xunge/DecIR huggingface dataset:
int array_good2_FP() {
  int *a[10];
  int i = 0;
  while (i < 10) {
    if (nondet()) {
      a[i] = 0;
      i++;
    }
  }
  return a[2];
}


x86 assembly (clang, -O0):
<array_good2_FP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x54(%rbp)
cmpl   $0xa,-0x54(%rbp)
jge    1154 <array_good2_FP+0x44>
mov    $0x0,%al
call   1030 <nondet@plt>
cmp    $0x0,%eax
je     114f <array_good2_FP+0x3f>
movslq -0x54(%rbp),%rax
movq   $0x0,-0x50(%rbp,%rax,8)
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    111f <array_good2_FP+0xf>
mov    -0x40(%rbp),%rax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<array_good2_FP>:
push   %rbx
sub    $0x50,%rsp
xor    %ebx,%ebx
jmp    1125 <array_good2_FP+0x15>
nopl   0x0(%rax)
cmp    $0xa,%ebx
jge    1140 <array_good2_FP+0x30>
xor    %eax,%eax
call   1030 <nondet@plt>
test   %eax,%eax
je     1120 <array_good2_FP+0x10>
movslq %ebx,%rbx
movq   $0x0,(%rsp,%rbx,8)
add    $0x1,%ebx
jmp    1120 <array_good2_FP+0x10>
mov    0x10(%rsp),%eax
add    $0x50,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @array_good2_FP() {
%1 = alloca [10 x i32*]
%2 = bitcast [10 x i32*]* %1 to i8*
br label %3
3: ; preds = %0, %11
%4 = phi i32 [ 0, %0 ], [ %12, %11 ]
%5 = tail call i32 (...) @nondet()
%6 = icmp eq i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %3
%8 = sext i32 %4 to i64
%9 = getelementptr inbounds [10 x i32*], [10 x i32*]* %1, i64 0, i64 %8
store i32* null, i32** %9
%10 = add nsw i32 %4, 1
br label %11
11: ; preds = %7, %3
%12 = phi i32 [ %10, %7 ], [ %4, %3 ]
%13 = icmp slt i32 %12, 10
br i1 %13, label %3, label %14
14: ; preds = %11
%15 = getelementptr inbounds [10 x i32*], [10 x i32*]* %1, i64 0, i64 2
%16 = load i32*, i32** %15
%17 = ptrtoint i32* %16 to i64
%18 = trunc i64 %17 to i32
ret i32 %18
}
int f(int *b) {
  b[0] = 33;
  b[2] = 19;
  return b[2];
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x21,(%rax)
mov    -0x8(%rbp),%rax
movl   $0x13,0x8(%rax)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
movl   $0x21,(%rdi)
movl   $0x13,0x8(%rdi)
mov    $0x13,%eax
ret

LLVM IR (-O0):
define i32 @f(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
store i32 33, i32* %4
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 2
store i32 19, i32* %6
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 2
%9 = load i32, i32* %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @f(i32* nocapture writeonly %0) {
store i32 33, i32* %0
%2 = getelementptr inbounds i32, i32* %0, i64 2
store i32 19, i32* %2
ret i32 19
}
void socfpga_arria10_mmc_init(void) { return; }


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @X509_CRL_dup() {
ret void
}
/* Variables and functions */
void *realloc(void *, size_t);
void *perealloc(void *ptr, size_t sz, int _unused) { return realloc(ptr, sz); }


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

x86 assembly (clang, -O2):
<perealloc>:
jmp    1030 <realloc@plt>

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

LLVM IR (-O2):
define noalias i8* @perealloc(i8* nocapture %0, i64 %1, i32 %2) {
%4 = tail call i8* @realloc(i8* %0, i64 %1)
ret i8* %4
}
int a1(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @a1() {
ret i32 1
}

LLVM IR (-O2):
define i32 @a1() {
ret i32 1
}
__float128 from_uns_short_load_n(unsigned short *a, long n) {
  return (__float128)a[n];
}


x86 assembly (clang, -O0):
<from_uns_short_load_n>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movzwl (%rax,%rcx,2),%edi
call   1130 <__floatsitf>
add    $0x10,%rsp
pop    %rbp
ret
nopw   0x0(%rax,%rax,1)

x86 assembly (clang, -O2):
<from_uns_short_load_n>:
push   %rax
movzwl (%rdi,%rsi,2),%edi
call   1110 <__floatsitf>
pop    %rax
ret
nopl   0x0(%rax)

LLVM IR (-O0):
define fp128 @from_uns_short_load_n(i16* %0, i64 %1) {
%3 = alloca i16*
%4 = alloca i64
store i16* %0, i16** %3
store i64 %1, i64* %4
%5 = load i16*, i16** %3
%6 = load i64, i64* %4
%7 = getelementptr inbounds i16, i16* %5, i64 %6
%8 = load i16, i16* %7
%9 = uitofp i16 %8 to fp128
ret fp128 %9
}

LLVM IR (-O2):
define fp128 @from_uns_short_load_n(i16* nocapture %0, i64 %1) {
%3 = getelementptr inbounds i16, i16* %0, i64 %1
%4 = load i16, i16* %3
%5 = uitofp i16 %4 to fp128
ret fp128 %5
}
/* Variables and functions */
scalar_t__ feof(int /*<<< orphan*/);
int /*<<< orphan*/ new_int(int);
int /*<<< orphan*/ push(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
void builtin_eof() { push(new_int(feof(stdin) != 0 ? 1 : 0)); }


x86 assembly (clang, -O0):
<builtin_eof>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
call   1030 <feof@plt>
mov    %rax,%rcx
xor    %edi,%edi
mov    $0x1,%eax
cmp    $0x0,%rcx
cmovne %eax,%edi
call   1040 <new_int@plt>
mov    %eax,%edi
call   1050 <push@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<builtin_eof>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
call   1030 <feof@plt>
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1040 <new_int@plt>
mov    %eax,%edi
pop    %rax
jmp    1050 <push@plt>

LLVM IR (-O0):
@stdin = global i32 0
define void @builtin_eof() {
%1 = load i32, i32* @stdin
%2 = call i64 @feof(i32 %1)
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 1, i32 0
%6 = call i32 @new_int(i32 %5)
%7 = call i32 @push(i32 %6)
ret void
}

LLVM IR (-O2):
@stdin = global i32 0
define void @builtin_eof() {
%1 = load i32, i32* @stdin
%2 = tail call i64 @feof(i32 %1)
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @new_int(i32 %4)
%6 = tail call i32 @push(i32 %5)
ret void
}
readsector(buffer, sectornummer) char *buffer;
unsigned int sectornummer;
{ common(buffer, sectornummer, 2); }


x86 assembly (clang, -O0):
<readsector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    $0x2,%edx
mov    $0x0,%al
call   1030 <common@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readsector>:
mov    $0x2,%edx
xor    %eax,%eax
jmp    1030 <common@plt>

LLVM IR (-O0):
define i32 @readsector(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%6 = load i8*, i8** %4
%7 = load i32, i32* %5
%8 = call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @common to i32 (i8*, i32, i32, ...)*)(i8* %6, i32 %7, i32 2)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @readsector(i8* %0, i32 %1) {
%3 = tail call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @common to i32 (i8*, i32, i32, ...)*)(i8* %0, i32 %1, i32 2)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ dump1d(size_t, double *);
void dump2d(size_t r, size_t c, double X[r][c]) {
  size_t i;
  for (i = 0; i < r; i++)
    dump1d(c, X[i]);
}


x86 assembly (clang, -O0):
<dump2d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    1170 <dump2d+0x60>
mov    -0x28(%rbp),%rax
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
imul   -0x20(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rsi
call   1030 <dump1d@plt>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1134 <dump2d+0x24>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump2d>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rdi,%rdi
je     1144 <dump2d+0x34>
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
lea    0x0(,%rsi,8),%r12
xchg   %ax,%ax
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <dump1d@plt>
add    %r12,%rbx
add    $0xffffffffffffffff,%r15
jne    1130 <dump2d+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @dump2d(i64 %0, i64 %1, double* %2) {
%4 = icmp eq i64 %0, 0
br i1 %4, label %12, label %5
5: ; preds = %3, %5
%6 = phi i64 [ %10, %5 ], [ 0, %3 ]
%7 = mul nsw i64 %6, %1
%8 = getelementptr inbounds double, double* %2, i64 %7
%9 = tail call i32 @dump1d(i64 %1, double* %8)
%10 = add nuw i64 %6, 1
%11 = icmp eq i64 %10, %0
br i1 %11, label %12, label %5
12: ; preds = %5, %3
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, char *);
char *replace(char *, char *, char *);
int main(void) {
  char string[] = "ANSI C language programming on win$ system";
  printf("%s\n", replace("win$", "unix", string));
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x2b,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rdx
lea    0xed0(%rip),%rdi
lea    0xece(%rip),%rsi
call   1050 <replace@plt>
mov    %rax,%rsi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e5f(%rip),%rax
mov    (%rax),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
movups 0xef0(%rip),%xmm0
movups %xmm0,0x1b(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xee1(%rip),%rdi
lea    0xedf(%rip),%rsi
mov    %rsp,%rdx
call   1040 <replace@plt>
lea    0xec7(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    0x2e6d(%rip),%rax
mov    (%rax),%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.main.string = [43 x i8] c"ANSI C language programming on win$ system\00"
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [5 x i8] c"win$\00"
@.str.2 = [5 x i8] c"unix\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [43 x i8]
store i32 0, i32* %1
%3 = bitcast [43 x i8]* %2 to i8*
%4 = getelementptr inbounds [43 x i8], [43 x i8]* %2, i64 0, i64 0
%5 = call i8* @replace(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}

LLVM IR (-O2):
@__const.main.string = [43 x i8] c"ANSI C language programming on win$ system\00"
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [5 x i8] c"win$\00"
@.str.2 = [5 x i8] c"unix\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca [43 x i8]
%2 = getelementptr inbounds [43 x i8], [43 x i8]* %1, i64 0, i64 0
%3 = call i8* @replace(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}
void g_strdup_printf() {}


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

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

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

LLVM IR (-O2):
define void @g_strdup_printf() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main_main() { printf("Hello world\n"); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"Hello world\0A\00"
define void @main_main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [12 x i8] c"Hello world\00"
define void @main_main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ link_failure_y0();
scalar_t__ y0(double);
void test_y0(double d) {
  if (y0(d) != y0(d))
    link_failure_y0();
}


x86 assembly (clang, -O0):
<test_y0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <y0@plt>
mov    %rax,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <y0@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     115c <test_y0+0x3c>
mov    $0x0,%al
call   1030 <link_failure_y0@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_y0>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
call   1040 <y0@plt>
mov    %rax,%rbx
movsd  0x8(%rsp),%xmm0
call   1040 <y0@plt>
cmp    %rax,%rbx
jne    1149 <test_y0+0x29>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1030 <link_failure_y0@plt>

LLVM IR (-O0):
define void @test_y0(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @y0(double %3)
%5 = load double, double* %2
%6 = call i64 @y0(double %5)
%7 = icmp ne i64 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @link_failure_y0()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @test_y0(double %0) {
%2 = tail call i64 @y0(double %0)
%3 = tail call i64 @y0(double %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_y0()
br label %7
7: ; preds = %5, %1
ret void
}
int read_config(char *cconfig) {
  if (!cconfig)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<read_config>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <read_config+0x1f>
movl   $0x0,-0x4(%rbp)
jmp    1126 <read_config+0x26>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @read_config(i8* readnone %0) {
%2 = icmp ne i8* %0, null
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ getsSample2();
int main() {
  getsSample2();
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getsSample2@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <getsSample2@plt>
mov    0x2ec1(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @getsSample2()
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @getsSample2()
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ handle_35(int /*<<< orphan*/);
int gen_35() {
  handle_35(0);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @gen_35() {
%1 = tail call i32 @handle_35(i32 0)
ret i32 0
}
/* Variables and functions */
bool nrf52_errata_110(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_110() {
ret i32 0
}
/* Variables and functions */
char *strstr(char const *, char *);
int drop_line(const char *line) {
  const char *p;
  p = strstr(line, "mercury__");
  if (p == NULL) {
    return 0;
  }
  return strstr(p, " used but never defined") != NULL;
}


x86 assembly (clang, -O0):
<drop_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strstr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1147 <drop_line+0x37>
movl   $0x0,-0x4(%rbp)
jmp    1166 <drop_line+0x56>
mov    -0x18(%rbp),%rdi
lea    0xeb8(%rip),%rsi
call   1030 <strstr@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drop_line>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strstr@plt>
test   %rax,%rax
je     113e <drop_line+0x2e>
lea    0xee1(%rip),%rsi
mov    %rax,%rdi
call   1030 <strstr@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"mercury__\00"
@.str.1 = [24 x i8] c" used but never defined\00"
define i32 @drop_line(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @strstr(i8* %5, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 0, i32* %2
br label %15
10: ; preds = %1
%11 = load i8*, i8** %4
%12 = call i8* @strstr(i8* %11, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%13 = icmp ne i8* %12, null
%14 = zext i1 %13 to i32
store i32 %14, i32* %2
br label %15
15: ; preds = %10, %9
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
@.str = [10 x i8] c"mercury__\00"
@.str.1 = [24 x i8] c" used but never defined\00"
define i32 @drop_line(i8* %0) {
%2 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i8* %2, null
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i8* @strstr(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp ne i8* %5, null
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 0, %1 ]
ret i32 %9
}
/* Variables and functions */
int PAPI_epc(int, float *, float *, long long *, long long *, long long *,
             float *);
void papif_epc__(int event, float *rtime, float *ptime, long long *ref,
                 long long *core, long long *evt, float *epc, int *check) {
  *check = PAPI_epc(event, rtime, ptime, ref, core, evt, epc);
}


x86 assembly (clang, -O0):
<papif_epc__>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
mov    0x10(%rbp),%rax
mov    %rax,(%rsp)
call   1030 <PAPI_epc@plt>
mov    %eax,%ecx
mov    0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<papif_epc__>:
push   %rbx
sub    $0x10,%rsp
mov    0x28(%rsp),%rbx
mov    0x20(%rsp),%rax
mov    %rax,(%rsp)
call   1030 <PAPI_epc@plt>
mov    %eax,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @papif_epc__(i32 %0, float* %1, float* %2, i64* %3, i64* %4, i64* %5, float* %6, i32* %7) {
%9 = alloca i32
%10 = alloca float*
%11 = alloca float*
%12 = alloca i64*
%13 = alloca i64*
%14 = alloca i64*
%15 = alloca float*
%16 = alloca i32*
store i32 %0, i32* %9
store float* %1, float** %10
store float* %2, float** %11
store i64* %3, i64** %12
store i64* %4, i64** %13
store i64* %5, i64** %14
store float* %6, float** %15
store i32* %7, i32** %16
%17 = load i32, i32* %9
%18 = load float*, float** %10
%19 = load float*, float** %11
%20 = load i64*, i64** %12
%21 = load i64*, i64** %13
%22 = load i64*, i64** %14
%23 = load float*, float** %15
%24 = call i32 @PAPI_epc(i32 %17, float* %18, float* %19, i64* %20, i64* %21, i64* %22, float* %23)
%25 = load i32*, i32** %16
store i32 %24, i32* %25
ret void
}

LLVM IR (-O2):
define void @papif_epc__(i32 %0, float* %1, float* %2, i64* %3, i64* %4, i64* %5, float* %6, i32* nocapture writeonly %7) {
%9 = tail call i32 @PAPI_epc(i32 %0, float* %1, float* %2, i64* %3, i64* %4, i64* %5, float* %6)
store i32 %9, i32* %7
ret void
}
int getAverage(int x, int y) {
  return (x + y) >> 1;
  return ((x ^ y) >> 1) + (x & y);
}


x86 assembly (clang, -O0):
<getAverage>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
sar    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getAverage>:
lea    (%rdi,%rsi,1),%eax
sar    %eax
ret

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

LLVM IR (-O2):
define i32 @getAverage(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = ashr i32 %3, 1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ uart0_write(char *);
void swi(void) {
  uart0_write("swi!\r\n");
  exit(-1);
}


x86 assembly (clang, -O0):
<swi>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <uart0_write@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<swi>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <uart0_write@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"swi!\0D\0A\00"
define void @swi() {
%1 = call i32 @uart0_write(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@.str = [7 x i8] c"swi!\0D\0A\00"
define void @swi() {
%1 = tail call i32 @uart0_write(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
char *find_corrections(char *);
char *correct_word(char *word) { return find_corrections(word); }


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

x86 assembly (clang, -O2):
<correct_word>:
jmp    1030 <find_corrections@plt>

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

LLVM IR (-O2):
define i8* @correct_word(i8* %0) {
%2 = tail call i8* @find_corrections(i8* %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ __analyzer_eval(int);
void test_35(int i, int j) {
  __analyzer_eval(&i == &i);
  __analyzer_eval(&i != &j);
}


x86 assembly (clang, -O0):
<test_35>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x1,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__analyzer_eval@plt>
lea    -0x4(%rbp),%rax
lea    -0x8(%rbp),%rcx
cmp    %rcx,%rax
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_35>:
push   %rax
mov    $0x1,%edi
call   1030 <__analyzer_eval@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <__analyzer_eval@plt>

LLVM IR (-O0):
define void @test_35(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = icmp eq i32* %3, %3
%6 = zext i1 %5 to i32
%7 = call i32 @__analyzer_eval(i32 %6)
%8 = icmp ne i32* %3, %4
%9 = zext i1 %8 to i32
%10 = call i32 @__analyzer_eval(i32 %9)
ret void
}

LLVM IR (-O2):
define void @test_35(i32 %0, i32 %1) {
%3 = tail call i32 @__analyzer_eval(i32 1)
%4 = tail call i32 @__analyzer_eval(i32 1)
ret void
}
void set_memory_limit(int megabytes) {}


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

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

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

LLVM IR (-O2):
define void @set_memory_limit(i32 %0) {
ret void
}
/* Type definitions */
typedef scalar_t__ pid_t;
typedef int /*<<< orphan*/ clockid_t;

/* Variables and functions */
int ENOENT;
int EPERM;
scalar_t__ getpid();
int __clock_getcpuclockid(pid_t pid, clockid_t *clock_id) {
  if (pid != 0 && pid != getpid())
    return EPERM;
  return ENOENT;
}


x86 assembly (clang, -O0):
<__clock_getcpuclockid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     115b <__clock_getcpuclockid+0x4b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
je     115b <__clock_getcpuclockid+0x4b>
mov    0x2e7f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1167 <__clock_getcpuclockid+0x57>
mov    0x2e76(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__clock_getcpuclockid>:
push   %rbx
test   %rdi,%rdi
je     1125 <__clock_getcpuclockid+0x15>
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <getpid@plt>
cmp    %rbx,%rax
jne    112e <__clock_getcpuclockid+0x1e>
mov    0x2eac(%rip),%rax
jmp    1135 <__clock_getcpuclockid+0x25>
mov    0x2e9b(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
@EPERM = global i32 0
@ENOENT = global i32 0
define i32 @__clock_getcpuclockid(i64 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i32*
store i64 %0, i64* %4
store i32* %1, i32** %5
%6 = load i64, i64* %4
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load i64, i64* %4
%10 = call i64 (...) @getpid()
%11 = icmp ne i64 %9, %10
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = load i32, i32* @EPERM
store i32 %13, i32* %3
br label %16
14: ; preds = %8, %2
%15 = load i32, i32* @ENOENT
store i32 %15, i32* %3
br label %16
16: ; preds = %14, %12
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@EPERM = global i32 0
@ENOENT = global i32 0
define i32 @__clock_getcpuclockid(i64 %0, i32* nocapture readnone %1) {
%3 = icmp eq i64 %0, 0
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = tail call i64 (...) @getpid()
%6 = icmp eq i64 %5, %0
br i1 %6, label %7, label %8
7: ; preds = %4, %2
br label %8
8: ; preds = %4, %7
%9 = phi i32* [ @ENOENT, %7 ], [ @EPERM, %4 ]
%10 = load i32, i32* %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int c1_f1() { printf("This is native call c1_f1()\n"); }


x86 assembly (clang, -O0):
<c1_f1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [29 x i8] c"This is native call c1_f1()\0A\00"
define i32 @c1_f1() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [28 x i8] c"This is native call c1_f1()\00"
define i32 @c1_f1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
void motion_test8(int *data) {
  int i = 0;
  int j = data[0];
  while (i < data[2]) {
    data[i] = 21 * j + i;
    i++;
  }
}


x86 assembly (clang, -O0):
<motion_test8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
cmp    0x8(%rcx),%eax
jge    1148 <motion_test8+0x48>
imul   $0x15,-0x10(%rbp),%edx
add    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1118 <motion_test8+0x18>
pop    %rbp
ret

x86 assembly (clang, -O2):
<motion_test8>:
cmpl   $0x0,0x8(%rdi)
jle    1123 <motion_test8+0x23>
mov    (%rdi),%eax
lea    (%rax,%rax,4),%ecx
lea    (%rax,%rcx,4),%eax
xor    %ecx,%ecx
lea    (%rax,%rcx,1),%edx
mov    %edx,(%rdi,%rcx,4)
add    $0x1,%rcx
movslq 0x8(%rdi),%rdx
cmp    %rdx,%rcx
jl     1110 <motion_test8+0x10>
ret

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

LLVM IR (-O2):
define void @motion_test8(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %17
5: ; preds = %1
%6 = load i32, i32* %0
%7 = mul nsw i32 %6, 21
br label %8
8: ; preds = %5, %8
%9 = phi i64 [ 0, %5 ], [ %13, %8 ]
%10 = trunc i64 %9 to i32
%11 = add nsw i32 %7, %10
%12 = getelementptr inbounds i32, i32* %0, i64 %9
store i32 %11, i32* %12
%13 = add nuw nsw i64 %9, 1
%14 = load i32, i32* %2
%15 = sext i32 %14 to i64
%16 = icmp slt i64 %13, %15
br i1 %16, label %8, label %17
17: ; preds = %8, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int16_t;
typedef int u_char;

/* Variables and functions */
u_int16_t htons(u_int16_t x) {
  u_char *s = (u_char *)&x;
  return (u_int16_t)(s[0] << 8 | s[1]);
}


x86 assembly (clang, -O0):
<htons>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
shl    $0x8,%eax
mov    -0x10(%rbp),%rcx
or     0x4(%rcx),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @htons(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
store i32* %2, i32** %3
%4 = load i32*, i32** %3
%5 = getelementptr inbounds i32, i32* %4, i64 0
%6 = load i32, i32* %5
%7 = shl i32 %6, 8
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 1
%10 = load i32, i32* %9
%11 = or i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @htons(i32 %0) {
ret i32 poison
}
/* Variables and functions */
int /*<<< orphan*/ hires_timer(double *);
void HIRES_TIMER_(double *d) { hires_timer(d); }


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

x86 assembly (clang, -O2):
<HIRES_TIMER_>:
jmp    1030 <hires_timer@plt>

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

LLVM IR (-O2):
define void @HIRES_TIMER_(double* %0) {
%2 = tail call i32 @hires_timer(double* %0)
ret void
}
void RTAvlU32GetBestFit(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAvlU32GetBestFit() {
ret void
}
const char *parse_skip_whitespace(const char *str) {
  while (*str &&
         (*str == ' ' || *str == '\t' || *str == '\n' || *str == '\r')) {
    str++;
  }
  return str;
}


x86 assembly (clang, -O0):
<parse_skip_whitespace>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1172 <parse_skip_whitespace+0x72>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0xa(%rbp)
je     116c <parse_skip_whitespace+0x6c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0xa(%rbp)
je     116c <parse_skip_whitespace+0x6c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0xa,%ecx
mov    %al,-0xa(%rbp)
je     116c <parse_skip_whitespace+0x6c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xd,%eax
sete   %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1182 <parse_skip_whitespace+0x82>
jmp    1193 <parse_skip_whitespace+0x93>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <parse_skip_whitespace+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_skip_whitespace>:
mov    %rdi,%rax
movabs $0x100002600,%rcx
nopl   (%rax)
movzbl (%rax),%edx
cmp    $0x20,%rdx
ja     1125 <parse_skip_whitespace+0x25>
bt     %rdx,%rcx
jae    1125 <parse_skip_whitespace+0x25>
add    $0x1,%rax
jmp    1110 <parse_skip_whitespace+0x10>
ret

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

LLVM IR (-O2):
define i8* @parse_skip_whitespace(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %7 [
i8 13, label %5
i8 32, label %5
i8 9, label %5
i8 10, label %5
]
5: ; preds = %2, %2, %2, %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char const *);
void print_status(int n, const char *text) {
  printf("Status: %d %s\r\n", n, text);
}


x86 assembly (clang, -O0):
<print_status>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_status>:
mov    %rsi,%rdx
mov    %edi,%esi
lea    0xee4(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Status: %d %s\0D\0A\00"
define void @print_status(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"Status: %d %s\0D\0A\00"
define void @print_status(i32 %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1)
ret void
}
/* Variables and functions */
int Add(int, int);
int EXIT_SUCCESS;
int Sub(int, int);
int /*<<< orphan*/ printf(char *, int, int, int);
int main(void) {
  int a = 3, b = 5;
  printf("%d + %d = %d\n", a, b, Add(a, b));
  printf("%d - %d = %d\n", a, b, Sub(a, b));
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1050 <Add@plt>
mov    -0x1c(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    %eax,%ecx
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <Sub@plt>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    %eax,%ecx
lea    0xe70(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e36(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3,%edi
mov    $0x5,%esi
call   1050 <Add@plt>
lea    0xeb9(%rip),%rdi
mov    $0x3,%esi
mov    $0x5,%edx
mov    %eax,%ecx
call   1030 <printf@plt>
mov    $0x3,%edi
mov    $0x5,%esi
call   1040 <Sub@plt>
lea    0xea0(%rip),%rdi
mov    $0x3,%esi
mov    $0x5,%edx
mov    %eax,%ecx
call   1030 <printf@plt>
mov    0x2e5a(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"%d + %d = %d\0A\00"
@.str.1 = [14 x i8] c"%d - %d = %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 3, i32* %2
store i32 5, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = call i32 @Add(i32 %6, i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5, i32 %8)
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = call i32 @Sub(i32 %12, i32 %13)
%15 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %10, i32 %11, i32 %14)
%16 = load i32, i32* @EXIT_SUCCESS
ret i32 %16
}

LLVM IR (-O2):
@.str = [14 x i8] c"%d + %d = %d\0A\00"
@.str.1 = [14 x i8] c"%d - %d = %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @Add(i32 3, i32 5)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 3, i32 5, i32 %1)
%3 = tail call i32 @Sub(i32 3, i32 5)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 3, i32 5, i32 %3)
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
void uint16_to_bin(uint16_t v, void *d) {
  uint8_t *p = (uint8_t *)d;
  *p++ = (v >> 8);
  *p = 0xff & v;
}


x86 assembly (clang, -O0):
<uint16_to_bin>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x18(%rbp)
mov    %ecx,(%rax)
mov    -0x4(%rbp),%ecx
and    $0xff,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<uint16_to_bin>:
movzbl %dil,%eax
sar    $0x8,%edi
mov    %edi,(%rsi)
mov    %eax,0x4(%rsi)
ret

LLVM IR (-O0):
define void @uint16_to_bin(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32*
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %5
%8 = load i32, i32* %3
%9 = ashr i32 %8, 8
%10 = load i32*, i32** %5
%11 = getelementptr inbounds i32, i32* %10, i32 1
store i32* %11, i32** %5
store i32 %9, i32* %10
%12 = load i32, i32* %3
%13 = and i32 255, %12
%14 = load i32*, i32** %5
store i32 %13, i32* %14
ret void
}

LLVM IR (-O2):
define void @uint16_to_bin(i32 %0, i8* nocapture writeonly %1) {
%3 = bitcast i8* %1 to i32*
%4 = ashr i32 %0, 8
%5 = getelementptr inbounds i8, i8* %1, i64 4
%6 = bitcast i8* %5 to i32*
store i32 %4, i32* %3
%7 = and i32 %0, 255
store i32 %7, i32* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void bgcolor(int c) { printf("\x1b[[4%dm", c); }


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

x86 assembly (clang, -O2):
<bgcolor>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"\1B[[4%dm\00"
define void @bgcolor(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
int get_path_name(char *path_name, char *dir_name, char *d_name) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @get_path_name(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
ret i32 0
}
int main() {
  int a = 0;
  if ((a == 0) || (a == 1))
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1126 <main+0x26>
cmpl   $0x1,-0x8(%rbp)
jne    1132 <main+0x32>
movl   $0x0,-0x4(%rbp)
jmp    1139 <main+0x39>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int child() {
  srand(time(NULL));
  int returnCode = rand() % 10;
  printf("child: returnCode = %d\n", returnCode);
  return returnCode;
}


x86 assembly (clang, -O0):
<child>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xe8c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<child>:
push   %rbx
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
xor    %eax,%eax
call   1060 <rand@plt>
movslq %eax,%rbx
imul   $0x66666667,%rbx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%ebx
lea    0xe85(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"child: returnCode = %d\0A\00"
define i32 @child() {
%1 = alloca i32
%2 = call i32 @time(i32* null)
%3 = call i32 @srand(i32 %2)
%4 = call i32 (...) @rand()
%5 = srem i32 %4, 10
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
@.str = [24 x i8] c"child: returnCode = %d\0A\00"
define i32 @child() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
%3 = tail call i32 (...) @rand()
%4 = srem i32 %3, 10
%5 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 %4
}