xunge/DecIR huggingface dataset:
/* Variables and functions */
int functionCall(char *, char *);
int main() { return (functionCall("pippo", "pluto")); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
lea    0xed9(%rip),%rsi
call   1030 <functionCall@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"pippo\00"
@.str.1 = [6 x i8] c"pluto\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @functionCall(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 %2
}

LLVM IR (-O2):
@.str = [6 x i8] c"pippo\00"
@.str.1 = [6 x i8] c"pluto\00"
define i32 @main() {
%1 = tail call i32 @functionCall(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ ft_bzero(void *, size_t);
scalar_t__ malloc(int);
char *ft_strnew(size_t size) {
  char *s;
  if ((s = (char *)malloc(sizeof(char) * (size + 1)))) {
    ft_bzero((void *)s, size + 1);
    return (s);
  }
  return (NULL);
}


x86 assembly (clang, -O0):
<ft_strnew>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     116b <ft_strnew+0x4b>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x1,%rsi
call   1030 <ft_bzero@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1173 <ft_strnew+0x53>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strnew>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
add    $0x1,%rbx
mov    %ebx,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1147 <ft_strnew+0x27>
mov    %rax,%r14
mov    %rax,%rdi
mov    %rbx,%rsi
call   1030 <ft_bzero@plt>
jmp    114a <ft_strnew+0x2a>
xor    %r14d,%r14d
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @ft_strnew(i64 %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
%5 = load i64, i64* %3
%6 = add i64 %5, 1
%7 = mul i64 1, %6
%8 = trunc i64 %7 to i32
%9 = call i64 @malloc(i32 %8)
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %4
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %18
12: ; preds = %1
%13 = load i8*, i8** %4
%14 = load i64, i64* %3
%15 = add i64 %14, 1
%16 = call i32 @ft_bzero(i8* %13, i64 %15)
%17 = load i8*, i8** %4
store i8* %17, i8** %2
br label %19
18: ; preds = %1
store i8* null, i8** %2
br label %19
19: ; preds = %18, %12
%20 = load i8*, i8** %2
ret i8* %20
}

LLVM IR (-O2):
define i8* @ft_strnew(i64 %0) {
%2 = add i64 %0, 1
%3 = trunc i64 %2 to i32
%4 = tail call i64 @malloc(i32 %3)
%5 = inttoptr i64 %4 to i8*
%6 = icmp eq i64 %4, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @ft_bzero(i8* %5, i64 %2)
br label %9
9: ; preds = %1, %7
%10 = phi i8* [ %5, %7 ], [ null, %1 ]
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ setbuf(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ stdout;
int main() {
  setbuf(stdout, NULL);
  printf("checkpoint1");
  int a = 1 / 0;
  printf("checkpoint2");
  return 0;
}


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

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

LLVM IR (-O0):
@stdout = global i32 0
@.str = [12 x i8] c"checkpoint1\00"
@.str.1 = [12 x i8] c"checkpoint2\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* @stdout
%4 = call i32 @setbuf(i32 %3, i32* null)
%5 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
store i32 poison, i32* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [12 x i8] c"checkpoint1\00"
@.str.1 = [12 x i8] c"checkpoint2\00"
define i32 @main() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @setbuf(i32 %1, i32* null)
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ foo(int);
int main() {
  foo(1);
  foo(2);
  foo(3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <foo@plt>
mov    $0x2,%edi
call   1030 <foo@plt>
mov    $0x3,%edi
call   1030 <foo@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <foo@plt>
mov    $0x2,%edi
call   1030 <foo@plt>
mov    $0x3,%edi
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 1)
%2 = tail call i32 @foo(i32 2)
%3 = tail call i32 @foo(i32 3)
ret i32 0
}
unsigned int _check_times(unsigned x, unsigned y) {
  unsigned long long whole_ans =
      ((unsigned long long)x) * ((unsigned long long)y);
  unsigned word_ans = (unsigned)whole_ans;
  if (word_ans < whole_ans || word_ans > (1 << 28))
    (_throw_badalloc_fn("/scratch/repos/new/home/jordi_armengol_estape/"
                        "c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/"
                        "cyclone/refs/heads/master/bin/genfiles/vcgen.c",
                        284));
  return word_ans;
}


x86 assembly (clang, -O0):
<_check_times>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%rax
jb     114d <_check_times+0x3d>
cmpl   $0x10000000,-0x14(%rbp)
jbe    1160 <_check_times+0x50>
lea    0xeac(%rip),%rdi
mov    $0x11c,%esi
mov    $0x0,%al
call   1030 <_throw_badalloc_fn@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_check_times>:
push   %rbx
mov    %edi,%eax
mul    %esi
mov    %eax,%ebx
jo     1121 <_check_times+0x11>
cmp    $0x10000001,%ebx
jb     1134 <_check_times+0x24>
lea    0xed8(%rip),%rdi
mov    $0x11c,%esi
xor    %eax,%eax
call   1030 <_throw_badalloc_fn@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [146 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/cyclone/refs/heads/master/bin/genfiles/vcgen.c\00"
define i32 @_check_times(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = zext i32 %7 to i64
%9 = load i32, i32* %4
%10 = zext i32 %9 to i64
%11 = mul i64 %8, %10
store i64 %11, i64* %5
%12 = load i64, i64* %5
%13 = trunc i64 %12 to i32
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = zext i32 %14 to i64
%16 = load i64, i64* %5
%17 = icmp ult i64 %15, %16
br i1 %17, label %21, label %18
18: ; preds = %2
%19 = load i32, i32* %6
%20 = icmp ugt i32 %19, 268435456
br i1 %20, label %21, label %23
21: ; preds = %18, %2
%22 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @_throw_badalloc_fn to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str, i64 0, i64 0), i32 284)
br label %23
23: ; preds = %21, %18
%24 = load i32, i32* %6
ret i32 %24
}

LLVM IR (-O2):
@.str = [146 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/cyclone/refs/heads/master/bin/genfiles/vcgen.c\00"
define i32 @_check_times(i32 %0, i32 %1) {
%3 = tail call { i32, i1 } @llvm.umul.with.overflow.i32(i32 %0, i32 %1)
%4 = extractvalue { i32, i1 } %3, 0
%5 = extractvalue { i32, i1 } %3, 1
%6 = icmp ugt i32 %4, 268435456
%7 = or i1 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @_throw_badalloc_fn to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str, i64 0, i64 0), i32 284)
br label %10
10: ; preds = %2, %8
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ uart_init_line(int, int);
unsigned long crb_reset_term(long unit) {
  if (unit != 0)
    return 0x8000000000000000ul;
  uart_init_line((0x3f8 - 0x2f8), 9600);
  return 0;
}


x86 assembly (clang, -O0):
<crb_reset_term>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     113a <crb_reset_term+0x2a>
movabs $0x8000000000000000,%rax
mov    %rax,-0x8(%rbp)
jmp    1151 <crb_reset_term+0x41>
mov    $0x100,%edi
mov    $0x2580,%esi
call   1030 <uart_init_line@plt>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crb_reset_term>:
test   %rdi,%rdi
je     1120 <crb_reset_term+0x10>
movabs $0x8000000000000000,%rax
ret
push   %rax
mov    $0x100,%edi
mov    $0x2580,%esi
call   1030 <uart_init_line@plt>
xor    %eax,%eax
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define i64 @crb_reset_term(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @uart_init_line(i32 256, i32 9600)
br label %5
5: ; preds = %1, %3
%6 = phi i64 [ 0, %3 ], [ -9223372036854775808, %1 ]
ret i64 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct in_addr {
  int /*<<< orphan*/ s_addr;
};

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
scalar_t__ inet_ntop(int /*<<< orphan*/, struct in_addr *, char *, int);
char *uint32_ntoa_r(uint32_t addr, char *buf, int buf_len) {
  struct in_addr saddr;
  saddr.s_addr = addr;
  return ((char *)inet_ntop(AF_INET, &saddr, buf, buf_len));
}


x86 assembly (clang, -O0):
<uint32_ntoa_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
lea    -0x18(%rbp),%rsi
call   1030 <inet_ntop@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uint32_ntoa_r>:
push   %rax
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,(%rsp)
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <inet_ntop@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.in_addr = type { i32 }
@AF_INET = global i32 0
define i8* @uint32_ntoa_r(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca %struct.in_addr
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %7, i32 0, i32 0
store i32 %8, i32* %9
%10 = load i32, i32* @AF_INET
%11 = load i8*, i8** %5
%12 = load i32, i32* %6
%13 = call i64 @inet_ntop(i32 %10, %struct.in_addr* %7, i8* %11, i32 %12)
%14 = inttoptr i64 %13 to i8*
ret i8* %14
}

LLVM IR (-O2):
%struct.in_addr = type { i32 }
@AF_INET = global i32 0
define i8* @uint32_ntoa_r(i32 %0, i8* %1, i32 %2) {
%4 = alloca %struct.in_addr
%5 = bitcast %struct.in_addr* %4 to i8*
%6 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %4, i64 0, i32 0
store i32 %0, i32* %6
%7 = load i32, i32* @AF_INET
%8 = call i64 @inet_ntop(i32 %7, %struct.in_addr* %4, i8* %1, i32 %2)
%9 = inttoptr i64 %8 to i8*
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0x4e() {
  Assert_real((isdigit(78) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isdigit.c",
              395, ("isdigit should be 0 for N"));
}


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

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

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [26 x i8] c"isdigit should be 0 for N\00"
define void @t_isdigit_0x4e() {
%1 = call i64 @isdigit(i32 78)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 395, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [26 x i8] c"isdigit should be 0 for N\00"
define void @t_isdigit_0x4e() {
%1 = tail call i64 @isdigit(i32 78)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 395, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void _ZGr49_gnu_Sjava_Slocale_SLocaleInformation__properties(void) {}


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

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

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

LLVM IR (-O2):
define void @_ZGr49_gnu_Sjava_Slocale_SLocaleInformation__properties() {
ret void
}
void foo698() {}


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

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

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

LLVM IR (-O2):
define void @foo698() {
ret void
}
void __vsyslog_chk(int pri, int flag, const char *fmt, int ap) {}


x86 assembly (clang, -O0):
<__vsyslog_chk>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @__vsyslog_chk(i32 %0, i32 %1, i8* nocapture %2, i32 %3) {
ret void
}
/* Variables and functions */
long fibonacci(int);
int /*<<< orphan*/ printf(char *, long);
int main(void) {
  long total = fibonacci(4000000);
  printf("Answer: %d", total);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"Answer: %d\00"
define i32 @main() {
%1 = tail call i64 @fibonacci(i32 4000000)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i64 %1)
ret i32 0
}
IR0A1(r0, r1, x0, x1, p0, p1) signed char r0, r1;
signed char *p0, *p1;
{
  if ((*p0) <= (*((signed char *)11111111)))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<IR0A1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %dil,%sil
mov    %sil,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
mov    $0xa98ac7,%ecx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jg     1141 <IR0A1+0x41>
movl   $0x1,-0x4(%rbp)
jmp    1148 <IR0A1+0x48>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IR0A1>:
mov    (%r8),%cl
xor    %eax,%eax
cmp    0xa98ac7,%cl
setle  %al
ret

LLVM IR (-O0):
define i32 @IR0A1(i32 %0, i32 %1, i32 %2, i32 %3, i8* %4, i8* %5) {
%7 = alloca i32
%8 = alloca i8
%9 = alloca i8
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i8*
%14 = trunc i32 %0 to i8
%15 = trunc i32 %1 to i8
store i8 %14, i8* %8
store i8 %15, i8* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i8* %4, i8** %12
store i8* %5, i8** %13
%16 = load i8*, i8** %12
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = load i8, i8* inttoptr (i64 11111111 to i8*)
%20 = sext i8 %19 to i32
%21 = icmp sle i32 %18, %20
br i1 %21, label %22, label %23
22: ; preds = %6
store i32 1, i32* %7
br label %24
23: ; preds = %6
store i32 0, i32* %7
br label %24
24: ; preds = %23, %22
%25 = load i32, i32* %7
ret i32 %25
}

LLVM IR (-O2):
define i32 @IR0A1(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture %4, i8* nocapture readnone %5) {
%7 = load i8, i8* %4
%8 = load i8, i8* inttoptr (i64 11111111 to i8*)
%9 = icmp sle i8 %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;
struct udev {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ vsyslog(int, char const *, int /*<<< orphan*/);
void log_fn(struct udev *udev, int priority, const char *file, int line,
            const char *fn, const char *format, va_list args) {
  vsyslog(priority, format, args);
}


x86 assembly (clang, -O0):
<log_fn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x30(%rbp),%rsi
mov    0x10(%rbp),%edx
call   1030 <vsyslog@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_fn>:
mov    %esi,%edi
mov    0x8(%rsp),%edx
mov    %r9,%rsi
jmp    1030 <vsyslog@plt>

LLVM IR (-O0):
%struct.udev = type { i32 }
define void @log_fn(%struct.udev* %0, i32 %1, i8* %2, i32 %3, i8* %4, i8* %5, i32 %6) {
%8 = alloca %struct.udev*
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i32
store %struct.udev* %0, %struct.udev** %8
store i32 %1, i32* %9
store i8* %2, i8** %10
store i32 %3, i32* %11
store i8* %4, i8** %12
store i8* %5, i8** %13
store i32 %6, i32* %14
%15 = load i32, i32* %9
%16 = load i8*, i8** %13
%17 = load i32, i32* %14
%18 = call i32 @vsyslog(i32 %15, i8* %16, i32 %17)
ret void
}

LLVM IR (-O2):
%struct.udev = type { i32 }
define void @log_fn(%struct.udev* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i32 %3, i8* nocapture readnone %4, i8* %5, i32 %6) {
%8 = tail call i32 @vsyslog(i32 %1, i8* %5, i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ stdout;
int main(int argc, char **argv) {
  {
    fprintf(stdout, "Hello... ");
    fflush(stdout);
  };
  sleep(5);
  printf("World! \n");
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e73(%rip),%rax
mov    (%rax),%edi
lea    0xe8a(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e5e(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0x5,%edi
call   1070 <sleep@plt>
lea    0xe70(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e32(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2e88(%rip),%rbx
mov    (%rbx),%edi
lea    0xe9f(%rip),%rsi
call   1040 <fprintf@plt>
mov    (%rbx),%edi
call   1050 <fflush@plt>
mov    $0x5,%edi
call   1070 <sleep@plt>
lea    0xe8c(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e4e(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [10 x i8] c"Hello... \00"
@.str.1 = [9 x i8] c"World! \0A\00"
@EXIT_SUCCESS = global i32 0
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* @stdout
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @stdout
%9 = call i32 @fflush(i32 %8)
%10 = call i32 @sleep(i32 5)
%11 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%12 = load i32, i32* @EXIT_SUCCESS
%13 = call i32 @exit(i32 %12)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [10 x i8] c"Hello... \00"
@EXIT_SUCCESS = global i32 0
@str = [8 x i8] c"World! \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stdout
%6 = tail call i32 @fflush(i32 %5)
%7 = tail call i32 @sleep(i32 5)
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%9 = load i32, i32* @EXIT_SUCCESS
%10 = tail call i32 @exit(i32 %9)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ error(int, char *, char *, char *);
int /*<<< orphan*/ exit(int);
void unterminated_text(int lineno, char *line, char *cptr) {
  error(lineno, line, cptr, "unmatched %%{");
  exit(1);
}


x86 assembly (clang, -O0):
<unterminated_text>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xebb(%rip),%rcx
call   1030 <error@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<unterminated_text>:
push   %rax
lea    0xed8(%rip),%rcx
call   1030 <error@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@.str = [14 x i8] c"unmatched %%{\00"
define void @unterminated_text(i32 %0, i8* %1, i8* %2) {
%4 = tail call i32 @error(i32 %0, i8* %1, i8* %2, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ AL_DetectFM();
int AL_Detect(int *port, int *unk) { return !AL_DetectFM(); }


x86 assembly (clang, -O0):
<AL_Detect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <AL_DetectFM@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AL_Detect>:
push   %rax
xor    %eax,%eax
call   1030 <AL_DetectFM@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @AL_Detect(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = call i32 (...) @AL_DetectFM()
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @AL_Detect(i32* nocapture readnone %0, i32* nocapture readnone %1) {
%3 = tail call i32 (...) @AL_DetectFM()
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int x = 0;
  int y = 0;
  while (x < 5) {
    y = y + 2;
    if (y > 4)
      y = y - 1;
    printf("%i%i ", x, y);
    x = x + 1;
  }
  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,-0x8(%rbp)
jge    1173 <main+0x63>
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jle    1153 <main+0x43>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"%i%i \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 = %15, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 5
br i1 %6, label %7, label %21
7: ; preds = %4
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 2
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = icmp sgt i32 %10, 4
br i1 %11, label %12, label %15
12: ; preds = %7
%13 = load i32, i32* %3
%14 = sub nsw i32 %13, 1
store i32 %14, i32* %3
br label %15
15: ; preds = %12, %7
%16 = load i32, i32* %2
%17 = load i32, i32* %3
%18 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %16, i32 %17)
%19 = load i32, i32* %2
%20 = add nsw i32 %19, 1
store i32 %20, i32* %2
br label %4
21: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%i%i \00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 0, i32 2)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 1, i32 4)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 2, i32 5)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 3, i32 6)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 4, i32 7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ print_path();
int /*<<< orphan*/ walk_path();
int main(void) {
  char path[10][10] = {{'.', '.', '.', '.', '.', '.', '.', '.', '.', '.'},
                       {'.', '.', '.', '.', '.', '.', '.', '.', '.', '.'},
                       {'.', '.', '.', '.', '.', '.', '.', '.', '.', '.'},
                       {'.', '.', '.', '.', '.', '.', '.', '.', '.', '.'},
                       {'.', '.', '.', '.', '.', '.', '.', '.', '.', '.'},
                       {'.', '.', '.', '.', '.', '.', '.', '.', '.', '.'},
                       {'.', '.', '.', '.', '.', '.', '.', '.', '.', '.'},
                       {'.', '.', '.', '.', '.', '.', '.', '.', '.', '.'},
                       {'.', '.', '.', '.', '.', '.', '.', '.', '.', '.'},
                       {'.', '.', '.', '.', '.', '.', '.', '.', '.', '.'}};
  walk_path();
  print_path();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rdi
mov    $0x2e,%esi
mov    $0x64,%edx
call   1030 <memset@plt>
mov    $0x0,%al
call   1050 <walk_path@plt>
mov    $0x0,%al
call   1040 <print_path@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x [10 x i8]]
store i32 0, i32* %1
%3 = bitcast [10 x [10 x i8]]* %2 to i8*
%4 = call i32 (...) @walk_path()
%5 = call i32 (...) @print_path()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @walk_path()
%2 = tail call i32 (...) @print_path()
ret i32 0
}
int dobro(int x) { return 2 * x; }


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

x86 assembly (clang, -O2):
<dobro>:
lea    (%rdi,%rdi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @dobro(i32 %0) {
%2 = shl nsw i32 %0, 1
ret i32 %2
}
void __svgalib_rendition_outmisc(int i) {}


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

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

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

LLVM IR (-O2):
define void @__svgalib_rendition_outmisc(i32 %0) {
ret void
}
/* Variables and functions */
int rand();
int rand_num() { return rand() % 100 + 1; }


x86 assembly (clang, -O0):
<rand_num>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_num>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
neg    %ecx
add    %ecx,%eax
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @rand_num() {
%1 = call i32 (...) @rand()
%2 = srem i32 %1, 100
%3 = add nsw i32 %2, 1
ret i32 %3
}

LLVM IR (-O2):
define i32 @rand_num() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 100
%3 = add nsw i32 %2, 1
ret i32 %3
}
/* Variables and functions */
float drand48();
float RandomValue(void) { return drand48(); }


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

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

LLVM IR (-O0):
define float @RandomValue() {
%1 = call float (...) @drand48()
ret float %1
}

LLVM IR (-O2):
define float @RandomValue() {
%1 = tail call float (...) @drand48()
ret float %1
}
/* Variables and functions */
int /*<<< orphan*/ CompileAgain(int);
void DoUntil(void) { CompileAgain(28); }


x86 assembly (clang, -O0):
<DoUntil>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1c,%edi
call   1030 <CompileAgain@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DoUntil>:
mov    $0x1c,%edi
jmp    1030 <CompileAgain@plt>

LLVM IR (-O0):
define void @DoUntil() {
%1 = call i32 @CompileAgain(i32 28)
ret void
}

LLVM IR (-O2):
define void @DoUntil() {
%1 = tail call i32 @CompileAgain(i32 28)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int bitmap_test(void *ptr, int bit) {
  int index = bit / 8;
  int offset = bit % 8;
  uint8_t *tmp = ptr;
  return (tmp[index] & (1 << offset));
}


x86 assembly (clang, -O0):
<bitmap_test>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x14(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitmap_test>:
mov    %esi,%ecx
lea    0x7(%rcx),%edx
test   %esi,%esi
cmovns %esi,%edx
and    $0x7,%cl
mov    $0x1,%eax
shl    %cl,%eax
sar    $0x3,%edx
movslq %edx,%rcx
and    (%rdi,%rcx,4),%eax
ret

LLVM IR (-O0):
define i32 @bitmap_test(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
store i8* %0, i8** %3
store i32 %1, i32* %4
%8 = load i32, i32* %4
%9 = sdiv i32 %8, 8
store i32 %9, i32* %5
%10 = load i32, i32* %4
%11 = srem i32 %10, 8
store i32 %11, i32* %6
%12 = load i8*, i8** %3
%13 = bitcast i8* %12 to i32*
store i32* %13, i32** %7
%14 = load i32*, i32** %7
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %14, i64 %16
%18 = load i32, i32* %17
%19 = load i32, i32* %6
%20 = shl i32 1, %19
%21 = and i32 %18, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @bitmap_test(i8* nocapture %0, i32 %1) {
%3 = sdiv i32 %1, 8
%4 = bitcast i8* %0 to i32*
%5 = sext i32 %3 to i64
%6 = getelementptr inbounds i32, i32* %4, i64 %5
%7 = load i32, i32* %6
%8 = and i32 %1, 7
%9 = shl nuw nsw i32 1, %8
%10 = and i32 %7, %9
ret i32 %10
}
/* Variables and functions */
scalar_t__ fn1();
scalar_t__ fn2(int, int);
scalar_t__ fn3(int);
int foo() {
  if (fn1() < 0 || fn2(2, 1) < 0 || fn3(2) < 0)
    return -1;
  fn1();
  fn2(92, 21);
  fn3(42);
  return 0;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <fn1@plt>
cmp    $0x0,%rax
jl     1176 <foo+0x46>
mov    $0x2,%edi
mov    $0x1,%esi
call   1050 <fn2@plt>
cmp    $0x0,%rax
jl     1176 <foo+0x46>
mov    $0x2,%edi
call   1040 <fn3@plt>
cmp    $0x0,%rax
jge    1182 <foo+0x52>
movl   $0xffffffff,-0x4(%rbp)
jmp    11a9 <foo+0x79>
mov    $0x0,%al
call   1030 <fn1@plt>
mov    $0x5c,%edi
mov    $0x15,%esi
call   1050 <fn2@plt>
mov    $0x2a,%edi
call   1040 <fn3@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbx
xor    %eax,%eax
call   1030 <fn1@plt>
mov    $0xffffffff,%ebx
test   %rax,%rax
js     1187 <foo+0x57>
mov    $0x2,%edi
mov    $0x1,%esi
call   1050 <fn2@plt>
test   %rax,%rax
js     1187 <foo+0x57>
mov    $0x2,%edi
call   1040 <fn3@plt>
test   %rax,%rax
js     1187 <foo+0x57>
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <fn1@plt>
mov    $0x5c,%edi
mov    $0x15,%esi
call   1050 <fn2@plt>
mov    $0x2a,%edi
call   1040 <fn3@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @foo() {
%1 = alloca i32
%2 = call i64 (...) @fn1()
%3 = icmp slt i64 %2, 0
br i1 %3, label %10, label %4
4: ; preds = %0
%5 = call i64 @fn2(i32 2, i32 1)
%6 = icmp slt i64 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %4
%8 = call i64 @fn3(i32 2)
%9 = icmp slt i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %7, %4, %0
store i32 -1, i32* %1
br label %15
11: ; preds = %7
%12 = call i64 (...) @fn1()
%13 = call i64 @fn2(i32 92, i32 21)
%14 = call i64 @fn3(i32 42)
store i32 0, i32* %1
br label %15
15: ; preds = %11, %10
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
define i32 @foo() {
%1 = tail call i64 (...) @fn1()
%2 = icmp slt i64 %1, 0
br i1 %2, label %13, label %3
3: ; preds = %0
%4 = tail call i64 @fn2(i32 2, i32 1)
%5 = icmp slt i64 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %3
%7 = tail call i64 @fn3(i32 2)
%8 = icmp slt i64 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %6
%10 = tail call i64 (...) @fn1()
%11 = tail call i64 @fn2(i32 92, i32 21)
%12 = tail call i64 @fn3(i32 42)
br label %13
13: ; preds = %0, %3, %6, %9
%14 = phi i32 [ 0, %9 ], [ -1, %6 ], [ -1, %3 ], [ -1, %0 ]
ret i32 %14
}
unsigned int Length(void *l) { return *((unsigned int *)l - 1); }


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

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

LLVM IR (-O0):
define i32 @Length(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = getelementptr inbounds i32, i32* %4, i64 -1
%6 = load i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @Length(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 -4
%3 = bitcast i8* %2 to i32*
%4 = load i32, i32* %3
ret i32 %4
}
DecVector(v, c) double v[3];
unsigned char *c;
{
  v[0] = DecFloat(&c[0]);
  v[1] = DecFloat(&c[4]);
  v[2] = DecFloat(&c[8]);
}


x86 assembly (clang, -O0):
<DecVector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x0,%al
call   1030 <DecFloat@plt>
cvtsi2sd %eax,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rdi
add    $0x4,%rdi
mov    $0x0,%al
call   1030 <DecFloat@plt>
cvtsi2sd %eax,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x18(%rbp),%rdi
add    $0x8,%rdi
mov    $0x0,%al
call   1030 <DecFloat@plt>
cvtsi2sd %eax,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x10(%rax)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DecVector>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
xor    %eax,%eax
call   1030 <DecFloat@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,(%r14)
lea    0x4(%rbx),%rdi
xor    %eax,%eax
call   1030 <DecFloat@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x8(%r14)
add    $0x8,%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <DecFloat@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x10(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @DecVector(double* %0, i8* %1) {
%3 = alloca i32
%4 = alloca double*
%5 = alloca i8*
store double* %0, double** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %5
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = call i32 (i8*, ...) bitcast (i32 (...)* @DecFloat to i32 (i8*, ...)*)(i8* %7)
%9 = sitofp i32 %8 to double
%10 = load double*, double** %4
%11 = getelementptr inbounds double, double* %10, i64 0
store double %9, double* %11
%12 = load i8*, i8** %5
%13 = getelementptr inbounds i8, i8* %12, i64 4
%14 = call i32 (i8*, ...) bitcast (i32 (...)* @DecFloat to i32 (i8*, ...)*)(i8* %13)
%15 = sitofp i32 %14 to double
%16 = load double*, double** %4
%17 = getelementptr inbounds double, double* %16, i64 1
store double %15, double* %17
%18 = load i8*, i8** %5
%19 = getelementptr inbounds i8, i8* %18, i64 8
%20 = call i32 (i8*, ...) bitcast (i32 (...)* @DecFloat to i32 (i8*, ...)*)(i8* %19)
%21 = sitofp i32 %20 to double
%22 = load double*, double** %4
%23 = getelementptr inbounds double, double* %22, i64 2
store double %21, double* %23
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @DecVector(double* nocapture writeonly %0, i8* %1) {
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @DecFloat to i32 (i8*, ...)*)(i8* %1)
%4 = sitofp i32 %3 to double
store double %4, double* %0
%5 = getelementptr inbounds i8, i8* %1, i64 4
%6 = tail call i32 (i8*, ...) bitcast (i32 (...)* @DecFloat to i32 (i8*, ...)*)(i8* %5)
%7 = sitofp i32 %6 to double
%8 = getelementptr inbounds double, double* %0, i64 1
store double %7, double* %8
%9 = getelementptr inbounds i8, i8* %1, i64 8
%10 = tail call i32 (i8*, ...) bitcast (i32 (...)* @DecFloat to i32 (i8*, ...)*)(i8* %9)
%11 = sitofp i32 %10 to double
%12 = getelementptr inbounds double, double* %0, i64 2
store double %11, double* %12
ret i32 undef
}
void freeTwoDigits(int *value) {}


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

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

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

LLVM IR (-O2):
define void @freeTwoDigits(i32* nocapture %0) {
ret void
}
int isOperator(int c) { return c == '+' || c == '-' || c == '*' || c == '/'; }


x86 assembly (clang, -O0):
<isOperator>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x2b,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     113e <isOperator+0x3e>
mov    $0x1,%al
cmpl   $0x2d,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     113e <isOperator+0x3e>
mov    $0x1,%al
cmpl   $0x2a,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     113e <isOperator+0x3e>
cmpl   $0x2f,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isOperator>:
cmp    $0x2d,%edi
ja     111d <isOperator+0x1d>
mov    $0x1,%eax
mov    %edi,%ecx
movabs $0x2c0000000000,%rdx
bt     %rcx,%rdx
jae    111d <isOperator+0x1d>
ret
xor    %eax,%eax
cmp    $0x2f,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @isOperator(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 43
br i1 %4, label %14, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 45
br i1 %7, label %14, label %8
8: ; preds = %5
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 42
br i1 %10, label %14, label %11
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp eq i32 %12, 47
br label %14
14: ; preds = %11, %8, %5, %1
%15 = phi i1 [ true, %8 ], [ true, %5 ], [ true, %1 ], [ %13, %11 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @isOperator(i32 %0) {
switch i32 %0, label %2 [
i32 45, label %5
i32 43, label %5
i32 42, label %5
]
2: ; preds = %1
%3 = icmp eq i32 %0, 47
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
int read(int, char *, int);
int sock_read(int fd, char *str, int len) {
  int nbytes;
  nbytes = read(fd, str, len);
  return nbytes;
}


x86 assembly (clang, -O0):
<sock_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <read@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sock_read>:
jmp    1030 <read@plt>

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

LLVM IR (-O2):
define i32 @sock_read(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @read(i32 %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *prog) {
  fprintf(stderr,
          "usage: %s [option] [command ...]\n"
          "command:\n"
          "	put\n"
          "	get filename\n"
          "	list\n"
          "	del package\n"
          "option:\n"
          "	-v	verbose\n"
          "	-q	quiet\n"
          "	-p	profile\n"
          "	-d	debug\n"
          "	-f dbfile\n"
          "	-P paths.list\n",
          prog);
  exit(0);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [159 x i8] c"usage: %s [option] [command ...]\0Acommand:\0A\09put\0A\09get filename\0A\09list\0A\09del package\0Aoption:\0A\09-v\09verbose\0A\09-q\09quiet\0A\09-p\09profile\0A\09-d\09debug\0A\09-f dbfile\0A\09-P paths.list\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([159 x i8], [159 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [159 x i8] c"usage: %s [option] [command ...]\0Acommand:\0A\09put\0A\09get filename\0A\09list\0A\09del package\0Aoption:\0A\09-v\09verbose\0A\09-q\09quiet\0A\09-p\09profile\0A\09-d\09debug\0A\09-f dbfile\0A\09-P paths.list\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([159 x i8], [159 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ Error(char *);
void picture_temporal_scalable_extension(void) {
  Error("temporal scalability not supported\n");
}


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

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

LLVM IR (-O0):
@.str = [36 x i8] c"temporal scalability not supported\0A\00"
define void @picture_temporal_scalable_extension() {
%1 = call i32 @Error(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"temporal scalability not supported\0A\00"
define void @picture_temporal_scalable_extension() {
%1 = tail call i32 @Error(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret void
}
int c026(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @c026() {
ret i32 0
}