xunge/DecIR huggingface dataset:
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int create_quaddobl_homotopy_with_given_gamma(double gamma_re,
                                              double gamma_im) {
  int *a, *b, fail;
  double c[2];
  c[0] = gamma_re;
  c[1] = gamma_im;
  fail = _ada_use_c2phc4c(183, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<create_quaddobl_homotopy_with_given_gamma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    -0x40(%rbp),%rcx
mov    $0xb7,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_quaddobl_homotopy_with_given_gamma>:
sub    $0x18,%rsp
movsd  %xmm0,(%rsp)
movsd  %xmm1,0x8(%rsp)
mov    %rsp,%rcx
mov    $0xb7,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @create_quaddobl_homotopy_with_given_gamma(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca [2 x double]
store double %0, double* %3
store double %1, double* %4
%9 = load double, double* %3
%10 = getelementptr inbounds [2 x double], [2 x double]* %8, i64 0, i64 0
store double %9, double* %10
%11 = load double, double* %4
%12 = getelementptr inbounds [2 x double], [2 x double]* %8, i64 0, i64 1
store double %11, double* %12
%13 = load i32*, i32** %5
%14 = load i32*, i32** %6
%15 = getelementptr inbounds [2 x double], [2 x double]* %8, i64 0, i64 0
%16 = call i32 @_ada_use_c2phc4c(i32 183, i32* %13, i32* %14, double* %15, i32 0)
store i32 %16, i32* %7
%17 = load i32, i32* %7
ret i32 %17
}

LLVM IR (-O2):
define i32 @create_quaddobl_homotopy_with_given_gamma(double %0, double %1) {
%3 = alloca [2 x double]
%4 = bitcast [2 x double]* %3 to i8*
%5 = getelementptr inbounds [2 x double], [2 x double]* %3, i64 0, i64 0
store double %0, double* %5
%6 = getelementptr inbounds [2 x double], [2 x double]* %3, i64 0, i64 1
store double %1, double* %6
%7 = call i32 @_ada_use_c2phc4c(i32 183, i32* undef, i32* undef, double* %5, i32 0)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printYear(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int year;
  printf("Enter a year from 1994 upwards: ");
  scanf("%d", &year);
  printYear(year);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
lea    0xecf(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1030 <printYear@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
lea    0xedd(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <printYear@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Enter a year from 1994 upwards: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 @printYear(i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"Enter a year from 1994 upwards: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @printYear(i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int XSetSelectionOwner() {
  printf("XSetSelectionOwner called\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [26 x i8] c"XSetSelectionOwner called\00"
define i32 @XSetSelectionOwner() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ *Mem_Alloc(int);
scalar_t__ Mem_Init(int);
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main() {
  assert(Mem_Init(4096) == 0);
  assert(Mem_Alloc(4095) == NULL);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1000,%edi
call   1030 <Mem_Init@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0xfff,%edi
call   1050 <Mem_Alloc@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1000,%edi
call   1030 <Mem_Init@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
mov    $0xfff,%edi
call   1050 <Mem_Alloc@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @Mem_Init(i32 4096)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
%5 = call i32 @assert(i32 %4)
%6 = call i32* @Mem_Alloc(i32 4095)
%7 = icmp eq i32* %6, null
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @Mem_Init(i32 4096)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32* @Mem_Alloc(i32 4095)
%6 = icmp eq i32* %5, null
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("\nmeu segundo programa\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 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [23 x i8] c"\0Ameu segundo programa\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [22 x i8] c"\0Ameu segundo programa\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Cfffiou(int, int *);
extern void ftfiou_(int *A1, int *A2) {
  ;
  Cfffiou(*A1, A2);
  return;
}


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

x86 assembly (clang, -O2):
<ftfiou_>:
mov    (%rdi),%edi
jmp    1030 <Cfffiou@plt>

LLVM IR (-O0):
define void @ftfiou_(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* %5
%7 = load i32*, i32** %4
%8 = call i32 @Cfffiou(i32 %6, i32* %7)
ret void
}

LLVM IR (-O2):
define void @ftfiou_(i32* nocapture %0, i32* %1) {
%3 = load i32, i32* %0
%4 = tail call i32 @Cfffiou(i32 %3, i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
int /*<<< orphan*/ scanf(char *, long *);
long solve(long);
int main() {
  long int n;
  scanf("%li", &n);
  long int result = solve(n);
  printf("%ld\n", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <solve@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe9d(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
mov    (%rsp),%rdi
call   1030 <solve@plt>
lea    0xeb4(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%li\00"
@.str.1 = [5 x i8] c"%ld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %2)
%5 = load i64, i64* %2
%6 = call i64 @solve(i64 %5)
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%li\00"
@.str.1 = [5 x i8] c"%ld\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %1)
%4 = load i64, i64* %1
%5 = call i64 @solve(i64 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
void foo(int *x, int *y) {
  free(x);
  free(y);
}


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

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

LLVM IR (-O0):
define void @foo(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 = call i32 @free(i32* %5)
%7 = load i32*, i32** %4
%8 = call i32 @free(i32* %7)
ret void
}

LLVM IR (-O2):
define void @foo(i32* nocapture %0, i32* nocapture %1) {
%3 = tail call i32 @free(i32* %0)
%4 = tail call i32 @free(i32* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ MC_avg_y_mmx(int, int, int /*<<< orphan*/ *,
                                int /*<<< orphan*/ const *, int);
void MC_avg_y_8_mmx(uint8_t *dest, const uint8_t *ref, int stride, int height) {
  MC_avg_y_mmx(8, height, dest, ref, stride);
}


x86 assembly (clang, -O0):
<MC_avg_y_8_mmx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x18(%rbp),%esi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%r8d
mov    $0x8,%edi
call   1030 <MC_avg_y_mmx@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MC_avg_y_8_mmx>:
mov    %edx,%r8d
mov    %rsi,%rax
mov    %rdi,%rdx
mov    $0x8,%edi
mov    %ecx,%esi
mov    %rax,%rcx
jmp    1030 <MC_avg_y_mmx@plt>

LLVM IR (-O0):
define void @MC_avg_y_8_mmx(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %8
%10 = load i32*, i32** %5
%11 = load i32*, i32** %6
%12 = load i32, i32* %7
%13 = call i32 @MC_avg_y_mmx(i32 8, i32 %9, i32* %10, i32* %11, i32 %12)
ret void
}

LLVM IR (-O2):
define void @MC_avg_y_8_mmx(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = tail call i32 @MC_avg_y_mmx(i32 8, i32 %3, i32* %0, i32* %1, i32 %2)
ret void
}
void cpuid_count(int op, int count, int *eax, int *ebx, int *ecx, int *edx) {
  __asm__("cpuid"
          : "=a"(*eax), "=b"(*ebx), "=c"(*ecx), "=d"(*edx)
          : "0"(op), "c"(count));
}


x86 assembly (clang, -O0):
<cpuid_count>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
cpuid
mov    %eax,%r9d
mov    -0x40(%rbp),%rax
mov    %ecx,%esi
mov    -0x38(%rbp),%rcx
mov    %r9d,(%r8)
mov    %ebx,(%rdi)
mov    %esi,(%rcx)
mov    %edx,(%rax)
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuid_count>:
push   %rbx
mov    %rcx,%r10
mov    %rdx,%r11
mov    %esi,%ecx
mov    %edi,%eax
cpuid
mov    %eax,(%r11)
mov    %ebx,(%r10)
mov    %ecx,(%r8)
mov    %edx,(%r9)
pop    %rbx
ret

LLVM IR (-O0):
define void @cpuid_count(i32 %0, i32 %1, i32* %2, i32* %3, i32* %4, i32* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32*
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32* %2, i32** %9
store i32* %3, i32** %10
store i32* %4, i32** %11
store i32* %5, i32** %12
%13 = load i32*, i32** %9
%14 = load i32*, i32** %10
%15 = load i32*, i32** %11
%16 = load i32*, i32** %12
%17 = load i32, i32* %7
%18 = load i32, i32* %8
%19 = call { i32, i32, i32, i32 } asm "cpuid", "={ax},={bx},={cx},={dx},0,{cx},~{dirflag},~{fpsr},~{flags}"(i32 %17, i32 %18)
%20 = extractvalue { i32, i32, i32, i32 } %19, 0
%21 = extractvalue { i32, i32, i32, i32 } %19, 1
%22 = extractvalue { i32, i32, i32, i32 } %19, 2
%23 = extractvalue { i32, i32, i32, i32 } %19, 3
store i32 %20, i32* %13
store i32 %21, i32* %14
store i32 %22, i32* %15
store i32 %23, i32* %16
ret void
}

LLVM IR (-O2):
define void @cpuid_count(i32 %0, i32 %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3, i32* nocapture writeonly %4, i32* nocapture writeonly %5) {
%7 = tail call { i32, i32, i32, i32 } asm "cpuid", "={ax},={bx},={cx},={dx},0,{cx},~{dirflag},~{fpsr},~{flags}"(i32 %0, i32 %1)
%8 = extractvalue { i32, i32, i32, i32 } %7, 0
%9 = extractvalue { i32, i32, i32, i32 } %7, 1
%10 = extractvalue { i32, i32, i32, i32 } %7, 2
%11 = extractvalue { i32, i32, i32, i32 } %7, 3
store i32 %8, i32* %2
store i32 %9, i32* %3
store i32 %10, i32* %4
store i32 %11, i32* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void div() {
DivideByZero:
  printf("Error  : Divide by zero\n");
}


x86 assembly (clang, -O0):
<div>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <div+0x9>
lea    0xee0(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [25 x i8] c"Error : Divide by zero\0A\00"
define void @div() {
br label %1
1: ; preds = %0
%2 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [24 x i8] c"Error : Divide by zero\00"
define void @div() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
main() {
  enum digit { LEN, TWENTY, ONE = 0 };
  int mydigit = LEN + ONE;
  printf("%d", mydigit);
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 0
}
/* Variables and functions */
int _f(int /*<<< orphan*/, int, double const, double const *);
double _I_10(const double omega, const double vertices_omegas[4]) {
  return (_f(0, 1, omega, vertices_omegas) + _f(0, 2, omega, vertices_omegas) +
          _f(0, 3, omega, vertices_omegas)) /
         3;
}


x86 assembly (clang, -O0):
<_I_10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rdx
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <_f@plt>
mov    %eax,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rdx
xor    %edi,%edi
mov    $0x2,%esi
call   1030 <_f@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rdx
xor    %edi,%edi
mov    $0x3,%esi
call   1030 <_f@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_I_10>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movsd  %xmm0,0x8(%rsp)
xor    %edi,%edi
mov    $0x1,%esi
mov    %rbx,%rdx
call   1030 <_f@plt>
mov    %eax,%r14d
xor    %edi,%edi
mov    $0x2,%esi
movsd  0x8(%rsp),%xmm0
mov    %rbx,%rdx
call   1030 <_f@plt>
mov    %eax,%ebp
add    %r14d,%ebp
xor    %edi,%edi
mov    $0x3,%esi
movsd  0x8(%rsp),%xmm0
mov    %rbx,%rdx
call   1030 <_f@plt>
add    %ebp,%eax
cltq
imul   $0x55555556,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define double @_I_10(double %0, double* %1) {
%3 = alloca double
%4 = alloca double*
store double %0, double* %3
store double* %1, double** %4
%5 = load double, double* %3
%6 = load double*, double** %4
%7 = call i32 @_f(i32 0, i32 1, double %5, double* %6)
%8 = load double, double* %3
%9 = load double*, double** %4
%10 = call i32 @_f(i32 0, i32 2, double %8, double* %9)
%11 = add nsw i32 %7, %10
%12 = load double, double* %3
%13 = load double*, double** %4
%14 = call i32 @_f(i32 0, i32 3, double %12, double* %13)
%15 = add nsw i32 %11, %14
%16 = sdiv i32 %15, 3
%17 = sitofp i32 %16 to double
ret double %17
}

LLVM IR (-O2):
define double @_I_10(double %0, double* %1) {
%3 = tail call i32 @_f(i32 0, i32 1, double %0, double* %1)
%4 = tail call i32 @_f(i32 0, i32 2, double %0, double* %1)
%5 = add nsw i32 %4, %3
%6 = tail call i32 @_f(i32 0, i32 3, double %0, double* %1)
%7 = add nsw i32 %5, %6
%8 = sdiv i32 %7, 3
%9 = sitofp i32 %8 to double
ret double %9
}
/* Variables and functions */
int pigpio_command(int, int, unsigned int, int /*<<< orphan*/, int);
int get_PWM_dutycycle(int pi, unsigned user_gpio) {
  return pigpio_command(pi, 83, user_gpio, 0, 1);
}


x86 assembly (clang, -O0):
<get_PWM_dutycycle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    $0x53,%esi
xor    %ecx,%ecx
mov    $0x1,%r8d
call   1030 <pigpio_command@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_PWM_dutycycle>:
mov    %esi,%edx
mov    $0x53,%esi
xor    %ecx,%ecx
mov    $0x1,%r8d
jmp    1030 <pigpio_command@plt>

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

LLVM IR (-O2):
define i32 @get_PWM_dutycycle(i32 %0, i32 %1) {
%3 = tail call i32 @pigpio_command(i32 %0, i32 83, i32 %1, i32 0, i32 1)
ret i32 %3
}
/* Variables and functions */
int strcmp(char const *, char const *);
int qsort_ascending(const void *a, const void *b) {
  const char *aa = a;
  const char *bb = b;
  return strcmp(aa, bb);
}


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

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

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

LLVM IR (-O2):
define i32 @qsort_ascending(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Variables and functions */
char *expand_string_with_args(char const *, int /*<<< orphan*/,
                              int /*<<< orphan*/ *);
char *expand_string(const char *in) {
  return expand_string_with_args(in, 0, NULL);
}


x86 assembly (clang, -O0):
<expand_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <expand_string_with_args@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expand_string>:
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <expand_string_with_args@plt>

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

LLVM IR (-O2):
define i8* @expand_string(i8* %0) {
%2 = tail call i8* @expand_string_with_args(i8* %0, i32 0, i32* null)
ret i8* %2
}
int do_861() { return 861; }


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

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

LLVM IR (-O0):
define i32 @do_861() {
ret i32 861
}

LLVM IR (-O2):
define i32 @do_861() {
ret i32 861
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ memset(int /*<<< orphan*/ *, int, int);
int /*<<< orphan*/ ts_init(int /*<<< orphan*/ *);
int /*<<< orphan*/ ts_set_cc(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ ts_set_payload(int /*<<< orphan*/ *);
int /*<<< orphan*/ ts_set_pid(int /*<<< orphan*/ *, int);
void ts_pad(uint8_t *p_ts) {
  ts_init(p_ts);
  ts_set_pid(p_ts, 0x1fff);
  ts_set_cc(p_ts, 0);
  ts_set_payload(p_ts);
  memset(p_ts + 4, 0xff, 188 - 4);
}


x86 assembly (clang, -O0):
<ts_pad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1070 <ts_init@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1fff,%esi
call   1040 <ts_set_pid@plt>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1060 <ts_set_cc@plt>
mov    -0x8(%rbp),%rdi
call   1050 <ts_set_payload@plt>
mov    -0x8(%rbp),%rdi
add    $0x10,%rdi
mov    $0xff,%esi
mov    $0xb8,%edx
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ts_pad>:
push   %rbx
mov    %rdi,%rbx
call   1070 <ts_init@plt>
mov    %rbx,%rdi
mov    $0x1fff,%esi
call   1040 <ts_set_pid@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1060 <ts_set_cc@plt>
mov    %rbx,%rdi
call   1050 <ts_set_payload@plt>
add    $0x10,%rbx
mov    %rbx,%rdi
mov    $0xff,%esi
mov    $0xb8,%edx
pop    %rbx
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @ts_pad(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @ts_init(i32* %3)
%5 = load i32*, i32** %2
%6 = call i32 @ts_set_pid(i32* %5, i32 8191)
%7 = load i32*, i32** %2
%8 = call i32 @ts_set_cc(i32* %7, i32 0)
%9 = load i32*, i32** %2
%10 = call i32 @ts_set_payload(i32* %9)
%11 = load i32*, i32** %2
%12 = getelementptr inbounds i32, i32* %11, i64 4
%13 = call i32 @memset(i32* %12, i32 255, i32 184)
ret void
}

LLVM IR (-O2):
define void @ts_pad(i32* %0) {
%2 = tail call i32 @ts_init(i32* %0)
%3 = tail call i32 @ts_set_pid(i32* %0, i32 8191)
%4 = tail call i32 @ts_set_cc(i32* %0, i32 0)
%5 = tail call i32 @ts_set_payload(i32* %0)
%6 = getelementptr inbounds i32, i32* %0, i64 4
%7 = tail call i32 @memset(i32* %6, i32 255, i32 184)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ my_malloc_into_struct();
void testMyMalloc() { my_malloc_into_struct(); }


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

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

LLVM IR (-O0):
define void @testMyMalloc() {
%1 = call i32 (...) @my_malloc_into_struct()
ret void
}

LLVM IR (-O2):
define void @testMyMalloc() {
%1 = tail call i32 (...) @my_malloc_into_struct()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ merge(int *, int, int, int);
void msort(int a[], int low, int high) {
  int mid, i;
  if (low < high) {
    mid = (low + high) / 2;
    msort(a, 0, mid);
    msort(a, mid + 1, high);
    merge(a, low, mid, high);
  }
}


x86 assembly (clang, -O0):
<msort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1181 <msort+0x61>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%edx
xor    %esi,%esi
call   1030 <msort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1030 <msort@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1040 <merge@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msort>:
cmp    %edx,%esi
jge    1174 <msort+0x54>
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %edx,%r12d
mov    %esi,%r14d
mov    %rdi,%r15
lea    (%r12,%r14,1),%eax
mov    %eax,%ebx
shr    $0x1f,%ebx
add    %eax,%ebx
sar    %ebx
xor    %esi,%esi
mov    %ebx,%edx
call   1030 <msort@plt>
lea    0x1(%rbx),%esi
mov    %r15,%rdi
mov    %r12d,%edx
call   1030 <msort@plt>
mov    %r15,%rdi
mov    %r14d,%esi
mov    %ebx,%edx
mov    %r12d,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1040 <merge@plt>
ret

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

LLVM IR (-O2):
define void @msort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %6, label %5
5: ; preds = %3, %6
ret void
6: ; preds = %3
%7 = add nsw i32 %2, %1
%8 = sdiv i32 %7, 2
tail call void @msort(i32* %0, i32 0, i32 %8)
%9 = add nsw i32 %8, 1
tail call void @msort(i32* %0, i32 %9, i32 %2)
%10 = tail call i32 @merge(i32* %0, i32 %1, i32 %8, i32 %2)
br label %5
}
void binary(int a, int masive[8]) {
  int broqch = 7;
  while (a != 0) {
    masive[broqch] = a % 2;
    a = a / 2;
    broqch--;
  }
}


x86 assembly (clang, -O0):
<binary>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x7,-0x14(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     114e <binary+0x4e>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1112 <binary+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<binary>:
test   %edi,%edi
je     1130 <binary+0x30>
add    $0x1c,%rsi
mov    %edi,%eax
nopw   0x0(%rax,%rax,1)
shr    $0x1f,%eax
add    %edi,%eax
mov    %eax,%ecx
and    $0xfffffffe,%ecx
mov    %edi,%edx
sub    %ecx,%edx
mov    %edx,(%rsi)
sar    %eax
add    $0x1,%edi
add    $0xfffffffffffffffc,%rsi
cmp    $0x2,%edi
mov    %eax,%edi
ja     1110 <binary+0x10>
ret

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

LLVM IR (-O2):
define void @binary(i32 %0, i32* nocapture writeonly %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %13, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %10, %4 ], [ 7, %2 ]
%6 = phi i32 [ %9, %4 ], [ %0, %2 ]
%7 = srem i32 %6, 2
%8 = getelementptr inbounds i32, i32* %1, i64 %5
store i32 %7, i32* %8
%9 = sdiv i32 %6, 2
%10 = add i64 %5, -1
%11 = add i32 %6, 1
%12 = icmp ult i32 %11, 3
br i1 %12, label %13, label %4
13: ; preds = %4, %2
ret void
}
/* Variables and functions */
double fabs(double);
double pow(double, double);
double exp_sim(double d, double scale, double offset, double origin) {
  double d_norm;
  d_norm = fabs(d - origin);
  if (d_norm <= offset) {
    return 1.0;
  } else {
    return pow(2.0, -(d_norm - offset) / scale);
  }
}


x86 assembly (clang, -O0):
<exp_sim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x28(%rbp),%xmm0
movaps 0xec3(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     116c <exp_sim+0x5c>
movsd  0xeb6(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11a4 <exp_sim+0x94>
movsd  -0x30(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
divsd  -0x18(%rbp),%xmm1
movsd  0xe76(%rip),%xmm0
call   1030 <pow@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exp_sim>:
subsd  %xmm3,%xmm0
andpd  0xee4(%rip),%xmm0
ucomisd %xmm0,%xmm2
jae    1137 <exp_sim+0x27>
subsd  %xmm2,%xmm0
xorpd  0xee2(%rip),%xmm0
divsd  %xmm1,%xmm0
jmp    1030 <exp2@plt>
movsd  0xee1(%rip),%xmm0
ret

LLVM IR (-O0):
define double @exp_sim(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
%11 = load double, double* %6
%12 = load double, double* %9
%13 = fsub double %11, %12
%14 = call double @llvm.fabs.f64(double %13)
store double %14, double* %10
%15 = load double, double* %10
%16 = load double, double* %8
%17 = fcmp ole double %15, %16
br i1 %17, label %18, label %19
18: ; preds = %4
store double 1.000000e+00, double* %5
br label %27
19: ; preds = %4
%20 = load double, double* %10
%21 = load double, double* %8
%22 = fsub double %20, %21
%23 = fneg double %22
%24 = load double, double* %7
%25 = fdiv double %23, %24
%26 = call double @pow(double 2.000000e+00, double %25)
store double %26, double* %5
br label %27
27: ; preds = %19, %18
%28 = load double, double* %5
ret double %28
}

LLVM IR (-O2):
define double @exp_sim(double %0, double %1, double %2, double %3) {
%5 = fsub double %0, %3
%6 = tail call double @llvm.fabs.f64(double %5)
%7 = fcmp ugt double %6, %2
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = fsub double %6, %2
%10 = fneg double %9
%11 = fdiv double %10, %1
%12 = tail call double @exp2(double %11)
br label %13
13: ; preds = %4, %8
%14 = phi double [ %12, %8 ], [ 1.000000e+00, %4 ]
ret double %14
}
void CG_DrawTourneyScoreboard() {}


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

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

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

LLVM IR (-O2):
define void @CG_DrawTourneyScoreboard() {
ret void
}
/* Variables and functions */
size_t strlen(const char *s) {
  size_t i = 0;
  if (s) {
    while (*s++ != 0)
      i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1151 <strlen+0x51>
jmp    1120 <strlen+0x20>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114c <strlen+0x4c>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1120 <strlen+0x20>
jmp    1151 <strlen+0x51>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
test   %rdi,%rdi
je     111f <strlen+0x1f>
cmpb   $0x0,(%rdi)
je     111f <strlen+0x1f>
xor    %ecx,%ecx
nopl   0x0(%rax)
lea    0x1(%rcx),%rax
cmpb   $0x0,0x1(%rdi,%rcx,1)
mov    %rax,%rcx
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = phi i64 [ %10, %6 ], [ 0, %3 ]
%8 = phi i8* [ %9, %6 ], [ %0, %3 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = add i64 %7, 1
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %6
13: ; preds = %6, %3, %1
%14 = phi i64 [ 0, %1 ], [ 0, %3 ], [ %10, %6 ]
ret i64 %14
}
int cqueue_init(int queuelen) {
  if (queuelen <= 0)
    return -1;
}


x86 assembly (clang, -O0):
<cqueue_init>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     1118 <cqueue_init+0x18>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @cqueue_init(i32 %0) {
ret i32 -1
}
/* Variables and functions */
unsigned char *__mib_chain_get(int, unsigned int);
unsigned char *_mib_chain_get(int id, unsigned int recordNum) {
  return __mib_chain_get(id, recordNum);
}


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

x86 assembly (clang, -O2):
<_mib_chain_get>:
jmp    1030 <__mib_chain_get@plt>

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

LLVM IR (-O2):
define i8* @_mib_chain_get(i32 %0, i32 %1) {
%3 = tail call i8* @__mib_chain_get(i32 %0, i32 %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ put_byte(int, int);
__attribute__((always_)) void patch_NCAS_3_2_0_1212_extra(void) {
  put_byte(0x10084B13, 0xEA);
}


x86 assembly (clang, -O0):
<patch_NCAS_3_2_0_1212_extra>:
push   %rbp
mov    %rsp,%rbp
mov    $0x10084b13,%edi
mov    $0xea,%esi
call   1030 <put_byte@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<patch_NCAS_3_2_0_1212_extra>:
mov    $0x10084b13,%edi
mov    $0xea,%esi
jmp    1030 <put_byte@plt>

LLVM IR (-O0):
define void @patch_NCAS_3_2_0_1212_extra() {
%1 = call i32 @put_byte(i32 268978963, i32 234)
ret void
}

LLVM IR (-O2):
define void @patch_NCAS_3_2_0_1212_extra() {
%1 = tail call i32 @put_byte(i32 268978963, i32 234)
ret void
}
char *strcpy(char *dest, const char *src) {
  char *dp = (char *)dest;
  char *sp = (char *)src;
  if ((dest != 0) && (src != 0)) {
    while (*sp != '\0') {
      *dp++ = *sp++;
    }
    *dp = '\0';
  }
  return dest;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1175 <strcpy+0x75>
cmpq   $0x0,-0x10(%rbp)
je     1175 <strcpy+0x75>
jmp    1137 <strcpy+0x37>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     116e <strcpy+0x6e>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
jmp    1137 <strcpy+0x37>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
test   %rdi,%rdi
je     1134 <strcpy+0x34>
test   %rsi,%rsi
je     1134 <strcpy+0x34>
mov    (%rsi),%cl
mov    %rax,%rdx
test   %cl,%cl
je     1131 <strcpy+0x31>
add    $0x1,%rsi
mov    %rax,%rdx
nopl   (%rax)
mov    %cl,(%rdx)
add    $0x1,%rdx
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1120 <strcpy+0x20>
movb   $0x0,(%rdx)
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne i8* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %19
6: ; preds = %2
%7 = load i8, i8* %1
%8 = icmp eq i8 %7, 0
br i1 %8, label %17, label %9
9: ; preds = %6, %9
%10 = phi i8 [ %15, %9 ], [ %7, %6 ]
%11 = phi i8* [ %13, %9 ], [ %1, %6 ]
%12 = phi i8* [ %14, %9 ], [ %0, %6 ]
%13 = getelementptr inbounds i8, i8* %11, i64 1
%14 = getelementptr inbounds i8, i8* %12, i64 1
store i8 %10, i8* %12
%15 = load i8, i8* %13
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %9
17: ; preds = %9, %6
%18 = phi i8* [ %0, %6 ], [ %14, %9 ]
store i8 0, i8* %18
br label %19
19: ; preds = %17, %2
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void grpcsharp_batch_context_recv_message_to_buffer() {
  fprintf(stderr, "Should never reach here");
  abort();
}


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

x86 assembly (clang, -O2):
<grpcsharp_batch_context_recv_message_to_buffer>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_batch_context_recv_message_to_buffer() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_batch_context_recv_message_to_buffer() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
unsigned char *xsalsa20poly1305_encrypt(unsigned char *, size_t *,
                                        unsigned char const *, size_t,
                                        unsigned char const *,
                                        unsigned char const *);
unsigned char *crypt_encrypt_xsalsa20poly1305(
    unsigned char *out, size_t *out_len, const unsigned char *in, size_t in_len,
    const unsigned char *nonce, const unsigned char *key) {
  return xsalsa20poly1305_encrypt(out, out_len, in, in_len, nonce, key);
}


x86 assembly (clang, -O0):
<crypt_encrypt_xsalsa20poly1305>:
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    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
call   1030 <xsalsa20poly1305_encrypt@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crypt_encrypt_xsalsa20poly1305>:
jmp    1030 <xsalsa20poly1305_encrypt@plt>

LLVM IR (-O0):
define i8* @crypt_encrypt_xsalsa20poly1305(i8* %0, i64* %1, i8* %2, i64 %3, i8* %4, i8* %5) {
%7 = alloca i8*
%8 = alloca i64*
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i8*
%12 = alloca i8*
store i8* %0, i8** %7
store i64* %1, i64** %8
store i8* %2, i8** %9
store i64 %3, i64* %10
store i8* %4, i8** %11
store i8* %5, i8** %12
%13 = load i8*, i8** %7
%14 = load i64*, i64** %8
%15 = load i8*, i8** %9
%16 = load i64, i64* %10
%17 = load i8*, i8** %11
%18 = load i8*, i8** %12
%19 = call i8* @xsalsa20poly1305_encrypt(i8* %13, i64* %14, i8* %15, i64 %16, i8* %17, i8* %18)
ret i8* %19
}

LLVM IR (-O2):
define i8* @crypt_encrypt_xsalsa20poly1305(i8* %0, i64* %1, i8* %2, i64 %3, i8* %4, i8* %5) {
%7 = tail call i8* @xsalsa20poly1305_encrypt(i8* %0, i64* %1, i8* %2, i64 %3, i8* %4, i8* %5)
ret i8* %7
}
/* Type definitions */
struct jelio_buf {
  int dummy;
};

/* Variables and functions */
struct jelio_buf *jelio_buffer(int);
int jelio_buffer_getc(struct jelio_buf *);
int bugetc(int fd) {
  struct jelio_buf *jb;
  jb = jelio_buffer(fd);
  if (!jb)
    return -2;
  return jelio_buffer_getc(jb);
}


x86 assembly (clang, -O0):
<bugetc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <jelio_buffer@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114e <bugetc+0x2e>
movl   $0xfffffffe,-0x4(%rbp)
jmp    115a <bugetc+0x3a>
mov    -0x10(%rbp),%rdi
call   1030 <jelio_buffer_getc@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bugetc>:
push   %rax
call   1040 <jelio_buffer@plt>
test   %rax,%rax
je     1134 <bugetc+0x14>
mov    %rax,%rdi
pop    %rax
jmp    1030 <jelio_buffer_getc@plt>
mov    $0xfffffffe,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.jelio_buf = type { i32 }
define i32 @bugetc(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca %struct.jelio_buf*
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call %struct.jelio_buf* @jelio_buffer(i32 %5)
store %struct.jelio_buf* %6, %struct.jelio_buf** %4
%7 = load %struct.jelio_buf*, %struct.jelio_buf** %4
%8 = icmp ne %struct.jelio_buf* %7, null
br i1 %8, label %10, label %9
9: ; preds = %1
store i32 -2, i32* %2
br label %13
10: ; preds = %1
%11 = load %struct.jelio_buf*, %struct.jelio_buf** %4
%12 = call i32 @jelio_buffer_getc(%struct.jelio_buf* %11)
store i32 %12, i32* %2
br label %13
13: ; preds = %10, %9
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
%struct.jelio_buf = type { i32 }
define i32 @bugetc(i32 %0) {
%2 = tail call %struct.jelio_buf* @jelio_buffer(i32 %0)
%3 = icmp eq %struct.jelio_buf* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @jelio_buffer_getc(%struct.jelio_buf* %2)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ -2, %1 ]
ret i32 %7
}
/* Variables and functions */
int strcmp(char const *, char const *);
int __cmpfunc(const void *first, const void *second) {
  return -strcmp(*(const char **)first, *(const char **)second);
}


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

x86 assembly (clang, -O2):
<__cmpfunc>:
push   %rax
mov    (%rdi),%rdi
mov    (%rsi),%rsi
call   1030 <strcmp@plt>
neg    %eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @__cmpfunc(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
%8 = sub nsw i32 0, %7
ret i32 %8
}
/* Variables and functions */
char const *memintern(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
const char *strintern(const char *string) {
  return memintern(string, strlen(string));
}


x86 assembly (clang, -O0):
<strintern>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <memintern@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strintern>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <memintern@plt>

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

LLVM IR (-O2):
define i8* @strintern(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i8* @memintern(i8* %0, i32 %2)
ret i8* %3
}