xunge/DecIR huggingface dataset:
void _emptyExtraDataPerThreadReduce(void *data) { (void)data; }


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

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

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

LLVM IR (-O2):
define void @_emptyExtraDataPerThreadReduce(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void adsr_note_free(void *data) { free(data); }


x86 assembly (clang, -O0):
<adsr_note_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):
<adsr_note_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @adsr_note_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 @adsr_note_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_format_info_free_string_array() {
  printf("NOT IMPLEMENTED:"
         "pa_format_info_free_string_array"
         "\n");
}


x86 assembly (clang, -O0):
<pa_format_info_free_string_array>:
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):
<pa_format_info_free_string_array>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [49 x i8] c"NOT IMPLEMENTED:pa_format_info_free_string_array\00"
define i32 @pa_format_info_free_string_array() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ die(char *, size_t);
void *realloc(void *, size_t);
void *xrealloc(void *ptr, size_t size) {
  ptr = realloc(ptr, size);
  if (!ptr && size)
    die("Out of memory: failed to allocate %zu bytes", size);
  return ptr;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <realloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1167 <xrealloc+0x47>
cmpq   $0x0,-0x10(%rbp)
je     1167 <xrealloc+0x47>
mov    -0x10(%rbp),%rsi
lea    0xe9e(%rip),%rdi
call   1040 <die@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1030 <realloc@plt>
mov    %rax,%r14
test   %rbx,%rbx
je     1148 <xrealloc+0x28>
test   %r14,%r14
jne    1148 <xrealloc+0x28>
lea    0xec0(%rip),%rdi
mov    %rbx,%rsi
call   1040 <die@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [44 x i8] c"Out of memory: failed to allocate %zu bytes\00"
define i8* @xrealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i8* @realloc(i8* %5, i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = icmp ne i8* %8, null
br i1 %9, label %16, label %10
10: ; preds = %2
%11 = load i64, i64* %4
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load i64, i64* %4
%15 = call i32 @die(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i64 %14)
br label %16
16: ; preds = %13, %10, %2
%17 = load i8*, i8** %3
ret i8* %17
}

LLVM IR (-O2):
@.str = [44 x i8] c"Out of memory: failed to allocate %zu bytes\00"
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
%5 = icmp ne i64 %1, 0
%6 = and i1 %5, %4
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @die(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i64 %1)
br label %9
9: ; preds = %7, %2
ret i8* %3
}
void INT_Excep_PERIA_INTA236(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ BIO_printf(int /*<<< orphan*/ *, char *, int);
void valid_code(BIO *bio) { BIO_printf(bio, "%d\n", 1); }


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

x86 assembly (clang, -O2):
<valid_code>:
lea    0xee9(%rip),%rsi
mov    $0x1,%edx
jmp    1030 <BIO_printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @valid_code(i32* %0) {
%2 = tail call i32 @BIO_printf(i32* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
/* Variables and functions */
int exp(double);
double sigmoid(double x) { return (1 / (1 + exp(-x))); }


x86 assembly (clang, -O0):
<sigmoid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <exp@plt>
mov    %eax,%ecx
add    $0x1,%ecx
mov    $0x1,%eax
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigmoid>:
push   %rax
xorps  0xee8(%rip),%xmm0
call   1030 <exp@plt>
lea    0x1(%rax),%ecx
add    $0x2,%eax
xor    %edx,%edx
cmp    $0x3,%eax
cmovb  %ecx,%edx
xorps  %xmm0,%xmm0
cvtsi2sd %edx,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @sigmoid(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fneg double %3
%5 = call i32 @exp(double %4)
%6 = add nsw i32 1, %5
%7 = sdiv i32 1, %6
%8 = sitofp i32 %7 to double
ret double %8
}

LLVM IR (-O2):
define double @sigmoid(double %0) {
%2 = fneg double %0
%3 = tail call i32 @exp(double %2)
%4 = add nsw i32 %3, 1
%5 = add i32 %3, 2
%6 = icmp ult i32 %5, 3
%7 = select i1 %6, i32 %4, i32 0
%8 = sitofp i32 %7 to double
ret double %8
}
int main(int argc, const char *argv[]) {
  struct my_struct {
    int a;
    double b[2];
  };
  struct my_struct array[2];
  int a = array[0].a;
  double b = array[1].b[0];
  return 0;
}


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

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

LLVM IR (-O0):
%struct.my_struct = type { i32, [2 x double] }
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [2 x %struct.my_struct]
%7 = alloca i32
%8 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = getelementptr inbounds [2 x %struct.my_struct], [2 x %struct.my_struct]* %6, i64 0, i64 0
%10 = getelementptr inbounds %struct.my_struct, %struct.my_struct* %9, i32 0, i32 0
%11 = load i32, i32* %10
store i32 %11, i32* %7
%12 = getelementptr inbounds [2 x %struct.my_struct], [2 x %struct.my_struct]* %6, i64 0, i64 1
%13 = getelementptr inbounds %struct.my_struct, %struct.my_struct* %12, i32 0, i32 1
%14 = getelementptr inbounds [2 x double], [2 x double]* %13, i64 0, i64 0
%15 = load double, double* %14
store double %15, double* %8
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_sw_volume_snprint_dB() {
  printf("NOT IMPLEMENTED:"
         "pa_sw_volume_snprint_dB"
         "\n");
}


x86 assembly (clang, -O0):
<pa_sw_volume_snprint_dB>:
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):
<pa_sw_volume_snprint_dB>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [40 x i8] c"NOT IMPLEMENTED:pa_sw_volume_snprint_dB\00"
define i32 @pa_sw_volume_snprint_dB() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
void __ompc_spin_unlock(volatile int *lock) { *lock = 0; }


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

x86 assembly (clang, -O2):
<__ompc_spin_unlock>:
movl   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @__ompc_spin_unlock(i32* %0) {
store volatile i32 0, i32* %0
ret void
}
int test_imm_4Bint16_mem(short *val) {
  return ((*val) & (-0x4B << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_4Bint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
and    $0xffffffb5,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_4Bint16_mem>:
movzwl (%rdi),%eax
test   $0xffb5,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_4Bint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -75
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ kbhit();
int getkey() {
  while (!kbhit())
    ;
  return (unsigned char)((unsigned int volatile *)0xd4018000)[0];
}


x86 assembly (clang, -O0):
<getkey>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <getkey+0x9>
mov    $0x0,%al
call   1030 <kbhit@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1135 <getkey+0x25>
jmp    113a <getkey+0x2a>
jmp    1119 <getkey+0x9>
mov    $0xd4018000,%eax
mov    (%rax),%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getkey>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <kbhit@plt>
test   %eax,%eax
je     1120 <getkey+0x10>
mov    $0xd4018000,%eax
mov    (%rax),%eax
movzbl %al,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @getkey() {
br label %1
1: ; preds = %5, %0
%2 = call i32 (...) @kbhit()
%3 = icmp ne i32 %2, 0
%4 = xor i1 %3, true
br i1 %4, label %5, label %6
5: ; preds = %1
br label %1
6: ; preds = %1
%7 = load volatile i32, i32* inttoptr (i64 3556868096 to i32*)
%8 = trunc i32 %7 to i8
%9 = zext i8 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @getkey() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @kbhit()
%3 = icmp eq i32 %2, 0
br i1 %3, label %1, label %4
4: ; preds = %1
%5 = load volatile i32, i32* inttoptr (i64 3556868096 to i32*)
%6 = and i32 %5, 255
ret i32 %6
}
int GFX_loadFont(char *name, int style, int size) { return (int)0; }


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

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

LLVM IR (-O0):
define i32 @GFX_loadFont(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
ret i32 0
}

LLVM IR (-O2):
define i32 @GFX_loadFont(i8* nocapture readnone %0, i32 %1, i32 %2) {
ret i32 0
}
void INT_Excep_RIIC1_ICRXI1(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_RIIC1_ICRXI1() {
ret void
}
int test(int param1, int param2, int param3) {
  int g1;
  int o0;
  g1 = 1;
  o0 = 1;
  if (param1 >= param2) {
    o0 = 0;
  }
  if (param2 >= param3) {
    g1 = 0;
  }
  return o0 & g1;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     112e <test+0x2e>
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     1141 <test+0x41>
movl   $0x0,-0x10(%rbp)
mov    -0x14(%rbp),%eax
and    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
cmp    %edx,%esi
setl   %al
cmp    %esi,%edi
setl   %cl
and    %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @test(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
%5 = icmp slt i32 %0, %1
%6 = and i1 %5, %4
%7 = zext i1 %6 to i32
ret i32 %7
}
void av_tree_find() {}


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

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

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

LLVM IR (-O2):
define void @av_tree_find() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RunFuriatune(char *);
void xCacheOff(void) { RunFuriatune("cache off"); }


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

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"cache off\00"
define void @xCacheOff() {
%1 = tail call i32 @RunFuriatune(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}
void l4x_debug_stats_exceptions_hit(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"hello world!\00"
define void @print_hello() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int ack(int, int);
int printf(char *, int);
int main() { return printf("%d\n", ack(3, 4)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x3,%edi
mov    $0x4,%esi
call   1030 <ack@plt>
mov    %eax,%esi
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3,%edi
mov    $0x4,%esi
call   1030 <ack@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1040 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @ack(i32 3, i32 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 %2
}
/* Variables and functions */
int bbm_byte_read(void *, unsigned short, unsigned char *);
int bbm_com_byte_read(void *handle, unsigned short addr, unsigned char *data) {
  int res;
  res = bbm_byte_read(handle, addr, data);
  return res;
}


x86 assembly (clang, -O0):
<bbm_com_byte_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xa(%rbp),%ax
mov    -0x18(%rbp),%rdx
movzwl %ax,%esi
call   1030 <bbm_byte_read@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bbm_com_byte_read>:
jmp    1030 <bbm_byte_read@plt>

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

LLVM IR (-O2):
define i32 @bbm_com_byte_read(i8* %0, i16 zeroext %1, i8* %2) {
%4 = tail call i32 @bbm_byte_read(i8* %0, i16 zeroext %1, i8* %2)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
uint64_t read_uint8(const char *buf) { return *(uint64_t *)buf; }


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

x86 assembly (clang, -O2):
<read_uint8>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @read_uint8(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int STepathlength();
int STheight();
int STipathlength();
int /*<<< orphan*/ STshowAll();
int /*<<< orphan*/ printf(char *, int);
void STinspect() {
  printf("STheight: %3d\n", STheight());
  printf("STipathlength: %3d\n", STipathlength());
  printf("STepathlength: %3d\n", STepathlength());
  STshowAll();
}


x86 assembly (clang, -O0):
<STinspect>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1070 <STheight@plt>
mov    %eax,%esi
lea    0xe9c(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <STipathlength@plt>
mov    %eax,%esi
lea    0xe96(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <STepathlength@plt>
mov    %eax,%esi
lea    0xe95(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <STshowAll@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<STinspect>:
push   %rax
xor    %eax,%eax
call   1070 <STheight@plt>
lea    0xea1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <STipathlength@plt>
lea    0xe9b(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1060 <STepathlength@plt>
lea    0xe9a(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <STshowAll@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"STheight: %3d\0A\00"
@.str.1 = [20 x i8] c"STipathlength: %3d\0A\00"
@.str.2 = [20 x i8] c"STepathlength: %3d\0A\00"
define void @STinspect() {
%1 = call i32 (...) @STheight()
%2 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 (...) @STipathlength()
%4 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = call i32 (...) @STepathlength()
%6 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %5)
%7 = call i32 (...) @STshowAll()
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"STheight: %3d\0A\00"
@.str.1 = [20 x i8] c"STipathlength: %3d\0A\00"
@.str.2 = [20 x i8] c"STepathlength: %3d\0A\00"
define void @STinspect() {
%1 = tail call i32 (...) @STheight()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @STipathlength()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = tail call i32 (...) @STepathlength()
%6 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %5)
%7 = tail call i32 (...) @STshowAll()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u_char;

/* Variables and functions */
scalar_t__ isspace(int /*<<< orphan*/);
int /*<<< orphan*/ strcpy(char *, char *);
char *ltrim(char *s) {
  char *p;
  for (p = s; isspace((u_char)*p); p++)
    ;
  if (p != s)
    strcpy(s, p);
  return (s);
}


x86 assembly (clang, -O0):
<ltrim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1040 <isspace@plt>
cmp    $0x0,%rax
je     1160 <ltrim+0x40>
jmp    114f <ltrim+0x2f>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1134 <ltrim+0x14>
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
je     117b <ltrim+0x5b>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ltrim>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %ebx,%ebx
nopl   0x0(%rax)
movsbl (%r14,%rbx,1),%edi
call   1040 <isspace@plt>
add    $0x1,%rbx
test   %rax,%rax
jne    1130 <ltrim+0x10>
cmp    $0x1,%rbx
je     1159 <ltrim+0x39>
lea    (%r14,%rbx,1),%rsi
add    $0xffffffffffffffff,%rsi
mov    %r14,%rdi
call   1030 <strcpy@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @ltrim(i8* returned %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %8, %2 ]
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = tail call i64 @isspace(i32 %5)
%7 = icmp eq i64 %6, 0
%8 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %7, label %9, label %2
9: ; preds = %2
%10 = icmp eq i8* %3, %0
br i1 %10, label %13, label %11
11: ; preds = %9
%12 = tail call i32 @strcpy(i8* %0, i8* %3)
br label %13
13: ; preds = %11, %9
ret i8* %0
}
int get_item_count(const char *string) {
  for (int i = 0, rotor_count = 0, next_rotor = 0;;)
    switch (string[i++]) {
    case '\n':
      if (next_rotor)
        rotor_count += next_rotor--;
      break;
    case '\0':
      return rotor_count + next_rotor;
    default:
      next_rotor = 1;
      break;
    }
}


x86 assembly (clang, -O0):
<get_item_count>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x18(%rbp)
test   %eax,%eax
je     1172 <get_item_count+0x72>
jmp    1141 <get_item_count+0x41>
mov    -0x18(%rbp),%eax
sub    $0xa,%eax
jne    117a <get_item_count+0x7a>
jmp    1152 <get_item_count+0x52>
cmpl   $0x0,-0x14(%rbp)
je     116d <get_item_count+0x6d>
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x14(%rbp)
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1181 <get_item_count+0x81>
mov    -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
pop    %rbp
ret
movl   $0x1,-0x14(%rbp)
jmp    111d <get_item_count+0x1d>

x86 assembly (clang, -O2):
<get_item_count>:
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %edx,%edx
nopw   0x0(%rax,%rax,1)
mov    %edx,%eax
movsbl (%rdi,%rcx,1),%esi
test   %esi,%esi
je     112d <get_item_count+0x2d>
add    $0x1,%rcx
mov    $0x1,%edx
cmp    $0xa,%esi
jne    1110 <get_item_count+0x10>
add    %eax,%r8d
jmp    1105 <get_item_count+0x5>
add    %r8d,%eax
ret

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

LLVM IR (-O2):
define i32 @get_item_count(i8* nocapture %0) {
br label %2
2: ; preds = %12, %1
%3 = phi i64 [ %8, %12 ], [ 0, %1 ]
%4 = phi i32 [ %13, %12 ], [ 0, %1 ]
br label %5
5: ; preds = %2, %5
%6 = phi i64 [ %8, %5 ], [ %3, %2 ]
%7 = phi i32 [ 1, %5 ], [ 0, %2 ]
%8 = add nuw i64 %6, 1
%9 = getelementptr inbounds i8, i8* %0, i64 %6
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
switch i32 %11, label %5 [
i32 10, label %12
i32 0, label %14
]
12: ; preds = %5
%13 = add nuw nsw i32 %4, %7
br label %2
14: ; preds = %5
%15 = add nuw nsw i32 %7, %4
ret i32 %15
}
/* Variables and functions */
int I2C_wait(int);
int /*<<< orphan*/ I2C_write_nonblock(int, int, unsigned char *, int);
int I2C_write(int mask, int i2c_addr, unsigned char *p, int len) {
  I2C_write_nonblock(mask, i2c_addr, p, len);
  return I2C_wait(mask);
}


x86 assembly (clang, -O0):
<I2C_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
call   1040 <I2C_write_nonblock@plt>
mov    -0x4(%rbp),%edi
call   1030 <I2C_wait@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2C_write>:
push   %rbx
mov    %edi,%ebx
call   1040 <I2C_write_nonblock@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <I2C_wait@plt>

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

LLVM IR (-O2):
define i32 @I2C_write(i32 %0, i32 %1, i8* %2, i32 %3) {
%5 = tail call i32 @I2C_write_nonblock(i32 %0, i32 %1, i8* %2, i32 %3)
%6 = tail call i32 @I2C_wait(i32 %0)
ret i32 %6
}
void neg_d(const double *source, double *target) { *target = -(*source); }


x86 assembly (clang, -O0):
<neg_d>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<neg_d>:
movsd  (%rdi),%xmm0
xorps  0xef5(%rip),%xmm0
movlps %xmm0,(%rsi)
ret

LLVM IR (-O0):
define void @neg_d(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = load double, double* %5
%7 = fneg double %6
%8 = load double*, double** %4
store double %7, double* %8
ret void
}

LLVM IR (-O2):
define void @neg_d(double* nocapture %0, double* nocapture writeonly %1) {
%3 = load double, double* %0
%4 = fneg double %3
store double %4, double* %1
ret void
}
void init_sub_rel_mask_color_span_funcs_c(void) {}


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

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

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

LLVM IR (-O2):
define void @init_sub_rel_mask_color_span_funcs_c() {
ret void
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int i;
  i = __VERIFIER_nondet_int();
  while (i > 5) {
    if (i < 10) {
      i = i - 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jle    114b <main+0x3b>
cmpl   $0xa,-0x8(%rbp)
jge    1146 <main+0x36>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1129 <main+0x19>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
cmp    $0x6,%eax
jl     112b <main+0x1b>
nopl   (%rax)
cmp    $0xa,%eax
sbb    $0x0,%eax
cmp    $0x5,%eax
ja     1120 <main+0x10>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = icmp sgt i32 %1, 5
br i1 %2, label %3, label %9
3: ; preds = %0, %3
%4 = phi i32 [ %7, %3 ], [ %1, %0 ]
%5 = icmp ult i32 %4, 10
%6 = sext i1 %5 to i32
%7 = add nsw i32 %4, %6
%8 = icmp ugt i32 %7, 5
br i1 %8, label %3, label %9
9: ; preds = %3, %0
ret i32 0
}
int test_imm_FEuint16_reg(unsigned short val) {
  return ((val) & (-0xFE << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_FEuint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -254
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void scaleBias2D(const float vec[3], float *texel) {
  for (int i = 0; i < 2; ++i) {
    texel[i] = vec[i];
    texel[i] *= 0.5;
    texel[i] += 0.5;
  }
}


x86 assembly (clang, -O0):
<scaleBias2D>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x2,-0x14(%rbp)
jge    1191 <scaleBias2D+0x91>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeb0(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe8a(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <scaleBias2D+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<scaleBias2D>:
movss  0xef8(%rip),%xmm0
movss  (%rdi),%xmm1
mulss  %xmm0,%xmm1
addss  %xmm0,%xmm1
movss  %xmm1,(%rsi)
movss  0x4(%rdi),%xmm1
mulss  %xmm0,%xmm1
addss  %xmm0,%xmm1
movss  %xmm1,0x4(%rsi)
ret

LLVM IR (-O0):
define void @scaleBias2D(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
%5 = alloca i32
store float* %0, float** %3
store float* %1, float** %4
store i32 0, i32* %5
br label %6
6: ; preds = %35, %2
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 2
br i1 %8, label %9, label %38
9: ; preds = %6
%10 = load float*, float** %3
%11 = load i32, i32* %5
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds float, float* %10, i64 %12
%14 = load float, float* %13
%15 = load float*, float** %4
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds float, float* %15, i64 %17
store float %14, float* %18
%19 = load float*, float** %4
%20 = load i32, i32* %5
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds float, float* %19, i64 %21
%23 = load float, float* %22
%24 = fpext float %23 to double
%25 = fmul double %24, 5.000000e-01
%26 = fptrunc double %25 to float
store float %26, float* %22
%27 = load float*, float** %4
%28 = load i32, i32* %5
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds float, float* %27, i64 %29
%31 = load float, float* %30
%32 = fpext float %31 to double
%33 = fadd double %32, 5.000000e-01
%34 = fptrunc double %33 to float
store float %34, float* %30
br label %35
35: ; preds = %9
%36 = load i32, i32* %5
%37 = add nsw i32 %36, 1
store i32 %37, i32* %5
br label %6
38: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @scaleBias2D(float* nocapture %0, float* nocapture writeonly %1) {
%3 = load float, float* %0
%4 = fmul float %3, 5.000000e-01
%5 = fadd float %4, 5.000000e-01
store float %5, float* %1
%6 = getelementptr inbounds float, float* %0, i64 1
%7 = load float, float* %6
%8 = getelementptr inbounds float, float* %1, i64 1
%9 = fmul float %7, 5.000000e-01
%10 = fadd float %9, 5.000000e-01
store float %10, float* %8
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ fork();
pid_t vfork(void) { return fork(); }


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

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

LLVM IR (-O0):
define i32 @vfork() {
%1 = call i32 (...) @fork()
ret i32 %1
}

LLVM IR (-O2):
define i32 @vfork() {
%1 = tail call i32 (...) @fork()
ret i32 %1
}
/* Variables and functions */
scalar_t__ strlen(char *);
char *strncpy(char *, char *, int);
void strncpy_effects(char *x, char *y) {
  char a = x[0];
  if (strncpy(x, y, 5) != x)
    (void)*(char *)0;
  if (strlen(x) != strlen(y))
    (void)*(char *)0;
  if (a != x[0])
    (void)*(char *)0;
}


x86 assembly (clang, -O0):
<strncpy_effects>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x5,%edx
call   1030 <strncpy@plt>
cmp    -0x8(%rbp),%rax
je     1155 <strncpy_effects+0x35>
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
je     117b <strncpy_effects+0x5b>
movsbl -0x11(%rbp),%eax
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     118e <strncpy_effects+0x6e>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncpy_effects>:
mov    $0x5,%edx
jmp    1030 <strncpy@plt>

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

LLVM IR (-O2):
define void @strncpy_effects(i8* %0, i8* %1) {
%3 = tail call i8* @strncpy(i8* %0, i8* %1, i32 5)
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
float *fvector(int size) { return (float *)malloc(sizeof(float) * size); }


x86 assembly (clang, -O0):
<fvector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fvector>:
shl    $0x2,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define float* @fvector(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = mul i64 4, %4
%6 = trunc i64 %5 to i32
%7 = call i64 @malloc(i32 %6)
%8 = inttoptr i64 %7 to float*
ret float* %8
}

LLVM IR (-O2):
define float* @fvector(i32 %0) {
%2 = shl i32 %0, 2
%3 = tail call i64 @malloc(i32 %2)
%4 = inttoptr i64 %3 to float*
ret float* %4
}
__attribute__((always_)) __attribute__((always_)) int
constant_test_bit(unsigned int nr, const volatile unsigned long *addr) {
  return ((1UL << (nr % 32)) & (((unsigned long *)addr)[nr / 32])) != 0;
}


x86 assembly (clang, -O0):
<constant_test_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1f,%eax
mov    %eax,%eax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%rax
mov    -0x10(%rbp),%rcx
mov    -0x4(%rbp),%edx
shr    $0x5,%edx
mov    %edx,%edx
and    (%rcx,%rdx,8),%rax
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<constant_test_bit>:
mov    %edi,%eax
shr    $0x5,%eax
mov    (%rsi,%rax,8),%ecx
xor    %eax,%eax
bt     %edi,%ecx
setb   %al
ret

LLVM IR (-O0):
define i32 @constant_test_bit(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
store i32 %0, i32* %3
store i64* %1, i64** %4
%5 = load i32, i32* %3
%6 = urem i32 %5, 32
%7 = zext i32 %6 to i64
%8 = shl i64 1, %7
%9 = load i64*, i64** %4
%10 = load i32, i32* %3
%11 = udiv i32 %10, 32
%12 = zext i32 %11 to i64
%13 = getelementptr inbounds i64, i64* %9, i64 %12
%14 = load i64, i64* %13
%15 = and i64 %8, %14
%16 = icmp ne i64 %15, 0
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @constant_test_bit(i32 %0, i64* nocapture %1) {
%3 = and i32 %0, 31
%4 = zext i32 %3 to i64
%5 = shl nuw nsw i64 1, %4
%6 = lshr i32 %0, 5
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds i64, i64* %1, i64 %7
%9 = load i64, i64* %8
%10 = and i64 %9, %5
%11 = icmp ne i64 %10, 0
%12 = zext i1 %11 to i32
ret i32 %12
}
void X509_email_free(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_email_free() {
ret void
}
/* Variables and functions */
int verify_bytes(char *buffer, size_t len, char expected) {
  for (size_t i = 0; i < len; ++i) {
    if (buffer[i] != expected) {
      return i + 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<verify_bytes>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %al,-0x19(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1165 <verify_bytes+0x65>
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x19(%rbp),%ecx
cmp    %ecx,%eax
je     114f <verify_bytes+0x4f>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %eax,-0x4(%rbp)
jmp    116c <verify_bytes+0x6c>
jmp    1154 <verify_bytes+0x54>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1119 <verify_bytes+0x19>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<verify_bytes>:
test   %rsi,%rsi
je     111e <verify_bytes+0x1e>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmp    %dl,(%rdi,%rax,1)
jne    1121 <verify_bytes+0x21>
add    $0x1,%rax
cmp    %rax,%rsi
jne    1110 <verify_bytes+0x10>
xor    %eax,%eax
ret
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @verify_bytes(i8* nocapture %0, i64 %1, i8 signext %2) {
%4 = icmp eq i64 %1, 0
br i1 %4, label %16, label %5
5: ; preds = %3, %13
%6 = phi i64 [ %14, %13 ], [ 0, %3 ]
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, %2
br i1 %9, label %13, label %10
10: ; preds = %5
%11 = trunc i64 %6 to i32
%12 = add i32 %11, 1
br label %16
13: ; preds = %5
%14 = add nuw i64 %6, 1
%15 = icmp eq i64 %14, %1
br i1 %15, label %16, label %5
16: ; preds = %13, %3, %10
%17 = phi i32 [ %12, %10 ], [ 0, %3 ], [ 0, %13 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
__attribute__((destructor)) void _intercept_fini(void) {
  if (4 <= 1)
    fprintf(stderr, "end of _intercept_fini()\n");
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @_intercept_fini, i8* null }]
define void @_intercept_fini() {
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @_intercept_fini, i8* null }]
define void @_intercept_fini() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ foo();
int main() {
#pragma omp parallel num_threads(2)
  {
#pragma omp barrier
#pragma omp single
    foo();
  }
  exit(0);
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @foo()
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foo()
%2 = tail call i32 @exit(i32 0)
unreachable
}
void __Hil__Static_Init_Func__(void) {}


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

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

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

LLVM IR (-O2):
define void @__Hil__Static_Init_Func__() {
ret void
}
unsigned char encode_heading(float h) {
  return ((unsigned char)(h * 255.0 / 360.0 + 0.5));
}


x86 assembly (clang, -O0):
<encode_heading>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee6(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xee2(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xede(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<encode_heading>:
cvtss2sd %xmm0,%xmm0
mulsd  0xef4(%rip),%xmm0
divsd  0xef4(%rip),%xmm0
addsd  0xef4(%rip),%xmm0
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define zeroext i8 @encode_heading(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fmul double %4, 2.550000e+02
%6 = fdiv double %5, 3.600000e+02
%7 = fadd double %6, 5.000000e-01
%8 = fptoui double %7 to i8
ret i8 %8
}

LLVM IR (-O2):
define zeroext i8 @encode_heading(float %0) {
%2 = fpext float %0 to double
%3 = fmul double %2, 2.550000e+02
%4 = fdiv double %3, 3.600000e+02
%5 = fadd double %4, 5.000000e-01
%6 = fptoui double %5 to i8
ret i8 %6
}
int c059(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @c059() {
ret i32 0
}