xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(char);
int /*<<< orphan*/ ft_putstr(char *);
void ft_print_words_tables(char **tab) {
  int it;
  it = 0;
  while (tab[it]) {
    ft_putstr(tab[it++]);
    ft_putchar('\n');
  }
}


x86 assembly (clang, -O0):
<ft_print_words_tables>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1170 <ft_print_words_tables+0x50>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <ft_putstr@plt>
mov    $0xa,%edi
call   1030 <ft_putchar@plt>
jmp    1133 <ft_print_words_tables+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_print_words_tables>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     114b <ft_print_words_tables+0x2b>
add    $0x8,%rbx
call   1040 <ft_putstr@plt>
mov    $0xa,%edi
call   1030 <ft_putchar@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <ft_print_words_tables+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @ft_print_words_tables(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
store i8** %0, i8*** %2
store i32 0, i32* %3
br label %4
4: ; preds = %11, %1
%5 = load i8**, i8*** %2
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8*, i8** %5, i64 %7
%9 = load i8*, i8** %8
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %20
11: ; preds = %4
%12 = load i8**, i8*** %2
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
%15 = sext i32 %13 to i64
%16 = getelementptr inbounds i8*, i8** %12, i64 %15
%17 = load i8*, i8** %16
%18 = call i32 @ft_putstr(i8* %17)
%19 = call i32 @ft_putchar(i8 signext 10)
br label %4
20: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @ft_print_words_tables(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8* [ %11, %4 ], [ %2, %1 ]
%7 = add nuw i64 %5, 1
%8 = tail call i32 @ft_putstr(i8* %6)
%9 = tail call i32 @ft_putchar(i8 signext 10)
%10 = getelementptr inbounds i8*, i8** %0, i64 %7
%11 = load i8*, i8** %10
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %4
13: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void *malloc(int);
int /*<<< orphan*/ perror(char *);
void *stack_new() {
  void *stack = malloc(65536);
  if (stack == NULL) {
    perror("\nError allocating stack memory\n");
    exit(1);
  }
  void *stack_top = stack + 65536;
  return stack_top;
}


x86 assembly (clang, -O0):
<stack_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x10000,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1167 <stack_new+0x37>
lea    0xea8(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10000,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stack_new>:
push   %rax
mov    $0x10000,%edi
call   1030 <malloc@plt>
test   %rax,%rax
je     1148 <stack_new+0x18>
add    $0x10000,%rax
pop    %rcx
ret
lea    0xeb1(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"\0AError allocating stack memory\0A\00"
define i8* @stack_new() {
%1 = alloca i8*
%2 = alloca i8*
%3 = call i8* @malloc(i32 65536)
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = call i32 @perror(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @exit(i32 1)
unreachable
9: ; preds = %0
%10 = load i8*, i8** %1
%11 = getelementptr i8, i8* %10, i64 65536
store i8* %11, i8** %2
%12 = load i8*, i8** %2
ret i8* %12
}

LLVM IR (-O2):
@.str = [32 x i8] c"\0AError allocating stack memory\0A\00"
define noalias i8* @stack_new() {
%1 = tail call dereferenceable_or_null(65536) i8* @malloc(i32 65536)
%2 = icmp eq i8* %1, null
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i32 @perror(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
6: ; preds = %0
%7 = getelementptr i8, i8* %1, i64 65536
ret i8* %7
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int y;
};
typedef TYPE_1__ XWindowAttributes;

/* Variables and functions */
void set_XWindowAttributes_y(void *_p, int _v) {
  ((XWindowAttributes *)_p)->y = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XWindowAttributes_y>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XWindowAttributes_y(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XWindowAttributes_y(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
int main() {
  int a;
  ({
    float __dummy;
    typeof(a) __dummy2;
    (void)(&__dummy == &__dummy2);
    1;
  });
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x10(%rbp)
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 float
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to float*
%6 = icmp eq float* %2, %5
%7 = zext i1 %6 to i32
store i32 1, i32* %4
%8 = load i32, i32* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int test_imm_7Buint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x7B << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_7Buint64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0x7b,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_7Buint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 123
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
float EaseLinearNone(float t, float b, float c, float d) {
  return (c * t / d + b);
}


x86 assembly (clang, -O0):
<EaseLinearNone>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
divss  -0x10(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<EaseLinearNone>:
mulss  %xmm2,%xmm0
divss  %xmm3,%xmm0
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @EaseLinearNone(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = load float, float* %7
%10 = load float, float* %5
%11 = fmul float %9, %10
%12 = load float, float* %8
%13 = fdiv float %11, %12
%14 = load float, float* %6
%15 = fadd float %13, %14
ret float %15
}

LLVM IR (-O2):
define float @EaseLinearNone(float %0, float %1, float %2, float %3) {
%5 = fmul float %0, %2
%6 = fdiv float %5, %3
%7 = fadd float %6, %1
ret float %7
}
void benchmarkSetupOnce() {}


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

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

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

LLVM IR (-O2):
define void @benchmarkSetupOnce() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(float *, float const *, int);
void gl11_matrix_load(float *d, const float *a) {
  memcpy(d, a, 16 * sizeof(float));
}


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

x86 assembly (clang, -O2):
<gl11_matrix_load>:
mov    $0x40,%edx
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define void @gl11_matrix_load(float* %0, float* %1) {
%3 = tail call i32 @memcpy(float* %0, float* %1, i32 64)
ret void
}
int inflateEnd(void *strm) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @inflateEnd(i8* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
int is_table_sep(char *data, size_t pos) {
  return data[pos] == '|' && (pos == 0 || data[pos - 1] != '\\');
}


x86 assembly (clang, -O0):
<is_table_sep>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x7c,%ecx
mov    %al,-0x11(%rbp)
jne    1155 <is_table_sep+0x55>
mov    $0x1,%al
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x12(%rbp)
je     114f <is_table_sep+0x4f>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x5c,%eax
setne  %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_table_sep>:
xor    %eax,%eax
cmpb   $0x7c,(%rdi,%rsi,1)
jne    1117 <is_table_sep+0x17>
test   %rsi,%rsi
je     1118 <is_table_sep+0x18>
xor    %eax,%eax
cmpb   $0x5c,-0x1(%rsi,%rdi,1)
setne  %al
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @is_table_sep(i8* nocapture %0, i64 %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 %1
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 124
br i1 %5, label %6, label %14
6: ; preds = %2
%7 = icmp eq i64 %1, 0
br i1 %7, label %14, label %8
8: ; preds = %6
%9 = add i64 %1, -1
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp ne i8 %11, 92
%13 = zext i1 %12 to i32
br label %14
14: ; preds = %6, %8, %2
%15 = phi i32 [ 0, %2 ], [ 1, %6 ], [ %13, %8 ]
ret i32 %15
}
/* Type definitions */
struct timeb {
  double millitm;
  scalar_t__ time;
};

/* Variables and functions */
int /*<<< orphan*/ ftime(struct timeb *);
double I_FloatTime(void) {
  struct timeb timebuffer;
  ftime(&timebuffer);
  return (double)timebuffer.time + (timebuffer.millitm / 1000.0);
}


x86 assembly (clang, -O0):
<I_FloatTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
call   1030 <ftime@plt>
cvtsi2sdq -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xecc(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<I_FloatTime>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
call   1030 <ftime@plt>
cvtsi2sdq 0x10(%rsp),%xmm1
movsd  0x8(%rsp),%xmm0
divsd  0xecd(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeb = type { double, i64 }
define double @I_FloatTime() {
%1 = alloca %struct.timeb
%2 = call i32 @ftime(%struct.timeb* %1)
%3 = getelementptr inbounds %struct.timeb, %struct.timeb* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = sitofp i64 %4 to double
%6 = getelementptr inbounds %struct.timeb, %struct.timeb* %1, i32 0, i32 0
%7 = load double, double* %6
%8 = fdiv double %7, 1.000000e+03
%9 = fadd double %5, %8
ret double %9
}

LLVM IR (-O2):
%struct.timeb = type { double, i64 }
define double @I_FloatTime() {
%1 = alloca %struct.timeb
%2 = bitcast %struct.timeb* %1 to i8*
%3 = call i32 @ftime(%struct.timeb* %1)
%4 = getelementptr inbounds %struct.timeb, %struct.timeb* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = getelementptr inbounds %struct.timeb, %struct.timeb* %1, i64 0, i32 0
%8 = load double, double* %7
%9 = fdiv double %8, 1.000000e+03
%10 = fadd double %9, %6
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_parse_volume() {
  printf("NOT IMPLEMENTED:"
         "pa_parse_volume"
         "\n");
}


x86 assembly (clang, -O0):
<pa_parse_volume>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [32 x i8] c"NOT IMPLEMENTED:pa_parse_volume\00"
define i32 @pa_parse_volume() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int sleep(int);
void test7_h2(int sig) {
  int r;
  printf("test7_h2\n");
  r = sleep(10);
  printf("test7_h2 bitti r:%d\n", r);
}


x86 assembly (clang, -O0):
<test7_h2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xa,%edi
call   1040 <sleep@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test7_h2>:
push   %rax
lea    0xedd(%rip),%rdi
call   1030 <puts@plt>
mov    $0xa,%edi
call   1050 <sleep@plt>
lea    0xeb2(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
pop    %rcx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"test7_h2\0A\00"
@.str.1 = [21 x i8] c"test7_h2 bitti r:%d\0A\00"
define void @test7_h2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @sleep(i32 10)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str.1 = [21 x i8] c"test7_h2 bitti r:%d\0A\00"
@str = [9 x i8] c"test7_h2\00"
define void @test7_h2(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @sleep(i32 10)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ usleep(int);
void uwait(int us) {
  printf("Delay %d Micro Second\n", us);
  usleep(us);
}


x86 assembly (clang, -O0):
<uwait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
call   1040 <usleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uwait>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <usleep@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"Delay %d Micro Second\0A\00"
define void @uwait(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @usleep(i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"Delay %d Micro Second\0A\00"
define void @uwait(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @usleep(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ secure_zero(void *, size_t);
void secure_free(void *ptr, size_t size) {
  secure_zero(ptr, size);
  free(ptr);
}


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

x86 assembly (clang, -O2):
<secure_free>:
push   %rbx
mov    %rdi,%rbx
call   1040 <secure_zero@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @secure_free(i8* %0, i64 %1) {
%3 = tail call i32 @secure_zero(i8* %0, i64 %1)
%4 = tail call i32 @free(i8* %0)
ret void
}
void Pattern6(struct PatternGen_Params *P, struct PatternGen_Settings *S,
              struct PatternGen_Random *R,
              struct PatternGen_PatternFuncSpecific *PS, int I,
              struct PatternGen_Tick *Output) {}


x86 assembly (clang, -O0):
<Pattern6>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9,-0x30(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.PatternGen_Params = type opaque
%struct.PatternGen_Settings = type opaque
%struct.PatternGen_Random = type opaque
%struct.PatternGen_PatternFuncSpecific = type opaque
%struct.PatternGen_Tick = type opaque
define void @Pattern6(%struct.PatternGen_Params* %0, %struct.PatternGen_Settings* %1, %struct.PatternGen_Random* %2, %struct.PatternGen_PatternFuncSpecific* %3, i32 %4, %struct.PatternGen_Tick* %5) {
%7 = alloca %struct.PatternGen_Params*
%8 = alloca %struct.PatternGen_Settings*
%9 = alloca %struct.PatternGen_Random*
%10 = alloca %struct.PatternGen_PatternFuncSpecific*
%11 = alloca i32
%12 = alloca %struct.PatternGen_Tick*
store %struct.PatternGen_Params* %0, %struct.PatternGen_Params** %7
store %struct.PatternGen_Settings* %1, %struct.PatternGen_Settings** %8
store %struct.PatternGen_Random* %2, %struct.PatternGen_Random** %9
store %struct.PatternGen_PatternFuncSpecific* %3, %struct.PatternGen_PatternFuncSpecific** %10
store i32 %4, i32* %11
store %struct.PatternGen_Tick* %5, %struct.PatternGen_Tick** %12
ret void
}

LLVM IR (-O2):
%struct.PatternGen_Params = type opaque
%struct.PatternGen_Settings = type opaque
%struct.PatternGen_Random = type opaque
%struct.PatternGen_PatternFuncSpecific = type opaque
%struct.PatternGen_Tick = type opaque
define void @Pattern6(%struct.PatternGen_Params* nocapture %0, %struct.PatternGen_Settings* nocapture %1, %struct.PatternGen_Random* nocapture %2, %struct.PatternGen_PatternFuncSpecific* nocapture %3, i32 %4, %struct.PatternGen_Tick* nocapture %5) {
ret void
}
int hash(int n) { return (n * 7) % 5000; }


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x7,-0x4(%rbp),%eax
mov    $0x1388,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
lea    0x0(,%rdi,8),%eax
sub    %edi,%eax
cltq
imul   $0x68db8bad,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x2b,%rcx
add    %edx,%ecx
imul   $0x1388,%ecx,%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @hash(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 7
%5 = srem i32 %4, 5000
ret i32 %5
}

LLVM IR (-O2):
define i32 @hash(i32 %0) {
%2 = mul nsw i32 %0, 7
%3 = srem i32 %2, 5000
ret i32 %3
}
/* Variables and functions */
int unlink(char *);
int sysapi_unlink_file(char *filename) { return unlink(filename); }


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

x86 assembly (clang, -O2):
<sysapi_unlink_file>:
jmp    1030 <unlink@plt>

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

LLVM IR (-O2):
define i32 @sysapi_unlink_file(i8* nocapture %0) {
%2 = tail call i32 @unlink(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ ft_bzero(void *, size_t);
void *malloc(int);
void *ft_memalloc(size_t size) {
  void *ptr;
  if (!(ptr = malloc(sizeof(char) * size)))
    exit(1);
  ft_bzero(ptr, size);
  return (ptr);
}


x86 assembly (clang, -O0):
<ft_memalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1163 <ft_memalloc+0x33>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <ft_bzero@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_memalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
test   %rax,%rax
je     115a <ft_memalloc+0x2a>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <ft_bzero@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define i8* @ft_memalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = mul i64 1, %4
%6 = trunc i64 %5 to i32
%7 = call i8* @malloc(i32 %6)
store i8* %7, i8** %3
%8 = icmp ne i8* %7, null
br i1 %8, label %11, label %9
9: ; preds = %1
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %1
%12 = load i8*, i8** %3
%13 = load i64, i64* %2
%14 = call i32 @ft_bzero(i8* %12, i64 %13)
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
define i8* @ft_memalloc(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = tail call i8* @malloc(i32 %2)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
%8 = tail call i32 @ft_bzero(i8* %3, i64 %0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int bdb_index_find(int a, void *b, void *c) {
  printf("you shouldn't be using this outside of the bastard!!!\n");
  return (0);
}


x86 assembly (clang, -O0):
<bdb_index_find>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [55 x i8] c"you shouldn't be using this outside of the bastard!!!\0A\00"
define i32 @bdb_index_find(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [54 x i8] c"you shouldn't be using this outside of the bastard!!!\00"
define i32 @bdb_index_find(i32 %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ setr1279(unsigned long);
void InitRNG(unsigned long int seed) {
  setr1279(seed);
  return;
}


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

x86 assembly (clang, -O2):
<InitRNG>:
jmp    1030 <setr1279@plt>

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

LLVM IR (-O2):
define void @InitRNG(i64 %0) {
%2 = tail call i32 @setr1279(i64 %0)
ret void
}
/* Variables and functions */
char *malloc(int);
void allocmem1() { char *memleak2 = malloc(100 * sizeof(char)); }


x86 assembly (clang, -O0):
<allocmem1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x64,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @allocmem1() {
%1 = alloca i8*
%2 = call i8* @malloc(i32 100)
store i8* %2, i8** %1
ret void
}

LLVM IR (-O2):
define void @allocmem1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void usage(char *progname) {
  fprintf(stderr, "Usage: %s\n", progname);
  fprintf(stderr, "   read data from stdin\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
lea    0xec4(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rdx
mov    0x2ec5(%rip),%rbx
mov    (%rbx),%edi
lea    0xedc(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xed7(%rip),%rsi
xor    %eax,%eax
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [11 x i8] c"Usage: %s\0A\00"
@.str.1 = [25 x i8] c" read data from stdin\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"Usage: %s\0A\00"
@.str.1 = [25 x i8] c" read data from stdin\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void cleanup_free(char **ptr) { free(*ptr); }


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

x86 assembly (clang, -O2):
<cleanup_free>:
mov    (%rdi),%rdi
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @cleanup_free(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @free(i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
scalar_t__ syncfs(int);
int syncFsAndClose(int fd) {
  if (syncfs(fd) != 0) {
    close(fd);
    return 1;
  }
  close(fd);
  return 0;
}


x86 assembly (clang, -O0):
<syncFsAndClose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <syncfs@plt>
cmp    $0x0,%rax
je     1151 <syncFsAndClose+0x31>
mov    -0x8(%rbp),%edi
call   1040 <close@plt>
movl   $0x1,-0x4(%rbp)
jmp    1160 <syncFsAndClose+0x40>
mov    -0x8(%rbp),%edi
call   1040 <close@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syncFsAndClose>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1030 <syncfs@plt>
xor    %ebp,%ebp
test   %rax,%rax
setne  %bpl
mov    %ebx,%edi
call   1040 <close@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @syncFsAndClose(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i64 @syncfs(i32 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %3
%9 = call i32 @close(i32 %8)
store i32 1, i32* %2
br label %13
10: ; preds = %1
%11 = load i32, i32* %3
%12 = call i32 @close(i32 %11)
store i32 0, i32* %2
br label %13
13: ; preds = %10, %7
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @syncFsAndClose(i32 %0) {
%2 = tail call i64 @syncfs(i32 %0)
%3 = icmp ne i64 %2, 0
%4 = tail call i32 @close(i32 %0)
%5 = zext i1 %3 to i32
ret i32 %5
}
int SerialOpen(int port, int baud) { return 0; }


x86 assembly (clang, -O0):
<SerialOpen>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @SerialOpen(i32 %0, i32 %1) {
ret i32 0
}
int c061(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @c061() {
ret i32 0
}
void Draco9210SetDataOut() {}


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

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

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

LLVM IR (-O2):
define void @Draco9210SetDataOut() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AttitudeSimulatedHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void AttitudeSimulatedRequestUpdate() {
  UAVObjRequestUpdate(AttitudeSimulatedHandle());
}


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

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

LLVM IR (-O0):
define void @AttitudeSimulatedRequestUpdate() {
%1 = call i32 (...) @AttitudeSimulatedHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @AttitudeSimulatedRequestUpdate() {
%1 = tail call i32 (...) @AttitudeSimulatedHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
uint8_t si470x_volumedown() {}


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

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

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

LLVM IR (-O2):
define i32 @si470x_volumedown() {
ret i32 undef
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int var_size_u64(int);
int var_size_s64(int64_t v) { return var_size_u64((v >> 63) ^ (v << 1)); }


x86 assembly (clang, -O0):
<var_size_s64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x3f,%ecx
sar    %cl,%edi
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
xor    %eax,%edi
call   1030 <var_size_u64@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<var_size_s64>:
jmp    1030 <var_size_u64@plt>

LLVM IR (-O0):
define i32 @var_size_s64(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 63
%5 = load i32, i32* %2
%6 = shl i32 %5, 1
%7 = xor i32 %4, %6
%8 = call i32 @var_size_u64(i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @var_size_s64(i32 %0) {
%2 = tail call i32 @var_size_u64(i32 poison)
ret i32 %2
}
/* Variables and functions */
unsigned int GetFactors(unsigned long);
int /*<<< orphan*/ printf(char *, unsigned long);
int main() {
  unsigned long triangleNumber = 0;
  unsigned long nextNumber = 1;
  unsigned int factors = 0;
  do {
    triangleNumber += nextNumber;
    nextNumber++;
    factors = GetFactors(triangleNumber);
  } while (factors < 500);
  printf("First triangle number with over 500 factors is %lu", triangleNumber);
  return triangleNumber;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x1,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <GetFactors@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x1f4,-0x1c(%rbp)
jb     1146 <main+0x26>
mov    -0x10(%rbp),%rsi
lea    0xe7e(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%ebx
xor    %r14d,%r14d
nopl   0x0(%rax)
add    %rbx,%r14
add    $0x1,%rbx
mov    %r14,%rdi
call   1040 <GetFactors@plt>
cmp    $0x1f4,%eax
jb     1130 <main+0x10>
lea    0xeb3(%rip),%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [51 x i8] c"First triangle number with over 500 factors is %lu\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca i32
store i32 0, i32* %1
store i64 0, i64* %2
store i64 1, i64* %3
store i32 0, i32* %4
br label %5
5: ; preds = %13, %0
%6 = load i64, i64* %3
%7 = load i64, i64* %2
%8 = add i64 %7, %6
store i64 %8, i64* %2
%9 = load i64, i64* %3
%10 = add i64 %9, 1
store i64 %10, i64* %3
%11 = load i64, i64* %2
%12 = call i32 @GetFactors(i64 %11)
store i32 %12, i32* %4
br label %13
13: ; preds = %5
%14 = load i32, i32* %4
%15 = icmp ult i32 %14, 500
br i1 %15, label %5, label %16
16: ; preds = %13
%17 = load i64, i64* %2
%18 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i64 %17)
%19 = load i64, i64* %2
%20 = trunc i64 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
@.str = [51 x i8] c"First triangle number with over 500 factors is %lu\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i64 [ 0, %0 ], [ %4, %1 ]
%3 = phi i64 [ 1, %0 ], [ %5, %1 ]
%4 = add i64 %3, %2
%5 = add i64 %3, 1
%6 = tail call i32 @GetFactors(i64 %4)
%7 = icmp ult i32 %6, 500
br i1 %7, label %1, label %8
8: ; preds = %1
%9 = tail call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i64 %4)
%10 = trunc i64 %4 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, short, char, char *, int);
void print(int a, short b, char c, char *d, int *e) {
  printf("%d, %d, %c, %s, %d\n", a, b, c, d, *e);
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %si,%dx
mov    %edi,-0x4(%rbp)
mov    %dx,-0x6(%rbp)
mov    %al,-0x7(%rbp)
mov    %rcx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x6(%rbp),%cx
mov    -0x7(%rbp),%al
mov    -0x10(%rbp),%r8
mov    -0x18(%rbp),%rdx
mov    (%rdx),%r9d
lea    0xeb5(%rip),%rdi
movswl %cx,%edx
movsbl %al,%ecx
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
mov    %rcx,%rax
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
mov    (%r8),%r9d
lea    0xedd(%rip),%rdi
mov    %rax,%r8
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"%d, %d, %c, %s, %d\0A\00"
define void @print(i32 %0, i16 signext %1, i8 signext %2, i8* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i16
%8 = alloca i8
%9 = alloca i8*
%10 = alloca i32*
store i32 %0, i32* %6
store i16 %1, i16* %7
store i8 %2, i8* %8
store i8* %3, i8** %9
store i32* %4, i32** %10
%11 = load i32, i32* %6
%12 = load i16, i16* %7
%13 = load i8, i8* %8
%14 = load i8*, i8** %9
%15 = load i32*, i32** %10
%16 = load i32, i32* %15
%17 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %11, i16 signext %12, i8 signext %13, i8* %14, i32 %16)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"%d, %d, %c, %s, %d\0A\00"
define void @print(i32 %0, i16 signext %1, i8 signext %2, i8* %3, i32* nocapture %4) {
%6 = load i32, i32* %4
%7 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %0, i16 signext %1, i8 signext %2, i8* %3, i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(char const *name) {
  fprintf(stderr,
          "Usage: %s --help|--new|--print|--update [OPTIONS] <nvm file> "
          "[<nvm_file>]\n",
          name);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [75 x i8] c"Usage: %s --help|--new|--print|--update [OPTIONS] <nvm file> [<nvm_file>]\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [75 x i8] c"Usage: %s --help|--new|--print|--update [OPTIONS] <nvm file> [<nvm_file>]\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ do_at_tests();
int /*<<< orphan*/ do_block_tests();
int /*<<< orphan*/ do_children_tests();
int /*<<< orphan*/ do_frozen_tests();
int /*<<< orphan*/ do_locals_tests();
int /*<<< orphan*/ do_special_tests();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  do_locals_tests();
  do_block_tests();
  do_children_tests();
  do_special_tests();
  do_frozen_tests();
  do_at_tests();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1070 <do_locals_tests@plt>
mov    $0x0,%al
call   1050 <do_block_tests@plt>
mov    $0x0,%al
call   1060 <do_children_tests@plt>
mov    $0x0,%al
call   1030 <do_special_tests@plt>
mov    $0x0,%al
call   1080 <do_frozen_tests@plt>
mov    $0x0,%al
call   1040 <do_at_tests@plt>
xor    %edi,%edi
call   1090 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1070 <do_locals_tests@plt>
xor    %eax,%eax
call   1050 <do_block_tests@plt>
xor    %eax,%eax
call   1060 <do_children_tests@plt>
xor    %eax,%eax
call   1030 <do_special_tests@plt>
xor    %eax,%eax
call   1080 <do_frozen_tests@plt>
xor    %eax,%eax
call   1040 <do_at_tests@plt>
xor    %edi,%edi
call   1090 <exit@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @do_locals_tests()
%7 = call i32 (...) @do_block_tests()
%8 = call i32 (...) @do_children_tests()
%9 = call i32 (...) @do_special_tests()
%10 = call i32 (...) @do_frozen_tests()
%11 = call i32 (...) @do_at_tests()
%12 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @do_locals_tests()
%4 = tail call i32 (...) @do_block_tests()
%5 = tail call i32 (...) @do_children_tests()
%6 = tail call i32 (...) @do_special_tests()
%7 = tail call i32 (...) @do_frozen_tests()
%8 = tail call i32 (...) @do_at_tests()
%9 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void catch_stp(int sig) { printf("STP\n"); }


x86 assembly (clang, -O0):
<catch_stp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [4 x i8] c"STP\00"
define void @catch_stp(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
int puts(const char *s) {
  while (*s)
    putchar(*s++);
  putchar('\n');
  return 0;
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <puts+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <putchar@plt>
jmp    111c <puts+0xc>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <puts+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <puts+0x10>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = tail call i32 @putchar(i8 signext %5)
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = tail call i32 @putchar(i8 signext 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assem_debug(char *);
int /*<<< orphan*/ output_byte(int);
void emit_fsqrt(void) {
  assem_debug("fsqrt");
  output_byte(0xd9);
  output_byte(0xfa);
}


x86 assembly (clang, -O0):
<emit_fsqrt>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <assem_debug@plt>
mov    $0xd9,%edi
call   1040 <output_byte@plt>
mov    $0xfa,%edi
call   1040 <output_byte@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_fsqrt>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <assem_debug@plt>
mov    $0xd9,%edi
call   1040 <output_byte@plt>
mov    $0xfa,%edi
pop    %rax
jmp    1040 <output_byte@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"fsqrt\00"
define void @emit_fsqrt() {
%1 = call i32 @assem_debug(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @output_byte(i32 217)
%3 = call i32 @output_byte(i32 250)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"fsqrt\00"
define void @emit_fsqrt() {
%1 = tail call i32 @assem_debug(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @output_byte(i32 217)
%3 = tail call i32 @output_byte(i32 250)
ret void
}