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

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int *twoSum(int *, int, int);
int main() {
  int *ans;
  int nums[] = {3, 2, 4};
  ans = twoSum(nums, sizeof(nums), 6);
  printf("%d %d\n", ans[0], ans[1]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x1c(%rbp)
mov    0xec8(%rip),%eax
mov    %eax,-0x14(%rbp)
lea    -0x1c(%rbp),%rdi
mov    $0xc,%esi
mov    $0x6,%edx
call   1040 <twoSum@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%edx
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xede(%rip),%eax
mov    %eax,0x10(%rsp)
mov    0xecb(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rdi
mov    $0xc,%esi
mov    $0x6,%edx
call   1040 <twoSum@plt>
mov    (%rax),%esi
mov    0x4(%rax),%edx
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@__const.main.nums = [3 x i32] [i32 3, i32 2, i32 4]
@.str = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = alloca [3 x i32]
%2 = bitcast [3 x i32]* %1 to i8*
%3 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%4 = call i32* @twoSum(i32* %3, i32 12, i32 6)
%5 = load i32, i32* %4
%6 = getelementptr inbounds i32, i32* %4, i64 1
%7 = load i32, i32* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ mm_optimize();
void mm_run() { mm_optimize(); }


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

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

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

LLVM IR (-O2):
define void @mm_run() {
%1 = tail call i32 (...) @mm_optimize()
ret void
}
int test_imm_04int32_reg(int val) { return ((val) & (0x04 << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_04int32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x4,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_04int32_reg(i32 %0) {
%2 = and i32 %0, 4
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ drv_Pertelian_send(char *, int);
int drv_Pertelian_backlight(int backlight) {
  char cmd[2];
  if (backlight <= 0)
    backlight = 2;
  else if (backlight >= 1)
    backlight = 3;
  cmd[0] = 0xfe;
  cmd[1] = backlight;
  drv_Pertelian_send(cmd, 2);
  return backlight;
}


x86 assembly (clang, -O0):
<drv_Pertelian_backlight>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jg     1131 <drv_Pertelian_backlight+0x21>
movl   $0x2,-0x4(%rbp)
jmp    1147 <drv_Pertelian_backlight+0x37>
cmpl   $0x1,-0x4(%rbp)
jl     1142 <drv_Pertelian_backlight+0x32>
movl   $0x3,-0x4(%rbp)
jmp    1147 <drv_Pertelian_backlight+0x37>
movb   $0xfe,-0x6(%rbp)
mov    -0x4(%rbp),%eax
mov    %al,-0x5(%rbp)
lea    -0x6(%rbp),%rdi
mov    $0x2,%esi
call   1030 <drv_Pertelian_send@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drv_Pertelian_backlight>:
push   %rbx
sub    $0x10,%rsp
xor    %ebx,%ebx
test   %edi,%edi
setle  %bl
xor    $0x3,%ebx
movb   $0xfe,0xe(%rsp)
mov    %bl,0xf(%rsp)
lea    0xe(%rsp),%rdi
mov    $0x2,%esi
call   1030 <drv_Pertelian_send@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @drv_Pertelian_backlight(i32 %0) {
%2 = alloca i32
%3 = alloca [2 x i8]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp sle i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 2, i32* %2
br label %12
7: ; preds = %1
%8 = load i32, i32* %2
%9 = icmp sge i32 %8, 1
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 3, i32* %2
br label %11
11: ; preds = %10, %7
br label %12
12: ; preds = %11, %6
%13 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
store i8 -2, i8* %13
%14 = load i32, i32* %2
%15 = trunc i32 %14 to i8
%16 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
store i8 %15, i8* %16
%17 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%18 = call i32 @drv_Pertelian_send(i8* %17, i32 2)
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @drv_Pertelian_backlight(i32 %0) {
%2 = alloca [2 x i8]
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%4 = icmp slt i32 %0, 1
%5 = select i1 %4, i32 2, i32 3
store i8 -2, i8* %3
%6 = trunc i32 %5 to i8
%7 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 1
store i8 %6, i8* %7
%8 = call i32 @drv_Pertelian_send(i8* %3, i32 2)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ V_freebuffer(int, int);
void V_freeuniform(int uoff) { V_freebuffer(uoff, 0x4); }


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

x86 assembly (clang, -O2):
<V_freeuniform>:
mov    $0x4,%esi
jmp    1030 <V_freebuffer@plt>

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

LLVM IR (-O2):
define void @V_freeuniform(i32 %0) {
%2 = tail call i32 @V_freebuffer(i32 %0, i32 4)
ret void
}
int f_min(int a, int b) { return a < b ? a : b; }


x86 assembly (clang, -O0):
<f_min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <f_min+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <f_min+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_min>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

LLVM IR (-O0):
define i32 @f_min(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @f_min(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
int mklower(int ch) {
  if (ch >= 0x41 && ch <= 0x5A)
    return (ch + 0x20);
  return (ch);
}


x86 assembly (clang, -O0):
<mklower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x41,-0x8(%rbp)
jl     1129 <mklower+0x29>
cmpl   $0x5a,-0x8(%rbp)
jg     1129 <mklower+0x29>
mov    -0x8(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <mklower+0x2f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mklower>:
lea    -0x41(%rdi),%ecx
lea    0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @mklower(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 65
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 90
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 32
store i32 %11, i32* %2
br label %14
12: ; preds = %6, %1
%13 = load i32, i32* %3
store i32 %13, i32* %2
br label %14
14: ; preds = %12, %9
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @mklower(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Variables and functions */
void OPENSSL_fork_prepare(void) {}


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

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

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

LLVM IR (-O2):
define void @OPENSSL_fork_prepare() {
ret void
}
/* Variables and functions */
float RAND_MAX;
scalar_t__ rand();
float get_random(float min, float max) {
  float rand_val;
  float range = max - min;
  rand_val = (((float)rand()) / RAND_MAX) * range;
  return min + rand_val;
}


x86 assembly (clang, -O0):
<get_random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
subss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2ss %rax,%xmm0
mov    0x2ea4(%rip),%rax
divss  (%rax),%xmm0
mulss  -0x10(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_random>:
push   %rax
movss  %xmm0,0x4(%rsp)
subss  %xmm0,%xmm1
movss  %xmm1,(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
mov    0x2eb2(%rip),%rax
divss  (%rax),%xmm0
mulss  (%rsp),%xmm0
addss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global float 0.000000e+00
define float @get_random(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %3
store float %1, float* %4
%7 = load float, float* %4
%8 = load float, float* %3
%9 = fsub float %7, %8
store float %9, float* %6
%10 = call i64 (...) @rand()
%11 = sitofp i64 %10 to float
%12 = load float, float* @RAND_MAX
%13 = fdiv float %11, %12
%14 = load float, float* %6
%15 = fmul float %13, %14
store float %15, float* %5
%16 = load float, float* %3
%17 = load float, float* %5
%18 = fadd float %16, %17
ret float %18
}

LLVM IR (-O2):
@RAND_MAX = global float 0.000000e+00
define float @get_random(float %0, float %1) {
%3 = fsub float %1, %0
%4 = tail call i64 (...) @rand()
%5 = sitofp i64 %4 to float
%6 = load float, float* @RAND_MAX
%7 = fdiv float %5, %6
%8 = fmul float %3, %7
%9 = fadd float %8, %0
ret float %9
}
int arch_get_random_seed_int(unsigned int *v) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @arch_get_random_seed_int(i32* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void usage(char *argv[]) {
  printf("usage:\n");
  printf("%s | dev\n", argv[0]);
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rbx
lea    0xedf(%rip),%rdi
call   1030 <puts@plt>
mov    (%rbx),%rsi
lea    0xec6(%rip),%rdi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"usage:\0A\00"
@.str.1 = [10 x i8] c"%s | dev\0A\00"
define void @usage(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = load i8**, i8*** %2
%5 = getelementptr inbounds i8*, i8** %4, i64 0
%6 = load i8*, i8** %5
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str.1 = [10 x i8] c"%s | dev\0A\00"
@str = [7 x i8] c"usage:\00"
define void @usage(i8** nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%3 = load i8*, i8** %0
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __fpurge(int /*<<< orphan*/);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
size_t strcspn(char *, char *);
void readString1(char variable[]) {
  fgets(variable, 1024, stdin);
  variable[strcspn(variable, "\n")] = '\0';
  __fpurge(stdin);
}


x86 assembly (clang, -O0):
<readString1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea1(%rip),%rax
mov    (%rax),%edx
mov    $0x400,%esi
call   1050 <fgets@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe9a(%rip),%rsi
call   1040 <strcspn@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax,%rcx,1)
mov    0x2e6b(%rip),%rax
mov    (%rax),%edi
call   1030 <__fpurge@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readString1>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eaa(%rip),%r14
mov    (%r14),%edx
mov    $0x400,%esi
call   1050 <fgets@plt>
lea    0xeae(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcspn@plt>
movb   $0x0,(%rbx,%rax,1)
mov    (%r14),%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <__fpurge@plt>

LLVM IR (-O0):
@stdin = global i32 0
@.str = [2 x i8] c"\0A\00"
define void @readString1(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @stdin
%5 = call i32 @fgets(i8* %3, i32 1024, i32 %4)
%6 = load i8*, i8** %2
%7 = load i8*, i8** %2
%8 = call i64 @strcspn(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%9 = getelementptr inbounds i8, i8* %6, i64 %8
store i8 0, i8* %9
%10 = load i32, i32* @stdin
%11 = call i32 @__fpurge(i32 %10)
ret void
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [2 x i8] c"\0A\00"
define void @readString1(i8* %0) {
%2 = load i32, i32* @stdin
%3 = tail call i32 @fgets(i8* %0, i32 1024, i32 %2)
%4 = tail call i64 @strcspn(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 0, i8* %5
%6 = load i32, i32* @stdin
%7 = tail call i32 @__fpurge(i32 %6)
ret void
}
void pgt_init(void) {}


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

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

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

LLVM IR (-O2):
define void @pgt_init() {
ret void
}
void cli() { __asm volatile("cli"); }


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

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

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

LLVM IR (-O2):
define void @cli() {
tail call void asm sideeffect "cli", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int count, sum = 0;
  for (count = 1; count <= 10; count++) {
    sum = sum + count;
  }
  printf("Sum (1..10) = %i\n", sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jg     114e <main+0x3e>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
mov    -0xc(%rbp),%esi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [18 x i8] c"Sum (1..10) = %i\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 55)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, ...);
int main(void) {
  int bob, jim = 21;
  bob = jim;
  bob *= 2;
  printf("jim: %d, bob: %d\n", jim, bob);
  jim = 60 + +3;
  printf("jim: %d\n", jim);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x15,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x3f,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [18 x i8] c"jim: %d, bob: %d\0A\00"
@.str.1 = [9 x i8] c"jim: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 21, i32* %3
%4 = load i32, i32* %3
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = mul nsw i32 %5, 2
store i32 %6, i32* %2
%7 = load i32, i32* %3
%8 = load i32, i32* %2
%9 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
store i32 63, i32* %3
%10 = load i32, i32* %3
%11 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"jim: %d, bob: %d\0A\00"
@.str.1 = [9 x i8] c"jim: %d\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 21, i32 42)
%2 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 63)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ u_long;
typedef int /*<<< orphan*/ u_int;
typedef int /*<<< orphan*/ bool_t;
typedef int /*<<< orphan*/ XDR;

/* Variables and functions */
int /*<<< orphan*/ xdr_u_long(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
bool_t xdr_u_int(XDR *xdrs, u_int *up) {
  return xdr_u_long(xdrs, (u_long *)up);
}


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

x86 assembly (clang, -O2):
<xdr_u_int>:
jmp    1030 <xdr_u_long@plt>

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

LLVM IR (-O2):
define i32 @xdr_u_int(i32* %0, i32* %1) {
%3 = tail call i32 @xdr_u_long(i32* %0, i32* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void PDQ_Report_null(void) { printf("foo!\n"); }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"foo!\0A\00"
define void @PDQ_Report_null() {
%1 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [5 x i8] c"foo!\00"
define void @PDQ_Report_null() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0xdc() {
  Assert_real((isdigit(220) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isdigit.c",
              1105, ("isdigit should be 0 for 0xdc"));
}


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

x86 assembly (clang, -O2):
<t_isdigit_0xdc>:
push   %rax
mov    $0xdc,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x451,%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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xdc\00"
define void @t_isdigit_0xdc() {
%1 = call i64 @isdigit(i32 220)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1105, i8* getelementptr inbounds ([29 x i8], [29 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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xdc\00"
define void @t_isdigit_0xdc() {
%1 = tail call i64 @isdigit(i32 220)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1105, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int any(char *, char *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int match_loc;
  char s1[] = "Hello";
  char s2[] = "yo";
  match_loc = any(s1, s2);
  printf("%d\n", match_loc);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xecb(%rip),%eax
mov    %eax,-0xe(%rbp)
mov    0xec5(%rip),%ax
mov    %ax,-0xa(%rbp)
mov    0xebc(%rip),%ax
mov    %ax,-0x11(%rbp)
mov    0xeb4(%rip),%al
mov    %al,-0xf(%rbp)
lea    -0xe(%rbp),%rdi
lea    -0x11(%rbp),%rsi
call   1040 <any@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movw   $0x6f,0x14(%rsp)
movl   $0x6c6c6548,0x10(%rsp)
6c
movb   $0x0,0xe(%rsp)
movw   $0x6f79,0xc(%rsp)
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rsi
call   1040 <any@plt>
lea    0xeb4(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.s1 = [6 x i8] c"Hello\00"
@__const.main.s2 = [3 x i8] c"yo\00"
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [6 x i8]
%4 = alloca [3 x i8]
store i32 0, i32* %1
%5 = bitcast [6 x i8]* %3 to i8*
%6 = bitcast [3 x i8]* %4 to i8*
%7 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [3 x i8], [3 x i8]* %4, i64 0, i64 0
%9 = call i32 @any(i8* %7, i8* %8)
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s1 = [6 x i8] c"Hello\00"
@__const.main.s2 = [3 x i8] c"yo\00"
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [6 x i8]
%2 = alloca [3 x i8]
%3 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%5 = call i32 @any(i8* %3, i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
char *setlocale(int category, char *locale) {
  (void)category;
  if (!locale || *locale == '\0' || (*locale == 'C' && locale[1] == '\0'))
    return "C";
  return 0;
}


x86 assembly (clang, -O0):
<setlocale>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1147 <setlocale+0x47>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1147 <setlocale+0x47>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x43,%eax
jne    1157 <setlocale+0x57>
mov    -0x18(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
jne    1157 <setlocale+0x57>
lea    0xeb2(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    115f <setlocale+0x5f>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<setlocale>:
lea    0xef9(%rip),%rax
test   %rsi,%rsi
je     111f <setlocale+0x1f>
mov    (%rsi),%cl
test   %cl,%cl
je     111f <setlocale+0x1f>
cmp    $0x43,%cl
jne    111d <setlocale+0x1d>
cmpb   $0x0,0x1(%rsi)
je     111f <setlocale+0x1f>
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [2 x i8] c"C\00"
define i8* @setlocale(i32 %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
%6 = load i32, i32* %4
%7 = load i8*, i8** %5
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %25
9: ; preds = %2
%10 = load i8*, i8** %5
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 0
br i1 %13, label %25, label %14
14: ; preds = %9
%15 = load i8*, i8** %5
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 67
br i1 %18, label %19, label %26
19: ; preds = %14
%20 = load i8*, i8** %5
%21 = getelementptr inbounds i8, i8* %20, i64 1
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = icmp eq i32 %23, 0
br i1 %24, label %25, label %26
25: ; preds = %19, %9, %2
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %3
br label %27
26: ; preds = %19, %14
store i8* null, i8** %3
br label %27
27: ; preds = %26, %25
%28 = load i8*, i8** %3
ret i8* %28
}

LLVM IR (-O2):
@.str = [2 x i8] c"C\00"
define i8* @setlocale(i32 %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %11, label %4
4: ; preds = %2
%5 = load i8, i8* %1
switch i8 %5, label %10 [
i8 0, label %11
i8 67, label %6
]
6: ; preds = %4
%7 = getelementptr inbounds i8, i8* %1, i64 1
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 0
br i1 %9, label %11, label %10
10: ; preds = %4, %6
br label %11
11: ; preds = %2, %6, %4, %10
%12 = phi i8* [ null, %10 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %4 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %6 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %2 ]
ret i8* %12
}
/* Variables and functions */
int abs(int);
int getUppercaseLowercaseOffset(void) { return abs(((int)'A') - ((int)'a')); }


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

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

LLVM IR (-O0):
define i32 @getUppercaseLowercaseOffset() {
%1 = call i32 @abs(i32 -32)
ret i32 %1
}

LLVM IR (-O2):
define i32 @getUppercaseLowercaseOffset() {
ret i32 32
}
/* Type definitions */
struct timeval {
  int tv_sec;
  scalar_t__ tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double curr_time(void) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return tv.tv_sec * 1e-6 + (double)tv.tv_usec;
}


x86 assembly (clang, -O0):
<curr_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdl -0x10(%rbp),%xmm0
cvtsi2sdq -0x8(%rbp),%xmm1
movsd  0xec8(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<curr_time>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdl 0x8(%rsp),%xmm0
cvtsi2sdq 0x10(%rsp),%xmm1
mulsd  0xecb(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define double @curr_time() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = sitofp i32 %4 to double
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = call double @llvm.fmuladd.f64(double %5, double 0x3EB0C6F7A0B5ED8D, double %8)
ret double %9
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define double @curr_time() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = sitofp i32 %5 to double
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = tail call double @llvm.fmuladd.f64(double %6, double 0x3EB0C6F7A0B5ED8D, double %9)
ret double %10
}
/* Variables and functions */
bool nrf52_errata_51(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_51() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ io_out8(int, int);
int /*<<< orphan*/ wait_KBC_sendready();
void enable_mouse(void) {
  wait_KBC_sendready();
  io_out8(0x0064, 0xd4);
  wait_KBC_sendready();
  io_out8(0x0060, 0xf4);
}


x86 assembly (clang, -O0):
<enable_mouse>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <wait_KBC_sendready@plt>
mov    $0x64,%edi
mov    $0xd4,%esi
call   1040 <io_out8@plt>
mov    $0x0,%al
call   1030 <wait_KBC_sendready@plt>
mov    $0x60,%edi
mov    $0xf4,%esi
call   1040 <io_out8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<enable_mouse>:
push   %rax
xor    %eax,%eax
call   1030 <wait_KBC_sendready@plt>
mov    $0x64,%edi
mov    $0xd4,%esi
call   1040 <io_out8@plt>
xor    %eax,%eax
call   1030 <wait_KBC_sendready@plt>
mov    $0x60,%edi
mov    $0xf4,%esi
pop    %rax
jmp    1040 <io_out8@plt>

LLVM IR (-O0):
define void @enable_mouse() {
%1 = call i32 (...) @wait_KBC_sendready()
%2 = call i32 @io_out8(i32 100, i32 212)
%3 = call i32 (...) @wait_KBC_sendready()
%4 = call i32 @io_out8(i32 96, i32 244)
ret void
}

LLVM IR (-O2):
define void @enable_mouse() {
%1 = tail call i32 (...) @wait_KBC_sendready()
%2 = tail call i32 @io_out8(i32 100, i32 212)
%3 = tail call i32 (...) @wait_KBC_sendready()
%4 = tail call i32 @io_out8(i32 96, i32 244)
ret void
}
/* Type definitions */
struct uwsgi_buffer {
  int dummy;
};

/* Variables and functions */
scalar_t__ uwsgi_buffer_append(struct uwsgi_buffer *, char *, int);
int uwsgi_webdav_multistatus_response_new(struct uwsgi_buffer *ub) {
  if (uwsgi_buffer_append(ub, "<D:response>\n", 13))
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<uwsgi_webdav_multistatus_response_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
mov    $0xd,%edx
call   1030 <uwsgi_buffer_append@plt>
cmp    $0x0,%rax
je     1147 <uwsgi_webdav_multistatus_response_new+0x37>
movl   $0xffffffff,-0x4(%rbp)
jmp    114e <uwsgi_webdav_multistatus_response_new+0x3e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uwsgi_webdav_multistatus_response_new>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0xd,%edx
call   1030 <uwsgi_buffer_append@plt>
neg    %rax
sbb    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.uwsgi_buffer = type { i32 }
@.str = [14 x i8] c"<D:response>\0A\00"
define i32 @uwsgi_webdav_multistatus_response_new(%struct.uwsgi_buffer* %0) {
%2 = alloca i32
%3 = alloca %struct.uwsgi_buffer*
store %struct.uwsgi_buffer* %0, %struct.uwsgi_buffer** %3
%4 = load %struct.uwsgi_buffer*, %struct.uwsgi_buffer** %3
%5 = call i64 @uwsgi_buffer_append(%struct.uwsgi_buffer* %4, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 13)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 -1, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
%struct.uwsgi_buffer = type { i32 }
@.str = [14 x i8] c"<D:response>\0A\00"
define i32 @uwsgi_webdav_multistatus_response_new(%struct.uwsgi_buffer* %0) {
%2 = tail call i64 @uwsgi_buffer_append(%struct.uwsgi_buffer* %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 13)
%3 = icmp ne i64 %2, 0
%4 = sext i1 %3 to i32
ret i32 %4
}
void termop_cleartab(struct ansiseq *s) {
  tnc_log_log(
      6, 4, -1,
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/fstd/telnetcat/refs/heads/devel/src/vt100.c",
      396, __func__, "unhandled");
  ansiseq_dump(s);
}


x86 assembly (clang, -O0):
<termop_cleartab>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x6,%edi
mov    $0x4,%esi
mov    $0xffffffff,%edx
lea    0xebe(%rip),%rcx
mov    $0x18c,%r8d
lea    0xf37(%rip),%r9
lea    0xf40(%rip),%rax
mov    %rax,(%rsp)
mov    $0x0,%al
call   1030 <tnc_log_log@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <ansiseq_dump@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<termop_cleartab>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xf67(%rip),%rax
mov    %rax,(%rsp)
lea    0xec6(%rip),%rcx
lea    0xf45(%rip),%r9
mov    $0x6,%edi
mov    $0x4,%esi
mov    $0xffffffff,%edx
mov    $0x18c,%r8d
xor    %eax,%eax
call   1030 <tnc_log_log@plt>
mov    %rbx,%rdi
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1040 <ansiseq_dump@plt>

LLVM IR (-O0):
%struct.ansiseq = type opaque
@.str = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fstd/telnetcat/refs/heads/devel/src/vt100.c\00"
@__func__.termop_cleartab = [16 x i8] c"termop_cleartab\00"
@.str.1 = [10 x i8] c"unhandled\00"
define void @termop_cleartab(%struct.ansiseq* %0) {
%2 = alloca %struct.ansiseq*
store %struct.ansiseq* %0, %struct.ansiseq** %2
%3 = call i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @tnc_log_log to i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...)*)(i32 6, i32 4, i32 -1, i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i32 396, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__func__.termop_cleartab, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%4 = load %struct.ansiseq*, %struct.ansiseq** %2
%5 = call i32 (%struct.ansiseq*, ...) bitcast (i32 (...)* @ansiseq_dump to i32 (%struct.ansiseq*, ...)*)(%struct.ansiseq* %4)
ret void
}

LLVM IR (-O2):
%struct.ansiseq = type opaque
@.str = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fstd/telnetcat/refs/heads/devel/src/vt100.c\00"
@__func__.termop_cleartab = [16 x i8] c"termop_cleartab\00"
@.str.1 = [10 x i8] c"unhandled\00"
define void @termop_cleartab(%struct.ansiseq* %0) {
%2 = tail call i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @tnc_log_log to i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...)*)(i32 6, i32 4, i32 -1, i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i32 396, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__func__.termop_cleartab, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (%struct.ansiseq*, ...) bitcast (i32 (...)* @ansiseq_dump to i32 (%struct.ansiseq*, ...)*)(%struct.ansiseq* %0)
ret void
}
/* Variables and functions */
unsigned char Read_MFRC522(unsigned char);
int /*<<< orphan*/ Write_MFRC522(unsigned char, unsigned char);
void ClearBitMask(unsigned char reg, unsigned char mask) {
  unsigned char tmp;
  tmp = Read_MFRC522(reg);
  Write_MFRC522(reg, tmp & (~mask));
}


x86 assembly (clang, -O0):
<ClearBitMask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <Read_MFRC522@plt>
mov    %al,-0x3(%rbp)
mov    -0x1(%rbp),%cl
movzbl -0x3(%rbp),%eax
movzbl -0x2(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%eax
movzbl %cl,%edi
movzbl %al,%esi
call   1040 <Write_MFRC522@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ClearBitMask>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <Read_MFRC522@plt>
not    %bl
and    %al,%bl
movzbl %bl,%esi
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <Write_MFRC522@plt>

LLVM IR (-O0):
define void @ClearBitMask(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%6 = load i8, i8* %3
%7 = call zeroext i8 @Read_MFRC522(i8 zeroext %6)
store i8 %7, i8* %5
%8 = load i8, i8* %3
%9 = load i8, i8* %5
%10 = zext i8 %9 to i32
%11 = load i8, i8* %4
%12 = zext i8 %11 to i32
%13 = xor i32 %12, -1
%14 = and i32 %10, %13
%15 = trunc i32 %14 to i8
%16 = call i32 @Write_MFRC522(i8 zeroext %8, i8 zeroext %15)
ret void
}

LLVM IR (-O2):
define void @ClearBitMask(i8 zeroext %0, i8 zeroext %1) {
%3 = tail call zeroext i8 @Read_MFRC522(i8 zeroext %0)
%4 = xor i8 %1, -1
%5 = and i8 %3, %4
%6 = tail call i32 @Write_MFRC522(i8 zeroext %0, i8 zeroext %5)
ret void
}
void test3() { int num = 5; }


x86 assembly (clang, -O0):
<test3>:
push   %rbp
mov    %rsp,%rbp
movl   $0x5,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test3() {
%1 = alloca i32
store i32 5, i32* %1
ret void
}

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

/* Variables and functions */
__attribute__((always_)) uint64_t getblock(const uint64_t *p, int i) {
  return p[i];
}


x86 assembly (clang, -O0):
<getblock>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getblock>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @getblock(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %5, i64 %7
%9 = load i32, i32* %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @getblock(i32* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = load i32, i32* %4
ret i32 %5
}
void curl_easy_strerror() {}


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

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

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

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


x86 assembly (clang, -O0):
<UpdateDateTimeCacheFirst>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <_UpdateDateTimeCache@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<UpdateDateTimeCacheFirst>:
xor    %edi,%edi
jmp    1030 <_UpdateDateTimeCache@plt>

LLVM IR (-O0):
define void @UpdateDateTimeCacheFirst() {
%1 = call i32 @_UpdateDateTimeCache(i32 0)
ret void
}

LLVM IR (-O2):
define void @UpdateDateTimeCacheFirst() {
%1 = tail call i32 @_UpdateDateTimeCache(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ panic(int);
void panic8() { panic(9); }


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

x86 assembly (clang, -O2):
<panic8>:
mov    $0x9,%edi
jmp    1030 <panic@plt>

LLVM IR (-O0):
define void @panic8() {
%1 = call i32 @panic(i32 9)
ret void
}

LLVM IR (-O2):
define void @panic8() {
%1 = tail call i32 @panic(i32 9)
ret void
}
double hour2deg(double x) { return (x * 15.0); }


x86 assembly (clang, -O0):
<hour2deg>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<hour2deg>:
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @hour2deg(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 1.500000e+01
ret double %4
}

LLVM IR (-O2):
define double @hour2deg(double %0) {
%2 = fmul double %0, 1.500000e+01
ret double %2
}
/* Variables and functions */
void stub1(int, long long);
void testClosureILLrV(void (*closure)(int, long long), int a1, long long a2) {
  if (closure != NULL)
    (*closure)(a1, a2);
}


x86 assembly (clang, -O0):
<testClosureILLrV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     112b <testClosureILLrV+0x2b>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureILLrV>:
test   %rdi,%rdi
je     110f <testClosureILLrV+0xf>
mov    %rdi,%rax
mov    %esi,%edi
mov    %rdx,%rsi
jmp    *%rax
ret

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

LLVM IR (-O2):
define void @testClosureILLrV(void (i32, i64)* %0, i32 %1, i64 %2) {
%4 = icmp eq void (i32, i64)* %0, null
br i1 %4, label %6, label %5
5: ; preds = %3
tail call void %0(i32 %1, i64 %2)
br label %6
6: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ testArray();
int /*<<< orphan*/ testStruct();
int main() {
  testStruct();
  testArray();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @testStruct()
%2 = tail call i32 (...) @testArray()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_usage() { printf("Usage: mkcollate [-d] [outputfile] inputfile\n"); }


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

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

LLVM IR (-O0):
@.str = [46 x i8] c"Usage: mkcollate [-d] [outputfile] inputfile\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [45 x i8] c"Usage: mkcollate [-d] [outputfile] inputfile\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
FILE *tmpfile(void) { return fopen("foo", ""); }


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

x86 assembly (clang, -O2):
<tmpfile>:
lea    0xee9(%rip),%rdi
lea    0xee5(%rip),%rsi
jmp    1030 <fopen@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"foo\00"
@.str.1 = [1 x i8] zeroinitializer
define i32* @tmpfile() {
%1 = call i32* @fopen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
ret i32* %1
}

LLVM IR (-O2):
@.str = [4 x i8] c"foo\00"
@.str.1 = [1 x i8] zeroinitializer
define noalias i32* @tmpfile() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
ret i32* %1
}
/* Variables and functions */
int /*<<< orphan*/ kputc(char);
void taska() {
  for (;;)
    kputc('A');
}


x86 assembly (clang, -O0):
<taska>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <taska+0x9>
mov    $0x41,%edi
call   1030 <kputc@plt>
jmp    1119 <taska+0x9>

x86 assembly (clang, -O2):
<taska>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x41,%edi
call   1030 <kputc@plt>
jmp    1120 <taska+0x10>

LLVM IR (-O0):
define void @taska() {
br label %1
1: ; preds = %1, %0
%2 = call i32 @kputc(i8 signext 65)
br label %1
}

LLVM IR (-O2):
define void @taska() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @kputc(i8 signext 65)
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void sig_handler(int signum) { printf("Received signal %d\n", signum); }


x86 assembly (clang, -O0):
<sig_handler>:
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):
<sig_handler>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [20 x i8] c"Received signal %d\0A\00"
define void @sig_handler(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}