xunge/DecIR huggingface dataset:
/* Variables and functions */
int color_eqn(int, int, int, int, int, int);
int g_cymg_yeg_yemg(int entrycyg, int entrycymg, int entryyeg, int entryyemg) {
  return color_eqn(21, entrycymg, 92, entryyeg, -74, entryyemg);
}


x86 assembly (clang, -O0):
<g_cymg_yeg_yemg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r9d
mov    $0x15,%edi
mov    $0x5c,%edx
mov    $0xffffffb6,%r8d
call   1030 <color_eqn@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_cymg_yeg_yemg>:
mov    %ecx,%r9d
mov    %edx,%ecx
mov    $0x15,%edi
mov    $0x5c,%edx
mov    $0xffffffb6,%r8d
jmp    1030 <color_eqn@plt>

LLVM IR (-O0):
define i32 @g_cymg_yeg_yemg(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %6
%10 = load i32, i32* %7
%11 = load i32, i32* %8
%12 = call i32 @color_eqn(i32 21, i32 %9, i32 92, i32 %10, i32 -74, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @g_cymg_yeg_yemg(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @color_eqn(i32 21, i32 %1, i32 92, i32 %2, i32 -74, i32 %3)
ret i32 %5
}
/* Type definitions */
typedef int int8_t;

/* Variables and functions */
void increasingArray(int8_t array[]) {
  for (int i = 0; i < 16; i++) {
    array[i] = i;
  }
  return;
}


x86 assembly (clang, -O0):
<increasingArray>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x10,-0xc(%rbp)
jge    1135 <increasingArray+0x35>
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <increasingArray+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<increasingArray>:
movaps 0xef9(%rip),%xmm0
movups %xmm0,(%rdi)
movaps 0xeff(%rip),%xmm0
movups %xmm0,0x10(%rdi)
movaps 0xf04(%rip),%xmm0
movups %xmm0,0x20(%rdi)
movaps 0xf09(%rip),%xmm0
movups %xmm0,0x30(%rdi)
ret

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

LLVM IR (-O2):
define void @increasingArray(i32* nocapture writeonly %0) {
%2 = bitcast i32* %0 to <4 x i32>*
store <4 x i32> <i32 0, i32 1, i32 2, i32 3>, <4 x i32>* %2
%3 = getelementptr inbounds i32, i32* %0, i64 4
%4 = bitcast i32* %3 to <4 x i32>*
store <4 x i32> <i32 4, i32 5, i32 6, i32 7>, <4 x i32>* %4
%5 = getelementptr inbounds i32, i32* %0, i64 8
%6 = bitcast i32* %5 to <4 x i32>*
store <4 x i32> <i32 8, i32 9, i32 10, i32 11>, <4 x i32>* %6
%7 = getelementptr inbounds i32, i32* %0, i64 12
%8 = bitcast i32* %7 to <4 x i32>*
store <4 x i32> <i32 12, i32 13, i32 14, i32 15>, <4 x i32>* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free_all_registers();
int /*<<< orphan*/ simplify_access();
void free_registers_move_start(void) {
  free_all_registers();
  simplify_access();
}


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

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

LLVM IR (-O0):
define void @free_registers_move_start() {
%1 = call i32 (...) @free_all_registers()
%2 = call i32 (...) @simplify_access()
ret void
}

LLVM IR (-O2):
define void @free_registers_move_start() {
%1 = tail call i32 (...) @free_all_registers()
%2 = tail call i32 (...) @simplify_access()
ret void
}
int syscall0(int n) {
  int ret;
  asm volatile("syscall" : "=a"(ret) : "a"(n));
  return ret;
}


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

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

LLVM IR (-O0):
define i32 @syscall0(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 asm sideeffect "syscall", "={ax},{ax},~{dirflag},~{fpsr},~{flags}"(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @syscall0(i32 %0) {
%2 = tail call i32 asm sideeffect "syscall", "={ax},{ax},~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int Tcl_DbCkfree(void *ptr, char *file, int line) {
  free(ptr);
  return 0;
}


x86 assembly (clang, -O0):
<Tcl_DbCkfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Tcl_DbCkfree>:
push   %rax
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @Tcl_DbCkfree(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 i8*, i8** %4
%8 = call i32 @free(i8* %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @Tcl_DbCkfree(i8* nocapture %0, i8* nocapture readnone %1, i32 %2) {
%4 = tail call i32 @free(i8* %0)
ret i32 0
}
/* Type definitions */
typedef int __u32;

/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
const char *strxf_mask32(__u32 mask) {
  static char str[16];
  sprintf(str, "%.8x", mask);
  return str;
}


x86 assembly (clang, -O0):
<strxf_mask32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0x2f1b(%rip),%rdi
lea    0xed4(%rip),%rsi
call   1030 <sprintf@plt>
lea    0x2f08(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strxf_mask32>:
push   %rbx
mov    %edi,%edx
lea    0x2f26(%rip),%rbx
lea    0xedf(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@strxf_mask32.str = internal global [16 x i8] zeroinitializer
@.str = [5 x i8] c"%.8x\00"
define i8* @strxf_mask32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @sprintf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @strxf_mask32.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @strxf_mask32.str, i64 0, i64 0)
}

LLVM IR (-O2):
@strxf_mask32.str = internal global [16 x i8] zeroinitializer
@.str = [5 x i8] c"%.8x\00"
define i8* @strxf_mask32(i32 %0) {
%2 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @strxf_mask32.str, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @strxf_mask32.str, i64 0, i64 0)
}
int baz() { return 5; }


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

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

LLVM IR (-O0):
define i32 @baz() {
ret i32 5
}

LLVM IR (-O2):
define i32 @baz() {
ret i32 5
}
/* Variables and functions */
int /*<<< orphan*/ radeon_set(unsigned long, char const *, unsigned int);
void radeon_set_indexed(unsigned long index_offset, unsigned long data_offset,
                        unsigned long offset, const char *name,
                        unsigned int value) {
  radeon_set(index_offset, "index", offset);
  radeon_set(data_offset, name, value);
}


x86 assembly (clang, -O0):
<radeon_set_indexed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    %eax,%edx
lea    0xec3(%rip),%rsi
call   1030 <radeon_set@plt>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x24(%rbp),%edx
call   1030 <radeon_set@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<radeon_set_indexed>:
push   %rbp
push   %r14
push   %rbx
mov    %r8d,%r14d
mov    %rcx,%rbx
mov    %rsi,%rbp
lea    0xedc(%rip),%rsi
call   1030 <radeon_set@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <radeon_set@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"index\00"
define void @radeon_set_indexed(i64 %0, i64 %1, i64 %2, i8* %3, i32 %4) {
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i8*
%10 = alloca i32
store i64 %0, i64* %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%11 = load i64, i64* %6
%12 = load i64, i64* %8
%13 = trunc i64 %12 to i32
%14 = call i32 @radeon_set(i64 %11, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %13)
%15 = load i64, i64* %7
%16 = load i8*, i8** %9
%17 = load i32, i32* %10
%18 = call i32 @radeon_set(i64 %15, i8* %16, i32 %17)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"index\00"
define void @radeon_set_indexed(i64 %0, i64 %1, i64 %2, i8* %3, i32 %4) {
%6 = trunc i64 %2 to i32
%7 = tail call i32 @radeon_set(i64 %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = tail call i32 @radeon_set(i64 %1, i8* %3, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Mm(int);
int main() {
  int i;
  for (i = 0; i < 2; i++)
    Mm(i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1146 <main+0x36>
mov    -0x8(%rbp),%edi
call   1030 <Mm@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <Mm@plt>
mov    $0x1,%edi
call   1030 <Mm@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 0, i32* %2
br label %3
3: ; preds = %9, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 2
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = load i32, i32* %2
%8 = call i32 @Mm(i32 %7)
br label %9
9: ; preds = %6
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 1
store i32 %11, i32* %2
br label %3
12: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @Mm(i32 0)
%2 = tail call i32 @Mm(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ log_f(char *);
unsigned joystickb_none_count_get(void) {
  log_f("joystickb:none: joystickb_none_count_get()\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [44 x i8] c"joystickb:none: joystickb_none_count_get()\0A\00"
define i32 @joystickb_none_count_get() {
%1 = call i32 @log_f(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [44 x i8] c"joystickb:none: joystickb_none_count_get()\0A\00"
define i32 @joystickb_none_count_get() {
%1 = tail call i32 @log_f(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isascii(int);
void t_isascii_0xac() {
  Assert_real((isascii(172) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isascii.c",
              865, ("isascii should be 0 for 0xac"));
}


x86 assembly (clang, -O0):
<t_isascii_0xac>:
push   %rbp
mov    %rsp,%rbp
mov    $0xac,%edi
call   1030 <isascii@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x361,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isascii_0xac>:
push   %rax
mov    $0xac,%edi
call   1030 <isascii@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x361,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0xac\00"
define void @t_isascii_0xac() {
%1 = call i64 @isascii(i32 172)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 865, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0xac\00"
define void @t_isascii_0xac() {
%1 = tail call i64 @isascii(i32 172)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 865, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ _modems();
int main(void) { return (_modems() == 0) ? 0 : 2; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <_modems@plt>
mov    %rax,%rdx
mov    $0x2,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <_modems@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
add    %ecx,%ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @_modems()
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 0, i32 2
ret i32 %5
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @_modems()
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i32 0, i32 2
ret i32 %3
}
void test_three(int x, int y) {
#pragma omp target teams distribute parallel for collapse(1)
  for (int i = 0; i < x; i++)
    for (int i = 0; i < y; i++)
      ;
}


x86 assembly (clang, -O0):
<test_three>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1156 <test_three+0x56>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1143 <test_three+0x43>
jmp    1135 <test_three+0x35>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1124 <test_three+0x24>
jmp    1148 <test_three+0x48>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1111 <test_three+0x11>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test_three(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
double RAND_MAX;
double rand();
int rand_range(int max) { return (int)(10.0 * rand() / (RAND_MAX + 1.0)); }


x86 assembly (clang, -O0):
<rand_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
movaps %xmm0,%xmm1
movsd  0xedb(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xec7(%rip),%xmm1
mov    0x2ea8(%rip),%rax
addsd  (%rax),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_range>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
mulsd  0xee0(%rip),%xmm0
mov    0x2ec1(%rip),%rax
movsd  (%rax),%xmm1
addsd  0xed5(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
pop    %rcx
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define i32 @rand_range(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call double (...) @rand()
%4 = fmul double 1.000000e+01, %3
%5 = load double, double* @RAND_MAX
%6 = fadd double %5, 1.000000e+00
%7 = fdiv double %4, %6
%8 = fptosi double %7 to i32
ret i32 %8
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define i32 @rand_range(i32 %0) {
%2 = tail call double (...) @rand()
%3 = fmul double %2, 1.000000e+01
%4 = load double, double* @RAND_MAX
%5 = fadd double %4, 1.000000e+00
%6 = fdiv double %3, %5
%7 = fptosi double %6 to i32
ret i32 %7
}
int getIntDigit(int n) { return (n / 1 > 0) ? (1 + getIntDigit(n / 10)) : 0; }


x86 assembly (clang, -O0):
<getIntDigit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
cmp    $0x0,%eax
jle    114c <getIntDigit+0x3c>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <getIntDigit@plt>
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1156 <getIntDigit+0x46>
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    1156 <getIntDigit+0x46>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getIntDigit>:
xor    %eax,%eax
test   %edi,%edi
jle    1124 <getIntDigit+0x24>
mov    $0xcccccccd,%ecx
nopl   0x0(%rax,%rax,1)
mov    %edi,%edx
imul   %rcx,%rdx
shr    $0x23,%rdx
add    $0x1,%eax
cmp    $0x9,%edi
mov    %edx,%edi
ja     1110 <getIntDigit+0x10>
ret

LLVM IR (-O0):
define i32 @getIntDigit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 1
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i32, i32* %2
%8 = sdiv i32 %7, 10
%9 = call i32 @getIntDigit(i32 %8)
%10 = add nsw i32 1, %9
br label %12
11: ; preds = %1
br label %12
12: ; preds = %11, %6
%13 = phi i32 [ %10, %6 ], [ 0, %11 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @getIntDigit(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ %0, %1 ]
%5 = phi i32 [ %7, %3 ], [ 0, %1 ]
%6 = udiv i32 %4, 10
%7 = add nuw nsw i32 %5, 1
%8 = icmp ult i32 %4, 10
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}
int fun304() { return 304; }


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

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

LLVM IR (-O0):
define i32 @fun304() {
ret i32 304
}

LLVM IR (-O2):
define i32 @fun304() {
ret i32 304
}
double max_d(double x, double y) { return x > y ? x : y; }


x86 assembly (clang, -O0):
<max_d>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    112d <max_d+0x2d>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1137 <max_d+0x37>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<max_d>:
maxsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @max_d(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp ogt double %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load double, double* %3
br label %12
10: ; preds = %2
%11 = load double, double* %4
br label %12
12: ; preds = %10, %8
%13 = phi double [ %9, %8 ], [ %11, %10 ]
ret double %13
}

LLVM IR (-O2):
define double @max_d(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
/* Type definitions */
struct cpu_thread {
  int dummy;
};
struct cpu_job {
  int dummy;
};

/* Variables and functions */
struct cpu_job *__cpu_queue_job(struct cpu_thread *, char const *,
                                void (*)(void *), void *, int);
struct cpu_job *cpu_queue_job(struct cpu_thread *cpu, const char *name,
                              void (*func)(void *data), void *data) {
  return __cpu_queue_job(cpu, name, func, data, false);
}


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

x86 assembly (clang, -O2):
<cpu_queue_job>:
xor    %r8d,%r8d
jmp    1030 <__cpu_queue_job@plt>

LLVM IR (-O0):
%struct.cpu_job = type { i32 }
%struct.cpu_thread = type { i32 }
define %struct.cpu_job* @cpu_queue_job(%struct.cpu_thread* %0, i8* %1, void (i8*)* %2, i8* %3) {
%5 = alloca %struct.cpu_thread*
%6 = alloca i8*
%7 = alloca void (i8*)*
%8 = alloca i8*
store %struct.cpu_thread* %0, %struct.cpu_thread** %5
store i8* %1, i8** %6
store void (i8*)* %2, void (i8*)** %7
store i8* %3, i8** %8
%9 = load %struct.cpu_thread*, %struct.cpu_thread** %5
%10 = load i8*, i8** %6
%11 = load void (i8*)*, void (i8*)** %7
%12 = load i8*, i8** %8
%13 = call %struct.cpu_job* @__cpu_queue_job(%struct.cpu_thread* %9, i8* %10, void (i8*)* %11, i8* %12, i32 0)
ret %struct.cpu_job* %13
}

LLVM IR (-O2):
%struct.cpu_job = type { i32 }
%struct.cpu_thread = type { i32 }
define %struct.cpu_job* @cpu_queue_job(%struct.cpu_thread* %0, i8* %1, void (i8*)* %2, i8* %3) {
%5 = tail call %struct.cpu_job* @__cpu_queue_job(%struct.cpu_thread* %0, i8* %1, void (i8*)* %2, i8* %3, i32 0)
ret %struct.cpu_job* %5
}
void cap_formatted(cbuf, arg1, arg2) char *cbuf;
int arg1, arg2;
{ tp(tgoto(cbuf, arg1, arg2), 1); }


x86 assembly (clang, -O0):
<cap_formatted>:
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
mov    $0x0,%al
call   1030 <tgoto@plt>
mov    %eax,%edi
mov    $0x1,%esi
mov    $0x0,%al
call   1040 <tp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cap_formatted>:
push   %rax
xor    %eax,%eax
call   1030 <tgoto@plt>
mov    %eax,%edi
mov    $0x1,%esi
xor    %eax,%eax
pop    %rcx
jmp    1040 <tp@plt>

LLVM IR (-O0):
define void @cap_formatted(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @tgoto to i32 (i8*, i32, i32, ...)*)(i8* %7, i32 %8, i32 %9)
%11 = call i32 (i32, i32, ...) bitcast (i32 (...)* @tp to i32 (i32, i32, ...)*)(i32 %10, i32 1)
ret void
}

LLVM IR (-O2):
define void @cap_formatted(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @tgoto to i32 (i8*, i32, i32, ...)*)(i8* %0, i32 %1, i32 %2)
%5 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @tp to i32 (i32, i32, ...)*)(i32 %4, i32 1)
ret void
}
/* Variables and functions */
int close(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ genlockfilename(char *);
int /*<<< orphan*/ stderr;
int unlink(int /*<<< orphan*/);
int unlockfile(char *file, int fd) {
  if (close(fd) == -1) {
    fprintf(stderr, "unlockfile::close: problem closing file: %m");
    return -1;
  }
  return unlink(genlockfilename(file));
}


x86 assembly (clang, -O0):
<unlockfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <close@plt>
cmp    $0xffffffff,%eax
jne    1181 <unlockfile+0x41>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
lea    0xe90(%rip),%rsi
call   1050 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1194 <unlockfile+0x54>
mov    -0x10(%rbp),%rdi
call   1060 <genlockfilename@plt>
mov    %eax,%edi
call   1030 <unlink@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unlockfile>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
call   1040 <close@plt>
cmp    $0xffffffff,%eax
je     1160 <unlockfile+0x20>
mov    %rbx,%rdi
call   1060 <genlockfilename@plt>
mov    %eax,%edi
pop    %rbx
jmp    1030 <unlink@plt>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
lea    0xe90(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [44 x i8] c"unlockfile::close: problem closing file: %m\00"
define i32 @unlockfile(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = call i32 @close(i32 %6)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i32, i32* @stderr
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %16
12: ; preds = %2
%13 = load i8*, i8** %4
%14 = call i32 @genlockfilename(i8* %13)
%15 = call i32 @unlink(i32 %14)
store i32 %15, i32* %3
br label %16
16: ; preds = %12, %9
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [44 x i8] c"unlockfile::close: problem closing file: %m\00"
define i32 @unlockfile(i8* %0, i32 %1) {
%3 = tail call i32 @close(i32 %1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
br label %11
8: ; preds = %2
%9 = tail call i32 @genlockfilename(i8* %0)
%10 = tail call i32 @unlink(i32 %9)
br label %11
11: ; preds = %8, %5
%12 = phi i32 [ -1, %5 ], [ %10, %8 ]
ret i32 %12
}
int arch_get_scno(struct tcb *tcp) { return 1; }


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

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

LLVM IR (-O0):
%struct.tcb = type opaque
define i32 @arch_get_scno(%struct.tcb* %0) {
%2 = alloca %struct.tcb*
store %struct.tcb* %0, %struct.tcb** %2
ret i32 1
}

LLVM IR (-O2):
%struct.tcb = type opaque
define i32 @arch_get_scno(%struct.tcb* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
int check_arg_count(int, int /*<<< orphan*/);
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_return(int /*<<< orphan*/);
void cmd_endwin(int nargs, char **args) {
  if (check_arg_count(nargs, 0) == 1)
    return;
  report_count(1);
  report_return(endwin());
}


x86 assembly (clang, -O0):
<cmd_endwin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1040 <check_arg_count@plt>
cmp    $0x1,%eax
jne    1167 <cmd_endwin+0x27>
jmp    117f <cmd_endwin+0x3f>
mov    $0x1,%edi
call   1050 <report_count@plt>
mov    $0x0,%al
call   1060 <endwin@plt>
mov    %eax,%edi
call   1030 <report_return@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_endwin>:
push   %rax
xor    %esi,%esi
call   1040 <check_arg_count@plt>
cmp    $0x1,%eax
jne    114f <cmd_endwin+0xf>
pop    %rax
ret
mov    $0x1,%edi
call   1050 <report_count@plt>
xor    %eax,%eax
call   1060 <endwin@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <report_return@plt>

LLVM IR (-O0):
define void @cmd_endwin(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = call i32 @check_arg_count(i32 %5, i32 0)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %2
br label %13
9: ; preds = %2
%10 = call i32 @report_count(i32 1)
%11 = call i32 (...) @endwin()
%12 = call i32 @report_return(i32 %11)
br label %13
13: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
define void @cmd_endwin(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @check_arg_count(i32 %0, i32 0)
%4 = icmp eq i32 %3, 1
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 @report_count(i32 1)
%7 = tail call i32 (...) @endwin()
%8 = tail call i32 @report_return(i32 %7)
br label %9
9: ; preds = %2, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ term_putchar(char);
int /*<<< orphan*/ term_putsn(char const *);
void term_puts(const char *str) {
  term_putsn(str);
  term_putchar('\n');
}


x86 assembly (clang, -O0):
<term_puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <term_putsn@plt>
mov    $0xa,%edi
call   1040 <term_putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<term_puts>:
push   %rax
call   1030 <term_putsn@plt>
mov    $0xa,%edi
pop    %rax
jmp    1040 <term_putchar@plt>

LLVM IR (-O0):
define void @term_puts(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @term_putsn(i8* %3)
%5 = call i32 @term_putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
define void @term_puts(i8* %0) {
%2 = tail call i32 @term_putsn(i8* %0)
%3 = tail call i32 @term_putchar(i8 signext 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void testDanish() {
  printf("Output should look like\n");
  printf("** *********\n");
  printf("** *********\n");
  printf("\n");
  printf("** *********\n");
  printf("** *********\n");
}


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

x86 assembly (clang, -O2):
<testDanish>:
push   %rbx
lea    0xed8(%rip),%rdi
call   1040 <puts@plt>
lea    0xee4(%rip),%rbx
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"Output should look like\0A\00"
@.str.1 = [14 x i8] c"** *********\0A\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @testDanish() {
%1 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [24 x i8] c"Output should look like\00"
@str.6 = [13 x i8] c"** *********\00"
define void @testDanish() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.6, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.6, i64 0, i64 0))
%4 = tail call i32 @putchar(i32 10)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.6, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.6, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef scalar_t__ volatile uint32_t;

/* Variables and functions */
void PWMIntDisable(uint32_t ui32Base, uint32_t ui32GenFault) {
  ;

  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000014))) &= ~(ui32GenFault);
}


x86 assembly (clang, -O0):
<PWMIntDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
xor    $0xffffffffffffffff,%rdx
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%rcx
and    %rdx,%rcx
mov    %rcx,0x14(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<PWMIntDisable>:
mov    %rdi,-0x8(%rsp)
mov    %rsi,-0x10(%rsp)
mov    -0x10(%rsp),%rax
not    %rax
mov    -0x8(%rsp),%rcx
and    %rax,0x14(%rcx)
ret

LLVM IR (-O0):
define void @PWMIntDisable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = xor i64 %5, -1
%7 = load volatile i64, i64* %3
%8 = add nsw i64 %7, 20
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
%11 = and i64 %10, %6
store volatile i64 %11, i64* %9
ret void
}

LLVM IR (-O2):
define void @PWMIntDisable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = xor i64 %5, -1
%7 = load volatile i64, i64* %3
%8 = add nsw i64 %7, 20
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
%11 = and i64 %10, %6
store volatile i64 %11, i64* %9
ret void
}
/* Variables and functions */
scalar_t__ microtime_();
long timeseed_() { return (long)microtime_(); }


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

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

LLVM IR (-O0):
define i64 @timeseed_() {
%1 = call i64 (...) @microtime_()
ret i64 %1
}

LLVM IR (-O2):
define i64 @timeseed_() {
%1 = tail call i64 (...) @microtime_()
ret i64 %1
}
/* Variables and functions */
int mwmAddPatternEx(void *, unsigned char *, int, int /*<<< orphan*/,
                    unsigned int, int /*<<< orphan*/, void *,
                    int /*<<< orphan*/);
int mwmAddPattern(void *pv, unsigned char *P, int m, unsigned id) {
  return mwmAddPatternEx(pv, P, m, 0, id, 0, pv, 0);
}


x86 assembly (clang, -O0):
<mwmAddPattern>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%r8d
mov    -0x8(%rbp),%rax
xor    %r9d,%r9d
mov    %r9d,%ecx
mov    %rax,(%rsp)
movl   $0x0,0x8(%rsp)
call   1030 <mwmAddPatternEx@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mwmAddPattern>:
push   %rax
mov    %ecx,%r8d
xor    %ecx,%ecx
xor    %r9d,%r9d
push   $0x0
push   %rdi
call   1030 <mwmAddPatternEx@plt>
add    $0x10,%rsp
pop    %rcx
ret

LLVM IR (-O0):
define i32 @mwmAddPattern(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = load i8*, i8** %5
%14 = call i32 @mwmAddPatternEx(i8* %9, i8* %10, i32 %11, i32 0, i32 %12, i32 0, i8* %13, i32 0)
ret i32 %14
}

LLVM IR (-O2):
define i32 @mwmAddPattern(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 @mwmAddPatternEx(i8* %0, i8* %1, i32 %2, i32 0, i32 %3, i32 0, i8* %0, i32 0)
ret i32 %5
}
int sign_d(double x) {
  if (x > 0.000000001)
    return 1;
  if (x < -0.000000001)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<sign_d>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    112c <sign_d+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    1152 <sign_d+0x52>
movsd  0xed4(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    114b <sign_d+0x4b>
movl   $0xffffffff,-0x4(%rbp)
jmp    1152 <sign_d+0x52>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sign_d>:
movsd  0xef8(%rip),%xmm1
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
seta   %cl
neg    %ecx
ucomisd 0xeed(%rip),%xmm0
mov    $0x1,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @sign_d(double %0) {
%2 = alloca i32
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp ogt double %4, 1.000000e-09
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 1, i32* %2
br label %12
7: ; preds = %1
%8 = load double, double* %3
%9 = fcmp olt double %8, -1.000000e-09
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 -1, i32* %2
br label %12
11: ; preds = %7
store i32 0, i32* %2
br label %12
12: ; preds = %11, %10, %6
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @sign_d(double %0) {
%2 = fcmp ogt double %0, 1.000000e-09
%3 = fcmp olt double %0, -1.000000e-09
%4 = sext i1 %3 to i32
%5 = select i1 %2, i32 1, i32 %4
ret i32 %5
}
char *hash_plugin_detailed(void) {
  return ("msoffice-old - Microsoft Office XP/2003 plugin\n"
          "------------------------------------------------\n"
          "Use this module to crack password-protected MS Office files\n"
          "Input should be a MS Office file specified with -f\n"
          "Known software that uses this password hashing method:\n"
          "Microsoft Office 2000,XP,2003.\n"
          "\nAuthor: Milen Rangelov <gat3way@gat3way.eu>\n");
}


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

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

LLVM IR (-O0):
@.str = [339 x i8] c"msoffice-old - Microsoft Office XP/2003 plugin\0A------------------------------------------------\0AUse this module to crack password-protected MS Office files\0AInput should be a MS Office file specified with -f\0AKnown software that uses this password hashing method:\0AMicrosoft Office 2000,XP,2003.\0A\0AAuthor: Milen Rangelov <gat3way@gat3way.eu>\0A\00"
define i8* @hash_plugin_detailed() {
ret i8* getelementptr inbounds ([339 x i8], [339 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [339 x i8] c"msoffice-old - Microsoft Office XP/2003 plugin\0A------------------------------------------------\0AUse this module to crack password-protected MS Office files\0AInput should be a MS Office file specified with -f\0AKnown software that uses this password hashing method:\0AMicrosoft Office 2000,XP,2003.\0A\0AAuthor: Milen Rangelov <gat3way@gat3way.eu>\0A\00"
define i8* @hash_plugin_detailed() {
ret i8* getelementptr inbounds ([339 x i8], [339 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void ge_helper_release_vdo_framebuf(void *vdo_framebuf) {
  if (vdo_framebuf)
    free(vdo_framebuf);
}


x86 assembly (clang, -O0):
<ge_helper_release_vdo_framebuf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <ge_helper_release_vdo_framebuf+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ge_helper_release_vdo_framebuf>:
test   %rdi,%rdi
je     111a <ge_helper_release_vdo_framebuf+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @ge_helper_release_vdo_framebuf(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @ge_helper_release_vdo_framebuf(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
int /*<<< orphan*/ EBADF;
#define STDIN_FILENO 128
int /*<<< orphan*/ errno;
int read_stdin(unsigned char *, unsigned int);
__attribute__((weak)) ssize_t _read(int file, char *ptr, size_t count) {
  switch (file) {
  case STDIN_FILENO:
    return read_stdin((unsigned char *)ptr, (unsigned int)count);
    break;
  default:
    errno = EBADF;
    return -1;
  }
}


x86 assembly (clang, -O0):
<_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x80,%eax
jne    114d <_read+0x3d>
jmp    1136 <_read+0x26>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    %eax,%esi
call   1030 <read_stdin@plt>
mov    %eax,-0x4(%rbp)
jmp    1166 <_read+0x56>
mov    0x2e84(%rip),%rax
mov    (%rax),%ecx
mov    0x2e83(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_read>:
cmp    $0x80,%edi
jne    1122 <_read+0x12>
mov    %rsi,%rdi
mov    %edx,%esi
jmp    1030 <read_stdin@plt>
mov    0x2eaf(%rip),%rax
mov    (%rax),%eax
mov    0x2eae(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@EBADF = global i32 0
@errno = global i32 0
define weak i32 @_read(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
store i32 %0, i32* %5
store i8* %1, i8** %6
store i64 %2, i64* %7
%8 = load i32, i32* %5
switch i32 %8, label %14 [
i32 128, label %9
]
9: ; preds = %3
%10 = load i8*, i8** %6
%11 = load i64, i64* %7
%12 = trunc i64 %11 to i32
%13 = call i32 @read_stdin(i8* %10, i32 %12)
store i32 %13, i32* %4
br label %16
14: ; preds = %3
%15 = load i32, i32* @EBADF
store i32 %15, i32* @errno
store i32 -1, i32* %4
br label %16
16: ; preds = %14, %9
%17 = load i32, i32* %4
ret i32 %17
}

LLVM IR (-O2):
@EBADF = global i32 0
@errno = global i32 0
define weak i32 @_read(i32 %0, i8* %1, i64 %2) {
%4 = icmp eq i32 %0, 128
br i1 %4, label %5, label %8
5: ; preds = %3
%6 = trunc i64 %2 to i32
%7 = tail call i32 @read_stdin(i8* %1, i32 %6)
br label %10
8: ; preds = %3
%9 = load i32, i32* @EBADF
store i32 %9, i32* @errno
br label %10
10: ; preds = %8, %5
%11 = phi i32 [ %7, %5 ], [ -1, %8 ]
ret i32 %11
}
/* Variables and functions */
double B(double);
int cos(double);
double sqrt(int);
double Fsn(double phi, double k) {
  double Fsn = k * cos(B(phi)) * (sqrt(20 + 16 * cos(phi)) - sqrt(20));
  return Fsn;
}


x86 assembly (clang, -O0):
<Fsn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <B@plt>
call   1040 <cos@plt>
movsd  -0x30(%rbp),%xmm0
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <cos@plt>
mov    %eax,%edi
shl    $0x4,%edi
add    $0x14,%edi
call   1050 <sqrt@plt>
movsd  %xmm0,-0x28(%rbp)
mov    $0x14,%edi
call   1050 <sqrt@plt>
movsd  -0x28(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x20(%rbp),%xmm0
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Fsn>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
call   1030 <B@plt>
call   1040 <cos@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1040 <cos@plt>
shl    $0x4,%eax
lea    0x14(%rax),%edi
call   1050 <sqrt@plt>
movsd  %xmm0,0x8(%rsp)
mov    $0x14,%edi
call   1050 <sqrt@plt>
movsd  0x8(%rsp),%xmm1
subsd  %xmm0,%xmm1
mulsd  0x10(%rsp),%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @Fsn(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %4
%7 = load double, double* %3
%8 = call double @B(double %7)
%9 = call i32 @cos(double %8)
%10 = sitofp i32 %9 to double
%11 = fmul double %6, %10
%12 = load double, double* %3
%13 = call i32 @cos(double %12)
%14 = mul nsw i32 16, %13
%15 = add nsw i32 20, %14
%16 = call double @sqrt(i32 %15)
%17 = call double @sqrt(i32 20)
%18 = fsub double %16, %17
%19 = fmul double %11, %18
store double %19, double* %5
%20 = load double, double* %5
ret double %20
}

LLVM IR (-O2):
define double @Fsn(double %0, double %1) {
%3 = tail call double @B(double %0)
%4 = tail call i32 @cos(double %3)
%5 = sitofp i32 %4 to double
%6 = fmul double %5, %1
%7 = tail call i32 @cos(double %0)
%8 = shl nsw i32 %7, 4
%9 = add nsw i32 %8, 20
%10 = tail call double @sqrt(i32 %9)
%11 = tail call double @sqrt(i32 20)
%12 = fsub double %10, %11
%13 = fmul double %6, %12
ret double %13
}
int order(int num) {
  int count;
  while (num > 0) {
    count++;
    num /= 10;
  }
  return count;
}


x86 assembly (clang, -O0):
<order>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    112d <order+0x2d>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    1107 <order+0x7>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<order>:
test   %edi,%edi
jle    1125 <order+0x25>
mov    $0xcccccccd,%ecx
nopl   0x0(%rax)
add    $0x1,%eax
mov    %edi,%edx
imul   %rcx,%rdx
shr    $0x23,%rdx
cmp    $0x9,%edi
mov    %edx,%edi
ja     1110 <order+0x10>
ret
ret

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

LLVM IR (-O2):
define i32 @order(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ undef, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add nsw i32 %4, 1
%7 = udiv i32 %5, 10
%8 = icmp ult i32 %5, 10
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ undef, %1 ], [ %6, %3 ]
ret i32 %10
}
seteuid(euid) { return (setuid(euid << 8 | getuid() & 0377)); }


x86 assembly (clang, -O0):
<seteuid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <getuid@plt>
mov    -0x8(%rbp),%edi
and    $0xff,%eax
or     %eax,%edi
mov    $0x0,%al
call   1040 <setuid@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<seteuid>:
push   %rbx
mov    %edi,%ebx
shl    $0x8,%ebx
xor    %eax,%eax
call   1030 <getuid@plt>
movzbl %al,%edi
or     %ebx,%edi
xor    %eax,%eax
pop    %rbx
jmp    1040 <setuid@plt>

LLVM IR (-O0):
define i32 @seteuid(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 8
%5 = call i32 (...) @getuid()
%6 = and i32 %5, 255
%7 = or i32 %4, %6
%8 = call i32 (i32, ...) bitcast (i32 (...)* @setuid to i32 (i32, ...)*)(i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @seteuid(i32 %0) {
%2 = shl i32 %0, 8
%3 = tail call i32 (...) @getuid()
%4 = and i32 %3, 255
%5 = or i32 %4, %2
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @setuid to i32 (i32, ...)*)(i32 %5)
ret i32 %6
}