xunge/DecIR huggingface dataset:
/* Variables and functions */
double sqrt(double);
double fnSD(double dVal) { return sqrt(dVal); }


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

x86 assembly (clang, -O2):
<fnSD>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     111f <fnSD+0xf>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

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

LLVM IR (-O2):
define double @fnSD(double %0) {
%2 = tail call double @sqrt(double %0)
ret double %2
}
/* Variables and functions */
void *malloc(unsigned int);
void *g_malloc_n(unsigned int n_blocks, unsigned int n_block_bytes) {
  return malloc(n_blocks * n_block_bytes);
}


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

x86 assembly (clang, -O2):
<g_malloc_n>:
imul   %esi,%edi
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @g_malloc_n(i32 %0, i32 %1) {
%3 = mul i32 %1, %0
%4 = tail call i8* @malloc(i32 %3)
ret i8* %4
}
/* Type definitions */
struct hash_table {
  int dummy;
};
struct dict {
  int dummy;
};

/* Variables and functions */
void *hash_table_get(struct hash_table *, char const *);
void *dict_get(struct dict *pt, const char *key) {
  return hash_table_get((struct hash_table *)pt, key);
}


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

x86 assembly (clang, -O2):
<dict_get>:
jmp    1030 <hash_table_get@plt>

LLVM IR (-O0):
%struct.dict = type { i32 }
%struct.hash_table = type { i32 }
define i8* @dict_get(%struct.dict* %0, i8* %1) {
%3 = alloca %struct.dict*
%4 = alloca i8*
store %struct.dict* %0, %struct.dict** %3
store i8* %1, i8** %4
%5 = load %struct.dict*, %struct.dict** %3
%6 = bitcast %struct.dict* %5 to %struct.hash_table*
%7 = load i8*, i8** %4
%8 = call i8* @hash_table_get(%struct.hash_table* %6, i8* %7)
ret i8* %8
}

LLVM IR (-O2):
%struct.dict = type { i32 }
%struct.hash_table = type { i32 }
define i8* @dict_get(%struct.dict* %0, i8* %1) {
%3 = bitcast %struct.dict* %0 to %struct.hash_table*
%4 = tail call i8* @hash_table_get(%struct.hash_table* %3, i8* %1)
ret i8* %4
}
int titleToNumber(char *s) {
  int n = 0;
  while (*s != '\0') {
    n *= 26;
    n += *s++ - 'A' + 1;
  }
  return n;
}


x86 assembly (clang, -O0):
<titleToNumber>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1149 <titleToNumber+0x49>
imul   $0x1a,-0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
sub    $0x41,%eax
add    $0x1,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110f <titleToNumber+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<titleToNumber>:
mov    (%rdi),%cl
test   %cl,%cl
je     112d <titleToNumber+0x2d>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
lea    (%rax,%rax,4),%edx
lea    (%rdx,%rdx,4),%edx
add    %eax,%edx
lea    (%rcx,%rdx,1),%eax
add    $0xffffffc0,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <titleToNumber+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @titleToNumber(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %13, %4 ], [ %2, %1 ]
%6 = phi i32 [ %12, %4 ], [ 0, %1 ]
%7 = phi i8* [ %10, %4 ], [ %0, %1 ]
%8 = sext i8 %5 to i32
%9 = mul nsw i32 %6, 26
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = add i32 %9, -64
%12 = add i32 %11, %8
%13 = load i8, i8* %10
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
%16 = phi i32 [ 0, %1 ], [ %12, %4 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M532_f(char *s) {
  debug("M532_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M532_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M532_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M532_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M532_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M532_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M532_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int fun(int *);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int x = 5;
  int y = 6;
  int z = x + y;
  int array[3];
  array[0] = x;
  array[1] = y;
  array[2] = z;
  int result = fun(array);
  printf("%d", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x5,-0x14(%rbp)
movl   $0x6,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
lea    -0x28(%rbp),%rdi
call   1030 <fun@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%esi
lea    0xe8b(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x600000005,%rax
mov    %rax,0xc(%rsp)
movl   $0xb,0x14(%rsp)
lea    0xc(%rsp),%rdi
call   1030 <fun@plt>
lea    0xeb4(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca [3 x i32]
%10 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 5, i32* %6
store i32 6, i32* %7
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = add nsw i32 %11, %12
store i32 %13, i32* %8
%14 = load i32, i32* %6
%15 = getelementptr inbounds [3 x i32], [3 x i32]* %9, i64 0, i64 0
store i32 %14, i32* %15
%16 = load i32, i32* %7
%17 = getelementptr inbounds [3 x i32], [3 x i32]* %9, i64 0, i64 1
store i32 %16, i32* %17
%18 = load i32, i32* %8
%19 = getelementptr inbounds [3 x i32], [3 x i32]* %9, i64 0, i64 2
store i32 %18, i32* %19
%20 = getelementptr inbounds [3 x i32], [3 x i32]* %9, i64 0, i64 0
%21 = call i32 @fun(i32* %20)
store i32 %21, i32* %10
%22 = load i32, i32* %10
%23 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %22)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [3 x i32]
%4 = bitcast [3 x i32]* %3 to i8*
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 0
store i32 5, i32* %5
%6 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 1
store i32 6, i32* %6
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 2
store i32 11, i32* %7
%8 = call i32 @fun(i32* %5)
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Type definitions */
struct terminal {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ move_cursor(struct terminal *, int, int /*<<< orphan*/);
void nl(struct terminal *term) { move_cursor(term, 1, 0); }


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

x86 assembly (clang, -O2):
<nl>:
mov    $0x1,%esi
xor    %edx,%edx
jmp    1030 <move_cursor@plt>

LLVM IR (-O0):
%struct.terminal = type { i32 }
define void @nl(%struct.terminal* %0) {
%2 = alloca %struct.terminal*
store %struct.terminal* %0, %struct.terminal** %2
%3 = load %struct.terminal*, %struct.terminal** %2
%4 = call i32 @move_cursor(%struct.terminal* %3, i32 1, i32 0)
ret void
}

LLVM IR (-O2):
%struct.terminal = type { i32 }
define void @nl(%struct.terminal* %0) {
%2 = tail call i32 @move_cursor(%struct.terminal* %0, i32 1, i32 0)
ret void
}
/* Variables and functions */
bool umul_is_oor(unsigned a, unsigned b) { return (a * b < a); }


x86 assembly (clang, -O0):
<umul_is_oor>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
setb   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<umul_is_oor>:
imul   %edi,%esi
xor    %eax,%eax
cmp    %edi,%esi
setb   %al
ret

LLVM IR (-O0):
define i32 @umul_is_oor(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = mul i32 %5, %6
%8 = load i32, i32* %3
%9 = icmp ult i32 %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @umul_is_oor(i32 %0, i32 %1) {
%3 = mul i32 %1, %0
%4 = icmp ult i32 %3, %0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ dostuff(int *);
void varDecl2(int X) {
  switch (X) {
    int A = 1;
  case 1:
    dostuff(&A);
    break;
  case 2:
    dostuff(&A);
    break;
  }
}


x86 assembly (clang, -O0):
<varDecl2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x1,%eax
je     1140 <varDecl2+0x30>
jmp    112f <varDecl2+0x1f>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     114e <varDecl2+0x3e>
jmp    1157 <varDecl2+0x47>
lea    -0x8(%rbp),%rdi
call   1030 <dostuff@plt>
jmp    1157 <varDecl2+0x47>
lea    -0x8(%rbp),%rdi
call   1030 <dostuff@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<varDecl2>:
add    $0xffffffff,%edi
cmp    $0x1,%edi
ja     1127 <varDecl2+0x17>
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <dostuff@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @varDecl2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
switch i32 %4, label %9 [
i32 1, label %5
i32 2, label %7
]
5: ; preds = %1
%6 = call i32 @dostuff(i32* %3)
br label %9
7: ; preds = %1
%8 = call i32 @dostuff(i32* %3)
br label %9
9: ; preds = %1, %7, %5
ret void
}

LLVM IR (-O2):
define void @varDecl2(i32 %0) {
%2 = alloca i32
%3 = add i32 %0, -1
%4 = icmp ult i32 %3, 2
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @dostuff(i32* %2)
br label %7
7: ; preds = %1, %5
ret void
}
/* Type definitions */
typedef scalar_t__ time_t;

/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ my_clock();
int /*<<< orphan*/ printf(char *, scalar_t__);
int /*<<< orphan*/ usleep(int);
int main(void) {
  usleep(2000 * 1000);
  time_t start = my_clock();
  usleep(300 * 1000);
  time_t end = my_clock();
  printf("elapsed: %lu\n", end - start);
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1e8480,%edi
call   1060 <usleep@plt>
mov    $0x0,%al
call   1040 <my_clock@plt>
mov    %rax,-0x10(%rbp)
mov    $0x493e0,%edi
call   1060 <usleep@plt>
mov    $0x0,%al
call   1040 <my_clock@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
sub    -0x10(%rbp),%rsi
lea    0xe78(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e4c(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1e8480,%edi
call   1060 <usleep@plt>
xor    %eax,%eax
call   1040 <my_clock@plt>
mov    %rax,%rbx
mov    $0x493e0,%edi
call   1060 <usleep@plt>
xor    %eax,%eax
call   1040 <my_clock@plt>
sub    %rbx,%rax
lea    0xe90(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    0x2e61(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"elapsed: %lu\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
store i32 0, i32* %1
%4 = call i32 @usleep(i32 2000000)
%5 = call i64 (...) @my_clock()
store i64 %5, i64* %2
%6 = call i32 @usleep(i32 300000)
%7 = call i64 (...) @my_clock()
store i64 %7, i64* %3
%8 = load i64, i64* %3
%9 = load i64, i64* %2
%10 = sub nsw i64 %8, %9
%11 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i64 %10)
%12 = load i32, i32* @EXIT_SUCCESS
%13 = call i32 @exit(i32 %12)
unreachable
}

LLVM IR (-O2):
@.str = [14 x i8] c"elapsed: %lu\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @usleep(i32 2000000)
%2 = tail call i64 (...) @my_clock()
%3 = tail call i32 @usleep(i32 300000)
%4 = tail call i64 (...) @my_clock()
%5 = sub nsw i64 %4, %2
%6 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i64 %5)
%7 = load i32, i32* @EXIT_SUCCESS
%8 = tail call i32 @exit(i32 %7)
unreachable
}
int ns_sub(const int a, const int b) { return a - b; }


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

x86 assembly (clang, -O2):
<ns_sub>:
mov    %edi,%eax
sub    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @ns_sub(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int /*<<< orphan*/ ft_memcpy(int *, int *, unsigned int);
int *malloc(int);
int *ft_realloc(int *ptr, unsigned int size) {
  int *tmp;
  tmp = malloc(sizeof(*ptr) * size);
  ft_memcpy(tmp, ptr, size / 2);
  free(ptr);
  return (tmp);
}


x86 assembly (clang, -O0):
<ft_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x2,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
shr    $0x1,%edx
call   1050 <ft_memcpy@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_realloc>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %rdi,%r14
lea    0x0(,%rbx,4),%edi
call   1040 <malloc@plt>
mov    %rax,%r15
shr    %ebx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   1050 <ft_memcpy@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32* @ft_realloc(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 = zext i32 %6 to i64
%8 = mul i64 4, %7
%9 = trunc i64 %8 to i32
%10 = call i32* @malloc(i32 %9)
store i32* %10, i32** %5
%11 = load i32*, i32** %5
%12 = load i32*, i32** %3
%13 = load i32, i32* %4
%14 = udiv i32 %13, 2
%15 = call i32 @ft_memcpy(i32* %11, i32* %12, i32 %14)
%16 = load i32*, i32** %3
%17 = call i32 @free(i32* %16)
%18 = load i32*, i32** %5
ret i32* %18
}

LLVM IR (-O2):
define i32* @ft_realloc(i32* %0, i32 %1) {
%3 = shl i32 %1, 2
%4 = tail call i32* @malloc(i32 %3)
%5 = lshr i32 %1, 1
%6 = tail call i32 @ft_memcpy(i32* %4, i32* %0, i32 %5)
%7 = tail call i32 @free(i32* %0)
ret i32* %4
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void main() {
  int i;
  if (i) {
    assert(i >= 1);
  } else {
    assert(i == 0);
    assert(i < 0);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
cmpl   $0x0,-0x4(%rbp)
je     1138 <main+0x28>
cmpl   $0x1,-0x4(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
jmp    115a <main+0x4a>
cmpl   $0x0,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x0,-0x4(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <assert@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = load i32, i32* %1
%3 = icmp ne i32 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %0
%5 = load i32, i32* %1
%6 = icmp sge i32 %5, 1
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
br label %18
9: ; preds = %0
%10 = load i32, i32* %1
%11 = icmp eq i32 %10, 0
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load i32, i32* %1
%15 = icmp slt i32 %14, 0
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
br label %18
18: ; preds = %9, %4
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @assert(i32 0)
%2 = tail call i32 @assert(i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ rotr64(int /*<<< orphan*/, int);
uint64_t bmw_large_r7(uint64_t x) {
  uint64_t r;
  r = rotr64(x, 64 - 53);
  return r;
}


x86 assembly (clang, -O0):
<bmw_large_r7>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0xb,%esi
call   1030 <rotr64@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bmw_large_r7>:
mov    $0xb,%esi
jmp    1030 <rotr64@plt>

LLVM IR (-O0):
define i32 @bmw_large_r7(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @rotr64(i32 %4, i32 11)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @bmw_large_r7(i32 %0) {
%2 = tail call i32 @rotr64(i32 %0, i32 11)
ret i32 %2
}
double ep2mjd(epoch)
double epoch;
{
  double dj;
  double date, time;
  ep2dt(epoch, &date, &time);
  dj = dt2jd(date, time);
  return (dj - 2400000.5);
}


x86 assembly (clang, -O0):
<ep2mjd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    -0x18(%rbp),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x1,%al
call   1030 <ep2dt@plt>
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
mov    $0x2,%al
call   1040 <dt2jd@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xe98(%rip),%xmm1
subsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ep2mjd>:
sub    $0x18,%rsp
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
mov    $0x1,%al
call   1030 <ep2dt@plt>
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
mov    $0x2,%al
call   1040 <dt2jd@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
addsd  0xea9(%rip),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @ep2mjd(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %2
%6 = load double, double* %2
%7 = call i32 (double, double*, double*, ...) bitcast (i32 (...)* @ep2dt to i32 (double, double*, double*, ...)*)(double %6, double* %4, double* %5)
%8 = load double, double* %4
%9 = load double, double* %5
%10 = call i32 (double, double, ...) bitcast (i32 (...)* @dt2jd to i32 (double, double, ...)*)(double %8, double %9)
%11 = sitofp i32 %10 to double
store double %11, double* %3
%12 = load double, double* %3
%13 = fsub double %12, 0x41424F8040000000
ret double %13
}

LLVM IR (-O2):
define double @ep2mjd(double %0) {
%2 = alloca double
%3 = alloca double
%4 = bitcast double* %2 to i8*
%5 = bitcast double* %3 to i8*
%6 = call i32 (double, double*, double*, ...) bitcast (i32 (...)* @ep2dt to i32 (double, double*, double*, ...)*)(double %0, double* %2, double* %3)
%7 = load double, double* %2
%8 = load double, double* %3
%9 = call i32 (double, double, ...) bitcast (i32 (...)* @dt2jd to i32 (double, double, ...)*)(double %7, double %8)
%10 = sitofp i32 %9 to double
%11 = fadd double %10, 0xC1424F8040000000
ret double %11
}
void pdr2s_(x, y) short *x, *y;
{ pdr((float)*x, (float)*y, 0.0); }


x86 assembly (clang, -O0):
<pdr2s_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%eax
cvtsi2ss %eax,%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x10(%rbp),%rax
movswl (%rax),%eax
cvtsi2ss %eax,%xmm1
cvtss2sd %xmm1,%xmm1
xorps  %xmm2,%xmm2
mov    $0x3,%al
call   1030 <pdr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pdr2s_>:
movswl (%rdi),%eax
cvtsi2sd %eax,%xmm0
movswl (%rsi),%eax
cvtsi2sd %eax,%xmm1
xorps  %xmm2,%xmm2
mov    $0x3,%al
jmp    1030 <pdr@plt>

LLVM IR (-O0):
define void @pdr2s_(i16* %0, i16* %1) {
%3 = alloca i16*
%4 = alloca i16*
store i16* %0, i16** %3
store i16* %1, i16** %4
%5 = load i16*, i16** %3
%6 = load i16, i16* %5
%7 = sitofp i16 %6 to float
%8 = fpext float %7 to double
%9 = load i16*, i16** %4
%10 = load i16, i16* %9
%11 = sitofp i16 %10 to float
%12 = fpext float %11 to double
%13 = call i32 (double, double, double, ...) bitcast (i32 (...)* @pdr to i32 (double, double, double, ...)*)(double %8, double %12, double 0.000000e+00)
ret void
}

LLVM IR (-O2):
define void @pdr2s_(i16* nocapture %0, i16* nocapture %1) {
%3 = load i16, i16* %0
%4 = sitofp i16 %3 to double
%5 = load i16, i16* %1
%6 = sitofp i16 %5 to double
%7 = tail call i32 (double, double, double, ...) bitcast (i32 (...)* @pdr to i32 (double, double, double, ...)*)(double %4, double %6, double 0.000000e+00)
ret void
}
/* Type definitions */
struct feature_pair {
  int dummy;
};
struct CovariateAnalysis {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
void _emitJSONCovCount(const struct feature_pair *pair,
                       const struct CovariateAnalysis *covan, FILE *fp) {}


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

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

LLVM IR (-O0):
%struct.feature_pair = type { i32 }
%struct.CovariateAnalysis = type { i32 }
define void @_emitJSONCovCount(%struct.feature_pair* %0, %struct.CovariateAnalysis* %1, i32* %2) {
%4 = alloca %struct.feature_pair*
%5 = alloca %struct.CovariateAnalysis*
%6 = alloca i32*
store %struct.feature_pair* %0, %struct.feature_pair** %4
store %struct.CovariateAnalysis* %1, %struct.CovariateAnalysis** %5
store i32* %2, i32** %6
ret void
}

LLVM IR (-O2):
%struct.feature_pair = type { i32 }
%struct.CovariateAnalysis = type { i32 }
define void @_emitJSONCovCount(%struct.feature_pair* nocapture %0, %struct.CovariateAnalysis* nocapture %1, i32* nocapture %2) {
ret void
}
/* Variables and functions */
int strlen(char *);
char tolower(char);
void strtolower(char *string) {
  int count;
  for (count = 0; count < strlen(string); count++) {
    string[count] = tolower(string[count]);
  }
}


x86 assembly (clang, -O0):
<strtolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jge    117b <strtolower+0x5b>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1040 <tolower@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <strtolower+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtolower>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
test   %eax,%eax
jle    1161 <strtolower+0x41>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%r14,%rbx,1),%edi
call   1040 <tolower@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1140 <strtolower+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @strtolower(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %13
4: ; preds = %1, %4
%5 = phi i64 [ %9, %4 ], [ 0, %1 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = tail call signext i8 @tolower(i8 signext %7)
store i8 %8, i8* %6
%9 = add nuw nsw i64 %5, 1
%10 = tail call i32 @strlen(i8* %0)
%11 = sext i32 %10 to i64
%12 = icmp slt i64 %9, %11
br i1 %12, label %4, label %13
13: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0x0c() {
  Assert_real((isxdigit(12) == 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_isxdigit.c",
              65, ("isxdigit should be 0 for 0x0c"));
}


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

x86 assembly (clang, -O2):
<t_isxdigit_0x0c>:
push   %rax
mov    $0xc,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x41,%edx
pop    %rax
jmp    1040 <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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0x0c\00"
define void @t_isxdigit_0x0c() {
%1 = call i64 @isxdigit(i32 12)
%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 65, 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0x0c\00"
define void @t_isxdigit_0x0c() {
%1 = tail call i64 @isxdigit(i32 12)
%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 65, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void UART9BitEnable(uint32_t ui32Base) {
  ;
  (*((volatile uint32_t *)(ui32Base + 0x000000A4))) |= 0x00008000;
}


x86 assembly (clang, -O0):
<UART9BitEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xa4,%eax
cltq
mov    (%rax),%ecx
or     $0x8000,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UART9BitEnable>:
movslq %edi,%rax
orl    $0x8000,0xa4(%rax)
ret

LLVM IR (-O0):
define void @UART9BitEnable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 164
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = or i32 %7, 32768
store volatile i32 %8, i32* %6
ret void
}

LLVM IR (-O2):
define void @UART9BitEnable(i32 %0) {
%2 = add nsw i32 %0, 164
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = or i32 %5, 32768
store volatile i32 %6, i32* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void ctrl_g(void) { printf("Hey, you pressed CTRL g! \n"); }


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

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

LLVM IR (-O0):
@.str = [27 x i8] c"Hey, you pressed CTRL g! \0A\00"
define void @ctrl_g() {
%1 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [26 x i8] c"Hey, you pressed CTRL g! \00"
define void @ctrl_g() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
ret void
}
int test_imm_B1uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0xB1 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_B1uint64_lowword_reg>:
test   $0xb1,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_B1uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 177
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int prime(int number) {
  if (number < 0)
    return -1;
  int i = 2;
  for (; i <= number - 1; i++) {
    if (number % i == 0)
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    111d <prime+0x1d>
movl   $0xffffffff,-0x4(%rbp)
jmp    116b <prime+0x6b>
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     1164 <prime+0x64>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1151 <prime+0x51>
movl   $0x0,-0x4(%rbp)
jmp    116b <prime+0x6b>
jmp    1156 <prime+0x56>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1124 <prime+0x24>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<prime>:
test   %edi,%edi
js     1133 <prime+0x33>
mov    $0x1,%ecx
cmp    $0x3,%edi
jb     1130 <prime+0x30>
mov    $0x2,%esi
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1139 <prime+0x39>
add    $0x1,%esi
cmp    %esi,%edi
jne    1120 <prime+0x20>
mov    %ecx,%eax
ret
mov    $0xffffffff,%eax
ret
xor    %ecx,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @prime(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = icmp ugt i32 %0, 2
br i1 %4, label %7, label %12
5: ; preds = %7
%6 = icmp eq i32 %11, %0
br i1 %6, label %12, label %7
7: ; preds = %3, %5
%8 = phi i32 [ %11, %5 ], [ 2, %3 ]
%9 = srem i32 %0, %8
%10 = icmp eq i32 %9, 0
%11 = add nuw nsw i32 %8, 1
br i1 %10, label %12, label %5
12: ; preds = %5, %7, %3, %1
%13 = phi i32 [ -1, %1 ], [ 1, %3 ], [ 1, %5 ], [ 0, %7 ]
ret i32 %13
}
void callback() {}


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

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

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

LLVM IR (-O2):
define void @callback() {
ret void
}
/* Type definitions */
typedef int uint64_t;
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
uint64_t timer() {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return tv.tv_sec * 1000 + tv.tv_usec / 1000;
}


x86 assembly (clang, -O0):
<timer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,-0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,(%rsp),%ecx
movslq 0x4(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
add    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i32 @timer() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = mul nsw i32 %4, 1000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i32, i32* %6
%8 = sdiv i32 %7, 1000
%9 = add nsw i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i32 @timer() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000
%10 = add nsw i32 %9, %6
ret i32 %10
}
int do_286() { return 286; }


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

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

LLVM IR (-O0):
define i32 @do_286() {
ret i32 286
}

LLVM IR (-O2):
define i32 @do_286() {
ret i32 286
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void usage(char *me) {
  printf("Usage: %s [-i interface] [-n net-mask-bits]  [-m subnet-mask-bits] "
         "[-s suffix] [-w metric] [-f script_to_call]\n",
         me);
}


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

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [112 x i8] c"Usage: %s [-i interface] [-n net-mask-bits] [-m subnet-mask-bits] [-s suffix] [-w metric] [-f script_to_call]\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([112 x i8], [112 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [112 x i8] c"Usage: %s [-i interface] [-n net-mask-bits] [-m subnet-mask-bits] [-s suffix] [-w metric] [-f script_to_call]\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([112 x i8], [112 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
double dmin1(double a, double b) {
  if (a <= b)
    return a;
  else
    return b;
}


x86 assembly (clang, -O0):
<dmin1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1131 <dmin1+0x31>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    113b <dmin1+0x3b>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dmin1>:
movapd %xmm0,%xmm2
cmplesd %xmm1,%xmm2
andpd  %xmm2,%xmm0
andnpd %xmm1,%xmm2
orpd   %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @dmin1(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = load double, double* %5
%8 = fcmp ole double %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load double, double* %4
store double %10, double* %3
br label %13
11: ; preds = %2
%12 = load double, double* %5
store double %12, double* %3
br label %13
13: ; preds = %11, %9
%14 = load double, double* %3
ret double %14
}

LLVM IR (-O2):
define double @dmin1(double %0, double %1) {
%3 = fcmp ole double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ endian_rev32(int /*<<< orphan*/);
uint32_t endian_ntohl(uint32_t data) { return endian_rev32(data); }


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

x86 assembly (clang, -O2):
<endian_ntohl>:
jmp    1030 <endian_rev32@plt>

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

LLVM IR (-O2):
define i32 @endian_ntohl(i32 %0) {
%2 = tail call i32 @endian_rev32(i32 %0)
ret i32 %2
}
void GPIOPortC_Handler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<GPIOPortC_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <GPIOPortC_Handler+0x9>
jmp    1109 <GPIOPortC_Handler+0x9>

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

LLVM IR (-O0):
define void @GPIOPortC_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @GPIOPortC_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void erro() {
  printf("\n Operacao com tipos invalidos \n");
  exit(1);
}


x86 assembly (clang, -O0):
<erro>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<erro>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"\0A Operacao com tipos invalidos \0A\00"
define void @erro() {
%1 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [32 x i8] c"\0A Operacao com tipos invalidos \00"
define void @erro() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
char *forward_command(char *, char *, char *);
int /*<<< orphan*/ print_failed_broadcast(char *);
int /*<<< orphan*/ print_try_broadcast(char *, char *);
char *try_broadcast(char *dest, char *buf, char *unique) {
  print_try_broadcast(dest, buf);
  char *r = forward_command(dest, buf, unique);
  if (r == NULL)
    print_failed_broadcast(dest);
  return r;
}


x86 assembly (clang, -O0):
<try_broadcast>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <print_try_broadcast@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <forward_command@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    117a <try_broadcast+0x4a>
mov    -0x8(%rbp),%rdi
call   1050 <print_failed_broadcast@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<try_broadcast>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r15
mov    %rsi,%rbx
mov    %rdi,%r14
call   1040 <print_try_broadcast@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
call   1030 <forward_command@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1161 <try_broadcast+0x31>
mov    %r14,%rdi
call   1050 <print_failed_broadcast@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @try_broadcast(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = call i32 @print_try_broadcast(i8* %8, i8* %9)
%11 = load i8*, i8** %4
%12 = load i8*, i8** %5
%13 = load i8*, i8** %6
%14 = call i8* @forward_command(i8* %11, i8* %12, i8* %13)
store i8* %14, i8** %7
%15 = load i8*, i8** %7
%16 = icmp eq i8* %15, null
br i1 %16, label %17, label %20
17: ; preds = %3
%18 = load i8*, i8** %4
%19 = call i32 @print_failed_broadcast(i8* %18)
br label %20
20: ; preds = %17, %3
%21 = load i8*, i8** %7
ret i8* %21
}

LLVM IR (-O2):
define i8* @try_broadcast(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @print_try_broadcast(i8* %0, i8* %1)
%5 = tail call i8* @forward_command(i8* %0, i8* %1, i8* %2)
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 @print_failed_broadcast(i8* %0)
br label %9
9: ; preds = %7, %3
ret i8* %5
}
int IDE_write(unsigned long storage_number, const void *src,
              unsigned long LBA_addr, unsigned long n) {}


x86 assembly (clang, -O0):
<IDE_write>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @IDE_write(i64 %0, i8* nocapture readnone %1, i64 %2, i64 %3) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ anykey();
int /*<<< orphan*/ display_monlist();
int /*<<< orphan*/ screen_load();
int /*<<< orphan*/ screen_save();
void do_cmd_monlist(void) {
  screen_save();
  display_monlist();
  anykey();
  screen_load();
}


x86 assembly (clang, -O0):
<do_cmd_monlist>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <screen_save@plt>
mov    $0x0,%al
call   1060 <display_monlist@plt>
mov    $0x0,%al
call   1040 <anykey@plt>
mov    $0x0,%al
call   1030 <screen_load@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_cmd_monlist>:
push   %rax
xor    %eax,%eax
call   1050 <screen_save@plt>
xor    %eax,%eax
call   1060 <display_monlist@plt>
xor    %eax,%eax
call   1040 <anykey@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <screen_load@plt>

LLVM IR (-O0):
define void @do_cmd_monlist() {
%1 = call i32 (...) @screen_save()
%2 = call i32 (...) @display_monlist()
%3 = call i32 (...) @anykey()
%4 = call i32 (...) @screen_load()
ret void
}

LLVM IR (-O2):
define void @do_cmd_monlist() {
%1 = tail call i32 (...) @screen_save()
%2 = tail call i32 (...) @display_monlist()
%3 = tail call i32 (...) @anykey()
%4 = tail call i32 (...) @screen_load()
ret void
}
void Hal_hook_rd_sgnfrec_recb(void) {}


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

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

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

LLVM IR (-O2):
define void @Hal_hook_rd_sgnfrec_recb() {
ret void
}
void g_byte_array_new() {}


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

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

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

LLVM IR (-O2):
define void @g_byte_array_new() {
ret void
}
cbuf22(f, n) { return (cbuf(f, n, 22)); }


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

x86 assembly (clang, -O2):
<cbuf22>:
mov    $0x16,%edx
xor    %eax,%eax
jmp    1030 <cbuf@plt>

LLVM IR (-O0):
define i32 @cbuf22(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @cbuf to i32 (i32, i32, i32, ...)*)(i32 %5, i32 %6, i32 22)
ret i32 %7
}

LLVM IR (-O2):
define i32 @cbuf22(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @cbuf to i32 (i32, i32, i32, ...)*)(i32 %0, i32 %1, i32 22)
ret i32 %3
}
int main(void) {
  int counter = 1000000;
  while (counter) {
    counter -= 1;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0xf4240,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     112a <main+0x2a>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <main+0x12>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}