xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ shift(int *, int);
void rotate(int A[], int n, int k) {
  for (int i = 1; i <= k; i++) {
    shift(A, n);
  }
}


x86 assembly (clang, -O0):
<rotate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     114f <rotate+0x3f>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <shift@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1129 <rotate+0x19>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotate>:
push   %rbp
push   %r14
push   %rbx
test   %edx,%edx
jle    1130 <rotate+0x20>
mov    %edx,%ebx
mov    %esi,%r14d
mov    %rdi,%rbp
mov    %rbp,%rdi
mov    %r14d,%esi
call   1030 <shift@plt>
add    $0xffffffff,%ebx
jne    1120 <rotate+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @rotate(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %2, 1
br i1 %4, label %5, label %6
5: ; preds = %6, %3
ret void
6: ; preds = %3, %6
%7 = phi i32 [ %9, %6 ], [ 1, %3 ]
%8 = tail call i32 @shift(i32* %0, i32 %1)
%9 = add nuw i32 %7, 1
%10 = icmp eq i32 %7, %2
br i1 %10, label %5, label %6
}
/* Variables and functions */
int /*<<< orphan*/ stack_so_deep();
int debug_loop() {
  while (1) {
    int stop_point_1 = 100;
    stack_so_deep();
    int stop_point_2 = 200;
  }
  return 0;
}


x86 assembly (clang, -O0):
<debug_loop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x64,-0x4(%rbp)
mov    $0x0,%al
call   1030 <stack_so_deep@plt>
movl   $0xc8,-0x8(%rbp)
jmp    1118 <debug_loop+0x8>

x86 assembly (clang, -O2):
<debug_loop>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <stack_so_deep@plt>
jmp    1120 <debug_loop+0x10>

LLVM IR (-O0):
define i32 @debug_loop() {
%1 = alloca i32
%2 = alloca i32
br label %3
3: ; preds = %0, %3
store i32 100, i32* %1
%4 = call i32 (...) @stack_so_deep()
store i32 200, i32* %2
br label %3
}

LLVM IR (-O2):
define i32 @debug_loop() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 (...) @stack_so_deep()
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, double *);
int main() {
  double salary = 0.0;
  double plus = 0.0;
  scanf("%lf", &salary);
  plus = salary * 0.25;
  printf("%.2lf\n", plus + salary);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
lea    0xec2(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movsd  0xea9(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movq   $0x0,(%rsp)
lea    0xed8(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
movsd  (%rsp),%xmm1
movsd  0xebb(%rip),%xmm0
mulsd  %xmm1,%xmm0
addsd  %xmm1,%xmm0
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [7 x i8] c"%.2lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
store i32 0, i32* %1
store double 0.000000e+00, double* %2
store double 0.000000e+00, double* %3
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %2)
%5 = load double, double* %2
%6 = fmul double %5, 2.500000e-01
store double %6, double* %3
%7 = load double, double* %3
%8 = load double, double* %2
%9 = fadd double %7, %8
%10 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [7 x i8] c"%.2lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
store double 0.000000e+00, double* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%4 = load double, double* %1
%5 = fmul double %4, 2.500000e-01
%6 = fadd double %4, %5
%7 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %6)
ret i32 0
}
void free_convert_matrix(b, nrl, nrh, ncl, nch) float **b;
int nrl, nrh, ncl, nch;
{ free((char *)(b + nrl)); }


x86 assembly (clang, -O0):
<free_convert_matrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_convert_matrix>:
movslq %esi,%rax
lea    (%rdi,%rax,8),%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_convert_matrix(float** %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca float**
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store float** %0, float*** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load float**, float*** %6
%12 = load i32, i32* %7
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds float*, float** %11, i64 %13
%15 = bitcast float** %14 to i8*
ret void
}

LLVM IR (-O2):
define void @free_convert_matrix(float** nocapture %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds float*, float** %0, i64 %6
%8 = bitcast float** %7 to i8*
tail call void @free(i8* %8)
ret void
}
int main(void) {
  const __uint128_t ui128 = 0;
  const __int128_t i128 = 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int ipow(int, int);
int rand();
float frrand(float low, float hi) {
  float r = hi + low;
  int p = 5;
  int n = ipow(10, p);
  float v = (float)(rand() % n) / (n - 1);
  float x = (v * r) + low;
  return x;
}


x86 assembly (clang, -O0):
<frrand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
addss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movl   $0x5,-0x10(%rbp)
mov    -0x10(%rbp),%esi
mov    $0xa,%edi
call   1030 <ipow@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
cltd
idivl  -0x14(%rbp)
cvtsi2ss %edx,%xmm0
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
cvtsi2ss %eax,%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
movss  -0xc(%rbp),%xmm2
movss  -0x4(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<frrand>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm0,0xc(%rsp)
addss  %xmm0,%xmm1
movss  %xmm1,0x8(%rsp)
mov    $0xa,%edi
mov    $0x5,%esi
call   1030 <ipow@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <rand@plt>
cltd
idiv   %ebx
xorps  %xmm0,%xmm0
cvtsi2ss %edx,%xmm0
add    $0xffffffff,%ebx
xorps  %xmm1,%xmm1
cvtsi2ss %ebx,%xmm1
divss  %xmm1,%xmm0
mulss  0x8(%rsp),%xmm0
addss  0xc(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define float @frrand(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca i32
%7 = alloca i32
%8 = alloca float
%9 = alloca float
store float %0, float* %3
store float %1, float* %4
%10 = load float, float* %4
%11 = load float, float* %3
%12 = fadd float %10, %11
store float %12, float* %5
store i32 5, i32* %6
%13 = load i32, i32* %6
%14 = call i32 @ipow(i32 10, i32 %13)
store i32 %14, i32* %7
%15 = call i32 (...) @rand()
%16 = load i32, i32* %7
%17 = srem i32 %15, %16
%18 = sitofp i32 %17 to float
%19 = load i32, i32* %7
%20 = sub nsw i32 %19, 1
%21 = sitofp i32 %20 to float
%22 = fdiv float %18, %21
store float %22, float* %8
%23 = load float, float* %8
%24 = load float, float* %5
%25 = load float, float* %3
%26 = call float @llvm.fmuladd.f32(float %23, float %24, float %25)
store float %26, float* %9
%27 = load float, float* %9
ret float %27
}

LLVM IR (-O2):
define float @frrand(float %0, float %1) {
%3 = fadd float %0, %1
%4 = tail call i32 @ipow(i32 10, i32 5)
%5 = tail call i32 (...) @rand()
%6 = srem i32 %5, %4
%7 = sitofp i32 %6 to float
%8 = add nsw i32 %4, -1
%9 = sitofp i32 %8 to float
%10 = fdiv float %7, %9
%11 = tail call float @llvm.fmuladd.f32(float %10, float %3, float %0)
ret float %11
}
void sysfs_remove_file_from_group(struct kobject *kobj,
                                  const struct attribute *attr,
                                  const char *group) {}


x86 assembly (clang, -O0):
<sysfs_remove_file_from_group>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.kobject = type opaque
%struct.attribute = type opaque
define void @sysfs_remove_file_from_group(%struct.kobject* %0, %struct.attribute* %1, i8* %2) {
%4 = alloca %struct.kobject*
%5 = alloca %struct.attribute*
%6 = alloca i8*
store %struct.kobject* %0, %struct.kobject** %4
store %struct.attribute* %1, %struct.attribute** %5
store i8* %2, i8** %6
ret void
}

LLVM IR (-O2):
%struct.kobject = type opaque
%struct.attribute = type opaque
define void @sysfs_remove_file_from_group(%struct.kobject* nocapture %0, %struct.attribute* nocapture %1, i8* nocapture %2) {
ret void
}
/* Type definitions */
struct feature_pair {
  int dummy;
};
struct CovariateAnalysis {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
void _emitJSONCovStatValue(const struct feature_pair *pair,
                           const struct CovariateAnalysis *covan, FILE *fp) {}


x86 assembly (clang, -O0):
<_emitJSONCovStatValue>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.feature_pair = type { i32 }
%struct.CovariateAnalysis = type { i32 }
define void @_emitJSONCovStatValue(%struct.feature_pair* %0, %struct.CovariateAnalysis* %1, i32* %2) {
%4 = alloca %struct.feature_pair*
%5 = alloca %struct.CovariateAnalysis*
%6 = alloca i32*
store %struct.feature_pair* %0, %struct.feature_pair** %4
store %struct.CovariateAnalysis* %1, %struct.CovariateAnalysis** %5
store i32* %2, i32** %6
ret void
}

LLVM IR (-O2):
%struct.feature_pair = type { i32 }
%struct.CovariateAnalysis = type { i32 }
define void @_emitJSONCovStatValue(%struct.feature_pair* nocapture %0, %struct.CovariateAnalysis* nocapture %1, i32* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HplMsp430GeneralIOP__45__IO__selectIOFunc();
void Msp430Adc12ImplP__Port65__selectIOFunc(void) {
  HplMsp430GeneralIOP__45__IO__selectIOFunc();
}


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

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

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

LLVM IR (-O2):
define void @Msp430Adc12ImplP__Port65__selectIOFunc() {
%1 = tail call i32 (...) @HplMsp430GeneralIOP__45__IO__selectIOFunc()
ret void
}
void test_isupper(void) {
  int i, j;
  for (i = -127; i < 256;)
    j = i, printf("%s: %d -> %d\n", __FUNCTION__, j, isupper(i++) ? 1 : 0);
}


x86 assembly (clang, -O0):
<test_isupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xffffff81,-0x4(%rbp)
cmpl   $0x100,-0x4(%rbp)
jge    1184 <test_isupper+0x64>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    %edi,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
call   1040 <isupper@plt>
mov    -0xc(%rbp),%edx
mov    %eax,%esi
xor    %ecx,%ecx
mov    $0x1,%eax
cmp    $0x0,%esi
cmovne %eax,%ecx
lea    0xe8f(%rip),%rdi
lea    0xe96(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    112f <test_isupper+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_isupper>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    $0xffffff81,%ebx
lea    0xecd(%rip),%r14
lea    0xed4(%rip),%r15
nopw   0x0(%rax,%rax,1)
lea    0x1(%rbx),%ebp
mov    %ebx,%edi
call   1040 <isupper@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    %r14,%rdi
mov    %r15,%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebp,%ebx
cmp    $0x100,%ebp
jne    1140 <test_isupper+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [14 x i8] c"%s: %d -> %d\0A\00"
@__FUNCTION__.test_isupper = [13 x i8] c"test_isupper\00"
define void @test_isupper() {
%1 = alloca i32
%2 = alloca i32
store i32 -127, i32* %1
br label %3
3: ; preds = %6, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 256
br i1 %5, label %6, label %16
6: ; preds = %3
%7 = load i32, i32* %1
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
%11 = call i32 @isupper(i32 %9)
%12 = icmp ne i32 %11, 0
%13 = zext i1 %12 to i64
%14 = select i1 %12, i32 1, i32 0
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.test_isupper, i64 0, i64 0), i32 %8, i32 %14)
br label %3
16: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"%s: %d -> %d\0A\00"
@__FUNCTION__.test_isupper = [13 x i8] c"test_isupper\00"
define void @test_isupper() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ -127, %0 ], [ %3, %1 ]
%3 = add nsw i32 %2, 1
%4 = tail call i32 @isupper(i32 %2)
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.test_isupper, i64 0, i64 0), i32 %2, i32 %6)
%8 = icmp eq i32 %3, 256
br i1 %8, label %9, label %1
9: ; preds = %1
ret void
}
/* Type definitions */
struct tcb {
  int dummy;
};

/* Variables and functions */
int printargs(struct tcb *);
int sys_lstat64(struct tcb *tcp) { return printargs(tcp); }


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

x86 assembly (clang, -O2):
<sys_lstat64>:
jmp    1030 <printargs@plt>

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

LLVM IR (-O2):
%struct.tcb = type { i32 }
define i32 @sys_lstat64(%struct.tcb* %0) {
%2 = tail call i32 @printargs(%struct.tcb* %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
int /*<<< orphan*/ radio_set_adv_tx_power(int /*<<< orphan*/);
void ll_set_adv_tx_power(int8_t pwr) { radio_set_adv_tx_power(pwr); }


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

x86 assembly (clang, -O2):
<ll_set_adv_tx_power>:
jmp    1030 <radio_set_adv_tx_power@plt>

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

LLVM IR (-O2):
define void @ll_set_adv_tx_power(i32 %0) {
%2 = tail call i32 @radio_set_adv_tx_power(i32 %0)
ret void
}
/* Type definitions */
typedef int dev_t;

/* Variables and functions */
int minor(dev_t dev) { return dev & 0xff; }


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

x86 assembly (clang, -O2):
<minor>:
movzbl %dil,%eax
ret

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

LLVM IR (-O2):
define i32 @minor(i32 %0) {
%2 = and i32 %0, 255
ret i32 %2
}
/* Variables and functions */
scalar_t__ less_than(int, int);
void l4_widened_no_overrun_Good_FP() {
  int a[10];
  for (int i = 0; less_than(i, 10); i++) {
    a[i] = 0;
  }
}


x86 assembly (clang, -O0):
<l4_widened_no_overrun_Good_FP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%edi
mov    $0xa,%esi
call   1030 <less_than@plt>
cmp    $0x0,%rax
je     1150 <l4_widened_no_overrun_Good_FP+0x40>
movslq -0x34(%rbp),%rax
movl   $0x0,-0x30(%rbp,%rax,4)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    111f <l4_widened_no_overrun_Good_FP+0xf>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<l4_widened_no_overrun_Good_FP>:
push   %rbx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%edi
mov    $0xa,%esi
call   1030 <less_than@plt>
add    $0x1,%ebx
test   %rax,%rax
jne    1120 <l4_widened_no_overrun_Good_FP+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @l4_widened_no_overrun_Good_FP() {
%1 = alloca [10 x i32]
%2 = alloca i32
store i32 0, i32* %2
br label %3
3: ; preds = %11, %0
%4 = load i32, i32* %2
%5 = call i64 @less_than(i32 %4, i32 10)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %14
7: ; preds = %3
%8 = load i32, i32* %2
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 %9
store i32 0, i32* %10
br label %11
11: ; preds = %7
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
br label %3
14: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @l4_widened_no_overrun_Good_FP() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 0, %0 ], [ %5, %1 ]
%3 = tail call i64 @less_than(i32 %2, i32 10)
%4 = icmp eq i64 %3, 0
%5 = add nuw nsw i32 %2, 1
br i1 %4, label %6, label %1
6: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ s2errb(int, int, float *, float *, float *, float *, int);
void s2errb_(int *dir, int *n, float *xpts, float *ypts, float *zpts,
             float *edelt, int *termsize) {
  s2errb(*dir, *n, xpts, ypts, zpts, edelt, *termsize);
}


x86 assembly (clang, -O0):
<s2errb_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
mov    0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,(%rsp)
call   1030 <s2errb@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s2errb_>:
push   %rax
mov    0x10(%rsp),%rax
mov    (%rdi),%edi
mov    (%rsi),%esi
mov    (%rax),%eax
mov    %eax,(%rsp)
call   1030 <s2errb@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @s2errb_(i32* %0, i32* %1, float* %2, float* %3, float* %4, float* %5, i32* %6) {
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca float*
%11 = alloca float*
%12 = alloca float*
%13 = alloca float*
%14 = alloca i32*
store i32* %0, i32** %8
store i32* %1, i32** %9
store float* %2, float** %10
store float* %3, float** %11
store float* %4, float** %12
store float* %5, float** %13
store i32* %6, i32** %14
%15 = load i32*, i32** %8
%16 = load i32, i32* %15
%17 = load i32*, i32** %9
%18 = load i32, i32* %17
%19 = load float*, float** %10
%20 = load float*, float** %11
%21 = load float*, float** %12
%22 = load float*, float** %13
%23 = load i32*, i32** %14
%24 = load i32, i32* %23
%25 = call i32 @s2errb(i32 %16, i32 %18, float* %19, float* %20, float* %21, float* %22, i32 %24)
ret void
}

LLVM IR (-O2):
define void @s2errb_(i32* nocapture %0, i32* nocapture %1, float* %2, float* %3, float* %4, float* %5, i32* nocapture %6) {
%8 = load i32, i32* %0
%9 = load i32, i32* %1
%10 = load i32, i32* %6
%11 = tail call i32 @s2errb(i32 %8, i32 %9, float* %2, float* %3, float* %4, float* %5, i32 %10)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
extern uint32_t cel_sdms_hash(const char *str) {
  register uint32_t h = 0;
  while (*str != '\0') {
    h = 65599 * h + (*str++);
  }
  return (h & 0x7FFFFFFF);
}


x86 assembly (clang, -O0):
<cel_sdms_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1142 <cel_sdms_hash+0x42>
imul   $0x1003f,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <cel_sdms_hash+0xf>
mov    -0xc(%rbp),%eax
and    $0x7fffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cel_sdms_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     112c <cel_sdms_hash+0x2c>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
imul   $0x1003f,%eax,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <cel_sdms_hash+0x10>
and    $0x7fffffff,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @cel_sdms_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %10, %4 ], [ %0, %1 ]
%8 = sext i8 %5 to i32
%9 = mul nsw i32 %6, 65599
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = add nsw i32 %9, %8
%12 = load i8, i8* %10
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = and i32 %11, 2147483647
br label %16
16: ; preds = %14, %1
%17 = phi i32 [ 0, %1 ], [ %15, %14 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ main_loop(int, char const **);
int main(int argc, const char *argv[]) {
  main_loop(argc, argv);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @main_loop(i32 %0, i8** %1)
ret i32 0
}
/* Variables and functions */
scalar_t__ I2C_setup();
int /*<<< orphan*/ VCNL4000_writeCmd(int, int);
void setupAmbientLight() {
  if (I2C_setup() < 0) {
    return;
  }
  VCNL4000_writeCmd(0x80 + 0x4, 1 << 7 | 1 << 3);
}


x86 assembly (clang, -O0):
<setupAmbientLight>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <I2C_setup@plt>
cmp    $0x0,%rax
jge    113a <setupAmbientLight+0x1a>
jmp    1149 <setupAmbientLight+0x29>
mov    $0x84,%edi
mov    $0x88,%esi
call   1030 <VCNL4000_writeCmd@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<setupAmbientLight>:
push   %rax
xor    %eax,%eax
call   1040 <I2C_setup@plt>
test   %rax,%rax
js     113d <setupAmbientLight+0x1d>
mov    $0x84,%edi
mov    $0x88,%esi
pop    %rax
jmp    1030 <VCNL4000_writeCmd@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @setupAmbientLight() {
%1 = call i64 (...) @I2C_setup()
%2 = icmp slt i64 %1, 0
br i1 %2, label %3, label %4
3: ; preds = %0
br label %6
4: ; preds = %0
%5 = call i32 @VCNL4000_writeCmd(i32 132, i32 136)
br label %6
6: ; preds = %4, %3
ret void
}

LLVM IR (-O2):
define void @setupAmbientLight() {
%1 = tail call i64 (...) @I2C_setup()
%2 = icmp slt i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @VCNL4000_writeCmd(i32 132, i32 136)
br label %5
5: ; preds = %0, %3
ret void
}
/* Type definitions */
struct timespec {
  int tv_sec;
  int tv_nsec;
};

/* Variables and functions */
unsigned long long llround(int);
unsigned long long timespec_to_usec_ull(struct timespec *ts) {
  return llround((ts->tv_sec * 1E9 + ts->tv_nsec) / 1000.0);
}


x86 assembly (clang, -O0):
<timespec_to_usec_ull>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cvtsi2sdl (%rax),%xmm0
mov    -0x8(%rbp),%rax
cvtsi2sdl 0x4(%rax),%xmm1
movsd  0xed3(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xebb(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <llround@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timespec_to_usec_ull>:
cvtsi2sdl (%rdi),%xmm0
cvtsi2sdl 0x4(%rdi),%xmm1
mulsd  0xedf(%rip),%xmm0
addsd  %xmm1,%xmm0
divsd  0xedb(%rip),%xmm0
cvttsd2si %xmm0,%edi
jmp    1030 <llround@plt>

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
define i64 @timespec_to_usec_ull(%struct.timespec* %0) {
%2 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %2
%3 = load %struct.timespec*, %struct.timespec** %2
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = sitofp i32 %5 to double
%7 = load %struct.timespec*, %struct.timespec** %2
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %7, i32 0, i32 1
%9 = load i32, i32* %8
%10 = sitofp i32 %9 to double
%11 = call double @llvm.fmuladd.f64(double %6, double 1.000000e+09, double %10)
%12 = fdiv double %11, 1.000000e+03
%13 = fptosi double %12 to i32
%14 = call i64 @llround(i32 %13)
ret i64 %14
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
define i64 @timespec_to_usec_ull(%struct.timespec* nocapture %0) {
%2 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%6 = load i32, i32* %5
%7 = sitofp i32 %6 to double
%8 = tail call double @llvm.fmuladd.f64(double %4, double 1.000000e+09, double %7)
%9 = fdiv double %8, 1.000000e+03
%10 = fptosi double %9 to i32
%11 = tail call i64 @llround(i32 %10)
ret i64 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  char array[5] = {'1', '2', '3', '3', '2'};
  int i, num = 0;
  for (i = 0; i < 5; i++) {
    int digit = 0;
    digit = array[i] - '0';
    num = num * 10 + digit;
  }
  printf("num=%d\n", num);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xedb(%rip),%eax
mov    %eax,-0x9(%rbp)
mov    0xed6(%rip),%al
mov    %al,-0x5(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x5,-0x10(%rbp)
jge    1177 <main+0x67>
movl   $0x0,-0x18(%rbp)
movslq -0x10(%rbp),%rax
movsbl -0x9(%rbp,%rax,1),%eax
sub    $0x30,%eax
mov    %eax,-0x18(%rbp)
imul   $0xa,-0x14(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    113f <main+0x2f>
mov    -0x14(%rbp),%esi
lea    0xe84(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.array = [5 x i8] c"12332"
@.str = [8 x i8] c"num=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i8]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = bitcast [5 x i8]* %2 to i8*
store i32 0, i32* %4
store i32 0, i32* %3
br label %7
7: ; preds = %21, %0
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 5
br i1 %9, label %10, label %24
10: ; preds = %7
store i32 0, i32* %5
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 %12
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = sub nsw i32 %15, 48
store i32 %16, i32* %5
%17 = load i32, i32* %4
%18 = mul nsw i32 %17, 10
%19 = load i32, i32* %5
%20 = add nsw i32 %18, %19
store i32 %20, i32* %4
br label %21
21: ; preds = %10
%22 = load i32, i32* %3
%23 = add nsw i32 %22, 1
store i32 %23, i32* %3
br label %7
24: ; preds = %7
%25 = load i32, i32* %4
%26 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %25)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"num=%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 12332)
ret i32 0
}
/* Type definitions */
typedef int __le16;

/* Variables and functions */
int cpu_to_le16(int);
int ieee80211_is_mgmt(__le16 fc) {
  return (fc & cpu_to_le16(0x000c)) == cpu_to_le16(0x0000);
}


x86 assembly (clang, -O0):
<ieee80211_is_mgmt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0xc,%edi
call   1030 <cpu_to_le16@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
and    %ecx,%eax
mov    %eax,-0x8(%rbp)
xor    %edi,%edi
call   1030 <cpu_to_le16@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ieee80211_is_mgmt>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0xc,%edi
call   1030 <cpu_to_le16@plt>
mov    %eax,%ebp
and    %ebx,%ebp
xor    %edi,%edi
call   1030 <cpu_to_le16@plt>
xor    %ecx,%ecx
cmp    %eax,%ebp
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ieee80211_is_mgmt(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @cpu_to_le16(i32 12)
%5 = and i32 %3, %4
%6 = call i32 @cpu_to_le16(i32 0)
%7 = icmp eq i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @ieee80211_is_mgmt(i32 %0) {
%2 = tail call i32 @cpu_to_le16(i32 12)
%3 = and i32 %2, %0
%4 = tail call i32 @cpu_to_le16(i32 0)
%5 = icmp eq i32 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ rb_arity_error_new(int, int, int);
int /*<<< orphan*/ rb_exc_raise(int /*<<< orphan*/);
void rb_error_arity(int argc, int min, int max) {
  rb_exc_raise(rb_arity_error_new(argc, min, max));
}


x86 assembly (clang, -O0):
<rb_error_arity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <rb_arity_error_new@plt>
mov    %eax,%edi
call   1040 <rb_exc_raise@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rb_error_arity>:
push   %rax
call   1030 <rb_arity_error_new@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <rb_exc_raise@plt>

LLVM IR (-O0):
define void @rb_error_arity(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @rb_arity_error_new(i32 %7, i32 %8, i32 %9)
%11 = call i32 @rb_exc_raise(i32 %10)
ret void
}

LLVM IR (-O2):
define void @rb_error_arity(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @rb_arity_error_new(i32 %0, i32 %1, i32 %2)
%5 = tail call i32 @rb_exc_raise(i32 %4)
ret void
}
/* Variables and functions */
bool is_escaped(char *string, int offset) {
  if (offset == 0) {
    return false;
  } else if (string[offset - 1] == '\\') {
    return !is_escaped(string, offset - 1);
  } else {
    return false;
  }
}


x86 assembly (clang, -O0):
<is_escaped>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1135 <is_escaped+0x25>
movl   $0x0,-0x4(%rbp)
jmp    117a <is_escaped+0x6a>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x5c,%eax
jne    1173 <is_escaped+0x63>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
sub    $0x1,%esi
call   1030 <is_escaped@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    117a <is_escaped+0x6a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_escaped>:
push   %rax
xor    %eax,%eax
test   %esi,%esi
je     1133 <is_escaped+0x23>
movslq %esi,%rsi
cmpb   $0x5c,-0x1(%rdi,%rsi,1)
jne    1133 <is_escaped+0x23>
add    $0xffffffffffffffff,%rsi
call   1030 <is_escaped@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @is_escaped(i8* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = add nsw i32 %1, -1
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 92
br i1 %9, label %12, label %10
10: ; preds = %2, %4, %12
%11 = phi i32 [ %15, %12 ], [ 0, %4 ], [ 0, %2 ]
ret i32 %11
12: ; preds = %4
%13 = tail call i32 @is_escaped(i8* %0, i32 %5)
%14 = icmp eq i32 %13, 0
%15 = zext i1 %14 to i32
br label %10
}
void smCallTraceStart() {}


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

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

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

LLVM IR (-O2):
define void @smCallTraceStart() {
ret void
}
/* Variables and functions */
float log(double);
int /*<<< orphan*/ printf(char *, float);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int x;
  float g;
  scanf("%d", &x);
  g = log((float)x) / log(2.0);
  printf("g = %f\n", g);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec2(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cvtsi2ssl -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
call   1050 <log@plt>
movss  %xmm0,-0x10(%rbp)
movsd  0xe96(%rip),%xmm0
call   1050 <log@plt>
movaps %xmm0,%xmm1
movss  -0x10(%rbp),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
lea    0xe7f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
cvtsi2ssl 0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
call   1050 <log@plt>
movss  %xmm0,(%rsp)
movsd  0xea2(%rip),%xmm0
call   1050 <log@plt>
movss  (%rsp),%xmm1
divss  %xmm0,%xmm1
lea    0xe98(%rip),%rdi
movaps %xmm1,%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [8 x i8] c"g = %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = sitofp i32 %5 to float
%7 = fpext float %6 to double
%8 = call float @log(double %7)
%9 = call float @log(double 2.000000e+00)
%10 = fdiv float %8, %9
store float %10, float* %3
%11 = load float, float* %3
%12 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), float %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [8 x i8] c"g = %f\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 float
%6 = fpext float %5 to double
%7 = call float @log(double %6)
%8 = call float @log(double 2.000000e+00)
%9 = fdiv float %7, %8
%10 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), float %9)
ret i32 0
}
/* Variables and functions */
scalar_t__ EOF;
scalar_t__ getchar();
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a = (getchar() != EOF);
  printf("%d", a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    0x2eab(%rip),%rcx
cmp    (%rcx),%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb9(%rip),%rcx
xor    %esi,%esi
cmp    (%rcx),%rax
setne  %sil
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@EOF = global i64 0
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i64 (...) @getchar()
%4 = load i64, i64* @EOF
%5 = icmp ne i64 %3, %4
%6 = zext i1 %5 to i32
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@EOF = global i64 0
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i64 (...) @getchar()
%2 = load i64, i64* @EOF
%3 = icmp ne i64 %1, %2
%4 = zext i1 %3 to i32
%5 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __environ;
int execve(char const *, char *const *, int /*<<< orphan*/);
int execv(__const char *path, char *__const argv[]) {
  return execve(path, argv, __environ);
}


x86 assembly (clang, -O0):
<execv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    0x2ec9(%rip),%rax
mov    (%rax),%edx
call   1030 <execve@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<execv>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%edx
jmp    1030 <execve@plt>

LLVM IR (-O0):
@__environ = global i32 0
define i32 @execv(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 = load i8**, i8*** %4
%7 = load i32, i32* @__environ
%8 = call i32 @execve(i8* %5, i8** %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
@__environ = global i32 0
define i32 @execv(i8* %0, i8** %1) {
%3 = load i32, i32* @__environ
%4 = tail call i32 @execve(i8* %0, i8** %1, i32 %3)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
void cleanup_fclose(FILE **stream) {
  if (*stream == NULL)
    return;
  fclose(*stream);
}


x86 assembly (clang, -O0):
<cleanup_fclose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
jne    112f <cleanup_fclose+0x1f>
jmp    113b <cleanup_fclose+0x2b>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleanup_fclose>:
mov    (%rdi),%rdi
test   %rdi,%rdi
je     111d <cleanup_fclose+0xd>
jmp    1030 <fclose@plt>
ret

LLVM IR (-O0):
define void @cleanup_fclose(i32** %0) {
%2 = alloca i32**
store i32** %0, i32*** %2
%3 = load i32**, i32*** %2
%4 = load i32*, i32** %3
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %7
6: ; preds = %1
br label %11
7: ; preds = %1
%8 = load i32**, i32*** %2
%9 = load i32*, i32** %8
%10 = call i32 @fclose(i32* %9)
br label %11
11: ; preds = %7, %6
ret void
}

LLVM IR (-O2):
define void @cleanup_fclose(i32** nocapture %0) {
%2 = load i32*, i32** %0
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fclose(i32* %2)
br label %6
6: ; preds = %1, %4
ret void
}
int local_f(void) { return 42; }


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

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

LLVM IR (-O0):
define i32 @local_f() {
ret i32 42
}

LLVM IR (-O2):
define i32 @local_f() {
ret i32 42
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("MBEDTLS_BIGNUM_C and/or MBEDTLS_CERTS_C and/or MBEDTLS_ENTROPY_C "
         "and/or MBEDTLS_SSL_TLS_C and/or MBEDTLS_SSL_SRV_C and/or "
         "MBEDTLS_NET_C and/or MBEDTLS_RSA_C and/or "
         "MBEDTLS_CTR_DRBG_C and/or MBEDTLS_X509_CRT_PARSE_C and/or "
         "MBEDTLS_THREADING_C and/or MBEDTLS_THREADING_PTHREAD "
         "and/or MBEDTLS_PEM_PARSE_C not defined.\n");
  return (0);
}


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

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

LLVM IR (-O0):
@.str = [316 x i8] c"MBEDTLS_BIGNUM_C and/or MBEDTLS_CERTS_C and/or MBEDTLS_ENTROPY_C and/or MBEDTLS_SSL_TLS_C and/or MBEDTLS_SSL_SRV_C and/or MBEDTLS_NET_C and/or MBEDTLS_RSA_C and/or MBEDTLS_CTR_DRBG_C and/or MBEDTLS_X509_CRT_PARSE_C and/or MBEDTLS_THREADING_C and/or MBEDTLS_THREADING_PTHREAD and/or MBEDTLS_PEM_PARSE_C not defined.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([316 x i8], [316 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [315 x i8] c"MBEDTLS_BIGNUM_C and/or MBEDTLS_CERTS_C and/or MBEDTLS_ENTROPY_C and/or MBEDTLS_SSL_TLS_C and/or MBEDTLS_SSL_SRV_C and/or MBEDTLS_NET_C and/or MBEDTLS_RSA_C and/or MBEDTLS_CTR_DRBG_C and/or MBEDTLS_X509_CRT_PARSE_C and/or MBEDTLS_THREADING_C and/or MBEDTLS_THREADING_PTHREAD and/or MBEDTLS_PEM_PARSE_C not defined.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([315 x i8], [315 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ssd1306_write_command(int);
void ssd1306_sleep_disable(void) { ssd1306_write_command(0xAF); }


x86 assembly (clang, -O0):
<ssd1306_sleep_disable>:
push   %rbp
mov    %rsp,%rbp
mov    $0xaf,%edi
call   1030 <ssd1306_write_command@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ssd1306_sleep_disable>:
mov    $0xaf,%edi
jmp    1030 <ssd1306_write_command@plt>

LLVM IR (-O0):
define void @ssd1306_sleep_disable() {
%1 = call i32 @ssd1306_write_command(i32 175)
ret void
}

LLVM IR (-O2):
define void @ssd1306_sleep_disable() {
%1 = tail call i32 @ssd1306_write_command(i32 175)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ platform_led_setup();
int /*<<< orphan*/ platform_systick_setup(int);
void setup() {
  platform_led_setup();
  platform_systick_setup(4000000);
}


x86 assembly (clang, -O0):
<setup>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <platform_led_setup@plt>
mov    $0x3d0900,%edi
call   1040 <platform_systick_setup@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<setup>:
push   %rax
xor    %eax,%eax
call   1030 <platform_led_setup@plt>
mov    $0x3d0900,%edi
pop    %rax
jmp    1040 <platform_systick_setup@plt>

LLVM IR (-O0):
define void @setup() {
%1 = call i32 (...) @platform_led_setup()
%2 = call i32 @platform_systick_setup(i32 4000000)
ret void
}

LLVM IR (-O2):
define void @setup() {
%1 = tail call i32 (...) @platform_led_setup()
%2 = tail call i32 @platform_systick_setup(i32 4000000)
ret void
}
int test_imm_35uint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x35 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_35uint64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
shr    $0x20,%rdx
and    $0x35,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_35uint64_highword_mem>:
testb  $0x35,0x4(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_35uint64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 32
%6 = and i64 %5, 53
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_35uint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 227633266688
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ PTHREAD_MUTEX_INITIALIZER;
int /*<<< orphan*/ pthread_mutex_lock(int /*<<< orphan*/ *);
void bar(void) {
  pthread_mutex_t mx = PTHREAD_MUTEX_INITIALIZER;
  pthread_mutex_lock(&mx);
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <pthread_mutex_lock@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <pthread_mutex_lock@plt>
pop    %rax
ret

LLVM IR (-O0):
@PTHREAD_MUTEX_INITIALIZER = global i32 0
define void @bar() {
%1 = alloca i32
%2 = load i32, i32* @PTHREAD_MUTEX_INITIALIZER
store i32 %2, i32* %1
%3 = call i32 @pthread_mutex_lock(i32* %1)
ret void
}

LLVM IR (-O2):
@PTHREAD_MUTEX_INITIALIZER = global i32 0
define void @bar() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = load i32, i32* @PTHREAD_MUTEX_INITIALIZER
store i32 %3, i32* %1
%4 = call i32 @pthread_mutex_lock(i32* %1)
ret void
}
unsigned int smartplugGet(void) { return -1; }


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

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

LLVM IR (-O0):
define i32 @smartplugGet() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @smartplugGet() {
ret i32 -1
}