xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ is_builtin(char *);
int /*<<< orphan*/ printf(char *, char *, int);
int test_is_builtin(void) {
  if (!is_builtin(L"floor")) {
    printf("Failed in %s, line %d\n",
           "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/rscarson/Lavendeux/refs/heads/master/"
           "tests/builtins.c",
           30);
    return 1;
  };
  ;
  return 0;
}


x86 assembly (clang, -O0):
<test_is_builtin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1040 <is_builtin@plt>
cmp    $0x0,%eax
jne    1161 <test_is_builtin+0x41>
lea    0xed4(%rip),%rdi
lea    0xee4(%rip),%rsi
mov    $0x1e,%edx
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1168 <test_is_builtin+0x48>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_is_builtin>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <is_builtin@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
je     1137 <test_is_builtin+0x17>
pop    %rcx
ret
lea    0xeda(%rip),%rdi
lea    0xeea(%rip),%rsi
mov    $0x1e,%edx
call   1030 <printf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i32] [i32 102, i32 108, i32 111, i32 111, i32 114, i32 0]
@.str.1 = [23 x i8] c"Failed in %s, line %d\0A\00"
@.str.2 = [144 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/rscarson/Lavendeux/refs/heads/master/tests/builtins.c\00"
define i32 @test_is_builtin() {
%1 = alloca i32
%2 = call i32 @is_builtin(i8* bitcast ([6 x i32]* @.str to i8*))
%3 = icmp ne i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str.2, i64 0, i64 0), i32 30)
store i32 1, i32* %1
br label %7
6: ; preds = %0
store i32 0, i32* %1
br label %7
7: ; preds = %6, %4
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
@.str = [6 x i32] [i32 102, i32 108, i32 111, i32 111, i32 114, i32 0]
@.str.1 = [23 x i8] c"Failed in %s, line %d\0A\00"
@.str.2 = [144 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/rscarson/Lavendeux/refs/heads/master/tests/builtins.c\00"
define i32 @test_is_builtin() {
%1 = tail call i32 @is_builtin(i8* bitcast ([6 x i32]* @.str to i8*))
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str.2, i64 0, i64 0), i32 30)
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ 1, %3 ], [ 0, %0 ]
ret i32 %6
}
/* Variables and functions */
void ensure_ascii_null_terminated(char *buf, size_t buf_size) {
  if (buf_size <= 0)
    return;
  buf[buf_size - 1] = 0;
}


x86 assembly (clang, -O0):
<ensure_ascii_null_terminated>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
ja     111c <ensure_ascii_null_terminated+0x1c>
jmp    112c <ensure_ascii_null_terminated+0x2c>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ensure_ascii_null_terminated>:
test   %rsi,%rsi
je     110a <ensure_ascii_null_terminated+0xa>
movb   $0x0,-0x1(%rsi,%rdi,1)
ret

LLVM IR (-O0):
define void @ensure_ascii_null_terminated(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = icmp ule i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %2
br label %13
8: ; preds = %2
%9 = load i8*, i8** %3
%10 = load i64, i64* %4
%11 = sub i64 %10, 1
%12 = getelementptr inbounds i8, i8* %9, i64 %11
store i8 0, i8* %12
br label %13
13: ; preds = %8, %7
ret void
}

LLVM IR (-O2):
define void @ensure_ascii_null_terminated(i8* nocapture writeonly %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = add i64 %1, -1
%6 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 0, i8* %6
br label %7
7: ; preds = %2, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void version(void) {
  puts("detab - expand tabs into spaces");
  puts("Version 1.0");
  puts("Written by Gregory Pietsch");
}


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

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

LLVM IR (-O0):
@.str = [32 x i8] c"detab - expand tabs into spaces\00"
@.str.1 = [12 x i8] c"Version 1.0\00"
@.str.2 = [27 x i8] c"Written by Gregory Pietsch\00"
define void @version() {
%1 = call i32 @puts(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @puts(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @puts(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"detab - expand tabs into spaces\00"
@.str.1 = [12 x i8] c"Version 1.0\00"
@.str.2 = [27 x i8] c"Written by Gregory Pietsch\00"
define void @version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, int);
int read(int, struct stat *, int);
int /*<<< orphan*/ stderr;
int ReadStat(int bfd, struct stat *inode) {
  int rbytes = 0;
  if ((rbytes = read(bfd, inode, sizeof(struct stat))) != sizeof(struct stat)) {
    fprintf(stderr, "%i vs. %l\n", rbytes, sizeof(struct stat));
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<ReadStat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1030 <read@plt>
mov    %eax,-0x14(%rbp)
cltq
cmp    $0x4,%rax
je     117f <ReadStat+0x5f>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
mov    -0x14(%rbp),%edx
lea    0xe97(%rip),%rsi
mov    $0x4,%ecx
call   1040 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1186 <ReadStat+0x66>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReadStat>:
push   %rax
mov    $0x4,%edx
call   1030 <read@plt>
mov    $0x1,%ecx
cmp    $0x4,%eax
je     1153 <ReadStat+0x33>
mov    0x2ea4(%rip),%rcx
mov    (%rcx),%edi
lea    0xebb(%rip),%rsi
mov    %eax,%edx
mov    $0x4,%ecx
call   1040 <fprintf@plt>
xor    %ecx,%ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@stderr = global i32 0
@.str = [11 x i8] c"%i vs. %l\0A\00"
define i32 @ReadStat(i32 %0, %struct.stat* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.stat*
%6 = alloca i32
store i32 %0, i32* %4
store %struct.stat* %1, %struct.stat** %5
store i32 0, i32* %6
%7 = load i32, i32* %4
%8 = load %struct.stat*, %struct.stat** %5
%9 = call i32 @read(i32 %7, %struct.stat* %8, i32 4)
store i32 %9, i32* %6
%10 = sext i32 %9 to i64
%11 = icmp ne i64 %10, 4
br i1 %11, label %12, label %16
12: ; preds = %2
%13 = load i32, i32* @stderr
%14 = load i32, i32* %6
%15 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %14, i32 4)
store i32 0, i32* %3
br label %17
16: ; preds = %2
store i32 1, i32* %3
br label %17
17: ; preds = %16, %12
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@stderr = global i32 0
@.str = [11 x i8] c"%i vs. %l\0A\00"
define i32 @ReadStat(i32 %0, %struct.stat* nocapture %1) {
%3 = tail call i32 @read(i32 %0, %struct.stat* %1, i32 4)
%4 = icmp eq i32 %3, 4
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %3, i32 4)
br label %8
8: ; preds = %2, %5
%9 = phi i32 [ 0, %5 ], [ 1, %2 ]
ret i32 %9
}
void foo6c() {}


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

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

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

LLVM IR (-O2):
define void @foo6c() {
ret void
}
/* Variables and functions */
void bootloader_ana_super_wdt_reset_config(bool enable) { (void)enable; }


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

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

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

LLVM IR (-O2):
define void @bootloader_ana_super_wdt_reset_config(i32 %0) {
ret void
}
strequ(str1, str2) char *str1, *str2;
{
  register char *rstr1, *rstr2;
  rstr1 = str1;
  rstr2 = str2;
  while (*rstr1 == *rstr2++)
    if (*rstr1++ == 0)
      return (1);
  return (0);
}


x86 assembly (clang, -O0):
<strequ>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
mov    -0x28(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x28(%rbp)
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1169 <strequ+0x69>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1164 <strequ+0x64>
movl   $0x1,-0x4(%rbp)
jmp    1170 <strequ+0x70>
jmp    111c <strequ+0x1c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strequ>:
xor    %eax,%eax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl (%rdi,%rcx,1),%edx
cmp    (%rsi,%rcx,1),%dl
jne    1126 <strequ+0x26>
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strequ+0x10>
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @strequ(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %9, %2
%4 = phi i8* [ %0, %2 ], [ %11, %9 ]
%5 = phi i8* [ %1, %2 ], [ %10, %9 ]
%6 = load i8, i8* %4
%7 = load i8, i8* %5
%8 = icmp eq i8 %6, %7
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = getelementptr inbounds i8, i8* %5, i64 1
%11 = getelementptr inbounds i8, i8* %4, i64 1
%12 = icmp eq i8 %6, 0
br i1 %12, label %13, label %3
13: ; preds = %3, %9
%14 = phi i32 [ 1, %9 ], [ 0, %3 ]
ret i32 %14
}
/* Variables and functions */
int gpi_exif_get_lilend(unsigned char *, int);
int gpe_theval(unsigned char *data, int tagind) {
  return (gpi_exif_get_lilend(data + tagind * 12 + 10, 4));
}


x86 assembly (clang, -O0):
<gpe_theval>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
imul   $0xc,-0xc(%rbp),%eax
cltq
add    %rax,%rdi
add    $0xa,%rdi
mov    $0x4,%esi
call   1030 <gpi_exif_get_lilend@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gpe_theval>:
shl    $0x2,%esi
lea    (%rsi,%rsi,2),%eax
cltq
add    %rax,%rdi
add    $0xa,%rdi
mov    $0x4,%esi
jmp    1030 <gpi_exif_get_lilend@plt>

LLVM IR (-O0):
define i32 @gpe_theval(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 = mul nsw i32 %6, 12
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %5, i64 %8
%10 = getelementptr inbounds i8, i8* %9, i64 10
%11 = call i32 @gpi_exif_get_lilend(i8* %10, i32 4)
ret i32 %11
}

LLVM IR (-O2):
define i32 @gpe_theval(i8* %0, i32 %1) {
%3 = mul nsw i32 %1, 12
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = getelementptr inbounds i8, i8* %5, i64 10
%7 = tail call i32 @gpi_exif_get_lilend(i8* %6, i32 4)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ send_then_recv(int, char, char *);
void update_nodes(int devfd) { send_then_recv(devfd, 'E', ">UP"); }


x86 assembly (clang, -O0):
<update_nodes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x45,%esi
lea    0xed6(%rip),%rdx
call   1030 <send_then_recv@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<update_nodes>:
lea    0xee9(%rip),%rdx
mov    $0x45,%esi
jmp    1030 <send_then_recv@plt>

LLVM IR (-O0):
@.str = [4 x i8] c">UP\00"
define void @update_nodes(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @send_then_recv(i32 %3, i8 signext 69, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c">UP\00"
define void @update_nodes(i32 %0) {
%2 = tail call i32 @send_then_recv(i32 %0, i8 signext 69, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
void set_number(short *board, int x, int y, short value) {
  *(board + ((y << 2) + x)) = value;
}


x86 assembly (clang, -O0):
<set_number>:
push   %rbp
mov    %rsp,%rbp
mov    %cx,%ax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ax,-0x12(%rbp)
mov    -0x12(%rbp),%dx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
shl    $0x2,%ecx
add    -0xc(%rbp),%ecx
movslq %ecx,%rcx
mov    %dx,(%rax,%rcx,2)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_number>:
lea    (%rsi,%rdx,4),%eax
cltq
mov    %cx,(%rdi,%rax,2)
ret

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

LLVM IR (-O2):
define void @set_number(i16* nocapture writeonly %0, i32 %1, i32 %2, i16 signext %3) {
%5 = shl i32 %2, 2
%6 = add nsw i32 %5, %1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i16, i16* %0, i64 %7
store i16 %3, i16* %8
ret void
}
/* Variables and functions */
long double factorial(unsigned int);
long double combination(unsigned k, unsigned n) {
  long double f = (factorial(n) / (factorial(k) * factorial(n - k)));
  return f;
}


x86 assembly (clang, -O0):
<combination>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <factorial@plt>
fstpt  -0x2c(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <factorial@plt>
fstpt  -0x38(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%eax
sub    %eax,%edi
call   1030 <factorial@plt>
fldt   -0x38(%rbp)
fldt   -0x2c(%rbp)
fxch   %st(1)
fmulp  %st,%st(2)
fdivp  %st,%st(1)
fstpt  -0x20(%rbp)
fldt   -0x20(%rbp)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<combination>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
mov    %esi,%ebx
mov    %edi,%ebp
mov    %esi,%edi
call   1030 <factorial@plt>
fstpt  0xc(%rsp)
mov    %ebp,%edi
call   1030 <factorial@plt>
fstpt  (%rsp)
sub    %ebp,%ebx
mov    %ebx,%edi
call   1030 <factorial@plt>
fldt   (%rsp)
fmulp  %st,%st(1)
fldt   0xc(%rsp)
fdivp  %st,%st(1)
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define x86_fp80 @combination(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca x86_fp80
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = call x86_fp80 @factorial(i32 %6)
%8 = load i32, i32* %3
%9 = call x86_fp80 @factorial(i32 %8)
%10 = load i32, i32* %4
%11 = load i32, i32* %3
%12 = sub i32 %10, %11
%13 = call x86_fp80 @factorial(i32 %12)
%14 = fmul x86_fp80 %9, %13
%15 = fdiv x86_fp80 %7, %14
store x86_fp80 %15, x86_fp80* %5
%16 = load x86_fp80, x86_fp80* %5
ret x86_fp80 %16
}

LLVM IR (-O2):
define x86_fp80 @combination(i32 %0, i32 %1) {
%3 = tail call x86_fp80 @factorial(i32 %1)
%4 = tail call x86_fp80 @factorial(i32 %0)
%5 = sub i32 %1, %0
%6 = tail call x86_fp80 @factorial(i32 %5)
%7 = fmul x86_fp80 %4, %6
%8 = fdiv x86_fp80 %3, %7
ret x86_fp80 %8
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void set_rclk(uint32_t rclk) {
  if (rclk == 0) {
    (*((volatile uint32_t *)0xE0200C04)) &= ~(0x04);
  } else {
    (*((volatile uint32_t *)0xE0200C04)) |= 0x04;
  }
}


x86 assembly (clang, -O0):
<set_rclk>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <set_rclk+0x2c>
mov    $0xe0200c04,%eax
mov    (%rax),%rcx
and    $0xfffffffffffffffb,%rcx
mov    $0xe0200c04,%eax
mov    %rcx,(%rax)
jmp    1140 <set_rclk+0x40>
mov    $0xe0200c04,%eax
mov    (%rax),%rcx
or     $0x4,%rcx
mov    $0xe0200c04,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_rclk>:
xor    %eax,%eax
test   %rdi,%rdi
setne  %al
mov    $0xe0200c04,%ecx
mov    (%rcx),%rdx
and    $0xfffffffffffffffb,%rdx
lea    (%rdx,%rax,4),%rax
mov    %rax,(%rcx)
ret

LLVM IR (-O0):
define void @set_rclk(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load volatile i64, i64* inttoptr (i64 3760196612 to i64*)
%7 = and i64 %6, -5
store volatile i64 %7, i64* inttoptr (i64 3760196612 to i64*)
br label %11
8: ; preds = %1
%9 = load volatile i64, i64* inttoptr (i64 3760196612 to i64*)
%10 = or i64 %9, 4
store volatile i64 %10, i64* inttoptr (i64 3760196612 to i64*)
br label %11
11: ; preds = %8, %5
ret void
}

LLVM IR (-O2):
define void @set_rclk(i64 %0) {
%2 = icmp eq i64 %0, 0
%3 = load volatile i64, i64* inttoptr (i64 3760196612 to i64*)
%4 = and i64 %3, -5
%5 = select i1 %2, i64 0, i64 4
%6 = or i64 %4, %5
store volatile i64 %6, i64* inttoptr (i64 3760196612 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int V1 = 9 + 7;
  printf("%d %d\n", V1, 11);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x10,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xed7(%rip),%rdi
mov    $0xb,%edx
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    $0x10,%esi
mov    $0xb,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 16, i32 11)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ boardCoardStringEqual(char *, char *);
void longStringChompedInBoardCoordString(void) {
  boardCoardStringEqual("abcd", "abc");
}


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

x86 assembly (clang, -O2):
<longStringChompedInBoardCoordString>:
lea    0xee9(%rip),%rdi
lea    0xee7(%rip),%rsi
jmp    1030 <boardCoardStringEqual@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"abcd\00"
@.str.1 = [4 x i8] c"abc\00"
define void @longStringChompedInBoardCoordString() {
%1 = call i32 @boardCoardStringEqual(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"abcd\00"
@.str.1 = [4 x i8] c"abc\00"
define void @longStringChompedInBoardCoordString() {
%1 = tail call i32 @boardCoardStringEqual(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ TCIOFLUSH;
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ tcflush(int, int /*<<< orphan*/);
void serial_discard(int fd) {
  if (0)
    printf("serial_discard()\n");
  tcflush(fd, TCIOFLUSH);
}


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

x86 assembly (clang, -O2):
<serial_discard>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <tcflush@plt>

LLVM IR (-O0):
@TCIOFLUSH = global i32 0
define void @serial_discard(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @TCIOFLUSH
%5 = call i32 @tcflush(i32 %3, i32 %4)
ret void
}

LLVM IR (-O2):
@TCIOFLUSH = global i32 0
define void @serial_discard(i32 %0) {
%2 = load i32, i32* @TCIOFLUSH
%3 = tail call i32 @tcflush(i32 %0, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ game();
int /*<<< orphan*/ waitvblank();
void main() {
  for (;;) {
    game();
    waitvblank();
    waitvblank();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <main+0x9>
mov    $0x0,%al
call   1040 <game@plt>
mov    $0x0,%al
call   1030 <waitvblank@plt>
mov    $0x0,%al
call   1030 <waitvblank@plt>
jmp    1129 <main+0x9>

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <game@plt>
xor    %eax,%eax
call   1030 <waitvblank@plt>
xor    %eax,%eax
call   1030 <waitvblank@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
define void @main() {
br label %1
1: ; preds = %1, %0
%2 = call i32 (...) @game()
%3 = call i32 (...) @waitvblank()
%4 = call i32 (...) @waitvblank()
br label %1
}

LLVM IR (-O2):
define void @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @game()
%3 = tail call i32 (...) @waitvblank()
%4 = tail call i32 (...) @waitvblank()
br label %1
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_size;
};
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
off_t posix_stat_st_size(const struct stat *st) { return st->st_size; }


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

x86 assembly (clang, -O2):
<posix_stat_st_size>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @posix_stat_st_size(%struct.stat* %0) {
%2 = alloca %struct.stat*
store %struct.stat* %0, %struct.stat** %2
%3 = load %struct.stat*, %struct.stat** %2
%4 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @posix_stat_st_size(%struct.stat* nocapture %0) {
%2 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 0
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ execvp(char *, char **);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  if (argc == 1)
    exit(0);
  execvp(argv[1], &argv[1]);
  printf("Can`t run process!\n");
  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)
cmpl   $0x1,-0x8(%rbp)
jne    1157 <main+0x27>
xor    %edi,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rsi
add    $0x8,%rsi
call   1040 <execvp@plt>
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
je     1153 <main+0x23>
mov    0x8(%rsi),%rdi
add    $0x8,%rsi
call   1040 <execvp@plt>
lea    0xeb6(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"Can`t run process!\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 = load i32, i32* %4
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @exit(i32 0)
unreachable
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = call i32 @execvp(i8* %13, i8** %15)
%17 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [19 x i8] c"Can`t run process!\00"
define i32 @main(i32 %0, i8** %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @exit(i32 0)
unreachable
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @execvp(i8* %8, i8** %7)
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret i32 0
}
char *(cstrcpy)(char *s1, const char *s2) {
  char *dst = s1;
  const char *src = s2;
  while ((*dst++ = *src++) != '\0')
    ;
  return s1;
}


x86 assembly (clang, -O0):
<cstrcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
mov    (%rax),%al
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     114f <cstrcpy+0x4f>
jmp    111c <cstrcpy+0x1c>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cstrcpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <cstrcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @cstrcpy(i8* returned writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %8, %3 ]
%5 = phi i8* [ %1, %2 ], [ %6, %3 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %5
%8 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %7, i8* %4
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %0
}
int Int_bit_MINUS_or(int x, int y) { return x | y; }


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

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

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

LLVM IR (-O2):
define i32 @Int_bit_MINUS_or(i32 %0, i32 %1) {
%3 = or i32 %1, %0
ret i32 %3
}
/* Type definitions */
typedef int int64_t;
typedef int int32_t;

/* Variables and functions */
int32_t soft_timer_us_to_ticks(int32_t us) {
  return (((int64_t)us) * 32768) / 1000000;
}


x86 assembly (clang, -O0):
<soft_timer_us_to_ticks>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0xf,%eax
mov    $0xf4240,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<soft_timer_us_to_ticks>:
shl    $0xf,%edi
movslq %edi,%rax
imul   $0x431bde83,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x32,%rax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @soft_timer_us_to_ticks(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 32768
%5 = sdiv i32 %4, 1000000
ret i32 %5
}

LLVM IR (-O2):
define i32 @soft_timer_us_to_ticks(i32 %0) {
%2 = shl nsw i32 %0, 15
%3 = sdiv i32 %2, 1000000
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strrev(char *);
int /*<<< orphan*/ strrev2(char *, int, int);
int main() {
  char s[] = "asdfgh";
  strrev(s);
  printf("%s", s);
  strrev2(s, 1, 1);
  printf("\n%s", s);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xec2(%rip),%eax
mov    %eax,-0x7(%rbp)
mov    0xebc(%rip),%ax
mov    %ax,-0x3(%rbp)
mov    0xeb4(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0x7(%rbp),%rdi
call   1050 <strrev@plt>
lea    -0x7(%rbp),%rsi
lea    0xe9f(%rip),%rdi
call   1040 <printf@plt>
lea    -0x7(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <strrev2@plt>
lea    -0x7(%rbp),%rsi
lea    0xe7e(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x686766,0xb(%rsp)
movl   $0x66647361,0x8(%rsp)
66
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <strrev@plt>
lea    0xeaf(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
call   1030 <strrev2@plt>
lea    0xe8d(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.s = [7 x i8] c"asdfgh\00"
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"\0A%s\00"
define i32 @main() {
%1 = alloca [7 x i8]
%2 = bitcast [7 x i8]* %1 to i8*
%3 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%4 = call i32 @strrev(i8* %3)
%5 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%8 = call i32 @strrev2(i8* %7, i32 1, i32 1)
%9 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %9)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s = [7 x i8] c"asdfgh\00"
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"\0A%s\00"
define i32 @main() {
%1 = alloca [7 x i8]
%2 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%3 = call i32 @strrev(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%5 = call i32 @strrev2(i8* %2, i32 1, i32 1)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ res_state;

/* Variables and functions */
const char *res_hostalias(const res_state statp, const char *name, char *dst,
                          size_t siz) {
  return (NULL);
}


x86 assembly (clang, -O0):
<res_hostalias>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @res_hostalias(i32 %0, i8* %1, i8* %2, i64 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64
store i32 %0, i32* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i64 %3, i64* %8
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @res_hostalias(i32 %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i64 %3) {
ret i8* null
}
void rop3_79_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~S;
  stk2 = *D | stk3;
  stk1 = T & stk2;
  stk1 = ~stk1;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_79_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_79_1_1>:
mov    (%rdi),%al
mov    %edx,%ecx
or     %sil,%cl
not    %cl
and    %al,%sil
or     %cl,%sil
and    %dl,%al
or     %sil,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_79_1_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %5
%11 = zext i8 %10 to i32
%12 = xor i32 %11, -1
%13 = trunc i32 %12 to i8
store i8 %13, i8* %9
%14 = load i8*, i8** %4
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = load i8, i8* %9
%18 = zext i8 %17 to i32
%19 = or i32 %16, %18
%20 = trunc i32 %19 to i8
store i8 %20, i8* %8
%21 = load i8, i8* %6
%22 = zext i8 %21 to i32
%23 = load i8, i8* %8
%24 = zext i8 %23 to i32
%25 = and i32 %22, %24
%26 = trunc i32 %25 to i8
store i8 %26, i8* %7
%27 = load i8, i8* %7
%28 = zext i8 %27 to i32
%29 = xor i32 %28, -1
%30 = trunc i32 %29 to i8
store i8 %30, i8* %7
%31 = load i8, i8* %7
%32 = zext i8 %31 to i32
%33 = load i8, i8* %5
%34 = zext i8 %33 to i32
%35 = xor i32 %34, -1
%36 = and i32 %32, %35
%37 = load i8, i8* %6
%38 = zext i8 %37 to i32
%39 = xor i32 %38, -1
%40 = and i32 %36, %39
%41 = load i8*, i8** %4
%42 = load i8, i8* %41
%43 = zext i8 %42 to i32
%44 = load i8, i8* %5
%45 = zext i8 %44 to i32
%46 = and i32 %43, %45
%47 = or i32 %40, %46
%48 = load i8*, i8** %4
%49 = load i8, i8* %48
%50 = zext i8 %49 to i32
%51 = load i8, i8* %6
%52 = zext i8 %51 to i32
%53 = and i32 %50, %52
%54 = or i32 %47, %53
%55 = trunc i32 %54 to i8
%56 = load i8*, i8** %4
store i8 %55, i8* %56
ret void
}

LLVM IR (-O2):
define void @rop3_79_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %2, %1
%6 = xor i8 %5, -1
%7 = and i8 %4, %1
%8 = or i8 %7, %6
%9 = and i8 %4, %2
%10 = or i8 %8, %9
store i8 %10, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ irq_ack(int);
int /*<<< orphan*/ timer_int_clean(int);
void timer1_isr(void) {
  timer_int_clean(1);
  irq_ack((0x00000020));
}


x86 assembly (clang, -O0):
<timer1_isr>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1040 <timer_int_clean@plt>
mov    $0x20,%edi
call   1030 <irq_ack@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer1_isr>:
push   %rax
mov    $0x1,%edi
call   1040 <timer_int_clean@plt>
mov    $0x20,%edi
pop    %rax
jmp    1030 <irq_ack@plt>

LLVM IR (-O0):
define void @timer1_isr() {
%1 = call i32 @timer_int_clean(i32 1)
%2 = call i32 @irq_ack(i32 32)
ret void
}

LLVM IR (-O2):
define void @timer1_isr() {
%1 = tail call i32 @timer_int_clean(i32 1)
%2 = tail call i32 @irq_ack(i32 32)
ret void
}
void bootLoaderExit(void) {}


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

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

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

LLVM IR (-O2):
define void @bootLoaderExit() {
ret void
}
int boardstatus(int *check) {
  int i;
  for (i = 0; i < 6; ++i)
    if (*(check + i))
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<boardstatus>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x6,-0x14(%rbp)
jge    114a <boardstatus+0x4a>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     1137 <boardstatus+0x37>
movl   $0x0,-0x4(%rbp)
jmp    1151 <boardstatus+0x51>
jmp    113c <boardstatus+0x3c>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    110f <boardstatus+0xf>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<boardstatus>:
xor    %eax,%eax
cmpl   $0x0,(%rdi)
je     1108 <boardstatus+0x8>
ret
cmpl   $0x0,0x4(%rdi)
jne    1107 <boardstatus+0x7>
cmpl   $0x0,0x8(%rdi)
jne    1107 <boardstatus+0x7>
cmpl   $0x0,0xc(%rdi)
jne    1107 <boardstatus+0x7>
cmpl   $0x0,0x10(%rdi)
jne    1107 <boardstatus+0x7>
xor    %eax,%eax
cmpl   $0x0,0x14(%rdi)
sete   %al
ret

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

LLVM IR (-O2):
define i32 @boardstatus(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %25
4: ; preds = %1
%5 = getelementptr inbounds i32, i32* %0, i64 1
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %25
8: ; preds = %4
%9 = getelementptr inbounds i32, i32* %0, i64 2
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %25
12: ; preds = %8
%13 = getelementptr inbounds i32, i32* %0, i64 3
%14 = load i32, i32* %13
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %25
16: ; preds = %12
%17 = getelementptr inbounds i32, i32* %0, i64 4
%18 = load i32, i32* %17
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %25
20: ; preds = %16
%21 = getelementptr inbounds i32, i32* %0, i64 5
%22 = load i32, i32* %21
%23 = icmp eq i32 %22, 0
%24 = zext i1 %23 to i32
br label %25
25: ; preds = %20, %16, %12, %8, %4, %1
%26 = phi i32 [ 0, %1 ], [ 0, %4 ], [ 0, %8 ], [ 0, %12 ], [ 0, %16 ], [ %24, %20 ]
ret i32 %26
}
/* Type definitions */
struct stat {
  size_t st_size;
};

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *);
scalar_t__ stat(char const *, struct stat *);
size_t file_length(const char *filename) {
  struct stat buf;
  if (stat(filename, &buf)) {
    perror(filename);
    exit(1);
  };
  return buf.st_size;
}


x86 assembly (clang, -O0):
<file_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
je     1166 <file_length+0x36>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_length>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%rsi
call   1030 <stat@plt>
test   %rax,%rax
jne    1152 <file_length+0x22>
mov    0x8(%rsp),%rax
add    $0x10,%rsp
pop    %rbx
ret
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
%struct.stat = type { i64 }
define i64 @file_length(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = call i32 @perror(i8* %0)
%8 = call i32 @exit(i32 1)
unreachable
9: ; preds = %1
%10 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%11 = load i64, i64* %10
ret i64 %11
}
/* Variables and functions */
double __nv_log2(double);
double log2(double __a) { return __nv_log2(__a); }


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

x86 assembly (clang, -O2):
<log2>:
jmp    1030 <__nv_log2@plt>

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

LLVM IR (-O2):
define double @log2(double %0) {
%2 = tail call double @__nv_log2(double %0)
ret double %2
}
void UI_get0_test_string(void) {}


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

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

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

LLVM IR (-O2):
define void @UI_get0_test_string() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stdout;
void printTestInfo(char *testName, char *info) {
  fprintf(stdout, "%s - %s\n", testName, info);
}


x86 assembly (clang, -O0):
<printTestInfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xec8(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printTestInfo>:
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
lea    0xeda(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [9 x i8] c"%s - %s\0A\00"
define void @printTestInfo(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @stdout
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %7)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [9 x i8] c"%s - %s\0A\00"
define void @printTestInfo(i8* %0, i8* %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
/* Type definitions */
struct afp_server {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ afp_unmount_all_volumes(struct afp_server *);
int /*<<< orphan*/ loop_disconnect(struct afp_server *);
void dsi_incoming_closesession(struct afp_server *server) {
  afp_unmount_all_volumes(server);
  loop_disconnect(server);
}


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

x86 assembly (clang, -O2):
<dsi_incoming_closesession>:
push   %rbx
mov    %rdi,%rbx
call   1030 <afp_unmount_all_volumes@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <loop_disconnect@plt>

LLVM IR (-O0):
%struct.afp_server = type { i32 }
define void @dsi_incoming_closesession(%struct.afp_server* %0) {
%2 = alloca %struct.afp_server*
store %struct.afp_server* %0, %struct.afp_server** %2
%3 = load %struct.afp_server*, %struct.afp_server** %2
%4 = call i32 @afp_unmount_all_volumes(%struct.afp_server* %3)
%5 = load %struct.afp_server*, %struct.afp_server** %2
%6 = call i32 @loop_disconnect(%struct.afp_server* %5)
ret void
}

LLVM IR (-O2):
%struct.afp_server = type { i32 }
define void @dsi_incoming_closesession(%struct.afp_server* %0) {
%2 = tail call i32 @afp_unmount_all_volumes(%struct.afp_server* %0)
%3 = tail call i32 @loop_disconnect(%struct.afp_server* %0)
ret void
}
int execute_adjtimex() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_adjtimex() {
ret i32 0
}
/* Type definitions */
struct dnaSeq {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ nibWriteMasked(int /*<<< orphan*/, struct dnaSeq *, char *);
void nibWrite(struct dnaSeq *seq, char *fileName) {
  nibWriteMasked(0, seq, fileName);
}


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

x86 assembly (clang, -O2):
<nibWrite>:
mov    %rsi,%rdx
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <nibWriteMasked@plt>

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

LLVM IR (-O2):
%struct.dnaSeq = type { i32 }
define void @nibWrite(%struct.dnaSeq* %0, i8* %1) {
%3 = tail call i32 @nibWriteMasked(i32 0, %struct.dnaSeq* %0, i8* %1)
ret void
}