xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ display_args(int, char **);
int /*<<< orphan*/ printf(char *, int);
scalar_t__ tinysh_get_arg();
void item_fnt(int argc, char **argv) {
  printf("item%d command called\n", (int)tinysh_get_arg());
  display_args(argc, argv);
}


x86 assembly (clang, -O0):
<item_fnt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <tinysh_get_arg@plt>
mov    %eax,%esi
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <display_args@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<item_fnt>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1050 <tinysh_get_arg@plt>
lea    0xeba(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <display_args@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"item%d command called\0A\00"
define void @item_fnt(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i64 (...) @tinysh_get_arg()
%6 = trunc i64 %5 to i32
%7 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %3
%9 = load i8**, i8*** %4
%10 = call i32 @display_args(i32 %8, i8** %9)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"item%d command called\0A\00"
define void @item_fnt(i32 %0, i8** %1) {
%3 = tail call i64 (...) @tinysh_get_arg()
%4 = trunc i64 %3 to i32
%5 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = tail call i32 @display_args(i32 %0, i8** %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ error(int, char *, char *, char *);
void unterminated_action(int lineno, char *line, char *cptr) {
  error(lineno, line, cptr, "unterminated action");
}


x86 assembly (clang, -O0):
<unterminated_action>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xecb(%rip),%rcx
call   1030 <error@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unterminated_action>:
lea    0xee9(%rip),%rcx
jmp    1030 <error@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"unterminated action\00"
define void @unterminated_action(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i32 @error(i32 %7, i8* %8, i8* %9, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"unterminated action\00"
define void @unterminated_action(i32 %0, i8* %1, i8* %2) {
%4 = tail call i32 @error(i32 %0, i8* %1, i8* %2, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}
void outb(unsigned short _port, unsigned char _data) {
  asm volatile("outb %0, %1" : : "a"(_data), "Nd"(_port));
}


x86 assembly (clang, -O0):
<outb>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    -0x2(%rbp),%dx
out    %al,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outb>:
mov    %esi,%eax
mov    %edi,%edx
out    %al,(%dx)
ret

LLVM IR (-O0):
define void @outb(i16 zeroext %0, i8 zeroext %1) {
%3 = alloca i16
%4 = alloca i8
store i16 %0, i16* %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = load i16, i16* %3
ret void
}

LLVM IR (-O2):
define void @outb(i16 zeroext %0, i8 zeroext %1) {
tail call void asm sideeffect "outb $0, $1", "{ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i8 %1, i16 %0)
ret void
}
void *run_function(void *env, void *arg) {
  void *(*function)(void *) = env;
  return function(arg);
}


x86 assembly (clang, -O0):
<run_function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rdi
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<run_function>:
mov    %rdi,%rax
mov    %rsi,%rdi
jmp    *%rax

LLVM IR (-O0):
define i8* @run_function(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8* (i8*)*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i8* (i8*)*
store i8* (i8*)* %7, i8* (i8*)** %5
%8 = load i8* (i8*)*, i8* (i8*)** %5
%9 = load i8*, i8** %4
%10 = call i8* %8(i8* %9)
ret i8* %10
}

LLVM IR (-O2):
define i8* @run_function(i8* nocapture %0, i8* %1) {
%3 = bitcast i8* %0 to i8* (i8*)*
%4 = tail call i8* %3(i8* %1)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ aligned_alloc(int, int);
void unusedRetVal_aligned_alloc(void) { aligned_alloc(8, 16); }


x86 assembly (clang, -O0):
<unusedRetVal_aligned_alloc>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8,%edi
mov    $0x10,%esi
call   1030 <aligned_alloc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<unusedRetVal_aligned_alloc>:
mov    $0x8,%edi
mov    $0x10,%esi
jmp    1030 <aligned_alloc@plt>

LLVM IR (-O0):
define void @unusedRetVal_aligned_alloc() {
%1 = call i32 @aligned_alloc(i32 8, i32 16)
ret void
}

LLVM IR (-O2):
define void @unusedRetVal_aligned_alloc() {
%1 = tail call i32 @aligned_alloc(i32 8, i32 16)
ret void
}
/* Type definitions */
struct cs1550_sem {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ syscall(int, struct cs1550_sem *);
void up(struct cs1550_sem *sem) { syscall(326, sem); }


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

x86 assembly (clang, -O2):
<up>:
mov    %rdi,%rsi
mov    $0x146,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.cs1550_sem = type { i32 }
define void @up(%struct.cs1550_sem* %0) {
%2 = alloca %struct.cs1550_sem*
store %struct.cs1550_sem* %0, %struct.cs1550_sem** %2
%3 = load %struct.cs1550_sem*, %struct.cs1550_sem** %2
%4 = call i32 @syscall(i32 326, %struct.cs1550_sem* %3)
ret void
}

LLVM IR (-O2):
%struct.cs1550_sem = type { i32 }
define void @up(%struct.cs1550_sem* %0) {
%2 = tail call i32 @syscall(i32 326, %struct.cs1550_sem* %0)
ret void
}
int test_imm_A3int8_mem(signed char *val) {
  return ((*val) & (-0xA3 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_A3int8_mem>:
movsbl (%rdi),%eax
test   $0xffffff5d,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_A3int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = and i32 %3, -163
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 -40, i32 -20
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ cadre();
int /*<<< orphan*/ effaceCadre();
int /*<<< orphan*/ printf(char *, char *);
void affiche(char *chaine) {
  effaceCadre();
  printf("  %s", chaine);
  cadre();
}


x86 assembly (clang, -O0):
<affiche>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1050 <effaceCadre@plt>
mov    -0x8(%rbp),%rsi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <cadre@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<affiche>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <effaceCadre@plt>
lea    0xebe(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
jmp    1040 <cadre@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c" %s\00"
define void @affiche(i8* %0) {
%2 = tail call i32 (...) @effaceCadre()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @cadre()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0xc1() {
  Assert_real((isdigit(193) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isdigit.c",
              970, ("isdigit should be 0 for 0xc1"));
}


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

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

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xc1\00"
define void @t_isdigit_0xc1() {
%1 = call i64 @isdigit(i32 193)
%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 970, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xc1\00"
define void @t_isdigit_0xc1() {
%1 = tail call i64 @isdigit(i32 193)
%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 970, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *check_malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *check_strdup(const char *string) {
  char *p = check_malloc(strlen(string) + 1);
  strcpy(p, string);
  return p;
}


x86 assembly (clang, -O0):
<check_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <check_malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <check_malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @check_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @check_malloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @check_strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @check_malloc(i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
void init_add_color_span_funcs_c(void) {}


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

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

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

LLVM IR (-O2):
define void @init_add_color_span_funcs_c() {
ret void
}
int xmlUCSIsCyrillicSupplement(int code) {
  return (((code >= 0x0500) && (code <= 0x052F)));
}


x86 assembly (clang, -O0):
<xmlUCSIsCyrillicSupplement>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x500,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <xmlUCSIsCyrillicSupplement+0x26>
cmpl   $0x52f,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmlUCSIsCyrillicSupplement>:
add    $0xfffffb00,%edi
xor    %eax,%eax
cmp    $0x30,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @xmlUCSIsCyrillicSupplement(i32 %0) {
%2 = add i32 %0, -1280
%3 = icmp ult i32 %2, 48
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ term_put_char(int /*<<< orphan*/);
int /*<<< orphan*/ u_str_get_char(char const *, size_t *);
void term_add_str(const char *str) {
  size_t i = 0;
  while (str[i]) {
    if (!term_put_char(u_str_get_char(str, &i))) {
      break;
    }
  }
}


x86 assembly (clang, -O0):
<term_add_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     116d <term_add_str+0x4d>
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <u_str_get_char@plt>
mov    %eax,%edi
call   1030 <term_put_char@plt>
cmp    $0x0,%eax
jne    1168 <term_add_str+0x48>
jmp    116d <term_add_str+0x4d>
jmp    1134 <term_add_str+0x14>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<term_add_str>:
push   %r14
push   %rbx
push   %rax
movq   $0x0,(%rsp)
cmpb   $0x0,(%rdi)
je     1160 <term_add_str+0x40>
mov    %rdi,%rbx
mov    %rsp,%r14
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <u_str_get_char@plt>
mov    %eax,%edi
call   1030 <term_put_char@plt>
test   %eax,%eax
je     1160 <term_add_str+0x40>
mov    (%rsp),%rax
cmpb   $0x0,(%rbx,%rax,1)
jne    1140 <term_add_str+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @term_add_str(i8* %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
store i64 0, i64* %2
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %15, label %6
6: ; preds = %1, %10
%7 = call i32 @u_str_get_char(i8* %0, i64* %2)
%8 = call i32 @term_put_char(i32 %7)
%9 = icmp eq i32 %8, 0
br i1 %9, label %15, label %10
10: ; preds = %6
%11 = load i64, i64* %2
%12 = getelementptr inbounds i8, i8* %0, i64 %11
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %6
15: ; preds = %10, %6, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ screen_puts(char *);
int /*<<< orphan*/ timer_sleep(int);
void taska() {
  while (1) {
    timer_sleep(800);
    screen_puts("A");
  }
}


x86 assembly (clang, -O0):
<taska>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <taska+0x9>
mov    $0x320,%edi
call   1030 <timer_sleep@plt>
lea    0xec6(%rip),%rdi
call   1040 <screen_puts@plt>
jmp    1129 <taska+0x9>

x86 assembly (clang, -O2):
<taska>:
push   %rbx
lea    0xed8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    $0x320,%edi
call   1030 <timer_sleep@plt>
mov    %rbx,%rdi
call   1040 <screen_puts@plt>
jmp    1130 <taska+0x10>

LLVM IR (-O0):
@.str = [2 x i8] c"A\00"
define void @taska() {
br label %1
1: ; preds = %0, %1
%2 = call i32 @timer_sleep(i32 800)
%3 = call i32 @screen_puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %1
}

LLVM IR (-O2):
@.str = [2 x i8] c"A\00"
define void @taska() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 @timer_sleep(i32 800)
%3 = tail call i32 @screen_puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %1
}
/* Type definitions */
struct vec4 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ vec4_inverse(float *, float *);
__attribute__((always_)) struct vec4 *psvec4_inverse(struct vec4 *result,
                                                     struct vec4 *a) {
  vec4_inverse((float *)result, (float *)a);
  return result;
}


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

x86 assembly (clang, -O2):
<psvec4_inverse>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vec4_inverse@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.vec4 = type { i32 }
define %struct.vec4* @psvec4_inverse(%struct.vec4* %0, %struct.vec4* %1) {
%3 = alloca %struct.vec4*
%4 = alloca %struct.vec4*
store %struct.vec4* %0, %struct.vec4** %3
store %struct.vec4* %1, %struct.vec4** %4
%5 = load %struct.vec4*, %struct.vec4** %3
%6 = bitcast %struct.vec4* %5 to float*
%7 = load %struct.vec4*, %struct.vec4** %4
%8 = bitcast %struct.vec4* %7 to float*
%9 = call i32 @vec4_inverse(float* %6, float* %8)
%10 = load %struct.vec4*, %struct.vec4** %3
ret %struct.vec4* %10
}

LLVM IR (-O2):
%struct.vec4 = type { i32 }
define %struct.vec4* @psvec4_inverse(%struct.vec4* returned %0, %struct.vec4* %1) {
%3 = bitcast %struct.vec4* %0 to float*
%4 = bitcast %struct.vec4* %1 to float*
%5 = tail call i32 @vec4_inverse(float* %3, float* %4)
ret %struct.vec4* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char letter, c;
  scanf("%c", &letter);
  c = 'z' - (letter - 'a');
  printf("%c", c);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0x1(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x1(%rbp),%ecx
sub    $0x61,%ecx
mov    $0x7a,%eax
sub    %ecx,%eax
mov    %al,-0x2(%rbp)
lea    0xeb0(%rip),%rdi
movsbl -0x2(%rbp),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rbx
lea    0xf(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    $0xdb,%al
sub    0xf(%rsp),%al
movsbl %al,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i8
%2 = alloca i8
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%4 = load i8, i8* %1
%5 = sext i8 %4 to i32
%6 = sub nsw i32 %5, 97
%7 = sub nsw i32 122, %6
%8 = trunc i32 %7 to i8
store i8 %8, i8* %2
%9 = load i8, i8* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i8
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = load i8, i8* %1
%4 = sub i8 -37, %3
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %4)
ret i32 0
}
unsigned franz(unsigned x) { return x; }


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

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

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

LLVM IR (-O2):
define i32 @franz(i32 returned %0) {
ret i32 %0
}
int syscall2(int syscall, int arg0, int arg1) {
  int ret;
  __asm__("movl %[syscall],%%eax\n\t"
          "movl %[arg0],%%ebx\n\t"
          "movl %[arg1],%%ecx\n\t"
          "int $0x80\n\t"
          "movl %%eax,%[ret]\n\t"
          : [ret] "=r"(ret)
          : [syscall] "m"(syscall), [arg0] "m"(arg0), [arg1] "m"(arg1)
          : "eax", "ebx", "ecx");
  return ret;
}


x86 assembly (clang, -O0):
<syscall2>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ebx
mov    -0x14(%rbp),%ecx
int    $0x80
mov    %eax,%edx
mov    %edx,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscall2>:
push   %rbx
mov    %edi,-0x4(%rsp)
mov    %esi,-0x8(%rsp)
mov    %edx,-0xc(%rsp)
mov    -0x4(%rsp),%eax
mov    -0x8(%rsp),%ebx
mov    -0xc(%rsp),%ecx
int    $0x80
mov    %eax,%edx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @syscall2(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = call i32 asm "movl $1,%eax\0A\09movl $2,%ebx\0A\09movl $3,%ecx\0A\09int $$0x80\0A\09movl %eax,$0\0A\09", "=r,*m,*m,*m,~{eax},~{ebx},~{ecx},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %4, i32* elementtype(i32) %5, i32* elementtype(i32) %6)
store i32 %8, i32* %7
%9 = load i32, i32* %7
ret i32 %9
}

LLVM IR (-O2):
define i32 @syscall2(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = call i32 asm "movl $1,%eax\0A\09movl $2,%ebx\0A\09movl $3,%ecx\0A\09int $$0x80\0A\09movl %eax,$0\0A\09", "=r,*m,*m,*m,~{eax},~{ebx},~{ecx},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %4, i32* elementtype(i32) %5, i32* elementtype(i32) %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ sprintf(char *, char *, int);
int strlen(char *);
int main() {
  char buf[20];
  int id = 10;
  memset(buf, 0, 20);
  sprintf(buf + strlen(buf), "BUF: %d", id);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x24(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1040 <memset@plt>
lea    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x30(%rbp),%rdi
cltq
add    %rax,%rdi
mov    -0x24(%rbp),%edx
lea    0xe86(%rip),%rsi
call   1050 <sprintf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1040 <memset@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
lea    (%rsp,%rax,1),%rdi
lea    0xea4(%rip),%rsi
mov    $0xa,%edx
call   1050 <sprintf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"BUF: %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i8]
%3 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %3
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%5 = call i32 @memset(i8* %4, i32 0, i32 20)
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%8 = call i32 @strlen(i8* %7)
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %6, i64 %9
%11 = load i32, i32* %3
%12 = call i32 @sprintf(i8* %10, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"BUF: %d\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = call i32 @memset(i8* %2, i32 0, i32 20)
%4 = call i32 @strlen(i8* %2)
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 %5
%7 = call i32 @sprintf(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 10)
ret i32 0
}
/* Variables and functions */
int move_obstacle(long *, long, long);
int move_Obs(long obs[2 * 10 + 1], long dx, long dy) {
  return (move_obstacle(obs, dx, dy));
}


x86 assembly (clang, -O0):
<move_Obs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <move_obstacle@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<move_Obs>:
jmp    1030 <move_obstacle@plt>

LLVM IR (-O0):
define i32 @move_Obs(i64* %0, i64 %1, i64 %2) {
%4 = alloca i64*
%5 = alloca i64
%6 = alloca i64
store i64* %0, i64** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64*, i64** %4
%8 = load i64, i64* %5
%9 = load i64, i64* %6
%10 = call i32 @move_obstacle(i64* %7, i64 %8, i64 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @move_Obs(i64* %0, i64 %1, i64 %2) {
%4 = tail call i32 @move_obstacle(i64* %0, i64 %1, i64 %2)
ret i32 %4
}
int debug_privileges(void) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @debug_privileges() {
ret i32 0
}
int fun550() { return 550; }


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

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

LLVM IR (-O0):
define i32 @fun550() {
ret i32 550
}

LLVM IR (-O2):
define i32 @fun550() {
ret i32 550
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int lrand48();
uint64_t rte_rand(void) {
  uint64_t val;
  val = lrand48();
  val <<= 32;
  val += lrand48();
  return val;
}


x86 assembly (clang, -O0):
<rte_rand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <lrand48@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
shl    %cl,%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <lrand48@plt>
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rte_rand>:
push   %rax
xor    %eax,%eax
call   1030 <lrand48@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <lrand48@plt>

LLVM IR (-O0):
define i32 @rte_rand() {
%1 = alloca i32
%2 = call i32 (...) @lrand48()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = shl i32 %3, 32
store i32 %4, i32* %1
%5 = call i32 (...) @lrand48()
%6 = load i32, i32* %1
%7 = add nsw i32 %6, %5
store i32 %7, i32* %1
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @rte_rand() {
%1 = tail call i32 (...) @lrand48()
%2 = tail call i32 (...) @lrand48()
ret i32 poison
}
int sdb_nop(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @sdb_nop() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assem_debug(char *, int);
int /*<<< orphan*/ output_byte(int);
void emit_fadd(int r) {
  assem_debug("fadd st%d", r);
  output_byte(0xd8);
  output_byte(0xc0 + r);
}


x86 assembly (clang, -O0):
<emit_fadd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <assem_debug@plt>
mov    $0xd8,%edi
call   1040 <output_byte@plt>
mov    -0x4(%rbp),%edi
add    $0xc0,%edi
call   1040 <output_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_fadd>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
mov    %ebx,%esi
call   1030 <assem_debug@plt>
mov    $0xd8,%edi
call   1040 <output_byte@plt>
add    $0xc0,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1040 <output_byte@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"fadd st%d\00"
define void @emit_fadd(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @assem_debug(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @output_byte(i32 216)
%6 = load i32, i32* %2
%7 = add nsw i32 192, %6
%8 = call i32 @output_byte(i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"fadd st%d\00"
define void @emit_fadd(i32 %0) {
%2 = tail call i32 @assem_debug(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @output_byte(i32 216)
%4 = add nsw i32 %0, 192
%5 = tail call i32 @output_byte(i32 %4)
ret void
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
__attribute__((weak)) pid_t _getpid(void) { return 1; }


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

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

LLVM IR (-O0):
define weak i32 @_getpid() {
ret i32 1
}

LLVM IR (-O2):
define weak i32 @_getpid() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ free(void **);
void free_matrix(void **matrix, size_t height) {
  size_t i;
  for (i = 0; i < height; i++) {
    free(matrix[i]);
  }
  free(matrix);
}


x86 assembly (clang, -O0):
<free_matrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1158 <free_matrix+0x48>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <free_matrix+0x18>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_matrix>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %rsi,%rsi
je     1142 <free_matrix+0x32>
mov    %rsi,%r15
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <free_matrix+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_matrix(i8** nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %12, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %10, %4 ], [ 0, %2 ]
%6 = getelementptr inbounds i8*, i8** %0, i64 %5
%7 = bitcast i8** %6 to i8***
%8 = load i8**, i8*** %7
%9 = tail call i32 @free(i8** %8)
%10 = add nuw i64 %5, 1
%11 = icmp eq i64 %10, %1
br i1 %11, label %12, label %4
12: ; preds = %4, %2
%13 = tail call i32 @free(i8** %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ add(int, int);
int mult(int, int /*<<< orphan*/);
int mult_a_sum(int i, int j, int k) { return mult(i, add(j, k)); }


x86 assembly (clang, -O0):
<mult_a_sum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <add@plt>
mov    -0x10(%rbp),%edi
mov    %eax,%esi
call   1040 <mult@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mult_a_sum>:
push   %rbx
mov    %edi,%ebx
mov    %esi,%edi
mov    %edx,%esi
call   1030 <add@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1040 <mult@plt>

LLVM IR (-O0):
define i32 @mult_a_sum(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @add(i32 %8, i32 %9)
%11 = call i32 @mult(i32 %7, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @mult_a_sum(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @add(i32 %1, i32 %2)
%5 = tail call i32 @mult(i32 %0, i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, int, int /*<<< orphan*/, int);
char *getProgramReleaseVersionString() {
  static char program_version_string[32];
  sprintf(program_version_string, "%d.%d.%d.%d", 3, 3, 0, 1);
  return program_version_string;
}


x86 assembly (clang, -O0):
<getProgramReleaseVersionString>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f25(%rip),%rdi
lea    0xede(%rip),%rsi
mov    $0x3,%ecx
xor    %r8d,%r8d
mov    $0x1,%r9d
mov    %ecx,%edx
call   1030 <sprintf@plt>
lea    0x2f02(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getProgramReleaseVersionString>:
push   %rbx
lea    0x2f28(%rip),%rbx
lea    0xee1(%rip),%rsi
mov    %rbx,%rdi
mov    $0x3,%edx
mov    $0x3,%ecx
xor    %r8d,%r8d
mov    $0x1,%r9d
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@getProgramReleaseVersionString.program_version_string = internal global [32 x i8] zeroinitializer
@.str = [12 x i8] c"%d.%d.%d.%d\00"
define i8* @getProgramReleaseVersionString() {
%1 = call i32 @sprintf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @getProgramReleaseVersionString.program_version_string, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 3, i32 3, i32 0, i32 1)
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @getProgramReleaseVersionString.program_version_string, i64 0, i64 0)
}

LLVM IR (-O2):
@getProgramReleaseVersionString.program_version_string = internal global [32 x i8] zeroinitializer
@.str = [12 x i8] c"%d.%d.%d.%d\00"
define i8* @getProgramReleaseVersionString() {
%1 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @getProgramReleaseVersionString.program_version_string, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 3, i32 3, i32 0, i32 1)
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @getProgramReleaseVersionString.program_version_string, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ ICPrint();
int /*<<< orphan*/ ICPrintParents();
int main(int argc, char **argv) {
  ICPrint();
  ICPrintParents();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @ICPrint()
%7 = call i32 (...) @ICPrintParents()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @ICPrint()
%4 = tail call i32 (...) @ICPrintParents()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ get_int(char *, int, int);
int /*<<< orphan*/ get_word(char *, char *, int);
int /*<<< orphan*/ printf(char *);
int main() {
  char word_p[] = "type a word";
  char num_p[] = "type an int";
  char word_1[5];
  get_word(word_p, word_1, 10);
  printf("\n");
  get_int(num_p, 1, 10);
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xeb8(%rip),%eax
mov    %eax,-0x8(%rbp)
mov    0xeb2(%rip),%rax
mov    %rax,-0x1c(%rbp)
mov    0xeb0(%rip),%eax
mov    %eax,-0x14(%rbp)
lea    -0x10(%rbp),%rdi
lea    -0x21(%rbp),%rsi
mov    $0xa,%edx
call   1040 <get_word@plt>
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
lea    -0x1c(%rbp),%rdi
mov    $0x1,%esi
mov    $0xa,%edx
call   1050 <get_int@plt>
mov    $0x1,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movabs $0x7720612065707974,%rax
61 20 77
mov    %rax,0x10(%rsp)
movl   $0x64726f,0x18(%rsp)
movabs $0x206e612065707974,%rax
61 6e 20
mov    %rax,(%rsp)
movl   $0x746e69,0x8(%rsp)
lea    0x10(%rsp),%rdi
lea    0x23(%rsp),%rsi
mov    $0xa,%edx
call   1040 <get_word@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rsp,%rdi
mov    $0x1,%esi
mov    $0xa,%edx
call   1050 <get_int@plt>
mov    $0x1,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.word_p = [12 x i8] c"type a word\00"
@__const.main.num_p = [12 x i8] c"type an int\00"
@.str = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [12 x i8]
%3 = alloca [12 x i8]
%4 = alloca [5 x i8]
store i32 0, i32* %1
%5 = bitcast [12 x i8]* %2 to i8*
%6 = bitcast [12 x i8]* %3 to i8*
%7 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%8 = getelementptr inbounds [5 x i8], [5 x i8]* %4, i64 0, i64 0
%9 = call i32 @get_word(i8* %7, i8* %8, i32 10)
%10 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%11 = getelementptr inbounds [12 x i8], [12 x i8]* %3, i64 0, i64 0
%12 = call i32 @get_int(i8* %11, i32 1, i32 10)
ret i32 1
}

LLVM IR (-O2):
@__const.main.word_p = [12 x i8] c"type a word\00"
@__const.main.num_p = [12 x i8] c"type an int\00"
define i32 @main() {
%1 = alloca [12 x i8]
%2 = alloca [12 x i8]
%3 = alloca [5 x i8]
%4 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%7 = call i32 @get_word(i8* %4, i8* %6, i32 10)
%8 = call i32 @putchar(i32 10)
%9 = call i32 @get_int(i8* %5, i32 1, i32 10)
ret i32 1
}
void v9fs_vcookie_set_qid(struct inode *inode, struct p9_qid *qid) {}


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

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

LLVM IR (-O0):
%struct.inode = type opaque
%struct.p9_qid = type opaque
define void @v9fs_vcookie_set_qid(%struct.inode* %0, %struct.p9_qid* %1) {
%3 = alloca %struct.inode*
%4 = alloca %struct.p9_qid*
store %struct.inode* %0, %struct.inode** %3
store %struct.p9_qid* %1, %struct.p9_qid** %4
ret void
}

LLVM IR (-O2):
%struct.inode = type opaque
%struct.p9_qid = type opaque
define void @v9fs_vcookie_set_qid(%struct.inode* nocapture %0, %struct.p9_qid* nocapture %1) {
ret void
}
int _default_storage_use_mailbox(char *mailbox) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @_default_storage_use_mailbox(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ pthread_exit(void *);
void error(const char *msg) {
  perror(msg);
  pthread_exit((void *)1);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1030 <pthread_exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error>:
push   %rax
call   1040 <perror@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <pthread_exit@plt>

LLVM IR (-O0):
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @pthread_exit(i8* inttoptr (i64 1 to i8*))
ret void
}

LLVM IR (-O2):
define void @error(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @pthread_exit(i8* inttoptr (i64 1 to i8*))
ret void
}
void year_size(int rows, int cols) {}


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

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

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

LLVM IR (-O2):
define void @year_size(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f();
main() {
  int i;
  for (i = 0; i < 10; i++)
    f();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1145 <main+0x35>
mov    $0x0,%al
call   1030 <f@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f()
%2 = tail call i32 (...) @f()
%3 = tail call i32 (...) @f()
%4 = tail call i32 (...) @f()
%5 = tail call i32 (...) @f()
%6 = tail call i32 (...) @f()
%7 = tail call i32 (...) @f()
%8 = tail call i32 (...) @f()
%9 = tail call i32 (...) @f()
%10 = tail call i32 (...) @f()
ret i32 0
}
void ARGBSepia() {}


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

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

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

LLVM IR (-O2):
define void @ARGBSepia() {
ret void
}
/* Type definitions */
struct dmx {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct dmx *);
void dmx_destroy(struct dmx *dmx) {
  if (dmx)
    free(dmx);
}


x86 assembly (clang, -O0):
<dmx_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <dmx_destroy+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dmx_destroy>:
test   %rdi,%rdi
je     111a <dmx_destroy+0xa>
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
%struct.dmx = type { i32 }
define void @dmx_destroy(%struct.dmx* %0) {
%2 = icmp eq %struct.dmx* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.dmx* %0)
br label %5
5: ; preds = %3, %1
ret void
}
int at_client_stopped() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @at_client_stopped() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ htons(int /*<<< orphan*/);
scalar_t__ little_endianess();
uint16_t htons_util(uint16_t input) {
  if (little_endianess()) {
    return htons(input);
  } else {
    return input;
  }
}


x86 assembly (clang, -O0):
<htons_util>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <little_endianess@plt>
cmp    $0x0,%rax
je     114c <htons_util+0x2c>
mov    -0x8(%rbp),%edi
call   1030 <htons@plt>
mov    %eax,-0x4(%rbp)
jmp    1152 <htons_util+0x32>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<htons_util>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <little_endianess@plt>
test   %rax,%rax
je     1137 <htons_util+0x17>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <htons@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @htons_util(i32 %0) {
%2 = tail call i64 (...) @little_endianess()
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @htons(i32 %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ %0, %1 ]
ret i32 %7
}
void sk_pop(void) {}


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

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

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

LLVM IR (-O2):
define void @sk_pop() {
ret void
}
void recon_register_pcmcia_callback(void (*f)(int slot, int in)) {}


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

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

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

LLVM IR (-O2):
define void @recon_register_pcmcia_callback(void (i32, i32)* nocapture %0) {
ret void
}