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

/* Variables and functions */
int /*<<< orphan*/ getmaxyx(int /*<<< orphan*/ *, int, int);
int /*<<< orphan*/ mvwprintw(int /*<<< orphan*/ *, int /*<<< orphan*/, int,
                             char *, char const *);
int strlen(char const *);
void nwipe_gui_title(WINDOW *w, const char *s) {
  int wy;
  (void)wy;
  int wx;
  getmaxyx(w, wy, wx);
  int margin = (wx - strlen(s));
  if (margin < 0) {
    margin = 0;
  }
  mvwprintw(w, 0, margin / 2, "%s", s);
}


x86 assembly (clang, -O0):
<nwipe_gui_title>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1040 <getmaxyx@plt>
mov    -0x18(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    1179 <nwipe_gui_title+0x49>
movl   $0x0,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x1c(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
mov    -0x10(%rbp),%r8
xor    %esi,%esi
lea    0xe69(%rip),%rcx
call   1050 <mvwprintw@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nwipe_gui_title>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <getmaxyx@plt>
mov    %r14,%rdi
call   1030 <strlen@plt>
lea    0xeb2(%rip),%rcx
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
mov    %r14,%r8
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <mvwprintw@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @nwipe_gui_title(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %3
store i8* %1, i8** %4
%8 = load i32, i32* %5
%9 = load i32*, i32** %3
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = call i32 @getmaxyx(i32* %9, i32 %10, i32 %11)
%13 = load i32, i32* %6
%14 = load i8*, i8** %4
%15 = call i32 @strlen(i8* %14)
%16 = sub nsw i32 %13, %15
store i32 %16, i32* %7
%17 = load i32, i32* %7
%18 = icmp slt i32 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %2
store i32 0, i32* %7
br label %20
20: ; preds = %19, %2
%21 = load i32*, i32** %3
%22 = load i32, i32* %7
%23 = sdiv i32 %22, 2
%24 = load i8*, i8** %4
%25 = call i32 @mvwprintw(i32* %21, i32 0, i32 %23, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %24)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @nwipe_gui_title(i32* %0, i8* %1) {
%3 = tail call i32 @getmaxyx(i32* %0, i32 undef, i32 undef)
%4 = tail call i32 @strlen(i8* %1)
%5 = tail call i32 @mvwprintw(i32* %0, i32 0, i32 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ a();
int /*<<< orphan*/ x();
int /*<<< orphan*/ y();
int /*<<< orphan*/ z();
int main() {
  a();
  x();
  y();
  z();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <a@plt>
xor    %eax,%eax
call   1040 <x@plt>
xor    %eax,%eax
call   1060 <y@plt>
xor    %eax,%eax
call   1030 <z@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @a()
%3 = call i32 (...) @x()
%4 = call i32 (...) @y()
%5 = call i32 (...) @z()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @a()
%2 = tail call i32 (...) @x()
%3 = tail call i32 (...) @y()
%4 = tail call i32 (...) @z()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ write(int /*<<< orphan*/, char *, int);
void fini_0(void) { write(STDOUT_FILENO, "fini array 0\n", 13); }


x86 assembly (clang, -O0):
<fini_0>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
mov    $0xd,%edx
call   1030 <write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fini_0>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
mov    $0xd,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@STDOUT_FILENO = global i32 0
@.str = [14 x i8] c"fini array 0\0A\00"
define void @fini_0() {
%1 = load i32, i32* @STDOUT_FILENO
%2 = call i32 @write(i32 %1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 13)
ret void
}

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
@.str = [14 x i8] c"fini array 0\0A\00"
define void @fini_0() {
%1 = load i32, i32* @STDOUT_FILENO
%2 = tail call i32 @write(i32 %1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 13)
ret void
}
void ha7net_lib_done(void) {}


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

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

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

LLVM IR (-O2):
define void @ha7net_lib_done() {
ret void
}
int test_67_4(int *mem) { return __atomic_xor_fetch(mem + 0, -1, 4); }


x86 assembly (clang, -O0):
<test_67_4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0xffffffff,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    %ecx,-0x18(%rbp)
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%esi
mov    %eax,%edx
xor    %esi,%edx
lock cmpxchg %edx,(%rcx)
sete   %cl
mov    %eax,-0x24(%rbp)
test   $0x1,%cl
mov    %eax,-0x14(%rbp)
jne    114b <test_67_4+0x4b>
jmp    1122 <test_67_4+0x22>
mov    -0x18(%rbp),%ecx
mov    -0x24(%rbp),%eax
xor    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_67_4>:
mov    (%rdi),%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %eax,%ecx
not    %ecx
lock cmpxchg %ecx,(%rdi)
jne    1110 <test_67_4+0x10>
not    %eax
ret

LLVM IR (-O0):
define i32 @test_67_4(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 0
store i32 -1, i32* %3
%7 = load i32, i32* %3
%8 = atomicrmw xor i32* %6, i32 %7 acq_rel
%9 = xor i32 %8, %7
store i32 %9, i32* %4
%10 = load i32, i32* %4
ret i32 %10
}

LLVM IR (-O2):
define i32 @test_67_4(i32* nocapture %0) {
%2 = atomicrmw xor i32* %0, i32 -1 acq_rel
%3 = xor i32 %2, -1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printIndent(int indent) {
  int i = 0;
  while (i < indent) {
    printf("    ");
    i += 1;
  }
  return;
}


x86 assembly (clang, -O0):
<printIndent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1148 <printIndent+0x38>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <printIndent+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printIndent>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
jle    113d <printIndent+0x2d>
mov    %edi,%ebx
lea    0xedf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0xffffffff,%ebx
jne    1130 <printIndent+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c" \00"
define void @printIndent(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ emit_addimm_and_set_flags(int, int);
int /*<<< orphan*/ emit_andimm(int, int, int);
int /*<<< orphan*/ emit_orreq_imm(int, int, int);
void emit_dt(int t, int sr) {
  emit_andimm(sr, ~1, sr);
  emit_addimm_and_set_flags(-1, t);
  emit_orreq_imm(sr, 1, sr);
}


x86 assembly (clang, -O0):
<emit_dt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    $0xfffffffe,%esi
call   1050 <emit_andimm@plt>
mov    -0x4(%rbp),%esi
mov    $0xffffffff,%edi
call   1030 <emit_addimm_and_set_flags@plt>
mov    -0x8(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    $0x1,%esi
call   1040 <emit_orreq_imm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_dt>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %esi,%edi
mov    $0xfffffffe,%esi
mov    %ebx,%edx
call   1050 <emit_andimm@plt>
mov    $0xffffffff,%edi
mov    %ebp,%esi
call   1030 <emit_addimm_and_set_flags@plt>
mov    %ebx,%edi
mov    $0x1,%esi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <emit_orreq_imm@plt>

LLVM IR (-O0):
define void @emit_dt(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 = load i32, i32* %4
%7 = call i32 @emit_andimm(i32 %5, i32 -2, i32 %6)
%8 = load i32, i32* %3
%9 = call i32 @emit_addimm_and_set_flags(i32 -1, i32 %8)
%10 = load i32, i32* %4
%11 = load i32, i32* %4
%12 = call i32 @emit_orreq_imm(i32 %10, i32 1, i32 %11)
ret void
}

LLVM IR (-O2):
define void @emit_dt(i32 %0, i32 %1) {
%3 = tail call i32 @emit_andimm(i32 %1, i32 -2, i32 %1)
%4 = tail call i32 @emit_addimm_and_set_flags(i32 -1, i32 %0)
%5 = tail call i32 @emit_orreq_imm(i32 %1, i32 1, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void foo(int i) { printf("foo %d\n", i); }


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

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

LLVM IR (-O2):
@.str = [8 x i8] c"foo %d\0A\00"
define void @foo(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
int yyl(void) {
  static int prev = 0;
  return ++prev;
}


x86 assembly (clang, -O0):
<yyl>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f1a(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f11(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<yyl>:
mov    0x2f1e(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f15(%rip)
ret

LLVM IR (-O0):
@yyl.prev = internal global i32 0
define i32 @yyl() {
%1 = load i32, i32* @yyl.prev
%2 = add nsw i32 %1, 1
store i32 %2, i32* @yyl.prev
ret i32 %2
}

LLVM IR (-O2):
@yyl.prev = internal unnamed_addr global i32 0
define i32 @yyl() {
%1 = load i32, i32* @yyl.prev
%2 = add nsw i32 %1, 1
store i32 %2, i32* @yyl.prev
ret i32 %2
}
void stopAppendOnly(void) {
  _serverPanic("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/"
               "heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c",
               129, "Function '%s' is disabled.", __func__);
}


x86 assembly (clang, -O0):
<stopAppendOnly>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x81,%esi
lea    0xf79(%rip),%rdx
lea    0xf8d(%rip),%rcx
mov    $0x0,%al
call   1030 <_serverPanic@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<stopAppendOnly>:
lea    0xee9(%rip),%rdi
lea    0xf82(%rip),%rdx
lea    0xf96(%rip),%rcx
mov    $0x81,%esi
xor    %eax,%eax
jmp    1030 <_serverPanic@plt>

LLVM IR (-O0):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.stopAppendOnly = [15 x i8] c"stopAppendOnly\00"
define void @stopAppendOnly() {
%1 = call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 129, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.stopAppendOnly, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.stopAppendOnly = [15 x i8] c"stopAppendOnly\00"
define void @stopAppendOnly() {
%1 = tail call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 129, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.stopAppendOnly, i64 0, i64 0))
ret void
}
/* Variables and functions */
void *fa_libcmem_create(char *name, size_t size) {
  return (void *)(intptr_t)size;
}


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

x86 assembly (clang, -O2):
<fa_libcmem_create>:
mov    %rsi,%rax
ret

LLVM IR (-O0):
define i8* @fa_libcmem_create(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}

LLVM IR (-O2):
define i8* @fa_libcmem_create(i8* nocapture readnone %0, i64 %1) {
%3 = inttoptr i64 %1 to i8*
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ foo(char *, int);
int test2(void) {
  foo("%d", 20);
  return 3;
}


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x14,%esi
call   1030 <foo@plt>
mov    $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test2>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x14,%esi
call   1030 <foo@plt>
mov    $0x3,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @test2() {
%1 = tail call i32 @foo(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 20)
ret i32 3
}
/* Variables and functions */
int isblank(int c) { return (c == ' ') || (c == '\t'); }


x86 assembly (clang, -O0):
<isblank>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1120 <isblank+0x20>
cmpl   $0x9,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isblank>:
cmp    $0x20,%edi
sete   %al
cmp    $0x9,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isblank(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 32
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 9
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @isblank(i32 %0) {
%2 = icmp eq i32 %0, 32
%3 = icmp eq i32 %0, 9
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ int8_t;
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ *malloc(int /*<<< orphan*/);
int8_t *heap_alloc_l_Pz(int64_t size) { return malloc(size); }


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

x86 assembly (clang, -O2):
<heap_alloc_l_Pz>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i32* @heap_alloc_l_Pz(i32 %0) {
%2 = tail call i32* @malloc(i32 %0)
ret i32* %2
}
/* Variables and functions */
int UINT_MAX;
unsigned int ratio(unsigned int x, unsigned int y) {
  if (x <= UINT_MAX / 100) {
    x *= 100;
  } else {
    y /= 100;
  }
  if (y == 0) {
    y = 1;
  }
  return x / y;
}


x86 assembly (clang, -O0):
<ratio>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
cmp    %ecx,%eax
ja     113a <ratio+0x3a>
imul   $0x64,-0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1149 <ratio+0x49>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    115a <ratio+0x5a>
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    %edx,%edx
divl   -0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ratio>:
mov    %edi,%eax
mov    0x2edf(%rip),%rcx
movslq (%rcx),%rcx
imul   $0x51eb851f,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
cmp    %edi,%ecx
jae    1133 <ratio+0x33>
mov    %esi,%ecx
imul   $0x51eb851f,%rcx,%rsi
shr    $0x25,%rsi
jmp    1136 <ratio+0x36>
imul   $0x64,%eax,%eax
test   %esi,%esi
mov    $0x1,%ecx
cmovne %esi,%ecx
xor    %edx,%edx
div    %ecx
ret

LLVM IR (-O0):
@UINT_MAX = global i32 0
define i32 @ratio(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* @UINT_MAX
%7 = sdiv i32 %6, 100
%8 = icmp ule i32 %5, %7
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i32, i32* %3
%11 = mul i32 %10, 100
store i32 %11, i32* %3
br label %15
12: ; preds = %2
%13 = load i32, i32* %4
%14 = udiv i32 %13, 100
store i32 %14, i32* %4
br label %15
15: ; preds = %12, %9
%16 = load i32, i32* %4
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %15
store i32 1, i32* %4
br label %19
19: ; preds = %18, %15
%20 = load i32, i32* %3
%21 = load i32, i32* %4
%22 = udiv i32 %20, %21
ret i32 %22
}

LLVM IR (-O2):
@UINT_MAX = global i32 0
define i32 @ratio(i32 %0, i32 %1) {
%3 = load i32, i32* @UINT_MAX
%4 = sdiv i32 %3, 100
%5 = icmp ult i32 %4, %0
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = mul i32 %0, 100
br label %10
8: ; preds = %2
%9 = udiv i32 %1, 100
br label %10
10: ; preds = %8, %6
%11 = phi i32 [ %7, %6 ], [ %0, %8 ]
%12 = phi i32 [ %1, %6 ], [ %9, %8 ]
%13 = icmp eq i32 %12, 0
%14 = select i1 %13, i32 1, i32 %12
%15 = udiv i32 %11, %14
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ gettimeofday_op(int, int);
void show_average(int i) { gettimeofday_op(4, i); }


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

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

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

LLVM IR (-O2):
define void @show_average(i32 %0) {
%2 = tail call i32 @gettimeofday_op(i32 4, i32 %0)
ret void
}
/* Variables and functions */
int uart_messages_waiting(int /*<<< orphan*/);
int uart_stdio_msgwaiting(void) { return uart_messages_waiting(0); }


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

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

LLVM IR (-O0):
define i32 @uart_stdio_msgwaiting() {
%1 = call i32 @uart_messages_waiting(i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @uart_stdio_msgwaiting() {
%1 = tail call i32 @uart_messages_waiting(i32 0)
ret i32 %1
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMR5D_set(void) { return U_WMRCORENONE_set("U_WMR5D"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMR5D\00"
define i8* @U_WMR5D_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR5D\00"
define i8* @U_WMR5D_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
double log10(double x) { return 4; }


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

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

LLVM IR (-O0):
define double @log10(double %0) {
%2 = alloca double
store double %0, double* %2
ret double 4.000000e+00
}

LLVM IR (-O2):
define double @log10(double %0) {
ret double 4.000000e+00
}
/* Variables and functions */
int cowsay_get_length(int, char **);
int /*<<< orphan*/ cowsay_print_multiline(int, char **);
int /*<<< orphan*/ cowsay_print_singleline(int, char **, int);
void cowsay_print_bubble(int argc, char **argv) {
  int length = cowsay_get_length(argc, argv);
  if (length < 40)
    cowsay_print_singleline(argc, argv, length);
  else
    cowsay_print_multiline(argc, argv);
}


x86 assembly (clang, -O0):
<cowsay_print_bubble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <cowsay_get_length@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x28,-0x14(%rbp)
jge    116c <cowsay_print_bubble+0x3c>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <cowsay_print_singleline@plt>
jmp    1178 <cowsay_print_bubble+0x48>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <cowsay_print_multiline@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cowsay_print_bubble>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
call   1050 <cowsay_get_length@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
cmp    $0x27,%eax
jg     1154 <cowsay_print_bubble+0x24>
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <cowsay_print_singleline@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <cowsay_print_multiline@plt>

LLVM IR (-O0):
define void @cowsay_print_bubble(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = load i32, i32* %3
%7 = load i8**, i8*** %4
%8 = call i32 @cowsay_get_length(i32 %6, i8** %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp slt i32 %9, 40
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i32, i32* %3
%13 = load i8**, i8*** %4
%14 = load i32, i32* %5
%15 = call i32 @cowsay_print_singleline(i32 %12, i8** %13, i32 %14)
br label %20
16: ; preds = %2
%17 = load i32, i32* %3
%18 = load i8**, i8*** %4
%19 = call i32 @cowsay_print_multiline(i32 %17, i8** %18)
br label %20
20: ; preds = %16, %11
ret void
}

LLVM IR (-O2):
define void @cowsay_print_bubble(i32 %0, i8** %1) {
%3 = tail call i32 @cowsay_get_length(i32 %0, i8** %1)
%4 = icmp slt i32 %3, 40
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @cowsay_print_singleline(i32 %0, i8** %1, i32 %3)
br label %9
7: ; preds = %2
%8 = tail call i32 @cowsay_print_multiline(i32 %0, i8** %1)
br label %9
9: ; preds = %7, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ my_memory_free(void *);
double my_parse_double(char *);
char *my_subStringC_firstEnd(char const *, char);
double my_parse_double_csubFirstEnd(const char *string,
                                    char charDesdeNoIncluido) {
  char *st = my_subStringC_firstEnd(string, charDesdeNoIncluido);
  double val = my_parse_double(st);
  (my_memory_free((void *)(st)));
  return val;
}


x86 assembly (clang, -O0):
<my_parse_double_csubFirstEnd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
movsbl -0x9(%rbp),%esi
call   1050 <my_subStringC_firstEnd@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <my_parse_double@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <my_memory_free@plt>
movsd  -0x20(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_parse_double_csubFirstEnd>:
push   %rbx
sub    $0x10,%rsp
call   1050 <my_subStringC_firstEnd@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <my_parse_double@plt>
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
call   1030 <my_memory_free@plt>
movsd  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @my_parse_double_csubFirstEnd(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i8*
%6 = alloca double
store i8* %0, i8** %3
store i8 %1, i8* %4
%7 = load i8*, i8** %3
%8 = load i8, i8* %4
%9 = call i8* @my_subStringC_firstEnd(i8* %7, i8 signext %8)
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = call double @my_parse_double(i8* %10)
store double %11, double* %6
%12 = load i8*, i8** %5
%13 = call i32 @my_memory_free(i8* %12)
%14 = load double, double* %6
ret double %14
}

LLVM IR (-O2):
define double @my_parse_double_csubFirstEnd(i8* %0, i8 signext %1) {
%3 = tail call i8* @my_subStringC_firstEnd(i8* %0, i8 signext %1)
%4 = tail call double @my_parse_double(i8* %3)
%5 = tail call i32 @my_memory_free(i8* %3)
ret double %4
}
int gy(int a, int b) {
  if (b == 0)
    return a;
  if (a > b)
    gy(b, a % b);
  else
    gy(a, b % a);
}


x86 assembly (clang, -O0):
<gy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1133 <gy+0x23>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1166 <gy+0x56>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1155 <gy+0x45>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%esi
call   1030 <gy@plt>
jmp    1166 <gy+0x56>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,%esi
call   1030 <gy@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gy>:
test   %esi,%esi
je     1148 <gy+0x48>
mov    %esi,%edx
xor    %r8d,%r8d
mov    %edx,%esi
nopl   0x0(%rax,%rax,1)
cmp    %esi,%edi
jg     1130 <gy+0x30>
mov    %esi,%eax
cltd
idiv   %edi
test   $0x1,%r8b
cmove  %edi,%ecx
mov    $0x1,%r8b
mov    %edx,%esi
test   %edx,%edx
jne    1110 <gy+0x10>
jmp    1145 <gy+0x45>
nopl   0x0(%rax,%rax,1)
mov    %edi,%eax
cltd
idiv   %esi
test   $0x1,%r8b
cmove  %edi,%ecx
mov    $0x1,%r8b
mov    %esi,%edi
test   %edx,%edx
jne    1109 <gy+0x9>
mov    %ecx,%eax
ret
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @gy(i32 returned %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %22, label %4
4: ; preds = %2, %14
%5 = phi i1 [ true, %14 ], [ false, %2 ]
%6 = phi i32 [ %16, %14 ], [ undef, %2 ]
%7 = phi i32 [ %15, %14 ], [ %1, %2 ]
%8 = phi i32 [ %12, %14 ], [ %0, %2 ]
br label %9
9: ; preds = %4, %18
%10 = phi i1 [ %5, %4 ], [ true, %18 ]
%11 = phi i32 [ %6, %4 ], [ %20, %18 ]
%12 = phi i32 [ %7, %4 ], [ %19, %18 ]
%13 = icmp sgt i32 %8, %12
br i1 %13, label %14, label %18
14: ; preds = %9
%15 = srem i32 %8, %12
%16 = select i1 %10, i32 %11, i32 %8
%17 = icmp eq i32 %15, 0
br i1 %17, label %22, label %4
18: ; preds = %9
%19 = srem i32 %12, %8
%20 = select i1 %10, i32 %11, i32 %8
%21 = icmp eq i32 %19, 0
br i1 %21, label %22, label %9
22: ; preds = %14, %18, %2
%23 = phi i32 [ %0, %2 ], [ %20, %18 ], [ %16, %14 ]
ret i32 %23
}
/* Variables and functions */
int /*<<< orphan*/ AT_FDCWD;
int unlinkat(int /*<<< orphan*/, char const *, int /*<<< orphan*/);
int unlink(const char *pathname) { return unlinkat(AT_FDCWD, pathname, 0); }


x86 assembly (clang, -O0):
<unlink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
xor    %edx,%edx
call   1030 <unlinkat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unlink>:
mov    %rdi,%rsi
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
xor    %edx,%edx
jmp    1030 <unlinkat@plt>

LLVM IR (-O0):
@AT_FDCWD = global i32 0
define i32 @unlink(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @AT_FDCWD
%4 = load i8*, i8** %2
%5 = call i32 @unlinkat(i32 %3, i8* %4, i32 0)
ret i32 %5
}

LLVM IR (-O2):
@AT_FDCWD = global i32 0
define i32 @unlink(i8* %0) {
%2 = load i32, i32* @AT_FDCWD
%3 = tail call i32 @unlinkat(i32 %2, i8* %0, i32 0)
ret i32 %3
}
/* Type definitions */
struct stack_st_OPENSSL_CSTRING {
  int dummy;
};
typedef int /*<<< orphan*/ OPENSSL_STACK;

/* Variables and functions */
scalar_t__ OPENSSL_sk_shift(int /*<<< orphan*/ *);
const char *sk_OPENSSL_CSTRING_shift(struct stack_st_OPENSSL_CSTRING *sk) {
  return (const char *)OPENSSL_sk_shift((OPENSSL_STACK *)sk);
}


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

x86 assembly (clang, -O2):
<sk_OPENSSL_CSTRING_shift>:
jmp    1030 <OPENSSL_sk_shift@plt>

LLVM IR (-O0):
%struct.stack_st_OPENSSL_CSTRING = type { i32 }
define i8* @sk_OPENSSL_CSTRING_shift(%struct.stack_st_OPENSSL_CSTRING* %0) {
%2 = alloca %struct.stack_st_OPENSSL_CSTRING*
store %struct.stack_st_OPENSSL_CSTRING* %0, %struct.stack_st_OPENSSL_CSTRING** %2
%3 = load %struct.stack_st_OPENSSL_CSTRING*, %struct.stack_st_OPENSSL_CSTRING** %2
%4 = bitcast %struct.stack_st_OPENSSL_CSTRING* %3 to i32*
%5 = call i64 @OPENSSL_sk_shift(i32* %4)
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}

LLVM IR (-O2):
%struct.stack_st_OPENSSL_CSTRING = type { i32 }
define i8* @sk_OPENSSL_CSTRING_shift(%struct.stack_st_OPENSSL_CSTRING* %0) {
%2 = getelementptr %struct.stack_st_OPENSSL_CSTRING, %struct.stack_st_OPENSSL_CSTRING* %0, i64 0, i32 0
%3 = tail call i64 @OPENSSL_sk_shift(i32* %2)
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ compute_xor(char *, int);
int /*<<< orphan*/ f2();
void main_test(void) {
  char str[5] = "ALLO";
  compute_xor(str, 4);
  f2();
}


x86 assembly (clang, -O0):
<main_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed2(%rip),%eax
mov    %eax,-0x5(%rbp)
mov    0xecd(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0x5(%rbp),%rdi
mov    $0x4,%esi
call   1040 <compute_xor@plt>
mov    $0x0,%al
call   1030 <f2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main_test>:
push   %rax
movb   $0x0,0x4(%rsp)
movl   $0x4f4c4c41,(%rsp)
mov    %rsp,%rdi
mov    $0x4,%esi
call   1040 <compute_xor@plt>
xor    %eax,%eax
call   1030 <f2@plt>
pop    %rax
ret

LLVM IR (-O0):
@__const.main_test.str = [5 x i8] c"ALLO\00"
define void @main_test() {
%1 = alloca [5 x i8]
%2 = bitcast [5 x i8]* %1 to i8*
%3 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%4 = call i32 @compute_xor(i8* %3, i32 4)
%5 = call i32 (...) @f2()
ret void
}

LLVM IR (-O2):
@__const.main_test.str = [5 x i8] c"ALLO\00"
define void @main_test() {
%1 = alloca [5 x i8]
%2 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%3 = call i32 @compute_xor(i8* %2, i32 4)
%4 = call i32 (...) @f2()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void version() { printf("version..\n"); }


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

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

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

LLVM IR (-O2):
@str = [10 x i8] c"version..\00"
define void @version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print(int *arr, int size) {
  int i;
  for (i = 0; i < size; i++) {
    printf("%d", arr[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <print+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print+0x16>
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <print+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <print+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @print(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
/* Type definitions */
typedef scalar_t__ ptrdiff_t;

/* Variables and functions */
ptrdiff_t objp_to_ptrdiff(void *ptr) {
  ptrdiff_t distance;
  distance = (ptrdiff_t)(((unsigned char *)ptr) - ((unsigned char *)NULL));
  return ((ptrdiff_t)distance);
}


x86 assembly (clang, -O0):
<objp_to_ptrdiff>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
sub    $0x0,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @objp_to_ptrdiff(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i64
%6 = sub i64 %5, 0
store i64 %6, i64* %3
%7 = load i64, i64* %3
ret i64 %7
}

LLVM IR (-O2):
define i64 @objp_to_ptrdiff(i8* %0) {
%2 = ptrtoint i8* %0 to i64
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
double sqrt(int);
int main() {
  double sq2 = sqrt(2);
  printf("\nsizeof(\'a\'): %d\n\n", sizeof('a'));
  char c;
  void *pv = &c;
  int *pi = pv;
  int class = 5;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    $0x2,%edi
call   1040 <sqrt@plt>
movsd  %xmm0,-0x8(%rbp)
lea    0xec2(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    -0x9(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x5,-0x24(%rbp)
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [19 x i8] c"\0Asizeof('a'): %d\0A\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca i8
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i32
%6 = call double @sqrt(i32 2)
store double %6, double* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 4)
store i8* %2, i8** %3
%8 = load i8*, i8** %3
%9 = bitcast i8* %8 to i32*
store i32* %9, i32** %4
store i32 5, i32* %5
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"\0Asizeof('a'): %d\0A\0A\00"
define i32 @main() {
%1 = tail call double @sqrt(i32 2)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 4)
ret i32 0
}
const char *Len_Brief(void) { return "Has a length"; }


x86 assembly (clang, -O0):
<Len_Brief>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Len_Brief>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Has a length\00"
define i8* @Len_Brief() {
ret i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [13 x i8] c"Has a length\00"
define i8* @Len_Brief() {
ret i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0)
}
int row_byte_hkscs(int row) { return 0x80 + row; }


x86 assembly (clang, -O0):
<row_byte_hkscs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x80,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<row_byte_hkscs>:
lea    0x80(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @row_byte_hkscs(i32 %0) {
%2 = add nsw i32 %0, 128
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ DeinitFields();
void SwitchFrom_370(void) { DeinitFields(); }


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

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

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

LLVM IR (-O2):
define void @SwitchFrom_370() {
%1 = tail call i32 (...) @DeinitFields()
ret void
}
void CFGMR3QueryS8Def(void) {}


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

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

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

LLVM IR (-O2):
define void @CFGMR3QueryS8Def() {
ret void
}
f_impl3(int f) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @f_impl3(i32 %0) {
ret i32 0
}
_Bool wrap(_Bool f) { return f; }


x86 assembly (clang, -O0):
<wrap>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
and    $0x1,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i1 @wrap(i1 zeroext %0) {
%2 = alloca i8
%3 = zext i1 %0 to i8
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = trunc i8 %4 to i1
ret i1 %5
}

LLVM IR (-O2):
define zeroext i1 @wrap(i1 returned zeroext %0) {
ret i1 %0
}
/* Variables and functions */
int myGetline(char *, int);
int /*<<< orphan*/ printf(char *, char *);
char main() {
  int len;
  int max;
  char line[1000];
  char longest[1000];
  max = 0;
  while ((len = myGetline(line, 1000)) > 0)
    if (len > 80) {
      printf("%s", line);
    }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x7e0,%rsp
movl   $0x0,-0x8(%rbp)
lea    -0x3f0(%rbp),%rdi
mov    $0x3e8,%esi
call   1040 <myGetline@plt>
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
jle    1171 <main+0x51>
cmpl   $0x50,-0x4(%rbp)
jle    116c <main+0x4c>
lea    -0x3f0(%rbp),%rsi
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
jmp    1132 <main+0x12>
xor    %eax,%eax
movsbl %al,%eax
add    $0x7e0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x3e8,%rsp
mov    %rsp,%rdi
mov    $0x3e8,%esi
call   1040 <myGetline@plt>
test   %eax,%eax
jle    1173 <main+0x53>
lea    0xebe(%rip),%r14
mov    %rsp,%rbx
jmp    1161 <main+0x41>
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1040 <myGetline@plt>
test   %eax,%eax
jle    1173 <main+0x53>
cmp    $0x51,%eax
jb     1150 <main+0x30>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
jmp    1150 <main+0x30>
xor    %eax,%eax
add    $0x3e8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define signext i8 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i32 @myGetline(i8* %2, i32 1000)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %13
5: ; preds = %0, %10
%6 = phi i32 [ %11, %10 ], [ %3, %0 ]
%7 = icmp ugt i32 %6, 80
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
br label %10
10: ; preds = %8, %5
%11 = call i32 @myGetline(i8* %2, i32 1000)
%12 = icmp sgt i32 %11, 0
br i1 %12, label %5, label %13
13: ; preds = %10, %0
ret i8 0
}
void my_swap_char(char *a, int i, int j) {
  char x;
  x = a[i];
  a[i] = a[j];
  a[j] = x;
}


x86 assembly (clang, -O0):
<my_swap_char>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x11(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_swap_char>:
movslq %esi,%rax
mov    (%rdi,%rax,1),%sil
movslq %edx,%rdx
mov    (%rdi,%rdx,1),%cl
mov    %cl,(%rdi,%rax,1)
mov    %sil,(%rdi,%rdx,1)
ret

LLVM IR (-O0):
define void @my_swap_char(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = load i8, i8* %11
store i8 %12, i8* %7
%13 = load i8*, i8** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
%18 = load i8*, i8** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %18, i64 %20
store i8 %17, i8* %21
%22 = load i8, i8* %7
%23 = load i8*, i8** %4
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8, i8* %23, i64 %25
store i8 %22, i8* %26
ret void
}

LLVM IR (-O2):
define void @my_swap_char(i8* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
store i8 %9, i8* %5
store i8 %6, i8* %8
ret void
}
/* Variables and functions */
char *reloc_mbi_struct(char *, int);
char *reloc_mbi_string(char *old) {
  char *p;
  for (p = old; *p != '\0'; p++)
    continue;
  return reloc_mbi_struct(old, p - old + 1);
}


x86 assembly (clang, -O0):
<reloc_mbi_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114a <reloc_mbi_string+0x3a>
jmp    1139 <reloc_mbi_string+0x29>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <reloc_mbi_string+0x14>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
add    $0x1,%rax
mov    %eax,%esi
call   1030 <reloc_mbi_struct@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reloc_mbi_string>:
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmpb   $0x0,(%rdi,%rsi,1)
lea    0x1(%rsi),%rsi
jne    1120 <reloc_mbi_string+0x10>
jmp    1030 <reloc_mbi_struct@plt>

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

LLVM IR (-O2):
define i8* @reloc_mbi_string(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
%12 = add i32 %11, 1
%13 = tail call i8* @reloc_mbi_struct(i8* %0, i32 %12)
ret i8* %13
}