xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ foo();
int /*<<< orphan*/ printf(char *);
int main() {
  printf("calling shared libary\n");
  foo();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"calling shared libary\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @foo()
ret i32 0
}

LLVM IR (-O2):
@str = [22 x i8] c"calling shared libary\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @foo()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ scaler_set_active_lines_override(int);
int FS460_set_scaled_channel_active_lines(int active_lines) {
  scaler_set_active_lines_override(active_lines);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @FS460_set_scaled_channel_active_lines(i32 %0) {
%2 = tail call i32 @scaler_set_active_lines_override(i32 %0)
ret i32 0
}
/* Type definitions */
struct ringbuffer {
  int dummy;
};
typedef int int32_t;

/* Variables and functions */
int calc_unused_space(struct ringbuffer *, int /*<<< orphan*/);
int32_t rb_available(struct ringbuffer *rb) {
  if (!rb) {
    return -1;
  }
  return calc_unused_space(rb, 0);
}


x86 assembly (clang, -O0):
<rb_available>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <rb_available+0x23>
movl   $0xffffffff,-0x4(%rbp)
jmp    1141 <rb_available+0x31>
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1030 <calc_unused_space@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rb_available>:
test   %rdi,%rdi
je     111c <rb_available+0xc>
xor    %esi,%esi
jmp    1030 <calc_unused_space@plt>
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.ringbuffer = type { i32 }
define i32 @rb_available(%struct.ringbuffer* %0) {
%2 = alloca i32
%3 = alloca %struct.ringbuffer*
store %struct.ringbuffer* %0, %struct.ringbuffer** %3
%4 = load %struct.ringbuffer*, %struct.ringbuffer** %3
%5 = icmp ne %struct.ringbuffer* %4, null
br i1 %5, label %7, label %6
6: ; preds = %1
store i32 -1, i32* %2
br label %10
7: ; preds = %1
%8 = load %struct.ringbuffer*, %struct.ringbuffer** %3
%9 = call i32 @calc_unused_space(%struct.ringbuffer* %8, i32 0)
store i32 %9, i32* %2
br label %10
10: ; preds = %7, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
%struct.ringbuffer = type { i32 }
define i32 @rb_available(%struct.ringbuffer* %0) {
%2 = icmp eq %struct.ringbuffer* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @calc_unused_space(%struct.ringbuffer* %0, i32 0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ -1, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("programowanie jest super!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%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
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"programowanie jest super!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [26 x i8] c"programowanie jest super!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
ret i32 0
}
float coeficiente(int x1, int y1, int x0, int y0) {
  return (y1 - y0) / (float)(x1 - x0);
}


x86 assembly (clang, -O0):
<coeficiente>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x10(%rbp),%eax
cvtsi2ss %eax,%xmm0
mov    -0x4(%rbp),%eax
sub    -0xc(%rbp),%eax
cvtsi2ss %eax,%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<coeficiente>:
sub    %ecx,%esi
cvtsi2ss %esi,%xmm0
sub    %edx,%edi
cvtsi2ss %edi,%xmm1
divss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @coeficiente(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %6
%10 = load i32, i32* %8
%11 = sub nsw i32 %9, %10
%12 = sitofp i32 %11 to float
%13 = load i32, i32* %5
%14 = load i32, i32* %7
%15 = sub nsw i32 %13, %14
%16 = sitofp i32 %15 to float
%17 = fdiv float %12, %16
ret float %17
}

LLVM IR (-O2):
define float @coeficiente(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = sub nsw i32 %1, %3
%6 = sitofp i32 %5 to float
%7 = sub nsw i32 %0, %2
%8 = sitofp i32 %7 to float
%9 = fdiv float %6, %8
ret float %9
}
void foo2(int *n) { *n = 333; }


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

x86 assembly (clang, -O2):
<foo2>:
movl   $0x14d,(%rdi)
ret

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

LLVM IR (-O2):
define void @foo2(i32* nocapture writeonly %0) {
store i32 333, i32* %0
ret void
}
/* Variables and functions */
int isendwin();
int wrap_isendwin(void) { return isendwin(); }


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

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

LLVM IR (-O0):
define i32 @wrap_isendwin() {
%1 = call i32 (...) @isendwin()
ret i32 %1
}

LLVM IR (-O2):
define i32 @wrap_isendwin() {
%1 = tail call i32 (...) @isendwin()
ret i32 %1
}
int check_args(int argc) {
  if (argc < 1 || argc > 1)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<check_args>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jl     111b <check_args+0x1b>
cmpl   $0x1,-0x8(%rbp)
jle    1127 <check_args+0x27>
movl   $0x0,-0x4(%rbp)
jmp    112e <check_args+0x2e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_args>:
xor    %eax,%eax
cmp    $0x1,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @check_args(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
scalar_t__ DBL_EPSILON;
scalar_t__ fabs(double const);
int __eq(const double a, const double b) { return fabs(a - b) <= DBL_EPSILON; }


x86 assembly (clang, -O0):
<__eq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
call   1030 <fabs@plt>
mov    0x2eb0(%rip),%rcx
cmp    (%rcx),%rax
setle  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__eq>:
push   %rax
subsd  %xmm1,%xmm0
call   1030 <fabs@plt>
mov    0x2ec7(%rip),%rdx
xor    %ecx,%ecx
cmp    (%rdx),%rax
setle  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@DBL_EPSILON = global i64 0
define i32 @__eq(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fsub double %5, %6
%8 = call i64 @fabs(double %7)
%9 = load i64, i64* @DBL_EPSILON
%10 = icmp sle i64 %8, %9
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
@DBL_EPSILON = global i64 0
define i32 @__eq(double %0, double %1) {
%3 = fsub double %0, %1
%4 = tail call i64 @fabs(double %3)
%5 = load i64, i64* @DBL_EPSILON
%6 = icmp sle i64 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
void reset(char *first, char *second) {
  strcpy(first, "undefined");
  strcpy(second, "undefined");
}


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

x86 assembly (clang, -O2):
<reset>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
lea    0xee2(%rip),%r14
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <strcpy@plt>

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

LLVM IR (-O2):
@.str = [10 x i8] c"undefined\00"
define void @reset(i8* %0, i8* %1) {
%3 = tail call i32 @strcpy(i8* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @strcpy(i8* %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ umount_original_rootfs(char *);
void umount_original_rootfs_on_exit(int exit_no, void *arg) {
  umount_original_rootfs((char *)arg);
}


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

x86 assembly (clang, -O2):
<umount_original_rootfs_on_exit>:
mov    %rsi,%rdi
jmp    1030 <umount_original_rootfs@plt>

LLVM IR (-O0):
define void @umount_original_rootfs_on_exit(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @umount_original_rootfs(i8* %5)
ret void
}

LLVM IR (-O2):
define void @umount_original_rootfs_on_exit(i32 %0, i8* %1) {
%3 = tail call i32 @umount_original_rootfs(i8* %1)
ret void
}
ISR(SPI_STC_vect) {
  DEBUG("ISR "
        "SPI_STC"
        " occured");
}


x86 assembly (clang, -O0):
<ISR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
lea    0xede(%rip),%rdi
mov    $0x0,%al
call   1030 <DEBUG@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ISR>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <DEBUG@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"ISR SPI_STC occured\00"
define i32 @ISR(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @DEBUG to i32 (i8*, ...)*)(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
@.str = [20 x i8] c"ISR SPI_STC occured\00"
define i32 @ISR(i32 %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @DEBUG to i32 (i8*, ...)*)(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
void rw_bad_stk_location() {
  int i;
  int *ptr = &i;
  ptr[-8] = 7;
  i = ptr[-15];
}


x86 assembly (clang, -O0):
<rw_bad_stk_location>:
push   %rbp
mov    %rsp,%rbp
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x7,-0x20(%rax)
mov    -0x10(%rbp),%rax
mov    -0x3c(%rax),%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @rw_bad_stk_location() {
%1 = alloca i32
%2 = alloca i32*
store i32* %1, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 -8
store i32 7, i32* %4
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 -15
%7 = load i32, i32* %6
store i32 %7, i32* %1
ret void
}

LLVM IR (-O2):
define void @rw_bad_stk_location() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ addOne(int *);
int main(int argc, char *argv[]) {
  int a = 1;
  addOne(&a);
  if (a != 2)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
lea    -0x14(%rbp),%rdi
call   1040 <addOne@plt>
cmpl   $0x2,-0x14(%rbp)
je     1157 <main+0x37>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x1,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1040 <addOne@plt>
cmpl   $0x2,0x4(%rsp)
jne    113e <main+0x1e>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %6
%7 = call i32 @addOne(i32* %6)
%8 = load i32, i32* %6
%9 = icmp ne i32 %8, 2
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 (...) @abort()
unreachable
12: ; preds = %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 1, i32* %3
%5 = call i32 @addOne(i32* %3)
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 2
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = call i32 (...) @abort()
unreachable
10: ; preds = %2
ret i32 0
}
int test_imm_D7int64_midword_reg(long long val) {
  return ((val >> 16) & (0xD7 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_D7int64_midword_reg>:
test   $0xd70000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_D7int64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 16
%5 = and i64 %4, 215
%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_D7int64_midword_reg(i64 %0) {
%2 = and i64 %0, 14090240
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0xd4() {
  Assert_real((isalnum(212) == 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_isalnum.c",
              1065, ("isalnum should be 0 for 0xd4"));
}


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

x86 assembly (clang, -O2):
<t_isalnum_0xd4>:
push   %rax
mov    $0xd4,%edi
call   1030 <isalnum@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x429,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0xd4\00"
define void @t_isalnum_0xd4() {
%1 = call i64 @isalnum(i32 212)
%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 1065, 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_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0xd4\00"
define void @t_isalnum_0xd4() {
%1 = tail call i64 @isalnum(i32 212)
%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 1065, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct Buffer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ buffer_append(struct Buffer *, char const *, int);
int strlen(char const *);
void buffer_append_string(struct Buffer *buffer, const char *data) {
  int len = strlen(data);
  buffer_append(buffer, data, len);
}


x86 assembly (clang, -O0):
<buffer_append_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <buffer_append@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.Buffer = type { i32 }
define void @buffer_append_string(%struct.Buffer* %0, i8* %1) {
%3 = alloca %struct.Buffer*
%4 = alloca i8*
%5 = alloca i32
store %struct.Buffer* %0, %struct.Buffer** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = call i32 @strlen(i8* %6)
store i32 %7, i32* %5
%8 = load %struct.Buffer*, %struct.Buffer** %3
%9 = load i8*, i8** %4
%10 = load i32, i32* %5
%11 = call i32 @buffer_append(%struct.Buffer* %8, i8* %9, i32 %10)
ret void
}

LLVM IR (-O2):
%struct.Buffer = type { i32 }
define void @buffer_append_string(%struct.Buffer* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @buffer_append(%struct.Buffer* %0, i8* %1, i32 %3)
ret void
}
/* Type definitions */
typedef int val;
typedef int uint8_t;
typedef int uint32_t;

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


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

x86 assembly (clang, -O2):
<ui24_to_bytes>:
mov    %esi,%eax
movzbl %ah,%ecx
movzbl %al,%edx
shr    $0x10,%eax
movzbl %al,%eax
mov    %eax,(%rdi)
mov    %ecx,0x4(%rdi)
mov    %edx,0x8(%rdi)
lea    0xc(%rdi),%rax
ret

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

LLVM IR (-O2):
define i32* @ui24_to_bytes(i32* writeonly %0, i32 %1) {
%3 = lshr i32 %1, 16
%4 = and i32 %3, 255
store i32 %4, i32* %0
%5 = lshr i32 %1, 8
%6 = and i32 %5, 255
%7 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %6, i32* %7
%8 = and i32 %1, 255
%9 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %8, i32* %9
%10 = getelementptr inbounds i32, i32* %0, i64 3
ret i32* %10
}
void g_object_set_property() {}


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

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

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

LLVM IR (-O2):
define void @g_object_set_property() {
ret void
}
/* Variables and functions */
double gsl_sf_lngamma(double);
double lngamma(double x) { return gsl_sf_lngamma(x); }


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

x86 assembly (clang, -O2):
<lngamma>:
jmp    1030 <gsl_sf_lngamma@plt>

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

LLVM IR (-O2):
define double @lngamma(double %0) {
%2 = tail call double @gsl_sf_lngamma(double %0)
ret double %2
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int S_ISDIR(int /*<<< orphan*/);
int stat(char const *, struct stat *);
int is_directory(const char *filename) {
  struct stat buffer;
  int status;
  status = stat(filename, &buffer);
  if (status == 0) {
    return S_ISDIR(buffer.st_mode);
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<is_directory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <stat@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    1156 <is_directory+0x36>
mov    -0x18(%rbp),%edi
call   1030 <S_ISDIR@plt>
mov    %eax,-0x4(%rbp)
jmp    115d <is_directory+0x3d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_directory>:
push   %rax
mov    %rsp,%rsi
call   1040 <stat@plt>
test   %eax,%eax
je     1131 <is_directory+0x11>
xor    %eax,%eax
pop    %rcx
ret
mov    (%rsp),%edi
pop    %rax
jmp    1030 <S_ISDIR@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @is_directory(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
%5 = alloca i32
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @stat(i8* %6, %struct.stat* %4)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %1
%11 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%12 = load i32, i32* %11
%13 = call i32 @S_ISDIR(i32 %12)
store i32 %13, i32* %2
br label %15
14: ; preds = %1
store i32 0, i32* %2
br label %15
15: ; preds = %14, %10
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @is_directory(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = tail call i32 @S_ISDIR(i32 %8)
br label %10
10: ; preds = %1, %6
%11 = phi i32 [ %9, %6 ], [ 0, %1 ]
ret i32 %11
}
void I422ToABGR() {}


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

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

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

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

/* Variables and functions */
void _close_file(FILE *fp) {}


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

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

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

LLVM IR (-O2):
define void @_close_file(i32* nocapture %0) {
ret void
}
int strlen16(unsigned short *s) {
  int len = 0;
  while (*s) {
    s++;
    len++;
  }
  return len;
}


x86 assembly (clang, -O0):
<strlen16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpw   $0x0,(%rax)
je     1137 <strlen16+0x37>
mov    -0x8(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlen16+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen16>:
cmpw   $0x0,(%rdi)
je     111d <strlen16+0x1d>
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
cmpw   $0x0,0x2(%rdi,%rax,2)
lea    0x1(%rax),%rax
jne    1110 <strlen16+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strlen16(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = icmp eq i16 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i16* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i16, i16* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i16, i16* %7
%10 = icmp eq i16 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
int HelpItem107(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @HelpItem107() {
ret i32 0
}
long long foolong(long long x, short *a, short *b) { return x + *a * *b; }


x86 assembly (clang, -O0):
<foolong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movswl (%rcx),%ecx
mov    -0x18(%rbp),%rdx
movswl (%rdx),%edx
imul   %edx,%ecx
movslq %ecx,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foolong>:
movswq (%rsi),%rcx
movswq (%rdx),%rax
imul   %rcx,%rax
add    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @foolong(i64 %0, i16* %1, i16* %2) {
%4 = alloca i64
%5 = alloca i16*
%6 = alloca i16*
store i64 %0, i64* %4
store i16* %1, i16** %5
store i16* %2, i16** %6
%7 = load i64, i64* %4
%8 = load i16*, i16** %5
%9 = load i16, i16* %8
%10 = sext i16 %9 to i32
%11 = load i16*, i16** %6
%12 = load i16, i16* %11
%13 = sext i16 %12 to i32
%14 = mul nsw i32 %10, %13
%15 = sext i32 %14 to i64
%16 = add nsw i64 %7, %15
ret i64 %16
}

LLVM IR (-O2):
define i64 @foolong(i64 %0, i16* nocapture %1, i16* nocapture %2) {
%4 = load i16, i16* %1
%5 = sext i16 %4 to i64
%6 = load i16, i16* %2
%7 = sext i16 %6 to i64
%8 = mul nsw i64 %7, %5
%9 = add nsw i64 %8, %0
ret i64 %9
}
void dmtimer_start(int num) {}


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

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

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

LLVM IR (-O2):
define void @dmtimer_start(i32 %0) {
ret void
}
/* Variables and functions */
float pow(float, double);
float toLinear(float color) {
  return color <= 0.04045 ? (color / 12.92) : pow((color + 0.055) / 1.055, 2.4);
}


x86 assembly (clang, -O0):
<toLinear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xed2(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     1157 <toLinear+0x47>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xed7(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1192 <toLinear+0x82>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeb0(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xe9c(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movsd  0xe84(%rip),%xmm1
call   1030 <pow@plt>
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toLinear>:
push   %rax
cvtss2sd %xmm0,%xmm0
movsd  0xee3(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    114a <toLinear+0x3a>
addsd  0xee5(%rip),%xmm0
divsd  0xee5(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movsd  0xee1(%rip),%xmm1
call   1030 <pow@plt>
cvtss2sd %xmm0,%xmm0
jmp    1152 <toLinear+0x42>
divsd  0xeb6(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @toLinear(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fcmp ole double %4, 4.045000e-02
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load float, float* %2
%8 = fpext float %7 to double
%9 = fdiv double %8, 1.292000e+01
br label %18
10: ; preds = %1
%11 = load float, float* %2
%12 = fpext float %11 to double
%13 = fadd double %12, 5.500000e-02
%14 = fdiv double %13, 1.055000e+00
%15 = fptrunc double %14 to float
%16 = call float @pow(float %15, double 2.400000e+00)
%17 = fpext float %16 to double
br label %18
18: ; preds = %10, %6
%19 = phi double [ %9, %6 ], [ %17, %10 ]
%20 = fptrunc double %19 to float
ret float %20
}

LLVM IR (-O2):
define float @toLinear(float %0) {
%2 = fpext float %0 to double
%3 = fcmp ugt double %2, 4.045000e-02
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = fdiv double %2, 1.292000e+01
br label %12
6: ; preds = %1
%7 = fadd double %2, 5.500000e-02
%8 = fdiv double %7, 1.055000e+00
%9 = fptrunc double %8 to float
%10 = tail call float @pow(float %9, double 2.400000e+00)
%11 = fpext float %10 to double
br label %12
12: ; preds = %6, %4
%13 = phi double [ %5, %4 ], [ %11, %6 ]
%14 = fptrunc double %13 to float
ret float %14
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
void show_invite() {
  printf("> ");
  fflush(stdout);
}


x86 assembly (clang, -O0):
<show_invite>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_invite>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"> \00"
@stdout = global i32 0
define void @show_invite() {
%1 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = call i32 @fflush(i32 %2)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"> \00"
@stdout = global i32 0
define void @show_invite() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = tail call i32 @fflush(i32 %2)
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;
typedef int uint16_t;
typedef int int32_t;

/* Variables and functions */
uint32_t beq(uint32_t reg1, uint32_t reg2, uint16_t kte, uint32_t *pc) {
  int32_t ktebuffer;
  if (reg1 == reg2) {
    ktebuffer = kte << 2;
    *pc = *pc + ktebuffer;
    return *pc;
  } else {
    return *pc;
  }
}


x86 assembly (clang, -O0):
<beq>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    114f <beq+0x4f>
mov    -0x1c(%rbp),%eax
shl    $0x2,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%rcx
movslq -0x2c(%rbp),%rax
add    %rax,%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x28(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    115a <beq+0x5a>
mov    -0x28(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<beq>:
cmp    %rsi,%rdi
jne    1112 <beq+0x12>
shl    $0x2,%edx
movslq %edx,%rax
add    (%rcx),%rax
mov    %rax,(%rcx)
ret
mov    (%rcx),%rax
ret

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

LLVM IR (-O2):
define i64 @beq(i64 %0, i64 %1, i32 %2, i64* nocapture %3) {
%5 = icmp eq i64 %0, %1
br i1 %5, label %6, label %11
6: ; preds = %4
%7 = shl i32 %2, 2
%8 = load i64, i64* %3
%9 = sext i32 %7 to i64
%10 = add nsw i64 %8, %9
store i64 %10, i64* %3
br label %13
11: ; preds = %4
%12 = load i64, i64* %3
br label %13
13: ; preds = %11, %6
%14 = phi i64 [ %10, %6 ], [ %12, %11 ]
ret i64 %14
}
/* Variables and functions */
double drand48();
int /*<<< orphan*/ init_rand();
double random_number(void) {
  init_rand();
  return drand48();
}


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

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

LLVM IR (-O0):
define double @random_number() {
%1 = call i32 (...) @init_rand()
%2 = call double (...) @drand48()
ret double %2
}

LLVM IR (-O2):
define double @random_number() {
%1 = tail call i32 (...) @init_rand()
%2 = tail call double (...) @drand48()
ret double %2
}
/* Variables and functions */
scalar_t__ TestReader();
scalar_t__ TestWriter();
int main() {
  if (TestWriter() != 0) {
    return -1;
  }
  if (TestReader() != 0) {
    return -2;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <TestWriter@plt>
cmp    $0x0,%rax
je     114c <main+0x2c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1170 <main+0x50>
mov    $0x0,%al
call   1040 <TestReader@plt>
cmp    $0x0,%rax
je     1169 <main+0x49>
movl   $0xfffffffe,-0x4(%rbp)
jmp    1170 <main+0x50>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <TestWriter@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
je     1137 <main+0x17>
pop    %rcx
ret
xor    %eax,%eax
call   1040 <TestReader@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
lea    (%rcx,%rcx,1),%eax
add    $0xfffffffe,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @TestWriter()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i64 (...) @TestReader()
%5 = icmp eq i64 %4, 0
%6 = select i1 %5, i32 0, i32 -2
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ -1, %0 ], [ %6, %3 ]
ret i32 %8
}
int emacs_spell_abort_func(const struct cmd_info *ci) { return 1; }


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

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

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

LLVM IR (-O2):
%struct.cmd_info = type opaque
define i32 @emacs_spell_abort_func(%struct.cmd_info* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void FINDUNDERSCORES(void) {
  printf("#ifndef F77_CRAY_UNDERSCORE\n");
  printf("#define F77_CRAY_UNDERSCORE\n");
  printf("#endif\n");
}


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

x86 assembly (clang, -O2):
<FINDUNDERSCORES>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf08(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"#ifndef F77_CRAY_UNDERSCORE\0A\00"
@.str.1 = [29 x i8] c"#define F77_CRAY_UNDERSCORE\0A\00"
@.str.2 = [8 x i8] c"#endif\0A\00"
define void @FINDUNDERSCORES() {
%1 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [28 x i8] c"#ifndef F77_CRAY_UNDERSCORE\00"
@str.3 = [28 x i8] c"#define F77_CRAY_UNDERSCORE\00"
@str.4 = [7 x i8] c"#endif\00"
define void @FINDUNDERSCORES() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void HoloStor_QuickFree(void *p) { free(p); }


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

x86 assembly (clang, -O2):
<HoloStor_QuickFree>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @HoloStor_QuickFree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void scheduler_enter_sleep_mode(void) {}


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

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

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

LLVM IR (-O2):
define void @scheduler_enter_sleep_mode() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int main(void) {
  char x[10] = "whoami";
  int i;
  for (i = 0; i < 6; i++) {
    printf("%c\n", x[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0xe(%rbp)
mov    0xed7(%rip),%ax
mov    %ax,-0x6(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x6,-0x14(%rbp)
jge    1169 <main+0x59>
movslq -0x14(%rbp),%rax
lea    0xeb9(%rip),%rdi
movsbl -0xe(%rbp,%rax,1),%esi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113c <main+0x2c>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x77,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x68,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x6f,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x61,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x6d,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x69,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext 119)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext 104)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext 111)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext 97)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext 109)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext 105)
ret i32 0
}
int trans_0_y(int x, int y) { return y; }


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

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

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

LLVM IR (-O2):
define i32 @trans_0_y(i32 %0, i32 returned %1) {
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ __NR_sendto;
size_t syscall(int /*<<< orphan*/, int, void const *, size_t, int,
               int /*<<< orphan*/, int /*<<< orphan*/);
__attribute__((always_)) size_t _syscall_send(int socket, const void *buffer,
                                              size_t length, int flags) {
  return syscall(__NR_sendto, socket, buffer, length, flags, 0, 0);
}


x86 assembly (clang, -O0):
<_syscall_send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
xor    %r9d,%r9d
movl   $0x0,(%rsp)
call   1030 <syscall@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_syscall_send>:
push   %rax
mov    %ecx,%r8d
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
movl   $0x0,(%rsp)
xor    %r9d,%r9d
call   1030 <syscall@plt>
pop    %rcx
ret

LLVM IR (-O0):
@__NR_sendto = global i32 0
define i64 @_syscall_send(i32 %0, i8* %1, i64 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i32 %3, i32* %8
%9 = load i32, i32* @__NR_sendto
%10 = load i32, i32* %5
%11 = load i8*, i8** %6
%12 = load i64, i64* %7
%13 = load i32, i32* %8
%14 = call i64 @syscall(i32 %9, i32 %10, i8* %11, i64 %12, i32 %13, i32 0, i32 0)
ret i64 %14
}

LLVM IR (-O2):
@__NR_sendto = global i32 0
define i64 @_syscall_send(i32 %0, i8* %1, i64 %2, i32 %3) {
%5 = load i32, i32* @__NR_sendto
%6 = tail call i64 @syscall(i32 %5, i32 %0, i8* %1, i64 %2, i32 %3, i32 0, i32 0)
ret i64 %6
}
__typeof__(isgraph(1)) test_isgraph_31(void) { return isgraph(1); }


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

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

LLVM IR (-O0):
define i32 @test_isgraph_31() {
%1 = call i32 @isgraph(i32 1)
ret i32 %1
}

LLVM IR (-O2):
define i32 @test_isgraph_31() {
%1 = tail call i32 @isgraph(i32 1)
ret i32 %1
}