xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ sleep(int);
void *does_too() {
  int i = 0;
  for (i = 0; i < 5; i++) {
    sleep(1);
    puts("Does too!");
  }
  return NULL;
}


x86 assembly (clang, -O0):
<does_too>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
jge    1164 <does_too+0x44>
mov    $0x1,%edi
call   1040 <sleep@plt>
lea    0xeaf(%rip),%rdi
call   1030 <puts@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1136 <does_too+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<does_too>:
push   %rbx
mov    $0x1,%edi
call   1040 <sleep@plt>
lea    0xece(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Does too!\00"
define i8* @does_too() {
%1 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %1
br label %2
2: ; preds = %8, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 5
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = call i32 @sleep(i32 1)
%7 = call i32 @puts(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %5
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
br label %2
11: ; preds = %2
ret i8* null
}

LLVM IR (-O2):
@.str = [10 x i8] c"Does too!\00"
define noalias i8* @does_too() {
%1 = tail call i32 @sleep(i32 1)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @sleep(i32 1)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @sleep(i32 1)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @sleep(i32 1)
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @sleep(i32 1)
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i8* null
}
/* Type definitions */
typedef int /*<<< orphan*/ clock_t;

/* Variables and functions */
int /*<<< orphan*/ clock();
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, char const *);
int _clock(char const *progname) {
  clock_t c;
  printf("%s: Testing clock()\n", progname);
  if ((c = clock()) == (clock_t)-1) {
    perror("clock");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<_clock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <clock@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
jne    1177 <_clock+0x47>
lea    0xeaf(%rip),%rdi
call   1050 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    117e <_clock+0x4e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_clock>:
push   %rbx
mov    %rdi,%rsi
lea    0xec5(%rip),%rdi
call   1040 <printf@plt>
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <clock@plt>
cmp    $0xffffffff,%eax
je     1152 <_clock+0x22>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xebc(%rip),%rdi
call   1050 <perror@plt>
mov    $0xffffffff,%ebx
jmp    114e <_clock+0x1e>

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

LLVM IR (-O2):
@.str = [21 x i8] c"%s: Testing clock()\0A\00"
@.str.1 = [6 x i8] c"clock\00"
define i32 @_clock(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 (...) @clock()
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %1, %5
%8 = phi i32 [ -1, %5 ], [ 0, %1 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void pthread_exit(void *value_ptr) { exit(0); }


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

x86 assembly (clang, -O2):
<pthread_exit>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @pthread_exit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @pthread_exit(i8* nocapture readnone %0) {
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int has_zero_byte(const uint32_t n) {
  return (n & 0xFF) == 0 || ((n >> 8) & 0xFF) == 0 || ((n >> 16) & 0xFF) == 0 ||
         ((n >> 24) & 0xFF) == 0;
}


x86 assembly (clang, -O0):
<has_zero_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
and    $0xff,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x5(%rbp)
je     1166 <has_zero_byte+0x66>
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x5(%rbp)
je     1166 <has_zero_byte+0x66>
mov    -0x4(%rbp),%ecx
sar    $0x10,%ecx
and    $0xff,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x5(%rbp)
je     1166 <has_zero_byte+0x66>
mov    -0x4(%rbp),%eax
sar    $0x18,%eax
and    $0xff,%eax
cmp    $0x0,%eax
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<has_zero_byte>:
test   %dil,%dil
sete   %al
test   $0xff00,%edi
sete   %cl
or     %al,%cl
test   $0xff0000,%edi
sete   %al
cmp    $0x1000000,%edi
setb   %dl
or     %al,%dl
or     %cl,%dl
movzbl %dl,%eax
ret

LLVM IR (-O0):
define i32 @has_zero_byte(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = icmp eq i32 %4, 0
br i1 %5, label %21, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = ashr i32 %7, 8
%9 = and i32 %8, 255
%10 = icmp eq i32 %9, 0
br i1 %10, label %21, label %11
11: ; preds = %6
%12 = load i32, i32* %2
%13 = ashr i32 %12, 16
%14 = and i32 %13, 255
%15 = icmp eq i32 %14, 0
br i1 %15, label %21, label %16
16: ; preds = %11
%17 = load i32, i32* %2
%18 = ashr i32 %17, 24
%19 = and i32 %18, 255
%20 = icmp eq i32 %19, 0
br label %21
21: ; preds = %16, %11, %6, %1
%22 = phi i1 [ true, %11 ], [ true, %6 ], [ true, %1 ], [ %20, %16 ]
%23 = zext i1 %22 to i32
ret i32 %23
}

LLVM IR (-O2):
define i32 @has_zero_byte(i32 %0) {
%2 = and i32 %0, 255
%3 = icmp eq i32 %2, 0
%4 = and i32 %0, 65280
%5 = icmp eq i32 %4, 0
%6 = or i1 %3, %5
%7 = and i32 %0, 16711680
%8 = icmp eq i32 %7, 0
%9 = or i1 %8, %6
%10 = icmp ult i32 %0, 16777216
%11 = or i1 %10, %9
%12 = zext i1 %11 to i32
ret i32 %12
}
void RTDbgAsModuleUnlink(void) {}


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

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

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

LLVM IR (-O2):
define void @RTDbgAsModuleUnlink() {
ret void
}
void gbx_local_card_changed(void) {}


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

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

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

LLVM IR (-O2):
define void @gbx_local_card_changed() {
ret void
}
/* Variables and functions */
int posix_memalign(void **, size_t, size_t);
int agbnp3_vmemalloc(void **memptr, const size_t size) {
  size_t alignment = 16;
  int retcode = 0;
  void *mem;
  size_t padded_size;
  padded_size = (size / alignment + 1) * alignment;
  retcode = posix_memalign(&mem, alignment, padded_size);
  if (retcode)
    mem = NULL;
  *memptr = mem;
  return retcode;
}


x86 assembly (clang, -O0):
<agbnp3_vmemalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x10,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x18(%rbp)
add    $0x1,%rax
imul   -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x30(%rbp),%rdx
lea    -0x28(%rbp),%rdi
call   1030 <posix_memalign@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     116e <agbnp3_vmemalloc+0x5e>
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x1c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<agbnp3_vmemalloc>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x10(%rsi),%rdx
and    $0xfffffffffffffff0,%rdx
lea    0x8(%rsp),%rdi
mov    $0x10,%esi
call   1030 <posix_memalign@plt>
test   %eax,%eax
jne    113a <agbnp3_vmemalloc+0x2a>
mov    0x8(%rsp),%rcx
jmp    113c <agbnp3_vmemalloc+0x2c>
xor    %ecx,%ecx
mov    %rcx,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @agbnp3_vmemalloc(i8** nocapture writeonly %0, i64 %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = add i64 %1, 16
%6 = and i64 %5, -16
%7 = call i32 @posix_memalign(i8** %3, i64 16, i64 %6)
%8 = icmp eq i32 %7, 0
%9 = load i8*, i8** %3
%10 = select i1 %8, i8* %9, i8* null
store i8* %10, i8** %0
ret i32 %7
}
/* Type definitions */
typedef int clock_t;

/* Variables and functions */
int CLOCKS_PER_SEC;
int clock();
void busy_waiting4(int second) {
  clock_t ticks1, ticks2;
  ticks1 = clock();
  ticks2 = ticks1;
  while ((ticks2 / CLOCKS_PER_SEC - ticks1 / CLOCKS_PER_SEC) < second)
    ticks2 = clock();
}


x86 assembly (clang, -O0):
<busy_waiting4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <clock@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2eb3(%rip),%rcx
cltd
idivl  (%rcx)
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2ea3(%rip),%rcx
cltd
idivl  (%rcx)
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
sub    %ecx,%eax
cmp    -0x4(%rbp),%eax
jge    1167 <busy_waiting4+0x57>
mov    $0x0,%al
call   1030 <clock@plt>
mov    %eax,-0xc(%rbp)
jmp    112b <busy_waiting4+0x1b>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<busy_waiting4>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <clock@plt>
test   %ebx,%ebx
jle    114a <busy_waiting4+0x3a>
mov    %eax,%ebp
mov    0x2ebe(%rip),%r14
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <clock@plt>
mov    (%r14),%esi
cltd
idiv   %esi
mov    %eax,%ecx
mov    %ebp,%eax
cltd
idiv   %esi
sub    %eax,%ecx
cmp    %ebx,%ecx
jl     1130 <busy_waiting4+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@CLOCKS_PER_SEC = global i32 0
define void @busy_waiting4(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = call i32 (...) @clock()
store i32 %5, i32* %3
%6 = load i32, i32* %3
store i32 %6, i32* %4
br label %7
7: ; preds = %17, %1
%8 = load i32, i32* %4
%9 = load i32, i32* @CLOCKS_PER_SEC
%10 = sdiv i32 %8, %9
%11 = load i32, i32* %3
%12 = load i32, i32* @CLOCKS_PER_SEC
%13 = sdiv i32 %11, %12
%14 = sub nsw i32 %10, %13
%15 = load i32, i32* %2
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %19
17: ; preds = %7
%18 = call i32 (...) @clock()
store i32 %18, i32* %4
br label %7
19: ; preds = %7
ret void
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global i32 0
define void @busy_waiting4(i32 %0) {
%2 = tail call i32 (...) @clock()
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %11
4: ; preds = %1, %4
%5 = tail call i32 (...) @clock()
%6 = load i32, i32* @CLOCKS_PER_SEC
%7 = sdiv i32 %5, %6
%8 = sdiv i32 %2, %6
%9 = sub nsw i32 %7, %8
%10 = icmp slt i32 %9, %0
br i1 %10, label %4, label %11
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ echo_test(int, int, int /*<<< orphan*/);
void echo_test_500K_0(void) { echo_test(0x00, 0x1c, 0); }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
xor    %edx,%edx
mov    $0x1c,%esi
mov    %edx,%edi
call   1030 <echo_test@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
xor    %edi,%edi
mov    $0x1c,%esi
xor    %edx,%edx
jmp    1030 <echo_test@plt>

LLVM IR (-O0):
define void @echo_test_500K_0() {
%1 = call i32 @echo_test(i32 0, i32 28, i32 0)
ret void
}

LLVM IR (-O2):
define void @echo_test_500K_0() {
%1 = tail call i32 @echo_test(i32 0, i32 28, i32 0)
ret void
}
int do_080() { return 80; }


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

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

LLVM IR (-O0):
define i32 @do_080() {
ret i32 80
}

LLVM IR (-O2):
define i32 @do_080() {
ret i32 80
}
/* Variables and functions */
int /*<<< orphan*/ HwSettingsHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void HwSettingsRequestUpdate() { UAVObjRequestUpdate(HwSettingsHandle()); }


x86 assembly (clang, -O0):
<HwSettingsRequestUpdate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <HwSettingsHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjRequestUpdate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<HwSettingsRequestUpdate>:
push   %rax
xor    %eax,%eax
call   1030 <HwSettingsHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjRequestUpdate@plt>

LLVM IR (-O0):
define void @HwSettingsRequestUpdate() {
%1 = call i32 (...) @HwSettingsHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @HwSettingsRequestUpdate() {
%1 = tail call i32 (...) @HwSettingsHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
char *SkipPath(char *name) {
  char *p = name;
  char *start = name;
  while (*p) {
    if (((*p == '/') || (*p == '\\')) && *(p + 1)) {
      start = p + 1;
    }
    p++;
  }
  return start;
}


x86 assembly (clang, -O0):
<SkipPath>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1173 <SkipPath+0x73>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
je     1145 <SkipPath+0x45>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5c,%eax
jne    1162 <SkipPath+0x62>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
je     1162 <SkipPath+0x62>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1118 <SkipPath+0x18>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SkipPath>:
mov    %rdi,%rax
lea    0x1(%rdi),%rcx
jmp    111b <SkipPath+0x1b>
nopl   0x0(%rax)
cmpb   $0x0,(%rcx)
cmovne %rcx,%rax
add    $0x1,%rcx
movzbl -0x1(%rcx),%edx
cmp    $0x2f,%dl
je     1110 <SkipPath+0x10>
cmp    $0x5c,%dl
je     1110 <SkipPath+0x10>
test   %dl,%dl
jne    1117 <SkipPath+0x17>
ret

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

LLVM IR (-O2):
define i8* @SkipPath(i8* %0) {
br label %2
2: ; preds = %11, %1
%3 = phi i8* [ %0, %1 ], [ %13, %11 ]
%4 = phi i8* [ %0, %1 ], [ %12, %11 ]
%5 = load i8, i8* %3
switch i8 %5, label %11 [
i8 0, label %14
i8 47, label %6
i8 92, label %6
]
6: ; preds = %2, %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 0
%10 = select i1 %9, i8* %4, i8* %7
br label %11
11: ; preds = %6, %2
%12 = phi i8* [ %4, %2 ], [ %10, %6 ]
%13 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
14: ; preds = %2
ret i8* %4
}
int main() {
  int k = 0, i, s = 0;
#pragma omp parallel
#pragma omp for simd linear(k : 3) reduction(+ : s) schedule(static, 16)
  for (i = 0; i < 128; i++) {
    k = k + 3;
    s = s + k;
  }
  if (s != 128 * 129 / 2 * 3)
    __builtin_abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x80,-0xc(%rbp)
jge    1161 <main+0x51>
mov    -0x8(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1134 <main+0x24>
cmpl   $0x60c0,-0x10(%rbp)
je     1173 <main+0x63>
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
double pow(int, double);
double note_to_period_mix(int n, int b) {
  double d = (double)n + (double)b / 12800;
  return 13696.0 / pow(2, d / 12);
}


x86 assembly (clang, -O0):
<note_to_period_mix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
cvtsi2sdl -0x8(%rbp),%xmm1
movsd  0xee0(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xebe(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xe9d(%rip),%xmm0
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<note_to_period_mix>:
push   %rax
cvtsi2sd %edi,%xmm1
cvtsi2sd %esi,%xmm0
divsd  0xedf(%rip),%xmm0
addsd  %xmm1,%xmm0
divsd  0xedb(%rip),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
movsd  0xed1(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @note_to_period_mix(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = sitofp i32 %6 to double
%8 = load i32, i32* %4
%9 = sitofp i32 %8 to double
%10 = fdiv double %9, 1.280000e+04
%11 = fadd double %7, %10
store double %11, double* %5
%12 = load double, double* %5
%13 = fdiv double %12, 1.200000e+01
%14 = call double @pow(i32 2, double %13)
%15 = fdiv double 1.369600e+04, %14
ret double %15
}

LLVM IR (-O2):
define double @note_to_period_mix(i32 %0, i32 %1) {
%3 = sitofp i32 %0 to double
%4 = sitofp i32 %1 to double
%5 = fdiv double %4, 1.280000e+04
%6 = fadd double %5, %3
%7 = fdiv double %6, 1.200000e+01
%8 = tail call double @pow(i32 2, double %7)
%9 = fdiv double 1.369600e+04, %8
ret double %9
}
void vPushApduPrepare(int iPushApduType, ...) { return; }


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

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

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

LLVM IR (-O2):
define void @vPushApduPrepare(i32 %0, ...) {
ret void
}
/* Variables and functions */
size_t modular_addition_size_t_unsafe(size_t x, size_t y, size_t m) {
  size_t z;
  z = m - x;
  if (z > y) {
    return x + y;
  } else {
    return y - z;
  }
}


x86 assembly (clang, -O0):
<modular_addition_size_t_unsafe>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
sub    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x18(%rbp),%rax
jbe    113b <modular_addition_size_t_unsafe+0x3b>
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1147 <modular_addition_size_t_unsafe+0x47>
mov    -0x18(%rbp),%rax
sub    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<modular_addition_size_t_unsafe>:
sub    %rdi,%rdx
mov    %rdx,%rax
neg    %rax
cmp    %rsi,%rdx
cmova  %rdi,%rax
add    %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @modular_addition_size_t_unsafe(i64 %0, i64 %1, i64 %2) {
%4 = sub i64 %2, %0
%5 = icmp ugt i64 %4, %1
%6 = sub i64 0, %4
%7 = select i1 %5, i64 %0, i64 %6
%8 = add i64 %7, %1
ret i64 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *);
int createIdPw(const char *id, const char *pw) {
  FILE *f;
  f = fopen(id, "w+");
  if (f == NULL)
    return -1;
  fprintf(f, "%s", pw);
  fclose(f);
  return 1;
}


x86 assembly (clang, -O0):
<createIdPw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    116b <createIdPw+0x3b>
movl   $0xffffffff,-0x4(%rbp)
jmp    118f <createIdPw+0x5f>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0xe89(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x20(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<createIdPw>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
lea    0xec2(%rip),%rsi
call   1050 <fopen@plt>
test   %rax,%rax
je     1165 <createIdPw+0x35>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
call   1040 <fputs@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
mov    $0x1,%eax
jmp    116a <createIdPw+0x3a>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"w+\00"
define i32 @createIdPw(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32* %3, null
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @fputs(i8* %1, i32* %3)
%7 = tail call i32 @fclose(i32* %3)
br label %8
8: ; preds = %2, %5
%9 = phi i32 [ 1, %5 ], [ -1, %2 ]
ret i32 %9
}
int foobar(int x) { return x * x - x + 1; }


x86 assembly (clang, -O0):
<foobar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
sub    -0x4(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foobar>:
mov    %edi,%eax
imul   %edi,%eax
sub    %edi,%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @foobar(i32 %0) {
%2 = mul nsw i32 %0, %0
%3 = sub i32 1, %0
%4 = add i32 %3, %2
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int);
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
scalar_t__ pthread_self();
void *Print() {
  pthread_t t1 = pthread_self();
  printf("Thread: %u\n", (unsigned int)t1);
  pthread_exit(NULL);
}


x86 assembly (clang, -O0):
<Print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <pthread_self@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,%esi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Print>:
push   %rax
xor    %eax,%eax
call   1050 <pthread_self@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <pthread_exit@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"Thread: %u\0A\00"
define i8* @Print() {
%1 = alloca i8*
%2 = alloca i64
%3 = call i64 (...) @pthread_self()
store i64 %3, i64* %2
%4 = load i64, i64* %2
%5 = trunc i64 %4 to i32
%6 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 @pthread_exit(i32* null)
%8 = load i8*, i8** %1
ret i8* %8
}

LLVM IR (-O2):
@.str = [12 x i8] c"Thread: %u\0A\00"
define noalias i8* @Print() {
%1 = tail call i64 (...) @pthread_self()
%2 = trunc i64 %1 to i32
%3 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 @pthread_exit(i32* null)
ret i8* undef
}
/* Variables and functions */
int countBinary(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  printf("Please input an integer:");
  scanf("%d", &n);
  printf("\nIt has %d binary digits.\n", countBinary(n));
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [25 x i8] c"Please input an integer:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [27 x i8] c"\0AIt has %d binary digits.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 @countBinary(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"Please input an integer:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [27 x i8] c"\0AIt has %d binary digits.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @countBinary(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}
void InitDebugSettings(void) {}


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

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

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

LLVM IR (-O2):
define void @InitDebugSettings() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
void close_file(FILE *fp) {
  fflush(fp);
  fclose(fp);
}


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

x86 assembly (clang, -O2):
<close_file>:
push   %rbx
mov    %rdi,%rbx
call   1040 <fflush@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fclose@plt>

LLVM IR (-O0):
define void @close_file(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fflush(i32* %3)
%5 = load i32*, i32** %2
%6 = call i32 @fclose(i32* %5)
ret void
}

LLVM IR (-O2):
define void @close_file(i32* nocapture %0) {
%2 = tail call i32 @fflush(i32* %0)
%3 = tail call i32 @fclose(i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *name) {
  fprintf(stderr, "Usage: %s [options] k\n", name);
  fprintf(stderr, "For more information type: %s -h \n\n", name);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xece(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ec2(%rip),%r14
mov    (%r14),%edi
lea    0xed8(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xedd(%rip),%rsi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [23 x i8] c"Usage: %s [options] k\0A\00"
@.str.1 = [36 x i8] c"For more information type: %s -h \0A\0A\00"
define void @usage(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* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = load i8*, i8** %2
%8 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"Usage: %s [options] k\0A\00"
@.str.1 = [36 x i8] c"For more information type: %s -h \0A\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
double pow(double, double);
double bohlen_pierce_itor(double interval) { return pow(3.0, interval / 13.0); }


x86 assembly (clang, -O0):
<bohlen_pierce_itor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  0xede(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xeca(%rip),%xmm0
call   1030 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bohlen_pierce_itor>:
movapd %xmm0,%xmm1
divsd  0xee4(%rip),%xmm1
movsd  0xee4(%rip),%xmm0
jmp    1030 <pow@plt>

LLVM IR (-O0):
define double @bohlen_pierce_itor(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 1.300000e+01
%5 = call double @pow(double 3.000000e+00, double %4)
ret double %5
}

LLVM IR (-O2):
define double @bohlen_pierce_itor(double %0) {
%2 = fdiv double %0, 1.300000e+01
%3 = tail call double @pow(double 3.000000e+00, double %2)
ret double %3
}
/* Type definitions */
struct _stor_lookup_destroy_req {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ osapi_free(struct _stor_lookup_destroy_req *);
void stor_lookup_destroy_req_free(struct _stor_lookup_destroy_req *ptr) {
  osapi_free(ptr);
}


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

x86 assembly (clang, -O2):
<stor_lookup_destroy_req_free>:
jmp    1030 <osapi_free@plt>

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

LLVM IR (-O2):
%struct._stor_lookup_destroy_req = type { i32 }
define void @stor_lookup_destroy_req_free(%struct._stor_lookup_destroy_req* %0) {
%2 = tail call i32 @osapi_free(%struct._stor_lookup_destroy_req* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ createProcessPerfectTree(int /*<<< orphan*/, int);
int /*<<< orphan*/ printPids(int /*<<< orphan*/);
int main() {
  int n = 7;
  printPids(createProcessPerfectTree(0, n));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x7,-0x4(%rbp)
mov    -0x4(%rbp),%esi
xor    %edi,%edi
call   1030 <createProcessPerfectTree@plt>
mov    %eax,%edi
call   1040 <printPids@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @createProcessPerfectTree(i32 0, i32 7)
%2 = tail call i32 @printPids(i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, double *, double *);
int main() {
  double A, B;
  scanf(" %lf %lf", &A, &B);
  printf("MEDIA = %0.5lf\n", ((A * 3.5) + (B * 7.5)) / 11);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xee2(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
movsd  0xec0(%rip),%xmm1
mulsd  -0x18(%rbp),%xmm1
movsd  0xeab(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe93(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xeed(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1040 <scanf@plt>
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
mulsd  0xeb2(%rip),%xmm1
mulsd  0xeb2(%rip),%xmm0
addsd  %xmm1,%xmm0
divsd  0xeae(%rip),%xmm0
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [9 x i8] c" %lf %lf\00"
@.str.1 = [16 x i8] c"MEDIA = %0.5lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), double* %2, double* %3)
%5 = load double, double* %2
%6 = load double, double* %3
%7 = fmul double %6, 7.500000e+00
%8 = call double @llvm.fmuladd.f64(double %5, double 3.500000e+00, double %7)
%9 = fdiv double %8, 1.100000e+01
%10 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), double %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c" %lf %lf\00"
@.str.1 = [16 x i8] c"MEDIA = %0.5lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = bitcast double* %1 to i8*
%4 = bitcast double* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), double* %1, double* %2)
%6 = load double, double* %1
%7 = load double, double* %2
%8 = fmul double %7, 7.500000e+00
%9 = call double @llvm.fmuladd.f64(double %6, double 3.500000e+00, double %8)
%10 = fdiv double %9, 1.100000e+01
%11 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), double %10)
ret i32 0
}
int ft_strcmp(char *s1, char *s2) {
  while (*s1 == *s2) {
    if (*s1 == '\0') {
      return (0);
    }
    s1++;
    s2++;
  }
  return ((unsigned char)*s1 - (unsigned char)*s2);
}


x86 assembly (clang, -O0):
<ft_strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    115b <ft_strcmp+0x5b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    113e <ft_strcmp+0x3e>
movl   $0x0,-0x4(%rbp)
jmp    116e <ft_strcmp+0x6e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    110c <ft_strcmp+0xc>
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movzbl (%rcx),%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strcmp>:
mov    (%rdi),%al
mov    (%rsi),%cl
cmp    %cl,%al
jne    1124 <ft_strcmp+0x24>
mov    $0x1,%edx
nopl   (%rax)
test   %al,%al
je     112d <ft_strcmp+0x2d>
movzbl (%rdi,%rdx,1),%eax
movzbl (%rsi,%rdx,1),%ecx
add    $0x1,%rdx
cmp    %cl,%al
je     1110 <ft_strcmp+0x10>
movzbl %al,%eax
movzbl %cl,%ecx
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp eq i8 %3, %4
br i1 %5, label %6, label %17
6: ; preds = %2, %11
%7 = phi i8 [ %14, %11 ], [ %3, %2 ]
%8 = phi i8* [ %13, %11 ], [ %1, %2 ]
%9 = phi i8* [ %12, %11 ], [ %0, %2 ]
%10 = icmp eq i8 %7, 0
br i1 %10, label %23, label %11
11: ; preds = %6
%12 = getelementptr inbounds i8, i8* %9, i64 1
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = load i8, i8* %12
%15 = load i8, i8* %13
%16 = icmp eq i8 %14, %15
br i1 %16, label %6, label %17
17: ; preds = %11, %2
%18 = phi i8 [ %3, %2 ], [ %14, %11 ]
%19 = phi i8 [ %4, %2 ], [ %15, %11 ]
%20 = zext i8 %18 to i32
%21 = zext i8 %19 to i32
%22 = sub nsw i32 %20, %21
br label %23
23: ; preds = %6, %17
%24 = phi i32 [ %22, %17 ], [ 0, %6 ]
ret i32 %24
}
int mal3(int x) {
  return 3 * x;
  return x;
}


x86 assembly (clang, -O0):
<mal3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x3,-0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @mal3(i32 %0) {
%2 = mul nsw i32 %0, 3
ret i32 %2
}
unsigned int bindec(char *s) {
  unsigned int i;
  int j;
  i = 0;
  for (j = 0; s[j]; j++) {
    i <<= 1;
    if (s[j] == '1')
      i |= 1;
  }
  return i;
}


x86 assembly (clang, -O0):
<bindec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1162 <bindec+0x62>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x31,%eax
jne    114f <bindec+0x4f>
mov    -0xc(%rbp),%eax
or     $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1154 <bindec+0x54>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <bindec+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bindec>:
mov    (%rdi),%cl
test   %cl,%cl
je     1127 <bindec+0x27>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
xor    %edx,%edx
cmp    $0x31,%cl
sete   %dl
lea    (%rdx,%rax,2),%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <bindec+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @bindec(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 = %26, %1
%6 = load i8*, i8** %2
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = load i8, i8* %9
%11 = icmp ne i8 %10, 0
br i1 %11, label %12, label %29
12: ; preds = %5
%13 = load i32, i32* %3
%14 = shl i32 %13, 1
store i32 %14, i32* %3
%15 = load i8*, i8** %2
%16 = load i32, i32* %4
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %15, i64 %17
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 49
br i1 %21, label %22, label %25
22: ; preds = %12
%23 = load i32, i32* %3
%24 = or i32 %23, 1
store i32 %24, i32* %3
br label %25
25: ; preds = %22, %12
br label %26
26: ; preds = %25
%27 = load i32, i32* %4
%28 = add nsw i32 %27, 1
store i32 %28, i32* %4
br label %5
29: ; preds = %5
%30 = load i32, i32* %3
ret i32 %30
}

LLVM IR (-O2):
define i32 @bindec(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %12, %4 ], [ 0, %1 ]
%6 = phi i8 [ %14, %4 ], [ %2, %1 ]
%7 = phi i32 [ %11, %4 ], [ 0, %1 ]
%8 = shl i32 %7, 1
%9 = icmp eq i8 %6, 49
%10 = zext i1 %9 to i32
%11 = or i32 %8, %10
%12 = add nuw nsw i64 %5, 1
%13 = getelementptr inbounds i8, i8* %0, i64 %12
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %4, %1
%17 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ tf(void *, void *, int);
void __attribute__((no_instrument_function))
__cyg_profile_func_enter(void *this, void *callsite) {
  tf(this, callsite, 1);
}


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

x86 assembly (clang, -O2):
<__cyg_profile_func_enter>:
mov    $0x1,%edx
jmp    1030 <tf@plt>

LLVM IR (-O0):
define void @__cyg_profile_func_enter(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @tf(i8* %5, i8* %6, i32 1)
ret void
}

LLVM IR (-O2):
define void @__cyg_profile_func_enter(i8* %0, i8* %1) {
%3 = tail call i32 @tf(i8* %0, i8* %1, i32 1)
ret void
}
void RTStrCatEx(void) {}


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

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

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

LLVM IR (-O2):
define void @RTStrCatEx() {
ret void
}