xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void fig09_15() {
  printf("%+09d\n", 452);
  printf("%09d\n", 452);
}


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

x86 assembly (clang, -O2):
<fig09_15>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x1c4,%esi
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
mov    $0x1c4,%esi
pop    %rax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"%+09d\0A\00"
@.str.1 = [6 x i8] c"%09d\0A\00"
define void @fig09_15() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 452)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 452)
ret void
}
void RTAvlroIOPortRangeRemove(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAvlroIOPortRangeRemove() {
ret void
}
int bitsize(int size) {
  int newsize = size / 8;
  if (size % 8 != 0)
    newsize++;
  return (newsize);
}


x86 assembly (clang, -O0):
<bitsize>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1132 <bitsize+0x32>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitsize>:
lea    0x7(%rdi),%eax
test   %edi,%edi
cmovns %edi,%eax
sar    $0x3,%eax
and    $0x7,%edi
cmp    $0x1,%edi
sbb    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @bitsize(i32 %0) {
%2 = sdiv i32 %0, 8
%3 = and i32 %0, 7
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
%6 = add nsw i32 %2, %5
ret i32 %6
}
int test_imm_0Euint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x0E << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_0Euint64_lowword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
and    $0xe,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_0Euint64_lowword_mem>:
testb  $0xe,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_0Euint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 14
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_0Euint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 14
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int floor(double);
double modpi(double x) {
  return x - floor(x / (2 * 3.14159265358979323846) + 0.5) *
                 (2 * 3.14159265358979323846);
}


x86 assembly (clang, -O0):
<modpi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xecc(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xec8(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1030 <floor@plt>
movsd  -0x10(%rbp),%xmm1
cvtsi2sd %eax,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xe8f(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<modpi>:
push   %rax
movsd  %xmm0,(%rsp)
divsd  0xee2(%rip),%xmm0
addsd  0xee2(%rip),%xmm0
call   1030 <floor@plt>
cvtsi2sd %eax,%xmm1
mulsd  0xec9(%rip),%xmm1
movsd  (%rsp),%xmm0
subsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @modpi(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fdiv double %4, 0x401921FB54442D18
%6 = fadd double %5, 5.000000e-01
%7 = call i32 @floor(double %6)
%8 = sitofp i32 %7 to double
%9 = fneg double %8
%10 = call double @llvm.fmuladd.f64(double %9, double 0x401921FB54442D18, double %3)
ret double %10
}

LLVM IR (-O2):
define double @modpi(double %0) {
%2 = fdiv double %0, 0x401921FB54442D18
%3 = fadd double %2, 5.000000e-01
%4 = tail call i32 @floor(double %3)
%5 = sitofp i32 %4 to double
%6 = fneg double %5
%7 = tail call double @llvm.fmuladd.f64(double %6, double 0x401921FB54442D18, double %0)
ret double %7
}
/* Variables and functions */
char const *get_builtin_mime_type(char const *, char *);
const char *mg_get_builtin_mime_type(const char *path) {
  return get_builtin_mime_type(path, "text/plain");
}


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

x86 assembly (clang, -O2):
<mg_get_builtin_mime_type>:
lea    0xee9(%rip),%rsi
jmp    1030 <get_builtin_mime_type@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"text/plain\00"
define i8* @mg_get_builtin_mime_type(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @get_builtin_mime_type(i8* %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i8* %4
}

LLVM IR (-O2):
@.str = [11 x i8] c"text/plain\00"
define i8* @mg_get_builtin_mime_type(i8* %0) {
%2 = tail call i8* @get_builtin_mime_type(i8* %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ ausgabe(void *, int, int);
int /*<<< orphan*/ rahmen(void *, int, int);
int /*<<< orphan*/ stern(void *, int, int, int, int);
int main() {
  char feld[20][15];
  int z0 = 7, s0 = 4;
  void *vp_feld = feld;
  rahmen(vp_feld, 20, 15);
  stern(vp_feld, 20, 15, z0, s0);
  ausgabe(vp_feld, 20, 15);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x140,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x7,-0x134(%rbp)
movl   $0x4,-0x138(%rbp)
lea    -0x130(%rbp),%rax
mov    %rax,-0x140(%rbp)
mov    -0x140(%rbp),%rdi
mov    $0x14,%esi
mov    $0xf,%edx
call   1040 <rahmen@plt>
mov    -0x140(%rbp),%rdi
mov    -0x134(%rbp),%ecx
mov    -0x138(%rbp),%r8d
mov    $0x14,%esi
mov    $0xf,%edx
call   1050 <stern@plt>
mov    -0x140(%rbp),%rdi
mov    $0x14,%esi
mov    $0xf,%edx
call   1030 <ausgabe@plt>
xor    %eax,%eax
add    $0x140,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x130,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x14,%esi
mov    $0xf,%edx
call   1040 <rahmen@plt>
mov    %rbx,%rdi
mov    $0x14,%esi
mov    $0xf,%edx
mov    $0x7,%ecx
mov    $0x4,%r8d
call   1050 <stern@plt>
mov    %rbx,%rdi
mov    $0x14,%esi
mov    $0xf,%edx
call   1030 <ausgabe@plt>
xor    %eax,%eax
add    $0x130,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x [15 x i8]]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 0, i32* %1
store i32 7, i32* %3
store i32 4, i32* %4
%6 = getelementptr inbounds [20 x [15 x i8]], [20 x [15 x i8]]* %2, i64 0, i64 0
%7 = bitcast [15 x i8]* %6 to i8*
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = call i32 @rahmen(i8* %8, i32 20, i32 15)
%10 = load i8*, i8** %5
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = call i32 @stern(i8* %10, i32 20, i32 15, i32 %11, i32 %12)
%14 = load i8*, i8** %5
%15 = call i32 @ausgabe(i8* %14, i32 20, i32 15)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [20 x [15 x i8]]
%2 = getelementptr inbounds [20 x [15 x i8]], [20 x [15 x i8]]* %1, i64 0, i64 0, i64 0
%3 = call i32 @rahmen(i8* %2, i32 20, i32 15)
%4 = call i32 @stern(i8* %2, i32 20, i32 15, i32 7, i32 4)
%5 = call i32 @ausgabe(i8* %2, i32 20, i32 15)
ret i32 0
}
/* Variables and functions */
int addnumbers(int, int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, const char *argv[]) {
  int total;
  total = addnumbers(2, 4);
  printf("total = %d\n", total);
  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)
mov    $0x2,%edi
mov    $0x4,%esi
call   1040 <addnumbers@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [12 x i8] c"total = %d\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
%7 = call i32 @addnumbers(i32 2, i32 4)
store i32 %7, i32* %6
%8 = load i32, i32* %6
%9 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"total = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @addnumbers(i32 2, i32 4)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int atoi(char *);
void convert(char *strings[], int numbers[], int length) {
  int i;
  for (i = 0; i < length; i++) {
    numbers[i] = atoi(strings[i]);
  }
}


x86 assembly (clang, -O0):
<convert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1162 <convert+0x52>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <atoi@plt>
mov    %eax,%edx
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    112a <convert+0x1a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edx,%edx
jle    1146 <convert+0x36>
mov    %rsi,%r14
mov    %rdi,%r15
mov    %edx,%r12d
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    (%r15,%rbx,8),%rdi
call   1030 <atoi@plt>
mov    %eax,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <convert+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @convert(i8** nocapture %0, i32* nocapture writeonly %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %15
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %13, %7 ]
%9 = getelementptr inbounds i8*, i8** %0, i64 %8
%10 = load i8*, i8** %9
%11 = tail call i32 @atoi(i8* %10)
%12 = getelementptr inbounds i32, i32* %1, i64 %8
store i32 %11, i32* %12
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %15, label %7
15: ; preds = %7, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ putchar(int /*<<< orphan*/);
main() {
  char *p = "abed";
  while (*p) {
    putchar(*p++);
  }
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1163 <main+0x43>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%edi
call   1030 <putchar@plt>
jmp    113a <main+0x1a>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x61,%edi
call   1030 <putchar@plt>
mov    $0x62,%edi
call   1030 <putchar@plt>
mov    $0x65,%edi
call   1030 <putchar@plt>
mov    $0x64,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @putchar(i32 97)
%2 = tail call i32 @putchar(i32 98)
%3 = tail call i32 @putchar(i32 101)
%4 = tail call i32 @putchar(i32 100)
%5 = tail call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int delete ();
int /*<<< orphan*/ left();
int delete_left(void) {
  if (!left())
    return delete ();
  return 1;
}


x86 assembly (clang, -O0):
<delete_left>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <left@plt>
cmp    $0x0,%eax
jne    1147 <delete_left+0x27>
mov    $0x0,%al
call   1040 <delete@plt>
mov    %eax,-0x4(%rbp)
jmp    114e <delete_left+0x2e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delete_left>:
push   %rax
xor    %eax,%eax
call   1030 <left@plt>
test   %eax,%eax
je     1133 <delete_left+0x13>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
jmp    1040 <delete@plt>

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

LLVM IR (-O2):
define i32 @delete_left() {
%1 = tail call i32 (...) @left()
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @delete()
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ %4, %3 ], [ 1, %0 ]
ret i32 %6
}
/* Variables and functions */
double _atan2(double, double);
double atan2(double y, double x) { return _atan2(y, x); }


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

x86 assembly (clang, -O2):
<atan2>:
jmp    1030 <_atan2@plt>

LLVM IR (-O0):
define double @atan2(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double @_atan2(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @atan2(double %0, double %1) {
%3 = tail call double @_atan2(double %0, double %1)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ MAP_HUGETLB;
int /*<<< orphan*/ mmap_chunks_higher(int, int /*<<< orphan*/);
int /*<<< orphan*/ mmap_chunks_lower(int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void alloc_16m() {
  printf("Allocating 16M chunks < 128TB \n");
  mmap_chunks_lower(64, MAP_HUGETLB);
  printf("Allocating 16M chunks > 128TB \n");
  mmap_chunks_higher(64, MAP_HUGETLB);
}


x86 assembly (clang, -O0):
<alloc_16m>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
mov    $0x40,%edi
call   1050 <mmap_chunks_lower@plt>
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e8a(%rip),%rax
mov    (%rax),%esi
mov    $0x40,%edi
call   1040 <mmap_chunks_higher@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_16m>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eac(%rip),%rbx
mov    (%rbx),%esi
mov    $0x40,%edi
call   1050 <mmap_chunks_lower@plt>
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
mov    (%rbx),%esi
mov    $0x40,%edi
pop    %rbx
jmp    1040 <mmap_chunks_higher@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"Allocating 16M chunks < 128TB \0A\00"
@MAP_HUGETLB = global i32 0
@.str.1 = [32 x i8] c"Allocating 16M chunks > 128TB \0A\00"
define void @alloc_16m() {
%1 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @MAP_HUGETLB
%3 = call i32 @mmap_chunks_lower(i32 64, i32 %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @MAP_HUGETLB
%6 = call i32 @mmap_chunks_higher(i32 64, i32 %5)
ret void
}

LLVM IR (-O2):
@MAP_HUGETLB = global i32 0
@str = [31 x i8] c"Allocating 16M chunks < 128TB \00"
@str.2 = [31 x i8] c"Allocating 16M chunks > 128TB \00"
define void @alloc_16m() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @MAP_HUGETLB
%3 = tail call i32 @mmap_chunks_lower(i32 64, i32 %2)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.2, i64 0, i64 0))
%5 = load i32, i32* @MAP_HUGETLB
%6 = tail call i32 @mmap_chunks_higher(i32 64, i32 %5)
ret void
}
__attribute__((no, noclone)) unsigned __int128 t174_5mul(unsigned __int128 x) {
  unsigned __int128 r;
  if (__builtin_mul_overflow(x, (unsigned __int128)(2), &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t174_5mul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdx
mov    -0x28(%rbp),%rcx
add    %rdx,%rdx
adc    %rcx,%rcx
setb   %al
mov    %rdx,-0x40(%rbp)
mov    %rcx,-0x38(%rbp)
test   $0x1,%al
jne    1156 <t174_5mul+0x46>
jmp    115d <t174_5mul+0x4d>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x40(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t174_5mul>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
add    %rdi,%rbx
adc    %rsi,%r14
jae    1129 <t174_5mul+0x19>
xor    %eax,%eax
call   1030 <bar@plt>
mov    %rbx,%rax
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define { i64, i64 } @t174_5mul(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = bitcast i128* %4 to { i64, i64 }*
%8 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 0
store i64 %0, i64* %8
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 1
store i64 %1, i64* %9
%10 = load i128, i128* %4
store i128 %10, i128* %5
%11 = load i128, i128* %5
%12 = call { i128, i1 } @llvm.umul.with.overflow.i128(i128 %11, i128 2)
%13 = extractvalue { i128, i1 } %12, 1
%14 = extractvalue { i128, i1 } %12, 0
store i128 %14, i128* %6
br i1 %13, label %15, label %17
15: ; preds = %2
%16 = call i32 (...) @bar()
br label %17
17: ; preds = %15, %2
%18 = load i128, i128* %6
store i128 %18, i128* %3
%19 = bitcast i128* %3 to { i64, i64 }*
%20 = load { i64, i64 }, { i64, i64 }* %19
ret { i64, i64 } %20
}

LLVM IR (-O2):
define { i64, i64 } @t174_5mul(i64 %0, i64 %1) {
%3 = zext i64 %1 to i128
%4 = shl nuw i128 %3, 64
%5 = zext i64 %0 to i128
%6 = or i128 %4, %5
%7 = tail call { i128, i1 } @llvm.umul.with.overflow.i128(i128 %6, i128 2)
%8 = extractvalue { i128, i1 } %7, 1
%9 = extractvalue { i128, i1 } %7, 0
br i1 %8, label %10, label %12
10: ; preds = %2
%11 = tail call i32 (...) @bar()
br label %12
12: ; preds = %10, %2
%13 = trunc i128 %9 to i64
%14 = lshr i128 %9, 64
%15 = trunc i128 %14 to i64
%16 = insertvalue { i64, i64 } poison, i64 %13, 0
%17 = insertvalue { i64, i64 } %16, i64 %15, 1
ret { i64, i64 } %17
}
/* Variables and functions */
int laguna_readb(int);
int __svgalib_laguna_inmisc(void) { return laguna_readb(0x80); }


x86 assembly (clang, -O0):
<__svgalib_laguna_inmisc>:
push   %rbp
mov    %rsp,%rbp
mov    $0x80,%edi
call   1030 <laguna_readb@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__svgalib_laguna_inmisc>:
mov    $0x80,%edi
jmp    1030 <laguna_readb@plt>

LLVM IR (-O0):
define i32 @__svgalib_laguna_inmisc() {
%1 = call i32 @laguna_readb(i32 128)
ret i32 %1
}

LLVM IR (-O2):
define i32 @__svgalib_laguna_inmisc() {
%1 = tail call i32 @laguna_readb(i32 128)
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
void nocrash_fseek() {
  FILE *f;
  f = fopen("this_file_doesnt_exist", "r");
  if (f) {
    fseek(f, 7, SEEK_SET);
    fclose(f);
  }
}


x86 assembly (clang, -O0):
<nocrash_fseek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0xed1(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     117a <nocrash_fseek+0x4a>
mov    -0x8(%rbp),%rdi
mov    0x2e7b(%rip),%rax
mov    (%rax),%edx
mov    $0x7,%esi
call   1040 <fseek@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nocrash_fseek>:
push   %rbx
lea    0xec8(%rip),%rdi
lea    0xed8(%rip),%rsi
call   1050 <fopen@plt>
test   %rax,%rax
je     116b <nocrash_fseek+0x3b>
mov    %rax,%rbx
mov    0x2e8d(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    $0x7,%esi
call   1040 <fseek@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fclose@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"this_file_doesnt_exist\00"
@.str.1 = [2 x i8] c"r\00"
@SEEK_SET = global i32 0
define void @nocrash_fseek() {
%1 = alloca i32*
%2 = call i32* @fopen(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = icmp ne i32* %3, null
br i1 %4, label %5, label %11
5: ; preds = %0
%6 = load i32*, i32** %1
%7 = load i32, i32* @SEEK_SET
%8 = call i32 @fseek(i32* %6, i32 7, i32 %7)
%9 = load i32*, i32** %1
%10 = call i32 @fclose(i32* %9)
br label %11
11: ; preds = %5, %0
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"this_file_doesnt_exist\00"
@.str.1 = [2 x i8] c"r\00"
@SEEK_SET = global i32 0
define void @nocrash_fseek() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i32* %1, null
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = load i32, i32* @SEEK_SET
%5 = tail call i32 @fseek(i32* %1, i32 7, i32 %4)
%6 = tail call i32 @fclose(i32* %1)
br label %7
7: ; preds = %3, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ heapify(int *, int, int);
void buildheap(int arr[], int len) {
  int i;
  for (i = len / 2; i >= 0; i--) {
    heapify(arr, i, len);
  }
}


x86 assembly (clang, -O0):
<buildheap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     1154 <buildheap+0x44>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <heapify@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    112d <buildheap+0x1d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buildheap>:
push   %rbp
push   %r14
push   %rbx
cmp    $0xffffffff,%esi
jl     1141 <buildheap+0x31>
mov    %esi,%ebx
mov    %rdi,%r14
mov    %esi,%ebp
shr    $0x1f,%ebp
add    %esi,%ebp
sar    %ebp
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   1030 <heapify@plt>
add    $0xffffffff,%ebp
jb     1130 <buildheap+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @buildheap(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, -2
br i1 %3, label %4, label %11
4: ; preds = %2
%5 = sdiv i32 %1, 2
br label %6
6: ; preds = %4, %6
%7 = phi i32 [ %9, %6 ], [ %5, %4 ]
%8 = tail call i32 @heapify(i32* %0, i32 %7, i32 %1)
%9 = add nsw i32 %7, -1
%10 = icmp eq i32 %7, 0
br i1 %10, label %11, label %6
11: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HwCopterControlHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void HwCopterControlUpdated() { UAVObjUpdated(HwCopterControlHandle()); }


x86 assembly (clang, -O0):
<HwCopterControlUpdated>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <HwCopterControlHandle@plt>
mov    %eax,%edi
call   1030 <UAVObjUpdated@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<HwCopterControlUpdated>:
push   %rax
xor    %eax,%eax
call   1040 <HwCopterControlHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <UAVObjUpdated@plt>

LLVM IR (-O0):
define void @HwCopterControlUpdated() {
%1 = call i32 (...) @HwCopterControlHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @HwCopterControlUpdated() {
%1 = tail call i32 (...) @HwCopterControlHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
unsigned xrop3_130_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = T ^ S;
  stk2 = ~stk2;
  stk1 = D & stk2;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_130_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_130_1_1>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
mov    %esi,%ecx
shl    $0x8,%ecx
or     %esi,%ecx
or     %eax,%ecx
mov    %edi,%eax
xor    %sil,%al
not    %al
movzbl %al,%eax
not    %ecx
and    %eax,%ecx
or     %dil,%sil
movzbl %sil,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_130_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %7
%23 = load i32, i32* %6
%24 = xor i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %9
%26 = xor i32 %25, -1
store i32 %26, i32* %9
%27 = load i32, i32* %5
%28 = load i32, i32* %9
%29 = and i32 %27, %28
store i32 %29, i32* %8
%30 = load i32, i32* %8
%31 = load i32, i32* %6
%32 = xor i32 %31, -1
%33 = and i32 %30, %32
%34 = load i32, i32* %7
%35 = xor i32 %34, -1
%36 = and i32 %33, %35
%37 = load i32, i32* %5
%38 = load i32, i32* %6
%39 = and i32 %37, %38
%40 = or i32 %36, %39
%41 = load i32, i32* %5
%42 = load i32, i32* %7
%43 = and i32 %41, %42
%44 = or i32 %40, %43
ret i32 %44
}

LLVM IR (-O2):
define i32 @xrop3_130_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i8 %0, %1
%8 = xor i8 %7, -1
%9 = zext i8 %8 to i32
%10 = or i32 %6, %4
%11 = xor i32 %10, -1
%12 = and i32 %11, %9
%13 = or i8 %1, %0
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
ret i32 %15
}
void clearScreen() { return; }


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

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

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

LLVM IR (-O2):
define void @clearScreen() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void f() {
  int array[1];
  int *p = &array[0];
  assert(p != 0);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    $0x1,%edi
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @f() {
%1 = alloca [1 x i32]
%2 = alloca i32*
%3 = getelementptr inbounds [1 x i32], [1 x i32]* %1, i64 0, i64 0
store i32* %3, i32** %2
%4 = load i32*, i32** %2
%5 = icmp ne i32* %4, null
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
ret void
}

LLVM IR (-O2):
define void @f() {
%1 = tail call i32 @assert(i32 1)
ret void
}
/* Type definitions */
struct hash_table_entry {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ get_hash(char const *, int /*<<< orphan*/);
struct hash_table_entry *hashtable_entry_get_hash(void *, char const *,
                                                  int /*<<< orphan*/);
struct hash_table_entry *hashtable_entry_get(void *h, const char *key) {
  return hashtable_entry_get_hash(h, key, get_hash(key, 0));
}


x86 assembly (clang, -O0):
<hashtable_entry_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1030 <get_hash@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1040 <hashtable_entry_get_hash@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashtable_entry_get>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
xor    %esi,%esi
call   1030 <get_hash@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <hashtable_entry_get_hash@plt>

LLVM IR (-O0):
%struct.hash_table_entry = type { i32 }
define %struct.hash_table_entry* @hashtable_entry_get(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @get_hash(i8* %7, i32 0)
%9 = call %struct.hash_table_entry* @hashtable_entry_get_hash(i8* %5, i8* %6, i32 %8)
ret %struct.hash_table_entry* %9
}

LLVM IR (-O2):
%struct.hash_table_entry = type { i32 }
define %struct.hash_table_entry* @hashtable_entry_get(i8* %0, i8* %1) {
%3 = tail call i32 @get_hash(i8* %1, i32 0)
%4 = tail call %struct.hash_table_entry* @hashtable_entry_get_hash(i8* %0, i8* %1, i32 %3)
ret %struct.hash_table_entry* %4
}
void rop3_222_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D ^ T;
  stk1 = S | stk2;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_222_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xa(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @rop3_222_1_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = load i8, i8* %6
%13 = zext i8 %12 to i32
%14 = xor i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %8
%16 = load i8, i8* %5
%17 = zext i8 %16 to i32
%18 = load i8, i8* %8
%19 = zext i8 %18 to i32
%20 = or i32 %17, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %7
%22 = load i8, i8* %7
%23 = zext i8 %22 to i32
%24 = load i8, i8* %5
%25 = zext i8 %24 to i32
%26 = xor i32 %25, -1
%27 = and i32 %23, %26
%28 = load i8, i8* %6
%29 = zext i8 %28 to i32
%30 = xor i32 %29, -1
%31 = and i32 %27, %30
%32 = load i8*, i8** %4
%33 = load i8, i8* %32
%34 = zext i8 %33 to i32
%35 = load i8, i8* %5
%36 = zext i8 %35 to i32
%37 = and i32 %34, %36
%38 = or i32 %31, %37
%39 = load i8*, i8** %4
%40 = load i8, i8* %39
%41 = zext i8 %40 to i32
%42 = load i8, i8* %6
%43 = zext i8 %42 to i32
%44 = and i32 %41, %43
%45 = or i32 %38, %44
%46 = trunc i32 %45 to i8
%47 = load i8*, i8** %4
store i8 %46, i8* %47
ret void
}

LLVM IR (-O2):
define void @rop3_222_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
ret void
}
BOOST_AUTO_TEST_CASE(arctan) { TESTCASE1(arctan, 0, 0); }


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

x86 assembly (clang, -O2):
<BOOST_AUTO_TEST_CASE>:
xor    %esi,%esi
xor    %edx,%edx
xor    %eax,%eax
jmp    1030 <TESTCASE1@plt>

LLVM IR (-O0):
define i32 @BOOST_AUTO_TEST_CASE(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE1 to i32 (i32, i32, i32, ...)*)(i32 %4, i32 0, i32 0)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @BOOST_AUTO_TEST_CASE(i32 %0) {
%2 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE1 to i32 (i32, i32, i32, ...)*)(i32 %0, i32 0, i32 0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0xb5() {
  Assert_real((isodigit(181) == 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_isodigit.c",
              910, ("isodigit should be 0 for 0xb5"));
}


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

x86 assembly (clang, -O2):
<t_isodigit_0xb5>:
push   %rax
mov    $0xb5,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x38e,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xb5\00"
define void @t_isodigit_0xb5() {
%1 = call i64 @isodigit(i32 181)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 910, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xb5\00"
define void @t_isodigit_0xb5() {
%1 = tail call i64 @isodigit(i32 181)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 910, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
void sigquit() {
  printf("CHILD: My DADDY has Killed me!!!\n");
  printf("CHILD: cleaning up...\n");
  sleep(2);
  exit(0);
}


x86 assembly (clang, -O0):
<sigquit>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1050 <sleep@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<sigquit>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
lea    0xedd(%rip),%rdi
call   1030 <puts@plt>
mov    $0x2,%edi
call   1050 <sleep@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"CHILD: My DADDY has Killed me!!!\0A\00"
@.str.1 = [23 x i8] c"CHILD: cleaning up...\0A\00"
define void @sigquit() {
%1 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @sleep(i32 2)
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [33 x i8] c"CHILD: My DADDY has Killed me!!!\00"
@str.2 = [22 x i8] c"CHILD: cleaning up...\00"
define void @sigquit() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.2, i64 0, i64 0))
%3 = tail call i32 @sleep(i32 2)
%4 = tail call i32 @exit(i32 0)
unreachable
}
void call3c(float *fp, double *dp) {
  fp = 0;
  dp = 0;
}


x86 assembly (clang, -O0):
<call3c>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @call3c(float* %0, double* %1) {
%3 = alloca float*
%4 = alloca double*
store float* %0, float** %3
store double* %1, double** %4
store float* null, float** %3
store double* null, double** %4
ret void
}

LLVM IR (-O2):
define void @call3c(float* nocapture %0, double* nocapture %1) {
ret void
}
int foo14() { return 14; }


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

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

LLVM IR (-O0):
define i32 @foo14() {
ret i32 14
}

LLVM IR (-O2):
define i32 @foo14() {
ret i32 14
}
/* Variables and functions */
int O_CREAT;
int O_TRUNC;
int O_WRONLY;
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ close(int);
int open(char const *, int, int);
int /*<<< orphan*/ write_types(int);
int vkext_write(const char *filename) {
  int f = open(filename, O_CREAT | O_WRONLY | O_TRUNC, 0640);
  assert(f >= 0);
  write_types(f);
  close(f);
  return 0;
}


x86 assembly (clang, -O0):
<vkext_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea1(%rip),%rax
mov    (%rax),%esi
mov    0x2e68(%rip),%rax
or     (%rax),%esi
mov    0x2e87(%rip),%rax
or     (%rax),%esi
mov    $0x1a0,%edx
call   1060 <open@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0xc(%rbp),%edi
call   1050 <write_types@plt>
mov    -0xc(%rbp),%edi
call   1030 <close@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vkext_write>:
push   %rbx
mov    0x2eb0(%rip),%rax
mov    0x2e79(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2e96(%rip),%rax
or     (%rax),%esi
mov    $0x1a0,%edx
call   1060 <open@plt>
mov    %eax,%ebx
mov    %eax,%edi
not    %edi
shr    $0x1f,%edi
call   1040 <assert@plt>
mov    %ebx,%edi
call   1050 <write_types@plt>
mov    %ebx,%edi
call   1030 <close@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@O_CREAT = global i32 0
@O_WRONLY = global i32 0
@O_TRUNC = global i32 0
define i32 @vkext_write(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i32, i32* @O_CREAT
%6 = load i32, i32* @O_WRONLY
%7 = or i32 %5, %6
%8 = load i32, i32* @O_TRUNC
%9 = or i32 %7, %8
%10 = call i32 @open(i8* %4, i32 %9, i32 416)
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = icmp sge i32 %11, 0
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = load i32, i32* %3
%16 = call i32 @write_types(i32 %15)
%17 = load i32, i32* %3
%18 = call i32 @close(i32 %17)
ret i32 0
}

LLVM IR (-O2):
@O_CREAT = global i32 0
@O_WRONLY = global i32 0
@O_TRUNC = global i32 0
define i32 @vkext_write(i8* nocapture %0) {
%2 = load i32, i32* @O_CREAT
%3 = load i32, i32* @O_WRONLY
%4 = or i32 %3, %2
%5 = load i32, i32* @O_TRUNC
%6 = or i32 %4, %5
%7 = tail call i32 @open(i8* %0, i32 %6, i32 416)
%8 = xor i32 %7, -1
%9 = lshr i32 %8, 31
%10 = tail call i32 @assert(i32 %9)
%11 = tail call i32 @write_types(i32 %7)
%12 = tail call i32 @close(i32 %7)
ret i32 0
}
int main() {
  int prev1 = 0;
  int prev2 = 1;
  while (1) {
    int new = prev1 + prev2;
    *((volatile int *)0x8000) = new;
    prev1 = prev2;
    prev2 = new;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%ecx
mov    $0x8000,%eax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1119 <main+0x19>

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
mov    $0x1,%ecx
nopw   0x0(%rax,%rax,1)
mov    %ecx,%edx
add    %ecx,%eax
mov    %eax,0x8000
mov    %eax,%ecx
mov    %edx,%eax
jmp    1110 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 1, i32* %3
br label %5
5: ; preds = %0, %5
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = add nsw i32 %6, %7
store i32 %8, i32* %4
%9 = load i32, i32* %4
store volatile i32 %9, i32* inttoptr (i64 32768 to i32*)
%10 = load i32, i32* %3
store i32 %10, i32* %2
%11 = load i32, i32* %4
store i32 %11, i32* %3
br label %5
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 1, %0 ], [ %4, %1 ]
%3 = phi i32 [ 0, %0 ], [ %2, %1 ]
%4 = add nsw i32 %3, %2
store volatile i32 %4, i32* inttoptr (i64 32768 to i32*)
br label %1
}
void XtRemoveInput() {}


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

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

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

LLVM IR (-O2):
define void @XtRemoveInput() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, char const *, char const *,
                          char const *, char const *);
int Usage(const char *name) {
  printf("usage:  %s [-n] variable ... \n"
         "        %s [-n] -w variable=value ... \n"
         "        %s [-n] -a \n"
         "        %s [-n] -p <file>   (default /etc/sysctl.conf) \n"
         "        %s [-n] -A\n",
         name, name, name, name, name);
  return -1;
}


x86 assembly (clang, -O0):
<Usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x8(%rbp),%rdx
mov    -0x8(%rbp),%rcx
mov    -0x8(%rbp),%r8
mov    -0x8(%rbp),%r9
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Usage>:
push   %rax
mov    %rdi,%rcx
lea    0xee5(%rip),%rdi
mov    %rcx,%rsi
mov    %rcx,%rdx
mov    %rcx,%r8
mov    %rcx,%r9
call   1030 <printf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [165 x i8] c"usage: %s [-n] variable ... \0A %s [-n] -w variable=value ... \0A %s [-n] -a \0A %s [-n] -p <file> (default /etc/sysctl.conf) \0A %s [-n] -A\0A\00"
define i32 @Usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = load i8*, i8** %2
%6 = load i8*, i8** %2
%7 = load i8*, i8** %2
%8 = call i32 @printf(i8* getelementptr inbounds ([165 x i8], [165 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %4, i8* %5, i8* %6, i8* %7)
ret i32 -1
}

LLVM IR (-O2):
@.str = [165 x i8] c"usage: %s [-n] variable ... \0A %s [-n] -w variable=value ... \0A %s [-n] -a \0A %s [-n] -p <file> (default /etc/sysctl.conf) \0A %s [-n] -A\0A\00"
define i32 @Usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([165 x i8], [165 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %0, i8* %0, i8* %0, i8* %0)
ret i32 -1
}