xunge/DecIR huggingface dataset:
/* Variables and functions */
int strncmp(char const *, char const *, size_t);
int ls_strncmp(const char *a, const char *b, size_t n) {
  if (a == b) {
    return 0;
  }
  if (a == NULL) {
    return -1;
  }
  if (b == NULL) {
    return 1;
  }
  return strncmp(a, b, n);
}


x86 assembly (clang, -O0):
<ls_strncmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    113e <ls_strncmp+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    1180 <ls_strncmp+0x70>
cmpq   $0x0,-0x10(%rbp)
jne    1155 <ls_strncmp+0x45>
movl   $0xffffffff,-0x4(%rbp)
jmp    1180 <ls_strncmp+0x70>
cmpq   $0x0,-0x18(%rbp)
jne    116c <ls_strncmp+0x5c>
movl   $0x1,-0x4(%rbp)
jmp    1180 <ls_strncmp+0x70>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <strncmp@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_strncmp>:
cmp    %rsi,%rdi
je     1124 <ls_strncmp+0x14>
test   %rdi,%rdi
je     1127 <ls_strncmp+0x17>
test   %rsi,%rsi
je     112d <ls_strncmp+0x1d>
jmp    1030 <strncmp@plt>
xor    %eax,%eax
ret
mov    $0xffffffff,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @ls_strncmp(i8* %0, i8* %1, i64 %2) {
%4 = icmp eq i8* %0, %1
br i1 %4, label %11, label %5
5: ; preds = %3
%6 = icmp eq i8* %0, null
br i1 %6, label %11, label %7
7: ; preds = %5
%8 = icmp eq i8* %1, null
br i1 %8, label %11, label %9
9: ; preds = %7
%10 = tail call i32 @strncmp(i8* %0, i8* %1, i64 %2)
br label %11
11: ; preds = %7, %5, %3, %9
%12 = phi i32 [ %10, %9 ], [ 0, %3 ], [ -1, %5 ], [ 1, %7 ]
ret i32 %12
}
int xen_smp_intr_init(unsigned int cpu) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @xen_smp_intr_init(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ glColor3f(double, double, double);
int /*<<< orphan*/ glutSolidCone(double, double, int, int);
void drawSCone(void) {
  glColor3f(1.5, 0.0, 0.2);
  glutSolidCone(5.0, 6.0, 30, 30);
}


x86 assembly (clang, -O0):
<drawSCone>:
push   %rbp
mov    %rsp,%rbp
movsd  0xee4(%rip),%xmm0
xorps  %xmm1,%xmm1
movsd  0xee1(%rip),%xmm2
call   1040 <glColor3f@plt>
movsd  0xebc(%rip),%xmm0
movsd  0xebc(%rip),%xmm1
mov    $0x1e,%esi
mov    %esi,%edi
call   1030 <glutSolidCone@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawSCone>:
push   %rax
movsd  0xed7(%rip),%xmm0
movsd  0xed7(%rip),%xmm2
xorps  %xmm1,%xmm1
call   1040 <glColor3f@plt>
movsd  0xecf(%rip),%xmm0
movsd  0xecf(%rip),%xmm1
mov    $0x1e,%edi
mov    $0x1e,%esi
pop    %rax
jmp    1030 <glutSolidCone@plt>

LLVM IR (-O0):
define void @drawSCone() {
%1 = call i32 @glColor3f(double 1.500000e+00, double 0.000000e+00, double 2.000000e-01)
%2 = call i32 @glutSolidCone(double 5.000000e+00, double 6.000000e+00, i32 30, i32 30)
ret void
}

LLVM IR (-O2):
define void @drawSCone() {
%1 = tail call i32 @glColor3f(double 1.500000e+00, double 0.000000e+00, double 2.000000e-01)
%2 = tail call i32 @glutSolidCone(double 5.000000e+00, double 6.000000e+00, i32 30, i32 30)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DecBin(int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  while (1) {
    scanf("%d", &n);
    if (n == -1)
      break;
    else
      DecBin(n);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <scanf@plt>
cmpl   $0xffffffff,-0x8(%rbp)
jne    114e <main+0x2e>
jmp    115b <main+0x3b>
mov    -0x8(%rbp),%edi
call   1040 <DecBin@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1030 <scanf@plt>
mov    0x4(%rsp),%edi
cmp    $0xffffffff,%edi
je     1169 <main+0x49>
lea    0xebb(%rip),%r14
lea    0x4(%rsp),%rbx
nopw   0x0(%rax,%rax,1)
call   1040 <DecBin@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <scanf@plt>
mov    0x4(%rsp),%edi
cmp    $0xffffffff,%edi
jne    1150 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, -1
br i1 %5, label %12, label %6
6: ; preds = %0, %6
%7 = phi i32 [ %10, %6 ], [ %4, %0 ]
%8 = call i32 @DecBin(i32 %7)
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%10 = load i32, i32* %1
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %6
12: ; preds = %6, %0
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char EOF;
char getc(int /*<<< orphan*/ *);
void readFile(FILE *in, char *str_in) {
  int i = 0;
  while (1) {
    char c = getc(in);
    str_in[i++] = c;
    if (c == EOF)
      break;
  }
}


x86 assembly (clang, -O0):
<readFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%dl
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x14(%rbp)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
movsbl -0x15(%rbp),%eax
mov    0x2e92(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1166 <readFile+0x56>
jmp    116b <readFile+0x5b>
jmp    1127 <readFile+0x17>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readFile>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
mov    0x2ec6(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
call   1030 <getc@plt>
mov    %al,(%rbx)
add    $0x1,%rbx
cmp    (%r15),%al
jne    1130 <readFile+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@EOF = global i8 0
define void @readFile(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8
store i32* %0, i32** %3
store i8* %1, i8** %4
store i32 0, i32* %5
br label %7
7: ; preds = %2, %22
%8 = load i32*, i32** %3
%9 = call signext i8 @getc(i32* %8)
store i8 %9, i8* %6
%10 = load i8, i8* %6
%11 = load i8*, i8** %4
%12 = load i32, i32* %5
%13 = add nsw i32 %12, 1
store i32 %13, i32* %5
%14 = sext i32 %12 to i64
%15 = getelementptr inbounds i8, i8* %11, i64 %14
store i8 %10, i8* %15
%16 = load i8, i8* %6
%17 = sext i8 %16 to i32
%18 = load i8, i8* @EOF
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %17, %19
br i1 %20, label %21, label %22
21: ; preds = %7
br label %23
22: ; preds = %7
br label %7
23: ; preds = %21
ret void
}

LLVM IR (-O2):
@EOF = global i8 0
define void @readFile(i32* nocapture %0, i8* nocapture writeonly %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %6, %3 ], [ 0, %2 ]
%5 = tail call signext i8 @getc(i32* %0)
%6 = add nuw i64 %4, 1
%7 = getelementptr inbounds i8, i8* %1, i64 %4
store i8 %5, i8* %7
%8 = load i8, i8* @EOF
%9 = icmp eq i8 %5, %8
br i1 %9, label %10, label %3
10: ; preds = %3
ret void
}
void foo_1_1_1_1_1_2_1_2_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_1_1_1_1_2_1_2_2() {
ret void
}
/* Variables and functions */
short get_eeprom_data(int);
int get_afedriusb_main_clock(void) {
  char c[4];
  int *main_clock_freq;
  short int *result1;
  short int *result2;
  main_clock_freq = (int *)&c[0];
  result1 = (short int *)&c[0];
  result2 = (short int *)&c[2];
  result1[0] = get_eeprom_data(0x0000);
  result2[0] = get_eeprom_data(0x0001);
  return main_clock_freq[0];
}


x86 assembly (clang, -O0):
<get_afedriusb_main_clock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x4(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x20(%rbp)
xor    %edi,%edi
call   1030 <get_eeprom_data@plt>
mov    %ax,%cx
mov    -0x18(%rbp),%rax
mov    %cx,(%rax)
mov    $0x1,%edi
call   1030 <get_eeprom_data@plt>
mov    %ax,%cx
mov    -0x20(%rbp),%rax
mov    %cx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_afedriusb_main_clock>:
push   %rbx
xor    %edi,%edi
call   1030 <get_eeprom_data@plt>
mov    %eax,%ebx
mov    $0x1,%edi
call   1030 <get_eeprom_data@plt>
shl    $0x10,%eax
movzwl %bx,%ecx
or     %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @get_afedriusb_main_clock() {
%1 = alloca [4 x i8]
%2 = alloca i32*
%3 = alloca i16*
%4 = alloca i16*
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%6 = bitcast i8* %5 to i32*
store i32* %6, i32** %2
%7 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%8 = bitcast i8* %7 to i16*
store i16* %8, i16** %3
%9 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 2
%10 = bitcast i8* %9 to i16*
store i16* %10, i16** %4
%11 = call signext i16 @get_eeprom_data(i32 0)
%12 = load i16*, i16** %3
%13 = getelementptr inbounds i16, i16* %12, i64 0
store i16 %11, i16* %13
%14 = call signext i16 @get_eeprom_data(i32 1)
%15 = load i16*, i16** %4
%16 = getelementptr inbounds i16, i16* %15, i64 0
store i16 %14, i16* %16
%17 = load i32*, i32** %2
%18 = getelementptr inbounds i32, i32* %17, i64 0
%19 = load i32, i32* %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @get_afedriusb_main_clock() {
%1 = tail call signext i16 @get_eeprom_data(i32 0)
%2 = tail call signext i16 @get_eeprom_data(i32 1)
%3 = zext i16 %2 to i32
%4 = shl nuw i32 %3, 16
%5 = zext i16 %1 to i32
%6 = or i32 %4, %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char const *);
int /*<<< orphan*/ stderr;
void fatal(const char *message) {
  fprintf(stderr, message);
  exit(EXIT_FAILURE);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@EXIT_FAILURE = global i32 0
define void @fatal(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@EXIT_FAILURE = global i32 0
define void @fatal(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Type definitions */
struct __run_loop_task {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct __run_loop_task *);
void __run_loop_task_destroy(struct __run_loop_task *t) { free(t); }


x86 assembly (clang, -O0):
<__run_loop_task_destroy>:
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):
<__run_loop_task_destroy>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.__run_loop_task = type { i32 }
define void @__run_loop_task_destroy(%struct.__run_loop_task* nocapture %0) {
%2 = tail call i32 @free(%struct.__run_loop_task* %0)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int mode;
};
typedef TYPE_1__ XFocusChangeEvent;

/* Variables and functions */
void set_XFocusChangeEvent_mode(void *_p, int _v) {
  ((XFocusChangeEvent *)_p)->mode = (int)_v;
}


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

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

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

LLVM IR (-O2):
define void @set_XFocusChangeEvent_mode(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
void print_inst_RD_IMM(char *mnemonic, int rd, int im) { ; }


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

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

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

LLVM IR (-O2):
define void @print_inst_RD_IMM(i8* nocapture %0, i32 %1, i32 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(int *, int *, long);
int /*<<< orphan*/ memset(int *, int /*<<< orphan*/, long);
int /*<<< orphan*/ serial_init(int);
int /*<<< orphan*/ softvec_init();
int init(void) {
  extern int erodata, data_start, edata, bss_start, ebss;
  memcpy(&data_start, &erodata, (long)&edata - (long)&data_start);
  memset(&bss_start, 0, (long)&ebss - (long)&bss_start);
  softvec_init();
  serial_init(1);
  return 0;
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e7d(%rip),%rdi
mov    0x2e66(%rip),%rdx
sub    %rdi,%rdx
mov    0x2e84(%rip),%rsi
call   1040 <memcpy@plt>
mov    0x2e68(%rip),%rdi
mov    0x2e79(%rip),%rdx
sub    %rdi,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    $0x0,%al
call   1050 <softvec_init@plt>
mov    $0x1,%edi
call   1060 <serial_init@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rax
mov    0x2e80(%rip),%rdi
mov    0x2e69(%rip),%rdx
sub    %rdi,%rdx
mov    0x2e87(%rip),%rsi
call   1040 <memcpy@plt>
mov    0x2e6b(%rip),%rdi
mov    0x2e7c(%rip),%rdx
sub    %rdi,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
xor    %eax,%eax
call   1050 <softvec_init@plt>
mov    $0x1,%edi
call   1060 <serial_init@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@data_start = external global i32
@erodata = external global i32
@edata = external global i32
@bss_start = external global i32
@ebss = external global i32
define i32 @init() {
%1 = call i32 @memcpy(i32* @data_start, i32* @erodata, i64 sub nsw (i64 ptrtoint (i32* @edata to i64), i64 ptrtoint (i32* @data_start to i64)))
%2 = call i32 @memset(i32* @bss_start, i32 0, i64 sub nsw (i64 ptrtoint (i32* @ebss to i64), i64 ptrtoint (i32* @bss_start to i64)))
%3 = call i32 (...) @softvec_init()
%4 = call i32 @serial_init(i32 1)
ret i32 0
}

LLVM IR (-O2):
@data_start = external global i32
@erodata = external global i32
@edata = external global i32
@bss_start = external global i32
@ebss = external global i32
define i32 @init() {
%1 = tail call i32 @memcpy(i32* @data_start, i32* @erodata, i64 sub (i64 ptrtoint (i32* @edata to i64), i64 ptrtoint (i32* @data_start to i64)))
%2 = tail call i32 @memset(i32* @bss_start, i32 0, i64 sub (i64 ptrtoint (i32* @ebss to i64), i64 ptrtoint (i32* @bss_start to i64)))
%3 = tail call i32 (...) @softvec_init()
%4 = tail call i32 @serial_init(i32 1)
ret i32 0
}
void dbgpipe(const char *fmt, ...) { (void)fmt; }


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

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

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

LLVM IR (-O2):
define void @dbgpipe(i8* nocapture %0, ...) {
ret void
}
int(Memento_squeezing)(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @Memento_squeezing() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int send_command_expect_ok(int /*<<< orphan*/, char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char *);
int netplot_set_window_title(char *window_title) {
  char buffer[256];
  memset(buffer, 0, 256);
  snprintf(buffer, 256, "set frame_title=%s\n", window_title);
  return send_command_expect_ok(0, buffer);
}


x86 assembly (clang, -O0):
<netplot_set_window_title>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x110(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1040 <memset@plt>
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x100,%esi
lea    0xe97(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x110(%rbp),%rsi
xor    %edi,%edi
call   1050 <send_command_expect_ok@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<netplot_set_window_title>:
push   %r14
push   %rbx
sub    $0x108,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1040 <memset@plt>
lea    0xeaa(%rip),%rdx
mov    %r14,%rdi
mov    $0x100,%esi
mov    %rbx,%rcx
call   1030 <snprintf@plt>
xor    %edi,%edi
mov    %r14,%rsi
call   1050 <send_command_expect_ok@plt>
add    $0x108,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [20 x i8] c"set frame_title=%s\0A\00"
define i32 @netplot_set_window_title(i8* %0) {
%2 = alloca i8*
%3 = alloca [256 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = call i32 @memset(i8* %4, i32 0, i32 256)
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%7 = load i8*, i8** %2
%8 = call i32 @snprintf(i8* %6, i32 256, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%10 = call i32 @send_command_expect_ok(i32 0, i8* %9)
ret i32 %10
}

LLVM IR (-O2):
@.str = [20 x i8] c"set frame_title=%s\0A\00"
define i32 @netplot_set_window_title(i8* %0) {
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%4 = call i32 @memset(i8* %3, i32 0, i32 256)
%5 = call i32 @snprintf(i8* %3, i32 256, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %0)
%6 = call i32 @send_command_expect_ok(i32 0, i8* %3)
ret i32 %6
}
/* Variables and functions */
void *VirtualAlloc(int /*<<< orphan*/, int, int, int);
void *allocpages(int n) { return VirtualAlloc(0, n * 4096, 4096 + 8192, 4); }


x86 assembly (clang, -O0):
<allocpages>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
shl    $0xc,%esi
xor    %edi,%edi
mov    $0x3000,%edx
mov    $0x4,%ecx
call   1030 <VirtualAlloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allocpages>:
mov    %edi,%esi
shl    $0xc,%esi
xor    %edi,%edi
mov    $0x3000,%edx
mov    $0x4,%ecx
jmp    1030 <VirtualAlloc@plt>

LLVM IR (-O0):
define i8* @allocpages(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 4096
%5 = call i8* @VirtualAlloc(i32 0, i32 %4, i32 12288, i32 4)
ret i8* %5
}

LLVM IR (-O2):
define i8* @allocpages(i32 %0) {
%2 = shl nsw i32 %0, 12
%3 = tail call i8* @VirtualAlloc(i32 0, i32 %2, i32 12288, i32 4)
ret i8* %3
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void h265hvcc_set_bitdepth_luma_8(uint8_t *p, uint8_t val) {
  p[16] = 0xf8 | val;
}


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

x86 assembly (clang, -O2):
<h265hvcc_set_bitdepth_luma_8>:
or     $0xf8,%esi
mov    %esi,0x40(%rdi)
ret

LLVM IR (-O0):
define void @h265hvcc_set_bitdepth_luma_8(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = or i32 248, %5
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 16
store i32 %6, i32* %8
ret void
}

LLVM IR (-O2):
define void @h265hvcc_set_bitdepth_luma_8(i32* nocapture writeonly %0, i32 %1) {
%3 = or i32 %1, 248
%4 = getelementptr inbounds i32, i32* %0, i64 16
store i32 %3, i32* %4
ret void
}
int WordHash(char *word) {
  int i = 0;
  int hash = 0;
  while (word[i] != '\0') {
    hash += (word[i] - 97);
    i++;
  }
  return hash;
}


x86 assembly (clang, -O0):
<WordHash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     114e <WordHash+0x4e>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
sub    $0x61,%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <WordHash+0x16>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<WordHash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1124 <WordHash+0x24>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
add    %ecx,%eax
add    $0xffffff9f,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <WordHash+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @WordHash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %11, %4 ], [ 0, %1 ]
%6 = phi i8 [ %13, %4 ], [ %2, %1 ]
%7 = phi i32 [ %10, %4 ], [ 0, %1 ]
%8 = sext i8 %6 to i32
%9 = add i32 %7, -97
%10 = add i32 %9, %8
%11 = add nuw nsw i64 %5, 1
%12 = getelementptr inbounds i8, i8* %0, i64 %11
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
%16 = phi i32 [ 0, %1 ], [ %10, %4 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int main() {
  system("rm a.out");
  system("rm code.cpp");
  system("rm tmpdiff");
  system("rm runtime");
  system("rm output");
  system("rm result");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <system@plt>
lea    0xed7(%rip),%rdi
call   1030 <system@plt>
lea    0xed7(%rip),%rdi
call   1030 <system@plt>
lea    0xed6(%rip),%rdi
call   1030 <system@plt>
lea    0xed5(%rip),%rdi
call   1030 <system@plt>
lea    0xed3(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [9 x i8] c"rm a.out\00"
@.str.1 = [12 x i8] c"rm code.cpp\00"
@.str.2 = [11 x i8] c"rm tmpdiff\00"
@.str.3 = [11 x i8] c"rm runtime\00"
@.str.4 = [10 x i8] c"rm output\00"
@.str.5 = [10 x i8] c"rm result\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @system(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @system(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @system(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @system(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%6 = call i32 @system(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
%7 = call i32 @system(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"rm a.out\00"
@.str.1 = [12 x i8] c"rm code.cpp\00"
@.str.2 = [11 x i8] c"rm tmpdiff\00"
@.str.3 = [11 x i8] c"rm runtime\00"
@.str.4 = [10 x i8] c"rm output\00"
@.str.5 = [10 x i8] c"rm result\00"
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @system(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @system(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @system(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 @system(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
%6 = tail call i32 @system(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int SIGABRT;
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ printf(char *);
void sigabrt_function(int signum) {
  assert(signum == SIGABRT);
  printf("SIGABRT\n");
}


x86 assembly (clang, -O0):
<sigabrt_function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2eab(%rip),%rcx
cmp    (%rcx),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigabrt_function>:
push   %rax
mov    0x2eb8(%rip),%rcx
xor    %eax,%eax
cmp    %edi,(%rcx)
sete   %al
mov    %eax,%edi
call   1040 <assert@plt>
lea    0xec3(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@SIGABRT = global i32 0
@.str = [9 x i8] c"SIGABRT\0A\00"
define void @sigabrt_function(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGABRT
%5 = icmp eq i32 %3, %4
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@SIGABRT = global i32 0
@str = [8 x i8] c"SIGABRT\00"
define void @sigabrt_function(i32 %0) {
%2 = load i32, i32* @SIGABRT
%3 = icmp eq i32 %2, %0
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct filter_node {
  int dummy;
};

/* Variables and functions */
char *PrintFilterInternal(struct filter_node *);
int /*<<< orphan*/ printf(char *, char *);
void PrintFilter(struct filter_node *pf) {
  printf("%s\n", PrintFilterInternal(pf));
}


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

x86 assembly (clang, -O2):
<PrintFilter>:
push   %rax
call   1040 <PrintFilterInternal@plt>
lea    0xed3(%rip),%rdi
mov    %rax,%rsi
pop    %rax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
%struct.filter_node = type { i32 }
@.str = [4 x i8] c"%s\0A\00"
define void @PrintFilter(%struct.filter_node* %0) {
%2 = tail call i8* @PrintFilterInternal(%struct.filter_node* %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret void
}
void USBD_USR_DeviceResumed(void) {}


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

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

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

LLVM IR (-O2):
define void @USBD_USR_DeviceResumed() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *xmalloc(size_t size) {
  void *ptr = malloc(size);
  assert(size != 0);
  if (!ptr) {
    fprintf(stderr, "malloc call failed - this is pretty bad\n");
    exit(-2);
  }
  return ptr;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpq   $0x0,-0x10(%rbp)
jne    1195 <xmalloc+0x55>
mov    0x2e63(%rip),%rax
mov    (%rax),%edi
lea    0xe7a(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0xfffffffe,%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1050 <malloc@plt>
mov    %rax,%r14
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
test   %r14,%r14
je     116d <xmalloc+0x2d>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    0x2e6c(%rip),%rax
mov    (%rax),%edi
lea    0xe83(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0xfffffffe,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [41 x i8] c"malloc call failed - this is pretty bad\0A\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i64, i64* %2
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load i8*, i8** %3
%11 = icmp ne i8* %10, null
br i1 %11, label %16, label %12
12: ; preds = %1
%13 = load i32, i32* @stderr
%14 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%15 = call i32 @exit(i32 -2)
unreachable
16: ; preds = %1
%17 = load i8*, i8** %3
ret i8* %17
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [41 x i8] c"malloc call failed - this is pretty bad\0A\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp ne i64 %0, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = icmp eq i8* %2, null
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 @exit(i32 -2)
unreachable
11: ; preds = %1
ret i8* %2
}
/* Variables and functions */
double errorfun(double);
double sqrt(double);
double gauss(double a, double d, double x) {
  if (d <= 0.0)
    d = 1.0e-10;
  return (1.0 + errorfun((x - a) / (sqrt(2.0) * d))) / 2.0;
}


x86 assembly (clang, -O0):
<gauss>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     1152 <gauss+0x32>
movsd  0xeb3(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x18(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xe9f(%rip),%xmm0
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
call   1030 <errorfun@plt>
movaps %xmm0,%xmm1
movsd  0xe81(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  0xe6d(%rip),%xmm1
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gauss>:
push   %rax
subsd  %xmm0,%xmm2
movsd  0xee3(%rip),%xmm0
mulsd  %xmm1,%xmm0
xorpd  %xmm3,%xmm3
cmpnlesd %xmm3,%xmm1
andpd  %xmm1,%xmm0
movsd  0xed2(%rip),%xmm3
andnpd %xmm3,%xmm1
orpd   %xmm0,%xmm1
divsd  %xmm1,%xmm2
movapd %xmm2,%xmm0
call   1030 <errorfun@plt>
addsd  0xebd(%rip),%xmm0
mulsd  0xebd(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @gauss(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %5
%8 = fcmp ole double %7, 0.000000e+00
br i1 %8, label %9, label %10
9: ; preds = %3
store double 1.000000e-10, double* %5
br label %10
10: ; preds = %9, %3
%11 = load double, double* %6
%12 = load double, double* %4
%13 = fsub double %11, %12
%14 = call double @sqrt(double 2.000000e+00)
%15 = load double, double* %5
%16 = fmul double %14, %15
%17 = fdiv double %13, %16
%18 = call double @errorfun(double %17)
%19 = fadd double 1.000000e+00, %18
%20 = fdiv double %19, 2.000000e+00
ret double %20
}

LLVM IR (-O2):
define double @gauss(double %0, double %1, double %2) {
%4 = fcmp ugt double %1, 0.000000e+00
%5 = fsub double %2, %0
%6 = fmul double %1, 0x3FF6A09E667F3BCD
%7 = select i1 %4, double %6, double 0x3DE36FD255A2213C
%8 = fdiv double %5, %7
%9 = tail call double @errorfun(double %8)
%10 = fadd double %9, 1.000000e+00
%11 = fmul double %10, 5.000000e-01
ret double %11
}
unsigned long Read32(unsigned char *pByte) {
  unsigned long value = 0;
  value |= (unsigned long)pByte[0];
  value |= (unsigned long)pByte[1] << 8;
  value |= (unsigned long)pByte[2] << 16;
  value |= (unsigned long)pByte[3] << 24;
  return value;
}


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

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

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

LLVM IR (-O2):
define i64 @Read32(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i64
%7 = shl nuw nsw i64 %6, 8
%8 = or i64 %7, %3
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i64
%12 = shl nuw nsw i64 %11, 16
%13 = or i64 %8, %12
%14 = getelementptr inbounds i8, i8* %0, i64 3
%15 = load i8, i8* %14
%16 = zext i8 %15 to i64
%17 = shl nuw nsw i64 %16, 24
%18 = or i64 %13, %17
ret i64 %18
}
int doubled(int x) { return x + x; }


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

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

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

LLVM IR (-O2):
define i32 @doubled(i32 %0) {
%2 = shl nsw i32 %0, 1
ret i32 %2
}
void swapArrayElements(int *s, int p1, int p2) {
  int temp;
  temp = s[p1];
  s[p1] = s[p2];
  s[p2] = temp;
}


x86 assembly (clang, -O0):
<swapArrayElements>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swapArrayElements>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

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

LLVM IR (-O2):
define void @swapArrayElements(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
int charcmp(const void *a, const void *b) { return *(char *)a - *(char *)b; }


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

x86 assembly (clang, -O2):
<charcmp>:
movsbl (%rdi),%eax
movsbl (%rsi),%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @charcmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @charcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = sext i8 %3 to i32
%5 = load i8, i8* %1
%6 = sext i8 %5 to i32
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
scalar_t__ num_to_word_len(int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int i, t = 0;
  for (i = 1; i <= 1000; i++)
    t += num_to_word_len(i);
  printf("%d\n", t);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
jg     116d <main+0x4d>
mov    -0x8(%rbp),%edi
call   1030 <num_to_word_len@plt>
mov    %rax,%rcx
movslq -0xc(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113d <main+0x1d>
mov    -0xc(%rbp),%esi
lea    0xe89(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%ebp
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    %ebp,%edi
call   1030 <num_to_word_len@plt>
add    %eax,%ebx
add    $0x1,%ebp
cmp    $0x3e9,%ebp
jne    1130 <main+0x10>
lea    0xeb5(%rip),%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %6, %1 ]
%3 = phi i32 [ 1, %0 ], [ %7, %1 ]
%4 = tail call i64 @num_to_word_len(i32 %3)
%5 = trunc i64 %4 to i32
%6 = add i32 %2, %5
%7 = add nuw nsw i32 %3, 1
%8 = icmp eq i32 %7, 1001
br i1 %8, label %9, label %1
9: ; preds = %1
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}
void FullMemoryBarrier() { __asm__ __volatile__("mfence" : : : "memory"); }


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

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

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

LLVM IR (-O2):
define void @FullMemoryBarrier() {
tail call void asm sideeffect "mfence", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
double pair_tailcorr_switch3_eislater1s1scorr(void *pair_data,
                                              long center_index,
                                              long other_index, double rcut,
                                              double width) {
  double t1 = 0;
  return t1;
}


x86 assembly (clang, -O0):
<pair_tailcorr_switch3_eislater1s1scorr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
movsd  %xmm1,-0x28(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<pair_tailcorr_switch3_eislater1s1scorr>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @pair_tailcorr_switch3_eislater1s1scorr(i8* %0, i64 %1, i64 %2, double %3, double %4) {
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
%9 = alloca double
%10 = alloca double
%11 = alloca double
store i8* %0, i8** %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store double %3, double* %9
store double %4, double* %10
store double 0.000000e+00, double* %11
%12 = load double, double* %11
ret double %12
}

LLVM IR (-O2):
define double @pair_tailcorr_switch3_eislater1s1scorr(i8* nocapture readnone %0, i64 %1, i64 %2, double %3, double %4) {
ret double 0.000000e+00
}