xunge/DecIR huggingface dataset:
unsigned xrop3_236_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = D & T;
  stk1 = S | stk2;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_236_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
and    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_236_0_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_236_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %5
%23 = load i32, i32* %7
%24 = and i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %6
%26 = load i32, i32* %9
%27 = or i32 %25, %26
store i32 %27, i32* %8
%28 = load i32, i32* %8
ret i32 %28
}

LLVM IR (-O2):
define i32 @xrop3_236_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = or i32 %4, %5
ret i32 %6
}
/* Variables and functions */
int _gdbio_unlink_r(int /*<<< orphan*/ *, char const *);
int /*<<< orphan*/ errno;
int gdbio_unlink(const char *pathname) {
  return _gdbio_unlink_r(&errno, pathname);
}


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

x86 assembly (clang, -O2):
<gdbio_unlink>:
mov    %rdi,%rsi
mov    0x2ec6(%rip),%rdi
jmp    1030 <_gdbio_unlink_r@plt>

LLVM IR (-O0):
@errno = global i32 0
define i32 @gdbio_unlink(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @_gdbio_unlink_r(i32* @errno, i8* %3)
ret i32 %4
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @gdbio_unlink(i8* %0) {
%2 = tail call i32 @_gdbio_unlink_r(i32* @errno, i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ Reserved61_DriverIRQHandler();
__attribute__((weak)) void Reserved61_IRQHandler(void) {
  Reserved61_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @Reserved61_IRQHandler() {
%1 = call i32 (...) @Reserved61_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @Reserved61_IRQHandler() {
%1 = tail call i32 (...) @Reserved61_DriverIRQHandler()
ret void
}
/* Variables and functions */
int sendto(int const, unsigned char const *, size_t, int /*<<< orphan*/,
           int /*<<< orphan*/ *, int /*<<< orphan*/);
int lin_rsk_sendto(const unsigned char *buffer, size_t buffer_size,
                   const int sockfd) {
  return sendto(sockfd, buffer, buffer_size, 0, NULL, 0);
}


x86 assembly (clang, -O0):
<lin_rsk_sendto>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
xor    %r9d,%r9d
xor    %eax,%eax
mov    %eax,%r8d
mov    %r9d,%ecx
call   1030 <sendto@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lin_rsk_sendto>:
mov    %edx,%eax
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %eax,%edi
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <sendto@plt>

LLVM IR (-O0):
define i32 @lin_rsk_sendto(i8* %0, i64 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32
store i8* %0, i8** %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = load i64, i64* %5
%10 = call i32 @sendto(i32 %7, i8* %8, i64 %9, i32 0, i32* null, i32 0)
ret i32 %10
}

LLVM IR (-O2):
define i32 @lin_rsk_sendto(i8* %0, i64 %1, i32 %2) {
%4 = tail call i32 @sendto(i32 %2, i8* %0, i64 %1, i32 0, i32* null, i32 0)
ret i32 %4
}
/* Type definitions */
struct timespec {
  scalar_t__ tv_sec;
  scalar_t__ tv_nsec;
};

/* Variables and functions */
bool timespec_gt(struct timespec a, struct timespec b) {
  if (a.tv_sec > a.tv_sec)
    return true;
  if (a.tv_sec < a.tv_sec)
    return false;
  return a.tv_nsec > b.tv_nsec;
}


x86 assembly (clang, -O0):
<timespec_gt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x18(%rbp),%rax
jle    112e <timespec_gt+0x2e>
movl   $0x1,-0x4(%rbp)
jmp    115b <timespec_gt+0x5b>
mov    -0x18(%rbp),%rax
cmp    -0x18(%rbp),%rax
jge    1148 <timespec_gt+0x48>
movl   $0x0,-0x4(%rbp)
jmp    115b <timespec_gt+0x5b>
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<timespec_gt>:
xor    %eax,%eax
cmp    %rcx,%rsi
setg   %al
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define i32 @timespec_gt(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i32
%6 = alloca %struct.timespec
%7 = alloca %struct.timespec
%8 = bitcast %struct.timespec* %6 to { i64, i64 }*
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %8, i32 0, i32 0
store i64 %0, i64* %9
%10 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %8, i32 0, i32 1
store i64 %1, i64* %10
%11 = bitcast %struct.timespec* %7 to { i64, i64 }*
%12 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %11, i32 0, i32 0
store i64 %2, i64* %12
%13 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %11, i32 0, i32 1
store i64 %3, i64* %13
%14 = getelementptr inbounds %struct.timespec, %struct.timespec* %6, i32 0, i32 0
%15 = load i64, i64* %14
%16 = getelementptr inbounds %struct.timespec, %struct.timespec* %6, i32 0, i32 0
%17 = load i64, i64* %16
%18 = icmp sgt i64 %15, %17
br i1 %18, label %19, label %20
19: ; preds = %4
store i32 1, i32* %5
br label %34
20: ; preds = %4
%21 = getelementptr inbounds %struct.timespec, %struct.timespec* %6, i32 0, i32 0
%22 = load i64, i64* %21
%23 = getelementptr inbounds %struct.timespec, %struct.timespec* %6, i32 0, i32 0
%24 = load i64, i64* %23
%25 = icmp slt i64 %22, %24
br i1 %25, label %26, label %27
26: ; preds = %20
store i32 0, i32* %5
br label %34
27: ; preds = %20
%28 = getelementptr inbounds %struct.timespec, %struct.timespec* %6, i32 0, i32 1
%29 = load i64, i64* %28
%30 = getelementptr inbounds %struct.timespec, %struct.timespec* %7, i32 0, i32 1
%31 = load i64, i64* %30
%32 = icmp sgt i64 %29, %31
%33 = zext i1 %32 to i32
store i32 %33, i32* %5
br label %34
34: ; preds = %27, %26, %19
%35 = load i32, i32* %5
ret i32 %35
}

LLVM IR (-O2):
define i32 @timespec_gt(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = icmp sgt i64 %1, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
float ceil(float);
scalar_t__ fabs(float);
float floor(float);
int myround(float f) {
  float ceil_f;
  float floor_f;
  int roundf;
  ceil_f = ceil(f);
  floor_f = floor(f);
  if ((fabs(f - ceil_f)) < (fabs(f - floor_f)))
    roundf = (int)ceil_f;
  else
    roundf = (int)floor_f;
  return roundf;
}


x86 assembly (clang, -O0):
<myround>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <ceil@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
call   1050 <floor@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
call   1040 <fabs@plt>
mov    %rax,-0x18(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0xc(%rbp),%xmm0
call   1040 <fabs@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
jge    119a <myround+0x6a>
cvttss2si -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    11a2 <myround+0x72>
cvttss2si -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myround>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm0,0x4(%rsp)
call   1050 <ceilf@plt>
movss  %xmm0,0xc(%rsp)
movss  0x4(%rsp),%xmm0
call   1030 <floorf@plt>
movss  %xmm0,0x8(%rsp)
movss  0x4(%rsp),%xmm0
subss  0xc(%rsp),%xmm0
call   1040 <fabs@plt>
mov    %rax,%rbx
movss  0x4(%rsp),%xmm0
subss  0x8(%rsp),%xmm0
call   1040 <fabs@plt>
movss  0xc(%rsp),%xmm0
cmp    %rax,%rbx
jl     118d <myround+0x5d>
movss  0x8(%rsp),%xmm0
cvttss2si %xmm0,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @myround(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca i32
store float %0, float* %2
%6 = load float, float* %2
%7 = call float @ceil(float %6)
store float %7, float* %3
%8 = load float, float* %2
%9 = call float @floor(float %8)
store float %9, float* %4
%10 = load float, float* %2
%11 = load float, float* %3
%12 = fsub float %10, %11
%13 = call i64 @fabs(float %12)
%14 = load float, float* %2
%15 = load float, float* %4
%16 = fsub float %14, %15
%17 = call i64 @fabs(float %16)
%18 = icmp slt i64 %13, %17
br i1 %18, label %19, label %22
19: ; preds = %1
%20 = load float, float* %3
%21 = fptosi float %20 to i32
store i32 %21, i32* %5
br label %25
22: ; preds = %1
%23 = load float, float* %4
%24 = fptosi float %23 to i32
store i32 %24, i32* %5
br label %25
25: ; preds = %22, %19
%26 = load i32, i32* %5
ret i32 %26
}

LLVM IR (-O2):
define i32 @myround(float %0) {
%2 = tail call float @llvm.ceil.f32(float %0)
%3 = tail call float @llvm.floor.f32(float %0)
%4 = fsub float %0, %2
%5 = tail call i64 @fabs(float %4)
%6 = fsub float %0, %3
%7 = tail call i64 @fabs(float %6)
%8 = icmp slt i64 %5, %7
%9 = select i1 %8, float %2, float %3
%10 = fptosi float %9 to i32
ret i32 %10
}
/* Variables and functions */
float cosf(float);
float sinf(float);
float test_func_00(float x) { return sinf(x) + cosf(x); }


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

x86 assembly (clang, -O2):
push   %rax
movss  %xmm0,(%rsp)
call   1030 <sinf@plt>
movss  %xmm0,0x4(%rsp)
movss  (%rsp),%xmm0
call   1040 <cosf@plt>
addss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @test_func_00(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @sinf(float %3)
%5 = load float, float* %2
%6 = call float @cosf(float %5)
%7 = fadd float %4, %6
ret float %7
}

LLVM IR (-O2):
define float @test_func_00(float %0) {
%2 = tail call float @sinf(float %0)
%3 = tail call float @cosf(float %0)
%4 = fadd float %2, %3
ret float %4
}
int min_int(int a, int b) { return (((a) <= (b)) ? (a) : (b)); }


x86 assembly (clang, -O0):
<min_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1121 <min_int+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <min_int+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min_int>:
mov    %edi,%eax
cmp    %esi,%edi
cmovg  %esi,%eax
ret

LLVM IR (-O0):
define i32 @min_int(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 = icmp sle i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @min_int(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Variables and functions */
double o_sinc(double);
double F_up(double t) {
  int k;
  double y = 1., coef = 2.;
  for (k = 1; k < 50; k++) {
    y *= o_sinc(t / coef);
    coef *= 2.;
  }
  return y;
}


x86 assembly (clang, -O0):
<F_up>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xee3(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xece(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x32,-0xc(%rbp)
jge    1181 <F_up+0x71>
movsd  -0x8(%rbp),%xmm0
divsd  -0x20(%rbp),%xmm0
call   1030 <o_sinc@plt>
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xe97(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113e <F_up+0x2e>
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<F_up>:
push   %rbx
sub    $0x20,%rsp
movsd  %xmm0,0x10(%rsp)
movsd  0xedd(%rip),%xmm0
movsd  0xedd(%rip),%xmm1
mov    $0x31,%ebx
movsd  %xmm1,0x18(%rsp)
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
divsd  %xmm1,%xmm0
call   1030 <o_sinc@plt>
movsd  0x8(%rsp),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  0x18(%rsp),%xmm1
movsd  0x8(%rsp),%xmm0
addsd  %xmm1,%xmm1
add    $0xffffffff,%ebx
jne    1130 <F_up+0x20>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @F_up(double %0) {
%2 = alloca double
%3 = alloca i32
%4 = alloca double
%5 = alloca double
store double %0, double* %2
store double 1.000000e+00, double* %4
store double 2.000000e+00, double* %5
store i32 1, i32* %3
br label %6
6: ; preds = %18, %1
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 50
br i1 %8, label %9, label %21
9: ; preds = %6
%10 = load double, double* %2
%11 = load double, double* %5
%12 = fdiv double %10, %11
%13 = call double @o_sinc(double %12)
%14 = load double, double* %4
%15 = fmul double %14, %13
store double %15, double* %4
%16 = load double, double* %5
%17 = fmul double %16, 2.000000e+00
store double %17, double* %5
br label %18
18: ; preds = %9
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
br label %6
21: ; preds = %6
%22 = load double, double* %4
ret double %22
}

LLVM IR (-O2):
define double @F_up(double %0) {
br label %2
2: ; preds = %1, %2
%3 = phi double [ 2.000000e+00, %1 ], [ %9, %2 ]
%4 = phi double [ 1.000000e+00, %1 ], [ %8, %2 ]
%5 = phi i32 [ 1, %1 ], [ %10, %2 ]
%6 = fdiv double %0, %3
%7 = tail call double @o_sinc(double %6)
%8 = fmul double %4, %7
%9 = fmul double %3, 2.000000e+00
%10 = add nuw nsw i32 %5, 1
%11 = icmp eq i32 %10, 50
br i1 %11, label %12, label %2
12: ; preds = %2
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ bench_board_score_1();
int /*<<< orphan*/ bench_count_last_flip();
int /*<<< orphan*/ bench_mobility();
int /*<<< orphan*/ bench_move_generator();
int /*<<< orphan*/ bench_stability();
int /*<<< orphan*/ printf(char *);
void bench(void) {
  printf("The unit of the results is CPU cycles\n");
  bench_move_generator();
  bench_count_last_flip();
  bench_board_score_1();
  bench_mobility();
  bench_stability();
}


x86 assembly (clang, -O0):
<bench>:
push   %rbp
mov    %rsp,%rbp
lea    0xe95(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1080 <bench_move_generator@plt>
mov    $0x0,%al
call   1030 <bench_count_last_flip@plt>
mov    $0x0,%al
call   1060 <bench_board_score_1@plt>
mov    $0x0,%al
call   1050 <bench_mobility@plt>
mov    $0x0,%al
call   1070 <bench_stability@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bench>:
push   %rax
lea    0xe98(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1080 <bench_move_generator@plt>
xor    %eax,%eax
call   1040 <bench_count_last_flip@plt>
xor    %eax,%eax
call   1060 <bench_board_score_1@plt>
xor    %eax,%eax
call   1050 <bench_mobility@plt>
xor    %eax,%eax
pop    %rcx
jmp    1070 <bench_stability@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"The unit of the results is CPU cycles\0A\00"
define void @bench() {
%1 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @bench_move_generator()
%3 = call i32 (...) @bench_count_last_flip()
%4 = call i32 (...) @bench_board_score_1()
%5 = call i32 (...) @bench_mobility()
%6 = call i32 (...) @bench_stability()
ret void
}

LLVM IR (-O2):
@str = [38 x i8] c"The unit of the results is CPU cycles\00"
define void @bench() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @bench_move_generator()
%3 = tail call i32 (...) @bench_count_last_flip()
%4 = tail call i32 (...) @bench_board_score_1()
%5 = tail call i32 (...) @bench_mobility()
%6 = tail call i32 (...) @bench_stability()
ret void
}
/* Type definitions */
struct target {
  int dummy;
};

/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ snprintf(char *, int, char *);
char *dump_sys_sched_yield(int depth, struct target *target) {
  char *param_str = malloc(5);
  snprintf(param_str, 5, "void");
  return param_str;
}


x86 assembly (clang, -O0):
<dump_sys_sched_yield>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x5,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x5,%esi
lea    0xeb3(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_sys_sched_yield>:
push   %rbx
mov    $0x5,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xecb(%rip),%rdx
mov    %rax,%rdi
mov    $0x5,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.target = type { i32 }
@.str = [5 x i8] c"void\00"
define i8* @dump_sys_sched_yield(i32 %0, %struct.target* %1) {
%3 = alloca i32
%4 = alloca %struct.target*
%5 = alloca i8*
store i32 %0, i32* %3
store %struct.target* %1, %struct.target** %4
%6 = call i8* @malloc(i32 5)
store i8* %6, i8** %5
%7 = load i8*, i8** %5
%8 = call i32 @snprintf(i8* %7, i32 5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%9 = load i8*, i8** %5
ret i8* %9
}

LLVM IR (-O2):
%struct.target = type { i32 }
@.str = [5 x i8] c"void\00"
define i8* @dump_sys_sched_yield(i32 %0, %struct.target* nocapture readnone %1) {
%3 = tail call dereferenceable_or_null(5) i8* @malloc(i32 5)
%4 = tail call i32 @snprintf(i8* %3, i32 5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i8* %3
}
unsigned int invert(unsigned int x, int p, int n) {
  unsigned int mask = ~(~0 << n) << (p + 1 - n);
  return (x & ~mask) | (~x & mask);
}


x86 assembly (clang, -O0):
<invert>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
xor    $0xffffffff,%eax
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
sub    -0xc(%rbp),%ecx
shl    %cl,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x4(%rbp),%ecx
xor    $0xffffffff,%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<invert>:
mov    %edx,%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
not    %eax
sub    %edx,%esi
lea    0x1(%rsi),%ecx
shl    %cl,%eax
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @invert(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = shl i32 -1, %8
%10 = xor i32 %9, -1
%11 = load i32, i32* %5
%12 = add nsw i32 %11, 1
%13 = load i32, i32* %6
%14 = sub nsw i32 %12, %13
%15 = shl i32 %10, %14
store i32 %15, i32* %7
%16 = load i32, i32* %4
%17 = load i32, i32* %7
%18 = xor i32 %17, -1
%19 = and i32 %16, %18
%20 = load i32, i32* %4
%21 = xor i32 %20, -1
%22 = load i32, i32* %7
%23 = and i32 %21, %22
%24 = or i32 %19, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @invert(i32 %0, i32 %1, i32 %2) {
%4 = shl nsw i32 -1, %2
%5 = xor i32 %4, -1
%6 = add nsw i32 %1, 1
%7 = sub i32 %6, %2
%8 = shl i32 %5, %7
%9 = xor i32 %8, %0
ret i32 %9
}
void ff_hevc_put_hevc_bi_qpel_v12_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_qpel_v12_12_sse4() {
ret void
}
int minimu(int min) { return min; }


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

x86 assembly (clang, -O2):
<minimu>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @minimu(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ foo();
void main(void) {
  int x;
  int y;
  foo();
  return;
}


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

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

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @foo()
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @foo()
ret void
}
int divpwr2(int x, int n) {
  x += ~(~0 << n) & (x >> 31);
  return x >> n;
}


x86 assembly (clang, -O0):
<divpwr2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
xor    $0xffffffff,%eax
mov    -0x4(%rbp),%ecx
sar    $0x1f,%ecx
and    %ecx,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<divpwr2>:
mov    %esi,%ecx
mov    $0xffffffff,%edx
shl    %cl,%edx
not    %edx
mov    %edi,%eax
sar    $0x1f,%eax
and    %edx,%eax
add    %edi,%eax
sar    %cl,%eax
ret

LLVM IR (-O0):
define i32 @divpwr2(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 = shl i32 -1, %5
%7 = xor i32 %6, -1
%8 = load i32, i32* %3
%9 = ashr i32 %8, 31
%10 = and i32 %7, %9
%11 = load i32, i32* %3
%12 = add nsw i32 %11, %10
store i32 %12, i32* %3
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = ashr i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @divpwr2(i32 %0, i32 %1) {
%3 = shl nsw i32 -1, %1
%4 = xor i32 %3, -1
%5 = icmp slt i32 %0, 0
%6 = select i1 %5, i32 %4, i32 0
%7 = add nsw i32 %6, %0
%8 = ashr i32 %7, %1
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
void *udev_monitor_new_from_socket(void *udev, const void *path) {
  errno = ENOSYS;
  return NULL;
}


x86 assembly (clang, -O0):
<udev_monitor_new_from_socket>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ed5(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebc(%rip),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<udev_monitor_new_from_socket>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
xor    %eax,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i8* @udev_monitor_new_from_socket(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @ENOSYS
store i32 %5, i32* @errno
ret i8* null
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define noalias i8* @udev_monitor_new_from_socket(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i8* null
}
unsigned char smb349_get_reg(unsigned char reg) { return 0; }


x86 assembly (clang, -O0):
<smb349_get_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
xor    %eax,%eax
movzbl %al,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define zeroext i8 @smb349_get_reg(i8 zeroext %0) {
ret i8 0
}
void dead_test7(int *data) {
  int k = 0;
  int j = data[2];
  data[j] = 2;
  if (j)
    k++;
  else
    k--;
}


x86 assembly (clang, -O0):
<dead_test7>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movl   $0x2,(%rax,%rcx,4)
cmpl   $0x0,-0x10(%rbp)
je     1140 <dead_test7+0x40>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1149 <dead_test7+0x49>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<dead_test7>:
movslq 0x8(%rdi),%rax
movl   $0x2,(%rdi,%rax,4)
ret

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

LLVM IR (-O2):
define void @dead_test7(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
store i32 2, i32* %5
ret void
}
/* Variables and functions */
void *dlsym(void *, char const *);
void *dbgsysFindLibraryEntry(void *handle, const char *name) {
  void *sym;
  sym = dlsym(handle, name);
  return sym;
}


x86 assembly (clang, -O0):
<dbgsysFindLibraryEntry>:
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 <dlsym@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dbgsysFindLibraryEntry>:
jmp    1030 <dlsym@plt>

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

LLVM IR (-O2):
define i8* @dbgsysFindLibraryEntry(i8* %0, i8* %1) {
%3 = tail call i8* @dlsym(i8* %0, i8* %1)
ret i8* %3
}
double f4_sum_pre_double_double_int(double v0, double v1, int v) {
  return v0 + v1 + ((double)(v));
}


x86 assembly (clang, -O0):
<f4_sum_pre_double_double_int>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
cvtsi2sdl -0x14(%rbp),%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_sum_pre_double_double_int>:
addsd  %xmm1,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %edi,%xmm1
addsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @f4_sum_pre_double_double_int(double %0, double %1, i32 %2) {
%4 = fadd double %0, %1
%5 = sitofp i32 %2 to double
%6 = fadd double %4, %5
ret double %6
}
/* Variables and functions */
void *grfio_reads(char *, int /*<<< orphan*/ *);
void *grfio_read(char *fname) { return grfio_reads(fname, NULL); }


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

x86 assembly (clang, -O2):
<grfio_read>:
xor    %esi,%esi
jmp    1030 <grfio_reads@plt>

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

LLVM IR (-O2):
define i8* @grfio_read(i8* %0) {
%2 = tail call i8* @grfio_reads(i8* %0, i32* null)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("This program exits with error code\n");
  return 404;
}


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

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

LLVM IR (-O0):
@.str = [36 x i8] c"This program exits with error code\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret i32 404
}

LLVM IR (-O2):
@str = [35 x i8] c"This program exits with error code\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
ret i32 404
}
/* Variables and functions */
size_t strlen(char const *);
size_t SEC_OSAL_Strlen(const char *str) { return strlen(str); }


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

x86 assembly (clang, -O2):
<SEC_OSAL_Strlen>:
jmp    1030 <strlen@plt>

LLVM IR (-O0):
define i64 @SEC_OSAL_Strlen(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strlen(i8* %3)
ret i64 %4
}

LLVM IR (-O2):
define i64 @SEC_OSAL_Strlen(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
ret i64 %2
}
int ld_ble_mr2(long double *a1, long double a2) {
  return !(__builtin_islessequal(*a1, a2));
}


x86 assembly (clang, -O0):
<ld_ble_mr2>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
mov    %rdi,-0x8(%rbp)
fstpt  -0x20(%rbp)
mov    -0x8(%rbp),%rax
fldt   (%rax)
fldt   -0x20(%rbp)
fucomip %st(1),%st
fstp   %st(0)
setae  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_ble_mr2>:
fldt   0x8(%rsp)
fldt   (%rdi)
xor    %eax,%eax
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setb   %al
ret

LLVM IR (-O0):
define i32 @ld_ble_mr2(x86_fp80* %0, x86_fp80 %1) {
%3 = alloca x86_fp80*
%4 = alloca x86_fp80
store x86_fp80* %0, x86_fp80** %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80*, x86_fp80** %3
%6 = load x86_fp80, x86_fp80* %5
%7 = load x86_fp80, x86_fp80* %4
%8 = fcmp ole x86_fp80 %6, %7
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @ld_ble_mr2(x86_fp80* nocapture %0, x86_fp80 %1) {
%3 = load x86_fp80, x86_fp80* %0
%4 = fcmp ugt x86_fp80 %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ thread();
int main() {
  int x = 0;
  thread();
  return x;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 (...) @thread()
%4 = load i32, i32* %2
ret i32 %4
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @thread()
ret i32 0
}
unsigned long long strtoull(const char *str, char **end, int base) {
  return ({
    extern __typeof__(strtoull) module_libc_strtoull;
    &module_libc_strtoull;
  })(str, end, base);
}


x86 assembly (clang, -O0):
<strtoull>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2ece(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtoull>:
jmp    1030 <module_libc_strtoull@plt>

LLVM IR (-O0):
define i64 @strtoull(i8* %0, i8** %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i64 (i8*, i8**, i32)*
store i8* %0, i8** %4
store i8** %1, i8*** %5
store i32 %2, i32* %6
store i64 (i8*, i8**, i32)* @module_libc_strtoull, i64 (i8*, i8**, i32)** %7
%8 = load i64 (i8*, i8**, i32)*, i64 (i8*, i8**, i32)** %7
%9 = load i8*, i8** %4
%10 = load i8**, i8*** %5
%11 = load i32, i32* %6
%12 = call i64 %8(i8* %9, i8** %10, i32 %11)
ret i64 %12
}

LLVM IR (-O2):
define i64 @strtoull(i8* %0, i8** %1, i32 %2) {
%4 = tail call i64 @module_libc_strtoull(i8* %0, i8** %1, i32 %2)
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void usage(const char *progname) {
  fprintf(stderr, "Search PARAM=VALUE pattern in the given string\n");
  fprintf(stderr, "Usage: %s <parameter-name> <default-value> <string>\n",
          progname);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
lea    0xed4(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xee9(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ec2(%rip),%r14
mov    (%r14),%edi
lea    0xed8(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xef7(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [48 x i8] c"Search PARAM=VALUE pattern in the given string\0A\00"
@.str.1 = [53 x i8] c"Usage: %s <parameter-name> <default-value> <string>\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %2
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [48 x i8] c"Search PARAM=VALUE pattern in the given string\0A\00"
@.str.1 = [53 x i8] c"Usage: %s <parameter-name> <default-value> <string>\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int int64_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, int *);
int64_t prod_from_fileptr(FILE *fp) {
  int64_t prod = 1;
  while (!feof(fp)) {
    int64_t current;
    fscanf(fp, "%lld ", &current);
    prod *= current;
  }
  return prod;
}


x86 assembly (clang, -O0):
<prod_from_fileptr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1151 <prod_from_fileptr+0x31>
jmp    1174 <prod_from_fileptr+0x54>
mov    -0x8(%rbp),%rdi
lea    0xea4(%rip),%rsi
lea    -0x10(%rbp),%rdx
call   1030 <fscanf@plt>
mov    -0x10(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <prod_from_fileptr+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prod_from_fileptr>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <feof@plt>
mov    $0x1,%ebp
test   %eax,%eax
jne    116f <prod_from_fileptr+0x4f>
mov    $0x1,%ebp
lea    0xebc(%rip),%r14
lea    0x4(%rsp),%r15
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <fscanf@plt>
imul   0x4(%rsp),%ebp
mov    %rbx,%rdi
call   1040 <feof@plt>
test   %eax,%eax
je     1150 <prod_from_fileptr+0x30>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%lld \00"
define i32 @prod_from_fileptr(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
store i32 1, i32* %3
br label %5
5: ; preds = %10, %1
%6 = load i32*, i32** %2
%7 = call i32 @feof(i32* %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
br i1 %9, label %10, label %16
10: ; preds = %5
%11 = load i32*, i32** %2
%12 = call i32 @fscanf(i32* %11, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %4)
%13 = load i32, i32* %4
%14 = load i32, i32* %3
%15 = mul nsw i32 %14, %13
store i32 %15, i32* %3
br label %5
16: ; preds = %5
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@.str = [6 x i8] c"%lld \00"
define i32 @prod_from_fileptr(i32* nocapture %0) {
%2 = alloca i32
%3 = call i32 @feof(i32* %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %14
5: ; preds = %1
%6 = bitcast i32* %2 to i8*
br label %7
7: ; preds = %5, %7
%8 = phi i32 [ 1, %5 ], [ %11, %7 ]
%9 = call i32 @fscanf(i32* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2)
%10 = load i32, i32* %2
%11 = mul nsw i32 %10, %8
%12 = call i32 @feof(i32* %0)
%13 = icmp eq i32 %12, 0
br i1 %13, label %7, label %14
14: ; preds = %7, %1
%15 = phi i32 [ 1, %1 ], [ %11, %7 ]
ret i32 %15
}
int is_num(double a) { return (a == a) && ((a - a) == 0.0); }


x86 assembly (clang, -O0):
<is_num>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xor    %eax,%eax
ucomisd -0x8(%rbp),%xmm0
mov    %al,-0x9(%rbp)
jne    1140 <is_num+0x40>
jp     1140 <is_num+0x40>
movsd  -0x8(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_num>:
ucomisd %xmm0,%xmm0
setnp  %al
subsd  %xmm0,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
setnp  %cl
sete   %dl
and    %cl,%dl
and    %al,%dl
movzbl %dl,%eax
ret

LLVM IR (-O0):
define i32 @is_num(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fcmp oeq double %3, %4
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load double, double* %2
%8 = load double, double* %2
%9 = fsub double %7, %8
%10 = fcmp oeq double %9, 0.000000e+00
br label %11
11: ; preds = %6, %1
%12 = phi i1 [ false, %1 ], [ %10, %6 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @is_num(double %0) {
%2 = fcmp ord double %0, 0.000000e+00
%3 = fsub double %0, %0
%4 = fcmp oeq double %3, 0.000000e+00
%5 = and i1 %2, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
long sum(int *, int);
int main() {
  int marbles[10] = {20, 10, 5, 39, 4, 16, 19, 26, 31, 20};
  long answer;
  answer = sum(marbles, 10);
  printf("The total number of marbles is %ld.\n", answer);
  printf("The size of marbles is %u bytes.\n", sizeof marbles);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1050 <sum@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    %eax,%esi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
mov    $0x28,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0xa,%esi
call   1040 <sum@plt>
lea    0xecd(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
lea    0xee4(%rip),%rdi
mov    $0x28,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.marbles = [10 x i32] [i32 20, i32 10, i32 5, i32 39, i32 4, i32 16, i32 19, i32 26, i32 31, i32 20]
@.str = [37 x i8] c"The total number of marbles is %ld.\0A\00"
@.str.1 = [34 x i8] c"The size of marbles is %u bytes.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca i64
store i32 0, i32* %1
%4 = bitcast [10 x i32]* %2 to i8*
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%6 = call i64 @sum(i32* %5, i32 10)
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = trunc i64 %7 to i32
%9 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i32 40)
ret i32 0
}

LLVM IR (-O2):
@__const.main.marbles = [10 x i32] [i32 20, i32 10, i32 5, i32 39, i32 4, i32 16, i32 19, i32 26, i32 31, i32 20]
@.str = [37 x i8] c"The total number of marbles is %ld.\0A\00"
@.str.1 = [34 x i8] c"The size of marbles is %u bytes.\0A\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i64 @sum(i32* %3, i32 10)
%5 = trunc i64 %4 to i32
%6 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i32 40)
ret i32 0
}
/* Type definitions */
struct session {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ socket_printf(struct session *, int, char *, int, int, int);
int /*<<< orphan*/ telopt_debug(struct session *, char *);
int send_wont_oldenviron(struct session *ses, int cplen, unsigned char *cpsrc) {
  socket_printf(ses, 3, "%c%c%c", 255, 252, 36);
  telopt_debug(ses, "SENT IAC WONT OLD_ENVIRON");
  return 3;
}


x86 assembly (clang, -O0):
<send_wont_oldenviron>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x3,%esi
lea    0xebd(%rip),%rdx
mov    $0xff,%ecx
mov    $0xfc,%r8d
mov    $0x24,%r9d
call   1040 <socket_printf@plt>
mov    -0x8(%rbp),%rdi
lea    0xea3(%rip),%rsi
call   1030 <telopt_debug@plt>
mov    $0x3,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_wont_oldenviron>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdx
mov    $0x3,%esi
mov    $0xff,%ecx
mov    $0xfc,%r8d
mov    $0x24,%r9d
call   1040 <socket_printf@plt>
lea    0xeba(%rip),%rsi
mov    %rbx,%rdi
call   1030 <telopt_debug@plt>
mov    $0x3,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.session = type { i32 }
@.str = [7 x i8] c"%c%c%c\00"
@.str.1 = [26 x i8] c"SENT IAC WONT OLD_ENVIRON\00"
define i32 @send_wont_oldenviron(%struct.session* %0, i32 %1, i8* %2) {
%4 = alloca %struct.session*
%5 = alloca i32
%6 = alloca i8*
store %struct.session* %0, %struct.session** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load %struct.session*, %struct.session** %4
%8 = call i32 @socket_printf(%struct.session* %7, i32 3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 255, i32 252, i32 36)
%9 = load %struct.session*, %struct.session** %4
%10 = call i32 @telopt_debug(%struct.session* %9, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret i32 3
}

LLVM IR (-O2):
%struct.session = type { i32 }
@.str = [7 x i8] c"%c%c%c\00"
@.str.1 = [26 x i8] c"SENT IAC WONT OLD_ENVIRON\00"
define i32 @send_wont_oldenviron(%struct.session* %0, i32 %1, i8* nocapture readnone %2) {
%4 = tail call i32 @socket_printf(%struct.session* %0, i32 3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 255, i32 252, i32 36)
%5 = tail call i32 @telopt_debug(%struct.session* %0, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret i32 3
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
int /*<<< orphan*/ insert8(int);
int simple(int code, char *label, char *mnemo, char *oper) {
  if (code & 0xff00)
    insert8(code >> 8);
  insert8(code);
  if (oper)
    error("no operands allowed");
  return 0;
}


x86 assembly (clang, -O0):
<simple>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff00,%eax
cmp    $0x0,%eax
je     1153 <simple+0x33>
mov    -0x4(%rbp),%edi
sar    $0x8,%edi
call   1030 <insert8@plt>
mov    -0x4(%rbp),%edi
call   1030 <insert8@plt>
cmpq   $0x0,-0x20(%rbp)
je     1172 <simple+0x52>
lea    0xe93(%rip),%rdi
call   1040 <error@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<simple>:
push   %rbp
push   %rbx
push   %rax
mov    %rcx,%rbx
mov    %edi,%ebp
test   $0xff00,%edi
je     113a <simple+0x1a>
mov    %ebp,%edi
sar    $0x8,%edi
call   1030 <insert8@plt>
mov    %ebp,%edi
call   1030 <insert8@plt>
test   %rbx,%rbx
je     1152 <simple+0x32>
lea    0xeb3(%rip),%rdi
call   1040 <error@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [20 x i8] c"no operands allowed\00"
define i32 @simple(i32 %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i32 %0, i32* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i32, i32* %5
%10 = and i32 %9, 65280
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %4
%13 = load i32, i32* %5
%14 = ashr i32 %13, 8
%15 = call i32 @insert8(i32 %14)
br label %16
16: ; preds = %12, %4
%17 = load i32, i32* %5
%18 = call i32 @insert8(i32 %17)
%19 = load i8*, i8** %8
%20 = icmp ne i8* %19, null
br i1 %20, label %21, label %23
21: ; preds = %16
%22 = call i32 @error(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %23
23: ; preds = %21, %16
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"no operands allowed\00"
define i32 @simple(i32 %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i8* readnone %3) {
%5 = and i32 %0, 65280
%6 = icmp eq i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %4
%8 = ashr i32 %0, 8
%9 = tail call i32 @insert8(i32 %8)
br label %10
10: ; preds = %7, %4
%11 = tail call i32 @insert8(i32 %0)
%12 = icmp eq i8* %3, null
br i1 %12, label %15, label %13
13: ; preds = %10
%14 = tail call i32 @error(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %13, %10
ret i32 0
}