xunge/DecIR huggingface dataset:
char *ft_strchr(char *str, int c) {
  int i;
  i = -1;
  while (*(str + (++i)) && *(str + i) != c) {
  }
  return (str + i);
}


x86 assembly (clang, -O0):
<ft_strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0xffffffff,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x10(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1149 <ft_strchr+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    -0xc(%rbp),%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1159 <ft_strchr+0x59>
jmp    115e <ft_strchr+0x5e>
jmp    1112 <ft_strchr+0x12>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strchr>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
movsbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %ecx,%ecx
je     1120 <ft_strchr+0x20>
cmp    %esi,%ecx
jne    1110 <ft_strchr+0x10>
ret

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

LLVM IR (-O2):
define i8* @ft_strchr(i8* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %5, %3 ], [ -1, %2 ]
%5 = add nsw i64 %4, 1
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
%9 = sext i8 %7 to i32
%10 = icmp eq i32 %9, %1
%11 = or i1 %8, %10
br i1 %11, label %12, label %3
12: ; preds = %3
%13 = getelementptr inbounds i8, i8* %0, i64 %5
ret i8* %13
}
/* Variables and functions */
int /*<<< orphan*/ imprimeIN(int);
void imprimeOUT(int e) { imprimeIN(e); }


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

x86 assembly (clang, -O2):
<imprimeOUT>:
jmp    1030 <imprimeIN@plt>

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

LLVM IR (-O2):
define void @imprimeOUT(i32 %0) {
%2 = tail call i32 @imprimeIN(i32 %0)
ret void
}
float interpolateLinear(float *data, double address, long arraysize) {
  long pos = (long)address;
  float posFract = (float)(address - (double)pos);
  return (data[pos] * (1.0f - posFract)) +
         (data[(pos + 1) % arraysize] * posFract);
}


x86 assembly (clang, -O0):
<interpolateLinear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cvttsd2si -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
cvtsi2sdq -0x20(%rbp),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x24(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
movss  0xeb8(%rip),%xmm2
subss  -0x24(%rbp),%xmm2
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
cqto
idivq  -0x18(%rbp)
mov    -0x30(%rbp),%rax
movss  (%rax,%rdx,4),%xmm1
mulss  -0x24(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<interpolateLinear>:
cvttsd2si %xmm0,%rax
cvtsi2sd %rax,%xmm1
subsd  %xmm1,%xmm0
xorps  %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm1
movss  (%rdi,%rax,4),%xmm0
movss  0xede(%rip),%xmm2
subss  %xmm1,%xmm2
add    $0x1,%rax
mov    %rax,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     113d <interpolateLinear+0x3d>
cqto
idiv   %rsi
jmp    1141 <interpolateLinear+0x41>
xor    %edx,%edx
div    %esi
mulss  (%rdi,%rdx,4),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @interpolateLinear(float* %0, double %1, i64 %2) {
%4 = alloca float*
%5 = alloca double
%6 = alloca i64
%7 = alloca i64
%8 = alloca float
store float* %0, float** %4
store double %1, double* %5
store i64 %2, i64* %6
%9 = load double, double* %5
%10 = fptosi double %9 to i64
store i64 %10, i64* %7
%11 = load double, double* %5
%12 = load i64, i64* %7
%13 = sitofp i64 %12 to double
%14 = fsub double %11, %13
%15 = fptrunc double %14 to float
store float %15, float* %8
%16 = load float*, float** %4
%17 = load i64, i64* %7
%18 = getelementptr inbounds float, float* %16, i64 %17
%19 = load float, float* %18
%20 = load float, float* %8
%21 = fsub float 1.000000e+00, %20
%22 = load float*, float** %4
%23 = load i64, i64* %7
%24 = add nsw i64 %23, 1
%25 = load i64, i64* %6
%26 = srem i64 %24, %25
%27 = getelementptr inbounds float, float* %22, i64 %26
%28 = load float, float* %27
%29 = load float, float* %8
%30 = fmul float %28, %29
%31 = call float @llvm.fmuladd.f32(float %19, float %21, float %30)
ret float %31
}

LLVM IR (-O2):
define float @interpolateLinear(float* nocapture %0, double %1, i64 %2) {
%4 = fptosi double %1 to i64
%5 = sitofp i64 %4 to double
%6 = fsub double %1, %5
%7 = fptrunc double %6 to float
%8 = getelementptr inbounds float, float* %0, i64 %4
%9 = load float, float* %8
%10 = fsub float 1.000000e+00, %7
%11 = add nsw i64 %4, 1
%12 = srem i64 %11, %2
%13 = getelementptr inbounds float, float* %0, i64 %12
%14 = load float, float* %13
%15 = fmul float %14, %7
%16 = tail call float @llvm.fmuladd.f32(float %9, float %10, float %15)
ret float %16
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
char *getenv(char *);
char *strdup(char *);
char *get_efene_path_from_env() {
  char *fnpath, *result;
  result = NULL;
  fnpath = getenv("FNPATH");
  if (fnpath != NULL) {
    result = strdup(fnpath);
    assert(result != NULL);
  }
  return result;
}


x86 assembly (clang, -O0):
<get_efene_path_from_env>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x10(%rbp)
lea    0xeb9(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     117a <get_efene_path_from_env+0x4a>
mov    -0x8(%rbp),%rdi
call   1050 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_efene_path_from_env>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     115d <get_efene_path_from_env+0x2d>
mov    %rax,%rdi
call   1050 <strdup@plt>
mov    %rax,%rbx
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1040 <assert@plt>
jmp    115f <get_efene_path_from_env+0x2f>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"FNPATH\00"
define noalias i8* @get_efene_path_from_env() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8* %1, null
br i1 %2, label %8, label %3
3: ; preds = %0
%4 = tail call i8* @strdup(i8* %1)
%5 = icmp ne i8* %4, null
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
br label %8
8: ; preds = %3, %0
%9 = phi i8* [ %4, %3 ], [ null, %0 ]
ret i8* %9
}
int test_imm_78int64_lowword_reg(long long val) {
  return ((val) & (0x78 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_78int64_lowword_reg>:
test   $0x78,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_78int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 120
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, long long);
int /*<<< orphan*/ stub_state_post_print(void *);
int /*<<< orphan*/ stub_state_pre_print(void *);
int stub_read_int(int64_t value, void *data) {
  stub_state_pre_print(data);
  printf("%lld", (signed long long)value);
  stub_state_post_print(data);
  return 0;
}


x86 assembly (clang, -O0):
<stub_read_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <stub_state_pre_print@plt>
mov    -0x8(%rbp),%rsi
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <stub_state_post_print@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stub_read_int>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1050 <stub_state_pre_print@plt>
lea    0xeb7(%rip),%rdi
mov    %r14,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <stub_state_post_print@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%lld\00"
define i32 @stub_read_int(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @stub_state_pre_print(i8* %5)
%7 = load i64, i64* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %7)
%9 = load i8*, i8** %4
%10 = call i32 @stub_state_post_print(i8* %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%lld\00"
define i32 @stub_read_int(i64 %0, i8* %1) {
%3 = tail call i32 @stub_state_pre_print(i8* %1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %0)
%5 = tail call i32 @stub_state_post_print(i8* %1)
ret i32 0
}
/* Type definitions */
struct class {
  int dummy;
};

/* Variables and functions */
struct class *main_sub();
int main() {
  struct class *model;
  model = main_sub();
  return 0;
}


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

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

LLVM IR (-O0):
%struct.class = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.class*
store i32 0, i32* %1
%3 = call %struct.class* (...) @main_sub()
store %struct.class* %3, %struct.class** %2
ret i32 0
}

LLVM IR (-O2):
%struct.class = type { i32 }
define i32 @main() {
%1 = tail call %struct.class* (...) @main_sub()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ GyrCon(int);
void OisEna(void) { GyrCon(0x01); }


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

x86 assembly (clang, -O2):
<OisEna>:
mov    $0x1,%edi
jmp    1030 <GyrCon@plt>

LLVM IR (-O0):
define void @OisEna() {
%1 = call i32 @GyrCon(i32 1)
ret void
}

LLVM IR (-O2):
define void @OisEna() {
%1 = tail call i32 @GyrCon(i32 1)
ret void
}
void cm_no_op(void) {}


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

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

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

LLVM IR (-O2):
define void @cm_no_op() {
ret void
}
/* Variables and functions */
int getch();
int SYS_getch() { return getch(); }


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

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

LLVM IR (-O0):
define i32 @SYS_getch() {
%1 = call i32 (...) @getch()
ret i32 %1
}

LLVM IR (-O2):
define i32 @SYS_getch() {
%1 = tail call i32 (...) @getch()
ret i32 %1
}
__attribute__((always_)) void enable_debug_pagealloc(void) {}


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

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

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

LLVM IR (-O2):
define void @enable_debug_pagealloc() {
ret void
}
__attribute__((no, noclone)) signed __int128 t113_5mul(unsigned __int128 x) {
  signed __int128 r;
  if (__builtin_mul_overflow(x, (signed __int128)(0), &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t113_5mul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
xor    %eax,%eax
movq   $0x0,-0x38(%rbp)
movq   $0x0,-0x40(%rbp)
test   $0x1,%al
jne    114f <t113_5mul+0x3f>
jmp    1156 <t113_5mul+0x46>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x40(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x40,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define { i64, i64 } @t113_5mul(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = bitcast i128* %4 to { i64, i64 }*
%8 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 0
store i64 %0, i64* %8
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 1
store i64 %1, i64* %9
%10 = load i128, i128* %4
store i128 %10, i128* %5
%11 = load i128, i128* %5
%12 = call { i128, i1 } @llvm.umul.with.overflow.i128(i128 0, i128 %11)
%13 = extractvalue { i128, i1 } %12, 1
%14 = extractvalue { i128, i1 } %12, 0
%15 = icmp ugt i128 %14, 170141183460469231731687303715884105727
%16 = or i1 %13, %15
%17 = sub i128 0, %14
%18 = select i1 false, i128 %17, i128 %14
store i128 %18, i128* %6
br i1 %16, label %19, label %21
19: ; preds = %2
%20 = call i32 (...) @bar()
br label %21
21: ; preds = %19, %2
%22 = load i128, i128* %6
store i128 %22, i128* %3
%23 = bitcast i128* %3 to { i64, i64 }*
%24 = load { i64, i64 }, { i64, i64 }* %23
ret { i64, i64 } %24
}

LLVM IR (-O2):
define { i64, i64 } @t113_5mul(i64 %0, i64 %1) {
ret { i64, i64 } zeroinitializer
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, int);
void sprint_mov_direct_to_direct(char *str, uint8_t direct_src,
                                 uint8_t direct_dst) {
  sprintf(str,
          "MOV   "
          "0x%02X"
          ", "
          "0x%02X"
          "                ",
          direct_dst, direct_src);
}


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

x86 assembly (clang, -O2):
<sprint_mov_direct_to_direct>:
mov    %esi,%ecx
lea    0xee7(%rip),%rsi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"MOV 0x%02X, 0x%02X \00"
define void @sprint_mov_direct_to_direct(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %6
%9 = load i32, i32* %5
%10 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"MOV 0x%02X, 0x%02X \00"
define void @sprint_mov_direct_to_direct(i8* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm_cmpord_ps(int /*<<< orphan*/, int /*<<< orphan*/);
__m128 f2(__m128 x, __m128 y) { return _mm_cmpord_ps(x, y); }


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

x86 assembly (clang, -O2):
<f2>:
jmp    1030 <_mm_cmpord_ps@plt>

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

LLVM IR (-O2):
define i32 @f2(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_cmpord_ps(i32 %0, i32 %1)
ret i32 %3
}
/* Type definitions */
struct timeval {
  double tv_usec;
  int tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
extern double evaluationStart(void *data) {
  struct timeval tv;
  (void)data;
  gettimeofday(&tv, NULL);
  return tv.tv_usec + tv.tv_sec * 1000000.;
}


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

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

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

LLVM IR (-O2):
%struct.timeval = type { double, i32 }
define double @evaluationStart(i8* nocapture readnone %0) {
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %2 to i8*
%4 = call i32 @gettimeofday(%struct.timeval* %2, i32* null)
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
%6 = load double, double* %5
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 1
%8 = load i32, i32* %7
%9 = sitofp i32 %8 to double
%10 = tail call double @llvm.fmuladd.f64(double %9, double 1.000000e+06, double %6)
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ __xalloc_failed(char const *, int, size_t);
void *malloc(size_t);
void *__xmalloc(const char *_file, int _line, size_t size) {
  void *p = malloc(size);
  if (!p)
    __xalloc_failed(_file, _line, (size));
  return p;
  ;
}


x86 assembly (clang, -O0):
<__xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    115b <__xmalloc+0x3b>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1040 <__xalloc_failed@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__xmalloc>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %esi,%r14d
mov    %rdi,%r15
mov    %rdx,%rdi
call   1030 <malloc@plt>
mov    %rax,%rbp
test   %rax,%rax
jne    114e <__xmalloc+0x2e>
mov    %r15,%rdi
mov    %r14d,%esi
mov    %rbx,%rdx
call   1040 <__xalloc_failed@plt>
mov    %rbp,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define noalias i8* @__xmalloc(i8* %0, i32 %1, i64 %2) {
%4 = tail call i8* @malloc(i64 %2)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @__xalloc_failed(i8* %0, i32 %1, i64 %2)
br label %8
8: ; preds = %6, %3
ret i8* %4
}
int ubifs_return_leb(struct ubifs_info *c, int lnum) { return 0; }


x86 assembly (clang, -O0):
<ubifs_return_leb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.ubifs_info = type opaque
define i32 @ubifs_return_leb(%struct.ubifs_info* %0, i32 %1) {
%3 = alloca %struct.ubifs_info*
%4 = alloca i32
store %struct.ubifs_info* %0, %struct.ubifs_info** %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
%struct.ubifs_info = type opaque
define i32 @ubifs_return_leb(%struct.ubifs_info* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char const *, char const *);
FILE *test_open(const char *filename, const char *mode) {
  FILE *file;
  file = fopen(filename, mode);
  return file;
}


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

x86 assembly (clang, -O2):
<test_open>:
jmp    1030 <fopen@plt>

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

LLVM IR (-O2):
define noalias i32* @test_open(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
ret i32* %3
}
/* Type definitions */
typedef scalar_t__ ssize_t;

/* Variables and functions */
int errno;
scalar_t__ read(int, void *, size_t);
ssize_t __sulong_posix_read(int fd, void *buf, size_t count) {
  {
    int native_errno = errno;
    ssize_t result = read(fd, buf, count);
    if (result == (ssize_t)-1) {
      result = (ssize_t)(long)-errno;
    }
    errno = native_errno;
    return result;
  }
}


x86 assembly (clang, -O0):
<__sulong_posix_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <read@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0xffffffffffffffff,-0x28(%rbp)
jne    115f <__sulong_posix_read+0x4f>
xor    %eax,%eax
mov    0x2e89(%rip),%rcx
sub    (%rcx),%eax
cltq
mov    %rax,-0x28(%rbp)
mov    -0x1c(%rbp),%ecx
mov    0x2e77(%rip),%rax
mov    %ecx,(%rax)
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__sulong_posix_read>:
push   %rbp
push   %rbx
push   %rax
mov    0x2ec6(%rip),%rbx
mov    (%rbx),%ebp
call   1030 <read@plt>
movslq (%rbx),%rcx
neg    %rcx
cmp    $0xffffffffffffffff,%rax
cmove  %rcx,%rax
mov    %ebp,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@errno = global i32 0
define i64 @__sulong_posix_read(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
%8 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%9 = load i32, i32* @errno
store i32 %9, i32* %7
%10 = load i32, i32* %4
%11 = load i8*, i8** %5
%12 = load i64, i64* %6
%13 = call i64 @read(i32 %10, i8* %11, i64 %12)
store i64 %13, i64* %8
%14 = load i64, i64* %8
%15 = icmp eq i64 %14, -1
br i1 %15, label %16, label %20
16: ; preds = %3
%17 = load i32, i32* @errno
%18 = sub nsw i32 0, %17
%19 = sext i32 %18 to i64
store i64 %19, i64* %8
br label %20
20: ; preds = %16, %3
%21 = load i32, i32* %7
store i32 %21, i32* @errno
%22 = load i64, i64* %8
ret i64 %22
}

LLVM IR (-O2):
@errno = global i32 0
define i64 @__sulong_posix_read(i32 %0, i8* nocapture %1, i64 %2) {
%4 = load i32, i32* @errno
%5 = tail call i64 @read(i32 %0, i8* %1, i64 %2)
%6 = icmp eq i64 %5, -1
%7 = load i32, i32* @errno
%8 = sub nsw i32 0, %7
%9 = sext i32 %8 to i64
%10 = select i1 %6, i64 %9, i64 %5
store i32 %4, i32* @errno
ret i64 %10
}
/* Type definitions */
typedef int int64_t;
typedef scalar_t__ int32_t;

/* Variables and functions */
scalar_t__ INT32_MAX;
scalar_t__ INT32_MIN;
scalar_t__ __stdfix_sat_lr(int);
int32_t __stdfix_smul_lr(int32_t x, int32_t y) {
  if (x == INT32_MIN && y == INT32_MIN)
    return (INT32_MAX);
  return (__stdfix_sat_lr(((int64_t)x * (int64_t)y) >> 31));
}


x86 assembly (clang, -O0):
<__stdfix_smul_lr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2ead(%rip),%rcx
cmp    (%rcx),%rax
jne    115b <__stdfix_smul_lr+0x4b>
mov    -0x18(%rbp),%rax
mov    0x2e99(%rip),%rcx
cmp    (%rcx),%rax
jne    115b <__stdfix_smul_lr+0x4b>
mov    0x2e91(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    1174 <__stdfix_smul_lr+0x64>
mov    -0x10(%rbp),%rax
mov    %eax,%edi
mov    -0x18(%rbp),%rax
imul   %eax,%edi
sar    $0x1f,%edi
call   1030 <__stdfix_sat_lr@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__stdfix_smul_lr>:
mov    0x2ec1(%rip),%rax
mov    (%rax),%rax
cmp    %rdi,%rax
jne    112f <__stdfix_smul_lr+0x1f>
cmp    %rsi,%rax
jne    112f <__stdfix_smul_lr+0x1f>
mov    0x2eb5(%rip),%rax
mov    (%rax),%rax
ret
imul   %edi,%esi
sar    $0x1f,%esi
mov    %esi,%edi
jmp    1030 <__stdfix_sat_lr@plt>

LLVM IR (-O0):
@INT32_MIN = global i64 0
@INT32_MAX = global i64 0
define i64 @__stdfix_smul_lr(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = load i64, i64* %4
%7 = load i64, i64* @INT32_MIN
%8 = icmp eq i64 %6, %7
br i1 %8, label %9, label %15
9: ; preds = %2
%10 = load i64, i64* %5
%11 = load i64, i64* @INT32_MIN
%12 = icmp eq i64 %10, %11
br i1 %12, label %13, label %15
13: ; preds = %9
%14 = load i64, i64* @INT32_MAX
store i64 %14, i64* %3
br label %23
15: ; preds = %9, %2
%16 = load i64, i64* %4
%17 = trunc i64 %16 to i32
%18 = load i64, i64* %5
%19 = trunc i64 %18 to i32
%20 = mul nsw i32 %17, %19
%21 = ashr i32 %20, 31
%22 = call i64 @__stdfix_sat_lr(i32 %21)
store i64 %22, i64* %3
br label %23
23: ; preds = %15, %13
%24 = load i64, i64* %3
ret i64 %24
}

LLVM IR (-O2):
@INT32_MIN = global i64 0
@INT32_MAX = global i64 0
define i64 @__stdfix_smul_lr(i64 %0, i64 %1) {
%3 = load i64, i64* @INT32_MIN
%4 = icmp eq i64 %3, %0
%5 = icmp eq i64 %3, %1
%6 = and i1 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = load i64, i64* @INT32_MAX
br label %15
9: ; preds = %2
%10 = trunc i64 %0 to i32
%11 = trunc i64 %1 to i32
%12 = mul nsw i32 %11, %10
%13 = ashr i32 %12, 31
%14 = tail call i64 @__stdfix_sat_lr(i32 %13)
br label %15
15: ; preds = %9, %7
%16 = phi i64 [ %8, %7 ], [ %14, %9 ]
ret i64 %16
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int sort(int);
int main() {
  if (sort(5) != 1)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x5,%edi
call   1040 <sort@plt>
cmp    $0x1,%eax
je     1149 <main+0x29>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1040 <sort@plt>
cmp    $0x1,%eax
jne    1134 <main+0x14>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @sort(i32 5)
%3 = icmp ne i32 %2, 1
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @sort(i32 5)
%2 = icmp eq i32 %1, 1
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *prgnam) {
  fprintf(stderr, "\nExecute code : %s -e <file-containing-shellcode>\n",
          prgnam);
  fprintf(stderr, "Convert code : %s -p <file-containing-shellcode> \n\n",
          prgnam);
  fflush(stderr);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xeb0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e6b(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ea2(%rip),%r14
mov    (%r14),%edi
lea    0xeb8(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xed9(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    (%r14),%edi
call   1040 <fflush@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [51 x i8] c"\0AExecute code : %s -e <file-containing-shellcode>\0A\00"
@.str.1 = [52 x i8] c"Convert code : %s -p <file-containing-shellcode> \0A\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = load i8*, i8** %2
%8 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%9 = load i32, i32* @stderr
%10 = call i32 @fflush(i32 %9)
%11 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [51 x i8] c"\0AExecute code : %s -e <file-containing-shellcode>\0A\00"
@.str.1 = [52 x i8] c"Convert code : %s -p <file-containing-shellcode> \0A\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%6 = load i32, i32* @stderr
%7 = tail call i32 @fflush(i32 %6)
%8 = tail call i32 @exit(i32 1)
unreachable
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ si_ptr;
};
typedef TYPE_1__ siginfo_t;

/* Variables and functions */
int /*<<< orphan*/ LOG_DEBUG;
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *, int, char *);
void handler(int sig, siginfo_t *info, void *ctx) {
  int i = 0;
  char buf[100] = {
      0,
  };
  void **p = NULL;
  syslog(LOG_DEBUG, "mpc_daemon:  %d %s", sig, (char *)(info->si_ptr));
}


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
lea    -0x80(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1030 <memset@plt>
movq   $0x0,-0x88(%rbp)
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
lea    0xe8e(%rip),%rsi
call   1040 <syslog@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handler>:
mov    %edi,%edx
mov    0x2ec7(%rip),%rax
mov    (%rax),%edi
mov    (%rsi),%rcx
lea    0xedb(%rip),%rsi
jmp    1030 <syslog@plt>

LLVM IR (-O0):
%struct.TYPE_3__ = type { i64 }
@LOG_DEBUG = global i32 0
@.str = [19 x i8] c"mpc_daemon: %d %s\00"
define void @handler(i32 %0, %struct.TYPE_3__* %1, i8* %2) {
%4 = alloca i32
%5 = alloca %struct.TYPE_3__*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca [100 x i8]
%9 = alloca i8**
store i32 %0, i32* %4
store %struct.TYPE_3__* %1, %struct.TYPE_3__** %5
store i8* %2, i8** %6
store i32 0, i32* %7
%10 = bitcast [100 x i8]* %8 to i8*
store i8** null, i8*** %9
%11 = load i32, i32* @LOG_DEBUG
%12 = load i32, i32* %4
%13 = load %struct.TYPE_3__*, %struct.TYPE_3__** %5
%14 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %13, i32 0, i32 0
%15 = load i64, i64* %14
%16 = inttoptr i64 %15 to i8*
%17 = call i32 @syslog(i32 %11, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %12, i8* %16)
ret void
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i64 }
@LOG_DEBUG = global i32 0
@.str = [19 x i8] c"mpc_daemon: %d %s\00"
define void @handler(i32 %0, %struct.TYPE_3__* nocapture %1, i8* nocapture readnone %2) {
%4 = load i32, i32* @LOG_DEBUG
%5 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 0
%6 = load i64, i64* %5
%7 = inttoptr i64 %6 to i8*
%8 = tail call i32 @syslog(i32 %4, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %7)
ret void
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
scalar_t__ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
long timestamp(void) {
  struct timeval tv;
  if (gettimeofday(&tv, NULL) < 0)
    return 0;
  return (long)((long)tv.tv_sec * 1000 + (long)tv.tv_usec / 1000);
}


x86 assembly (clang, -O0):
<timestamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cmp    $0x0,%rax
jge    113c <timestamp+0x2c>
movq   $0x0,-0x8(%rbp)
jmp    1164 <timestamp+0x54>
imul   $0x3e8,-0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    $0x3e8,%ecx
cqto
idiv   %rcx
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timestamp>:
push   %rbx
sub    $0x10,%rsp
xor    %ebx,%ebx
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
test   %rax,%rax
js     1151 <timestamp+0x41>
imul   $0x3e8,0x8(%rsp),%rcx
movabs $0x20c49ba5e353f7cf,%rax
9b c4 20
imulq  (%rsp)
mov    %rdx,%rbx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x7,%rbx
add    %rax,%rbx
add    %rcx,%rbx
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i64 @timestamp() {
%1 = alloca i64
%2 = alloca %struct.timeval
%3 = call i64 @gettimeofday(%struct.timeval* %2, i32* null)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %0
store i64 0, i64* %1
br label %14
6: ; preds = %0
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 1
%8 = load i64, i64* %7
%9 = mul nsw i64 %8, 1000
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
%11 = load i64, i64* %10
%12 = sdiv i64 %11, 1000
%13 = add nsw i64 %9, %12
store i64 %13, i64* %1
br label %14
14: ; preds = %6, %5
%15 = load i64, i64* %1
ret i64 %15
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i64 @timestamp() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i64 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = icmp slt i64 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %0
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load i64, i64* %6
%8 = mul nsw i64 %7, 1000
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%10 = load i64, i64* %9
%11 = sdiv i64 %10, 1000
%12 = add nsw i64 %11, %8
br label %13
13: ; preds = %0, %5
%14 = phi i64 [ %12, %5 ], [ 0, %0 ]
ret i64 %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void ddd(char *p) {
  do {
    printf("[leostun]==>");
    printf("===================++>%s", p);
    printf("\n");
  } while (0);
  ;
}


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

x86 assembly (clang, -O2):
<ddd>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed4(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"[leostun]==>\00"
@.str.1 = [25 x i8] c"===================++>%s\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @ddd(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %8
8: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"[leostun]==>\00"
@.str.1 = [25 x i8] c"===================++>%s\00"
define void @ddd(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%4 = tail call i32 @putchar(i32 10)
ret void
}
int init_portal_kernel(struct PortalInternal *pint, void *param) { return 0; }


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

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

LLVM IR (-O0):
%struct.PortalInternal = type opaque
define i32 @init_portal_kernel(%struct.PortalInternal* %0, i8* %1) {
%3 = alloca %struct.PortalInternal*
%4 = alloca i8*
store %struct.PortalInternal* %0, %struct.PortalInternal** %3
store i8* %1, i8** %4
ret i32 0
}

LLVM IR (-O2):
%struct.PortalInternal = type opaque
define i32 @init_portal_kernel(%struct.PortalInternal* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
scalar_t__ pow(double, double);
double sqrt(scalar_t__);
double as(double a) { return sqrt(pow(a, 1.5) + pow(a, 2.5)); }


x86 assembly (clang, -O0):
<as>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xece(%rip),%xmm1
call   1030 <pow@plt>
mov    %rax,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeb0(%rip),%xmm1
call   1030 <pow@plt>
mov    -0x10(%rbp),%rdi
add    %rax,%rdi
call   1040 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<as>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
movsd  0xecd(%rip),%xmm1
call   1030 <pow@plt>
mov    %rax,%rbx
movsd  0xec5(%rip),%xmm1
movsd  0x8(%rsp),%xmm0
call   1030 <pow@plt>
add    %rax,%rbx
mov    %rbx,%rdi
add    $0x10,%rsp
pop    %rbx
jmp    1040 <sqrt@plt>

LLVM IR (-O0):
define double @as(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @pow(double %3, double 1.500000e+00)
%5 = load double, double* %2
%6 = call i64 @pow(double %5, double 2.500000e+00)
%7 = add nsw i64 %4, %6
%8 = call double @sqrt(i64 %7)
ret double %8
}

LLVM IR (-O2):
define double @as(double %0) {
%2 = tail call i64 @pow(double %0, double 1.500000e+00)
%3 = tail call i64 @pow(double %0, double 2.500000e+00)
%4 = add nsw i64 %3, %2
%5 = tail call double @sqrt(i64 %4)
ret double %5
}
void print_stacktrace() {}


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

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

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

LLVM IR (-O2):
define void @print_stacktrace() {
ret void
}
void reset_voice(void) {}


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

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

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

LLVM IR (-O2):
define void @reset_voice() {
ret void
}
int base64_blksize_raw() { return 3; }


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

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

LLVM IR (-O0):
define i32 @base64_blksize_raw() {
ret i32 3
}

LLVM IR (-O2):
define i32 @base64_blksize_raw() {
ret i32 3
}
char *checkmark(int x) { return (x) ? "x" : "_"; }


x86 assembly (clang, -O0):
<checkmark>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xef1(%rip),%rax
lea    0xee8(%rip),%rcx
cmp    $0x0,%edx
cmovne %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkmark>:
test   %edi,%edi
lea    0xef9(%rip),%rcx
lea    0xef0(%rip),%rax
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [2 x i8] c"x\00"
@.str.1 = [2 x i8] c"_\00"
define i8* @checkmark(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i64
%6 = select i1 %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0)
ret i8* %6
}

LLVM IR (-O2):
@.str = [2 x i8] c"x\00"
@.str.1 = [2 x i8] c"_\00"
define i8* @checkmark(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
ret i8* %3
}
/* Type definitions */
struct kvm_sregs {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ KVM_SET_SREGS;
int ioctl(int, int /*<<< orphan*/, struct kvm_sregs const *);
int kvm_set_sregs(int fd, const struct kvm_sregs *sregs) {
  return ioctl(fd, KVM_SET_SREGS, sregs);
}


x86 assembly (clang, -O0):
<kvm_set_sregs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eaf(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
call   1030 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kvm_set_sregs>:
mov    %rsi,%rdx
mov    0x2ebe(%rip),%rax
mov    (%rax),%esi
jmp    1030 <ioctl@plt>

LLVM IR (-O0):
%struct.kvm_sregs = type { i32 }
@KVM_SET_SREGS = global i32 0
define i32 @kvm_set_sregs(i32 %0, %struct.kvm_sregs* %1) {
%3 = alloca i32
%4 = alloca %struct.kvm_sregs*
store i32 %0, i32* %3
store %struct.kvm_sregs* %1, %struct.kvm_sregs** %4
%5 = load i32, i32* %3
%6 = load i32, i32* @KVM_SET_SREGS
%7 = load %struct.kvm_sregs*, %struct.kvm_sregs** %4
%8 = call i32 @ioctl(i32 %5, i32 %6, %struct.kvm_sregs* %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.kvm_sregs = type { i32 }
@KVM_SET_SREGS = global i32 0
define i32 @kvm_set_sregs(i32 %0, %struct.kvm_sregs* %1) {
%3 = load i32, i32* @KVM_SET_SREGS
%4 = tail call i32 @ioctl(i32 %0, i32 %3, %struct.kvm_sregs* %1)
ret i32 %4
}
int f3(unsigned x) { return x - 1 < 0x7fffffff; }


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
cmp    $0x7fffffff,%eax
setb   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
xor    %eax,%eax
test   %edi,%edi
setg   %al
ret

LLVM IR (-O0):
define i32 @f3(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub i32 %3, 1
%5 = icmp ult i32 %4, 2147483647
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @f3(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int parse_args(int, char **);
int /*<<< orphan*/ start_client(int, char **);
int /*<<< orphan*/ start_server(int, char **);
int main(int argc, char **argv) {
  int result;
  result = parse_args(argc, argv);
  if (result == 1)
    start_server(argc, argv);
  else if (result == 2)
    start_client(argc, argv);
  else
    return 0;
  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)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <parse_args@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jne    1170 <main+0x40>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <start_server@plt>
jmp    119c <main+0x6c>
cmpl   $0x2,-0x14(%rbp)
jne    118b <main+0x5b>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <start_client@plt>
jmp    1197 <main+0x67>
movl   $0x0,-0x4(%rbp)
jmp    11a3 <main+0x73>
jmp    119c <main+0x6c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
call   1030 <parse_args@plt>
cmp    $0x2,%eax
je     1153 <main+0x23>
cmp    $0x1,%eax
jne    115d <main+0x2d>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1050 <start_server@plt>
jmp    115d <main+0x2d>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1040 <start_client@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
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
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = call i32 @parse_args(i32 %7, i8** %8)
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = icmp eq i32 %10, 1
br i1 %11, label %12, label %16
12: ; preds = %2
%13 = load i32, i32* %4
%14 = load i8**, i8*** %5
%15 = call i32 @start_server(i32 %13, i8** %14)
br label %25
16: ; preds = %2
%17 = load i32, i32* %6
%18 = icmp eq i32 %17, 2
br i1 %18, label %19, label %23
19: ; preds = %16
%20 = load i32, i32* %4
%21 = load i8**, i8*** %5
%22 = call i32 @start_client(i32 %20, i8** %21)
br label %24
23: ; preds = %16
store i32 0, i32* %3
br label %26
24: ; preds = %19
br label %25
25: ; preds = %24, %12
store i32 0, i32* %3
br label %26
26: ; preds = %25, %23
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @parse_args(i32 %0, i8** %1)
switch i32 %3, label %8 [
i32 1, label %4
i32 2, label %6
]
4: ; preds = %2
%5 = tail call i32 @start_server(i32 %0, i8** %1)
br label %8
6: ; preds = %2
%7 = tail call i32 @start_client(i32 %0, i8** %1)
br label %8
8: ; preds = %4, %6, %2
ret i32 0
}