xunge/DecIR huggingface dataset:
long double sinl(long double x) {
  long double r;
  if (isinf(x))
    return __domain_error();
  __asm__ __volatile__("fsin" : "=t"(r) : "0"(x));
  return r;
}


x86 assembly (clang, -O0):
<sinl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
fldt   0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
xor    %eax,%eax
call   1040 <isinf@plt>
cmp    $0x0,%eax
je     115b <sinl+0x3b>
xor    %eax,%eax
call   1030 <__domain_error@plt>
mov    %eax,-0x34(%rbp)
fildl  -0x34(%rbp)
fstpt  -0x10(%rbp)
jmp    1169 <sinl+0x49>
fldt   -0x20(%rbp)
fsin
fstpt  -0x30(%rbp)
fldt   -0x30(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sinl>:
sub    $0x28,%rsp
fldt   0x30(%rsp)
fld    %st(0)
fstpt  0x1c(%rsp)
fstpt  (%rsp)
xor    %eax,%eax
call   1040 <isinf@plt>
test   %eax,%eax
je     1150 <sinl+0x30>
xor    %eax,%eax
call   1030 <__domain_error@plt>
mov    %eax,0x18(%rsp)
fildl  0x18(%rsp)
add    $0x28,%rsp
ret
fldt   0x1c(%rsp)
fsin
add    $0x28,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @sinl(x86_fp80 %0) {
%2 = alloca x86_fp80
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
%5 = load x86_fp80, x86_fp80* %3
%6 = call i32 (x86_fp80, ...) bitcast (i32 (...)* @isinf to i32 (x86_fp80, ...)*)(x86_fp80 %5)
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = call i32 (...) @__domain_error()
%10 = sitofp i32 %9 to x86_fp80
store x86_fp80 %10, x86_fp80* %2
br label %15
11: ; preds = %1
%12 = load x86_fp80, x86_fp80* %3
%13 = call x86_fp80 asm sideeffect "fsin", "={st},0,~{dirflag},~{fpsr},~{flags}"(x86_fp80 %12)
store x86_fp80 %13, x86_fp80* %4
%14 = load x86_fp80, x86_fp80* %4
store x86_fp80 %14, x86_fp80* %2
br label %15
15: ; preds = %11, %8
%16 = load x86_fp80, x86_fp80* %2
ret x86_fp80 %16
}

LLVM IR (-O2):
define x86_fp80 @sinl(x86_fp80 %0) {
%2 = tail call i32 (x86_fp80, ...) bitcast (i32 (...)* @isinf to i32 (x86_fp80, ...)*)(x86_fp80 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 (...) @__domain_error()
%6 = sitofp i32 %5 to x86_fp80
br label %9
7: ; preds = %1
%8 = tail call x86_fp80 asm sideeffect "fsin", "={st},0,~{dirflag},~{fpsr},~{flags}"(x86_fp80 %0)
br label %9
9: ; preds = %7, %4
%10 = phi x86_fp80 [ %6, %4 ], [ %8, %7 ]
ret x86_fp80 %10
}
punct(i) {
  if (!i || alph(i))
    return (0);
  else
    return (1);
}


x86 assembly (clang, -O0):
<punct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1138 <punct+0x28>
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1030 <alph@plt>
cmp    $0x0,%eax
je     1144 <punct+0x34>
movl   $0x0,-0x4(%rbp)
jmp    114b <punct+0x3b>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<punct>:
test   %edi,%edi
je     112a <punct+0x1a>
push   %rax
xor    %eax,%eax
call   1030 <alph@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @punct(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @alph to i32 (i32, ...)*)(i32 %0)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void dt_free(void *object) { free(object); }


x86 assembly (clang, -O0):
<dt_free>:
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):
<dt_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @dt_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
scalar_t__ u8islowerlatini(int);
scalar_t__ u8isupperlatini(int);
int u8islatini(int n) { return u8islowerlatini(n) || u8isupperlatini(n); }


x86 assembly (clang, -O0):
<u8islatini>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <u8islowerlatini@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    1157 <u8islatini+0x37>
mov    -0x4(%rbp),%edi
call   1040 <u8isupperlatini@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<u8islatini>:
push   %rbx
mov    %edi,%ebx
call   1030 <u8islowerlatini@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <u8islatini+0x17>
pop    %rbx
ret
mov    %ebx,%edi
call   1040 <u8isupperlatini@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @u8islatini(i32 %0) {
%2 = tail call i64 @u8islowerlatini(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @u8isupperlatini(i32 %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Type definitions */
struct rusage {
  int dummy;
};
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ wait4(int, int *, int, struct rusage *);
pid_t wait3(int *status, int opts, struct rusage *rusage) {
  return wait4(-1, status, opts, rusage);
}


x86 assembly (clang, -O0):
<wait3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    $0xffffffff,%edi
call   1030 <wait4@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait3>:
mov    %rdx,%rcx
mov    %esi,%edx
mov    %rdi,%rsi
mov    $0xffffffff,%edi
jmp    1030 <wait4@plt>

LLVM IR (-O0):
%struct.rusage = type { i32 }
define i32 @wait3(i32* %0, i32 %1, %struct.rusage* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca %struct.rusage*
store i32* %0, i32** %4
store i32 %1, i32* %5
store %struct.rusage* %2, %struct.rusage** %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %5
%9 = load %struct.rusage*, %struct.rusage** %6
%10 = call i32 @wait4(i32 -1, i32* %7, i32 %8, %struct.rusage* %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.rusage = type { i32 }
define i32 @wait3(i32* %0, i32 %1, %struct.rusage* %2) {
%4 = tail call i32 @wait4(i32 -1, i32* %0, i32 %1, %struct.rusage* %2)
ret i32 %4
}
/* Variables and functions */
float expf(float);
float gaussian(float x, float y, float sigma) {
  return expf(-(x * x + y * y) / (2.0f * sigma * sigma));
}


x86 assembly (clang, -O0):
<gaussian>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
movss  -0x8(%rbp),%xmm1
mulss  -0x8(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  0xea8(%rip),%xmm1
mulss  -0xc(%rbp),%xmm1
mulss  -0xc(%rbp),%xmm1
divss  %xmm1,%xmm0
call   1030 <expf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gaussian>:
mulss  %xmm1,%xmm1
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
xorps  0xedd(%rip),%xmm0
movaps %xmm2,%xmm1
addss  %xmm2,%xmm1
mulss  %xmm2,%xmm1
divss  %xmm1,%xmm0
jmp    1030 <expf@plt>

LLVM IR (-O0):
define float @gaussian(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %4
%9 = load float, float* %5
%10 = load float, float* %5
%11 = fmul float %9, %10
%12 = call float @llvm.fmuladd.f32(float %7, float %8, float %11)
%13 = fneg float %12
%14 = load float, float* %6
%15 = fmul float 2.000000e+00, %14
%16 = load float, float* %6
%17 = fmul float %15, %16
%18 = fdiv float %13, %17
%19 = call float @expf(float %18)
ret float %19
}

LLVM IR (-O2):
define float @gaussian(float %0, float %1, float %2) {
%4 = fmul float %1, %1
%5 = tail call float @llvm.fmuladd.f32(float %0, float %0, float %4)
%6 = fneg float %5
%7 = fmul float %2, 2.000000e+00
%8 = fmul float %7, %2
%9 = fdiv float %6, %8
%10 = tail call float @expf(float %9)
ret float %10
}
void f(int n) {
  { int n = 2; }
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @f(i32 %0) {
ret void
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
float stdlib_strided_sdssum(int, float *, int);
int main() {
  float x[] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0};
  int64_t N = 4;
  int64_t stride = 2;
  float v = stdlib_strided_sdssum(N, x, stride);
  printf("sum: %f\n", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec8(%rip),%rax
mov    %rax,-0x8(%rbp)
movl   $0x4,-0x24(%rbp)
movl   $0x2,-0x28(%rbp)
mov    -0x24(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%edx
call   1040 <stdlib_strided_sdssum@plt>
movss  %xmm0,-0x2c(%rbp)
movss  -0x2c(%rbp),%xmm0
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x4,%edi
mov    $0x2,%edx
call   1040 <stdlib_strided_sdssum@plt>
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [8 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00]
@.str = [9 x i8] c"sum: %f\0A\00"
define i32 @main() {
%1 = alloca [8 x float]
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = bitcast [8 x float]* %1 to i8*
store i32 4, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call float @stdlib_strided_sdssum(i32 %6, float* %7, i32 %8)
store float %9, float* %4
%10 = load float, float* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), float %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [8 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00]
@.str = [9 x i8] c"sum: %f\0A\00"
define i32 @main() {
%1 = alloca [8 x float]
%2 = bitcast [8 x float]* %1 to i8*
%3 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 0
%4 = call float @stdlib_strided_sdssum(i32 4, float* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), float %4)
ret i32 0
}
/* Variables and functions */
int lernotas(float *);
double media(float *, int);
int /*<<< orphan*/ printf(char *, double);
int main() {
  float notas[100] = {0};
  int n = lernotas(notas);
  printf("A media das notas da turma foi %.2f\n", media(notas, n));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1b0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x1a0(%rbp),%rdi
xor    %esi,%esi
mov    $0x190,%edx
call   1040 <memset@plt>
lea    -0x1a0(%rbp),%rdi
call   1050 <lernotas@plt>
mov    %eax,-0x1a4(%rbp)
lea    -0x1a0(%rbp),%rdi
mov    -0x1a4(%rbp),%esi
call   1060 <media@plt>
lea    0xe70(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x1b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x190,%rsp
mov    %rsp,%rbx
mov    $0x190,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <memset@plt>
mov    %rbx,%rdi
call   1050 <lernotas@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1060 <media@plt>
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x190,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"A media das notas da turma foi %.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x float]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [100 x float]* %2 to i8*
%5 = getelementptr inbounds [100 x float], [100 x float]* %2, i64 0, i64 0
%6 = call i32 @lernotas(float* %5)
store i32 %6, i32* %3
%7 = getelementptr inbounds [100 x float], [100 x float]* %2, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call double @media(float* %7, i32 %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), double %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [37 x i8] c"A media das notas da turma foi %.2f\0A\00"
define i32 @main() {
%1 = alloca [100 x float]
%2 = bitcast [100 x float]* %1 to i8*
%3 = getelementptr inbounds [100 x float], [100 x float]* %1, i64 0, i64 0
%4 = call i32 @lernotas(float* %3)
%5 = call double @media(float* %3, i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), double %5)
ret i32 0
}
/* Variables and functions */
float fasterfc(float);
float fasterf(float x) { return 1.0f - fasterfc(x); }


x86 assembly (clang, -O0):
<fasterf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <fasterfc@plt>
movaps %xmm0,%xmm1
movss  0xece(%rip),%xmm0
subss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fasterf>:
push   %rax
call   1030 <fasterfc@plt>
movss  0xee2(%rip),%xmm1
subss  %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

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

LLVM IR (-O2):
define float @fasterf(float %0) {
%2 = tail call float @fasterfc(float %0)
%3 = fsub float 1.000000e+00, %2
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ foo(char *);
__attribute__((no, noclone)) void f1(int x) {
  char locals[128];
  char vla[x];
  foo(vla);
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x98(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,%rsp
mov    %rax,-0xa0(%rbp)
call   1030 <foo@plt>
mov    -0x98(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,%eax
mov    %rsp,%rdi
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rdi
mov    %rdi,%rsp
call   1030 <foo@plt>
mov    %rbp,%rsp
pop    %rbp
ret

LLVM IR (-O0):
define void @f1(i32 %0) {
%2 = alloca i32
%3 = alloca [128 x i8]
%4 = alloca i8*
%5 = alloca i64
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = zext i32 %6 to i64
%8 = call i8* @llvm.stacksave()
store i8* %8, i8** %4
%9 = alloca i8, i64 %7
store i64 %7, i64* %5
%10 = call i32 @foo(i8* %9)
%11 = load i8*, i8** %4
ret void
}

LLVM IR (-O2):
define void @f1(i32 %0) {
%2 = zext i32 %0 to i64
%3 = alloca i8, i64 %2
%4 = call i32 @foo(i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void _c_die() { exit(0); }


x86 assembly (clang, -O0):
<_c_die>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<_c_die>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @_c_die() {
%1 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @_c_die() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int minmax(int a[], int len, int *min, int *max) {
  printf("minmax sizeof(a)=%lu\n", sizeof(a));
  printf("minmax a=%p\n", a);
  *min = *max = a[0];
  return 0;
}


x86 assembly (clang, -O0):
<minmax>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
lea    0xed2(%rip),%rdi
mov    $0x8,%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<minmax>:
push   %r15
push   %r14
push   %rbx
mov    %rcx,%r15
mov    %rdx,%r14
mov    %rdi,%rbx
lea    0xedb(%rip),%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    (%rbx),%eax
mov    %eax,(%r15)
mov    %eax,(%r14)
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [22 x i8] c"minmax sizeof(a)=%lu\0A\00"
@.str.1 = [13 x i8] c"minmax a=%p\0A\00"
define i32 @minmax(i32* %0, i32 %1, i32* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i64 8)
%10 = load i32*, i32** %5
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32* %10)
%12 = load i32*, i32** %5
%13 = getelementptr inbounds i32, i32* %12, i64 0
%14 = load i32, i32* %13
%15 = load i32*, i32** %8
store i32 %14, i32* %15
%16 = load i32*, i32** %7
store i32 %14, i32* %16
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"minmax sizeof(a)=%lu\0A\00"
@.str.1 = [13 x i8] c"minmax a=%p\0A\00"
define i32 @minmax(i32* %0, i32 %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3) {
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i64 8)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32* %0)
%7 = load i32, i32* %0
store i32 %7, i32* %3
store i32 %7, i32* %2
ret i32 0
}
/* Variables and functions */
int subtracao(int *inteiros, size_t quantos) { return 0; }


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

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

LLVM IR (-O0):
define i32 @subtracao(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @subtracao(i32* nocapture readnone %0, i64 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ do_north_east_corner();
int /*<<< orphan*/ do_south_west_corner();
double get_south_penetration();
void do_north_west_diag(void) {
  if (get_south_penetration() <= 0.5)
    do_south_west_corner();
  else
    do_north_east_corner();
}


x86 assembly (clang, -O0):
<do_north_west_diag>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <get_south_penetration@plt>
movaps %xmm0,%xmm1
movsd  0xeba(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     115c <do_north_west_diag+0x2c>
mov    $0x0,%al
call   1040 <do_south_west_corner@plt>
jmp    1163 <do_north_west_diag+0x33>
mov    $0x0,%al
call   1030 <do_north_east_corner@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_north_west_diag>:
push   %rax
xor    %eax,%eax
call   1050 <get_south_penetration@plt>
movsd  0xec0(%rip),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
jae    114e <do_north_west_diag+0x1e>
pop    %rcx
jmp    1030 <do_north_east_corner@plt>
pop    %rcx
jmp    1040 <do_south_west_corner@plt>

LLVM IR (-O0):
define void @do_north_west_diag() {
%1 = call double (...) @get_south_penetration()
%2 = fcmp ole double %1, 5.000000e-01
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 (...) @do_south_west_corner()
br label %7
5: ; preds = %0
%6 = call i32 (...) @do_north_east_corner()
br label %7
7: ; preds = %5, %3
ret void
}

LLVM IR (-O2):
define void @do_north_west_diag() {
%1 = tail call double (...) @get_south_penetration()
%2 = fcmp ugt double %1, 5.000000e-01
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @do_south_west_corner()
br label %7
5: ; preds = %0
%6 = tail call i32 (...) @do_north_east_corner()
br label %7
7: ; preds = %5, %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, int /*<<< orphan*/ *, int);
void trunnel_set_uint8(void *p, uint8_t v) { memcpy(p, &v, 1); }


x86 assembly (clang, -O0):
<trunnel_set_uint8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x1,%edx
call   1030 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trunnel_set_uint8>:
push   %rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x1,%edx
call   1030 <memcpy@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @trunnel_set_uint8(i8* %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i32 @memcpy(i8* %0, i32* %3, i32 1)
ret void
}
/* Variables and functions */
size_t str_chr(char const *, char);
int contains(const char *str, char ch) { return str[str_chr(str, ch)]; }


x86 assembly (clang, -O0):
<contains>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
movsbl -0x9(%rbp),%esi
call   1030 <str_chr@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
movsbl (%rax,%rcx,1),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<contains>:
push   %rbx
mov    %rdi,%rbx
call   1030 <str_chr@plt>
movsbl (%rbx,%rax,1),%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @contains(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %3
%7 = load i8, i8* %4
%8 = call i64 @str_chr(i8* %6, i8 signext %7)
%9 = getelementptr inbounds i8, i8* %5, i64 %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @contains(i8* %0, i8 signext %1) {
%3 = tail call i64 @str_chr(i8* %0, i8 signext %1)
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
ret i32 %6
}
void test_non_identifiers() {
  int i, x;
#pragma omp target
#pragma omp teams
#pragma omp distribute simd;
  for (i = 0; i < 16; ++i)
    ;
#pragma omp target
#pragma omp teams
#pragma omp distribute simd private(x);
  for (i = 0; i < 16; ++i)
    ;
#pragma omp target
#pragma omp teams
#pragma omp distribute simd, private(x);
  for (i = 0; i < 16; ++i)
    ;
}


x86 assembly (clang, -O0):
<test_non_identifiers>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    1128 <test_non_identifiers+0x28>
jmp    111a <test_non_identifiers+0x1a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <test_non_identifiers+0xb>
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    114c <test_non_identifiers+0x4c>
jmp    113e <test_non_identifiers+0x3e>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <test_non_identifiers+0x2f>
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    1170 <test_non_identifiers+0x70>
jmp    1162 <test_non_identifiers+0x62>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <test_non_identifiers+0x53>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test_non_identifiers() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printw(char *);
void ion_cmd_ls(char *cmd) { printw("\n\rls command\n\r\n\r"); }


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"\0A\0Dls command\0A\0D\0A\0D\00"
define void @ion_cmd_ls(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printw(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"\0A\0Dls command\0A\0D\0A\0D\00"
define void @ion_cmd_ls(i8* nocapture readnone %0) {
%2 = tail call i32 @printw(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}
float getSNBmultiplier(void) {
  unsigned int msr_lo, msr_hi;
  float coef;
  __asm__ __volatile__("rdmsr"
                       : "=a"(msr_lo), "=d"(msr_hi)
                       : "c"(0xCE)
                       : "edi");
  coef = (msr_lo >> 8) & 0xFF;
  return coef;
}


x86 assembly (clang, -O0):
<getSNBmultiplier>:
push   %rbp
mov    %rsp,%rbp
mov    $0xce,%ecx
rdmsr
mov    %eax,-0x4(%rbp)
mov    %edx,-0x8(%rbp)
movzbl -0x3(%rbp),%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<getSNBmultiplier>:
mov    $0xce,%ecx
rdmsr
movzbl %ah,%eax
cvtsi2ss %eax,%xmm0
ret

LLVM IR (-O0):
define float @getSNBmultiplier() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
%4 = call { i32, i32 } asm sideeffect "rdmsr", "={ax},={dx},{cx},~{edi},~{dirflag},~{fpsr},~{flags}"(i32 206)
%5 = extractvalue { i32, i32 } %4, 0
%6 = extractvalue { i32, i32 } %4, 1
store i32 %5, i32* %1
store i32 %6, i32* %2
%7 = load i32, i32* %1
%8 = lshr i32 %7, 8
%9 = and i32 %8, 255
%10 = uitofp i32 %9 to float
store float %10, float* %3
%11 = load float, float* %3
ret float %11
}

LLVM IR (-O2):
define float @getSNBmultiplier() {
%1 = tail call { i32, i32 } asm sideeffect "rdmsr", "={ax},={dx},{cx},~{edi},~{dirflag},~{fpsr},~{flags}"(i32 206)
%2 = extractvalue { i32, i32 } %1, 0
%3 = lshr i32 %2, 8
%4 = and i32 %3, 255
%5 = uitofp i32 %4 to float
ret float %5
}
h() { static int good; }


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

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

LLVM IR (-O0):
@h.good = internal global i32 0
define i32 @h() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @h() {
ret i32 undef
}
void parse_all_samples(const char *arg, void *out, struct callbacks *cb) {
  if (arg)
    *(const char **)out = arg;
  else
    *(const char **)out = "samples.csv";
}


x86 assembly (clang, -O0):
<parse_all_samples>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     112b <parse_all_samples+0x2b>
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
jmp    1139 <parse_all_samples+0x39>
mov    -0x10(%rbp),%rax
lea    0xeca(%rip),%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_all_samples>:
test   %rdi,%rdi
lea    0xef6(%rip),%rax
cmovne %rdi,%rax
mov    %rax,(%rsi)
ret

LLVM IR (-O0):
%struct.callbacks = type opaque
@.str = [12 x i8] c"samples.csv\00"
define void @parse_all_samples(i8* %0, i8* %1, %struct.callbacks* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca %struct.callbacks*
store i8* %0, i8** %4
store i8* %1, i8** %5
store %struct.callbacks* %2, %struct.callbacks** %6
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = load i8*, i8** %4
%11 = load i8*, i8** %5
%12 = bitcast i8* %11 to i8**
store i8* %10, i8** %12
br label %16
13: ; preds = %3
%14 = load i8*, i8** %5
%15 = bitcast i8* %14 to i8**
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8** %15
br label %16
16: ; preds = %13, %9
ret void
}

LLVM IR (-O2):
%struct.callbacks = type opaque
@.str = [12 x i8] c"samples.csv\00"
define void @parse_all_samples(i8* %0, i8* nocapture writeonly %1, %struct.callbacks* nocapture readnone %2) {
%4 = icmp eq i8* %0, null
%5 = bitcast i8* %1 to i8**
%6 = select i1 %4, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0
store i8* %6, i8** %5
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int swap_endian(int, int);
int main(int argc, const char *argv[]) {
  uint8_t a = 0x95;
  uint8_t b = 0x22;
  uint16_t c = swap_endian(a, b);
  printf("c = %x\n", c);
  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   $0x95,-0x14(%rbp)
movl   $0x22,-0x18(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1040 <swap_endian@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x95,%edi
mov    $0x22,%esi
call   1040 <swap_endian@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"c = %x\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 149, i32* %6
store i32 34, i32* %7
%9 = load i32, i32* %6
%10 = load i32, i32* %7
%11 = call i32 @swap_endian(i32 %9, i32 %10)
store i32 %11, i32* %8
%12 = load i32, i32* %8
%13 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"c = %x\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @swap_endian(i32 149, i32 34)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void FreeBuffer(char *buf) {
  if (buf) {
    free(buf);
  }
}


x86 assembly (clang, -O0):
<FreeBuffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <FreeBuffer+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FreeBuffer>:
test   %rdi,%rdi
je     111a <FreeBuffer+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @FreeBuffer(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @FreeBuffer(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
void ae(void) {}


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

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

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

LLVM IR (-O2):
define void @ae() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MIPS_CLEAR_BIT(int, int);
void xburst_cgm_ungate_pcm() { MIPS_CLEAR_BIT((0xB0000000 + 0x28), 3); }


x86 assembly (clang, -O0):
<xburst_cgm_ungate_pcm>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb0000028,%edi
mov    $0x3,%esi
call   1030 <MIPS_CLEAR_BIT@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<xburst_cgm_ungate_pcm>:
mov    $0xb0000028,%edi
mov    $0x3,%esi
jmp    1030 <MIPS_CLEAR_BIT@plt>

LLVM IR (-O0):
define void @xburst_cgm_ungate_pcm() {
%1 = call i32 @MIPS_CLEAR_BIT(i32 -1342177240, i32 3)
ret void
}

LLVM IR (-O2):
define void @xburst_cgm_ungate_pcm() {
%1 = tail call i32 @MIPS_CLEAR_BIT(i32 -1342177240, i32 3)
ret void
}
/* Variables and functions */
int atoi(int /*<<< orphan*/);
int /*<<< orphan*/ gets(char *);
int geti() {
  char s[16];
  return atoi(gets(s));
}


x86 assembly (clang, -O0):
<geti>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
call   1030 <gets@plt>
mov    %eax,%edi
call   1040 <atoi@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<geti>:
sub    $0x18,%rsp
mov    %rsp,%rdi
call   1030 <gets@plt>
mov    %eax,%edi
call   1040 <atoi@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @geti() {
%1 = alloca [16 x i8]
%2 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%3 = call i32 @gets(i8* %2)
%4 = call i32 @atoi(i32 %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @geti() {
%1 = alloca [16 x i8]
%2 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%3 = call i32 @gets(i8* %2)
%4 = call i32 @atoi(i32 %3)
ret i32 %4
}
follow2(c1, c2, r1, r2, r3) {
  register int c;
  if ((c = Getc()) == c1)
    return r1;
  else if (c == c2)
    return r2;
  else {
    Ungetc(c);
    return r3;
  }
}


x86 assembly (clang, -O0):
<follow2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    $0x0,%al
call   1030 <Getc@plt>
mov    %eax,-0x1c(%rbp)
cmp    -0x8(%rbp),%eax
jne    1156 <follow2+0x36>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    117d <follow2+0x5d>
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    116d <follow2+0x4d>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    117d <follow2+0x5d>
mov    -0x1c(%rbp),%edi
mov    $0x0,%al
call   1040 <Ungetc@plt>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<follow2>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r8d,%r14d
mov    %ecx,%r15d
mov    %edx,%ebp
mov    %esi,%r12d
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <Getc@plt>
cmp    %ebx,%eax
je     1154 <follow2+0x34>
mov    %r15d,%ebp
cmp    %r12d,%eax
je     1154 <follow2+0x34>
mov    %eax,%edi
xor    %eax,%eax
call   1040 <Ungetc@plt>
mov    %r14d,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @follow2(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 (...) @Getc()
%7 = icmp eq i32 %6, %0
br i1 %7, label %12, label %8
8: ; preds = %5
%9 = icmp eq i32 %6, %1
br i1 %9, label %12, label %10
10: ; preds = %8
%11 = tail call i32 (i32, ...) bitcast (i32 (...)* @Ungetc to i32 (i32, ...)*)(i32 %6)
br label %12
12: ; preds = %8, %5, %10
%13 = phi i32 [ %4, %10 ], [ %2, %5 ], [ %3, %8 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ task(int);
void *serial(int num_tasks) {
  int i;
  for (i = 0; i < num_tasks; i++) {
    task(i);
  }
}


x86 assembly (clang, -O0):
<serial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1144 <serial+0x34>
mov    -0x10(%rbp),%edi
call   1030 <task@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1122 <serial+0x12>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial>:
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
jle    112e <serial+0x1e>
mov    %edi,%ebx
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
call   1030 <task@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    1120 <serial+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define noalias i8* @serial(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @task(i32 %4)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void can_close(int sock) {
  if (sock >= 0)
    close(sock);
}


x86 assembly (clang, -O0):
<can_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     112d <can_close+0x1d>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<can_close>:
test   %edi,%edi
js     1119 <can_close+0x9>
jmp    1030 <close@plt>
ret

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

LLVM IR (-O2):
define void @can_close(i32 %0) {
%2 = icmp sgt i32 %0, -1
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @close(i32 %0)
br label %5
5: ; preds = %3, %1
ret void
}
void clear_ptrace_hw_breakpoint(struct task_struct *tsk) {}


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

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

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

LLVM IR (-O2):
%struct.task_struct = type opaque
define void @clear_ptrace_hw_breakpoint(%struct.task_struct* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void janus_version(const char *pname) { printf("Janus %s\n", "0.1"); }


x86 assembly (clang, -O0):
<janus_version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
lea    0xee0(%rip),%rsi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [10 x i8] c"Janus %s\0A\00"
@.str.1 = [4 x i8] c"0.1\00"
define void @janus_version(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"Janus %s\0A\00"
@.str.1 = [4 x i8] c"0.1\00"
define void @janus_version(i8* nocapture readnone %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int unsetTransformationBit(int i, int *transformations) {
  *transformations = *transformations & ~(1 << (i - 1));
}


x86 assembly (clang, -O0):
<unsetTransformationBit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    -0x14(%rbp),%ecx
xor    $0xffffffff,%eax
and    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unsetTransformationBit>:
lea    -0x1(%rdi),%ecx
mov    $0xfffffffe,%eax
rol    %cl,%eax
and    %eax,(%rsi)
ret

LLVM IR (-O0):
define i32 @unsetTransformationBit(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
store i32 %0, i32* %4
store i32* %1, i32** %5
%6 = load i32*, i32** %5
%7 = load i32, i32* %6
%8 = load i32, i32* %4
%9 = sub nsw i32 %8, 1
%10 = shl i32 1, %9
%11 = xor i32 %10, -1
%12 = and i32 %7, %11
%13 = load i32*, i32** %5
store i32 %12, i32* %13
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @unsetTransformationBit(i32 %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = add nsw i32 %0, -1
%5 = shl nuw i32 1, %4
%6 = xor i32 %5, -1
%7 = and i32 %3, %6
store i32 %7, i32* %1
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf2(char *, int);
void GenDumpChar(int ch) {
  if (ch > 0)
    printf2("\tdb($%u)\n", ch & 0xFFu);
}


x86 assembly (clang, -O0):
<GenDumpChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    113a <GenDumpChar+0x2a>
mov    -0x4(%rbp),%esi
and    $0xff,%esi
lea    0xecb(%rip),%rdi
call   1030 <printf2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GenDumpChar>:
test   %edi,%edi
jle    1124 <GenDumpChar+0x14>
movzbl %dil,%esi
lea    0xee1(%rip),%rdi
jmp    1030 <printf2@plt>
ret

LLVM IR (-O0):
@.str = [10 x i8] c"\09db($%u)\0A\00"
define void @GenDumpChar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* %2
%7 = and i32 %6, 255
%8 = call i32 @printf2(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %9
9: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"\09db($%u)\0A\00"
define void @GenDumpChar(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = and i32 %0, 255
%5 = tail call i32 @printf2(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %4)
br label %6
6: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ltrim(char *);
int /*<<< orphan*/ rtrim(char *);
char *trim(char *s) {
  ltrim(s);
  rtrim(s);
  return s;
}


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

x86 assembly (clang, -O2):
<trim>:
push   %rbx
mov    %rdi,%rbx
call   1040 <ltrim@plt>
mov    %rbx,%rdi
call   1030 <rtrim@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @trim(i8* returned %0) {
%2 = tail call i32 @ltrim(i8* %0)
%3 = tail call i32 @rtrim(i8* %0)
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int pattern(int n) {
  int a = n;
  if (n > 0) {
    printf("%d ", a);
    a = pattern(n - 5);
    printf("%d ", n);
  } else
    printf("%d ", a);
}


x86 assembly (clang, -O0):
<pattern>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    116c <pattern+0x4c>
mov    -0xc(%rbp),%esi
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
sub    $0x5,%edi
call   1040 <pattern@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
jmp    117b <pattern+0x5b>
mov    -0xc(%rbp),%esi
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pattern>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
test   %ebx,%ebx
jle    114b <pattern+0x2b>
lea    -0x5(%rbx),%edi
call   1040 <pattern@plt>
lea    0xebc(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define i32 @pattern(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
br i1 %2, label %5, label %4
4: ; preds = %1, %5
ret i32 undef
5: ; preds = %1
%6 = add nsw i32 %0, -5
%7 = tail call i32 @pattern(i32 %6)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %4
}