xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ do_test_1();
int /*<<< orphan*/ do_test_2();
int /*<<< orphan*/ do_test_3(double);
int main(void) {
  do_test_1();
  do_test_2();
  do_test_3(0.1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <do_test_1@plt>
mov    $0x0,%al
call   1030 <do_test_2@plt>
movsd  0xeab(%rip),%xmm0
call   1040 <do_test_3@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <do_test_1@plt>
xor    %eax,%eax
call   1030 <do_test_2@plt>
movsd  0xeb9(%rip),%xmm0
call   1040 <do_test_3@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @do_test_1()
%3 = call i32 (...) @do_test_2()
%4 = call i32 @do_test_3(double 1.000000e-01)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @do_test_1()
%2 = tail call i32 (...) @do_test_2()
%3 = tail call i32 @do_test_3(double 1.000000e-01)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void rfx_free(void *ptr) {
  if (!ptr)
    return;
  free(ptr);
}


x86 assembly (clang, -O0):
<rfx_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <rfx_free+0x1c>
jmp    1135 <rfx_free+0x25>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @rfx_free(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 %6, label %5
5: ; preds = %1
br label %9
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 @free(i8* %7)
br label %9
9: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
define void @rfx_free(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 = %1, %3
ret void
}
void genlink_subblock() {}


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

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

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

LLVM IR (-O2):
define void @genlink_subblock() {
ret void
}
/* Variables and functions */
int f313(int *);
int f314(int *p) { return f313(p); }


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

x86 assembly (clang, -O2):
<f314>:
jmp    1030 <f313@plt>

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

LLVM IR (-O2):
define i32 @f314(i32* %0) {
%2 = tail call i32 @f313(i32* %0)
ret i32 %2
}
void Msp430TimerCapComP__7__Timer__overflow(void) {}


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

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

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

LLVM IR (-O2):
define void @Msp430TimerCapComP__7__Timer__overflow() {
ret void
}
int deinitializeIpfixReceivers() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @deinitializeIpfixReceivers() {
ret i32 0
}
void XGetTextProperty() {}


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

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

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

LLVM IR (-O2):
define void @XGetTextProperty() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putCMD(int);
int /*<<< orphan*/ putPT(int);
int /*<<< orphan*/ putPT_flash();
int _dos_find_close(void) {
  putCMD(0x83);
  putPT(0xa);
  putPT_flash();
  return 0;
}


x86 assembly (clang, -O0):
<_dos_find_close>:
push   %rbp
mov    %rsp,%rbp
mov    $0x83,%edi
call   1040 <putCMD@plt>
mov    $0xa,%edi
call   1030 <putPT@plt>
mov    $0x0,%al
call   1050 <putPT_flash@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_dos_find_close>:
push   %rax
mov    $0x83,%edi
call   1040 <putCMD@plt>
mov    $0xa,%edi
call   1030 <putPT@plt>
xor    %eax,%eax
call   1050 <putPT_flash@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @_dos_find_close() {
%1 = call i32 @putCMD(i32 131)
%2 = call i32 @putPT(i32 10)
%3 = call i32 (...) @putPT_flash()
ret i32 0
}

LLVM IR (-O2):
define i32 @_dos_find_close() {
%1 = tail call i32 @putCMD(i32 131)
%2 = tail call i32 @putPT(i32 10)
%3 = tail call i32 (...) @putPT_flash()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int cookie1;
  int cookie2;
  if (cookie1 == 0x41424344) {
    if (cookie2 == 0x45464748) {
      if (cookie1 != 0x41424345) {
        printf("you win!\n");
      }
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x41424344,-0x8(%rbp)
jne    115c <main+0x4c>
cmpl   $0x45464748,-0xc(%rbp)
jne    1157 <main+0x47>
cmpl   $0x41424345,-0x8(%rbp)
je     1152 <main+0x42>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
jmp    1157 <main+0x47>
jmp    115c <main+0x4c>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ write(int /*<<< orphan*/, void **, int);
void __cyg_profile_func_exit(void *this_fn, void *call_site) {
  write(STDOUT_FILENO, &call_site, sizeof call_site);
}


x86 assembly (clang, -O0):
<__cyg_profile_func_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
mov    $0x8,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__cyg_profile_func_exit>:
push   %rax
mov    %rsi,(%rsp)
mov    0x2ed4(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
mov    $0x8,%edx
call   1030 <write@plt>
pop    %rax
ret

LLVM IR (-O0):
@STDOUT_FILENO = global i32 0
define void @__cyg_profile_func_exit(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @STDOUT_FILENO
%6 = call i32 @write(i32 %5, i8** %4, i32 8)
ret void
}

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
define void @__cyg_profile_func_exit(i8* nocapture readnone %0, i8* %1) {
%3 = alloca i8*
store i8* %1, i8** %3
%4 = load i32, i32* @STDOUT_FILENO
%5 = call i32 @write(i32 %4, i8** %3, i32 8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *malloc(scalar_t__);
int /*<<< orphan*/ strcpy(void *, char *);
scalar_t__ strlen(char *);
void from_string(void **data, char *s) {
  free(*data);
  *data = malloc(strlen(s) + 1);
  strcpy(*data, s);
}


x86 assembly (clang, -O0):
<from_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rdi
call   1050 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1060 <malloc@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<from_string>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
mov    %r14,%rdi
call   1050 <strlen@plt>
lea    0x1(%rax),%rdi
call   1060 <malloc@plt>
mov    %rax,(%rbx)
mov    %rax,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <strcpy@plt>

LLVM IR (-O0):
define void @from_string(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 = call i32 @free(i8* %6)
%8 = load i8*, i8** %4
%9 = call i64 @strlen(i8* %8)
%10 = add nsw i64 %9, 1
%11 = call i8* @malloc(i64 %10)
%12 = load i8**, i8*** %3
store i8* %11, i8** %12
%13 = load i8**, i8*** %3
%14 = load i8*, i8** %13
%15 = load i8*, i8** %4
%16 = call i32 @strcpy(i8* %14, i8* %15)
ret void
}

LLVM IR (-O2):
define void @from_string(i8** nocapture %0, i8* %1) {
%3 = load i8*, i8** %0
%4 = tail call i32 @free(i8* %3)
%5 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%6 = add nsw i64 %5, 1
%7 = tail call i8* @malloc(i64 %6)
store i8* %7, i8** %0
%8 = tail call i32 @strcpy(i8* %7, i8* %1)
ret void
}
unsigned char _hg_get_state(unsigned int status) {
  return ((status & 0x3C) >> 2) & 0xF;
}


x86 assembly (clang, -O0):
<_hg_get_state>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x3c,%eax
shr    $0x2,%eax
and    $0xf,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_hg_get_state>:
mov    %edi,%eax
shr    $0x2,%al
and    $0xf,%al
ret

LLVM IR (-O0):
define zeroext i8 @_hg_get_state(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 60
%5 = lshr i32 %4, 2
%6 = and i32 %5, 15
%7 = trunc i32 %6 to i8
ret i8 %7
}

LLVM IR (-O2):
define zeroext i8 @_hg_get_state(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = lshr i8 %2, 2
%4 = and i8 %3, 15
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void help() {
  puts("1. progname blend   x86|ssse3|sse4|sse4-2 filename-back.ppm "
       "filename-fore.ppm alpha\n"
       "2. progname measure x86|ssse3|sse4|sse4-2 iterations\n"
       "\n"
       "1. Program loads two PPM files and constant alpha, then perform "
       "blending and save back result (use to verify)\n"
       "2. Program runs selected procedure in a loop with given number "
       "iterations");
}


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

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

LLVM IR (-O0):
@.str = [322 x i8] c"1. progname blend x86|ssse3|sse4|sse4-2 filename-back.ppm filename-fore.ppm alpha\0A2. progname measure x86|ssse3|sse4|sse4-2 iterations\0A\0A1. Program loads two PPM files and constant alpha, then perform blending and save back result (use to verify)\0A2. Program runs selected procedure in a loop with given number iterations\00"
define void @help() {
%1 = call i32 @puts(i8* getelementptr inbounds ([322 x i8], [322 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [322 x i8] c"1. progname blend x86|ssse3|sse4|sse4-2 filename-back.ppm filename-fore.ppm alpha\0A2. progname measure x86|ssse3|sse4|sse4-2 iterations\0A\0A1. Program loads two PPM files and constant alpha, then perform blending and save back result (use to verify)\0A2. Program runs selected procedure in a loop with given number iterations\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([322 x i8], [322 x i8]* @.str, i64 0, i64 0))
ret void
}
void regex_subst(void) {
  const void *subst = "";
  (*(void (*)(int))subst)(0);
}


x86 assembly (clang, -O0):
<regex_subst>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xef1(%rip),%rax
mov    %rax,-0x8(%rbp)
xor    %edi,%edi
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<regex_subst>:
xor    %edi,%edi
jmp    2000 <_fini+0xef8>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @regex_subst() {
%1 = alloca i8*
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
%3 = bitcast i8* %2 to void (i32)*
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define void @regex_subst() {
tail call void bitcast ([1 x i8]* @.str to void (i32)*)(i32 0)
ret void
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int);
long timeval_diff(struct timeval *, struct timeval *, struct timeval *);
long TimerEnd(struct timeval *start_time, struct timeval *end_time,
              struct timeval *duration_time) {
  gettimeofday(end_time, 0x0);
  return timeval_diff(duration_time, end_time, start_time);
}


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

x86 assembly (clang, -O2):
<TimerEnd>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
mov    %rsi,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <timeval_diff@plt>

LLVM IR (-O0):
%struct.timeval = type { i32 }
define i64 @TimerEnd(%struct.timeval* %0, %struct.timeval* %1, %struct.timeval* %2) {
%4 = alloca %struct.timeval*
%5 = alloca %struct.timeval*
%6 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %4
store %struct.timeval* %1, %struct.timeval** %5
store %struct.timeval* %2, %struct.timeval** %6
%7 = load %struct.timeval*, %struct.timeval** %5
%8 = call i32 @gettimeofday(%struct.timeval* %7, i32 0)
%9 = load %struct.timeval*, %struct.timeval** %6
%10 = load %struct.timeval*, %struct.timeval** %5
%11 = load %struct.timeval*, %struct.timeval** %4
%12 = call i64 @timeval_diff(%struct.timeval* %9, %struct.timeval* %10, %struct.timeval* %11)
ret i64 %12
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define i64 @TimerEnd(%struct.timeval* %0, %struct.timeval* %1, %struct.timeval* %2) {
%4 = tail call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%5 = tail call i64 @timeval_diff(%struct.timeval* %2, %struct.timeval* %1, %struct.timeval* %0)
ret i64 %5
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
void clear_bit(int len, uint64_t *array, int element) {
  uint64_t one = 1;
  int array_index = element / 64;
  element -= (array_index * 64);
  array[array_index] &= ~(one << (63 - element));
}


x86 assembly (clang, -O0):
<clear_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x40,%ecx
cltd
idiv   %ecx
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%ecx
shl    $0x6,%ecx
mov    -0x14(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%edx
mov    $0x3f,%ecx
sub    -0x14(%rbp),%ecx
shl    %cl,%edx
xor    $0xffffffff,%edx
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
and    (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_bit>:
lea    0x3f(%rdx),%eax
test   %edx,%edx
cmovns %edx,%eax
sar    $0x6,%eax
mov    $0x3f,%cl
sub    %dl,%cl
mov    $0xfffffffe,%edx
rol    %cl,%edx
cltq
and    %edx,(%rsi,%rax,4)
ret

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

LLVM IR (-O2):
define void @clear_bit(i32 %0, i32* nocapture %1, i32 %2) {
%4 = sdiv i32 %2, 64
%5 = shl nsw i32 %4, 6
%6 = sub i32 63, %2
%7 = add i32 %6, %5
%8 = shl nuw i32 1, %7
%9 = xor i32 %8, -1
%10 = sext i32 %4 to i64
%11 = getelementptr inbounds i32, i32* %1, i64 %10
%12 = load i32, i32* %11
%13 = and i32 %12, %9
store i32 %13, i32* %11
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "berictl_test"
                  " -p path_to_socket"
                  " -f filename"
                  " -c controlfilename\n");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [63 x i8] c"berictl_test -p path_to_socket -f filename -c controlfilename\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [63 x i8] c"berictl_test -p path_to_socket -f filename -c controlfilename\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
cndfree(addr) char *addr;
{
  extern char end;
  if (addr >= &end)
    free(addr);
}


x86 assembly (clang, -O0):
<cndfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    0x2ebd(%rip),%rax
cmp    %rax,-0x10(%rbp)
jb     1136 <cndfree+0x26>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cndfree>:
push   %rax
cmp    0x2ec8(%rip),%rdi
jb     111f <cndfree+0xf>
call   1030 <free@plt>
pop    %rcx
ret

LLVM IR (-O0):
@end = external global i8
define i32 @cndfree(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp uge i8* %4, @end
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i8*, i8** %3
br label %8
8: ; preds = %6, %1
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
@end = external global i8
define i32 @cndfree(i8* %0) {
%2 = icmp ult i8* %0, @end
br i1 %2, label %4, label %3
3: ; preds = %1
tail call void @free(i8* %0)
br label %4
4: ; preds = %3, %1
ret i32 undef
}
/* Variables and functions */
double pow(double, int);
double penrose_side_length(double start_size, int depth) {
  return start_size / pow(1.6180339887, depth);
}


x86 assembly (clang, -O0):
<penrose_side_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0xc(%rbp),%edi
movsd  0xecb(%rip),%xmm0
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<penrose_side_length>:
push   %rax
movsd  %xmm0,(%rsp)
movsd  0xee2(%rip),%xmm0
call   1030 <pow@plt>
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @penrose_side_length(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
store double %0, double* %3
store i32 %1, i32* %4
%5 = load double, double* %3
%6 = load i32, i32* %4
%7 = call double @pow(double 0x3FF9E3779B9486E5, i32 %6)
%8 = fdiv double %5, %7
ret double %8
}

LLVM IR (-O2):
define double @penrose_side_length(double %0, i32 %1) {
%3 = tail call double @pow(double 0x3FF9E3779B9486E5, i32 %1)
%4 = fdiv double %0, %3
ret double %4
}
void VDP_waitFIFOEmpty() {
  while (!((*(volatile unsigned short *)(0xC00004)) & ((1 << 9))))
    ;
}


x86 assembly (clang, -O0):
<VDP_waitFIFOEmpty>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <VDP_waitFIFOEmpty+0x9>
mov    $0xc00004,%eax
mov    (%rax),%ax
movzwl %ax,%eax
and    $0x200,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    112e <VDP_waitFIFOEmpty+0x2e>
jmp    1133 <VDP_waitFIFOEmpty+0x33>
jmp    1109 <VDP_waitFIFOEmpty+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<VDP_waitFIFOEmpty>:
movzwl 0xc00004,%eax
test   $0x200,%eax
je     1100 <VDP_waitFIFOEmpty>
ret

LLVM IR (-O0):
define void @VDP_waitFIFOEmpty() {
br label %1
1: ; preds = %7, %0
%2 = load volatile i16, i16* inttoptr (i64 12582916 to i16*)
%3 = zext i16 %2 to i32
%4 = and i32 %3, 512
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
br i1 %6, label %7, label %8
7: ; preds = %1
br label %1
8: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @VDP_waitFIFOEmpty() {
br label %1
1: ; preds = %1, %0
%2 = load volatile i16, i16* inttoptr (i64 12582916 to i16*)
%3 = and i16 %2, 512
%4 = icmp eq i16 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
ret void
}
int __xap_ap_ro_init(int fd, unsigned long *aperrno_p) {}


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

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

LLVM IR (-O0):
define i32 @__xap_ap_ro_init(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64*
store i32 %0, i32* %4
store i64* %1, i64** %5
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @__xap_ap_ro_init(i32 %0, i64* nocapture readnone %1) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ outb(int, int);
void eoi() { outb(0x20, 0x20); }


x86 assembly (clang, -O0):
<eoi>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20,%esi
mov    %esi,%edi
call   1030 <outb@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<eoi>:
mov    $0x20,%edi
mov    $0x20,%esi
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @eoi() {
%1 = call i32 @outb(i32 32, i32 32)
ret void
}

LLVM IR (-O2):
define void @eoi() {
%1 = tail call i32 @outb(i32 32, i32 32)
ret void
}
int f2(int x, int y) { return (x & ~0x0ff000) | ((y & 0x0ff) << 12); }


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xfff00fff,%eax
mov    -0x8(%rbp),%ecx
and    $0xff,%ecx
shl    $0xc,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
and    $0xfff00fff,%edi
movzbl %sil,%eax
shl    $0xc,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @f2(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 = and i32 %5, -1044481
%7 = load i32, i32* %4
%8 = and i32 %7, 255
%9 = shl i32 %8, 12
%10 = or i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @f2(i32 %0, i32 %1) {
%3 = and i32 %0, -1044481
%4 = shl i32 %1, 12
%5 = and i32 %4, 1044480
%6 = or i32 %5, %3
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ isspace(char);
uint8_t opdi_is_space(char c) { return isspace(c); }


x86 assembly (clang, -O0):
<opdi_is_space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isspace@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opdi_is_space>:
jmp    1030 <isspace@plt>

LLVM IR (-O0):
define i32 @opdi_is_space(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @isspace(i8 signext %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @opdi_is_space(i8 signext %0) {
%2 = tail call i32 @isspace(i8 signext %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void outputusage(void) {
  printf("You can input command:\n"
         "Command type:\"send\", \"tell\", \"getu\", \"exit\"\n"
         "Example: send username message\n"
         "         tell username ip:port message\n"
         "         getu\n"
         "         exit\n");
}


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

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

LLVM IR (-O0):
@.str = [166 x i8] c"You can input command:\0ACommand type:\22send\22, \22tell\22, \22getu\22, \22exit\22\0AExample: send username message\0A tell username ip:port message\0A getu\0A exit\0A\00"
define void @outputusage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([166 x i8], [166 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [165 x i8] c"You can input command:\0ACommand type:\22send\22, \22tell\22, \22getu\22, \22exit\22\0AExample: send username message\0A tell username ip:port message\0A getu\0A exit\00"
define void @outputusage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([165 x i8], [165 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ puts(char *);
int main(int argc, char *argv[]) {
  if (argc != 2) {
    puts("Wrong number of arguments!");
    return -1;
  }
  printf("%s\n", argv[1]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     1158 <main+0x38>
lea    0xeb9(%rip),%rdi
call   1030 <puts@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1173 <main+0x53>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xeb4(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    113a <main+0x1a>
mov    0x8(%rsi),%rsi
lea    0xeea(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xebf(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Wrong number of arguments!\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 2
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @puts(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %15
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %13)
store i32 0, i32* %3
br label %15
15: ; preds = %10, %8
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@.str = [27 x i8] c"Wrong number of arguments!\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %10
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %8)
br label %10
10: ; preds = %6, %4
%11 = phi i32 [ -1, %4 ], [ 0, %6 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ zzzzzzz();
void yyy(void) { zzzzzzz(); }


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

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

LLVM IR (-O0):
define void @yyy() {
%1 = call i32 (...) @zzzzzzz()
ret void
}

LLVM IR (-O2):
define void @yyy() {
%1 = tail call i32 (...) @zzzzzzz()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int ano, idade;
  printf("Insira seu ano de nascimento: ");
  scanf("%d", &ano);
  printf("Sua idade eh: %d", 2017 - ano);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef0(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    $0x7e1,%esi
sub    -0x4(%rbp),%esi
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xef7(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    $0x7e1,%esi
sub    0x4(%rsp),%esi
lea    0xecf(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"Insira seu ano de nascimento: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [17 x i8] c"Sua idade eh: %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = sub nsw i32 2017, %5
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [31 x i8] c"Insira seu ano de nascimento: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [17 x i8] c"Sua idade eh: %d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = sub nsw i32 2017, %5
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}
int test_imm_79uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x79 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_79uint64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0x79,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_79uint64_lowword_reg>:
test   $0x79,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_79uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 121
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ dump(unsigned char *, int);
int /*<<< orphan*/ printf(char *, double);
void test_double(double d) {
  long *dp = (long *)(&d);
  dump((unsigned char *)dp, 8);
  printf(" %lf\n", d);
}


x86 assembly (clang, -O0):
<test_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x8,%esi
call   1040 <dump@plt>
movsd  -0x8(%rbp),%xmm0
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_double>:
push   %rax
movsd  %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x8,%esi
call   1040 <dump@plt>
movsd  (%rsp),%xmm0
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c" %lf\0A\00"
define void @test_double(double %0) {
%2 = alloca double
%3 = alloca i64*
store double %0, double* %2
%4 = bitcast double* %2 to i64*
store i64* %4, i64** %3
%5 = load i64*, i64** %3
%6 = bitcast i64* %5 to i8*
%7 = call i32 @dump(i8* %6, i32 8)
%8 = load double, double* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %8)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c" %lf\0A\00"
define void @test_double(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = bitcast double* %2 to i8*
%4 = call i32 @dump(i8* %3, i32 8)
%5 = load double, double* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %5)
ret void
}
int __mp_view(char *f, unsigned long l) { return 0; }


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

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

LLVM IR (-O0):
define i32 @__mp_view(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @__mp_view(i8* nocapture readnone %0, i64 %1) {
ret i32 0
}
void doexit(sig) int sig;
{ exit(0); }


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

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

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

LLVM IR (-O2):
define void @doexit(i32 %0) {
tail call void @exit(i32 0)
unreachable
}
/* Type definitions */
struct hostent {
  int dummy;
};
typedef enum nss_status { ____Placeholder_nss_status } nss_status;

/* Variables and functions */
int NSS_STATUS_UNAVAIL;
enum nss_status _nss_hostslocal_gethostbyname_r(const char *name,
                                                struct hostent *result,
                                                char *buffer, size_t buflen,
                                                int *errnop, int *h_errnop) {
  enum nss_status status = NSS_STATUS_UNAVAIL;
  return status;
}


x86 assembly (clang, -O0):
<_nss_hostslocal_gethostbyname_r>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_nss_hostslocal_gethostbyname_r>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
%struct.hostent = type { i32 }
@NSS_STATUS_UNAVAIL = global i32 0
define i32 @_nss_hostslocal_gethostbyname_r(i8* %0, %struct.hostent* %1, i8* %2, i64 %3, i32* %4, i32* %5) {
%7 = alloca i8*
%8 = alloca %struct.hostent*
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i32*
%12 = alloca i32*
%13 = alloca i32
store i8* %0, i8** %7
store %struct.hostent* %1, %struct.hostent** %8
store i8* %2, i8** %9
store i64 %3, i64* %10
store i32* %4, i32** %11
store i32* %5, i32** %12
%14 = load i32, i32* @NSS_STATUS_UNAVAIL
store i32 %14, i32* %13
%15 = load i32, i32* %13
ret i32 %15
}

LLVM IR (-O2):
%struct.hostent = type { i32 }
@NSS_STATUS_UNAVAIL = global i32 0
define i32 @_nss_hostslocal_gethostbyname_r(i8* nocapture readnone %0, %struct.hostent* nocapture readnone %1, i8* nocapture readnone %2, i64 %3, i32* nocapture readnone %4, i32* nocapture readnone %5) {
%7 = load i32, i32* @NSS_STATUS_UNAVAIL
ret i32 %7
}
void setgrent() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_p384_add(uintptr_t, uintptr_t, uintptr_t);
void fiat_p384_add(uint32_t out1[12], const uint32_t arg1[12],
                   const uint32_t arg2[12]) {
  internal_fiat_p384_add((uintptr_t)out1, (uintptr_t)arg1, (uintptr_t)arg2);
}


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

x86 assembly (clang, -O2):
<fiat_p384_add>:
jmp    1030 <internal_fiat_p384_add@plt>

LLVM IR (-O0):
define void @fiat_p384_add(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 = ptrtoint i32* %7 to i64
%9 = load i32*, i32** %5
%10 = ptrtoint i32* %9 to i64
%11 = load i32*, i32** %6
%12 = ptrtoint i32* %11 to i64
%13 = call i32 @internal_fiat_p384_add(i64 %8, i64 %10, i64 %12)
ret void
}

LLVM IR (-O2):
define void @fiat_p384_add(i32* %0, i32* %1, i32* %2) {
%4 = ptrtoint i32* %0 to i64
%5 = ptrtoint i32* %1 to i64
%6 = ptrtoint i32* %2 to i64
%7 = tail call i32 @internal_fiat_p384_add(i64 %4, i64 %5, i64 %6)
ret void
}
/* Variables and functions */
int count;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void HandleUSR2(int sig) {
  static count = 0;
  if (++count == 2)
    exit(0);
}


x86 assembly (clang, -O0):
<HandleUSR2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2f0b(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f02(%rip)
cmp    $0x2,%eax
jne    113a <HandleUSR2+0x2a>
xor    %edi,%edi
call   1030 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HandleUSR2>:
push   %rax
mov    0x2f15(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f0c(%rip)
cmp    $0x2,%eax
je     1127 <HandleUSR2+0x17>
pop    %rax
ret
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@HandleUSR2.count = internal global i32 0
@count = global i32 0
define void @HandleUSR2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @HandleUSR2.count
%4 = add nsw i32 %3, 1
store i32 %4, i32* @HandleUSR2.count
%5 = icmp eq i32 %4, 2
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @exit(i32 0)
unreachable
8: ; preds = %1
ret void
}

LLVM IR (-O2):
@HandleUSR2.count = internal unnamed_addr global i32 0
@count = global i32 0
define void @HandleUSR2(i32 %0) {
%2 = load i32, i32* @HandleUSR2.count
%3 = add nsw i32 %2, 1
store i32 %3, i32* @HandleUSR2.count
%4 = icmp eq i32 %3, 2
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %1
ret void
}
/* Variables and functions */
int newDbGetLastupdateDevicesDev(int, int);
int newDbGetLastupdateClimate(void) {
  return newDbGetLastupdateDevicesDev(1, 5);
}


x86 assembly (clang, -O0):
<newDbGetLastupdateClimate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
mov    $0x5,%esi
call   1030 <newDbGetLastupdateDevicesDev@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<newDbGetLastupdateClimate>:
mov    $0x1,%edi
mov    $0x5,%esi
jmp    1030 <newDbGetLastupdateDevicesDev@plt>

LLVM IR (-O0):
define i32 @newDbGetLastupdateClimate() {
%1 = call i32 @newDbGetLastupdateDevicesDev(i32 1, i32 5)
ret i32 %1
}

LLVM IR (-O2):
define i32 @newDbGetLastupdateClimate() {
%1 = tail call i32 @newDbGetLastupdateDevicesDev(i32 1, i32 5)
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ _DIAGASSERT(int /*<<< orphan*/);
int __sgetc(int /*<<< orphan*/ *);
int getc_unlocked(FILE *fp) {
  _DIAGASSERT(fp != NULL);
  return __sgetc(fp);
}


x86 assembly (clang, -O0):
<getc_unlocked>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <_DIAGASSERT@plt>
mov    -0x8(%rbp),%rdi
call   1040 <__sgetc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getc_unlocked>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <_DIAGASSERT@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <__sgetc@plt>

LLVM IR (-O0):
define i32 @getc_unlocked(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = icmp ne i32* %3, null
%5 = zext i1 %4 to i32
%6 = call i32 @_DIAGASSERT(i32 %5)
%7 = load i32*, i32** %2
%8 = call i32 @__sgetc(i32* %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @getc_unlocked(i32* %0) {
%2 = icmp ne i32* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @_DIAGASSERT(i32 %3)
%5 = tail call i32 @__sgetc(i32* %0)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRCORE_SIZE16_swap(char *, int);
void U_WMRSAVEDC_swap(char *record, int torev) {
  U_WMRCORE_SIZE16_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMRSAVEDC_swap>:
jmp    1030 <U_WMRCORE_SIZE16_swap@plt>

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

LLVM IR (-O2):
define void @U_WMRSAVEDC_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRCORE_SIZE16_swap(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
scalar_t__ coin();
int *lookUpInt(int unused) {
  if (coin())
    return 0;
  static int x;
  return &x;
}


x86 assembly (clang, -O0):
<lookUpInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <coin@plt>
cmp    $0x0,%rax
je     1139 <lookUpInt+0x29>
movq   $0x0,-0x8(%rbp)
jmp    1144 <lookUpInt+0x34>
lea    0x2eec(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lookUpInt>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <coin@plt>
test   %rax,%rax
lea    0x2f08(%rip),%rax
cmove  %rax,%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@lookUpInt.x = internal global i32 0
define i32* @lookUpInt(i32 %0) {
%2 = alloca i32*
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i64 (...) @coin()
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i32* null, i32** %2
br label %8
7: ; preds = %1
store i32* @lookUpInt.x, i32** %2
br label %8
8: ; preds = %7, %6
%9 = load i32*, i32** %2
ret i32* %9
}

LLVM IR (-O2):
@lookUpInt.x = internal global i32 0
define i32* @lookUpInt(i32 %0) {
%2 = tail call i64 (...) @coin()
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32* @lookUpInt.x, i32* null
ret i32* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ SYS_kill;
int syscall_1(int /*<<< orphan*/, int /*<<< orphan*/);
int kill(pid_t pid) { return syscall_1(SYS_kill, pid); }


x86 assembly (clang, -O0):
<kill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ed6(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
call   1030 <syscall_1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kill>:
mov    %edi,%esi
mov    0x2edf(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall_1@plt>

LLVM IR (-O0):
@SYS_kill = global i32 0
define i32 @kill(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @SYS_kill
%4 = load i32, i32* %2
%5 = call i32 @syscall_1(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@SYS_kill = global i32 0
define i32 @kill(i32 %0) {
%2 = load i32, i32* @SYS_kill
%3 = tail call i32 @syscall_1(i32 %2, i32 %0)
ret i32 %3
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void dump(uint8_t *D, int len) {
  int i;
  for (i = 0; i < len; i++)
    printf("%02x ", D[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<dump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <dump+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <dump+0x16>
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <dump+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <dump+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"%02x \00"
define void @dump(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}