xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ arm_arith_sub(int /*<<< orphan*/);
int /*<<< orphan*/ t16_data_reg_op();
void t16_sub_reg() { arm_arith_sub(t16_data_reg_op()); }


x86 assembly (clang, -O0):
<t16_sub_reg>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <t16_data_reg_op@plt>
mov    %eax,%edi
call   1030 <arm_arith_sub@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t16_sub_reg>:
push   %rax
xor    %eax,%eax
call   1040 <t16_data_reg_op@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <arm_arith_sub@plt>

LLVM IR (-O0):
define void @t16_sub_reg() {
%1 = call i32 (...) @t16_data_reg_op()
%2 = call i32 @arm_arith_sub(i32 %1)
ret void
}

LLVM IR (-O2):
define void @t16_sub_reg() {
%1 = tail call i32 (...) @t16_data_reg_op()
%2 = tail call i32 @arm_arith_sub(i32 %1)
ret void
}
double reduc(x)
double x;
{
  double t;
  t = cephes_ldexp(x, 4);
  t = floor(t);
  t = cephes_ldexp(t, -4);
  return (t);
}


x86 assembly (clang, -O0):
<reduc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x4,%edi
mov    $0x1,%al
call   1030 <cephes_ldexp@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <floor@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    $0xfffffffc,%edi
mov    $0x1,%al
call   1030 <cephes_ldexp@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reduc>:
push   %rax
mov    $0x4,%edi
mov    $0x1,%al
call   1030 <cephes_ldexp@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mov    $0xfffffffc,%edi
mov    $0x1,%al
call   1030 <cephes_ldexp@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @reduc(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call i32 (double, i32, ...) bitcast (i32 (...)* @cephes_ldexp to i32 (double, i32, ...)*)(double %4, i32 4)
%6 = sitofp i32 %5 to double
store double %6, double* %3
%7 = load double, double* %3
%8 = call double @llvm.floor.f64(double %7)
store double %8, double* %3
%9 = load double, double* %3
%10 = call i32 (double, i32, ...) bitcast (i32 (...)* @cephes_ldexp to i32 (double, i32, ...)*)(double %9, i32 -4)
%11 = sitofp i32 %10 to double
store double %11, double* %3
%12 = load double, double* %3
ret double %12
}

LLVM IR (-O2):
define double @reduc(double %0) {
%2 = tail call i32 (double, i32, ...) bitcast (i32 (...)* @cephes_ldexp to i32 (double, i32, ...)*)(double %0, i32 4)
%3 = sitofp i32 %2 to double
%4 = tail call i32 (double, i32, ...) bitcast (i32 (...)* @cephes_ldexp to i32 (double, i32, ...)*)(double %3, i32 -4)
%5 = sitofp i32 %4 to double
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void foo(int a, int b, int c, int d, int e, int f, int g) { assert(g == -1); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
cmpl   $0xffffffff,0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
xor    %edi,%edi
cmpl   $0xffffffff,0x8(%rsp)
sete   %dil
jmp    1030 <assert@plt>

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

LLVM IR (-O2):
define void @foo(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = icmp eq i32 %6, -1
%9 = zext i1 %8 to i32
%10 = tail call i32 @assert(i32 %9)
ret void
}
int rfbi_init_platform_driver(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @rfbi_init_platform_driver() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ cont(int, int);
int /*<<< orphan*/ move_nasko(int, int);
int line(int x0, int y0, int x1, int y1) {
  move_nasko(x0, y0);
  cont(x1, y1);
  return 0;
}


x86 assembly (clang, -O0):
<line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <move_nasko@plt>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1040 <cont@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<line>:
push   %rbp
push   %rbx
push   %rax
mov    %ecx,%ebx
mov    %edx,%ebp
call   1030 <move_nasko@plt>
mov    %ebp,%edi
mov    %ebx,%esi
call   1040 <cont@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @line(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 = load i32, i32* %6
%11 = call i32 @move_nasko(i32 %9, i32 %10)
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = call i32 @cont(i32 %12, i32 %13)
ret i32 0
}

LLVM IR (-O2):
define i32 @line(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @move_nasko(i32 %0, i32 %1)
%6 = tail call i32 @cont(i32 %2, i32 %3)
ret i32 0
}
int xmlUCSIsCurrencySymbols(int code) {
  return (((code >= 0x20A0) && (code <= 0x20CF)));
}


x86 assembly (clang, -O0):
<xmlUCSIsCurrencySymbols>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x20a0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <xmlUCSIsCurrencySymbols+0x26>
cmpl   $0x20cf,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmlUCSIsCurrencySymbols>:
add    $0xffffdf60,%edi
xor    %eax,%eax
cmp    $0x30,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @xmlUCSIsCurrencySymbols(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 8352
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 8399
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @xmlUCSIsCurrencySymbols(i32 %0) {
%2 = add i32 %0, -8352
%3 = icmp ult i32 %2, 48
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ _outsw_ns(void *, void const *, unsigned long);
void iowrite16_rep(void *addr, const void *src, unsigned long count) {
  _outsw_ns(addr, src, count);
}


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

x86 assembly (clang, -O2):
<iowrite16_rep>:
jmp    1030 <_outsw_ns@plt>

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

LLVM IR (-O2):
define void @iowrite16_rep(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @_outsw_ns(i8* %0, i8* %1, i64 %2)
ret void
}
void ff_hevc_put_hevc_uni_w_epel_v8_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_w_epel_v8_8_sse4() {
ret void
}
void change_array(int arr[]) {
  arr[7] = 70;
  arr[9] = 90;
  arr[8] = arr[1] + arr[9];
}


x86 assembly (clang, -O0):
<change_array>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x46,0x1c(%rax)
mov    -0x8(%rbp),%rax
movl   $0x5a,0x24(%rax)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%ecx
mov    -0x8(%rbp),%rax
add    0x24(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x20(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<change_array>:
movl   $0x46,0x1c(%rdi)
movl   $0x5a,0x24(%rdi)
mov    0x4(%rdi),%eax
add    $0x5a,%eax
mov    %eax,0x20(%rdi)
ret

LLVM IR (-O0):
define void @change_array(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 7
store i32 70, i32* %4
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 9
store i32 90, i32* %6
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32, i32* %8
%10 = load i32*, i32** %2
%11 = getelementptr inbounds i32, i32* %10, i64 9
%12 = load i32, i32* %11
%13 = add nsw i32 %9, %12
%14 = load i32*, i32** %2
%15 = getelementptr inbounds i32, i32* %14, i64 8
store i32 %13, i32* %15
ret void
}

LLVM IR (-O2):
define void @change_array(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 7
store i32 70, i32* %2
%3 = getelementptr inbounds i32, i32* %0, i64 9
store i32 90, i32* %3
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = add nsw i32 %5, 90
%7 = getelementptr inbounds i32, i32* %0, i64 8
store i32 %6, i32* %7
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ n;

/* Variables and functions */
int CHAR_BIT;
int __builtin_clzl(unsigned long);
int /*<<< orphan*/ assert(int);
int blz_log2(unsigned long n) {
  assert(n > 0);
  return (int)sizeof(n) * CHAR_BIT - 1 - __builtin_clzl(n);
}


x86 assembly (clang, -O0):
<blz_log2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
seta   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%eax
shl    $0x3,%eax
sub    $0x1,%eax
mov    -0x8(%rbp),%rcx
bsr    %rcx,%rcx
xor    $0x3f,%rcx
sub    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blz_log2>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
mov    0x2eb7(%rip),%rax
mov    (%rax),%eax
bsr    %rbx,%rcx
xor    $0xffffffc0,%ecx
lea    (%rcx,%rax,8),%eax
pop    %rbx
ret

LLVM IR (-O0):
@CHAR_BIT = global i32 0
define i32 @blz_log2(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ugt i64 %3, 0
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load i32, i32* @CHAR_BIT
%8 = mul nsw i32 8, %7
%9 = sub nsw i32 %8, 1
%10 = load i64, i64* %2
%11 = call i64 @llvm.ctlz.i64(i64 %10, i1 true)
%12 = trunc i64 %11 to i32
%13 = sub nsw i32 %9, %12
ret i32 %13
}

LLVM IR (-O2):
@CHAR_BIT = global i32 0
define i32 @blz_log2(i64 %0) {
%2 = icmp ne i64 %0, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = load i32, i32* @CHAR_BIT
%6 = shl nsw i32 %5, 3
%7 = tail call i64 @llvm.ctlz.i64(i64 %0, i1 true)
%8 = trunc i64 %7 to i32
%9 = xor i32 %8, -1
%10 = add i32 %6, %9
ret i32 %10
}
/* Variables and functions */
const char *_gss_name_prefix(void) { return "_gsskrb5"; }


x86 assembly (clang, -O0):
<_gss_name_prefix>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_gss_name_prefix>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [9 x i8] c"_gsskrb5\00"
define i8* @_gss_name_prefix() {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [9 x i8] c"_gsskrb5\00"
define i8* @_gss_name_prefix() {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}
int array_pointer_add(int b[][3]) {
  ++b;
  return b[0][1] * b[1][2];
}


x86 assembly (clang, -O0):
<array_pointer_add>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xc,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    -0x8(%rbp),%rcx
imul   0x14(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<array_pointer_add>:
mov    0x20(%rdi),%eax
imul   0x10(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @array_pointer_add([3 x i32]* %0) {
%2 = alloca [3 x i32]*
store [3 x i32]* %0, [3 x i32]** %2
%3 = load [3 x i32]*, [3 x i32]** %2
%4 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i32 1
store [3 x i32]* %4, [3 x i32]** %2
%5 = load [3 x i32]*, [3 x i32]** %2
%6 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 1
%8 = load i32, i32* %7
%9 = load [3 x i32]*, [3 x i32]** %2
%10 = getelementptr inbounds [3 x i32], [3 x i32]* %9, i64 1
%11 = getelementptr inbounds [3 x i32], [3 x i32]* %10, i64 0, i64 2
%12 = load i32, i32* %11
%13 = mul nsw i32 %8, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @array_pointer_add([3 x i32]* nocapture %0) {
%2 = getelementptr inbounds [3 x i32], [3 x i32]* %0, i64 1, i64 1
%3 = load i32, i32* %2
%4 = getelementptr inbounds [3 x i32], [3 x i32]* %0, i64 2, i64 2
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, %3
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fread(int *, int, int, int /*<<< orphan*/ *);
int *malloc(int);
int *zeroes(int size) {
  FILE *device;
  int *result;
  device = fopen("/dev/zero", "r");
  result = malloc(sizeof(int) * size);
  fread(result, sizeof(int), size, device);
  return result;
}


x86 assembly (clang, -O0):
<zeroes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
lea    0xec1(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rcx
mov    $0x4,%esi
call   1030 <fread@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zeroes>:
push   %r15
push   %r14
push   %rbx
mov    %edi,%r15d
lea    0xec1(%rip),%rdi
lea    0xec4(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%r14
lea    0x0(,%r15,4),%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x4,%esi
mov    %r15d,%edx
mov    %r14,%rcx
call   1030 <fread@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [10 x i8] c"/dev/zero\00"
@.str.1 = [2 x i8] c"r\00"
define i32* @zeroes(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32*
store i32 %0, i32* %2
%5 = call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %5, i32** %3
%6 = load i32, i32* %2
%7 = sext i32 %6 to i64
%8 = mul i64 4, %7
%9 = trunc i64 %8 to i32
%10 = call i32* @malloc(i32 %9)
store i32* %10, i32** %4
%11 = load i32*, i32** %4
%12 = load i32, i32* %2
%13 = load i32*, i32** %3
%14 = call i32 @fread(i32* %11, i32 4, i32 %12, i32* %13)
%15 = load i32*, i32** %4
ret i32* %15
}

LLVM IR (-O2):
@.str = [10 x i8] c"/dev/zero\00"
@.str.1 = [2 x i8] c"r\00"
define noalias i32* @zeroes(i32 %0) {
%2 = tail call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%3 = shl i32 %0, 2
%4 = tail call i32* @malloc(i32 %3)
%5 = tail call i32 @fread(i32* %4, i32 4, i32 %0, i32* %2)
ret i32* %4
}
/* Variables and functions */
int calc_tri_num(int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("Triangular number 10: %i\n", calc_tri_num(10));
  printf("Triangular number 20: %i\n", calc_tri_num(20));
  printf("Triangular number 50: %i\n", calc_tri_num(50));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xa,%edi
call   1040 <calc_tri_num@plt>
mov    %eax,%esi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    $0x14,%edi
call   1040 <calc_tri_num@plt>
mov    %eax,%esi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    $0x32,%edi
call   1040 <calc_tri_num@plt>
mov    %eax,%esi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1040 <calc_tri_num@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x14,%edi
call   1040 <calc_tri_num@plt>
lea    0xed0(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x32,%edi
call   1040 <calc_tri_num@plt>
lea    0xed2(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Triangular number 10: %i\0A\00"
@.str.1 = [26 x i8] c"Triangular number 20: %i\0A\00"
@.str.2 = [26 x i8] c"Triangular number 50: %i\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @calc_tri_num(i32 10)
%3 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 @calc_tri_num(i32 20)
%5 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = call i32 @calc_tri_num(i32 50)
%7 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"Triangular number 10: %i\0A\00"
@.str.1 = [26 x i8] c"Triangular number 20: %i\0A\00"
@.str.2 = [26 x i8] c"Triangular number 50: %i\0A\00"
define i32 @main() {
%1 = tail call i32 @calc_tri_num(i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @calc_tri_num(i32 20)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = tail call i32 @calc_tri_num(i32 50)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret i32 0
}
int ft_max(int x, int y) { return (x > y ? x : y); }


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

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

LLVM IR (-O0):
define i32 @ft_max(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 sgt 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 @ft_max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main() {
  int i = 1;
  char *p = (char *)&i;
  if (p[0] == 1)
    printf("LITTLE_ENDIAN\n");
  else
    printf("BIG_ENDIAN\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x1,%eax
jne    1148 <main+0x38>
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
jmp    1154 <main+0x44>
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [14 x i8] c"LITTLE_ENDIAN\00"
define void @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ memset(int /*<<< orphan*/ *, char, int);
void none_sign(uint8_t *data, int len, uint8_t *signature) {
  (void)data;
  (void)len;
  memset(signature, 'x', 32);
}


x86 assembly (clang, -O0):
<none_sign>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x78,%esi
mov    $0x20,%edx
call   1030 <memset@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<none_sign>:
mov    %rdx,%rdi
mov    $0x78,%esi
mov    $0x20,%edx
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @none_sign(i32* %0, i32 %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32*
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %5
%9 = load i32*, i32** %6
%10 = call i32 @memset(i32* %9, i8 signext 120, i32 32)
ret void
}

LLVM IR (-O2):
define void @none_sign(i32* nocapture readnone %0, i32 %1, i32* %2) {
%4 = tail call i32 @memset(i32* %2, i8 signext 120, i32 32)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M371_f(char *s) {
  debug("M371_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M371_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M371_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M371_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M371_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M371_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M371_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int pev_sock_del(int);
int pev_timer_del(int id) { return pev_sock_del(id); }


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

x86 assembly (clang, -O2):
<pev_timer_del>:
jmp    1030 <pev_sock_del@plt>

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

LLVM IR (-O2):
define i32 @pev_timer_del(i32 %0) {
%2 = tail call i32 @pev_sock_del(i32 %0)
ret i32 %2
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMR8C_set(void) { return U_WMRCORENONE_set("U_WMR8C"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMR8C\00"
define i8* @U_WMR8C_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR8C\00"
define i8* @U_WMR8C_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ delay(int);
unsigned long readIRCode();
unsigned long waitForIRCode() {
  unsigned long irCode = readIRCode();
  while ((irCode == 0) || (irCode == 0xFFFFFFFF)) {
    delay(200);
    irCode = readIRCode();
  }
  return irCode;
}


x86 assembly (clang, -O0):
<waitForIRCode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <readIRCode@plt>
mov    %rax,-0x8(%rbp)
mov    $0x1,%al
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1152 <waitForIRCode+0x32>
mov    $0xffffffff,%eax
cmp    %rax,-0x8(%rbp)
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1162 <waitForIRCode+0x42>
jmp    117c <waitForIRCode+0x5c>
mov    $0xc8,%edi
call   1040 <delay@plt>
mov    $0x0,%al
call   1030 <readIRCode@plt>
mov    %rax,-0x8(%rbp)
jmp    1133 <waitForIRCode+0x13>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<waitForIRCode>:
push   %rbx
mov    $0xffffffff,%ebx
jmp    113a <waitForIRCode+0x1a>
nopl   0x0(%rax,%rax,1)
mov    $0xc8,%edi
call   1040 <delay@plt>
xor    %eax,%eax
call   1030 <readIRCode@plt>
cmp    %rbx,%rax
je     1130 <waitForIRCode+0x10>
test   %rax,%rax
je     1130 <waitForIRCode+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define i64 @waitForIRCode() {
%1 = alloca i64
%2 = call i64 (...) @readIRCode()
store i64 %2, i64* %1
br label %3
3: ; preds = %11, %0
%4 = load i64, i64* %1
%5 = icmp eq i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = load i64, i64* %1
%8 = icmp eq i64 %7, 4294967295
br label %9
9: ; preds = %6, %3
%10 = phi i1 [ true, %3 ], [ %8, %6 ]
br i1 %10, label %11, label %14
11: ; preds = %9
%12 = call i32 @delay(i32 200)
%13 = call i64 (...) @readIRCode()
store i64 %13, i64* %1
br label %3
14: ; preds = %9
%15 = load i64, i64* %1
ret i64 %15
}

LLVM IR (-O2):
define i64 @waitForIRCode() {
br label %1
1: ; preds = %3, %0
%2 = tail call i64 (...) @readIRCode()
switch i64 %2, label %5 [
i64 4294967295, label %3
i64 0, label %3
]
3: ; preds = %1, %1
%4 = tail call i32 @delay(i32 200)
br label %1
5: ; preds = %1
ret i64 %2
}
void unmask_evtchn() {}


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

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

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

LLVM IR (-O2):
define void @unmask_evtchn() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_assume(int);
int /*<<< orphan*/ assert(int);
void main() {
  int a, b;
  int res, cnt;
  __VERIFIER_assume(a <= 1000000);
  __VERIFIER_assume(0 <= b && b <= 1000000);
  res = a;
  cnt = b;
  while (cnt > 0) {
    cnt = cnt - 1;
    res = res + 1;
  }
  assert(res == a + b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
cmpl   $0xf4240,-0x4(%rbp)
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__VERIFIER_assume@plt>
xor    %eax,%eax
xor    %ecx,%ecx
cmp    -0x8(%rbp),%ecx
mov    %al,-0x11(%rbp)
jg     1159 <main+0x39>
cmpl   $0xf4240,-0x8(%rbp)
setle  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__VERIFIER_assume@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jle    1193 <main+0x73>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1172 <main+0x52>
mov    -0xc(%rbp),%eax
mov    -0x4(%rbp),%ecx
add    -0x8(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1040 <__VERIFIER_assume@plt>
mov    $0x1,%edi
call   1040 <__VERIFIER_assume@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = load i32, i32* %1
%6 = icmp sle i32 %5, 1000000
%7 = zext i1 %6 to i32
%8 = call i32 @__VERIFIER_assume(i32 %7)
%9 = load i32, i32* %2
%10 = icmp sle i32 0, %9
br i1 %10, label %11, label %14
11: ; preds = %0
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 1000000
br label %14
14: ; preds = %11, %0
%15 = phi i1 [ false, %0 ], [ %13, %11 ]
%16 = zext i1 %15 to i32
%17 = call i32 @__VERIFIER_assume(i32 %16)
%18 = load i32, i32* %1
store i32 %18, i32* %3
%19 = load i32, i32* %2
store i32 %19, i32* %4
br label %20
20: ; preds = %23, %14
%21 = load i32, i32* %4
%22 = icmp sgt i32 %21, 0
br i1 %22, label %23, label %28
23: ; preds = %20
%24 = load i32, i32* %4
%25 = sub nsw i32 %24, 1
store i32 %25, i32* %4
%26 = load i32, i32* %3
%27 = add nsw i32 %26, 1
store i32 %27, i32* %3
br label %20
28: ; preds = %20
%29 = load i32, i32* %3
%30 = load i32, i32* %1
%31 = load i32, i32* %2
%32 = add nsw i32 %30, %31
%33 = icmp eq i32 %29, %32
%34 = zext i1 %33 to i32
%35 = call i32 @assert(i32 %34)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @__VERIFIER_assume(i32 1)
%2 = tail call i32 @__VERIFIER_assume(i32 1)
%3 = tail call i32 @assert(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, void *);
void func(void *addr) { printf("%p\n", addr); }


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

x86 assembly (clang, -O2):
<func>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%p\0A\00"
define void @func(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void judgeNull() {
  int a = 10;
  int *p = &a;
  p = NULL;
  if (p) {
    printf("p is not NULL\n");
  } else {
    printf("p is  NULL\n");
  }
}


x86 assembly (clang, -O0):
<judgeNull>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xa,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114b <judgeNull+0x3b>
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
jmp    1157 <judgeNull+0x47>
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [11 x i8] c"p is NULL\00"
define void @judgeNull() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
scalar_t__ mkdir(char const *, int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *);
int main(int argc, const char *argv[]) {
  if (argc != 2) {
    printf("wrong argument!\n");
    exit(-1);
  }
  if (mkdir(argv[1], 0777) < 0) {
    perror("mkdir");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     1176 <main+0x36>
lea    0xe99(%rip),%rdi
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    $0x1ff,%esi
call   1030 <mkdir@plt>
cmp    $0x0,%rax
jge    119e <main+0x5e>
lea    0xe78(%rip),%rdi
call   1050 <perror@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    116b <main+0x2b>
mov    0x8(%rsi),%rdi
mov    $0x1ff,%esi
call   1030 <mkdir@plt>
test   %rax,%rax
js     115d <main+0x1d>
xor    %eax,%eax
pop    %rcx
ret
lea    0xe9c(%rip),%rdi
call   1050 <perror@plt>
jmp    1159 <main+0x19>
lea    0xe94(%rip),%rdi
call   1040 <puts@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>

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

LLVM IR (-O2):
@.str.1 = [6 x i8] c"mkdir\00"
@str = [16 x i8] c"wrong argument!\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 -1)
unreachable
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i64 @mkdir(i8* %9, i32 511)
%11 = icmp slt i64 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %7
%13 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %12, %7
ret i32 0
}
unsigned int wp_direct_hash(const void *v) { return (unsigned int)v; }


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

x86 assembly (clang, -O2):
<wp_direct_hash>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i32 @wp_direct_hash(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @wp_direct_hash(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *);
scalar_t__ malloc(unsigned int);
long *xmalloc(unsigned int size) {
  long *result = (long *)malloc(size);
  if (result == NULL) {
    fatal("virtual memory exhausted");
  }
  return result;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114e <xmalloc+0x2e>
lea    0xeb7(%rip),%rdi
call   1040 <fatal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <xmalloc+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"virtual memory exhausted\00"
define i64* @xmalloc(i32 %0) {
%2 = alloca i32
%3 = alloca i64*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i64 @malloc(i32 %4)
%6 = inttoptr i64 %5 to i64*
store i64* %6, i64** %3
%7 = load i64*, i64** %3
%8 = icmp eq i64* %7, null
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 @fatal(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %1
%12 = load i64*, i64** %3
ret i64* %12
}

LLVM IR (-O2):
@.str = [25 x i8] c"virtual memory exhausted\00"
define i64* @xmalloc(i32 %0) {
%2 = tail call i64 @malloc(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @fatal(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
%7 = inttoptr i64 %2 to i64*
ret i64* %7
}
long int __isnanf(float x) {
  union {
    unsigned long int lval;
    float fval;
  } z;
  z.fval = x;
  return (((z.lval & 0x7f800000) == 0x7f800000) &&
          ((z.lval & 0x007fffff) != 0));
}


x86 assembly (clang, -O0):
<__isnanf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
and    $0x7f800000,%rcx
xor    %eax,%eax
cmp    $0x7f800000,%rcx
mov    %al,-0x11(%rbp)
jne    1144 <__isnanf+0x44>
mov    -0x10(%rbp),%rax
and    $0x7fffff,%rax
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<__isnanf>:
movd   %xmm0,%eax
mov    %eax,%ecx
not    %ecx
test   $0x7f800000,%ecx
sete   %cl
test   $0x7fffff,%eax
setne  %al
and    %cl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
%union.anon = type { i64 }
define i64 @__isnanf(float %0) {
%2 = alloca float
%3 = alloca %union.anon
store float %0, float* %2
%4 = load float, float* %2
%5 = bitcast %union.anon* %3 to float*
store float %4, float* %5
%6 = bitcast %union.anon* %3 to i64*
%7 = load i64, i64* %6
%8 = and i64 %7, 2139095040
%9 = icmp eq i64 %8, 2139095040
br i1 %9, label %10, label %15
10: ; preds = %1
%11 = bitcast %union.anon* %3 to i64*
%12 = load i64, i64* %11
%13 = and i64 %12, 8388607
%14 = icmp ne i64 %13, 0
br label %15
15: ; preds = %10, %1
%16 = phi i1 [ false, %1 ], [ %14, %10 ]
%17 = zext i1 %16 to i32
%18 = sext i32 %17 to i64
ret i64 %18
}

LLVM IR (-O2):
define i64 @__isnanf(float %0) {
%2 = bitcast float %0 to i32
%3 = zext i32 %2 to i64
%4 = and i64 %3, 2139095040
%5 = icmp eq i64 %4, 2139095040
%6 = and i64 %3, 8388607
%7 = icmp ne i64 %6, 0
%8 = and i1 %5, %7
%9 = zext i1 %8 to i64
ret i64 %9
}
/* Variables and functions */
char EOF;
char getchar();
void clearBuffer() {
  char c = NULL;
  while ((c = getchar()) != '\n' && c != EOF) {
  }
}


x86 assembly (clang, -O0):
<clearBuffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %al,-0x1(%rbp)
movsbl %al,%ecx
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0x2(%rbp)
je     114d <clearBuffer+0x3d>
movsbl -0x1(%rbp),%eax
mov    0x2ea6(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
setne  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
test   $0x1,%al
jne    115d <clearBuffer+0x4d>
jmp    1162 <clearBuffer+0x52>
jmp    111c <clearBuffer+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clearBuffer>:
push   %rbx
mov    0x2ed0(%rip),%rbx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%al
je     112f <clearBuffer+0x1f>
cmp    (%rbx),%al
jne    1120 <clearBuffer+0x10>
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i8 0
define void @clearBuffer() {
%1 = alloca i8
store i8 0, i8* %1
br label %2
2: ; preds = %14, %0
%3 = call signext i8 (...) @getchar()
store i8 %3, i8* %1
%4 = sext i8 %3 to i32
%5 = icmp ne i32 %4, 10
br i1 %5, label %6, label %12
6: ; preds = %2
%7 = load i8, i8* %1
%8 = sext i8 %7 to i32
%9 = load i8, i8* @EOF
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %8, %10
br label %12
12: ; preds = %6, %2
%13 = phi i1 [ false, %2 ], [ %11, %6 ]
br i1 %13, label %14, label %15
14: ; preds = %12
br label %2
15: ; preds = %12
ret void
}

LLVM IR (-O2):
@EOF = global i8 0
define void @clearBuffer() {
br label %1
1: ; preds = %1, %0
%2 = tail call signext i8 (...) @getchar()
%3 = icmp ne i8 %2, 10
%4 = load i8, i8* @EOF
%5 = icmp ne i8 %2, %4
%6 = select i1 %3, i1 %5, i1 false
br i1 %6, label %1, label %7
7: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ w5100_write_byte(int, unsigned int);
void w5100_writeRMSR(unsigned data) { w5100_write_byte(0x001A, data); }


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

x86 assembly (clang, -O2):
mov    %edi,%esi
mov    $0x1a,%edi
jmp    1030 <w5100_write_byte@plt>

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

LLVM IR (-O2):
define void @w5100_writeRMSR(i32 %0) {
%2 = tail call i32 @w5100_write_byte(i32 26, i32 %0)
ret void
}
/* Type definitions */
struct UPnPService {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void RNDResponseSink_RenderingControl_SetBlueVideoGain(
    struct UPnPService *Service, int ErrorCode, void *User) {
  printf("RND Invoke Response: "
         "RenderingControl/SetBlueVideoGain[ErrorCode:%d]()\r\n",
         ErrorCode);
}


x86 assembly (clang, -O0):
<RNDResponseSink_RenderingControl_SetBlueVideoGain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%esi
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.UPnPService = type { i32 }
@.str = [73 x i8] c"RND Invoke Response: RenderingControl/SetBlueVideoGain[ErrorCode:%d]()\0D\0A\00"
define void @RNDResponseSink_RenderingControl_SetBlueVideoGain(%struct.UPnPService* %0, i32 %1, i8* %2) {
%4 = alloca %struct.UPnPService*
%5 = alloca i32
%6 = alloca i8*
store %struct.UPnPService* %0, %struct.UPnPService** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %5
%8 = call i32 @printf(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
%struct.UPnPService = type { i32 }
@.str = [73 x i8] c"RND Invoke Response: RenderingControl/SetBlueVideoGain[ErrorCode:%d]()\0D\0A\00"
define void @RNDResponseSink_RenderingControl_SetBlueVideoGain(%struct.UPnPService* nocapture readnone %0, i32 %1, i8* nocapture readnone %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Type definitions */
struct bar {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct bar *);
int /*<<< orphan*/ i3bar_stop(struct bar *);
void bar_destroy(struct bar *bar) {
  i3bar_stop(bar);
  free(bar);
}


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

x86 assembly (clang, -O2):
<bar_destroy>:
push   %rbx
mov    %rdi,%rbx
call   1040 <i3bar_stop@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.bar = type { i32 }
define void @bar_destroy(%struct.bar* %0) {
%2 = alloca %struct.bar*
store %struct.bar* %0, %struct.bar** %2
%3 = load %struct.bar*, %struct.bar** %2
%4 = call i32 @i3bar_stop(%struct.bar* %3)
%5 = load %struct.bar*, %struct.bar** %2
%6 = call i32 @free(%struct.bar* %5)
ret void
}

LLVM IR (-O2):
%struct.bar = type { i32 }
define void @bar_destroy(%struct.bar* %0) {
%2 = tail call i32 @i3bar_stop(%struct.bar* %0)
%3 = tail call i32 @free(%struct.bar* %0)
ret void
}
int minus(int *a, int *b) { return *a - *b; }


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

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

LLVM IR (-O0):
define i32 @minus(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* %5
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = sub nsw i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @minus(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = sub nsw i32 %3, %4
ret i32 %5
}
int test_imm_11int16_reg(short val) {
  return ((val) & (-0x11 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_11int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffffef,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_11int16_reg>:
test   $0xffef,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_11int16_reg(i16 signext %0) {
%2 = and i16 %0, -17
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Port_End();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void App_Exit2(void) {
  Port_End();
  exit(0);
}


x86 assembly (clang, -O0):
<App_Exit2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <Port_End@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<App_Exit2>:
push   %rax
xor    %eax,%eax
call   1030 <Port_End@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @App_Exit2() {
%1 = call i32 (...) @Port_End()
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @App_Exit2() {
%1 = tail call i32 (...) @Port_End()
%2 = tail call i32 @exit(i32 0)
unreachable
}
int get_magic_number() { return 32; }


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

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

LLVM IR (-O0):
define i32 @get_magic_number() {
ret i32 32
}

LLVM IR (-O2):
define i32 @get_magic_number() {
ret i32 32
}