xunge/DecIR huggingface dataset:
/* Variables and functions */
double tanh(double const);
double tanh_gradient(const double x) {
  double t = tanh(x);
  return 1 - t * t;
}


x86 assembly (clang, -O0):
<tanh_gradient>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <tanh@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xea7(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tanh_gradient>:
push   %rax
call   1030 <tanh@plt>
mulsd  %xmm0,%xmm0
movsd  0xede(%rip),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @tanh_gradient(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call double @tanh(double %4)
store double %5, double* %3
%6 = load double, double* %3
%7 = load double, double* %3
%8 = fneg double %6
%9 = call double @llvm.fmuladd.f64(double %8, double %7, double 1.000000e+00)
ret double %9
}

LLVM IR (-O2):
define double @tanh_gradient(double %0) {
%2 = tail call double @tanh(double %0)
%3 = fneg double %2
%4 = tail call double @llvm.fmuladd.f64(double %3, double %2, double 1.000000e+00)
ret double %4
}
const char *_glp_get_err_msg(void) { return ""; }


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

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @_glp_get_err_msg() {
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @_glp_get_err_msg() {
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ canid_t;

/* Variables and functions */
scalar_t__ ioctl(int, int, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int can_set_broadcast_id(int fd, canid_t id) {
  if (ioctl(fd, 0x4502, id) != 0) {
    perror("Can Test Set Broadcast: ");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<can_set_broadcast_id>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%edx
mov    $0x4502,%esi
call   1030 <ioctl@plt>
cmp    $0x0,%rax
je     1160 <can_set_broadcast_id+0x40>
lea    0xeb1(%rip),%rdi
call   1040 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1167 <can_set_broadcast_id+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<can_set_broadcast_id>:
push   %rax
mov    %esi,%edx
mov    $0x4502,%esi
call   1030 <ioctl@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
jne    1139 <can_set_broadcast_id+0x19>
pop    %rcx
ret
lea    0xec0(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Can Test Set Broadcast: \00"
define i32 @can_set_broadcast_id(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 = load i32, i32* %5
%8 = call i64 @ioctl(i32 %6, i32 17666, i32 %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @perror(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %13
12: ; preds = %2
store i32 0, i32* %3
br label %13
13: ; preds = %12, %10
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
@.str = [25 x i8] c"Can Test Set Broadcast: \00"
define i32 @can_set_broadcast_id(i32 %0, i32 %1) {
%3 = tail call i64 @ioctl(i32 %0, i32 17666, i32 %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ -1, %5 ], [ 0, %2 ]
ret i32 %8
}
double UC_11_1_12(double F_g_s_d, double F_g_u_d) {
  return (F_g_s_d / F_g_u_d);
}


x86 assembly (clang, -O0):
<UC_11_1_12>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<UC_11_1_12>:
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @UC_11_1_12(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fdiv double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @UC_11_1_12(double %0, double %1) {
%3 = fdiv double %0, %1
ret double %3
}
/* Type definitions */
typedef int /*<<< orphan*/ OCSP_CERTID;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
scalar_t__ ASN1_item_d2i(int /*<<< orphan*/ **, unsigned char const **, long,
                         int /*<<< orphan*/ *);
int /*<<< orphan*/ OCSP_CERTID_it;
OCSP_CERTID *d2i_OCSP_CERTID(OCSP_CERTID **a, const unsigned char **in,
                             long len) {
  return (OCSP_CERTID *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
                                      &OCSP_CERTID_it);
}


x86 assembly (clang, -O0):
<d2i_OCSP_CERTID>:
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
mov    0x2ec1(%rip),%rcx
call   1030 <ASN1_item_d2i@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d2i_OCSP_CERTID>:
mov    0x2ee1(%rip),%rcx
jmp    1030 <ASN1_item_d2i@plt>

LLVM IR (-O0):
@OCSP_CERTID_it = global i32 0
define i32* @d2i_OCSP_CERTID(i32** %0, i8** %1, i64 %2) {
%4 = alloca i32**
%5 = alloca i8**
%6 = alloca i64
store i32** %0, i32*** %4
store i8** %1, i8*** %5
store i64 %2, i64* %6
%7 = load i32**, i32*** %4
%8 = load i8**, i8*** %5
%9 = load i64, i64* %6
%10 = call i64 @ASN1_item_d2i(i32** %7, i8** %8, i64 %9, i32* @OCSP_CERTID_it)
%11 = inttoptr i64 %10 to i32*
ret i32* %11
}

LLVM IR (-O2):
@OCSP_CERTID_it = global i32 0
define i32* @d2i_OCSP_CERTID(i32** %0, i8** %1, i64 %2) {
%4 = tail call i64 @ASN1_item_d2i(i32** %0, i8** %1, i64 %2, i32* @OCSP_CERTID_it)
%5 = inttoptr i64 %4 to i32*
ret i32* %5
}
const char *type_name(int t) {
  if (t)
    return "INT";
  else
    return "int";
}


x86 assembly (clang, -O0):
<type_name>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1121 <type_name+0x21>
lea    0xee8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    112c <type_name+0x2c>
lea    0xedc(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"INT\00"
@.str.1 = [4 x i8] c"int\00"
define i8* @type_name(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %2
br label %8
7: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %8
8: ; preds = %7, %6
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [4 x i8] c"INT\00"
@.str.1 = [4 x i8] c"int\00"
define i8* @type_name(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ abort();
double foo(double arg) {
  if (arg != 116.0)
    abort();
  return arg + 1.0;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    113f <foo+0x2f>
jp     113f <foo+0x2f>
jmp    1146 <foo+0x36>
mov    $0x0,%al
call   1030 <abort@plt>
movsd  0xeba(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
ucomisd 0xee7(%rip),%xmm0
jne    1127 <foo+0x17>
jp     1127 <foo+0x17>
movsd  0xee3(%rip),%xmm0
pop    %rax
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define double @foo(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp une double %3, 1.160000e+02
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %1
%8 = load double, double* %2
%9 = fadd double %8, 1.000000e+00
ret double %9
}

LLVM IR (-O2):
define double @foo(double %0) {
%2 = fcmp une double %0, 1.160000e+02
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %1
ret double 1.170000e+02
}
/* Variables and functions */
double logpexp(double);
double logsigmoid(double x) { return -logpexp(-x); }


x86 assembly (clang, -O0):
<logsigmoid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <logpexp@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logsigmoid>:
push   %rax
xorps  0xee8(%rip),%xmm0
call   1030 <logpexp@plt>
xorps  0xedc(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @logsigmoid(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fneg double %3
%5 = call double @logpexp(double %4)
%6 = fneg double %5
ret double %6
}

LLVM IR (-O2):
define double @logsigmoid(double %0) {
%2 = fneg double %0
%3 = tail call double @logpexp(double %2)
%4 = fneg double %3
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void giveup(char *msg) {
  fprintf(stderr, "httpGate: %s\n", msg);
  exit(1);
}


x86 assembly (clang, -O0):
<giveup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<giveup>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [14 x i8] c"httpGate: %s\0A\00"
define void @giveup(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [14 x i8] c"httpGate: %s\0A\00"
define void @giveup(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
int sipserver_add(const char *ifname, const int ifindex,
                  const char *addrPlain) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @sipserver_add(i8* nocapture readnone %0, i32 %1, i8* nocapture readnone %2) {
ret i32 0
}
char *genquit(char *quit) {
  quit[0] = '#';
  quit[1] = 'q';
  quit[2] = 'u';
  quit[3] = 'i';
  quit[4] = 't';
  quit[5] = '\0';
}


x86 assembly (clang, -O0):
<genquit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x23,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x71,0x1(%rax)
mov    -0x10(%rbp),%rax
movb   $0x75,0x2(%rax)
mov    -0x10(%rbp),%rax
movb   $0x69,0x3(%rax)
mov    -0x10(%rbp),%rax
movb   $0x74,0x4(%rax)
mov    -0x10(%rbp),%rax
movb   $0x0,0x5(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<genquit>:
movl   $0x69757123,(%rdi)
movw   $0x74,0x4(%rdi)
ret

LLVM IR (-O0):
define i8* @genquit(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8, i8* %4, i64 0
store i8 35, i8* %5
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 1
store i8 113, i8* %7
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 2
store i8 117, i8* %9
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 3
store i8 105, i8* %11
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i64 4
store i8 116, i8* %13
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i64 5
store i8 0, i8* %15
%16 = load i8*, i8** %2
ret i8* %16
}

LLVM IR (-O2):
define noalias i8* @genquit(i8* nocapture writeonly %0) {
store i8 35, i8* %0
%2 = getelementptr inbounds i8, i8* %0, i64 1
store i8 113, i8* %2
%3 = getelementptr inbounds i8, i8* %0, i64 2
store i8 117, i8* %3
%4 = getelementptr inbounds i8, i8* %0, i64 3
store i8 105, i8* %4
%5 = getelementptr inbounds i8, i8* %0, i64 4
store i8 116, i8* %5
%6 = getelementptr inbounds i8, i8* %0, i64 5
store i8 0, i8* %6
ret i8* undef
}
int execute_nfsservctl() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_nfsservctl() {
ret i32 0
}
int findnext(struct ffblk *ffblk) { return 0; }


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

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

LLVM IR (-O0):
%struct.ffblk = type opaque
define i32 @findnext(%struct.ffblk* %0) {
%2 = alloca %struct.ffblk*
store %struct.ffblk* %0, %struct.ffblk** %2
ret i32 0
}

LLVM IR (-O2):
%struct.ffblk = type opaque
define i32 @findnext(%struct.ffblk* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ recordEvent();
int /*<<< orphan*/ resetQueue();
void pumpQueue(void) {
  resetQueue();
  recordEvent();
}


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

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

LLVM IR (-O0):
define void @pumpQueue() {
%1 = call i32 (...) @resetQueue()
%2 = call i32 (...) @recordEvent()
ret void
}

LLVM IR (-O2):
define void @pumpQueue() {
%1 = tail call i32 (...) @resetQueue()
%2 = tail call i32 (...) @recordEvent()
ret void
}
char *say_hello_c() { return "HELLO WORLD"; }


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

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

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

LLVM IR (-O2):
@.str = [12 x i8] c"HELLO WORLD\00"
define i8* @say_hello_c() {
ret i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
struct timespec {
  long tv_sec;
  double tv_nsec;
};

/* Variables and functions */
struct timespec dtots(double a) {
  struct timespec t;
  t.tv_sec = (long)(a + 0.5e-9);
  t.tv_nsec = (a - t.tv_sec) * 1000000000UL;
  return t;
}


x86 assembly (clang, -O0):
<dtots>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
mov    %rax,-0x10(%rbp)
movsd  -0x18(%rbp),%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  0xece(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
mov    -0x10(%rbp),%rax
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dtots>:
movsd  0xef8(%rip),%xmm1
addsd  %xmm0,%xmm1
cvttsd2si %xmm1,%rax
xorps  %xmm1,%xmm1
cvtsi2sd %rax,%xmm1
subsd  %xmm1,%xmm0
mulsd  0xee3(%rip),%xmm0
ret

LLVM IR (-O0):
%struct.timespec = type { i64, double }
define { i64, double } @dtots(double %0) {
%2 = alloca %struct.timespec
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fadd double %4, 5.000000e-10
%6 = fptosi double %5 to i64
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 0
store i64 %6, i64* %7
%8 = load double, double* %3
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 0
%10 = load i64, i64* %9
%11 = sitofp i64 %10 to double
%12 = fsub double %8, %11
%13 = fmul double %12, 1.000000e+09
%14 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 1
store double %13, double* %14
%15 = bitcast %struct.timespec* %2 to { i64, double }*
%16 = load { i64, double }, { i64, double }* %15
ret { i64, double } %16
}

LLVM IR (-O2):
define { i64, double } @dtots(double %0) {
%2 = fadd double %0, 5.000000e-10
%3 = fptosi double %2 to i64
%4 = sitofp i64 %3 to double
%5 = fsub double %0, %4
%6 = fmul double %5, 1.000000e+09
%7 = insertvalue { i64, double } poison, i64 %3, 0
%8 = insertvalue { i64, double } %7, double %6, 1
ret { i64, double } %8
}
/* Variables and functions */
int /*<<< orphan*/ memmove(float *, float const *, int);
extern void warp_mat4_copy(float *dst, const float *src) {
  if (dst == NULL || src == NULL)
    return;
  memmove(dst, src, sizeof(float) * 16);
}


x86 assembly (clang, -O0):
<warp_mat4_copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1136 <warp_mat4_copy+0x26>
cmpq   $0x0,-0x10(%rbp)
jne    113b <warp_mat4_copy+0x2b>
jmp    114d <warp_mat4_copy+0x3d>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x40,%edx
call   1030 <memmove@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<warp_mat4_copy>:
test   %rdi,%rdi
je     1124 <warp_mat4_copy+0x14>
test   %rsi,%rsi
je     1124 <warp_mat4_copy+0x14>
mov    $0x40,%edx
jmp    1030 <memmove@plt>
ret

LLVM IR (-O0):
define void @warp_mat4_copy(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %3
%6 = icmp eq float* %5, null
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load float*, float** %4
%9 = icmp eq float* %8, null
br i1 %9, label %10, label %11
10: ; preds = %7, %2
br label %15
11: ; preds = %7
%12 = load float*, float** %3
%13 = load float*, float** %4
%14 = call i32 @memmove(float* %12, float* %13, i32 64)
br label %15
15: ; preds = %11, %10
ret void
}

LLVM IR (-O2):
define void @warp_mat4_copy(float* %0, float* %1) {
%3 = icmp eq float* %0, null
%4 = icmp eq float* %1, null
%5 = or i1 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @memmove(float* %0, float* %1, i32 64)
br label %8
8: ; preds = %2, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SetFontUnderLine110(unsigned long);
void setfontunderline(unsigned long ud) { SetFontUnderLine110(ud); }


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

x86 assembly (clang, -O2):
<setfontunderline>:
jmp    1030 <SetFontUnderLine110@plt>

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

LLVM IR (-O2):
define void @setfontunderline(i64 %0) {
%2 = tail call i32 @SetFontUnderLine110(i64 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clearScr();
void runClear() { clearScr(); }


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

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

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

LLVM IR (-O2):
define void @runClear() {
%1 = tail call i32 (...) @clearScr()
ret void
}
int Cyc_Port_cmp_seg_t(unsigned loc1, unsigned loc2) {
  return (int)(loc1 - loc2);
}


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

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

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

LLVM IR (-O2):
define i32 @Cyc_Port_cmp_seg_t(i32 %0, i32 %1) {
%3 = sub i32 %0, %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
__attribute((section(".ghc.f1.1"), used)) void f1(int n) {
  printf("f1: %d\n", n);
}


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

x86 assembly (clang, -O2):
<f1>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"f1: %d\0A\00"
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (void (i32)* @f1 to i8*)], section "llvm.metadata"
define void @f1(i32 %0) section ".ghc.f1.1" {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"f1: %d\0A\00"
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (void (i32)* @f1 to i8*)], section "llvm.metadata"
define void @f1(i32 %0) section ".ghc.f1.1" {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIOCATMARK;
int _ioctl(int, int /*<<< orphan*/, int *);
int sockatmark(int s) {
  int atmark;
  if (_ioctl(s, SIOCATMARK, &atmark) == -1)
    return -1;
  return atmark;
}


x86 assembly (clang, -O0):
<sockatmark>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
lea    -0xc(%rbp),%rdx
call   1030 <_ioctl@plt>
cmp    $0xffffffff,%eax
jne    1145 <sockatmark+0x35>
movl   $0xffffffff,-0x4(%rbp)
jmp    114b <sockatmark+0x3b>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sockatmark>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
lea    0x4(%rsp),%rdx
call   1030 <_ioctl@plt>
cmp    $0xffffffff,%eax
je     112d <sockatmark+0x1d>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@SIOCATMARK = global i32 0
define i32 @sockatmark(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = load i32, i32* @SIOCATMARK
%7 = call i32 @_ioctl(i32 %5, i32 %6, i32* %4)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 -1, i32* %2
br label %12
10: ; preds = %1
%11 = load i32, i32* %4
store i32 %11, i32* %2
br label %12
12: ; preds = %10, %9
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@SIOCATMARK = global i32 0
define i32 @sockatmark(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i32, i32* @SIOCATMARK
%5 = call i32 @_ioctl(i32 %0, i32 %4, i32* %2)
%6 = icmp eq i32 %5, -1
%7 = load i32, i32* %2
%8 = select i1 %6, i32 -1, i32 %7
ret i32 %8
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _STAT_VER;
int __lxstat(int /*<<< orphan*/, char const *, struct stat *);
int __lstat(const char *file, struct stat *buf) {
  return __lxstat(_STAT_VER, file, buf);
}


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

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

LLVM IR (-O0):
%struct.stat = type { i32 }
@_STAT_VER = global i32 0
define i32 @__lstat(i8* %0, %struct.stat* %1) {
%3 = alloca i8*
%4 = alloca %struct.stat*
store i8* %0, i8** %3
store %struct.stat* %1, %struct.stat** %4
%5 = load i32, i32* @_STAT_VER
%6 = load i8*, i8** %3
%7 = load %struct.stat*, %struct.stat** %4
%8 = call i32 @__lxstat(i32 %5, i8* %6, %struct.stat* %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@_STAT_VER = global i32 0
define i32 @__lstat(i8* %0, %struct.stat* %1) {
%3 = load i32, i32* @_STAT_VER
%4 = tail call i32 @__lxstat(i32 %3, i8* %0, %struct.stat* %1)
ret i32 %4
}
int max(int x, int y) {
  if (x > y)
    return y;
  else
    return x;
}


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

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

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

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
void glBufferSubData(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glBufferSubData() {
ret void
}
unsigned int hashnat(void *key, unsigned int buckets) {
  int *p = key;
  return *p % buckets;
}


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

x86 assembly (clang, -O2):
<hashnat>:
mov    (%rdi),%eax
xor    %edx,%edx
div    %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @hashnat(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %5
%8 = load i32*, i32** %5
%9 = load i32, i32* %8
%10 = load i32, i32* %4
%11 = urem i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @hashnat(i8* nocapture %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = urem i32 %4, %1
ret i32 %5
}
void GPIOPortM_Handler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<GPIOPortM_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <GPIOPortM_Handler+0x9>
jmp    1109 <GPIOPortM_Handler+0x9>

x86 assembly (clang, -O2):
<GPIOPortM_Handler>:
jmp    1100 <GPIOPortM_Handler>

LLVM IR (-O0):
define void @GPIOPortM_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @GPIOPortM_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printSegmentationFaultMessage(void) {
  printf("Executing the current line would cause segmentation fault.\n");
  printf("Please use the 'list' command to track the line where the error "
         "occurred\n");
}


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

x86 assembly (clang, -O2):
<printSegmentationFaultMessage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf17(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [60 x i8] c"Executing the current line would cause segmentation fault.\0A\00"
@.str.1 = [74 x i8] c"Please use the 'list' command to track the line where the error occurred\0A\00"
define void @printSegmentationFaultMessage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [59 x i8] c"Executing the current line would cause segmentation fault.\00"
@str.2 = [73 x i8] c"Please use the 'list' command to track the line where the error occurred\00"
define void @printSegmentationFaultMessage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([73 x i8], [73 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
char tolower(char);
char *QC_strlower(char *start) {
  char *in;
  in = start;
  while (*in) {
    *in = tolower(*in);
    in++;
  }
  return start;
}


x86 assembly (clang, -O0):
<QC_strlower>:
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     1156 <QC_strlower+0x46>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <QC_strlower+0x14>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<QC_strlower>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%al
test   %al,%al
je     1146 <QC_strlower+0x36>
lea    0x1(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <QC_strlower+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @QC_strlower(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 %16
9: ; preds = %5
%10 = load i8*, i8** %3
%11 = load i8, i8* %10
%12 = call signext i8 @tolower(i8 signext %11)
%13 = load i8*, i8** %3
store i8 %12, i8* %13
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %3
br label %5
16: ; preds = %5
%17 = load i8*, i8** %2
ret i8* %17
}

LLVM IR (-O2):
define i8* @QC_strlower(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call signext i8 @tolower(i8 signext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret i8* %0
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint8_t pixel_a(uint32_t pixel) { return (pixel >> 24) & 0xff; }


x86 assembly (clang, -O0):
<pixel_a>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x18,%eax
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pixel_a>:
mov    %edi,%eax
shr    $0x18,%eax
ret

LLVM IR (-O0):
define i32 @pixel_a(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 24
%5 = and i32 %4, 255
ret i32 %5
}

LLVM IR (-O2):
define i32 @pixel_a(i32 %0) {
%2 = lshr i32 %0, 24
ret i32 %2
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ atoi(char *);
int call_custom_cc(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  printf("result: %d\n", call_custom_cc(atoi(argv[1]), atoi(argv[2])));
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1050 <atoi@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%esi
call   1040 <call_custom_cc@plt>
mov    %eax,%esi
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e5e(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   1050 <atoi@plt>
mov    %eax,%ebp
mov    0x10(%rbx),%rdi
call   1050 <atoi@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1040 <call_custom_cc@plt>
lea    0xea6(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    0x2e78(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [12 x i8] c"result: %d\0A\00"
@EXIT_SUCCESS = global i32 0
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 i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = call i32 @atoi(i8* %8)
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 2
%12 = load i8*, i8** %11
%13 = call i32 @atoi(i8* %12)
%14 = call i32 @call_custom_cc(i32 %9, i32 %13)
%15 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %14)
%16 = load i32, i32* @EXIT_SUCCESS
ret i32 %16
}

LLVM IR (-O2):
@.str = [12 x i8] c"result: %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
%6 = getelementptr inbounds i8*, i8** %1, i64 2
%7 = load i8*, i8** %6
%8 = tail call i32 @atoi(i8* %7)
%9 = tail call i32 @call_custom_cc(i32 %5, i32 %8)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i32, i32* @EXIT_SUCCESS
ret i32 %11
}
int GetGreater(int x, int y) {
  int g;
  if (x < y)
    g = y;
  else
    g = x;
  return g;
}


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

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

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

LLVM IR (-O2):
define i32 @GetGreater(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Variables and functions */
int genrand_int32();
double genrand_res53(void) {
  unsigned long a = genrand_int32() >> 5, b = genrand_int32() >> 6;
  return ((double)a * 67108864.0 + (double)b) * (1.0 / 9007199254740992.0);
}


x86 assembly (clang, -O0):
<genrand_res53>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
xor    %eax,%eax
mov    %al,-0x11(%rbp)
call   1030 <genrand_int32@plt>
mov    %eax,%ecx
mov    -0x11(%rbp),%al
sar    $0x5,%ecx
movslq %ecx,%rcx
mov    %rcx,-0x8(%rbp)
call   1030 <genrand_int32@plt>
sar    $0x6,%eax
cltq
mov    %rax,-0x10(%rbp)
movaps 0xeca(%rip),%xmm3
movq   -0x8(%rbp),%xmm0
punpckldq %xmm3,%xmm0
movapd 0xec9(%rip),%xmm2
subpd  %xmm2,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
movq   -0x10(%rbp),%xmm1
punpckldq %xmm3,%xmm1
subpd  %xmm2,%xmm1
movaps %xmm1,%xmm2
unpckhpd %xmm1,%xmm1
addsd  %xmm2,%xmm1
movsd  0xe82(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe6a(%rip),%xmm1
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genrand_res53>:
push   %rbx
xor    %eax,%eax
call   1030 <genrand_int32@plt>
sar    $0x5,%eax
movslq %eax,%rbx
xor    %eax,%eax
call   1030 <genrand_int32@plt>
sar    $0x6,%eax
cltq
movq   %rbx,%xmm1
movdqa 0xec9(%rip),%xmm2
punpckldq %xmm2,%xmm1
movapd 0xecd(%rip),%xmm3
subpd  %xmm3,%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
addsd  %xmm1,%xmm0
movq   %rax,%xmm1
punpckldq %xmm2,%xmm1
subpd  %xmm3,%xmm1
movapd %xmm1,%xmm2
unpckhpd %xmm1,%xmm2
mulsd  0xeb0(%rip),%xmm0
addsd  %xmm1,%xmm2
addsd  %xmm2,%xmm0
mulsd  0xea8(%rip),%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define double @genrand_res53() {
%1 = alloca i64
%2 = alloca i64
%3 = call i32 (...) @genrand_int32()
%4 = ashr i32 %3, 5
%5 = sext i32 %4 to i64
store i64 %5, i64* %1
%6 = call i32 (...) @genrand_int32()
%7 = ashr i32 %6, 6
%8 = sext i32 %7 to i64
store i64 %8, i64* %2
%9 = load i64, i64* %1
%10 = uitofp i64 %9 to double
%11 = load i64, i64* %2
%12 = uitofp i64 %11 to double
%13 = call double @llvm.fmuladd.f64(double %10, double 0x4190000000000000, double %12)
%14 = fmul double %13, 0x3CA0000000000000
ret double %14
}

LLVM IR (-O2):
define double @genrand_res53() {
%1 = tail call i32 (...) @genrand_int32()
%2 = ashr i32 %1, 5
%3 = sext i32 %2 to i64
%4 = tail call i32 (...) @genrand_int32()
%5 = ashr i32 %4, 6
%6 = sext i32 %5 to i64
%7 = uitofp i64 %3 to double
%8 = uitofp i64 %6 to double
%9 = tail call double @llvm.fmuladd.f64(double %7, double 0x4190000000000000, double %8)
%10 = fmul double %9, 0x3CA0000000000000
ret double %10
}
void fc287(int n) {
  {
    typedef int(*b)[n];
    {
      typedef int(*c)[n];
      0;
    }
    {
      typedef int(*d)[n];
      0;
    };
    typedef int(*e)[n];
    0;
  };
  {
    typedef int(*f)[n];
    {
      typedef int(*g)[n];
      0;
    };
    {
      typedef int(*h)[n];
      0;
    };
    ;
    typedef int(*i)[n];
    0;
  };
  ;
  typedef int(*j)[n];
a:
  0;
  goto a;
}


x86 assembly (clang, -O0):
<fc287>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <fc287+0x7>

x86 assembly (clang, -O2):
<fc287>:
jmp    1100 <fc287>

LLVM IR (-O0):
define void @fc287(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
%7 = load i32, i32* %2
%8 = zext i32 %7 to i64
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
%11 = load i32, i32* %2
%12 = zext i32 %11 to i64
%13 = load i32, i32* %2
%14 = zext i32 %13 to i64
%15 = load i32, i32* %2
%16 = zext i32 %15 to i64
%17 = load i32, i32* %2
%18 = zext i32 %17 to i64
%19 = load i32, i32* %2
%20 = zext i32 %19 to i64
br label %21
21: ; preds = %21, %1
br label %21
}

LLVM IR (-O2):
define void @fc287(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void printHorizontal(int v) {
  if (v)
    printf("%s", "___");
  else
    printf("%s", "   ");
}


x86 assembly (clang, -O0):
<printHorizontal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     113d <printHorizontal+0x2d>
lea    0xed4(%rip),%rdi
lea    0xed0(%rip),%rsi
call   1030 <printf@plt>
jmp    1150 <printHorizontal+0x40>
lea    0xebc(%rip),%rdi
lea    0xebc(%rip),%rsi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printHorizontal>:
test   %edi,%edi
lea    0xeee(%rip),%rax
lea    0xee3(%rip),%rsi
cmove  %rax,%rsi
lea    0xed5(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"___\00"
@.str.2 = [4 x i8] c" \00"
define void @printHorizontal(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
volatile void unlock_and_exit(int code) { exit(code); }


x86 assembly (clang, -O0):
<unlock_and_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<unlock_and_exit>:
push   %rax
call   1030 <exit@plt>

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

LLVM IR (-O2):
define void @unlock_and_exit(i32 %0) {
%2 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int addr_classbits(char);
scalar_t__ ceil(int);
int log(int);
int netw_subcount_bits(int subcount, char class) {
  return (int)ceil((log((double)subcount) / log(2.))) + addr_classbits(class);
}


x86 assembly (clang, -O0):
<netw_subcount_bits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1040 <log@plt>
mov    %eax,-0x10(%rbp)
mov    $0x2,%edi
call   1040 <log@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <ceil@plt>
mov    %eax,-0xc(%rbp)
movsbl -0x5(%rbp),%edi
call   1050 <addr_classbits@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<netw_subcount_bits>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
call   1040 <log@plt>
mov    %eax,%ebp
mov    $0x2,%edi
call   1040 <log@plt>
mov    %eax,%ecx
mov    %ebp,%eax
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <ceil@plt>
mov    %rax,%rbp
mov    %ebx,%edi
call   1050 <addr_classbits@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @netw_subcount_bits(i32 %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i8
store i32 %0, i32* %3
store i8 %1, i8* %4
%5 = load i32, i32* %3
%6 = sitofp i32 %5 to double
%7 = fptosi double %6 to i32
%8 = call i32 @log(i32 %7)
%9 = call i32 @log(i32 2)
%10 = sdiv i32 %8, %9
%11 = call i64 @ceil(i32 %10)
%12 = trunc i64 %11 to i32
%13 = load i8, i8* %4
%14 = call i32 @addr_classbits(i8 signext %13)
%15 = add nsw i32 %12, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @netw_subcount_bits(i32 %0, i8 signext %1) {
%3 = tail call i32 @log(i32 %0)
%4 = tail call i32 @log(i32 2)
%5 = sdiv i32 %3, %4
%6 = tail call i64 @ceil(i32 %5)
%7 = trunc i64 %6 to i32
%8 = tail call i32 @addr_classbits(i8 signext %1)
%9 = add nsw i32 %8, %7
ret i32 %9
}
/* Type definitions */
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
uint32_t __attribute__((always_)) bj_v32_of_p16(uint16_t *p16) {
  uint32_t v32 = p16[1];
  v32 <<= 16;
  v32 |= p16[0];
  return v32;
}


x86 assembly (clang, -O0):
<bj_v32_of_p16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x10,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bj_v32_of_p16>:
mov    0x4(%rdi),%eax
shl    $0x10,%eax
or     (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @bj_v32_of_p16(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = getelementptr inbounds i32, i32* %4, i64 1
%6 = load i32, i32* %5
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = shl i32 %7, 16
store i32 %8, i32* %3
%9 = load i32*, i32** %2
%10 = getelementptr inbounds i32, i32* %9, i64 0
%11 = load i32, i32* %10
%12 = load i32, i32* %3
%13 = or i32 %12, %11
store i32 %13, i32* %3
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @bj_v32_of_p16(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load i32, i32* %2
%4 = shl i32 %3, 16
%5 = load i32, i32* %0
%6 = or i32 %4, %5
ret i32 %6
}
int func(void) {
  int n = 3;
  int m = 5;
  n != m;
  return 0;
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
movl   $0x3,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @func() {
ret i32 0
}
/* Variables and functions */
size_t const getpagesize();
size_t getmaplength(const size_t len) {
  return ((len + getpagesize() - 1) / getpagesize()) * getpagesize();
}


x86 assembly (clang, -O0):
<getmaplength>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1030 <getpagesize@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
add    %rcx,%rax
sub    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <getpagesize@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
xor    %edx,%edx
div    %rcx
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <getpagesize@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
imul   %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getmaplength>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <getpagesize@plt>
add    %rax,%rbx
add    $0xffffffffffffffff,%rbx
xor    %eax,%eax
call   1030 <getpagesize@plt>
mov    %rax,%rcx
or     %rbx,%rax
shr    $0x20,%rax
je     1142 <getmaplength+0x32>
mov    %rbx,%rax
xor    %edx,%edx
div    %rcx
mov    %rax,%rbx
jmp    114a <getmaplength+0x3a>
mov    %ebx,%eax
xor    %edx,%edx
div    %ecx
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <getpagesize@plt>
imul   %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @getmaplength(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 (...) @getpagesize()
%5 = add i64 %3, %4
%6 = sub i64 %5, 1
%7 = call i64 (...) @getpagesize()
%8 = udiv i64 %6, %7
%9 = call i64 (...) @getpagesize()
%10 = mul i64 %8, %9
ret i64 %10
}

LLVM IR (-O2):
define i64 @getmaplength(i64 %0) {
%2 = tail call i64 (...) @getpagesize()
%3 = add i64 %0, -1
%4 = add i64 %3, %2
%5 = tail call i64 (...) @getpagesize()
%6 = udiv i64 %4, %5
%7 = tail call i64 (...) @getpagesize()
%8 = mul i64 %7, %6
ret i64 %8
}