xunge/DecIR huggingface dataset:
/* Variables and functions */
int main_real(int, char **);
int main(int argc, char **argv) { return main_real(argc, argv); }


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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <main_real@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <main_real@plt>

LLVM IR (-O0):
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 i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @main_real(i32 %6, i8** %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @main_real(i32 %0, i8** %1)
ret i32 %3
}
int ast_hashtab_compare_shorts(const void *a, const void *b) {
  short as = *((short *)a);
  short bs = *((short *)b);
  if (as < bs)
    return -1;
  else if (as == bs)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<ast_hashtab_compare_shorts>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ax
mov    %ax,-0x1a(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%ax
mov    %ax,-0x1c(%rbp)
movswl -0x1a(%rbp),%eax
movswl -0x1c(%rbp),%ecx
cmp    %ecx,%eax
jge    113e <ast_hashtab_compare_shorts+0x3e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1161 <ast_hashtab_compare_shorts+0x61>
movswl -0x1a(%rbp),%eax
movswl -0x1c(%rbp),%ecx
cmp    %ecx,%eax
jne    115a <ast_hashtab_compare_shorts+0x5a>
movl   $0x0,-0x4(%rbp)
jmp    1161 <ast_hashtab_compare_shorts+0x61>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ast_hashtab_compare_shorts>:
movzwl (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%ax
setne  %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @ast_hashtab_compare_shorts(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i16*
%4 = load i16, i16* %3
%5 = bitcast i8* %1 to i16*
%6 = load i16, i16* %5
%7 = icmp slt i16 %4, %6
%8 = icmp ne i16 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
float magnitude_3f(float *);
int /*<<< orphan*/ scale_3f(int, float *);
void normalize_3f(float *x) {
  float magnitude = magnitude_3f(x);
  if (magnitude == 0.f) {
    return;
  }
  scale_3f(1 / magnitude, x);
}


x86 assembly (clang, -O0):
<normalize_3f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <magnitude_3f@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1156 <normalize_3f+0x36>
jp     1156 <normalize_3f+0x36>
jmp    1170 <normalize_3f+0x50>
movss  0xea2(%rip),%xmm0
divss  -0xc(%rbp),%xmm0
cvttss2si %xmm0,%edi
mov    -0x8(%rbp),%rsi
call   1030 <scale_3f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<normalize_3f>:
push   %rbx
mov    %rdi,%rbx
call   1040 <magnitude_3f@plt>
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1135 <normalize_3f+0x15>
jp     1135 <normalize_3f+0x15>
pop    %rbx
ret
movss  0xec3(%rip),%xmm1
divss  %xmm0,%xmm1
cvttss2si %xmm1,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <scale_3f@plt>

LLVM IR (-O0):
define void @normalize_3f(float* %0) {
%2 = alloca float*
%3 = alloca float
store float* %0, float** %2
%4 = load float*, float** %2
%5 = call float @magnitude_3f(float* %4)
store float %5, float* %3
%6 = load float, float* %3
%7 = fcmp oeq float %6, 0.000000e+00
br i1 %7, label %8, label %9
8: ; preds = %1
br label %15
9: ; preds = %1
%10 = load float, float* %3
%11 = fdiv float 1.000000e+00, %10
%12 = fptosi float %11 to i32
%13 = load float*, float** %2
%14 = call i32 @scale_3f(i32 %12, float* %13)
br label %15
15: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
define void @normalize_3f(float* %0) {
%2 = tail call float @magnitude_3f(float* %0)
%3 = fcmp oeq float %2, 0.000000e+00
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = fdiv float 1.000000e+00, %2
%6 = fptosi float %5 to i32
%7 = tail call i32 @scale_3f(i32 %6, float* %0)
br label %8
8: ; preds = %1, %4
ret void
}
void SV_Frame(float time) {}


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

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

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

LLVM IR (-O2):
define void @SV_Frame(float %0) {
ret void
}
int align(unsigned int addr, int line_size) {
  return addr - (addr % line_size);
}


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

x86 assembly (clang, -O2):
<align>:
mov    %edi,%eax
xor    %edx,%edx
div    %esi
sub    %edx,%edi
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @align(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 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = urem i32 %6, %7
%9 = sub i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @align(i32 %0, i32 %1) {
%3 = urem i32 %0, %1
%4 = sub i32 %0, %3
ret i32 %4
}
int f2(int x) { return (x % 5) % 5; }


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
movslq %edi,%rax
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x21,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @f2(i32 %0) {
%2 = srem i32 %0, 5
ret i32 %2
}
int main() {
  int i = 0;
  for (;;)
    i++;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    %eax,-0x8(%rbp)
jmp    1112 <main+0x12>

x86 assembly (clang, -O2):
<main>:
jmp    1100 <main>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %3, %0
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 1
store i32 %5, i32* %2
br label %3
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
unsigned long PWMARRGet(unsigned long);
unsigned long PWMDutyGet(unsigned long ulBase, unsigned long ulChannel) {
  unsigned long ulCMRData;
  unsigned long ulCNRData;
  ;
  ;
  ulCNRData = PWMARRGet(ulBase);
  ulCMRData =
      (*((volatile unsigned long *)(ulBase + 0x00000034 + ulChannel * 4)));
  ulChannel = (ulCMRData + 1) * 100 / (ulCNRData + 1);
  return ulChannel;
}


x86 assembly (clang, -O0):
<PWMDutyGet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <PWMARRGet@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
add    $0x34,%rax
mov    -0x10(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
imul   $0x64,%rax,%rax
mov    -0x20(%rbp),%rcx
add    $0x1,%rcx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PWMDutyGet>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <PWMARRGet@plt>
mov    %rax,%rcx
imul   $0x64,0x34(%rbx,%r14,4),%rax
add    $0x64,%rax
add    $0x1,%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
je     1143 <PWMDutyGet+0x33>
xor    %edx,%edx
div    %rcx
jmp    1147 <PWMDutyGet+0x37>
xor    %edx,%edx
div    %ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @PWMDutyGet(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%7 = load i64, i64* %3
%8 = call i64 @PWMARRGet(i64 %7)
store i64 %8, i64* %6
%9 = load i64, i64* %3
%10 = add i64 %9, 52
%11 = load i64, i64* %4
%12 = mul i64 %11, 4
%13 = add i64 %10, %12
%14 = inttoptr i64 %13 to i64*
%15 = load volatile i64, i64* %14
store i64 %15, i64* %5
%16 = load i64, i64* %5
%17 = add i64 %16, 1
%18 = mul i64 %17, 100
%19 = load i64, i64* %6
%20 = add i64 %19, 1
%21 = udiv i64 %18, %20
store i64 %21, i64* %4
%22 = load i64, i64* %4
ret i64 %22
}

LLVM IR (-O2):
define i64 @PWMDutyGet(i64 %0, i64 %1) {
%3 = tail call i64 @PWMARRGet(i64 %0)
%4 = add i64 %0, 52
%5 = shl i64 %1, 2
%6 = add i64 %4, %5
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
%9 = mul i64 %8, 100
%10 = add i64 %9, 100
%11 = add i64 %3, 1
%12 = udiv i64 %10, %11
ret i64 %12
}
/* Variables and functions */
int b();
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("b=%d\n", b());
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"b=%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @b()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ AltKeyDown();
int /*<<< orphan*/ KeyPressed();
int ReadKey();
int /*<<< orphan*/ printf(char *, int);
int main() {
  while (!AltKeyDown())
    ;
  while (!KeyPressed())
    ;
  printf("%d", ReadKey());
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <AltKeyDown@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    116b <main+0x2b>
jmp    1170 <main+0x30>
jmp    114f <main+0xf>
jmp    1175 <main+0x35>
mov    $0x0,%al
call   1050 <KeyPressed@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1191 <main+0x51>
jmp    1196 <main+0x56>
jmp    1175 <main+0x35>
mov    $0x0,%al
call   1060 <ReadKey@plt>
mov    %eax,%esi
lea    0xe5a(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <AltKeyDown@plt>
test   %eax,%eax
je     1150 <main+0x10>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <KeyPressed@plt>
test   %eax,%eax
je     1160 <main+0x20>
xor    %eax,%eax
call   1060 <ReadKey@plt>
lea    0xe87(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @AltKeyDown()
%3 = icmp eq i32 %2, 0
br i1 %3, label %1, label %4
4: ; preds = %1, %4
%5 = tail call i32 (...) @KeyPressed()
%6 = icmp eq i32 %5, 0
br i1 %6, label %4, label %7
7: ; preds = %4
%8 = tail call i32 (...) @ReadKey()
%9 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}
void jmem_term() {}


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

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

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

LLVM IR (-O2):
define void @jmem_term() {
ret void
}
double GetPath(double *sln, int yardage) {
  double size = sln[50001 * 10 + 1];
  if (yardage < size) {
    return sln[10 * yardage + 1];
  } else
    return 0;
}


x86 assembly (clang, -O0):
<GetPath>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x3d0958(%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
cvtsi2sdl -0x14(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    114d <GetPath+0x4d>
mov    -0x10(%rbp),%rax
imul   $0xa,-0x14(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1155 <GetPath+0x55>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetPath>:
cvtsi2sd %esi,%xmm1
movsd  0x3d0958(%rdi),%xmm2
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm2
jbe    1124 <GetPath+0x24>
add    %esi,%esi
lea    (%rsi,%rsi,4),%eax
or     $0x1,%eax
cltq
movsd  (%rdi,%rax,8),%xmm0
ret

LLVM IR (-O0):
define double @GetPath(double* %0, i32 %1) {
%3 = alloca double
%4 = alloca double*
%5 = alloca i32
%6 = alloca double
store double* %0, double** %4
store i32 %1, i32* %5
%7 = load double*, double** %4
%8 = getelementptr inbounds double, double* %7, i64 500011
%9 = load double, double* %8
store double %9, double* %6
%10 = load i32, i32* %5
%11 = sitofp i32 %10 to double
%12 = load double, double* %6
%13 = fcmp olt double %11, %12
br i1 %13, label %14, label %22
14: ; preds = %2
%15 = load double*, double** %4
%16 = load i32, i32* %5
%17 = mul nsw i32 10, %16
%18 = add nsw i32 %17, 1
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds double, double* %15, i64 %19
%21 = load double, double* %20
store double %21, double* %3
br label %23
22: ; preds = %2
store double 0.000000e+00, double* %3
br label %23
23: ; preds = %22, %14
%24 = load double, double* %3
ret double %24
}

LLVM IR (-O2):
define double @GetPath(double* nocapture %0, i32 %1) {
%3 = getelementptr inbounds double, double* %0, i64 500011
%4 = load double, double* %3
%5 = sitofp i32 %1 to double
%6 = fcmp ogt double %4, %5
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = mul nsw i32 %1, 10
%9 = or i32 %8, 1
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds double, double* %0, i64 %10
%12 = load double, double* %11
br label %13
13: ; preds = %2, %7
%14 = phi double [ %12, %7 ], [ 0.000000e+00, %2 ]
ret double %14
}
int foo() {
  int y;
  volatile int x;
  x = 5;
  x = 5;
  x = 5;
  y = 3;
  return x + y;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movl   $0x5,-0x8(%rbp)
movl   $0x5,-0x8(%rbp)
movl   $0x5,-0x8(%rbp)
movl   $0x3,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movl   $0x5,-0x4(%rsp)
movl   $0x5,-0x4(%rsp)
movl   $0x5,-0x4(%rsp)
mov    -0x4(%rsp),%eax
add    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @foo() {
%1 = alloca i32
%2 = alloca i32
store volatile i32 5, i32* %2
store volatile i32 5, i32* %2
store volatile i32 5, i32* %2
store i32 3, i32* %1
%3 = load volatile i32, i32* %2
%4 = load i32, i32* %1
%5 = add nsw i32 %3, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @foo() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store volatile i32 5, i32* %1
store volatile i32 5, i32* %1
store volatile i32 5, i32* %1
%3 = load volatile i32, i32* %1
%4 = add nsw i32 %3, 3
ret i32 %4
}
int convdig(c)
char c;
{
  if (('0' <= c && c <= '9'))
    return (c - '0');
  return (toupper(c) - 'A' + 10);
}


x86 assembly (clang, -O0):
<convdig>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%ecx
mov    $0x30,%eax
cmp    %ecx,%eax
jg     114b <convdig+0x3b>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     114b <convdig+0x3b>
movsbl -0x5(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    115d <convdig+0x4d>
movsbl -0x5(%rbp),%edi
call   1030 <toupper@plt>
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convdig>:
movsbl %dil,%eax
shl    $0x18,%edi
add    $0xd0ffffff,%edi
cmp    $0xafffffe,%edi
ja     1129 <convdig+0x19>
add    $0xffffffd0,%eax
ret
push   %rax
mov    %eax,%edi
call   1030 <toupper@plt>
add    $0xffffffc9,%eax
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define i32 @convdig(i32 %0) {
%2 = shl i32 %0, 24
%3 = ashr exact i32 %2, 24
%4 = add i32 %2, -788529153
%5 = icmp ult i32 %4, 184549375
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = add nsw i32 %3, -48
br label %11
8: ; preds = %1
%9 = tail call i32 @toupper(i32 %3)
%10 = add nsw i32 %9, -55
br label %11
11: ; preds = %8, %6
%12 = phi i32 [ %7, %6 ], [ %10, %8 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ glPopMatrix();
void dl_F3DEX_POPMTX() { glPopMatrix(); }


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

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

LLVM IR (-O0):
define void @dl_F3DEX_POPMTX() {
%1 = call i32 (...) @glPopMatrix()
ret void
}

LLVM IR (-O2):
define void @dl_F3DEX_POPMTX() {
%1 = tail call i32 (...) @glPopMatrix()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ display_ratio(double, double, double);
double prompt_maximum_speed();
double prompt_minimum_speed();
double speeds_ratio(double, double);
int main(void) {
  double speed_max = 0.0, speed_min = 0.0, ratio = 0.0;
  speed_max = prompt_maximum_speed();
  speed_min = prompt_minimum_speed();
  ratio = speeds_ratio(speed_max, speed_min);
  display_ratio(speed_max, speed_min, ratio);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    $0x0,%al
call   1030 <prompt_maximum_speed@plt>
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1060 <prompt_minimum_speed@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1040 <speeds_ratio@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
call   1050 <display_ratio@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
xor    %eax,%eax
call   1030 <prompt_maximum_speed@plt>
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1060 <prompt_minimum_speed@plt>
movaps %xmm0,%xmm1
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1040 <speeds_ratio@plt>
movaps %xmm0,%xmm2
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
call   1050 <display_ratio@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
store i32 0, i32* %1
store double 0.000000e+00, double* %2
store double 0.000000e+00, double* %3
store double 0.000000e+00, double* %4
%5 = call double (...) @prompt_maximum_speed()
store double %5, double* %2
%6 = call double (...) @prompt_minimum_speed()
store double %6, double* %3
%7 = load double, double* %2
%8 = load double, double* %3
%9 = call double @speeds_ratio(double %7, double %8)
store double %9, double* %4
%10 = load double, double* %2
%11 = load double, double* %3
%12 = load double, double* %4
%13 = call i32 @display_ratio(double %10, double %11, double %12)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call double (...) @prompt_maximum_speed()
%2 = tail call double (...) @prompt_minimum_speed()
%3 = tail call double @speeds_ratio(double %1, double %2)
%4 = tail call i32 @display_ratio(double %1, double %2, double %3)
ret i32 0
}
void delete_array(char **list, int n) {
  int loop;
  assert(n >= 0);
  for (loop = n - 1; loop >= 0; loop--)
    myfree(list[loop]);
  myfree(list);
}


x86 assembly (clang, -O0):
<delete_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     1176 <delete_array+0x56>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    $0x0,%al
call   1040 <myfree@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    114b <delete_array+0x2b>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <myfree@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delete_array>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    %esi,%edi
not    %edi
shr    $0x1f,%edi
xor    %eax,%eax
call   1030 <assert@plt>
test   %ebp,%ebp
jle    1158 <delete_array+0x38>
mov    %ebp,%ebp
add    $0x1,%rbp
lea    -0x2(%rbp),%eax
mov    (%rbx,%rax,8),%rdi
xor    %eax,%eax
call   1040 <myfree@plt>
add    $0xffffffffffffffff,%rbp
cmp    $0x1,%rbp
ja     1140 <delete_array+0x20>
mov    %rbx,%rdi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <myfree@plt>

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

LLVM IR (-O2):
define void @delete_array(i8** %0, i32 %1) {
%3 = xor i32 %1, -1
%4 = lshr i32 %3, 31
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %4)
%6 = icmp sgt i32 %1, 0
br i1 %6, label %7, label %17
7: ; preds = %2
%8 = zext i32 %1 to i64
br label %9
9: ; preds = %7, %9
%10 = phi i64 [ %8, %7 ], [ %11, %9 ]
%11 = add nsw i64 %10, -1
%12 = and i64 %11, 4294967295
%13 = getelementptr inbounds i8*, i8** %0, i64 %12
%14 = load i8*, i8** %13
%15 = tail call i32 (i8*, ...) bitcast (i32 (...)* @myfree to i32 (i8*, ...)*)(i8* %14)
%16 = icmp ugt i64 %10, 1
br i1 %16, label %9, label %17
17: ; preds = %9, %2
%18 = tail call i32 (i8**, ...) bitcast (i32 (...)* @myfree to i32 (i8**, ...)*)(i8** %0)
ret void
}
void PrintDebug(const char *str, ...) { (void)str; }


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

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

LLVM IR (-O0):
define void @PrintDebug(i8* %0, ...) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
ret void
}

LLVM IR (-O2):
define void @PrintDebug(i8* nocapture %0, ...) {
ret void
}
/* Variables and functions */
scalar_t__ EOF;
scalar_t__ fputs(char const *, int /*<<< orphan*/);
scalar_t__ putchar(char);
int /*<<< orphan*/ stdout;
int puts(const char *s) {
  return fputs(s, stdout) || putchar('\n') == EOF ? EOF : 0;
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea1(%rip),%rax
mov    (%rax),%esi
call   1040 <fputs@plt>
cmp    $0x0,%rax
jne    1162 <puts+0x42>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x2e8f(%rip),%rcx
cmp    (%rcx),%rax
jne    1175 <puts+0x55>
mov    0x2e7f(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
jmp    1180 <puts+0x60>
xor    %eax,%eax
mov    %rax,-0x10(%rbp)
jmp    1180 <puts+0x60>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
call   1040 <fputs@plt>
test   %rax,%rax
je     1140 <puts+0x20>
mov    0x2ead(%rip),%rax
mov    (%rax),%rax
jmp    1158 <puts+0x38>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x2e97(%rip),%rdx
xor    %ecx,%ecx
cmp    (%rdx),%rax
jne    115a <puts+0x3a>
mov    %eax,%ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdout = global i32 0
@EOF = global i64 0
define i32 @puts(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @stdout
%5 = call i64 @fputs(i8* %3, i32 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = call i64 @putchar(i8 signext 10)
%9 = load i64, i64* @EOF
%10 = icmp eq i64 %8, %9
br i1 %10, label %11, label %13
11: ; preds = %7, %1
%12 = load i64, i64* @EOF
br label %14
13: ; preds = %7
br label %14
14: ; preds = %13, %11
%15 = phi i64 [ %12, %11 ], [ 0, %13 ]
%16 = trunc i64 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
@stdout = global i32 0
@EOF = global i64 0
define i32 @puts(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i64 @fputs(i8* %0, i32 %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = load i64, i64* @EOF
br label %11
7: ; preds = %1
%8 = tail call i64 @putchar(i8 signext 10)
%9 = load i64, i64* @EOF
%10 = icmp eq i64 %8, %9
br i1 %10, label %11, label %14
11: ; preds = %5, %7
%12 = phi i64 [ %6, %5 ], [ %8, %7 ]
%13 = trunc i64 %12 to i32
br label %14
14: ; preds = %7, %11
%15 = phi i32 [ %13, %11 ], [ 0, %7 ]
ret i32 %15
}
/* Variables and functions */
size_t CHAR_BIT;
void set_bit(char bit_array[], size_t i) {
  const size_t index = i / CHAR_BIT;
  const size_t offset = i % CHAR_BIT;
  bit_array[index] |= 1 << offset;
}


x86 assembly (clang, -O0):
<set_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2ec9(%rip),%rcx
xor    %edx,%edx
divq   (%rcx)
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2eb5(%rip),%rcx
xor    %edx,%edx
divq   (%rcx)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %eax,%ecx
mov    $0x1,%esi
shl    %cl,%esi
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%edx
or     %esi,%edx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_bit>:
mov    %rsi,%rax
mov    0x2ed6(%rip),%rcx
mov    (%rcx),%rcx
mov    %rsi,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
je     1123 <set_bit+0x23>
xor    %edx,%edx
div    %rcx
mov    %rdx,%rcx
jmp    1129 <set_bit+0x29>
xor    %edx,%edx
div    %ecx
mov    %edx,%ecx
mov    $0x1,%edx
shl    %cl,%edx
or     %dl,(%rdi,%rax,1)
ret

LLVM IR (-O0):
@CHAR_BIT = global i64 0
define void @set_bit(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%7 = load i64, i64* %4
%8 = load i64, i64* @CHAR_BIT
%9 = udiv i64 %7, %8
store i64 %9, i64* %5
%10 = load i64, i64* %4
%11 = load i64, i64* @CHAR_BIT
%12 = urem i64 %10, %11
store i64 %12, i64* %6
%13 = load i64, i64* %6
%14 = trunc i64 %13 to i32
%15 = shl i32 1, %14
%16 = load i8*, i8** %3
%17 = load i64, i64* %5
%18 = getelementptr inbounds i8, i8* %16, i64 %17
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = or i32 %20, %15
%22 = trunc i32 %21 to i8
store i8 %22, i8* %18
ret void
}

LLVM IR (-O2):
@CHAR_BIT = global i64 0
define void @set_bit(i8* nocapture %0, i64 %1) {
%3 = load i64, i64* @CHAR_BIT
%4 = udiv i64 %1, %3
%5 = urem i64 %1, %3
%6 = trunc i64 %5 to i32
%7 = shl nuw i32 1, %6
%8 = getelementptr inbounds i8, i8* %0, i64 %4
%9 = load i8, i8* %8
%10 = trunc i32 %7 to i8
%11 = or i8 %9, %10
store i8 %11, i8* %8
ret void
}
void LowPower_Handler(void) {}


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

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

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

LLVM IR (-O2):
define void @LowPower_Handler() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ unittest_generate_captures();
int /*<<< orphan*/ unittest_generate_moves();
int /*<<< orphan*/ unittest_generate_multicaptures();
int /*<<< orphan*/ unittest_make_move();
int /*<<< orphan*/ unittest_move_list_compare();
int /*<<< orphan*/ unittest_move_list_sort();
int /*<<< orphan*/ unittest_perft();
int main(int argc, char **argv) {
  unittest_move_list_compare();
  unittest_move_list_sort();
  unittest_generate_moves();
  unittest_generate_captures();
  unittest_generate_multicaptures();
  unittest_make_move();
  unittest_perft();
  return 0;
}


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    $0x0,%al
call   1050 <unittest_move_list_compare@plt>
mov    $0x0,%al
call   1080 <unittest_move_list_sort@plt>
mov    $0x0,%al
call   1030 <unittest_generate_moves@plt>
mov    $0x0,%al
call   1060 <unittest_generate_captures@plt>
mov    $0x0,%al
call   1090 <unittest_generate_multicaptures@plt>
mov    $0x0,%al
call   1070 <unittest_make_move@plt>
mov    $0x0,%al
call   1040 <unittest_perft@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <unittest_move_list_compare@plt>
xor    %eax,%eax
call   1080 <unittest_move_list_sort@plt>
xor    %eax,%eax
call   1030 <unittest_generate_moves@plt>
xor    %eax,%eax
call   1060 <unittest_generate_captures@plt>
xor    %eax,%eax
call   1090 <unittest_generate_multicaptures@plt>
xor    %eax,%eax
call   1070 <unittest_make_move@plt>
xor    %eax,%eax
call   1040 <unittest_perft@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
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 = call i32 (...) @unittest_move_list_compare()
%7 = call i32 (...) @unittest_move_list_sort()
%8 = call i32 (...) @unittest_generate_moves()
%9 = call i32 (...) @unittest_generate_captures()
%10 = call i32 (...) @unittest_generate_multicaptures()
%11 = call i32 (...) @unittest_make_move()
%12 = call i32 (...) @unittest_perft()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @unittest_move_list_compare()
%4 = tail call i32 (...) @unittest_move_list_sort()
%5 = tail call i32 (...) @unittest_generate_moves()
%6 = tail call i32 (...) @unittest_generate_captures()
%7 = tail call i32 (...) @unittest_generate_multicaptures()
%8 = tail call i32 (...) @unittest_make_move()
%9 = tail call i32 (...) @unittest_perft()
ret i32 0
}
int Media_SetVolume(int volume) { return 65535; }


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

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

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

LLVM IR (-O2):
define i32 @Media_SetVolume(i32 %0) {
ret i32 65535
}
/* Variables and functions */
int /*<<< orphan*/ output_rs232_tx(unsigned int);
void stdout_put_char(unsigned i) { output_rs232_tx(i); }


x86 assembly (clang, -O0):
<stdout_put_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <output_rs232_tx@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdout_put_char>:
jmp    1030 <output_rs232_tx@plt>

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

LLVM IR (-O2):
define void @stdout_put_char(i32 %0) {
%2 = tail call i32 @output_rs232_tx(i32 %0)
ret void
}
long double fool(long double a) { return 2 * a; }


x86 assembly (clang, -O0):
<fool>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fadd   %st,%st(0)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fool>:
fldt   0x8(%rsp)
fadd   %st,%st(0)
ret

LLVM IR (-O0):
define x86_fp80 @fool(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fmul x86_fp80 0xK40008000000000000000, %3
ret x86_fp80 %4
}

LLVM IR (-O2):
define x86_fp80 @fool(x86_fp80 %0) {
%2 = fmul x86_fp80 %0, 0xK40008000000000000000
ret x86_fp80 %2
}
/* Variables and functions */
int /*<<< orphan*/ glIndexi(int);
void Indexi(int v) { glIndexi(v); }


x86 assembly (clang, -O0):
<Indexi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <glIndexi@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Indexi>:
jmp    1030 <glIndexi@plt>

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

LLVM IR (-O2):
define void @Indexi(i32 %0) {
%2 = tail call i32 @glIndexi(i32 %0)
ret void
}
long long int countfact(long long int n, long long int p) {
  long long int k = 0;
  while (n > 0) {
    k = k + n / p;
    n = n / p;
  }
  return k;
}


x86 assembly (clang, -O0):
<countfact>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
jle    1152 <countfact+0x52>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
cqto
idivq  -0x10(%rbp)
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cqto
idivq  -0x10(%rbp)
mov    %rax,-0x8(%rbp)
jmp    1114 <countfact+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<countfact>:
xor    %ecx,%ecx
test   %rdi,%rdi
jle    112f <countfact+0x2f>
mov    %rdi,%rax
jmp    111d <countfact+0x1d>
nopl   0x0(%rax)
cqto
idiv   %rsi
add    %rax,%rcx
test   %rax,%rax
jle    112f <countfact+0x2f>
mov    %rax,%rdx
or     %rsi,%rdx
shr    $0x20,%rdx
jne    1110 <countfact+0x10>
xor    %edx,%edx
div    %esi
jmp    1115 <countfact+0x15>
mov    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @countfact(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
store i64 0, i64* %5
br label %6
6: ; preds = %9, %2
%7 = load i64, i64* %3
%8 = icmp sgt i64 %7, 0
br i1 %8, label %9, label %18
9: ; preds = %6
%10 = load i64, i64* %5
%11 = load i64, i64* %3
%12 = load i64, i64* %4
%13 = sdiv i64 %11, %12
%14 = add nsw i64 %10, %13
store i64 %14, i64* %5
%15 = load i64, i64* %3
%16 = load i64, i64* %4
%17 = sdiv i64 %15, %16
store i64 %17, i64* %3
br label %6
18: ; preds = %6
%19 = load i64, i64* %5
ret i64 %19
}

LLVM IR (-O2):
define i64 @countfact(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, 0
br i1 %3, label %4, label %10
4: ; preds = %2, %4
%5 = phi i64 [ %8, %4 ], [ 0, %2 ]
%6 = phi i64 [ %7, %4 ], [ %0, %2 ]
%7 = sdiv i64 %6, %1
%8 = add nsw i64 %7, %5
%9 = icmp sgt i64 %7, 0
br i1 %9, label %4, label %10
10: ; preds = %4, %2
%11 = phi i64 [ 0, %2 ], [ %8, %4 ]
ret i64 %11
}
void Uart_SendByte(int data) {
  if (data == '\n') {
    while (!((*(volatile unsigned *)0x50000010) & 0x2))
      ;
    (*(volatile unsigned char *)0x50000020) = '\r';
  }
  while (!((*(volatile unsigned *)0x50000010) & 0x2))
    ;
  (*(volatile unsigned char *)0x50000020) = data;
}


x86 assembly (clang, -O0):
<Uart_SendByte>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jne    1142 <Uart_SendByte+0x42>
jmp    1116 <Uart_SendByte+0x16>
mov    $0x50000010,%eax
mov    (%rax),%eax
and    $0x2,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1135 <Uart_SendByte+0x35>
jmp    113a <Uart_SendByte+0x3a>
jmp    1116 <Uart_SendByte+0x16>
mov    $0x50000020,%eax
movb   $0xd,(%rax)
jmp    1147 <Uart_SendByte+0x47>
mov    $0x50000010,%eax
mov    (%rax),%eax
and    $0x2,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1166 <Uart_SendByte+0x66>
jmp    116b <Uart_SendByte+0x6b>
jmp    1147 <Uart_SendByte+0x47>
mov    -0x4(%rbp),%eax
mov    %al,%cl
mov    $0x50000020,%eax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<Uart_SendByte>:
cmp    $0xa,%edi
jne    1130 <Uart_SendByte+0x30>
cs nopw 0x0(%rax,%rax,1)
nop
testl  $0x2,0x50000010
je     1110 <Uart_SendByte+0x10>
movb   $0xd,0x50000020
0d
cs nopw 0x0(%rax,%rax,1)
nop
testl  $0x2,0x50000010
je     1130 <Uart_SendByte+0x30>
mov    %dil,0x50000020
50
ret

LLVM IR (-O0):
define void @Uart_SendByte(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 10
br i1 %4, label %5, label %13
5: ; preds = %1
br label %6
6: ; preds = %11, %5
%7 = load volatile i32, i32* inttoptr (i64 1342177296 to i32*)
%8 = and i32 %7, 2
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
br i1 %10, label %11, label %12
11: ; preds = %6
br label %6
12: ; preds = %6
store volatile i8 13, i8* inttoptr (i64 1342177312 to i8*)
br label %13
13: ; preds = %12, %1
br label %14
14: ; preds = %19, %13
%15 = load volatile i32, i32* inttoptr (i64 1342177296 to i32*)
%16 = and i32 %15, 2
%17 = icmp ne i32 %16, 0
%18 = xor i1 %17, true
br i1 %18, label %19, label %20
19: ; preds = %14
br label %14
20: ; preds = %14
%21 = load i32, i32* %2
%22 = trunc i32 %21 to i8
store volatile i8 %22, i8* inttoptr (i64 1342177312 to i8*)
ret void
}

LLVM IR (-O2):
define void @Uart_SendByte(i32 %0) {
%2 = icmp eq i32 %0, 10
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = load volatile i32, i32* inttoptr (i64 1342177296 to i32*)
%5 = and i32 %4, 2
%6 = icmp eq i32 %5, 0
br i1 %6, label %3, label %7
7: ; preds = %3
store volatile i8 13, i8* inttoptr (i64 1342177312 to i8*)
br label %8
8: ; preds = %7, %1
br label %9
9: ; preds = %8, %9
%10 = load volatile i32, i32* inttoptr (i64 1342177296 to i32*)
%11 = and i32 %10, 2
%12 = icmp eq i32 %11, 0
br i1 %12, label %9, label %13
13: ; preds = %9
%14 = trunc i32 %0 to i8
store volatile i8 %14, i8* inttoptr (i64 1342177312 to i8*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dread_ascfile(char const *, double *, double *, int *,
                                 double *);
void dread_ascfile_c(const char *name, double *t0, double *dt, int *n,
                     double *data) {
  dread_ascfile(name, t0, dt, n, data);
}


x86 assembly (clang, -O0):
<dread_ascfile_c>:
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    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <dread_ascfile@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dread_ascfile_c>:
jmp    1030 <dread_ascfile@plt>

LLVM IR (-O0):
define void @dread_ascfile_c(i8* %0, double* %1, double* %2, i32* %3, double* %4) {
%6 = alloca i8*
%7 = alloca double*
%8 = alloca double*
%9 = alloca i32*
%10 = alloca double*
store i8* %0, i8** %6
store double* %1, double** %7
store double* %2, double** %8
store i32* %3, i32** %9
store double* %4, double** %10
%11 = load i8*, i8** %6
%12 = load double*, double** %7
%13 = load double*, double** %8
%14 = load i32*, i32** %9
%15 = load double*, double** %10
%16 = call i32 @dread_ascfile(i8* %11, double* %12, double* %13, i32* %14, double* %15)
ret void
}

LLVM IR (-O2):
define void @dread_ascfile_c(i8* %0, double* %1, double* %2, i32* %3, double* %4) {
%6 = tail call i32 @dread_ascfile(i8* %0, double* %1, double* %2, i32* %3, double* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SOCK_STREAM;
int clientsock(int /*<<< orphan*/, char const *, int);
int clientTCPsock(const char *destination, int portN) {
  return clientsock(SOCK_STREAM, destination, portN);
}


x86 assembly (clang, -O0):
<clientTCPsock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <clientsock@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clientTCPsock>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2ec4(%rip),%rax
mov    (%rax),%edi
jmp    1030 <clientsock@plt>

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

LLVM IR (-O2):
@SOCK_STREAM = global i32 0
define i32 @clientTCPsock(i8* %0, i32 %1) {
%3 = load i32, i32* @SOCK_STREAM
%4 = tail call i32 @clientsock(i32 %3, i8* %0, i32 %1)
ret i32 %4
}
void X509_add1_trust_object(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_add1_trust_object() {
ret void
}
int addtwo(int a) {
  int x = 2;
  return a + x;
}


x86 assembly (clang, -O0):
<addtwo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<addtwo>:
lea    0x2(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @addtwo(i32 %0) {
%2 = add nsw i32 %0, 2
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ maketree(char *, char *);
int main(int argc, char *argv[]) {
  maketree(argv[1], argv[2]);
  return 0;
}


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),%rax
mov    0x10(%rax),%rsi
call   1030 <maketree@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
mov    0x10(%rsi),%rsi
call   1030 <maketree@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
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 = getelementptr inbounds i8*, i8** %9, i64 2
%11 = load i8*, i8** %10
%12 = call i32 @maketree(i8* %8, i8* %11)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8*, i8** %1, i64 2
%6 = load i8*, i8** %5
%7 = tail call i32 @maketree(i8* %4, i8* %6)
ret i32 0
}
int dup_userfaultfd(struct vm_area_struct *vma, struct list_head *l) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.vm_area_struct = type opaque
%struct.list_head = type opaque
define i32 @dup_userfaultfd(%struct.vm_area_struct* %0, %struct.list_head* %1) {
%3 = alloca %struct.vm_area_struct*
%4 = alloca %struct.list_head*
store %struct.vm_area_struct* %0, %struct.vm_area_struct** %3
store %struct.list_head* %1, %struct.list_head** %4
ret i32 0
}

LLVM IR (-O2):
%struct.vm_area_struct = type opaque
%struct.list_head = type opaque
define i32 @dup_userfaultfd(%struct.vm_area_struct* nocapture readnone %0, %struct.list_head* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
double percentile_weight_double(int, double *, double *, double);
double percentile_weight(int n, double *data, double *err, double pct) {
  return percentile_weight_double(n, data, err, pct);
}


x86 assembly (clang, -O0):
<percentile_weight>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
movsd  -0x20(%rbp),%xmm0
call   1030 <percentile_weight_double@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<percentile_weight>:
jmp    1030 <percentile_weight_double@plt>

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

LLVM IR (-O2):
define double @percentile_weight(i32 %0, double* %1, double* %2, double %3) {
%5 = tail call double @percentile_weight_double(i32 %0, double* %1, double* %2, double %3)
ret double %5
}