xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ estruturaPrograma(int *, int *);
int /*<<< orphan*/ exibeMenu(int *);
int main(int argc, const char *argv[]) {
  int opcao = 0, codigoFuncionarios = 0;
  exibeMenu(&opcao);
  estruturaPrograma(&opcao, &codigoFuncionarios);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
lea    -0x14(%rbp),%rdi
call   1040 <exibeMenu@plt>
lea    -0x14(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <estruturaPrograma@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
movl   $0x0,0x8(%rsp)
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <exibeMenu@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <estruturaPrograma@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 0, i32* %7
%8 = call i32 @exibeMenu(i32* %6)
%9 = call i32 @estruturaPrograma(i32* %6, i32* %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%6 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%7 = call i32 @exibeMenu(i32* %3)
%8 = call i32 @estruturaPrograma(i32* %3, i32* %4)
ret i32 0
}
/* Type definitions */
typedef int time_t;
struct spx_datetime {
  int dummy;
};

/* Variables and functions */
struct spx_datetime *spx_get_datetime(int *, struct spx_datetime *);
int spx_mktime(struct spx_datetime *);
struct spx_datetime *spx_datetime_add_days(struct spx_datetime *dt, int days) {
  time_t secs = spx_mktime(dt);
  secs += days * 24 * 3600;
  dt = spx_get_datetime(&secs, dt);
  return dt;
}


x86 assembly (clang, -O0):
<spx_datetime_add_days>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <spx_mktime@plt>
mov    %eax,-0x10(%rbp)
imul   $0x18,-0xc(%rbp),%eax
imul   $0xe10,%eax,%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0x10(%rbp),%rdi
call   1040 <spx_get_datetime@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spx_datetime_add_days>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <spx_mktime@plt>
imul   $0x15180,%ebp,%ecx
add    %eax,%ecx
mov    %ecx,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    %rbx,%rsi
call   1040 <spx_get_datetime@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.spx_datetime = type { i32 }
define %struct.spx_datetime* @spx_datetime_add_days(%struct.spx_datetime* %0, i32 %1) {
%3 = alloca %struct.spx_datetime*
%4 = alloca i32
%5 = alloca i32
store %struct.spx_datetime* %0, %struct.spx_datetime** %3
store i32 %1, i32* %4
%6 = load %struct.spx_datetime*, %struct.spx_datetime** %3
%7 = call i32 @spx_mktime(%struct.spx_datetime* %6)
store i32 %7, i32* %5
%8 = load i32, i32* %4
%9 = mul nsw i32 %8, 24
%10 = mul nsw i32 %9, 3600
%11 = load i32, i32* %5
%12 = add nsw i32 %11, %10
store i32 %12, i32* %5
%13 = load %struct.spx_datetime*, %struct.spx_datetime** %3
%14 = call %struct.spx_datetime* @spx_get_datetime(i32* %5, %struct.spx_datetime* %13)
store %struct.spx_datetime* %14, %struct.spx_datetime** %3
%15 = load %struct.spx_datetime*, %struct.spx_datetime** %3
ret %struct.spx_datetime* %15
}

LLVM IR (-O2):
%struct.spx_datetime = type { i32 }
define %struct.spx_datetime* @spx_datetime_add_days(%struct.spx_datetime* %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @spx_mktime(%struct.spx_datetime* %0)
%6 = mul i32 %1, 86400
%7 = add nsw i32 %5, %6
store i32 %7, i32* %3
%8 = call %struct.spx_datetime* @spx_get_datetime(i32* %3, %struct.spx_datetime* %0)
ret %struct.spx_datetime* %8
}
float recip_approx(float value) { return 1.0f / value; }


x86 assembly (clang, -O0):
<recip_approx>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
divss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<recip_approx>:
movss  0xef8(%rip),%xmm1
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @recip_approx(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fdiv float 1.000000e+00, %3
ret float %4
}

LLVM IR (-O2):
define float @recip_approx(float %0) {
%2 = fdiv float 1.000000e+00, %0
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ setup();
int /*<<< orphan*/ test_basics();
int /*<<< orphan*/ test_next();
int main(void) {
  setup();
  test_basics();
  test_next();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <setup@plt>
xor    %eax,%eax
call   1040 <test_basics@plt>
xor    %eax,%eax
call   1030 <test_next@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @setup()
%3 = call i32 (...) @test_basics()
%4 = call i32 (...) @test_next()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @setup()
%2 = tail call i32 (...) @test_basics()
%3 = tail call i32 (...) @test_next()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print(int a[], int n) {
  for (int i = 0; i < n; ++i)
    printf("%d ", a[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <print+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <print+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <print+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @print(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 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @print(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8, %2
%7 = tail call i32 @putchar(i32 10)
ret void
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %13, %8 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %8
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ xorr_avx2(scalar_t__ *, scalar_t__ const *, size_t);
void maddrc2_avx2(uint8_t *region1, const uint8_t *region2, uint8_t constant,
                  size_t length) {
  if (constant != 0)
    xorr_avx2(region1, region2, length);
}


x86 assembly (clang, -O0):
<maddrc2_avx2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1144 <maddrc2_avx2+0x34>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <xorr_avx2@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<maddrc2_avx2>:
test   %rdx,%rdx
je     111d <maddrc2_avx2+0xd>
mov    %rcx,%rdx
jmp    1030 <xorr_avx2@plt>
ret

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

LLVM IR (-O2):
define void @maddrc2_avx2(i64* %0, i64* %1, i64 %2, i64 %3) {
%5 = icmp eq i64 %2, 0
br i1 %5, label %8, label %6
6: ; preds = %4
%7 = tail call i32 @xorr_avx2(i64* %0, i64* %1, i64 %3)
br label %8
8: ; preds = %6, %4
ret void
}
int xenoprof_backtrace_supported(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @xenoprof_backtrace_supported() {
ret i32 0
}
void arch_local_irq_restore(unsigned long flags) {
  asm volatile("push %0; popf" : : "g"(flags) : "memory", "cc");
}


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

x86 assembly (clang, -O2):
<arch_local_irq_restore>:
mov    %rdi,-0x8(%rsp)
push   -0x8(%rsp)
popf
ret

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

LLVM IR (-O2):
define void @arch_local_irq_restore(i64 %0) {
tail call void asm sideeffect "push $0; popf", "imr,~{memory},~{cc},~{dirflag},~{fpsr},~{flags}"(i64 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ msgpack_person();
int main(void) {
  msgpack_person();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @msgpack_person()
ret i32 0
}
void adis16400_uninitialize_ring(struct iio_ring_buffer *ring) {}


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

x86 assembly (clang, -O2):
ret

LLVM IR (-O0):
%struct.iio_ring_buffer = type opaque
define void @adis16400_uninitialize_ring(%struct.iio_ring_buffer* %0) {
%2 = alloca %struct.iio_ring_buffer*
store %struct.iio_ring_buffer* %0, %struct.iio_ring_buffer** %2
ret void
}

LLVM IR (-O2):
%struct.iio_ring_buffer = type opaque
define void @adis16400_uninitialize_ring(%struct.iio_ring_buffer* nocapture %0) {
ret void
}
/* Type definitions */
struct mat4 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mat4_multiply(float *, float *, float *);
__attribute__((always_)) struct mat4 *
psmat4_multiply(struct mat4 *result, struct mat4 *a, struct mat4 *b) {
  mat4_multiply((float *)result, (float *)a, (float *)b);
  return result;
}


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

x86 assembly (clang, -O2):
<psmat4_multiply>:
push   %rbx
mov    %rdi,%rbx
call   1030 <mat4_multiply@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.mat4 = type { i32 }
define %struct.mat4* @psmat4_multiply(%struct.mat4* returned %0, %struct.mat4* %1, %struct.mat4* %2) {
%4 = bitcast %struct.mat4* %0 to float*
%5 = bitcast %struct.mat4* %1 to float*
%6 = bitcast %struct.mat4* %2 to float*
%7 = tail call i32 @mat4_multiply(float* %4, float* %5, float* %6)
ret %struct.mat4* %0
}
/* Variables and functions */
int /*<<< orphan*/ alloc_free_chain();
void test_stress() {
  int k = 0;
  while (k++ < 200) {
    alloc_free_chain();
  }
}


x86 assembly (clang, -O0):
<test_stress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0xc8,%eax
jge    1141 <test_stress+0x31>
mov    $0x0,%al
call   1030 <alloc_free_chain@plt>
jmp    111f <test_stress+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_stress>:
push   %rbx
mov    $0xc8,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <alloc_free_chain@plt>
add    $0xffffffff,%ebx
jne    1120 <test_stress+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @test_stress() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %6, %0
%3 = load i32, i32* %1
%4 = add nsw i32 %3, 1
store i32 %4, i32* %1
%5 = icmp slt i32 %3, 200
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = call i32 (...) @alloc_free_chain()
br label %2
8: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @test_stress() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %3, %1 ]
%3 = add nuw nsw i32 %2, 1
%4 = tail call i32 (...) @alloc_free_chain()
%5 = icmp eq i32 %3, 200
br i1 %5, label %6, label %1
6: ; preds = %1
ret void
}
void __decodeName(unsigned char *name) {
  unsigned char *s;
  unsigned char num;
  s = name;
  while (*s != '\0') {
    num = *s + 1;
    *s = '.';
    s += num;
  }
  return;
}


x86 assembly (clang, -O0):
<__decodeName>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x0,%eax
je     114b <__decodeName+0x4b>
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
add    $0x1,%eax
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x2e,(%rax)
movzbl -0x11(%rbp),%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <__decodeName+0x10>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__decodeName>:
mov    (%rdi),%al
test   %al,%al
je     1123 <__decodeName+0x23>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%al
movb   $0x2e,(%rdi)
movzbl %al,%ecx
movzbl (%rdi,%rcx,1),%eax
add    %rcx,%rdi
test   %al,%al
jne    1110 <__decodeName+0x10>
ret

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

LLVM IR (-O2):
define void @__decodeName(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = add i8 %5, 1
store i8 46, i8* %6
%8 = zext i8 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
void *a5(int);
void *a4(int x) { return (((x >> 4) & 1) ? a5(x) : a5(x)); }


x86 assembly (clang, -O0):
<a4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x4,%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     113e <a4+0x2e>
mov    -0x4(%rbp),%edi
call   1030 <a5@plt>
mov    %rax,-0x10(%rbp)
jmp    114a <a4+0x3a>
mov    -0x4(%rbp),%edi
call   1030 <a5@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a4>:
jmp    1030 <a5@plt>

LLVM IR (-O0):
define i8* @a4(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 4
%5 = and i32 %4, 1
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %2
%9 = call i8* @a5(i32 %8)
br label %13
10: ; preds = %1
%11 = load i32, i32* %2
%12 = call i8* @a5(i32 %11)
br label %13
13: ; preds = %10, %7
%14 = phi i8* [ %9, %7 ], [ %12, %10 ]
ret i8* %14
}

LLVM IR (-O2):
define i8* @a4(i32 %0) {
%2 = tail call i8* @a5(i32 %0)
ret i8* %2
}
/* Variables and functions */
int rom_present(char *);
int xta_available(void) { return (rom_present(L"roms/hdd/xta/idexywd2.bin")); }


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

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

LLVM IR (-O0):
@.str = [26 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 104, i32 100, i32 100, i32 47, i32 120, i32 116, i32 97, i32 47, i32 105, i32 100, i32 101, i32 120, i32 121, i32 119, i32 100, i32 50, i32 46, i32 98, i32 105, i32 110, i32 0]
define i32 @xta_available() {
%1 = call i32 @rom_present(i8* bitcast ([26 x i32]* @.str to i8*))
ret i32 %1
}

LLVM IR (-O2):
@.str = [26 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 104, i32 100, i32 100, i32 47, i32 120, i32 116, i32 97, i32 47, i32 105, i32 100, i32 101, i32 120, i32 121, i32 119, i32 100, i32 50, i32 46, i32 98, i32 105, i32 110, i32 0]
define i32 @xta_available() {
%1 = tail call i32 @rom_present(i8* bitcast ([26 x i32]* @.str to i8*))
ret i32 %1
}
void wkup_m3_set_ops(struct wkup_m3_ops *ops) {}


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

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

LLVM IR (-O0):
%struct.wkup_m3_ops = type opaque
define void @wkup_m3_set_ops(%struct.wkup_m3_ops* %0) {
%2 = alloca %struct.wkup_m3_ops*
store %struct.wkup_m3_ops* %0, %struct.wkup_m3_ops** %2
ret void
}

LLVM IR (-O2):
%struct.wkup_m3_ops = type opaque
define void @wkup_m3_set_ops(%struct.wkup_m3_ops* nocapture %0) {
ret void
}
/* Type definitions */
struct TestACII {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, size_t, char *, struct TestACII const *,
                            size_t, char *);
const char *clingPrint_TestACII(const struct TestACII *Ptr, size_t Sz,
                                char *Buf) {
  snprintf(Buf, Sz, "TestACII - %p %lu %p", Ptr, Sz, Buf);
  return Buf;
}


x86 assembly (clang, -O0):
<clingPrint_TestACII>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
mov    -0x18(%rbp),%r9
lea    0xec1(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clingPrint_TestACII>:
push   %rbx
mov    %rdx,%rbx
mov    %rdi,%rcx
lea    0xee2(%rip),%rdx
mov    %rbx,%rdi
mov    %rsi,%r8
mov    %rbx,%r9
call   1030 <snprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.TestACII = type { i32 }
@.str = [21 x i8] c"TestACII - %p %lu %p\00"
define i8* @clingPrint_TestACII(%struct.TestACII* %0, i64 %1, i8* %2) {
%4 = alloca %struct.TestACII*
%5 = alloca i64
%6 = alloca i8*
store %struct.TestACII* %0, %struct.TestACII** %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = load i64, i64* %5
%9 = load %struct.TestACII*, %struct.TestACII** %4
%10 = load i64, i64* %5
%11 = load i8*, i8** %6
%12 = call i32 @snprintf(i8* %7, i64 %8, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), %struct.TestACII* %9, i64 %10, i8* %11)
%13 = load i8*, i8** %6
ret i8* %13
}

LLVM IR (-O2):
%struct.TestACII = type { i32 }
@.str = [21 x i8] c"TestACII - %p %lu %p\00"
define i8* @clingPrint_TestACII(%struct.TestACII* %0, i64 %1, i8* returned %2) {
%4 = tail call i32 @snprintf(i8* %2, i64 %1, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), %struct.TestACII* %0, i64 %1, i8* %2)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ drv_Newhaven_sendData(char const *, unsigned int const);
int /*<<< orphan*/ drv_generic_i2c_byte(char const);
void drv_Newhaven_sendCommand(const char command, const char *data,
                              const unsigned int len) {
  drv_generic_i2c_byte(0xFE);
  drv_generic_i2c_byte(command);
  drv_Newhaven_sendData(data, len);
}


x86 assembly (clang, -O0):
<drv_Newhaven_sendCommand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0xfffffffe,%edi
call   1030 <drv_generic_i2c_byte@plt>
movsbl -0x1(%rbp),%edi
call   1030 <drv_generic_i2c_byte@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <drv_Newhaven_sendData@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drv_Newhaven_sendCommand>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %edi,%ebp
mov    $0xfffffffe,%edi
call   1030 <drv_generic_i2c_byte@plt>
mov    %ebp,%edi
call   1030 <drv_generic_i2c_byte@plt>
mov    %rbx,%rdi
mov    %r14d,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <drv_Newhaven_sendData@plt>

LLVM IR (-O0):
define void @drv_Newhaven_sendCommand(i8 signext %0, i8* %1, i32 %2) {
%4 = alloca i8
%5 = alloca i8*
%6 = alloca i32
store i8 %0, i8* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = call i32 @drv_generic_i2c_byte(i8 signext -2)
%8 = load i8, i8* %4
%9 = call i32 @drv_generic_i2c_byte(i8 signext %8)
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = call i32 @drv_Newhaven_sendData(i8* %10, i32 %11)
ret void
}

LLVM IR (-O2):
define void @drv_Newhaven_sendCommand(i8 signext %0, i8* %1, i32 %2) {
%4 = tail call i32 @drv_generic_i2c_byte(i8 signext -2)
%5 = tail call i32 @drv_generic_i2c_byte(i8 signext %0)
%6 = tail call i32 @drv_Newhaven_sendData(i8* %1, i32 %2)
ret void
}
unsigned int WordToHost(unsigned int word) { return word; }


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

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

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

LLVM IR (-O2):
define i32 @WordToHost(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
double RAND_MAX;
double rand();
double uran(double a, double b) {
  return rand() / (RAND_MAX + 1.0) * (b - a) + a;
}


x86 assembly (clang, -O0):
<uran>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
movsd  0xecf(%rip),%xmm1
mov    0x2eb0(%rip),%rax
addsd  (%rax),%xmm1
divsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm2
subsd  -0x8(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uran>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
mov    0x2eba(%rip),%rax
movsd  (%rax),%xmm1
addsd  0xec6(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0x8(%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
subsd  %xmm1,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define double @uran(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = call double (...) @rand()
%6 = load double, double* @RAND_MAX
%7 = fadd double %6, 1.000000e+00
%8 = fdiv double %5, %7
%9 = load double, double* %4
%10 = load double, double* %3
%11 = fsub double %9, %10
%12 = load double, double* %3
%13 = call double @llvm.fmuladd.f64(double %8, double %11, double %12)
ret double %13
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define double @uran(double %0, double %1) {
%3 = tail call double (...) @rand()
%4 = load double, double* @RAND_MAX
%5 = fadd double %4, 1.000000e+00
%6 = fdiv double %3, %5
%7 = fsub double %1, %0
%8 = tail call double @llvm.fmuladd.f64(double %6, double %7, double %0)
ret double %8
}
/* Variables and functions */
scalar_t__ update_map();
void full_update() {
  while (update_map() != 0)
    ;
}


x86 assembly (clang, -O0):
<full_update>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <full_update+0x9>
mov    $0x0,%al
call   1030 <update_map@plt>
cmp    $0x0,%rax
je     112f <full_update+0x1f>
jmp    1119 <full_update+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<full_update>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <update_map@plt>
test   %rax,%rax
jne    1120 <full_update+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @full_update() {
br label %1
1: ; preds = %4, %0
%2 = call i64 (...) @update_map()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %1
br label %1
5: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @full_update() {
br label %1
1: ; preds = %1, %0
%2 = tail call i64 (...) @update_map()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %1
4: ; preds = %1
ret void
}
void uiUserBugCannotSetParentOnToplevel(const char *type) {
  _userbug("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/Monroe88/RetroArch/refs/heads/master/"
           "common/userbugs.c",
           "7", __func__, "You cannot make a %s a child of another uiControl,",
           type);
}


x86 assembly (clang, -O0):
<uiUserBugCannotSetParentOnToplevel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%r8
lea    0xed9(%rip),%rdi
lea    0xf63(%rip),%rsi
lea    0xf5e(%rip),%rdx
lea    0xf7a(%rip),%rcx
mov    $0x0,%al
call   1030 <_userbug@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uiUserBugCannotSetParentOnToplevel>:
mov    %rdi,%r8
lea    0xee6(%rip),%rdi
lea    0xf70(%rip),%rsi
lea    0xf6b(%rip),%rdx
lea    0xf87(%rip),%rcx
xor    %eax,%eax
jmp    1030 <_userbug@plt>

LLVM IR (-O0):
@.str = [145 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Monroe88/RetroArch/refs/heads/master/common/userbugs.c\00"
@.str.1 = [2 x i8] c"7\00"
@__func__.uiUserBugCannotSetParentOnToplevel = [35 x i8] c"uiUserBugCannotSetParentOnToplevel\00"
@.str.2 = [51 x i8] c"You cannot make a %s a child of another uiControl,\00"
define void @uiUserBugCannotSetParentOnToplevel(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i8*, i8*, i8*, i8*, ...) bitcast (i32 (...)* @_userbug to i32 (i8*, i8*, i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([145 x i8], [145 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([35 x i8], [35 x i8]* @__func__.uiUserBugCannotSetParentOnToplevel, i64 0, i64 0), i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.2, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [145 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Monroe88/RetroArch/refs/heads/master/common/userbugs.c\00"
@.str.1 = [2 x i8] c"7\00"
@__func__.uiUserBugCannotSetParentOnToplevel = [35 x i8] c"uiUserBugCannotSetParentOnToplevel\00"
@.str.2 = [51 x i8] c"You cannot make a %s a child of another uiControl,\00"
define void @uiUserBugCannotSetParentOnToplevel(i8* %0) {
%2 = tail call i32 (i8*, i8*, i8*, i8*, i8*, ...) bitcast (i32 (...)* @_userbug to i32 (i8*, i8*, i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([145 x i8], [145 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([35 x i8], [35 x i8]* @__func__.uiUserBugCannotSetParentOnToplevel, i64 0, i64 0), i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.2, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int unlink(char *);
int myremove(char *f) { return unlink(f); }


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

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

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

LLVM IR (-O2):
define i32 @myremove(i8* nocapture %0) {
%2 = tail call i32 @unlink(i8* %0)
ret i32 %2
}
/* Variables and functions */
int val1();
int val2(void) { return val1() + 2; }


x86 assembly (clang, -O0):
<val2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <val1@plt>
add    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<val2>:
push   %rax
xor    %eax,%eax
call   1030 <val1@plt>
add    $0x2,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @val2() {
%1 = call i32 (...) @val1()
%2 = add nsw i32 %1, 2
ret i32 %2
}

LLVM IR (-O2):
define i32 @val2() {
%1 = tail call i32 (...) @val1()
%2 = add nsw i32 %1, 2
ret i32 %2
}
/* Variables and functions */
int atoi(char *);
int fib(int);
int /*<<< orphan*/ printf(char *, int, int);
int main(int argc, char *argv[]) {
  int n = 30;
  if (argc >= 2) {
    n = atoi(argv[1]);
  }
  printf("fib(%d)=%d\n", n, fib(n));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1e,-0x14(%rbp)
cmpl   $0x2,-0x8(%rbp)
jl     1167 <main+0x37>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <fib@plt>
mov    -0x18(%rbp),%esi
mov    %eax,%edx
lea    0xe7f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1e,%ebx
cmp    $0x2,%edi
jl     1146 <main+0x16>
mov    0x8(%rsi),%rdi
call   1050 <atoi@plt>
mov    %eax,%ebx
mov    %ebx,%edi
call   1040 <fib@plt>
lea    0xeac(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"fib(%d)=%d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @atoi(i8* %6)
br label %8
8: ; preds = %4, %2
%9 = phi i32 [ %7, %4 ], [ 30, %2 ]
%10 = tail call i32 @fib(i32 %9)
%11 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10)
ret i32 0
}
/* Variables and functions */
int getsockopt(int, int, int, char *, int *);
int Xgetsockopt(int s, int e, int n, void *v, int *l) {
  int rl;
  int code;
  rl = *l;
  code = getsockopt(s, e, n, (char *)v, &rl);
  *l = rl;
  return code;
}


x86 assembly (clang, -O0):
<Xgetsockopt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
lea    -0x24(%rbp),%r8
call   1030 <getsockopt@plt>
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x28(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Xgetsockopt>:
push   %rbx
sub    $0x10,%rsp
mov    %r8,%rbx
mov    (%r8),%eax
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%r8
call   1030 <getsockopt@plt>
mov    0xc(%rsp),%ecx
mov    %ecx,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @Xgetsockopt(i32 %0, i32 %1, i32 %2, i8* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32*
%11 = alloca i32
%12 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i32* %4, i32** %10
%13 = load i32*, i32** %10
%14 = load i32, i32* %13
store i32 %14, i32* %11
%15 = load i32, i32* %6
%16 = load i32, i32* %7
%17 = load i32, i32* %8
%18 = load i8*, i8** %9
%19 = call i32 @getsockopt(i32 %15, i32 %16, i32 %17, i8* %18, i32* %11)
store i32 %19, i32* %12
%20 = load i32, i32* %11
%21 = load i32*, i32** %10
store i32 %20, i32* %21
%22 = load i32, i32* %12
ret i32 %22
}

LLVM IR (-O2):
define i32 @Xgetsockopt(i32 %0, i32 %1, i32 %2, i8* %3, i32* nocapture %4) {
%6 = alloca i32
%7 = bitcast i32* %6 to i8*
%8 = load i32, i32* %4
store i32 %8, i32* %6
%9 = call i32 @getsockopt(i32 %0, i32 %1, i32 %2, i8* %3, i32* %6)
%10 = load i32, i32* %6
store i32 %10, i32* %4
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
void LogBoolParam(FILE *fp, char *key, signed char boolvalue) {
  if (boolvalue) {
    fprintf(fp, "%s  TRUE\n", key);
  } else {
    fprintf(fp, "%s  FALSE\n", key);
  }
}


x86 assembly (clang, -O0):
<LogBoolParam>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
cmpb   $0x0,-0x11(%rbp)
je     1148 <LogBoolParam+0x38>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xec2(%rip),%rsi
call   1030 <fprintf@plt>
jmp    115c <LogBoolParam+0x4c>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LogBoolParam>:
mov    %rsi,%rax
test   %dl,%dl
lea    0xeee(%rip),%rcx
lea    0xedd(%rip),%rsi
cmove  %rcx,%rsi
mov    %rax,%rdx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"%s TRUE\0A\00"
@.str.1 = [11 x i8] c"%s FALSE\0A\00"
define void @LogBoolParam(i32* %0, i8* %1, i8 signext %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i8
store i32* %0, i32** %4
store i8* %1, i8** %5
store i8 %2, i8* %6
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = load i32*, i32** %4
%11 = load i8*, i8** %5
%12 = call i32 @fprintf(i32* %10, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %11)
br label %17
13: ; preds = %3
%14 = load i32*, i32** %4
%15 = load i8*, i8** %5
%16 = call i32 @fprintf(i32* %14, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %15)
br label %17
17: ; preds = %13, %9
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"%s TRUE\0A\00"
@.str.1 = [11 x i8] c"%s FALSE\0A\00"
define void @LogBoolParam(i32* nocapture %0, i8* %1, i8 signext %2) {
%4 = icmp eq i8 %2, 0
%5 = select i1 %4, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
%6 = tail call i32 @fprintf(i32* %0, i8* %5, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void ft_write_to_file(int fd, char *str) {
  int length;
  length = 0;
  while (str[length])
    length++;
  write(fd, str, length);
}


x86 assembly (clang, -O0):
<ft_write_to_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1146 <ft_write_to_file+0x36>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <ft_write_to_file+0x16>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_write_to_file>:
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmpb   $0x0,(%rsi,%rdx,1)
lea    0x1(%rdx),%rdx
jne    1120 <ft_write_to_file+0x10>
add    $0xffffffff,%edx
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define void @ft_write_to_file(i32 %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %8, %3 ], [ 0, %2 ]
%5 = getelementptr inbounds i8, i8* %1, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = add nuw i64 %4, 1
br i1 %7, label %9, label %3
9: ; preds = %3
%10 = trunc i64 %4 to i32
%11 = tail call i32 @write(i32 %0, i8* %1, i32 %10)
ret void
}
double fd2epj(string)
char *string;
{
  double dj;
  dj = fd2jd(string);
  if (dj < 1.0)
    return (dj / 365.25);
  else
    return (jd2epj(dj));
}


x86 assembly (clang, -O0):
<fd2epj>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <fd2jd@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xeb8(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    116e <fd2epj+0x4e>
movsd  -0x18(%rbp),%xmm0
movsd  0xea8(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1183 <fd2epj+0x63>
movsd  -0x18(%rbp),%xmm0
mov    $0x1,%al
call   1040 <jd2epj@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fd2epj>:
push   %rax
xor    %eax,%eax
call   1030 <fd2jd@plt>
cvtsi2sd %eax,%xmm0
test   %eax,%eax
jle    1140 <fd2epj+0x20>
mov    $0x1,%al
call   1040 <jd2epj@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret
divsd  0xeb8(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @fd2epj(i8* %0) {
%2 = alloca double
%3 = alloca i8*
%4 = alloca double
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @fd2jd to i32 (i8*, ...)*)(i8* %5)
%7 = sitofp i32 %6 to double
store double %7, double* %4
%8 = load double, double* %4
%9 = fcmp olt double %8, 1.000000e+00
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = load double, double* %4
%12 = fdiv double %11, 3.652500e+02
store double %12, double* %2
br label %17
13: ; preds = %1
%14 = load double, double* %4
%15 = call i32 (double, ...) bitcast (i32 (...)* @jd2epj to i32 (double, ...)*)(double %14)
%16 = sitofp i32 %15 to double
store double %16, double* %2
br label %17
17: ; preds = %13, %10
%18 = load double, double* %2
ret double %18
}

LLVM IR (-O2):
define double @fd2epj(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @fd2jd to i32 (i8*, ...)*)(i8* %0)
%3 = sitofp i32 %2 to double
%4 = icmp slt i32 %2, 1
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = fdiv double %3, 3.652500e+02
br label %10
7: ; preds = %1
%8 = tail call i32 (double, ...) bitcast (i32 (...)* @jd2epj to i32 (double, ...)*)(double %3)
%9 = sitofp i32 %8 to double
br label %10
10: ; preds = %7, %5
%11 = phi double [ %6, %5 ], [ %9, %7 ]
ret double %11
}
/* Variables and functions */
int rand();
int randomRank(int max) {
  int r;
  r = rand() % max;
  return (int)r;
}


x86 assembly (clang, -O0):
<randomRank>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cltd
idivl  -0x4(%rbp)
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randomRank>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @randomRank(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 (...) @rand()
%5 = load i32, i32* %2
%6 = srem i32 %4, %5
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @randomRank(i32 %0) {
%2 = tail call i32 (...) @rand()
%3 = srem i32 %2, %0
ret i32 %3
}
char stackBased1() {
  char buf[2];
  buf[0] = 'a';
  return buf[1];
}


x86 assembly (clang, -O0):
<stackBased1>:
push   %rbp
mov    %rsp,%rbp
movb   $0x61,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i8 @stackBased1() {
%1 = alloca [2 x i8]
%2 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
store i8 97, i8* %2
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 1
%4 = load i8, i8* %3
ret i8 %4
}

LLVM IR (-O2):
define signext i8 @stackBased1() {
ret i8 undef
}
/* Variables and functions */
int /*<<< orphan*/ errno;
char *os_GetErrorString(int /*<<< orphan*/);
char *os_ErrorString(void) { return os_GetErrorString(errno); }


x86 assembly (clang, -O0):
<os_ErrorString>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <os_GetErrorString@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_ErrorString>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <os_GetErrorString@plt>

LLVM IR (-O0):
@errno = global i32 0
define i8* @os_ErrorString() {
%1 = load i32, i32* @errno
%2 = call i8* @os_GetErrorString(i32 %1)
ret i8* %2
}

LLVM IR (-O2):
@errno = global i32 0
define i8* @os_ErrorString() {
%1 = load i32, i32* @errno
%2 = tail call i8* @os_GetErrorString(i32 %1)
ret i8* %2
}
int si_forward() {}


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

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

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

LLVM IR (-O2):
define i32 @si_forward() {
ret i32 undef
}
/* Variables and functions */
int strtol(char const *, int /*<<< orphan*/ *, int);
int atoi(const char *nptr) { return strtol(nptr, NULL, 10); }


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

x86 assembly (clang, -O2):
<atoi>:
xor    %esi,%esi
mov    $0xa,%edx
jmp    1030 <strtol@plt>

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

LLVM IR (-O2):
define i32 @atoi(i8* nocapture %0) {
%2 = tail call i32 @strtol(i8* nocapture %0, i32* null, i32 10)
ret i32 %2
}
void sif_platform_target_speed(int high_speed) {}


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

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

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

LLVM IR (-O2):
define void @sif_platform_target_speed(i32 %0) {
ret void
}
int is_num(char c) {
  int result = 0;
  int i = (int)c;
  if (i >= 48 && i <= 57) {
    result++;
  }
  return result;
}


x86 assembly (clang, -O0):
<is_num>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x30,-0xc(%rbp)
jl     1135 <is_num+0x35>
cmpl   $0x39,-0xc(%rbp)
jg     1135 <is_num+0x35>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_num>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @is_num(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
%4 = alloca i32
store i8 %0, i8* %2
store i32 0, i32* %3
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp sge i32 %7, 48
br i1 %8, label %9, label %15
9: ; preds = %1
%10 = load i32, i32* %4
%11 = icmp sle i32 %10, 57
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %15
15: ; preds = %12, %9, %1
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @is_num(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
int bump_up(int input) {
  if ((input % 2) == 1) {
    input++;
  }
  return input;
}


x86 assembly (clang, -O0):
<bump_up>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
jne    1124 <bump_up+0x24>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bump_up>:
mov    %edi,%eax
shr    $0x1f,%eax
add    %edi,%eax
and    $0xfffffffe,%eax
mov    %edi,%ecx
sub    %eax,%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
sete   %al
add    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @bump_up(i32 %0) {
%2 = srem i32 %0, 2
%3 = icmp eq i32 %2, 1
%4 = zext i1 %3 to i32
%5 = add nsw i32 %4, %0
ret i32 %5
}