xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ test6_g();
void test6_h(void) { test6_g(); }


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

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

LLVM IR (-O0):
define void @test6_h() {
%1 = call i32 (...) @test6_g()
ret void
}

LLVM IR (-O2):
define void @test6_h() {
%1 = tail call i32 (...) @test6_g()
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t safe(uint32_t addr) { return addr & 0x10000 - 1; }


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

x86 assembly (clang, -O2):
<safe>:
movzwl %di,%eax
ret

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

LLVM IR (-O2):
define i32 @safe(i32 %0) {
%2 = and i32 %0, 65535
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void cf_trial(int numLines) {
  int i;
  for (i = 0; i < numLines; i++)
    printf("\n");
}


x86 assembly (clang, -O0):
<cf_trial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1148 <cf_trial+0x38>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <cf_trial+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cf_trial>:
push   %rbx
test   %edi,%edi
jle    112f <cf_trial+0x1f>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <cf_trial+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @cf_trial(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @putchar(i32 10)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Type definitions */
struct passwd {
  int dummy;
};

/* Variables and functions */
struct passwd *getpwent();
struct passwd *sys_getpwent(void) {
  return getpwent();
}


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

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

LLVM IR (-O0):
%struct.passwd = type { i32 }
define %struct.passwd* @sys_getpwent() {
%1 = call %struct.passwd* (...) @getpwent()
ret %struct.passwd* %1
}

LLVM IR (-O2):
%struct.passwd = type { i32 }
define %struct.passwd* @sys_getpwent() {
%1 = tail call %struct.passwd* (...) @getpwent()
ret %struct.passwd* %1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0x8b() {
  Assert_real((isodigit(139) == 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_isodigit.c",
              700, ("isodigit should be 0 for 0x8b"));
}


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

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

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

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0x8b\00"
define void @t_isodigit_0x8b() {
%1 = tail call i64 @isodigit(i32 139)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 700, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void sleepTime() { usleep(1); }


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

x86 assembly (clang, -O2):
<sleepTime>:
mov    $0x1,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @sleepTime() {
%1 = call i32 @usleep(i32 1)
ret void
}

LLVM IR (-O2):
define void @sleepTime() {
%1 = tail call i32 @usleep(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print_elem_hex(int elem) { printf("0x%x\n", elem); }


x86 assembly (clang, -O0):
<print_elem_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_elem_hex>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"0x%x\0A\00"
define void @print_elem_hex(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FIONBIO;
scalar_t__ ioctl(int, int /*<<< orphan*/, int *);
int os_set_nonblocking(int fd) {
  int res = 1;
  return (0 == ioctl(fd, FIONBIO, &res));
}


x86 assembly (clang, -O0):
<os_set_nonblocking>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb4(%rip),%rax
mov    (%rax),%esi
lea    -0x8(%rbp),%rdx
call   1030 <ioctl@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_set_nonblocking>:
push   %rax
movl   $0x1,0x4(%rsp)
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
lea    0x4(%rsp),%rdx
call   1030 <ioctl@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@FIONBIO = global i32 0
define i32 @os_set_nonblocking(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* @FIONBIO
%6 = call i64 @ioctl(i32 %4, i32 %5, i32* %3)
%7 = icmp eq i64 0, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
@FIONBIO = global i32 0
define i32 @os_set_nonblocking(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 1, i32* %2
%4 = load i32, i32* @FIONBIO
%5 = call i64 @ioctl(i32 %0, i32 %4, i32* %2)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
scalar_t__ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
void err_check(int err) {
  char err_msg[100];
  sprintf(err_msg, "\nAn error occured, errno = %d:", err);
  if (errno != 0) {
    perror(err_msg);
    exit(1);
  }
  return;
}


x86 assembly (clang, -O0):
<err_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x70(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xeb7(%rip),%rsi
call   1040 <sprintf@plt>
mov    0x2e8b(%rip),%rax
cmpq   $0x0,(%rax)
je     1172 <err_check+0x42>
lea    -0x70(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<err_check>:
sub    $0x68,%rsp
mov    %edi,%edx
lea    0xec3(%rip),%rsi
mov    %rsp,%rdi
call   1040 <sprintf@plt>
mov    0x2e94(%rip),%rax
cmpq   $0x0,(%rax)
jne    1157 <err_check+0x27>
add    $0x68,%rsp
ret
mov    %rsp,%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"\0AAn error occured, errno = %d:\00"
@errno = global i64 0
define void @err_check(i32 %0) {
%2 = alloca i32
%3 = alloca [100 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i64, i64* @errno
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%11 = call i32 @perror(i8* %10)
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"\0AAn error occured, errno = %d:\00"
@errno = global i64 0
define void @err_check(i32 %0) {
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = load i64, i64* @errno
%6 = icmp eq i64 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %1
%8 = call i32 @perror(i8* %3)
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %1
ret void
}
long BUFTOL(p)
register char *p;
{
  register long l = 0;
  register int i;
  for (i = 4; i > 0; i--) {
    l = (l << 8) | (*p++ & 0377);
  }
  return l;
}


x86 assembly (clang, -O0):
<BUFTOL>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0x4,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    1159 <BUFTOL+0x59>
mov    -0x10(%rbp),%rax
shl    $0x8,%rax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
and    $0xff,%ecx
movslq %ecx,%rcx
or     %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1117 <BUFTOL+0x17>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BUFTOL>:
mov    (%rdi),%eax
shl    $0x20,%rax
bswap  %rax
ret

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

LLVM IR (-O2):
define i64 @BUFTOL(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %0
%4 = zext i8 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 2
%6 = load i8, i8* %2
%7 = zext i8 %6 to i64
%8 = shl nuw nsw i64 %4, 16
%9 = shl nuw nsw i64 %7, 8
%10 = or i64 %8, %9
%11 = getelementptr inbounds i8, i8* %0, i64 3
%12 = load i8, i8* %5
%13 = zext i8 %12 to i64
%14 = or i64 %10, %13
%15 = shl nuw nsw i64 %14, 8
%16 = load i8, i8* %11
%17 = zext i8 %16 to i64
%18 = or i64 %15, %17
ret i64 %18
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void cgi_send_header(const char *header) { printf("%s\r\n", header); }


x86 assembly (clang, -O0):
<cgi_send_header>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgi_send_header>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"%s\0D\0A\00"
define void @cgi_send_header(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
struct link_map {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
void __libc_register_dlfcn_hook(struct link_map *map) { __set_errno(ENOSYS); }


x86 assembly (clang, -O0):
<__libc_register_dlfcn_hook>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__libc_register_dlfcn_hook>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <__set_errno@plt>

LLVM IR (-O0):
%struct.link_map = type { i32 }
@ENOSYS = global i32 0
define void @__libc_register_dlfcn_hook(%struct.link_map* %0) {
%2 = alloca %struct.link_map*
store %struct.link_map* %0, %struct.link_map** %2
%3 = load i32, i32* @ENOSYS
%4 = call i32 @__set_errno(i32 %3)
ret void
}

LLVM IR (-O2):
%struct.link_map = type { i32 }
@ENOSYS = global i32 0
define void @__libc_register_dlfcn_hook(%struct.link_map* nocapture readnone %0) {
%2 = load i32, i32* @ENOSYS
%3 = tail call i32 @__set_errno(i32 %2)
ret void
}
int d_ble_mr1(double *a1, double a2) {
  return (__builtin_islessequal(*a1, a2));
}


x86 assembly (clang, -O0):
<d_ble_mr1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_ble_mr1>:
xor    %eax,%eax
ucomisd (%rdi),%xmm0
setae  %al
ret

LLVM IR (-O0):
define i32 @d_ble_mr1(double* %0, double %1) {
%3 = alloca double*
%4 = alloca double
store double* %0, double** %3
store double %1, double* %4
%5 = load double*, double** %3
%6 = load double, double* %5
%7 = load double, double* %4
%8 = fcmp ole double %6, %7
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @d_ble_mr1(double* nocapture %0, double %1) {
%3 = load double, double* %0
%4 = fcmp ole double %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int next_quaddobl_solution(int k) {
  int fail, *b;
  double *c;
  fail = _ada_use_c2phc(508, &k, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<next_quaddobl_solution>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x1fc,%edi
lea    -0x4(%rbp),%rsi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_quaddobl_solution>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x1fc,%edi
call   1030 <_ada_use_c2phc@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @next_quaddobl_solution(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
%5 = alloca double*
store i32 %0, i32* %2
%6 = load i32*, i32** %4
%7 = load double*, double** %5
%8 = call i32 @_ada_use_c2phc(i32 508, i32* %2, i32* %6, double* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @next_quaddobl_solution(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_ada_use_c2phc(i32 508, i32* %2, i32* undef, double* undef)
ret i32 %3
}
void ARGBToUVJRow_SSSE3() {}


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

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

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

LLVM IR (-O2):
define void @ARGBToUVJRow_SSSE3() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: aed [ -deh] [ -p passphrase] [ -s salt]\n");
  exit(EXIT_FAILURE);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [48 x i8] c"Usage: aed [ -deh] [ -p passphrase] [ -s salt]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [48 x i8] c"Usage: aed [ -deh] [ -p passphrase] [ -s salt]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
scalar_t__ SYS_exit;
int /*<<< orphan*/ syscall_1(long, long);
void exit(int status) { syscall_1((long)(SYS_exit), ((long)(status))); }


x86 assembly (clang, -O0):
<exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%rdi
movslq -0x4(%rbp),%rsi
call   1030 <syscall_1@plt>

x86 assembly (clang, -O2):
<exit>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%rax
movslq %edi,%rsi
mov    %rax,%rdi
call   1030 <syscall_1@plt>

LLVM IR (-O0):
@SYS_exit = global i64 0
define void @exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i64, i64* @SYS_exit
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = call i32 @syscall_1(i64 %3, i64 %5)
unreachable
}

LLVM IR (-O2):
@SYS_exit = global i64 0
define void @exit(i32 %0) {
%2 = load i64, i64* @SYS_exit
%3 = sext i32 %0 to i64
%4 = tail call i32 @syscall_1(i64 %2, i64 %3)
unreachable
}
/* Variables and functions */
double Exponential(int);
int /*<<< orphan*/ SelectStream(int);
double generate_exp(double lambda, int stream) {
  SelectStream(stream);
  return Exponential(1 / lambda);
}


x86 assembly (clang, -O0):
<generate_exp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <SelectStream@plt>
movsd  0xec0(%rip),%xmm0
divsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1040 <Exponential@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generate_exp>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <SelectStream@plt>
movsd  0xecd(%rip),%xmm0
divsd  (%rsp),%xmm0
cvttsd2si %xmm0,%edi
pop    %rax
jmp    1040 <Exponential@plt>

LLVM IR (-O0):
define double @generate_exp(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
store double %0, double* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @SelectStream(i32 %5)
%7 = load double, double* %3
%8 = fdiv double 1.000000e+00, %7
%9 = fptosi double %8 to i32
%10 = call double @Exponential(i32 %9)
ret double %10
}

LLVM IR (-O2):
define double @generate_exp(double %0, i32 %1) {
%3 = tail call i32 @SelectStream(i32 %1)
%4 = fdiv double 1.000000e+00, %0
%5 = fptosi double %4 to i32
%6 = tail call double @Exponential(i32 %5)
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int write(int, unsigned char *, int);
int SendRawPacket(int rawsock, unsigned char *pkt, int pkt_len) {
  int sent = 0;
  if ((sent = write(rawsock, pkt, pkt_len)) != pkt_len) {
    printf("Could only send %d bytes of packet of length %d\n", sent, pkt_len);
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<SendRawPacket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
mov    %eax,-0x18(%rbp)
cmp    -0x14(%rbp),%eax
je     1172 <SendRawPacket+0x52>
mov    -0x18(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    0xe9f(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1179 <SendRawPacket+0x59>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SendRawPacket>:
push   %rbx
mov    %edx,%ebx
call   1030 <write@plt>
mov    $0x1,%ecx
cmp    %ebx,%eax
je     1143 <SendRawPacket+0x23>
lea    0xec8(%rip),%rdi
mov    %eax,%esi
mov    %ebx,%edx
call   1040 <printf@plt>
xor    %ecx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [49 x i8] c"Could only send %d bytes of packet of length %d\0A\00"
define i32 @SendRawPacket(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 0, i32* %8
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = load i32, i32* %7
%12 = call i32 @write(i32 %9, i8* %10, i32 %11)
store i32 %12, i32* %8
%13 = load i32, i32* %7
%14 = icmp ne i32 %12, %13
br i1 %14, label %15, label %19
15: ; preds = %3
%16 = load i32, i32* %8
%17 = load i32, i32* %7
%18 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i32 %16, i32 %17)
store i32 0, i32* %4
br label %20
19: ; preds = %3
store i32 1, i32* %4
br label %20
20: ; preds = %19, %15
%21 = load i32, i32* %4
ret i32 %21
}

LLVM IR (-O2):
@.str = [49 x i8] c"Could only send %d bytes of packet of length %d\0A\00"
define i32 @SendRawPacket(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %2)
%5 = icmp eq i32 %4, %2
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %2)
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ 0, %6 ], [ 1, %3 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ __builtin_altivec_dst(void *, int /*<<< orphan*/,
                                         int /*<<< orphan*/);
void foo(char *image) {
  while (1) {
    __builtin_altivec_dst((void *)((long)image & ~0x0f), 0, 0);
    image += 48;
  }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
and    $0xfffffffffffffff0,%rdi
mov    %rdi,-0x18(%rbp)
xor    %edx,%edx
mov    %edx,%esi
call   1030 <__builtin_altivec_dst@plt>
mov    -0x8(%rbp),%rax
add    $0x30,%rax
mov    %rax,-0x10(%rbp)
mov    %rax,-0x8(%rbp)
jmp    111c <foo+0xc>

x86 assembly (clang, -O2):
<foo>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
and    $0xfffffffffffffff0,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <__builtin_altivec_dst@plt>
add    $0x30,%rbx
jmp    1120 <foo+0x10>

LLVM IR (-O0):
define void @foo(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1, %3
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i64
%6 = and i64 %5, -16
%7 = inttoptr i64 %6 to i8*
%8 = call i32 @__builtin_altivec_dst(i8* %7, i32 0, i32 0)
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 48
store i8* %10, i8** %2
br label %3
}

LLVM IR (-O2):
define void @foo(i8* %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i8* [ %0, %1 ], [ %8, %2 ]
%4 = ptrtoint i8* %3 to i64
%5 = and i64 %4, -16
%6 = inttoptr i64 %5 to i8*
%7 = tail call i32 @__builtin_altivec_dst(i8* %6, i32 0, i32 0)
%8 = getelementptr inbounds i8, i8* %3, i64 48
br label %2
}
/* Variables and functions */
int sfxhash_nearest_powerof2(int);
int sfxhash_calcrows(int num) { return sfxhash_nearest_powerof2(num); }


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

x86 assembly (clang, -O2):
<sfxhash_calcrows>:
jmp    1030 <sfxhash_nearest_powerof2@plt>

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

LLVM IR (-O2):
define i32 @sfxhash_calcrows(i32 %0) {
%2 = tail call i32 @sfxhash_nearest_powerof2(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void putfont(char *fn) {
  if (fn != NULL && *fn)
    printf(fn[1] ? "\\f(%.2s" : "\\f%.2s", fn);
}


x86 assembly (clang, -O0):
<putfont>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     115d <putfont+0x4d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     115d <putfont+0x4d>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%ecx
lea    0xec2(%rip),%rdi
lea    0xeb3(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdi
mov    -0x8(%rbp),%rsi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putfont>:
test   %rdi,%rdi
je     1138 <putfont+0x28>
mov    %rdi,%rsi
cmpb   $0x0,(%rdi)
je     1138 <putfont+0x28>
cmpb   $0x0,0x1(%rsi)
lea    0xee0(%rip),%rax
lea    0xed1(%rip),%rdi
cmove  %rax,%rdi
jmp    1030 <printf@plt>
ret

LLVM IR (-O0):
@.str = [8 x i8] c"\\f(%.2s\00"
@.str.1 = [7 x i8] c"\\f%.2s\00"
define void @putfont(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %20
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %20
10: ; preds = %5
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i64 1
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp ne i32 %14, 0
%16 = zext i1 %15 to i64
%17 = select i1 %15, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0)
%18 = load i8*, i8** %2
%19 = call i32 @printf(i8* %17, i8* %18)
br label %20
20: ; preds = %10, %5, %1
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"\\f(%.2s\00"
@.str.1 = [7 x i8] c"\\f%.2s\00"
define void @putfont(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %12, label %6
6: ; preds = %3
%7 = getelementptr inbounds i8, i8* %0, i64 1
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 0
%10 = select i1 %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
%11 = tail call i32 @printf(i8* %10, i8* %0)
br label %12
12: ; preds = %6, %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memory_destroy();
int /*<<< orphan*/ registers_destroy();
void machine_destroy() {
  memory_destroy();
  registers_destroy();
}


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

x86 assembly (clang, -O2):
<machine_destroy>:
push   %rax
xor    %eax,%eax
call   1040 <memory_destroy@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <registers_destroy@plt>

LLVM IR (-O0):
define void @machine_destroy() {
%1 = call i32 (...) @memory_destroy()
%2 = call i32 (...) @registers_destroy()
ret void
}

LLVM IR (-O2):
define void @machine_destroy() {
%1 = tail call i32 (...) @memory_destroy()
%2 = tail call i32 (...) @registers_destroy()
ret void
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ putchar(int);
int main() {
  int i, c;
  while ((c = getchar()) != EOF) {
    putchar((c >= 'A' && c <= 'Z') ? c + 'a' - 'A' : c);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0xc(%rbp)
mov    0x2ea8(%rip),%rcx
cmp    (%rcx),%eax
je     1180 <main+0x60>
cmpl   $0x41,-0xc(%rbp)
jl     116d <main+0x4d>
cmpl   $0x5a,-0xc(%rbp)
jg     116d <main+0x4d>
mov    -0xc(%rbp),%eax
add    $0x61,%eax
sub    $0x41,%eax
mov    %eax,-0x10(%rbp)
jmp    1173 <main+0x53>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
call   1030 <putchar@plt>
jmp    112f <main+0xf>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb9(%rip),%rbx
cmp    (%rbx),%eax
je     115c <main+0x3c>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    -0x41(%rax),%ecx
lea    0x20(%rax),%edi
cmp    $0x1a,%ecx
cmovae %eax,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%eax
jne    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
br label %4
4: ; preds = %20, %0
%5 = call i32 (...) @getchar()
store i32 %5, i32* %3
%6 = load i32, i32* @EOF
%7 = icmp ne i32 %5, %6
br i1 %7, label %8, label %23
8: ; preds = %4
%9 = load i32, i32* %3
%10 = icmp sge i32 %9, 65
br i1 %10, label %11, label %18
11: ; preds = %8
%12 = load i32, i32* %3
%13 = icmp sle i32 %12, 90
br i1 %13, label %14, label %18
14: ; preds = %11
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 97
%17 = sub nsw i32 %16, 65
br label %20
18: ; preds = %11, %8
%19 = load i32, i32* %3
br label %20
20: ; preds = %18, %14
%21 = phi i32 [ %17, %14 ], [ %19, %18 ]
%22 = call i32 @putchar(i32 %21)
br label %4
23: ; preds = %4
%24 = load i32, i32* %1
ret i32 %24
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %14, label %4
4: ; preds = %0, %4
%5 = phi i32 [ %11, %4 ], [ %1, %0 ]
%6 = add i32 %5, -65
%7 = icmp ult i32 %6, 26
%8 = add nsw i32 %5, 32
%9 = select i1 %7, i32 %8, i32 %5
%10 = tail call i32 @putchar(i32 %9)
%11 = tail call i32 (...) @getchar()
%12 = load i32, i32* @EOF
%13 = icmp eq i32 %11, %12
br i1 %13, label %14, label %4
14: ; preds = %4, %0
ret i32 0
}
void av_thread_message_queue_send() {}


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

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

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

LLVM IR (-O2):
define void @av_thread_message_queue_send() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ conv_arabic_direction();
int /*<<< orphan*/ conv_arabic_glyph();
int /*<<< orphan*/ conv_iso1256_ibm864();
int processLine(void) {
  int i, s;
  unsigned char lastc;
  conv_iso1256_ibm864();
  conv_arabic_glyph();
  conv_arabic_direction();
  return 0;
}


x86 assembly (clang, -O0):
<processLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <conv_iso1256_ibm864@plt>
mov    $0x0,%al
call   1030 <conv_arabic_glyph@plt>
mov    $0x0,%al
call   1050 <conv_arabic_direction@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<processLine>:
push   %rax
xor    %eax,%eax
call   1040 <conv_iso1256_ibm864@plt>
xor    %eax,%eax
call   1030 <conv_arabic_glyph@plt>
xor    %eax,%eax
call   1050 <conv_arabic_direction@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @processLine() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
%4 = call i32 (...) @conv_iso1256_ibm864()
%5 = call i32 (...) @conv_arabic_glyph()
%6 = call i32 (...) @conv_arabic_direction()
ret i32 0
}

LLVM IR (-O2):
define i32 @processLine() {
%1 = tail call i32 (...) @conv_iso1256_ibm864()
%2 = tail call i32 (...) @conv_arabic_glyph()
%3 = tail call i32 (...) @conv_arabic_direction()
ret i32 0
}
/* Variables and functions */
void *malloc(size_t);
void *cmalloc_(int *NBytes) {
  void *ArrPtr;
  if (*NBytes > 0) {
    ArrPtr = malloc((size_t)(*NBytes));
  } else {
    ArrPtr = NULL;
  }
  return (ArrPtr);
}


x86 assembly (clang, -O0):
<cmalloc_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
jle    113e <cmalloc_+0x2e>
mov    -0x8(%rbp),%rax
movslq (%rax),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
jmp    1146 <cmalloc_+0x36>
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmalloc_>:
mov    (%rdi),%edi
test   %edi,%edi
jle    111b <cmalloc_+0xb>
jmp    1030 <malloc@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @cmalloc_(i32* %0) {
%2 = alloca i32*
%3 = alloca i8*
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i32*, i32** %2
%9 = load i32, i32* %8
%10 = sext i32 %9 to i64
%11 = call i8* @malloc(i64 %10)
store i8* %11, i8** %3
br label %13
12: ; preds = %1
store i8* null, i8** %3
br label %13
13: ; preds = %12, %7
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
define noalias i8* @cmalloc_(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = zext i32 %2 to i64
%6 = tail call i8* @malloc(i64 %5)
br label %7
7: ; preds = %1, %4
%8 = phi i8* [ %6, %4 ], [ null, %1 ]
ret i8* %8
}
void _M2_para_finish(__attribute__((unused)) int argc,
                     __attribute__((unused)) char *argv[]) {}


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

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

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

LLVM IR (-O2):
define void @_M2_para_finish(i32 %0, i8** nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(int);
void main(int i) {
  int a;
  foo(a);
  a = 1;
  if (1) {
    int a;
    a = 2;
  }
  a = 3;
}


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

x86 assembly (clang, -O2):
<main>:
jmp    1030 <foo@plt>

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

LLVM IR (-O2):
define void @main(i32 %0) {
%2 = tail call i32 @foo(i32 undef)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
void sansa_print_error(char *msg) { perror(msg); }


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

x86 assembly (clang, -O2):
<sansa_print_error>:
jmp    1030 <perror@plt>

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

LLVM IR (-O2):
define void @sansa_print_error(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fclose(int /*<<< orphan*/ *);
int wave_close(FILE *ptr) {
  int ret;
  ret = fclose(ptr);
  ptr = NULL;
  return ret;
}


x86 assembly (clang, -O0):
<wave_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
mov    %eax,-0xc(%rbp)
movq   $0x0,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wave_close>:
jmp    1030 <fclose@plt>

LLVM IR (-O0):
define i32 @wave_close(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @fclose(i32* %4)
store i32 %5, i32* %3
store i32* null, i32** %2
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @wave_close(i32* nocapture %0) {
%2 = tail call i32 @fclose(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void puts(char *c) {
  while (*c) {
    putchar(*c);
    c++;
  }
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1146 <puts+0x36>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <puts+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <puts+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <puts+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @putchar(i8 signext %5)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ primeFactors(unsigned long);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, unsigned long *);
int main(void) {
  unsigned long input;
  printf("Enter number to prime-factorize: ");
  scanf("%lu", &input);
  primeFactors(input);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    0xed0(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x10(%rbp),%rdi
call   1050 <primeFactors@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
mov    (%rsp),%rdi
call   1050 <primeFactors@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [34 x i8] c"Enter number to prime-factorize: \00"
@.str.1 = [4 x i8] c"%lu\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64* %2)
%5 = load i64, i64* %2
%6 = call i32 @primeFactors(i64 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"Enter number to prime-factorize: \00"
@.str.1 = [4 x i8] c"%lu\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64* %1)
%5 = load i64, i64* %1
%6 = call i32 @primeFactors(i64 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ puts(int /*<<< orphan*/);
int /*<<< orphan*/ random_filepath();
void test_random_filepath() { puts(random_filepath()); }


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

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

LLVM IR (-O0):
define void @test_random_filepath() {
%1 = call i32 (...) @random_filepath()
%2 = call i32 @puts(i32 %1)
ret void
}

LLVM IR (-O2):
define void @test_random_filepath() {
%1 = tail call i32 (...) @random_filepath()
%2 = tail call i32 @puts(i32 %1)
ret void
}
void swap_gt(unsigned *a, unsigned *b) {
  unsigned tmp;
  if (*a > *b) {
    tmp = *a;
    *a = *b;
    *b = tmp;
  }
}


x86 assembly (clang, -O0):
<swap_gt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
jbe    113c <swap_gt+0x3c>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_gt>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
cmp    %ecx,%eax
jbe    110c <swap_gt+0xc>
mov    %ecx,(%rdi)
mov    %eax,(%rsi)
ret

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

LLVM IR (-O2):
define void @swap_gt(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = icmp ugt i32 %3, %4
br i1 %5, label %6, label %7
6: ; preds = %2
store i32 %4, i32* %0
store i32 %3, i32* %1
br label %7
7: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _config_test();
int /*<<< orphan*/ _list_test();
int /*<<< orphan*/ _map_test();
int main() {
  _list_test();
  _map_test();
  _config_test();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <_list_test@plt>
mov    $0x0,%al
call   1050 <_map_test@plt>
mov    $0x0,%al
call   1040 <_config_test@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @_list_test()
%2 = tail call i32 (...) @_map_test()
%3 = tail call i32 (...) @_config_test()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ b(int);
void a() {
  int a_local = 0;
  b(a_local);
}


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

x86 assembly (clang, -O2):
<a>:
xor    %edi,%edi
jmp    1030 <b@plt>

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

LLVM IR (-O2):
define void @a() {
%1 = tail call i32 @b(i32 0)
ret void
}
main() {
  int ar[10];
  int *p;
  p = &ar[5];
  *p = 2;
  return ar[5];
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rax
add    $0x14,%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
movl   $0x2,(%rax)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca i32*
store i32 0, i32* %1
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 5
store i32* %4, i32** %3
%5 = load i32*, i32** %3
store i32 2, i32* %5
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 5
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @main() {
ret i32 2
}
void dodbg(void) {}


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

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

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

LLVM IR (-O2):
define void @dodbg() {
ret void
}
/* Variables and functions */
int add(char *);
bool add_test_newline_delimiter() {
  if (add("7,9\n5,1,3") == 25)
    return true;
  return false;
}


x86 assembly (clang, -O0):
<add_test_newline_delimiter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <add@plt>
cmp    $0x19,%eax
jne    1139 <add_test_newline_delimiter+0x29>
movl   $0x1,-0x4(%rbp)
jmp    1140 <add_test_newline_delimiter+0x30>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_test_newline_delimiter>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <add@plt>
xor    %ecx,%ecx
cmp    $0x19,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"7,9\0A5,1,3\00"
define i32 @add_test_newline_delimiter() {
%1 = alloca i32
%2 = call i32 @add(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 25
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 1, i32* %1
br label %6
5: ; preds = %0
store i32 0, i32* %1
br label %6
6: ; preds = %5, %4
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
@.str = [10 x i8] c"7,9\0A5,1,3\00"
define i32 @add_test_newline_delimiter() {
%1 = tail call i32 @add(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, 25
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int x_root;
};
struct TYPE_4__ {
  TYPE_1__ xcrossing;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xcrossing_x_root(void *_p, int _v) {
  ((XEvent *)_p)->xcrossing.x_root = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XEvent_xcrossing_x_root>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i32 }
define void @set_XEvent_xcrossing_x_root(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i32 %5, i32* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xcrossing_x_root(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}