xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
bool backspace(char **pos, char line[]) {
  if (*pos > line) {
    printf("\b \b");
    (*pos)--;
    return true;
  } else
    return false;
}


x86 assembly (clang, -O0):
<backspace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
cmp    -0x18(%rbp),%rax
jbe    1157 <backspace+0x47>
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    115e <backspace+0x4e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<backspace>:
push   %rbx
xor    %eax,%eax
cmp    %rsi,(%rdi)
jbe    1130 <backspace+0x20>
mov    %rdi,%rbx
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
addq   $0xffffffffffffffff,(%rbx)
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"\08 \08\00"
define i32 @backspace(i8** nocapture %0, i8* readnone %1) {
%3 = load i8*, i8** %0
%4 = icmp ugt i8* %3, %1
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%7 = load i8*, i8** %0
%8 = getelementptr inbounds i8, i8* %7, i64 -1
store i8* %8, i8** %0
br label %9
9: ; preds = %2, %5
%10 = phi i32 [ 1, %5 ], [ 0, %2 ]
ret i32 %10
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int recv_byte();
int /*<<< orphan*/ send_byte(int);
uint8_t debug_instr_1(uint8_t in0) {
  send_byte(0x55);
  send_byte(in0);
  return recv_byte();
}


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

x86 assembly (clang, -O2):
<debug_instr_1>:
push   %rbx
mov    %edi,%ebx
mov    $0x55,%edi
call   1040 <send_byte@plt>
mov    %ebx,%edi
call   1040 <send_byte@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <recv_byte@plt>

LLVM IR (-O0):
define i32 @debug_instr_1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @send_byte(i32 85)
%4 = load i32, i32* %2
%5 = call i32 @send_byte(i32 %4)
%6 = call i32 (...) @recv_byte()
ret i32 %6
}

LLVM IR (-O2):
define i32 @debug_instr_1(i32 %0) {
%2 = tail call i32 @send_byte(i32 85)
%3 = tail call i32 @send_byte(i32 %0)
%4 = tail call i32 (...) @recv_byte()
ret i32 %4
}
/* Type definitions */
struct avltree {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ avltree_destroy(struct avltree *);
int /*<<< orphan*/ free(struct avltree *);
void avltree_delete(struct avltree *__restrict tree) {
  avltree_destroy(tree);
  free(tree);
}


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

x86 assembly (clang, -O2):
<avltree_delete>:
push   %rbx
mov    %rdi,%rbx
call   1040 <avltree_destroy@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.avltree = type { i32 }
define void @avltree_delete(%struct.avltree* noalias %0) {
%2 = alloca %struct.avltree*
store %struct.avltree* %0, %struct.avltree** %2
%3 = load %struct.avltree*, %struct.avltree** %2
%4 = call i32 @avltree_destroy(%struct.avltree* %3)
%5 = load %struct.avltree*, %struct.avltree** %2
%6 = call i32 @free(%struct.avltree* %5)
ret void
}

LLVM IR (-O2):
%struct.avltree = type { i32 }
define void @avltree_delete(%struct.avltree* noalias %0) {
%2 = tail call i32 @avltree_destroy(%struct.avltree* %0)
%3 = tail call i32 @free(%struct.avltree* %0)
ret void
}
int shrink(int a) { return 4 * a / 5; }


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

x86 assembly (clang, -O2):
<shrink>:
shl    $0x2,%edi
movslq %edi,%rax
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x21,%rax
add    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @shrink(i32 %0) {
%2 = shl nsw i32 %0, 2
%3 = sdiv i32 %2, 5
ret i32 %3
}
int function(int a) {
  int b, c;
  b = 3;
  c = a + b;
  return c;
}


x86 assembly (clang, -O0):
<function>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<function>:
lea    0x3(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @function(i32 %0) {
%2 = add nsw i32 %0, 3
ret i32 %2
}
void busy(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<busy>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <busy+0x9>
jmp    1109 <busy+0x9>

x86 assembly (clang, -O2):
<busy>:
jmp    1100 <busy>

LLVM IR (-O0):
define void @busy() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @busy() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ imdireccion(int);
int /*<<< orphan*/ imparreglos(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int dimen;
  printf("¿Quieres tu arreglo de 1 o 2 dimensiones?\n");
  scanf("%d", &dimen);
  printf("%d\n", dimen);
  imparreglos(dimen);
  imdireccion(dimen);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec8(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
call   1050 <imparreglos@plt>
mov    -0x8(%rbp),%edi
call   1060 <imdireccion@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeaf(%rip),%rdi
call   1030 <puts@plt>
lea    0xe9c(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%esi
lea    0xe8a(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%rsp),%edi
call   1060 <imparreglos@plt>
mov    0x4(%rsp),%edi
call   1070 <imdireccion@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [44 x i8] c"\C2\BFQuieres tu arreglo de 1 o 2 dimensiones?\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %2
%8 = call i32 @imparreglos(i32 %7)
%9 = load i32, i32* %2
%10 = call i32 @imdireccion(i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [4 x i8] c"%d\0A\00"
@str = [43 x i8] c"\C2\BFQuieres tu arreglo de 1 o 2 dimensiones?\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %1
%8 = call i32 @imparreglos(i32 %7)
%9 = load i32, i32* %1
%10 = call i32 @imdireccion(i32 %9)
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t ntoh32(const uint8_t *src) {
  return (uint32_t)src[0] << 24 | (uint32_t)src[1] << 16 |
         (uint32_t)src[2] << 8 | src[3];
}


x86 assembly (clang, -O0):
<ntoh32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
or     0xc(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ntoh32>:
mov    (%rdi),%eax
mov    0x4(%rdi),%ecx
shl    $0x18,%eax
shl    $0x10,%ecx
or     %eax,%ecx
mov    0x8(%rdi),%eax
shl    $0x8,%eax
or     %ecx,%eax
or     0xc(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @ntoh32(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 24
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = shl i32 %5, 16
%7 = or i32 %6, %3
%8 = getelementptr inbounds i32, i32* %0, i64 2
%9 = load i32, i32* %8
%10 = shl i32 %9, 8
%11 = or i32 %7, %10
%12 = getelementptr inbounds i32, i32* %0, i64 3
%13 = load i32, i32* %12
%14 = or i32 %11, %13
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void print_version(void) {
  fprintf(stderr, "%s - HEX to binary conversion - version %s\n", "hex2image",
          "0.10.0");
  fprintf(stderr, "Copyright (C) 2007 Rodolfo Giometti <giometti@linux.it>\n");
}


x86 assembly (clang, -O0):
<print_version>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
lea    0xf01(%rip),%rdx
lea    0xf04(%rip),%rcx
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
lea    0xef4(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_version>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
lea    0xf04(%rip),%rdx
lea    0xf07(%rip),%rcx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xefe(%rip),%rsi
xor    %eax,%eax
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [44 x i8] c"%s - HEX to binary conversion - version %s\0A\00"
@.str.1 = [10 x i8] c"hex2image\00"
@.str.2 = [7 x i8] c"0.10.0\00"
@.str.3 = [57 x i8] c"Copyright (C) 2007 Rodolfo Giometti <giometti@linux.it>\0A\00"
define void @print_version() {
%1 = load i32, i32* @stderr
%2 = call i32 (i32, i8*, ...) @fprintf(i32 %1, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [44 x i8] c"%s - HEX to binary conversion - version %s\0A\00"
@.str.1 = [10 x i8] c"hex2image\00"
@.str.2 = [7 x i8] c"0.10.0\00"
@.str.3 = [57 x i8] c"Copyright (C) 2007 Rodolfo Giometti <giometti@linux.it>\0A\00"
define void @print_version() {
%1 = load i32, i32* @stderr
%2 = tail call i32 (i32, i8*, ...) @fprintf(i32 %1, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
int rand();
float bgbdt_part_randf() { return ((rand() & 32767) / 32767.0); }


x86 assembly (clang, -O0):
<bgbdt_part_randf>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
and    $0x7fff,%eax
cvtsi2sd %eax,%xmm0
movsd  0xed4(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<bgbdt_part_randf>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
and    $0x7fff,%eax
cvtsi2sd %eax,%xmm0
divsd  0xed7(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @bgbdt_part_randf() {
%1 = call i32 (...) @rand()
%2 = and i32 %1, 32767
%3 = sitofp i32 %2 to double
%4 = fdiv double %3, 3.276700e+04
%5 = fptrunc double %4 to float
ret float %5
}

LLVM IR (-O2):
define float @bgbdt_part_randf() {
%1 = tail call i32 (...) @rand()
%2 = and i32 %1, 32767
%3 = sitofp i32 %2 to double
%4 = fdiv double %3, 3.276700e+04
%5 = fptrunc double %4 to float
ret float %5
}
void CRYPTO_set_mem_debug_options(long bits) { return; }


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

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

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

LLVM IR (-O2):
define void @CRYPTO_set_mem_debug_options(i64 %0) {
ret void
}
/* Variables and functions */
int f2(int /*<<< orphan*/);
int f3() {
  int w;
  w = f2(0);
  return w;
}


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

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

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

LLVM IR (-O2):
define i32 @f3() {
%1 = tail call i32 @f2(i32 0)
ret i32 %1
}
/* Variables and functions */
int strlen(const char *str) {
  const char *wrk = str;
  int retval;
  for (retval = 0; *wrk != '\0'; wrk++)
    retval++;
  return retval;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1141 <strlen+0x41>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1117 <strlen+0x17>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,(%rdi)
je     111c <strlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = add nuw nsw i32 %5, 1
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %12
}
/* Variables and functions */
double __infer_nondet_double();
double sqrt(double x) { return __infer_nondet_double(); }


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

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

LLVM IR (-O0):
define double @sqrt(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call double (...) @__infer_nondet_double()
ret double %3
}

LLVM IR (-O2):
define double @sqrt(double %0) {
%2 = tail call double (...) @__infer_nondet_double()
ret double %2
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ y;
};
struct TYPE_4__ {
  TYPE_1__ max_logical_extent;
};
typedef TYPE_2__ XFontSetExtents;

/* Variables and functions */
short get_XFontSetExtents_max_logical_extent_y(void *_p) {
  return (short)((XFontSetExtents *)_p)->max_logical_extent.y;
}


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

x86 assembly (clang, -O2):
<get_XFontSetExtents_max_logical_extent_y>:
movzwl (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define signext i16 @get_XFontSetExtents_max_logical_extent_y(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i16
ret i16 %8
}

LLVM IR (-O2):
define signext i16 @get_XFontSetExtents_max_logical_extent_y(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i16
ret i16 %4
}
/* Variables and functions */
char *MD5Data(char *, int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *, int, char *, char *);
int /*<<< orphan*/ strlen(char *);
void MDString(char *string) {
  char buf[33];
  printf("MD%d (\"%s\") = %s\n", 5, string,
         MD5Data(string, strlen(string), buf));
}


x86 assembly (clang, -O0):
<MDString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x40(%rbp),%rdi
mov    %eax,%esi
lea    -0x30(%rbp),%rdx
call   1050 <MD5Data@plt>
mov    -0x38(%rbp),%rdx
mov    %rax,%rcx
lea    0xe8e(%rip),%rdi
mov    $0x5,%esi
call   1040 <printf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MDString>:
push   %rbx
sub    $0x30,%rsp
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rsp,%rdx
mov    %rbx,%rdi
mov    %eax,%esi
call   1050 <MD5Data@plt>
lea    0xeaf(%rip),%rdi
mov    $0x5,%esi
mov    %rbx,%rdx
mov    %rax,%rcx
call   1040 <printf@plt>
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"MD%d (\22%s\22) = %s\0A\00"
define void @MDString(i8* %0) {
%2 = alloca i8*
%3 = alloca [33 x i8]
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i8*, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 @strlen(i8* %6)
%8 = getelementptr inbounds [33 x i8], [33 x i8]* %3, i64 0, i64 0
%9 = call i8* @MD5Data(i8* %5, i32 %7, i8* %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 5, i8* %4, i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"MD%d (\22%s\22) = %s\0A\00"
define void @MDString(i8* %0) {
%2 = alloca [33 x i8]
%3 = getelementptr inbounds [33 x i8], [33 x i8]* %2, i64 0, i64 0
%4 = tail call i32 @strlen(i8* %0)
%5 = call i8* @MD5Data(i8* %0, i32 %4, i8* %3)
%6 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 5, i8* %0, i8* %5)
ret void
}
main() { int f(char *); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int leftBuddy(int n, int p) {
  int aux = 1;
  aux <<= n;
  p <<= (31 - n);
  p >>= (31 - n);
  if (aux == p) {
    return 0;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<leftBuddy>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x10(%rbp),%eax
shl    %cl,%eax
mov    %eax,-0x10(%rbp)
mov    $0x1f,%ecx
sub    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%eax
shl    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    $0x1f,%ecx
sub    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%eax
sar    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1154 <leftBuddy+0x54>
movl   $0x0,-0x4(%rbp)
jmp    115b <leftBuddy+0x5b>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<leftBuddy>:
mov    %edi,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    $0x1f,%al
sub    %cl,%al
mov    %eax,%ecx
shl    %cl,%esi
sar    %cl,%esi
xor    %eax,%eax
cmp    %esi,%edx
setne  %al
ret

LLVM IR (-O0):
define i32 @leftBuddy(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
store i32 1, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %6
%9 = shl i32 %8, %7
store i32 %9, i32* %6
%10 = load i32, i32* %4
%11 = sub nsw i32 31, %10
%12 = load i32, i32* %5
%13 = shl i32 %12, %11
store i32 %13, i32* %5
%14 = load i32, i32* %4
%15 = sub nsw i32 31, %14
%16 = load i32, i32* %5
%17 = ashr i32 %16, %15
store i32 %17, i32* %5
%18 = load i32, i32* %6
%19 = load i32, i32* %5
%20 = icmp eq i32 %18, %19
br i1 %20, label %21, label %22
21: ; preds = %2
store i32 0, i32* %3
br label %23
22: ; preds = %2
store i32 1, i32* %3
br label %23
23: ; preds = %22, %21
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @leftBuddy(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %0
%4 = sub nsw i32 31, %0
%5 = shl i32 %1, %4
%6 = ashr i32 %5, %4
%7 = icmp ne i32 %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
scalar_t__ malloc(int);
int *blinky(int pac[3]) {
  int *t = (int *)malloc(sizeof(int) * 2);
  t[0] = pac[0];
  t[1] = pac[1];
  return t;
}


x86 assembly (clang, -O0):
<blinky>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x8,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blinky>:
push   %rbx
mov    %rdi,%rbx
mov    $0x8,%edi
call   1030 <malloc@plt>
mov    (%rbx),%ecx
mov    %ecx,(%rax)
mov    0x4(%rbx),%ecx
mov    %ecx,0x4(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define i32* @blinky(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
store i32* %0, i32** %2
%4 = call i64 @malloc(i32 8)
%5 = inttoptr i64 %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 0
%8 = load i32, i32* %7
%9 = load i32*, i32** %3
%10 = getelementptr inbounds i32, i32* %9, i64 0
store i32 %8, i32* %10
%11 = load i32*, i32** %2
%12 = getelementptr inbounds i32, i32* %11, i64 1
%13 = load i32, i32* %12
%14 = load i32*, i32** %3
%15 = getelementptr inbounds i32, i32* %14, i64 1
store i32 %13, i32* %15
%16 = load i32*, i32** %3
ret i32* %16
}

LLVM IR (-O2):
define i32* @blinky(i32* nocapture %0) {
%2 = tail call i64 @malloc(i32 8)
%3 = inttoptr i64 %2 to i32*
%4 = load i32, i32* %0
store i32 %4, i32* %3
%5 = getelementptr inbounds i32, i32* %0, i64 1
%6 = load i32, i32* %5
%7 = getelementptr inbounds i32, i32* %3, i64 1
store i32 %6, i32* %7
ret i32* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char);
int main() {
  int i = 0;
  char c;
  for (i = 0; i <= 255l; i++) {
    c = i;
    printf("\n%d%c", i, c);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x8(%rbp)
movslq -0x8(%rbp),%rax
cmp    $0xff,%rax
jg     1164 <main+0x54>
mov    -0x8(%rbp),%eax
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeb3(%rip),%rdi
movsbl -0x9(%rbp),%edx
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
nopl   (%rax)
movsbl %bl,%edx
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x100,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c"\0A%d%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %2
br label %4
4: ; preds = %14, %0
%5 = load i32, i32* %2
%6 = sext i32 %5 to i64
%7 = icmp sle i64 %6, 255
br i1 %7, label %8, label %17
8: ; preds = %4
%9 = load i32, i32* %2
%10 = trunc i32 %9 to i8
store i8 %10, i8* %3
%11 = load i32, i32* %2
%12 = load i8, i8* %3
%13 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %11, i8 signext %12)
br label %14
14: ; preds = %8
%15 = load i32, i32* %2
%16 = add nsw i32 %15, 1
store i32 %16, i32* %2
br label %4
17: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"\0A%d%c\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %5, %1 ]
%3 = trunc i32 %2 to i8
%4 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %2, i8 signext %3)
%5 = add nuw nsw i32 %2, 1
%6 = icmp eq i32 %5, 256
br i1 %6, label %7, label %1
7: ; preds = %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ big_endian_dbl0(double *);
void big_endian_dbl(int n, double *d) {
  int i;
  for (i = 0; i < n; i++)
    big_endian_dbl0(&d[i]);
}


x86 assembly (clang, -O0):
<big_endian_dbl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1154 <big_endian_dbl+0x44>
mov    -0x10(%rbp),%rdi
movslq -0x14(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
call   1030 <big_endian_dbl0@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <big_endian_dbl+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<big_endian_dbl>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
jle    1132 <big_endian_dbl+0x22>
mov    %rsi,%rbx
mov    %edi,%r14d
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <big_endian_dbl0@plt>
add    $0x8,%rbx
add    $0xffffffffffffffff,%r14
jne    1120 <big_endian_dbl+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @big_endian_dbl(i32 %0, double* %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %10, %6 ]
%8 = getelementptr inbounds double, double* %1, i64 %7
%9 = tail call i32 @big_endian_dbl0(double* %8)
%10 = add nuw nsw i64 %7, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6, %2
ret void
}
/* Type definitions */
typedef int bits;

/* Variables and functions */
int /*<<< orphan*/ memset(unsigned long *, char, unsigned long);
void pc_init_bitmap(unsigned long *bitmap, char value, unsigned long bits) {
  unsigned long byte_count =
      ((int)sizeof(unsigned long)) *
      (((bits) + (((int)sizeof(unsigned long)) * 8) - 1) /
       (((int)sizeof(unsigned long)) * 8));
  memset(bitmap, value, byte_count);
}


x86 assembly (clang, -O0):
<pc_init_bitmap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x40,%rax
sub    $0x1,%rax
shr    $0x6,%rax
shl    $0x3,%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x9(%rbp),%al
mov    -0x20(%rbp),%rdx
movsbl %al,%esi
call   1030 <memset@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pc_init_bitmap>:
add    $0x3f,%rdx
shr    $0x3,%rdx
and    $0xfffffffffffffff8,%rdx
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @pc_init_bitmap(i64* %0, i8 signext %1, i64 %2) {
%4 = alloca i64*
%5 = alloca i8
%6 = alloca i64
%7 = alloca i64
store i64* %0, i64** %4
store i8 %1, i8* %5
store i64 %2, i64* %6
%8 = load i64, i64* %6
%9 = add i64 %8, 64
%10 = sub i64 %9, 1
%11 = udiv i64 %10, 64
%12 = mul i64 8, %11
store i64 %12, i64* %7
%13 = load i64*, i64** %4
%14 = load i8, i8* %5
%15 = load i64, i64* %7
%16 = call i32 @memset(i64* %13, i8 signext %14, i64 %15)
ret void
}

LLVM IR (-O2):
define void @pc_init_bitmap(i64* %0, i8 signext %1, i64 %2) {
%4 = add i64 %2, 63
%5 = lshr i64 %4, 3
%6 = and i64 %5, 2305843009213693944
%7 = tail call i32 @memset(i64* %0, i8 signext %1, i64 %6)
ret void
}
int main(void) {
  int a = 1;
  float b = 2.0;
  char *f = "hello";
  printf(a);
  printf(a, b, f);
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movss  0xed2(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x18(%rbp)
movslq -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0x8(%rbp),%rdi
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x18(%rbp),%rsi
mov    $0x1,%al
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee4(%rip),%rsi
movsd  0xed4(%rip),%xmm0
mov    $0x1,%edi
mov    $0x1,%al
call   1030 <printf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"hello\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
%4 = alloca i8*
store i32 0, i32* %1
store i32 1, i32* %2
store float 2.000000e+00, float* %3
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %4
%5 = load i32, i32* %2
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i8*
%8 = call i32 (i8*, ...) @printf(i8* %7)
%9 = load i32, i32* %2
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i8*
%12 = load float, float* %3
%13 = fpext float %12 to double
%14 = load i8*, i8** %4
%15 = call i32 (i8*, ...) @printf(i8* %11, double %13, i8* %14)
ret i32 1
}

LLVM IR (-O2):
@.str = [6 x i8] c"hello\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* inttoptr (i64 1 to i8*))
%2 = tail call i32 (i8*, ...) @printf(i8* inttoptr (i64 1 to i8*), double 2.000000e+00, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
int _mergeSort(int *, int *, int /*<<< orphan*/, int);
scalar_t__ malloc(int);
int mergeSort(int arr[], int array_size) {
  int *temp = (int *)malloc(sizeof(int) * array_size);
  return _mergeSort(arr, temp, 0, array_size - 1);
}


x86 assembly (clang, -O0):
<mergeSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
xor    %edx,%edx
call   1030 <_mergeSort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mergeSort>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
lea    0x0(,%rbx,4),%edi
call   1040 <malloc@plt>
add    $0xffffffff,%ebx
mov    %r14,%rdi
mov    %rax,%rsi
xor    %edx,%edx
mov    %ebx,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <_mergeSort@plt>

LLVM IR (-O0):
define i32 @mergeSort(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32*
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = mul i64 4, %7
%9 = trunc i64 %8 to i32
%10 = call i64 @malloc(i32 %9)
%11 = inttoptr i64 %10 to i32*
store i32* %11, i32** %5
%12 = load i32*, i32** %3
%13 = load i32*, i32** %5
%14 = load i32, i32* %4
%15 = sub nsw i32 %14, 1
%16 = call i32 @_mergeSort(i32* %12, i32* %13, i32 0, i32 %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @mergeSort(i32* %0, i32 %1) {
%3 = shl i32 %1, 2
%4 = tail call i64 @malloc(i32 %3)
%5 = inttoptr i64 %4 to i32*
%6 = add nsw i32 %1, -1
%7 = tail call i32 @_mergeSort(i32* %0, i32* %5, i32 0, i32 %6)
ret i32 %7
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int32_t is_space_or_eoln(char cc) { return ((unsigned char)cc) <= 32; }


x86 assembly (clang, -O0):
<is_space_or_eoln>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x20,%eax
setle  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_space_or_eoln>:
xor    %eax,%eax
cmp    $0x21,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @is_space_or_eoln(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp sle i32 %4, 32
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @is_space_or_eoln(i8 signext %0) {
%2 = icmp ult i8 %0, 33
%3 = zext i1 %2 to i32
ret i32 %3
}
void workaroundjnientrypoint() {}


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

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

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

LLVM IR (-O2):
define void @workaroundjnientrypoint() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void print_find(int succ) {
  if ((succ == 1) || (succ == 2))
    fprintf(stdout, "YES\n");
  else if (succ == 0)
    fprintf(stdout, "NO\n");
}


x86 assembly (clang, -O0):
<print_find>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
je     112f <print_find+0x1f>
cmpl   $0x2,-0x4(%rbp)
jne    1149 <print_find+0x39>
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
lea    0xec1(%rip),%rsi
call   1030 <fprintf@plt>
jmp    116d <print_find+0x5d>
cmpl   $0x0,-0x4(%rbp)
jne    1168 <print_find+0x58>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
lea    0xea2(%rip),%rsi
call   1030 <fprintf@plt>
jmp    116d <print_find+0x5d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_find>:
lea    -0x1(%rdi),%eax
cmp    $0x2,%eax
jae    1121 <print_find+0x11>
lea    0xee1(%rip),%rsi
jmp    112d <print_find+0x1d>
test   %edi,%edi
je     1126 <print_find+0x16>
ret
lea    0xed8(%rip),%rsi
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [5 x i8] c"YES\0A\00"
@.str.1 = [4 x i8] c"NO\0A\00"
define void @print_find(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 2
br i1 %7, label %8, label %11
8: ; preds = %5, %1
%9 = load i32, i32* @stdout
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %18
11: ; preds = %5
%12 = load i32, i32* %2
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %11
%15 = load i32, i32* @stdout
%16 = call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %17
17: ; preds = %14, %11
br label %18
18: ; preds = %17, %8
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [5 x i8] c"YES\0A\00"
@.str.1 = [4 x i8] c"NO\0A\00"
define void @print_find(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 2
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = icmp eq i32 %0, 0
br i1 %5, label %6, label %10
6: ; preds = %4, %1
%7 = phi i8* [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), %1 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), %4 ]
%8 = load i32, i32* @stdout
%9 = tail call i32 @fprintf(i32 %8, i8* %7)
br label %10
10: ; preds = %6, %4
ret void
}
__attribute__((always_)) void set_bit(int nr, volatile unsigned long *addr) {
  __asm__ __volatile__("lock ; "
                       "btsl %1,%0"
                       : "=m"((*(volatile long *)addr))
                       : "Ir"(nr));
}


x86 assembly (clang, -O0):
<set_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
lock bts %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_bit>:
lock bts %edi,(%rsi)
ret

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

LLVM IR (-O2):
define void @set_bit(i32 %0, i64* %1) {
tail call void asm sideeffect "lock ; btsl $1,$0", "=*m,Ir,~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %1, i32 %0)
ret void
}
f5(a) long a;
{
  int i;
  for (i = 0; i < 10; i++) {
    if (++a == 0)
      return i;
  }
  return -1;
}


x86 assembly (clang, -O0):
<f5>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jge    114d <f5+0x4d>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    113a <f5+0x3a>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1154 <f5+0x54>
jmp    113f <f5+0x3f>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    110f <f5+0xf>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f5>:
cmp    $0xfffffffffffffff6,%rdi
not    %edi
mov    $0xffffffff,%eax
cmovae %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @f5(i64 %0) {
%2 = icmp ugt i64 %0, -11
%3 = trunc i64 %0 to i32
%4 = xor i32 %3, -1
%5 = select i1 %2, i32 %4, i32 -1
ret i32 %5
}
void shell_init() {}


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

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

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

LLVM IR (-O2):
define void @shell_init() {
ret void
}
/* Variables and functions */
scalar_t__ rand_word();
double rand_uniopen(void) {
  return (0.5 + (double)rand_word()) / (1.0 + (double)0x7fffffff);
}


x86 assembly (clang, -O0):
<rand_uniopen>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand_word@plt>
cvtsi2sd %rax,%xmm1
movsd  0xee0(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  0xecc(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_uniopen>:
push   %rax
xor    %eax,%eax
call   1030 <rand_word@plt>
cvtsi2sd %rax,%xmm0
addsd  0xedb(%rip),%xmm0
mulsd  0xedb(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @rand_uniopen() {
%1 = call i64 (...) @rand_word()
%2 = sitofp i64 %1 to double
%3 = fadd double 5.000000e-01, %2
%4 = fdiv double %3, 0x41E0000000000000
ret double %4
}

LLVM IR (-O2):
define double @rand_uniopen() {
%1 = tail call i64 (...) @rand_word()
%2 = sitofp i64 %1 to double
%3 = fadd double %2, 5.000000e-01
%4 = fmul double %3, 0x3E00000000000000
ret double %4
}
/* Type definitions */
struct templatevars {
  int dummy;
};

/* Variables and functions */
char *tpl_getTpl(struct templatevars *, char *);
char *send_oscam_graph(struct templatevars *vars) {
  return tpl_getTpl(vars, "GRAPH");
}


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

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

LLVM IR (-O0):
%struct.templatevars = type { i32 }
@.str = [6 x i8] c"GRAPH\00"
define i8* @send_oscam_graph(%struct.templatevars* %0) {
%2 = alloca %struct.templatevars*
store %struct.templatevars* %0, %struct.templatevars** %2
%3 = load %struct.templatevars*, %struct.templatevars** %2
%4 = call i8* @tpl_getTpl(%struct.templatevars* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i8* %4
}

LLVM IR (-O2):
%struct.templatevars = type { i32 }
@.str = [6 x i8] c"GRAPH\00"
define i8* @send_oscam_graph(%struct.templatevars* %0) {
%2 = tail call i8* @tpl_getTpl(%struct.templatevars* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
int read_current() { return 1234; }


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

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

LLVM IR (-O0):
define i32 @read_current() {
ret i32 1234
}

LLVM IR (-O2):
define i32 @read_current() {
ret i32 1234
}
/* Type definitions */
typedef scalar_t__ uLong;

/* Variables and functions */
unsigned char decrypt_byte(uLong keys[3]) {
  unsigned short tmp;
  tmp = ((unsigned short)keys[2] & 0xffff) | 2;
  return (unsigned char)(((tmp * (tmp ^ 1)) >> 8) & 0xff);
}


x86 assembly (clang, -O0):
<decrypt_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%rax
movzwl %ax,%eax
and    $0xffff,%eax
or     $0x2,%eax
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
movzwl -0xa(%rbp),%ecx
xor    $0x1,%ecx
imul   %ecx,%eax
sar    $0x8,%eax
and    $0xff,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<decrypt_byte>:
mov    $0xfffd,%eax
and    0x10(%rdi),%eax
lea    0x2(%rax),%ecx
xor    $0x3,%eax
imul   %ecx,%eax
shr    $0x8,%eax
ret

LLVM IR (-O0):
define zeroext i8 @decrypt_byte(i64* %0) {
%2 = alloca i64*
%3 = alloca i16
store i64* %0, i64** %2
%4 = load i64*, i64** %2
%5 = getelementptr inbounds i64, i64* %4, i64 2
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i16
%8 = zext i16 %7 to i32
%9 = and i32 %8, 65535
%10 = or i32 %9, 2
%11 = trunc i32 %10 to i16
store i16 %11, i16* %3
%12 = load i16, i16* %3
%13 = zext i16 %12 to i32
%14 = load i16, i16* %3
%15 = zext i16 %14 to i32
%16 = xor i32 %15, 1
%17 = mul nsw i32 %13, %16
%18 = ashr i32 %17, 8
%19 = and i32 %18, 255
%20 = trunc i32 %19 to i8
ret i8 %20
}

LLVM IR (-O2):
define zeroext i8 @decrypt_byte(i64* nocapture %0) {
%2 = getelementptr inbounds i64, i64* %0, i64 2
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = and i32 %4, 65533
%6 = or i32 %5, 2
%7 = xor i32 %5, 3
%8 = mul nuw nsw i32 %6, %7
%9 = lshr i32 %8, 8
%10 = trunc i32 %9 to i8
ret i8 %10
}
/* Type definitions */
struct mdinfo {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, unsigned long long);
int sysfs_set_str(struct mdinfo *, struct mdinfo *, char *, char *);
int sysfs_set_num(struct mdinfo *sra, struct mdinfo *dev, char *name,
                  unsigned long long val) {
  char valstr[50];
  sprintf(valstr, "%llu", val);
  return sysfs_set_str(sra, dev, name, valstr);
}


x86 assembly (clang, -O0):
<sysfs_set_num>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
lea    -0x60(%rbp),%rdi
mov    -0x20(%rbp),%rdx
lea    0xeb9(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    -0x60(%rbp),%rcx
call   1030 <sysfs_set_str@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sysfs_set_num>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
lea    0xec5(%rip),%rsi
mov    %rsp,%r12
mov    %r12,%rdi
mov    %rcx,%rdx
call   1040 <sprintf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
mov    %r12,%rcx
call   1030 <sysfs_set_str@plt>
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.mdinfo = type { i32 }
@.str = [5 x i8] c"%llu\00"
define i32 @sysfs_set_num(%struct.mdinfo* %0, %struct.mdinfo* %1, i8* %2, i64 %3) {
%5 = alloca %struct.mdinfo*
%6 = alloca %struct.mdinfo*
%7 = alloca i8*
%8 = alloca i64
%9 = alloca [50 x i8]
store %struct.mdinfo* %0, %struct.mdinfo** %5
store %struct.mdinfo* %1, %struct.mdinfo** %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%10 = getelementptr inbounds [50 x i8], [50 x i8]* %9, i64 0, i64 0
%11 = load i64, i64* %8
%12 = call i32 @sprintf(i8* %10, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %11)
%13 = load %struct.mdinfo*, %struct.mdinfo** %5
%14 = load %struct.mdinfo*, %struct.mdinfo** %6
%15 = load i8*, i8** %7
%16 = getelementptr inbounds [50 x i8], [50 x i8]* %9, i64 0, i64 0
%17 = call i32 @sysfs_set_str(%struct.mdinfo* %13, %struct.mdinfo* %14, i8* %15, i8* %16)
ret i32 %17
}

LLVM IR (-O2):
%struct.mdinfo = type { i32 }
@.str = [5 x i8] c"%llu\00"
define i32 @sysfs_set_num(%struct.mdinfo* %0, %struct.mdinfo* %1, i8* %2, i64 %3) {
%5 = alloca [50 x i8]
%6 = getelementptr inbounds [50 x i8], [50 x i8]* %5, i64 0, i64 0
%7 = call i32 @sprintf(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %3)
%8 = call i32 @sysfs_set_str(%struct.mdinfo* %0, %struct.mdinfo* %1, i8* %2, i8* %6)
ret i32 %8
}
signed int float_to_signed_int(float src) { return src; }


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

x86 assembly (clang, -O2):
<float_to_signed_int>:
cvttss2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @float_to_signed_int(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fptosi float %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @float_to_signed_int(float %0) {
%2 = fptosi float %0 to i32
ret i32 %2
}