xunge/DecIR huggingface dataset:
int motorctrl_bound_value(int motor_val) {
  motor_val = (motor_val * 100) / 1024;
  if (motor_val < -100)
    return -100;
  else if (motor_val > 100)
    return 100;
  else
    return motor_val;
}


x86 assembly (clang, -O0):
<motorctrl_bound_value>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
imul   $0x64,-0x8(%rbp),%eax
mov    $0x400,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
cmpl   $0xffffff9c,-0x8(%rbp)
jge    112c <motorctrl_bound_value+0x2c>
movl   $0xffffff9c,-0x4(%rbp)
jmp    1148 <motorctrl_bound_value+0x48>
cmpl   $0x64,-0x8(%rbp)
jle    1142 <motorctrl_bound_value+0x42>
movl   $0x64,-0x4(%rbp)
jmp    1148 <motorctrl_bound_value+0x48>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<motorctrl_bound_value>:
imul   $0x64,%edi,%eax
mov    $0x64,%ecx
cmp    $0x193ff,%eax
jg     111d <motorctrl_bound_value+0x1d>
lea    0x3ff(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
sar    $0xa,%ecx
cmp    $0xfffe6c01,%eax
mov    $0xffffff9c,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @motorctrl_bound_value(i32 %0) {
%2 = mul nsw i32 %0, 100
%3 = sdiv i32 %2, 1024
%4 = icmp slt i32 %2, -103423
%5 = icmp sgt i32 %2, 103423
%6 = select i1 %5, i32 100, i32 %3
%7 = select i1 %4, i32 -100, i32 %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ DMA11_DMA27_DriverIRQHandler();
__attribute__((weak)) void DMA11_DMA27_IRQHandler(void) {
  DMA11_DMA27_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @DMA11_DMA27_IRQHandler() {
%1 = call i32 (...) @DMA11_DMA27_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @DMA11_DMA27_IRQHandler() {
%1 = tail call i32 (...) @DMA11_DMA27_DriverIRQHandler()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errAbort(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
scalar_t__ strcmp(char *, char *);
void flakyStuff(char *password) {
  printf("Checking password %s\n", password);
  if (!(strcmp(password, "secret") == 0)) {
    errAbort("%s is not secret password!", password);
  }
}


x86 assembly (clang, -O0):
<flakyStuff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
lea    0xebf(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
je     1176 <flakyStuff+0x46>
mov    -0x8(%rbp),%rsi
lea    0xeac(%rip),%rdi
call   1040 <errAbort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flakyStuff>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
lea    0xecc(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
je     1167 <flakyStuff+0x37>
lea    0xebf(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <errAbort@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Checking password %s\0A\00"
@.str.1 = [7 x i8] c"secret\00"
@.str.2 = [27 x i8] c"%s is not secret password!\00"
define void @flakyStuff(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %2
%6 = call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = call i32 @errAbort(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i8* %9)
br label %11
11: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"Checking password %s\0A\00"
@.str.1 = [7 x i8] c"secret\00"
@.str.2 = [27 x i8] c"%s is not secret password!\00"
define void @flakyStuff(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @errAbort(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i8* %0)
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0x5e() {
  Assert_real((isalpha(94) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalpha.c",
              475, ("isalpha should be 0 for ^"));
}


x86 assembly (clang, -O0):
<t_isalpha_0x5e>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5e,%edi
call   1030 <isalpha@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x1db,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalpha_0x5e>:
push   %rax
mov    $0x5e,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x1db,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [26 x i8] c"isalpha should be 0 for ^\00"
define void @t_isalpha_0x5e() {
%1 = call i64 @isalpha(i32 94)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 475, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [26 x i8] c"isalpha should be 0 for ^\00"
define void @t_isalpha_0x5e() {
%1 = tail call i64 @isalpha(i32 94)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 475, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
movedisk(a, b) {
  int diskno;
  path(a, b);
  diskno = DiskRemove(a);
  unpath();
  placedisk(b, diskno);
}


x86 assembly (clang, -O0):
<movedisk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    $0x0,%al
call   1040 <path@plt>
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1030 <DiskRemove@plt>
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1060 <unpath@plt>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    $0x0,%al
call   1050 <placedisk@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<movedisk>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <path@plt>
mov    %ebp,%edi
xor    %eax,%eax
call   1030 <DiskRemove@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1060 <unpath@plt>
mov    %ebx,%edi
mov    %ebp,%esi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <placedisk@plt>

LLVM IR (-O0):
define i32 @movedisk(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = call i32 (i32, i32, ...) bitcast (i32 (...)* @path to i32 (i32, i32, ...)*)(i32 %7, i32 %8)
%10 = load i32, i32* %4
%11 = call i32 (i32, ...) bitcast (i32 (...)* @DiskRemove to i32 (i32, ...)*)(i32 %10)
store i32 %11, i32* %6
%12 = call i32 (...) @unpath()
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = call i32 (i32, i32, ...) bitcast (i32 (...)* @placedisk to i32 (i32, i32, ...)*)(i32 %13, i32 %14)
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @movedisk(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @path to i32 (i32, i32, ...)*)(i32 %0, i32 %1)
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @DiskRemove to i32 (i32, ...)*)(i32 %0)
%5 = tail call i32 (...) @unpath()
%6 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @placedisk to i32 (i32, i32, ...)*)(i32 %1, i32 %4)
ret i32 undef
}
void load_ligatures(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ *stdout;
FILE *file___new_NativeFile_native_stdout___impl() { return stdout; }


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

x86 assembly (clang, -O2):
<file___new_NativeFile_native_stdout___impl>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%rax
ret

LLVM IR (-O0):
@stdout = global i32* null
define i32* @file___new_NativeFile_native_stdout___impl() {
%1 = load i32*, i32** @stdout
ret i32* %1
}

LLVM IR (-O2):
@stdout = global i32* null
define i32* @file___new_NativeFile_native_stdout___impl() {
%1 = load i32*, i32** @stdout
ret i32* %1
}
void msm_spm_reinit(void) {}


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

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

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

LLVM IR (-O2):
define void @msm_spm_reinit() {
ret void
}
int ru(int num) {
  if (num % 2) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<ru>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1127 <ru+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <ru+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @ru(i32 %0) {
%2 = and i32 %0, 1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int distance = 100;
  printf(" You are %d miles away. \n", distance);
  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)
movl   $0x64,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [26 x i8] c" You are %d miles away. \0A\00"
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
store i32 100, i32* %6
%7 = load i32, i32* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c" You are %d miles away. \0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 100)
ret i32 0
}
/* Variables and functions */
char *getcwd(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char **argv) {
  char tmp[128];
  char *p;
  int ret;
  p = getcwd(tmp, 128);
  if (!p) {
    return 1;
  }
  printf("%s", p);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x90(%rbp),%rdi
mov    $0x80,%esi
call   1040 <getcwd@plt>
mov    %rax,-0x98(%rbp)
cmpq   $0x0,-0x98(%rbp)
jne    116b <main+0x4b>
movl   $0x1,-0x4(%rbp)
jmp    1185 <main+0x65>
mov    -0x98(%rbp),%rsi
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x88,%rsp
mov    %rsp,%rdi
mov    $0x80,%esi
call   1040 <getcwd@plt>
test   %rax,%rax
je     1152 <main+0x32>
lea    0xec0(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x88,%rsp
ret
mov    $0x1,%eax
add    $0x88,%rsp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [128 x i8]
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%5 = call i8* @getcwd(i8* %4, i32 128)
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
br label %9
9: ; preds = %2, %7
%10 = phi i32 [ 0, %7 ], [ 1, %2 ]
ret i32 %10
}
void RTSha1Digest(void) {}


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

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

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

LLVM IR (-O2):
define void @RTSha1Digest() {
ret void
}
int addDigits(int num) {
  if (num / 10 == 0) {
    return num;
  }
  int sum = 0;
  while (num != 0) {
    sum += num % 10;
    num /= 10;
  }
  return addDigits(sum);
}


x86 assembly (clang, -O0):
<addDigits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x0,%eax
jne    113a <addDigits+0x2a>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    117a <addDigits+0x6a>
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     116f <addDigits+0x5f>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    -0xc(%rbp),%edx
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
jmp    1141 <addDigits+0x31>
mov    -0xc(%rbp),%edi
call   1030 <addDigits@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addDigits>:
lea    0x9(%rdi),%eax
cmp    $0x13,%eax
jae    110c <addDigits+0xc>
mov    %edi,%eax
jmp    114e <addDigits+0x4e>
xor    %ecx,%ecx
xchg   %ax,%ax
movslq %edi,%rdx
imul   $0x66666667,%rdx,%rdi
mov    %rdi,%rax
shr    $0x3f,%rax
sar    $0x22,%rdi
add    %eax,%edi
lea    (%rdi,%rdi,1),%eax
lea    (%rax,%rax,4),%eax
mov    %edx,%esi
sub    %eax,%esi
mov    %ecx,%eax
add    %esi,%eax
add    $0x9,%edx
mov    %eax,%ecx
cmp    $0x13,%edx
jae    1110 <addDigits+0x10>
lea    0x9(%rax),%edx
mov    $0x0,%ecx
mov    %eax,%edi
cmp    $0x13,%edx
jae    1110 <addDigits+0x10>
ret

LLVM IR (-O0):
define i32 @addDigits(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = sdiv i32 %5, 10
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i32, i32* %3
store i32 %9, i32* %2
br label %24
10: ; preds = %1
store i32 0, i32* %4
br label %11
11: ; preds = %14, %10
%12 = load i32, i32* %3
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %21
14: ; preds = %11
%15 = load i32, i32* %3
%16 = srem i32 %15, 10
%17 = load i32, i32* %4
%18 = add nsw i32 %17, %16
store i32 %18, i32* %4
%19 = load i32, i32* %3
%20 = sdiv i32 %19, 10
store i32 %20, i32* %3
br label %11
21: ; preds = %11
%22 = load i32, i32* %4
%23 = call i32 @addDigits(i32 %22)
store i32 %23, i32* %2
br label %24
24: ; preds = %21, %8
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
define i32 @addDigits(i32 %0) {
%2 = add i32 %0, 9
%3 = icmp ult i32 %2, 19
br i1 %3, label %18, label %7
4: ; preds = %7
%5 = add i32 %11, 9
%6 = icmp ult i32 %5, 19
br i1 %6, label %18, label %15
7: ; preds = %1, %15
%8 = phi i32 [ %16, %15 ], [ 0, %1 ]
%9 = phi i32 [ %17, %15 ], [ %0, %1 ]
%10 = srem i32 %9, 10
%11 = add nsw i32 %8, %10
%12 = sdiv i32 %9, 10
%13 = add i32 %9, 9
%14 = icmp ult i32 %13, 19
br i1 %14, label %4, label %15
15: ; preds = %7, %4
%16 = phi i32 [ %11, %7 ], [ 0, %4 ]
%17 = phi i32 [ %12, %7 ], [ %11, %4 ]
br label %7
18: ; preds = %4, %1
%19 = phi i32 [ %0, %1 ], [ %11, %4 ]
ret i32 %19
}
void __attribute__((noreturn))
__assert_func(const char __attribute__((unused)) * file,
              int __attribute__((unused)) line,
              const char __attribute__((unused)) * func,
              const char __attribute__((unused)) * failedexpr) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<__assert_func>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
jmp    1113 <__assert_func+0x13>

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

LLVM IR (-O0):
define void @__assert_func(i8* %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
br label %9
9: ; preds = %4, %9
br label %9
}

LLVM IR (-O2):
define void @__assert_func(i8* nocapture %0, i32 %1, i8* nocapture %2, i8* nocapture %3) {
br label %5
5: ; preds = %4, %5
br label %5
}
/* Variables and functions */
int /*<<< orphan*/ outbyte(int);
nl() {
  outbyte(13);
  outbyte(10);
}


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

x86 assembly (clang, -O2):
<nl>:
push   %rax
mov    $0xd,%edi
call   1030 <outbyte@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <outbyte@plt>

LLVM IR (-O0):
define i32 @nl() {
%1 = alloca i32
%2 = call i32 @outbyte(i32 13)
%3 = call i32 @outbyte(i32 10)
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @nl() {
%1 = tail call i32 @outbyte(i32 13)
%2 = tail call i32 @outbyte(i32 10)
ret i32 undef
}
int isLeapYear(int y) { return (y % 400 == 0 || (y % 100 != 0 && y % 4 == 0)); }


x86 assembly (clang, -O0):
<isLeapYear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
mov    $0x1,%al
cmp    $0x0,%edx
mov    %al,-0x5(%rbp)
je     1153 <isLeapYear+0x53>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
cmp    $0x0,%edx
mov    %al,-0x6(%rbp)
je     114d <isLeapYear+0x4d>
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isLeapYear>:
imul   $0xc28f5c29,%edi,%eax
add    $0x51eb850,%eax
mov    %eax,%ecx
ror    $0x4,%ecx
cmp    $0xa3d70b,%ecx
jb     112c <isLeapYear+0x2c>
ror    $0x2,%eax
cmp    $0x28f5c29,%eax
jb     1132 <isLeapYear+0x32>
xor    %eax,%eax
test   $0x3,%dil
sete   %al
ret
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @isLeapYear(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 400
%5 = icmp eq i32 %4, 0
br i1 %5, label %16, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = srem i32 %7, 100
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %6
%11 = load i32, i32* %2
%12 = srem i32 %11, 4
%13 = icmp eq i32 %12, 0
br label %14
14: ; preds = %10, %6
%15 = phi i1 [ false, %6 ], [ %13, %10 ]
br label %16
16: ; preds = %14, %1
%17 = phi i1 [ true, %1 ], [ %15, %14 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @isLeapYear(i32 %0) {
%2 = srem i32 %0, 400
%3 = icmp eq i32 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = srem i32 %0, 100
%6 = icmp eq i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %4
%8 = and i32 %0, 3
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %4, %7, %1
%12 = phi i32 [ 1, %1 ], [ 0, %4 ], [ %10, %7 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
void display_end() { endwin(); }


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

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

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

LLVM IR (-O2):
define void @display_end() {
%1 = tail call i32 (...) @endwin()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void aesReadBlock(uint32_t offset, uint32_t *pVal32, uint32_t numBytes) {
  void (*p_aesReadBlock)(uint32_t offset, uint32_t * pVal32, uint32_t numBytes);
  p_aesReadBlock = (void (*)(uint32_t offset, uint32_t * pVal32,
                             uint32_t numBytes))0x030011e9U;
  p_aesReadBlock(offset, pVal32, numBytes);
}


x86 assembly (clang, -O0):
<aesReadBlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0x30011e9,%eax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aesReadBlock>:
mov    $0x30011e9,%eax
jmp    *%rax

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

LLVM IR (-O2):
define void @aesReadBlock(i32 %0, i32* %1, i32 %2) {
tail call void inttoptr (i64 50336233 to void (i32, i32*, i32)*)(i32 %0, i32* %1, i32 %2)
ret void
}
/* Variables and functions */
int atoi(char *);
int fact(int);
int /*<<< orphan*/ printf(char *, int, ...);
int main(int argc, char **argv) {
  int n = atoi(argv[1]);
  printf("%d\n", n);
  printf("The factorial of %d is %d\n", n, fact(n));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <fact@plt>
mov    -0x18(%rbp),%esi
mov    %eax,%edx
lea    0xe86(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x8(%rsi),%rdi
call   1050 <atoi@plt>
mov    %eax,%ebx
lea    0xed4(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebx,%edi
call   1040 <fact@plt>
lea    0xea6(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [27 x i8] c"The factorial of %d is %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = load i8**, i8*** %4
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = call i32 @atoi(i8* %8)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = load i32, i32* %5
%13 = load i32, i32* %5
%14 = call i32 @fact(i32 %13)
%15 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %12, i32 %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [27 x i8] c"The factorial of %d is %d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
%6 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = tail call i32 @fact(i32 %5)
%8 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %5, i32 %7)
ret i32 0
}
/* Variables and functions */
int bam_index_build(char const *, int /*<<< orphan*/);
int samtools_bam_index_build(const char *fn) { return bam_index_build(fn, 0); }


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

x86 assembly (clang, -O2):
<samtools_bam_index_build>:
xor    %esi,%esi
jmp    1030 <bam_index_build@plt>

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

LLVM IR (-O2):
define i32 @samtools_bam_index_build(i8* %0) {
%2 = tail call i32 @bam_index_build(i8* %0, i32 0)
ret i32 %2
}
void av_hwdevice_ctx_init() {}


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

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

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

LLVM IR (-O2):
define void @av_hwdevice_ctx_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ monitorProcessForkIfExist();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ watchAndStraceZygote();
int main(int argc, char **argv) {
  watchAndStraceZygote();
  while (1) {
    printf("watching...\n");
    sleep(3);
    monitorProcessForkIfExist();
  }
}


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 <watchAndStraceZygote@plt>
lea    0xe9c(%rip),%rdi
call   1040 <printf@plt>
mov    $0x3,%edi
call   1060 <sleep@plt>
mov    $0x0,%al
call   1030 <monitorProcessForkIfExist@plt>
jmp    115d <main+0x1d>

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <watchAndStraceZygote@plt>
lea    0xeb1(%rip),%rbx
nop
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0x3,%edi
call   1060 <sleep@plt>
xor    %eax,%eax
call   1040 <monitorProcessForkIfExist@plt>
jmp    1150 <main+0x10>

LLVM IR (-O0):
@.str = [13 x i8] c"watching...\0A\00"
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 (...) @watchAndStraceZygote()
br label %7
7: ; preds = %2, %7
%8 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @sleep(i32 3)
%10 = call i32 (...) @monitorProcessForkIfExist()
br label %7
}

LLVM IR (-O2):
@str = [12 x i8] c"watching...\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @watchAndStraceZygote()
br label %4
4: ; preds = %2, %4
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @sleep(i32 3)
%7 = tail call i32 (...) @monitorProcessForkIfExist()
br label %4
}
atod(c) char c;
{ return (((c < '0') || (c > '9')) ? -1 : c - '0'); }


x86 assembly (clang, -O0):
<atod>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x30,%eax
jl     1124 <atod+0x24>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
jle    1131 <atod+0x31>
mov    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    113b <atod+0x3b>
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<atod>:
movsbl %dil,%ecx
shl    $0x18,%edi
add    $0xc6ffffff,%edi
add    $0xffffffd0,%ecx
cmp    $0xf6ffffff,%edi
mov    $0xffffffff,%eax
cmovae %ecx,%eax
ret

LLVM IR (-O0):
define i32 @atod(i32 %0) {
%2 = alloca i8
%3 = trunc i32 %0 to i8
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp slt i32 %5, 48
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = icmp sgt i32 %9, 57
br i1 %10, label %11, label %12
11: ; preds = %7, %1
br label %16
12: ; preds = %7
%13 = load i8, i8* %2
%14 = sext i8 %13 to i32
%15 = sub nsw i32 %14, 48
br label %16
16: ; preds = %12, %11
%17 = phi i32 [ -1, %11 ], [ %15, %12 ]
ret i32 %17
}

LLVM IR (-O2):
define i32 @atod(i32 %0) {
%2 = shl i32 %0, 24
%3 = ashr exact i32 %2, 24
%4 = add i32 %2, -956301313
%5 = icmp ult i32 %4, -150994945
%6 = add nsw i32 %3, -48
%7 = select i1 %5, i32 -1, i32 %6
ret i32 %7
}
int qp_code(x)
register int x;
{
  if (x >= '0' && x <= '9')
    return x - '0';
  if (x >= 'a' && x <= 'f')
    return x - 'a' + 10;
  if (x >= 'A' && x <= 'F')
    return x - 'A' + 10;
  return -1;
}


x86 assembly (clang, -O0):
<qp_code>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x30,-0x8(%rbp)
jl     1129 <qp_code+0x29>
cmpl   $0x39,-0x8(%rbp)
jg     1129 <qp_code+0x29>
mov    -0x8(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    117a <qp_code+0x7a>
cmpl   $0x61,-0x8(%rbp)
jl     114e <qp_code+0x4e>
cmpl   $0x66,-0x8(%rbp)
jg     114e <qp_code+0x4e>
mov    -0x8(%rbp),%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    117a <qp_code+0x7a>
cmpl   $0x41,-0x8(%rbp)
jl     1173 <qp_code+0x73>
cmpl   $0x46,-0x8(%rbp)
jg     1173 <qp_code+0x73>
mov    -0x8(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    117a <qp_code+0x7a>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<qp_code>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%eax
jb     1127 <qp_code+0x27>
lea    -0x61(%rdi),%eax
cmp    $0x5,%eax
ja     1116 <qp_code+0x16>
add    $0xffffffa9,%edi
mov    %edi,%eax
ret
lea    -0x41(%rdi),%eax
add    $0xffffffc9,%edi
cmp    $0x6,%eax
mov    $0xffffffff,%eax
cmovb  %edi,%eax
ret

LLVM IR (-O0):
define i32 @qp_code(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 57
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 48
store i32 %11, i32* %2
br label %33
12: ; preds = %6, %1
%13 = load i32, i32* %3
%14 = icmp sge i32 %13, 97
br i1 %14, label %15, label %22
15: ; preds = %12
%16 = load i32, i32* %3
%17 = icmp sle i32 %16, 102
br i1 %17, label %18, label %22
18: ; preds = %15
%19 = load i32, i32* %3
%20 = sub nsw i32 %19, 97
%21 = add nsw i32 %20, 10
store i32 %21, i32* %2
br label %33
22: ; preds = %15, %12
%23 = load i32, i32* %3
%24 = icmp sge i32 %23, 65
br i1 %24, label %25, label %32
25: ; preds = %22
%26 = load i32, i32* %3
%27 = icmp sle i32 %26, 70
br i1 %27, label %28, label %32
28: ; preds = %25
%29 = load i32, i32* %3
%30 = sub nsw i32 %29, 65
%31 = add nsw i32 %30, 10
store i32 %31, i32* %2
br label %33
32: ; preds = %25, %22
store i32 -1, i32* %2
br label %33
33: ; preds = %32, %28, %18, %9
%34 = load i32, i32* %2
ret i32 %34
}

LLVM IR (-O2):
define i32 @qp_code(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
br i1 %3, label %14, label %4
4: ; preds = %1
%5 = add i32 %0, -97
%6 = icmp ult i32 %5, 6
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = add nsw i32 %0, -87
br label %14
9: ; preds = %4
%10 = add i32 %0, -65
%11 = icmp ult i32 %10, 6
%12 = add nsw i32 %0, -55
%13 = select i1 %11, i32 %12, i32 -1
br label %14
14: ; preds = %1, %9, %7
%15 = phi i32 [ %8, %7 ], [ %13, %9 ], [ %2, %1 ]
ret i32 %15
}
/* Type definitions */
struct tm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ strftime(char *, size_t, char const *, struct tm const *);
void my_strftime(char *buf, size_t len, const char *fmt, const struct tm *tm) {
  strftime(buf, len, fmt, tm);
}


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

x86 assembly (clang, -O2):
<my_strftime>:
jmp    1030 <strftime@plt>

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

LLVM IR (-O2):
%struct.tm = type { i32 }
define void @my_strftime(i8* %0, i64 %1, i8* %2, %struct.tm* %3) {
%5 = tail call i32 @strftime(i8* %0, i64 %1, i8* %2, %struct.tm* %3)
ret void
}
/* Variables and functions */
int EINVAL;
int native_pcm_poll_fds(int fd) {
  if (fd < 0)
    return -EINVAL;
  return 1;
}


x86 assembly (clang, -O0):
<native_pcm_poll_fds>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1124 <native_pcm_poll_fds+0x24>
xor    %eax,%eax
mov    0x2ec6(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    112b <native_pcm_poll_fds+0x2b>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<native_pcm_poll_fds>:
mov    0x2ed9(%rip),%rax
xor    %ecx,%ecx
sub    (%rax),%ecx
test   %edi,%edi
mov    $0x1,%eax
cmovs  %ecx,%eax
ret

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

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @native_pcm_poll_fds(i32 %0) {
%2 = icmp slt i32 %0, 0
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
%5 = select i1 %2, i32 %4, i32 1
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ siginfo_t;

/* Variables and functions */
void alarm_handler(int signo, siginfo_t *info, void *context) {}


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

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

LLVM IR (-O0):
define void @alarm_handler(i32 %0, i32* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i8*
store i32 %0, i32* %4
store i32* %1, i32** %5
store i8* %2, i8** %6
ret void
}

LLVM IR (-O2):
define void @alarm_handler(i32 %0, i32* nocapture %1, i8* nocapture %2) {
ret void
}
/* Variables and functions */
char *____secure_getenv_compat(char const *);
char *__wrap_secure_getenv(const char *name) {
  return ____secure_getenv_compat(name);
}


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

x86 assembly (clang, -O2):
<__wrap_secure_getenv>:
jmp    1030 <____secure_getenv_compat@plt>

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

LLVM IR (-O2):
define i8* @__wrap_secure_getenv(i8* %0) {
%2 = tail call i8* @____secure_getenv_compat(i8* %0)
ret i8* %2
}
float ft_rsqrt(float number) {
  long i;
  float x2;
  float y;
  const float threehalfs = 1.5F;
  x2 = number * 0.5F;
  y = number;
  i = *(long *)&y;
  i = 0x5f3759df - (i >> 1);
  y = *(float *)&i;
  y = y * (threehalfs - (x2 * y * y));
  y = y * (threehalfs - (x2 * y * y));
  return (y);
}


x86 assembly (clang, -O0):
<ft_rsqrt>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  0xee6(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
sar    $0x1,%rcx
mov    $0x5f3759df,%eax
sub    %rcx,%rax
mov    %rax,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
mulss  -0x18(%rbp),%xmm1
movss  -0x18(%rbp),%xmm2
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm1
movss  0xe7b(%rip),%xmm2
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
mulss  -0x18(%rbp),%xmm1
movss  -0x18(%rbp),%xmm2
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm1
movss  0xe41(%rip),%xmm2
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define float @ft_rsqrt(float %0) {
%2 = alloca float
%3 = alloca i64
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %2
store float 1.500000e+00, float* %6
%7 = load float, float* %2
%8 = fmul float %7, 5.000000e-01
store float %8, float* %4
%9 = load float, float* %2
store float %9, float* %5
%10 = bitcast float* %5 to i64*
%11 = load i64, i64* %10
store i64 %11, i64* %3
%12 = load i64, i64* %3
%13 = ashr i64 %12, 1
%14 = sub nsw i64 1597463007, %13
store i64 %14, i64* %3
%15 = bitcast i64* %3 to float*
%16 = load float, float* %15
store float %16, float* %5
%17 = load float, float* %5
%18 = load float, float* %4
%19 = load float, float* %5
%20 = fmul float %18, %19
%21 = load float, float* %5
%22 = fneg float %20
%23 = call float @llvm.fmuladd.f32(float %22, float %21, float 1.500000e+00)
%24 = fmul float %17, %23
store float %24, float* %5
%25 = load float, float* %5
%26 = load float, float* %4
%27 = load float, float* %5
%28 = fmul float %26, %27
%29 = load float, float* %5
%30 = fneg float %28
%31 = call float @llvm.fmuladd.f32(float %30, float %29, float 1.500000e+00)
%32 = fmul float %25, %31
store float %32, float* %5
%33 = load float, float* %5
ret float %33
}

LLVM IR (-O2):
define float @ft_rsqrt(float %0) {
ret float poison
}
/* Variables and functions */
int get_schoenflies(char *, double **, double **, int const *, int const,
                    double const, double const);
int spgat_get_schoenflies(char symbol[7], double lattice[3][3],
                          double position[][3], const int types[],
                          const int num_atom, const double symprec,
                          const double angle_tolerance) {
  return get_schoenflies(symbol, lattice, position, types, num_atom, symprec,
                         angle_tolerance);
}


x86 assembly (clang, -O0):
<spgat_get_schoenflies>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
movsd  %xmm0,-0x30(%rbp)
movsd  %xmm1,-0x38(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
movsd  -0x30(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm1
call   1030 <get_schoenflies@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spgat_get_schoenflies>:
jmp    1030 <get_schoenflies@plt>

LLVM IR (-O0):
define i32 @spgat_get_schoenflies(i8* %0, [3 x double]* %1, [3 x double]* %2, i32* %3, i32 %4, double %5, double %6) {
%8 = alloca i8*
%9 = alloca [3 x double]*
%10 = alloca [3 x double]*
%11 = alloca i32*
%12 = alloca i32
%13 = alloca double
%14 = alloca double
store i8* %0, i8** %8
store [3 x double]* %1, [3 x double]** %9
store [3 x double]* %2, [3 x double]** %10
store i32* %3, i32** %11
store i32 %4, i32* %12
store double %5, double* %13
store double %6, double* %14
%15 = load i8*, i8** %8
%16 = load [3 x double]*, [3 x double]** %9
%17 = bitcast [3 x double]* %16 to double**
%18 = load [3 x double]*, [3 x double]** %10
%19 = bitcast [3 x double]* %18 to double**
%20 = load i32*, i32** %11
%21 = load i32, i32* %12
%22 = load double, double* %13
%23 = load double, double* %14
%24 = call i32 @get_schoenflies(i8* %15, double** %17, double** %19, i32* %20, i32 %21, double %22, double %23)
ret i32 %24
}

LLVM IR (-O2):
define i32 @spgat_get_schoenflies(i8* %0, [3 x double]* %1, [3 x double]* %2, i32* %3, i32 %4, double %5, double %6) {
%8 = bitcast [3 x double]* %1 to double**
%9 = bitcast [3 x double]* %2 to double**
%10 = tail call i32 @get_schoenflies(i8* %0, double** %8, double** %9, i32* %3, i32 %4, double %5, double %6)
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ pthread_exit(void *);
void *thread_function(void *arg) {
  pthread_exit((void *)0);
  return NULL;
}


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

x86 assembly (clang, -O2):
<thread_function>:
push   %rax
xor    %edi,%edi
call   1030 <pthread_exit@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @thread_function(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @pthread_exit(i8* null)
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @thread_function(i8* nocapture readnone %0) {
%2 = tail call i32 @pthread_exit(i8* null)
ret i8* null
}
/* Type definitions */
typedef int /*<<< orphan*/ one;

/* Variables and functions */
int /*<<< orphan*/ SOL_TCP;
int /*<<< orphan*/ TCP_NODELAY;
int setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, int *, int);
int net_dont_delay(int fd) {
  int one = 1;
  return setsockopt(fd, SOL_TCP, TCP_NODELAY, &one, sizeof(one));
}


x86 assembly (clang, -O0):
<net_dont_delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb4(%rip),%rax
mov    (%rax),%esi
mov    0x2eb3(%rip),%rax
mov    (%rax),%edx
lea    -0x8(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<net_dont_delay>:
push   %rax
movl   $0x1,0x4(%rsp)
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
mov    0x2ebf(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
pop    %rcx
ret

LLVM IR (-O0):
@SOL_TCP = global i32 0
@TCP_NODELAY = global i32 0
define i32 @net_dont_delay(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* @SOL_TCP
%6 = load i32, i32* @TCP_NODELAY
%7 = call i32 @setsockopt(i32 %4, i32 %5, i32 %6, i32* %3, i32 4)
ret i32 %7
}

LLVM IR (-O2):
@SOL_TCP = global i32 0
@TCP_NODELAY = global i32 0
define i32 @net_dont_delay(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 1, i32* %2
%4 = load i32, i32* @SOL_TCP
%5 = load i32, i32* @TCP_NODELAY
%6 = call i32 @setsockopt(i32 %0, i32 %4, i32 %5, i32* %2, i32 4)
ret i32 %6
}
__attribute__((always_)) unsigned get_apic_id(unsigned long x) {
  return (((x) >> 24) & 0xFF);
}


x86 assembly (clang, -O0):
<get_apic_id>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x18,%rax
and    $0xff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_apic_id>:
mov    %rdi,%rax
shr    $0x18,%eax
ret

LLVM IR (-O0):
define i32 @get_apic_id(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 24
%5 = and i64 %4, 255
%6 = trunc i64 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @get_apic_id(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = lshr i32 %2, 24
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
scalar_t__ ntohl(scalar_t__);
uint32_t netbytes2uint32(uint8_t *s) {
  uint32_t *t = (uint32_t *)s;
  uint32_t ret = ntohl((uint32_t)*t);
  return ret;
}


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

x86 assembly (clang, -O2):
<netbytes2uint32>:
mov    (%rdi),%rdi
jmp    1030 <ntohl@plt>

LLVM IR (-O0):
define i64 @netbytes2uint32(i32* %0) {
%2 = alloca i32*
%3 = alloca i64*
%4 = alloca i64
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = bitcast i32* %5 to i64*
store i64* %6, i64** %3
%7 = load i64*, i64** %3
%8 = load i64, i64* %7
%9 = call i64 @ntohl(i64 %8)
store i64 %9, i64* %4
%10 = load i64, i64* %4
ret i64 %10
}

LLVM IR (-O2):
define i64 @netbytes2uint32(i32* nocapture %0) {
%2 = bitcast i32* %0 to i64*
%3 = load i64, i64* %2
%4 = tail call i64 @ntohl(i64 %3)
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ barrier_print(int, int *);
void *thread(void *id) {
  int i = 0;
  while (1) {
    i++;
    barrier_print(i, (int *)id);
  }
}


x86 assembly (clang, -O0):
<thread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1030 <barrier_print@plt>
jmp    1123 <thread+0x13>

x86 assembly (clang, -O2):
<thread>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0x1,%ebp
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
mov    %rbx,%rsi
call   1030 <barrier_print@plt>
add    $0x1,%ebp
jmp    1120 <thread+0x10>

LLVM IR (-O0):
define i8* @thread(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %1, %4
%5 = load i32, i32* %3
%6 = add nsw i32 %5, 1
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = load i8*, i8** %2
%9 = bitcast i8* %8 to i32*
%10 = call i32 @barrier_print(i32 %7, i32* %9)
br label %4
}

LLVM IR (-O2):
define noalias i8* @thread(i8* %0) {
%2 = bitcast i8* %0 to i32*
br label %3
3: ; preds = %3, %1
%4 = phi i32 [ 0, %1 ], [ %5, %3 ]
%5 = add nuw nsw i32 %4, 1
%6 = tail call i32 @barrier_print(i32 %5, i32* %2)
br label %3
}