xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ calc_host(int const, double *, double *, double *);
int /*<<< orphan*/ calc_opencl(int const, double *, double *, double *, char *);
int main() {
  const int datasize = 100;
  double *data1;
  double *data2;
  double *result;
  calc_host(datasize, data1, data2, result);
  calc_opencl(datasize, data1, data2, result, "vec_add.cl");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x64,-0x8(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x64,%edi
call   1040 <calc_host@plt>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x64,%edi
lea    0xe9c(%rip),%r8
call   1030 <calc_opencl@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x64,%edi
call   1040 <calc_host@plt>
lea    0xece(%rip),%r8
mov    $0x64,%edi
call   1030 <calc_opencl@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"vec_add.cl\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double*
%4 = alloca double*
%5 = alloca double*
store i32 0, i32* %1
store i32 100, i32* %2
%6 = load double*, double** %3
%7 = load double*, double** %4
%8 = load double*, double** %5
%9 = call i32 @calc_host(i32 100, double* %6, double* %7, double* %8)
%10 = load double*, double** %3
%11 = load double*, double** %4
%12 = load double*, double** %5
%13 = call i32 @calc_opencl(i32 100, double* %10, double* %11, double* %12, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"vec_add.cl\00"
define i32 @main() {
%1 = tail call i32 @calc_host(i32 100, double* undef, double* undef, double* undef)
%2 = tail call i32 @calc_opencl(i32 100, double* undef, double* undef, double* undef, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ tlv_empty(int /*<<< orphan*/ *);
void emmg_init(uint8_t *p_tlv) { tlv_empty(p_tlv); }


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

x86 assembly (clang, -O2):
<emmg_init>:
jmp    1030 <tlv_empty@plt>

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

LLVM IR (-O2):
define void @emmg_init(i32* %0) {
%2 = tail call i32 @tlv_empty(i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ tfprintf(int /*<<< orphan*/, char *, int /*<<< orphan*/,
                            char const *, char const *);
int /*<<< orphan*/ time_str(char *);
void vegas_warn(const char *name, const char *msg) {
  char tbuf[64];
  tfprintf(stderr, "HPC[%s]: Warning (%s): %s\n", time_str(tbuf), name, msg);
  fflush(stderr);
}


x86 assembly (clang, -O0):
<vegas_warn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e99(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x54(%rbp)
lea    -0x50(%rbp),%rdi
call   1030 <time_str@plt>
mov    -0x54(%rbp),%edi
mov    %eax,%edx
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
lea    0xe97(%rip),%rsi
call   1040 <tfprintf@plt>
mov    0x2e6b(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vegas_warn>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x48,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x2e99(%rip),%r15
mov    (%r15),%ebp
mov    %rsp,%rdi
call   1030 <time_str@plt>
lea    0xea7(%rip),%rsi
mov    %ebp,%edi
mov    %eax,%edx
mov    %rbx,%rcx
mov    %r14,%r8
call   1040 <tfprintf@plt>
mov    (%r15),%edi
call   1050 <fflush@plt>
add    $0x48,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [27 x i8] c"HPC[%s]: Warning (%s): %s\0A\00"
define void @vegas_warn(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [64 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i32, i32* @stderr
%7 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%8 = call i32 @time_str(i8* %7)
%9 = load i8*, i8** %3
%10 = load i8*, i8** %4
%11 = call i32 @tfprintf(i32 %6, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %8, i8* %9, i8* %10)
%12 = load i32, i32* @stderr
%13 = call i32 @fflush(i32 %12)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [27 x i8] c"HPC[%s]: Warning (%s): %s\0A\00"
define void @vegas_warn(i8* %0, i8* %1) {
%3 = alloca [64 x i8]
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* @stderr
%6 = call i32 @time_str(i8* %4)
%7 = call i32 @tfprintf(i32 %5, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %6, i8* %0, i8* %1)
%8 = load i32, i32* @stderr
%9 = call i32 @fflush(i32 %8)
ret void
}
unsigned rightrot(unsigned src_bf, unsigned rot_num) {
  extern unsigned maxbit;
  if (rot_num > maxbit) {
    return rightrot(src_bf, rot_num - maxbit);
  } else {
    return (src_bf >> rot_num) | (src_bf << (maxbit - rot_num));
  }
}


x86 assembly (clang, -O0):
<rightrot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2eb0(%rip),%rcx
cmp    (%rcx),%eax
jbe    114c <rightrot+0x3c>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    0x2e9b(%rip),%rax
sub    (%rax),%esi
call   1030 <rightrot@plt>
mov    %eax,-0x4(%rbp)
jmp    116c <rightrot+0x5c>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shr    %cl,%eax
mov    -0x8(%rbp),%edx
mov    0x2e7a(%rip),%rcx
mov    (%rcx),%ecx
sub    -0xc(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rightrot>:
mov    %edi,%eax
mov    0x2ecf(%rip),%rcx
mov    (%rcx),%ecx
nopl   0x0(%rax,%rax,1)
sub    %ecx,%esi
ja     1110 <rightrot+0x10>
add    %esi,%ecx
mov    %eax,%edx
shr    %cl,%edx
neg    %sil
mov    %esi,%ecx
shl    %cl,%eax
or     %edx,%eax
ret

LLVM IR (-O0):
@maxbit = external global i32
define i32 @rightrot(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = load i32, i32* @maxbit
%8 = icmp ugt i32 %6, %7
br i1 %8, label %9, label %15
9: ; preds = %2
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = load i32, i32* @maxbit
%13 = sub i32 %11, %12
%14 = call i32 @rightrot(i32 %10, i32 %13)
store i32 %14, i32* %3
br label %25
15: ; preds = %2
%16 = load i32, i32* %4
%17 = load i32, i32* %5
%18 = lshr i32 %16, %17
%19 = load i32, i32* %4
%20 = load i32, i32* @maxbit
%21 = load i32, i32* %5
%22 = sub i32 %20, %21
%23 = shl i32 %19, %22
%24 = or i32 %18, %23
store i32 %24, i32* %3
br label %25
25: ; preds = %15, %9
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
@maxbit = external global i32
define i32 @rightrot(i32 %0, i32 %1) {
%3 = load i32, i32* @maxbit
br label %4
4: ; preds = %4, %2
%5 = phi i32 [ %1, %2 ], [ %7, %4 ]
%6 = icmp ugt i32 %5, %3
%7 = sub i32 %5, %3
br i1 %6, label %4, label %8
8: ; preds = %4
%9 = lshr i32 %0, %5
%10 = sub i32 %3, %5
%11 = shl i32 %0, %10
%12 = or i32 %11, %9
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ literal_string_parameter(char *);
void call_literal_string_parameter2_Bad() { literal_string_parameter("hellp"); }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"hellp\00"
define void @call_literal_string_parameter2_Bad() {
%1 = call i32 @literal_string_parameter(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"hellp\00"
define void @call_literal_string_parameter2_Bad() {
%1 = tail call i32 @literal_string_parameter(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ critic();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  extern int units;
  printf("How many pounds to a firkin of butter?\n");
  scanf("%d", &units);
  while (units != 56)
    critic();
  printf("You must have looked it up!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
mov    0x2e8f(%rip),%rsi
call   1050 <scanf@plt>
mov    0x2e83(%rip),%rax
cmpl   $0x38,(%rax)
je     117a <main+0x4a>
mov    $0x0,%al
call   1040 <critic@plt>
jmp    115e <main+0x2e>
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xecb(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
mov    0x2e9d(%rip),%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
cmpl   $0x38,(%rbx)
je     116c <main+0x3c>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <critic@plt>
cmpl   $0x38,(%rbx)
jne    1160 <main+0x30>
lea    0xeb7(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [40 x i8] c"How many pounds to a firkin of butter?\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@units = external global i32
@.str.2 = [29 x i8] c"You must have looked it up!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* @units)
br label %4
4: ; preds = %7, %0
%5 = load i32, i32* @units
%6 = icmp ne i32 %5, 56
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = call i32 (...) @critic()
br label %4
9: ; preds = %4
%10 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@units = external global i32
@str = [39 x i8] c"How many pounds to a firkin of butter?\00"
@str.3 = [28 x i8] c"You must have looked it up!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* @units)
%3 = load i32, i32* @units
%4 = icmp eq i32 %3, 56
br i1 %4, label %9, label %5
5: ; preds = %0, %5
%6 = tail call i32 (...) @critic()
%7 = load i32, i32* @units
%8 = icmp eq i32 %7, 56
br i1 %8, label %9, label %5
9: ; preds = %5, %0
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.3, i64 0, i64 0))
ret i32 0
}
int spgdb_remove_space(char symbol[], const int num_char) {
  int i;
  for (i = num_char - 2; i > -1; i--) {
    if (symbol[i] == ' ') {
      symbol[i] = '\0';
    } else {
      return i;
    }
  }
  return i;
}


x86 assembly (clang, -O0):
<spgdb_remove_space>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x18(%rbp)
cmpl   $0xffffffff,-0x18(%rbp)
jle    1162 <spgdb_remove_space+0x62>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
jne    1144 <spgdb_remove_space+0x44>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    114f <spgdb_remove_space+0x4f>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1168 <spgdb_remove_space+0x68>
jmp    1154 <spgdb_remove_space+0x54>
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
jmp    1114 <spgdb_remove_space+0x14>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<spgdb_remove_space>:
lea    -0x2(%rsi),%eax
cmp    $0x2,%esi
jl     112a <spgdb_remove_space+0x2a>
nopl   0x0(%rax,%rax,1)
mov    %eax,%ecx
cmpb   $0x20,(%rdi,%rcx,1)
jne    112a <spgdb_remove_space+0x2a>
movb   $0x0,(%rdi,%rcx,1)
lea    -0x1(%rax),%ecx
test   %eax,%eax
mov    %ecx,%eax
jg     1110 <spgdb_remove_space+0x10>
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @spgdb_remove_space(i8* nocapture %0, i32 %1) {
%3 = add nsw i32 %1, -2
%4 = icmp sgt i32 %1, 1
br i1 %4, label %5, label %14
5: ; preds = %2, %11
%6 = phi i32 [ %12, %11 ], [ %3, %2 ]
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 32
br i1 %10, label %11, label %14
11: ; preds = %5
store i8 0, i8* %8
%12 = add nsw i32 %6, -1
%13 = icmp sgt i32 %6, 0
br i1 %13, label %5, label %14
14: ; preds = %5, %11, %2
%15 = phi i32 [ %3, %2 ], [ -1, %11 ], [ %6, %5 ]
ret i32 %15
}
int ip6cp_this_layer_finished(struct lcp_context *context) {
  context = context;
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.lcp_context = type opaque
define i32 @ip6cp_this_layer_finished(%struct.lcp_context* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef scalar_t__ RAND_MAX;

/* Variables and functions */
scalar_t__ rand();
int rollRand(int min, int max) {
  double r;
  double x;
  r = ((double)rand() / ((double)(RAND_MAX) + (double)(1)));
  x = (r * max);
  return (int)x + min;
}


x86 assembly (clang, -O0):
<rollRand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
movsd  0xece(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
cvtsi2sdl -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
cvttsd2si -0x18(%rbp),%eax
add    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rollRand>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
cvtsi2sd %ebx,%xmm1
mulsd  %xmm0,%xmm1
cvttsd2si %xmm1,%eax
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @rollRand(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
%6 = alloca double
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = call i64 (...) @rand()
%8 = sitofp i64 %7 to double
%9 = fdiv double %8, 1.000000e+00
store double %9, double* %5
%10 = load double, double* %5
%11 = load i32, i32* %4
%12 = sitofp i32 %11 to double
%13 = fmul double %10, %12
store double %13, double* %6
%14 = load double, double* %6
%15 = fptosi double %14 to i32
%16 = load i32, i32* %3
%17 = add nsw i32 %15, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @rollRand(i32 %0, i32 %1) {
%3 = tail call i64 (...) @rand()
%4 = sitofp i64 %3 to double
%5 = sitofp i32 %1 to double
%6 = fmul double %5, %4
%7 = fptosi double %6 to i32
%8 = add nsw i32 %7, %0
ret i32 %8
}
int main() {
  int a;
  int b;
  a = 2;
  b = 3;
  int c;
  c = (a + b) / a % b;
  return c;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 2, i32* %2
store i32 3, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = add nsw i32 %5, %6
%8 = load i32, i32* %2
%9 = sdiv i32 %7, %8
%10 = load i32, i32* %3
%11 = srem i32 %9, %10
store i32 %11, i32* %4
%12 = load i32, i32* %4
ret i32 %12
}

LLVM IR (-O2):
define i32 @main() {
ret i32 2
}
/* Variables and functions */
int RAND_MAX;
int /*<<< orphan*/ lua_pushnumber(double);
int rand();
void math_random(void) {
  lua_pushnumber((double)(rand() % RAND_MAX) / (double)RAND_MAX);
}


x86 assembly (clang, -O0):
<math_random>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <rand@plt>
mov    0x2eb6(%rip),%rcx
cltd
idivl  (%rcx)
cvtsi2sd %edx,%xmm0
mov    0x2ea8(%rip),%rax
cvtsi2sdl (%rax),%xmm1
divsd  %xmm1,%xmm0
call   1030 <lua_pushnumber@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<math_random>:
push   %rax
xor    %eax,%eax
call   1040 <rand@plt>
mov    0x2eb9(%rip),%rcx
mov    (%rcx),%ecx
cltd
idiv   %ecx
cvtsi2sd %edx,%xmm0
cvtsi2sd %ecx,%xmm1
divsd  %xmm1,%xmm0
pop    %rax
jmp    1030 <lua_pushnumber@plt>

LLVM IR (-O0):
@RAND_MAX = global i32 0
define void @math_random() {
%1 = call i32 (...) @rand()
%2 = load i32, i32* @RAND_MAX
%3 = srem i32 %1, %2
%4 = sitofp i32 %3 to double
%5 = load i32, i32* @RAND_MAX
%6 = sitofp i32 %5 to double
%7 = fdiv double %4, %6
%8 = call i32 @lua_pushnumber(double %7)
ret void
}

LLVM IR (-O2):
@RAND_MAX = global i32 0
define void @math_random() {
%1 = tail call i32 (...) @rand()
%2 = load i32, i32* @RAND_MAX
%3 = srem i32 %1, %2
%4 = sitofp i32 %3 to double
%5 = sitofp i32 %2 to double
%6 = fdiv double %4, %5
%7 = tail call i32 @lua_pushnumber(double %6)
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t mvhd_from_be32(uint32_t val) {
  uint8_t *tmp = (uint8_t *)&val;
  uint32_t ret = 0;
  ret = (uint32_t)tmp[0] << 24;
  ret |= (uint32_t)tmp[1] << 16;
  ret |= (uint32_t)tmp[2] << 8;
  ret |= (uint32_t)tmp[3] << 0;
  return ret;
}


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

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

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

LLVM IR (-O2):
define i32 @mvhd_from_be32(i32 %0) {
ret i32 poison
}
/* Variables and functions */
int /*<<< orphan*/ executar_servidor();
int run_capivara(void) {
  executar_servidor();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @run_capivara() {
%1 = call i32 (...) @executar_servidor()
ret i32 0
}

LLVM IR (-O2):
define i32 @run_capivara() {
%1 = tail call i32 (...) @executar_servidor()
ret i32 0
}
void usage(argv) char *argv[];
{
  AJKNETusage("CPMFTP", "0.0.5", "FTP", argv[0],
              "the.network.IP.address nick [port]");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
lea    0xed6(%rip),%rdi
lea    0xed6(%rip),%rsi
lea    0xecb(%rip),%rdx
lea    0xece(%rip),%r8
mov    $0x0,%al
call   1030 <AJKNETusage@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    (%rdi),%rcx
lea    0xee6(%rip),%rdi
lea    0xee6(%rip),%rsi
lea    0xedb(%rip),%rdx
lea    0xede(%rip),%r8
xor    %eax,%eax
jmp    1030 <AJKNETusage@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"CPMFTP\00"
@.str.1 = [6 x i8] c"0.0.5\00"
@.str.2 = [4 x i8] c"FTP\00"
@.str.3 = [35 x i8] c"the.network.IP.address nick [port]\00"
define void @usage(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = getelementptr inbounds i8*, i8** %3, i64 0
%5 = load i8*, i8** %4
%6 = call i32 (i8*, i8*, i8*, i8*, i8*, ...) bitcast (i32 (...)* @AJKNETusage to i32 (i8*, i8*, i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %5, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"CPMFTP\00"
@.str.1 = [6 x i8] c"0.0.5\00"
@.str.2 = [4 x i8] c"FTP\00"
@.str.3 = [35 x i8] c"the.network.IP.address nick [port]\00"
define void @usage(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 (i8*, i8*, i8*, i8*, i8*, ...) bitcast (i32 (...)* @AJKNETusage to i32 (i8*, i8*, i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %2, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _IO(char, int);
int ioctl(int, int /*<<< orphan*/);
int /*<<< orphan*/ nvme_verify_chr(int);
int nvme_reset_controller(int fd) {
  nvme_verify_chr(fd);
  return ioctl(fd, _IO('N', 0x44));
}


x86 assembly (clang, -O0):
<nvme_reset_controller>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <nvme_verify_chr@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x4e,%edi
mov    $0x44,%esi
call   1030 <_IO@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
call   1040 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nvme_reset_controller>:
push   %rbx
mov    %edi,%ebx
call   1050 <nvme_verify_chr@plt>
mov    $0x4e,%edi
mov    $0x44,%esi
call   1030 <_IO@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1040 <ioctl@plt>

LLVM IR (-O0):
define i32 @nvme_reset_controller(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @nvme_verify_chr(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @_IO(i8 signext 78, i32 68)
%7 = call i32 @ioctl(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @nvme_reset_controller(i32 %0) {
%2 = tail call i32 @nvme_verify_chr(i32 %0)
%3 = tail call i32 @_IO(i8 signext 78, i32 68)
%4 = tail call i32 @ioctl(i32 %0, i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ foo();
int main(void) {
  foo();
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <foo@plt>
jmp    1126 <main+0x16>

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foo()
br label %2
2: ; preds = %2, %0
br label %2
}
__typeof__(memcpy(1, 1, (void *)1)) test_memcpy_112(void) {
  return memcpy(1, 1, (void *)1);
}


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

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

LLVM IR (-O0):
define i8* @test_memcpy_112() {
ret i8* inttoptr (i64 1 to i8*)
}

LLVM IR (-O2):
define i8* @test_memcpy_112() {
ret i8* inttoptr (i64 1 to i8*)
}
/* Variables and functions */
float sqrt(float);
float etr_high_area(float area) {
  float square_root_3 = sqrt(3);
  float side = sqrt(area / 0.433);
  float high = side * square_root_3 / 2;
  return high;
}


x86 assembly (clang, -O0):
<etr_high_area>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xedf(%rip),%xmm0
call   1030 <sqrt@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xec8(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1030 <sqrt@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  0xe9c(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<etr_high_area>:
push   %rax
cvtss2sd %xmm0,%xmm0
divsd  0xee3(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     112f <etr_high_area+0x1f>
sqrtss %xmm0,%xmm0
jmp    1134 <etr_high_area+0x24>
call   1030 <sqrt@plt>
mulss  0xecc(%rip),%xmm0
mulss  0xec8(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @etr_high_area(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %2
%6 = call float @sqrt(float 3.000000e+00)
store float %6, float* %3
%7 = load float, float* %2
%8 = fpext float %7 to double
%9 = fdiv double %8, 4.330000e-01
%10 = fptrunc double %9 to float
%11 = call float @sqrt(float %10)
store float %11, float* %4
%12 = load float, float* %4
%13 = load float, float* %3
%14 = fmul float %12, %13
%15 = fdiv float %14, 2.000000e+00
store float %15, float* %5
%16 = load float, float* %5
ret float %16
}

LLVM IR (-O2):
define float @etr_high_area(float %0) {
%2 = fpext float %0 to double
%3 = fdiv double %2, 4.330000e-01
%4 = fptrunc double %3 to float
%5 = tail call float @sqrt(float %4)
%6 = fmul float %5, 0x3FFBB67AE0000000
%7 = fmul float %6, 5.000000e-01
ret float %7
}
/* Variables and functions */
int /*<<< orphan*/ gmove_cp_1a1t_b();
int /*<<< orphan*/ gmove_cp_1a1t_b_c();
int /*<<< orphan*/ gmove_cp_1a1t_bc();
int /*<<< orphan*/ gmove_cp_1a1t_c();
int /*<<< orphan*/ gmove_cp_1a1t_gb();
int main() {
  gmove_cp_1a1t_b();
  gmove_cp_1a1t_b_c();
  gmove_cp_1a1t_bc();
  gmove_cp_1a1t_c();
  gmove_cp_1a1t_gb();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1070 <gmove_cp_1a1t_b@plt>
mov    $0x0,%al
call   1030 <gmove_cp_1a1t_b_c@plt>
mov    $0x0,%al
call   1050 <gmove_cp_1a1t_bc@plt>
mov    $0x0,%al
call   1040 <gmove_cp_1a1t_c@plt>
mov    $0x0,%al
call   1060 <gmove_cp_1a1t_gb@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1070 <gmove_cp_1a1t_b@plt>
xor    %eax,%eax
call   1030 <gmove_cp_1a1t_b_c@plt>
xor    %eax,%eax
call   1050 <gmove_cp_1a1t_bc@plt>
xor    %eax,%eax
call   1040 <gmove_cp_1a1t_c@plt>
xor    %eax,%eax
call   1060 <gmove_cp_1a1t_gb@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @gmove_cp_1a1t_b()
%3 = call i32 (...) @gmove_cp_1a1t_b_c()
%4 = call i32 (...) @gmove_cp_1a1t_bc()
%5 = call i32 (...) @gmove_cp_1a1t_c()
%6 = call i32 (...) @gmove_cp_1a1t_gb()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @gmove_cp_1a1t_b()
%2 = tail call i32 (...) @gmove_cp_1a1t_b_c()
%3 = tail call i32 (...) @gmove_cp_1a1t_bc()
%4 = tail call i32 (...) @gmove_cp_1a1t_c()
%5 = tail call i32 (...) @gmove_cp_1a1t_gb()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ mrf24j40_write_short_ctrl_reg(int, int);
void mrf24j40_bb_reset(void) { mrf24j40_write_short_ctrl_reg(0x2A, (1 << 1)); }


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

x86 assembly (clang, -O2):
<mrf24j40_bb_reset>:
mov    $0x2a,%edi
mov    $0x2,%esi
jmp    1030 <mrf24j40_write_short_ctrl_reg@plt>

LLVM IR (-O0):
define void @mrf24j40_bb_reset() {
%1 = call i32 @mrf24j40_write_short_ctrl_reg(i32 42, i32 2)
ret void
}

LLVM IR (-O2):
define void @mrf24j40_bb_reset() {
%1 = tail call i32 @mrf24j40_write_short_ctrl_reg(i32 42, i32 2)
ret void
}
/* Variables and functions */
int floor(double);
double mods3600(double x) {
  double y;
  y = x - 1296000. * floor(x / 1296000.);
  return (y);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xed4(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <floor@plt>
movsd  -0x18(%rbp),%xmm1
cvtsi2sd %eax,%xmm0
movsd  0xeb2(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rax
movsd  %xmm0,(%rsp)
divsd  0xee2(%rip),%xmm0
call   1030 <floor@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xed6(%rip),%xmm0
addsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @mods3600(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = load double, double* %2
%6 = fdiv double %5, 1.296000e+06
%7 = call i32 @floor(double %6)
%8 = sitofp i32 %7 to double
%9 = call double @llvm.fmuladd.f64(double -1.296000e+06, double %8, double %4)
store double %9, double* %3
%10 = load double, double* %3
ret double %10
}

LLVM IR (-O2):
define double @mods3600(double %0) {
%2 = fdiv double %0, 1.296000e+06
%3 = tail call i32 @floor(double %2)
%4 = sitofp i32 %3 to double
%5 = tail call double @llvm.fmuladd.f64(double %4, double -1.296000e+06, double %0)
ret double %5
}
/* Variables and functions */
int partition(int *, int, int);
void quicksort(int ar[], int l, int r) {
  int m = 0;
  if (l >= r) {
    return;
  }
  m = partition(ar, l, r);
  quicksort(ar, l, m - 1);
  quicksort(ar, m + 1, r);
}


x86 assembly (clang, -O0):
<quicksort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     114a <quicksort+0x2a>
jmp    1180 <quicksort+0x60>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <quicksort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <quicksort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quicksort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <quicksort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <quicksort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <quicksort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @quicksort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @partition(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @quicksort(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ parse_preference(char *, int);
void parse_global_process_buffer(char *buffer, int length) {
  if (buffer[0] == '.')
    parse_preference(buffer + 1, length - 1);
  return;
}


x86 assembly (clang, -O0):
<parse_global_process_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    1142 <parse_global_process_buffer+0x32>
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1030 <parse_preference@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_global_process_buffer>:
cmpb   $0x2e,(%rdi)
jne    1121 <parse_global_process_buffer+0x11>
add    $0x1,%rdi
add    $0xffffffff,%esi
jmp    1030 <parse_preference@plt>
ret

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

LLVM IR (-O2):
define void @parse_global_process_buffer(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 46
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = add nsw i32 %1, -1
%8 = tail call i32 @parse_preference(i8* %6, i32 %7)
br label %9
9: ; preds = %5, %2
ret void
}
int main() {
  int i, j;
  int c;
  c = 0;
  i = 0;
  while (i < 100) {
    c = c + 1;
    i = i + 1;
  }
  j = 5;
  while (j < 21) {
    c = c + 1;
    j = j + 3;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    113a <main+0x3a>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1119 <main+0x19>
movl   $0x5,-0xc(%rbp)
cmpl   $0x15,-0xc(%rbp)
jge    1162 <main+0x62>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0xc(%rbp)
jmp    1141 <main+0x41>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void foo069(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo069(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ range_char();
int /*<<< orphan*/ range_int();
int /*<<< orphan*/ range_long();
int /*<<< orphan*/ range_short();
int main(void) {
  range_char();
  range_short();
  range_int();
  range_long();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <range_char@plt>
mov    $0x0,%al
call   1030 <range_short@plt>
mov    $0x0,%al
call   1040 <range_int@plt>
mov    $0x0,%al
call   1050 <range_long@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <range_char@plt>
xor    %eax,%eax
call   1030 <range_short@plt>
xor    %eax,%eax
call   1040 <range_int@plt>
xor    %eax,%eax
call   1050 <range_long@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @range_char()
%3 = call i32 (...) @range_short()
%4 = call i32 (...) @range_int()
%5 = call i32 (...) @range_long()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @range_char()
%2 = tail call i32 (...) @range_short()
%3 = tail call i32 (...) @range_int()
%4 = tail call i32 (...) @range_long()
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int menu_hash_get_help_eo(uint32_t hash, char *s, size_t len) {
  int ret = 0;
  switch (hash) {
  case 0:
  default:
    ret = -1;
    break;
  }
  return ret;
}


x86 assembly (clang, -O0):
<menu_hash_get_help_eo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x4(%rbp),%eax
test   %eax,%eax
jne    112b <menu_hash_get_help_eo+0x2b>
jmp    1126 <menu_hash_get_help_eo+0x26>
jmp    112b <menu_hash_get_help_eo+0x2b>
movl   $0xffffffff,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @menu_hash_get_help_eo(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
store i32 0, i32* %7
%8 = load i32, i32* %4
switch i32 %8, label %10 [
i32 0, label %9
]
9: ; preds = %3
br label %10
10: ; preds = %3, %9
store i32 -1, i32* %7
br label %11
11: ; preds = %10
%12 = load i32, i32* %7
ret i32 %12
}

LLVM IR (-O2):
define i32 @menu_hash_get_help_eo(i32 %0, i8* nocapture readnone %1, i64 %2) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ NW_ShellExc(char *);
void NW_InquireIfconfig(void) { NW_ShellExc("ifconfig"); }


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"ifconfig\00"
define void @NW_InquireIfconfig() {
%1 = call i32 @NW_ShellExc(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"ifconfig\00"
define void @NW_InquireIfconfig() {
%1 = tail call i32 @NW_ShellExc(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int strcmp(char const *, char const *);
int str_cmp(void *n1, void *n2) {
  const char *na = n1, *nb = n2;
  return (strcmp(na, nb));
}


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

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

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

LLVM IR (-O2):
define i32 @str_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ err_exit(char *, int /*<<< orphan*/);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
void *xcalloc(size_t nmemb, size_t size) {
  void *p;
  p = calloc(nmemb, size);
  if (p == NULL && size != 0)
    err_exit("calloc failed: %s", strerror(errno));
  return p;
}


x86 assembly (clang, -O0):
<xcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1183 <xcalloc+0x53>
cmpq   $0x0,-0x10(%rbp)
je     1183 <xcalloc+0x53>
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    %eax,%esi
lea    0xe82(%rip),%rdi
call   1040 <err_exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1030 <calloc@plt>
mov    %rax,%r14
test   %rbx,%rbx
je     1165 <xcalloc+0x35>
test   %r14,%r14
jne    1165 <xcalloc+0x35>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xea2(%rip),%rdi
mov    %eax,%esi
call   1040 <err_exit@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [18 x i8] c"calloc failed: %s\00"
@errno = global i32 0
define noalias i8* @xcalloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
%5 = icmp ne i64 %1, 0
%6 = and i1 %5, %4
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i32, i32* @errno
%9 = tail call i32 @strerror(i32 %8)
%10 = tail call i32 @err_exit(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %7, %2
ret i8* %3
}
/* Type definitions */
typedef scalar_t__ uint16_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
scalar_t__ f16(int /*<<< orphan*/);
bool isLFilled16(uint16_t i) {
  return i == 0 ? false : f16((int32_t)i) == ~(uint16_t)0;
}


x86 assembly (clang, -O0):
<isLFilled16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1131 <isLFilled16+0x21>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    114b <isLFilled16+0x3b>
mov    -0x8(%rbp),%rax
mov    %eax,%edi
call   1030 <f16@plt>
cmp    $0xffffffffffffffff,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isLFilled16>:
test   %rdi,%rdi
je     112c <isLFilled16+0x1c>
push   %rax
call   1030 <f16@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0xffffffffffffffff,%rcx
sete   %al
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @isLFilled16(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %12
6: ; preds = %1
%7 = load i64, i64* %2
%8 = trunc i64 %7 to i32
%9 = call i64 @f16(i32 %8)
%10 = icmp eq i64 %9, -1
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %6, %5
%13 = phi i32 [ 0, %5 ], [ %11, %6 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @isLFilled16(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = trunc i64 %0 to i32
%5 = tail call i64 @f16(i32 %4)
%6 = icmp eq i64 %5, -1
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %1, %3
%9 = phi i32 [ %7, %3 ], [ 0, %1 ]
ret i32 %9
}
void f2(const char *str) {
  unsigned char ch, cl, *p;
  p = (unsigned char *)str;
  ch = *p++;
  cl = *p++;
  if (!cl)
    cl = 'a';
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%al
mov    %al,-0x9(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%al
mov    %al,-0xa(%rbp)
cmpb   $0x0,-0xa(%rbp)
jne    1146 <f2+0x46>
movb   $0x61,-0xa(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @f2(i8* nocapture %0) {
ret void
}