xunge/DecIR huggingface dataset:
char *langRomTypeMasushitaSramInv() {
  return "Matsushita SRAM - Turbo 5.37MHz";
}


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

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

LLVM IR (-O0):
@.str = [32 x i8] c"Matsushita SRAM - Turbo 5.37MHz\00"
define i8* @langRomTypeMasushitaSramInv() {
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [32 x i8] c"Matsushita SRAM - Turbo 5.37MHz\00"
define i8* @langRomTypeMasushitaSramInv() {
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int minimum(int const **, int, int);
int /*<<< orphan*/ printf(char *, int);
void menuMinimum(const int grades[][4], int pupils, int tests) {
  printf("\n\nLowest grade: %d\n", minimum(grades, pupils, tests));
}


x86 assembly (clang, -O0):
<menuMinimum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <minimum@plt>
mov    %eax,%esi
lea    0xeb6(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [20 x i8] c"\0A\0ALowest grade: %d\0A\00"
define void @menuMinimum([4 x i32]* %0, i32 %1, i32 %2) {
%4 = alloca [4 x i32]*
%5 = alloca i32
%6 = alloca i32
store [4 x i32]* %0, [4 x i32]** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load [4 x i32]*, [4 x i32]** %4
%8 = bitcast [4 x i32]* %7 to i32**
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 @minimum(i32** %8, i32 %9, i32 %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"\0A\0ALowest grade: %d\0A\00"
define void @menuMinimum([4 x i32]* %0, i32 %1, i32 %2) {
%4 = bitcast [4 x i32]* %0 to i32**
%5 = tail call i32 @minimum(i32** %4, i32 %1, i32 %2)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}
int int_compare(int i1, int i2) {
  if (i1 < i2)
    return -1;
  else if (i1 > i2)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<int_compare>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1122 <int_compare+0x22>
movl   $0xffffffff,-0x4(%rbp)
jmp    1141 <int_compare+0x41>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    113a <int_compare+0x3a>
movl   $0x1,-0x4(%rbp)
jmp    1141 <int_compare+0x41>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_compare>:
xor    %ecx,%ecx
cmp    %esi,%edi
setg   %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @int_compare(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = icmp sgt i32 %0, %1
%5 = zext i1 %4 to i32
%6 = select i1 %3, i32 -1, i32 %5
ret i32 %6
}
int test_llist_print() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @test_llist_print() {
ret i32 0
}
/* Variables and functions */
int read(int const, char *, int);
int get_type(const int fd, char *type) {
  char buf[2];
  if (read(fd, buf, 2) != 2 || buf[0] != '0')
    return 1;
  *type = buf[1];
  return 0;
}


x86 assembly (clang, -O0):
<get_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x12(%rbp),%rsi
mov    $0x2,%edx
call   1030 <read@plt>
cmp    $0x2,%eax
jne    1146 <get_type+0x36>
movsbl -0x12(%rbp),%eax
cmp    $0x30,%eax
je     1152 <get_type+0x42>
movl   $0x1,-0x4(%rbp)
jmp    1162 <get_type+0x52>
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_type>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
lea    0xe(%rsp),%rsi
mov    $0x2,%edx
call   1030 <read@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    $0x2,%ecx
jne    1142 <get_type+0x32>
cmpb   $0x30,0xe(%rsp)
jne    1142 <get_type+0x32>
mov    0xf(%rsp),%al
mov    %al,(%rbx)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @get_type(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca [2 x i8]
store i32 %0, i32* %4
store i8* %1, i8** %5
%7 = load i32, i32* %4
%8 = getelementptr inbounds [2 x i8], [2 x i8]* %6, i64 0, i64 0
%9 = call i32 @read(i32 %7, i8* %8, i32 2)
%10 = icmp ne i32 %9, 2
br i1 %10, label %16, label %11
11: ; preds = %2
%12 = getelementptr inbounds [2 x i8], [2 x i8]* %6, i64 0, i64 0
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp ne i32 %14, 48
br i1 %15, label %16, label %17
16: ; preds = %11, %2
store i32 1, i32* %3
br label %21
17: ; preds = %11
%18 = getelementptr inbounds [2 x i8], [2 x i8]* %6, i64 0, i64 1
%19 = load i8, i8* %18
%20 = load i8*, i8** %5
store i8 %19, i8* %20
store i32 0, i32* %3
br label %21
21: ; preds = %17, %16
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @get_type(i32 %0, i8* nocapture writeonly %1) {
%3 = alloca [2 x i8]
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%5 = call i32 @read(i32 %0, i8* %4, i32 2)
%6 = icmp ne i32 %5, 2
%7 = load i8, i8* %4
%8 = icmp ne i8 %7, 48
%9 = select i1 %6, i1 true, i1 %8
br i1 %9, label %13, label %10
10: ; preds = %2
%11 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
%12 = load i8, i8* %11
store i8 %12, i8* %1
br label %13
13: ; preds = %2, %10
%14 = phi i32 [ 0, %10 ], [ 1, %2 ]
ret i32 %14
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ system(char *const);
int main() {
  char *const command = "ls -l";
  system(command);
  return EXIT_SUCCESS;
}


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"ls -l\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0))
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}

LLVM IR (-O2):
@.str = [6 x i8] c"ls -l\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
void snck_line_cleanup(struct snck_ctxt const *const p_ctxt) { (void)(p_ctxt); }


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

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

LLVM IR (-O0):
%struct.snck_ctxt = type opaque
define void @snck_line_cleanup(%struct.snck_ctxt* %0) {
%2 = alloca %struct.snck_ctxt*
store %struct.snck_ctxt* %0, %struct.snck_ctxt** %2
%3 = load %struct.snck_ctxt*, %struct.snck_ctxt** %2
ret void
}

LLVM IR (-O2):
%struct.snck_ctxt = type opaque
define void @snck_line_cleanup(%struct.snck_ctxt* nocapture %0) {
ret void
}
adr0reg1_set(r0, r1, x0, x1, p0, p1) int r0, r1;
int *p0, *p1;
{ (*((int *)10000000)) = r1; }


x86 assembly (clang, -O0):
<adr0reg1_set>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0x989680,%eax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adr0reg1_set>:
mov    %esi,0x989680
ret

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

LLVM IR (-O2):
define i32 @adr0reg1_set(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture readnone %4, i32* nocapture readnone %5) {
store i32 %1, i32* inttoptr (i64 10000000 to i32*)
ret i32 undef
}
void bar(float *p) { *p = 5.2; }


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  0xeec(%rip),%xmm0
movss  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
movl   $0x40a66666,(%rdi)
ret

LLVM IR (-O0):
define void @bar(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
store float 0x4014CCCCC0000000, float* %3
ret void
}

LLVM IR (-O2):
define void @bar(float* nocapture writeonly %0) {
store float 0x4014CCCCC0000000, float* %0
ret void
}
int return_int_0() { return -1073741825; }


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

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

LLVM IR (-O0):
define i32 @return_int_0() {
ret i32 -1073741825
}

LLVM IR (-O2):
define i32 @return_int_0() {
ret i32 -1073741825
}
/* Variables and functions */
int /*<<< orphan*/ __amd_remainder_piby2d2f(unsigned long long, double *,
                                            int *);
void __remainder_piby2d2f(unsigned long ux, double *r, int *region) {
  __amd_remainder_piby2d2f((unsigned long long)ux, r, region);
}


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

x86 assembly (clang, -O2):
<__remainder_piby2d2f>:
jmp    1030 <__amd_remainder_piby2d2f@plt>

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

LLVM IR (-O2):
define void @__remainder_piby2d2f(i64 %0, double* %1, i32* %2) {
%4 = tail call i32 @__amd_remainder_piby2d2f(i64 %0, double* %1, i32* %2)
ret void
}
extern void __attribute__((always_)) gui_ksys_finish_draw_window(void) {
  __asm__ __volatile__("int $0x40" : : "a"(12), "b"(2));
}


x86 assembly (clang, -O0):
<gui_ksys_finish_draw_window>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    $0xc,%eax
mov    $0x2,%ebx
int    $0x40
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<gui_ksys_finish_draw_window>:
push   %rbx
mov    $0xc,%eax
mov    $0x2,%ebx
int    $0x40
pop    %rbx
ret

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

LLVM IR (-O2):
define void @gui_ksys_finish_draw_window() {
tail call void asm sideeffect "int $$0x40", "{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32 12, i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ blob_in_bounds(int, int);
int track_bbox_left(int, int);
int track_bbox_right(int, int);
int track_bbox_width(int ch, int i) {
  if (!blob_in_bounds(ch, i))
    return -1;
  return track_bbox_right(ch, i) - track_bbox_left(ch, i) + 1;
}


x86 assembly (clang, -O0):
<track_bbox_width>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1050 <blob_in_bounds@plt>
cmp    $0x0,%eax
jne    115e <track_bbox_width+0x2e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1184 <track_bbox_width+0x54>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <track_bbox_right@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <track_bbox_left@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
sub    %ecx,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<track_bbox_width>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %edi,%ebp
call   1050 <blob_in_bounds@plt>
test   %eax,%eax
je     115f <track_bbox_width+0x2f>
mov    %ebp,%edi
mov    %r14d,%esi
call   1040 <track_bbox_right@plt>
mov    %eax,%ebx
mov    %ebp,%edi
mov    %r14d,%esi
call   1030 <track_bbox_left@plt>
sub    %eax,%ebx
add    $0x1,%ebx
jmp    1164 <track_bbox_width+0x34>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @track_bbox_width(i32 %0, i32 %1) {
%3 = tail call i32 @blob_in_bounds(i32 %0, i32 %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = tail call i32 @track_bbox_right(i32 %0, i32 %1)
%7 = tail call i32 @track_bbox_left(i32 %0, i32 %1)
%8 = add i32 %6, 1
%9 = sub i32 %8, %7
br label %10
10: ; preds = %2, %5
%11 = phi i32 [ %9, %5 ], [ -1, %2 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr,
          "usage: timings DATAFILE\n"
          "       cat DATAFILE | timings\n"
          "  DATAFILE has to contain a list of numbers, one per line.\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [114 x i8] c"usage: timings DATAFILE\0A cat DATAFILE | timings\0A DATAFILE has to contain a list of numbers, one per line.\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([114 x i8], [114 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [114 x i8] c"usage: timings DATAFILE\0A cat DATAFILE | timings\0A DATAFILE has to contain a list of numbers, one per line.\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([114 x i8], [114 x i8]* @.str, i64 0, i64 0))
ret void
}
void av_vorbis_parse_free() {}


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

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

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

LLVM IR (-O2):
define void @av_vorbis_parse_free() {
ret void
}
main() {
  int x = 12;
  if (x == 12)
    printf(x);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xc,-0x8(%rbp)
cmpl   $0xc,-0x8(%rbp)
jne    113b <main+0x2b>
movslq -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xc,%edi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* inttoptr (i64 12 to i8*))
ret i32 0
}
/* Variables and functions */
void glmCompMult3fs_(float x[3], float y) {
  for (size_t i = 0; i < 3; ++i)
    x[i] *= y;
}


x86 assembly (clang, -O0):
<glmCompMult3fs_>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x3,-0x18(%rbp)
jae    1148 <glmCompMult3fs_+0x48>
movss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mulss  (%rax,%rcx,4),%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1115 <glmCompMult3fs_+0x15>
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmCompMult3fs_>:
movss  (%rdi),%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,(%rdi)
movss  0x4(%rdi),%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,0x4(%rdi)
mulss  0x8(%rdi),%xmm0
movss  %xmm0,0x8(%rdi)
ret

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

LLVM IR (-O2):
define void @glmCompMult3fs_(float* nocapture %0, float %1) {
%3 = load float, float* %0
%4 = fmul float %3, %1
store float %4, float* %0
%5 = getelementptr inbounds float, float* %0, i64 1
%6 = load float, float* %5
%7 = fmul float %6, %1
store float %7, float* %5
%8 = getelementptr inbounds float, float* %0, i64 2
%9 = load float, float* %8
%10 = fmul float %9, %1
store float %10, float* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ srand(int);
int /*<<< orphan*/ test_api();
int /*<<< orphan*/ test_map();
int /*<<< orphan*/ test_shuffle();
int main(int argc, char **argv) {
  unsigned int i;
  srand(0xdeadbeef);
  test_api();
  for (i = 0; i < 4; ++i) {
    test_shuffle();
    test_map();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xdeadbeef,%edi
call   1050 <srand@plt>
mov    $0x0,%al
call   1030 <test_api@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jae    1194 <main+0x54>
mov    $0x0,%al
call   1040 <test_shuffle@plt>
mov    $0x0,%al
call   1060 <test_map@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    116e <main+0x2e>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xdeadbeef,%edi
call   1050 <srand@plt>
xor    %eax,%eax
call   1030 <test_api@plt>
xor    %eax,%eax
call   1040 <test_shuffle@plt>
xor    %eax,%eax
call   1060 <test_map@plt>
xor    %eax,%eax
call   1040 <test_shuffle@plt>
xor    %eax,%eax
call   1060 <test_map@plt>
xor    %eax,%eax
call   1040 <test_shuffle@plt>
xor    %eax,%eax
call   1060 <test_map@plt>
xor    %eax,%eax
call   1040 <test_shuffle@plt>
xor    %eax,%eax
call   1060 <test_map@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @srand(i32 -559038737)
%8 = call i32 (...) @test_api()
store i32 0, i32* %6
br label %9
9: ; preds = %15, %2
%10 = load i32, i32* %6
%11 = icmp ult i32 %10, 4
br i1 %11, label %12, label %18
12: ; preds = %9
%13 = call i32 (...) @test_shuffle()
%14 = call i32 (...) @test_map()
br label %15
15: ; preds = %12
%16 = load i32, i32* %6
%17 = add i32 %16, 1
store i32 %17, i32* %6
br label %9
18: ; preds = %9
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @srand(i32 -559038737)
%4 = tail call i32 (...) @test_api()
%5 = tail call i32 (...) @test_shuffle()
%6 = tail call i32 (...) @test_map()
%7 = tail call i32 (...) @test_shuffle()
%8 = tail call i32 (...) @test_map()
%9 = tail call i32 (...) @test_shuffle()
%10 = tail call i32 (...) @test_map()
%11 = tail call i32 (...) @test_shuffle()
%12 = tail call i32 (...) @test_map()
ret i32 0
}
void v4f_(vec) float vec[4];
{ vcall(vec, 4); }


x86 assembly (clang, -O0):
<v4f_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x4,%esi
mov    $0x0,%al
call   1030 <vcall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<v4f_>:
mov    $0x4,%esi
xor    %eax,%eax
jmp    1030 <vcall@plt>

LLVM IR (-O0):
define void @v4f_(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = call i32 (float*, i32, ...) bitcast (i32 (...)* @vcall to i32 (float*, i32, ...)*)(float* %3, i32 4)
ret void
}

LLVM IR (-O2):
define void @v4f_(float* %0) {
%2 = tail call i32 (float*, i32, ...) bitcast (i32 (...)* @vcall to i32 (float*, i32, ...)*)(float* %0, i32 4)
ret void
}
/* Variables and functions */
size_t vlad_sizeof(int k, int d, int flags) {
  size_t s = d * k;
  if (flags == 6)
    s *= 3;
  if (flags == 15)
    s *= 2;
  if (flags == 17)
    s *= 2;
  return s;
}


x86 assembly (clang, -O0):
<vlad_sizeof>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x4(%rbp),%eax
cltq
mov    %rax,-0x18(%rbp)
cmpl   $0x6,-0xc(%rbp)
jne    112d <vlad_sizeof+0x2d>
imul   $0x3,-0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0xf,-0xc(%rbp)
jne    1143 <vlad_sizeof+0x43>
mov    -0x18(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x11,-0xc(%rbp)
jne    1159 <vlad_sizeof+0x59>
mov    -0x18(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vlad_sizeof>:
imul   %esi,%edi
movslq %edi,%rcx
cmp    $0x6,%edx
lea    (%rcx,%rcx,2),%rax
cmovne %rcx,%rax
cmp    $0xf,%edx
sete   %cl
shl    %cl,%rax
cmp    $0x11,%edx
sete   %cl
shl    %cl,%rax
ret

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

LLVM IR (-O2):
define i64 @vlad_sizeof(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %1, %0
%5 = sext i32 %4 to i64
%6 = icmp eq i32 %2, 6
%7 = mul nsw i64 %5, 3
%8 = select i1 %6, i64 %7, i64 %5
%9 = icmp eq i32 %2, 15
%10 = zext i1 %9 to i64
%11 = shl nsw i64 %8, %10
%12 = icmp eq i32 %2, 17
%13 = zext i1 %12 to i64
%14 = shl nsw i64 %11, %13
ret i64 %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void function_receive_something_return_void(int a, int b) {
  printf("(a + b) = %d\n", a + b);
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"(a + b) = %d\0A\00"
define void @function_receive_something_return_void(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add nsw i32 %5, %6
%8 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"(a + b) = %d\0A\00"
define void @function_receive_something_return_void(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void bar(void) { printf("bar\n"); }


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"bar\0A\00"
define void @bar() {
%1 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [4 x i8] c"bar\00"
define void @bar() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
ret void
}
float fun_float(void) { return 1.5; }


x86 assembly (clang, -O0):
<fun_float>:
push   %rbp
mov    %rsp,%rbp
movss  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun_float>:
movss  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define float @fun_float() {
ret float 1.500000e+00
}

LLVM IR (-O2):
define float @fun_float() {
ret float 1.500000e+00
}
void _acrtused() {}


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

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

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

LLVM IR (-O2):
define void @_acrtused() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ f(int *, int *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  int t_b = 1;
  int t_a = 10;
  f(&t_a, &t_b);
#pragma omp taskwait
  if (t_b != 11) {
    fprintf(stderr, "t_b == %d != 11\n", t_b);
    abort();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
movl   $0xa,-0x18(%rbp)
lea    -0x18(%rbp),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <f@plt>
cmpl   $0xb,-0x14(%rbp)
je     118a <main+0x5a>
mov    0x2e6e(%rip),%rax
mov    (%rax),%edi
mov    -0x14(%rbp),%edx
lea    0xe82(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x1,(%rsp)
movl   $0xa,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1040 <f@plt>
mov    (%rsp),%edx
cmp    $0xb,%edx
jne    1159 <main+0x29>
xor    %eax,%eax
pop    %rcx
ret
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
lea    0xe97(%rip),%rsi
call   1050 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [17 x i8] c"t_b == %d != 11\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %6
store i32 10, i32* %7
%8 = call i32 @f(i32* %7, i32* %6)
%9 = load i32, i32* %6
%10 = icmp ne i32 %9, 11
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = load i32, i32* %6
%14 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %13)
%15 = call i32 (...) @abort()
unreachable
16: ; preds = %2
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [17 x i8] c"t_b == %d != 11\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
store i32 1, i32* %3
%6 = bitcast i32* %4 to i8*
store i32 10, i32* %4
%7 = call i32 @f(i32* %4, i32* %3)
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 11
br i1 %9, label %14, label %10
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %8)
%13 = call i32 (...) @abort()
unreachable
14: ; preds = %2
ret i32 0
}
char *strip_first_CRLF(char *string) {
  if (*string == '\r') {
    string++;
    if (*string == '\n')
      string++;
  } else if (*string == '\n') {
    string++;
    if (*string == '\r')
      string++;
  }
  return string;
}


x86 assembly (clang, -O0):
<strip_first_CRLF>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xd,%eax
jne    1145 <strip_first_CRLF+0x45>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    1140 <strip_first_CRLF+0x40>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1187 <strip_first_CRLF+0x87>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    1182 <strip_first_CRLF+0x82>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xd,%eax
jne    117d <strip_first_CRLF+0x7d>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1182 <strip_first_CRLF+0x82>
jmp    1187 <strip_first_CRLF+0x87>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strip_first_CRLF>:
mov    %rdi,%rax
mov    (%rdi),%cl
cmp    $0xd,%cl
je     1113 <strip_first_CRLF+0x13>
cmp    $0xa,%cl
jne    1124 <strip_first_CRLF+0x24>
mov    $0xd,%cl
jmp    1115 <strip_first_CRLF+0x15>
mov    $0xa,%cl
cmp    %cl,0x1(%rax)
lea    0x2(%rax),%rcx
lea    0x1(%rax),%rax
cmove  %rcx,%rax
ret

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

LLVM IR (-O2):
define i8* @strip_first_CRLF(i8* %0) {
%2 = load i8, i8* %0
switch i8 %2, label %11 [
i8 13, label %4
i8 10, label %3
]
3: ; preds = %1
br label %4
4: ; preds = %1, %3
%5 = phi i8 [ 13, %3 ], [ 10, %1 ]
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, %5
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = select i1 %8, i8* %9, i8* %6
br label %11
11: ; preds = %4, %1
%12 = phi i8* [ %0, %1 ], [ %10, %4 ]
ret i8* %12
}
/* Variables and functions */
int /*<<< orphan*/ do_nothing();
int /*<<< orphan*/ process_options(int, char **);
int main(int argc, char **argv) {
  process_options(argc, argv);
  do_nothing();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <process_options@plt>
mov    $0x0,%al
call   1040 <do_nothing@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @process_options(i32 %6, i8** %7)
%9 = call i32 (...) @do_nothing()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @process_options(i32 %0, i8** %1)
%4 = tail call i32 (...) @do_nothing()
ret i32 0
}
int ASAP_MillisecondsToBlocks(int milliseconds) {
  return milliseconds * 441 / 10;
}


x86 assembly (clang, -O0):
<ASAP_MillisecondsToBlocks>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x1b9,-0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<ASAP_MillisecondsToBlocks>:
imul   $0x1b9,%edi,%eax
cltq
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @ASAP_MillisecondsToBlocks(i32 %0) {
%2 = mul nsw i32 %0, 441
%3 = sdiv i32 %2, 10
ret i32 %3
}
/* Variables and functions */
size_t aeron_compute_max_message_length(size_t term_length) {
  size_t max_length_for_term = term_length / 8;
  return max_length_for_term < (16u * 1024u * 1024u) ? max_length_for_term
                                                     : (16u * 1024u * 1024u);
}


x86 assembly (clang, -O0):
<aeron_compute_max_message_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x3,%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x1000000,-0x10(%rbp)
01
jae    112f <aeron_compute_max_message_length+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    113d <aeron_compute_max_message_length+0x3d>
mov    $0x1000000,%eax
mov    %rax,-0x18(%rbp)
jmp    113d <aeron_compute_max_message_length+0x3d>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<aeron_compute_max_message_length>:
shr    $0x3,%rdi
cmp    $0x1000000,%rdi
mov    $0x1000000,%eax
cmovb  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @aeron_compute_max_message_length(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = udiv i64 %4, 8
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = icmp ult i64 %6, 16777216
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i64, i64* %3
br label %11
10: ; preds = %1
br label %11
11: ; preds = %10, %8
%12 = phi i64 [ %9, %8 ], [ 16777216, %10 ]
ret i64 %12
}

LLVM IR (-O2):
define i64 @aeron_compute_max_message_length(i64 %0) {
%2 = lshr i64 %0, 3
%3 = icmp ult i64 %2, 16777216
%4 = select i1 %3, i64 %2, i64 16777216
ret i64 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, int);
int /*<<< orphan*/ reverse_memcpy(void *, void *, int);
int32_t bytes_to_int32(const unsigned char bytes[4], int switch_endian) {
  int32_t dest_num;
  void *dest_ptr = (void *)&dest_num;
  if (switch_endian) {
    reverse_memcpy(dest_ptr, (void *)bytes, 4);
  } else {
    memcpy(dest_ptr, (void *)bytes, 4);
  }
  return dest_num;
}


x86 assembly (clang, -O0):
<bytes_to_int32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1158 <bytes_to_int32+0x38>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1030 <reverse_memcpy@plt>
jmp    116a <bytes_to_int32+0x4a>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bytes_to_int32>:
push   %rax
mov    %rdi,%rax
lea    0x4(%rsp),%rdi
test   %esi,%esi
je     113c <bytes_to_int32+0x1c>
mov    %rax,%rsi
mov    $0x4,%edx
call   1030 <reverse_memcpy@plt>
jmp    1149 <bytes_to_int32+0x29>
mov    %rax,%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @bytes_to_int32(i8* %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = icmp eq i32 %1, 0
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = call i32 @reverse_memcpy(i8* %4, i8* %0, i32 4)
br label %10
8: ; preds = %2
%9 = call i32 @memcpy(i8* %4, i8* %0, i32 4)
br label %10
10: ; preds = %8, %6
%11 = load i32, i32* %3
ret i32 %11
}
/* Variables and functions */
unsigned int UINT_MAX;
unsigned hash_djb2(const char *p) {
  unsigned hash_val = 5381;
  while (*p) {
    hash_val = ((hash_val << 5) + hash_val) + *p;
    hash_val %= UINT_MAX;
    p++;
  }
  return hash_val;
}


x86 assembly (clang, -O0):
<hash_djb2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1505,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1155 <hash_djb2+0x55>
mov    -0xc(%rbp),%eax
shl    $0x5,%eax
add    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    0x2eb0(%rip),%rax
mov    (%rax),%ecx
mov    -0xc(%rbp),%eax
xor    %edx,%edx
div    %ecx
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <hash_djb2+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_djb2>:
mov    (%rdi),%al
test   %al,%al
je     113e <hash_djb2+0x3e>
mov    0x2edb(%rip),%rcx
mov    (%rcx),%ecx
add    $0x1,%rdi
mov    $0x1505,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%esi
shl    $0x5,%esi
add    %edx,%esi
movsbl %al,%eax
add    %esi,%eax
xor    %edx,%edx
div    %ecx
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1120 <hash_djb2+0x20>
mov    %edx,%eax
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
@UINT_MAX = global i32 0
define i32 @hash_djb2(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %17, label %4
4: ; preds = %1
%5 = load i32, i32* @UINT_MAX
br label %6
6: ; preds = %4, %6
%7 = phi i8 [ %2, %4 ], [ %15, %6 ]
%8 = phi i32 [ 5381, %4 ], [ %13, %6 ]
%9 = phi i8* [ %0, %4 ], [ %14, %6 ]
%10 = mul i32 %8, 33
%11 = sext i8 %7 to i32
%12 = add i32 %10, %11
%13 = urem i32 %12, %5
%14 = getelementptr inbounds i8, i8* %9, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %6
17: ; preds = %6, %1
%18 = phi i32 [ 5381, %1 ], [ %13, %6 ]
ret i32 %18
}
int test1(int a) { return a + ~a; }


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
xor    $0xffffffff,%ecx
add    %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test1(i32 %0) {
ret i32 -1
}
void copyString(char *to, char *from, int index) {
  to += index;
  while (*from) {
    *to++ = *from++;
  }
  *to = '\0';
}


x86 assembly (clang, -O0):
<copyString>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1154 <copyString+0x54>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    1120 <copyString+0x20>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<copyString>:
movslq %edx,%rax
add    %rdi,%rax
mov    (%rsi),%cl
test   %cl,%cl
je     1121 <copyString+0x21>
add    $0x1,%rsi
mov    %cl,(%rax)
add    $0x1,%rax
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1110 <copyString+0x10>
movb   $0x0,(%rax)
ret

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

LLVM IR (-O2):
define void @copyString(i8* nocapture writeonly %0, i8* nocapture %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %1
%7 = icmp eq i8 %6, 0
br i1 %7, label %16, label %8
8: ; preds = %3, %8
%9 = phi i8 [ %14, %8 ], [ %6, %3 ]
%10 = phi i8* [ %13, %8 ], [ %5, %3 ]
%11 = phi i8* [ %12, %8 ], [ %1, %3 ]
%12 = getelementptr inbounds i8, i8* %11, i64 1
%13 = getelementptr inbounds i8, i8* %10, i64 1
store i8 %9, i8* %10
%14 = load i8, i8* %12
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %8
16: ; preds = %8, %3
%17 = phi i8* [ %5, %3 ], [ %13, %8 ]
store i8 0, i8* %17
ret void
}
int strSearch(char *suchen, char ch) {
  int counter = 0;
  while (*suchen != '\0') {
    if (*suchen++ == ch)
      counter++;
  }
  return counter;
}


x86 assembly (clang, -O0):
<strSearch>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1151 <strSearch+0x51>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    114c <strSearch+0x4c>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1115 <strSearch+0x15>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strSearch>:
mov    (%rdi),%cl
test   %cl,%cl
je     1126 <strSearch+0x26>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
xor    %edx,%edx
cmp    %sil,%cl
sete   %dl
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <strSearch+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @strSearch(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i32
store i8* %0, i8** %3
store i8 %1, i8* %4
store i32 0, i32* %5
br label %6
6: ; preds = %22, %2
%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 %23
11: ; preds = %6
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %3
%14 = load i8, i8* %12
%15 = sext i8 %14 to i32
%16 = load i8, i8* %4
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %15, %17
br i1 %18, label %19, label %22
19: ; preds = %11
%20 = load i32, i32* %5
%21 = add nsw i32 %20, 1
store i32 %21, i32* %5
br label %22
22: ; preds = %19, %11
br label %6
23: ; preds = %6
%24 = load i32, i32* %5
ret i32 %24
}

LLVM IR (-O2):
define i32 @strSearch(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i32 [ %12, %5 ], [ 0, %2 ]
%8 = phi i8* [ %9, %5 ], [ %0, %2 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = icmp eq i8 %6, %1
%11 = zext i1 %10 to i32
%12 = add nuw nsw i32 %7, %11
%13 = load i8, i8* %9
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i32 [ 0, %2 ], [ %12, %5 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void sys_four(void) { printf("four\n"); }


x86 assembly (clang, -O0):
<sys_four>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_four>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"four\0A\00"
define void @sys_four() {
%1 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [5 x i8] c"four\00"
define void @sys_four() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret void
}