xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *, int);
int strlen(char *);
int main(void) {
  char a[80 + 1];
  int l;
  printf("Introduce una cadena (max. %d cars.): ", 80);
  gets(a);
  l = strlen(a);
  printf("Longitud de la cadena: %d\n", l);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x50,%esi
call   1040 <printf@plt>
lea    -0x60(%rbp),%rdi
call   1050 <gets@plt>
lea    -0x60(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x64(%rbp)
mov    -0x64(%rbp),%esi
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x60,%rsp
lea    0xec4(%rip),%rdi
mov    $0x50,%esi
call   1040 <printf@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <gets@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0xec7(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [39 x i8] c"Introduce una cadena (max. %d cars.): \00"
@.str.1 = [27 x i8] c"Longitud de la cadena: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [81 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 80)
%5 = getelementptr inbounds [81 x i8], [81 x i8]* %2, i64 0, i64 0
%6 = call i32 @gets(i8* %5)
%7 = getelementptr inbounds [81 x i8], [81 x i8]* %2, i64 0, i64 0
%8 = call i32 @strlen(i8* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [39 x i8] c"Introduce una cadena (max. %d cars.): \00"
@.str.1 = [27 x i8] c"Longitud de la cadena: %d\0A\00"
define i32 @main() {
%1 = alloca [81 x i8]
%2 = getelementptr inbounds [81 x i8], [81 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 80)
%4 = call i32 @gets(i8* %2)
%5 = call i32 @strlen(i8* %2)
%6 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ functionLargSmall(int *, int *);
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int largest, smallest;
  functionLargSmall(&largest, &smallest);
  printf("Largest: %d, smallest: %d\n", largest, smallest);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <functionLargSmall@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [27 x i8] c"Largest: %d, smallest: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @functionLargSmall(i32* %1, i32* %2)
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"Largest: %d, smallest: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @functionLargSmall(i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
ret i32 0
}
int write_to_mpoad(struct data_to_pass_st *pmsg) {
  int mpoad_fifo_fd = -1;
  int status = 0;
  int ret = 0;
  return status;
}


x86 assembly (clang, -O0):
<write_to_mpoad>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.data_to_pass_st = type opaque
define i32 @write_to_mpoad(%struct.data_to_pass_st* %0) {
%2 = alloca %struct.data_to_pass_st*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store %struct.data_to_pass_st* %0, %struct.data_to_pass_st** %2
store i32 -1, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
%6 = load i32, i32* %4
ret i32 %6
}

LLVM IR (-O2):
%struct.data_to_pass_st = type opaque
define i32 @write_to_mpoad(%struct.data_to_pass_st* nocapture readnone %0) {
ret i32 0
}
void ddmg(void *g) {}


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

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

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

LLVM IR (-O2):
define void @ddmg(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ wait_on_futex_value(int *, int);
int /*<<< orphan*/ wake_futex_blocking(int *);
void *threadfunc(void *p) {
  int *shared_data = (int *)p;
  printf("child waiting for A\n");
  wait_on_futex_value(shared_data, 0xA);
  printf("child writing B\n");
  *shared_data = 0xB;
  wake_futex_blocking(shared_data);
  return NULL;
}


x86 assembly (clang, -O0):
<threadfunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    $0xa,%esi
call   1040 <wait_on_futex_value@plt>
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
movl   $0xb,(%rax)
mov    -0x10(%rbp),%rdi
call   1050 <wake_futex_blocking@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<threadfunc>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1040 <wait_on_futex_value@plt>
lea    0xec0(%rip),%rdi
call   1030 <puts@plt>
movl   $0xb,(%rbx)
mov    %rbx,%rdi
call   1050 <wake_futex_blocking@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"child waiting for A\0A\00"
@.str.1 = [17 x i8] c"child writing B\0A\00"
define i8* @threadfunc(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%7 = load i32*, i32** %3
%8 = call i32 @wait_on_futex_value(i32* %7, i32 10)
%9 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%10 = load i32*, i32** %3
store i32 11, i32* %10
%11 = load i32*, i32** %3
%12 = call i32 @wake_futex_blocking(i32* %11)
ret i8* null
}

LLVM IR (-O2):
@str = [20 x i8] c"child waiting for A\00"
@str.2 = [16 x i8] c"child writing B\00"
define noalias i8* @threadfunc(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @wait_on_futex_value(i32* %2, i32 10)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.2, i64 0, i64 0))
store i32 11, i32* %2
%6 = tail call i32 @wake_futex_blocking(i32* %2)
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ panic(int);
void panic6() { panic(7); }


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

x86 assembly (clang, -O2):
<panic6>:
mov    $0x7,%edi
jmp    1030 <panic@plt>

LLVM IR (-O0):
define void @panic6() {
%1 = call i32 @panic(i32 7)
ret void
}

LLVM IR (-O2):
define void @panic6() {
%1 = tail call i32 @panic(i32 7)
ret void
}
unsigned char *inv_int16_to_big8(short x, unsigned char *big8) {
  big8[0] = (unsigned char)((x >> 8) & 0xff);
  big8[1] = (unsigned char)(x & 0xff);
  return big8;
}


x86 assembly (clang, -O0):
<inv_int16_to_big8>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movswl -0x2(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
movswl -0x2(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inv_int16_to_big8>:
mov    %rsi,%rax
rol    $0x8,%di
mov    %di,(%rsi)
ret

LLVM IR (-O0):
define i8* @inv_int16_to_big8(i16 signext %0, i8* %1) {
%3 = alloca i16
%4 = alloca i8*
store i16 %0, i16* %3
store i8* %1, i8** %4
%5 = load i16, i16* %3
%6 = sext i16 %5 to i32
%7 = ashr i32 %6, 8
%8 = and i32 %7, 255
%9 = trunc i32 %8 to i8
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i64 0
store i8 %9, i8* %11
%12 = load i16, i16* %3
%13 = sext i16 %12 to i32
%14 = and i32 %13, 255
%15 = trunc i32 %14 to i8
%16 = load i8*, i8** %4
%17 = getelementptr inbounds i8, i8* %16, i64 1
store i8 %15, i8* %17
%18 = load i8*, i8** %4
ret i8* %18
}

LLVM IR (-O2):
define i8* @inv_int16_to_big8(i16 signext %0, i8* returned writeonly %1) {
%3 = lshr i16 %0, 8
%4 = trunc i16 %3 to i8
store i8 %4, i8* %1
%5 = trunc i16 %0 to i8
%6 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %5, i8* %6
ret i8* %1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int stats_init_and_reg(void *a, uint8_t b, uint8_t c, void *d, uint8_t e,
                       void *f) {
  return 0;
}


x86 assembly (clang, -O0):
<stats_init_and_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9,-0x28(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @stats_init_and_reg(i8* nocapture readnone %0, i32 %1, i32 %2, i8* nocapture readnone %3, i32 %4, i8* nocapture readnone %5) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ new_block_simplex(int /*<<< orphan*/);
void free_simplex_storage(void) { new_block_simplex(0); }


x86 assembly (clang, -O0):
<free_simplex_storage>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <new_block_simplex@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @free_simplex_storage() {
%1 = call i32 @new_block_simplex(i32 0)
ret void
}

LLVM IR (-O2):
define void @free_simplex_storage() {
%1 = tail call i32 @new_block_simplex(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Absolute(int);
int /*<<< orphan*/ TSB8(int /*<<< orphan*/);
void Op0CM1(void) { TSB8(Absolute(3)); }


x86 assembly (clang, -O0):
<Op0CM1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1040 <Absolute@plt>
mov    %eax,%edi
call   1030 <TSB8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Op0CM1>:
push   %rax
mov    $0x3,%edi
call   1040 <Absolute@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <TSB8@plt>

LLVM IR (-O0):
define void @Op0CM1() {
%1 = call i32 @Absolute(i32 3)
%2 = call i32 @TSB8(i32 %1)
ret void
}

LLVM IR (-O2):
define void @Op0CM1() {
%1 = tail call i32 @Absolute(i32 3)
%2 = tail call i32 @TSB8(i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int smbw_open(char *, int, int /*<<< orphan*/);
scalar_t__ smbw_path(char *);
int stub1(char *, int, int /*<<< orphan*/);
int openx(char *name, int flags, mode_t mode, int (*f)(char *, int, mode_t)) {
  if (smbw_path(name)) {
    return smbw_open(name, flags, mode);
  }
  return (*f)(name, flags, mode);
}


x86 assembly (clang, -O0):
<openx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <smbw_path@plt>
cmp    $0x0,%rax
je     1160 <openx+0x40>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1030 <smbw_open@plt>
mov    %eax,-0x4(%rbp)
jmp    1173 <openx+0x53>
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   *%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<openx>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r15
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
call   1040 <smbw_path@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
test   %rax,%rax
je     1153 <openx+0x33>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <smbw_open@plt>
mov    %r15,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    *%rax

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

LLVM IR (-O2):
define i32 @openx(i8* %0, i32 %1, i32 %2, i32 (i8*, i32, i32)* nocapture %3) {
%5 = tail call i64 @smbw_path(i8* %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @smbw_open(i8* %0, i32 %1, i32 %2)
br label %11
9: ; preds = %4
%10 = tail call i32 %3(i8* %0, i32 %1, i32 %2)
br label %11
11: ; preds = %9, %7
%12 = phi i32 [ %8, %7 ], [ %10, %9 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ InitializeDefaultIDs();
int /*<<< orphan*/ InitializeSystemIDs();
void d2xx_table_initialize(void) {
  InitializeDefaultIDs();
  InitializeSystemIDs();
}


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

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

LLVM IR (-O0):
define void @d2xx_table_initialize() {
%1 = call i32 (...) @InitializeDefaultIDs()
%2 = call i32 (...) @InitializeSystemIDs()
ret void
}

LLVM IR (-O2):
define void @d2xx_table_initialize() {
%1 = tail call i32 (...) @InitializeDefaultIDs()
%2 = tail call i32 (...) @InitializeSystemIDs()
ret void
}
void geoMag(double x1, double x2, double *y1, double *y2) {
  *y1 = x1 + x2;
  *y2 = x1 - x2;
}


x86 assembly (clang, -O0):
<geoMag>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<geoMag>:
movapd %xmm0,%xmm2
addsd  %xmm1,%xmm2
movsd  %xmm2,(%rdi)
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rsi)
ret

LLVM IR (-O0):
define void @geoMag(double %0, double %1, double* %2, double* %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double*
%8 = alloca double*
store double %0, double* %5
store double %1, double* %6
store double* %2, double** %7
store double* %3, double** %8
%9 = load double, double* %5
%10 = load double, double* %6
%11 = fadd double %9, %10
%12 = load double*, double** %7
store double %11, double* %12
%13 = load double, double* %5
%14 = load double, double* %6
%15 = fsub double %13, %14
%16 = load double*, double** %8
store double %15, double* %16
ret void
}

LLVM IR (-O2):
define void @geoMag(double %0, double %1, double* nocapture writeonly %2, double* nocapture writeonly %3) {
%5 = fadd double %0, %1
store double %5, double* %2
%6 = fsub double %0, %1
store double %6, double* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stderr;
int main(void) {
  printf("REALOUTPUT: Hello standard output\n");
  fprintf(stderr, "REALOUTPUT: Hello standard error!\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [35 x i8] c"REALOUTPUT: Hello standard output\0A\00"
@stderr = global i32 0
@.str.1 = [35 x i8] c"REALOUTPUT: Hello standard error!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str.1 = [35 x i8] c"REALOUTPUT: Hello standard error!\0A\00"
@str = [34 x i8] c"REALOUTPUT: Hello standard output\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ myMain();
void loop() { myMain(); }


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

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

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

LLVM IR (-O2):
define void @loop() {
%1 = tail call i32 (...) @myMain()
ret void
}
/* Type definitions */
typedef int mode_t;
typedef int /*<<< orphan*/ dev_t;

/* Variables and functions */
int S_IFIFO;
int /*<<< orphan*/ _MKNOD_VER;
int __xmknod(int /*<<< orphan*/, char const *, int, int /*<<< orphan*/ *);
int mkfifo(const char *path, mode_t mode) {
  dev_t dev = 0;
  return __xmknod(_MKNOD_VER, path, mode | S_IFIFO, &dev);
}


x86 assembly (clang, -O0):
<mkfifo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    0x2ebb(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    0x2e9b(%rip),%rax
or     (%rax),%edx
lea    -0x10(%rbp),%rcx
call   1030 <__xmknod@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkfifo>:
push   %rax
mov    %esi,%edx
mov    %rdi,%rsi
movl   $0x0,0x4(%rsp)
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
mov    0x2eaa(%rip),%rax
or     (%rax),%edx
lea    0x4(%rsp),%rcx
call   1030 <__xmknod@plt>
pop    %rcx
ret

LLVM IR (-O0):
@_MKNOD_VER = global i32 0
@S_IFIFO = global i32 0
define i32 @mkfifo(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %5
%6 = load i32, i32* @_MKNOD_VER
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = load i32, i32* @S_IFIFO
%10 = or i32 %8, %9
%11 = call i32 @__xmknod(i32 %6, i8* %7, i32 %10, i32* %5)
ret i32 %11
}

LLVM IR (-O2):
@_MKNOD_VER = global i32 0
@S_IFIFO = global i32 0
define i32 @mkfifo(i8* %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%5 = load i32, i32* @_MKNOD_VER
%6 = load i32, i32* @S_IFIFO
%7 = or i32 %6, %1
%8 = call i32 @__xmknod(i32 %5, i8* %0, i32 %7, i32* %3)
ret i32 %8
}
void exec_idle(void) {}


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

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

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

LLVM IR (-O2):
define void @exec_idle() {
ret void
}
/* Variables and functions */
double log(int);
double log2(double n) { return log(n) / log(2); }


x86 assembly (clang, -O0):
<log2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%edi
call   1030 <log@plt>
movsd  %xmm0,-0x10(%rbp)
mov    $0x2,%edi
call   1030 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log2>:
push   %rax
cvttsd2si %xmm0,%edi
call   1030 <log@plt>
movsd  %xmm0,(%rsp)
mov    $0x2,%edi
call   1030 <log@plt>
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @log2(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fptosi double %3 to i32
%5 = call double @log(i32 %4)
%6 = call double @log(i32 2)
%7 = fdiv double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @log2(double %0) {
%2 = fptosi double %0 to i32
%3 = tail call double @log(i32 %2)
%4 = tail call double @log(i32 2)
%5 = fdiv double %3, %4
ret double %5
}
/* Type definitions */
struct util_node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct util_node *);
void util_free_node(struct util_node *node) { free(node); }


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

x86 assembly (clang, -O2):
<util_free_node>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.util_node = type { i32 }
define void @util_free_node(%struct.util_node* %0) {
%2 = alloca %struct.util_node*
store %struct.util_node* %0, %struct.util_node** %2
%3 = load %struct.util_node*, %struct.util_node** %2
%4 = call i32 @free(%struct.util_node* %3)
ret void
}

LLVM IR (-O2):
%struct.util_node = type { i32 }
define void @util_free_node(%struct.util_node* nocapture %0) {
%2 = tail call i32 @free(%struct.util_node* %0)
ret void
}
void splice_settransportstreamid(int tsid) {}


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

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

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

LLVM IR (-O2):
define void @splice_settransportstreamid(i32 %0) {
ret void
}
int si_has_missing_return() {}


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

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

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

LLVM IR (-O2):
define i32 @si_has_missing_return() {
ret i32 undef
}
int Operand_frt_decode(unsigned int *valp __attribute__((__unused__))) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @Operand_frt_decode(i32* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
struct Hero {
  int dummy;
};
struct Ability {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Hero_AddBuff(struct Hero *, int /*<<< orphan*/);
int /*<<< orphan*/ JiBenBianFaBuff_Get(int);
void JiBenBianFa_add_buff_to_attacker(struct Ability *self,
                                      struct Hero *attacker,
                                      struct Hero *target) {
  Hero_AddBuff(attacker, JiBenBianFaBuff_Get(99));
}


x86 assembly (clang, -O0):
<JiBenBianFa_add_buff_to_attacker>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    $0x63,%edi
call   1040 <JiBenBianFaBuff_Get@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
call   1030 <Hero_AddBuff@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<JiBenBianFa_add_buff_to_attacker>:
push   %rbx
mov    %rsi,%rbx
mov    $0x63,%edi
call   1040 <JiBenBianFaBuff_Get@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <Hero_AddBuff@plt>

LLVM IR (-O0):
%struct.Ability = type { i32 }
%struct.Hero = type { i32 }
define void @JiBenBianFa_add_buff_to_attacker(%struct.Ability* %0, %struct.Hero* %1, %struct.Hero* %2) {
%4 = alloca %struct.Ability*
%5 = alloca %struct.Hero*
%6 = alloca %struct.Hero*
store %struct.Ability* %0, %struct.Ability** %4
store %struct.Hero* %1, %struct.Hero** %5
store %struct.Hero* %2, %struct.Hero** %6
%7 = load %struct.Hero*, %struct.Hero** %5
%8 = call i32 @JiBenBianFaBuff_Get(i32 99)
%9 = call i32 @Hero_AddBuff(%struct.Hero* %7, i32 %8)
ret void
}

LLVM IR (-O2):
%struct.Ability = type { i32 }
%struct.Hero = type { i32 }
define void @JiBenBianFa_add_buff_to_attacker(%struct.Ability* nocapture readnone %0, %struct.Hero* %1, %struct.Hero* nocapture readnone %2) {
%4 = tail call i32 @JiBenBianFaBuff_Get(i32 99)
%5 = tail call i32 @Hero_AddBuff(%struct.Hero* %1, i32 %4)
ret void
}
/* Variables and functions */
scalar_t__ avoid_os_int_sort(int *, int);
int /*<<< orphan*/ os_sort_ints(int *, int, int *);
int /*<<< orphan*/ spr_sort_ints(int *, int, int *);
void sort_ints(int *iarr, int size, int *r_iarr) {
  if (avoid_os_int_sort(iarr, size))
    spr_sort_ints(iarr, size, r_iarr);
  else
    os_sort_ints(iarr, size, r_iarr);
}


x86 assembly (clang, -O0):
<sort_ints>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <avoid_os_int_sort@plt>
cmp    $0x0,%rax
je     116e <sort_ints+0x3e>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1050 <spr_sort_ints@plt>
jmp    117e <sort_ints+0x4e>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <os_sort_ints@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sort_ints>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebp
mov    %rdi,%rbx
call   1040 <avoid_os_int_sort@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14,%rdx
test   %rax,%rax
je     1157 <sort_ints+0x27>
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <spr_sort_ints@plt>
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <os_sort_ints@plt>

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

LLVM IR (-O2):
define void @sort_ints(i32* %0, i32 %1, i32* %2) {
%4 = tail call i64 @avoid_os_int_sort(i32* %0, i32 %1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @spr_sort_ints(i32* %0, i32 %1, i32* %2)
br label %10
8: ; preds = %3
%9 = tail call i32 @os_sort_ints(i32* %0, i32 %1, i32* %2)
br label %10
10: ; preds = %8, %6
ret void
}
int gcd(int a, int b) {
  if (b == 0) {
    return a;
  }
  return gcd(b, a % b);
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1133 <gcd+0x23>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1147 <gcd+0x37>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%esi
call   1030 <gcd@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %edi,%eax
test   %esi,%esi
je     111d <gcd+0x1d>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <gcd+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i32 [ %5, %4 ], [ %0, %2 ]
%7 = srem i32 %6, %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %5, %4 ]
ret i32 %10
}
int gcd(int nr1, int nr2) {
  int rest;
  if (nr1 == 0 || nr2 == 0)
    return 0;
  if (nr1 % nr2 == 0)
    return nr2;
  else {
    rest = nr1 % nr2;
    return (gcd(nr2, rest));
  }
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1132 <gcd+0x22>
cmpl   $0x0,-0xc(%rbp)
jne    113e <gcd+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    1171 <gcd+0x61>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1159 <gcd+0x49>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1171 <gcd+0x61>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <gcd@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %esi,%edx
mov    %edi,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %ecx,%ecx
test   %eax,%eax
je     1127 <gcd+0x27>
mov    %edx,%esi
test   %edx,%edx
je     1127 <gcd+0x27>
cltd
idiv   %esi
mov    %esi,%eax
mov    %esi,%ecx
test   %edx,%edx
jne    1110 <gcd+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
br label %3
3: ; preds = %9, %2
%4 = phi i32 [ %0, %2 ], [ %5, %9 ]
%5 = phi i32 [ %1, %2 ], [ %10, %9 ]
%6 = icmp eq i32 %4, 0
%7 = icmp eq i32 %5, 0
%8 = or i1 %6, %7
br i1 %8, label %12, label %9
9: ; preds = %3
%10 = srem i32 %4, %5
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %3
12: ; preds = %9, %3
%13 = phi i32 [ 0, %3 ], [ %5, %9 ]
ret i32 %13
}
void ScaleARGBCols_Any_NEON() {}


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

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

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

LLVM IR (-O2):
define void @ScaleARGBCols_Any_NEON() {
ret void
}
void reverse_recursor(char s[], int i, int j) {
  char temp;
  if (i < j) {
    reverse_recursor(s, i + 1, j - 1);
    temp = s[i];
    s[i] = s[j];
    s[j] = temp;
  }
}


x86 assembly (clang, -O0):
<reverse_recursor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1175 <reverse_recursor+0x65>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
sub    $0x1,%edx
call   1030 <reverse_recursor@plt>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x11(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse_recursor>:
cmp    %edx,%esi
jge    1148 <reverse_recursor+0x38>
push   %r15
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%r15d
mov    %rdi,%rbx
lea    0x1(%r15),%esi
lea    -0x1(%r14),%edx
call   1030 <reverse_recursor@plt>
movslq %r15d,%rax
mov    (%rbx,%rax,1),%sil
movslq %r14d,%rdx
mov    (%rbx,%rdx,1),%cl
mov    %cl,(%rbx,%rax,1)
mov    %sil,(%rbx,%rdx,1)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @reverse_recursor(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %36
11: ; preds = %3
%12 = load i8*, i8** %4
%13 = load i32, i32* %5
%14 = add nsw i32 %13, 1
%15 = load i32, i32* %6
%16 = sub nsw i32 %15, 1
%17 = load i8*, i8** %4
%18 = load i32, i32* %5
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %17, i64 %19
%21 = load i8, i8* %20
store i8 %21, i8* %7
%22 = load i8*, i8** %4
%23 = load i32, i32* %6
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8, i8* %22, i64 %24
%26 = load i8, i8* %25
%27 = load i8*, i8** %4
%28 = load i32, i32* %5
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i8, i8* %27, i64 %29
store i8 %26, i8* %30
%31 = load i8, i8* %7
%32 = load i8*, i8** %4
%33 = load i32, i32* %6
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds i8, i8* %32, i64 %34
store i8 %31, i8* %35
br label %36
36: ; preds = %11, %3
ret void
}

LLVM IR (-O2):
define void @reverse_recursor(i8* nocapture %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %6, label %5
5: ; preds = %3, %6
ret void
6: ; preds = %3
%7 = add nsw i32 %1, 1
%8 = add nsw i32 %2, -1
tail call void @reverse_recursor(i8* %0, i32 %7, i32 %8)
%9 = sext i32 %1 to i64
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = sext i32 %2 to i64
%13 = getelementptr inbounds i8, i8* %0, i64 %12
%14 = load i8, i8* %13
store i8 %14, i8* %10
store i8 %11, i8* %13
br label %5
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int f(int);
int main(void) {
  int y, z;
  if (y < 1000) {
    z = y;
    y = f(y);
    assert(y == z + 1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
jge    1165 <main+0x45>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <f@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
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
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 1000
br i1 %5, label %6, label %16
6: ; preds = %0
%7 = load i32, i32* %2
store i32 %7, i32* %3
%8 = load i32, i32* %2
%9 = call i32 @f(i32 %8)
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
%13 = icmp eq i32 %10, %12
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
br label %16
16: ; preds = %6, %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ puts(char *);
void handle_alarm(int sig) {
  puts("Client timed out...");
  exit(0);
}


x86 assembly (clang, -O0):
<handle_alarm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<handle_alarm>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"Client timed out...\00"
define void @handle_alarm(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @puts(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [20 x i8] c"Client timed out...\00"
define void @handle_alarm(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(int argc, char **argv) {
  puts("hello, world!");
  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)
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [14 x i8] c"hello, world!\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 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"hello, world!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
unsigned long long calculate_ref_size(unsigned long long total_msgs) {
  return sizeof(unsigned long long) * total_msgs;
}


x86 assembly (clang, -O0):
<calculate_ref_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x3,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculate_ref_size>:
lea    0x0(,%rdi,8),%rax
ret

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

LLVM IR (-O2):
define i64 @calculate_ref_size(i64 %0) {
%2 = shl i64 %0, 3
ret i64 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
void check_file_handle(FILE *file_handle, char *filename) {
  if (!file_handle) {
    printf("ERROR! I could not find the file %s", filename);
    printf("exiting...\n");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<check_file_handle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1165 <check_file_handle+0x45>
mov    -0x10(%rbp),%rsi
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_file_handle>:
test   %rdi,%rdi
je     1136 <check_file_handle+0x6>
ret
push   %rax
lea    0xec2(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"ERROR! I could not find the file %s\00"
@.str.1 = [12 x i8] c"exiting...\0A\00"
define void @check_file_handle(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i32*, i32** %3
%6 = icmp ne i32* %5, null
br i1 %6, label %12, label %7
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"ERROR! I could not find the file %s\00"
@str = [11 x i8] c"exiting...\00"
define void @check_file_handle(i32* readnone %0, i8* %1) {
%3 = icmp eq i32* %0, null
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %1)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
ret void
}
int toTheFifthPower(int x) { return x * (x * (x * (x * x))); }


x86 assembly (clang, -O0):
<toTheFifthPower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
mov    -0x4(%rbp),%edx
mov    -0x4(%rbp),%esi
imul   -0x4(%rbp),%esi
imul   %esi,%edx
imul   %edx,%ecx
imul   %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toTheFifthPower>:
mov    %edi,%eax
imul   %edi,%eax
imul   %eax,%edi
imul   %edi,%eax
ret

LLVM IR (-O0):
define i32 @toTheFifthPower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* %2
%6 = load i32, i32* %2
%7 = load i32, i32* %2
%8 = mul nsw i32 %6, %7
%9 = mul nsw i32 %5, %8
%10 = mul nsw i32 %4, %9
%11 = mul nsw i32 %3, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @toTheFifthPower(i32 %0) {
%2 = mul i32 %0, %0
%3 = mul i32 %2, %0
%4 = mul i32 %3, %2
ret i32 %4
}
/* Type definitions */
struct node {
  int dummy;
};

/* Variables and functions */
struct node *mk_none() {
  return NULL;
}


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

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

LLVM IR (-O0):
%struct.node = type { i32 }
define %struct.node* @mk_none() {
ret %struct.node* null
}

LLVM IR (-O2):
%struct.node = type { i32 }
define noalias %struct.node* @mk_none() {
ret %struct.node* null
}
/* Variables and functions */
void *memcpy(void *, void const *, size_t);
void *memcpy_caller(void *dst, const void *src, size_t n) {
  return memcpy(dst, src, n);
}


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

x86 assembly (clang, -O2):
<memcpy_caller>:
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define i8* @memcpy_caller(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
ret i8* %7
}

LLVM IR (-O2):
define i8* @memcpy_caller(i8* returned writeonly %0, i8* nocapture %1, i64 %2) {
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 %1, i64 %2, i1 false)
ret i8* %0
}
void rop3_63_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  stk1 = T & S;
  stk1 = ~stk1;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


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

x86 assembly (clang, -O2):
<rop3_63_0_1>:
not    %sil
and    %dl,%sil
not    %dl
and    (%rdi),%sil
or     %dl,%sil
mov    %sil,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_63_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %2, -1
%5 = xor i8 %1, -1
%6 = and i8 %5, %2
%7 = load i8, i8* %0
%8 = and i8 %6, %7
%9 = or i8 %8, %4
store i8 %9, i8* %0
ret void
}