xunge/DecIR huggingface dataset:
char *some_complex_operation(int input_num) {
  if (input_num < 0) {
    return "That's a negative number";
  } else if (input_num > 100) {
    return "That's a pretty big number";
  } else {
    return "That's a number between 0 and 100!";
  }
}


x86 assembly (clang, -O0):
<some_complex_operation>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1121 <some_complex_operation+0x21>
lea    0xee8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1146 <some_complex_operation+0x46>
cmpl   $0x64,-0xc(%rbp)
jle    113b <some_complex_operation+0x3b>
lea    0xee7(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1146 <some_complex_operation+0x46>
lea    0xef2(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<some_complex_operation>:
cmp    $0x65,%edi
lea    0xf0f(%rip),%rax
lea    0xf23(%rip),%rcx
cmovge %rax,%rcx
test   %edi,%edi
lea    0xee2(%rip),%rax
cmovns %rcx,%rax
ret

LLVM IR (-O0):
@.str = [25 x i8] c"That's a negative number\00"
@.str.1 = [27 x i8] c"That's a pretty big number\00"
@.str.2 = [35 x i8] c"That's a number between 0 and 100!\00"
define i8* @some_complex_operation(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8** %2
br label %12
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp sgt i32 %8, 100
br i1 %9, label %10, label %11
10: ; preds = %7
store i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %12
11: ; preds = %7
store i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %12
12: ; preds = %11, %10, %6
%13 = load i8*, i8** %2
ret i8* %13
}

LLVM IR (-O2):
@.str = [25 x i8] c"That's a negative number\00"
@.str.1 = [27 x i8] c"That's a pretty big number\00"
@.str.2 = [35 x i8] c"That's a number between 0 and 100!\00"
define i8* @some_complex_operation(i32 %0) {
%2 = icmp slt i32 %0, 0
%3 = icmp sgt i32 %0, 100
%4 = select i1 %3, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0)
%5 = select i1 %2, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %4
ret i8* %5
}
void SteamGameServer_RunCallbacks(void) {}


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

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

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

LLVM IR (-O2):
define void @SteamGameServer_RunCallbacks() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CL_GetPingInfo(int, char *, int);
void LAN_GetPingInfo(int n, char *buf, int buflen) {
  CL_GetPingInfo(n, buf, buflen);
}


x86 assembly (clang, -O0):
<LAN_GetPingInfo>:
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    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <CL_GetPingInfo@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LAN_GetPingInfo>:
jmp    1030 <CL_GetPingInfo@plt>

LLVM IR (-O0):
define void @LAN_GetPingInfo(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 i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @CL_GetPingInfo(i32 %7, i8* %8, i32 %9)
ret void
}

LLVM IR (-O2):
define void @LAN_GetPingInfo(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @CL_GetPingInfo(i32 %0, i8* %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int shmdt(void const *);
int dt_shm(const void *shmaddr) {
  int ret;
  ret = shmdt(shmaddr);
  if (ret == -1)
    perror("shmdt()");
  return ret;
}


x86 assembly (clang, -O0):
<dt_shm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <shmdt@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    114e <dt_shm+0x2e>
lea    0xeb7(%rip),%rdi
call   1040 <perror@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dt_shm>:
push   %rbx
call   1030 <shmdt@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
je     1131 <dt_shm+0x11>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xec8(%rip),%rdi
call   1040 <perror@plt>
jmp    112d <dt_shm+0xd>

LLVM IR (-O0):
@.str = [8 x i8] c"shmdt()\00"
define i32 @dt_shm(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @shmdt(i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
@.str = [8 x i8] c"shmdt()\00"
define i32 @dt_shm(i8* %0) {
%2 = tail call i32 @shmdt(i8* %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i32 %2
}
/* Variables and functions */
float CLOCKS_PER_SEC;
scalar_t__ clock();
int /*<<< orphan*/ printf(char *, float);
float stop_clock(float startTime) {
  float endTime = (float)clock() / CLOCKS_PER_SEC;
  float elapsed = endTime - startTime;
  printf("Time elapsed: %fs\n", elapsed);
  return elapsed;
}


x86 assembly (clang, -O0):
<stop_clock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <clock@plt>
cvtsi2ss %rax,%xmm0
mov    0x2ea8(%rip),%rax
divss  (%rax),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
subss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
lea    0xe9c(%rip),%rdi
call   1040 <printf@plt>
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stop_clock>:
push   %rax
movss  %xmm0,0x4(%rsp)
xor    %eax,%eax
call   1030 <clock@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
mov    0x2eab(%rip),%rax
divss  (%rax),%xmm0
subss  0x4(%rsp),%xmm0
movss  %xmm0,0x4(%rsp)
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
movss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@CLOCKS_PER_SEC = global float 0.000000e+00
@.str = [19 x i8] c"Time elapsed: %fs\0A\00"
define float @stop_clock(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
store float %0, float* %2
%5 = call i64 (...) @clock()
%6 = sitofp i64 %5 to float
%7 = load float, float* @CLOCKS_PER_SEC
%8 = fdiv float %6, %7
store float %8, float* %3
%9 = load float, float* %3
%10 = load float, float* %2
%11 = fsub float %9, %10
store float %11, float* %4
%12 = load float, float* %4
%13 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), float %12)
%14 = load float, float* %4
ret float %14
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global float 0.000000e+00
@.str = [19 x i8] c"Time elapsed: %fs\0A\00"
define float @stop_clock(float %0) {
%2 = tail call i64 (...) @clock()
%3 = sitofp i64 %2 to float
%4 = load float, float* @CLOCKS_PER_SEC
%5 = fdiv float %3, %4
%6 = fsub float %5, %0
%7 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), float %6)
ret float %6
}
void evt_closelog(void) {}


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

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

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

LLVM IR (-O2):
define void @evt_closelog() {
ret void
}
int wkup_m3_fw_version_read(void) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @wkup_m3_fw_version_read() {
ret i32 -1
}
/* Variables and functions */
void ri_parallel_send(void *src, size_t size, int dest, int tag) {
  (void)src;
  (void)size;
  (void)dest;
  (void)tag;
}


x86 assembly (clang, -O0):
<ri_parallel_send>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @ri_parallel_send(i8* nocapture %0, i64 %1, i32 %2, i32 %3) {
ret void
}
double wf(double lambda, double D_LR, double D_LU, double D_LD, double D_RU,
          double D_RD, double D_DU) {
  double weight;
  weight = 0.5 * (lambda * (D_LU + D_RD) + (1 - lambda) * (D_LD + D_RU) -
                  (D_LR + D_DU));
  return (weight);
}


x86 assembly (clang, -O0):
<wf>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  %xmm6,-0x38(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
addsd  -0x30(%rbp),%xmm2
movsd  0xeca(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm3
addsd  -0x28(%rbp),%xmm3
mulsd  %xmm3,%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
addsd  -0x38(%rbp),%xmm0
subsd  %xmm0,%xmm1
movsd  0xe91(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<wf>:
addsd  %xmm5,%xmm2
movsd  0xef4(%rip),%xmm5
subsd  %xmm0,%xmm5
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm5
mulsd  %xmm2,%xmm0
addsd  %xmm5,%xmm0
addsd  %xmm6,%xmm1
subsd  %xmm1,%xmm0
mulsd  0xed8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @wf(double %0, double %1, double %2, double %3, double %4, double %5, double %6) {
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
store double %0, double* %8
store double %1, double* %9
store double %2, double* %10
store double %3, double* %11
store double %4, double* %12
store double %5, double* %13
store double %6, double* %14
%16 = load double, double* %8
%17 = load double, double* %10
%18 = load double, double* %13
%19 = fadd double %17, %18
%20 = load double, double* %8
%21 = fsub double 1.000000e+00, %20
%22 = load double, double* %11
%23 = load double, double* %12
%24 = fadd double %22, %23
%25 = fmul double %21, %24
%26 = call double @llvm.fmuladd.f64(double %16, double %19, double %25)
%27 = load double, double* %9
%28 = load double, double* %14
%29 = fadd double %27, %28
%30 = fsub double %26, %29
%31 = fmul double 5.000000e-01, %30
store double %31, double* %15
%32 = load double, double* %15
ret double %32
}

LLVM IR (-O2):
define double @wf(double %0, double %1, double %2, double %3, double %4, double %5, double %6) {
%8 = fadd double %2, %5
%9 = fsub double 1.000000e+00, %0
%10 = fadd double %3, %4
%11 = fmul double %9, %10
%12 = tail call double @llvm.fmuladd.f64(double %0, double %8, double %11)
%13 = fadd double %1, %6
%14 = fsub double %12, %13
%15 = fmul double %14, 5.000000e-01
ret double %15
}
/* Variables and functions */
int foo(int, int, int, int, int, int, int);
int main(void) { return foo(1, 2, 3, 4, 5, 6, 0xFF000000u); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
mov    $0x5,%r8d
mov    $0x6,%r9d
movl   $0xff000000,(%rsp)
call   1030 <foo@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0xff000000,(%rsp)
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
mov    $0x5,%r8d
mov    $0x6,%r9d
call   1030 <foo@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @foo(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 -16777216)
ret i32 %2
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 -16777216)
ret i32 %1
}
void RTFileDelete(void) {}


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

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

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

LLVM IR (-O2):
define void @RTFileDelete() {
ret void
}
/* Variables and functions */
int labs(int);
int adirompare(const void *n1, const void *n2) {
  return (labs(*((int *)n1)) - labs(*((int *)n2)));
}


x86 assembly (clang, -O0):
<adirompare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <labs@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1030 <labs@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
sub    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<adirompare>:
mov    (%rdi),%eax
mov    %eax,%ecx
neg    %ecx
cmovs  %eax,%ecx
mov    (%rsi),%edx
mov    %edx,%eax
neg    %eax
cmovns %edx,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @adirompare(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 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = call i32 @labs(i32 %7)
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
%11 = load i32, i32* %10
%12 = call i32 @labs(i32 %11)
%13 = sub nsw i32 %8, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @adirompare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = tail call i32 @llvm.abs.i32(i32 %4, i1 true)
%6 = bitcast i8* %1 to i32*
%7 = load i32, i32* %6
%8 = tail call i32 @llvm.abs.i32(i32 %7, i1 true)
%9 = sub nsw i32 %5, %8
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
void ftab_to(FILE *f, int n) {
  for (; n > -15; n--) {
    fputc(' ', f);
  };
}


x86 assembly (clang, -O0):
<ftab_to>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0xfffffff1,-0xc(%rbp)
jle    1145 <ftab_to+0x35>
mov    -0x8(%rbp),%rsi
mov    $0x20,%edi
call   1030 <fputc@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    111f <ftab_to+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ftab_to>:
push   %r14
push   %rbx
push   %rax
cmp    $0xfffffff2,%esi
jl     1145 <ftab_to+0x35>
mov    %esi,%ebx
mov    %rdi,%r14
add    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x20,%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
add    $0xffffffff,%ebx
cmp    $0xfffffff2,%ebx
jg     1130 <ftab_to+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @ftab_to(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
br label %5
5: ; preds = %11, %2
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, -15
br i1 %7, label %8, label %14
8: ; preds = %5
%9 = load i32*, i32** %3
%10 = call i32 @fputc(i8 signext 32, i32* %9)
br label %11
11: ; preds = %8
%12 = load i32, i32* %4
%13 = add nsw i32 %12, -1
store i32 %13, i32* %4
br label %5
14: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @ftab_to(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, -15
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = tail call i32 @fputc(i8 signext 32, i32* %0)
%7 = add nsw i32 %5, -1
%8 = icmp sgt i32 %5, -14
br i1 %8, label %4, label %9
9: ; preds = %4, %2
ret void
}
/* Type definitions */
struct vm_area_struct {
  int dummy;
};
struct page {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void const *, unsigned long);
__attribute__((always_)) void copy_to_user_page(struct vm_area_struct *vma,
                                                struct page *page,
                                                unsigned long vaddr, void *dst,
                                                const void *src,
                                                unsigned long len) {
  memcpy(dst, src, len);
}


x86 assembly (clang, -O0):
<copy_to_user_page>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdx
call   1030 <memcpy@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_to_user_page>:
mov    %r9,%rdx
mov    %r8,%rsi
mov    %rcx,%rdi
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
%struct.vm_area_struct = type { i32 }
%struct.page = type { i32 }
define void @copy_to_user_page(%struct.vm_area_struct* %0, %struct.page* %1, i64 %2, i8* %3, i8* %4, i64 %5) {
%7 = alloca %struct.vm_area_struct*
%8 = alloca %struct.page*
%9 = alloca i64
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i64
store %struct.vm_area_struct* %0, %struct.vm_area_struct** %7
store %struct.page* %1, %struct.page** %8
store i64 %2, i64* %9
store i8* %3, i8** %10
store i8* %4, i8** %11
store i64 %5, i64* %12
%13 = load i8*, i8** %10
%14 = load i8*, i8** %11
%15 = load i64, i64* %12
%16 = call i32 @memcpy(i8* %13, i8* %14, i64 %15)
ret void
}

LLVM IR (-O2):
%struct.vm_area_struct = type { i32 }
%struct.page = type { i32 }
define void @copy_to_user_page(%struct.vm_area_struct* nocapture readnone %0, %struct.page* nocapture readnone %1, i64 %2, i8* %3, i8* %4, i64 %5) {
%7 = tail call i32 @memcpy(i8* %3, i8* %4, i64 %5)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int /*<<< orphan*/ *display;
};
typedef TYPE_1__ XSelectionClearEvent;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
void set_XSelectionClearEvent_display(void *_p, void *_v) {
  ((XSelectionClearEvent *)_p)->display = (Display *)_v;
}


x86 assembly (clang, -O0):
<set_XSelectionClearEvent_display>:
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_XSelectionClearEvent_display>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32* }
define void @set_XSelectionClearEvent_display(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_XSelectionClearEvent_display(i8* nocapture writeonly %0, i8* %1) {
%3 = bitcast i8* %0 to i8**
store i8* %1, i8** %3
ret void
}
void createGroup() {}


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

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

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

LLVM IR (-O2):
define void @createGroup() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ flockfile(int /*<<< orphan*/);
int /*<<< orphan*/ funlockfile(int /*<<< orphan*/);
int getchar_unlocked();
int /*<<< orphan*/ stdin;
int getchar(void) {
  flockfile(stdin);
  int result = getchar_unlocked();
  funlockfile(stdin);
  return result;
}


x86 assembly (clang, -O0):
<getchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1050 <flockfile@plt>
mov    $0x0,%al
call   1040 <getchar_unlocked@plt>
mov    %eax,-0x4(%rbp)
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
call   1030 <funlockfile@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getchar>:
push   %r14
push   %rbx
push   %rax
mov    0x2ead(%rip),%r14
mov    (%r14),%edi
call   1050 <flockfile@plt>
xor    %eax,%eax
call   1040 <getchar_unlocked@plt>
mov    %eax,%ebx
mov    (%r14),%edi
call   1030 <funlockfile@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stdin = global i32 0
define i32 @getchar() {
%1 = alloca i32
%2 = load i32, i32* @stdin
%3 = call i32 @flockfile(i32 %2)
%4 = call i32 (...) @getchar_unlocked()
store i32 %4, i32* %1
%5 = load i32, i32* @stdin
%6 = call i32 @funlockfile(i32 %5)
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @getchar() {
%1 = load i32, i32* @stdin
%2 = tail call i32 @flockfile(i32 %1)
%3 = tail call i32 (...) @getchar_unlocked()
%4 = load i32, i32* @stdin
%5 = tail call i32 @funlockfile(i32 %4)
ret i32 %3
}
void initarray(double *A, int n) {
  for (int i = 0; i < n; i++)
    A[i] = 0.0;
}


x86 assembly (clang, -O0):
<initarray>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113c <initarray+0x3c>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <initarray+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initarray>:
test   %esi,%esi
jle    1126 <initarray+0x16>
push   %rax
mov    %esi,%edx
shl    $0x3,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @initarray(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
%5 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %15, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %18
10: ; preds = %6
%11 = load double*, double** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds double, double* %11, i64 %13
store double 0.000000e+00, double* %14
br label %15
15: ; preds = %10
%16 = load i32, i32* %5
%17 = add nsw i32 %16, 1
store i32 %17, i32* %5
br label %6
18: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @initarray(double* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = bitcast double* %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 3
br label %8
8: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int x[2];
  *x = 1;
  *(x + 1) = 2;
  assert(*x == 1);
  assert(*(x + 1) == 2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x2,-0x8(%rbp)
cmpl   $0x1,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x2,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x i32]
store i32 0, i32* %1
%3 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
store i32 1, i32* %3
%4 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%5 = getelementptr inbounds i32, i32* %4, i64 1
store i32 2, i32* %5
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, 1
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%12 = getelementptr inbounds i32, i32* %11, i64 1
%13 = load i32, i32* %12
%14 = icmp eq i32 %13, 2
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
%2 = tail call i32 @assert(i32 1)
ret i32 0
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMR8A_get(void) { return U_WMRCORENONE_get("U_WMR8A"); }


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

x86 assembly (clang, -O2):
<U_WMR8A_get>:
lea    0xee9(%rip),%rdi
jmp    1030 <U_WMRCORENONE_get@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMR8A\00"
define i32 @U_WMR8A_get() {
%1 = call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR8A\00"
define i32 @U_WMR8A_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
int bla(int n) {
  int i = 0;
  while (n >= 45) {
    i++;
    n -= 45;
  }
  return i;
}


x86 assembly (clang, -O0):
<bla>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x2d,-0x4(%rbp)
jl     112f <bla+0x2f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x2d,%eax
mov    %eax,-0x4(%rbp)
jmp    110e <bla+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bla>:
xor    %eax,%eax
cmp    $0x2d,%edi
jl     1130 <bla+0x30>
cmp    $0x59,%edi
mov    $0x59,%eax
cmovl  %edi,%eax
neg    %eax
add    %edi,%eax
add    $0x2c,%eax
imul   $0x6c16c16d,%rax,%rcx
shr    $0x20,%rcx
sub    %ecx,%eax
shr    %eax
add    %ecx,%eax
shr    $0x5,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @bla(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %7, %1
%5 = load i32, i32* %2
%6 = icmp sge i32 %5, 45
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 1
store i32 %9, i32* %3
%10 = load i32, i32* %2
%11 = sub nsw i32 %10, 45
store i32 %11, i32* %2
br label %4
12: ; preds = %4
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @bla(i32 %0) {
%2 = icmp sgt i32 %0, 44
br i1 %2, label %3, label %9
3: ; preds = %1
%4 = add nuw i32 %0, 44
%5 = call i32 @llvm.smin.i32(i32 %0, i32 89)
%6 = sub nuw i32 %4, %5
%7 = udiv i32 %6, 45
%8 = add nuw nsw i32 %7, 1
br label %9
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ kputc(char const, int);
void kprint(const char *str) {
  unsigned int i = 0;
  while (str[i] != '\0')
    kputc(str[i++], 0x07);
}


x86 assembly (clang, -O0):
<kprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     115b <kprint+0x4b>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
mov    %ecx,%ecx
mov    $0x7,%esi
movsbl (%rax,%rcx,1),%edi
call   1030 <kputc@plt>
jmp    1123 <kprint+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kprint>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     114a <kprint+0x3a>
mov    %rdi,%rbx
mov    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %al,%edi
mov    $0x7,%esi
call   1030 <kputc@plt>
mov    %ebp,%eax
movzbl (%rbx,%rax,1),%eax
add    $0x1,%ebp
test   %al,%al
jne    1130 <kprint+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @kprint(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %12, %1
%5 = load i8*, i8** %2
%6 = load i32, i32* %3
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %20
12: ; preds = %4
%13 = load i8*, i8** %2
%14 = load i32, i32* %3
%15 = add i32 %14, 1
store i32 %15, i32* %3
%16 = zext i32 %14 to i64
%17 = getelementptr inbounds i8, i8* %13, i64 %16
%18 = load i8, i8* %17
%19 = call i32 @kputc(i8 signext %18, i32 7)
br label %4
20: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @kprint(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %11, %4 ], [ %2, %1 ]
%6 = phi i32 [ %7, %4 ], [ 0, %1 ]
%7 = add i32 %6, 1
%8 = tail call i32 @kputc(i8 signext %5, i32 7)
%9 = zext i32 %7 to i64
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
ret void
}
void strCpy(char *dest, const char *src) {
  while ((*dest++ = *src++))
    ;
}


x86 assembly (clang, -O0):
<strCpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     113b <strCpy+0x3b>
jmp    110c <strCpy+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strCpy>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strCpy+0x10>
ret

LLVM IR (-O0):
define void @strCpy(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %12, %2
%6 = load i8*, i8** %4
%7 = getelementptr inbounds i8, i8* %6, i32 1
store i8* %7, i8** %4
%8 = load i8, i8* %6
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %3
store i8 %8, i8* %9
%11 = icmp ne i8 %8, 0
br i1 %11, label %12, label %13
12: ; preds = %5
br label %5
13: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @strCpy(i8* nocapture writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %8, %3 ]
%5 = phi i8* [ %1, %2 ], [ %6, %3 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %5
%8 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %7, i8* %4
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(char *, char *, char *);
void function_id(char *id) { write("csv-task.csv", "%s,", id); }


x86 assembly (clang, -O0):
<function_id>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    0xed9(%rip),%rdi
lea    0xedf(%rip),%rsi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<function_id>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xeec(%rip),%rsi
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"csv-task.csv\00"
@.str.1 = [4 x i8] c"%s,\00"
define void @function_id(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @write(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"csv-task.csv\00"
@.str.1 = [4 x i8] c"%s,\00"
define void @function_id(i8* %0) {
%2 = tail call i32 @write(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int delta;
};
typedef TYPE_1__ XwcTextItem;

/* Variables and functions */
void set_XwcTextItem_delta(void *_p, int _v) {
  ((XwcTextItem *)_p)->delta = (int)_v;
}


x86 assembly (clang, -O0):
<set_XwcTextItem_delta>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XwcTextItem_delta>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XwcTextItem_delta(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mypthread_exit();
scalar_t__ mypthread_getArg();
int /*<<< orphan*/ mypthread_sleep();
int /*<<< orphan*/ printf(char *, long);
void PrintHello(void *threadid) {
  long tid;
  tid = (long)mypthread_getArg();
  if (tid == 3)
    mypthread_sleep();
  printf("Hello World! It's me, thread #%ld! \n", tid);
  printf("Hello World! It's me, thread #%ld! \n", tid);
  mypthread_exit();
}


x86 assembly (clang, -O0):
<PrintHello>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1060 <mypthread_getArg@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x3,-0x10(%rbp)
jne    1169 <PrintHello+0x29>
mov    $0x0,%al
call   1040 <mypthread_sleep@plt>
mov    -0x10(%rbp),%rsi
lea    0xe8c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xe7c(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <mypthread_exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintHello>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1060 <mypthread_getArg@plt>
mov    %rax,%rbx
cmp    $0x3,%rax
jne    115b <PrintHello+0x1b>
xor    %eax,%eax
call   1040 <mypthread_sleep@plt>
lea    0xe9e(%rip),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <mypthread_exit@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"Hello World! It's me, thread #%ld! \0A\00"
define void @PrintHello(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = call i64 (...) @mypthread_getArg()
store i64 %4, i64* %3
%5 = load i64, i64* %3
%6 = icmp eq i64 %5, 3
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 (...) @mypthread_sleep()
br label %9
9: ; preds = %7, %1
%10 = load i64, i64* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i64 %10)
%12 = load i64, i64* %3
%13 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i64 %12)
%14 = call i32 (...) @mypthread_exit()
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"Hello World! It's me, thread #%ld! \0A\00"
define void @PrintHello(i8* nocapture readnone %0) {
%2 = tail call i64 (...) @mypthread_getArg()
%3 = icmp eq i64 %2, 3
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @mypthread_sleep()
br label %6
6: ; preds = %4, %1
%7 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i64 %2)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i64 %2)
%9 = tail call i32 (...) @mypthread_exit()
ret void
}
unsigned short int f14(unsigned short int x, unsigned long int y) {
  return (x << y) | (x >> (8 * sizeof(unsigned short) - y));
}


x86 assembly (clang, -O0):
<f14>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movzwl -0x2(%rbp),%eax
mov    -0x10(%rbp),%rcx
shl    %cl,%eax
movzwl -0x2(%rbp),%edx
mov    $0x10,%ecx
sub    -0x10(%rbp),%rcx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f14>:
mov    %rsi,%rcx
mov    %edi,%eax
rol    %cl,%ax
ret

LLVM IR (-O0):
define zeroext i16 @f14(i16 zeroext %0, i64 %1) {
%3 = alloca i16
%4 = alloca i64
store i16 %0, i16* %3
store i64 %1, i64* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = load i64, i64* %4
%8 = trunc i64 %7 to i32
%9 = shl i32 %6, %8
%10 = load i16, i16* %3
%11 = zext i16 %10 to i32
%12 = load i64, i64* %4
%13 = sub i64 16, %12
%14 = trunc i64 %13 to i32
%15 = ashr i32 %11, %14
%16 = or i32 %9, %15
%17 = trunc i32 %16 to i16
ret i16 %17
}

LLVM IR (-O2):
define zeroext i16 @f14(i16 zeroext %0, i64 %1) {
%3 = trunc i64 %1 to i16
%4 = tail call i16 @llvm.fshl.i16(i16 %0, i16 %0, i16 %3)
ret i16 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
scalar_t__ fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
int fwrite(void *, int, int, int /*<<< orphan*/ *);
int s_write(void *user, int offset, void *buf, int size) {
  FILE *f = user;
  if (fseek(f, offset, SEEK_SET) != 0)
    return 0;
  return fwrite(buf, 1, size, f);
}


x86 assembly (clang, -O0):
<s_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    0x2e94(%rip),%rax
mov    (%rax),%edx
call   1030 <fseek@plt>
cmp    $0x0,%rax
je     1169 <s_write+0x49>
movl   $0x0,-0x4(%rbp)
jmp    1181 <s_write+0x61>
mov    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%edx
mov    -0x30(%rbp),%rcx
mov    $0x1,%esi
call   1040 <fwrite@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_write>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%r14d
mov    %rdx,%rbp
mov    %rdi,%rbx
mov    0x2eac(%rip),%rax
mov    (%rax),%edx
call   1030 <fseek@plt>
test   %rax,%rax
je     1147 <s_write+0x27>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    %rbp,%rdi
mov    $0x1,%esi
mov    %r14d,%edx
mov    %rbx,%rcx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <fwrite@plt>

LLVM IR (-O0):
@SEEK_SET = global i32 0
define i32 @s_write(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32*
store i8* %0, i8** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i32 %3, i32* %9
%11 = load i8*, i8** %6
%12 = bitcast i8* %11 to i32*
store i32* %12, i32** %10
%13 = load i32*, i32** %10
%14 = load i32, i32* %7
%15 = load i32, i32* @SEEK_SET
%16 = call i64 @fseek(i32* %13, i32 %14, i32 %15)
%17 = icmp ne i64 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %4
store i32 0, i32* %5
br label %24
19: ; preds = %4
%20 = load i8*, i8** %8
%21 = load i32, i32* %9
%22 = load i32*, i32** %10
%23 = call i32 @fwrite(i8* %20, i32 1, i32 %21, i32* %22)
store i32 %23, i32* %5
br label %24
24: ; preds = %19, %18
%25 = load i32, i32* %5
ret i32 %25
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define i32 @s_write(i8* nocapture %0, i32 %1, i8* nocapture %2, i32 %3) {
%5 = bitcast i8* %0 to i32*
%6 = load i32, i32* @SEEK_SET
%7 = tail call i64 @fseek(i32* %5, i32 %1, i32 %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = tail call i32 @fwrite(i8* %2, i32 1, i32 %3, i32* %5)
br label %11
11: ; preds = %4, %9
%12 = phi i32 [ %10, %9 ], [ 0, %4 ]
ret i32 %12
}
unsigned char galois_mul2(unsigned char value) {
  if (value >> 7) {
    value = value << 1;
    return (value ^ 0x1b);
  } else {
    return value << 1;
  }
}


x86 assembly (clang, -O0):
<galois_mul2>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
sar    $0x7,%eax
cmp    $0x0,%eax
je     1133 <galois_mul2+0x33>
movzbl -0x2(%rbp),%eax
shl    $0x1,%eax
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
xor    $0x1b,%eax
mov    %al,-0x1(%rbp)
jmp    113d <galois_mul2+0x3d>
movzbl -0x2(%rbp),%eax
shl    $0x1,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<galois_mul2>:
lea    (%rdi,%rdi,1),%eax
movzbl %al,%ecx
xor    $0x1b,%al
test   %dil,%dil
movzbl %al,%eax
cmovns %ecx,%eax
ret

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

LLVM IR (-O2):
define zeroext i8 @galois_mul2(i8 zeroext %0) {
%2 = icmp sgt i8 %0, -1
%3 = shl i8 %0, 1
%4 = xor i8 %3, 27
%5 = select i1 %2, i8 %3, i8 %4
ret i8 %5
}
int tbss(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @tbss() {
ret i32 0
}

LLVM IR (-O2):
define i32 @tbss() {
ret i32 0
}
/* Variables and functions */
int sqFileShutdown();
int shutdownModule(void) { return sqFileShutdown(); }


x86 assembly (clang, -O0):
<shutdownModule>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <sqFileShutdown@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<shutdownModule>:
xor    %eax,%eax
jmp    1030 <sqFileShutdown@plt>

LLVM IR (-O0):
define i32 @shutdownModule() {
%1 = call i32 (...) @sqFileShutdown()
ret i32 %1
}

LLVM IR (-O2):
define i32 @shutdownModule() {
%1 = tail call i32 (...) @sqFileShutdown()
ret i32 %1
}
/* Variables and functions */
int stat_settings_file();
int /*<<< orphan*/ update_state(int);
void update_system_control(int current_state) {
  int new_code;
  new_code = stat_settings_file();
  if (new_code != current_state) {
    update_state(new_code);
  }
}


x86 assembly (clang, -O0):
<update_system_control>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <stat_settings_file@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
je     1149 <update_system_control+0x29>
mov    -0x8(%rbp),%edi
call   1030 <update_state@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<update_system_control>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <stat_settings_file@plt>
cmp    %ebx,%eax
jne    1130 <update_system_control+0x10>
pop    %rbx
ret
mov    %eax,%edi
pop    %rbx
jmp    1030 <update_state@plt>

LLVM IR (-O0):
define void @update_system_control(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 (...) @stat_settings_file()
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp ne i32 %5, %6
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i32, i32* %3
%10 = call i32 @update_state(i32 %9)
br label %11
11: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @update_system_control(i32 %0) {
%2 = tail call i32 (...) @stat_settings_file()
%3 = icmp eq i32 %2, %0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @update_state(i32 %2)
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int system(char *);
int fb_hShell(char *program) { return system(program); }


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

x86 assembly (clang, -O2):
<fb_hShell>:
jmp    1030 <system@plt>

LLVM IR (-O0):
define i32 @fb_hShell(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @system(i8* %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @fb_hShell(i8* nocapture %0) {
%2 = tail call i32 @system(i8* %0)
ret i32 %2
}
int cairo_code_draw_casFrame_get_height() { return 70; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_casFrame_get_height() {
ret i32 70
}

LLVM IR (-O2):
define i32 @cairo_code_draw_casFrame_get_height() {
ret i32 70
}
/* Variables and functions */
int aaip_local_attr_support(int);
int iso_local_attr_support(int flag) {
  int ret;
  ret = aaip_local_attr_support(flag & 255);
  return ret;
}


x86 assembly (clang, -O0):
<iso_local_attr_support>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
and    $0xff,%edi
call   1030 <aaip_local_attr_support@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iso_local_attr_support>:
movzbl %dil,%edi
jmp    1030 <aaip_local_attr_support@plt>

LLVM IR (-O0):
define i32 @iso_local_attr_support(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = and i32 %4, 255
%6 = call i32 @aaip_local_attr_support(i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @iso_local_attr_support(i32 %0) {
%2 = and i32 %0, 255
%3 = tail call i32 @aaip_local_attr_support(i32 %2)
ret i32 %3
}
void dead_test3(int *data) {
  int k = 0;
  int j = data[1];
  if (j) {
    k++;
    j = k + data[0] * j;
  } else
    k--;
  j = data[2];
  data[j] = 2;
  data[3] = k;
}


x86 assembly (clang, -O0):
<dead_test3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     1143 <dead_test3+0x43>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%ecx
imul   -0x10(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
jmp    114c <dead_test3+0x4c>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movl   $0x2,(%rax,%rcx,4)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<dead_test3>:
cmpl   $0x1,0x4(%rdi)
sbb    %eax,%eax
or     $0x1,%eax
movslq 0x8(%rdi),%rcx
movl   $0x2,(%rdi,%rcx,4)
mov    %eax,0xc(%rdi)
ret

LLVM IR (-O0):
define void @dead_test3(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 1
%7 = load i32, i32* %6
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %20
10: ; preds = %1
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
%13 = load i32, i32* %3
%14 = load i32*, i32** %2
%15 = getelementptr inbounds i32, i32* %14, i64 0
%16 = load i32, i32* %15
%17 = load i32, i32* %4
%18 = mul nsw i32 %16, %17
%19 = add nsw i32 %13, %18
store i32 %19, i32* %4
br label %23
20: ; preds = %1
%21 = load i32, i32* %3
%22 = add nsw i32 %21, -1
store i32 %22, i32* %3
br label %23
23: ; preds = %20, %10
%24 = load i32*, i32** %2
%25 = getelementptr inbounds i32, i32* %24, i64 2
%26 = load i32, i32* %25
store i32 %26, i32* %4
%27 = load i32*, i32** %2
%28 = load i32, i32* %4
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i32, i32* %27, i64 %29
store i32 2, i32* %30
%31 = load i32, i32* %3
%32 = load i32*, i32** %2
%33 = getelementptr inbounds i32, i32* %32, i64 3
store i32 %31, i32* %33
ret void
}

LLVM IR (-O2):
define void @dead_test3(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -1, i32 1
%6 = getelementptr inbounds i32, i32* %0, i64 2
%7 = load i32, i32* %6
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %0, i64 %8
store i32 2, i32* %9
%10 = getelementptr inbounds i32, i32* %0, i64 3
store i32 %5, i32* %10
ret void
}