xunge/DecIR huggingface dataset:
int compare_function(const void *a, const void *b) {
  double *x = (double *)a;
  double *y = (double *)b;
  if (*x < *y)
    return -1;
  else if (*x > *y)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<compare_function>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    1142 <compare_function+0x42>
movl   $0xffffffff,-0x4(%rbp)
jmp    1170 <compare_function+0x70>
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x28(%rbp),%rax
ucomisd (%rax),%xmm0
jbe    1164 <compare_function+0x64>
movl   $0x1,-0x4(%rbp)
jmp    1170 <compare_function+0x70>
jmp    1169 <compare_function+0x69>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_function>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
seta   %cl
ucomisd %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @compare_function(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca double*
%7 = alloca double*
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to double*
store double* %9, double** %6
%10 = load i8*, i8** %5
%11 = bitcast i8* %10 to double*
store double* %11, double** %7
%12 = load double*, double** %6
%13 = load double, double* %12
%14 = load double*, double** %7
%15 = load double, double* %14
%16 = fcmp olt double %13, %15
br i1 %16, label %17, label %18
17: ; preds = %2
store i32 -1, i32* %3
br label %27
18: ; preds = %2
%19 = load double*, double** %6
%20 = load double, double* %19
%21 = load double*, double** %7
%22 = load double, double* %21
%23 = fcmp ogt double %20, %22
br i1 %23, label %24, label %25
24: ; preds = %18
store i32 1, i32* %3
br label %27
25: ; preds = %18
br label %26
26: ; preds = %25
store i32 0, i32* %3
br label %27
27: ; preds = %26, %24, %17
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
define i32 @compare_function(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = bitcast i8* %1 to double*
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp olt double %5, %6
%8 = fcmp ogt double %5, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
int test_imm_33int8_reg(signed char val) {
  return ((val) & (0x33 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_33int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0x33,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_33int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 51
%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_33int8_reg(i8 signext %0) {
%2 = and i8 %0, 51
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int DynamicLibrary2Function(char);
int main() { return DynamicLibrary2Function('m'); }


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

x86 assembly (clang, -O2):
<main>:
mov    $0x6d,%edi
jmp    1030 <DynamicLibrary2Function@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @DynamicLibrary2Function(i8 signext 109)
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm_loadl_pi(int /*<<< orphan*/, int /*<<< orphan*/ *);
__m128 test_mm_loadl_pi(__m128 x, __m64 *y) { return _mm_loadl_pi(x, y); }


x86 assembly (clang, -O0):
<test_mm_loadl_pi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <_mm_loadl_pi@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_mm_loadl_pi>:
jmp    1030 <_mm_loadl_pi@plt>

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

LLVM IR (-O2):
define i32 @test_mm_loadl_pi(i32 %0, i32* %1) {
%3 = tail call i32 @_mm_loadl_pi(i32 %0, i32* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printCpuVendorID();
int /*<<< orphan*/ printf(char *, ...);
double sphereVolume(double);
int main() {
  printf("Austin Parrish\n");
  printf("%f\n", sphereVolume(4.5));
  printCpuVendorID();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movsd  0xeab(%rip),%xmm0
call   1030 <sphereVolume@plt>
lea    0xeb7(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <printCpuVendorID@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec4(%rip),%rdi
call   1040 <puts@plt>
movsd  0xeab(%rip),%xmm0
call   1030 <sphereVolume@plt>
lea    0xea7(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
xor    %eax,%eax
call   1060 <printCpuVendorID@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Austin Parrish\0A\00"
@.str.1 = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = call double @sphereVolume(double 4.500000e+00)
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double %3)
%5 = call i32 (...) @printCpuVendorID()
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%f\0A\00"
@str = [15 x i8] c"Austin Parrish\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%2 = tail call double @sphereVolume(double 4.500000e+00)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double %2)
%4 = tail call i32 (...) @printCpuVendorID()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ mask;
typedef int /*<<< orphan*/ cpu_set_t;

/* Variables and functions */
int /*<<< orphan*/ CPU_SET(unsigned int, int /*<<< orphan*/ *);
int /*<<< orphan*/ CPU_ZERO(int /*<<< orphan*/ *);
int /*<<< orphan*/ perror(char *);
scalar_t__ sched_setaffinity(int /*<<< orphan*/, int, int /*<<< orphan*/ *);
int on_cpu(unsigned cpu) {
  cpu_set_t mask;
  CPU_ZERO(&mask);
  CPU_SET(cpu, &mask);
  if (sched_setaffinity(0, sizeof(mask), &mask) < 0) {
    perror("sched_setaffinity");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<on_cpu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
call   1040 <CPU_ZERO@plt>
mov    -0x8(%rbp),%edi
lea    -0xc(%rbp),%rsi
call   1060 <CPU_SET@plt>
xor    %edi,%edi
mov    $0x4,%esi
lea    -0xc(%rbp),%rdx
call   1030 <sched_setaffinity@plt>
cmp    $0x0,%rax
jge    1192 <on_cpu+0x52>
lea    0xe7f(%rip),%rdi
call   1050 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1199 <on_cpu+0x59>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<on_cpu>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x4(%rsp),%r14
mov    %r14,%rdi
call   1040 <CPU_ZERO@plt>
mov    %ebx,%edi
mov    %r14,%rsi
call   1060 <CPU_SET@plt>
xor    %ebx,%ebx
xor    %edi,%edi
mov    $0x4,%esi
mov    %r14,%rdx
call   1030 <sched_setaffinity@plt>
test   %rax,%rax
js     117d <on_cpu+0x3d>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
lea    0xe7c(%rip),%rdi
call   1050 <perror@plt>
mov    $0xffffffff,%ebx
jmp    1173 <on_cpu+0x33>

LLVM IR (-O0):
@.str = [18 x i8] c"sched_setaffinity\00"
define i32 @on_cpu(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = call i32 @CPU_ZERO(i32* %4)
%6 = load i32, i32* %3
%7 = call i32 @CPU_SET(i32 %6, i32* %4)
%8 = call i64 @sched_setaffinity(i32 0, i32 4, i32* %4)
%9 = icmp slt i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = call i32 @perror(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %2
br label %13
12: ; preds = %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %10
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@.str = [18 x i8] c"sched_setaffinity\00"
define i32 @on_cpu(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @CPU_ZERO(i32* %2)
%5 = call i32 @CPU_SET(i32 %0, i32* %2)
%6 = call i64 @sched_setaffinity(i32 0, i32 4, i32* %2)
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %1, %8
%11 = phi i32 [ -1, %8 ], [ 0, %1 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printInventoryTitle(void) { printf("\nMy Inventory: \n"); }


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

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

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

LLVM IR (-O2):
@str = [16 x i8] c"\0AMy Inventory: \00"
define void @printInventoryTitle() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret void
}
int XCloseIM() {}


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

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

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

LLVM IR (-O2):
define i32 @XCloseIM() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ set_io_bit(int, int);
void TOSH_SET_PW2_PIN() { set_io_bit(0x40, 2); }


x86 assembly (clang, -O0):
<TOSH_SET_PW2_PIN>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40,%edi
mov    $0x2,%esi
call   1030 <set_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_SET_PW2_PIN>:
mov    $0x40,%edi
mov    $0x2,%esi
jmp    1030 <set_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_SET_PW2_PIN() {
%1 = call i32 @set_io_bit(i32 64, i32 2)
ret void
}

LLVM IR (-O2):
define void @TOSH_SET_PW2_PIN() {
%1 = tail call i32 @set_io_bit(i32 64, i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HibernateWriteComplete();
void HibernateGPIORetentionEnable(void) {
  (*((volatile unsigned long *)(0x400FC010))) |= 0x00000100;
  HibernateWriteComplete();
}


x86 assembly (clang, -O0):
<HibernateGPIORetentionEnable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400fc010,%eax
mov    (%rax),%rcx
or     $0x100,%rcx
mov    $0x400fc010,%eax
mov    %rcx,(%rax)
mov    $0x0,%al
call   1030 <HibernateWriteComplete@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<HibernateGPIORetentionEnable>:
orq    $0x100,0x400fc010
xor    %eax,%eax
jmp    1030 <HibernateWriteComplete@plt>

LLVM IR (-O0):
define void @HibernateGPIORetentionEnable() {
%1 = load volatile i64, i64* inttoptr (i64 1074774032 to i64*)
%2 = or i64 %1, 256
store volatile i64 %2, i64* inttoptr (i64 1074774032 to i64*)
%3 = call i32 (...) @HibernateWriteComplete()
ret void
}

LLVM IR (-O2):
define void @HibernateGPIORetentionEnable() {
%1 = load volatile i64, i64* inttoptr (i64 1074774032 to i64*)
%2 = or i64 %1, 256
store volatile i64 %2, i64* inttoptr (i64 1074774032 to i64*)
%3 = tail call i32 (...) @HibernateWriteComplete()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t fe(uint32_t i) {
  uint32_t o;
  char *c = (char *)&i;
  char *p = (char *)&o;
  p[0] = c[3];
  p[1] = c[2];
  p[2] = c[1];
  p[3] = c[0];
  return o;
}


x86 assembly (clang, -O0):
<fe>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x3(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x10(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fe>:
mov    %edi,%eax
bswap  %eax
ret

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

LLVM IR (-O2):
define i32 @fe(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ execl(char *, char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, int *);
int main(int argc, char *argv[]) {
  int stack_var;
  printf("stack_var is at %p\n", &stack_var);
  execl("./aslr_demo", "aslr_demo", NULL);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
lea    0xec9(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <execl@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
lea    0xed6(%rip),%rsi
xor    %edx,%edx
call   1040 <execl@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"stack_var is at %p\0A\00"
@.str.1 = [12 x i8] c"./aslr_demo\00"
@.str.2 = [10 x i8] c"aslr_demo\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32* %5)
%7 = call i32 @execl(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32* null)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"stack_var is at %p\0A\00"
@.str.1 = [12 x i8] c"./aslr_demo\00"
@.str.2 = [10 x i8] c"aslr_demo\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32* %3)
%6 = call i32 @execl(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32* null)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int return1(int /*<<< orphan*/);
int main(int argc, char *argv[], char *envp[]) {
  int o0;
  o0 = return1(0);
  printf("SOMETHING%D", o0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %edi,%edi
call   1040 <return1@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <return1@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"SOMETHING%D\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
%8 = alloca i32
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%9 = call i32 @return1(i32 0)
store i32 %9, i32* %8
%10 = load i32, i32* %8
%11 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"SOMETHING%D\00"
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = tail call i32 @return1(i32 0)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
scalar_t__ DWC_IN_IRQ();
char *dwc_irq(void) { return (DWC_IN_IRQ() != 0) ? "IRQ" : ""; }


x86 assembly (clang, -O0):
<dwc_irq>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <DWC_IN_IRQ@plt>
mov    %rax,%rdx
lea    0xede(%rip),%rax
lea    0xed4(%rip),%rcx
cmp    $0x0,%rdx
cmovne %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dwc_irq>:
push   %rax
xor    %eax,%eax
call   1030 <DWC_IN_IRQ@plt>
test   %rax,%rax
lea    0xee1(%rip),%rcx
lea    0xed7(%rip),%rax
cmove  %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"IRQ\00"
@.str.1 = [1 x i8] zeroinitializer
define i8* @dwc_irq() {
%1 = call i64 (...) @DWC_IN_IRQ()
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i64
%4 = select i1 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0)
ret i8* %4
}

LLVM IR (-O2):
@.str = [4 x i8] c"IRQ\00"
@.str.1 = [1 x i8] zeroinitializer
define i8* @dwc_irq() {
%1 = tail call i64 (...) @DWC_IN_IRQ()
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
ret i8* %3
}
unsigned long SomaRecursao(int n) {
  if (n == 1) {
    return 1;
  }
  return n + SomaRecursao(n - 1);
}


x86 assembly (clang, -O0):
<SomaRecursao>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    1132 <SomaRecursao+0x22>
movq   $0x1,-0x8(%rbp)
jmp    1153 <SomaRecursao+0x43>
movslq -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
sub    $0x1,%edi
call   1030 <SomaRecursao@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SomaRecursao>:
mov    $0x1,%eax
cmp    $0x1,%edi
je     112c <SomaRecursao+0x2c>
movslq %edi,%rcx
lea    -0x1(%rcx),%rax
lea    -0x2(%rdi),%edx
imul   %rdx,%rax
add    $0xfffffffd,%edi
imul   %rdx,%rdi
shr    %rdi
add    %rcx,%rax
sub    %rdi,%rax
add    $0x1,%rax
ret

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

LLVM IR (-O2):
define i64 @SomaRecursao(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %17, label %3
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = add nsw i64 %4, -1
%6 = add i32 %0, -2
%7 = zext i32 %6 to i64
%8 = mul nsw i64 %5, %7
%9 = zext i32 %6 to i64
%10 = add i32 %0, -3
%11 = zext i32 %10 to i64
%12 = mul nuw i64 %9, %11
%13 = lshr i64 %12, 1
%14 = add i64 %8, %4
%15 = sub i64 %14, %13
%16 = add i64 %15, 1
br label %17
17: ; preds = %3, %1
%18 = phi i64 [ 1, %1 ], [ %16, %3 ]
ret i64 %18
}
/* Variables and functions */
int strcmp(char *, char *);
int cmp(void *key1, void *key2) { return strcmp((char *)key1, (char *)key2); }


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

x86 assembly (clang, -O2):
<cmp>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Type definitions */
struct text_tag_list {
  int dummy;
};
struct genlist {
  int dummy;
};

/* Variables and functions */
int genlist_size(struct genlist *);
int text_tag_list_size(const struct text_tag_list *tthis) {
  return genlist_size(((struct genlist *)(tthis)));
}


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

x86 assembly (clang, -O2):
<text_tag_list_size>:
jmp    1030 <genlist_size@plt>

LLVM IR (-O0):
%struct.text_tag_list = type { i32 }
%struct.genlist = type { i32 }
define i32 @text_tag_list_size(%struct.text_tag_list* %0) {
%2 = alloca %struct.text_tag_list*
store %struct.text_tag_list* %0, %struct.text_tag_list** %2
%3 = load %struct.text_tag_list*, %struct.text_tag_list** %2
%4 = bitcast %struct.text_tag_list* %3 to %struct.genlist*
%5 = call i32 @genlist_size(%struct.genlist* %4)
ret i32 %5
}

LLVM IR (-O2):
%struct.text_tag_list = type { i32 }
%struct.genlist = type { i32 }
define i32 @text_tag_list_size(%struct.text_tag_list* %0) {
%2 = bitcast %struct.text_tag_list* %0 to %struct.genlist*
%3 = tail call i32 @genlist_size(%struct.genlist* %2)
ret i32 %3
}
/* Variables and functions */
int some_function(char *);
int main(int argc, char *argv[]) { return some_function(argv[1]); }


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

x86 assembly (clang, -O2):
<main>:
mov    0x8(%rsi),%rdi
jmp    1030 <some_function@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = call i32 @some_function(i8* %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @some_function(i8* %4)
ret i32 %5
}
int ld_ne_mr2(long double *a1, long double a2) { return !(((*a1) != (a2))); }


x86 assembly (clang, -O0):
<ld_ne_mr2>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
mov    %rdi,-0x8(%rbp)
fstpt  -0x20(%rbp)
mov    -0x8(%rbp),%rax
fldt   (%rax)
fldt   -0x20(%rbp)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setp   %cl
setne  %al
or     %cl,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_ne_mr2>:
fldt   0x8(%rsp)
fldt   (%rdi)
fucomip %st(1),%st
fstp   %st(0)
setnp  %al
sete   %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @ld_ne_mr2(x86_fp80* %0, x86_fp80 %1) {
%3 = alloca x86_fp80*
%4 = alloca x86_fp80
store x86_fp80* %0, x86_fp80** %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80*, x86_fp80** %3
%6 = load x86_fp80, x86_fp80* %5
%7 = load x86_fp80, x86_fp80* %4
%8 = fcmp une x86_fp80 %6, %7
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @ld_ne_mr2(x86_fp80* nocapture %0, x86_fp80 %1) {
%3 = load x86_fp80, x86_fp80* %0
%4 = fcmp oeq x86_fp80 %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char const *, char const *,
                           char const *);
void iptables_delpost(char *cmd, const char *Fip, const char *Sip,
                      const char *Sport) {
  sprintf(cmd,
          "/sbin/iptables"
          " -t nat -D POSTROUTING -p tcp -d %s --dport %s -j SNAT --to %s",
          Sip, Sport, Fip);
}


x86 assembly (clang, -O0):
<iptables_delpost>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%r8
lea    0xec1(%rip),%rsi
call   1030 <sprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iptables_delpost>:
mov    %rsi,%r8
lea    0xee6(%rip),%rsi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [77 x i8] c"/sbin/iptables -t nat -D POSTROUTING -p tcp -d %s --dport %s -j SNAT --to %s\00"
define void @iptables_delpost(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %7
%11 = load i8*, i8** %8
%12 = load i8*, i8** %6
%13 = call i32 @sprintf(i8* %9, i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str, i64 0, i64 0), i8* %10, i8* %11, i8* %12)
ret void
}

LLVM IR (-O2):
@.str = [77 x i8] c"/sbin/iptables -t nat -D POSTROUTING -p tcp -d %s --dport %s -j SNAT --to %s\00"
define void @iptables_delpost(i8* nocapture writeonly %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([77 x i8], [77 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %3, i8* %1)
ret void
}
int kvm_vfio_ops_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @kvm_vfio_ops_init() {
ret i32 0
}
int __fesetround(int round) {
  unsigned short int cw;
  int mxcsr;
  if ((round & ~0xc00) != 0)
    return 1;
  asm("fnstcw %0" : "=m"(*&cw));
  cw &= ~0xc00;
  cw |= round;
  asm("fldcw %0" : : "m"(*&cw));
  asm("stmxcsr %0" : "=m"(*&mxcsr));
  mxcsr &= ~0x6000;
  mxcsr |= round << 3;
  asm("ldmxcsr %0" : : "m"(*&mxcsr));
  return 0;
}


x86 assembly (clang, -O0):
<__fesetround>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xfffff3ff,%eax
cmp    $0x0,%eax
je     1124 <__fesetround+0x24>
movl   $0x1,-0x4(%rbp)
jmp    116a <__fesetround+0x6a>
fnstcw -0xa(%rbp)
movzwl -0xa(%rbp),%eax
and    $0xfffff3ff,%eax
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%ecx
movzwl -0xa(%rbp),%eax
or     %ecx,%eax
mov    %ax,-0xa(%rbp)
fldcw  -0xa(%rbp)
stmxcsr -0x10(%rbp)
mov    -0x10(%rbp),%eax
and    $0xffff9fff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x3,%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
ldmxcsr -0x10(%rbp)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__fesetround>:
mov    $0x1,%eax
test   $0xfffff3ff,%edi
je     110e <__fesetround+0xe>
ret
fnstcw -0x6(%rsp)
movzwl -0x6(%rsp),%eax
and    $0xfffff3ff,%eax
or     %edi,%eax
mov    %ax,-0x6(%rsp)
fldcw  -0x6(%rsp)
stmxcsr -0x4(%rsp)
mov    $0xffff9fff,%eax
and    -0x4(%rsp),%eax
shl    $0x3,%edi
or     %eax,%edi
mov    %edi,-0x4(%rsp)
ldmxcsr -0x4(%rsp)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @__fesetround(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i16
%5 = alloca i32
store i32 %0, i32* %3
%6 = load i32, i32* %3
%7 = and i32 %6, -3073
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 1, i32* %2
br label %26
10: ; preds = %1
%11 = load i16, i16* %4
%12 = zext i16 %11 to i32
%13 = and i32 %12, -3073
%14 = trunc i32 %13 to i16
store i16 %14, i16* %4
%15 = load i32, i32* %3
%16 = load i16, i16* %4
%17 = zext i16 %16 to i32
%18 = or i32 %17, %15
%19 = trunc i32 %18 to i16
store i16 %19, i16* %4
%20 = load i32, i32* %5
%21 = and i32 %20, -24577
store i32 %21, i32* %5
%22 = load i32, i32* %3
%23 = shl i32 %22, 3
%24 = load i32, i32* %5
%25 = or i32 %24, %23
store i32 %25, i32* %5
store i32 0, i32* %2
br label %26
26: ; preds = %10, %9
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
define i32 @__fesetround(i32 %0) {
%2 = alloca i16
%3 = alloca i32
%4 = bitcast i16* %2 to i8*
%5 = bitcast i32* %3 to i8*
%6 = and i32 %0, -3073
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %17
8: ; preds = %1
%9 = load i16, i16* %2
%10 = and i16 %9, -3073
%11 = trunc i32 %0 to i16
%12 = or i16 %10, %11
store i16 %12, i16* %2
%13 = load i32, i32* %3
%14 = and i32 %13, -24577
%15 = shl nuw nsw i32 %0, 3
%16 = or i32 %14, %15
store i32 %16, i32* %3
br label %17
17: ; preds = %1, %8
%18 = phi i32 [ 0, %8 ], [ 1, %1 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ set_ioprio_rt();
int pcap_rw_prepare_writing_pcap(int fd) {
  set_ioprio_rt();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @pcap_rw_prepare_writing_pcap(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @set_ioprio_rt()
ret i32 0
}

LLVM IR (-O2):
define i32 @pcap_rw_prepare_writing_pcap(i32 %0) {
%2 = tail call i32 (...) @set_ioprio_rt()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ print_rev(char *);
int main(void) {
  char *str;
  str = "I do not fear computers. I fear the lack of them - Isaac Asimov";
  print_rev(str);
  return (0);
}


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

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

LLVM IR (-O0):
@.str = [64 x i8] c"I do not fear computers. I fear the lack of them - Isaac Asimov\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @print_rev(i8* %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [64 x i8] c"I do not fear computers. I fear the lack of them - Isaac Asimov\00"
define i32 @main() {
%1 = tail call i32 @print_rev(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct sparsegroup {
  int dummy;
};
typedef int ssize_t;

/* Variables and functions */
ssize_t sparsegroup_size(const struct sparsegroup *g) {
  (void)g;
  return 48;
}


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

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

LLVM IR (-O0):
%struct.sparsegroup = type { i32 }
define i32 @sparsegroup_size(%struct.sparsegroup* %0) {
%2 = alloca %struct.sparsegroup*
store %struct.sparsegroup* %0, %struct.sparsegroup** %2
%3 = load %struct.sparsegroup*, %struct.sparsegroup** %2
ret i32 48
}

LLVM IR (-O2):
%struct.sparsegroup = type { i32 }
define i32 @sparsegroup_size(%struct.sparsegroup* nocapture readnone %0) {
ret i32 48
}
/* Variables and functions */
int /*<<< orphan*/ foo(int);
int main(void) {
  for (int i = -129; i < 130; i++)
    foo(i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xffffff7f,-0x8(%rbp)
cmpl   $0x82,-0x8(%rbp)
jge    1149 <main+0x39>
mov    -0x8(%rbp),%edi
call   1030 <foo@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xffffff7f,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1030 <foo@plt>
add    $0x1,%ebx
cmp    $0x82,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
br label %2
1: ; preds = %2
ret i32 0
2: ; preds = %0, %2
%3 = phi i32 [ -129, %0 ], [ %5, %2 ]
%4 = tail call i32 @foo(i32 %3)
%5 = add nsw i32 %3, 1
%6 = icmp eq i32 %5, 130
br i1 %6, label %1, label %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char const *);
int helper(int argc, const char **argv) {
  int i;
  for (i = 0; i < argc; i++)
    printf("argv[%i]: %s\n", i, argv[i]);
  return 0;
}


x86 assembly (clang, -O0):
<helper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    115b <helper+0x4b>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <helper+0x16>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<helper>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    1147 <helper+0x37>
mov    %rsi,%r14
mov    %edi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdx
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <helper+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"argv[%i]: %s\0A\00"
define i32 @helper(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = trunc i64 %7 to i32
%11 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %10, i8* %9)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret i32 0
}
int charGreaterThan(const void *a, const void *b) {
  char an = *(char *)a;
  char bn = *(char *)b;
  if (an > bn)
    return 1;
  else if (an == bn)
    return 0;
  else
    return -1;
}


x86 assembly (clang, -O0):
<charGreaterThan>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x19(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x1a(%rbp)
movsbl -0x19(%rbp),%eax
movsbl -0x1a(%rbp),%ecx
cmp    %ecx,%eax
jle    113a <charGreaterThan+0x3a>
movl   $0x1,-0x4(%rbp)
jmp    115d <charGreaterThan+0x5d>
movsbl -0x19(%rbp),%eax
movsbl -0x1a(%rbp),%ecx
cmp    %ecx,%eax
jne    1156 <charGreaterThan+0x56>
movl   $0x0,-0x4(%rbp)
jmp    115d <charGreaterThan+0x5d>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<charGreaterThan>:
mov    (%rdi),%al
mov    (%rsi),%cl
xor    %edx,%edx
cmp    %cl,%al
setne  %dl
neg    %edx
cmp    %cl,%al
mov    $0x1,%eax
cmovle %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @charGreaterThan(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp sgt i8 %3, %4
%6 = icmp ne i8 %3, %4
%7 = sext i1 %6 to i32
%8 = select i1 %5, i32 1, i32 %7
ret i32 %8
}
/* Variables and functions */
int yas_adxl345_read_reg(unsigned char, unsigned char *, int);
int yas_adxl345_read_reg_byte(unsigned char adr) {
  unsigned char buf;
  int err;
  err = yas_adxl345_read_reg(adr, &buf, 1);
  if (err == 0)
    return buf;
  return 0;
}


x86 assembly (clang, -O0):
<yas_adxl345_read_reg_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
lea    -0x6(%rbp),%rsi
mov    $0x1,%edx
movzbl -0x5(%rbp),%edi
call   1030 <yas_adxl345_read_reg@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1149 <yas_adxl345_read_reg_byte+0x39>
movzbl -0x6(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1150 <yas_adxl345_read_reg_byte+0x40>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yas_adxl345_read_reg_byte>:
push   %rax
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <yas_adxl345_read_reg@plt>
xor    %ecx,%ecx
test   %eax,%eax
movzbl 0x7(%rsp),%eax
cmovne %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @yas_adxl345_read_reg_byte(i8 zeroext %0) {
%2 = alloca i8
%3 = call i32 @yas_adxl345_read_reg(i8 zeroext %0, i8* %2, i32 1)
%4 = icmp eq i32 %3, 0
%5 = load i8, i8* %2
%6 = zext i8 %5 to i32
%7 = select i1 %4, i32 %6, i32 0
ret i32 %7
}
void sk_new(void) {}


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

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

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

LLVM IR (-O2):
define void @sk_new() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int main(int argc, const char *argv[]) {
  system("../../src/pnv_json 06301234567 hu");
  system("../../src/pnv_json 0630123456 hu");
  system("../../src/pnv_json 0630123456");
  system("../../src/pnv_json +36-70.123.4567");
  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)
lea    0xed3(%rip),%rdi
call   1030 <system@plt>
lea    0xee9(%rip),%rdi
call   1030 <system@plt>
lea    0xefe(%rip),%rdi
call   1030 <system@plt>
lea    0xf10(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [34 x i8] c"../../src/pnv_json 06301234567 hu\00"
@.str.1 = [33 x i8] c"../../src/pnv_json 0630123456 hu\00"
@.str.2 = [30 x i8] c"../../src/pnv_json 0630123456\00"
@.str.3 = [35 x i8] c"../../src/pnv_json +36-70.123.4567\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 = call i32 @system(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @system(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @system(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 @system(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"../../src/pnv_json 06301234567 hu\00"
@.str.1 = [33 x i8] c"../../src/pnv_json 0630123456 hu\00"
@.str.2 = [30 x i8] c"../../src/pnv_json 0630123456\00"
@.str.3 = [35 x i8] c"../../src/pnv_json +36-70.123.4567\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @system(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @system(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @system(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 @system(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int /*<<< orphan*/ umask(int /*<<< orphan*/);
int set_file_mask(mode_t file_mask) {
  umask(file_mask);
  return 1;
}


x86 assembly (clang, -O0):
<set_file_mask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <umask@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_file_mask>:
push   %rax
call   1030 <umask@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @set_file_mask(i32 %0) {
%2 = tail call i32 @umask(i32 %0)
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
void om_text_print_report_link(FILE *fp, char *report) {
  fprintf(fp, "-> %s\n", report);
  return;
}


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

x86 assembly (clang, -O2):
<om_text_print_report_link>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"-> %s\0A\00"
define void @om_text_print_report_link(i32* nocapture %0, i8* %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Type definitions */
struct wl_shell_surface {
  int dummy;
};
struct wl_proxy {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_proxy_marshal(struct wl_proxy *, int, char const *);
void wl_shell_surface_set_class(struct wl_shell_surface *wl_shell_surface,
                                const char *class_) {
  wl_proxy_marshal((struct wl_proxy *)wl_shell_surface, 9, class_);
}


x86 assembly (clang, -O0):
<wl_shell_surface_set_class>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x9,%esi
call   1030 <wl_proxy_marshal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wl_shell_surface_set_class>:
mov    %rsi,%rdx
mov    $0x9,%esi
jmp    1030 <wl_proxy_marshal@plt>

LLVM IR (-O0):
%struct.wl_shell_surface = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_shell_surface_set_class(%struct.wl_shell_surface* %0, i8* %1) {
%3 = alloca %struct.wl_shell_surface*
%4 = alloca i8*
store %struct.wl_shell_surface* %0, %struct.wl_shell_surface** %3
store i8* %1, i8** %4
%5 = load %struct.wl_shell_surface*, %struct.wl_shell_surface** %3
%6 = bitcast %struct.wl_shell_surface* %5 to %struct.wl_proxy*
%7 = load i8*, i8** %4
%8 = call i32 @wl_proxy_marshal(%struct.wl_proxy* %6, i32 9, i8* %7)
ret void
}

LLVM IR (-O2):
%struct.wl_shell_surface = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_shell_surface_set_class(%struct.wl_shell_surface* %0, i8* %1) {
%3 = bitcast %struct.wl_shell_surface* %0 to %struct.wl_proxy*
%4 = tail call i32 @wl_proxy_marshal(%struct.wl_proxy* %3, i32 9, i8* %1)
ret void
}
/* Variables and functions */
long ndb_get_ptr_ps(void *i_ptr, short i_status, long *o_index, size_t *o_size,
                    char *o_remark) {
  return 0;
}


x86 assembly (clang, -O0):
<ndb_get_ptr_ps>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @ndb_get_ptr_ps(i8* %0, i16 signext %1, i64* %2, i64* %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i16
%8 = alloca i64*
%9 = alloca i64*
%10 = alloca i8*
store i8* %0, i8** %6
store i16 %1, i16* %7
store i64* %2, i64** %8
store i64* %3, i64** %9
store i8* %4, i8** %10
ret i64 0
}

LLVM IR (-O2):
define i64 @ndb_get_ptr_ps(i8* nocapture readnone %0, i16 signext %1, i64* nocapture readnone %2, i64* nocapture readnone %3, i8* nocapture readnone %4) {
ret i64 0
}