xunge/DecIR huggingface dataset:
/* Variables and functions */
unsigned char bitmask_put(int, unsigned char);
unsigned char lnp_addressing_addr(unsigned char mask, unsigned char host,
                                  unsigned char port) {
  return (bitmask_put(mask, host) | bitmask_put(0xff ^ mask, port));
}


x86 assembly (clang, -O0):
<lnp_addressing_addr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %dil,%dl
mov    %dl,-0x1(%rbp)
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
movzbl -0x1(%rbp),%edi
movzbl -0x2(%rbp),%esi
call   1030 <bitmask_put@plt>
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
movzbl -0x1(%rbp),%edi
xor    $0xff,%edi
movzbl -0x3(%rbp),%esi
call   1030 <bitmask_put@plt>
mov    %al,%cl
mov    -0x8(%rbp),%eax
movzbl %cl,%ecx
or     %ecx,%eax
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lnp_addressing_addr>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %edi,%ebp
call   1030 <bitmask_put@plt>
mov    %eax,%ebx
xor    $0xff,%ebp
mov    %ebp,%edi
mov    %r14d,%esi
call   1030 <bitmask_put@plt>
or     %bl,%al
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define zeroext i8 @lnp_addressing_addr(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
store i8 %0, i8* %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = load i8, i8* %5
%10 = call zeroext i8 @bitmask_put(i32 %8, i8 zeroext %9)
%11 = zext i8 %10 to i32
%12 = load i8, i8* %4
%13 = zext i8 %12 to i32
%14 = xor i32 255, %13
%15 = load i8, i8* %6
%16 = call zeroext i8 @bitmask_put(i32 %14, i8 zeroext %15)
%17 = zext i8 %16 to i32
%18 = or i32 %11, %17
%19 = trunc i32 %18 to i8
ret i8 %19
}

LLVM IR (-O2):
define zeroext i8 @lnp_addressing_addr(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2) {
%4 = zext i8 %0 to i32
%5 = tail call zeroext i8 @bitmask_put(i32 %4, i8 zeroext %1)
%6 = xor i32 %4, 255
%7 = tail call zeroext i8 @bitmask_put(i32 %6, i8 zeroext %2)
%8 = or i8 %7, %5
ret i8 %8
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  char *s = "-456123";
  printf("%d", atoi(s));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 -456123)
ret i32 0
}
/* Variables and functions */
char *last_slash(char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
char *dirname(char *d, int dsize, char *s) {
  char *p;
  strncpy(d, s, dsize - 1);
  d[dsize - 1] = 0;
  p = last_slash(d);
  *p = 0;
  return d;
}


x86 assembly (clang, -O0):
<dirname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
call   1030 <strncpy@plt>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rdi
call   1040 <last_slash@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dirname>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
movslq %esi,%r14
lea    -0x1(%r14),%rax
mov    %rdx,%rsi
mov    %eax,%edx
call   1030 <strncpy@plt>
movb   $0x0,-0x1(%rbx,%r14,1)
mov    %rbx,%rdi
call   1040 <last_slash@plt>
movb   $0x0,(%rax)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @dirname(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%8 = load i8*, i8** %4
%9 = load i8*, i8** %6
%10 = load i32, i32* %5
%11 = sub nsw i32 %10, 1
%12 = call i32 @strncpy(i8* %8, i8* %9, i32 %11)
%13 = load i8*, i8** %4
%14 = load i32, i32* %5
%15 = sub nsw i32 %14, 1
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %13, i64 %16
store i8 0, i8* %17
%18 = load i8*, i8** %4
%19 = call i8* @last_slash(i8* %18)
store i8* %19, i8** %7
%20 = load i8*, i8** %7
store i8 0, i8* %20
%21 = load i8*, i8** %4
ret i8* %21
}

LLVM IR (-O2):
define i8* @dirname(i8* returned %0, i32 %1, i8* %2) {
%4 = add nsw i32 %1, -1
%5 = tail call i32 @strncpy(i8* %0, i8* %2, i32 %4)
%6 = sext i32 %4 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 0, i8* %7
%8 = tail call i8* @last_slash(i8* %0)
store i8 0, i8* %8
ret i8* %0
}
/* Variables and functions */
void *malloc(size_t);
void *MALLOC(size_t size) { return malloc(size); }


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

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

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

LLVM IR (-O2):
define noalias i8* @MALLOC(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ io_out8(int, int);
int /*<<< orphan*/ wait_kbc_sendready();
void enable_mouse(void) {
  wait_kbc_sendready();
  io_out8((0x0064), (0xd4));
  wait_kbc_sendready();
  io_out8((0x0060), (0xf4));
}


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

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

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

LLVM IR (-O2):
define void @enable_mouse() {
%1 = tail call i32 (...) @wait_kbc_sendready()
%2 = tail call i32 @io_out8(i32 100, i32 212)
%3 = tail call i32 (...) @wait_kbc_sendready()
%4 = tail call i32 @io_out8(i32 96, i32 244)
ret void
}
void print_serial(const char *buf) {
  unsigned long len = strlen(buf);
  asm volatile("rep/outsb" : "+S"(buf), "+c"(len) : "d"(0xf1));
}


x86 assembly (clang, -O0):
<print_serial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rcx
mov    $0xf1,%edx
rep outsb %ds:(%rsi),(%dx)
mov    %rsi,-0x8(%rbp)
mov    %rcx,-0x10(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_serial>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    $0xf1,%edx
mov    %rbx,%rsi
mov    %rax,%rcx
rep outsb %ds:(%rsi),(%dx)
pop    %rbx
ret

LLVM IR (-O0):
define void @print_serial(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
store i64 %5, i64* %3
%6 = load i8*, i8** %2
%7 = load i64, i64* %3
%8 = call { i8*, i64 } asm sideeffect "rep/outsb", "={si},={cx},{dx},0,1,~{dirflag},~{fpsr},~{flags}"(i32 241, i8* %6, i64 %7)
%9 = extractvalue { i8*, i64 } %8, 0
%10 = extractvalue { i8*, i64 } %8, 1
store i8* %9, i8** %2
store i64 %10, i64* %3
ret void
}

LLVM IR (-O2):
define void @print_serial(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = tail call { i8*, i64 } asm sideeffect "rep/outsb", "={si},={cx},{dx},0,1,~{dirflag},~{fpsr},~{flags}"(i32 241, i8* %0, i64 %2)
ret void
}
void socketInit() {}


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

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

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

LLVM IR (-O2):
define void @socketInit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ syscall2(int, unsigned int, int);
void map_vga_memory() {
  syscall2(0x2700, (unsigned int)((short *)0xb8000), 0x2000);
}


x86 assembly (clang, -O0):
<map_vga_memory>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2700,%edi
mov    $0xb8000,%eax
mov    %eax,%esi
mov    $0x2000,%edx
call   1030 <syscall2@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<map_vga_memory>:
mov    $0x2700,%edi
mov    $0xb8000,%esi
mov    $0x2000,%edx
jmp    1030 <syscall2@plt>

LLVM IR (-O0):
define void @map_vga_memory() {
%1 = call i32 @syscall2(i32 9984, i32 ptrtoint (i16* inttoptr (i64 753664 to i16*) to i32), i32 8192)
ret void
}

LLVM IR (-O2):
define void @map_vga_memory() {
%1 = tail call i32 @syscall2(i32 9984, i32 753664, i32 8192)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void PrintUsage() { printf("usage:\ntdbupdate -r rawname -c comment\n"); }


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

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

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

LLVM IR (-O2):
@str = [39 x i8] c"usage:\0Atdbupdate -r rawname -c comment\00"
define void @PrintUsage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int rand();
int rand_int() {
  int i, r = 0;
  for (i = 0; i < 32; i++) {
    r += rand() % 2 * (0x1 << i);
  }
  return r;
}


x86 assembly (clang, -O0):
<rand_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0x20,-0x4(%rbp)
jge    1164 <rand_int+0x54>
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    -0x4(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
imul   %ecx,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1126 <rand_int+0x16>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_int>:
push   %rbp
push   %rbx
push   %rax
xor    %ebx,%ebx
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <rand@plt>
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
and    $0xfffffffe,%ecx
sub    %ecx,%eax
mov    %ebp,%ecx
shl    %cl,%eax
add    %eax,%ebx
add    $0x1,%ebp
cmp    $0x20,%ebp
jne    1120 <rand_int+0x10>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @rand_int() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %2
store i32 0, i32* %1
br label %3
3: ; preds = %14, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 32
br i1 %5, label %6, label %17
6: ; preds = %3
%7 = call i32 (...) @rand()
%8 = srem i32 %7, 2
%9 = load i32, i32* %1
%10 = shl i32 1, %9
%11 = mul nsw i32 %8, %10
%12 = load i32, i32* %2
%13 = add nsw i32 %12, %11
store i32 %13, i32* %2
br label %14
14: ; preds = %6
%15 = load i32, i32* %1
%16 = add nsw i32 %15, 1
store i32 %16, i32* %1
br label %3
17: ; preds = %3
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @rand_int() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %7, %1 ]
%3 = phi i32 [ 0, %0 ], [ %8, %1 ]
%4 = tail call i32 (...) @rand()
%5 = srem i32 %4, 2
%6 = shl i32 %5, %3
%7 = add nsw i32 %6, %2
%8 = add nuw nsw i32 %3, 1
%9 = icmp eq i32 %8, 32
br i1 %9, label %10, label %1
10: ; preds = %1
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ IF_old_stackC();
int /*<<< orphan*/ IF_old_stackL();
int /*<<< orphan*/ IF_old_stackN();
void IF_old_stackAll(void) {
  IF_old_stackN();
  IF_old_stackC();
  IF_old_stackL();
}


x86 assembly (clang, -O0):
<IF_old_stackAll>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <IF_old_stackN@plt>
mov    $0x0,%al
call   1030 <IF_old_stackC@plt>
mov    $0x0,%al
call   1050 <IF_old_stackL@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<IF_old_stackAll>:
push   %rax
xor    %eax,%eax
call   1040 <IF_old_stackN@plt>
xor    %eax,%eax
call   1030 <IF_old_stackC@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <IF_old_stackL@plt>

LLVM IR (-O0):
define void @IF_old_stackAll() {
%1 = call i32 (...) @IF_old_stackN()
%2 = call i32 (...) @IF_old_stackC()
%3 = call i32 (...) @IF_old_stackL()
ret void
}

LLVM IR (-O2):
define void @IF_old_stackAll() {
%1 = tail call i32 (...) @IF_old_stackN()
%2 = tail call i32 (...) @IF_old_stackC()
%3 = tail call i32 (...) @IF_old_stackL()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *, char *, char *);
void status(char *status_string, char *hostname, char *battery_remain,
            char *current_time) {
  sprintf(status_string, "host: %s | battery: %s | %s", hostname,
          battery_remain, current_time);
}


x86 assembly (clang, -O0):
<status>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
lea    0xec1(%rip),%rsi
call   1030 <sprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<status>:
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
lea    0xee0(%rip),%rsi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"host: %s | battery: %s | %s\00"
define void @status(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = load i8*, i8** %8
%13 = call i32 @sprintf(i8* %9, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %10, i8* %11, i8* %12)
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"host: %s | battery: %s | %s\00"
define void @status(i8* nocapture writeonly %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2, i8* %3)
ret void
}
void handler(int signum) { (void)signum; }


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

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

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

LLVM IR (-O2):
define void @handler(i32 %0) {
ret void
}
void PBISTInit(void) {
  (*((volatile unsigned long *)(0x400FB000 + 0x00000180))) = 0x1;
  (*((volatile unsigned long *)(0x400FB000 + 0x00000188))) = 0x9;
}


x86 assembly (clang, -O0):
<PBISTInit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400fb180,%eax
movq   $0x1,(%rax)
mov    $0x400fb188,%eax
movq   $0x9,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<PBISTInit>:
movq   $0x1,0x400fb180
movq   $0x9,0x400fb188
ret

LLVM IR (-O0):
define void @PBISTInit() {
store volatile i64 1, i64* inttoptr (i64 1074770304 to i64*)
store volatile i64 9, i64* inttoptr (i64 1074770312 to i64*)
ret void
}

LLVM IR (-O2):
define void @PBISTInit() {
store volatile i64 1, i64* inttoptr (i64 1074770304 to i64*)
store volatile i64 9, i64* inttoptr (i64 1074770312 to i64*)
ret void
}
int do_368() { return 368; }


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

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

LLVM IR (-O0):
define i32 @do_368() {
ret i32 368
}

LLVM IR (-O2):
define i32 @do_368() {
ret i32 368
}
void RSA_new_method(void) {}


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

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

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

LLVM IR (-O2):
define void @RSA_new_method() {
ret void
}
void g_object_weak_unref() {}


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

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

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

LLVM IR (-O2):
define void @g_object_weak_unref() {
ret void
}
/* Variables and functions */
int atoi(int /*<<< orphan*/);
int /*<<< orphan*/ readIn();
int ReadInt() { return atoi(readIn()); }


x86 assembly (clang, -O0):
<ReadInt>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <readIn@plt>
mov    %eax,%edi
call   1040 <atoi@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReadInt>:
push   %rax
xor    %eax,%eax
call   1030 <readIn@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <atoi@plt>

LLVM IR (-O0):
define i32 @ReadInt() {
%1 = call i32 (...) @readIn()
%2 = call i32 @atoi(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
define i32 @ReadInt() {
%1 = tail call i32 (...) @readIn()
%2 = tail call i32 @atoi(i32 %1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ api_end();
int /*<<< orphan*/ api_putstr0(char *);
void HariMain(void) {
  api_putstr0("Hello, world!\n");
  api_end();
}


x86 assembly (clang, -O0):
<HariMain>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <api_putstr0@plt>
mov    $0x0,%al
call   1030 <api_end@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<HariMain>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <api_putstr0@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <api_end@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"Hello, world!\0A\00"
define void @HariMain() {
%1 = call i32 @api_putstr0(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @api_end()
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"Hello, world!\0A\00"
define void @HariMain() {
%1 = tail call i32 @api_putstr0(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @api_end()
ret void
}
void heapsort_(int arr[], int n) {}


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

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

LLVM IR (-O0):
define void @heapsort_(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 @heapsort_(i32* nocapture %0, i32 %1) {
ret void
}
void terminate() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ socket_free(struct socket *);
struct socket *socketlist_remove(struct socketlist *);
void socketlist_free(struct socketlist *head) {
  struct socket *s;
  while ((s = socketlist_remove(head)) != 0)
    socket_free(s);
}


x86 assembly (clang, -O0):
<socketlist_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <socketlist_remove@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1151 <socketlist_free+0x31>
mov    -0x10(%rbp),%rdi
call   1040 <socket_free@plt>
jmp    112c <socketlist_free+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<socketlist_free>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
call   1030 <socketlist_remove@plt>
test   %rax,%rax
je     1147 <socketlist_free+0x27>
mov    %rax,%rdi
call   1040 <socket_free@plt>
mov    %rbx,%rdi
jmp    1130 <socketlist_free+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.socketlist = type { i32 }
%struct.socket = type { i32 }
define void @socketlist_free(%struct.socketlist* %0) {
%2 = tail call %struct.socket* @socketlist_remove(%struct.socketlist* %0)
%3 = icmp eq %struct.socket* %2, null
br i1 %3, label %9, label %4
4: ; preds = %1, %4
%5 = phi %struct.socket* [ %7, %4 ], [ %2, %1 ]
%6 = tail call i32 @socket_free(%struct.socket* %5)
%7 = tail call %struct.socket* @socketlist_remove(%struct.socketlist* %0)
%8 = icmp eq %struct.socket* %7, null
br i1 %8, label %9, label %4
9: ; preds = %4, %1
ret void
}
const char *proc_state_str(struct myproc *a) { return ""; }


x86 assembly (clang, -O0):
<proc_state_str>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
lea    0xef1(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.myproc = type opaque
@.str = [1 x i8] zeroinitializer
define i8* @proc_state_str(%struct.myproc* %0) {
%2 = alloca %struct.myproc*
store %struct.myproc* %0, %struct.myproc** %2
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
%struct.myproc = type opaque
@.str = [1 x i8] zeroinitializer
define i8* @proc_state_str(%struct.myproc* nocapture readnone %0) {
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}
void foo_1_1_2_1_2_1_1_1_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_1_2_1_2_1_1_1_1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ reverse_recursor(char *, int, int);
int strlen(char *);
void reverse_recursive(char s[]) {
  int i, j;
  i = 0;
  j = strlen(s) - 1;
  reverse_recursor(s, i, j);
}


x86 assembly (clang, -O0):
<reverse_recursive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <reverse_recursor@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse_recursive>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
lea    -0x1(%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
pop    %rbx
jmp    1040 <reverse_recursor@plt>

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

LLVM IR (-O2):
define void @reverse_recursive(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, -1
%4 = tail call i32 @reverse_recursor(i8* %0, i32 0, i32 %3)
ret void
}
void xerbla_(const char *srname, const int *info, int srname_len) {
  (void)srname;
  (void)info;
  (void)srname_len;
  return;
}


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

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

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

LLVM IR (-O2):
define void @xerbla_(i8* nocapture %0, i32* nocapture %1, i32 %2) {
ret void
}
void PrintJNSimpleCompareFunction2(void *theEnv, const char *logicalName,
                                   void *theValue) {}


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

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

LLVM IR (-O0):
define void @PrintJNSimpleCompareFunction2(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
ret void
}

LLVM IR (-O2):
define void @PrintJNSimpleCompareFunction2(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2) {
ret void
}
int main(int argc, char *argv[]) {
  int x = 0;
  switch (argc) {
  case 0:
    x += 0;
  case 5:
    x += 2;
    break;
  case 1:
    x += 2;
  case 2:
    x += 2;
  case 3:
    x += 2;
  default:
    x = 10;
    break;
  }
  return x;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    %rax,-0x20(%rbp)
sub    $0x5,%rax
ja     1170 <main+0x70>
mov    -0x20(%rbp),%rax
lea    0xecb(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x14(%rbp),%eax
add    $0x0,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x14(%rbp)
jmp    1177 <main+0x77>
mov    -0x14(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x14(%rbp)
movl   $0xa,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
cmp    $0x5,%edi
setne  %al
test   %edi,%edi
lea    0x2(,%rax,8),%ecx
mov    $0x2,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%7 = load i32, i32* %4
switch i32 %7, label %23 [
i32 0, label %8
i32 5, label %11
i32 1, label %14
i32 2, label %17
i32 3, label %20
]
8: ; preds = %2
%9 = load i32, i32* %6
%10 = add nsw i32 %9, 0
store i32 %10, i32* %6
br label %11
11: ; preds = %2, %8
%12 = load i32, i32* %6
%13 = add nsw i32 %12, 2
store i32 %13, i32* %6
br label %24
14: ; preds = %2
%15 = load i32, i32* %6
%16 = add nsw i32 %15, 2
store i32 %16, i32* %6
br label %17
17: ; preds = %2, %14
%18 = load i32, i32* %6
%19 = add nsw i32 %18, 2
store i32 %19, i32* %6
br label %20
20: ; preds = %2, %17
%21 = load i32, i32* %6
%22 = add nsw i32 %21, 2
store i32 %22, i32* %6
br label %23
23: ; preds = %2, %20
store i32 10, i32* %6
br label %24
24: ; preds = %23, %11
%25 = load i32, i32* %6
ret i32 %25
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = icmp eq i32 %0, 0
%4 = icmp eq i32 %0, 5
%5 = or i1 %3, %4
%6 = select i1 %5, i32 2, i32 10
ret i32 %6
}
/* Variables and functions */
int isdigit(int);
int ISDIGIT(int ch) { return isdigit(ch); }


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

x86 assembly (clang, -O2):
<ISDIGIT>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @ISDIGIT(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ write(int, float *, int);
void write_float_(float *z, int *fd) { write(*fd, z, sizeof(float)); }


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

x86 assembly (clang, -O2):
<write_float_>:
mov    %rdi,%rax
mov    (%rsi),%edi
mov    %rax,%rsi
mov    $0x4,%edx
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define void @write_float_(float* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = tail call i32 @write(i32 %3, float* %0, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int clear_main(int argc, char **argv) {
  fputs("\x1b[2J\x1b[H", stdout);
  return 0;
}


x86 assembly (clang, -O0):
<clear_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%esi
lea    0xed1(%rip),%rdi
call   1030 <fputs@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [8 x i8] c"\1B[2J\1B[H\00"
@stdout = global i32 0
define i32 @clear_main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* @stdout
%6 = call i32 @fputs(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"\1B[2J\1B[H\00"
@stdout = global i32 0
define i32 @clear_main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @fputs(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ansi_goto(int /*<<< orphan*/, int);
int /*<<< orphan*/ ansi_refresh();
int ansi_endwin() {
  ansi_refresh();
  ansi_goto(0, 23);
  return 0;
}


x86 assembly (clang, -O0):
<ansi_endwin>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <ansi_refresh@plt>
xor    %edi,%edi
mov    $0x17,%esi
call   1030 <ansi_goto@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ansi_endwin>:
push   %rax
xor    %eax,%eax
call   1040 <ansi_refresh@plt>
xor    %edi,%edi
mov    $0x17,%esi
call   1030 <ansi_goto@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ansi_endwin() {
%1 = call i32 (...) @ansi_refresh()
%2 = call i32 @ansi_goto(i32 0, i32 23)
ret i32 0
}

LLVM IR (-O2):
define i32 @ansi_endwin() {
%1 = tail call i32 (...) @ansi_refresh()
%2 = tail call i32 @ansi_goto(i32 0, i32 23)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void freeMatrix(char **matrix, size_t nbLines) {
  size_t i;
  for (i = 0; i < nbLines; i++)
    free(matrix[i]);
}


x86 assembly (clang, -O0):
<freeMatrix>:
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 <freeMatrix+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 <freeMatrix+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeMatrix>:
push   %r15
push   %r14
push   %rbx
test   %rsi,%rsi
je     1142 <freeMatrix+0x32>
mov    %rsi,%r15
mov    %rdi,%r14
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 <freeMatrix+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @freeMatrix(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 = %16, %2
%7 = load i64, i64* %5
%8 = load i64, i64* %4
%9 = icmp ult i64 %7, %8
br i1 %9, label %10, label %19
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 = call i32 @free(i8* %14)
br label %16
16: ; preds = %10
%17 = load i64, i64* %5
%18 = add i64 %17, 1
store i64 %18, i64* %5
br label %6
19: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @freeMatrix(i8** nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %11, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %9, %4 ], [ 0, %2 ]
%6 = getelementptr inbounds i8*, i8** %0, i64 %5
%7 = load i8*, i8** %6
%8 = tail call i32 @free(i8* %7)
%9 = add nuw i64 %5, 1
%10 = icmp eq i64 %9, %1
br i1 %10, label %11, label %4
11: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int testRtiImplied();
int testRtsImplied();
void testReturn() {
  printf("testRtiImplied: %d\r\n", testRtiImplied());
  printf("testRtsImplied: %d\r\n", testRtsImplied());
}


x86 assembly (clang, -O0):
<testReturn>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <testRtiImplied@plt>
mov    %eax,%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <testRtsImplied@plt>
mov    %eax,%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testReturn>:
push   %rax
xor    %eax,%eax
call   1040 <testRtiImplied@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1050 <testRtsImplied@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"testRtiImplied: %d\0D\0A\00"
@.str.1 = [21 x i8] c"testRtsImplied: %d\0D\0A\00"
define void @testReturn() {
%1 = call i32 (...) @testRtiImplied()
%2 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 (...) @testRtsImplied()
%4 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"testRtiImplied: %d\0D\0A\00"
@.str.1 = [21 x i8] c"testRtsImplied: %d\0D\0A\00"
define void @testReturn() {
%1 = tail call i32 (...) @testRtiImplied()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @testRtsImplied()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret void
}
void outer_clean_all(void) {}


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

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

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

LLVM IR (-O2):
define void @outer_clean_all() {
ret void
}
void check_logfs_je_area(void) { ; }


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

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

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

LLVM IR (-O2):
define void @check_logfs_je_area() {
ret void
}
void dev_midi_imsg(void *arg, unsigned char *msg, int len) {}


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

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

LLVM IR (-O0):
define void @dev_midi_imsg(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
ret void
}

LLVM IR (-O2):
define void @dev_midi_imsg(i8* nocapture %0, i8* nocapture %1, i32 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_action_loop();
int /*<<< orphan*/ test_action_simple();
int main(int argc, char **argv) {
  printf("Running test_action_simple()\n");
  test_action_simple();
  printf("Running test_action_loop()\n");
  test_action_loop();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <test_action_simple@plt>
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <test_action_loop@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [30 x i8] c"Running test_action_simple()\0A\00"
@.str.1 = [28 x i8] c"Running test_action_loop()\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @test_action_simple()
%8 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 (...) @test_action_loop()
ret i32 0
}

LLVM IR (-O2):
@str = [29 x i8] c"Running test_action_simple()\00"
@str.2 = [27 x i8] c"Running test_action_loop()\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @test_action_simple()
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.2, i64 0, i64 0))
%6 = tail call i32 (...) @test_action_loop()
ret i32 0
}
/* Type definitions */
struct vectyploc {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ vectyploc_resize__(struct vectyploc *, size_t,
                                      int /*<<< orphan*/);
void vectyploc_resize(struct vectyploc *v, size_t new_count) {
  vectyploc_resize__(v, new_count, 0);
}


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

x86 assembly (clang, -O2):
<vectyploc_resize>:
xor    %edx,%edx
jmp    1030 <vectyploc_resize__@plt>

LLVM IR (-O0):
%struct.vectyploc = type { i32 }
define void @vectyploc_resize(%struct.vectyploc* %0, i64 %1) {
%3 = alloca %struct.vectyploc*
%4 = alloca i64
store %struct.vectyploc* %0, %struct.vectyploc** %3
store i64 %1, i64* %4
%5 = load %struct.vectyploc*, %struct.vectyploc** %3
%6 = load i64, i64* %4
%7 = call i32 @vectyploc_resize__(%struct.vectyploc* %5, i64 %6, i32 0)
ret void
}

LLVM IR (-O2):
%struct.vectyploc = type { i32 }
define void @vectyploc_resize(%struct.vectyploc* %0, i64 %1) {
%3 = tail call i32 @vectyploc_resize__(%struct.vectyploc* %0, i64 %1, i32 0)
ret void
}
/* Variables and functions */
void *calloc(int, size_t);
void *ntfs_calloc(size_t size) {
  void *p;
  p = calloc(1, size);
  if (!p)
    ;
  return p;
}


x86 assembly (clang, -O0):
<ntfs_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x1,%edi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    113e <ntfs_calloc+0x2e>
jmp    113e <ntfs_calloc+0x2e>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ntfs_calloc>:
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <calloc@plt>

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

LLVM IR (-O2):
define i8* @ntfs_calloc(i64 %0) {
%2 = tail call i8* @calloc(i32 1, i64 %0)
ret i8* %2
}
void make_white(unsigned char *pixel) {
  pixel[0] = pixel[1] = pixel[2] = (unsigned char)255;
}


x86 assembly (clang, -O0):
<make_white>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0xff,0x2(%rax)
mov    -0x8(%rbp),%rax
movb   $0xff,0x1(%rax)
mov    -0x8(%rbp),%rax
movb   $0xff,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_white>:
movb   $0xff,0x2(%rdi)
movw   $0xffff,(%rdi)
ret

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

LLVM IR (-O2):
define void @make_white(i8* nocapture writeonly %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 2
store i8 -1, i8* %2
%3 = getelementptr inbounds i8, i8* %0, i64 1
store i8 -1, i8* %3
store i8 -1, i8* %0
ret void
}
int __fstatfs64(int fd, struct statfs64 *buf) {}


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

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

LLVM IR (-O0):
%struct.statfs64 = type opaque
define i32 @__fstatfs64(i32 %0, %struct.statfs64* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.statfs64*
store i32 %0, i32* %4
store %struct.statfs64* %1, %struct.statfs64** %5
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
%struct.statfs64 = type opaque
define i32 @__fstatfs64(i32 %0, %struct.statfs64* nocapture readnone %1) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void bar(void) { printf("DSO bar\n"); }


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

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

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

LLVM IR (-O2):
@str = [8 x i8] c"DSO bar\00"
define void @bar() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0xe9() {
  Assert_real((ispunct(233) == 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_ispunct.c",
              1170, ("ispunct should be 0 for 0xe9"));
}


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

x86 assembly (clang, -O2):
<t_ispunct_0xe9>:
push   %rax
mov    $0xe9,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x492,%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_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0xe9\00"
define void @t_ispunct_0xe9() {
%1 = call i64 @ispunct(i32 233)
%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 1170, 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_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0xe9\00"
define void @t_ispunct_0xe9() {
%1 = tail call i64 @ispunct(i32 233)
%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 1170, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sh_vector_assign(void *, void *);
void sh_stack_assign(void *to, void *from) { sh_vector_assign(to, from); }


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

x86 assembly (clang, -O2):
<sh_stack_assign>:
jmp    1030 <sh_vector_assign@plt>

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

LLVM IR (-O2):
define void @sh_stack_assign(i8* %0, i8* %1) {
%3 = tail call i32 @sh_vector_assign(i8* %0, i8* %1)
ret void
}
int main() {
  int y;
  int *p;
  y = 10;
  y += 7;
  y = y & 10;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x7,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xa,%eax
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
store i32 0, i32* %1
store i32 10, i32* %2
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 7
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = and i32 %6, 10
store i32 %7, i32* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ info(char *);
int /*<<< orphan*/ menu();
void dummy2(void) {
  info("Appel de la fonction 2\n");
  menu();
}


x86 assembly (clang, -O0):
<dummy2>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <info@plt>
mov    $0x0,%al
call   1030 <menu@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<dummy2>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <info@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <menu@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"Appel de la fonction 2\0A\00"
define void @dummy2() {
%1 = call i32 @info(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @menu()
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"Appel de la fonction 2\0A\00"
define void @dummy2() {
%1 = tail call i32 @info(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @menu()
ret void
}