xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ ULLONG_MAX;
int kcn_strtoull(char const *, int /*<<< orphan*/, int /*<<< orphan*/,
                 unsigned long long *);
bool kcn_eq_val_aton(const char *w, unsigned long long *valp) {
  return kcn_strtoull(w, 0, ULLONG_MAX, valp);
}


x86 assembly (clang, -O0):
<kcn_eq_val_aton>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ebd(%rip),%rax
mov    (%rax),%edx
mov    -0x10(%rbp),%rcx
xor    %esi,%esi
call   1030 <kcn_strtoull@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kcn_eq_val_aton>:
mov    %rsi,%rcx
mov    0x2ece(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
jmp    1030 <kcn_strtoull@plt>

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

LLVM IR (-O2):
@ULLONG_MAX = global i32 0
define i32 @kcn_eq_val_aton(i8* %0, i64* %1) {
%3 = load i32, i32* @ULLONG_MAX
%4 = tail call i32 @kcn_strtoull(i8* %0, i32 0, i32 %3, i64* %1)
ret i32 %4
}
g(x, y) {
  if (x != 3)
    abort();
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     112d <g+0x1d>
call   1030 <abort@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
cmp    $0x3,%edi
jne    1116 <g+0x6>
ret
push   %rax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define i32 @g(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 3
br i1 %3, label %5, label %4
4: ; preds = %2
tail call void @abort()
unreachable
5: ; preds = %2
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ link_error();
void f6(unsigned short int s) {
  if ((unsigned short int)s == 0)
    return;
  if (s == 0)
    link_error();
}


x86 assembly (clang, -O0):
<f6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
cmp    $0x0,%eax
jne    1131 <f6+0x21>
jmp    1145 <f6+0x35>
movzwl -0x2(%rbp),%eax
cmp    $0x0,%eax
jne    1145 <f6+0x35>
mov    $0x0,%al
call   1030 <link_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f6(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
br label %13
7: ; preds = %1
%8 = load i16, i16* %2
%9 = zext i16 %8 to i32
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %7
%12 = call i32 (...) @link_error()
br label %13
13: ; preds = %6, %11, %7
ret void
}

LLVM IR (-O2):
define void @f6(i16 zeroext %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void twiddle(void) {
  static int pos;
  putchar("|/-\\"[pos++ & 3]);
  putchar('\b');
}


x86 assembly (clang, -O0):
<twiddle>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f12(%rip),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,0x2f07(%rip)
and    $0x3,%eax
movslq %eax,%rcx
lea    0xece(%rip),%rax
movsbl (%rax,%rcx,1),%edi
call   1030 <putchar@plt>
mov    $0x8,%edi
call   1030 <putchar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<twiddle>:
push   %rax
mov    0x2f15(%rip),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x2f0c(%rip)
and    $0x3,%eax
lea    0xed6(%rip),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <putchar@plt>
mov    $0x8,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@twiddle.pos = internal global i32 0
@.str = [5 x i8] c"|/-\\\00"
define void @twiddle() {
%1 = load i32, i32* @twiddle.pos
%2 = add nsw i32 %1, 1
store i32 %2, i32* @twiddle.pos
%3 = and i32 %1, 3
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds [5 x i8], [5 x i8]* @.str, i64 0, i64 %4
%6 = load i8, i8* %5
%7 = call i32 @putchar(i8 signext %6)
%8 = call i32 @putchar(i8 signext 8)
ret void
}

LLVM IR (-O2):
@twiddle.pos = internal unnamed_addr global i32 0
@.str = [5 x i8] c"|/-\\\00"
define void @twiddle() {
%1 = load i32, i32* @twiddle.pos
%2 = add nsw i32 %1, 1
store i32 %2, i32* @twiddle.pos
%3 = and i32 %1, 3
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds [5 x i8], [5 x i8]* @.str, i64 0, i64 %4
%6 = load i8, i8* %5
%7 = tail call i32 @putchar(i8 signext %6)
%8 = tail call i32 @putchar(i8 signext 8)
ret void
}
int d_eq_rc2(double a1) { return !(((a1) == (100))); }


x86 assembly (clang, -O0):
<d_eq_rc2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_eq_rc2>:
cmpneqsd 0xef7(%rip),%xmm0
movq   %xmm0,%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @d_eq_rc2(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp oeq double %3, 1.000000e+02
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @d_eq_rc2(double %0) {
%2 = fcmp une double %0, 1.000000e+02
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
long double sinl(long double);
long double sind(long double x) {
  return sinl(x / 180.0L * 3.141592653589793238462643383279502884L);
}


x86 assembly (clang, -O0):
<sind>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
flds   0xed9(%rip)
fdivrp %st,%st(1)
fldt   0xee1(%rip)
fmulp  %st,%st(1)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <sinl@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sind>:
sub    $0x18,%rsp
fldt   0x20(%rsp)
fdivs  0xee2(%rip)
fldt   0xeec(%rip)
fmulp  %st,%st(1)
fstpt  (%rsp)
call   1030 <sinl@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @sind(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fdiv x86_fp80 %3, 0xK4006B400000000000000
%5 = fmul x86_fp80 %4, 0xK4000C90FDAA22168C235
%6 = call x86_fp80 @sinl(x86_fp80 %5)
ret x86_fp80 %6
}

LLVM IR (-O2):
define x86_fp80 @sind(x86_fp80 %0) {
%2 = fdiv x86_fp80 %0, 0xK4006B400000000000000
%3 = fmul x86_fp80 %2, 0xK4000C90FDAA22168C235
%4 = tail call x86_fp80 @sinl(x86_fp80 %3)
ret x86_fp80 %4
}
double f11(double x) {
  double tmp1 = 7.5;
  double tmp2 = __builtin_copysign(2.0, x);
  double tmp3 = tmp2 * 24.0;
  return tmp1 * tmp2;
}


x86 assembly (clang, -O0):
<f11>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xef7(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movaps 0xeee(%rip),%xmm1
pand   %xmm1,%xmm0
movaps 0xef3(%rip),%xmm1
por    %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xec2(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f11>:
andpd  0xef8(%rip),%xmm0
orpd   0xf00(%rip),%xmm0
mulsd  0xf08(%rip),%xmm0
ret

LLVM IR (-O0):
define double @f11(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %2
store double 7.500000e+00, double* %3
%6 = load double, double* %2
%7 = call double @llvm.copysign.f64(double 2.000000e+00, double %6)
store double %7, double* %4
%8 = load double, double* %4
%9 = fmul double %8, 2.400000e+01
store double %9, double* %5
%10 = load double, double* %3
%11 = load double, double* %4
%12 = fmul double %10, %11
ret double %12
}

LLVM IR (-O2):
define double @f11(double %0) {
%2 = tail call double @llvm.copysign.f64(double 2.000000e+00, double %0)
%3 = fmul double %2, 7.500000e+00
ret double %3
}
/* Variables and functions */
int __builtin_ptx_read_ctaid_w();
int __builtin_ptx_read_ctaid_x();
int __builtin_ptx_read_ctaid_y();
int __builtin_ptx_read_ctaid_z();
int read_ctaid() {
  int x = __builtin_ptx_read_ctaid_x();
  int y = __builtin_ptx_read_ctaid_y();
  int z = __builtin_ptx_read_ctaid_z();
  int w = __builtin_ptx_read_ctaid_w();
  return x + y + z + w;
}


x86 assembly (clang, -O0):
<read_ctaid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <__builtin_ptx_read_ctaid_x@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1050 <__builtin_ptx_read_ctaid_y@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <__builtin_ptx_read_ctaid_z@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1060 <__builtin_ptx_read_ctaid_w@plt>
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_ctaid>:
push   %rbp
push   %r14
push   %rbx
xor    %eax,%eax
call   1030 <__builtin_ptx_read_ctaid_x@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1050 <__builtin_ptx_read_ctaid_y@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1040 <__builtin_ptx_read_ctaid_z@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1060 <__builtin_ptx_read_ctaid_w@plt>
add    %r14d,%ebp
add    %ebx,%ebp
add    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @read_ctaid() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = call i32 (...) @__builtin_ptx_read_ctaid_x()
store i32 %5, i32* %1
%6 = call i32 (...) @__builtin_ptx_read_ctaid_y()
store i32 %6, i32* %2
%7 = call i32 (...) @__builtin_ptx_read_ctaid_z()
store i32 %7, i32* %3
%8 = call i32 (...) @__builtin_ptx_read_ctaid_w()
store i32 %8, i32* %4
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = add nsw i32 %9, %10
%12 = load i32, i32* %3
%13 = add nsw i32 %11, %12
%14 = load i32, i32* %4
%15 = add nsw i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @read_ctaid() {
%1 = tail call i32 (...) @__builtin_ptx_read_ctaid_x()
%2 = tail call i32 (...) @__builtin_ptx_read_ctaid_y()
%3 = tail call i32 (...) @__builtin_ptx_read_ctaid_z()
%4 = tail call i32 (...) @__builtin_ptx_read_ctaid_w()
%5 = add nsw i32 %2, %1
%6 = add nsw i32 %5, %3
%7 = add nsw i32 %6, %4
ret i32 %7
}
void XRemoveFromSaveSet() {}


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

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

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

LLVM IR (-O2):
define void @XRemoveFromSaveSet() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void move_cursor_to_next_line() { fputs("\033e", stdout); }


x86 assembly (clang, -O0):
<move_cursor_to_next_line>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<move_cursor_to_next_line>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
lea    0xee0(%rip),%rdi
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"\1Be\00"
@stdout = global i32 0
define void @move_cursor_to_next_line() {
%1 = load i32, i32* @stdout
%2 = call i32 @fputs(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"\1Be\00"
@stdout = global i32 0
define void @move_cursor_to_next_line() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
unsigned SetAlpha(const unsigned int color, const unsigned int alpha) {
  return ((color & 0x00FFFFFF) | (alpha << 24));
}


x86 assembly (clang, -O0):
<SetAlpha>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffffff,%eax
mov    -0x8(%rbp),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetAlpha>:
and    $0xffffff,%edi
shl    $0x18,%esi
lea    (%rsi,%rdi,1),%eax
ret

LLVM IR (-O0):
define i32 @SetAlpha(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 = and i32 %5, 16777215
%7 = load i32, i32* %4
%8 = shl i32 %7, 24
%9 = or i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @SetAlpha(i32 %0, i32 %1) {
%3 = and i32 %0, 16777215
%4 = shl i32 %1, 24
%5 = or i32 %4, %3
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
void populateArray(int8_t array[], int8_t number) {
  for (int i = 0; i < 16; i++) {
    array[i] = number;
  }
  return;
}


x86 assembly (clang, -O0):
<populateArray>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x10,-0x10(%rbp)
jge    1138 <populateArray+0x38>
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <populateArray+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<populateArray>:
movd   %esi,%xmm0
pshufd $0x0,%xmm0,%xmm0
movdqu %xmm0,(%rdi)
movdqu %xmm0,0x10(%rdi)
movdqu %xmm0,0x20(%rdi)
movdqu %xmm0,0x30(%rdi)
ret

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

LLVM IR (-O2):
define void @populateArray(i32* nocapture writeonly %0, i32 %1) {
%3 = insertelement <4 x i32> poison, i32 %1, i64 0
%4 = shufflevector <4 x i32> %3, <4 x i32> poison, <4 x i32> zeroinitializer
%5 = bitcast i32* %0 to <4 x i32>*
store <4 x i32> %4, <4 x i32>* %5
%6 = getelementptr inbounds i32, i32* %0, i64 4
%7 = bitcast i32* %6 to <4 x i32>*
store <4 x i32> %4, <4 x i32>* %7
%8 = getelementptr inbounds i32, i32* %0, i64 8
%9 = bitcast i32* %8 to <4 x i32>*
store <4 x i32> %4, <4 x i32>* %9
%10 = getelementptr inbounds i32, i32* %0, i64 12
%11 = bitcast i32* %10 to <4 x i32>*
store <4 x i32> %4, <4 x i32>* %11
ret void
}
/* Variables and functions */
int isqrt4(long const);
__attribute__((const)) unsigned ihypot(int x, int y) {
  const long lx = x, ly = y;
  return isqrt4(lx * lx + ly * ly);
}


x86 assembly (clang, -O0):
<ihypot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movslq -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
movslq -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
imul   -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rax
imul   -0x18(%rbp),%rax
add    %rax,%rdi
call   1030 <isqrt4@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ihypot>:
movslq %edi,%rax
movslq %esi,%rdi
imul   %rax,%rax
imul   %rdi,%rdi
add    %rax,%rdi
jmp    1030 <isqrt4@plt>

LLVM IR (-O0):
define i32 @ihypot(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
%6 = alloca i64
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
store i64 %8, i64* %5
%9 = load i32, i32* %4
%10 = sext i32 %9 to i64
store i64 %10, i64* %6
%11 = load i64, i64* %5
%12 = load i64, i64* %5
%13 = mul nsw i64 %11, %12
%14 = load i64, i64* %6
%15 = load i64, i64* %6
%16 = mul nsw i64 %14, %15
%17 = add nsw i64 %13, %16
%18 = call i32 @isqrt4(i64 %17)
ret i32 %18
}

LLVM IR (-O2):
define i32 @ihypot(i32 %0, i32 %1) {
%3 = sext i32 %0 to i64
%4 = sext i32 %1 to i64
%5 = mul nsw i64 %3, %3
%6 = mul nsw i64 %4, %4
%7 = add nuw nsw i64 %6, %5
%8 = tail call i32 @isqrt4(i64 %7)
ret i32 %8
}
int division(int val1, int val2) { return (val1 / val2); }


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

x86 assembly (clang, -O2):
<division>:
mov    %edi,%eax
cltd
idiv   %esi
ret

LLVM IR (-O0):
define i32 @division(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 = sdiv i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @division(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
ret i32 %3
}
/* Variables and functions */
int numa_num_possible_nodes();
int numa_max_possible_node_v2(void) { return numa_num_possible_nodes() - 1; }


x86 assembly (clang, -O0):
<numa_max_possible_node_v2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <numa_num_possible_nodes@plt>
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<numa_max_possible_node_v2>:
push   %rax
xor    %eax,%eax
call   1030 <numa_num_possible_nodes@plt>
add    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @numa_max_possible_node_v2() {
%1 = call i32 (...) @numa_num_possible_nodes()
%2 = sub nsw i32 %1, 1
ret i32 %2
}

LLVM IR (-O2):
define i32 @numa_max_possible_node_v2() {
%1 = tail call i32 (...) @numa_num_possible_nodes()
%2 = add nsw i32 %1, -1
ret i32 %2
}
void CholeskyDecomposition(double *A, int n, double **L) {}


x86 assembly (clang, -O0):
<CholeskyDecomposition>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @CholeskyDecomposition(double* nocapture %0, i32 %1, double** nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ init_pair_precomp_param();
int /*<<< orphan*/ init_single_param();
void tersoff2_param_init() {
  init_single_param();
  init_pair_precomp_param();
}


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

x86 assembly (clang, -O2):
<tersoff2_param_init>:
push   %rax
xor    %eax,%eax
call   1040 <init_single_param@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <init_pair_precomp_param@plt>

LLVM IR (-O0):
define void @tersoff2_param_init() {
%1 = call i32 (...) @init_single_param()
%2 = call i32 (...) @init_pair_precomp_param()
ret void
}

LLVM IR (-O2):
define void @tersoff2_param_init() {
%1 = tail call i32 (...) @init_single_param()
%2 = tail call i32 (...) @init_pair_precomp_param()
ret void
}
void validate_proc_schedule(void) {}


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

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

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

LLVM IR (-O2):
define void @validate_proc_schedule() {
ret void
}
unsigned xrop3_234_0_1(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 = T & S;
  stk1 = D | stk2;
  return (stk1 & S) | (stk1 & (~T)) | (T & (~S) & D);
}


x86 assembly (clang, -O0):
<xrop3_234_0_1>:
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    -0x10(%rbp),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    -0xc(%rbp),%eax
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
and    -0x8(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_234_0_1>:
mov    %esi,%ecx
and    %edi,%ecx
shl    $0x8,%ecx
mov    %esi,%eax
xor    $0xff,%eax
or     %edi,%eax
or     %ecx,%eax
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_234_0_1(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* %7
%23 = load i32, i32* %6
%24 = and i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %5
%26 = load i32, i32* %9
%27 = or i32 %25, %26
store i32 %27, i32* %8
%28 = load i32, i32* %8
%29 = load i32, i32* %6
%30 = and i32 %28, %29
%31 = load i32, i32* %8
%32 = load i32, i32* %7
%33 = xor i32 %32, -1
%34 = and i32 %31, %33
%35 = or i32 %30, %34
%36 = load i32, i32* %7
%37 = load i32, i32* %6
%38 = xor i32 %37, -1
%39 = and i32 %36, %38
%40 = load i32, i32* %5
%41 = and i32 %39, %40
%42 = or i32 %35, %41
ret i32 %42
}

LLVM IR (-O2):
define i32 @xrop3_234_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = zext i8 %1 to i32
%5 = and i8 %1, %0
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = xor i32 %4, 255
%9 = or i32 %8, %3
%10 = or i32 %9, %7
%11 = or i32 %10, %4
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ matrix3_copy(double ***, double ***, int, int, int);
double ***new_matrix3(int, int, int);
double ***matrix3_clone(double ***X, int n, int m, int p) {
  double ***Y = new_matrix3(n, m, p);
  matrix3_copy(Y, X, n, m, p);
  return Y;
}


x86 assembly (clang, -O0):
<matrix3_clone>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1030 <new_matrix3@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
call   1040 <matrix3_copy@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<matrix3_clone>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %ecx,%r14d
mov    %edx,%r12d
mov    %esi,%ebx
mov    %rdi,%r15
mov    %esi,%edi
mov    %edx,%esi
mov    %ecx,%edx
call   1030 <new_matrix3@plt>
mov    %rax,%rbp
mov    %rax,%rdi
mov    %r15,%rsi
mov    %ebx,%edx
mov    %r12d,%ecx
mov    %r14d,%r8d
call   1040 <matrix3_copy@plt>
mov    %rbp,%rax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define double*** @matrix3_clone(double*** %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca double***
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca double***
store double*** %0, double**** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call double*** @new_matrix3(i32 %10, i32 %11, i32 %12)
store double*** %13, double**** %9
%14 = load double***, double**** %9
%15 = load double***, double**** %5
%16 = load i32, i32* %6
%17 = load i32, i32* %7
%18 = load i32, i32* %8
%19 = call i32 @matrix3_copy(double*** %14, double*** %15, i32 %16, i32 %17, i32 %18)
%20 = load double***, double**** %9
ret double*** %20
}

LLVM IR (-O2):
define double*** @matrix3_clone(double*** %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call double*** @new_matrix3(i32 %1, i32 %2, i32 %3)
%6 = tail call i32 @matrix3_copy(double*** %5, double*** %0, i32 %1, i32 %2, i32 %3)
ret double*** %5
}
/* Type definitions */
struct expression {
  int dummy;
};

/* Variables and functions */
int show_inc_dec(struct expression *, int);
int show_postop(struct expression *expr) { return show_inc_dec(expr, 1); }


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

x86 assembly (clang, -O2):
<show_postop>:
mov    $0x1,%esi
jmp    1030 <show_inc_dec@plt>

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

LLVM IR (-O2):
%struct.expression = type { i32 }
define i32 @show_postop(%struct.expression* %0) {
%2 = tail call i32 @show_inc_dec(%struct.expression* %0, i32 1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_pstream_set_die_callback() {
  printf("NOT IMPLEMENTED:"
         "pa_pstream_set_die_callback"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [45 x i8] c"NOT IMPLEMENTED:pa_pstream_set_die_callback\0A\00"
define i32 @pa_pstream_set_die_callback() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [44 x i8] c"NOT IMPLEMENTED:pa_pstream_set_die_callback\00"
define i32 @pa_pstream_set_die_callback() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ escape_buf(int, char *);
int /*<<< orphan*/ m_putc(int, char);
int field_escape(int s2, char *s, int quotes) {
  if (quotes)
    m_putc(s2, '\'');
  escape_buf(s2, s);
  if (quotes)
    m_putc(s2, '\'');
  return s2;
}


x86 assembly (clang, -O0):
<field_escape>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1149 <field_escape+0x29>
mov    -0x4(%rbp),%edi
mov    $0x27,%esi
call   1040 <m_putc@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <escape_buf@plt>
cmpl   $0x0,-0x14(%rbp)
je     116c <field_escape+0x4c>
mov    -0x4(%rbp),%edi
mov    $0x27,%esi
call   1040 <m_putc@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<field_escape>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %edi,%ebx
test   %edx,%edx
je     114f <field_escape+0x2f>
mov    $0x27,%esi
call   1040 <m_putc@plt>
mov    %ebx,%edi
mov    %r14,%rsi
call   1030 <escape_buf@plt>
mov    %ebx,%edi
mov    $0x27,%esi
call   1040 <m_putc@plt>
jmp    1157 <field_escape+0x37>
mov    %r14,%rsi
call   1030 <escape_buf@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @field_escape(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %3
%10 = load i32, i32* %4
%11 = call i32 @m_putc(i32 %10, i8 signext 39)
br label %12
12: ; preds = %9, %3
%13 = load i32, i32* %4
%14 = load i8*, i8** %5
%15 = call i32 @escape_buf(i32 %13, i8* %14)
%16 = load i32, i32* %6
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %21
18: ; preds = %12
%19 = load i32, i32* %4
%20 = call i32 @m_putc(i32 %19, i8 signext 39)
br label %21
21: ; preds = %18, %12
%22 = load i32, i32* %4
ret i32 %22
}

LLVM IR (-O2):
define i32 @field_escape(i32 returned %0, i8* %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %9, label %5
5: ; preds = %3
%6 = tail call i32 @m_putc(i32 %0, i8 signext 39)
%7 = tail call i32 @escape_buf(i32 %0, i8* %1)
%8 = tail call i32 @m_putc(i32 %0, i8 signext 39)
br label %11
9: ; preds = %3
%10 = tail call i32 @escape_buf(i32 %0, i8* %1)
br label %11
11: ; preds = %9, %5
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ lowercase(int /*<<< orphan*/);
char *mklower(char *str) {
  char *sp;
  sp = str;
  while (*sp)
    lowercase(sp++);
  return (str);
}


x86 assembly (clang, -O0):
<mklower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     114c <mklower+0x3c>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    %eax,%edi
call   1030 <lowercase@plt>
jmp    1124 <mklower+0x14>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mklower>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
cmpb   $0x0,(%rdi)
je     1143 <mklower+0x33>
lea    0x1(%r14),%rbx
mov    %r14d,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebp,%edi
call   1030 <lowercase@plt>
add    $0x1,%ebp
cmpb   $0x0,(%rbx)
lea    0x1(%rbx),%rbx
jne    1130 <mklower+0x20>
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @mklower(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %9, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %5
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %3
%12 = ptrtoint i8* %10 to i32
%13 = call i32 @lowercase(i32 %12)
br label %5
14: ; preds = %5
%15 = load i8*, i8** %2
ret i8* %15
}

LLVM IR (-O2):
define i8* @mklower(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %6, %4 ], [ %0, %1 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = ptrtoint i8* %5 to i64
%8 = trunc i64 %7 to i32
%9 = tail call i32 @lowercase(i32 %8)
%10 = load i8, i8* %6
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret i8* %0
}
int is_in(double n) {
  return ((n != n || (n == 1.0 / 0.0) || (n == -1.0 / 0.0)));
}


x86 assembly (clang, -O0):
<is_in>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x1,%al
ucomisd -0x8(%rbp),%xmm0
mov    %al,-0x9(%rbp)
jne    1167 <is_in+0x67>
jp     1167 <is_in+0x67>
movsd  -0x8(%rbp),%xmm0
mov    $0x1,%al
movsd  0xecd(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x9(%rbp)
jne    114b <is_in+0x4b>
jp     114b <is_in+0x4b>
jmp    1167 <is_in+0x67>
movsd  -0x8(%rbp),%xmm0
movsd  0xeb0(%rip),%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_in>:
ucomisd %xmm0,%xmm0
setp   %al
ucomisd 0xef1(%rip),%xmm0
setae  %cl
or     %al,%cl
movsd  0xeec(%rip),%xmm1
ucomisd %xmm0,%xmm1
setae  %al
or     %cl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @is_in(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fcmp une double %3, %4
br i1 %5, label %12, label %6
6: ; preds = %1
%7 = load double, double* %2
%8 = fcmp oeq double %7, 0x7FF0000000000000
br i1 %8, label %12, label %9
9: ; preds = %6
%10 = load double, double* %2
%11 = fcmp oeq double %10, 0xFFF0000000000000
br label %12
12: ; preds = %9, %6, %1
%13 = phi i1 [ true, %6 ], [ true, %1 ], [ %11, %9 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @is_in(double %0) {
%2 = fcmp uno double %0, 0.000000e+00
%3 = fcmp oeq double %0, 0x7FF0000000000000
%4 = or i1 %2, %3
%5 = fcmp oeq double %0, 0xFFF0000000000000
%6 = or i1 %5, %4
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
int /*<<< orphan*/ ntohl(int /*<<< orphan*/);
uint32_t unserial_uint32(uint8_t **const ptr) {
  uint32_t vo;
  memcpy(&vo, *ptr, sizeof vo);
  *ptr += sizeof vo;
  return ntohl(vo);
}


x86 assembly (clang, -O0):
<unserial_uint32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
lea    -0xc(%rbp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x10,%rcx
mov    %rcx,(%rax)
mov    -0xc(%rbp),%edi
call   1040 <ntohl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unserial_uint32>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    (%rdi),%rsi
lea    0xc(%rsp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
addq   $0x10,(%rbx)
mov    0xc(%rsp),%edi
call   1040 <ntohl@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @unserial_uint32(i32** %0) {
%2 = alloca i32**
%3 = alloca i32
store i32** %0, i32*** %2
%4 = load i32**, i32*** %2
%5 = load i32*, i32** %4
%6 = call i32 @memcpy(i32* %3, i32* %5, i32 4)
%7 = load i32**, i32*** %2
%8 = load i32*, i32** %7
%9 = getelementptr inbounds i32, i32* %8, i64 4
store i32* %9, i32** %7
%10 = load i32, i32* %3
%11 = call i32 @ntohl(i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @unserial_uint32(i32** nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i32*, i32** %0
%5 = call i32 @memcpy(i32* %2, i32* %4, i32 4)
%6 = load i32*, i32** %0
%7 = getelementptr inbounds i32, i32* %6, i64 4
store i32* %7, i32** %0
%8 = load i32, i32* %2
%9 = call i32 @ntohl(i32 %8)
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ system(char *);
int x12_teardown() {
  char cmd[256];
  sprintf(cmd,
          "iptables -D INPUT -p tcp -m multiport --sport 53,80 --tcp-flags "
          "SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d",
          1);
  system(cmd);
  return 0;
}


x86 assembly (clang, -O0):
<x12_teardown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    -0x100(%rbp),%rdi
lea    0xec7(%rip),%rsi
mov    $0x1,%edx
call   1040 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x12_teardown>:
push   %rbx
sub    $0x100,%rsp
lea    0xed1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [106 x i8] c"iptables -D INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x12_teardown() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%5 = call i32 @system(i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [106 x i8] c"iptables -D INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x12_teardown() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = call i32 @system(i8* %2)
ret i32 0
}
void ding() { return; }


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

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

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

LLVM IR (-O2):
define void @ding() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ utest_control();
void utest_adts_bits(void) {
  utest_control();
  return;
}


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

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

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

LLVM IR (-O2):
define void @utest_adts_bits() {
%1 = tail call i32 (...) @utest_control()
ret void
}
/* Variables and functions */
scalar_t__ __mriPlatform_CommIsWaitingForGdbToConnect();
void waitForFirstCharFromHost(void) {
  while (__mriPlatform_CommIsWaitingForGdbToConnect()) {
  }
}


x86 assembly (clang, -O0):
<waitForFirstCharFromHost>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <waitForFirstCharFromHost+0x9>
mov    $0x0,%al
call   1030 <__mriPlatform_CommIsWaitingForGdbToConnect@plt>
cmp    $0x0,%rax
je     112f <waitForFirstCharFromHost+0x1f>
jmp    1119 <waitForFirstCharFromHost+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<waitForFirstCharFromHost>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <__mriPlatform_CommIsWaitingForGdbToConnect@plt>
test   %rax,%rax
jne    1120 <waitForFirstCharFromHost+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @waitForFirstCharFromHost() {
br label %1
1: ; preds = %4, %0
%2 = call i64 (...) @__mriPlatform_CommIsWaitingForGdbToConnect()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %1
br label %1
5: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @waitForFirstCharFromHost() {
br label %1
1: ; preds = %1, %0
%2 = tail call i64 (...) @__mriPlatform_CommIsWaitingForGdbToConnect()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %1
4: ; preds = %1
ret void
}
float obdConvert_3C_3F(unsigned int A, unsigned int B, unsigned int C,
                       unsigned int D) {
  return ((float)A * 256.0f + (float)B) / 10.0f - 40.0f;
}


x86 assembly (clang, -O0):
<obdConvert_3C_3F>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cvtsi2ss %rax,%xmm0
mov    -0x8(%rbp),%eax
cvtsi2ss %rax,%xmm1
movss  0xee0(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  0xecc(%rip),%xmm1
divss  %xmm1,%xmm0
movss  0xebc(%rip),%xmm1
subss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<obdConvert_3C_3F>:
mov    %edi,%eax
cvtsi2ss %rax,%xmm0
mov    %esi,%eax
cvtsi2ss %rax,%xmm1
mulss  0xeea(%rip),%xmm0
addss  %xmm1,%xmm0
divss  0xee2(%rip),%xmm0
addss  0xede(%rip),%xmm0
ret

LLVM IR (-O0):
define float @obdConvert_3C_3F(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = uitofp i32 %9 to float
%11 = load i32, i32* %6
%12 = uitofp i32 %11 to float
%13 = call float @llvm.fmuladd.f32(float %10, float 2.560000e+02, float %12)
%14 = fdiv float %13, 1.000000e+01
%15 = fsub float %14, 4.000000e+01
ret float %15
}

LLVM IR (-O2):
define float @obdConvert_3C_3F(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = uitofp i32 %0 to float
%6 = uitofp i32 %1 to float
%7 = tail call float @llvm.fmuladd.f32(float %5, float 2.560000e+02, float %6)
%8 = fdiv float %7, 1.000000e+01
%9 = fadd float %8, -4.000000e+01
ret float %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int sheet_row_callback(size_t row, size_t maxcol, void *callbackdata) {
  printf("\n");
  printf("[[%i,%i]]\n", (int)row, (int)maxcol);
  return 0;
}


x86 assembly (clang, -O0):
<sheet_row_callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xede(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    %eax,%esi
mov    -0x10(%rbp),%rax
mov    %eax,%edx
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sheet_row_callback>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xec5(%rip),%rdi
mov    %ebx,%esi
mov    %r14d,%edx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [11 x i8] c"[[%i,%i]]\0A\00"
define i32 @sheet_row_callback(i64 %0, i64 %1, i8* %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i8*
store i64 %0, i64* %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%8 = load i64, i64* %4
%9 = trunc i64 %8 to i32
%10 = load i64, i64* %5
%11 = trunc i64 %10 to i32
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %9, i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [11 x i8] c"[[%i,%i]]\0A\00"
define i32 @sheet_row_callback(i64 %0, i64 %1, i8* nocapture readnone %2) {
%4 = tail call i32 @putchar(i32 10)
%5 = trunc i64 %0 to i32
%6 = trunc i64 %1 to i32
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %5, i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memmove(char *, char *, int);
void f4(int size) {
  char src[12] = "helloworld";
  char dest[12];
  if (size > 0)
    memmove(dest, src, size);
}


x86 assembly (clang, -O0):
<f4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xedc(%rip),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1149 <f4+0x39>
lea    -0x1c(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    -0x4(%rbp),%edx
call   1030 <memmove@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4>:
sub    $0x18,%rsp
movabs $0x726f776f6c6c6568,%rax
77 6f 72
mov    %rax,(%rsp)
movl   $0x646c,0x8(%rsp)
test   %edi,%edi
jle    113d <f4+0x2d>
mov    %edi,%edx
lea    0xc(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <memmove@plt>
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@__const.f4.src = [12 x i8] c"helloworld\00\00"
define void @f4(i32 %0) {
%2 = alloca [12 x i8]
%3 = alloca [12 x i8]
%4 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [12 x i8], [12 x i8]* %3, i64 0, i64 0
%6 = icmp sgt i32 %0, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @memmove(i8* %5, i8* %4, i32 %0)
br label %9
9: ; preds = %7, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ downheap(int *, int, int);
void heapify(int array[], int size) {
  for (int i = size - 1; i >= 0; i--) {
    int parent = (i - 1) / 2;
    downheap(array, size, parent);
  }
}


x86 assembly (clang, -O0):
<heapify>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     1160 <heapify+0x50>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1030 <downheap@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1128 <heapify+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<heapify>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1151 <heapify+0x41>
mov    %esi,%r15d
mov    %rdi,%r14
lea    0x1(%r15),%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    -0x3(%rbx),%eax
shr    $0x1f,%eax
lea    (%rbx,%rax,1),%edx
add    $0xfffffffd,%edx
sar    %edx
mov    %r14,%rdi
mov    %r15d,%esi
call   1030 <downheap@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1130 <heapify+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @heapify(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %5, label %4
4: ; preds = %5, %2
ret void
5: ; preds = %2, %5
%6 = phi i32 [ %7, %5 ], [ %1, %2 ]
%7 = add nsw i32 %6, -1
%8 = add nsw i32 %6, -2
%9 = sdiv i32 %8, 2
%10 = tail call i32 @downheap(i32* %0, i32 %1, i32 %9)
%11 = icmp ugt i32 %6, 1
br i1 %11, label %5, label %4
}
void ff_hevc_put_hevc_qpel_v16_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_qpel_v16_10_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ calculate_sec(int, int *, int *, int *);
void test1(void) {
  int input_sec = 4000;
  int sec, min, hr;
  calculate_sec(input_sec, &sec, &min, &hr);
  assert(hr == 1);
  assert(min == 6);
  assert(sec == 40);
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xfa0,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1030 <calculate_sec@plt>
cmpl   $0x1,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
cmpl   $0x6,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
cmpl   $0x28,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
sub    $0x18,%rsp
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
mov    $0xfa0,%edi
call   1030 <calculate_sec@plt>
xor    %edi,%edi
cmpl   $0x1,0xc(%rsp)
sete   %dil
call   1040 <assert@plt>
xor    %edi,%edi
cmpl   $0x6,0x10(%rsp)
sete   %dil
call   1040 <assert@plt>
xor    %edi,%edi
cmpl   $0x28,0x14(%rsp)
sete   %dil
call   1040 <assert@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @test1() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 4000, i32* %1
%5 = load i32, i32* %1
%6 = call i32 @calculate_sec(i32 %5, i32* %2, i32* %3, i32* %4)
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 1
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = load i32, i32* %3
%12 = icmp eq i32 %11, 6
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = load i32, i32* %2
%16 = icmp eq i32 %15, 40
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
ret void
}

LLVM IR (-O2):
define void @test1() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 @calculate_sec(i32 4000, i32* %1, i32* %2, i32* %3)
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 1
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load i32, i32* %2
%13 = icmp eq i32 %12, 6
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
%16 = load i32, i32* %1
%17 = icmp eq i32 %16, 40
%18 = zext i1 %17 to i32
%19 = call i32 @assert(i32 %18)
ret void
}