xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ test1();
int /*<<< orphan*/ test2();
int /*<<< orphan*/ test3(int *);
int /*<<< orphan*/ vfork();
void test(int *p) {
  test1();
  p++;
  test2();
  p++;
  vfork();
  test3(p);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <test1@plt>
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <test2@plt>
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
call   1060 <vfork@plt>
mov    -0x8(%rbp),%rdi
call   1030 <test3@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %eax,%eax
mov    %eax,%ebx
call   1040 <test1@plt>
mov    %ebx,%eax
call   1050 <test2@plt>
add    $0x8,%r14
call   1060 <vfork@plt>
mov    %r14,%rdi
call   1030 <test3@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @test(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 (...) @test1()
%4 = load i32*, i32** %2
%5 = getelementptr inbounds i32, i32* %4, i32 1
store i32* %5, i32** %2
%6 = call i32 (...) @test2()
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i32 1
store i32* %8, i32** %2
%9 = call i32 @vfork()
%10 = load i32*, i32** %2
%11 = call i32 @test3(i32* %10)
ret void
}

LLVM IR (-O2):
define void @test(i32* %0) {
%2 = call i32 (...) @test1()
%3 = call i32 (...) @test2()
%4 = getelementptr inbounds i32, i32* %0, i64 2
%5 = call i32 @vfork()
%6 = call i32 @test3(i32* %4)
ret void
}
void gdk_set_pointer_hooks() {}


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

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

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

LLVM IR (-O2):
define void @gdk_set_pointer_hooks() {
ret void
}
int fun862() { return 862; }


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

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

LLVM IR (-O0):
define i32 @fun862() {
ret i32 862
}

LLVM IR (-O2):
define i32 @fun862() {
ret i32 862
}
int ft_toupper(int c) {
  if (c >= 97 && c <= 122)
    c = c - 32;
  return (c);
}


x86 assembly (clang, -O0):
<ft_toupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x61,-0x4(%rbp)
jl     1124 <ft_toupper+0x24>
cmpl   $0x7a,-0x4(%rbp)
jg     1124 <ft_toupper+0x24>
mov    -0x4(%rbp),%eax
sub    $0x20,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_toupper>:
lea    -0x61(%rdi),%ecx
lea    -0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @ft_toupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 97
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 122
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* %2
%10 = sub nsw i32 %9, 32
store i32 %10, i32* %2
br label %11
11: ; preds = %8, %5, %1
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @ft_toupper(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Type definitions */
typedef scalar_t__ ptrdiff_t;

/* Variables and functions */
void *ptrdiff_to_objp(ptrdiff_t ptr_rep) {
  unsigned char *ptr;
  ptrdiff_t distance;
  distance = (ptrdiff_t)ptr_rep;
  ptr = (unsigned char *)(((unsigned char *)NULL) + ((ptrdiff_t)distance));
  return ((void *)ptr);
}


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

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

LLVM IR (-O0):
define i8* @ptrdiff_to_objp(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
%4 = alloca i64
store i64 %0, i64* %2
%5 = load i64, i64* %2
store i64 %5, i64* %4
%6 = load i64, i64* %4
%7 = inttoptr i64 %6 to i8*
store i8* %7, i8** %3
%8 = load i8*, i8** %3
ret i8* %8
}

LLVM IR (-O2):
define i8* @ptrdiff_to_objp(i64 %0) {
%2 = inttoptr i64 %0 to i8*
ret i8* %2
}
/* Variables and functions */
scalar_t__ get_tlv_item(int, unsigned char *, unsigned char *);
int /*<<< orphan*/ printf(char *);
int get_sn(unsigned char *sn, unsigned char *len) {
  if (get_tlv_item(0x42, len, sn) < 0) {
    printf("Get serial number failed.\n");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<get_sn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x42,%edi
call   1030 <get_tlv_item@plt>
cmp    $0x0,%rax
jge    1164 <get_sn+0x44>
lea    0xead(%rip),%rdi
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    116b <get_sn+0x4b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_sn>:
push   %rax
mov    %rdi,%rdx
mov    $0x42,%edi
call   1040 <get_tlv_item@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
js     113a <get_sn+0x1a>
pop    %rcx
ret
lea    0xebf(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Get serial number failed.\0A\00"
define i32 @get_sn(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %5
%7 = load i8*, i8** %4
%8 = call i64 @get_tlv_item(i32 66, i8* %6, i8* %7)
%9 = icmp slt i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %13
12: ; preds = %2
store i32 0, i32* %3
br label %13
13: ; preds = %12, %10
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
@str = [26 x i8] c"Get serial number failed.\00"
define i32 @get_sn(i8* %0, i8* %1) {
%3 = tail call i64 @get_tlv_item(i32 66, i8* %1, i8* %0)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ -1, %5 ], [ 0, %2 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_memchunk_will_need() {
  printf("NOT IMPLEMENTED:"
         "pa_memchunk_will_need"
         "\n");
}


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

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

LLVM IR (-O2):
@str = [38 x i8] c"NOT IMPLEMENTED:pa_memchunk_will_need\00"
define i32 @pa_memchunk_will_need() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
void load_cr3(unsigned long cr3) { asm("mov %0, %%cr3" : : "r"(cr3)); }


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

x86 assembly (clang, -O2):
<load_cr3>:
mov    %rdi,%cr3
ret

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

LLVM IR (-O2):
define void @load_cr3(i64 %0) {
tail call void asm sideeffect "mov $0, %cr3", "r,~{dirflag},~{fpsr},~{flags}"(i64 %0)
ret void
}
/* Variables and functions */
double fabs(double const);
double dDistance(const double value1, const double value2) {
  return fabs(value1 - value2);
}


x86 assembly (clang, -O0):
<dDistance>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movaps 0xee1(%rip),%xmm1
pand   %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dDistance>:
subsd  %xmm1,%xmm0
andpd  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define double @dDistance(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* %4
%7 = fsub double %5, %6
%8 = call double @llvm.fabs.f64(double %7)
ret double %8
}

LLVM IR (-O2):
define double @dDistance(double %0, double %1) {
%3 = fsub double %0, %1
%4 = tail call double @llvm.fabs.f64(double %3)
ret double %4
}
int main(void) { return (10 < 20) + (10 < 20) + (20 < 10); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 2
}
/* Variables and functions */
int link(char *, char *);
int /*<<< orphan*/ printf(char *);
int external_build_lib_call(void) {
  printf("hello from external lib\n");
  if (1 != link("", "")) {
    printf("expecting library stubs' link to return 1");
    return -1;
  }
  return 314;
}


x86 assembly (clang, -O0):
<external_build_lib_call>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    0xedd(%rip),%rsi
mov    %rsi,%rdi
call   1040 <link@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
je     116a <external_build_lib_call+0x4a>
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1171 <external_build_lib_call+0x51>
movl   $0x13a,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<external_build_lib_call>:
push   %rax
lea    0xef2(%rip),%rdi
call   1030 <puts@plt>
lea    0xee5(%rip),%rdi
mov    %rdi,%rsi
call   1050 <link@plt>
mov    %eax,%ecx
mov    $0x13a,%eax
cmp    $0x1,%ecx
je     1169 <external_build_lib_call+0x39>
lea    0xea1(%rip),%rdi
call   1040 <printf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"hello from external lib\0A\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [42 x i8] c"expecting library stubs' link to return 1\00"
define i32 @external_build_lib_call() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @link(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%4 = icmp ne i32 1, %3
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0))
store i32 -1, i32* %1
br label %8
7: ; preds = %0
store i32 314, i32* %1
br label %8
8: ; preds = %7, %5
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [42 x i8] c"expecting library stubs' link to return 1\00"
@str = [24 x i8] c"hello from external lib\00"
define i32 @external_build_lib_call() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @link(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%3 = icmp eq i32 %2, 1
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0))
br label %6
6: ; preds = %0, %4
%7 = phi i32 [ -1, %4 ], [ 314, %0 ]
ret i32 %7
}
void Strcpy2(char *t, char *s) {
  while (*s++ = *t++)
    ;
}


x86 assembly (clang, -O0):
<Strcpy2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     113b <Strcpy2+0x3b>
jmp    110c <Strcpy2+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Strcpy2>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi,%rax,1),%ecx
mov    %cl,(%rsi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <Strcpy2+0x10>
ret

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

LLVM IR (-O2):
define void @Strcpy2(i8* nocapture %0, i8* nocapture writeonly %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %6, %3 ]
%5 = phi i8* [ %1, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret void
}
int tosMemory_isNull(int base) { return base == 0; }


x86 assembly (clang, -O0):
<tosMemory_isNull>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tosMemory_isNull>:
xor    %eax,%eax
test   %edi,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @tosMemory_isNull(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void *malloc(scalar_t__);
void *zcm_malloc(uint32_t sz) {
  if (sz)
    return malloc(sz);
  return NULL;
}


x86 assembly (clang, -O0):
<zcm_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1139 <zcm_malloc+0x29>
mov    -0x10(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
jmp    1141 <zcm_malloc+0x31>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define noalias i8* @zcm_malloc(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i8* @malloc(i64 %0)
br label %5
5: ; preds = %1, %3
%6 = phi i8* [ %4, %3 ], [ null, %1 ]
ret i8* %6
}
int __signbitf(float x) {
  unsigned short sw;
  __asm__("fxam; fstsw %%ax;" : "=a"(sw) : "t"(x));
  return (sw & 0x0200) != 0;
}


x86 assembly (clang, -O0):
<__signbitf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
flds   -0xc(%rbp)
fxam
fstsw  %ax
fstp   %st(0)
mov    %ax,-0x6(%rbp)
movzwl -0x6(%rbp),%eax
and    $0x200,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__signbitf>:
movss  %xmm0,-0x4(%rsp)
flds   -0x4(%rsp)
fxam
fstsw  %ax
fstp   %st(0)
shr    $0x9,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @__signbitf(float %0) {
%2 = alloca float
%3 = alloca i16
store float %0, float* %2
%4 = load float, float* %2
%5 = call i16 asm "fxam; fstsw %ax;", "={ax},{st},~{dirflag},~{fpsr},~{flags}"(float %4)
store i16 %5, i16* %3
%6 = load i16, i16* %3
%7 = zext i16 %6 to i32
%8 = and i32 %7, 512
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @__signbitf(float %0) {
%2 = tail call i16 asm "fxam; fstsw %ax;", "={ax},{st},~{dirflag},~{fpsr},~{flags}"(float %0)
%3 = lshr i16 %2, 9
%4 = and i16 %3, 1
%5 = zext i16 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ LCD_SHOW_STRING(int /*<<< orphan*/, int /*<<< orphan*/,
                                   char *);
int /*<<< orphan*/ delay_reduce(int);
void nrf24l01p_irq_tx_ds_handle() {
  LCD_SHOW_STRING(0, 0, "***TRANSLATION**");
  delay_reduce(60000);
  delay_reduce(60000);
  delay_reduce(60000);
  delay_reduce(60000);
  delay_reduce(60000);
  LCD_SHOW_STRING(0, 0, "**COLOR--VALUE**");
}


x86 assembly (clang, -O0):
<nrf24l01p_irq_tx_ds_handle>:
push   %rbp
mov    %rsp,%rbp
xor    %esi,%esi
lea    0xed3(%rip),%rdx
mov    %esi,%edi
call   1030 <LCD_SHOW_STRING@plt>
mov    $0xea60,%edi
call   1040 <delay_reduce@plt>
mov    $0xea60,%edi
call   1040 <delay_reduce@plt>
mov    $0xea60,%edi
call   1040 <delay_reduce@plt>
mov    $0xea60,%edi
call   1040 <delay_reduce@plt>
mov    $0xea60,%edi
call   1040 <delay_reduce@plt>
xor    %esi,%esi
lea    0xea2(%rip),%rdx
mov    %esi,%edi
call   1030 <LCD_SHOW_STRING@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<nrf24l01p_irq_tx_ds_handle>:
push   %rax
lea    0xed8(%rip),%rdx
xor    %edi,%edi
xor    %esi,%esi
call   1030 <LCD_SHOW_STRING@plt>
mov    $0xea60,%edi
call   1040 <delay_reduce@plt>
mov    $0xea60,%edi
call   1040 <delay_reduce@plt>
mov    $0xea60,%edi
call   1040 <delay_reduce@plt>
mov    $0xea60,%edi
call   1040 <delay_reduce@plt>
mov    $0xea60,%edi
call   1040 <delay_reduce@plt>
lea    0xea7(%rip),%rdx
xor    %edi,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <LCD_SHOW_STRING@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"***TRANSLATION**\00"
@.str.1 = [17 x i8] c"**COLOR--VALUE**\00"
define void @nrf24l01p_irq_tx_ds_handle() {
%1 = call i32 @LCD_SHOW_STRING(i32 0, i32 0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @delay_reduce(i32 60000)
%3 = call i32 @delay_reduce(i32 60000)
%4 = call i32 @delay_reduce(i32 60000)
%5 = call i32 @delay_reduce(i32 60000)
%6 = call i32 @delay_reduce(i32 60000)
%7 = call i32 @LCD_SHOW_STRING(i32 0, i32 0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"***TRANSLATION**\00"
@.str.1 = [17 x i8] c"**COLOR--VALUE**\00"
define void @nrf24l01p_irq_tx_ds_handle() {
%1 = tail call i32 @LCD_SHOW_STRING(i32 0, i32 0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @delay_reduce(i32 60000)
%3 = tail call i32 @delay_reduce(i32 60000)
%4 = tail call i32 @delay_reduce(i32 60000)
%5 = tail call i32 @delay_reduce(i32 60000)
%6 = tail call i32 @delay_reduce(i32 60000)
%7 = tail call i32 @LCD_SHOW_STRING(i32 0, i32 0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char const *, size_t);
void strncpyt(char *dst, const char *src, size_t len) {
  strncpy(dst, src, len);
  dst[len - 1] = '\0';
}


x86 assembly (clang, -O0):
<strncpyt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strncpy@plt>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncpyt>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
call   1030 <strncpy@plt>
movb   $0x0,-0x1(%r14,%rbx,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @strncpyt(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @strncpy(i8* %7, i8* %8, i64 %9)
%11 = load i8*, i8** %4
%12 = load i64, i64* %6
%13 = sub i64 %12, 1
%14 = getelementptr inbounds i8, i8* %11, i64 %13
store i8 0, i8* %14
ret void
}

LLVM IR (-O2):
define void @strncpyt(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @strncpy(i8* %0, i8* %1, i64 %2)
%5 = add i64 %2, -1
%6 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 0, i8* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int count = 0, sum = 0, n;
  scanf("%d", &n);
  while (count++ < n)
    sum = sum + count;
  printf("sum = %d\n", sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xebc(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
cmp    -0x10(%rbp),%eax
jge    116f <main+0x4f>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    114d <main+0x2d>
mov    -0xc(%rbp),%esi
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
xor    %ecx,%ecx
test   %eax,%eax
cmovle %ecx,%eax
lea    -0x1(%rax),%esi
imul   %rax,%rsi
shr    %rsi
add    %eax,%esi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [10 x i8] c"sum = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @llvm.smax.i32(i32 %4, i32 0)
%6 = zext i32 %5 to i33
%7 = add nsw i32 %5, -1
%8 = zext i32 %7 to i33
%9 = mul i33 %6, %8
%10 = lshr i33 %9, 1
%11 = trunc i33 %10 to i32
%12 = add i32 %5, %11
%13 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %12)
ret i32 0
}
/* Variables and functions */
int pipe(int *);
int __gnat_create_signalling_fds(int *fds) { return pipe(fds); }


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

x86 assembly (clang, -O2):
<__gnat_create_signalling_fds>:
jmp    1030 <pipe@plt>

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

LLVM IR (-O2):
define i32 @__gnat_create_signalling_fds(i32* %0) {
%2 = tail call i32 @pipe(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ log_unix_error(char *);
int open_listenfd(int);
int Open_listenfd(int port) {
  int rc;
  if ((rc = open_listenfd(port)) < 0)
    log_unix_error("Open_listenfd error");
  return rc;
}


x86 assembly (clang, -O0):
<Open_listenfd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <open_listenfd@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jge    114b <Open_listenfd+0x2b>
lea    0xeba(%rip),%rdi
call   1030 <log_unix_error@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Open_listenfd>:
push   %rbx
call   1040 <open_listenfd@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    1138 <Open_listenfd+0x18>
lea    0xecd(%rip),%rdi
call   1030 <log_unix_error@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Open_listenfd error\00"
define i32 @Open_listenfd(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @open_listenfd(i32 %4)
store i32 %5, i32* %3
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @log_unix_error(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
@.str = [20 x i8] c"Open_listenfd error\00"
define i32 @Open_listenfd(i32 %0) {
%2 = tail call i32 @open_listenfd(i32 %0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @log_unix_error(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ MixColor101(unsigned long, unsigned long, unsigned long,
                               double);
void mixcolor(unsigned long rgb1, unsigned long rgb2, unsigned long rgb3,
              double m) {
  MixColor101(rgb1, rgb2, rgb3, m);
}


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

x86 assembly (clang, -O2):
<mixcolor>:
jmp    1030 <MixColor101@plt>

LLVM IR (-O0):
define void @mixcolor(i64 %0, i64 %1, i64 %2, double %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca double
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store double %3, double* %8
%9 = load i64, i64* %5
%10 = load i64, i64* %6
%11 = load i64, i64* %7
%12 = load double, double* %8
%13 = call i32 @MixColor101(i64 %9, i64 %10, i64 %11, double %12)
ret void
}

LLVM IR (-O2):
define void @mixcolor(i64 %0, i64 %1, i64 %2, double %3) {
%5 = tail call i32 @MixColor101(i64 %0, i64 %1, i64 %2, double %3)
ret void
}
int msm_jtag_save_register(struct notifier_block *nb) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.notifier_block = type opaque
define i32 @msm_jtag_save_register(%struct.notifier_block* nocapture readnone %0) {
ret i32 0
}
void foo057() {}


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

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

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

LLVM IR (-O2):
define void @foo057() {
ret void
}
/* Variables and functions */
int LOG_DAEMON;
int LOG_LOCAL3;
int /*<<< orphan*/ openlog(char *, int /*<<< orphan*/, int);
void initlog(void) { openlog("lrsd", 0, LOG_DAEMON | LOG_LOCAL3); }


x86 assembly (clang, -O0):
<initlog>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edx
mov    0x2eb4(%rip),%rax
or     (%rax),%edx
lea    0xed3(%rip),%rdi
xor    %esi,%esi
call   1030 <openlog@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initlog>:
mov    0x2ed1(%rip),%rax
mov    0x2eba(%rip),%rcx
mov    (%rcx),%edx
or     (%rax),%edx
lea    0xed7(%rip),%rdi
xor    %esi,%esi
jmp    1030 <openlog@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"lrsd\00"
@LOG_DAEMON = global i32 0
@LOG_LOCAL3 = global i32 0
define void @initlog() {
%1 = load i32, i32* @LOG_DAEMON
%2 = load i32, i32* @LOG_LOCAL3
%3 = or i32 %1, %2
%4 = call i32 @openlog(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 0, i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"lrsd\00"
@LOG_DAEMON = global i32 0
@LOG_LOCAL3 = global i32 0
define void @initlog() {
%1 = load i32, i32* @LOG_DAEMON
%2 = load i32, i32* @LOG_LOCAL3
%3 = or i32 %2, %1
%4 = tail call i32 @openlog(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 0, i32 %3)
ret void
}
void free(void *where) {}


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

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

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

LLVM IR (-O2):
define void @free(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
scalar_t__ hex_convert(int);
uint8_t hex2uint8t(uint8_t hex[2]) {
  uint8_t v = 0;
  v |= ((uint8_t)hex_convert(hex[1]) << 0);
  v |= ((uint8_t)hex_convert(hex[0]) << 4);
  return (v);
}


x86 assembly (clang, -O0):
<hex2uint8t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%edi
call   1030 <hex_convert@plt>
shl    $0x0,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <hex_convert@plt>
shl    $0x4,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex2uint8t>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x4(%rdi),%edi
call   1030 <hex_convert@plt>
mov    %rax,%r14
mov    (%rbx),%edi
call   1030 <hex_convert@plt>
shl    $0x4,%eax
or     %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @hex2uint8t(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
%4 = load i32*, i32** %2
%5 = getelementptr inbounds i32, i32* %4, i64 1
%6 = load i32, i32* %5
%7 = call i64 @hex_convert(i32 %6)
%8 = trunc i64 %7 to i32
%9 = shl i32 %8, 0
%10 = load i32, i32* %3
%11 = or i32 %10, %9
store i32 %11, i32* %3
%12 = load i32*, i32** %2
%13 = getelementptr inbounds i32, i32* %12, i64 0
%14 = load i32, i32* %13
%15 = call i64 @hex_convert(i32 %14)
%16 = trunc i64 %15 to i32
%17 = shl i32 %16, 4
%18 = load i32, i32* %3
%19 = or i32 %18, %17
store i32 %19, i32* %3
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @hex2uint8t(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load i32, i32* %2
%4 = tail call i64 @hex_convert(i32 %3)
%5 = trunc i64 %4 to i32
%6 = load i32, i32* %0
%7 = tail call i64 @hex_convert(i32 %6)
%8 = trunc i64 %7 to i32
%9 = shl i32 %8, 4
%10 = or i32 %9, %5
ret i32 %10
}
void swap(void *v[], int i, int j) {
  void *t;
  t = v[i];
  v[i] = v[j];
  v[j] = t;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x18(%rbp),%rdx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,8),%rcx
movslq %edx,%rdx
mov    (%rdi,%rdx,8),%rsi
mov    %rsi,(%rdi,%rax,8)
mov    %rcx,(%rdi,%rdx,8)
ret

LLVM IR (-O0):
define void @swap(i8** %0, i32 %1, i32 %2) {
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
store i8** %0, i8*** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i8**, i8*** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8*, i8** %8, i64 %10
%12 = load i8*, i8** %11
store i8* %12, i8** %7
%13 = load i8**, i8*** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8*, i8** %13, i64 %15
%17 = load i8*, i8** %16
%18 = load i8**, i8*** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8*, i8** %18, i64 %20
store i8* %17, i8** %21
%22 = load i8*, i8** %7
%23 = load i8**, i8*** %4
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8*, i8** %23, i64 %25
store i8* %22, i8** %26
ret void
}

LLVM IR (-O2):
define void @swap(i8** nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i8*, i8** %0, i64 %4
%6 = load i8*, i8** %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = load i8*, i8** %8
store i8* %9, i8** %5
store i8* %6, i8** %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FixedWingPathFollowerStatusHandle();
int /*<<< orphan*/ UAVObjLogging(int /*<<< orphan*/);
void FixedWingPathFollowerStatusLogging() {
  UAVObjLogging(FixedWingPathFollowerStatusHandle());
}


x86 assembly (clang, -O0):
<FixedWingPathFollowerStatusLogging>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <FixedWingPathFollowerStatusHandle@plt>
mov    %eax,%edi
call   1030 <UAVObjLogging@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<FixedWingPathFollowerStatusLogging>:
push   %rax
xor    %eax,%eax
call   1040 <FixedWingPathFollowerStatusHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <UAVObjLogging@plt>

LLVM IR (-O0):
define void @FixedWingPathFollowerStatusLogging() {
%1 = call i32 (...) @FixedWingPathFollowerStatusHandle()
%2 = call i32 @UAVObjLogging(i32 %1)
ret void
}

LLVM IR (-O2):
define void @FixedWingPathFollowerStatusLogging() {
%1 = tail call i32 (...) @FixedWingPathFollowerStatusHandle()
%2 = tail call i32 @UAVObjLogging(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ OS_TaskRegister();
void task_8(void) {
  OS_TaskRegister();
  while (1)
    ;
  return;
  return;
}


x86 assembly (clang, -O0):
<task_8>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <OS_TaskRegister@plt>
jmp    111b <task_8+0xb>

x86 assembly (clang, -O2):
<task_8>:
push   %rax
xor    %eax,%eax
call   1030 <OS_TaskRegister@plt>
nopl   0x0(%rax,%rax,1)
jmp    1120 <task_8+0x10>

LLVM IR (-O0):
define void @task_8() {
%1 = call i32 (...) @OS_TaskRegister()
br label %2
2: ; preds = %0, %2
br label %2
}

LLVM IR (-O2):
define void @task_8() {
%1 = tail call i32 (...) @OS_TaskRegister()
br label %2
2: ; preds = %0, %2
br label %2
}
int __test() {
  int x = 3;
  int arr[10] = {1, 2, 3, 4, 5, x};
  return arr[3];
}


x86 assembly (clang, -O0):
<__test>:
push   %rbp
mov    %rsp,%rbp
movl   $0x3,-0x4(%rbp)
lea    -0x30(%rbp),%rcx
movl   $0x1,-0x30(%rbp)
mov    %rcx,%rax
add    $0x4,%rax
movl   $0x2,-0x2c(%rbp)
add    $0x4,%rax
movl   $0x3,-0x28(%rbp)
add    $0x4,%rax
movl   $0x4,-0x24(%rbp)
add    $0x4,%rax
movl   $0x5,-0x20(%rbp)
add    $0x4,%rax
mov    -0x4(%rbp),%edx
mov    %edx,-0x1c(%rbp)
add    $0x4,%rax
add    $0x28,%rcx
mov    %rcx,-0x40(%rbp)
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    -0x40(%rbp),%rcx
movl   $0x0,(%rax)
add    $0x4,%rax
mov    %rax,-0x48(%rbp)
cmp    %rcx,%rax
mov    %rax,-0x38(%rbp)
jne    115f <__test+0x5f>
mov    -0x24(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @__test() {
ret i32 4
}
/* Variables and functions */
int MAXPATHLEN;
size_t atoi(char *);
int /*<<< orphan*/ getcwd(char *, size_t);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  char b[MAXPATHLEN];
  size_t len = atoi(argv[1]);
  (void)getcwd(b, len);
  (void)printf("%s\n", b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e9b(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x30(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    -0x30(%rbp),%rdi
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rsi
call   1040 <getcwd@plt>
mov    -0x30(%rbp),%rsi
lea    0xe65(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
push   %rax
mov    0x2eab(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rbx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    0x8(%rsi),%rdi
call   1050 <atoi@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1040 <getcwd@plt>
lea    0xe95(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
lea    -0x8(%rbp),%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@MAXPATHLEN = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i32, i32* @MAXPATHLEN
%10 = zext i32 %9 to i64
%11 = call i8* @llvm.stacksave()
store i8* %11, i8** %6
%12 = alloca i8, i64 %10
store i64 %10, i64* %7
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = call i64 @atoi(i8* %15)
store i64 %16, i64* %8
%17 = load i64, i64* %8
%18 = call i32 @getcwd(i8* %12, i64 %17)
%19 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %12)
store i32 0, i32* %3
%20 = load i8*, i8** %6
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
@MAXPATHLEN = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i32, i32* @MAXPATHLEN
%4 = zext i32 %3 to i64
%5 = alloca i8, i64 %4
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = tail call i64 @atoi(i8* %7)
%9 = call i32 @getcwd(i8* %5, i64 %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 0
}
int getLabelReg(int name) { return ++name; }


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

x86 assembly (clang, -O2):
<getLabelReg>:
lea    0x1(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @getLabelReg(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  if (argc != 2) {
    return 1;
  }
  printf("hello container world [%s]\n", argv[1]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     113c <main+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    1157 <main+0x47>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x1,%eax
cmp    $0x2,%edi
jne    1131 <main+0x21>
push   %rax
mov    0x8(%rsi),%rsi
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
@.str = [28 x i8] c"hello container world [%s]\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %6)
br label %8
8: ; preds = %2, %4
%9 = phi i32 [ 0, %4 ], [ 1, %2 ]
ret i32 %9
}
const char *jacFun_name_in(int i) {
  switch (i) {
  case 0:
    return "i0";
  case 1:
    return "i1";
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<jacFun_name_in>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     112b <jacFun_name_in+0x2b>
jmp    111a <jacFun_name_in+0x1a>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     113b <jacFun_name_in+0x3b>
jmp    114b <jacFun_name_in+0x4b>
lea    0xece(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <jacFun_name_in+0x53>
lea    0xec1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <jacFun_name_in+0x53>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<jacFun_name_in>:
xor    %ecx,%ecx
cmp    $0x1,%edi
lea    0xef7(%rip),%rax
cmove  %rax,%rcx
test   %edi,%edi
lea    0xee7(%rip),%rax
cmovne %rcx,%rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"i0\00"
@.str.1 = [3 x i8] c"i1\00"
define i8* @jacFun_name_in(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 0, label %5
i32 1, label %6
]
5: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %2
br label %8
6: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %8
7: ; preds = %1
store i8* null, i8** %2
br label %8
8: ; preds = %7, %6, %5
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [3 x i8] c"i0\00"
@.str.1 = [3 x i8] c"i1\00"
define i8* @jacFun_name_in(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* null
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3
ret i8* %5
}
adr0imm1_set(r0, r1, x0, x1, p0, p1) float r0, r1;
float *p0, *p1;
{ (*((float *)10000000)) = 33; }


x86 assembly (clang, -O0):
<adr0imm1_set>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm1,-0x30(%rbp)
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
cvtsd2ss %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm0
movss  %xmm1,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    %edi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    $0x989680,%eax
movss  0xec2(%rip),%xmm0
movss  %xmm0,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adr0imm1_set>:
movl   $0x42040000,0x989680
ret

LLVM IR (-O0):
define i32 @adr0imm1_set(double %0, double %1, i32 %2, i32 %3, float* %4, float* %5) {
%7 = alloca i32
%8 = alloca float
%9 = alloca float
%10 = alloca i32
%11 = alloca i32
%12 = alloca float*
%13 = alloca float*
%14 = fptrunc double %0 to float
%15 = fptrunc double %1 to float
store float %14, float* %8
store float %15, float* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store float* %4, float** %12
store float* %5, float** %13
store float 3.300000e+01, float* inttoptr (i64 10000000 to float*)
%16 = load i32, i32* %7
ret i32 %16
}

LLVM IR (-O2):
define i32 @adr0imm1_set(double %0, double %1, i32 %2, i32 %3, float* nocapture readnone %4, float* nocapture readnone %5) {
store float 3.300000e+01, float* inttoptr (i64 10000000 to float*)
ret i32 undef
}
int gg_resolve_pthread(int *fd, void **resolver, const char *hostname) {
  return -1;
}


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

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

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

LLVM IR (-O2):
define i32 @gg_resolve_pthread(i32* nocapture readnone %0, i8** nocapture readnone %1, i8* nocapture readnone %2) {
ret i32 -1
}
/* Type definitions */
struct rb_node {
  int dummy;
};

/* Variables and functions */
struct rb_node *rb_parent(struct rb_node *);
struct rb_node *rb_grandparent(struct rb_node *node) {
  struct rb_node *parent = rb_parent(node);
  if (parent == NULL)
    return NULL;
  return rb_parent(parent);
}


x86 assembly (clang, -O0):
<rb_grandparent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <rb_parent@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1141 <rb_grandparent+0x31>
movq   $0x0,-0x8(%rbp)
jmp    114e <rb_grandparent+0x3e>
mov    -0x18(%rbp),%rdi
call   1030 <rb_parent@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rb_grandparent>:
push   %rax
call   1030 <rb_parent@plt>
test   %rax,%rax
je     1124 <rb_grandparent+0x14>
mov    %rax,%rdi
pop    %rax
jmp    1030 <rb_parent@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.rb_node = type { i32 }
define %struct.rb_node* @rb_grandparent(%struct.rb_node* %0) {
%2 = alloca %struct.rb_node*
%3 = alloca %struct.rb_node*
%4 = alloca %struct.rb_node*
store %struct.rb_node* %0, %struct.rb_node** %3
%5 = load %struct.rb_node*, %struct.rb_node** %3
%6 = call %struct.rb_node* @rb_parent(%struct.rb_node* %5)
store %struct.rb_node* %6, %struct.rb_node** %4
%7 = load %struct.rb_node*, %struct.rb_node** %4
%8 = icmp eq %struct.rb_node* %7, null
br i1 %8, label %9, label %10
9: ; preds = %1
store %struct.rb_node* null, %struct.rb_node** %2
br label %13
10: ; preds = %1
%11 = load %struct.rb_node*, %struct.rb_node** %4
%12 = call %struct.rb_node* @rb_parent(%struct.rb_node* %11)
store %struct.rb_node* %12, %struct.rb_node** %2
br label %13
13: ; preds = %10, %9
%14 = load %struct.rb_node*, %struct.rb_node** %2
ret %struct.rb_node* %14
}

LLVM IR (-O2):
%struct.rb_node = type { i32 }
define %struct.rb_node* @rb_grandparent(%struct.rb_node* %0) {
%2 = tail call %struct.rb_node* @rb_parent(%struct.rb_node* %0)
%3 = icmp eq %struct.rb_node* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call %struct.rb_node* @rb_parent(%struct.rb_node* %2)
br label %6
6: ; preds = %1, %4
%7 = phi %struct.rb_node* [ %5, %4 ], [ null, %1 ]
ret %struct.rb_node* %7
}