xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
scalar_t__ shitlord(int *);
int main(void) {
  for (int i = 0; shitlord(&i); --i) {
    printf("%d\n", i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <shitlord@plt>
cmp    $0x0,%rax
je     1166 <main+0x46>
mov    -0x8(%rbp),%esi
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1040 <shitlord@plt>
test   %rax,%rax
je     116e <main+0x4e>
lea    0xebe(%rip),%r14
lea    0x4(%rsp),%rbx
nopw   0x0(%rax,%rax,1)
mov    0x4(%rsp),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
addl   $0xffffffff,0x4(%rsp)
mov    %rbx,%rdi
call   1040 <shitlord@plt>
test   %rax,%rax
jne    1150 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i64 @shitlord(i32* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %6, %0
ret i32 0
6: ; preds = %0, %6
%7 = load i32, i32* %1
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %1
%10 = add nsw i32 %9, -1
store i32 %10, i32* %1
%11 = call i64 @shitlord(i32* %1)
%12 = icmp eq i64 %11, 0
br i1 %12, label %5, label %6
}
extern int xextWeak(int i) { return i * 4; }


x86 assembly (clang, -O0):
<xextWeak>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xextWeak>:
lea    0x0(,%rdi,4),%eax
ret

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

LLVM IR (-O2):
define i32 @xextWeak(i32 %0) {
%2 = shl nsw i32 %0, 2
ret i32 %2
}
/* Variables and functions */
double cos(int /*<<< orphan*/);
int /*<<< orphan*/ ln_deg_to_rad(double);
double ln_get_ell_radius_vector(double a, double e, double E) {
  return a * (1.0 - e * cos(ln_deg_to_rad(E)));
}


x86 assembly (clang, -O0):
<ln_get_ell_radius_vector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1040 <ln_deg_to_rad@plt>
mov    %eax,%edi
call   1030 <cos@plt>
movsd  -0x28(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x20(%rbp),%xmm0
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
movsd  0xe74(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ln_get_ell_radius_vector>:
sub    $0x18,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
movapd %xmm2,%xmm0
call   1040 <ln_deg_to_rad@plt>
mov    %eax,%edi
call   1030 <cos@plt>
mulsd  0x8(%rsp),%xmm0
movsd  0xeb2(%rip),%xmm1
subsd  %xmm0,%xmm1
mulsd  0x10(%rsp),%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @ln_get_ell_radius_vector(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = load double, double* %6
%10 = call i32 @ln_deg_to_rad(double %9)
%11 = call double @cos(i32 %10)
%12 = fneg double %8
%13 = call double @llvm.fmuladd.f64(double %12, double %11, double 1.000000e+00)
%14 = fmul double %7, %13
ret double %14
}

LLVM IR (-O2):
define double @ln_get_ell_radius_vector(double %0, double %1, double %2) {
%4 = tail call i32 @ln_deg_to_rad(double %2)
%5 = tail call double @cos(i32 %4)
%6 = fneg double %1
%7 = tail call double @llvm.fmuladd.f64(double %6, double %5, double 1.000000e+00)
%8 = fmul double %7, %0
ret double %8
}
/* Variables and functions */
int use_before_def();
int useage(void) { return use_before_def(); }


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

x86 assembly (clang, -O2):
<useage>:
xor    %eax,%eax
jmp    1030 <use_before_def@plt>

LLVM IR (-O0):
define i32 @useage() {
%1 = call i32 (...) @use_before_def()
ret i32 %1
}

LLVM IR (-O2):
define i32 @useage() {
%1 = tail call i32 (...) @use_before_def()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ test(char *, int);
int main(int argc, char **argv) {
  test("/home/zhs/test", sizeof("/home/zhs/test"));
  test("/home/zhs/test/main.c/", sizeof("/home/zhs/test/main.c/"));
  test("/home/zhs/test/main.c", sizeof("/home/zhs/test/main.c"));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rdi
mov    $0xf,%esi
call   1030 <test@plt>
lea    0xed1(%rip),%rdi
mov    $0x17,%esi
call   1030 <test@plt>
lea    0xed7(%rip),%rdi
mov    $0x16,%esi
call   1030 <test@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0xf,%esi
call   1030 <test@plt>
lea    0xee6(%rip),%rdi
mov    $0x17,%esi
call   1030 <test@plt>
lea    0xeec(%rip),%rdi
mov    $0x16,%esi
call   1030 <test@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"/home/zhs/test\00"
@.str.1 = [23 x i8] c"/home/zhs/test/main.c/\00"
@.str.2 = [22 x i8] c"/home/zhs/test/main.c\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @test(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 15)
%7 = call i32 @test(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 23)
%8 = call i32 @test(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 22)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"/home/zhs/test\00"
@.str.1 = [23 x i8] c"/home/zhs/test/main.c/\00"
@.str.2 = [22 x i8] c"/home/zhs/test/main.c\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @test(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 15)
%4 = tail call i32 @test(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 23)
%5 = tail call i32 @test(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 22)
ret i32 0
}
int main(int argc, char **argv) {
  int numbers[10];
  int i;
  for (i = 0; i <= 10; i++) {
    numbers[i] = 0;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x44(%rbp)
cmpl   $0xa,-0x44(%rbp)
jg     113d <main+0x3d>
movslq -0x44(%rbp),%rax
movl   $0x0,-0x40(%rbp,%rax,4)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1119 <main+0x19>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
scalar_t__ rand_uniform(double, double);
float rand_uniformf(float a, float b) {
  return (float)rand_uniform((double)a, (double)b);
}


x86 assembly (clang, -O0):
<rand_uniformf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
call   1030 <rand_uniform@plt>
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_uniformf>:
push   %rax
cvtss2sd %xmm0,%xmm0
cvtss2sd %xmm1,%xmm1
call   1030 <rand_uniform@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @rand_uniformf(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 = fpext float %5 to double
%7 = load float, float* %4
%8 = fpext float %7 to double
%9 = call i64 @rand_uniform(double %6, double %8)
%10 = sitofp i64 %9 to float
ret float %10
}

LLVM IR (-O2):
define float @rand_uniformf(float %0, float %1) {
%3 = fpext float %0 to double
%4 = fpext float %1 to double
%5 = tail call i64 @rand_uniform(double %3, double %4)
%6 = sitofp i64 %5 to float
ret float %6
}
/* Variables and functions */
int /*<<< orphan*/ my_free(int *, int);
void free_int_vector(int *v, int n) { my_free(v, n * sizeof(int)); }


x86 assembly (clang, -O0):
<free_int_vector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%esi
call   1030 <my_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_int_vector>:
shl    $0x2,%esi
jmp    1030 <my_free@plt>

LLVM IR (-O0):
define void @free_int_vector(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = mul i64 %7, 4
%9 = trunc i64 %8 to i32
%10 = call i32 @my_free(i32* %5, i32 %9)
ret void
}

LLVM IR (-O2):
define void @free_int_vector(i32* %0, i32 %1) {
%3 = shl i32 %1, 2
%4 = tail call i32 @my_free(i32* %0, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *, int);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *);
int getcmd(char *buf, int nbuf) {
  printf("$ ");
  memset(buf, 0, nbuf);
  gets(buf, nbuf);
  if (buf[0] == 0)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<getcmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
xor    %esi,%esi
call   1040 <memset@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1050 <gets@plt>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1181 <getcmd+0x51>
movl   $0xffffffff,-0x4(%rbp)
jmp    1188 <getcmd+0x58>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getcmd>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %ebp,%edx
call   1040 <memset@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1050 <gets@plt>
cmpb   $0x1,(%rbx)
sbb    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"$ \00"
define i32 @getcmd(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @memset(i8* %0, i32 0, i32 %1)
%5 = tail call i32 @gets(i8* %0, i32 %1)
%6 = load i8, i8* %0
%7 = icmp eq i8 %6, 0
%8 = sext i1 %7 to i32
ret i32 %8
}
unsigned short swapb_ushort(unsigned short u) {
  unsigned short r;
  r = (u >> 8) & 0xff;
  r |= ((u & 0xff) << 8);
  return r;
}


x86 assembly (clang, -O0):
<swapb_ushort>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %ax,-0x4(%rbp)
movzwl -0x2(%rbp),%ecx
and    $0xff,%ecx
shl    $0x8,%ecx
movzwl -0x4(%rbp),%eax
or     %ecx,%eax
mov    %ax,-0x4(%rbp)
movzwl -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swapb_ushort>:
mov    %edi,%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
define zeroext i16 @swapb_ushort(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i16
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = zext i16 %4 to i32
%6 = ashr i32 %5, 8
%7 = and i32 %6, 255
%8 = trunc i32 %7 to i16
store i16 %8, i16* %3
%9 = load i16, i16* %2
%10 = zext i16 %9 to i32
%11 = and i32 %10, 255
%12 = shl i32 %11, 8
%13 = load i16, i16* %3
%14 = zext i16 %13 to i32
%15 = or i32 %14, %12
%16 = trunc i32 %15 to i16
store i16 %16, i16* %3
%17 = load i16, i16* %3
ret i16 %17
}

LLVM IR (-O2):
define zeroext i16 @swapb_ushort(i16 zeroext %0) {
%2 = tail call i16 @llvm.bswap.i16(i16 %0)
ret i16 %2
}
/* Variables and functions */
char *colliding_convert(int);
int printf(char *, int, char *);
int libstupid_print_integer(int x) {
  return printf("libstupid: "
                "In Roman numerals, %d is %s\n",
                x, colliding_convert(x));
}


x86 assembly (clang, -O0):
<libstupid_print_integer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <colliding_convert@plt>
mov    -0x8(%rbp),%esi
mov    %rax,%rdx
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libstupid_print_integer>:
push   %rbx
mov    %edi,%ebx
call   1030 <colliding_convert@plt>
lea    0xed1(%rip),%rdi
mov    %ebx,%esi
mov    %rax,%rdx
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [40 x i8] c"libstupid: In Roman numerals, %d is %s\0A\00"
define i32 @libstupid_print_integer(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @colliding_convert(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %3, i8* %5)
ret i32 %6
}

LLVM IR (-O2):
@.str = [40 x i8] c"libstupid: In Roman numerals, %d is %s\0A\00"
define i32 @libstupid_print_integer(i32 %0) {
%2 = tail call i8* @colliding_convert(i32 %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %2)
ret i32 %3
}
/* Variables and functions */
unsigned short crc_dsp(unsigned short, int /*<<< orphan*/);
unsigned short crc_16(unsigned char *data, unsigned int len) {
  unsigned short crc = ~0x0000;
  unsigned char *p = data;
  while (len-- > 0) {
    crc = crc_dsp(crc, *p++);
  }
  return crc;
}


x86 assembly (clang, -O0):
<crc_16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movw   $0xffff,-0xe(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
jbe    1168 <crc_16+0x58>
mov    -0xe(%rbp),%ax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movzbl (%rcx),%esi
movzwl %ax,%edi
call   1030 <crc_dsp@plt>
mov    %ax,-0xe(%rbp)
jmp    112d <crc_16+0x1d>
movzwl -0xe(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crc_16>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
je     1148 <crc_16+0x38>
mov    %rdi,%r14
mov    %esi,%r15d
mov    $0xffff,%ax
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%r14,%rbx,1),%esi
movzwl %ax,%edi
call   1030 <crc_dsp@plt>
add    $0x1,%rbx
cmp    %ebx,%r15d
jne    1130 <crc_16+0x20>
jmp    114c <crc_16+0x3c>
mov    $0xffff,%ax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define zeroext i16 @crc_16(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i16
%6 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
store i16 -1, i16* %5
%7 = load i8*, i8** %3
store i8* %7, i8** %6
br label %8
8: ; preds = %12, %2
%9 = load i32, i32* %4
%10 = add i32 %9, -1
store i32 %10, i32* %4
%11 = icmp ugt i32 %9, 0
br i1 %11, label %12, label %19
12: ; preds = %8
%13 = load i16, i16* %5
%14 = load i8*, i8** %6
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %6
%16 = load i8, i8* %14
%17 = zext i8 %16 to i32
%18 = call zeroext i16 @crc_dsp(i16 zeroext %13, i32 %17)
store i16 %18, i16* %5
br label %8
19: ; preds = %8
%20 = load i16, i16* %5
ret i16 %20
}

LLVM IR (-O2):
define zeroext i16 @crc_16(i8* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %14, label %4
4: ; preds = %2, %4
%5 = phi i8* [ %9, %4 ], [ %0, %2 ]
%6 = phi i16 [ %12, %4 ], [ -1, %2 ]
%7 = phi i32 [ %8, %4 ], [ %1, %2 ]
%8 = add i32 %7, -1
%9 = getelementptr inbounds i8, i8* %5, i64 1
%10 = load i8, i8* %5
%11 = zext i8 %10 to i32
%12 = tail call zeroext i16 @crc_dsp(i16 zeroext %6, i32 %11)
%13 = icmp eq i32 %8, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %2
%15 = phi i16 [ -1, %2 ], [ %12, %4 ]
ret i16 %15
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
extern void shmem_broadcast64(void *target, const void *source, size_t nlong,
                              int PE_root, int PE_start, int logPE_stride,
                              int PE_size, long *pSync) {
  printf("\nOpenSHMEM Analyzer\n");
}


x86 assembly (clang, -O0):
<shmem_broadcast64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [20 x i8] c"\0AOpenSHMEM Analyzer\00"
define void @shmem_broadcast64(i8* nocapture readnone %0, i8* nocapture readnone %1, i64 %2, i32 %3, i32 %4, i32 %5, i32 %6, i64* nocapture readnone %7) {
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint32_t;

/* Variables and functions */
uint32_t load_u32(const char **data) {
  const uint32_t *b = (const uint32_t *)*data;
  *data += sizeof(uint32_t);
  return *b;
}


x86 assembly (clang, -O0):
<load_u32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x4,%rcx
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<load_u32>:
mov    (%rdi),%rax
lea    0x4(%rax),%rcx
mov    %rcx,(%rdi)
mov    (%rax),%eax
ret

LLVM IR (-O0):
define i32 @load_u32(i8** %0) {
%2 = alloca i8**
%3 = alloca i32*
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
%5 = load i8*, i8** %4
%6 = bitcast i8* %5 to i32*
store i32* %6, i32** %3
%7 = load i8**, i8*** %2
%8 = load i8*, i8** %7
%9 = getelementptr inbounds i8, i8* %8, i64 4
store i8* %9, i8** %7
%10 = load i32*, i32** %3
%11 = load i32, i32* %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @load_u32(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = bitcast i8* %2 to i32*
%4 = getelementptr inbounds i8, i8* %2, i64 4
store i8* %4, i8** %0
%5 = load i32, i32* %3
ret i32 %5
}
void f(int counter) {
  if (counter == 0)
    return;
  f(counter - 1);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    112a <f+0x1a>
jmp    1135 <f+0x25>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1030 <f@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 1
br label %9
9: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
define void @f(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void embeddedsystemmurecursivefunction(void) {
  printf("embeddedsystemmurecursivefunction\n");
}


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

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

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

LLVM IR (-O2):
@str = [34 x i8] c"embeddedsystemmurecursivefunction\00"
define void @embeddedsystemmurecursivefunction() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double fabs(double);
int gmx_within_tol(double f1, double f2, double tol) {
  if (fabs(f1 - f2) <= tol * 0.5 * (fabs(f1) + fabs(f2))) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<gmx_within_tol>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm1
subsd  -0x18(%rbp),%xmm1
movaps 0xedc(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xee0(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
movaps 0xebf(%rip),%xmm3
pand   %xmm3,%xmm2
movsd  -0x18(%rbp),%xmm3
movaps 0xeaf(%rip),%xmm4
pand   %xmm4,%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
ucomisd %xmm1,%xmm0
jb     1173 <gmx_within_tol+0x73>
movl   $0x1,-0x4(%rbp)
jmp    117a <gmx_within_tol+0x7a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gmx_within_tol>:
movapd %xmm0,%xmm3
subsd  %xmm1,%xmm3
movapd 0xef0(%rip),%xmm4
andpd  %xmm4,%xmm3
mulsd  0xef4(%rip),%xmm2
andpd  %xmm4,%xmm0
andpd  %xmm4,%xmm1
addsd  %xmm0,%xmm1
mulsd  %xmm2,%xmm1
xor    %eax,%eax
ucomisd %xmm3,%xmm1
setae  %al
ret

LLVM IR (-O0):
define i32 @gmx_within_tol(double %0, double %1, double %2) {
%4 = alloca i32
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
%8 = load double, double* %5
%9 = load double, double* %6
%10 = fsub double %8, %9
%11 = call double @llvm.fabs.f64(double %10)
%12 = load double, double* %7
%13 = fmul double %12, 5.000000e-01
%14 = load double, double* %5
%15 = call double @llvm.fabs.f64(double %14)
%16 = load double, double* %6
%17 = call double @llvm.fabs.f64(double %16)
%18 = fadd double %15, %17
%19 = fmul double %13, %18
%20 = fcmp ole double %11, %19
br i1 %20, label %21, label %22
21: ; preds = %3
store i32 1, i32* %4
br label %23
22: ; preds = %3
store i32 0, i32* %4
br label %23
23: ; preds = %22, %21
%24 = load i32, i32* %4
ret i32 %24
}

LLVM IR (-O2):
define i32 @gmx_within_tol(double %0, double %1, double %2) {
%4 = fsub double %0, %1
%5 = tail call double @llvm.fabs.f64(double %4)
%6 = fmul double %2, 5.000000e-01
%7 = tail call double @llvm.fabs.f64(double %0)
%8 = tail call double @llvm.fabs.f64(double %1)
%9 = fadd double %7, %8
%10 = fmul double %6, %9
%11 = fcmp ole double %5, %10
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Type definitions */
struct st_options {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ usage(int, char **, struct st_options *);
int run_help(int argc, char **argv, void *st_options) {
  struct st_options *o = st_options;
  usage(argc, argv, o);
  return 0;
}


x86 assembly (clang, -O0):
<run_help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <usage@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.st_options = type { i32 }
define i32 @run_help(i32 %0, i8** %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca %struct.st_options*
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* %2, i8** %6
%8 = load i8*, i8** %6
%9 = bitcast i8* %8 to %struct.st_options*
store %struct.st_options* %9, %struct.st_options** %7
%10 = load i32, i32* %4
%11 = load i8**, i8*** %5
%12 = load %struct.st_options*, %struct.st_options** %7
%13 = call i32 @usage(i32 %10, i8** %11, %struct.st_options* %12)
ret i32 0
}

LLVM IR (-O2):
%struct.st_options = type { i32 }
define i32 @run_help(i32 %0, i8** %1, i8* %2) {
%4 = bitcast i8* %2 to %struct.st_options*
%5 = tail call i32 @usage(i32 %0, i8** %1, %struct.st_options* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ pintf(char *);
int main() {
  pintf("Hello C!\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"Hello C!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @pintf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"Hello C!\0A\00"
define i32 @main() {
%1 = tail call i32 @pintf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_lmatrix(long **m, long nrl, long nrh, long ncl, long nch) {
  free((char *)(m[nrl] + ncl - 0));
  free((char *)(m + nrl - 0));
}


x86 assembly (clang, -O0):
<free_lmatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x20(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
call   1030 <free@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_lmatrix>:
push   %rbx
lea    (%rdi,%rsi,8),%rbx
lea    0x0(,%rcx,8),%rax
add    (%rdi,%rsi,8),%rax
mov    %rax,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_lmatrix(i64** nocapture %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = getelementptr inbounds i64*, i64** %0, i64 %1
%7 = load i64*, i64** %6
%8 = getelementptr inbounds i64, i64* %7, i64 %3
%9 = bitcast i64* %8 to i8*
%10 = tail call i32 @free(i8* %9)
%11 = bitcast i64** %6 to i8*
%12 = tail call i32 @free(i8* %11)
ret void
}
/* Variables and functions */
int U_WMRCORE_RECSAFE_get(char const *, int);
int U_WMRSAVEDC_get(const char *contents) {
  return (U_WMRCORE_RECSAFE_get(contents, (6)));
}


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

x86 assembly (clang, -O2):
<U_WMRSAVEDC_get>:
mov    $0x6,%esi
jmp    1030 <U_WMRCORE_RECSAFE_get@plt>

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

LLVM IR (-O2):
define i32 @U_WMRSAVEDC_get(i8* %0) {
%2 = tail call i32 @U_WMRCORE_RECSAFE_get(i8* %0, i32 6)
ret i32 %2
}
/* Variables and functions */
int f236(int *);
int f237(int *p) { return f236(p); }


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

x86 assembly (clang, -O2):
<f237>:
jmp    1030 <f236@plt>

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

LLVM IR (-O2):
define i32 @f237(i32* %0) {
%2 = tail call i32 @f236(i32* %0)
ret i32 %2
}
/* Variables and functions */
int strlen(char *);
int ends_in_chr(char c, char *st) {
  int len = strlen(st);
  return st[len - 1] == c;
}


x86 assembly (clang, -O0):
<ends_in_chr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x1(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ends_in_chr>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1030 <strlen@plt>
movslq %eax,%rcx
xor    %eax,%eax
cmp    %bpl,-0x1(%rcx,%rbx,1)
sete   %al
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ends_in_chr(i8 signext %0, i8* %1) {
%3 = alloca i8
%4 = alloca i8*
%5 = alloca i32
store i8 %0, i8* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = call i32 @strlen(i8* %6)
store i32 %7, i32* %5
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = sub nsw i32 %9, 1
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %8, i64 %11
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = load i8, i8* %3
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %14, %16
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @ends_in_chr(i8 signext %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = add nsw i32 %3, -1
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %1, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, %0
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
size_t HashNodeListSize(size_t);
size_t SizeOfHashNodeList(size_t capacity) {
  return HashNodeListSize(capacity);
}


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

x86 assembly (clang, -O2):
<SizeOfHashNodeList>:
jmp    1030 <HashNodeListSize@plt>

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

LLVM IR (-O2):
define i64 @SizeOfHashNodeList(i64 %0) {
%2 = tail call i64 @HashNodeListSize(i64 %0)
ret i64 %2
}
/* Variables and functions */
int abs(int);
int igcd(int a, int b) {
  int c;
  while (a) {
    c = a;
    a = b % a;
    b = c;
  }
  return abs(b);
}


x86 assembly (clang, -O0):
<igcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1143 <igcd+0x33>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0x4(%rbp)
mov    %edx,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    111e <igcd+0xe>
mov    -0x8(%rbp),%edi
call   1030 <abs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<igcd>:
mov    %esi,%eax
test   %edi,%edi
je     111d <igcd+0x1d>
mov    %edi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <igcd+0x10>
jmp    111f <igcd+0x1f>
mov    %eax,%ecx
mov    %ecx,%eax
neg    %eax
cmovs  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @igcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %0, %2 ]
%6 = phi i32 [ %5, %4 ], [ %1, %2 ]
%7 = srem i32 %6, %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %1, %2 ], [ %5, %4 ]
%11 = tail call i32 @llvm.abs.i32(i32 %10, i1 true)
ret i32 %11
}
int search(int arr[], int x) {
  int i = 0, size = arr[0];
  for (i = 0; i < size; i++)
    if (arr[i] == x)
      return i;
  return -1;
}


x86 assembly (clang, -O0):
<search>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1160 <search+0x60>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x14(%rbp),%eax
jne    114d <search+0x4d>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1167 <search+0x67>
jmp    1152 <search+0x52>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1122 <search+0x22>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<search>:
mov    (%rdi),%ecx
test   %ecx,%ecx
jle    1133 <search+0x33>
xor    %eax,%eax
cmp    %esi,%ecx
je     1132 <search+0x32>
add    $0xffffffffffffffff,%rcx
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmp    %rdx,%rcx
je     1133 <search+0x33>
lea    0x1(%rdx),%rax
cmp    %esi,0x4(%rdi,%rdx,4)
mov    %rax,%rdx
jne    1120 <search+0x20>
ret
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @search(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %18
5: ; preds = %2
%6 = zext i32 %3 to i64
%7 = icmp eq i32 %3, %1
br i1 %7, label %18, label %8
8: ; preds = %5, %12
%9 = phi i64 [ %10, %12 ], [ 0, %5 ]
%10 = add nuw nsw i64 %9, 1
%11 = icmp eq i64 %10, %6
br i1 %11, label %18, label %12
12: ; preds = %8
%13 = getelementptr inbounds i32, i32* %0, i64 %10
%14 = load i32, i32* %13
%15 = icmp eq i32 %14, %1
br i1 %15, label %16, label %8
16: ; preds = %12
%17 = trunc i64 %10 to i32
br label %18
18: ; preds = %8, %5, %16, %2
%19 = phi i32 [ -1, %2 ], [ %17, %16 ], [ 0, %5 ], [ -1, %8 ]
ret i32 %19
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
void usage(int exitval) {
  fprintf(exitval ? stderr : stdout,
          "Usage: dump_eeprom [--help] [--device id] [--raw]\n");
  exit(exitval);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1146 <usage+0x26>
mov    0x2ea4(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
jmp    1152 <usage+0x32>
mov    0x2e8b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    0xea4(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %edi,%ebx
test   %edi,%edi
jne    1130 <usage+0x10>
mov    0x2eaa(%rip),%rax
jmp    1137 <usage+0x17>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@stdout = global i32 0
@.str = [51 x i8] c"Usage: dump_eeprom [--help] [--device id] [--raw]\0A\00"
define void @usage(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i32, i32* @stderr
br label %9
7: ; preds = %1
%8 = load i32, i32* @stdout
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ %6, %5 ], [ %8, %7 ]
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%12 = load i32, i32* %2
%13 = call i32 @exit(i32 %12)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@stdout = global i32 0
@.str = [51 x i8] c"Usage: dump_eeprom [--help] [--device id] [--raw]\0A\00"
define void @usage(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = load i32, i32* @stderr
%4 = load i32, i32* @stdout
%5 = select i1 %2, i32 %4, i32 %3
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 %0)
unreachable
}
void gdk_drag_get_selection() {}


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

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

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

LLVM IR (-O2):
define void @gdk_drag_get_selection() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void Usage(void) {
  fprintf(stderr, "Usage: ./model rate0,rate1 [-l len] [-f freq] <in-file>\n");
  exit(-1);
}


x86 assembly (clang, -O0):
<Usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<Usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [57 x i8] c"Usage: ./model rate0,rate1 [-l len] [-f freq] <in-file>\0A\00"
define void @Usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [57 x i8] c"Usage: ./model rate0,rate1 [-l len] [-f freq] <in-file>\0A\00"
define void @Usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 -1)
unreachable
}
int Sign(int n) {
  if (n > 0)
    return 1;
  else if (n < 0)
    return -1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<Sign>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    111d <Sign+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    113a <Sign+0x3a>
cmpl   $0x0,-0x8(%rbp)
jge    1133 <Sign+0x33>
movl   $0xffffffff,-0x4(%rbp)
jmp    113a <Sign+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sign>:
mov    %edi,%ecx
sar    $0x1f,%ecx
test   %edi,%edi
mov    $0x1,%eax
cmovle %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @Sign(i32 %0) {
%2 = ashr i32 %0, 31
%3 = icmp slt i32 %0, 1
%4 = select i1 %3, i32 %2, i32 1
ret i32 %4
}
/* Variables and functions */
char bgetchar();
int /*<<< orphan*/ putchar(char);
char ugetchar();
int main() {
  char c;
  while ((c = ugetchar()) != 'x') {
    putchar(c);
  }
  while ((c = bgetchar()) != 'x') {
    putchar(c);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <ugetchar@plt>
mov    %al,-0x5(%rbp)
movsbl %al,%eax
cmp    $0x78,%eax
je     1163 <main+0x33>
movsbl -0x5(%rbp),%edi
call   1030 <putchar@plt>
jmp    113f <main+0xf>
jmp    1168 <main+0x38>
mov    $0x0,%al
call   1040 <bgetchar@plt>
mov    %al,-0x5(%rbp)
movsbl %al,%eax
cmp    $0x78,%eax
je     118c <main+0x5c>
movsbl -0x5(%rbp),%edi
call   1030 <putchar@plt>
jmp    1168 <main+0x38>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <ugetchar@plt>
cmp    $0x78,%al
je     1168 <main+0x38>
movsbl %al,%edi
call   1030 <putchar@plt>
jmp    1140 <main+0x10>
cs nopw 0x0(%rax,%rax,1)
nop
movsbl %al,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <bgetchar@plt>
cmp    $0x78,%al
jne    1160 <main+0x30>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
br label %3
3: ; preds = %7, %0
%4 = call signext i8 (...) @ugetchar()
store i8 %4, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp ne i32 %5, 120
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = load i8, i8* %2
%9 = call i32 @putchar(i8 signext %8)
br label %3
10: ; preds = %3
br label %11
11: ; preds = %15, %10
%12 = call signext i8 (...) @bgetchar()
store i8 %12, i8* %2
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 120
br i1 %14, label %15, label %18
15: ; preds = %11
%16 = load i8, i8* %2
%17 = call i32 @putchar(i8 signext %16)
br label %11
18: ; preds = %11
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call signext i8 (...) @ugetchar()
%2 = icmp eq i8 %1, 120
br i1 %2, label %3, label %6
3: ; preds = %6, %0
%4 = tail call signext i8 (...) @bgetchar()
%5 = icmp eq i8 %4, 120
br i1 %5, label %16, label %11
6: ; preds = %0, %6
%7 = phi i8 [ %9, %6 ], [ %1, %0 ]
%8 = tail call i32 @putchar(i8 signext %7)
%9 = tail call signext i8 (...) @ugetchar()
%10 = icmp eq i8 %9, 120
br i1 %10, label %3, label %6
11: ; preds = %3, %11
%12 = phi i8 [ %14, %11 ], [ %4, %3 ]
%13 = tail call i32 @putchar(i8 signext %12)
%14 = tail call signext i8 (...) @bgetchar()
%15 = icmp eq i8 %14, 120
br i1 %15, label %16, label %11
16: ; preds = %11, %3
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Lcd_Out(unsigned char, unsigned char, char *);
void lcd16x2_write(unsigned char row, unsigned char col, char *text) {
  Lcd_Out(row, col, text);
}


x86 assembly (clang, -O0):
<lcd16x2_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x1(%rbp),%cl
mov    -0x2(%rbp),%al
mov    -0x10(%rbp),%rdx
movzbl %cl,%edi
movzbl %al,%esi
call   1030 <Lcd_Out@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcd16x2_write>:
jmp    1030 <Lcd_Out@plt>

LLVM IR (-O0):
define void @lcd16x2_write(i8 zeroext %0, i8 zeroext %1, i8* %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8*
store i8 %0, i8* %4
store i8 %1, i8* %5
store i8* %2, i8** %6
%7 = load i8, i8* %4
%8 = load i8, i8* %5
%9 = load i8*, i8** %6
%10 = call i32 @Lcd_Out(i8 zeroext %7, i8 zeroext %8, i8* %9)
ret void
}

LLVM IR (-O2):
define void @lcd16x2_write(i8 zeroext %0, i8 zeroext %1, i8* %2) {
%4 = tail call i32 @Lcd_Out(i8 zeroext %0, i8 zeroext %1, i8* %2)
ret void
}