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


x86 assembly (clang, -O0):
<f4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @f4(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ nums;

/* Variables and functions */
int /*<<< orphan*/ bubble_sort(int *, int);
int /*<<< orphan*/ print_int_array(char *, int *, int);
int main(int argc, char *argv[]) {
  int nums[] = {5, 2, 4, 7, 1, 3, 2, 6};
  int n = (sizeof(nums) / sizeof(nums[0]));
  bubble_sort(nums, n);
  print_int_array("Sorted nums:  ", nums, n);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec1(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x8,-0x34(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1040 <bubble_sort@plt>
lea    -0x30(%rbp),%rsi
mov    -0x34(%rbp),%edx
lea    0xea4(%rip),%rdi
call   1030 <print_int_array@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movaps 0xee4(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x8,%esi
call   1040 <bubble_sort@plt>
lea    0xecd(%rip),%rdi
mov    %rbx,%rsi
mov    $0x8,%edx
call   1030 <print_int_array@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.nums = [8 x i32] [i32 5, i32 2, i32 4, i32 7, i32 1, i32 3, i32 2, i32 6]
@.str = [15 x i8] c"Sorted nums: \00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca [8 x i32]
%6 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%7 = bitcast [8 x i32]* %5 to i8*
store i32 8, i32* %6
%8 = getelementptr inbounds [8 x i32], [8 x i32]* %5, i64 0, i64 0
%9 = load i32, i32* %6
%10 = call i32 @bubble_sort(i32* %8, i32 %9)
%11 = getelementptr inbounds [8 x i32], [8 x i32]* %5, i64 0, i64 0
%12 = load i32, i32* %6
%13 = call i32 @print_int_array(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32* %11, i32 %12)
ret i32 0
}

LLVM IR (-O2):
@__const.main.nums = [8 x i32] [i32 5, i32 2, i32 4, i32 7, i32 1, i32 3, i32 2, i32 6]
@.str = [15 x i8] c"Sorted nums: \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [8 x i32]
%4 = bitcast [8 x i32]* %3 to i8*
%5 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
%6 = call i32 @bubble_sort(i32* %5, i32 8)
%7 = call i32 @print_int_array(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32* %5, i32 8)
ret i32 0
}
/* Type definitions */
struct timespec {
  int tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ nanosleep(struct timespec *, int /*<<< orphan*/ *);
void WaitForRobovero(void) {
  struct timespec timeout;
  timeout.tv_sec = 0;
  timeout.tv_nsec = 1000000;
  nanosleep(&timeout, NULL);
}


x86 assembly (clang, -O0):
<WaitForRobovero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
movl   $0xf4240,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <nanosleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WaitForRobovero>:
sub    $0x18,%rsp
movq   $0x0,0x10(%rsp)
movl   $0xf4240,0x8(%rsp)
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i64 }
define void @WaitForRobovero() {
%1 = alloca %struct.timespec
%2 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
store i64 0, i64* %2
%3 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
store i32 1000000, i32* %3
%4 = call i32 @nanosleep(%struct.timespec* %1, i32* null)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32, i64 }
define void @WaitForRobovero() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
store i64 0, i64* %3
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
store i32 1000000, i32* %4
%5 = call i32 @nanosleep(%struct.timespec* %1, i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DirectIndexedXE1(int);
int /*<<< orphan*/ STA8(int /*<<< orphan*/);
void Op95E1(void) { STA8(DirectIndexedXE1(2)); }


x86 assembly (clang, -O0):
<Op95E1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <DirectIndexedXE1@plt>
mov    %eax,%edi
call   1040 <STA8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Op95E1>:
push   %rax
mov    $0x2,%edi
call   1030 <DirectIndexedXE1@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <STA8@plt>

LLVM IR (-O0):
define void @Op95E1() {
%1 = call i32 @DirectIndexedXE1(i32 2)
%2 = call i32 @STA8(i32 %1)
ret void
}

LLVM IR (-O2):
define void @Op95E1() {
%1 = tail call i32 @DirectIndexedXE1(i32 2)
%2 = tail call i32 @STA8(i32 %1)
ret void
}
/* Variables and functions */
scalar_t__ jnl(int, long double);
int /*<<< orphan*/ link_failure_jnl();
void test_jnl(int x, long double ld) {
  if (jnl(x, ld) != jnl(x, ld))
    link_failure_jnl();
}


x86 assembly (clang, -O0):
<test_jnl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
fldt   0x10(%rbp)
mov    %edi,-0x4(%rbp)
fstpt  -0x20(%rbp)
mov    -0x4(%rbp),%edi
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <jnl@plt>
mov    %rax,-0x28(%rbp)
mov    -0x4(%rbp),%edi
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <jnl@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
cmp    %rcx,%rax
je     116c <test_jnl+0x4c>
mov    $0x0,%al
call   1040 <link_failure_jnl@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_jnl>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %edi,%ebx
fldt   0x40(%rsp)
fld    %st(0)
fstpt  0x1c(%rsp)
fstpt  (%rsp)
call   1030 <jnl@plt>
mov    %rax,%r14
fldt   0x1c(%rsp)
fstpt  (%rsp)
mov    %ebx,%edi
call   1030 <jnl@plt>
cmp    %rax,%r14
jne    1159 <test_jnl+0x39>
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r14
jmp    1040 <link_failure_jnl@plt>

LLVM IR (-O0):
define void @test_jnl(i32 %0, x86_fp80 %1) {
%3 = alloca i32
%4 = alloca x86_fp80
store i32 %0, i32* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load i32, i32* %3
%6 = load x86_fp80, x86_fp80* %4
%7 = call i64 @jnl(i32 %5, x86_fp80 %6)
%8 = load i32, i32* %3
%9 = load x86_fp80, x86_fp80* %4
%10 = call i64 @jnl(i32 %8, x86_fp80 %9)
%11 = icmp ne i64 %7, %10
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 (...) @link_failure_jnl()
br label %14
14: ; preds = %12, %2
ret void
}

LLVM IR (-O2):
define void @test_jnl(i32 %0, x86_fp80 %1) {
%3 = tail call i64 @jnl(i32 %0, x86_fp80 %1)
%4 = tail call i64 @jnl(i32 %0, x86_fp80 %1)
%5 = icmp eq i64 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 (...) @link_failure_jnl()
br label %8
8: ; preds = %6, %2
ret void
}
/* Variables and functions */
scalar_t__ isspace(char const);
char const *nextToken(char const *input) {
  for (; *input && isspace(*input); input++) {
  }
  return input;
}


x86 assembly (clang, -O0):
<nextToken>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1147 <nextToken+0x37>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1157 <nextToken+0x47>
jmp    116d <nextToken+0x5d>
jmp    115c <nextToken+0x4c>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <nextToken+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nextToken>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1139 <nextToken+0x29>
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <isspace@plt>
test   %rax,%rax
je     1139 <nextToken+0x29>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <nextToken+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @nextToken(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %16, %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 %13
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = call i64 @isspace(i8 signext %10)
%12 = icmp ne i64 %11, 0
br label %13
13: ; preds = %8, %3
%14 = phi i1 [ false, %3 ], [ %12, %8 ]
br i1 %14, label %15, label %19
15: ; preds = %13
br label %16
16: ; preds = %15
%17 = load i8*, i8** %2
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %2
br label %3
19: ; preds = %13
%20 = load i8*, i8** %2
ret i8* %20
}

LLVM IR (-O2):
define i8* @nextToken(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %9
%5 = phi i8 [ %11, %9 ], [ %2, %1 ]
%6 = phi i8* [ %10, %9 ], [ %0, %1 ]
%7 = tail call i64 @isspace(i8 signext %5)
%8 = icmp eq i64 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %9, %1
%14 = phi i8* [ %0, %1 ], [ %10, %9 ], [ %6, %4 ]
ret i8* %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double, unsigned long);
double ret_double(double a, double b) {
  double ret = (a + b);
  unsigned long *ul;
  ul = (unsigned long *)&ret;
  printf("// return %e, %lX\n", ret, *ul);
  return ret;
}


x86 assembly (clang, -O0):
<ret_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
lea    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    -0x20(%rbp),%rax
mov    (%rax),%rsi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ret_double>:
push   %rax
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rsp)
movq   %xmm0,%rsi
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
movsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [19 x i8] c"// return %e, %lX\0A\00"
define double @ret_double(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca i64*
store double %0, double* %3
store double %1, double* %4
%7 = load double, double* %3
%8 = load double, double* %4
%9 = fadd double %7, %8
store double %9, double* %5
%10 = bitcast double* %5 to i64*
store i64* %10, i64** %6
%11 = load double, double* %5
%12 = load i64*, i64** %6
%13 = load i64, i64* %12
%14 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), double %11, i64 %13)
%15 = load double, double* %5
ret double %15
}

LLVM IR (-O2):
@.str = [19 x i8] c"// return %e, %lX\0A\00"
define double @ret_double(double %0, double %1) {
%3 = fadd double %0, %1
%4 = bitcast double %3 to i64
%5 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), double %3, i64 %4)
ret double %3
}
int do_391() { return 391; }


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

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

LLVM IR (-O0):
define i32 @do_391() {
ret i32 391
}

LLVM IR (-O2):
define i32 @do_391() {
ret i32 391
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ puts(char *);
void usage() {
  puts("Usage: ntless file");
  exit(1);
}


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"Usage: ntless file\00"
define void @usage() {
%1 = call i32 @puts(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [19 x i8] c"Usage: ntless file\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ glInitNames();
void qglInitNames(void) { glInitNames(); }


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

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

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

LLVM IR (-O2):
define void @qglInitNames() {
%1 = tail call i32 (...) @glInitNames()
ret void
}
__attribute__((no, noclone)) unsigned __int128 t170_5mul(unsigned __int128 x) {
  unsigned __int128 r;
  if (__builtin_mul_overflow(x, (unsigned __int128)(3), &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t170_5mul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x28(%rbp),%rax
mov    $0x3,%ecx
mul    %rcx
mov    %rax,%rsi
mov    -0x50(%rbp),%rax
seto   %dl
mov    %dl,-0x41(%rbp)
mul    %rcx
mov    %rax,%rcx
mov    -0x41(%rbp),%al
add    %rsi,%rdx
setb   %sil
or     %sil,%al
mov    %rcx,-0x40(%rbp)
mov    %rdx,-0x38(%rbp)
test   $0x1,%al
jne    1179 <t170_5mul+0x69>
jmp    1180 <t170_5mul+0x70>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x40(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t170_5mul>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rax
mov    $0x3,%esi
mul    %rsi
mov    %rax,%rcx
mov    %rdi,%rax
seto   %dil
mul    %rsi
mov    %rax,%r14
mov    %rdx,%rbx
add    %rcx,%rbx
setb   %al
or     %dil,%al
cmp    $0x1,%al
jne    1146 <t170_5mul+0x36>
xor    %eax,%eax
call   1030 <bar@plt>
mov    %r14,%rax
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define { i64, i64 } @t170_5mul(i64 %0, i64 %1) {
%3 = zext i64 %1 to i128
%4 = shl nuw i128 %3, 64
%5 = zext i64 %0 to i128
%6 = or i128 %4, %5
%7 = tail call { i128, i1 } @llvm.umul.with.overflow.i128(i128 %6, i128 3)
%8 = extractvalue { i128, i1 } %7, 1
%9 = extractvalue { i128, i1 } %7, 0
br i1 %8, label %10, label %12
10: ; preds = %2
%11 = tail call i32 (...) @bar()
br label %12
12: ; preds = %10, %2
%13 = trunc i128 %9 to i64
%14 = lshr i128 %9, 64
%15 = trunc i128 %14 to i64
%16 = insertvalue { i64, i64 } poison, i64 %13, 0
%17 = insertvalue { i64, i64 } %16, i64 %15, 1
ret { i64, i64 } %17
}
/* Variables and functions */
int /*<<< orphan*/ at_assert_f(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ failure();
void _at_tf_Failure(void *_at_input) {
  if (!at_assert_f(failure(),
                   "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                   "outputs/2022-01-22/02-19-57/repos/alexandream/atest/refs/"
                   "heads/master/src/example.c",
                   40))
    return;
}


x86 assembly (clang, -O0):
<_at_tf_Failure>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <failure@plt>
mov    %eax,%edi
lea    0xec4(%rip),%rsi
mov    $0x28,%edx
call   1040 <at_assert_f@plt>
cmp    $0x0,%eax
jne    1154 <_at_tf_Failure+0x34>
jmp    1154 <_at_tf_Failure+0x34>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_at_tf_Failure>:
push   %rax
xor    %eax,%eax
call   1030 <failure@plt>
lea    0xed1(%rip),%rsi
mov    %eax,%edi
mov    $0x28,%edx
pop    %rax
jmp    1040 <at_assert_f@plt>

LLVM IR (-O0):
@.str = [140 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/alexandream/atest/refs/heads/master/src/example.c\00"
define void @_at_tf_Failure(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @failure()
%4 = call i32 @at_assert_f(i32 %3, i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str, i64 0, i64 0), i32 40)
%5 = icmp ne i32 %4, 0
br i1 %5, label %7, label %6
6: ; preds = %1
br label %7
7: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@.str = [140 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/alexandream/atest/refs/heads/master/src/example.c\00"
define void @_at_tf_Failure(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @failure()
%3 = tail call i32 @at_assert_f(i32 %2, i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str, i64 0, i64 0), i32 40)
ret void
}
/* Variables and functions */
int mcfioC_NextSpecificEvent(int, int, int, int, int);
int mcfio_nextspecificevent_(int *stream, int *ievt, int *istore, int *irun,
                             int *itrig) {
  return mcfioC_NextSpecificEvent(*stream, *ievt, *istore, *irun, *itrig);
}


x86 assembly (clang, -O0):
<mcfio_nextspecificevent_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
mov    -0x28(%rbp),%rax
mov    (%rax),%r8d
call   1030 <mcfioC_NextSpecificEvent@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mcfio_nextspecificevent_>:
mov    (%rdi),%edi
mov    (%rsi),%esi
mov    (%rdx),%edx
mov    (%rcx),%ecx
mov    (%r8),%r8d
jmp    1030 <mcfioC_NextSpecificEvent@plt>

LLVM IR (-O0):
define i32 @mcfio_nextspecificevent_(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4) {
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
store i32* %0, i32** %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store i32* %4, i32** %10
%11 = load i32*, i32** %6
%12 = load i32, i32* %11
%13 = load i32*, i32** %7
%14 = load i32, i32* %13
%15 = load i32*, i32** %8
%16 = load i32, i32* %15
%17 = load i32*, i32** %9
%18 = load i32, i32* %17
%19 = load i32*, i32** %10
%20 = load i32, i32* %19
%21 = call i32 @mcfioC_NextSpecificEvent(i32 %12, i32 %14, i32 %16, i32 %18, i32 %20)
ret i32 %21
}

LLVM IR (-O2):
define i32 @mcfio_nextspecificevent_(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2, i32* nocapture %3, i32* nocapture %4) {
%6 = load i32, i32* %0
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = tail call i32 @mcfioC_NextSpecificEvent(i32 %6, i32 %7, i32 %8, i32 %9, i32 %10)
ret i32 %11
}
int dummy_f_0_0(int n) { return n * 4; }


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

x86 assembly (clang, -O2):
<dummy_f_0_0>:
lea    0x0(,%rdi,4),%eax
ret

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

LLVM IR (-O2):
define i32 @dummy_f_0_0(i32 %0) {
%2 = shl nsw i32 %0, 2
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ write_byte(int, int, int /*<<< orphan*/);
void set_diskette_ret_status(uint8_t value) {
  write_byte(0x0040, 0x0041, value);
}


x86 assembly (clang, -O0):
<set_diskette_ret_status>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0x40,%edi
mov    $0x41,%esi
call   1030 <write_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_diskette_ret_status>:
mov    %edi,%edx
mov    $0x40,%edi
mov    $0x41,%esi
jmp    1030 <write_byte@plt>

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

LLVM IR (-O2):
define void @set_diskette_ret_status(i32 %0) {
%2 = tail call i32 @write_byte(i32 64, i32 65, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, char, unsigned int);
void OsaMemSet(void *d, char val, unsigned int len) { memset(d, val, len); }


x86 assembly (clang, -O0):
<OsaMemSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x9(%rbp),%al
mov    -0x10(%rbp),%edx
movsbl %al,%esi
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OsaMemSet>:
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @OsaMemSet(i8* %0, i8 signext %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i32
store i8* %0, i8** %4
store i8 %1, i8* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8, i8* %5
%9 = load i32, i32* %6
%10 = call i32 @memset(i8* %7, i8 signext %8, i32 %9)
ret void
}

LLVM IR (-O2):
define void @OsaMemSet(i8* %0, i8 signext %1, i32 %2) {
%4 = tail call i32 @memset(i8* %0, i8 signext %1, i32 %2)
ret void
}
int numaCurrentNode(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @numaCurrentNode() {
ret i32 0
}

LLVM IR (-O2):
define i32 @numaCurrentNode() {
ret i32 0
}
/* Variables and functions */
void *stack_pop(void *array[], int size) {
  void **base;
  if (array[0] < (void *)((size_t)array + size)) {
    base = *array;
    array[0] += sizeof(void *);
    return *base;
  }
  return NULL;
}


x86 assembly (clang, -O0):
<stack_pop>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    -0x10(%rbp),%rcx
movslq -0x14(%rbp),%rdx
add    %rdx,%rcx
cmp    %rcx,%rax
jae    114f <stack_pop+0x4f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0x8,%rcx
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    1157 <stack_pop+0x57>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stack_pop>:
mov    (%rdi),%rax
movslq %esi,%rcx
add    %rdi,%rcx
cmp    %rcx,%rax
jae    1119 <stack_pop+0x19>
lea    0x8(%rax),%rcx
mov    %rcx,(%rdi)
mov    (%rax),%rax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @stack_pop(i8** %0, i32 %1) {
%3 = load i8*, i8** %0
%4 = ptrtoint i8** %0 to i64
%5 = sext i32 %1 to i64
%6 = add i64 %5, %4
%7 = inttoptr i64 %6 to i8*
%8 = icmp ult i8* %3, %7
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = bitcast i8* %3 to i8**
%11 = getelementptr i8, i8* %3, i64 8
store i8* %11, i8** %0
%12 = load i8*, i8** %10
br label %13
13: ; preds = %2, %9
%14 = phi i8* [ %12, %9 ], [ null, %2 ]
ret i8* %14
}
void tegra_smmu_map_misc_device(struct device *dev) {}


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

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

LLVM IR (-O0):
%struct.device = type opaque
define void @tegra_smmu_map_misc_device(%struct.device* %0) {
%2 = alloca %struct.device*
store %struct.device* %0, %struct.device** %2
ret void
}

LLVM IR (-O2):
%struct.device = type opaque
define void @tegra_smmu_map_misc_device(%struct.device* nocapture %0) {
ret void
}
void stst() {}


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

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

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

LLVM IR (-O2):
define void @stst() {
ret void
}
/* Variables and functions */
char getchar_and_flush();
int /*<<< orphan*/ printf(char *, char, char);
int /*<<< orphan*/ system(char *);
int main(int argc, char **argv) {
  char foo;
  system("clear");
  while (foo != '%') {
    foo = getchar_and_flush();
    printf("\nThe first character was %c or %d in ASCII.\n\n", foo, foo);
  }
  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)
lea    0xeb3(%rip),%rdi
call   1030 <system@plt>
movsbl -0x11(%rbp),%eax
cmp    $0x25,%eax
je     1184 <main+0x54>
mov    $0x0,%al
call   1050 <getchar_and_flush@plt>
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
lea    0xe93(%rip),%rdi
movsbl %al,%esi
movsbl -0x11(%rbp),%edx
call   1040 <printf@plt>
jmp    1152 <main+0x22>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xec6(%rip),%rdi
call   1030 <system@plt>
lea    0xec0(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <getchar_and_flush@plt>
movsbl %al,%ebp
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %ebp,%edx
call   1040 <printf@plt>
cmp    $0x25,%bpl
jne    1150 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"clear\00"
@.str.1 = [46 x i8] c"\0AThe first character was %c or %d in ASCII.\0A\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %12, %2
%9 = load i8, i8* %6
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 37
br i1 %11, label %12, label %17
12: ; preds = %8
%13 = call signext i8 (...) @getchar_and_flush()
store i8 %13, i8* %6
%14 = load i8, i8* %6
%15 = load i8, i8* %6
%16 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0), i8 signext %14, i8 signext %15)
br label %8
17: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"clear\00"
@.str.1 = [46 x i8] c"\0AThe first character was %c or %d in ASCII.\0A\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %2, %4
%5 = tail call signext i8 (...) @getchar_and_flush()
%6 = tail call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0), i8 signext %5, i8 signext %5)
%7 = icmp eq i8 %5, 37
br i1 %7, label %8, label %4
8: ; preds = %4
ret i32 0
}
/* Variables and functions */
int fat32_rd_n(void const *, int);
unsigned fat32_rd16(const void *p) { return fat32_rd_n(p, 2); }


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

x86 assembly (clang, -O2):
<fat32_rd16>:
mov    $0x2,%esi
jmp    1030 <fat32_rd_n@plt>

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

LLVM IR (-O2):
define i32 @fat32_rd16(i8* %0) {
%2 = tail call i32 @fat32_rd_n(i8* %0, i32 2)
ret i32 %2
}
int test_imm_49uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x49 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_49uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 73
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int test_imm_2Buint16_mem(unsigned short *val) {
  return ((*val) & (0x2B << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_2Buint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 43
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int fact(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int num;
  printf("Enter a number: ");
  scanf("%d", &num);
  printf("%d! = %d\n", num, fact(num));
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec7(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%ebx
mov    %ebx,%edi
call   1040 <fact@plt>
lea    0xeae(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Enter a number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [10 x i8] c"%d! = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = load i32, i32* %1
%6 = call i32 @fact(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %4, i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"Enter a number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [10 x i8] c"%d! = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @fact(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 %6)
ret i32 0
}
/* Type definitions */
struct forth_instance {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ st_push(struct forth_instance *, int);
scalar_t__ time(int /*<<< orphan*/ *);
void time_fetch(struct forth_instance *fi) { st_push(fi, (int)time(NULL)); }


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

x86 assembly (clang, -O2):
<time_fetch>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
call   1030 <time@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <st_push@plt>

LLVM IR (-O0):
%struct.forth_instance = type { i32 }
define void @time_fetch(%struct.forth_instance* %0) {
%2 = alloca %struct.forth_instance*
store %struct.forth_instance* %0, %struct.forth_instance** %2
%3 = load %struct.forth_instance*, %struct.forth_instance** %2
%4 = call i64 @time(i32* null)
%5 = trunc i64 %4 to i32
%6 = call i32 @st_push(%struct.forth_instance* %3, i32 %5)
ret void
}

LLVM IR (-O2):
%struct.forth_instance = type { i32 }
define void @time_fetch(%struct.forth_instance* %0) {
%2 = tail call i64 @time(i32* null)
%3 = trunc i64 %2 to i32
%4 = tail call i32 @st_push(%struct.forth_instance* %0, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setbuf(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ stdout;
void __attribute__((constructor)) setunbuf(void) { setbuf(stdout, NULL); }


x86 assembly (clang, -O0):
<setunbuf>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <setbuf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<setunbuf>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
jmp    1030 <setbuf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @setunbuf, i8* null }]
define void @setunbuf() {
%1 = load i32, i32* @stdout
%2 = call i32 @setbuf(i32 %1, i32* null)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @setunbuf, i8* null }]
define void @setunbuf() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @setbuf(i32 %1, i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ conq(int /*<<< orphan*/);
void con_twrite(char *p, int n) {
  while (*p)
    conq(*p++);
}


x86 assembly (clang, -O0):
<con_twrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1148 <con_twrite+0x38>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <conq@plt>
jmp    111f <con_twrite+0xf>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @con_twrite(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %8, %5 ], [ %0, %2 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = sext i8 %6 to i32
%10 = tail call i32 @conq(i32 %9)
%11 = load i8, i8* %8
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *malloc_safe(size_t s) {
  void *d;
  if ((d = malloc(s)) == NULL) {
    fprintf(stderr, "Out of memory\n");
    exit(EXIT_FAILURE);
  }
  return d;
}


x86 assembly (clang, -O0):
<malloc_safe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1176 <malloc_safe+0x46>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
lea    0xe9d(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e69(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc_safe>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <malloc_safe+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [15 x i8] c"Out of memory\0A\00"
@EXIT_FAILURE = global i32 0
define i8* @malloc_safe(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i32, i32* @stderr
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* @EXIT_FAILURE
%11 = call i32 @exit(i32 %10)
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"Out of memory\0A\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @malloc_safe(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void *TaskCode(void *argument) {
  int tid;
  tid = *((int *)argument);
  printf("Hello World! It's me, thread %d!\n", tid);
  return NULL;
}


x86 assembly (clang, -O0):
<TaskCode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [34 x i8] c"Hello World! It's me, thread %d!\0A\00"
define i8* @TaskCode(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i8* null
}

LLVM IR (-O2):
@.str = [34 x i8] c"Hello World! It's me, thread %d!\0A\00"
define noalias i8* @TaskCode(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ outputcar(int /*<<< orphan*/);
void output(char *s) {
  while (*s)
    outputcar(*s++);
}


x86 assembly (clang, -O0):
<output>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <output+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <outputcar@plt>
jmp    111c <output+0xc>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @output(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @outputcar(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setenv(char *, char *, int);
int main(int argc, char *argv[]) {
  setenv("FOO", "BAR", 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rdi
lea    0xed0(%rip),%rsi
mov    $0x1,%edx
call   1030 <setenv@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xee5(%rip),%rsi
mov    $0x1,%edx
call   1030 <setenv@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"FOO\00"
@.str.1 = [4 x i8] c"BAR\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @setenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"FOO\00"
@.str.1 = [4 x i8] c"BAR\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @setenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret i32 0
}
unsigned my_rand(unsigned *seed_p) {
  long long z = *seed_p;
  z *= 279470273;
  z %= 4294967291U;
  *seed_p = z;
  return *seed_p;
}


x86 assembly (clang, -O0):
<my_rand>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %rax,-0x10(%rbp)
imul   $0x10a860c1,-0x10(%rbp),%rax
10
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    $0xfffffffb,%ecx
cqto
idiv   %rcx
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_rand>:
mov    (%rdi),%eax
imul   $0x10a860c1,%rax,%rcx
movabs $0x800000028000000d,%rdx
mov    %rcx,%rax
mul    %rdx
shr    $0x1f,%rdx
lea    (%rdx,%rdx,4),%eax
add    %eax,%ecx
mov    %ecx,(%rdi)
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @my_rand(i32* %0) {
%2 = alloca i32*
%3 = alloca i64
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
%6 = zext i32 %5 to i64
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = mul nsw i64 %7, 279470273
store i64 %8, i64* %3
%9 = load i64, i64* %3
%10 = srem i64 %9, 4294967291
store i64 %10, i64* %3
%11 = load i64, i64* %3
%12 = trunc i64 %11 to i32
%13 = load i32*, i32** %2
store i32 %12, i32* %13
%14 = load i32*, i32** %2
%15 = load i32, i32* %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @my_rand(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = zext i32 %2 to i64
%4 = mul nuw nsw i64 %3, 279470273
%5 = urem i64 %4, 4294967291
%6 = trunc i64 %5 to i32
store i32 %6, i32* %0
ret i32 %6
}
int tls13_server_new_session_ticket_send(struct tls13_ctx *ctx) { return 1; }


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

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

LLVM IR (-O0):
%struct.tls13_ctx = type opaque
define i32 @tls13_server_new_session_ticket_send(%struct.tls13_ctx* %0) {
%2 = alloca %struct.tls13_ctx*
store %struct.tls13_ctx* %0, %struct.tls13_ctx** %2
ret i32 1
}

LLVM IR (-O2):
%struct.tls13_ctx = type opaque
define i32 @tls13_server_new_session_ticket_send(%struct.tls13_ctx* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ McSrv_DisableIrq();
int /*<<< orphan*/ McSrv_EnableIrq();
unsigned char machdep_ReadSPI(unsigned long);
unsigned char McSrv_ReadSPI(unsigned long dRegAddr) {
  unsigned char bReg;
  McSrv_DisableIrq();
  bReg = machdep_ReadSPI(dRegAddr);
  McSrv_EnableIrq();
  return bReg;
}


x86 assembly (clang, -O0):
<McSrv_ReadSPI>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <McSrv_DisableIrq@plt>
mov    -0x8(%rbp),%rdi
call   1040 <machdep_ReadSPI@plt>
mov    %al,-0x9(%rbp)
mov    $0x0,%al
call   1050 <McSrv_EnableIrq@plt>
movzbl -0x9(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<McSrv_ReadSPI>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <McSrv_DisableIrq@plt>
mov    %rbx,%rdi
call   1040 <machdep_ReadSPI@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <McSrv_EnableIrq@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i8 @McSrv_ReadSPI(i64 %0) {
%2 = alloca i64
%3 = alloca i8
store i64 %0, i64* %2
%4 = call i32 (...) @McSrv_DisableIrq()
%5 = load i64, i64* %2
%6 = call zeroext i8 @machdep_ReadSPI(i64 %5)
store i8 %6, i8* %3
%7 = call i32 (...) @McSrv_EnableIrq()
%8 = load i8, i8* %3
ret i8 %8
}

LLVM IR (-O2):
define zeroext i8 @McSrv_ReadSPI(i64 %0) {
%2 = tail call i32 (...) @McSrv_DisableIrq()
%3 = tail call zeroext i8 @machdep_ReadSPI(i64 %0)
%4 = tail call i32 (...) @McSrv_EnableIrq()
ret i8 %3
}