xunge/DecIR huggingface dataset:
double finite_field_electric_field() { return 5.e-3; }


x86 assembly (clang, -O0):
<finite_field_electric_field>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<finite_field_electric_field>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @finite_field_electric_field() {
ret double 5.000000e-03
}

LLVM IR (-O2):
define double @finite_field_electric_field() {
ret double 5.000000e-03
}
void Calc_TrimWhiteSpace(char *input) { return; }


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

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

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

LLVM IR (-O2):
define void @Calc_TrimWhiteSpace(i8* nocapture %0) {
ret void
}
void gdk_text_property_to_text_list() {}


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

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

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

LLVM IR (-O2):
define void @gdk_text_property_to_text_list() {
ret void
}
void fc4b(x) _Atomic short x;
{}


x86 assembly (clang, -O0):
<fc4b>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @fc4b(i16 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ set_rounding(int /*<<< orphan*/ const *);
void div_s(const uint32_t *fcr31, const float *source1, const float *source2,
           float *target) {
  set_rounding(fcr31);
  *target = *source1 / *source2;
}


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

x86 assembly (clang, -O2):
<div_s>:
push   %r15
push   %r14
push   %rbx
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%rbx
call   1030 <set_rounding@plt>
movss  (%rbx),%xmm0
divss  (%r15),%xmm0
movss  %xmm0,(%r14)
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @div_s(i32* %0, float* nocapture %1, float* nocapture %2, float* nocapture writeonly %3) {
%5 = tail call i32 @set_rounding(i32* %0)
%6 = load float, float* %1
%7 = load float, float* %2
%8 = fdiv float %6, %7
store float %8, float* %3
ret void
}
/* Variables and functions */
int rand();
int prng(int min, int max) { return rand() % (max + 1 - min) + min; }


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

x86 assembly (clang, -O2):
<prng>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
sub    %ebp,%ebx
add    $0x1,%ebx
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @prng(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @rand()
%6 = load i32, i32* %4
%7 = add nsw i32 %6, 1
%8 = load i32, i32* %3
%9 = sub nsw i32 %7, %8
%10 = srem i32 %5, %9
%11 = load i32, i32* %3
%12 = add nsw i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @prng(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = sub i32 1, %0
%5 = add i32 %4, %1
%6 = srem i32 %3, %5
%7 = add nsw i32 %6, %0
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int fchflags(int fd, unsigned long int flags) {
  if (fd < 0) {
    __set_errno(EINVAL);
    return -1;
  }
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<fchflags>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1143 <fchflags+0x33>
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1158 <fchflags+0x48>
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fchflags>:
push   %rax
test   %edi,%edi
jns    111e <fchflags+0xe>
mov    0x2ebc(%rip),%rax
jmp    1125 <fchflags+0x15>
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@EINVAL = global i32 0
@ENOSYS = global i32 0
define i32 @fchflags(i32 %0, i64 %1) {
%3 = icmp slt i32 %0, 0
%4 = load i32, i32* @EINVAL
%5 = load i32, i32* @ENOSYS
%6 = select i1 %3, i32 %4, i32 %5
%7 = tail call i32 @__set_errno(i32 %6)
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ fetx_dealloc(void *const);
void fetx_dealloc_two(void *const a, void *const b) {
  fetx_dealloc(a);
  fetx_dealloc(b);
}


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

x86 assembly (clang, -O2):
<fetx_dealloc_two>:
push   %rbx
mov    %rsi,%rbx
call   1030 <fetx_dealloc@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fetx_dealloc@plt>

LLVM IR (-O0):
define void @fetx_dealloc_two(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 = call i32 @fetx_dealloc(i8* %5)
%7 = load i8*, i8** %4
%8 = call i32 @fetx_dealloc(i8* %7)
ret void
}

LLVM IR (-O2):
define void @fetx_dealloc_two(i8* %0, i8* %1) {
%3 = tail call i32 @fetx_dealloc(i8* %0)
%4 = tail call i32 @fetx_dealloc(i8* %1)
ret void
}
/* Variables and functions */
scalar_t__ gfx_test_timing_active();
scalar_t__ gfx_test_vertical_active();
int gfx_wait_vertical_blank(void) {
  if (gfx_test_timing_active()) {
    while (!gfx_test_vertical_active())
      ;
    while (gfx_test_vertical_active())
      ;
  }
  return (0);
}


x86 assembly (clang, -O0):
<gfx_wait_vertical_blank>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <gfx_test_timing_active@plt>
cmp    $0x0,%rax
je     117c <gfx_wait_vertical_blank+0x5c>
jmp    113a <gfx_wait_vertical_blank+0x1a>
mov    $0x0,%al
call   1040 <gfx_test_vertical_active@plt>
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1157 <gfx_wait_vertical_blank+0x37>
jmp    115c <gfx_wait_vertical_blank+0x3c>
jmp    113a <gfx_wait_vertical_blank+0x1a>
jmp    1161 <gfx_wait_vertical_blank+0x41>
mov    $0x0,%al
call   1040 <gfx_test_vertical_active@plt>
cmp    $0x0,%rax
je     1177 <gfx_wait_vertical_blank+0x57>
jmp    1161 <gfx_wait_vertical_blank+0x41>
jmp    117c <gfx_wait_vertical_blank+0x5c>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gfx_wait_vertical_blank>:
push   %rax
xor    %eax,%eax
call   1030 <gfx_test_timing_active@plt>
test   %rax,%rax
je     114c <gfx_wait_vertical_blank+0x2c>
nopl   (%rax)
xor    %eax,%eax
call   1040 <gfx_test_vertical_active@plt>
test   %rax,%rax
je     1130 <gfx_wait_vertical_blank+0x10>
nopl   0x0(%rax)
xor    %eax,%eax
call   1040 <gfx_test_vertical_active@plt>
test   %rax,%rax
jne    1140 <gfx_wait_vertical_blank+0x20>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @gfx_wait_vertical_blank() {
%1 = call i64 (...) @gfx_test_timing_active()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %15
3: ; preds = %0
br label %4
4: ; preds = %8, %3
%5 = call i64 (...) @gfx_test_vertical_active()
%6 = icmp ne i64 %5, 0
%7 = xor i1 %6, true
br i1 %7, label %8, label %9
8: ; preds = %4
br label %4
9: ; preds = %4
br label %10
10: ; preds = %13, %9
%11 = call i64 (...) @gfx_test_vertical_active()
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %10
br label %10
14: ; preds = %10
br label %15
15: ; preds = %14, %0
ret i32 0
}

LLVM IR (-O2):
define i32 @gfx_wait_vertical_blank() {
%1 = tail call i64 (...) @gfx_test_timing_active()
%2 = icmp eq i64 %1, 0
br i1 %2, label %9, label %3
3: ; preds = %0, %3
%4 = tail call i64 (...) @gfx_test_vertical_active()
%5 = icmp eq i64 %4, 0
br i1 %5, label %3, label %6
6: ; preds = %3, %6
%7 = tail call i64 (...) @gfx_test_vertical_active()
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %6
9: ; preds = %6, %0
ret i32 0
}
int test_imm_4Eint16_mem(short *val) {
  return ((*val) & (-0x4E << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_4Eint16_mem>:
movzwl (%rdi),%eax
test   $0xffb2,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_4Eint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, -78
%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_4Eint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -78
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void f5(_Complex float a) {}


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

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

LLVM IR (-O0):
define void @f5(<2 x float> %0) {
%2 = alloca { float, float }
%3 = bitcast { float, float }* %2 to <2 x float>*
store <2 x float> %0, <2 x float>* %3
ret void
}

LLVM IR (-O2):
define void @f5(<2 x float> %0) {
ret void
}
/* Variables and functions */
long double remquo(double, double, int *);
long double remquol(long double x, long double y, int *i) {
  return remquo((double)x, (double)y, i);
}


x86 assembly (clang, -O0):
<remquol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
mov    %rdi,-0x28(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
fldt   -0x20(%rbp)
fstpl  -0x30(%rbp)
movsd  -0x30(%rbp),%xmm1
mov    -0x28(%rbp),%rdi
call   1030 <remquo@plt>
fld    %st(0)
fstp   %st(0)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remquol>:
fldt   0x18(%rsp)
fldt   0x8(%rsp)
fstpl  -0x8(%rsp)
movsd  -0x8(%rsp),%xmm0
fstpl  -0x10(%rsp)
movsd  -0x10(%rsp),%xmm1
jmp    1030 <remquo@plt>

LLVM IR (-O0):
define x86_fp80 @remquol(x86_fp80 %0, x86_fp80 %1, i32* %2) {
%4 = alloca x86_fp80
%5 = alloca x86_fp80
%6 = alloca i32*
store x86_fp80 %0, x86_fp80* %4
store x86_fp80 %1, x86_fp80* %5
store i32* %2, i32** %6
%7 = load x86_fp80, x86_fp80* %4
%8 = fptrunc x86_fp80 %7 to double
%9 = load x86_fp80, x86_fp80* %5
%10 = fptrunc x86_fp80 %9 to double
%11 = load i32*, i32** %6
%12 = call x86_fp80 @remquo(double %8, double %10, i32* %11)
ret x86_fp80 %12
}

LLVM IR (-O2):
define x86_fp80 @remquol(x86_fp80 %0, x86_fp80 %1, i32* %2) {
%4 = fptrunc x86_fp80 %0 to double
%5 = fptrunc x86_fp80 %1 to double
%6 = tail call x86_fp80 @remquo(double %4, double %5, i32* %2)
ret x86_fp80 %6
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ dump_int_bits(int);
int main(int argc, char *argv[]) {
  int i = 100;
  if (argc > 1)
    i = atoi(argv[1]);
  dump_int_bits(i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x64,-0x14(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1157 <main+0x37>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <dump_int_bits@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %edi,%eax
mov    $0x64,%edi
cmp    $0x2,%eax
jl     1138 <main+0x18>
mov    0x8(%rsi),%rdi
call   1040 <atoi@plt>
mov    %eax,%edi
call   1030 <dump_int_bits@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**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 100, i32* %6
%7 = load i32, i32* %4
%8 = icmp sgt i32 %7, 1
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i32 @atoi(i8* %12)
store i32 %13, i32* %6
br label %14
14: ; preds = %9, %2
%15 = load i32, i32* %6
%16 = call i32 @dump_int_bits(i32 %15)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @atoi(i8* %6)
br label %8
8: ; preds = %4, %2
%9 = phi i32 [ %7, %4 ], [ 100, %2 ]
%10 = tail call i32 @dump_int_bits(i32 %9)
ret i32 0
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMR50_get(void) { return U_WMRCORENONE_get("U_WMRENDPAGE"); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"U_WMRENDPAGE\00"
define i32 @U_WMR50_get() {
%1 = call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [13 x i8] c"U_WMRENDPAGE\00"
define i32 @U_WMR50_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
float atan2f(float, float);
float gb_arctan2(float y, float x) { return atan2f(y, x); }


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

x86 assembly (clang, -O2):
<gb_arctan2>:
jmp    1030 <atan2f@plt>

LLVM IR (-O0):
define float @gb_arctan2(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call float @atan2f(float %5, float %6)
ret float %7
}

LLVM IR (-O2):
define float @gb_arctan2(float %0, float %1) {
%3 = tail call float @atan2f(float %0, float %1)
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ SOCK_STREAM;
int j_socket_connect(int /*<<< orphan*/, char *, char *);
int j_socket_tcp_connect(char *server, char *port) {
  return j_socket_connect(SOCK_STREAM, server, port);
}


x86 assembly (clang, -O0):
<j_socket_tcp_connect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <j_socket_connect@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<j_socket_tcp_connect>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
jmp    1030 <j_socket_connect@plt>

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

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

/* Variables and functions */
int fwrite(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *);
int LengthWrite(FILE *output, int64_t messageLength) {
  if (fwrite(&messageLength, sizeof(int64_t), 1, output) != 1) {
    printf("error on output writing\n");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<LengthWrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1040 <fwrite@plt>
cmp    $0x1,%eax
je     1167 <LengthWrite+0x47>
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    116e <LengthWrite+0x4e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LengthWrite>:
push   %rax
mov    %rdi,%rcx
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1040 <fwrite@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
je     1156 <LengthWrite+0x36>
lea    0xeb4(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"error on output writing\0A\00"
define i32 @LengthWrite(i32* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
%6 = load i32*, i32** %4
%7 = call i32 @fwrite(i32* %5, i32 4, i32 1, i32* %6)
%8 = icmp ne i32 %7, 1
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %12
11: ; preds = %2
store i32 0, i32* %3
br label %12
12: ; preds = %11, %9
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
@str = [24 x i8] c"error on output writing\00"
define i32 @LengthWrite(i32* nocapture %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i32 @fwrite(i32* %3, i32 4, i32 1, i32* %0)
%5 = icmp eq i32 %4, 1
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ -1, %6 ], [ 0, %2 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ ndsctl_action(char *, char *, char *);
void ndsctl_trust(void) {
  ndsctl_action("trust", "MAC %s trusted.\n", "Failed to trust MAC %s.\n");
}


x86 assembly (clang, -O0):
<ndsctl_trust>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee4(%rip),%rsi
lea    0xeee(%rip),%rdx
call   1030 <ndsctl_action@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ndsctl_trust>:
lea    0xee9(%rip),%rdi
lea    0xee8(%rip),%rsi
lea    0xef2(%rip),%rdx
jmp    1030 <ndsctl_action@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"trust\00"
@.str.1 = [17 x i8] c"MAC %s trusted.\0A\00"
@.str.2 = [25 x i8] c"Failed to trust MAC %s.\0A\00"
define void @ndsctl_trust() {
%1 = call i32 @ndsctl_action(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"trust\00"
@.str.1 = [17 x i8] c"MAC %s trusted.\0A\00"
@.str.2 = [25 x i8] c"Failed to trust MAC %s.\0A\00"
define void @ndsctl_trust() {
%1 = tail call i32 @ndsctl_action(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
ret void
}
int gtfract(anum, adenom, bnum, bdenom) {
  if ((anum * bdenom) > (bnum * adenom)) {
    return (1);
  } else {
    return (0);
  };
}


x86 assembly (clang, -O0):
<gtfract>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x14(%rbp),%eax
mov    -0x10(%rbp),%ecx
imul   -0xc(%rbp),%ecx
cmp    %ecx,%eax
jle    1132 <gtfract+0x32>
movl   $0x1,-0x4(%rbp)
jmp    1139 <gtfract+0x39>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gtfract>:
imul   %ecx,%edi
imul   %edx,%esi
xor    %eax,%eax
cmp    %esi,%edi
setg   %al
ret

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

LLVM IR (-O2):
define i32 @gtfract(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = mul nsw i32 %3, %0
%6 = mul nsw i32 %2, %1
%7 = icmp sgt i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
void v3f_(vec) float vec[3];
{ vcall(vec, 3); }


x86 assembly (clang, -O0):
<v3f_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x3,%esi
mov    $0x0,%al
call   1030 <vcall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<v3f_>:
mov    $0x3,%esi
xor    %eax,%eax
jmp    1030 <vcall@plt>

LLVM IR (-O0):
define void @v3f_(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = call i32 (float*, i32, ...) bitcast (i32 (...)* @vcall to i32 (float*, i32, ...)*)(float* %3, i32 3)
ret void
}

LLVM IR (-O2):
define void @v3f_(float* %0) {
%2 = tail call i32 (float*, i32, ...) bitcast (i32 (...)* @vcall to i32 (float*, i32, ...)*)(float* %0, i32 3)
ret void
}
void myHackFunction(int v) {}


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

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

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

LLVM IR (-O2):
define void @myHackFunction(i32 %0) {
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int send_event;
};
struct TYPE_4__ {
  TYPE_1__ xexpose;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xexpose_send_event(void *_p, int _v) {
  ((XEvent *)_p)->xexpose.send_event = (int)_v;
}


x86 assembly (clang, -O0):
<set_XEvent_xexpose_send_event>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XEvent_xexpose_send_event>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i32 }
define void @set_XEvent_xexpose_send_event(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i32 %5, i32* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xexpose_send_event(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
unsigned int
calcoloIntervalloMinimoFrequenza(unsigned int massimaFrequenzaCardiaca) {
  unsigned int intervalloMinimo;
  return intervalloMinimo = ((massimaFrequenzaCardiaca * 50) / 100);
}


x86 assembly (clang, -O0):
<calcoloIntervalloMinimoFrequenza>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x32,-0x4(%rbp),%eax
mov    $0x64,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcoloIntervalloMinimoFrequenza>:
imul   $0x32,%edi,%eax
imul   $0x51eb851f,%rax,%rax
shr    $0x25,%rax
ret

LLVM IR (-O0):
define i32 @calcoloIntervalloMinimoFrequenza(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = mul i32 %4, 50
%6 = udiv i32 %5, 100
store i32 %6, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @calcoloIntervalloMinimoFrequenza(i32 %0) {
%2 = mul i32 %0, 50
%3 = udiv i32 %2, 100
ret i32 %3
}
const char *RocksLogShorterFileName(const char *file) {
  return file +
         (sizeof("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                 "outputs/2022-01-22/02-19-57/repos/arangodb/arangodb/refs/"
                 "heads/devel/3rdParty/rocksdb/6.8/logging/logging.h") > 15
              ? sizeof(
                    "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                    "outputs/2022-01-22/02-19-57/repos/arangodb/arangodb/refs/"
                    "heads/devel/3rdParty/rocksdb/6.8/logging/logging.h") -
                    15
              : 0);
}


x86 assembly (clang, -O0):
<RocksLogShorterFileName>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x95,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RocksLogShorterFileName>:
lea    0x95(%rdi),%rax
ret

LLVM IR (-O0):
define i8* @RocksLogShorterFileName(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 149
ret i8* %4
}

LLVM IR (-O2):
define i8* @RocksLogShorterFileName(i8* readnone %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 149
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int /*<<< orphan*/ *opendir(char const *);
int /*<<< orphan*/ printf(char *);
DIR *ext_opendir(const char *path) {
  printf("Get DIR ...\n");
  if (path == NULL)
    return NULL;
  return opendir(path);
}


x86 assembly (clang, -O0):
<ext_opendir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xecd(%rip),%rdi
call   1040 <printf@plt>
cmpq   $0x0,-0x10(%rbp)
jne    1150 <ext_opendir+0x30>
movq   $0x0,-0x8(%rbp)
jmp    115d <ext_opendir+0x3d>
mov    -0x10(%rbp),%rdi
call   1030 <opendir@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ext_opendir>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
test   %rbx,%rbx
je     113e <ext_opendir+0x1e>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <opendir@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@str = [12 x i8] c"Get DIR ...\00"
define noalias i32* @ext_opendir(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%3 = icmp eq i8* %0, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32* @opendir(i8* %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32* [ %5, %4 ], [ null, %1 ]
ret i32* %7
}
/* Variables and functions */
int /*<<< orphan*/ gmx_polystat(int, char **);
int main(int argc, char *argv[]) {
  gmx_polystat(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 <gmx_polystat@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1030 <gmx_polystat@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 @gmx_polystat(i32 %6, i8** %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @gmx_polystat(i32 %0, i8** %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ mputchar(int /*<<< orphan*/);
void mputbytes(char *bytes, unsigned long len) {
  char *p = bytes;
  while (len--)
    mputchar(*p++);
  free(bytes);
}


x86 assembly (clang, -O0):
<mputbytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
cmp    $0x0,%rax
je     116d <mputbytes+0x4d>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movsbl (%rax),%edi
call   1040 <mputchar@plt>
jmp    1138 <mputbytes+0x18>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mputbytes>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %rsi,%rsi
je     1153 <mputbytes+0x33>
mov    %rsi,%r15
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%r14,%rbx,1),%edi
call   1040 <mputchar@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1140 <mputbytes+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @mputbytes(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %13, label %4
4: ; preds = %2, %4
%5 = phi i8* [ %8, %4 ], [ %0, %2 ]
%6 = phi i64 [ %7, %4 ], [ %1, %2 ]
%7 = add i64 %6, -1
%8 = getelementptr inbounds i8, i8* %5, i64 1
%9 = load i8, i8* %5
%10 = sext i8 %9 to i32
%11 = tail call i32 @mputchar(i32 %10)
%12 = icmp eq i64 %7, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %2
%14 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void *fun2(void *arg) {
  int d = (int)arg;
  d = d + 1;
  printf("in the fun 2 d = %d\n", d);
  return NULL;
}


x86 assembly (clang, -O0):
<fun2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun2>:
push   %rax
lea    0x1(%rdi),%esi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"in the fun 2 d = %d\0A\00"
define i8* @fun2(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i32
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = add nsw i32 %6, 1
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i8* null
}

LLVM IR (-O2):
@.str = [21 x i8] c"in the fun 2 d = %d\0A\00"
define noalias i8* @fun2(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = add nsw i32 %3, 1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i8* null
}
int _write(int fd, const void *buf, int count) { return -1; }


x86 assembly (clang, -O0):
<_write>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @_write(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
ret i32 -1
}

LLVM IR (-O2):
define i32 @_write(i32 %0, i8* nocapture readnone %1, i32 %2) {
ret i32 -1
}
void sig_hup(int _sig) { (void)_sig; }


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

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

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

LLVM IR (-O2):
define void @sig_hup(i32 %0) {
ret void
}
int is_hidden_object(const char *name) { return name[0] == '.'; }


x86 assembly (clang, -O0):
<is_hidden_object>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_hidden_object>:
xor    %eax,%eax
cmpb   $0x2e,(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @is_hidden_object(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 46
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @is_hidden_object(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 46
%4 = zext i1 %3 to i32
ret i32 %4
}
void foo163(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo163(i32 %0) {
ret void
}
/* Variables and functions */
unsigned int JSHash(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
unsigned int JSHash2(const void *data) {
  const char *str = data;
  return JSHash(str, strlen(str));
}


x86 assembly (clang, -O0):
<JSHash2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1040 <JSHash@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<JSHash2>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <JSHash@plt>

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

LLVM IR (-O2):
define i32 @JSHash2(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @JSHash(i8* %0, i32 %2)
ret i32 %3
}
void swap_my(int *first, int *second) {
  int temp = 0;
  temp = *first;
  *first = *second;
  *second = temp;
}


x86 assembly (clang, -O0):
<swap_my>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @swap_my(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
store i32 0, i32* %5
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @swap_my(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *gmtime_r(int /*<<< orphan*/ const *, struct tm *);
struct tm *gmtime(const time_t *timp) {
  static struct tm xtime;
  return gmtime_r(timp, &xtime);
}


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

x86 assembly (clang, -O2):
<gmtime>:
lea    0x2f15(%rip),%rsi
jmp    1030 <gmtime_r@plt>

LLVM IR (-O0):
%struct.tm = type { i32 }
@gmtime.xtime = internal global %struct.tm zeroinitializer
define %struct.tm* @gmtime(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call %struct.tm* @gmtime_r(i32* %3, %struct.tm* @gmtime.xtime)
ret %struct.tm* %4
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@gmtime.xtime = internal global %struct.tm zeroinitializer
define %struct.tm* @gmtime(i32* %0) {
%2 = tail call %struct.tm* @gmtime_r(i32* %0, %struct.tm* @gmtime.xtime)
ret %struct.tm* %2
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void delete_key(void *key) { free(key); }


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

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

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

LLVM IR (-O2):
define void @delete_key(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int baz(int *x) {
  int i;
  int *xx = __builtin_assume_aligned(x, 8);
  for (i = 0; i < 8; i++)
    xx[i] = xx[i] < 0 ? -1 : 0;
}


x86 assembly (clang, -O0):
<baz>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x8,-0x14(%rbp)
jge    1152 <baz+0x52>
mov    -0x20(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
xor    %edx,%edx
mov    $0xffffffff,%eax
cmp    $0x0,%ecx
cmovl  %eax,%edx
mov    -0x20(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1117 <baz+0x17>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<baz>:
movdqu (%rdi),%xmm0
movdqu 0x10(%rdi),%xmm1
psrad  $0x1f,%xmm0
movdqu %xmm0,(%rdi)
psrad  $0x1f,%xmm1
movdqu %xmm1,0x10(%rdi)
ret

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

LLVM IR (-O2):
define i32 @baz(i32* %0) {
%2 = bitcast i32* %0 to i8*
%3 = bitcast i32* %0 to <4 x i32>*
%4 = load <4 x i32>, <4 x i32>* %3
%5 = ashr <4 x i32> %4, <i32 31, i32 31, i32 31, i32 31>
%6 = bitcast i32* %0 to <4 x i32>*
store <4 x i32> %5, <4 x i32>* %6
%7 = getelementptr inbounds i32, i32* %0, i64 4
%8 = bitcast i32* %7 to <4 x i32>*
%9 = load <4 x i32>, <4 x i32>* %8
%10 = ashr <4 x i32> %9, <i32 31, i32 31, i32 31, i32 31>
%11 = bitcast i32* %7 to <4 x i32>*
store <4 x i32> %10, <4 x i32>* %11
ret i32 undef
}
int test_03(double a, double b) { return a >= b; }


x86 assembly (clang, -O0):
<test_03>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_03>:
xor    %eax,%eax
ucomisd %xmm1,%xmm0
setae  %al
ret

LLVM IR (-O0):
define i32 @test_03(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 = load double, double* %4
%7 = fcmp oge double %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_03(double %0, double %1) {
%3 = fcmp oge double %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
void bar(int i, int j) {
  while (i < j) {
    i = i + 1;
    j = j - 1;
  }
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    112d <bar+0x2d>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110a <bar+0xa>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @bar(i32 %0, i32 %1) {
ret void
}
int Operand_cimm8x4_encode(unsigned int *valp) {
  unsigned imm8_0, cimm8x4_0;
  cimm8x4_0 = *valp;
  imm8_0 = (cimm8x4_0 >> 2) & 0xff;
  *valp = imm8_0;
  return 0;
}


x86 assembly (clang, -O0):
<Operand_cimm8x4_encode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
shr    $0x2,%eax
and    $0xff,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Operand_cimm8x4_encode>:
mov    (%rdi),%eax
shr    $0x2,%eax
movzbl %al,%eax
mov    %eax,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @Operand_cimm8x4_encode(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = lshr i32 %7, 2
%9 = and i32 %8, 255
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = load i32*, i32** %2
store i32 %10, i32* %11
ret i32 0
}

LLVM IR (-O2):
define i32 @Operand_cimm8x4_encode(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = lshr i32 %2, 2
%4 = and i32 %3, 255
store i32 %4, i32* %0
ret i32 0
}
/* Variables and functions */
int left_child_index(int);
bool has_left_child(int size, int index) {
  return left_child_index(index) < size;
}


x86 assembly (clang, -O0):
<has_left_child>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <left_child_index@plt>
cmp    -0x4(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<has_left_child>:
push   %rbx
mov    %edi,%ebx
mov    %esi,%edi
call   1030 <left_child_index@plt>
xor    %ecx,%ecx
cmp    %ebx,%eax
setl   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @has_left_child(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @left_child_index(i32 %5)
%7 = load i32, i32* %3
%8 = icmp slt i32 %6, %7
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @has_left_child(i32 %0, i32 %1) {
%3 = tail call i32 @left_child_index(i32 %1)
%4 = icmp slt i32 %3, %0
%5 = zext i1 %4 to i32
ret i32 %5
}
int is_prime(int n) {
  int i;
  for (i = 2; i * i <= n; ++i)
    if (!n % i)
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<is_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1158 <is_prime+0x58>
cmpl   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
je     1145 <is_prime+0x45>
movl   $0x0,-0x4(%rbp)
jmp    115f <is_prime+0x5f>
jmp    114a <is_prime+0x4a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <is_prime+0xe>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_prime>:
xor    %r8d,%r8d
test   %edi,%edi
sete   %al
cmp    $0x4,%edi
jge    1113 <is_prime+0x13>
mov    $0x1,%eax
ret
mov    %al,%r8b
mov    $0x3,%ecx
xor    %esi,%esi
nopl   (%rax)
lea    -0x1(%rcx),%r9d
mov    %r8d,%eax
xor    %edx,%edx
div    %r9d
test   %edx,%edx
jne    1142 <is_prime+0x42>
mov    %ecx,%eax
imul   %ecx,%eax
add    $0x1,%ecx
cmp    %edi,%eax
jle    1120 <is_prime+0x20>
mov    $0x1,%eax
ret
mov    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @is_prime(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = zext i1 %2 to i32
%4 = icmp slt i32 %0, 4
br i1 %4, label %13, label %8
5: ; preds = %8
%6 = mul nsw i32 %12, %12
%7 = icmp sgt i32 %6, %0
br i1 %7, label %13, label %8
8: ; preds = %1, %5
%9 = phi i32 [ %12, %5 ], [ 2, %1 ]
%10 = urem i32 %3, %9
%11 = icmp eq i32 %10, 0
%12 = add nuw nsw i32 %9, 1
br i1 %11, label %5, label %13
13: ; preds = %8, %5, %1
%14 = phi i32 [ 1, %1 ], [ 1, %5 ], [ 0, %8 ]
ret i32 %14
}