xunge/DecIR huggingface dataset:
void dd_mul_pwr2(const double *a, double b, double *c) {
  c[0] = a[0] * b;
  c[1] = a[1] * b;
}


x86 assembly (clang, -O0):
<dd_mul_pwr2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mulsd  -0x10(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mulsd  -0x10(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<dd_mul_pwr2>:
movsd  (%rdi),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%rsi)
mulsd  0x8(%rdi),%xmm0
movsd  %xmm0,0x8(%rsi)
ret

LLVM IR (-O0):
define void @dd_mul_pwr2(double* %0, double %1, double* %2) {
%4 = alloca double*
%5 = alloca double
%6 = alloca double*
store double* %0, double** %4
store double %1, double* %5
store double* %2, double** %6
%7 = load double*, double** %4
%8 = getelementptr inbounds double, double* %7, i64 0
%9 = load double, double* %8
%10 = load double, double* %5
%11 = fmul double %9, %10
%12 = load double*, double** %6
%13 = getelementptr inbounds double, double* %12, i64 0
store double %11, double* %13
%14 = load double*, double** %4
%15 = getelementptr inbounds double, double* %14, i64 1
%16 = load double, double* %15
%17 = load double, double* %5
%18 = fmul double %16, %17
%19 = load double*, double** %6
%20 = getelementptr inbounds double, double* %19, i64 1
store double %18, double* %20
ret void
}

LLVM IR (-O2):
define void @dd_mul_pwr2(double* nocapture %0, double %1, double* nocapture writeonly %2) {
%4 = load double, double* %0
%5 = fmul double %4, %1
store double %5, double* %2
%6 = getelementptr inbounds double, double* %0, i64 1
%7 = load double, double* %6
%8 = fmul double %7, %1
%9 = getelementptr inbounds double, double* %2, i64 1
store double %8, double* %9
ret void
}
/* Variables and functions */
int f188(int *);
int f189(int *p) { return f188(p); }


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

x86 assembly (clang, -O2):
<f189>:
jmp    1030 <f188@plt>

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

LLVM IR (-O2):
define i32 @f189(i32* %0) {
%2 = tail call i32 @f188(i32* %0)
ret i32 %2
}
void avcodec_get_type() {}


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

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

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

LLVM IR (-O2):
define void @avcodec_get_type() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ log_f(char *);
void keyb_none_poll() { log_f("keyb:none: keyb_none_poll()\n"); }


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

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

LLVM IR (-O0):
@.str = [29 x i8] c"keyb:none: keyb_none_poll()\0A\00"
define void @keyb_none_poll() {
%1 = call i32 @log_f(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"keyb:none: keyb_none_poll()\0A\00"
define void @keyb_none_poll() {
%1 = tail call i32 @log_f(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int PAPI_stop(int, long long *);
void papif_stop(int *EventSet, long long *values, int *check) {
  *check = PAPI_stop(*EventSet, values);
}


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

x86 assembly (clang, -O2):
<papif_stop>:
push   %rbx
mov    %rdx,%rbx
mov    (%rdi),%edi
call   1030 <PAPI_stop@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @papif_stop(i32* nocapture %0, i64* %1, i32* nocapture writeonly %2) {
%4 = load i32, i32* %0
%5 = tail call i32 @PAPI_stop(i32 %4, i64* %1)
store i32 %5, i32* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cat(char *);
int /*<<< orphan*/ cat_fd(int /*<<< orphan*/);
int main(int argc, char **argv) {
  if (argc == 1)
    cat_fd(0);
  else {
    int i;
    for (i = 1; i < argc; i++)
      cat(argv[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    114c <main+0x2c>
xor    %edi,%edi
call   1030 <cat_fd@plt>
jmp    1183 <main+0x63>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    117e <main+0x5e>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <cat@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1153 <main+0x33>
jmp    1183 <main+0x63>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
cmp    $0x1,%edi
jne    1133 <main+0x13>
xor    %edi,%edi
call   1030 <cat_fd@plt>
jmp    1152 <main+0x32>
jle    1152 <main+0x32>
mov    %rsi,%r14
mov    %edi,%r15d
mov    $0x1,%ebx
mov    (%r14,%rbx,8),%rdi
call   1040 <cat@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @cat_fd(i32 0)
br label %27
11: ; preds = %2
store i32 1, i32* %6
br label %12
12: ; preds = %23, %11
%13 = load i32, i32* %6
%14 = load i32, i32* %4
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %26
16: ; preds = %12
%17 = load i8**, i8*** %5
%18 = load i32, i32* %6
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8*, i8** %17, i64 %19
%21 = load i8*, i8** %20
%22 = call i32 @cat(i8* %21)
br label %23
23: ; preds = %16
%24 = load i32, i32* %6
%25 = add nsw i32 %24, 1
store i32 %25, i32* %6
br label %12
26: ; preds = %12
br label %27
27: ; preds = %26, %9
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = icmp sgt i32 %0, 1
br i1 %5, label %6, label %17
6: ; preds = %4
%7 = zext i32 %0 to i64
br label %10
8: ; preds = %2
%9 = tail call i32 @cat_fd(i32 0)
br label %17
10: ; preds = %6, %10
%11 = phi i64 [ 1, %6 ], [ %15, %10 ]
%12 = getelementptr inbounds i8*, i8** %1, i64 %11
%13 = load i8*, i8** %12
%14 = tail call i32 @cat(i8* %13)
%15 = add nuw nsw i64 %11, 1
%16 = icmp eq i64 %15, %7
br i1 %16, label %17, label %10
17: ; preds = %10, %4, %8
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ xlFmtError(char *);
void mapseqdummy_restore(void) {
  xlFmtError("shouldn't happen -- mapdummy_restore");
}


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

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

LLVM IR (-O0):
@.str = [37 x i8] c"shouldn't happen -- mapdummy_restore\00"
define void @mapseqdummy_restore() {
%1 = call i32 @xlFmtError(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"shouldn't happen -- mapdummy_restore\00"
define void @mapseqdummy_restore() {
%1 = tail call i32 @xlFmtError(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
ret void
}
int fun145() { return 145; }


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

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

LLVM IR (-O0):
define i32 @fun145() {
ret i32 145
}

LLVM IR (-O2):
define i32 @fun145() {
ret i32 145
}
int *foo(int *a) {
  *a = 8;
  return a;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x8,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    %rdi,%rax
movl   $0x8,(%rdi)
ret

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

LLVM IR (-O2):
define i32* @foo(i32* returned writeonly %0) {
store i32 8, i32* %0
ret i32* %0
}
/* Variables and functions */
scalar_t__ jsU_isalpharune(int);
int isunicodeletter(int c) {
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || jsU_isalpharune(c);
}


x86 assembly (clang, -O0):
<isunicodeletter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x61,-0x4(%rbp)
jl     1134 <isunicodeletter+0x24>
mov    $0x1,%al
cmpl   $0x7a,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    115f <isunicodeletter+0x4f>
cmpl   $0x41,-0x4(%rbp)
jl     114d <isunicodeletter+0x3d>
mov    $0x1,%al
cmpl   $0x5a,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    115f <isunicodeletter+0x4f>
mov    -0x4(%rbp),%edi
call   1030 <jsU_isalpharune@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isunicodeletter>:
mov    %edi,%ecx
and    $0xffffffdf,%ecx
add    $0xffffffbf,%ecx
mov    $0x1,%eax
cmp    $0x1a,%ecx
jb     1137 <isunicodeletter+0x27>
push   %rax
call   1030 <jsU_isalpharune@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @isunicodeletter(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 97
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 122
br i1 %7, label %18, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp sge i32 %9, 65
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 90
br i1 %13, label %18, label %14
14: ; preds = %11, %8
%15 = load i32, i32* %2
%16 = call i64 @jsU_isalpharune(i32 %15)
%17 = icmp ne i64 %16, 0
br label %18
18: ; preds = %14, %11, %5
%19 = phi i1 [ true, %11 ], [ true, %5 ], [ %17, %14 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @isunicodeletter(i32 %0) {
%2 = and i32 %0, -33
%3 = add i32 %2, -65
%4 = icmp ult i32 %3, 26
br i1 %4, label %9, label %5
5: ; preds = %1
%6 = tail call i64 @jsU_isalpharune(i32 %0)
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %1, %5
%10 = phi i32 [ %8, %5 ], [ 1, %1 ]
ret i32 %10
}
float UTIL_angleDiff(float a1, float a2) {
  float delta = a1 - a2;
  if (a1 > a2) {
    if (delta >= 180)
      delta -= 360;
  } else {
    if (delta <= -180)
      delta += 360;
  }
  return delta;
}


x86 assembly (clang, -O0):
<UTIL_angleDiff>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    115d <UTIL_angleDiff+0x5d>
movss  -0xc(%rbp),%xmm0
movss  0xecf(%rip),%xmm1
ucomiss %xmm1,%xmm0
jb     1158 <UTIL_angleDiff+0x58>
movss  -0xc(%rbp),%xmm0
movss  0xeb5(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1186 <UTIL_angleDiff+0x86>
movss  0xe9b(%rip),%xmm0
ucomiss -0xc(%rbp),%xmm0
jb     1181 <UTIL_angleDiff+0x81>
movss  0xe8d(%rip),%xmm0
addss  -0xc(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1186 <UTIL_angleDiff+0x86>
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<UTIL_angleDiff>:
ucomiss %xmm1,%xmm0
subss  %xmm1,%xmm0
jbe    111b <UTIL_angleDiff+0x1b>
ucomiss 0xef8(%rip),%xmm0
jb     1130 <UTIL_angleDiff+0x30>
addss  0xef2(%rip),%xmm0
ret
movss  0xedd(%rip),%xmm1
ucomiss %xmm0,%xmm1
jb     1130 <UTIL_angleDiff+0x30>
addss  0xed4(%rip),%xmm0
ret

LLVM IR (-O0):
define float @UTIL_angleDiff(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %3
%7 = load float, float* %4
%8 = fsub float %6, %7
store float %8, float* %5
%9 = load float, float* %3
%10 = load float, float* %4
%11 = fcmp ogt float %9, %10
br i1 %11, label %12, label %19
12: ; preds = %2
%13 = load float, float* %5
%14 = fcmp oge float %13, 1.800000e+02
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = load float, float* %5
%17 = fsub float %16, 3.600000e+02
store float %17, float* %5
br label %18
18: ; preds = %15, %12
br label %26
19: ; preds = %2
%20 = load float, float* %5
%21 = fcmp ole float %20, -1.800000e+02
br i1 %21, label %22, label %25
22: ; preds = %19
%23 = load float, float* %5
%24 = fadd float %23, 3.600000e+02
store float %24, float* %5
br label %25
25: ; preds = %22, %19
br label %26
26: ; preds = %25, %18
%27 = load float, float* %5
ret float %27
}

LLVM IR (-O2):
define float @UTIL_angleDiff(float %0, float %1) {
%3 = fsub float %0, %1
%4 = fcmp ogt float %0, %1
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = fcmp ult float %3, 1.800000e+02
br i1 %6, label %13, label %7
7: ; preds = %5
%8 = fadd float %3, -3.600000e+02
br label %13
9: ; preds = %2
%10 = fcmp ugt float %3, -1.800000e+02
br i1 %10, label %13, label %11
11: ; preds = %9
%12 = fadd float %3, 3.600000e+02
br label %13
13: ; preds = %9, %11, %5, %7
%14 = phi float [ %8, %7 ], [ %3, %5 ], [ %12, %11 ], [ %3, %9 ]
ret float %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int sum;
  int x;
  x = 1;
  sum = 0;
  while (x <= 10) {
    sum += x;
    ++x;
  }
  printf("La somma e': %d\n", sum);
  printf("Il valore di x e': %d\n", x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0xc(%rbp)
jg     114e <main+0x3e>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <main+0x1d>
mov    -0x8(%rbp),%esi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x37,%esi
call   1030 <printf@plt>
lea    0xee8(%rip),%rdi
mov    $0xb,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"La somma e': %d\0A\00"
@.str.1 = [23 x i8] c"Il valore di x e': %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %3
store i32 0, i32* %2
br label %4
4: ; preds = %7, %0
%5 = load i32, i32* %3
%6 = icmp sle i32 %5, 10
br i1 %6, label %7, label %13
7: ; preds = %4
%8 = load i32, i32* %3
%9 = load i32, i32* %2
%10 = add nsw i32 %9, %8
store i32 %10, i32* %2
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %4
13: ; preds = %4
%14 = load i32, i32* %2
%15 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %14)
%16 = load i32, i32* %3
%17 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"La somma e': %d\0A\00"
@.str.1 = [23 x i8] c"Il valore di x e': %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 55)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 11)
ret i32 0
}
/* Type definitions */
struct cosmos_dl_hdl {
  int dummy;
};

/* Variables and functions */
void *cosmos_dlsym_vm(struct cosmos_dl_hdl *dlh, char *idlstr) { return NULL; }


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

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

LLVM IR (-O0):
%struct.cosmos_dl_hdl = type { i32 }
define i8* @cosmos_dlsym_vm(%struct.cosmos_dl_hdl* %0, i8* %1) {
%3 = alloca %struct.cosmos_dl_hdl*
%4 = alloca i8*
store %struct.cosmos_dl_hdl* %0, %struct.cosmos_dl_hdl** %3
store i8* %1, i8** %4
ret i8* null
}

LLVM IR (-O2):
%struct.cosmos_dl_hdl = type { i32 }
define noalias i8* @cosmos_dlsym_vm(%struct.cosmos_dl_hdl* nocapture readnone %0, i8* nocapture readnone %1) {
ret i8* null
}
void cacheex_free_hitcache(void) {}


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

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

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

LLVM IR (-O2):
define void @cacheex_free_hitcache() {
ret void
}
/* Type definitions */
struct bufferevent {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ event_loopbreak();
void pty_child_stdout_error(struct bufferevent *be, short what, void *arg) {
  event_loopbreak();
}


x86 assembly (clang, -O0):
<pty_child_stdout_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1030 <event_loopbreak@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.bufferevent = type { i32 }
define void @pty_child_stdout_error(%struct.bufferevent* %0, i16 signext %1, i8* %2) {
%4 = alloca %struct.bufferevent*
%5 = alloca i16
%6 = alloca i8*
store %struct.bufferevent* %0, %struct.bufferevent** %4
store i16 %1, i16* %5
store i8* %2, i8** %6
%7 = call i32 (...) @event_loopbreak()
ret void
}

LLVM IR (-O2):
%struct.bufferevent = type { i32 }
define void @pty_child_stdout_error(%struct.bufferevent* nocapture readnone %0, i16 signext %1, i8* nocapture readnone %2) {
%4 = tail call i32 (...) @event_loopbreak()
ret void
}
void ARGBMultiplyRow_SSE2() {}


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

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

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

LLVM IR (-O2):
define void @ARGBMultiplyRow_SSE2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ VIM_SIF_I2cWriteByte(unsigned char, unsigned char);
void SensorSetReg_HV7131RP(unsigned char uAddr, unsigned short uVal) {
  VIM_SIF_I2cWriteByte((unsigned char)uAddr, (unsigned char)uVal);
}


x86 assembly (clang, -O0):
<SensorSetReg_HV7131RP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x1(%rbp),%cl
mov    -0x4(%rbp),%ax
movzbl %cl,%edi
movzbl %al,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SensorSetReg_HV7131RP>:
movzbl %sil,%esi
jmp    1030 <VIM_SIF_I2cWriteByte@plt>

LLVM IR (-O0):
define void @SensorSetReg_HV7131RP(i8 zeroext %0, i16 zeroext %1) {
%3 = alloca i8
%4 = alloca i16
store i8 %0, i8* %3
store i16 %1, i16* %4
%5 = load i8, i8* %3
%6 = load i16, i16* %4
%7 = trunc i16 %6 to i8
%8 = call i32 @VIM_SIF_I2cWriteByte(i8 zeroext %5, i8 zeroext %7)
ret void
}

LLVM IR (-O2):
define void @SensorSetReg_HV7131RP(i8 zeroext %0, i16 zeroext %1) {
%3 = trunc i16 %1 to i8
%4 = tail call i32 @VIM_SIF_I2cWriteByte(i8 zeroext %0, i8 zeroext %3)
ret void
}
long get_steps() { return 0; }


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

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

LLVM IR (-O0):
define i64 @get_steps() {
ret i64 0
}

LLVM IR (-O2):
define i64 @get_steps() {
ret i64 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ detail;
};
typedef TYPE_1__ XEnterWindowEvent;

/* Variables and functions */
int get_XEnterWindowEvent_detail(void *_p) {
  return (int)((XEnterWindowEvent *)_p)->detail;
}


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

x86 assembly (clang, -O2):
<get_XEnterWindowEvent_detail>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @get_XEnterWindowEvent_detail(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
scalar_t__ fabs(double);
int /*<<< orphan*/ link_failure_fabs();
void test_fabs(double d) {
  if (fabs(d) != fabs(d))
    link_failure_fabs();
}


x86 assembly (clang, -O0):
<test_fabs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <fabs@plt>
mov    %rax,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <fabs@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     115c <test_fabs+0x3c>
mov    $0x0,%al
call   1030 <link_failure_fabs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_fabs>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
call   1040 <fabs@plt>
mov    %rax,%rbx
movsd  0x8(%rsp),%xmm0
call   1040 <fabs@plt>
cmp    %rax,%rbx
jne    1149 <test_fabs+0x29>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1030 <link_failure_fabs@plt>

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

LLVM IR (-O2):
define void @test_fabs(double %0) {
%2 = tail call i64 @fabs(double %0)
%3 = tail call i64 @fabs(double %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_fabs()
br label %7
7: ; preds = %5, %1
ret void
}
void test(int *k) {
  if (*k > 5) {
    *k--;
  }
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x5,(%rax)
jle    1121 <test+0x21>
mov    -0x8(%rbp),%rax
add    $0xfffffffffffffffc,%rax
mov    %rax,-0x8(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test(i32* nocapture %0) {
ret void
}
int numlen(unsigned int p) {
  return (p < 10) ? 1 : (p < 100) ? 2 : (p < 1000) ? 3 : (p < 10000) ? 4 : 5;
}


x86 assembly (clang, -O0):
<numlen>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jae    111e <numlen+0x1e>
mov    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1174 <numlen+0x74>
cmpl   $0x64,-0x4(%rbp)
jae    1135 <numlen+0x35>
mov    $0x2,%eax
mov    %eax,-0xc(%rbp)
jmp    116e <numlen+0x6e>
cmpl   $0x3e8,-0x4(%rbp)
jae    114f <numlen+0x4f>
mov    $0x3,%eax
mov    %eax,-0x10(%rbp)
jmp    1168 <numlen+0x68>
mov    -0x4(%rbp),%edx
mov    $0x5,%eax
mov    $0x4,%ecx
cmp    $0x2710,%edx
cmovb  %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<numlen>:
mov    $0x1,%eax
cmp    $0xa,%edi
jb     112f <numlen+0x2f>
mov    $0x2,%eax
cmp    $0x64,%edi
jb     112f <numlen+0x2f>
mov    $0x3,%eax
cmp    $0x3e8,%edi
jb     112f <numlen+0x2f>
cmp    $0x2710,%edi
mov    $0x5,%eax
sbb    $0x0,%eax
ret

LLVM IR (-O0):
define i32 @numlen(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ult i32 %3, 10
br i1 %4, label %5, label %6
5: ; preds = %1
br label %23
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp ult i32 %7, 100
br i1 %8, label %9, label %10
9: ; preds = %6
br label %21
10: ; preds = %6
%11 = load i32, i32* %2
%12 = icmp ult i32 %11, 1000
br i1 %12, label %13, label %14
13: ; preds = %10
br label %19
14: ; preds = %10
%15 = load i32, i32* %2
%16 = icmp ult i32 %15, 10000
%17 = zext i1 %16 to i64
%18 = select i1 %16, i32 4, i32 5
br label %19
19: ; preds = %14, %13
%20 = phi i32 [ 3, %13 ], [ %18, %14 ]
br label %21
21: ; preds = %19, %9
%22 = phi i32 [ 2, %9 ], [ %20, %19 ]
br label %23
23: ; preds = %21, %5
%24 = phi i32 [ 1, %5 ], [ %22, %21 ]
ret i32 %24
}

LLVM IR (-O2):
define i32 @numlen(i32 %0) {
%2 = icmp ult i32 %0, 10
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = icmp ult i32 %0, 100
br i1 %4, label %10, label %5
5: ; preds = %3
%6 = icmp ult i32 %0, 1000
br i1 %6, label %10, label %7
7: ; preds = %5
%8 = icmp ult i32 %0, 10000
%9 = select i1 %8, i32 4, i32 5
br label %10
10: ; preds = %3, %5, %7, %1
%11 = phi i32 [ 1, %1 ], [ 2, %3 ], [ %9, %7 ], [ 3, %5 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Say hello.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Say hello.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [11 x i8] c"Say hello.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ position;
};
typedef TYPE_1__ XIMPreeditCaretCallbackStruct;

/* Variables and functions */
int get_XIMPreeditCaretCallbackStruct_position(void *_p) {
  return (int)((XIMPreeditCaretCallbackStruct *)_p)->position;
}


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

x86 assembly (clang, -O2):
<get_XIMPreeditCaretCallbackStruct_position>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @get_XIMPreeditCaretCallbackStruct_position(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
int get_gcd(int m, int n) {
  int q;
  while (n > 0) {
    q = m % n;
    m = n;
    n = q;
  }
  return m;
}


x86 assembly (clang, -O0):
<get_gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    112f <get_gcd+0x2f>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    110a <get_gcd+0xa>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_gcd>:
mov    %edi,%eax
test   %esi,%esi
jle    111d <get_gcd+0x1d>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jg     1110 <get_gcd+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @get_gcd(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %6, %4 ], [ %0, %2 ]
%6 = phi i32 [ %7, %4 ], [ %1, %2 ]
%7 = srem i32 %5, %6
%8 = icmp sgt i32 %7, 0
br i1 %8, label %4, label %9
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %6, %4 ]
ret i32 %10
}
OP(ed, d0) {}


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ memory;

/* Variables and functions */
int /*<<< orphan*/ input_flush_serial_port();
int /*<<< orphan*/ usleep(int);
int /*<<< orphan*/ write_serial_port(char *, int);
int xmodem_receive(unsigned char *, int);
int read_memory(int addr, int len) {
  int r;
  unsigned char memory[0x200000];
  write_serial_port("R000000,180#", 12);
  usleep(20000);
  input_flush_serial_port();
  r = xmodem_receive(memory, sizeof(memory));
  return r;
}


x86 assembly (clang, -O0):
<read_memory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x200010,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    0xea8(%rip),%rdi
mov    $0xc,%esi
call   1030 <write_serial_port@plt>
mov    $0x4e20,%edi
call   1060 <usleep@plt>
mov    $0x0,%al
call   1050 <input_flush_serial_port@plt>
lea    -0x200010(%rbp),%rdi
mov    $0x200000,%esi
call   1040 <xmodem_receive@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x200010,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_memory>:
sub    $0x200008,%rsp
lea    0xeb2(%rip),%rdi
mov    $0xc,%esi
call   1030 <write_serial_port@plt>
mov    $0x4e20,%edi
call   1060 <usleep@plt>
xor    %eax,%eax
call   1050 <input_flush_serial_port@plt>
mov    %rsp,%rdi
mov    $0x200000,%esi
call   1040 <xmodem_receive@plt>
add    $0x200008,%rsp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"R000000,180#\00"
define i32 @read_memory(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [2097152 x i8]
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = call i32 @write_serial_port(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 12)
%8 = call i32 @usleep(i32 20000)
%9 = call i32 (...) @input_flush_serial_port()
%10 = getelementptr inbounds [2097152 x i8], [2097152 x i8]* %6, i64 0, i64 0
%11 = call i32 @xmodem_receive(i8* %10, i32 2097152)
store i32 %11, i32* %5
%12 = load i32, i32* %5
ret i32 %12
}

LLVM IR (-O2):
@.str = [13 x i8] c"R000000,180#\00"
define i32 @read_memory(i32 %0, i32 %1) {
%3 = alloca [2097152 x i8]
%4 = getelementptr inbounds [2097152 x i8], [2097152 x i8]* %3, i64 0, i64 0
%5 = tail call i32 @write_serial_port(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 12)
%6 = tail call i32 @usleep(i32 20000)
%7 = tail call i32 (...) @input_flush_serial_port()
%8 = call i32 @xmodem_receive(i8* %4, i32 2097152)
ret i32 %8
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
int rotateLeft64(int, int);
uint32_t supplementalHash(uint64_t hash, uint64_t index) {
  uint32_t x = (uint32_t)(rotateLeft64(hash, (uint32_t)index) ^ index);
  x = ((x >> 16) ^ x) * 0x45d9f3b;
  x = ((x >> 16) ^ x) * 0x45d9f3b;
  x = (x >> 16) ^ x;
  return x;
}


x86 assembly (clang, -O0):
<supplementalHash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <rotateLeft64@plt>
xor    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x10,%eax
xor    -0xc(%rbp),%eax
imul   $0x45d9f3b,%eax,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x10,%eax
xor    -0xc(%rbp),%eax
imul   $0x45d9f3b,%eax,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x10,%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<supplementalHash>:
push   %rbx
mov    %esi,%ebx
call   1030 <rotateLeft64@plt>
xor    %ebx,%eax
mov    %eax,%ecx
sar    $0x10,%ecx
xor    %eax,%ecx
imul   $0x45d9f3b,%ecx,%eax
mov    %eax,%ecx
sar    $0x10,%ecx
xor    %eax,%ecx
imul   $0x45d9f3b,%ecx,%ecx
mov    %ecx,%eax
sar    $0x10,%eax
xor    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @supplementalHash(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* %3
%7 = load i32, i32* %4
%8 = call i32 @rotateLeft64(i32 %6, i32 %7)
%9 = load i32, i32* %4
%10 = xor i32 %8, %9
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = ashr i32 %11, 16
%13 = load i32, i32* %5
%14 = xor i32 %12, %13
%15 = mul nsw i32 %14, 73244475
store i32 %15, i32* %5
%16 = load i32, i32* %5
%17 = ashr i32 %16, 16
%18 = load i32, i32* %5
%19 = xor i32 %17, %18
%20 = mul nsw i32 %19, 73244475
store i32 %20, i32* %5
%21 = load i32, i32* %5
%22 = ashr i32 %21, 16
%23 = load i32, i32* %5
%24 = xor i32 %22, %23
store i32 %24, i32* %5
%25 = load i32, i32* %5
ret i32 %25
}

LLVM IR (-O2):
define i32 @supplementalHash(i32 %0, i32 %1) {
%3 = tail call i32 @rotateLeft64(i32 %0, i32 %1)
%4 = xor i32 %3, %1
%5 = ashr i32 %4, 16
%6 = xor i32 %5, %4
%7 = mul nsw i32 %6, 73244475
%8 = ashr i32 %7, 16
%9 = xor i32 %8, %7
%10 = mul nsw i32 %9, 73244475
%11 = ashr i32 %10, 16
%12 = xor i32 %11, %10
ret i32 %12
}
void dgtpicom_get_time(char time[]) {
  time[0] = 0;
  time[1] = 0;
  time[2] = 0;
  time[3] = 0;
  time[4] = 0;
  time[5] = 0;
}


x86 assembly (clang, -O0):
<dgtpicom_get_time>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
movb   $0x0,0x1(%rax)
mov    -0x8(%rbp),%rax
movb   $0x0,0x2(%rax)
mov    -0x8(%rbp),%rax
movb   $0x0,0x3(%rax)
mov    -0x8(%rbp),%rax
movb   $0x0,0x4(%rax)
mov    -0x8(%rbp),%rax
movb   $0x0,0x5(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<dgtpicom_get_time>:
movw   $0x0,0x4(%rdi)
movl   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @dgtpicom_get_time(i8* nocapture writeonly %0) {
ret void
}
void rep_nop(void) { asm volatile("rep; nop" ::: "memory"); }


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

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

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

LLVM IR (-O2):
define void @rep_nop() {
tail call void asm sideeffect "rep; nop", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
void debug(int level, const char *format, ...) {}


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

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

LLVM IR (-O0):
define void @debug(i32 %0, i8* %1, ...) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
define void @debug(i32 %0, i8* nocapture %1, ...) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void divider() { printf("\n"); }


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

x86 assembly (clang, -O2):
<divider>:
mov    $0xa,%edi
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @divider() {
%1 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void exit(void) {
  puts("exit\n");
  while (1)
    ;
}


x86 assembly (clang, -O0):
<exit>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
jmp    1120 <exit+0x10>

x86 assembly (clang, -O2):
<exit>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
nopl   (%rax)
jmp    1120 <exit+0x10>

LLVM IR (-O0):
@.str = [6 x i8] c"exit\0A\00"
define void @exit() {
%1 = call i32 @puts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}

LLVM IR (-O2):
@.str = [6 x i8] c"exit\0A\00"
define void @exit() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}
/* Type definitions */
typedef int uint;

/* Variables and functions */
int cmpuint(const void *p1, const void *p2) {
  return (*(uint *)p1) - (*(uint *)p2);
}


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

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

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

LLVM IR (-O2):
define i32 @cmpuint(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
void ELMCAutoGatingConfig(unsigned int baseAddr, unsigned int configVal) {
  (*((volatile unsigned int *)(baseAddr + (0x10)))) &= ~(0x00000001u);
  (*((volatile unsigned int *)(baseAddr + (0x10)))) =
      ((configVal << (0x00000000u)) & (0x00000001u));
}


x86 assembly (clang, -O0):
<ELMCAutoGatingConfig>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%eax
mov    %eax,%eax
mov    (%rax),%ecx
and    $0xfffffffe,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%ecx
shl    $0x0,%ecx
and    $0x1,%ecx
mov    -0x4(%rbp),%eax
add    $0x10,%eax
mov    %eax,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ELMCAutoGatingConfig>:
add    $0x10,%edi
andl   $0xfffffffe,(%rdi)
and    $0x1,%esi
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @ELMCAutoGatingConfig(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = add i32 %5, 16
%7 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = and i32 %9, -2
store volatile i32 %10, i32* %8
%11 = load i32, i32* %4
%12 = shl i32 %11, 0
%13 = and i32 %12, 1
%14 = load i32, i32* %3
%15 = add i32 %14, 16
%16 = zext i32 %15 to i64
%17 = inttoptr i64 %16 to i32*
store volatile i32 %13, i32* %17
ret void
}

LLVM IR (-O2):
define void @ELMCAutoGatingConfig(i32 %0, i32 %1) {
%3 = add i32 %0, 16
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = and i32 %6, -2
store volatile i32 %7, i32* %5
%8 = and i32 %1, 1
store volatile i32 %8, i32* %5
ret void
}
unsigned int QRinput_decodeECIfromByteArray(unsigned char *data) {
  int i;
  unsigned int ecinum;
  ecinum = 0;
  for (i = 0; i < 4; i++) {
    ecinum = ecinum << 8;
    ecinum |= data[3 - i];
  }
  return ecinum;
}


x86 assembly (clang, -O0):
<QRinput_decodeECIfromByteArray>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    1150 <QRinput_decodeECIfromByteArray+0x50>
mov    -0x10(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x3,%ecx
sub    -0xc(%rbp),%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <QRinput_decodeECIfromByteArray+0x16>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<QRinput_decodeECIfromByteArray>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @QRinput_decodeECIfromByteArray(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %4
store i32 0, i32* %3
br label %5
5: ; preds = %20, %1
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 4
br i1 %7, label %8, label %23
8: ; preds = %5
%9 = load i32, i32* %4
%10 = shl i32 %9, 8
store i32 %10, i32* %4
%11 = load i8*, i8** %2
%12 = load i32, i32* %3
%13 = sub nsw i32 3, %12
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %11, i64 %14
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = load i32, i32* %4
%19 = or i32 %18, %17
store i32 %19, i32* %4
br label %20
20: ; preds = %8
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 1
store i32 %22, i32* %3
br label %5
23: ; preds = %5
%24 = load i32, i32* %4
ret i32 %24
}

LLVM IR (-O2):
define i32 @QRinput_decodeECIfromByteArray(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 3
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = getelementptr inbounds i8, i8* %0, i64 2
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %4, 16
%9 = shl nuw nsw i32 %7, 8
%10 = or i32 %8, %9
%11 = getelementptr inbounds i8, i8* %0, i64 1
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = or i32 %10, %13
%15 = shl nuw i32 %14, 8
%16 = load i8, i8* %0
%17 = zext i8 %16 to i32
%18 = or i32 %15, %17
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ ENOMEM;
int /*<<< orphan*/ fail(int /*<<< orphan*/);
void *realloc(void *, size_t);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
void *reallocate(void *p, size_t size) {
  p = realloc(p, size);
  if (!p)
    fail(strerror(ENOMEM));
  return p;
}


x86 assembly (clang, -O0):
<reallocate>:
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   1040 <realloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1171 <reallocate+0x41>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    %eax,%edi
call   1030 <fail@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reallocate>:
push   %rbx
call   1040 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1153 <reallocate+0x23>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    %eax,%edi
call   1030 <fail@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@ENOMEM = global i32 0
define i8* @reallocate(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i8* @realloc(i8* %5, i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = icmp ne i8* %8, null
br i1 %9, label %14, label %10
10: ; preds = %2
%11 = load i32, i32* @ENOMEM
%12 = call i32 @strerror(i32 %11)
%13 = call i32 @fail(i32 %12)
br label %14
14: ; preds = %10, %2
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
@ENOMEM = global i32 0
define noalias i8* @reallocate(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @ENOMEM
%7 = tail call i32 @strerror(i32 %6)
%8 = tail call i32 @fail(i32 %7)
br label %9
9: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
int EXIT_FAILURE;
int /*<<< orphan*/ execvp(char *, char **);
int /*<<< orphan*/ perror(char *);
int main(int argc, char *argv[]) {
  execvp(argv[1], argv);
  perror("exec");
  return EXIT_FAILURE;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <execvp@plt>
lea    0xeb2(%rip),%rdi
call   1030 <perror@plt>
mov    0x2e86(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1040 <execvp@plt>
lea    0xecf(%rip),%rdi
call   1030 <perror@plt>
mov    0x2ea3(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"exec\00"
@EXIT_FAILURE = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = load i8**, i8*** %5
%10 = call i32 @execvp(i8* %8, i8** %9)
%11 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%12 = load i32, i32* @EXIT_FAILURE
ret i32 %12
}

LLVM IR (-O2):
@.str = [5 x i8] c"exec\00"
@EXIT_FAILURE = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @execvp(i8* %4, i8** %1)
%6 = tail call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
void free_select(int *select) { free(select); }


x86 assembly (clang, -O0):
<free_select>:
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):
<free_select>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_select(i32* nocapture %0) {
%2 = tail call i32 @free(i32* %0)
ret void
}