xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print_Item(void *item) {
  if (item) {
    int *item_int = (int *)item;
    printf("%d ", *item_int);
  }
}


x86 assembly (clang, -O0):
<print_Item>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1141 <print_Item+0x31>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_Item>:
test   %rdi,%rdi
je     1123 <print_Item+0x13>
mov    (%rdi),%esi
lea    0xee2(%rip),%rdi
jmp    1030 <printf@plt>
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
define void @print_Item(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %3
%9 = load i32*, i32** %3
%10 = load i32, i32* %9
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
br label %12
12: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @print_Item(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = bitcast i8* %0 to i32*
%5 = load i32, i32* %4
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
br label %7
7: ; preds = %3, %1
ret void
}
void dummyvideo_ResizeVideoOutput(int width, int height) {}


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

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

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

LLVM IR (-O2):
define void @dummyvideo_ResizeVideoOutput(i32 %0, i32 %1) {
ret void
}
void __psslice(dps, dbl, sps, sbl, start, length) unsigned char *dps;
unsigned long dbl;
unsigned char *sps;
unsigned long sbl;
unsigned long start;
unsigned long length;
{ __pscpy(dps, dbl, (unsigned long)0, sps, sbl, start, length); }


x86 assembly (clang, -O0):
<__psslice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
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),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
mov    -0x30(%rbp),%rax
xor    %edx,%edx
mov    %rax,(%rsp)
mov    $0x0,%al
call   1030 <__pscpy@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__psslice>:
push   %rax
mov    %r8,%rax
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %r9,(%rsp)
xor    %edx,%edx
mov    %rax,%r9
xor    %eax,%eax
call   1030 <__pscpy@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @__psslice(i8* %0, i64 %1, i8* %2, i64 %3, i64 %4, i64 %5) {
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
store i8* %0, i8** %7
store i64 %1, i64* %8
store i8* %2, i8** %9
store i64 %3, i64* %10
store i64 %4, i64* %11
store i64 %5, i64* %12
%13 = load i8*, i8** %7
%14 = load i64, i64* %8
%15 = load i8*, i8** %9
%16 = load i64, i64* %10
%17 = load i64, i64* %11
%18 = load i64, i64* %12
%19 = call i32 (i8*, i64, i64, i8*, i64, i64, i64, ...) bitcast (i32 (...)* @__pscpy to i32 (i8*, i64, i64, i8*, i64, i64, i64, ...)*)(i8* %13, i64 %14, i64 0, i8* %15, i64 %16, i64 %17, i64 %18)
ret void
}

LLVM IR (-O2):
define void @__psslice(i8* %0, i64 %1, i8* %2, i64 %3, i64 %4, i64 %5) {
%7 = tail call i32 (i8*, i64, i64, i8*, i64, i64, i64, ...) bitcast (i32 (...)* @__pscpy to i32 (i8*, i64, i64, i8*, i64, i64, i64, ...)*)(i8* %0, i64 %1, i64 0, i8* %2, i64 %3, i64 %4, i64 %5)
ret void
}
/* Variables and functions */
int get_rand_int();
int get_rand_int_limit(int limit) { return get_rand_int() % limit; }


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

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

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

LLVM IR (-O2):
define i32 @get_rand_int_limit(i32 %0) {
%2 = tail call i32 (...) @get_rand_int()
%3 = srem i32 %2, %0
ret i32 %3
}
/* Variables and functions */
short barriereNatif16(short);
scalar_t__ systemeBigEndian();
short natif16VersLittle(short natif) {
  if (systemeBigEndian()) {
    return barriereNatif16(natif);
  } else {
    return natif;
  }
}


x86 assembly (clang, -O0):
<natif16VersLittle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <systemeBigEndian@plt>
cmp    $0x0,%rax
je     1152 <natif16VersLittle+0x32>
movswl -0x4(%rbp),%edi
call   1040 <barriereNatif16@plt>
mov    %ax,-0x2(%rbp)
jmp    115a <natif16VersLittle+0x3a>
mov    -0x4(%rbp),%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<natif16VersLittle>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <systemeBigEndian@plt>
test   %rax,%rax
je     1138 <natif16VersLittle+0x18>
movswl %bx,%edi
pop    %rbx
jmp    1040 <barriereNatif16@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i16 @natif16VersLittle(i16 signext %0) {
%2 = alloca i16
%3 = alloca i16
store i16 %0, i16* %3
%4 = call i64 (...) @systemeBigEndian()
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i16, i16* %3
%8 = call signext i16 @barriereNatif16(i16 signext %7)
store i16 %8, i16* %2
br label %11
9: ; preds = %1
%10 = load i16, i16* %3
store i16 %10, i16* %2
br label %11
11: ; preds = %9, %6
%12 = load i16, i16* %2
ret i16 %12
}

LLVM IR (-O2):
define signext i16 @natif16VersLittle(i16 signext %0) {
%2 = tail call i64 (...) @systemeBigEndian()
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call signext i16 @barriereNatif16(i16 signext %0)
br label %6
6: ; preds = %1, %4
%7 = phi i16 [ %5, %4 ], [ %0, %1 ]
ret i16 %7
}
/* Variables and functions */
int /*<<< orphan*/ cpc_key_press(int);
int /*<<< orphan*/ cpc_key_unpress(int);
void Joy_Alpha_Fire1(int value) {
  if (value) {
    cpc_key_press(0x94);
  } else {
    cpc_key_unpress(0x94);
  };
}


x86 assembly (clang, -O0):
<Joy_Alpha_Fire1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1144 <Joy_Alpha_Fire1+0x24>
mov    $0x94,%edi
call   1030 <cpc_key_press@plt>
jmp    114e <Joy_Alpha_Fire1+0x2e>
mov    $0x94,%edi
call   1040 <cpc_key_unpress@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Joy_Alpha_Fire1>:
test   %edi,%edi
je     112e <Joy_Alpha_Fire1+0xe>
mov    $0x94,%edi
jmp    1030 <cpc_key_press@plt>
mov    $0x94,%edi
jmp    1040 <cpc_key_unpress@plt>

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

LLVM IR (-O2):
define void @Joy_Alpha_Fire1(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @cpc_key_press(i32 148)
br label %7
5: ; preds = %1
%6 = tail call i32 @cpc_key_unpress(i32 148)
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
double cdfStandard(double);
double log(double);
double cdfLognormal(double a, double b, double x) {
  double t = (log(x) - a) / b;
  return (cdfStandard(t));
}


x86 assembly (clang, -O0):
<cdfLognormal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1040 <log@plt>
subsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1030 <cdfStandard@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cdfLognormal>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
movapd %xmm2,%xmm0
call   1040 <log@plt>
subsd  0x8(%rsp),%xmm0
divsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
jmp    1030 <cdfStandard@plt>

LLVM IR (-O0):
define double @cdfLognormal(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%8 = load double, double* %6
%9 = call double @log(double %8)
%10 = load double, double* %4
%11 = fsub double %9, %10
%12 = load double, double* %5
%13 = fdiv double %11, %12
store double %13, double* %7
%14 = load double, double* %7
%15 = call double @cdfStandard(double %14)
ret double %15
}

LLVM IR (-O2):
define double @cdfLognormal(double %0, double %1, double %2) {
%4 = tail call double @log(double %2)
%5 = fsub double %4, %0
%6 = fdiv double %5, %1
%7 = tail call double @cdfStandard(double %6)
ret double %7
}
/* Variables and functions */
float __nv_cyl_bessel_i0f(float);
float cyl_bessel_i0f(float __a) { return __nv_cyl_bessel_i0f(__a); }


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

x86 assembly (clang, -O2):
<cyl_bessel_i0f>:
jmp    1030 <__nv_cyl_bessel_i0f@plt>

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

LLVM IR (-O2):
define float @cyl_bessel_i0f(float %0) {
%2 = tail call float @__nv_cyl_bessel_i0f(float %0)
ret float %2
}
void null_process() {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<null_process>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <null_process+0x9>
jmp    1109 <null_process+0x9>

x86 assembly (clang, -O2):
<null_process>:
jmp    1100 <null_process>

LLVM IR (-O0):
define void @null_process() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @null_process() {
br label %1
1: ; preds = %0, %1
br label %1
}
double f4_cb_send_pre_int_int_int(double (*cb)(int, int, int)) {
  int r = 44;
  return cb(8, 9, r) + 1.0;
}


x86 assembly (clang, -O0):
<f4_cb_send_pre_int_int_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x2c,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%edx
mov    $0x8,%edi
mov    $0x9,%esi
call   *%rax
movsd  0xed2(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_cb_send_pre_int_int_int>:
push   %rax
mov    %rdi,%rax
mov    $0x8,%edi
mov    $0x9,%esi
mov    $0x2c,%edx
call   *%rax
addsd  0xee3(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @f4_cb_send_pre_int_int_int(double (i32, i32, i32)* %0) {
%2 = alloca double (i32, i32, i32)*
%3 = alloca i32
store double (i32, i32, i32)* %0, double (i32, i32, i32)** %2
store i32 44, i32* %3
%4 = load double (i32, i32, i32)*, double (i32, i32, i32)** %2
%5 = load i32, i32* %3
%6 = call double %4(i32 8, i32 9, i32 %5)
%7 = fadd double %6, 1.000000e+00
ret double %7
}

LLVM IR (-O2):
define double @f4_cb_send_pre_int_int_int(double (i32, i32, i32)* nocapture %0) {
%2 = tail call double %0(i32 8, i32 9, i32 44)
%3 = fadd double %2, 1.000000e+00
ret double %3
}
/* Variables and functions */
void *evaluator_derivative(void *, char *);
void *evaluator_derivative_x(void *evaluator) {
  return evaluator_derivative(evaluator, "x");
}


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

x86 assembly (clang, -O2):
<evaluator_derivative_x>:
lea    0xee9(%rip),%rsi
jmp    1030 <evaluator_derivative@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"x\00"
define i8* @evaluator_derivative_x(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @evaluator_derivative(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i8* %4
}

LLVM IR (-O2):
@.str = [2 x i8] c"x\00"
define i8* @evaluator_derivative_x(i8* %0) {
%2 = tail call i8* @evaluator_derivative(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
int main() {
  if (sizeof(long) == 4) {
    union {
      double d;
      unsigned long l[2];
    } x;
    x.d = 2.;
    if (x.l[0] == 0 && x.l[1] == (1UL << 30))
      printf("1\n");
    else if (x.l[1] == 0 && x.l[0] == (1UL << 30))
      printf("0\n");
    else
      printf("NOT IEEE (32 bit)\n");
  } else {
    union {
      double d;
      unsigned long l;
    } x;
    x.d = 2.;
    if (x.l == (1UL << 62))
      printf("-\n");
    else
      printf("NOT IEEE (64 bit)\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xed9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movabs $0x4000000000000000,%rax
cmp    %rax,-0x10(%rbp)
jne    1153 <main+0x43>
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1161 <main+0x51>
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
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):
%union.anon = type { double }
@.str = [3 x i8] c"-\0A\00"
@.str.1 = [19 x i8] c"NOT IEEE (64 bit)\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %union.anon
store i32 0, i32* %1
%3 = bitcast %union.anon* %2 to double*
store double 2.000000e+00, double* %3
%4 = bitcast %union.anon* %2 to i64*
%5 = load i64, i64* %4
%6 = icmp eq i64 %5, 4611686018427387904
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %11
9: ; preds = %0
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9, %7
ret i32 0
}

LLVM IR (-O2):
@str = [2 x i8] c"-\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
void *excl_dlcalloc(size_t, size_t);
void *calloc(size_t cnt, size_t sz) { return excl_dlcalloc(cnt, sz); }


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

x86 assembly (clang, -O2):
<calloc>:
jmp    1030 <excl_dlcalloc@plt>

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

LLVM IR (-O2):
define i8* @calloc(i64 %0, i64 %1) {
%3 = tail call i8* @excl_dlcalloc(i64 %0, i64 %1)
ret i8* %3
}
int bt_mesh_test(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @bt_mesh_test() {
ret i32 0
}
void foo092(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo092(i32 %0) {
ret void
}
void del_line(char *line) {
  int i;
  for (i = 0; line[i] != '\0'; ++i) {
    line[i] = '\0';
  }
}


x86 assembly (clang, -O0):
<del_line>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     113e <del_line+0x3e>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <del_line+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<del_line>:
cmpb   $0x0,(%rdi)
je     111d <del_line+0x1d>
add    $0x1,%rdi
nopl   0x0(%rax)
movb   $0x0,-0x1(%rdi)
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <del_line+0x10>
ret

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

LLVM IR (-O2):
define void @del_line(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
store i8 0, i8* %6
%7 = add nuw nsw i64 %5, 1
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
long long get_near_round_value(long long);
long long delta(long long size) {
  long long pow;
  pow = get_near_round_value(size);
  if (pow > size)
    return pow - size;
  else
    return size - pow;
}


x86 assembly (clang, -O0):
<delta>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <get_near_round_value@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jle    1148 <delta+0x38>
mov    -0x18(%rbp),%rax
sub    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1154 <delta+0x44>
mov    -0x10(%rbp),%rax
sub    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delta>:
push   %rbx
mov    %rdi,%rbx
call   1030 <get_near_round_value@plt>
mov    %rax,%rcx
sub    %rbx,%rcx
neg    %rcx
sub    %rbx,%rax
cmovle %rcx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @delta(i64 %0) {
%2 = tail call i64 @get_near_round_value(i64 %0)
%3 = icmp sgt i64 %2, %0
%4 = sub nsw i64 %2, %0
%5 = sub nsw i64 %0, %2
%6 = select i1 %3, i64 %4, i64 %5
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void f7(int a) { printf("Seu numero eh %d\n", a); }


x86 assembly (clang, -O0):
<f7>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f7>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"Seu numero eh %d\0A\00"
define void @f7(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"Seu numero eh %d\0A\00"
define void @f7(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ function_with_leak1();
void use_function_with_leak1() {
  function_with_leak1();
  int y = 0;
}


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

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

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

LLVM IR (-O2):
define void @use_function_with_leak1() {
%1 = tail call i32 (...) @function_with_leak1()
ret void
}
void stack_segment() {
  __asm__ __volatile__("cli");
  SetTextColor(0x04 | 0x08, 0x00);
  kprintf("\nERROR: stack_segment\n");
  do {
    __asm__ __volatile__("cli  \n\t"
                         "hlt");
  } while (1 == 1);
}


x86 assembly (clang, -O0):
<stack_segment>:
push   %rbp
mov    %rsp,%rbp
cli
mov    $0xc,%edi
xor    %esi,%esi
mov    $0x0,%al
call   1030 <SetTextColor@plt>
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1040 <kprintf@plt>
cli
hlt
mov    $0x1,%al
test   $0x1,%al
jne    1141 <stack_segment+0x21>
jmp    1152 <stack_segment+0x32>
pop    %rbp
ret

x86 assembly (clang, -O2):
<stack_segment>:
push   %rax
cli
mov    $0xc,%edi
xor    %esi,%esi
xor    %eax,%eax
call   1030 <SetTextColor@plt>
lea    0xec9(%rip),%rdi
xor    %eax,%eax
call   1040 <kprintf@plt>
xchg   %ax,%ax
cli
hlt
jmp    1140 <stack_segment+0x20>

LLVM IR (-O0):
@.str = [23 x i8] c"\0AERROR: stack_segment\0A\00"
define void @stack_segment() {
%1 = call i32 (i32, i32, ...) bitcast (i32 (...)* @SetTextColor to i32 (i32, i32, ...)*)(i32 12, i32 0)
%2 = call i32 (i8*, ...) bitcast (i32 (...)* @kprintf to i32 (i8*, ...)*)(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %3
3: ; preds = %4, %0
br label %4
4: ; preds = %3
br i1 true, label %3, label %5
5: ; preds = %4
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"\0AERROR: stack_segment\0A\00"
define void @stack_segment() {
tail call void asm sideeffect "cli", "~{dirflag},~{fpsr},~{flags}"()
%1 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @SetTextColor to i32 (i32, i32, ...)*)(i32 12, i32 0)
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @kprintf to i32 (i8*, ...)*)(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %3
3: ; preds = %3, %0
tail call void asm sideeffect "cli \0A\09hlt", "~{dirflag},~{fpsr},~{flags}"()
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ doPutch(char);
void putch(char ch) {
  if (ch == '\n')
    doPutch('\r');
  doPutch(ch);
}


x86 assembly (clang, -O0):
<putch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
jne    1135 <putch+0x25>
mov    $0xd,%edi
call   1030 <doPutch@plt>
movsbl -0x1(%rbp),%edi
call   1030 <doPutch@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putch>:
push   %rbx
mov    %edi,%ebx
cmp    $0xa,%bl
jne    1122 <putch+0x12>
mov    $0xd,%edi
call   1030 <doPutch@plt>
movsbl %bl,%edi
pop    %rbx
jmp    1030 <doPutch@plt>

LLVM IR (-O0):
define void @putch(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 10
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @doPutch(i8 signext 13)
br label %8
8: ; preds = %6, %1
%9 = load i8, i8* %2
%10 = call i32 @doPutch(i8 signext %9)
ret void
}

LLVM IR (-O2):
define void @putch(i8 signext %0) {
%2 = icmp eq i8 %0, 10
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @doPutch(i8 signext 13)
br label %5
5: ; preds = %3, %1
%6 = tail call i32 @doPutch(i8 signext %0)
ret void
}
/* Type definitions */
struct tpacket_hdr {
  int tp_status;
};

/* Variables and functions */
int TP_STATUS_USER;
int __v1_rx_kernel_ready(struct tpacket_hdr *hdr) {
  return ((hdr->tp_status & TP_STATUS_USER) == TP_STATUS_USER);
}


x86 assembly (clang, -O0):
<__v1_rx_kernel_ready>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    0x2ed3(%rip),%rcx
and    (%rcx),%eax
mov    0x2eca(%rip),%rcx
cmp    (%rcx),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__v1_rx_kernel_ready>:
mov    (%rdi),%ecx
mov    0x2edf(%rip),%rdx
not    %ecx
xor    %eax,%eax
test   %ecx,(%rdx)
sete   %al
ret

LLVM IR (-O0):
%struct.tpacket_hdr = type { i32 }
@TP_STATUS_USER = global i32 0
define i32 @__v1_rx_kernel_ready(%struct.tpacket_hdr* %0) {
%2 = alloca %struct.tpacket_hdr*
store %struct.tpacket_hdr* %0, %struct.tpacket_hdr** %2
%3 = load %struct.tpacket_hdr*, %struct.tpacket_hdr** %2
%4 = getelementptr inbounds %struct.tpacket_hdr, %struct.tpacket_hdr* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = load i32, i32* @TP_STATUS_USER
%7 = and i32 %5, %6
%8 = load i32, i32* @TP_STATUS_USER
%9 = icmp eq i32 %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
%struct.tpacket_hdr = type { i32 }
@TP_STATUS_USER = global i32 0
define i32 @__v1_rx_kernel_ready(%struct.tpacket_hdr* nocapture %0) {
%2 = getelementptr inbounds %struct.tpacket_hdr, %struct.tpacket_hdr* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = load i32, i32* @TP_STATUS_USER
%5 = and i32 %4, %3
%6 = icmp eq i32 %5, %4
%7 = zext i1 %6 to i32
ret i32 %7
}
int RAND_status(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @RAND_status() {
ret i32 1
}
int test_imm_43uint8_mem(unsigned char *val) {
  return ((*val) & (0x43 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_43uint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0x43,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_43uint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, 67
%7 = icmp ne i32 %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_43uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 67
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int celcon_solve_dobldobl_start_system(int k, int *mv) {
  int fail;
  double *c;
  fail = _ada_use_c2phc(466, &k, mv, c);
  return fail;
}


x86 assembly (clang, -O0):
<celcon_solve_dobldobl_start_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x1d2,%edi
lea    -0x4(%rbp),%rsi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<celcon_solve_dobldobl_start_system>:
push   %rax
mov    %rsi,%rdx
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x1d2,%edi
call   1030 <_ada_use_c2phc@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @celcon_solve_dobldobl_start_system(i32 %0, i32* %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @_ada_use_c2phc(i32 466, i32* %3, i32* %1, double* undef)
ret i32 %4
}
void newlinespec2newlinespec_unit() {}


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

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

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

LLVM IR (-O2):
define void @newlinespec2newlinespec_unit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double, double);
void back_square(double x, double y) {
  printf("        <rect x=\"%.2fin\" y=\"%.2fin\" width=\"0.17in\" "
         "height=\"0.25in\" fill=\"#ffffff\" />\n",
         x + 0.2, y + 0.7);
}


x86 assembly (clang, -O0):
<back_square>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xede(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  0xec9(%rip),%xmm1
addsd  -0x10(%rbp),%xmm1
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<back_square>:
addsd  0xee8(%rip),%xmm0
addsd  0xee8(%rip),%xmm1
lea    0xee9(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [86 x i8] c" <rect x=\22%.2fin\22 y=\22%.2fin\22 width=\220.17in\22 height=\220.25in\22 fill=\22#ffffff\22 />\0A\00"
define void @back_square(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = fadd double %5, 2.000000e-01
%7 = load double, double* %4
%8 = fadd double %7, 0x3FE6666666666666
%9 = call i32 @printf(i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str, i64 0, i64 0), double %6, double %8)
ret void
}

LLVM IR (-O2):
@.str = [86 x i8] c" <rect x=\22%.2fin\22 y=\22%.2fin\22 width=\220.17in\22 height=\220.25in\22 fill=\22#ffffff\22 />\0A\00"
define void @back_square(double %0, double %1) {
%3 = fadd double %0, 2.000000e-01
%4 = fadd double %1, 0x3FE6666666666666
%5 = tail call i32 @printf(i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str, i64 0, i64 0), double %3, double %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void main() {
  enum sz { one, two, three = 1, four, five = 0 } a, b, c;
  a = four;
  printf("%d", a);
}


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

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rdi
mov    $0x2,%esi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
ret void
}
void handle_PWR(int sig) {}


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

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

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

LLVM IR (-O2):
define void @handle_PWR(i32 %0) {
ret void
}
/* Type definitions */
struct tm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ asctime(struct tm *);
void nullPointer_asctime(void) {
  struct tm *tm = 0;
  (void)asctime(tm);
  (void)asctime(0);
}


x86 assembly (clang, -O0):
<nullPointer_asctime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <asctime@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <asctime@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nullPointer_asctime>:
push   %rax
xor    %edi,%edi
call   1030 <asctime@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <asctime@plt>

LLVM IR (-O0):
%struct.tm = type { i32 }
define void @nullPointer_asctime() {
%1 = alloca %struct.tm*
store %struct.tm* null, %struct.tm** %1
%2 = load %struct.tm*, %struct.tm** %1
%3 = call i32 @asctime(%struct.tm* %2)
%4 = call i32 @asctime(%struct.tm* null)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define void @nullPointer_asctime() {
%1 = tail call i32 @asctime(%struct.tm* null)
%2 = tail call i32 @asctime(%struct.tm* null)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, int);
int pthread_create(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                   void *(*)(void *), void *);
void d_create(pthread_t *thread, void *(*start_routine)(void *), void *arg) {
  int rv = pthread_create(thread, NULL, start_routine, arg);
  if (rv != 0) {
    printf("error: pthread_create == %d\n", rv);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<d_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%esi
call   1040 <pthread_create@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     117f <d_create+0x4f>
mov    -0x1c(%rbp),%esi
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_create>:
push   %rax
mov    %rdx,%rcx
mov    %rsi,%rdx
xor    %esi,%esi
call   1040 <pthread_create@plt>
test   %eax,%eax
jne    1144 <d_create+0x14>
pop    %rax
ret
lea    0xeb5(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@.str = [29 x i8] c"error: pthread_create == %d\0A\00"
define void @d_create(i32* %0, i8* (i8*)* %1, i8* %2) {
%4 = tail call i32 @pthread_create(i32* %0, i32* null, i8* (i8*)* %1, i8* %2)
%5 = icmp eq i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %4)
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %3
ret void
}
void foo605(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo605(i32 %0) {
ret void
}
int get_cpu(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @get_cpu() {
ret i32 0
}
int blog(base, m)
int base, m;
{
  int i, exp;
  exp = base;
  m = m + m / 2;
  for (i = 1; exp < m; i++)
    exp = exp * base;
  return (i);
}


x86 assembly (clang, -O0):
<blog>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1156 <blog+0x56>
mov    -0x10(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1132 <blog+0x32>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<blog>:
mov    %esi,%ecx
shr    $0x1f,%ecx
add    %esi,%ecx
sar    %ecx
add    %esi,%ecx
mov    $0x1,%eax
cmp    %edi,%ecx
jle    112a <blog+0x2a>
mov    $0x1,%eax
mov    %edi,%edx
nopl   0x0(%rax,%rax,1)
imul   %edi,%edx
add    $0x1,%eax
cmp    %ecx,%edx
jl     1120 <blog+0x20>
ret

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

LLVM IR (-O2):
define i32 @blog(i32 %0, i32 %1) {
%3 = sdiv i32 %1, 2
%4 = add nsw i32 %3, %1
%5 = icmp sgt i32 %4, %0
br i1 %5, label %6, label %12
6: ; preds = %2, %6
%7 = phi i32 [ %9, %6 ], [ %0, %2 ]
%8 = phi i32 [ %10, %6 ], [ 1, %2 ]
%9 = mul nsw i32 %7, %0
%10 = add nuw nsw i32 %8, 1
%11 = icmp slt i32 %9, %4
br i1 %11, label %6, label %12
12: ; preds = %6, %2
%13 = phi i32 [ 1, %2 ], [ %10, %6 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ write_line(char *);
void ipf_toc_start(void) { write_line(":lines align=left."); }


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

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

LLVM IR (-O0):
@.str = [19 x i8] c":lines align=left.\00"
define void @ipf_toc_start() {
%1 = call i32 @write_line(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c":lines align=left.\00"
define void @ipf_toc_start() {
%1 = tail call i32 @write_line(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}
unsigned short gp2x_video_RGB_color15(int R, int G, int B, int A) {
  return ((((R)&0xF8) << 8) | (((G)&0xF8) << 3) | (((B)&0xF8) >> 3) |
          ((A) << 5));
}


x86 assembly (clang, -O0):
<gp2x_video_RGB_color15>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf8,%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%ecx
and    $0xf8,%ecx
shl    $0x3,%ecx
or     %ecx,%eax
mov    -0xc(%rbp),%ecx
and    $0xf8,%ecx
sar    $0x3,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
shl    $0x5,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gp2x_video_RGB_color15>:
shl    $0x8,%edi
and    $0xf800,%edi
and    $0xf8,%esi
lea    (%rdi,%rsi,8),%eax
shr    $0x3,%edx
and    $0x1f,%edx
or     %edx,%eax
shl    $0x5,%ecx
or     %ecx,%eax
ret

LLVM IR (-O0):
define zeroext i16 @gp2x_video_RGB_color15(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 = load i32, i32* %5
%10 = and i32 %9, 248
%11 = shl i32 %10, 8
%12 = load i32, i32* %6
%13 = and i32 %12, 248
%14 = shl i32 %13, 3
%15 = or i32 %11, %14
%16 = load i32, i32* %7
%17 = and i32 %16, 248
%18 = ashr i32 %17, 3
%19 = or i32 %15, %18
%20 = load i32, i32* %8
%21 = shl i32 %20, 5
%22 = or i32 %19, %21
%23 = trunc i32 %22 to i16
ret i16 %23
}

LLVM IR (-O2):
define zeroext i16 @gp2x_video_RGB_color15(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = shl i32 %0, 8
%6 = and i32 %5, 63488
%7 = shl i32 %1, 3
%8 = and i32 %7, 1984
%9 = or i32 %8, %6
%10 = lshr i32 %2, 3
%11 = and i32 %10, 31
%12 = or i32 %9, %11
%13 = shl i32 %3, 5
%14 = or i32 %12, %13
%15 = trunc i32 %14 to i16
ret i16 %15
}
void jnz(int *op1, int *op2, unsigned int *pc) {
  if (*op1 != 0)
    *pc += *op2;
  else
    (*pc)++;
}


x86 assembly (clang, -O0):
<jnz>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
je     1130 <jnz+0x30>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%rax
add    (%rax),%ecx
mov    %ecx,(%rax)
jmp    113b <jnz+0x3b>
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<jnz>:
cmpl   $0x0,(%rdi)
je     110a <jnz+0xa>
mov    (%rsi),%eax
add    %eax,(%rdx)
ret
mov    $0x1,%eax
add    %eax,(%rdx)
ret

LLVM IR (-O0):
define void @jnz(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* %7
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %16
10: ; preds = %3
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
%13 = load i32*, i32** %6
%14 = load i32, i32* %13
%15 = add i32 %14, %12
store i32 %15, i32* %13
br label %20
16: ; preds = %3
%17 = load i32*, i32** %6
%18 = load i32, i32* %17
%19 = add i32 %18, 1
store i32 %19, i32* %17
br label %20
20: ; preds = %16, %10
ret void
}

LLVM IR (-O2):
define void @jnz(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2) {
%4 = load i32, i32* %0
%5 = icmp eq i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = load i32, i32* %1
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ %7, %6 ], [ 1, %3 ]
%10 = load i32, i32* %2
%11 = add i32 %10, %9
store i32 %11, i32* %2
ret void
}
/* Type definitions */
struct timeval {
  double tv_sec;
  scalar_t__ tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double getTime(void) {
  struct timeval tp;
  gettimeofday(&tp, NULL);
  return (tp.tv_sec + (double)tp.tv_usec / 1000000.0);
}


x86 assembly (clang, -O0):
<getTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
movsd  -0x10(%rbp),%xmm0
cvtsi2sdq -0x8(%rbp),%xmm1
movsd  0xec8(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getTime>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x10(%rsp),%xmm0
divsd  0xed1(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, i64 }
define double @getTime() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load double, double* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%6 = load i64, i64* %5
%7 = sitofp i64 %6 to double
%8 = fdiv double %7, 1.000000e+06
%9 = fadd double %4, %8
ret double %9
}

LLVM IR (-O2):
%struct.timeval = type { double, i64 }
define double @getTime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load double, double* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = fdiv double %8, 1.000000e+06
%10 = fadd double %5, %9
ret double %10
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int quot;
  int rem;
};
typedef TYPE_1__ div_t;

/* Variables and functions */
div_t div(int n, int d) {
  div_t retval;
  retval.quot = n / d;
  retval.rem = n % d;
  return retval;
}


x86 assembly (clang, -O0):
<div>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cltd
idivl  -0x10(%rbp)
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
cltd
idivl  -0x10(%rbp)
mov    %edx,-0x4(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<div>:
mov    %edi,%eax
cltd
idiv   %esi
shl    $0x20,%rdx
or     %rdx,%rax
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32, i32 }
define i64 @div(i32 %0, i32 %1) {
%3 = alloca %struct.TYPE_3__
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = sdiv i32 %6, %7
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 0
store i32 %8, i32* %9
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = srem i32 %10, %11
%13 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 1
store i32 %12, i32* %13
%14 = bitcast %struct.TYPE_3__* %3 to i64*
%15 = load i64, i64* %14
ret i64 %15
}

LLVM IR (-O2):
define i64 @div(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
%4 = srem i32 %0, %1
%5 = zext i32 %4 to i64
%6 = shl nuw i64 %5, 32
%7 = zext i32 %3 to i64
%8 = or i64 %6, %7
ret i64 %8
}
unsigned int bit_clz(unsigned int v) { return __builtin_clz(v); }


x86 assembly (clang, -O0):
<bit_clz>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
bsr    %eax,%eax
xor    $0x1f,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_clz>:
bsr    %edi,%eax
xor    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @bit_clz(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @llvm.ctlz.i32(i32 %3, i1 true)
ret i32 %4
}

LLVM IR (-O2):
define i32 @bit_clz(i32 %0) {
%2 = tail call i32 @llvm.ctlz.i32(i32 %0, i1 true)
ret i32 %2
}