xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void phoenix_mem_free(void *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<phoenix_mem_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @phoenix_mem_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int isatty(int file) {}


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

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

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

LLVM IR (-O2):
define i32 @isatty(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ shell_output(char *, char *);
scalar_t__ strlen(char *);
void unknown(char *str) {
  if (strlen(str) > 0) {
    shell_output("Unknown command: ", str);
  }
}


x86 assembly (clang, -O0):
<unknown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%rax
jle    114f <unknown+0x2f>
mov    -0x8(%rbp),%rsi
lea    0xeb6(%rip),%rdi
call   1040 <shell_output@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unknown>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %rax,%rax
jle    113e <unknown+0x1e>
lea    0xecb(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <shell_output@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Unknown command: \00"
define void @unknown(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strlen(i8* %3)
%5 = icmp sgt i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 @shell_output(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %7)
br label %9
9: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"Unknown command: \00"
define void @unknown(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = icmp sgt i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @shell_output(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %6
6: ; preds = %4, %1
ret void
}
double cc_gain(double cc) {
  double f = cc / 127.0;
  return (1 + f) / (2 - f);
}


x86 assembly (clang, -O0):
<cc_gain>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xefa(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xee1(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  0xecc(%rip),%xmm1
subsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<cc_gain>:
divsd  0xef8(%rip),%xmm0
movsd  0xef8(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  0xef4(%rip),%xmm2
subsd  %xmm0,%xmm2
divsd  %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @cc_gain(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fdiv double %4, 1.270000e+02
store double %5, double* %3
%6 = load double, double* %3
%7 = fadd double 1.000000e+00, %6
%8 = load double, double* %3
%9 = fsub double 2.000000e+00, %8
%10 = fdiv double %7, %9
ret double %10
}

LLVM IR (-O2):
define double @cc_gain(double %0) {
%2 = fdiv double %0, 1.270000e+02
%3 = fadd double %2, 1.000000e+00
%4 = fsub double 2.000000e+00, %2
%5 = fdiv double %3, %4
ret double %5
}
void g_source_add_poll() {}


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

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

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

LLVM IR (-O2):
define void @g_source_add_poll() {
ret void
}
int test_01(volatile short *x) { return *x; }


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

x86 assembly (clang, -O2):
<test_01>:
movswl (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @test_01(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load volatile i16, i16* %3
%5 = sext i16 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @test_01(i16* %0) {
%2 = load volatile i16, i16* %0
%3 = sext i16 %2 to i32
ret i32 %3
}
int gcd(int m, int n) {
  int r;
  for (;;) {
    r = m % n;
    if (r == 0)
      return (n);
    m = n;
    n = r;
  }
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1123 <gcd+0x23>
mov    -0x8(%rbp),%eax
pop    %rbp
ret
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    110a <gcd+0xa>

x86 assembly (clang, -O2):
<gcd>:
mov    %esi,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %edi,%eax
mov    %edx,%edi
cltd
idiv   %edi
test   %edx,%edx
jne    1110 <gcd+0x10>
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ %1, %2 ], [ %6, %3 ]
%5 = phi i32 [ %0, %2 ], [ %4, %3 ]
%6 = srem i32 %5, %4
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3
ret i32 %4
}
int psp_sound_reset(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @psp_sound_reset() {
ret i32 0
}
void uniphier_cache_l2_touch_range(unsigned long start, unsigned long end) {}


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

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

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

LLVM IR (-O2):
define void @uniphier_cache_l2_touch_range(i64 %0, i64 %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
int printtable(char **table, int size, FILE *out) {
  while (size--)
    fprintf(out, "%s", table[size]);
  return 0;
}


x86 assembly (clang, -O0):
<printtable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
je     1158 <printtable+0x48>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xeb2(%rip),%rsi
call   1030 <fprintf@plt>
jmp    1123 <printtable+0x13>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printtable>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
je     1155 <printtable+0x45>
mov    %rdx,%r14
mov    %esi,%r12d
movslq %esi,%rax
lea    (%rdi,%rax,8),%r15
add    $0xfffffffffffffff8,%r15
neg    %r12d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r15,%rbx,8),%rdi
mov    %r14,%rsi
call   1030 <fputs@plt>
add    $0xffffffffffffffff,%rbx
cmp    %ebx,%r12d
jne    1140 <printtable+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @printtable(i8** nocapture %0, i32 %1, i32* nocapture %2) {
%4 = icmp eq i32 %1, 0
br i1 %4, label %15, label %5
5: ; preds = %3
%6 = sext i32 %1 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ %6, %5 ], [ %9, %7 ]
%9 = add nsw i64 %8, -1
%10 = getelementptr inbounds i8*, i8** %0, i64 %9
%11 = load i8*, i8** %10
%12 = tail call i32 @fputs(i8* %11, i32* %2)
%13 = trunc i64 %9 to i32
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %7
15: ; preds = %7, %3
ret i32 0
}
/* Variables and functions */
int my_rand();
int extract_rand_len(void) {
  int retval;
  retval = my_rand() % 12 + my_rand() % 12;
  if (retval > 12)
    retval = 12 * 2 - 1 - retval;
  return retval;
}


x86 assembly (clang, -O0):
<extract_rand_len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <my_rand@plt>
mov    $0xc,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    $0x0,%al
call   1030 <my_rand@plt>
mov    $0xc,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    -0x8(%rbp),%edx
add    %eax,%edx
mov    %edx,-0x4(%rbp)
cmpl   $0xc,-0x4(%rbp)
jle    1158 <extract_rand_len+0x48>
mov    $0x17,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<extract_rand_len>:
push   %rbx
xor    %eax,%eax
call   1030 <my_rand@plt>
movslq %eax,%rbx
imul   $0x2aaaaaab,%rbx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x21,%rax
add    %ecx,%eax
shl    $0x2,%eax
lea    (%rax,%rax,2),%eax
sub    %eax,%ebx
xor    %eax,%eax
call   1030 <my_rand@plt>
movslq %eax,%rcx
imul   $0x2aaaaaab,%rcx,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
shr    $0x21,%rax
add    %edx,%eax
shl    $0x2,%eax
lea    (%rax,%rax,2),%eax
sub    %eax,%ecx
add    %ebx,%ecx
mov    $0x17,%eax
sub    %ecx,%eax
cmp    $0xd,%ecx
cmovl  %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @extract_rand_len() {
%1 = tail call i32 (...) @my_rand()
%2 = srem i32 %1, 12
%3 = tail call i32 (...) @my_rand()
%4 = srem i32 %3, 12
%5 = add nsw i32 %4, %2
%6 = icmp sgt i32 %5, 12
%7 = sub nsw i32 23, %5
%8 = select i1 %6, i32 %7, i32 %5
ret i32 %8
}
void element2assertions() {}


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

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

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

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

/* Variables and functions */
uint64_t my_c_func(void) { return 42; }


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

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

LLVM IR (-O0):
define i32 @my_c_func() {
ret i32 42
}

LLVM IR (-O2):
define i32 @my_c_func() {
ret i32 42
}
/* Variables and functions */
int /*<<< orphan*/ codegen_test();
int /*<<< orphan*/ lex_test();
int /*<<< orphan*/ parse_test();
int /*<<< orphan*/ pike_test();
int main(int argc, char *argv[]) {
  (void)argc;
  (void)argv;
  lex_test();
  parse_test();
  codegen_test();
  pike_test();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <lex_test@plt>
xor    %eax,%eax
call   1040 <parse_test@plt>
xor    %eax,%eax
call   1050 <codegen_test@plt>
xor    %eax,%eax
call   1060 <pike_test@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @lex_test()
%4 = tail call i32 (...) @parse_test()
%5 = tail call i32 (...) @codegen_test()
%6 = tail call i32 (...) @pike_test()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, char *, int);
void demux_name(int demux, char *demux_name, int len, char *adapter_name) {
  snprintf(demux_name, len, "%s/demux%d", adapter_name, demux);
}


x86 assembly (clang, -O0):
<demux_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rcx
mov    -0x4(%rbp),%r8d
lea    0xec4(%rip),%rdx
call   1030 <snprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<demux_name>:
mov    %edi,%r8d
lea    0xee6(%rip),%rax
mov    %rsi,%rdi
mov    %edx,%esi
mov    %rax,%rdx
jmp    1030 <snprintf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"%s/demux%d\00"
define void @demux_name(i32 %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i8*, i8** %6
%10 = load i32, i32* %7
%11 = load i8*, i8** %8
%12 = load i32, i32* %5
%13 = call i32 @snprintf(i8* %9, i32 %10, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %11, i32 %12)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"%s/demux%d\00"
define void @demux_name(i32 %0, i8* %1, i32 %2, i8* %3) {
%5 = tail call i32 @snprintf(i8* %1, i32 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %3, i32 %0)
ret void
}
/* Type definitions */
struct drand48_data {
  int /*<<< orphan*/ __x;
};

/* Variables and functions */
int __jrand48_r(int /*<<< orphan*/, struct drand48_data *, long *);
int mrand48_r(struct drand48_data *buffer, long int *result) {
  if (buffer == NULL)
    return -1;
  return __jrand48_r(buffer->__x, buffer, result);
}


x86 assembly (clang, -O0):
<mrand48_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1137 <mrand48_r+0x27>
movl   $0xffffffff,-0x4(%rbp)
jmp    114d <mrand48_r+0x3d>
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <__jrand48_r@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mrand48_r>:
test   %rdi,%rdi
je     1122 <mrand48_r+0x12>
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    (%rdi),%edi
jmp    1030 <__jrand48_r@plt>
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.drand48_data = type { i32 }
define i32 @mrand48_r(%struct.drand48_data* %0, i64* %1) {
%3 = alloca i32
%4 = alloca %struct.drand48_data*
%5 = alloca i64*
store %struct.drand48_data* %0, %struct.drand48_data** %4
store i64* %1, i64** %5
%6 = load %struct.drand48_data*, %struct.drand48_data** %4
%7 = icmp eq %struct.drand48_data* %6, null
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 -1, i32* %3
br label %16
9: ; preds = %2
%10 = load %struct.drand48_data*, %struct.drand48_data** %4
%11 = getelementptr inbounds %struct.drand48_data, %struct.drand48_data* %10, i32 0, i32 0
%12 = load i32, i32* %11
%13 = load %struct.drand48_data*, %struct.drand48_data** %4
%14 = load i64*, i64** %5
%15 = call i32 @__jrand48_r(i32 %12, %struct.drand48_data* %13, i64* %14)
store i32 %15, i32* %3
br label %16
16: ; preds = %9, %8
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
%struct.drand48_data = type { i32 }
define i32 @mrand48_r(%struct.drand48_data* %0, i64* %1) {
%3 = icmp eq %struct.drand48_data* %0, null
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = getelementptr inbounds %struct.drand48_data, %struct.drand48_data* %0, i64 0, i32 0
%6 = load i32, i32* %5
%7 = tail call i32 @__jrand48_r(i32 %6, %struct.drand48_data* %0, i64* %1)
br label %8
8: ; preds = %2, %4
%9 = phi i32 [ %7, %4 ], [ -1, %2 ]
ret i32 %9
}
int hwconfig_wishbone_divisor(void) { return 2; }


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

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

LLVM IR (-O0):
define i32 @hwconfig_wishbone_divisor() {
ret i32 2
}

LLVM IR (-O2):
define i32 @hwconfig_wishbone_divisor() {
ret i32 2
}
/* Variables and functions */
int /*<<< orphan*/ ssl3_connect(int);
int main(void) {
  int s;
  {
    {
      s = 12292;
      ssl3_connect(12292);
    }
    return (0);
  }
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 12292, i32* %2
%3 = call i32 @ssl3_connect(i32 12292)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @ssl3_connect(i32 12292)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ reset_ep_datatog(int);
void reset_hub_datatog(void) { reset_ep_datatog(1); }


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

x86 assembly (clang, -O2):
<reset_hub_datatog>:
mov    $0x1,%edi
jmp    1030 <reset_ep_datatog@plt>

LLVM IR (-O0):
define void @reset_hub_datatog() {
%1 = call i32 @reset_ep_datatog(i32 1)
ret void
}

LLVM IR (-O2):
define void @reset_hub_datatog() {
%1 = tail call i32 @reset_ep_datatog(i32 1)
ret void
}
OP(dd, bb) {
  illegal_1();
  op_bb();
}


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <illegal_1@plt>
mov    $0x0,%al
call   1040 <op_bb@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @OP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (...) @illegal_1()
%7 = call i32 (...) @op_bb()
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_bb()
ret i32 undef
}
int main(int argc, char *argv[]) {
  int f1, f2;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int fchownat(int, char const *, int /*<<< orphan*/, int /*<<< orphan*/, int);
__attribute__((__weak__, __always___)) int
softboundcets_fchownat(int dirfd, const char *pathname, uid_t owner,
                       gid_t group, int flags) {
  return fchownat(dirfd, pathname, owner, group, flags);
}


x86 assembly (clang, -O0):
<softboundcets_fchownat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
call   1030 <fchownat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<softboundcets_fchownat>:
jmp    1030 <fchownat@plt>

LLVM IR (-O0):
define weak i32 @softboundcets_fchownat(i32 %0, i8* %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32, i32* %6
%12 = load i8*, i8** %7
%13 = load i32, i32* %8
%14 = load i32, i32* %9
%15 = load i32, i32* %10
%16 = call i32 @fchownat(i32 %11, i8* %12, i32 %13, i32 %14, i32 %15)
ret i32 %16
}

LLVM IR (-O2):
define weak i32 @softboundcets_fchownat(i32 %0, i8* %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @fchownat(i32 %0, i8* %1, i32 %2, i32 %3, i32 %4)
ret i32 %6
}
extern int findchar(str, chr)
char *str;
char chr;
{
  int i;
  for (i = 0;; i++) {
    if (str[i] == chr) {
      return (i);
    }
    if (str[i] == '\0') {
      return (-1);
    }
  }
}


x86 assembly (clang, -O0):
<findchar>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    1138 <findchar+0x38>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116c <findchar+0x6c>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    1159 <findchar+0x59>
movl   $0xffffffff,-0x4(%rbp)
jmp    116c <findchar+0x6c>
jmp    115e <findchar+0x5e>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1115 <findchar+0x15>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<findchar>:
movsbl %sil,%ecx
movsbl (%rdi),%edx
xor    %eax,%eax
cmp    %edx,%ecx
je     1121 <findchar+0x21>
xor    %eax,%eax
nop
test   %dl,%dl
je     1122 <findchar+0x22>
movsbl 0x1(%rdi,%rax,1),%edx
add    $0x1,%rax
cmp    %edx,%ecx
jne    1110 <findchar+0x10>
ret
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @findchar(i8* nocapture %0, i32 %1) {
%3 = shl i32 %1, 24
%4 = ashr exact i32 %3, 24
%5 = load i8, i8* %0
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %4, %6
br i1 %7, label %20, label %8
8: ; preds = %2, %12
%9 = phi i64 [ %13, %12 ], [ 0, %2 ]
%10 = phi i8 [ %15, %12 ], [ %5, %2 ]
%11 = icmp eq i8 %10, 0
br i1 %11, label %20, label %12
12: ; preds = %8
%13 = add nuw i64 %9, 1
%14 = getelementptr inbounds i8, i8* %0, i64 %13
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %4, %16
br i1 %17, label %18, label %8
18: ; preds = %12
%19 = trunc i64 %13 to i32
br label %20
20: ; preds = %8, %18, %2
%21 = phi i32 [ 0, %2 ], [ %19, %18 ], [ -1, %8 ]
ret i32 %21
}
int fun180() { return 180; }


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

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

LLVM IR (-O0):
define i32 @fun180() {
ret i32 180
}

LLVM IR (-O2):
define i32 @fun180() {
ret i32 180
}
/* Variables and functions */
float __infer_nondet_float();
float tanhf(float x) { return __infer_nondet_float(); }


x86 assembly (clang, -O0):
<tanhf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__infer_nondet_float@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define float @tanhf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = call float (...) @__infer_nondet_float()
ret float %3
}

LLVM IR (-O2):
define float @tanhf(float %0) {
%2 = tail call float (...) @__infer_nondet_float()
ret float %2
}
/* Variables and functions */
unsigned long long _blsmsk_u64(unsigned long long);
unsigned long long func_blsmsk64_2(unsigned long long X) {
  return _blsmsk_u64(X);
}


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

x86 assembly (clang, -O2):
<func_blsmsk64_2>:
jmp    1030 <_blsmsk_u64@plt>

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

LLVM IR (-O2):
define i64 @func_blsmsk64_2(i64 %0) {
%2 = tail call i64 @_blsmsk_u64(i64 %0)
ret i64 %2
}
char *strtokRestore(char *pCurrent, char *pRestore, char cEraser) {
  char *p = pRestore;
  while (1) {
    if (!(*p)) {
      *p = cEraser;
      if (p > pCurrent) {
        break;
      }
    }
    p++;
  }
  return pRestore;
}


x86 assembly (clang, -O0):
<strtokRestore>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1147 <strtokRestore+0x47>
mov    -0x11(%rbp),%cl
mov    -0x20(%rbp),%rax
mov    %cl,(%rax)
mov    -0x20(%rbp),%rax
cmp    -0x8(%rbp),%rax
jbe    1142 <strtokRestore+0x42>
jmp    1158 <strtokRestore+0x58>
jmp    1147 <strtokRestore+0x47>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1119 <strtokRestore+0x19>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtokRestore>:
mov    %rsi,%rax
mov    %rsi,%rcx
jmp    1114 <strtokRestore+0x14>
nopl   0x0(%rax,%rax,1)
add    $0x1,%rcx
cmpb   $0x0,(%rcx)
jne    1110 <strtokRestore+0x10>
mov    %dl,(%rcx)
cmp    %rdi,%rcx
jbe    1110 <strtokRestore+0x10>
ret

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

LLVM IR (-O2):
define i8* @strtokRestore(i8* readnone %0, i8* returned %1, i8 signext %2) {
br label %4
4: ; preds = %10, %3
%5 = phi i8* [ %1, %3 ], [ %11, %10 ]
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %4
store i8 %2, i8* %5
%9 = icmp ugt i8* %5, %0
br i1 %9, label %12, label %10
10: ; preds = %8, %4
%11 = getelementptr inbounds i8, i8* %5, i64 1
br label %4
12: ; preds = %8
ret i8* %1
}
/* Type definitions */
struct List {
  int dummy;
};

/* Variables and functions */
int list_deleteLatestElement(struct List *);
int lifo_top(struct List *list) { return list_deleteLatestElement(list); }


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

x86 assembly (clang, -O2):
<lifo_top>:
jmp    1030 <list_deleteLatestElement@plt>

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

LLVM IR (-O2):
%struct.List = type { i32 }
define i32 @lifo_top(%struct.List* %0) {
%2 = tail call i32 @list_deleteLatestElement(%struct.List* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ notify_pvcall(char *);
int pvSetExposureMode(char byBoardNum, unsigned int nExposureMode,
                      double dExposureTime) {
  notify_pvcall("f");
  return (0);
}


x86 assembly (clang, -O0):
<pvSetExposureMode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
lea    0xed3(%rip),%rdi
call   1030 <notify_pvcall@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [2 x i8] c"f\00"
define i32 @pvSetExposureMode(i8 signext %0, i32 %1, double %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca double
store i8 %0, i8* %4
store i32 %1, i32* %5
store double %2, double* %6
%7 = call i32 @notify_pvcall(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c"f\00"
define i32 @pvSetExposureMode(i8 signext %0, i32 %1, double %2) {
%4 = tail call i32 @notify_pvcall(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
unsigned char mfm_get_byte(int drive_id) {}


x86 assembly (clang, -O0):
<mfm_get_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define zeroext i8 @mfm_get_byte(i32 %0) {
ret i8 undef
}
int __attribute__((no)) ypit_doy(int soy) { return (unsigned)soy / 86400; }


x86 assembly (clang, -O0):
<ypit_doy>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x15180,%ecx
xor    %edx,%edx
div    %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<ypit_doy>:
mov    %edi,%ecx
mov    $0xc22e4507,%eax
imul   %rcx,%rax
shr    $0x30,%rax
ret

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

LLVM IR (-O2):
define i32 @ypit_doy(i32 %0) {
%2 = udiv i32 %0, 86400
ret i32 %2
}
/* Variables and functions */
int time(int /*<<< orphan*/ *);
int idris2_time() { return time(NULL); }


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

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

LLVM IR (-O0):
define i32 @idris2_time() {
%1 = call i32 @time(i32* null)
ret i32 %1
}

LLVM IR (-O2):
define i32 @idris2_time() {
%1 = tail call i32 @time(i32* null)
ret i32 %1
}
/* Variables and functions */
int strlen(char *s) {
  int l = 0;
  while (*s != 0) {
    l++;
    *s++;
  }
  return l;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1139 <strlen+0x39>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,(%rdi)
je     111c <strlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = add nuw nsw i32 %5, 1
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ cleanControlPanel();
int /*<<< orphan*/ closeLogger();
void cleanMainResources() {
  cleanControlPanel();
  closeLogger();
}


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

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

LLVM IR (-O0):
define void @cleanMainResources() {
%1 = call i32 (...) @cleanControlPanel()
%2 = call i32 (...) @closeLogger()
ret void
}

LLVM IR (-O2):
define void @cleanMainResources() {
%1 = tail call i32 (...) @cleanControlPanel()
%2 = tail call i32 (...) @closeLogger()
ret void
}
void wifi_rsp_i2c_start_write(
    const struct wifi_msg_i2c_start_write_rsp_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.wifi_msg_i2c_start_write_rsp_t = type opaque
define void @wifi_rsp_i2c_start_write(%struct.wifi_msg_i2c_start_write_rsp_t* nocapture %0) {
ret void
}
/* Variables and functions */
char *deen_leaf_path(char const *, char *);
char *deen_data_path(const char *root_dir) {
  return deen_leaf_path(root_dir, "de-en.txt");
}


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

x86 assembly (clang, -O2):
<deen_data_path>:
lea    0xee9(%rip),%rsi
jmp    1030 <deen_leaf_path@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"de-en.txt\00"
define i8* @deen_data_path(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @deen_leaf_path(i8* %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i8* %4
}

LLVM IR (-O2):
@.str = [10 x i8] c"de-en.txt\00"
define i8* @deen_data_path(i8* %0) {
%2 = tail call i8* @deen_leaf_path(i8* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
/* Variables and functions */
char *memchr(char *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
void nullPointer_memchr(char *p) {
  char *s = 0;
  p = memchr(s, 0, strlen(s));
  (void)p;
}


x86 assembly (clang, -O0):
<nullPointer_memchr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%edx
xor    %esi,%esi
call   1040 <memchr@plt>
mov    %rax,-0x8(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nullPointer_memchr>:
push   %rax
xor    %edi,%edi
call   1030 <strlen@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    %eax,%edx
pop    %rax
jmp    1040 <memchr@plt>

LLVM IR (-O0):
define void @nullPointer_memchr(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
store i8* null, i8** %3
%4 = load i8*, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @strlen(i8* %5)
%7 = call i8* @memchr(i8* %4, i32 0, i32 %6)
store i8* %7, i8** %2
%8 = load i8*, i8** %2
ret void
}

LLVM IR (-O2):
define void @nullPointer_memchr(i8* nocapture readnone %0) {
%2 = tail call i32 @strlen(i8* null)
%3 = tail call i8* @memchr(i8* null, i32 0, i32 %2)
ret void
}
/* Variables and functions */
bool Boolean_0_toBoolean_2_Integer(long long value) { return value != 0; }


x86 assembly (clang, -O0):
<Boolean_0_toBoolean_2_Integer>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Boolean_0_toBoolean_2_Integer>:
xor    %eax,%eax
test   %rdi,%rdi
setne  %al
ret

LLVM IR (-O0):
define i32 @Boolean_0_toBoolean_2_Integer(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ne i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @Boolean_0_toBoolean_2_Integer(i64 %0) {
%2 = icmp ne i64 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int, int);
void usage(char *argv[]) {
  printf("Usage: %s \n"
         "\t--reps <repetitions> (default %d)\n"
         "\t--datasize <datasize> (default %d bytes)\n",
         argv[0], 10, 1048576);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
lea    0xed6(%rip),%rdi
mov    $0xa,%edx
mov    $0x100000,%ecx
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    (%rdi),%rsi
lea    0xee6(%rip),%rdi
mov    $0xa,%edx
mov    $0x100000,%ecx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [89 x i8] c"Usage: %s \0A\09--reps <repetitions> (default %d)\0A\09--datasize <datasize> (default %d bytes)\0A\00"
define void @usage(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = getelementptr inbounds i8*, i8** %3, i64 0
%5 = load i8*, i8** %4
%6 = call i32 @printf(i8* getelementptr inbounds ([89 x i8], [89 x i8]* @.str, i64 0, i64 0), i8* %5, i32 10, i32 1048576)
ret void
}

LLVM IR (-O2):
@.str = [89 x i8] c"Usage: %s \0A\09--reps <repetitions> (default %d)\0A\09--datasize <datasize> (default %d bytes)\0A\00"
define void @usage(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([89 x i8], [89 x i8]* @.str, i64 0, i64 0), i8* %2, i32 10, i32 1048576)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char const *, size_t);
char *xmalloc(size_t);
size_t xstrlen(char const *);
char *xstrdup(const char *dup) {
  size_t len;
  char *copy;
  len = xstrlen(dup);
  if (len == 0)
    return NULL;
  copy = xmalloc(len + 1);
  if (copy != NULL)
    strncpy(copy, dup, len + 1);
  return copy;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <xstrlen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1161 <xstrdup+0x31>
movq   $0x0,-0x8(%rbp)
jmp    119a <xstrdup+0x6a>
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
call   1040 <xmalloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1192 <xstrdup+0x62>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
add    $0x1,%rdx
call   1030 <strncpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1050 <xstrlen@plt>
test   %rax,%rax
je     1169 <xstrdup+0x39>
mov    %rax,%rbx
add    $0x1,%rbx
mov    %rbx,%rdi
call   1040 <xmalloc@plt>
test   %rax,%rax
je     1169 <xstrdup+0x39>
mov    %rax,%r15
mov    %rax,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1030 <strncpy@plt>
jmp    116c <xstrdup+0x3c>
xor    %r15d,%r15d
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @xstrdup(i8* %0) {
%2 = tail call i64 @xstrlen(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %10, label %4
4: ; preds = %1
%5 = add i64 %2, 1
%6 = tail call i8* @xmalloc(i64 %5)
%7 = icmp eq i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %4
%9 = tail call i32 @strncpy(i8* %6, i8* %0, i64 %5)
br label %10
10: ; preds = %4, %8, %1
%11 = phi i8* [ null, %1 ], [ %6, %8 ], [ null, %4 ]
ret i8* %11
}
void _Z12_Jv_is_proxyPv(void) {}


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

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

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

LLVM IR (-O2):
define void @_Z12_Jv_is_proxyPv() {
ret void
}
int binary(const unsigned char source[], int position, int length) {
  int retval = 0;
  if (source[position] >= 128) {
    retval = 1;
  }
  return retval;
}


x86 assembly (clang, -O0):
<binary>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
cmp    $0x80,%eax
jl     1133 <binary+0x33>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<binary>:
movslq %esi,%rax
movzbl (%rdi,%rax,1),%eax
shr    $0x7,%eax
ret

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

LLVM IR (-O2):
define i32 @binary(i8* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = lshr i8 %6, 7
%8 = zext i8 %7 to i32
ret i32 %8
}
int g(void) { return 257; }


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

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

LLVM IR (-O0):
define i32 @g() {
ret i32 257
}

LLVM IR (-O2):
define i32 @g() {
ret i32 257
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int wscanw(int /*<<< orphan*/ *, char *, char *);
int s_wscanw(WINDOW *win, char *fmt, char *string) {
  return (wscanw(win, fmt, string));
}


x86 assembly (clang, -O0):
<s_wscanw>:
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 <wscanw@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_wscanw>:
jmp    1030 <wscanw@plt>

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

LLVM IR (-O2):
define i32 @s_wscanw(i32* %0, i8* %1, i8* %2) {
%4 = tail call i32 @wscanw(i32* %0, i8* %1, i8* %2)
ret i32 %4
}
/* Variables and functions */
int inb(unsigned short);
int serial_is_interrupt_pending(unsigned short com) {
  return (inb((com + 2)) & 0x01) == 0x01;
}


x86 assembly (clang, -O0):
<serial_is_interrupt_pending>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
add    $0x2,%eax
movzwl %ax,%edi
call   1030 <inb@plt>
and    $0x1,%eax
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_is_interrupt_pending>:
push   %rax
add    $0x2,%edi
movzwl %di,%edi
call   1030 <inb@plt>
and    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @serial_is_interrupt_pending(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = add nsw i32 %4, 2
%6 = trunc i32 %5 to i16
%7 = call i32 @inb(i16 zeroext %6)
%8 = and i32 %7, 1
%9 = icmp eq i32 %8, 1
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @serial_is_interrupt_pending(i16 zeroext %0) {
%2 = add i16 %0, 2
%3 = tail call i32 @inb(i16 zeroext %2)
%4 = and i32 %3, 1
ret i32 %4
}
float f(float x, float y) { return x * x + y * y; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
movss  -0x8(%rbp),%xmm1
mulss  -0x8(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mulss  %xmm1,%xmm1
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @f(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %3
%7 = load float, float* %4
%8 = load float, float* %4
%9 = fmul float %7, %8
%10 = call float @llvm.fmuladd.f32(float %5, float %6, float %9)
ret float %10
}

LLVM IR (-O2):
define float @f(float %0, float %1) {
%3 = fmul float %1, %1
%4 = tail call float @llvm.fmuladd.f32(float %0, float %0, float %3)
ret float %4
}