xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ set_ht_err_type(char *, int /*<<< orphan*/);
int main(int argc, char **argv) {
  char *path = "/sys/devices/pci0000:00/0000:00:18.0/config";
  set_ht_err_type(path, 0);
}


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

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

LLVM IR (-O0):
@.str = [44 x i8] c"/sys/devices/pci0000:00/0000:00:18.0/config\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i8*
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8** %5
%6 = load i8*, i8** %5
%7 = call i32 @set_ht_err_type(i8* %6, i32 0)
ret i32 0
}

LLVM IR (-O2):
@.str = [44 x i8] c"/sys/devices/pci0000:00/0000:00:18.0/config\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @set_ht_err_type(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 0
}
/* Variables and functions */
int EXIT_SUCCESS;
int bitcount(int);
int /*<<< orphan*/ printf(char *, int, int);
int main(void) {
  printf("%d %d\n", bitcount(10), bitcount(100));
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xa,%edi
call   1040 <bitcount@plt>
mov    %eax,-0x8(%rbp)
mov    $0x64,%edi
call   1040 <bitcount@plt>
mov    -0x8(%rbp),%esi
mov    %eax,%edx
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e82(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xa,%edi
call   1040 <bitcount@plt>
mov    %eax,%ebx
mov    $0x64,%edi
call   1040 <bitcount@plt>
lea    0xec2(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1030 <printf@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%d %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @bitcount(i32 10)
%2 = tail call i32 @bitcount(i32 100)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}
unsigned int sum16(unsigned char *crcptr, unsigned int crc_len) {
  unsigned int sum_temp = 0;
  unsigned int i;
  if (crcptr == 0x00)
    return 0;
  for (i = 0; i < crc_len; i++) {
    sum_temp = +*(crcptr + i);
  }
  return sum_temp;
}


x86 assembly (clang, -O0):
<sum16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1129 <sum16+0x29>
movl   $0x0,-0x4(%rbp)
jmp    115e <sum16+0x5e>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jae    1158 <sum16+0x58>
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
movzbl (%rax,%rcx,1),%eax
mov    %eax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1130 <sum16+0x30>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum16>:
xor    %eax,%eax
test   %rdi,%rdi
je     1112 <sum16+0x12>
test   %esi,%esi
je     1112 <sum16+0x12>
add    $0xffffffff,%esi
movzbl (%rdi,%rsi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @sum16(i8* %0, i32 %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne i32 %1, 0
%5 = and i1 %3, %4
br i1 %5, label %6, label %12
6: ; preds = %2
%7 = add i32 %1, -1
%8 = zext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
br label %12
12: ; preds = %6, %2
%13 = phi i32 [ 0, %2 ], [ %11, %6 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ move_cursor_right();
void cmd_right(const char *pf, char **args) { move_cursor_right(); }


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

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

LLVM IR (-O0):
define void @cmd_right(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
store i8* %0, i8** %3
store i8** %1, i8*** %4
%5 = call i32 (...) @move_cursor_right()
ret void
}

LLVM IR (-O2):
define void @cmd_right(i8* nocapture readnone %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @move_cursor_right()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
unsigned char *blake2s_file(unsigned char *, int /*<<< orphan*/ *,
                            int /*<<< orphan*/ *, int /*<<< orphan*/);
unsigned char *hash_file_blake2s(unsigned char *out, FILE *fp) {
  return blake2s_file(out, fp, NULL, 0);
}


x86 assembly (clang, -O0):
<hash_file_blake2s>:
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    %eax,%eax
mov    %eax,%edx
xor    %ecx,%ecx
call   1030 <blake2s_file@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_file_blake2s>:
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <blake2s_file@plt>

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

LLVM IR (-O2):
define i8* @hash_file_blake2s(i8* %0, i32* %1) {
%3 = tail call i8* @blake2s_file(i8* %0, i32* %1, i32* null, i32 0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ ERROR(char *, int);
void test_seq_alloc(char *seq, char *seqend) {
  if (seq >= seqend)
    ERROR("Not enough memory allocated for sequence", 1);
}


x86 assembly (clang, -O0):
<test_seq_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jb     113f <test_seq_alloc+0x2f>
lea    0xecb(%rip),%rdi
mov    $0x1,%esi
call   1030 <ERROR@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_seq_alloc>:
cmp    %rsi,%rdi
jae    1116 <test_seq_alloc+0x6>
ret
lea    0xee3(%rip),%rdi
mov    $0x1,%esi
jmp    1030 <ERROR@plt>

LLVM IR (-O0):
@.str = [41 x i8] c"Not enough memory allocated for sequence\00"
define void @test_seq_alloc(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 = icmp uge i8* %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @ERROR(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 1)
br label %10
10: ; preds = %8, %2
ret void
}

LLVM IR (-O2):
@.str = [41 x i8] c"Not enough memory allocated for sequence\00"
define void @test_seq_alloc(i8* readnone %0, i8* readnone %1) {
%3 = icmp ult i8* %0, %1
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @ERROR(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 1)
br label %6
6: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bzero(unsigned char *, int);
int f_b64_ntop_init(unsigned char *tailbuf, int *taillen, int *outlen) {
  bzero(tailbuf, 3);
  *taillen = 0;
  *outlen = 0;
  return 0;
}


x86 assembly (clang, -O0):
<f_b64_ntop_init>:
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    $0x3,%esi
call   1030 <bzero@plt>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_b64_ntop_init>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
mov    $0x3,%esi
call   1030 <bzero@plt>
movl   $0x0,(%rbx)
movl   $0x0,(%r14)
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @f_b64_ntop_init(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 = call i32 @bzero(i8* %7, i32 3)
%9 = load i32*, i32** %5
store i32 0, i32* %9
%10 = load i32*, i32** %6
store i32 0, i32* %10
ret i32 0
}

LLVM IR (-O2):
define i32 @f_b64_ntop_init(i8* nocapture writeonly %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
%4 = tail call i32 @bzero(i8* %0, i32 3)
store i32 0, i32* %1
store i32 0, i32* %2
ret i32 0
}
/* Variables and functions */
scalar_t__ COND_GT();
int /*<<< orphan*/ EA_AY_IX_8();
int /*<<< orphan*/ m68ki_write_8(int /*<<< orphan*/, int);
void m68k_op_sgt_8_ix(void) {
  m68ki_write_8(EA_AY_IX_8(), COND_GT() ? 0xff : 0);
}


x86 assembly (clang, -O0):
<m68k_op_sgt_8_ix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <EA_AY_IX_8@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <COND_GT@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rcx
xor    %esi,%esi
mov    $0xff,%eax
cmp    $0x0,%rcx
cmovne %eax,%esi
call   1050 <m68ki_write_8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_op_sgt_8_ix>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <EA_AY_IX_8@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <COND_GT@plt>
test   %rax,%rax
mov    $0xff,%esi
cmove  %ebp,%esi
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <m68ki_write_8@plt>

LLVM IR (-O0):
define void @m68k_op_sgt_8_ix() {
%1 = call i32 (...) @EA_AY_IX_8()
%2 = call i64 (...) @COND_GT()
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 255, i32 0
%6 = call i32 @m68ki_write_8(i32 %1, i32 %5)
ret void
}

LLVM IR (-O2):
define void @m68k_op_sgt_8_ix() {
%1 = tail call i32 (...) @EA_AY_IX_8()
%2 = tail call i64 (...) @COND_GT()
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 0, i32 255
%5 = tail call i32 @m68ki_write_8(i32 %1, i32 %4)
ret void
}
int to_dlx_row(const int row, const int col, const int num) {
  return (((row * 9) + col) * 9) + num;
}


x86 assembly (clang, -O0):
<to_dlx_row>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
imul   $0x9,-0x4(%rbp),%eax
add    -0x8(%rbp),%eax
imul   $0x9,%eax,%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_dlx_row>:
lea    (%rdi,%rdi,8),%eax
add    %esi,%eax
lea    (%rax,%rax,8),%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @to_dlx_row(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 = mul nsw i32 %7, 9
%9 = load i32, i32* %5
%10 = add nsw i32 %8, %9
%11 = mul nsw i32 %10, 9
%12 = load i32, i32* %6
%13 = add nsw i32 %11, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @to_dlx_row(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %0, 9
%5 = add nsw i32 %4, %1
%6 = mul nsw i32 %5, 9
%7 = add nsw i32 %6, %2
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main() { printf("Hello, world!"); }


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

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

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

LLVM IR (-O2):
@.str = [14 x i8] c"Hello, world!\00"
define void @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x19() {
  Assert_real((isbdigit(25) == 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_isbdigit.c",
              130, ("isbdigit should be 0 for 0x19"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0x19>:
push   %rax
mov    $0x19,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x82,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0x19\00"
define void @t_isbdigit_0x19() {
%1 = call i64 @isbdigit(i32 25)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 130, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0x19\00"
define void @t_isbdigit_0x19() {
%1 = tail call i64 @isbdigit(i32 25)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 130, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ logger_fatal(char *);
scalar_t__ process_create(char *);
int /*<<< orphan*/ process_switch();
int /*<<< orphan*/ system_halt();
int /*<<< orphan*/ system_init();
void run_init(void) {
  system_init();
  if (process_create("/sbin/init") < 0) {
    logger_fatal("could not create process");
    system_halt();
  }
  process_switch();
}


x86 assembly (clang, -O0):
<run_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <system_init@plt>
lea    0xe9e(%rip),%rdi
call   1040 <process_create@plt>
cmp    $0x0,%rax
jge    1184 <run_init+0x34>
lea    0xe93(%rip),%rdi
call   1060 <logger_fatal@plt>
mov    $0x0,%al
call   1070 <system_halt@plt>
mov    $0x0,%al
call   1030 <process_switch@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<run_init>:
push   %rax
xor    %eax,%eax
call   1050 <system_init@plt>
lea    0xea1(%rip),%rdi
call   1040 <process_create@plt>
test   %rax,%rax
jns    117c <run_init+0x2c>
lea    0xe9b(%rip),%rdi
call   1060 <logger_fatal@plt>
xor    %eax,%eax
call   1070 <system_halt@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <process_switch@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"/sbin/init\00"
@.str.1 = [25 x i8] c"could not create process\00"
define void @run_init() {
%1 = call i32 (...) @system_init()
%2 = call i64 @process_create(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = call i32 @logger_fatal(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (...) @system_halt()
br label %7
7: ; preds = %4, %0
%8 = call i32 (...) @process_switch()
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"/sbin/init\00"
@.str.1 = [25 x i8] c"could not create process\00"
define void @run_init() {
%1 = tail call i32 (...) @system_init()
%2 = tail call i64 @process_create(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = tail call i32 @logger_fatal(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 (...) @system_halt()
br label %7
7: ; preds = %4, %0
%8 = tail call i32 (...) @process_switch()
ret void
}
int str_empty(const char *str) { return (!str || *str == '\0'); }


x86 assembly (clang, -O0):
<str_empty>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%al
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1128 <str_empty+0x28>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_empty>:
test   %rdi,%rdi
je     110e <str_empty+0xe>
xor    %eax,%eax
cmpb   $0x0,(%rdi)
sete   %al
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @str_empty(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 1, %1 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M585_f(char *s) {
  debug("M585_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M585_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M585_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M585_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M585_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M585_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M585_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_usage_details(void) {
  printf("simple_rcp - Remote Copy Client and Server\n");
  printf("Usage details:\n");
  printf("To start a server: simple_rcp --start-server [--port=XXXX]\n");
  printf("To start a client: simple_rcp [--port=XXXX] SOURCE [host:]DEST \n");
}


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

x86 assembly (clang, -O2):
<print_usage_details>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf07(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0a(%rip),%rdi
call   1030 <puts@plt>
lea    0xf39(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [44 x i8] c"simple_rcp - Remote Copy Client and Server\0A\00"
@.str.1 = [16 x i8] c"Usage details:\0A\00"
@.str.2 = [60 x i8] c"To start a server: simple_rcp --start-server [--port=XXXX]\0A\00"
@.str.3 = [65 x i8] c"To start a client: simple_rcp [--port=XXXX] SOURCE [host:]DEST \0A\00"
define void @print_usage_details() {
%1 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [43 x i8] c"simple_rcp - Remote Copy Client and Server\00"
@str.4 = [15 x i8] c"Usage details:\00"
@str.5 = [59 x i8] c"To start a server: simple_rcp --start-server [--port=XXXX]\00"
@str.6 = [64 x i8] c"To start a client: simple_rcp [--port=XXXX] SOURCE [host:]DEST \00"
define void @print_usage_details() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @str.6, i64 0, i64 0))
ret void
}
int make_state() {}


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

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

LLVM IR (-O0):
define i32 @make_state() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @make_state() {
ret i32 undef
}
/* Variables and functions */
long atol(char *);
char *opts_gets(char const);
long opts_geti(const char opt) {
  char *str = opts_gets(opt);
  return (str ? atol(str) : 0);
}


x86 assembly (clang, -O0):
<opts_geti>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <opts_gets@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1158 <opts_geti+0x38>
mov    -0x10(%rbp),%rdi
call   1040 <atol@plt>
mov    %rax,-0x18(%rbp)
jmp    1163 <opts_geti+0x43>
xor    %eax,%eax
mov    %rax,-0x18(%rbp)
jmp    1163 <opts_geti+0x43>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opts_geti>:
push   %rax
call   1030 <opts_gets@plt>
test   %rax,%rax
je     1134 <opts_geti+0x14>
mov    %rax,%rdi
pop    %rax
jmp    1040 <atol@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @opts_geti(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8*
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = call i8* @opts_gets(i8 signext %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i64 @atol(i8* %9)
br label %12
11: ; preds = %1
br label %12
12: ; preds = %11, %8
%13 = phi i64 [ %10, %8 ], [ 0, %11 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @opts_geti(i8 signext %0) {
%2 = tail call i8* @opts_gets(i8 signext %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i64 @atol(i8* %2)
br label %6
6: ; preds = %1, %4
%7 = phi i64 [ %5, %4 ], [ 0, %1 ]
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: verify [ -t ] pchk-file decoded-file [ gen-file [ "
                  "source-file ] ]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [74 x i8] c"Usage: verify [ -t ] pchk-file decoded-file [ gen-file [ source-file ] ]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [74 x i8] c"Usage: verify [ -t ] pchk-file decoded-file [ gen-file [ source-file ] ]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ matNf_copy(float *, float const *, int);
void mat4f_copy(float dest[16], const float src[16]) {
  matNf_copy(dest, src, 4);
}


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

x86 assembly (clang, -O2):
<mat4f_copy>:
mov    $0x4,%edx
jmp    1030 <matNf_copy@plt>

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

LLVM IR (-O2):
define void @mat4f_copy(float* %0, float* %1) {
%3 = tail call i32 @matNf_copy(float* %0, float* %1, i32 4)
ret void
}
int kgsl_mmu_unmap(struct kgsl_pagetable *pagetable,
                   struct kgsl_memdesc *memdesc) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.kgsl_pagetable = type opaque
%struct.kgsl_memdesc = type opaque
define i32 @kgsl_mmu_unmap(%struct.kgsl_pagetable* %0, %struct.kgsl_memdesc* %1) {
%3 = alloca %struct.kgsl_pagetable*
%4 = alloca %struct.kgsl_memdesc*
store %struct.kgsl_pagetable* %0, %struct.kgsl_pagetable** %3
store %struct.kgsl_memdesc* %1, %struct.kgsl_memdesc** %4
ret i32 0
}

LLVM IR (-O2):
%struct.kgsl_pagetable = type opaque
%struct.kgsl_memdesc = type opaque
define i32 @kgsl_mmu_unmap(%struct.kgsl_pagetable* nocapture readnone %0, %struct.kgsl_memdesc* nocapture readnone %1) {
ret i32 0
}
int inner_method() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @inner_method() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main2() {
  printf("Hello from Nios II!\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"Hello from Nios II!\0A\00"
define i32 @main2() {
%1 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [20 x i8] c"Hello from Nios II!\00"
define i32 @main2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void *threadFunc(void *arg) {
  char *s = (char *)arg;
  printf("\n %s: \n", __func__);
  printf("%s", s);
  return (void *)strlen(s);
}


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

x86 assembly (clang, -O2):
<threadFunc>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
lea    0xed6(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed3(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <strlen@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"\0A %s: \0A\00"
@__func__.threadFunc = [11 x i8] c"threadFunc\00"
@.str.1 = [3 x i8] c"%s\00"
define i8* @threadFunc(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__func__.threadFunc, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}
/* Variables and functions */
void *__memcpy_glibc_2_2_5(void *, void const *, size_t);
void *__wrap_memcpy(void *dest, const void *src, size_t n) {
  return __memcpy_glibc_2_2_5(dest, src, n);
}


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

x86 assembly (clang, -O2):
<__wrap_memcpy>:
jmp    1030 <__memcpy_glibc_2_2_5@plt>

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

LLVM IR (-O2):
define i8* @__wrap_memcpy(i8* %0, i8* %1, i64 %2) {
%4 = tail call i8* @__memcpy_glibc_2_2_5(i8* %0, i8* %1, i64 %2)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, int, int);
int main(void) {
  int ultra = 0, super = 0;
  while (super < 5) {
    super++;
    ++ultra;
    printf("super = %d, ultra = %d\n", super, ultra);
  }
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jge    1170 <main+0x50>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
jmp    113d <main+0x1d>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x2,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x3,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x4,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
mov    $0x5,%edx
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [24 x i8] c"super = %d, ultra = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 1, i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 2, i32 2)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 3, i32 3)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 4, i32 4)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 5, i32 5)
%6 = tail call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
int /*<<< orphan*/ printid(int);
int main() {
  int c;
  char mm[2] = {'a', 'b'};
  c = mm[1] < mm[0];
  print("c 0");
  printid(c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%ax
mov    %ax,-0xa(%rbp)
movsbl -0x9(%rbp),%eax
movsbl -0xa(%rbp),%ecx
cmp    %ecx,%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
lea    0xeac(%rip),%rdi
call   1030 <print@plt>
mov    -0x8(%rbp),%edi
call   1040 <printid@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.mm = [2 x i8] c"ab"
@.str = [4 x i8] c"c 0\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [2 x i8]
store i32 0, i32* %1
%4 = bitcast [2 x i8]* %3 to i8*
%5 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp slt i32 %7, %10
%12 = zext i1 %11 to i32
store i32 %12, i32* %2
%13 = call i32 @print(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%14 = load i32, i32* %2
%15 = call i32 @printid(i32 %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"c 0\00"
define i32 @main() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printid(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ check(char const *, int, char const *);
void check_match(char const *re, char const *text) { check(re, 1, text); }


x86 assembly (clang, -O0):
<check_match>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x1,%esi
call   1030 <check@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_match>:
mov    %rsi,%rdx
mov    $0x1,%esi
jmp    1030 <check@plt>

LLVM IR (-O0):
define void @check_match(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 @check(i8* %5, i32 1, i8* %6)
ret void
}

LLVM IR (-O2):
define void @check_match(i8* %0, i8* %1) {
%3 = tail call i32 @check(i8* %0, i32 1, i8* %1)
ret void
}
/* Variables and functions */
scalar_t__ Init();
int MainLoop();
int /*<<< orphan*/ ServerDebug(char *);
int /*<<< orphan*/ TidyUp();
int Server() {
  int i = 0;
  if (Init())
    i = MainLoop();
  else
    ServerDebug("Server unable to initialise.");
  TidyUp();
  return (i);
}


x86 assembly (clang, -O0):
<Server>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <Init@plt>
cmp    $0x0,%rax
je     116f <Server+0x2f>
mov    $0x0,%al
call   1030 <MainLoop@plt>
mov    %eax,-0x4(%rbp)
jmp    117b <Server+0x3b>
lea    0xe8a(%rip),%rdi
call   1060 <ServerDebug@plt>
mov    $0x0,%al
call   1050 <TidyUp@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Server>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <Init@plt>
test   %rax,%rax
je     115a <Server+0x1a>
xor    %eax,%eax
call   1030 <MainLoop@plt>
mov    %eax,%ebx
jmp    1166 <Server+0x26>
lea    0xe9f(%rip),%rdi
call   1060 <ServerDebug@plt>
xor    %eax,%eax
call   1050 <TidyUp@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"Server unable to initialise.\00"
define i32 @Server() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @Init()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @MainLoop()
store i32 %5, i32* %1
br label %8
6: ; preds = %0
%7 = call i32 @ServerDebug(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %4
%9 = call i32 (...) @TidyUp()
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
@.str = [29 x i8] c"Server unable to initialise.\00"
define i32 @Server() {
%1 = tail call i64 (...) @Init()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @MainLoop()
br label %7
5: ; preds = %0
%6 = tail call i32 @ServerDebug(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
%8 = phi i32 [ %4, %3 ], [ 0, %5 ]
%9 = tail call i32 (...) @TidyUp()
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ drawtext(int, int, int /*<<< orphan*/);
int /*<<< orphan*/ ftoa(float);
void drawnum(int x, int y, float n) { drawtext(x, y, ftoa(n)); }


x86 assembly (clang, -O0):
<drawnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
call   1040 <ftoa@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    %eax,%edx
call   1030 <drawtext@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawnum>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1040 <ftoa@plt>
mov    %ebp,%edi
mov    %ebx,%esi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <drawtext@plt>

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

LLVM IR (-O2):
define void @drawnum(i32 %0, i32 %1, float %2) {
%4 = tail call i32 @ftoa(float %2)
%5 = tail call i32 @drawtext(i32 %0, i32 %1, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GeneratePrimes(char *);
int main() { GeneratePrimes("primes"); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"primes\00"
define i32 @main() {
%1 = call i32 @GeneratePrimes(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"primes\00"
define i32 @main() {
%1 = tail call i32 @GeneratePrimes(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void empty_function() {}


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

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

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

LLVM IR (-O2):
define void @empty_function() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char *, int);
int colemak(char layout[][96], int i) {
  strncpy(layout[i],
          " 1234567890-=qwfpgjluy;[]\\arstdhneio'zxcvbkm,./"
          "!@#$%^&*()_+QWFPGJLUY:{}|ARSTDHNEIO\"ZXCVBXM<>?",
          96);
  return 85;
}


x86 assembly (clang, -O0):
<colemak>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
imul   $0x60,%rax,%rax
add    %rax,%rdi
lea    0xecb(%rip),%rsi
mov    $0x60,%edx
call   1030 <strncpy@plt>
mov    $0x55,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<colemak>:
push   %rax
movslq %esi,%rax
lea    (%rax,%rax,2),%rax
shl    $0x5,%rax
add    %rax,%rdi
lea    0xeda(%rip),%rsi
mov    $0x60,%edx
call   1030 <strncpy@plt>
mov    $0x55,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [94 x i8] c" 1234567890-=qwfpgjluy;[]\\arstdhneio'zxcvbkm,./!@#$%^&*()_+QWFPGJLUY:{}|ARSTDHNEIO\22ZXCVBXM<>?\00"
define i32 @colemak([96 x i8]* %0, i32 %1) {
%3 = alloca [96 x i8]*
%4 = alloca i32
store [96 x i8]* %0, [96 x i8]** %3
store i32 %1, i32* %4
%5 = load [96 x i8]*, [96 x i8]** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [96 x i8], [96 x i8]* %5, i64 %7
%9 = getelementptr inbounds [96 x i8], [96 x i8]* %8, i64 0, i64 0
%10 = call i32 @strncpy(i8* %9, i8* getelementptr inbounds ([94 x i8], [94 x i8]* @.str, i64 0, i64 0), i32 96)
ret i32 85
}

LLVM IR (-O2):
@.str = [94 x i8] c" 1234567890-=qwfpgjluy;[]\\arstdhneio'zxcvbkm,./!@#$%^&*()_+QWFPGJLUY:{}|ARSTDHNEIO\22ZXCVBXM<>?\00"
define i32 @colemak([96 x i8]* %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds [96 x i8], [96 x i8]* %0, i64 %3, i64 0
%5 = tail call i32 @strncpy(i8* %4, i8* getelementptr inbounds ([94 x i8], [94 x i8]* @.str, i64 0, i64 0), i32 96)
ret i32 85
}
void init_fdct(void) {
  signed int i;
  signed int j;
  double s;
}


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

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

LLVM IR (-O0):
define void @init_fdct() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
ret void
}

LLVM IR (-O2):
define void @init_fdct() {
ret void
}
unsigned char pow_2(int j) {
  int k = 1;
  k = k << j;
  return k;
}


x86 assembly (clang, -O0):
<pow_2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
shl    %cl,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pow_2>:
mov    %edi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
ret

LLVM IR (-O0):
define zeroext i8 @pow_2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
%4 = load i32, i32* %3
%5 = load i32, i32* %2
%6 = shl i32 %4, %5
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = trunc i32 %7 to i8
ret i8 %8
}

LLVM IR (-O2):
define zeroext i8 @pow_2(i32 %0) {
%2 = shl nuw i32 1, %0
%3 = trunc i32 %2 to i8
ret i8 %3
}
void yy_2_MagicWordAutoCorrect(char *yytext, int yyleng) {
  ;
  ;
}


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

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

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

LLVM IR (-O2):
define void @yy_2_MagicWordAutoCorrect(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int strlen(const char *src) {
  int nr_char = 0;
  while (*src) {
    src++;
    nr_char++;
  }
  return nr_char;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1136 <strlen+0x36>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,(%rdi)
je     111c <strlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

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

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