xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int age;
  scanf("%d", &age);
  printf("%e\n", age * 3.156e7);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xeb4(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%esi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
cvtsi2sdl 0x4(%rsp),%xmm0
mulsd  0xec0(%rip),%xmm0
cvttsd2si %xmm0,%esi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%e\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = sitofp i32 %4 to double
%6 = fmul double %5, 3.156000e+07
%7 = fptosi double %6 to i32
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%e\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = sitofp i32 %4 to double
%6 = fmul double %5, 3.156000e+07
%7 = fptosi double %6 to i32
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}
int gcd(int A, int B) {
  int r;
  while (B) {
    r = A % B;
    A = B;
    B = r;
  }
  return A;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     112f <gcd+0x2f>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    110a <gcd+0xa>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %6, %4 ], [ %0, %2 ]
%6 = phi i32 [ %7, %4 ], [ %1, %2 ]
%7 = srem i32 %5, %6
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %6, %4 ]
ret i32 %10
}
void comment(struct state *s) {}


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

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

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

LLVM IR (-O2):
%struct.state = type opaque
define void @comment(%struct.state* nocapture %0) {
ret void
}
int ls_cost_nm6_n_in(void) { return 2; }


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

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

LLVM IR (-O0):
define i32 @ls_cost_nm6_n_in() {
ret i32 2
}

LLVM IR (-O2):
define i32 @ls_cost_nm6_n_in() {
ret i32 2
}
/* Type definitions */
struct rlimit {
  int dummy;
};

/* Variables and functions */
int getrlimit(int, struct rlimit *);
__attribute__((__weak__, __always___)) int
softboundcets_getrlimit(int resource, struct rlimit *rlim) {
  return getrlimit(resource, rlim);
}


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

x86 assembly (clang, -O2):
<softboundcets_getrlimit>:
jmp    1030 <getrlimit@plt>

LLVM IR (-O0):
%struct.rlimit = type { i32 }
define weak i32 @softboundcets_getrlimit(i32 %0, %struct.rlimit* %1) {
%3 = alloca i32
%4 = alloca %struct.rlimit*
store i32 %0, i32* %3
store %struct.rlimit* %1, %struct.rlimit** %4
%5 = load i32, i32* %3
%6 = load %struct.rlimit*, %struct.rlimit** %4
%7 = call i32 @getrlimit(i32 %5, %struct.rlimit* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.rlimit = type { i32 }
define weak i32 @softboundcets_getrlimit(i32 %0, %struct.rlimit* %1) {
%3 = tail call i32 @getrlimit(i32 %0, %struct.rlimit* %1)
ret i32 %3
}
/* Type definitions */
struct catmc_atomic_uint_least16_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct catmc_atomic_uint_least16_t *);
void catmc_atomic_uint_least16_t_destroy(
    struct catmc_atomic_uint_least16_t *wrapper) {
  free(wrapper);
}


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

x86 assembly (clang, -O2):
<catmc_atomic_uint_least16_t_destroy>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.catmc_atomic_uint_least16_t = type { i32 }
define void @catmc_atomic_uint_least16_t_destroy(%struct.catmc_atomic_uint_least16_t* %0) {
%2 = alloca %struct.catmc_atomic_uint_least16_t*
store %struct.catmc_atomic_uint_least16_t* %0, %struct.catmc_atomic_uint_least16_t** %2
%3 = load %struct.catmc_atomic_uint_least16_t*, %struct.catmc_atomic_uint_least16_t** %2
%4 = call i32 @free(%struct.catmc_atomic_uint_least16_t* %3)
ret void
}

LLVM IR (-O2):
%struct.catmc_atomic_uint_least16_t = type { i32 }
define void @catmc_atomic_uint_least16_t_destroy(%struct.catmc_atomic_uint_least16_t* nocapture %0) {
%2 = tail call i32 @free(%struct.catmc_atomic_uint_least16_t* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printArray(int *arr, int size) {
  int i;
  for (i = 0; i < size; i++) {
    printf("%d ", arr[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<printArray>:
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 <printArray+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 <printArray+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printArray>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <printArray+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 <printArray+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 @printArray(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 @printArray(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_foo() { printf("from baz\n"); }


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

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

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

LLVM IR (-O2):
@str = [9 x i8] c"from baz\00"
define void @print_foo() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct timeval {
  unsigned long long tv_sec;
  unsigned long long tv_usec;
};

/* Variables and functions */
void __jiffies_to_tv(struct timeval *tv, unsigned long jiffies) {
  unsigned long long tvusec;
  tvusec = 10000ULL * jiffies;
  tv->tv_sec = tvusec / 1000000;
  tv->tv_usec = tvusec - 1000000 * tv->tv_sec;
}


x86 assembly (clang, -O0):
<__jiffies_to_tv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
imul   $0x2710,-0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    $0xf4240,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
imul   $0xf4240,(%rax),%rax
sub    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__jiffies_to_tv>:
imul   $0x2710,%rsi,%rcx
movabs $0x431bde82d7b634db,%rdx
de 1b 43
mov    %rcx,%rax
mul    %rdx
shr    $0x12,%rdx
mov    %rdx,(%rdi)
imul   $0xfffffffffff0bdc0,%rdx,%rax
add    %rcx,%rax
mov    %rax,0x8(%rdi)
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define void @__jiffies_to_tv(%struct.timeval* %0, i64 %1) {
%3 = alloca %struct.timeval*
%4 = alloca i64
%5 = alloca i64
store %struct.timeval* %0, %struct.timeval** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = mul i64 10000, %6
store i64 %7, i64* %5
%8 = load i64, i64* %5
%9 = udiv i64 %8, 1000000
%10 = load %struct.timeval*, %struct.timeval** %3
%11 = getelementptr inbounds %struct.timeval, %struct.timeval* %10, i32 0, i32 0
store i64 %9, i64* %11
%12 = load i64, i64* %5
%13 = load %struct.timeval*, %struct.timeval** %3
%14 = getelementptr inbounds %struct.timeval, %struct.timeval* %13, i32 0, i32 0
%15 = load i64, i64* %14
%16 = mul i64 1000000, %15
%17 = sub i64 %12, %16
%18 = load %struct.timeval*, %struct.timeval** %3
%19 = getelementptr inbounds %struct.timeval, %struct.timeval* %18, i32 0, i32 1
store i64 %17, i64* %19
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define void @__jiffies_to_tv(%struct.timeval* nocapture writeonly %0, i64 %1) {
%3 = mul i64 %1, 10000
%4 = udiv i64 %3, 1000000
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
store i64 %4, i64* %5
%6 = mul i64 %4, -1000000
%7 = add i64 %6, %3
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
store i64 %7, i64* %8
ret void
}
float Vector_Dot_Product(float vector1[3], float vector2[3]) {
  float op = 0;
  for (int c = 0; c < 3; c++) {
    op += vector1[c] * vector2[c];
  }
  return op;
}


x86 assembly (clang, -O0):
<Vector_Dot_Product>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x3,-0x18(%rbp)
jge    115f <Vector_Dot_Product+0x5f>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm2
movss  -0x14(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    111b <Vector_Dot_Product+0x1b>
movss  -0x14(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Vector_Dot_Product>:
movss  (%rdi),%xmm0
movss  0x4(%rdi),%xmm1
mulss  (%rsi),%xmm0
xorps  %xmm2,%xmm2
addss  %xmm0,%xmm2
mulss  0x4(%rsi),%xmm1
addss  %xmm2,%xmm1
movss  0x8(%rdi),%xmm0
mulss  0x8(%rsi),%xmm0
addss  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @Vector_Dot_Product(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %0
%4 = load float, float* %1
%5 = tail call float @llvm.fmuladd.f32(float %3, float %4, float 0.000000e+00)
%6 = getelementptr inbounds float, float* %0, i64 1
%7 = load float, float* %6
%8 = getelementptr inbounds float, float* %1, i64 1
%9 = load float, float* %8
%10 = tail call float @llvm.fmuladd.f32(float %7, float %9, float %5)
%11 = getelementptr inbounds float, float* %0, i64 2
%12 = load float, float* %11
%13 = getelementptr inbounds float, float* %1, i64 2
%14 = load float, float* %13
%15 = tail call float @llvm.fmuladd.f32(float %12, float %14, float %10)
ret float %15
}
/* Variables and functions */
int /*<<< orphan*/ __dmb(int /*<<< orphan*/);
void check__dmb(void) { __dmb(0); }


x86 assembly (clang, -O0):
<check__dmb>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <__dmb@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<check__dmb>:
xor    %edi,%edi
jmp    1030 <__dmb@plt>

LLVM IR (-O0):
define void @check__dmb() {
%1 = call i32 @__dmb(i32 0)
ret void
}

LLVM IR (-O2):
define void @check__dmb() {
%1 = tail call i32 @__dmb(i32 0)
ret void
}
/* Variables and functions */
int getpid();
int /*<<< orphan*/ printf(char *, int);
void sig_int_handler(int signo) {
  printf("process[%d] get SIGINT\n", getpid());
  return;
}


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

x86 assembly (clang, -O2):
<sig_int_handler>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"process[%d] get SIGINT\0A\00"
define void @sig_int_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @getpid()
%4 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"process[%d] get SIGINT\0A\00"
define void @sig_int_handler(i32 %0) {
%2 = tail call i32 (...) @getpid()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
void a2bcdefghijklmnopqrstuvwxzy() {}


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

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

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

LLVM IR (-O2):
define void @a2bcdefghijklmnopqrstuvwxzy() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;
typedef int /*<<< orphan*/ msg;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *, char *);
int /*<<< orphan*/ vsnprintf(char *, int, char const *, int /*<<< orphan*/);
void print_e(FILE *fd, const char *prefix, const char *fmt, va_list va) {
  static char msg[4096];
  vsnprintf(msg, sizeof(msg), fmt, va);
  fprintf(fd, "%s: %s\n", prefix, msg);
}


x86 assembly (clang, -O0):
<print_e>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
lea    0x2efb(%rip),%rdi
mov    $0x1000,%esi
call   1030 <vsnprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xea2(%rip),%rsi
lea    0x2edb(%rip),%rcx
call   1040 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_e>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0x2f0e(%rip),%r15
mov    %r15,%rdi
mov    $0x1000,%esi
call   1030 <vsnprintf@plt>
lea    0xeba(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
mov    %r15,%rcx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@print_e.msg = internal global [4096 x i8] zeroinitializer
@.str = [8 x i8] c"%s: %s\0A\00"
define void @print_e(i32* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i32* %0, i32** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %7
%10 = load i32, i32* %8
%11 = call i32 @vsnprintf(i8* getelementptr inbounds ([4096 x i8], [4096 x i8]* @print_e.msg, i64 0, i64 0), i32 4096, i8* %9, i32 %10)
%12 = load i32*, i32** %5
%13 = load i8*, i8** %6
%14 = call i32 @fprintf(i32* %12, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %13, i8* getelementptr inbounds ([4096 x i8], [4096 x i8]* @print_e.msg, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@print_e.msg = internal global [4096 x i8] zeroinitializer
@.str = [8 x i8] c"%s: %s\0A\00"
define void @print_e(i32* nocapture %0, i8* %1, i8* nocapture %2, i32 %3) {
%5 = tail call i32 @vsnprintf(i8* getelementptr inbounds ([4096 x i8], [4096 x i8]* @print_e.msg, i64 0, i64 0), i32 4096, i8* %2, i32 %3)
%6 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %1, i8* getelementptr inbounds ([4096 x i8], [4096 x i8]* @print_e.msg, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ count_blocks();
int /*<<< orphan*/ print_date();
int /*<<< orphan*/ print_file_name(char *);
int /*<<< orphan*/ print_group();
int /*<<< orphan*/ print_link();
int /*<<< orphan*/ print_owner();
int /*<<< orphan*/ print_permissions();
int /*<<< orphan*/ print_size();
void print_file_info(char *dirname, char *filename) {
  print_permissions();
  print_link();
  print_owner();
  print_group();
  print_size();
  print_date();
  print_file_name(filename);
  count_blocks();
}


x86 assembly (clang, -O0):
<print_file_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1080 <print_permissions@plt>
mov    $0x0,%al
call   1030 <print_link@plt>
mov    $0x0,%al
call   1050 <print_owner@plt>
mov    $0x0,%al
call   1090 <print_group@plt>
mov    $0x0,%al
call   1040 <print_size@plt>
mov    $0x0,%al
call   1070 <print_date@plt>
mov    -0x10(%rbp),%rdi
call   1060 <print_file_name@plt>
mov    $0x0,%al
call   10a0 <count_blocks@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_file_info>:
push   %rbx
mov    %rsi,%rbx
xor    %eax,%eax
call   1080 <print_permissions@plt>
xor    %eax,%eax
call   1030 <print_link@plt>
xor    %eax,%eax
call   1050 <print_owner@plt>
xor    %eax,%eax
call   1090 <print_group@plt>
xor    %eax,%eax
call   1040 <print_size@plt>
xor    %eax,%eax
call   1070 <print_date@plt>
mov    %rbx,%rdi
call   1060 <print_file_name@plt>
xor    %eax,%eax
pop    %rbx
jmp    10a0 <count_blocks@plt>

LLVM IR (-O0):
define void @print_file_info(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = call i32 (...) @print_permissions()
%6 = call i32 (...) @print_link()
%7 = call i32 (...) @print_owner()
%8 = call i32 (...) @print_group()
%9 = call i32 (...) @print_size()
%10 = call i32 (...) @print_date()
%11 = load i8*, i8** %4
%12 = call i32 @print_file_name(i8* %11)
%13 = call i32 (...) @count_blocks()
ret void
}

LLVM IR (-O2):
define void @print_file_info(i8* nocapture readnone %0, i8* %1) {
%3 = tail call i32 (...) @print_permissions()
%4 = tail call i32 (...) @print_link()
%5 = tail call i32 (...) @print_owner()
%6 = tail call i32 (...) @print_group()
%7 = tail call i32 (...) @print_size()
%8 = tail call i32 (...) @print_date()
%9 = tail call i32 @print_file_name(i8* %1)
%10 = tail call i32 (...) @count_blocks()
ret void
}
/* Variables and functions */
void *malloc(size_t);
int main(int argc, char **argv) {
  size_t size = 15;
  void *p = malloc(size + 260);
  ((char *)p)[size] = 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0xf,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x104,%rdi
call   1030 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i64
%6 = alloca i8*
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i64 15, i64* %5
%7 = load i64, i64* %5
%8 = add i64 %7, 260
%9 = call i8* @malloc(i64 %8)
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = load i64, i64* %5
%12 = getelementptr inbounds i8, i8* %10, i64 %11
store i8 0, i8* %12
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
int iCmp(const void *a, const void *b) { return *(int *)a - *(int *)b; }


x86 assembly (clang, -O0):
<iCmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iCmp>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

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

LLVM IR (-O2):
define i32 @iCmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
int bcmp(s1, s2, len)
char *s1, *s2;
int len;
{
  for (; len > 0; len--, s1++, s2++)
    if (*s1 != *s2)
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<bcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jle    1166 <bcmp+0x66>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     113b <bcmp+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    116d <bcmp+0x6d>
jmp    1140 <bcmp+0x40>
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    110f <bcmp+0xf>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bcmp>:
test   %edx,%edx
jle    1125 <bcmp+0x25>
add    $0x1,%edx
xor    %eax,%eax
nopl   0x0(%rax)
movzbl (%rdi,%rax,1),%ecx
cmp    (%rsi,%rax,1),%cl
jne    1128 <bcmp+0x28>
add    $0xffffffff,%edx
add    $0x1,%rax
cmp    $0x1,%edx
jg     1110 <bcmp+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @bcmp(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %17
5: ; preds = %3, %12
%6 = phi i32 [ %13, %12 ], [ %2, %3 ]
%7 = phi i8* [ %15, %12 ], [ %1, %3 ]
%8 = phi i8* [ %14, %12 ], [ %0, %3 ]
%9 = load i8, i8* %8
%10 = load i8, i8* %7
%11 = icmp eq i8 %9, %10
br i1 %11, label %12, label %17
12: ; preds = %5
%13 = add nsw i32 %6, -1
%14 = getelementptr inbounds i8, i8* %8, i64 1
%15 = getelementptr inbounds i8, i8* %7, i64 1
%16 = icmp sgt i32 %6, 1
br i1 %16, label %5, label %17
17: ; preds = %5, %12, %3
%18 = phi i32 [ 0, %3 ], [ 0, %12 ], [ 1, %5 ]
ret i32 %18
}
int fun216() { return 216; }


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

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

LLVM IR (-O0):
define i32 @fun216() {
ret i32 216
}

LLVM IR (-O2):
define i32 @fun216() {
ret i32 216
}
/* Variables and functions */
int /*<<< orphan*/ my_putchar(int);
void my_putnbr(int nbr) {
  if (nbr < 0) {
    nbr *= -1;
    my_putchar('-');
  }
  if (nbr / 10 > 0)
    my_putnbr(nbr / 10);
  my_putchar(nbr % 10 + 48);
}


x86 assembly (clang, -O0):
<my_putnbr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1146 <my_putnbr+0x26>
imul   $0xffffffff,-0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    $0x2d,%edi
call   1030 <my_putchar@plt>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x0,%eax
jle    116c <my_putnbr+0x4c>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1040 <my_putnbr@plt>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
add    $0x30,%edi
call   1030 <my_putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_putnbr>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
test   %edi,%edi
jns    1136 <my_putnbr+0x16>
neg    %ebx
mov    $0x2d,%edi
call   1030 <my_putchar@plt>
mov    %ebx,%r14d
cmp    $0xa,%ebx
jb     1150 <my_putnbr+0x30>
mov    $0xcccccccd,%edi
imul   %r14,%rdi
shr    $0x23,%rdi
call   1040 <my_putnbr@plt>
mov    $0xcccccccd,%eax
imul   %r14,%rax
shr    $0x23,%rax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%ebx
or     $0x30,%ebx
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <my_putchar@plt>

LLVM IR (-O0):
define void @my_putnbr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* %2
%7 = mul nsw i32 %6, -1
store i32 %7, i32* %2
%8 = call i32 @my_putchar(i32 45)
br label %9
9: ; preds = %5, %1
%10 = load i32, i32* %2
%11 = sdiv i32 %10, 10
%12 = icmp sgt i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %9
%14 = load i32, i32* %2
%15 = sdiv i32 %14, 10
br label %16
16: ; preds = %13, %9
%17 = load i32, i32* %2
%18 = srem i32 %17, 10
%19 = add nsw i32 %18, 48
%20 = call i32 @my_putchar(i32 %19)
ret void
}

LLVM IR (-O2):
define void @my_putnbr(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = sub nsw i32 0, %0
%5 = tail call i32 @my_putchar(i32 45)
br label %6
6: ; preds = %3, %1
%7 = phi i32 [ %4, %3 ], [ %0, %1 ]
%8 = icmp ugt i32 %7, 9
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = udiv i32 %7, 10
tail call void @my_putnbr(i32 %10)
br label %11
11: ; preds = %9, %6
%12 = urem i32 %7, 10
%13 = or i32 %12, 48
%14 = tail call i32 @my_putchar(i32 %13)
ret void
}
void g_option_context_parse() {}


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

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

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

LLVM IR (-O2):
define void @g_option_context_parse() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int clearscn() {
  printf("{FONTE}33[2J");
  return 1;
}


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"{FONTE}33[2J\00"
define i32 @clearscn() {
%1 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@.str = [13 x i8] c"{FONTE}33[2J\00"
define i32 @clearscn() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int sumofdigits_r(int);
int main(int argc, char *argv[]) {
  int num = 0;
  printf("Enter a number:");
  scanf("%d", &num);
  printf("Sum of digits of %d=%d\n", num, sumofdigits_r(num));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb5(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <sumofdigits_r@plt>
mov    -0x18(%rbp),%esi
mov    %eax,%edx
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
lea    0xebc(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xebe(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%ebx
mov    %ebx,%edi
call   1050 <sumofdigits_r@plt>
lea    0xea5(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Enter a number:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [24 x i8] c"Sum of digits of %d=%d\0A\00"
define i32 @main(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
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%8 = load i32, i32* %5
%9 = load i32, i32* %5
%10 = call i32 @sumofdigits_r(i32 %9)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %8, i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"Enter a number:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [24 x i8] c"Sum of digits of %d=%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%7 = load i32, i32* %3
%8 = call i32 @sumofdigits_r(i32 %7)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %7, i32 %8)
ret i32 0
}
/* Type definitions */
struct timezone {
  int dummy;
};
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int gettimeofday(struct timeval *, struct timezone *);
double seconds() {
  struct timeval tp;
  struct timezone tzp;
  int i;
  i = gettimeofday(&tp, &tzp);
  return ((double)tp.tv_sec + (double)tp.tv_usec * 1.e-6);
}


x86 assembly (clang, -O0):
<seconds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <gettimeofday@plt>
mov    %eax,-0x1c(%rbp)
cvtsi2sdq -0x8(%rbp),%xmm1
cvtsi2sdq -0x10(%rbp),%xmm0
movsd  0xec4(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<seconds>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x10(%rsp),%xmm1
cvtsi2sdq 0x8(%rsp),%xmm0
mulsd  0xec9(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
%struct.timezone = type { i32 }
define double @seconds() {
%1 = alloca %struct.timeval
%2 = alloca %struct.timezone
%3 = alloca i32
%4 = call i32 @gettimeofday(%struct.timeval* %1, %struct.timezone* %2)
store i32 %4, i32* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%6 = load i64, i64* %5
%7 = sitofp i64 %6 to double
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%9 = load i64, i64* %8
%10 = sitofp i64 %9 to double
%11 = call double @llvm.fmuladd.f64(double %10, double 0x3EB0C6F7A0B5ED8D, double %7)
ret double %11
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
%struct.timezone = type { i32 }
define double @seconds() {
%1 = alloca %struct.timeval
%2 = alloca %struct.timezone
%3 = bitcast %struct.timeval* %1 to i8*
%4 = bitcast %struct.timezone* %2 to i8*
%5 = call i32 @gettimeofday(%struct.timeval* %1, %struct.timezone* %2)
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%10 = load i64, i64* %9
%11 = sitofp i64 %10 to double
%12 = tail call double @llvm.fmuladd.f64(double %11, double 0x3EB0C6F7A0B5ED8D, double %8)
ret double %12
}
/* Variables and functions */
int /*<<< orphan*/ r4030_delay();
extern void r4030_write_reg32(unsigned addr, unsigned val) {
  *((volatile unsigned int *)addr) = val;
  r4030_delay();
}


x86 assembly (clang, -O0):
<r4030_write_reg32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
mov    %ecx,(%rax)
mov    $0x0,%al
call   1030 <r4030_delay@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<r4030_write_reg32>:
mov    %edi,%eax
mov    %esi,(%rax)
xor    %eax,%eax
jmp    1030 <r4030_delay@plt>

LLVM IR (-O0):
define void @r4030_write_reg32(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 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
store volatile i32 %5, i32* %8
%9 = call i32 (...) @r4030_delay()
ret void
}

LLVM IR (-O2):
define void @r4030_write_reg32(i32 %0, i32 %1) {
%3 = zext i32 %0 to i64
%4 = inttoptr i64 %3 to i32*
store volatile i32 %1, i32* %4
%5 = tail call i32 (...) @r4030_delay()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void nmstermio_show_cursor(void) { printf("\033[?25h"); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"\1B[?25h\00"
define void @nmstermio_show_cursor() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"\1B[?25h\00"
define void @nmstermio_show_cursor() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test(int);
int main() {
  test(25);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x19,%edi
call   1030 <test@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test(i32 25)
ret i32 0
}
/* Type definitions */
struct packet {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ MSG_DONTWAIT;
int /*<<< orphan*/ buildPacket(char *, struct packet *);
int recvfrom(int, char *, int, int /*<<< orphan*/, int /*<<< orphan*/,
             int /*<<< orphan*/);
int readPacket(int sd, char *buffer, int bufferSize, struct packet *p) {
  int bytes_read;
  bytes_read = recvfrom(sd, buffer, bufferSize, MSG_DONTWAIT, 0, 0);
  if (bytes_read > 0)
    buildPacket(buffer, p);
  return bytes_read;
}


x86 assembly (clang, -O0):
<readPacket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    0x2e99(%rip),%rax
mov    (%rax),%ecx
xor    %r9d,%r9d
mov    %r9d,%r8d
call   1030 <recvfrom@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jle    116e <readPacket+0x4e>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <buildPacket@plt>
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readPacket>:
push   %rbp
push   %r14
push   %rbx
mov    %rcx,%r14
mov    %rsi,%rbx
mov    0x2eaf(%rip),%rax
mov    (%rax),%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <recvfrom@plt>
mov    %eax,%ebp
test   %eax,%eax
jle    114f <readPacket+0x2f>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <buildPacket@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.packet = type { i32 }
@MSG_DONTWAIT = global i32 0
define i32 @readPacket(i32 %0, i8* %1, i32 %2, %struct.packet* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca %struct.packet*
%9 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store %struct.packet* %3, %struct.packet** %8
%10 = load i32, i32* %5
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = load i32, i32* @MSG_DONTWAIT
%14 = call i32 @recvfrom(i32 %10, i8* %11, i32 %12, i32 %13, i32 0, i32 0)
store i32 %14, i32* %9
%15 = load i32, i32* %9
%16 = icmp sgt i32 %15, 0
br i1 %16, label %17, label %21
17: ; preds = %4
%18 = load i8*, i8** %6
%19 = load %struct.packet*, %struct.packet** %8
%20 = call i32 @buildPacket(i8* %18, %struct.packet* %19)
br label %21
21: ; preds = %17, %4
%22 = load i32, i32* %9
ret i32 %22
}

LLVM IR (-O2):
%struct.packet = type { i32 }
@MSG_DONTWAIT = global i32 0
define i32 @readPacket(i32 %0, i8* %1, i32 %2, %struct.packet* %3) {
%5 = load i32, i32* @MSG_DONTWAIT
%6 = tail call i32 @recvfrom(i32 %0, i8* %1, i32 %2, i32 %5, i32 0, i32 0)
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = tail call i32 @buildPacket(i8* %1, %struct.packet* %3)
br label %10
10: ; preds = %8, %4
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ rgph_u32x3_jenkins2v_data32(float const *, size_t, uintptr_t,
                                               int /*<<< orphan*/ *);
void rgph_u32x3_jenkins2v_f32a(const float *key, size_t len, uintptr_t seed,
                               uint32_t *h) {
  rgph_u32x3_jenkins2v_data32(key, len, seed, h);
}


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

x86 assembly (clang, -O2):
<rgph_u32x3_jenkins2v_f32a>:
jmp    1030 <rgph_u32x3_jenkins2v_data32@plt>

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

LLVM IR (-O2):
define void @rgph_u32x3_jenkins2v_f32a(float* %0, i64 %1, i64 %2, i32* %3) {
%5 = tail call i32 @rgph_u32x3_jenkins2v_data32(float* %0, i64 %1, i64 %2, i32* %3)
ret void
}
void ri_parallel_barrier() {}


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

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

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

LLVM IR (-O2):
define void @ri_parallel_barrier() {
ret void
}
double D_sign(double a, double b) {
  double x;
  x = (a >= 0 ? a : -a);
  return (b >= 0 ? x : -x);
}


x86 assembly (clang, -O0):
<D_sign>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     112f <D_sign+0x2f>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    1150 <D_sign+0x50>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     117b <D_sign+0x7b>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    119c <D_sign+0x9c>
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<D_sign>:
movapd 0xef8(%rip),%xmm2
movapd %xmm0,%xmm3
xorpd  %xmm2,%xmm3
xorpd  %xmm4,%xmm4
xorpd  %xmm5,%xmm5
cmplesd %xmm0,%xmm5
andpd  %xmm5,%xmm0
andnpd %xmm3,%xmm5
orpd   %xmm5,%xmm0
xorpd  %xmm0,%xmm2
cmplesd %xmm1,%xmm4
andpd  %xmm4,%xmm0
andnpd %xmm2,%xmm4
orpd   %xmm4,%xmm0
ret

LLVM IR (-O0):
define double @D_sign(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = fcmp oge double %6, 0.000000e+00
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load double, double* %3
br label %13
10: ; preds = %2
%11 = load double, double* %3
%12 = fneg double %11
br label %13
13: ; preds = %10, %8
%14 = phi double [ %9, %8 ], [ %12, %10 ]
store double %14, double* %5
%15 = load double, double* %4
%16 = fcmp oge double %15, 0.000000e+00
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = load double, double* %5
br label %22
19: ; preds = %13
%20 = load double, double* %5
%21 = fneg double %20
br label %22
22: ; preds = %19, %17
%23 = phi double [ %18, %17 ], [ %21, %19 ]
ret double %23
}

LLVM IR (-O2):
define double @D_sign(double %0, double %1) {
%3 = fcmp oge double %0, 0.000000e+00
%4 = fneg double %0
%5 = select i1 %3, double %0, double %4
%6 = fcmp oge double %1, 0.000000e+00
%7 = fneg double %5
%8 = select i1 %6, double %5, double %7
ret double %8
}
unsigned xrop3_155_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = T | S;
  stk2 = D & stk3;
  stk1 = S ^ stk2;
  stk1 = ~stk1;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_155_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_155_0_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
or     %edi,%esi
xor    %esi,%eax
not    %eax
ret

LLVM IR (-O0):
define i32 @xrop3_155_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %7
%24 = load i32, i32* %6
%25 = or i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %5
%27 = load i32, i32* %10
%28 = and i32 %26, %27
store i32 %28, i32* %9
%29 = load i32, i32* %6
%30 = load i32, i32* %9
%31 = xor i32 %29, %30
store i32 %31, i32* %8
%32 = load i32, i32* %8
%33 = xor i32 %32, -1
store i32 %33, i32* %8
%34 = load i32, i32* %8
ret i32 %34
}

LLVM IR (-O2):
define i32 @xrop3_155_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = or i8 %1, %0
%6 = zext i8 %5 to i32
%7 = xor i32 %4, %6
%8 = xor i32 %7, -1
ret i32 %8
}
/* Variables and functions */
float _fabsf(float);
float fabsf(float value) { return _fabsf(value); }


x86 assembly (clang, -O0):
<fabsf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <_fabsf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fabsf>:
jmp    1030 <_fabsf@plt>

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

LLVM IR (-O2):
define float @fabsf(float %0) {
%2 = tail call float @_fabsf(float %0)
ret float %2
}