xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ insertValues();
int /*<<< orphan*/ printValues();
int /*<<< orphan*/ quicksort(int /*<<< orphan*/, int);
int main() {
  insertValues();
  quicksort(0, 50 - 1);
  printValues();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <insertValues@plt>
xor    %edi,%edi
mov    $0x31,%esi
call   1030 <quicksort@plt>
mov    $0x0,%al
call   1050 <printValues@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <insertValues@plt>
xor    %edi,%edi
mov    $0x31,%esi
call   1030 <quicksort@plt>
xor    %eax,%eax
call   1050 <printValues@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @insertValues()
%3 = call i32 @quicksort(i32 0, i32 49)
%4 = call i32 (...) @printValues()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @insertValues()
%2 = tail call i32 @quicksort(i32 0, i32 49)
%3 = tail call i32 (...) @printValues()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ g(int *, int);
void f(int y, int *z) {
  if (y > 0) {
    f(y - 1, z);
    g(z, y);
  } else
    *z = 1;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1159 <f+0x39>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
mov    -0x10(%rbp),%rsi
call   1030 <f@plt>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1040 <g@plt>
jmp    1163 <f+0x43>
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
test   %edi,%edi
jle    1149 <f+0x29>
mov    %edi,%ebx
lea    -0x1(%rbx),%edi
mov    %r14,%rsi
call   1030 <f@plt>
mov    %r14,%rdi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <g@plt>
movl   $0x1,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @f(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 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %14
7: ; preds = %2
%8 = load i32, i32* %3
%9 = sub nsw i32 %8, 1
%10 = load i32*, i32** %4
%11 = load i32*, i32** %4
%12 = load i32, i32* %3
%13 = call i32 @g(i32* %11, i32 %12)
br label %16
14: ; preds = %2
%15 = load i32*, i32** %4
store i32 1, i32* %15
br label %16
16: ; preds = %14, %7
ret void
}

LLVM IR (-O2):
define void @f(i32 %0, i32* %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %5, label %8
4: ; preds = %8, %5
ret void
5: ; preds = %2
%6 = add nsw i32 %0, -1
tail call void @f(i32 %6, i32* %1)
%7 = tail call i32 @g(i32* %1, i32 %0)
br label %4
8: ; preds = %2
store i32 1, i32* %1
br label %4
}
/* Variables and functions */
unsigned char inb(unsigned int);
int /*<<< orphan*/ outb(int, unsigned int);
int smbus_stop_condition(unsigned smbus_io_base) {
  unsigned char val;
  val = inb(smbus_io_base + 0x03);
  outb((0x01 << 1), smbus_io_base + 0x03);
  return 0;
}


x86 assembly (clang, -O0):
<smbus_stop_condition>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
add    $0x3,%edi
call   1040 <inb@plt>
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%esi
add    $0x3,%esi
mov    $0x2,%edi
call   1030 <outb@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smbus_stop_condition>:
push   %rbx
lea    0x3(%rdi),%ebx
mov    %ebx,%edi
call   1040 <inb@plt>
mov    $0x2,%edi
mov    %ebx,%esi
call   1030 <outb@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @smbus_stop_condition(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = add i32 %4, 3
%6 = call zeroext i8 @inb(i32 %5)
store i8 %6, i8* %3
%7 = load i32, i32* %2
%8 = add i32 %7, 3
%9 = call i32 @outb(i32 2, i32 %8)
ret i32 0
}

LLVM IR (-O2):
define i32 @smbus_stop_condition(i32 %0) {
%2 = add i32 %0, 3
%3 = tail call zeroext i8 @inb(i32 %2)
%4 = tail call i32 @outb(i32 2, i32 %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ end_game();
int /*<<< orphan*/ mvaddstr(int, int, char *);
void you_lost() {
  mvaddstr(24 / 2, 48 / 2, " YOU HAVE LOST! :( ");
  end_game();
}


x86 assembly (clang, -O0):
<you_lost>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc,%edi
mov    $0x18,%esi
lea    0xecb(%rip),%rdx
call   1030 <mvaddstr@plt>
mov    $0x0,%al
call   1040 <end_game@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<you_lost>:
push   %rax
lea    0xed8(%rip),%rdx
mov    $0xc,%edi
mov    $0x18,%esi
call   1030 <mvaddstr@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <end_game@plt>

LLVM IR (-O0):
@.str = [20 x i8] c" YOU HAVE LOST! :( \00"
define void @you_lost() {
%1 = call i32 @mvaddstr(i32 12, i32 24, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @end_game()
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c" YOU HAVE LOST! :( \00"
define void @you_lost() {
%1 = tail call i32 @mvaddstr(i32 12, i32 24, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @end_game()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void idea_set_decrypt_key(void *encrypt_ks, void *decrypt_ks) {
  printf("idea_set_decrypt_key stubbed\n");
  (void)&(encrypt_ks);
  (void)&(decrypt_ks);
}


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

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

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

LLVM IR (-O2):
@str = [29 x i8] c"idea_set_decrypt_key stubbed\00"
define void @idea_set_decrypt_key(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
ret void
}
void timeR_init_early(void) {}


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

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

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

LLVM IR (-O2):
define void @timeR_init_early() {
ret void
}
/* Type definitions */
struct language_function {
  int dummy;
};

/* Variables and functions */
scalar_t__ ggc_test_and_set_mark(struct language_function *const);
void gt_ggc_mx_language_function(void *x_p) {
  struct language_function *const x = (struct language_function *)x_p;
  if (ggc_test_and_set_mark(x)) {
  }
}


x86 assembly (clang, -O0):
<gt_ggc_mx_language_function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <ggc_test_and_set_mark@plt>
cmp    $0x0,%rax
je     113c <gt_ggc_mx_language_function+0x2c>
jmp    113c <gt_ggc_mx_language_function+0x2c>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gt_ggc_mx_language_function>:
jmp    1030 <ggc_test_and_set_mark@plt>

LLVM IR (-O0):
%struct.language_function = type { i32 }
define void @gt_ggc_mx_language_function(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.language_function*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct.language_function*
store %struct.language_function* %5, %struct.language_function** %3
%6 = load %struct.language_function*, %struct.language_function** %3
%7 = call i64 @ggc_test_and_set_mark(%struct.language_function* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
br label %10
10: ; preds = %9, %1
ret void
}

LLVM IR (-O2):
%struct.language_function = type { i32 }
define void @gt_ggc_mx_language_function(i8* %0) {
%2 = bitcast i8* %0 to %struct.language_function*
%3 = tail call i64 @ggc_test_and_set_mark(%struct.language_function* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ WNOHANG;
scalar_t__ waitpid(int, int /*<<< orphan*/ *, int /*<<< orphan*/);
void handle(int sig) {
  while (waitpid(-1, NULL, WNOHANG) > 0)
    ;
}


x86 assembly (clang, -O0):
<handle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <waitpid@plt>
cmp    $0x0,%rax
jle    1141 <handle+0x31>
jmp    111b <handle+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle>:
push   %rbx
mov    0x2ed0(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    (%rbx),%edx
mov    $0xffffffff,%edi
xor    %esi,%esi
call   1030 <waitpid@plt>
test   %rax,%rax
jg     1120 <handle+0x10>
pop    %rbx
ret

LLVM IR (-O0):
@WNOHANG = global i32 0
define void @handle(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %7, %1
%4 = load i32, i32* @WNOHANG
%5 = call i64 @waitpid(i32 -1, i32* null, i32 %4)
%6 = icmp sgt i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
ret void
}

LLVM IR (-O2):
@WNOHANG = global i32 0
define void @handle(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = load i32, i32* @WNOHANG
%4 = tail call i64 @waitpid(i32 -1, i32* null, i32 %3)
%5 = icmp sgt i64 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2
ret void
}
char *strchr(const char *s, int c) {
  char *ptr = (char *)s;
  while (*ptr != (char)c) {
    if (*ptr == '\0')
      return ((void *)0);
    ptr++;
  }
  return ptr;
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
mov    -0x14(%rbp),%ecx
movsbl %cl,%ecx
cmp    %ecx,%eax
je     1156 <strchr+0x56>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1145 <strchr+0x45>
movq   $0x0,-0x8(%rbp)
jmp    115e <strchr+0x5e>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1113 <strchr+0x13>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
mov    %rdi,%rax
movsbl %sil,%ecx
movsbl (%rdi),%edx
cmp    %edx,%ecx
je     1120 <strchr+0x20>
xchg   %ax,%ax
test   %dl,%dl
je     1121 <strchr+0x21>
movsbl 0x1(%rax),%edx
add    $0x1,%rax
cmp    %edx,%ecx
jne    1110 <strchr+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
%3 = shl i32 %1, 24
%4 = ashr exact i32 %3, 24
%5 = load i8, i8* %0
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %4, %6
br i1 %7, label %17, label %8
8: ; preds = %2, %12
%9 = phi i8 [ %14, %12 ], [ %5, %2 ]
%10 = phi i8* [ %13, %12 ], [ %0, %2 ]
%11 = icmp eq i8 %9, 0
br i1 %11, label %17, label %12
12: ; preds = %8
%13 = getelementptr inbounds i8, i8* %10, i64 1
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %4, %15
br i1 %16, label %17, label %8
17: ; preds = %8, %12, %2
%18 = phi i8* [ %0, %2 ], [ %13, %12 ], [ null, %8 ]
ret i8* %18
}
float recombination_to_mutation_ratio(int number_of_recombinations,
                                      int number_of_snps) {
  if (number_of_snps == 0) {
    return 0;
  }
  return (number_of_recombinations * 1.0) / (number_of_snps * 1.0);
}


x86 assembly (clang, -O0):
<recombination_to_mutation_ratio>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1121 <recombination_to_mutation_ratio+0x21>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1150 <recombination_to_mutation_ratio+0x50>
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xed2(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
movsd  0xec1(%rip),%xmm2
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<recombination_to_mutation_ratio>:
test   %esi,%esi
je     1115 <recombination_to_mutation_ratio+0x15>
cvtsi2sd %edi,%xmm0
cvtsi2sd %esi,%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
ret
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @recombination_to_mutation_ratio(i32 %0, i32 %1) {
%3 = alloca float
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
store float 0.000000e+00, float* %3
br label %18
9: ; preds = %2
%10 = load i32, i32* %4
%11 = sitofp i32 %10 to double
%12 = fmul double %11, 1.000000e+00
%13 = load i32, i32* %5
%14 = sitofp i32 %13 to double
%15 = fmul double %14, 1.000000e+00
%16 = fdiv double %12, %15
%17 = fptrunc double %16 to float
store float %17, float* %3
br label %18
18: ; preds = %9, %8
%19 = load float, float* %3
ret float %19
}

LLVM IR (-O2):
define float @recombination_to_mutation_ratio(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = sitofp i32 %0 to double
%6 = sitofp i32 %1 to double
%7 = fdiv double %5, %6
%8 = fptrunc double %7 to float
br label %9
9: ; preds = %2, %4
%10 = phi float [ %8, %4 ], [ 0.000000e+00, %2 ]
ret float %10
}
int host1x_dummy_submit(struct host1x_client *client, struct host1x_job *job) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.host1x_client = type opaque
%struct.host1x_job = type opaque
define i32 @host1x_dummy_submit(%struct.host1x_client* %0, %struct.host1x_job* %1) {
%3 = alloca %struct.host1x_client*
%4 = alloca %struct.host1x_job*
store %struct.host1x_client* %0, %struct.host1x_client** %3
store %struct.host1x_job* %1, %struct.host1x_job** %4
ret i32 0
}

LLVM IR (-O2):
%struct.host1x_client = type opaque
%struct.host1x_job = type opaque
define i32 @host1x_dummy_submit(%struct.host1x_client* nocapture readnone %0, %struct.host1x_job* nocapture readnone %1) {
ret i32 0
}
int do_839() { return 839; }


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

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

LLVM IR (-O0):
define i32 @do_839() {
ret i32 839
}

LLVM IR (-O2):
define i32 @do_839() {
ret i32 839
}
/* Type definitions */
typedef int /*<<< orphan*/ __u64;

/* Variables and functions */
int /*<<< orphan*/ hea_set_u64_bits(int /*<<< orphan*/, int /*<<< orphan*/, int,
                                    int);
void hea_cq_aer_intern_err_reset(__u64 *aer) {
  *aer = hea_set_u64_bits(*aer, 0, 10, 34);
}


x86 assembly (clang, -O0):
<hea_cq_aer_intern_err_reset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
xor    %esi,%esi
mov    $0xa,%edx
mov    $0x22,%ecx
call   1030 <hea_set_u64_bits@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hea_cq_aer_intern_err_reset>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
xor    %esi,%esi
mov    $0xa,%edx
mov    $0x22,%ecx
call   1030 <hea_set_u64_bits@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @hea_cq_aer_intern_err_reset(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = call i32 @hea_set_u64_bits(i32 %4, i32 0, i32 10, i32 34)
%6 = load i32*, i32** %2
store i32 %5, i32* %6
ret void
}

LLVM IR (-O2):
define void @hea_cq_aer_intern_err_reset(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @hea_set_u64_bits(i32 %2, i32 0, i32 10, i32 34)
store i32 %3, i32* %0
ret void
}
void fn_test1(void) { printf("extern: %s\n", __func__); }


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

x86 assembly (clang, -O2):
<fn_test1>:
lea    0xee9(%rip),%rdi
lea    0xeee(%rip),%rsi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"extern: %s\0A\00"
@__func__.fn_test1 = [9 x i8] c"fn_test1\00"
define void @fn_test1() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__func__.fn_test1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"extern: %s\0A\00"
@__func__.fn_test1 = [9 x i8] c"fn_test1\00"
define void @fn_test1() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__func__.fn_test1, i64 0, i64 0))
ret void
}
void csv_disp_at(double n, double perct) {}


x86 assembly (clang, -O0):
<csv_disp_at>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @csv_disp_at(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
ret void
}

LLVM IR (-O2):
define void @csv_disp_at(double %0, double %1) {
ret void
}
void fa151(void) {
P0A:
  goto P0A;
  ({
    P01A:
      goto P01A;
      ({
        P012A:
          goto P012A;
          0;
      });
    P01B:
      goto P01B;
      ({
        P013A:
          goto P013A;
          0;
      });
    P01C:
      goto P01C;
      0;
  });
P0B:
  goto P0B;
  ({
    P02A:
      goto P02A;
      ({
        P024A:
          goto P024A;
          0;
      });
    P02B:
      goto P02B;
      ({
        p025A:
          goto p025A;
          goto a;
        P025A:
          goto P025A;
          0;
      });
    a:
      0;
  });
P0C:
  goto P0C;
  0;
P0D:
  goto P0D;
}


x86 assembly (clang, -O0):
<fa151>:
push   %rbp
mov    %rsp,%rbp
jmp    1104 <fa151+0x4>

x86 assembly (clang, -O2):
<fa151>:
jmp    1100 <fa151>

LLVM IR (-O0):
define void @fa151() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
br label %7
7: ; preds = %7, %0
br label %7
8: ; No predecessors!
br label %9
9: ; preds = %9, %8
br label %9
10: ; No predecessors!
br label %11
11: ; preds = %11, %10
br label %11
12: ; preds = %12
br label %12
13: ; No predecessors!
br label %14
14: ; preds = %14, %13
br label %14
15: ; preds = %15
br label %15
16: ; preds = %16
br label %16
17: ; No predecessors!
br label %18
18: ; preds = %18, %17
br label %18
19: ; No predecessors!
br label %20
20: ; preds = %20, %19
br label %20
21: ; preds = %21
br label %21
22: ; No predecessors!
br label %23
23: ; preds = %23, %22
br label %23
24: ; preds = %24
br label %24
25: ; preds = %25
br label %25
26: ; preds = %26
br label %26
}

LLVM IR (-O2):
define void @fa151() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ standardBenchmark(int, int /*<<< orphan*/, int, int, int);
int main(int argc, char **argv) {
  printf("Starting benchmark\n");
  standardBenchmark(1024, 0, 1024, 65536, 2048);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    $0x400,%edx
xor    %esi,%esi
mov    $0x10000,%ecx
mov    $0x800,%r8d
mov    %edx,%edi
call   1040 <standardBenchmark@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x400,%edi
xor    %esi,%esi
mov    $0x400,%edx
mov    $0x10000,%ecx
mov    $0x800,%r8d
call   1040 <standardBenchmark@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Starting benchmark\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @standardBenchmark(i32 1024, i32 0, i32 1024, i32 65536, i32 2048)
ret i32 0
}

LLVM IR (-O2):
@str = [19 x i8] c"Starting benchmark\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @standardBenchmark(i32 1024, i32 0, i32 1024, i32 65536, i32 2048)
ret i32 0
}
void glEnableVertexAttribArray(unsigned int index) {}


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

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

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

LLVM IR (-O2):
define void @glEnableVertexAttribArray(i32 %0) {
ret void
}
int main() {
  int i, a = 0;
  for (i = 0; i < 1024; i++) {
    a += i;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x400,-0x8(%rbp)
jge    113d <main+0x3d>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1119 <main+0x19>
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
store i32 0, i32* %1
store i32 0, i32* %3
store i32 0, i32* %2
br label %4
4: ; preds = %11, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 1024
br i1 %6, label %7, label %14
7: ; preds = %4
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = add nsw i32 %9, %8
store i32 %10, i32* %3
br label %11
11: ; preds = %7
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
br label %4
14: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef scalar_t__ volatile uint16_t;

/* Variables and functions */
uint16_t volatile_fetch_add_u16(volatile uint16_t *dest, uint16_t val) {
  uint16_t result = *dest;
  *dest = result + val;
  return result;
}


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

x86 assembly (clang, -O2):
<volatile_fetch_add_u16>:
mov    %rsi,-0x8(%rsp)
mov    (%rdi),%rax
mov    %rax,-0x10(%rsp)
mov    -0x10(%rsp),%rax
add    -0x8(%rsp),%rax
mov    %rax,(%rdi)
mov    -0x10(%rsp),%rax
ret

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

LLVM IR (-O2):
define i64 @volatile_fetch_add_u16(i64* %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %1, i64* %3
%5 = bitcast i64* %4 to i8*
%6 = load volatile i64, i64* %0
store volatile i64 %6, i64* %4
%7 = load volatile i64, i64* %4
%8 = load volatile i64, i64* %3
%9 = add nsw i64 %8, %7
store volatile i64 %9, i64* %0
%10 = load volatile i64, i64* %4
ret i64 %10
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
bool SHAREMIND_SET_KEY_EQUALS_uint64_t(uint64_t const k1, uint64_t const k2) {
  return k1 == k2;
}


x86 assembly (clang, -O0):
<SHAREMIND_SET_KEY_EQUALS_uint64_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHAREMIND_SET_KEY_EQUALS_uint64_t>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @SHAREMIND_SET_KEY_EQUALS_uint64_t(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp eq i64 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

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

/* Variables and functions */
uint32_t get_reg32(uint32_t base, uint8_t reg) {
  if (base == 0)
    return 0;
  return *(uint32_t *)(base + reg);
}


x86 assembly (clang, -O0):
<get_reg32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1124 <get_reg32+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1133 <get_reg32+0x33>
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_reg32>:
test   %rdi,%rdi
je     110a <get_reg32+0xa>
mov    (%rsi,%rdi,1),%rax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @get_reg32(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, 0
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = add nsw i64 %1, %0
%6 = inttoptr i64 %5 to i64*
%7 = load i64, i64* %6
br label %8
8: ; preds = %2, %4
%9 = phi i64 [ %7, %4 ], [ 0, %2 ]
ret i64 %9
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ clearconsole();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ random_encounter();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(void) {
  clearconsole();
  srand(time(NULL));
  random_encounter();
  (void)putchar('\n');
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1080 <clearconsole@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    $0x0,%al
call   1070 <random_encounter@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x2e42(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1080 <clearconsole@plt>
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
xor    %eax,%eax
call   1070 <random_encounter@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x2e52(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @clearconsole()
%3 = call i32 @time(i32* null)
%4 = call i32 @srand(i32 %3)
%5 = call i32 (...) @random_encounter()
%6 = call i32 @putchar(i8 signext 10)
%7 = load i32, i32* @EXIT_SUCCESS
%8 = call i32 @exit(i32 %7)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @clearconsole()
%2 = tail call i32 @time(i32* null)
%3 = tail call i32 @srand(i32 %2)
%4 = tail call i32 (...) @random_encounter()
%5 = tail call i32 @putchar(i8 signext 10)
%6 = load i32, i32* @EXIT_SUCCESS
%7 = tail call i32 @exit(i32 %6)
unreachable
}
/* Variables and functions */
int ht_hash(char const *, int, int const);
int ht_get_hash(const char *s, const int num_buckets, const int attempt) {
  const int hash_a = ht_hash(s, 223, num_buckets);
  const int hash_b = ht_hash(s, 277, num_buckets);
  return (hash_a + (attempt * (hash_b + 1))) % num_buckets;
}


x86 assembly (clang, -O0):
<ht_get_hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    $0xdf,%esi
call   1030 <ht_hash@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    $0x115,%esi
call   1030 <ht_hash@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x10(%rbp),%ecx
mov    -0x18(%rbp),%edx
add    $0x1,%edx
imul   %edx,%ecx
add    %ecx,%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ht_get_hash>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
mov    $0xdf,%esi
mov    %ebp,%edx
call   1030 <ht_hash@plt>
mov    %eax,%r15d
mov    %rbx,%rdi
mov    $0x115,%esi
mov    %ebp,%edx
call   1030 <ht_hash@plt>
add    $0x1,%eax
imul   %r14d,%eax
add    %r15d,%eax
cltd
idiv   %ebp
mov    %edx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ht_get_hash(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i8*, i8** %4
%10 = load i32, i32* %5
%11 = call i32 @ht_hash(i8* %9, i32 223, i32 %10)
store i32 %11, i32* %7
%12 = load i8*, i8** %4
%13 = load i32, i32* %5
%14 = call i32 @ht_hash(i8* %12, i32 277, i32 %13)
store i32 %14, i32* %8
%15 = load i32, i32* %7
%16 = load i32, i32* %6
%17 = load i32, i32* %8
%18 = add nsw i32 %17, 1
%19 = mul nsw i32 %16, %18
%20 = add nsw i32 %15, %19
%21 = load i32, i32* %5
%22 = srem i32 %20, %21
ret i32 %22
}

LLVM IR (-O2):
define i32 @ht_get_hash(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @ht_hash(i8* %0, i32 223, i32 %1)
%5 = tail call i32 @ht_hash(i8* %0, i32 277, i32 %1)
%6 = add nsw i32 %5, 1
%7 = mul nsw i32 %6, %2
%8 = add nsw i32 %7, %4
%9 = srem i32 %8, %1
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ puts(char *);
void test07_head() {
  do {
    printf("test07");
    puts("");
  } while (0);
}


x86 assembly (clang, -O0):
<test07_head>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <test07_head+0x9>
lea    0xed0(%rip),%rdi
call   1040 <printf@plt>
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test07_head>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"test07\00"
@.str.1 = [1 x i8] zeroinitializer
define void @test07_head() {
br label %1
1: ; preds = %0
%2 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %4
4: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"test07\00"
define void @test07_head() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_instruction(void) {
  printf("\n\tWelcome to the gsat Tool!\n\t"
         "\x1B[36m"
         "(c) Emanuel Gitterle    Tirol\n"
         "\x1B[0m");
  printf("\n\tPleas give a file in DIMACS format as first argument\n\tlike so: "
         " /path/filename.cnf\n\n");
}


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

x86 assembly (clang, -O2):
<print_instruction>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <printf@plt>
lea    0xf11(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [69 x i8] c"\0A\09Welcome to the gsat Tool!\0A\09\1B[36m(c) Emanuel Gitterle Tirol\0A\1B[0m\00"
@.str.1 = [87 x i8] c"\0A\09Pleas give a file in DIMACS format as first argument\0A\09like so: /path/filename.cnf\0A\0A\00"
define void @print_instruction() {
%1 = call i32 @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [69 x i8] c"\0A\09Welcome to the gsat Tool!\0A\09\1B[36m(c) Emanuel Gitterle Tirol\0A\1B[0m\00"
@str = [86 x i8] c"\0A\09Pleas give a file in DIMACS format as first argument\0A\09like so: /path/filename.cnf\0A\00"
define void @print_instruction() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([86 x i8], [86 x i8]* @str, i64 0, i64 0))
ret void
}
unsigned int readu4(unsigned char *p) {
  return p[0] | p[1] << 8 | p[2] << 16 | p[3] << 24;
}


x86 assembly (clang, -O0):
<readu4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @readu4(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 = zext i8 %5 to i32
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 8
%12 = or i32 %6, %11
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i64 2
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = shl i32 %16, 16
%18 = or i32 %12, %17
%19 = load i8*, i8** %2
%20 = getelementptr inbounds i8, i8* %19, i64 3
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
%23 = shl i32 %22, 24
%24 = or i32 %18, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @readu4(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %3
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl nuw nsw i32 %11, 16
%13 = or i32 %8, %12
%14 = getelementptr inbounds i8, i8* %0, i64 3
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = shl nuw i32 %16, 24
%18 = or i32 %13, %17
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char const *const);
void uninitvar_strcat(char *dest, const char *const source) {
  char *deststr;
  char *srcstr;
  (void)strcat(deststr, srcstr);
  (void)strcat(dest, srcstr);
  (void)strcat(deststr, source);
  (void)strcat(dest, source);
}


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

x86 assembly (clang, -O2):
<uninitvar_strcat>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strcat@plt>
mov    %rbx,%rdi
call   1030 <strcat@plt>
mov    %r14,%rsi
call   1030 <strcat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <strcat@plt>

LLVM IR (-O0):
define void @uninitvar_strcat(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** %5
%8 = load i8*, i8** %6
%9 = call i32 @strcat(i8* %7, i8* %8)
%10 = load i8*, i8** %3
%11 = load i8*, i8** %6
%12 = call i32 @strcat(i8* %10, i8* %11)
%13 = load i8*, i8** %5
%14 = load i8*, i8** %4
%15 = call i32 @strcat(i8* %13, i8* %14)
%16 = load i8*, i8** %3
%17 = load i8*, i8** %4
%18 = call i32 @strcat(i8* %16, i8* %17)
ret void
}

LLVM IR (-O2):
define void @uninitvar_strcat(i8* %0, i8* %1) {
%3 = tail call i32 @strcat(i8* undef, i8* undef)
%4 = tail call i32 @strcat(i8* %0, i8* undef)
%5 = tail call i32 @strcat(i8* undef, i8* %1)
%6 = tail call i32 @strcat(i8* %0, i8* %1)
ret void
}
int function(void) {
  static int i, state = 0;
  switch (state) {
  case 0:
    goto LABEL0;
  case 1:
    goto LABEL1;
  }
LABEL0:
  for (i = 0; i < 10; i++) {
    state = 1;
    return i;
  LABEL1:;
  }
}


x86 assembly (clang, -O0):
<function>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f1e(%rip),%eax
mov    %eax,-0x8(%rbp)
test   %eax,%eax
je     112b <function+0x2b>
jmp    111a <function+0x1a>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
je     1130 <function+0x30>
jmp    1135 <function+0x35>
jmp    113a <function+0x3a>
jmp    1169 <function+0x69>
jmp    113a <function+0x3a>
movl   $0x0,0x2ee0(%rip)
cmpl   $0xa,0x2ed9(%rip)
jge    1182 <function+0x82>
movl   $0x1,0x2ecd(%rip)
mov    0x2ec3(%rip),%eax
mov    %eax,-0x4(%rbp)
jmp    1182 <function+0x82>
jmp    116e <function+0x6e>
mov    0x2eb0(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2ea7(%rip)
jmp    1144 <function+0x44>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<function>:
mov    0x2f1e(%rip),%ecx
add    $0x1,%ecx
xor    %eax,%eax
cmpb   $0x0,0x2f16(%rip)
cmovne %ecx,%eax
mov    %eax,0x2f09(%rip)
cmp    $0x9,%eax
jg     1127 <function+0x27>
movb   $0x1,0x2f01(%rip)
ret

LLVM IR (-O0):
@function.i = internal global i32 0
@function.state = internal global i32 0
define i32 @function() {
%1 = alloca i32
%2 = load i32, i32* @function.state
switch i32 %2, label %5 [
i32 0, label %3
i32 1, label %4
]
3: ; preds = %0
br label %6
4: ; preds = %0
br label %12
5: ; preds = %0
br label %6
6: ; preds = %5, %3
store i32 0, i32* @function.i
br label %7
7: ; preds = %13, %6
%8 = load i32, i32* @function.i
%9 = icmp slt i32 %8, 10
br i1 %9, label %10, label %16
10: ; preds = %7
store i32 1, i32* @function.state
%11 = load i32, i32* @function.i
store i32 %11, i32* %1
br label %16
12: ; preds = %4
br label %13
13: ; preds = %12
%14 = load i32, i32* @function.i
%15 = add nsw i32 %14, 1
store i32 %15, i32* @function.i
br label %7
16: ; preds = %10, %7
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
@function.i = internal unnamed_addr global i32 0
@function.state = internal unnamed_addr global i1 false
define i32 @function() {
%1 = load i1, i1* @function.state
%2 = load i32, i32* @function.i
%3 = add nsw i32 %2, 1
%4 = select i1 %1, i32 %3, i32 0
store i32 %4, i32* @function.i
%5 = icmp slt i32 %4, 10
br i1 %5, label %6, label %7
6: ; preds = %0
store i1 true, i1* @function.state
br label %7
7: ; preds = %6, %0
ret i32 %4
}
void xil_mstats(int verbosity) {}


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

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

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

LLVM IR (-O2):
define void @xil_mstats(i32 %0) {
ret void
}
main() {
  __complex__ double x;
  x = xcexp(1.0i);
  if (__real__ x != -1.0)
    abort();
  if (__imag__ x != 0.0)
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xeb9(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
mov    $0x2,%al
call   1050 <xcexp@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xe7d(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1198 <main+0x68>
jp     1198 <main+0x68>
jmp    119d <main+0x6d>
call   1030 <abort@plt>
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    11ba <main+0x8a>
jp     11ba <main+0x8a>
jmp    11bf <main+0x8f>
call   1030 <abort@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xec7(%rip),%xmm1
xorps  %xmm0,%xmm0
mov    $0x2,%al
call   1050 <xcexp@plt>
cmp    $0xffffffff,%eax
jne    114f <main+0x1f>
xor    %edi,%edi
call   1040 <exit@plt>
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca { double, double }
%3 = alloca { double, double }
store i32 0, i32* %1
%4 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 0
%5 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 1
store double 0.000000e+00, double* %4
store double 1.000000e+00, double* %5
%6 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 0
%7 = load double, double* %6
%8 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 1
%9 = load double, double* %8
%10 = call i32 (double, double, ...) bitcast (i32 (...)* @xcexp to i32 (double, double, ...)*)(double %7, double %9)
%11 = sitofp i32 %10 to double
%12 = getelementptr inbounds { double, double }, { double, double }* %2, i32 0, i32 0
%13 = getelementptr inbounds { double, double }, { double, double }* %2, i32 0, i32 1
store double %11, double* %12
store double 0.000000e+00, double* %13
%14 = getelementptr inbounds { double, double }, { double, double }* %2, i32 0, i32 0
%15 = load double, double* %14
%16 = fcmp une double %15, -1.000000e+00
br i1 %16, label %17, label %18
17: ; preds = %0
unreachable
18: ; preds = %0
%19 = getelementptr inbounds { double, double }, { double, double }* %2, i32 0, i32 1
%20 = load double, double* %19
%21 = fcmp une double %20, 0.000000e+00
br i1 %21, label %22, label %23
22: ; preds = %18
unreachable
23: ; preds = %18
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (double, double, ...) bitcast (i32 (...)* @xcexp to i32 (double, double, ...)*)(double 0.000000e+00, double 1.000000e+00)
%2 = icmp eq i32 %1, -1
br i1 %2, label %4, label %3
3: ; preds = %0
tail call void @abort()
unreachable
4: ; preds = %0
tail call void @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ strtok_r(char *, char *, char **);
int main() {
  char *brkb;
  char strbuf[] = "abc";
  strtok_r(strbuf, ":", &brkb);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xedb(%rip),%eax
mov    %eax,-0x14(%rbp)
lea    -0x14(%rbp),%rdi
lea    0xed1(%rip),%rsi
lea    -0x10(%rbp),%rdx
call   1030 <strtok_r@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movl   $0x636261,0xc(%rsp)
lea    0xedd(%rip),%rsi
lea    0xc(%rsp),%rdi
lea    0x10(%rsp),%rdx
call   1030 <strtok_r@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.strbuf = [4 x i8] c"abc\00"
@.str = [2 x i8] c":\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca [4 x i8]
store i32 0, i32* %1
%4 = bitcast [4 x i8]* %3 to i8*
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%6 = call i32 @strtok_r(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c":\00"
define i32 @main() {
%1 = alloca i8*
%2 = alloca i32
%3 = bitcast i8** %1 to i8*
%4 = bitcast i32* %2 to i8*
store i32 6513249, i32* %2
%5 = call i32 @strtok_r(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %1)
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ send_event;
};
struct TYPE_4__ {
  TYPE_1__ xconfigurerequest;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
int get_XEvent_xconfigurerequest_send_event(void *_p) {
  return (int)((XEvent *)_p)->xconfigurerequest.send_event;
}


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

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i32 @get_XEvent_xconfigurerequest_send_event(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @get_XEvent_xconfigurerequest_send_event(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
int fail(int x) { return 1 / x; }


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

x86 assembly (clang, -O2):
<fail>:
lea    0x1(%rdi),%ecx
xor    %eax,%eax
cmp    $0x3,%ecx
cmovb  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @fail(i32 %0) {
%2 = add i32 %0, 1
%3 = icmp ult i32 %2, 3
%4 = select i1 %3, i32 %0, i32 0
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ ehrpwm_reg_config(int /*<<< orphan*/, int, int, int);
int ehrpwm_tb_force_sync(uint8_t module) {
  ehrpwm_reg_config(module, 0x0, (1) << 0x6, (1 << 6));
  return 0;
}


x86 assembly (clang, -O0):
<ehrpwm_tb_force_sync>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
mov    $0x40,%ecx
mov    %ecx,%edx
call   1030 <ehrpwm_reg_config@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ehrpwm_tb_force_sync>:
push   %rax
xor    %esi,%esi
mov    $0x40,%edx
mov    $0x40,%ecx
call   1030 <ehrpwm_reg_config@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @ehrpwm_tb_force_sync(i32 %0) {
%2 = tail call i32 @ehrpwm_reg_config(i32 %0, i32 0, i32 64, i32 64)
ret i32 0
}