xunge/DecIR huggingface dataset:
/* Type definitions */
struct ath_hal {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ath_hal_set_cck_weak_det(struct ath_hal *, int);
void ath_hal_enable_cck_weak_det(struct ath_hal *ah, int enable) {
  ath_hal_set_cck_weak_det(ah, enable ? 6 : 8);
}


x86 assembly (clang, -O0):
<ath_hal_enable_cck_weak_det>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%ecx
mov    $0x8,%esi
mov    $0x6,%eax
cmp    $0x0,%ecx
cmovne %eax,%esi
call   1030 <ath_hal_set_cck_weak_det@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ath_hal_enable_cck_weak_det>:
xor    %eax,%eax
test   %esi,%esi
sete   %al
lea    (%rax,%rax,1),%esi
add    $0x6,%esi
jmp    1030 <ath_hal_set_cck_weak_det@plt>

LLVM IR (-O0):
%struct.ath_hal = type { i32 }
define void @ath_hal_enable_cck_weak_det(%struct.ath_hal* %0, i32 %1) {
%3 = alloca %struct.ath_hal*
%4 = alloca i32
store %struct.ath_hal* %0, %struct.ath_hal** %3
store i32 %1, i32* %4
%5 = load %struct.ath_hal*, %struct.ath_hal** %3
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 6, i32 8
%10 = call i32 @ath_hal_set_cck_weak_det(%struct.ath_hal* %5, i32 %9)
ret void
}

LLVM IR (-O2):
%struct.ath_hal = type { i32 }
define void @ath_hal_enable_cck_weak_det(%struct.ath_hal* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = select i1 %3, i32 8, i32 6
%5 = tail call i32 @ath_hal_set_cck_weak_det(%struct.ath_hal* %0, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, uintptr_t);
scalar_t__ sbrk(int /*<<< orphan*/);
bool brk_command(void) {
  printf("brk: 0x%08lx\n", (uintptr_t)sbrk(0));
  return true;
}


x86 assembly (clang, -O0):
<brk_command>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1040 <sbrk@plt>
mov    %rax,%rsi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<brk_command>:
push   %rax
xor    %edi,%edi
call   1040 <sbrk@plt>
lea    0xed1(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"brk: 0x%08lx\0A\00"
define i32 @brk_command() {
%1 = call i64 @sbrk(i32 0)
%2 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i64 %1)
ret i32 1
}

LLVM IR (-O2):
@.str = [14 x i8] c"brk: 0x%08lx\0A\00"
define i32 @brk_command() {
%1 = tail call i64 @sbrk(i32 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i64 %1)
ret i32 1
}
void DX_PAL_LogLevelSet(int setLevel) {}


x86 assembly (clang, -O0):
<DX_PAL_LogLevelSet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<DX_PAL_LogLevelSet>:
ret

LLVM IR (-O0):
define void @DX_PAL_LogLevelSet(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret void
}

LLVM IR (-O2):
define void @DX_PAL_LogLevelSet(i32 %0) {
ret void
}
/* Type definitions */
struct group {
  int dummy;
};

/* Variables and functions */
int getgrent_r(struct group *__restrict __resultbuf, char *__restrict __buffer,
               size_t __buflen, struct group **__restrict __result) {
  return 0;
}


x86 assembly (clang, -O0):
<getgrent_r>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getgrent_r>:
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.group = type { i32 }
define i32 @getgrent_r(%struct.group* noalias %0, i8* noalias %1, i64 %2, %struct.group** noalias %3) {
%5 = alloca %struct.group*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca %struct.group**
store %struct.group* %0, %struct.group** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store %struct.group** %3, %struct.group*** %8
ret i32 0
}

LLVM IR (-O2):
%struct.group = type { i32 }
define i32 @getgrent_r(%struct.group* noalias nocapture readnone %0, i8* noalias nocapture readnone %1, i64 %2, %struct.group** noalias nocapture readnone %3) {
ret i32 0
}
/* Type definitions */
struct timer_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct timer_t *);
void timer_free(struct timer_t *tmr) { free(tmr); }


x86 assembly (clang, -O0):
<timer_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.timer_t = type { i32 }
define void @timer_free(%struct.timer_t* %0) {
%2 = alloca %struct.timer_t*
store %struct.timer_t* %0, %struct.timer_t** %2
%3 = load %struct.timer_t*, %struct.timer_t** %2
%4 = call i32 @free(%struct.timer_t* %3)
ret void
}

LLVM IR (-O2):
%struct.timer_t = type { i32 }
define void @timer_free(%struct.timer_t* nocapture %0) {
%2 = tail call i32 @free(%struct.timer_t* %0)
ret void
}
void tinf_init() {}


x86 assembly (clang, -O0):
<tinf_init>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tinf_init>:
ret

LLVM IR (-O0):
define void @tinf_init() {
ret void
}

LLVM IR (-O2):
define void @tinf_init() {
ret void
}
/* Variables and functions */
int mvprintw(int, int, char const *, long);
int l_mvprintw(int y, int x, const char *fmt, long i) {
  return (mvprintw(y, x, fmt, i));
}


x86 assembly (clang, -O0):
<l_mvprintw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
call   1030 <mvprintw@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<l_mvprintw>:
jmp    1030 <mvprintw@plt>

LLVM IR (-O0):
define i32 @l_mvprintw(i32 %0, i32 %1, i8* %2, i64 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i64
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load i8*, i8** %7
%12 = load i64, i64* %8
%13 = call i32 @mvprintw(i32 %9, i32 %10, i8* %11, i64 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @l_mvprintw(i32 %0, i32 %1, i8* %2, i64 %3) {
%5 = tail call i32 @mvprintw(i32 %0, i32 %1, i8* %2, i64 %3)
ret i32 %5
}
void cvmx_ipd_disable(void) {}


x86 assembly (clang, -O0):
<cvmx_ipd_disable>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cvmx_ipd_disable>:
ret

LLVM IR (-O0):
define void @cvmx_ipd_disable() {
ret void
}

LLVM IR (-O2):
define void @cvmx_ipd_disable() {
ret void
}
void VMR3PowerOff(void) {}


x86 assembly (clang, -O0):
<VMR3PowerOff>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VMR3PowerOff>:
ret

LLVM IR (-O0):
define void @VMR3PowerOff() {
ret void
}

LLVM IR (-O2):
define void @VMR3PowerOff() {
ret void
}
/* Variables and functions */
int execv(char const *, char *const *);
int _execv(const char *path, char *const *argv) { return execv(path, argv); }


x86 assembly (clang, -O0):
<_execv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <execv@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_execv>:
jmp    1030 <execv@plt>

LLVM IR (-O0):
define i32 @_execv(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
store i8* %0, i8** %3
store i8** %1, i8*** %4
%5 = load i8*, i8** %3
%6 = load i8**, i8*** %4
%7 = call i32 @execv(i8* %5, i8** %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @_execv(i8* %0, i8** %1) {
%3 = tail call i32 @execv(i8* %0, i8** %1)
ret i32 %3
}
/* Variables and functions */
int rand();
int random_in_interval(int low, int high) {
  int size = high - low;
  return (rand() % size) + low;
}


x86 assembly (clang, -O0):
<random_in_interval>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cltd
idivl  -0xc(%rbp)
mov    %edx,%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_in_interval>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
sub    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @random_in_interval(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
store i32 %8, i32* %5
%9 = call i32 (...) @rand()
%10 = load i32, i32* %5
%11 = srem i32 %9, %10
%12 = load i32, i32* %3
%13 = add nsw i32 %11, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @random_in_interval(i32 %0, i32 %1) {
%3 = sub nsw i32 %1, %0
%4 = tail call i32 (...) @rand()
%5 = srem i32 %4, %3
%6 = add nsw i32 %5, %0
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ processarLinha();
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int quantidadeDeCasos, i;
  scanf("%d", &quantidadeDeCasos);
  for (i = 0; i < quantidadeDeCasos; i++) {
    processarLinha();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <scanf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1167 <main+0x47>
mov    $0x0,%al
call   1040 <processarLinha@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1146 <main+0x26>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1030 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
jle    1150 <main+0x30>
xor    %ebx,%ebx
nop
xor    %eax,%eax
call   1040 <processarLinha@plt>
add    $0x1,%ebx
cmp    0xc(%rsp),%ebx
jl     1140 <main+0x20>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
store i32 0, i32* %3
br label %5
5: ; preds = %11, %0
%6 = load i32, i32* %3
%7 = load i32, i32* %2
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %14
9: ; preds = %5
%10 = call i32 (...) @processarLinha()
br label %11
11: ; preds = %9
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
store i32 %13, i32* %3
br label %5
14: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %0, %6
%7 = phi i32 [ %9, %6 ], [ 0, %0 ]
%8 = call i32 (...) @processarLinha()
%9 = add nuw nsw i32 %7, 1
%10 = load i32, i32* %1
%11 = icmp slt i32 %9, %10
br i1 %11, label %6, label %12
12: ; preds = %6, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ lseek(int, int, int /*<<< orphan*/);
int read(int, unsigned char *, int);
int read_data(int f, unsigned char *buff, int len) {
  lseek(f, 0xb000, SEEK_SET);
  return read(f, buff, len);
}


x86 assembly (clang, -O0):
<read_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ea4(%rip),%rax
mov    (%rax),%edx
mov    $0xb000,%esi
call   1030 <lseek@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <read@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_data>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2ead(%rip),%rax
mov    (%rax),%edx
mov    $0xb000,%esi
call   1030 <lseek@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <read@plt>

LLVM IR (-O0):
@SEEK_SET = global i32 0
define i32 @read_data(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* @SEEK_SET
%9 = call i32 @lseek(i32 %7, i32 45056, i32 %8)
%10 = load i32, i32* %4
%11 = load i8*, i8** %5
%12 = load i32, i32* %6
%13 = call i32 @read(i32 %10, i8* %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define i32 @read_data(i32 %0, i8* nocapture %1, i32 %2) {
%4 = load i32, i32* @SEEK_SET
%5 = tail call i32 @lseek(i32 %0, i32 45056, i32 %4)
%6 = tail call i32 @read(i32 %0, i8* %1, i32 %2)
ret i32 %6
}
double pathcon_nm10_twice(double x) { return x + x; }


x86 assembly (clang, -O0):
<pathcon_nm10_twice>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<pathcon_nm10_twice>:
addsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @pathcon_nm10_twice(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fadd double %3, %4
ret double %5
}

LLVM IR (-O2):
define double @pathcon_nm10_twice(double %0) {
%2 = fadd double %0, %0
ret double %2
}
/* Type definitions */
typedef double clock_t;

/* Variables and functions */
double CLOCKS_PER_SEC;
scalar_t__ clock();
int /*<<< orphan*/ printf(char *, double);
void print_time(clock_t start, size_t flag) {
  if (flag)
    printf("Took: %f sec\n", ((double)clock() - start) / CLOCKS_PER_SEC);
}


x86 assembly (clang, -O0):
<print_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1164 <print_time+0x44>
mov    $0x0,%al
call   1030 <clock@plt>
cvtsi2sd %rax,%xmm0
subsd  -0x8(%rbp),%xmm0
mov    0x2e94(%rip),%rax
divsd  (%rax),%xmm0
lea    0xea1(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_time>:
test   %rdi,%rdi
je     1157 <print_time+0x37>
push   %rax
xor    %eax,%eax
movsd  %xmm0,(%rsp)
call   1030 <clock@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
subsd  (%rsp),%xmm0
mov    0x2ea2(%rip),%rax
divsd  (%rax),%xmm0
lea    0xeaf(%rip),%rdi
pop    %rax
jmp    1040 <printf@plt>
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Took: %f sec\0A\00"
@CLOCKS_PER_SEC = global double 0.000000e+00
define void @print_time(double %0, i64 %1) {
%3 = alloca double
%4 = alloca i64
store double %0, double* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %15
7: ; preds = %2
%8 = call i64 (...) @clock()
%9 = sitofp i64 %8 to double
%10 = load double, double* %3
%11 = fsub double %9, %10
%12 = load double, double* @CLOCKS_PER_SEC
%13 = fdiv double %11, %12
%14 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), double %13)
br label %15
15: ; preds = %7, %2
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"Took: %f sec\0A\00"
@CLOCKS_PER_SEC = global double 0.000000e+00
define void @print_time(double %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %11, label %4
4: ; preds = %2
%5 = tail call i64 (...) @clock()
%6 = sitofp i64 %5 to double
%7 = fsub double %6, %0
%8 = load double, double* @CLOCKS_PER_SEC
%9 = fdiv double %7, %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), double %9)
br label %11
11: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ xsi_register_didat(char *, char *);
extern void work_a_1956806361_3212880686_init() {
  xsi_register_didat(
      "work_a_1956806361_3212880686",
      "isim/tb_round_isim_beh.exe.sim/work/a_1956806361_3212880686.didat");
}


x86 assembly (clang, -O0):
<work_a_1956806361_3212880686_init>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xefb(%rip),%rsi
call   1030 <xsi_register_didat@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<work_a_1956806361_3212880686_init>:
lea    0xee9(%rip),%rdi
lea    0xeff(%rip),%rsi
jmp    1030 <xsi_register_didat@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"work_a_1956806361_3212880686\00"
@.str.1 = [66 x i8] c"isim/tb_round_isim_beh.exe.sim/work/a_1956806361_3212880686.didat\00"
define void @work_a_1956806361_3212880686_init() {
%1 = call i32 @xsi_register_didat(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"work_a_1956806361_3212880686\00"
@.str.1 = [66 x i8] c"isim/tb_round_isim_beh.exe.sim/work/a_1956806361_3212880686.didat\00"
define void @work_a_1956806361_3212880686_init() {
%1 = tail call i32 @xsi_register_didat(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
void putc(char c) {}


x86 assembly (clang, -O0):
<putc>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<putc>:
ret

LLVM IR (-O0):
define void @putc(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
ret void
}

LLVM IR (-O2):
define void @putc(i8 signext %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int shift_index(int arg) {
  if (arg == 2)
    return 1;
  if (arg == 4)
    return 2;
  if (arg == 8)
    return 3;
  assert(0);
}


x86 assembly (clang, -O0):
<shift_index>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    1131 <shift_index+0x21>
movl   $0x1,-0x4(%rbp)
jmp    1164 <shift_index+0x54>
cmpl   $0x4,-0x8(%rbp)
jne    1147 <shift_index+0x37>
movl   $0x2,-0x4(%rbp)
jmp    1164 <shift_index+0x54>
cmpl   $0x8,-0x8(%rbp)
jne    115d <shift_index+0x4d>
movl   $0x3,-0x4(%rbp)
jmp    1164 <shift_index+0x54>
xor    %edi,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shift_index>:
cmp    $0x2,%edi
je     1125 <shift_index+0x15>
cmp    $0x8,%edi
je     112b <shift_index+0x1b>
cmp    $0x4,%edi
jne    1131 <shift_index+0x21>
mov    $0x2,%eax
ret
mov    $0x1,%eax
ret
mov    $0x3,%eax
ret
push   %rax
xor    %edi,%edi
call   1030 <assert@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @shift_index(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 2
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 1, i32* %2
br label %17
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 4
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 2, i32* %2
br label %17
11: ; preds = %7
%12 = load i32, i32* %3
%13 = icmp eq i32 %12, 8
br i1 %13, label %14, label %15
14: ; preds = %11
store i32 3, i32* %2
br label %17
15: ; preds = %11
%16 = call i32 @assert(i32 0)
br label %17
17: ; preds = %15, %14, %10, %6
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @shift_index(i32 %0) {
switch i32 %0, label %4 [
i32 2, label %6
i32 4, label %2
i32 8, label %3
]
2: ; preds = %1
br label %6
3: ; preds = %1
br label %6
4: ; preds = %1
%5 = tail call i32 @assert(i32 0)
br label %6
6: ; preds = %1, %4, %3, %2
%7 = phi i32 [ 2, %2 ], [ 3, %3 ], [ undef, %4 ], [ 1, %1 ]
ret i32 %7
}
void UI_process(void) {}


x86 assembly (clang, -O0):
<UI_process>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UI_process>:
ret

LLVM IR (-O0):
define void @UI_process() {
ret void
}

LLVM IR (-O2):
define void @UI_process() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
char *strrchr(char *, char);
void construct_output_filename(char *outname, char *inname) {
  char *ptr;
  strcpy(outname, inname);
  ptr = strrchr(outname, '.');
  if (ptr)
    strcpy(ptr, ".mif");
  else
    strcat(outname, ".mif");
}


x86 assembly (clang, -O0):
<construct_output_filename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rdi
mov    $0x2e,%esi
call   1040 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     117f <construct_output_filename+0x4f>
mov    -0x18(%rbp),%rdi
lea    0xe8b(%rip),%rsi
call   1030 <strcpy@plt>
jmp    118f <construct_output_filename+0x5f>
mov    -0x8(%rbp),%rdi
lea    0xe76(%rip),%rsi
call   1050 <strcat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<construct_output_filename>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    $0x2e,%esi
call   1040 <strrchr@plt>
lea    0xeb3(%rip),%rsi
test   %rax,%rax
je     115b <construct_output_filename+0x2b>
mov    %rax,%rdi
pop    %rbx
jmp    1030 <strcpy@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <strcat@plt>

LLVM IR (-O0):
@.str = [5 x i8] c".mif\00"
define void @construct_output_filename(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32 @strcpy(i8* %6, i8* %7)
%9 = load i8*, i8** %3
%10 = call i8* @strrchr(i8* %9, i8 signext 46)
store i8* %10, i8** %5
%11 = load i8*, i8** %5
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %16
13: ; preds = %2
%14 = load i8*, i8** %5
%15 = call i32 @strcpy(i8* %14, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %19
16: ; preds = %2
%17 = load i8*, i8** %3
%18 = call i32 @strcat(i8* %17, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %19
19: ; preds = %16, %13
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c".mif\00"
define void @construct_output_filename(i8* %0, i8* %1) {
%3 = tail call i32 @strcpy(i8* %0, i8* %1)
%4 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 46)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %10
8: ; preds = %2
%9 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %6
ret void
}
const char *socket_simgen_name() { return "Socket"; }


x86 assembly (clang, -O0):
<socket_simgen_name>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<socket_simgen_name>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [7 x i8] c"Socket\00"
define i8* @socket_simgen_name() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [7 x i8] c"Socket\00"
define i8* @socket_simgen_name() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
typedef int /*<<< orphan*/ Visual;
struct TYPE_2__ {
  int /*<<< orphan*/ *visuals;
};
typedef TYPE_1__ Depth;

/* Variables and functions */
void set_Depth_visuals(void *_p, void *_v) {
  ((Depth *)_p)->visuals = (Visual *)_v;
}


x86 assembly (clang, -O0):
<set_Depth_visuals>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_Depth_visuals>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32* }
define void @set_Depth_visuals(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = bitcast i8* %5 to i32*
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to %struct.TYPE_2__*
%9 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %8, i32 0, i32 0
store i32* %6, i32** %9
ret void
}

LLVM IR (-O2):
define void @set_Depth_visuals(i8* nocapture writeonly %0, i8* %1) {
%3 = bitcast i8* %0 to i8**
store i8* %1, i8** %3
ret void
}
XSetWindowColormap() {}


x86 assembly (clang, -O0):
<XSetWindowColormap>:
push   %rbp
mov    %rsp,%rbp
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<XSetWindowColormap>:
ret

LLVM IR (-O0):
define i32 @XSetWindowColormap() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @XSetWindowColormap() {
ret i32 undef
}
/* Variables and functions */
int rand();
int rollDice() { return rand() % 6 + 1; }


x86 assembly (clang, -O0):
<rollDice>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x6,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rollDice>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x2aaaaaab,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,2),%ecx
neg    %ecx
add    %ecx,%eax
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @rollDice() {
%1 = call i32 (...) @rand()
%2 = srem i32 %1, 6
%3 = add nsw i32 %2, 1
ret i32 %3
}

LLVM IR (-O2):
define i32 @rollDice() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 6
%3 = add nsw i32 %2, 1
ret i32 %3
}
R0R1(r0, r1, x0, x1, p0, p1) signed char r0, r1;
signed char *p0, *p1;
{
  if (r0 <= r1)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<R0R1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %dil,%sil
mov    %sil,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
movsbl -0x5(%rbp),%eax
movsbl -0x6(%rbp),%ecx
cmp    %ecx,%eax
jg     113a <R0R1+0x3a>
movl   $0x1,-0x4(%rbp)
jmp    1141 <R0R1+0x41>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<R0R1>:
shl    $0x18,%edi
shl    $0x18,%esi
xor    %eax,%eax
cmp    %esi,%edi
setle  %al
ret

LLVM IR (-O0):
define i32 @R0R1(i32 %0, i32 %1, i32 %2, i32 %3, i8* %4, i8* %5) {
%7 = alloca i32
%8 = alloca i8
%9 = alloca i8
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i8*
%14 = trunc i32 %0 to i8
%15 = trunc i32 %1 to i8
store i8 %14, i8* %8
store i8 %15, i8* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i8* %4, i8** %12
store i8* %5, i8** %13
%16 = load i8, i8* %8
%17 = sext i8 %16 to i32
%18 = load i8, i8* %9
%19 = sext i8 %18 to i32
%20 = icmp sle i32 %17, %19
br i1 %20, label %21, label %22
21: ; preds = %6
store i32 1, i32* %7
br label %23
22: ; preds = %6
store i32 0, i32* %7
br label %23
23: ; preds = %22, %21
%24 = load i32, i32* %7
ret i32 %24
}

LLVM IR (-O2):
define i32 @R0R1(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture readnone %4, i8* nocapture readnone %5) {
%7 = shl i32 %0, 24
%8 = shl i32 %1, 24
%9 = icmp sle i32 %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}
struct s3c24x0_clock_power *s3c24x0_get_base_clock_power(void) {
  return (struct s3c24x0_clock_power *)0x14800000;
}


x86 assembly (clang, -O0):
<s3c24x0_get_base_clock_power>:
push   %rbp
mov    %rsp,%rbp
mov    $0x14800000,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<s3c24x0_get_base_clock_power>:
mov    $0x14800000,%eax
ret

LLVM IR (-O0):
%struct.s3c24x0_clock_power = type opaque
define %struct.s3c24x0_clock_power* @s3c24x0_get_base_clock_power() {
ret %struct.s3c24x0_clock_power* inttoptr (i64 343932928 to %struct.s3c24x0_clock_power*)
}

LLVM IR (-O2):
%struct.s3c24x0_clock_power = type opaque
define %struct.s3c24x0_clock_power* @s3c24x0_get_base_clock_power() {
ret %struct.s3c24x0_clock_power* inttoptr (i64 343932928 to %struct.s3c24x0_clock_power*)
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int first_byte_is_valid(uint8_t first_byte) {
  switch (first_byte) {
  case 0x60:
  case 0xE9:
  case 0xEB:
    return (1);
  default:
    break;
  }
  return (0);
}


x86 assembly (clang, -O0):
<first_byte_is_valid>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x60,%eax
je     1141 <first_byte_is_valid+0x41>
jmp    111b <first_byte_is_valid+0x1b>
mov    -0xc(%rbp),%eax
sub    $0xe9,%eax
je     1141 <first_byte_is_valid+0x41>
jmp    112e <first_byte_is_valid+0x2e>
mov    -0xc(%rbp),%eax
sub    $0xeb,%eax
jne    114d <first_byte_is_valid+0x4d>
jmp    1141 <first_byte_is_valid+0x41>
movl   $0x1,-0x4(%rbp)
jmp    1159 <first_byte_is_valid+0x59>
jmp    1152 <first_byte_is_valid+0x52>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<first_byte_is_valid>:
mov    $0x1,%eax
cmp    $0x60,%edi
je     111c <first_byte_is_valid+0x1c>
cmp    $0xe9,%edi
je     111c <first_byte_is_valid+0x1c>
cmp    $0xeb,%edi
je     111c <first_byte_is_valid+0x1c>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @first_byte_is_valid(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 96, label %5
i32 233, label %5
i32 235, label %5
]
5: ; preds = %1, %1, %1
store i32 1, i32* %2
br label %8
6: ; preds = %1
br label %7
7: ; preds = %6
store i32 0, i32* %2
br label %8
8: ; preds = %7, %5
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @first_byte_is_valid(i32 %0) {
switch i32 %0, label %2 [
i32 96, label %3
i32 233, label %3
i32 235, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
void printplayer(player) int player;
{
  switch (player) {
  case 0:
    (void)printf("I ");
    break;
  case 1:
    (void)printf("You ");
    break;
  }
}


x86 assembly (clang, -O0):
<printplayer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
test   %eax,%eax
je     113f <printplayer+0x2f>
jmp    112e <printplayer+0x1e>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
je     1152 <printplayer+0x42>
jmp    1160 <printplayer+0x50>
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1160 <printplayer+0x50>
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printplayer>:
test   %edi,%edi
je     1127 <printplayer+0x17>
cmp    $0x1,%edi
jne    1135 <printplayer+0x25>
lea    0xee3(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xed2(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
ret

LLVM IR (-O0):
@.str = [3 x i8] c"I \00"
@.str.1 = [5 x i8] c"You \00"
define void @printplayer(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %8 [
i32 0, label %4
i32 1, label %6
]
4: ; preds = %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %8
6: ; preds = %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %1, %6, %4
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"I \00"
@.str.1 = [5 x i8] c"You \00"
define void @printplayer(i32 %0) {
switch i32 %0, label %6 [
i32 0, label %3
i32 1, label %2
]
2: ; preds = %1
br label %3
3: ; preds = %1, %2
%4 = phi i8* [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %1 ]
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %4)
br label %6
6: ; preds = %3, %1
ret void
}
/* Variables and functions */
double pop();
int /*<<< orphan*/ push(double);
void swap_top_two(void) {
  double tmp1, tmp2;
  tmp1 = pop();
  tmp2 = pop();
  push(tmp1);
  push(tmp2);
}


x86 assembly (clang, -O0):
<swap_top_two>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <pop@plt>
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <pop@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <push@plt>
movsd  -0x10(%rbp),%xmm0
call   1040 <push@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_top_two>:
sub    $0x18,%rsp
xor    %eax,%eax
call   1030 <pop@plt>
movsd  %xmm0,0x10(%rsp)
xor    %eax,%eax
call   1030 <pop@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1040 <push@plt>
movsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
jmp    1040 <push@plt>

LLVM IR (-O0):
define void @swap_top_two() {
%1 = alloca double
%2 = alloca double
%3 = call double (...) @pop()
store double %3, double* %1
%4 = call double (...) @pop()
store double %4, double* %2
%5 = load double, double* %1
%6 = call i32 @push(double %5)
%7 = load double, double* %2
%8 = call i32 @push(double %7)
ret void
}

LLVM IR (-O2):
define void @swap_top_two() {
%1 = tail call double (...) @pop()
%2 = tail call double (...) @pop()
%3 = tail call i32 @push(double %1)
%4 = tail call i32 @push(double %2)
ret void
}
int file2mem(int numWds, int src, int *dst, int do_interrupt) {
  int ctrl, int_req;
  volatile int *IO = (int *)(0x3c000000 + 13 * 0x00000020);
  int_req = (do_interrupt ? 0x40000000 : 0);
  ctrl = 0x80000000 | (numWds & 0x03ff) | int_req;
  *(IO + 0) = ctrl;
  *(IO + 2) = src & 0x01;
  *(IO + 3) = (int)dst;
  return ctrl;
}


x86 assembly (clang, -O0):
<file2mem>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    $0x3c0001a0,%eax
mov    %rax,-0x28(%rbp)
mov    -0x14(%rbp),%edx
xor    %eax,%eax
mov    $0x40000000,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x4(%rbp),%eax
and    $0x3ff,%eax
or     $0x80000000,%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%ecx
and    $0x1,%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x10(%rbp),%rax
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,0xc(%rax)
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<file2mem>:
xor    %eax,%eax
test   %ecx,%ecx
setne  %al
shl    $0x1e,%eax
and    $0x3ff,%edi
add    %edi,%eax
add    $0x80000000,%eax
mov    %eax,0x3c0001a0
and    $0x1,%esi
mov    %esi,0x3c0001a8
mov    %edx,0x3c0001ac
ret

LLVM IR (-O0):
define i32 @file2mem(i32 %0, i32 %1, i32* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32 %3, i32* %8
store i32* inttoptr (i64 1006633376 to i32*), i32** %11
%12 = load i32, i32* %8
%13 = icmp ne i32 %12, 0
%14 = zext i1 %13 to i64
%15 = select i1 %13, i32 1073741824, i32 0
store i32 %15, i32* %10
%16 = load i32, i32* %5
%17 = and i32 %16, 1023
%18 = or i32 -2147483648, %17
%19 = load i32, i32* %10
%20 = or i32 %18, %19
store i32 %20, i32* %9
%21 = load i32, i32* %9
%22 = load i32*, i32** %11
%23 = getelementptr inbounds i32, i32* %22, i64 0
store volatile i32 %21, i32* %23
%24 = load i32, i32* %6
%25 = and i32 %24, 1
%26 = load i32*, i32** %11
%27 = getelementptr inbounds i32, i32* %26, i64 2
store volatile i32 %25, i32* %27
%28 = load i32*, i32** %7
%29 = ptrtoint i32* %28 to i32
%30 = load i32*, i32** %11
%31 = getelementptr inbounds i32, i32* %30, i64 3
store volatile i32 %29, i32* %31
%32 = load i32, i32* %9
ret i32 %32
}

LLVM IR (-O2):
define i32 @file2mem(i32 %0, i32 %1, i32* %2, i32 %3) {
%5 = icmp eq i32 %3, 0
%6 = select i1 %5, i32 0, i32 1073741824
%7 = and i32 %0, 1023
%8 = or i32 %7, %6
%9 = or i32 %8, -2147483648
store volatile i32 %9, i32* inttoptr (i64 1006633376 to i32*)
%10 = and i32 %1, 1
store volatile i32 %10, i32* inttoptr (i64 1006633384 to i32*)
%11 = ptrtoint i32* %2 to i64
%12 = trunc i64 %11 to i32
store volatile i32 %12, i32* inttoptr (i64 1006633388 to i32*)
ret i32 %9
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ write_int32(int);
void write_int64(uint64_t i) {
  uint32_t lo, hi;
  lo = i >> 0;
  hi = i >> 32;
  write_int32(lo);
  write_int32(hi);
}


x86 assembly (clang, -O0):
<write_int64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x0,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <write_int32@plt>
mov    -0xc(%rbp),%edi
call   1030 <write_int32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_int64>:
push   %rax
call   1030 <write_int32@plt>
pop    %rax
jmp    1030 <write_int32@plt>

LLVM IR (-O0):
define void @write_int64(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = ashr i32 %5, 0
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = ashr i32 %7, 32
store i32 %8, i32* %4
%9 = load i32, i32* %3
%10 = call i32 @write_int32(i32 %9)
%11 = load i32, i32* %4
%12 = call i32 @write_int32(i32 %11)
ret void
}

LLVM IR (-O2):
define void @write_int64(i32 %0) {
%2 = tail call i32 @write_int32(i32 %0)
%3 = tail call i32 @write_int32(i32 poison)
ret void
}
/* Type definitions */
struct PdSocket {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ IPPROTO_TCP;
int /*<<< orphan*/ TCP_QUICKACK;
int pd_socket_int_option(struct PdSocket *, int /*<<< orphan*/,
                         int /*<<< orphan*/, int);
int pd_socket_tcp_quickack(struct PdSocket *sock, int on) {
  return pd_socket_int_option(sock, IPPROTO_TCP, TCP_QUICKACK, on);
}


x86 assembly (clang, -O0):
<pd_socket_tcp_quickack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ebe(%rip),%rax
mov    (%rax),%esi
mov    0x2ead(%rip),%rax
mov    (%rax),%edx
mov    -0xc(%rbp),%ecx
call   1030 <pd_socket_int_option@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pd_socket_tcp_quickack>:
mov    %esi,%ecx
mov    0x2ecf(%rip),%rax
mov    (%rax),%esi
mov    0x2ebe(%rip),%rax
mov    (%rax),%edx
jmp    1030 <pd_socket_int_option@plt>

LLVM IR (-O0):
%struct.PdSocket = type { i32 }
@IPPROTO_TCP = global i32 0
@TCP_QUICKACK = global i32 0
define i32 @pd_socket_tcp_quickack(%struct.PdSocket* %0, i32 %1) {
%3 = alloca %struct.PdSocket*
%4 = alloca i32
store %struct.PdSocket* %0, %struct.PdSocket** %3
store i32 %1, i32* %4
%5 = load %struct.PdSocket*, %struct.PdSocket** %3
%6 = load i32, i32* @IPPROTO_TCP
%7 = load i32, i32* @TCP_QUICKACK
%8 = load i32, i32* %4
%9 = call i32 @pd_socket_int_option(%struct.PdSocket* %5, i32 %6, i32 %7, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.PdSocket = type { i32 }
@IPPROTO_TCP = global i32 0
@TCP_QUICKACK = global i32 0
define i32 @pd_socket_tcp_quickack(%struct.PdSocket* %0, i32 %1) {
%3 = load i32, i32* @IPPROTO_TCP
%4 = load i32, i32* @TCP_QUICKACK
%5 = tail call i32 @pd_socket_int_option(%struct.PdSocket* %0, i32 %3, i32 %4, i32 %1)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void die(char *func) {
  perror(func);
  exit(1);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rax
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @die(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @die(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void h_tr_end(void) { fputs("</tr>\n", stdout); }


x86 assembly (clang, -O0):
<h_tr_end>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<h_tr_end>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
lea    0xee0(%rip),%rdi
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"</tr>\0A\00"
@stdout = global i32 0
define void @h_tr_end() {
%1 = load i32, i32* @stdout
%2 = call i32 @fputs(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"</tr>\0A\00"
@stdout = global i32 0
define void @h_tr_end() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
void gtk_toggle_action_toggled() {}


x86 assembly (clang, -O0):
<gtk_toggle_action_toggled>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gtk_toggle_action_toggled>:
ret

LLVM IR (-O0):
define void @gtk_toggle_action_toggled() {
ret void
}

LLVM IR (-O2):
define void @gtk_toggle_action_toggled() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
#define AF_INET6 128
int /*<<< orphan*/ EAFNOSUPPORT;
int /*<<< orphan*/ errno;
char const *vinet_ntop6w(void const *, char *, int /*<<< orphan*/);
const char *vinet_ntop6(int af, const void *__restrict src,
                        char *__restrict dst, socklen_t size) {
  switch (af) {
  case AF_INET6:
    return (vinet_ntop6w(src, dst, size));
  default:
    errno = EAFNOSUPPORT;
    return (NULL);
  }
}


x86 assembly (clang, -O0):
<vinet_ntop6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x80,%eax
jne    1152 <vinet_ntop6+0x42>
jmp    1139 <vinet_ntop6+0x29>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x24(%rbp),%edx
call   1030 <vinet_ntop6w@plt>
mov    %rax,-0x8(%rbp)
jmp    116c <vinet_ntop6+0x5c>
mov    0x2e7f(%rip),%rax
mov    (%rax),%ecx
mov    0x2e7e(%rip),%rax
mov    %ecx,(%rax)
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vinet_ntop6>:
cmp    $0x80,%edi
jne    1125 <vinet_ntop6+0x15>
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %ecx,%edx
jmp    1030 <vinet_ntop6w@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%eax
mov    0x2eab(%rip),%rcx
mov    %eax,(%rcx)
xor    %eax,%eax
ret

LLVM IR (-O0):
@EAFNOSUPPORT = global i32 0
@errno = global i32 0
define i8* @vinet_ntop6(i32 %0, i8* noalias %1, i8* noalias %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
store i32 %0, i32* %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i32 %3, i32* %9
%10 = load i32, i32* %6
switch i32 %10, label %16 [
i32 128, label %11
]
11: ; preds = %4
%12 = load i8*, i8** %7
%13 = load i8*, i8** %8
%14 = load i32, i32* %9
%15 = call i8* @vinet_ntop6w(i8* %12, i8* %13, i32 %14)
store i8* %15, i8** %5
br label %18
16: ; preds = %4
%17 = load i32, i32* @EAFNOSUPPORT
store i32 %17, i32* @errno
store i8* null, i8** %5
br label %18
18: ; preds = %16, %11
%19 = load i8*, i8** %5
ret i8* %19
}

LLVM IR (-O2):
@EAFNOSUPPORT = global i32 0
@errno = global i32 0
define i8* @vinet_ntop6(i32 %0, i8* noalias %1, i8* noalias %2, i32 %3) {
%5 = icmp eq i32 %0, 128
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = tail call i8* @vinet_ntop6w(i8* %1, i8* %2, i32 %3)
br label %10
8: ; preds = %4
%9 = load i32, i32* @EAFNOSUPPORT
store i32 %9, i32* @errno
br label %10
10: ; preds = %8, %6
%11 = phi i8* [ %7, %6 ], [ null, %8 ]
ret i8* %11
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ header();
int /*<<< orphan*/ txt_ctrd(char *);
void nul_scr() {
  header();
  txt_ctrd("Equality ! Better luck next time !\n");
  txt_ctrd("Press a key to quit...\n");
  getchar();
}


x86 assembly (clang, -O0):
<nul_scr>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <header@plt>
lea    0xebe(%rip),%rdi
call   1050 <txt_ctrd@plt>
lea    0xed6(%rip),%rdi
call   1050 <txt_ctrd@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<nul_scr>:
push   %rax
xor    %eax,%eax
call   1030 <header@plt>
lea    0xec1(%rip),%rdi
call   1050 <txt_ctrd@plt>
lea    0xed9(%rip),%rdi
call   1050 <txt_ctrd@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <getchar@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"Equality ! Better luck next time !\0A\00"
@.str.1 = [24 x i8] c"Press a key to quit...\0A\00"
define void @nul_scr() {
%1 = call i32 (...) @header()
%2 = call i32 @txt_ctrd(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @txt_ctrd(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 (...) @getchar()
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"Equality ! Better luck next time !\0A\00"
@.str.1 = [24 x i8] c"Press a key to quit...\0A\00"
define void @nul_scr() {
%1 = tail call i32 (...) @header()
%2 = tail call i32 @txt_ctrd(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @txt_ctrd(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 (...) @getchar()
ret void
}
int new_printf() { return 1; }


x86 assembly (clang, -O0):
<new_printf>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<new_printf>:
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @new_printf() {
ret i32 1
}

LLVM IR (-O2):
define i32 @new_printf() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ GL_COLOR_MATERIAL;
int /*<<< orphan*/ GL_LIGHTING;
int /*<<< orphan*/ glDisable(int /*<<< orphan*/);
int /*<<< orphan*/ glEnable(int /*<<< orphan*/);
void lfunc(void) {
  static int state = 1;
  if (state ^= 1)
    glEnable(GL_LIGHTING);
  else
    glDisable(GL_LIGHTING);
  glEnable(GL_COLOR_MATERIAL);
}


x86 assembly (clang, -O0):
<lfunc>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f06(%rip),%eax
xor    $0x1,%eax
mov    %eax,0x2efd(%rip)
cmp    $0x0,%eax
je     114f <lfunc+0x2f>
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
call   1030 <glEnable@plt>
jmp    115d <lfunc+0x3d>
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
call   1040 <glDisable@plt>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
call   1030 <glEnable@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<lfunc>:
push   %rax
xorl   $0x1,0x2f08(%rip)
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
je     113a <lfunc+0x1a>
call   1030 <glEnable@plt>
jmp    113f <lfunc+0x1f>
call   1040 <glDisable@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1030 <glEnable@plt>

LLVM IR (-O0):
@lfunc.state = internal global i32 1
@GL_LIGHTING = global i32 0
@GL_COLOR_MATERIAL = global i32 0
define void @lfunc() {
%1 = load i32, i32* @lfunc.state
%2 = xor i32 %1, 1
store i32 %2, i32* @lfunc.state
%3 = icmp ne i32 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = load i32, i32* @GL_LIGHTING
%6 = call i32 @glEnable(i32 %5)
br label %10
7: ; preds = %0
%8 = load i32, i32* @GL_LIGHTING
%9 = call i32 @glDisable(i32 %8)
br label %10
10: ; preds = %7, %4
%11 = load i32, i32* @GL_COLOR_MATERIAL
%12 = call i32 @glEnable(i32 %11)
ret void
}

LLVM IR (-O2):
@lfunc.state = internal unnamed_addr global i32 1
@GL_LIGHTING = global i32 0
@GL_COLOR_MATERIAL = global i32 0
define void @lfunc() {
%1 = load i32, i32* @lfunc.state
%2 = xor i32 %1, 1
store i32 %2, i32* @lfunc.state
%3 = icmp eq i32 %2, 0
%4 = load i32, i32* @GL_LIGHTING
br i1 %3, label %7, label %5
5: ; preds = %0
%6 = tail call i32 @glEnable(i32 %4)
br label %9
7: ; preds = %0
%8 = tail call i32 @glDisable(i32 %4)
br label %9
9: ; preds = %7, %5
%10 = load i32, i32* @GL_COLOR_MATERIAL
%11 = tail call i32 @glEnable(i32 %10)
ret void
}