xunge/DecIR huggingface dataset:
int ranf(max)
int max;
{
  register int t;
  if (max <= 0)
    return (0);
  t = rand() >> 5;
  return (t % max);
}


x86 assembly (clang, -O0):
<ranf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     1131 <ranf+0x21>
movl   $0x0,-0x4(%rbp)
jmp    1148 <ranf+0x38>
mov    $0x0,%al
call   1030 <rand@plt>
sar    $0x5,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ranf>:
test   %edi,%edi
jle    1128 <ranf+0x18>
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
sar    $0x5,%eax
cltd
idiv   %ebx
mov    %edx,%eax
pop    %rbx
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @ranf(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = icmp sle i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %14
8: ; preds = %1
%9 = call i32 (...) @rand()
%10 = ashr i32 %9, 5
store i32 %10, i32* %4
%11 = load i32, i32* %4
%12 = load i32, i32* %3
%13 = srem i32 %11, %12
store i32 %13, i32* %2
br label %14
14: ; preds = %8, %7
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @ranf(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i32 (...) @rand()
%5 = ashr i32 %4, 5
%6 = srem i32 %5, %0
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ 0, %1 ]
ret i32 %8
}
void *start_routine(void *args) { return args; }


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

x86 assembly (clang, -O2):
<start_routine>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @start_routine(i8* readnone returned %0) {
ret i8* %0
}
/* Variables and functions */
bool SZT_MUL_OVFCHK(size_t a, size_t b) {
  return (a > 0 && b > 0 && a > 0xFFFFFFFFFFFFFFFFULL / b);
}


x86 assembly (clang, -O0):
<SZT_MUL_OVFCHK>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x11(%rbp)
jbe    1153 <SZT_MUL_OVFCHK+0x53>
xor    %eax,%eax
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x11(%rbp)
jbe    1153 <SZT_MUL_OVFCHK+0x53>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    $0xffffffffffffffff,%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
seta   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SZT_MUL_OVFCHK>:
mov    %rsi,%rax
xor    %ecx,%ecx
mul    %rdi
seto   %cl
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @SZT_MUL_OVFCHK(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = icmp ugt i64 %5, 0
br i1 %6, label %7, label %15
7: ; preds = %2
%8 = load i64, i64* %4
%9 = icmp ugt i64 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %7
%11 = load i64, i64* %3
%12 = load i64, i64* %4
%13 = udiv i64 -1, %12
%14 = icmp ugt i64 %11, %13
br label %15
15: ; preds = %10, %7, %2
%16 = phi i1 [ false, %7 ], [ false, %2 ], [ %14, %10 ]
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @SZT_MUL_OVFCHK(i64 %0, i64 %1) {
%3 = tail call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %1, i64 %0)
%4 = extractvalue { i64, i1 } %3, 1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ symbol_ResetStandardVarCounter();
int /*<<< orphan*/ term_NewMark();
void term_StartMinRenaming(void) {
  symbol_ResetStandardVarCounter();
  term_NewMark();
}


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

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

LLVM IR (-O0):
define void @term_StartMinRenaming() {
%1 = call i32 (...) @symbol_ResetStandardVarCounter()
%2 = call i32 (...) @term_NewMark()
ret void
}

LLVM IR (-O2):
define void @term_StartMinRenaming() {
%1 = tail call i32 (...) @symbol_ResetStandardVarCounter()
%2 = tail call i32 (...) @term_NewMark()
ret void
}
/* Variables and functions */
int check_arg_count(int, int);
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_error(char *);
void cmd_mvwadd_wchnstr(int nargs, char **args) {
  if (check_arg_count(nargs, 1) == 1)
    return;
  report_count(1);
  report_error("UNSUPPORTED");
}


x86 assembly (clang, -O0):
<cmd_mvwadd_wchnstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    115a <cmd_mvwadd_wchnstr+0x2a>
jmp    1170 <cmd_mvwadd_wchnstr+0x40>
mov    $0x1,%edi
call   1040 <report_count@plt>
lea    0xe95(%rip),%rdi
call   1050 <report_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_mvwadd_wchnstr>:
push   %rax
mov    $0x1,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    1142 <cmd_mvwadd_wchnstr+0x12>
pop    %rax
ret
mov    $0x1,%edi
call   1040 <report_count@plt>
lea    0xead(%rip),%rdi
pop    %rax
jmp    1050 <report_error@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"UNSUPPORTED\00"
define void @cmd_mvwadd_wchnstr(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 1)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %2
br label %12
9: ; preds = %2
%10 = call i32 @report_count(i32 1)
%11 = call i32 @report_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"UNSUPPORTED\00"
define void @cmd_mvwadd_wchnstr(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @check_arg_count(i32 %0, i32 1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @report_count(i32 1)
%7 = tail call i32 @report_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %2, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_id(char *);
void *thread_task(void *arg) {
  print_id("child thread:");
  return NULL;
}


x86 assembly (clang, -O0):
<thread_task>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
call   1030 <print_id@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [14 x i8] c"child thread:\00"
define i8* @thread_task(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @print_id(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i8* null
}

LLVM IR (-O2):
@.str = [14 x i8] c"child thread:\00"
define noalias i8* @thread_task(i8* nocapture readnone %0) {
%2 = tail call i32 @print_id(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i8* null
}
/* Type definitions */
struct nfa {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct nfa *);
int /*<<< orphan*/ nfa_fini(struct nfa *);
void nfa_free(struct nfa *nfa) {
  if (nfa) {
    nfa_fini(nfa);
    free(nfa);
  }
}


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

x86 assembly (clang, -O2):
<nfa_free>:
test   %rdi,%rdi
je     1137 <nfa_free+0x17>
push   %rbx
mov    %rdi,%rbx
call   1040 <nfa_fini@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
%struct.nfa = type { i32 }
define void @nfa_free(%struct.nfa* %0) {
%2 = icmp eq %struct.nfa* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @nfa_fini(%struct.nfa* %0)
%5 = tail call i32 @free(%struct.nfa* %0)
br label %6
6: ; preds = %3, %1
ret void
}
void gtk_notebook_get_scrollable() {}


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

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

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

LLVM IR (-O2):
define void @gtk_notebook_get_scrollable() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isprint(int);
void t_isprint_0x6b() {
  Assert_real((isprint(107)),
              "/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_isprint.c",
              540, ("isprint should be 1 for k"));
}


x86 assembly (clang, -O0):
<t_isprint_0x6b>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6b,%edi
call   1030 <isprint@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x21c,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isprint_0x6b>:
push   %rax
mov    $0x6b,%edi
call   1030 <isprint@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x21c,%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_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for k\00"
define void @t_isprint_0x6b() {
%1 = call i32 @isprint(i32 107)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 540, i8* getelementptr inbounds ([26 x i8], [26 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_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for k\00"
define void @t_isprint_0x6b() {
%1 = tail call i32 @isprint(i32 107)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 540, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ERR_free_strings();
int /*<<< orphan*/ ERR_remove_state(int /*<<< orphan*/);
int /*<<< orphan*/ EVP_cleanup();
void tls_module_uninit(void) {
  ERR_free_strings();
  EVP_cleanup();
  ERR_remove_state(0);
}


x86 assembly (clang, -O0):
<tls_module_uninit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <ERR_free_strings@plt>
mov    $0x0,%al
call   1040 <EVP_cleanup@plt>
xor    %edi,%edi
call   1030 <ERR_remove_state@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<tls_module_uninit>:
push   %rax
xor    %eax,%eax
call   1050 <ERR_free_strings@plt>
xor    %eax,%eax
call   1040 <EVP_cleanup@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <ERR_remove_state@plt>

LLVM IR (-O0):
define void @tls_module_uninit() {
%1 = call i32 (...) @ERR_free_strings()
%2 = call i32 (...) @EVP_cleanup()
%3 = call i32 @ERR_remove_state(i32 0)
ret void
}

LLVM IR (-O2):
define void @tls_module_uninit() {
%1 = tail call i32 (...) @ERR_free_strings()
%2 = tail call i32 (...) @EVP_cleanup()
%3 = tail call i32 @ERR_remove_state(i32 0)
ret void
}
unsigned int vied_bit_slice(unsigned int value, unsigned int lsb,
                            unsigned int numbits) {
  unsigned int mask = (1 << numbits) - 1;
  return (value >> lsb) & mask;
}


x86 assembly (clang, -O0):
<vied_bit_slice>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    %cl,%eax
and    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vied_bit_slice>:
mov    %edx,%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
not    %eax
mov    %esi,%ecx
shr    %cl,%edi
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @vied_bit_slice(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = shl i32 1, %8
%10 = sub nsw i32 %9, 1
store i32 %10, i32* %7
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = lshr i32 %11, %12
%14 = load i32, i32* %7
%15 = and i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @vied_bit_slice(i32 %0, i32 %1, i32 %2) {
%4 = shl nsw i32 -1, %2
%5 = xor i32 %4, -1
%6 = lshr i32 %0, %1
%7 = and i32 %6, %5
ret i32 %7
}
int portaudio_seek_to_beginning(struct audiotap *audiotap) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.audiotap = type opaque
define i32 @portaudio_seek_to_beginning(%struct.audiotap* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
size_t strlen(const char *s) {
  const char *ptr;
  for (ptr = s; *ptr; ptr++)
    ;
  return (ptr - s);
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1133 <strlen+0x33>
jmp    1122 <strlen+0x22>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
ret i64 %10
}
int max2(int a, int b) { return (a >= b) ? a : b; }


x86 assembly (clang, -O0):
<max2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     1121 <max2+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <max2+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max2>:
mov    %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @max2(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
void view_hotel_volume_maximum(void) {}


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

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

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

LLVM IR (-O2):
define void @view_hotel_volume_maximum() {
ret void
}
/* Variables and functions */
int strcmp(char *, char *);
int reverse(char **a, char **b) { return (-1 * strcmp(*a, *b)); }


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
call   1030 <strcmp@plt>
imul   $0xffffffff,%eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
push   %rax
mov    (%rdi),%rdi
mov    (%rsi),%rsi
call   1030 <strcmp@plt>
neg    %eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @reverse(i8** %0, i8** %1) {
%3 = alloca i8**
%4 = alloca i8**
store i8** %0, i8*** %3
store i8** %1, i8*** %4
%5 = load i8**, i8*** %3
%6 = load i8*, i8** %5
%7 = load i8**, i8*** %4
%8 = load i8*, i8** %7
%9 = call i32 @strcmp(i8* %6, i8* %8)
%10 = mul nsw i32 -1, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @reverse(i8** nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %0
%4 = load i8*, i8** %1
%5 = tail call i32 @strcmp(i8* dereferenceable(1) %3, i8* dereferenceable(1) %4)
%6 = sub nsw i32 0, %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int ParseError(int state, int symbol) {
  printf("Parsing Error, state[%d], symbol=[%d]\n", state, symbol);
  return 1;
}


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

x86 assembly (clang, -O2):
<ParseError>:
push   %rax
mov    %esi,%edx
mov    %edi,%esi
lea    0xee4(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [39 x i8] c"Parsing Error, state[%d], symbol=[%d]\0A\00"
define i32 @ParseError(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret i32 1
}

LLVM IR (-O2):
@.str = [39 x i8] c"Parsing Error, state[%d], symbol=[%d]\0A\00"
define i32 @ParseError(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void curly_log_msg_cb(char *msg) { printf("curly says: %s\n", msg); }


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

x86 assembly (clang, -O2):
<curly_log_msg_cb>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [16 x i8] c"curly says: %s\0A\00"
define void @curly_log_msg_cb(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef unsigned long uint32_t;

/* Variables and functions */
void SSIDataGet(uint32_t ui32Base, uint32_t *pui32Data) {
  ;
  while (
      !((*((volatile unsigned long *)(ui32Base + 0x0000000C))) & 0x00000004)) {
  }
  *pui32Data = (*((volatile unsigned long *)(ui32Base + 0x00000008)));
}


x86 assembly (clang, -O0):
<SSIDataGet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%rax
and    $0x4,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    112e <SSIDataGet+0x2e>
jmp    1133 <SSIDataGet+0x33>
jmp    110c <SSIDataGet+0xc>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SSIDataGet>:
testq  $0x4,0xc(%rdi)
je     1100 <SSIDataGet>
mov    0x8(%rdi),%rax
mov    %rax,(%rsi)
ret

LLVM IR (-O0):
define void @SSIDataGet(i64 %0, i64* %1) {
%3 = alloca i64
%4 = alloca i64*
store i64 %0, i64* %3
store i64* %1, i64** %4
br label %5
5: ; preds = %13, %2
%6 = load i64, i64* %3
%7 = add i64 %6, 12
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = and i64 %9, 4
%11 = icmp ne i64 %10, 0
%12 = xor i1 %11, true
br i1 %12, label %13, label %14
13: ; preds = %5
br label %5
14: ; preds = %5
%15 = load i64, i64* %3
%16 = add i64 %15, 8
%17 = inttoptr i64 %16 to i64*
%18 = load volatile i64, i64* %17
%19 = load i64*, i64** %4
store i64 %18, i64* %19
ret void
}

LLVM IR (-O2):
define void @SSIDataGet(i64 %0, i64* nocapture writeonly %1) {
%3 = add i64 %0, 12
%4 = inttoptr i64 %3 to i64*
br label %5
5: ; preds = %5, %2
%6 = load volatile i64, i64* %4
%7 = and i64 %6, 4
%8 = icmp eq i64 %7, 0
br i1 %8, label %5, label %9
9: ; preds = %5
%10 = add i64 %0, 8
%11 = inttoptr i64 %10 to i64*
%12 = load volatile i64, i64* %11
store i64 %12, i64* %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutexattr_t;
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ Sys_failure(char *);
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int pthread_mutex_init(int /*<<< orphan*/ *, int /*<<< orphan*/ const *);
void Pthread_mutex_init(pthread_mutex_t *mutex,
                        const pthread_mutexattr_t *mutexattr) {
  int retval;
  assert(mutex != NULL);
  retval = pthread_mutex_init(mutex, mutexattr);
  if (retval != 0)
    Sys_failure("pthread_mutex_init");
}


x86 assembly (clang, -O0):
<Pthread_mutex_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <pthread_mutex_init@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1178 <Pthread_mutex_init+0x48>
lea    0xe8d(%rip),%rdi
call   1040 <Sys_failure@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Pthread_mutex_init>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <pthread_mutex_init@plt>
test   %eax,%eax
je     116a <Pthread_mutex_init+0x3a>
lea    0xea2(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <Sys_failure@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [19 x i8] c"pthread_mutex_init\00"
define void @Pthread_mutex_init(i32* %0, i32* %1) {
%3 = icmp ne i32* %0, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i32 @pthread_mutex_init(i32* %0, i32* %1)
%7 = icmp eq i32 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = tail call i32 @Sys_failure(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LOG_INFO;
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *);
void ignoreSignal(int sig) { syslog(LOG_INFO, "SIGHUP Received by parent!"); }


x86 assembly (clang, -O0):
<ignoreSignal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
lea    0xed5(%rip),%rsi
call   1030 <syslog@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@LOG_INFO = global i32 0
@.str = [27 x i8] c"SIGHUP Received by parent!\00"
define void @ignoreSignal(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @LOG_INFO
%4 = call i32 @syslog(i32 %3, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@LOG_INFO = global i32 0
@.str = [27 x i8] c"SIGHUP Received by parent!\00"
define void @ignoreSignal(i32 %0) {
%2 = load i32, i32* @LOG_INFO
%3 = tail call i32 @syslog(i32 %2, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
unsigned long fwrite(void const *, int, unsigned long, int /*<<< orphan*/ *);
int psi_write(FILE *fp, const void *buf, unsigned long cnt) {
  if (fwrite(buf, 1, cnt, fp) != cnt) {
    return (1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<psi_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    $0x1,%esi
call   1030 <fwrite@plt>
cmp    -0x20(%rbp),%rax
je     1150 <psi_write+0x40>
movl   $0x1,-0x4(%rbp)
jmp    1157 <psi_write+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psi_write>:
push   %rbx
mov    %rdx,%rbx
mov    %rdi,%rcx
mov    %rsi,%rdi
mov    $0x1,%esi
call   1030 <fwrite@plt>
xor    %ecx,%ecx
cmp    %rbx,%rax
setne  %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @psi_write(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 i8*, i8** %6
%9 = load i64, i64* %7
%10 = load i32*, i32** %5
%11 = call i64 @fwrite(i8* %8, i32 1, i64 %9, i32* %10)
%12 = load i64, i64* %7
%13 = icmp ne i64 %11, %12
br i1 %13, label %14, label %15
14: ; preds = %3
store i32 1, i32* %4
br label %16
15: ; preds = %3
store i32 0, i32* %4
br label %16
16: ; preds = %15, %14
%17 = load i32, i32* %4
ret i32 %17
}

LLVM IR (-O2):
define i32 @psi_write(i32* nocapture %0, i8* nocapture %1, i64 %2) {
%4 = tail call i64 @fwrite(i8* %1, i32 1, i64 %2, i32* %0)
%5 = icmp ne i64 %4, %2
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void ErrorHandler(char *errorMessage) { printf("%s", errorMessage); }


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

x86 assembly (clang, -O2):
<ErrorHandler>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @ErrorHandler(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *const);
void astringPrint(FILE *fp, const char *const *data, int indent) {
  fprintf(fp, "\"%s\"", *data);
}


x86 assembly (clang, -O0):
<astringPrint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xecb(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<astringPrint>:
mov    (%rsi),%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"\22%s\22\00"
define void @astringPrint(i32* %0, i8** %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i8**
%6 = alloca i32
store i32* %0, i32** %4
store i8** %1, i8*** %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load i8**, i8*** %5
%9 = load i8*, i8** %8
%10 = call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"\22%s\22\00"
define void @astringPrint(i32* nocapture %0, i8** nocapture %1, i32 %2) {
%4 = load i8*, i8** %1
%5 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ test75_TestFcnRtn_foo__E();
void test75_Test_pollen__run__E() {
  test75_TestFcnRtn_foo__E();
  exit(0);
}


x86 assembly (clang, -O0):
<test75_Test_pollen__run__E>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <test75_TestFcnRtn_foo__E@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
define void @test75_Test_pollen__run__E() {
%1 = call i32 (...) @test75_TestFcnRtn_foo__E()
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @test75_Test_pollen__run__E() {
%1 = tail call i32 (...) @test75_TestFcnRtn_foo__E()
%2 = tail call i32 @exit(i32 0)
unreachable
}
int __mman_alias_page() {}


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

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

LLVM IR (-O0):
define i32 @__mman_alias_page() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @__mman_alias_page() {
ret i32 undef
}
void func2(void) {}


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

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

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

LLVM IR (-O2):
define void @func2() {
ret void
}
/* Variables and functions */
int approxEquals(double, double, double);
int /*<<< orphan*/ printf(char *, double, double, int);
void test(double a, double b) {
  double epsilon = 1e-18;
  printf("%f, %f => %d\n", a, b, approxEquals(a, b, epsilon));
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xec6(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1040 <approxEquals@plt>
movsd  -0x28(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
mov    %eax,%esi
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
movsd  0xec8(%rip),%xmm2
call   1040 <approxEquals@plt>
lea    0xec4(%rip),%rdi
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
mov    %eax,%esi
add    $0x18,%rsp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"%f, %f => %d\0A\00"
define void @test(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
store double 1.000000e-18, double* %5
%6 = load double, double* %3
%7 = load double, double* %4
%8 = load double, double* %3
%9 = load double, double* %4
%10 = load double, double* %5
%11 = call i32 @approxEquals(double %8, double %9, double %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), double %6, double %7, i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"%f, %f => %d\0A\00"
define void @test(double %0, double %1) {
%3 = tail call i32 @approxEquals(double %0, double %1, double 1.000000e-18)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), double %0, double %1, i32 %3)
ret void
}
void gtk_window_set_destroy_with_parent() {}


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

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

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

LLVM IR (-O2):
define void @gtk_window_set_destroy_with_parent() {
ret void
}
/* Type definitions */
typedef int mode_t;

/* Variables and functions */
int S_IWOTH;
int is_others_write(mode_t mode) { return mode & S_IWOTH; }


x86 assembly (clang, -O0):
<is_others_write>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ec7(%rip),%rcx
and    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_others_write>:
mov    %edi,%eax
mov    0x2ecf(%rip),%rcx
and    (%rcx),%eax
ret

LLVM IR (-O0):
@S_IWOTH = global i32 0
define i32 @is_others_write(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @S_IWOTH
%5 = and i32 %3, %4
ret i32 %5
}

LLVM IR (-O2):
@S_IWOTH = global i32 0
define i32 @is_others_write(i32 %0) {
%2 = load i32, i32* @S_IWOTH
%3 = and i32 %2, %0
ret i32 %3
}
int test_imm_D8int16_reg(short val) {
  return ((val) & (-0xD8 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_D8int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffff28,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_D8int16_reg>:
test   $0xff28,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_D8int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, -216
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_D8int16_reg(i16 signext %0) {
%2 = and i16 %0, -216
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
int do_nothing(void) {
  while (1)
    sleep(10);
  return -1;
}


x86 assembly (clang, -O0):
<do_nothing>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <do_nothing+0x9>
mov    $0xa,%edi
call   1030 <sleep@plt>
jmp    1119 <do_nothing+0x9>

x86 assembly (clang, -O2):
<do_nothing>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <sleep@plt>
jmp    1120 <do_nothing+0x10>

LLVM IR (-O0):
define i32 @do_nothing() {
br label %1
1: ; preds = %0, %1
%2 = call i32 @sleep(i32 10)
br label %1
}

LLVM IR (-O2):
define i32 @do_nothing() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 @sleep(i32 10)
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ f2(int *);
void f1(int p1) { f2(&p1); }


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

x86 assembly (clang, -O2):
<f1>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <f2@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @f1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @f2(i32* %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                          int);
int lw_put_data(uint8_t *dst, const uint8_t *data, uint16_t len) {
  memcpy(dst, data, len);
  return len;
}


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

x86 assembly (clang, -O2):
<lw_put_data>:
push   %rbx
mov    %edx,%ebx
call   1030 <memcpy@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @lw_put_data(i32* %0, i32* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load i32*, i32** %5
%9 = load i32, i32* %6
%10 = call i32 @memcpy(i32* %7, i32* %8, i32 %9)
%11 = load i32, i32* %6
ret i32 %11
}

LLVM IR (-O2):
define i32 @lw_put_data(i32* %0, i32* %1, i32 returned %2) {
%4 = tail call i32 @memcpy(i32* %0, i32* %1, i32 %2)
ret i32 %2
}
char *_i18n_number_rewrite(char *w, char *rear_ptr) {
  char *src;
  _Bool use_alloca = (((rear_ptr - w) * sizeof(char)) < 4096U);
  if (use_alloca)
    src = (char *)__builtin_alloca((rear_ptr - w) * sizeof(char));
  else
    src = (char *)__builtin_malloc((rear_ptr - w) * sizeof(char));
  return src;
}


x86 assembly (clang, -O0):
<_i18n_number_rewrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
shl    $0x0,%rax
cmp    $0x1000,%rax
setb   %al
and    $0x1,%al
mov    %al,-0x19(%rbp)
testb  $0x1,-0x19(%rbp)
je     116c <_i18n_number_rewrite+0x5c>
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
sub    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rax
sub    %rcx,%rax
mov    %rax,%rsp
mov    %rax,-0x18(%rbp)
jmp    1184 <_i18n_number_rewrite+0x74>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rax
sub    %rax,%rdi
shl    $0x0,%rdi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_i18n_number_rewrite>:
sub    %rdi,%rsi
cmp    $0xfff,%rsi
ja     1136 <_i18n_number_rewrite+0x26>
push   %rbp
mov    %rsp,%rbp
mov    %rsp,%rax
add    $0xf,%rsi
and    $0xfffffffffffffff0,%rsi
sub    %rsi,%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret
mov    %rsi,%rdi
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @_i18n_number_rewrite(i8* %0, i8* %1) {
%3 = ptrtoint i8* %1 to i64
%4 = ptrtoint i8* %0 to i64
%5 = sub i64 %3, %4
%6 = icmp ult i64 %5, 4096
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = alloca i8, i64 %5
br label %11
9: ; preds = %2
%10 = tail call i8* @malloc(i64 %5)
br label %11
11: ; preds = %9, %7
%12 = phi i8* [ %8, %7 ], [ %10, %9 ]
ret i8* %12
}
/* Variables and functions */
int div0(int /*<<< orphan*/);
int entrypoint(void) { return div0(0); }


x86 assembly (clang, -O0):
<entrypoint>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <div0@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @entrypoint() {
%1 = call i32 @div0(i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @entrypoint() {
%1 = tail call i32 @div0(i32 0)
ret i32 %1
}
void XSetStandardColormap() {}


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

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

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

LLVM IR (-O2):
define void @XSetStandardColormap() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ esc(char *);
void decdwl(void) { esc("#6"); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"\00"
define void @decdwl() {
%1 = tail call i32 @esc(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct tipc_msg {
  int dummy;
};

/* Variables and functions */
char msg_bits(struct tipc_msg *, int, int, int);
char msg_net_plane(struct tipc_msg *m) { return msg_bits(m, 5, 1, 7) + 'A'; }


x86 assembly (clang, -O0):
<msg_net_plane>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x5,%esi
mov    $0x1,%edx
mov    $0x7,%ecx
call   1030 <msg_bits@plt>
movsbl %al,%eax
add    $0x41,%eax
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msg_net_plane>:
push   %rax
mov    $0x5,%esi
mov    $0x1,%edx
mov    $0x7,%ecx
call   1030 <msg_bits@plt>
add    $0x41,%al
pop    %rcx
ret

LLVM IR (-O0):
%struct.tipc_msg = type { i32 }
define signext i8 @msg_net_plane(%struct.tipc_msg* %0) {
%2 = alloca %struct.tipc_msg*
store %struct.tipc_msg* %0, %struct.tipc_msg** %2
%3 = load %struct.tipc_msg*, %struct.tipc_msg** %2
%4 = call signext i8 @msg_bits(%struct.tipc_msg* %3, i32 5, i32 1, i32 7)
%5 = sext i8 %4 to i32
%6 = add nsw i32 %5, 65
%7 = trunc i32 %6 to i8
ret i8 %7
}

LLVM IR (-O2):
%struct.tipc_msg = type { i32 }
define signext i8 @msg_net_plane(%struct.tipc_msg* %0) {
%2 = tail call signext i8 @msg_bits(%struct.tipc_msg* %0, i32 5, i32 1, i32 7)
%3 = add i8 %2, 65
ret i8 %3
}
/* Type definitions */
struct IridiumContext {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ IR_early_init_Object(struct IridiumContext *);
int /*<<< orphan*/ IR_init_Object(struct IridiumContext *);
void setup(struct IridiumContext *context) {
  IR_early_init_Object(context);
  IR_init_Object(context);
}


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

x86 assembly (clang, -O2):
<setup>:
push   %rbx
mov    %rdi,%rbx
call   1040 <IR_early_init_Object@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <IR_init_Object@plt>

LLVM IR (-O0):
%struct.IridiumContext = type { i32 }
define void @setup(%struct.IridiumContext* %0) {
%2 = alloca %struct.IridiumContext*
store %struct.IridiumContext* %0, %struct.IridiumContext** %2
%3 = load %struct.IridiumContext*, %struct.IridiumContext** %2
%4 = call i32 @IR_early_init_Object(%struct.IridiumContext* %3)
%5 = load %struct.IridiumContext*, %struct.IridiumContext** %2
%6 = call i32 @IR_init_Object(%struct.IridiumContext* %5)
ret void
}

LLVM IR (-O2):
%struct.IridiumContext = type { i32 }
define void @setup(%struct.IridiumContext* %0) {
%2 = tail call i32 @IR_early_init_Object(%struct.IridiumContext* %0)
%3 = tail call i32 @IR_init_Object(%struct.IridiumContext* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ msgbox(char *);
int tolower(int /*<<< orphan*/);
bool prompt(char *message) {
  int rval;
  while (true) {
    rval = tolower(msgbox(message));
    if (rval == 'y' || rval == '\n' || rval == ' ')
      return true;
    else if (rval == 'n')
      return false;
  }
}


x86 assembly (clang, -O0):
<prompt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <msgbox@plt>
mov    %eax,%edi
call   1030 <tolower@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x79,-0x14(%rbp)
je     115d <prompt+0x3d>
cmpl   $0xa,-0x14(%rbp)
je     115d <prompt+0x3d>
cmpl   $0x20,-0x14(%rbp)
jne    1169 <prompt+0x49>
movl   $0x1,-0x4(%rbp)
jmp    1189 <prompt+0x69>
cmpl   $0x6e,-0x14(%rbp)
jne    117f <prompt+0x5f>
movl   $0x0,-0x4(%rbp)
jmp    1189 <prompt+0x69>
jmp    1184 <prompt+0x64>
jmp    112c <prompt+0xc>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prompt>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   1040 <msgbox@plt>
mov    %eax,%edi
call   1030 <tolower@plt>
cmp    $0x6d,%eax
jg     1150 <prompt+0x30>
cmp    $0xa,%eax
je     115a <prompt+0x3a>
cmp    $0x20,%eax
jne    1130 <prompt+0x10>
jmp    115a <prompt+0x3a>
cmp    $0x6e,%eax
je     1161 <prompt+0x41>
cmp    $0x79,%eax
jne    1130 <prompt+0x10>
mov    $0x1,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @prompt(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @msgbox(i8* %0)
%4 = tail call i32 @tolower(i32 %3)
switch i32 %4, label %2 [
i32 121, label %5
i32 32, label %5
i32 10, label %5
i32 110, label %6
]
5: ; preds = %2, %2, %2
br label %6
6: ; preds = %2, %5
%7 = phi i32 [ 1, %5 ], [ 0, %2 ]
ret i32 %7
}