xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ SYS_fork;
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ syscall(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  syscall(SYS_fork);
  printf("We should never see this message.\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
call   1040 <syscall@plt>
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@SYS_fork = global i32 0
@.str = [35 x i8] c"We should never see this message.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* @SYS_fork
%7 = call i32 @syscall(i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@SYS_fork = global i32 0
@str = [34 x i8] c"We should never see this message.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @SYS_fork
%4 = tail call i32 @syscall(i32 %3)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ seatest_test_fixture_end();
int /*<<< orphan*/ seatest_test_fixture_start(char *);
void chown_tests(void) {
  do {
    seatest_test_fixture_start(
        "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/sshilovsky/vifm/refs/heads/master/tests/iop/"
        "chown.c");
  } while (0);
  do {
    seatest_test_fixture_end();
  } while (0);
}


x86 assembly (clang, -O0):
<chown_tests>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <chown_tests+0x9>
lea    0xed0(%rip),%rdi
call   1040 <seatest_test_fixture_start@plt>
jmp    113a <chown_tests+0x1a>
mov    $0x0,%al
call   1030 <seatest_test_fixture_end@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [142 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/sshilovsky/vifm/refs/heads/master/tests/iop/chown.c\00"
define void @chown_tests() {
br label %1
1: ; preds = %0
%2 = call i32 @seatest_test_fixture_start(i8* getelementptr inbounds ([142 x i8], [142 x i8]* @.str, i64 0, i64 0))
br label %3
3: ; preds = %1
br label %4
4: ; preds = %3
%5 = call i32 (...) @seatest_test_fixture_end()
br label %6
6: ; preds = %4
ret void
}

LLVM IR (-O2):
@.str = [142 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/sshilovsky/vifm/refs/heads/master/tests/iop/chown.c\00"
define void @chown_tests() {
%1 = tail call i32 @seatest_test_fixture_start(i8* getelementptr inbounds ([142 x i8], [142 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @seatest_test_fixture_end()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ nis_name;

/* Variables and functions */
int /*<<< orphan*/ searchXYX(char *, char *);
nis_name searchgroup(char *str) { return searchXYX(str, "group="); }


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

x86 assembly (clang, -O2):
<searchgroup>:
lea    0xee9(%rip),%rsi
jmp    1030 <searchXYX@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"group=\00"
define i32 @searchgroup(i8* %0) {
%2 = tail call i32 @searchXYX(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Variables and functions */
char *get_version();
int /*<<< orphan*/ printf(char *, ...);
void greet(char *p_name) {
  printf("=========================================\n");
  printf("%s Version: %s\n", p_name, get_version());
  printf("=========================================\n");
}


x86 assembly (clang, -O0):
<greet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <get_version@plt>
mov    -0x10(%rbp),%rsi
mov    %rax,%rdx
lea    0xed4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<greet>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xed2(%rip),%r14
mov    %r14,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <get_version@plt>
lea    0xeac(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@.str.1 = [16 x i8] c"%s Version: %s\0A\00"
@str.2 = [42 x i8] c"=========================================\00"
define void @greet(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.2, i64 0, i64 0))
%3 = tail call i8* (...) @get_version()
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* %3)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
const uint8_t *packer_uint16_unpack(const uint8_t *buffer, uint16_t *value) {
  *value = ((uint16_t)buffer[0] << 8) + buffer[1];
  return buffer + 2;
}


x86 assembly (clang, -O0):
<packer_uint16_unpack>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
shl    $0x8,%ecx
mov    -0x8(%rbp),%rax
add    0x4(%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
add    $0x8,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<packer_uint16_unpack>:
mov    (%rdi),%eax
shl    $0x8,%eax
add    0x4(%rdi),%eax
mov    %eax,(%rsi)
lea    0x8(%rdi),%rax
ret

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

LLVM IR (-O2):
define i32* @packer_uint16_unpack(i32* %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* %0
%4 = shl i32 %3, 8
%5 = getelementptr inbounds i32, i32* %0, i64 1
%6 = load i32, i32* %5
%7 = add nsw i32 %4, %6
store i32 %7, i32* %1
%8 = getelementptr inbounds i32, i32* %0, i64 2
ret i32* %8
}
void sd_dif_complete(struct scsi_cmnd *cmd, unsigned int a) {}


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

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

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

LLVM IR (-O2):
%struct.scsi_cmnd = type opaque
define void @sd_dif_complete(%struct.scsi_cmnd* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0x32() {
  Assert_real((iscntrl(50) == 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_iscntrl.c",
              255, ("iscntrl should be 0 for 2"));
}


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

x86 assembly (clang, -O2):
<t_iscntrl_0x32>:
push   %rax
mov    $0x32,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0xff,%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_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for 2\00"
define void @t_iscntrl_0x32() {
%1 = call i64 @iscntrl(i32 50)
%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 255, 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_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for 2\00"
define void @t_iscntrl_0x32() {
%1 = tail call i64 @iscntrl(i32 50)
%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 255, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int oh_display_init(int edge, int frame_width, int frame_height) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @oh_display_init(i32 %0, i32 %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *);
void error(const char *msg) {
  perror(msg);
  exit(1);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @error(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct timezone {
  int dummy;
};
struct timeval {
  int tv_sec;
  scalar_t__ tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, struct timezone *);
double getTime() {
  struct timeval tv;
  struct timezone tz;
  gettimeofday(&tv, &tz);
  return (tv.tv_sec * 1000 + ((double)tv.tv_usec) / 1000);
}


x86 assembly (clang, -O0):
<getTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <gettimeofday@plt>
imul   $0x3e8,-0x10(%rbp),%eax
cvtsi2sd %eax,%xmm0
cvtsi2sdq -0x8(%rbp),%xmm1
movsd  0xec2(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getTime>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <gettimeofday@plt>
imul   $0x3e8,0x8(%rsp),%eax
cvtsi2sd %eax,%xmm1
cvtsi2sdq 0x10(%rsp),%xmm0
divsd  0xec4(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
%struct.timezone = type { i32 }
define double @getTime() {
%1 = alloca %struct.timeval
%2 = alloca %struct.timezone
%3 = call i32 @gettimeofday(%struct.timeval* %1, %struct.timezone* %2)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000
%7 = sitofp i32 %6 to double
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%9 = load i64, i64* %8
%10 = sitofp i64 %9 to double
%11 = fdiv double %10, 1.000000e+03
%12 = fadd double %7, %11
ret double %12
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
%struct.timezone = type { i32 }
define double @getTime() {
%1 = alloca %struct.timeval
%2 = alloca %struct.timezone
%3 = bitcast %struct.timeval* %1 to i8*
%4 = bitcast %struct.timezone* %2 to i8*
%5 = call i32 @gettimeofday(%struct.timeval* %1, %struct.timezone* %2)
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%7 = load i32, i32* %6
%8 = mul nsw i32 %7, 1000
%9 = sitofp i32 %8 to double
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%11 = load i64, i64* %10
%12 = sitofp i64 %11 to double
%13 = fdiv double %12, 1.000000e+03
%14 = fadd double %13, %9
ret double %14
}
signed int le_read32(const void *addr) {
  const unsigned char *p = (const unsigned char *)addr;
  return p[0] | (p[1] << 8) | (p[2] << 16) | (p[3] << 24);
}


x86 assembly (clang, -O0):
<le_read32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @le_read32(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = or i32 %8, %13
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 2
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 16
%20 = or i32 %14, %19
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i64 3
%23 = load i8, i8* %22
%24 = zext i8 %23 to i32
%25 = shl i32 %24, 24
%26 = or i32 %20, %25
ret i32 %26
}

LLVM IR (-O2):
define i32 @le_read32(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %3
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl nuw nsw i32 %11, 16
%13 = or i32 %8, %12
%14 = getelementptr inbounds i8, i8* %0, i64 3
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = shl nuw i32 %16, 24
%18 = or i32 %13, %17
ret i32 %18
}
int main(void) {
  int v1, v2;
#pragma acc parallel reduction(+ : v1, v2)
  ;
#pragma acc parallel reduction(+ : v1, v2) copy(v1, v2)
  ;
#pragma acc parallel reduction(+ : v1, v2) pcopy(v1, v2)
  ;
#pragma acc parallel reduction(+ : v1, v2) present(v1, v2)
  ;
#pragma acc parallel reduction(+ : v1, v2) copyin(v1, v2)
  ;
#pragma acc parallel reduction(+ : v1, v2) pcopyin(v1, v2)
  ;
#pragma acc parallel reduction(+ : v1, v2) copyout(v1, v2)
  ;
#pragma acc parallel reduction(+ : v1, v2) pcopyout(v1, v2)
  ;
#pragma acc parallel reduction(+ : v1, v2) create(v1, v2)
  ;
#pragma acc parallel reduction(+ : v1, v2) pcreate(v1, v2)
  ;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int fib(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, char *argv[], char *envp[]) {
  int local0;
  int o0;
  printf("Input number: ");
  scanf("%d", &local0);
  o0 = fib(local0);
  printf("fibonacci(%d) = %d\n", local0, o0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb0(%rip),%rdi
lea    -0x1c(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x1c(%rbp),%edi
call   1050 <fib@plt>
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%esi
mov    -0x20(%rbp),%edx
lea    0xe92(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [15 x i8] c"Input number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [20 x i8] c"fibonacci(%d) = %d\0A\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %8)
%12 = load i32, i32* %8
%13 = call i32 @fib(i32 %12)
store i32 %13, i32* %9
%14 = load i32, i32* %8
%15 = load i32, i32* %9
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %14, i32 %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"Input number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [20 x i8] c"fibonacci(%d) = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%8 = load i32, i32* %4
%9 = call i32 @fib(i32 %8)
%10 = load i32, i32* %4
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %10, i32 %9)
ret i32 0
}
const char *BZ2_bzlibVersion(void) { return "1.0.3, 17-Oct-2004"; }


x86 assembly (clang, -O0):
<BZ2_bzlibVersion>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [19 x i8] c"1.0.3, 17-Oct-2004\00"
define i8* @BZ2_bzlibVersion() {
ret i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [19 x i8] c"1.0.3, 17-Oct-2004\00"
define i8* @BZ2_bzlibVersion() {
ret i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0)
}
int globus_hashtable_ulong_keyeq(void *integer1, void *integer2) {
  return (integer1 == integer2);
}


x86 assembly (clang, -O0):
<globus_hashtable_ulong_keyeq>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<globus_hashtable_ulong_keyeq>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @globus_hashtable_ulong_keyeq(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = icmp eq i8* %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @globus_hashtable_ulong_keyeq(i8* readnone %0, i8* readnone %1) {
%3 = icmp eq i8* %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ Interpolate_3(int /*<<< orphan*/, int, int /*<<< orphan*/,
                                 int, int /*<<< orphan*/, int, int);
void Interp9(uint32_t *pc, uint32_t c1, uint32_t c2, uint32_t c3) {
  *pc = Interpolate_3(c1, 2, c2, 3, c3, 3, 3);
}


x86 assembly (clang, -O0):
<Interp9>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%r8d
mov    $0x2,%esi
mov    $0x3,%r9d
mov    %r9d,%ecx
movl   $0x3,(%rsp)
call   1030 <Interpolate_3@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Interp9>:
push   %rbx
sub    $0x10,%rsp
mov    %ecx,%r8d
mov    %rdi,%rbx
movl   $0x3,(%rsp)
mov    %esi,%edi
mov    $0x2,%esi
mov    $0x3,%ecx
mov    $0x3,%r9d
call   1030 <Interpolate_3@plt>
mov    %eax,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @Interp9(i32* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %6
%10 = load i32, i32* %7
%11 = load i32, i32* %8
%12 = call i32 @Interpolate_3(i32 %9, i32 2, i32 %10, i32 3, i32 %11, i32 3, i32 3)
%13 = load i32*, i32** %5
store i32 %12, i32* %13
ret void
}

LLVM IR (-O2):
define void @Interp9(i32* nocapture writeonly %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @Interpolate_3(i32 %1, i32 2, i32 %2, i32 3, i32 %3, i32 3, i32 3)
store i32 %5, i32* %0
ret void
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ assert_or_panic(int);
void c_i64(int64_t x) { assert_or_panic(x == -4); }


x86 assembly (clang, -O0):
<c_i64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xfffffffc,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert_or_panic@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_i64>:
xor    %eax,%eax
cmp    $0xfffffffc,%edi
sete   %al
mov    %eax,%edi
jmp    1030 <assert_or_panic@plt>

LLVM IR (-O0):
define void @c_i64(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, -4
%5 = zext i1 %4 to i32
%6 = call i32 @assert_or_panic(i32 %5)
ret void
}

LLVM IR (-O2):
define void @c_i64(i32 %0) {
%2 = icmp eq i32 %0, -4
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert_or_panic(i32 %3)
ret void
}
int test_imm_BEint16_mem(short *val) {
  return ((*val) & (0xBE << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_BEint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
and    $0xbe,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_BEint16_mem>:
testb  $0xbe,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_BEint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, 190
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_BEint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 190
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long window;
};
typedef TYPE_1__ XMappingEvent;

/* Variables and functions */
void set_XMappingEvent_window(void *_p, unsigned long _v) {
  ((XMappingEvent *)_p)->window = (unsigned long)_v;
}


x86 assembly (clang, -O0):
<set_XMappingEvent_window>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XMappingEvent_window>:
mov    %rsi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XMappingEvent_window(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void mian() {
  int i = 10;
  int j = 20;
  if (i > j)
    printf("\40:");
}


x86 assembly (clang, -O0):
<mian>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xa,-0x4(%rbp)
movl   $0x14,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    113e <mian+0x2e>
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @mian() {
ret void
}
void writeDataToDram(volatile unsigned int *pBaseAddress) {
  unsigned int index;
  for (index = 0; index < (0x10000 * 1); index += 1) {
    pBaseAddress[index] = 0xDEADBEEF;
  }
}


x86 assembly (clang, -O0):
<writeDataToDram>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x10000,-0xc(%rbp)
jae    1138 <writeDataToDram+0x38>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
movl   $0xdeadbeef,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <writeDataToDram+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeDataToDram>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movl   $0xdeadbeef,(%rdi,%rax,4)
movl   $0xdeadbeef,0x4(%rdi,%rax,4)
de
movl   $0xdeadbeef,0x8(%rdi,%rax,4)
de
movl   $0xdeadbeef,0xc(%rdi,%rax,4)
de
movl   $0xdeadbeef,0x10(%rdi,%rax,4)
de
movl   $0xdeadbeef,0x14(%rdi,%rax,4)
de
movl   $0xdeadbeef,0x18(%rdi,%rax,4)
de
movl   $0xdeadbeef,0x1c(%rdi,%rax,4)
de
add    $0x8,%rax
cmp    $0x10000,%rax
jne    1110 <writeDataToDram+0x10>
ret

LLVM IR (-O0):
define void @writeDataToDram(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
br label %4
4: ; preds = %12, %1
%5 = load i32, i32* %3
%6 = icmp ult i32 %5, 65536
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = load i32*, i32** %2
%9 = load i32, i32* %3
%10 = zext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
store volatile i32 -559038737, i32* %11
br label %12
12: ; preds = %7
%13 = load i32, i32* %3
%14 = add i32 %13, 1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @writeDataToDram(i32* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %19, %2 ]
%4 = getelementptr inbounds i32, i32* %0, i64 %3
store volatile i32 -559038737, i32* %4
%5 = or i64 %3, 1
%6 = getelementptr inbounds i32, i32* %0, i64 %5
store volatile i32 -559038737, i32* %6
%7 = or i64 %3, 2
%8 = getelementptr inbounds i32, i32* %0, i64 %7
store volatile i32 -559038737, i32* %8
%9 = or i64 %3, 3
%10 = getelementptr inbounds i32, i32* %0, i64 %9
store volatile i32 -559038737, i32* %10
%11 = or i64 %3, 4
%12 = getelementptr inbounds i32, i32* %0, i64 %11
store volatile i32 -559038737, i32* %12
%13 = or i64 %3, 5
%14 = getelementptr inbounds i32, i32* %0, i64 %13
store volatile i32 -559038737, i32* %14
%15 = or i64 %3, 6
%16 = getelementptr inbounds i32, i32* %0, i64 %15
store volatile i32 -559038737, i32* %16
%17 = or i64 %3, 7
%18 = getelementptr inbounds i32, i32* %0, i64 %17
store volatile i32 -559038737, i32* %18
%19 = add nuw nsw i64 %3, 8
%20 = icmp eq i64 %19, 65536
br i1 %20, label %21, label %2
21: ; preds = %2
ret void
}
/* Variables and functions */
float RAND_MAX;
float rand();
float uniform_distribution(float M, float N) {
  return M + (rand() / (RAND_MAX / (N - M)));
}


x86 assembly (clang, -O0):
<uniform_distribution>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
movaps %xmm0,%xmm1
movss  -0xc(%rbp),%xmm0
mov    0x2ea6(%rip),%rax
movss  (%rax),%xmm2
movss  -0x8(%rbp),%xmm3
subss  -0x4(%rbp),%xmm3
divss  %xmm3,%xmm2
divss  %xmm2,%xmm1
addss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uniform_distribution>:
push   %rax
movss  %xmm1,0x4(%rsp)
movss  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
mov    0x2ebe(%rip),%rax
movss  (%rax),%xmm1
movss  (%rsp),%xmm2
movss  0x4(%rsp),%xmm3
subss  %xmm2,%xmm3
divss  %xmm3,%xmm1
divss  %xmm1,%xmm0
addss  %xmm2,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global float 0.000000e+00
define float @uniform_distribution(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = call float (...) @rand()
%7 = load float, float* @RAND_MAX
%8 = load float, float* %4
%9 = load float, float* %3
%10 = fsub float %8, %9
%11 = fdiv float %7, %10
%12 = fdiv float %6, %11
%13 = fadd float %5, %12
ret float %13
}

LLVM IR (-O2):
@RAND_MAX = global float 0.000000e+00
define float @uniform_distribution(float %0, float %1) {
%3 = tail call float (...) @rand()
%4 = load float, float* @RAND_MAX
%5 = fsub float %1, %0
%6 = fdiv float %4, %5
%7 = fdiv float %3, %6
%8 = fadd float %7, %0
ret float %8
}
int comp(const void *a, const void *b) {
  return (*(int(*)[2])a)[0] - (*(int(*)[2])b)[0];
}


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

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

LLVM IR (-O0):
define i32 @comp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to [2 x i32]*
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%8 = load i32, i32* %7
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to [2 x i32]*
%11 = getelementptr inbounds [2 x i32], [2 x i32]* %10, i64 0, i64 0
%12 = load i32, i32* %11
%13 = sub nsw i32 %8, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @comp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
void vbiosFinal() {}


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

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

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

LLVM IR (-O2):
define void @vbiosFinal() {
ret void
}
/* Variables and functions */
double absolute(float);
float triangle_area(float xa, float xb, float ya, float yb) {
  return (absolute(xa - xb) * absolute(ya - yb)) / 2.0;
}


x86 assembly (clang, -O0):
<triangle_area>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
call   1030 <absolute@plt>
movsd  %xmm0,-0x18(%rbp)
movss  -0xc(%rbp),%xmm0
subss  -0x10(%rbp),%xmm0
call   1030 <absolute@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe9d(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<triangle_area>:
sub    $0x18,%rsp
movss  %xmm3,0xc(%rsp)
movss  %xmm2,0x8(%rsp)
subss  %xmm1,%xmm0
call   1030 <absolute@plt>
movsd  %xmm0,0x10(%rsp)
movss  0x8(%rsp),%xmm0
subss  0xc(%rsp),%xmm0
call   1030 <absolute@plt>
mulsd  0x10(%rsp),%xmm0
mulsd  0xeb2(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define float @triangle_area(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = load float, float* %5
%10 = load float, float* %6
%11 = fsub float %9, %10
%12 = call double @absolute(float %11)
%13 = load float, float* %7
%14 = load float, float* %8
%15 = fsub float %13, %14
%16 = call double @absolute(float %15)
%17 = fmul double %12, %16
%18 = fdiv double %17, 2.000000e+00
%19 = fptrunc double %18 to float
ret float %19
}

LLVM IR (-O2):
define float @triangle_area(float %0, float %1, float %2, float %3) {
%5 = fsub float %0, %1
%6 = tail call double @absolute(float %5)
%7 = fsub float %2, %3
%8 = tail call double @absolute(float %7)
%9 = fmul double %6, %8
%10 = fmul double %9, 5.000000e-01
%11 = fptrunc double %10 to float
ret float %11
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ syscall(int, char const *, char *, size_t);
ssize_t listxattr(const char *path, char *list, size_t size) {
  return syscall(194, path, list, size);
}


x86 assembly (clang, -O0):
<listxattr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0xc2,%edi
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<listxattr>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0xc2,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @listxattr(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @syscall(i32 194, i8* %0, i8* %1, i64 %2)
ret i32 %4
}
/* Type definitions */
typedef int uint16_t;

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


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

x86 assembly (clang, -O2):
<safe>:
mov    %edi,%eax
and    $0x7fff,%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, 32767
ret i32 %4
}

LLVM IR (-O2):
define i32 @safe(i32 %0) {
%2 = and i32 %0, 32767
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printRowOfAsterisks(int numAsterisks) {
  int looper;
  for (looper = 1; looper <= numAsterisks; looper++)
    printf("* ");
  printf("\n");
  return;
}


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

x86 assembly (clang, -O2):
<printRowOfAsterisks>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
jle    114d <printRowOfAsterisks+0x2d>
mov    %edi,%ebx
lea    0xecf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1040 <printf@plt>
add    $0xffffffff,%ebx
jne    1140 <printRowOfAsterisks+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"* \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @printRowOfAsterisks(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
br label %4
4: ; preds = %10, %1
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp sle i32 %5, %6
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 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
%14 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"* \00"
define void @printRowOfAsterisks(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 1, %1 ]
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%6 = add nuw i32 %4, 1
%7 = icmp eq i32 %4, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
%9 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(
      stderr,
      "Usage: diodcat [OPTIONS] [-s HOST[:PORT]] [-a aname] [file [file...]]\n"
      "   -a,--aname NAME       file system (default ctl)\n"
      "   -s,--server HOST:PORT server (default localhost:564)\n"
      "   -m,--msize            msize (default 65536)\n"
      "   -u,--uid              authenticate as uid (default is your euid)\n"
      "   -t,--timeout SECS     give up after specified seconds\n"
      "   -p,--privport         connect from a privileged port (root user "
      "only)\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [423 x i8] c"Usage: diodcat [OPTIONS] [-s HOST[:PORT]] [-a aname] [file [file...]]\0A -a,--aname NAME file system (default ctl)\0A -s,--server HOST:PORT server (default localhost:564)\0A -m,--msize msize (default 65536)\0A -u,--uid authenticate as uid (default is your euid)\0A -t,--timeout SECS give up after specified seconds\0A -p,--privport connect from a privileged port (root user only)\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([423 x i8], [423 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [423 x i8] c"Usage: diodcat [OPTIONS] [-s HOST[:PORT]] [-a aname] [file [file...]]\0A -a,--aname NAME file system (default ctl)\0A -s,--server HOST:PORT server (default localhost:564)\0A -m,--msize msize (default 65536)\0A -u,--uid authenticate as uid (default is your euid)\0A -t,--timeout SECS give up after specified seconds\0A -p,--privport connect from a privileged port (root user only)\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([423 x i8], [423 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
char *getStackStr(void) {
  char str[] = {"Hello"};
  return str;
}


x86 assembly (clang, -O0):
<getStackStr>:
push   %rbp
mov    %rsp,%rbp
mov    0xef6(%rip),%eax
mov    %eax,-0x6(%rbp)
mov    0xef0(%rip),%ax
mov    %ax,-0x2(%rbp)
lea    -0x6(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getStackStr>:
lea    -0x6(%rsp),%rax
ret

LLVM IR (-O0):
@__const.getStackStr.str = [6 x i8] c"Hello\00"
define i8* @getStackStr() {
%1 = alloca [6 x i8]
%2 = bitcast [6 x i8]* %1 to i8*
%3 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
ret i8* %3
}

LLVM IR (-O2):
define noalias i8* @getStackStr() {
%1 = alloca [6 x i8]
%2 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
ret i8* %2
}
int daemonize() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @daemonize() {
ret i32 0
}
long long signum_fun_llong(long long a) { return (a != 0) | (a >> 63); }


x86 assembly (clang, -O0):
<signum_fun_llong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
cltq
mov    -0x8(%rbp),%rcx
sar    $0x3f,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<signum_fun_llong>:
xor    %eax,%eax
test   %rdi,%rdi
setne  %al
sar    $0x3f,%rdi
or     %rdi,%rax
ret

LLVM IR (-O0):
define i64 @signum_fun_llong(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ne i64 %3, 0
%5 = zext i1 %4 to i32
%6 = sext i32 %5 to i64
%7 = load i64, i64* %2
%8 = ashr i64 %7, 63
%9 = or i64 %6, %8
ret i64 %9
}

LLVM IR (-O2):
define i64 @signum_fun_llong(i64 %0) {
%2 = icmp ne i64 %0, 0
%3 = zext i1 %2 to i64
%4 = ashr i64 %0, 63
%5 = or i64 %4, %3
ret i64 %5
}
/* Type definitions */
struct qbman_result {
  int dummy;
};

/* Variables and functions */
int qbman_result_DQ_flags(struct qbman_result const *);
int qbman_result_DQ_is_pull(const struct qbman_result *dq) {
  return (int)(qbman_result_DQ_flags(dq) & 0x02);
}


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

x86 assembly (clang, -O2):
<qbman_result_DQ_is_pull>:
push   %rax
call   1030 <qbman_result_DQ_flags@plt>
and    $0x2,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.qbman_result = type { i32 }
define i32 @qbman_result_DQ_is_pull(%struct.qbman_result* %0) {
%2 = alloca %struct.qbman_result*
store %struct.qbman_result* %0, %struct.qbman_result** %2
%3 = load %struct.qbman_result*, %struct.qbman_result** %2
%4 = call i32 @qbman_result_DQ_flags(%struct.qbman_result* %3)
%5 = and i32 %4, 2
ret i32 %5
}

LLVM IR (-O2):
%struct.qbman_result = type { i32 }
define i32 @qbman_result_DQ_is_pull(%struct.qbman_result* %0) {
%2 = tail call i32 @qbman_result_DQ_flags(%struct.qbman_result* %0)
%3 = and i32 %2, 2
ret i32 %3
}
int check_end_array(char *items, int pos) {
  if (items[pos] == '\0') {
    return 1;
  }
  return !1;
}


x86 assembly (clang, -O0):
<check_end_array>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    112c <check_end_array+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    1133 <check_end_array+0x33>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_end_array>:
movslq %esi,%rcx
xor    %eax,%eax
cmpb   $0x0,(%rdi,%rcx,1)
sete   %al
ret

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

LLVM IR (-O2):
define i32 @check_end_array(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ utest_control();
void utest_adts_rbt(void) {
  utest_control();
  return;
}


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

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

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

LLVM IR (-O2):
define void @utest_adts_rbt() {
%1 = tail call i32 (...) @utest_control()
ret void
}
void g_cclosure_marshal_VOID__UINT() {}


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

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

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

LLVM IR (-O2):
define void @g_cclosure_marshal_VOID__UINT() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ctrl_ack_packet();
void musserv_send_ack(int fd) { ctrl_ack_packet(); }


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

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

LLVM IR (-O0):
define void @musserv_send_ack(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @ctrl_ack_packet()
ret void
}

LLVM IR (-O2):
define void @musserv_send_ack(i32 %0) {
%2 = tail call i32 (...) @ctrl_ack_packet()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
const char *as_string(void *data, uint32_t bytes) { return (const char *)data; }


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

x86 assembly (clang, -O2):
<as_string>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @as_string(i8* readnone returned %0, i32 %1) {
ret i8* %0
}