#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
struct eeprom_table {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ on_and_tv_to_pc_procedure(int, struct eeprom_table *, int);
int /*<<< orphan*/ pc_to_tv_procedure(int, struct eeprom_table *);
int /*<<< orphan*/ printf(char *);
void third_stage(int device_fd, struct eeprom_table *new_e2prom_tab_p,
                 int dump_mode) {
  printf("\nStage-3: \"panel_data_dump_mode\" enabled. one-to-mul keys...\n");
  printf("ON PROCEDURE\n");
  on_and_tv_to_pc_procedure(device_fd, new_e2prom_tab_p, 1);
  printf("TV_to_PC PROCEDURE\n");
  on_and_tv_to_pc_procedure(device_fd, new_e2prom_tab_p, 0);
  printf("PC_to_TV PROCEDURE\n");
  pc_to_tv_procedure(device_fd, new_e2prom_tab_p);
}


x86 assembly (clang, -O0):
<third_stage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    0xeb7(%rip),%rdi
call   1040 <printf@plt>
lea    0xee9(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x1,%edx
call   1050 <on_and_tv_to_pc_procedure@plt>
lea    0xeda(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
xor    %edx,%edx
call   1050 <on_and_tv_to_pc_procedure@plt>
lea    0xed4(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <pc_to_tv_procedure@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<third_stage>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xec1(%rip),%rdi
call   1040 <puts@plt>
lea    0xef2(%rip),%rdi
call   1040 <puts@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1050 <on_and_tv_to_pc_procedure@plt>
lea    0xee4(%rip),%rdi
call   1040 <puts@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
xor    %edx,%edx
call   1050 <on_and_tv_to_pc_procedure@plt>
lea    0xedf(%rip),%rdi
call   1040 <puts@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <pc_to_tv_procedure@plt>

LLVM IR (-O0):
%struct.eeprom_table = type { i32 }
@.str = [62 x i8] c"\0AStage-3: \22panel_data_dump_mode\22 enabled. one-to-mul keys...\0A\00"
@.str.1 = [14 x i8] c"ON PROCEDURE\0A\00"
@.str.2 = [20 x i8] c"TV_to_PC PROCEDURE\0A\00"
@.str.3 = [20 x i8] c"PC_to_TV PROCEDURE\0A\00"
define void @third_stage(i32 %0, %struct.eeprom_table* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.eeprom_table*
%6 = alloca i32
store i32 %0, i32* %4
store %struct.eeprom_table* %1, %struct.eeprom_table** %5
store i32 %2, i32* %6
%7 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%9 = load i32, i32* %4
%10 = load %struct.eeprom_table*, %struct.eeprom_table** %5
%11 = call i32 @on_and_tv_to_pc_procedure(i32 %9, %struct.eeprom_table* %10, i32 1)
%12 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%13 = load i32, i32* %4
%14 = load %struct.eeprom_table*, %struct.eeprom_table** %5
%15 = call i32 @on_and_tv_to_pc_procedure(i32 %13, %struct.eeprom_table* %14, i32 0)
%16 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
%17 = load i32, i32* %4
%18 = load %struct.eeprom_table*, %struct.eeprom_table** %5
%19 = call i32 @pc_to_tv_procedure(i32 %17, %struct.eeprom_table* %18)
ret void
}

LLVM IR (-O2):
%struct.eeprom_table = type { i32 }
@str = [61 x i8] c"\0AStage-3: \22panel_data_dump_mode\22 enabled. one-to-mul keys...\00"
@str.4 = [13 x i8] c"ON PROCEDURE\00"
@str.5 = [19 x i8] c"TV_to_PC PROCEDURE\00"
@str.6 = [19 x i8] c"PC_to_TV PROCEDURE\00"
define void @third_stage(i32 %0, %struct.eeprom_table* %1, i32 %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.4, i64 0, i64 0))
%6 = tail call i32 @on_and_tv_to_pc_procedure(i32 %0, %struct.eeprom_table* %1, i32 1)
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.5, i64 0, i64 0))
%8 = tail call i32 @on_and_tv_to_pc_procedure(i32 %0, %struct.eeprom_table* %1, i32 0)
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.6, i64 0, i64 0))
%10 = tail call i32 @pc_to_tv_procedure(i32 %0, %struct.eeprom_table* %1)
ret void
}