xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ranged_random_revmult_lazycheckpower2(int /*<<< orphan*/);
void loop_revmult_lazycheckpower2(size_t count, uint32_t range,
                                  uint32_t *output) {
  for (size_t i = 0; i < count; i++) {
    *output++ = ranged_random_revmult_lazycheckpower2(range);
  }
}


x86 assembly (clang, -O0):
<loop_revmult_lazycheckpower2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    1165 <loop_revmult_lazycheckpower2+0x55>
mov    -0xc(%rbp),%edi
call   1030 <ranged_random_revmult_lazycheckpower2@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x18(%rbp)
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    112b <loop_revmult_lazycheckpower2+0x1b>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<loop_revmult_lazycheckpower2>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     1145 <loop_revmult_lazycheckpower2+0x35>
mov    %rdx,%r14
mov    %esi,%r15d
mov    %rdi,%rbx
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
mov    %r15d,%edi
call   1030 <ranged_random_revmult_lazycheckpower2@plt>
mov    %eax,(%r14,%rbp,4)
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    1130 <loop_revmult_lazycheckpower2+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @loop_revmult_lazycheckpower2(i64 %0, i32 %1, i32* nocapture writeonly %2) {
%4 = icmp eq i64 %0, 0
br i1 %4, label %5, label %6
5: ; preds = %6, %3
ret void
6: ; preds = %3, %6
%7 = phi i64 [ %11, %6 ], [ 0, %3 ]
%8 = phi i32* [ %10, %6 ], [ %2, %3 ]
%9 = tail call i32 @ranged_random_revmult_lazycheckpower2(i32 %1)
%10 = getelementptr inbounds i32, i32* %8, i64 1
store i32 %9, i32* %8
%11 = add nuw i64 %7, 1
%12 = icmp eq i64 %11, %0
br i1 %12, label %5, label %6
}
/* Variables and functions */
int /*<<< orphan*/ is_prime(int);
void *thread1_find(void *arg) {
  int i;
  for (i = 0; i < 90000; i++)
    is_prime(i);
}


x86 assembly (clang, -O0):
<thread1_find>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x15f90,-0x14(%rbp)
jge    1146 <thread1_find+0x36>
mov    -0x14(%rbp),%edi
call   1030 <is_prime@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1123 <thread1_find+0x13>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread1_find>:
push   %rbx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%edi
call   1030 <is_prime@plt>
add    $0x1,%ebx
cmp    $0x15f90,%ebx
jne    1120 <thread1_find+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define i8* @thread1_find(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 0, i32* %4
br label %5
5: ; preds = %11, %1
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 90000
br i1 %7, label %8, label %14
8: ; preds = %5
%9 = load i32, i32* %4
%10 = call i32 @is_prime(i32 %9)
br label %11
11: ; preds = %8
%12 = load i32, i32* %4
%13 = add nsw i32 %12, 1
store i32 %13, i32* %4
br label %5
14: ; preds = %5
%15 = load i8*, i8** %2
ret i8* %15
}

LLVM IR (-O2):
define noalias i8* @thread1_find(i8* nocapture readnone %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i32 [ 0, %1 ], [ %5, %2 ]
%4 = tail call i32 @is_prime(i32 %3)
%5 = add nuw nsw i32 %3, 1
%6 = icmp eq i32 %5, 90000
br i1 %6, label %7, label %2
7: ; preds = %2
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int divide_power2(int, int);
int main(int argc, char *argv[]) {
  int x = 0x80000007;
  assert(divide_power2(x, 1) == x / 2);
  assert(divide_power2(x, 2) == x / 4);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x80000007,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    $0x1,%esi
call   1040 <divide_power2@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x14(%rbp),%edi
mov    $0x2,%esi
call   1040 <divide_power2@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x80000007,%edi
mov    $0x1,%esi
call   1040 <divide_power2@plt>
xor    %edi,%edi
cmp    $0xc0000004,%eax
sete   %dil
call   1030 <assert@plt>
mov    $0x80000007,%edi
mov    $0x2,%esi
call   1040 <divide_power2@plt>
xor    %edi,%edi
cmp    $0xe0000002,%eax
sete   %dil
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 -2147483641, i32* %6
%7 = load i32, i32* %6
%8 = call i32 @divide_power2(i32 %7, i32 1)
%9 = load i32, i32* %6
%10 = sdiv i32 %9, 2
%11 = icmp eq i32 %8, %10
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load i32, i32* %6
%15 = call i32 @divide_power2(i32 %14, i32 2)
%16 = load i32, i32* %6
%17 = sdiv i32 %16, 4
%18 = icmp eq i32 %15, %17
%19 = zext i1 %18 to i32
%20 = call i32 @assert(i32 %19)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @divide_power2(i32 -2147483641, i32 1)
%4 = icmp eq i32 %3, -1073741820
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = tail call i32 @divide_power2(i32 -2147483641, i32 2)
%8 = icmp eq i32 %7, -536870910
%9 = zext i1 %8 to i32
%10 = tail call i32 @assert(i32 %9)
ret i32 0
}
/* Variables and functions */
scalar_t__ chr_isalpha(char const);
scalar_t__ chr_isdigit(char const);
int chr_isalnum(const char c) { return chr_isdigit(c) || chr_isalpha(c); }


x86 assembly (clang, -O0):
<chr_isalnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1040 <chr_isdigit@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    115c <chr_isalnum+0x3c>
movsbl -0x1(%rbp),%edi
call   1030 <chr_isalpha@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chr_isalnum>:
push   %rbx
mov    %edi,%ebx
call   1040 <chr_isdigit@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <chr_isalnum+0x17>
pop    %rbx
ret
movsbl %bl,%edi
call   1030 <chr_isalpha@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @chr_isalnum(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @chr_isdigit(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = call i64 @chr_isalpha(i8 signext %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @chr_isalnum(i8 signext %0) {
%2 = tail call i64 @chr_isdigit(i8 signext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @chr_isalpha(i8 signext %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
int test_imm_35int16_reg(short val) {
  return ((val) & (0x35 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_35int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0x35,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_35int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, 53
%6 = icmp ne i32 %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_35int16_reg(i16 signext %0) {
%2 = and i16 %0, 53
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct list_node {
  int dummy;
};
struct list {
  int dummy;
};

/* Variables and functions */
struct list_node *list_insert(struct list *, int /*<<< orphan*/, void *);
struct list_node *list_push_front(struct list *self, void *data) {
  return list_insert(self, 0, data);
}


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

x86 assembly (clang, -O2):
<list_push_front>:
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <list_insert@plt>

LLVM IR (-O0):
%struct.list_node = type { i32 }
%struct.list = type { i32 }
define %struct.list_node* @list_push_front(%struct.list* %0, i8* %1) {
%3 = alloca %struct.list*
%4 = alloca i8*
store %struct.list* %0, %struct.list** %3
store i8* %1, i8** %4
%5 = load %struct.list*, %struct.list** %3
%6 = load i8*, i8** %4
%7 = call %struct.list_node* @list_insert(%struct.list* %5, i32 0, i8* %6)
ret %struct.list_node* %7
}

LLVM IR (-O2):
%struct.list_node = type { i32 }
%struct.list = type { i32 }
define %struct.list_node* @list_push_front(%struct.list* %0, i8* %1) {
%3 = tail call %struct.list_node* @list_insert(%struct.list* %0, i32 0, i8* %1)
ret %struct.list_node* %3
}
void fa178(int n) {
  {
    int b[n];
    {
      int c[n];
      0;
    }
    {
      int d[n];
      0;
    };
    int e[n];
    0;
  };
  {
    int f[n];
  a : {
    int g[n];
    0;
  };
    goto a;
    {
      int h[n];
      0;
    };
    ;
    int i[n];
    0;
  };
  ;
  int j[n];
  0;
}


x86 assembly (clang, -O0):
<fa178>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x20(%rbp)
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x30(%rbp)
mov    %rax,-0x38(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rax,-0x40(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x48(%rbp)
mov    %rax,-0x50(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x58(%rbp)
mov    %rax,-0x60(%rbp)
mov    -0x58(%rbp),%rax
mov    %rax,%rsp
jmp    1162 <fa178+0x62>

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

LLVM IR (-O0):
define void @fa178(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i64
%10 = alloca i8*
%11 = alloca i64
%12 = alloca i8*
%13 = alloca i64
%14 = alloca i8*
%15 = alloca i64
%16 = alloca i64
%17 = alloca i8*
%18 = alloca i64
store i32 %0, i32* %2
%19 = load i32, i32* %2
%20 = zext i32 %19 to i64
%21 = call i8* @llvm.stacksave()
store i8* %21, i8** %3
%22 = alloca i32, i64 %20
store i64 %20, i64* %4
%23 = load i32, i32* %2
%24 = zext i32 %23 to i64
%25 = call i8* @llvm.stacksave()
store i8* %25, i8** %5
%26 = alloca i32, i64 %24
store i64 %24, i64* %6
%27 = load i8*, i8** %5
%28 = load i32, i32* %2
%29 = zext i32 %28 to i64
%30 = call i8* @llvm.stacksave()
store i8* %30, i8** %7
%31 = alloca i32, i64 %29
store i64 %29, i64* %8
%32 = load i8*, i8** %7
%33 = load i32, i32* %2
%34 = zext i32 %33 to i64
%35 = alloca i32, i64 %34
store i64 %34, i64* %9
%36 = load i8*, i8** %3
%37 = load i32, i32* %2
%38 = zext i32 %37 to i64
%39 = call i8* @llvm.stacksave()
store i8* %39, i8** %10
%40 = alloca i32, i64 %38
store i64 %38, i64* %11
br label %41
41: ; preds = %41, %1
%42 = load i32, i32* %2
%43 = zext i32 %42 to i64
%44 = call i8* @llvm.stacksave()
store i8* %44, i8** %12
%45 = alloca i32, i64 %43
store i64 %43, i64* %13
%46 = load i8*, i8** %12
br label %41
47: ; No predecessors!
%48 = load i32, i32* %2
%49 = zext i32 %48 to i64
%50 = call i8* @llvm.stacksave()
store i8* %50, i8** %14
%51 = alloca i32, i64 %49
store i64 %49, i64* %15
%52 = load i8*, i8** %14
%53 = load i32, i32* %2
%54 = zext i32 %53 to i64
%55 = alloca i32, i64 %54
store i64 %54, i64* %16
%56 = load i8*, i8** %10
%57 = load i32, i32* %2
%58 = zext i32 %57 to i64
%59 = call i8* @llvm.stacksave()
store i8* %59, i8** %17
%60 = alloca i32, i64 %58
store i64 %58, i64* %18
%61 = load i8*, i8** %17
ret void
}

LLVM IR (-O2):
define void @fa178(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Variables and functions */
double acos(double);
void b_acos(double *x) { *x = acos(*x); }


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

x86 assembly (clang, -O2):
<b_acos>:
push   %rbx
mov    %rdi,%rbx
movsd  (%rdi),%xmm0
call   1030 <acos@plt>
movsd  %xmm0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @b_acos(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = load double, double* %3
%5 = call double @acos(double %4)
%6 = load double*, double** %2
store double %5, double* %6
ret void
}

LLVM IR (-O2):
define void @b_acos(double* nocapture %0) {
%2 = load double, double* %0
%3 = tail call double @acos(double %2)
store double %3, double* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ABDAY_4;
char *nl_langinfo(int /*<<< orphan*/);
char *langinfo_abday_4() { return nl_langinfo(ABDAY_4); }


x86 assembly (clang, -O0):
<langinfo_abday_4>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <nl_langinfo@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<langinfo_abday_4>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <nl_langinfo@plt>

LLVM IR (-O0):
@ABDAY_4 = global i32 0
define i8* @langinfo_abday_4() {
%1 = load i32, i32* @ABDAY_4
%2 = call i8* @nl_langinfo(i32 %1)
ret i8* %2
}

LLVM IR (-O2):
@ABDAY_4 = global i32 0
define i8* @langinfo_abday_4() {
%1 = load i32, i32* @ABDAY_4
%2 = tail call i8* @nl_langinfo(i32 %1)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ ENOTSUP;
int /*<<< orphan*/ errno;
int ioqueue_eventfd() {
  errno = ENOTSUP;
  return -1;
}


x86 assembly (clang, -O0):
<ioqueue_eventfd>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec4(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ioqueue_eventfd>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOTSUP = global i32 0
@errno = global i32 0
define i32 @ioqueue_eventfd() {
%1 = load i32, i32* @ENOTSUP
store i32 %1, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOTSUP = global i32 0
@errno = global i32 0
define i32 @ioqueue_eventfd() {
%1 = load i32, i32* @ENOTSUP
store i32 %1, i32* @errno
ret i32 -1
}
int threads_runnable(unsigned int *threads_running) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @threads_runnable(i32* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ error(int, int /*<<< orphan*/, char *, char const *);
void usage(const char *filepath) {
  error(1, 0,
        "Usage: %s [-46acmHPtTuvz] [-C cpu] [-D dst ip] [-l secs] [-M "
        "messagenr] [-p port] [-s sendsize] [-S gsosize]",
        filepath);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x1,%edi
xor    %esi,%esi
lea    0xed2(%rip),%rdx
call   1030 <error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdx
mov    $0x1,%edi
xor    %esi,%esi
jmp    1030 <error@plt>

LLVM IR (-O0):
@.str = [109 x i8] c"Usage: %s [-46acmHPtTuvz] [-C cpu] [-D dst ip] [-l secs] [-M messagenr] [-p port] [-s sendsize] [-S gsosize]\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @error(i32 1, i32 0, i8* getelementptr inbounds ([109 x i8], [109 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [109 x i8] c"Usage: %s [-46acmHPtTuvz] [-C cpu] [-D dst ip] [-l secs] [-M messagenr] [-p port] [-s sendsize] [-S gsosize]\00"
define void @usage(i8* %0) {
%2 = tail call i32 @error(i32 1, i32 0, i8* getelementptr inbounds ([109 x i8], [109 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_something_during_suite_teardown() {
  printf("I was called during suite teardown\n");
}


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

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

LLVM IR (-O0):
@.str = [36 x i8] c"I was called during suite teardown\0A\00"
define void @print_something_during_suite_teardown() {
%1 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [35 x i8] c"I was called during suite teardown\00"
define void @print_something_during_suite_teardown() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ output_char(int);
void output_short(int n) {
  output_char(n);
  output_char(n >> 8);
}


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

x86 assembly (clang, -O2):
<output_short>:
push   %rbx
mov    %edi,%ebx
call   1030 <output_char@plt>
sar    $0x8,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <output_char@plt>

LLVM IR (-O0):
define void @output_short(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @output_char(i32 %3)
%5 = load i32, i32* %2
%6 = ashr i32 %5, 8
%7 = call i32 @output_char(i32 %6)
ret void
}

LLVM IR (-O2):
define void @output_short(i32 %0) {
%2 = tail call i32 @output_char(i32 %0)
%3 = ashr i32 %0, 8
%4 = tail call i32 @output_char(i32 %3)
ret void
}
unsigned int f10(unsigned int x, long int y) {
  return (x << y) | (x >> ((-y) & (8 * sizeof(unsigned int) - 1)));
}


x86 assembly (clang, -O0):
<f10>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x10(%rbp),%rcx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
xor    %ecx,%ecx
sub    -0x10(%rbp),%rcx
and    $0x1f,%rcx
shr    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f10>:
mov    %rsi,%rcx
mov    %edi,%eax
rol    %cl,%eax
ret

LLVM IR (-O0):
define i32 @f10(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%5 = load i32, i32* %3
%6 = load i64, i64* %4
%7 = trunc i64 %6 to i32
%8 = shl i32 %5, %7
%9 = load i32, i32* %3
%10 = load i64, i64* %4
%11 = sub nsw i64 0, %10
%12 = and i64 %11, 31
%13 = trunc i64 %12 to i32
%14 = lshr i32 %9, %13
%15 = or i32 %8, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @f10(i32 %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = shl i32 %0, %3
%5 = sub i32 0, %3
%6 = and i32 %5, 31
%7 = lshr i32 %0, %6
%8 = or i32 %7, %4
ret i32 %8
}
double foo2(double a, double b, double c) { return a * b * c; }


x86 assembly (clang, -O0):
<foo2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo2>:
mulsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @foo2(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = fmul double %7, %8
%10 = load double, double* %6
%11 = fmul double %9, %10
ret double %11
}

LLVM IR (-O2):
define double @foo2(double %0, double %1, double %2) {
%4 = fmul double %0, %1
%5 = fmul double %4, %2
ret double %5
}
/* Variables and functions */
char toupper(char);
void convertToUppercase(char *sPtr) {
  while (*sPtr != '\0') {
    *sPtr = toupper(*sPtr);
    ++sPtr;
  }
}


x86 assembly (clang, -O0):
<convertToUppercase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1151 <convertToUppercase+0x41>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <convertToUppercase+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convertToUppercase>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1136 <convertToUppercase+0x26>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <toupper@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <convertToUppercase+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @convertToUppercase(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %8, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %15
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = call signext i8 @toupper(i8 signext %10)
%12 = load i8*, i8** %2
store i8 %11, i8* %12
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %2
br label %3
15: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @convertToUppercase(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call signext i8 @toupper(i8 signext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
int dep3(void) { return 42; }


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

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

LLVM IR (-O0):
define i32 @dep3() {
ret i32 42
}

LLVM IR (-O2):
define i32 @dep3() {
ret i32 42
}
/* Variables and functions */
int /*<<< orphan*/ osTimerInit();
int /*<<< orphan*/ taskInit();
void osSetup() {
  osTimerInit();
  taskInit();
}


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

x86 assembly (clang, -O2):
<osSetup>:
push   %rax
xor    %eax,%eax
call   1030 <osTimerInit@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <taskInit@plt>

LLVM IR (-O0):
define void @osSetup() {
%1 = call i32 (...) @osTimerInit()
%2 = call i32 (...) @taskInit()
ret void
}

LLVM IR (-O2):
define void @osSetup() {
%1 = tail call i32 (...) @osTimerInit()
%2 = tail call i32 (...) @taskInit()
ret void
}
void etm_save_reg_check(void) {}


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

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

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

LLVM IR (-O2):
define void @etm_save_reg_check() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ tiger_main();
int main() {
  tiger_main();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @tiger_main()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @tiger_main()
ret i32 0
}
/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
scalar_t__ standalone(int, char **);
int main(int argc, char **argv) {
  return (standalone(argc, argv) == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
}


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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <standalone@plt>
cmp    $0x0,%rax
jne    114d <main+0x3d>
mov    0x2e95(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
jmp    1159 <main+0x49>
mov    0x2e8c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1030 <standalone@plt>
test   %rax,%rax
jne    1124 <main+0x14>
mov    0x2eb6(%rip),%rax
jmp    112b <main+0x1b>
mov    0x2eb5(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i64 @standalone(i32 %6, i8** %7)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load i32, i32* @EXIT_SUCCESS
br label %14
12: ; preds = %2
%13 = load i32, i32* @EXIT_FAILURE
br label %14
14: ; preds = %12, %10
%15 = phi i32 [ %11, %10 ], [ %13, %12 ]
ret i32 %15
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i64 @standalone(i32 %0, i8** %1)
%4 = icmp eq i64 %3, 0
%5 = load i32, i32* @EXIT_SUCCESS
%6 = load i32, i32* @EXIT_FAILURE
%7 = select i1 %4, i32 %5, i32 %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ mmatch(char const *, char const *);
int match2patterns(const char *patrn, const char *string) {
  return !mmatch(patrn, string);
}


x86 assembly (clang, -O0):
<match2patterns>:
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 <mmatch@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<match2patterns>:
push   %rax
call   1030 <mmatch@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @match2patterns(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 = call i32 @mmatch(i8* %5, i8* %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @match2patterns(i8* %0, i8* %1) {
%3 = tail call i32 @mmatch(i8* %0, i8* %1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
signed int _mulschar(signed char x, signed char y) { return ((int)x * (int)y); }


x86 assembly (clang, -O0):
<_mulschar>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
imul   %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @_mulschar(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = mul nsw i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @_mulschar(i8 signext %0, i8 signext %1) {
%3 = sext i8 %0 to i32
%4 = sext i8 %1 to i32
%5 = mul nsw i32 %4, %3
ret i32 %5
}
long long f(long long a) { return __builtin_bswap64(a); }


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

x86 assembly (clang, -O2):
<f>:
mov    %rdi,%rax
bswap  %rax
ret

LLVM IR (-O0):
define i64 @f(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @llvm.bswap.i64(i64 %3)
ret i64 %4
}

LLVM IR (-O2):
define i64 @f(i64 %0) {
%2 = tail call i64 @llvm.bswap.i64(i64 %0)
ret i64 %2
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ send_event;
};
typedef TYPE_1__ XPropertyEvent;

/* Variables and functions */
int get_XPropertyEvent_send_event(void *_p) {
  return (int)((XPropertyEvent *)_p)->send_event;
}


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

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

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

LLVM IR (-O2):
define i32 @get_XPropertyEvent_send_event(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Type definitions */
struct stat {
  long st_size;
};

/* Variables and functions */
int /*<<< orphan*/ fstat(int, struct stat *);
long filelength(int fd) {
  struct stat st;
  fstat(fd, &st);
  return st.st_size;
}


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

x86 assembly (clang, -O2):
<filelength>:
push   %rax
mov    %rsp,%rsi
call   1030 <fstat@plt>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i64 }
define i64 @filelength(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.stat
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @fstat(i32 %4, %struct.stat* %3)
%6 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%7 = load i64, i64* %6
ret i64 %7
}

LLVM IR (-O2):
%struct.stat = type { i64 }
define i64 @filelength(i32 %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @fstat(i32 %0, %struct.stat* %2)
%5 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%6 = load i64, i64* %5
ret i64 %6
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ UARTSendData(int *, int);
int32_t NakPacket(void) {
  uint8_t ui8Nak;
  ui8Nak = 0x33;
  return (UARTSendData(&ui8Nak, 1));
}


x86 assembly (clang, -O0):
<NakPacket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x33,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
mov    $0x1,%esi
call   1030 <UARTSendData@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NakPacket>:
push   %rax
movl   $0x33,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x1,%esi
call   1030 <UARTSendData@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @NakPacket() {
%1 = alloca i32
store i32 51, i32* %1
%2 = call i32 @UARTSendData(i32* %1, i32 1)
ret i32 %2
}

LLVM IR (-O2):
define i32 @NakPacket() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 51, i32* %1
%3 = call i32 @UARTSendData(i32* %1, i32 1)
ret i32 %3
}
double _F_R_INF(const double rr, const double Dx, const double L_domain) {
  const double r = rr / Dx;
}


x86 assembly (clang, -O0):
<_F_R_INF>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @_F_R_INF(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
%9 = load double, double* %5
%10 = load double, double* %6
%11 = fdiv double %9, %10
store double %11, double* %8
%12 = load double, double* %4
ret double %12
}

LLVM IR (-O2):
define double @_F_R_INF(double %0, double %1, double %2) {
ret double undef
}
int main() {
  int x = (({
    int __val;
    {
      if (({ 1; }) == 1)
        __val = 1U;
      switch (4UL) {
      case 4:;
        goto ldv_35185;
      default:;
      ldv_35190:;
        goto ldv_35190;
      }
    ldv_35185:;
    }
    __val;
  }))
              ?: 1;
  if (x != 1) {
  ERROR:
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     1132 <main+0x32>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    113f <main+0x3f>
mov    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    113f <main+0x3f>
mov    -0x18(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
je     1160 <main+0x60>
jmp    1154 <main+0x54>
movl   $0x1,-0x4(%rbp)
jmp    1167 <main+0x67>
movl   $0x0,-0x4(%rbp)
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
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %3
br label %6
5: ; preds = %5
br label %5
6: ; preds = %0
%7 = load i32, i32* %3
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %6
br label %12
11: ; preds = %6
br label %12
12: ; preds = %11, %10
%13 = phi i32 [ %8, %10 ], [ 1, %11 ]
store i32 %13, i32* %2
%14 = load i32, i32* %2
%15 = icmp ne i32 %14, 1
br i1 %15, label %16, label %18
16: ; preds = %12
br label %17
17: ; preds = %16
store i32 1, i32* %1
br label %19
18: ; preds = %12
store i32 0, i32* %1
br label %19
19: ; preds = %18, %17
%20 = load i32, i32* %1
ret i32 %20
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ rand_limit(int);
unsigned char *rand_bytes(unsigned char *buf, int len) {
  int i;
  for (i = 0; i < len; ++i)
    *buf++ = rand_limit(256);
  return buf;
}


x86 assembly (clang, -O0):
<rand_bytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115d <rand_bytes+0x4d>
mov    $0x100,%edi
call   1030 <rand_limit@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <rand_bytes+0x16>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_bytes>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
test   %esi,%esi
jle    1135 <rand_bytes+0x25>
mov    %esi,%ebp
nopl   0x0(%rax)
mov    $0x100,%edi
call   1030 <rand_limit@plt>
mov    %al,(%rbx)
add    $0x1,%rbx
add    $0xffffffff,%ebp
jne    1120 <rand_bytes+0x10>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @rand_bytes(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %15, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %18
10: ; preds = %6
%11 = call i32 @rand_limit(i32 256)
%12 = trunc i32 %11 to i8
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %3
store i8 %12, i8* %13
br label %15
15: ; preds = %10
%16 = load i32, i32* %5
%17 = add nsw i32 %16, 1
store i32 %17, i32* %5
br label %6
18: ; preds = %6
%19 = load i8*, i8** %3
ret i8* %19
}

LLVM IR (-O2):
define i8* @rand_bytes(i8* writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2, %4
%5 = phi i32 [ %10, %4 ], [ 0, %2 ]
%6 = phi i8* [ %9, %4 ], [ %0, %2 ]
%7 = tail call i32 @rand_limit(i32 256)
%8 = trunc i32 %7 to i8
%9 = getelementptr inbounds i8, i8* %6, i64 1
store i8 %8, i8* %6
%10 = add nuw nsw i32 %5, 1
%11 = icmp eq i32 %10, %1
br i1 %11, label %12, label %4
12: ; preds = %4, %2
%13 = phi i8* [ %0, %2 ], [ %9, %4 ]
ret i8* %13
}
/* Variables and functions */
void *_sp_realloc(void *, size_t);
void *sp_mem_realloc(void *ptr, size_t size) { return _sp_realloc(ptr, size); }


x86 assembly (clang, -O0):
<sp_mem_realloc>:
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 <_sp_realloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sp_mem_realloc>:
jmp    1030 <_sp_realloc@plt>

LLVM IR (-O0):
define i8* @sp_mem_realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i8* @_sp_realloc(i8* %5, i64 %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @sp_mem_realloc(i8* %0, i64 %1) {
%3 = tail call i8* @_sp_realloc(i8* %0, i64 %1)
ret i8* %3
}
void dummyinput_SDL_KeyUp(int keymod, int keysym) {}


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

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

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

LLVM IR (-O2):
define void @dummyinput_SDL_KeyUp(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isalnum(int);
void t_isalnum_0x73() {
  Assert_real((isalnum(115)),
              "/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_isalnum.c",
              580, ("isalnum should be 1 for s"));
}


x86 assembly (clang, -O0):
<t_isalnum_0x73>:
push   %rbp
mov    %rsp,%rbp
mov    $0x73,%edi
call   1030 <isalnum@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x244,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalnum_0x73>:
push   %rax
mov    $0x73,%edi
call   1030 <isalnum@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x244,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 1 for s\00"
define void @t_isalnum_0x73() {
%1 = call i32 @isalnum(i32 115)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 580, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 1 for s\00"
define void @t_isalnum_0x73() {
%1 = tail call i32 @isalnum(i32 115)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 580, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void nerror(char error_text[]) {
  fprintf(stderr, "run-time error...\n");
  fprintf(stderr, "%s\n", error_text);
  fprintf(stderr, "...now exiting to system...\n");
  exit(1);
}


x86 assembly (clang, -O0):
<nerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xec4(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xebc(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
lea    0xea9(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<nerror>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eb2(%rip),%r14
mov    (%r14),%edi
lea    0xec8(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xeca(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xeba(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [19 x i8] c"run-time error...\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [29 x i8] c"...now exiting to system...\0A\00"
define void @nerror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %2
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%8 = load i32, i32* @stderr
%9 = call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"run-time error...\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [29 x i8] c"...now exiting to system...\0A\00"
define void @nerror(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%6 = load i32, i32* @stderr
%7 = tail call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int val;
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint8_t *ui16_to_bytes(uint8_t *buf, uint16_t val) {
  buf[0] = (val >> 8) & 0xff;
  buf[1] = (val)&0xff;
  return buf + 2;
}


x86 assembly (clang, -O0):
<ui16_to_bytes>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x8(%rbp),%rax
add    $0x8,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ui16_to_bytes>:
mov    %esi,%eax
movzbl %ah,%ecx
mov    %ecx,(%rdi)
movzbl %al,%eax
mov    %eax,0x4(%rdi)
lea    0x8(%rdi),%rax
ret

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

LLVM IR (-O2):
define i32* @ui16_to_bytes(i32* writeonly %0, i32 %1) {
%3 = lshr i32 %1, 8
%4 = and i32 %3, 255
store i32 %4, i32* %0
%5 = and i32 %1, 255
%6 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %5, i32* %6
%7 = getelementptr inbounds i32, i32* %0, i64 2
ret i32* %7
}
/* Variables and functions */
size_t isqrt(size_t x) {
  size_t i;
  if (x == 0)
    return 0;
  for (i = 1; i * i < x; i++)
    ;
  return i;
}


x86 assembly (clang, -O0):
<isqrt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1120 <isqrt+0x20>
movq   $0x0,-0x8(%rbp)
jmp    1159 <isqrt+0x59>
movq   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%rax
imul   -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1151 <isqrt+0x51>
jmp    1140 <isqrt+0x40>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <isqrt+0x28>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isqrt>:
xor    %eax,%eax
test   %rdi,%rdi
je     1120 <isqrt+0x20>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rax
mov    %rax,%rcx
imul   %rax,%rcx
cmp    %rdi,%rcx
jb     1110 <isqrt+0x10>
ret

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

LLVM IR (-O2):
define i64 @isqrt(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %7, %3 ], [ 1, %1 ]
%5 = mul i64 %4, %4
%6 = icmp ult i64 %5, %0
%7 = add i64 %4, 1
br i1 %6, label %3, label %8
8: ; preds = %3, %1
%9 = phi i64 [ 0, %1 ], [ %4, %3 ]
ret i64 %9
}