xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ avr_end();
int /*<<< orphan*/ speed_bigint_mul136();
int /*<<< orphan*/ speed_bigint_mul256();
int /*<<< orphan*/ speed_curve25519();
int /*<<< orphan*/ speed_ed25519();
int /*<<< orphan*/ speed_empty();
int /*<<< orphan*/ speed_nothing();
int /*<<< orphan*/ speed_poly1305();
int /*<<< orphan*/ speed_salsa20();
int /*<<< orphan*/ speed_sha512();
int main() {
  speed_nothing();
  speed_empty();
  speed_bigint_mul136();
  speed_bigint_mul256();
  speed_salsa20();
  speed_poly1305();
  speed_sha512();
  speed_curve25519();
  speed_ed25519();
  avr_end();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1070 <speed_nothing@plt>
mov    $0x0,%al
call   1060 <speed_empty@plt>
mov    $0x0,%al
call   1050 <speed_bigint_mul136@plt>
mov    $0x0,%al
call   1030 <speed_bigint_mul256@plt>
mov    $0x0,%al
call   10b0 <speed_salsa20@plt>
mov    $0x0,%al
call   1040 <speed_poly1305@plt>
mov    $0x0,%al
call   1080 <speed_sha512@plt>
mov    $0x0,%al
call   1090 <speed_curve25519@plt>
mov    $0x0,%al
call   10a0 <speed_ed25519@plt>
mov    $0x0,%al
call   10c0 <avr_end@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1070 <speed_nothing@plt>
xor    %eax,%eax
call   1060 <speed_empty@plt>
xor    %eax,%eax
call   1050 <speed_bigint_mul136@plt>
xor    %eax,%eax
call   1030 <speed_bigint_mul256@plt>
xor    %eax,%eax
call   10b0 <speed_salsa20@plt>
xor    %eax,%eax
call   1040 <speed_poly1305@plt>
xor    %eax,%eax
call   1080 <speed_sha512@plt>
xor    %eax,%eax
call   1090 <speed_curve25519@plt>
xor    %eax,%eax
call   10a0 <speed_ed25519@plt>
xor    %eax,%eax
call   10c0 <avr_end@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @speed_nothing()
%3 = call i32 (...) @speed_empty()
%4 = call i32 (...) @speed_bigint_mul136()
%5 = call i32 (...) @speed_bigint_mul256()
%6 = call i32 (...) @speed_salsa20()
%7 = call i32 (...) @speed_poly1305()
%8 = call i32 (...) @speed_sha512()
%9 = call i32 (...) @speed_curve25519()
%10 = call i32 (...) @speed_ed25519()
%11 = call i32 (...) @avr_end()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @speed_nothing()
%2 = tail call i32 (...) @speed_empty()
%3 = tail call i32 (...) @speed_bigint_mul136()
%4 = tail call i32 (...) @speed_bigint_mul256()
%5 = tail call i32 (...) @speed_salsa20()
%6 = tail call i32 (...) @speed_poly1305()
%7 = tail call i32 (...) @speed_sha512()
%8 = tail call i32 (...) @speed_curve25519()
%9 = tail call i32 (...) @speed_ed25519()
%10 = tail call i32 (...) @avr_end()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int main() {
  printf("OS Rocks\n");
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@str = [9 x i8] c"OS Rocks\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
void set_rounding_precision(uae_u32) {}


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

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

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

LLVM IR (-O2):
define void @set_rounding_precision(i32 %0) {
ret void
}
/* Variables and functions */
int fabs(double);
int equals(double a, double b) { return fabs(a - b) < 1e-12; }


x86 assembly (clang, -O0):
<equals>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
call   1030 <fabs@plt>
cvtsi2sd %eax,%xmm1
movsd  0xec3(%rip),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<equals>:
push   %rax
subsd  %xmm1,%xmm0
call   1030 <fabs@plt>
xor    %ecx,%ecx
test   %eax,%eax
setle  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @equals(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 = fsub double %5, %6
%8 = call i32 @fabs(double %7)
%9 = sitofp i32 %8 to double
%10 = fcmp olt double %9, 0x3D719799812DEA11
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @equals(double %0, double %1) {
%3 = fsub double %0, %1
%4 = tail call i32 @fabs(double %3)
%5 = icmp slt i32 %4, 1
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t u4_12_from_float(float f) {
  static const float scale = (float)(1 << 12);
  static const float limpos = 0xffff / scale;
  if (f <= 0.) {
    return 0;
  } else if (f >= limpos) {
    return 0xffff;
  }
  return f * scale + 0.5;
}


x86 assembly (clang, -O0):
<u4_12_from_float>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jb     112b <u4_12_from_float+0x2b>
movl   $0x0,-0x4(%rbp)
jmp    1176 <u4_12_from_float+0x76>
movss  -0x8(%rbp),%xmm0
movss  0xec8(%rip),%xmm1
ucomiss %xmm1,%xmm0
jb     114d <u4_12_from_float+0x4d>
movl   $0xffff,-0x4(%rbp)
jmp    1176 <u4_12_from_float+0x76>
jmp    1152 <u4_12_from_float+0x52>
movss  0xeaa(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe9d(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<u4_12_from_float>:
xor    %eax,%eax
xorps  %xmm1,%xmm1
ucomiss %xmm0,%xmm1
jae    1130 <u4_12_from_float+0x30>
mov    $0xffff,%eax
ucomiss 0xeea(%rip),%xmm0
jae    1130 <u4_12_from_float+0x30>
mulss  0xee4(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  0xedc(%rip),%xmm0
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
@u4_12_from_float.scale = internal constant float 4.096000e+03
@u4_12_from_float.limpos = internal constant float 0x402FFFE000000000
define i32 @u4_12_from_float(float %0) {
%2 = alloca i32
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fpext float %4 to double
%6 = fcmp ole double %5, 0.000000e+00
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %19
8: ; preds = %1
%9 = load float, float* %3
%10 = fcmp oge float %9, 0x402FFFE000000000
br i1 %10, label %11, label %12
11: ; preds = %8
store i32 65535, i32* %2
br label %19
12: ; preds = %8
br label %13
13: ; preds = %12
%14 = load float, float* %3
%15 = fmul float %14, 4.096000e+03
%16 = fpext float %15 to double
%17 = fadd double %16, 5.000000e-01
%18 = fptosi double %17 to i32
store i32 %18, i32* %2
br label %19
19: ; preds = %13, %11, %7
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @u4_12_from_float(float %0) {
%2 = fcmp ugt float %0, 0.000000e+00
br i1 %2, label %3, label %10
3: ; preds = %1
%4 = fcmp ult float %0, 0x402FFFE000000000
br i1 %4, label %5, label %10
5: ; preds = %3
%6 = fmul float %0, 4.096000e+03
%7 = fpext float %6 to double
%8 = fadd double %7, 5.000000e-01
%9 = fptosi double %8 to i32
br label %10
10: ; preds = %3, %1, %5
%11 = phi i32 [ %9, %5 ], [ 0, %1 ], [ 65535, %3 ]
ret i32 %11
}
int do_429() { return 429; }


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

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

LLVM IR (-O0):
define i32 @do_429() {
ret i32 429
}

LLVM IR (-O2):
define i32 @do_429() {
ret i32 429
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int murmur_fmix(int);
uint32_t murmur_finish(uint32_t state, int len) {
  state ^= len;
  state = murmur_fmix(state);
  return state;
}


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

x86 assembly (clang, -O2):
<murmur_finish>:
xor    %esi,%edi
jmp    1030 <murmur_fmix@plt>

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

LLVM IR (-O2):
define i32 @murmur_finish(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
%4 = tail call i32 @murmur_fmix(i32 %3)
ret i32 %4
}
int main() { return 0x1337; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x1337,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 4919
}
int sqAssert(int aBool) { ; }


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

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

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

LLVM IR (-O2):
define i32 @sqAssert(i32 %0) {
ret i32 undef
}
void BLESecondsTimerPing() {}


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

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

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

LLVM IR (-O2):
define void @BLESecondsTimerPing() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void *malloc(size_t);
void *_alloc(size_t size) {
  void *ptr = malloc(size);
  assert(!size || ptr);
  return ptr;
}


x86 assembly (clang, -O0):
<_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    $0x1,%al
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x11(%rbp)
je     1154 <_alloc+0x34>
cmpq   $0x0,-0x10(%rbp)
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_alloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <malloc@plt>
mov    %rax,%r14
test   %rbx,%rbx
sete   %al
test   %r14,%r14
setne  %cl
or     %al,%cl
movzbl %cl,%edi
call   1030 <assert@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @_alloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i64, i64* %2
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = icmp ne i8* %9, null
br label %11
11: ; preds = %8, %1
%12 = phi i1 [ true, %1 ], [ %10, %8 ]
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
define noalias i8* @_alloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i64 %0, 0
%4 = icmp ne i8* %2, null
%5 = or i1 %3, %4
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ query;

/* Variables and functions */
int RS400_recvbytes(unsigned char *);
int /*<<< orphan*/ RS400_sendbytes(unsigned char *, int);
int RS400_get_overview(unsigned char data[]) {
  unsigned char query[] = {0x15};
  RS400_sendbytes(query, sizeof(query));
  return RS400_recvbytes(data);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0xece(%rip),%al
mov    %al,-0x9(%rbp)
lea    -0x9(%rbp),%rdi
mov    $0x1,%esi
call   1030 <RS400_sendbytes@plt>
mov    -0x8(%rbp),%rdi
call   1040 <RS400_recvbytes@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movb   $0x15,0xf(%rsp)
lea    0xf(%rsp),%rdi
mov    $0x1,%esi
call   1030 <RS400_sendbytes@plt>
mov    %rbx,%rdi
call   1040 <RS400_recvbytes@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.RS400_get_overview.query = [1 x i8] c"\15"
define i32 @RS400_get_overview(i8* %0) {
%2 = alloca i8*
%3 = alloca [1 x i8]
store i8* %0, i8** %2
%4 = bitcast [1 x i8]* %3 to i8*
%5 = getelementptr inbounds [1 x i8], [1 x i8]* %3, i64 0, i64 0
%6 = call i32 @RS400_sendbytes(i8* %5, i32 1)
%7 = load i8*, i8** %2
%8 = call i32 @RS400_recvbytes(i8* %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @RS400_get_overview(i8* %0) {
%2 = alloca [1 x i8]
%3 = getelementptr inbounds [1 x i8], [1 x i8]* %2, i64 0, i64 0
store i8 21, i8* %3
%4 = call i32 @RS400_sendbytes(i8* %3, i32 1)
%5 = call i32 @RS400_recvbytes(i8* %0)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void foo(void) { puts("New message 2"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"New message 2\00"
define void @foo() {
%1 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"New message 2\00"
define void @foo() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, unsigned int);
int /*<<< orphan*/ stdout;
main() {
  int x;
  unsigned int y;
  x = -10;
  y = x;
  fprintf(stdout, "%d %u\n", x, y);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xfffffff6,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    0x2eb4(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
mov    $0xfffffff6,%edx
mov    $0xfffffff6,%ecx
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [7 x i8] c"%d %u\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 -10, i32* %1
%3 = load i32, i32* %1
store i32 %3, i32* %2
%4 = load i32, i32* @stdout
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [7 x i8] c"%d %u\0A\00"
define i32 @main() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 -10, i32 -10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ charcopy(char *, char *);
int charlen(char *);
scalar_t__ malloc(int);
char *adjust(char *s) {
  char *c;
  c = (char *)malloc(charlen(s) * sizeof(char));
  charcopy(s, c);
  return c;
}


x86 assembly (clang, -O0):
<adjust>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <charlen@plt>
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <charcopy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<adjust>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1050 <charlen@plt>
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
call   1040 <charcopy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @adjust(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @charlen(i8* %4)
%6 = sext i32 %5 to i64
%7 = mul i64 %6, 1
%8 = trunc i64 %7 to i32
%9 = call i64 @malloc(i32 %8)
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %3
%11 = load i8*, i8** %2
%12 = load i8*, i8** %3
%13 = call i32 @charcopy(i8* %11, i8* %12)
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
define i8* @adjust(i8* %0) {
%2 = tail call i32 @charlen(i8* %0)
%3 = tail call i64 @malloc(i32 %2)
%4 = inttoptr i64 %3 to i8*
%5 = tail call i32 @charcopy(i8* %0, i8* %4)
ret i8* %4
}
void excalibur_stop(void) {}


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

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

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

LLVM IR (-O2):
define void @excalibur_stop() {
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
bool unicode_is_high_surrogate_utf16(uint16_t value) {
  return (value & 0xFC00) == 0xD800;
}


x86 assembly (clang, -O0):
<unicode_is_high_surrogate_utf16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xfc00,%eax
cmp    $0xd800,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unicode_is_high_surrogate_utf16>:
and    $0xfc00,%edi
xor    %eax,%eax
cmp    $0xd800,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @unicode_is_high_surrogate_utf16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 64512
%5 = icmp eq i32 %4, 55296
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @unicode_is_high_surrogate_utf16(i32 %0) {
%2 = and i32 %0, 64512
%3 = icmp eq i32 %2, 55296
%4 = zext i1 %3 to i32
ret i32 %4
}
int parity4(unsigned *array, int len) {
  int i, val, res = 0;
  unsigned x;
  for (i = 0; i < len; i++) {
    x = array[i];
    val = 0;
    asm("\n"
        "ini4:                 \n\t"
        "     xor %[x], %[v]   \n\t"
        "     shr %[x]         \n\t"
        "     jne ini4         \n\t"
        : [v] "+r"(val)
        : [x] "r"(x));
    res += val & 0x1;
  }
  return res;
}


x86 assembly (clang, -O0):
<parity4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1167 <ini4+0x27>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x1c(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x1c(%rbp),%ecx

x86 assembly (clang, -O2):
<parity4>:
test   %esi,%esi
jle    112a <ini4+0x15>
mov    %esi,%r8d
xor    %edx,%edx
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
mov    (%rdi,%rdx,4),%esi
xor    %ecx,%ecx

LLVM IR (-O0):
define i32 @parity4(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %7
store i32 0, i32* %5
br label %9
9: ; preds = %26, %2
%10 = load i32, i32* %5
%11 = load i32, i32* %4
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %29
13: ; preds = %9
%14 = load i32*, i32** %3
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %14, i64 %16
%18 = load i32, i32* %17
store i32 %18, i32* %8
store i32 0, i32* %6
%19 = load i32, i32* %6
%20 = load i32, i32* %8
%21 = call i32 asm "\0Aini4: \0A\09 xor $1, $0 \0A\09 shr $1 \0A\09 jne ini4 \0A\09", "=r,r,0,~{dirflag},~{fpsr},~{flags}"(i32 %20, i32 %19)
store i32 %21, i32* %6
%22 = load i32, i32* %6
%23 = and i32 %22, 1
%24 = load i32, i32* %7
%25 = add nsw i32 %24, %23
store i32 %25, i32* %7
br label %26
26: ; preds = %13
%27 = load i32, i32* %5
%28 = add nsw i32 %27, 1
store i32 %28, i32* %5
br label %9
29: ; preds = %9
%30 = load i32, i32* %7
ret i32 %30
}

LLVM IR (-O2):
define i32 @parity4(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %16
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %14, %6 ]
%8 = phi i32 [ 0, %4 ], [ %13, %6 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %7
%10 = load i32, i32* %9
%11 = tail call i32 asm "\0Aini4: \0A\09 xor $1, $0 \0A\09 shr $1 \0A\09 jne ini4 \0A\09", "=r,r,0,~{dirflag},~{fpsr},~{flags}"(i32 %10, i32 0)
%12 = and i32 %11, 1
%13 = add nuw nsw i32 %12, %8
%14 = add nuw nsw i64 %7, 1
%15 = icmp eq i64 %14, %5
br i1 %15, label %16, label %6
16: ; preds = %6, %2
%17 = phi i32 [ 0, %2 ], [ %13, %6 ]
ret i32 %17
}
/* Variables and functions */
int any(char *, char *);
int /*<<< orphan*/ printf(char *, char, int);
int main() {
  char *s1 = "hello";
  char *s2 = "world";
  int idx;
  idx = any(s1, s2);
  printf("First character matching %c is at %d\n", s1[idx], idx);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xec5(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <any@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    -0x1c(%rbp),%edx
lea    0xea2(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
lea    0xed7(%rip),%rsi
mov    %rbx,%rdi
call   1040 <any@plt>
movslq %eax,%rdx
movsbl (%rdx,%rbx,1),%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"hello\00"
@.str.1 = [6 x i8] c"world\00"
@.str.2 = [38 x i8] c"First character matching %c is at %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i32 0, i32* %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %2
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8** %3
%5 = load i8*, i8** %2
%6 = load i8*, i8** %3
%7 = call i32 @any(i8* %5, i8* %6)
store i32 %7, i32* %4
%8 = load i8*, i8** %2
%9 = load i32, i32* %4
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = load i8, i8* %11
%13 = load i32, i32* %4
%14 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), i8 signext %12, i32 %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"hello\00"
@.str.1 = [6 x i8] c"world\00"
@.str.2 = [38 x i8] c"First character matching %c is at %d\0A\00"
define i32 @main() {
%1 = tail call i32 @any(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%2 = sext i32 %1 to i64
%3 = getelementptr inbounds [6 x i8], [6 x i8]* @.str, i64 0, i64 %2
%4 = load i8, i8* %3
%5 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), i8 signext %4, i32 %1)
ret i32 0
}
/* Variables and functions */
int in(int, int, int);
int u8islowerasciii(int n) { return in(n, 0x61, 0x7A); }


x86 assembly (clang, -O0):
<u8islowerasciii>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x61,%esi
mov    $0x7a,%edx
call   1030 <in@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<u8islowerasciii>:
mov    $0x61,%esi
mov    $0x7a,%edx
jmp    1030 <in@plt>

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

LLVM IR (-O2):
define i32 @u8islowerasciii(i32 %0) {
%2 = tail call i32 @in(i32 %0, i32 97, i32 122)
ret i32 %2
}
int int_sub(int x, int y) { return x - y; }


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

x86 assembly (clang, -O2):
<int_sub>:
mov    %edi,%eax
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @int_sub(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 = sub nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @int_sub(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ GLshort;

/* Variables and functions */
int /*<<< orphan*/ glVertex2sv(int /*<<< orphan*/ *);
void Vertex2sv(GLshort v[2]) { glVertex2sv(v); }


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

x86 assembly (clang, -O2):
<Vertex2sv>:
jmp    1030 <glVertex2sv@plt>

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

LLVM IR (-O2):
define void @Vertex2sv(i32* %0) {
%2 = tail call i32 @glVertex2sv(i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ multipli(int, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  multipli(n, m);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1030 <multipli@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 @multipli(i32 %6, i32 %7)
ret i32 0
}
/* Variables and functions */
int umount2(char *, int /*<<< orphan*/);
int main(void) { return umount2("", 0); }


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

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rdi
xor    %esi,%esi
jmp    1030 <umount2@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @umount2(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 %2
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i32 @main() {
%1 = tail call i32 @umount2(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 %1
}
/* Type definitions */
struct in_addr {
  int dummy;
};

/* Variables and functions */
int AF_INET;
int AF_INET6;
int /*<<< orphan*/ assert(int);
char *inet_ntoa(struct in_addr);
const char *netcat_inet_ntop(int af, const void *src) {
  const char *ret;
  ;
  assert((af == AF_INET) || (af == AF_INET6));
  ret = inet_ntoa(*(struct in_addr *)src);
  return ret;
}


x86 assembly (clang, -O0):
<netcat_inet_ntop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x1,%al
mov    0x2ead(%rip),%rdx
cmp    (%rdx),%ecx
mov    %al,-0x19(%rbp)
je     1158 <netcat_inet_ntop+0x38>
mov    -0x4(%rbp),%eax
mov    0x2e90(%rip),%rcx
cmp    (%rcx),%eax
sete   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1030 <inet_ntoa@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<netcat_inet_ntop>:
push   %rbx
mov    0x2ec0(%rip),%rax
cmp    %edi,(%rax)
sete   %al
mov    0x2eac(%rip),%rcx
cmp    %edi,(%rcx)
mov    %rsi,%rbx
sete   %cl
or     %al,%cl
movzbl %cl,%edi
call   1040 <assert@plt>
mov    (%rbx),%edi
pop    %rbx
jmp    1030 <inet_ntoa@plt>

LLVM IR (-O0):
%struct.in_addr = type { i32 }
@AF_INET = global i32 0
@AF_INET6 = global i32 0
define i8* @netcat_inet_ntop(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i32, i32* %3
%7 = load i32, i32* @AF_INET
%8 = icmp eq i32 %6, %7
br i1 %8, label %13, label %9
9: ; preds = %2
%10 = load i32, i32* %3
%11 = load i32, i32* @AF_INET6
%12 = icmp eq i32 %10, %11
br label %13
13: ; preds = %9, %2
%14 = phi i1 [ true, %2 ], [ %12, %9 ]
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
%17 = load i8*, i8** %4
%18 = bitcast i8* %17 to %struct.in_addr*
%19 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %18, i32 0, i32 0
%20 = load i32, i32* %19
%21 = call i8* @inet_ntoa(i32 %20)
store i8* %21, i8** %5
%22 = load i8*, i8** %5
ret i8* %22
}

LLVM IR (-O2):
@AF_INET = global i32 0
@AF_INET6 = global i32 0
define i8* @netcat_inet_ntop(i32 %0, i8* nocapture %1) {
%3 = load i32, i32* @AF_INET
%4 = icmp eq i32 %3, %0
%5 = load i32, i32* @AF_INET6
%6 = icmp eq i32 %5, %0
%7 = select i1 %4, i1 true, i1 %6
%8 = zext i1 %7 to i32
%9 = tail call i32 @assert(i32 %8)
%10 = bitcast i8* %1 to i32*
%11 = load i32, i32* %10
%12 = tail call i8* @inet_ntoa(i32 %11)
ret i8* %12
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;
typedef int /*<<< orphan*/ mtx_t;

/* Variables and functions */
int __pthread_mutex_unlock(int /*<<< orphan*/ *);
int mtx_unlock(mtx_t *mtx) {
  return __pthread_mutex_unlock((pthread_mutex_t *)mtx);
}


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

x86 assembly (clang, -O2):
<mtx_unlock>:
jmp    1030 <__pthread_mutex_unlock@plt>

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

LLVM IR (-O2):
define i32 @mtx_unlock(i32* %0) {
%2 = tail call i32 @__pthread_mutex_unlock(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ bzero(void *, int);
void *uws_malloc(int);
void *uws_calloc(size_t nmemb, size_t size) {
  int s = nmemb * size;
  void *p = uws_malloc(s);
  bzero(p, s);
  return p;
}


x86 assembly (clang, -O0):
<uws_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
imul   -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <uws_malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <bzero@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uws_calloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
imul   %edi,%ebx
mov    %ebx,%edi
call   1030 <uws_malloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    %ebx,%esi
call   1040 <bzero@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @uws_calloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i32
%6 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%7 = load i64, i64* %3
%8 = load i64, i64* %4
%9 = mul i64 %7, %8
%10 = trunc i64 %9 to i32
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = call i8* @uws_malloc(i32 %11)
store i8* %12, i8** %6
%13 = load i8*, i8** %6
%14 = load i32, i32* %5
%15 = call i32 @bzero(i8* %13, i32 %14)
%16 = load i8*, i8** %6
ret i8* %16
}

LLVM IR (-O2):
define i8* @uws_calloc(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = trunc i64 %3 to i32
%5 = tail call i8* @uws_malloc(i32 %4)
%6 = tail call i32 @bzero(i8* %5, i32 %4)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ test_goal_create();
void run_goal_tests() { test_goal_create(); }


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

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

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

LLVM IR (-O2):
define void @run_goal_tests() {
%1 = tail call i32 (...) @test_goal_create()
ret void
}
/* Variables and functions */
int fatorial(int);
int binomial_coefficient(int n, int p) {
  return fatorial(n) / (fatorial(p) * fatorial(n - p));
}


x86 assembly (clang, -O0):
<binomial_coefficient>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <fatorial@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <fatorial@plt>
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
sub    -0x8(%rbp),%edi
call   1030 <fatorial@plt>
mov    -0x10(%rbp),%ecx
mov    %eax,%edx
mov    -0xc(%rbp),%eax
imul   %edx,%ecx
cltd
idiv   %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<binomial_coefficient>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <fatorial@plt>
mov    %eax,%r14d
mov    %ebx,%edi
call   1030 <fatorial@plt>
mov    %eax,%r15d
sub    %ebx,%ebp
mov    %ebp,%edi
call   1030 <fatorial@plt>
mov    %eax,%ecx
imul   %r15d,%ecx
mov    %r14d,%eax
cltd
idiv   %ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @binomial_coefficient(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 @fatorial(i32 %5)
%7 = load i32, i32* %4
%8 = call i32 @fatorial(i32 %7)
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = sub nsw i32 %9, %10
%12 = call i32 @fatorial(i32 %11)
%13 = mul nsw i32 %8, %12
%14 = sdiv i32 %6, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @binomial_coefficient(i32 %0, i32 %1) {
%3 = tail call i32 @fatorial(i32 %0)
%4 = tail call i32 @fatorial(i32 %1)
%5 = sub nsw i32 %0, %1
%6 = tail call i32 @fatorial(i32 %5)
%7 = mul nsw i32 %6, %4
%8 = sdiv i32 %3, %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fpTest(double, double);
int main() {
  fpTest(35.7, 45.0);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xec9(%rip),%xmm0
movsd  0xec9(%rip),%xmm1
call   1030 <fpTest@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xed7(%rip),%xmm0
movsd  0xed7(%rip),%xmm1
call   1030 <fpTest@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @fpTest(double 3.570000e+01, double 4.500000e+01)
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @fpTest(double 3.570000e+01, double 4.500000e+01)
%2 = tail call i32 @exit(i32 0)
unreachable
}
void zero_cutoff(float *mdct_line, int mdct_line_num, int cutoff_line) {
  int i;
  for (i = cutoff_line; i < mdct_line_num; i++)
    mdct_line[i] = 0;
}


x86 assembly (clang, -O0):
<zero_cutoff>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113e <zero_cutoff+0x3e>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1114 <zero_cutoff+0x14>
pop    %rbp
ret

x86 assembly (clang, -O2):
<zero_cutoff>:
cmp    %esi,%edx
jge    1133 <zero_cutoff+0x23>
push   %rax
movslq %edx,%rax
lea    (%rdi,%rax,4),%rdi
not    %edx
add    %esi,%edx
lea    0x4(,%rdx,4),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @zero_cutoff(float* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %2, %1
br i1 %4, label %5, label %14
5: ; preds = %3
%6 = sext i32 %2 to i64
%7 = getelementptr float, float* %0, i64 %6
%8 = bitcast float* %7 to i8*
%9 = xor i32 %2, -1
%10 = add i32 %9, %1
%11 = zext i32 %10 to i64
%12 = shl nuw nsw i64 %11, 2
%13 = add nuw nsw i64 %12, 4
br label %14
14: ; preds = %5, %3
ret void
}
/* Variables and functions */
int *calloc(int, int);
int /*<<< orphan*/ free(int *);
int /*<<< orphan*/ sleep(int);
int main(void) {
  int y = 0;
  int *x = calloc(1, sizeof(int));
  free(x);
  y += x[0];
  sleep(1);
  y += x[0];
  return y;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x1,%edi
mov    $0x4,%esi
call   1040 <calloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x1,%edi
call   1050 <sleep@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1,%edi
mov    $0x4,%esi
call   1040 <calloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <free@plt>
mov    (%rbx),%ebx
mov    $0x1,%edi
call   1050 <sleep@plt>
add    %ebx,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
store i32 0, i32* %1
store i32 0, i32* %2
%4 = call i32* @calloc(i32 1, i32 4)
store i32* %4, i32** %3
%5 = load i32*, i32** %3
%6 = call i32 @free(i32* %5)
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 0
%9 = load i32, i32* %8
%10 = load i32, i32* %2
%11 = add nsw i32 %10, %9
store i32 %11, i32* %2
%12 = call i32 @sleep(i32 1)
%13 = load i32*, i32** %3
%14 = getelementptr inbounds i32, i32* %13, i64 0
%15 = load i32, i32* %14
%16 = load i32, i32* %2
%17 = add nsw i32 %16, %15
store i32 %17, i32* %2
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* @calloc(i32 1, i32 4)
%2 = tail call i32 @free(i32* %1)
%3 = load i32, i32* %1
%4 = tail call i32 @sleep(i32 1)
%5 = shl nsw i32 %3, 1
ret i32 %5
}
int test_imm_A4int8_reg(signed char val) {
  return ((val) & (-0xA4 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_A4int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffff5c,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_A4int8_reg>:
test   $0xffffff5c,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_A4int8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -164
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int numbtrop_standard_size(int *nbt) {
  int fail, *b;
  double *c;
  fail = _ada_use_c2phc(720, nbt, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<numbtrop_standard_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x2d0,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<numbtrop_standard_size>:
mov    %rdi,%rsi
mov    $0x2d0,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @numbtrop_standard_size(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32*
%5 = alloca double*
store i32* %0, i32** %2
%6 = load i32*, i32** %2
%7 = load i32*, i32** %4
%8 = load double*, double** %5
%9 = call i32 @_ada_use_c2phc(i32 720, i32* %6, i32* %7, double* %8)
store i32 %9, i32* %3
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @numbtrop_standard_size(i32* %0) {
%2 = tail call i32 @_ada_use_c2phc(i32 720, i32* %0, i32* undef, double* undef)
ret i32 %2
}
/* Variables and functions */
double log(double);
double logCauchy(double x, double mu, double sigma) {
  double diff = log(x) - mu;
  return 1 / (x * 3.14159265358979323846) * sigma /
         (diff * diff + sigma * sigma);
}


x86 assembly (clang, -O0):
<logCauchy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <log@plt>
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xec5(%rip),%xmm1
mulsd  -0x8(%rbp),%xmm1
movsd  0xeb0(%rip),%xmm0
divsd  %xmm1,%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm3
movsd  -0x18(%rbp),%xmm2
mulsd  -0x18(%rbp),%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logCauchy>:
sub    $0x18,%rsp
movsd  %xmm2,0x10(%rsp)
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,(%rsp)
call   1030 <log@plt>
movsd  (%rsp),%xmm2
mulsd  0xec9(%rip),%xmm2
subsd  0x8(%rsp),%xmm0
movsd  0xec3(%rip),%xmm1
divsd  %xmm2,%xmm1
movsd  0x10(%rsp),%xmm2
mulsd  %xmm2,%xmm1
mulsd  %xmm2,%xmm2
mulsd  %xmm0,%xmm0
addsd  %xmm2,%xmm0
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @logCauchy(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%8 = load double, double* %4
%9 = call double @log(double %8)
%10 = load double, double* %5
%11 = fsub double %9, %10
store double %11, double* %7
%12 = load double, double* %4
%13 = fmul double %12, 0x400921FB54442D18
%14 = fdiv double 1.000000e+00, %13
%15 = load double, double* %6
%16 = fmul double %14, %15
%17 = load double, double* %7
%18 = load double, double* %7
%19 = load double, double* %6
%20 = load double, double* %6
%21 = fmul double %19, %20
%22 = call double @llvm.fmuladd.f64(double %17, double %18, double %21)
%23 = fdiv double %16, %22
ret double %23
}

LLVM IR (-O2):
define double @logCauchy(double %0, double %1, double %2) {
%4 = tail call double @log(double %0)
%5 = fsub double %4, %1
%6 = fmul double %0, 0x400921FB54442D18
%7 = fdiv double 1.000000e+00, %6
%8 = fmul double %7, %2
%9 = fmul double %2, %2
%10 = tail call double @llvm.fmuladd.f64(double %5, double %5, double %9)
%11 = fdiv double %8, %10
ret double %11
}
/* Variables and functions */
double cos(double);
double sin(double);
double u(double x, double y, double t) { return x * cos(t) + y * sin(t); }


x86 assembly (clang, -O0):
<u>:
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  -0x18(%rbp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <sin@plt>
movsd  -0x30(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
movaps %xmm0,%xmm3
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<u>:
sub    $0x28,%rsp
movsd  %xmm2,0x8(%rsp)
movsd  %xmm1,0x18(%rsp)
movsd  %xmm0,0x20(%rsp)
movaps %xmm2,%xmm0
call   1040 <cos@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <sin@plt>
mulsd  0x18(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
mulsd  0x20(%rsp),%xmm1
addsd  %xmm1,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @u(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* %6
%9 = call double @cos(double %8)
%10 = load double, double* %5
%11 = load double, double* %6
%12 = call double @sin(double %11)
%13 = fmul double %10, %12
%14 = call double @llvm.fmuladd.f64(double %7, double %9, double %13)
ret double %14
}

LLVM IR (-O2):
define double @u(double %0, double %1, double %2) {
%4 = tail call double @cos(double %2)
%5 = tail call double @sin(double %2)
%6 = fmul double %5, %1
%7 = tail call double @llvm.fmuladd.f64(double %0, double %4, double %6)
ret double %7
}