xunge/DecIR huggingface dataset:
unsigned int hash(n)
register const char *n;
{
  register unsigned int h = 0;
  while (*n != '\0')
    h = 2 * h + *n++;
  return h * 32821;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1141 <hash+0x41>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <hash+0xf>
imul   $0x8035,-0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%al
test   %al,%al
je     1128 <hash+0x28>
add    $0x1,%rdi
xor    %ecx,%ecx
nopl   0x0(%rax)
movsbl %al,%eax
lea    (%rax,%rcx,2),%ecx
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <hash+0x10>
imul   $0x8035,%ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %10, %4 ], [ %0, %1 ]
%8 = sext i8 %5 to i32
%9 = shl i32 %6, 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = add i32 %9, %8
%12 = load i8, i8* %10
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = mul i32 %11, 32821
br label %16
16: ; preds = %14, %1
%17 = phi i32 [ 0, %1 ], [ %15, %14 ]
ret i32 %17
}
void body(int argc, char **argv) {}


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

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

LLVM IR (-O0):
define void @body(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
ret void
}

LLVM IR (-O2):
define void @body(i32 %0, i8** nocapture %1) {
ret void
}
/* Variables and functions */
bool nrf53_errata_33(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf53_errata_33() {
ret i32 0
}
/* Variables and functions */
scalar_t__ strlen(char const *);
int str_is_set(const char *s) { return s != NULL && strlen(s) > 0; }


x86 assembly (clang, -O0):
<str_is_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     113f <str_is_set+0x2f>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%rax
setg   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_is_set>:
test   %rdi,%rdi
je     112b <str_is_set+0x1b>
push   %rax
call   1030 <strlen@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setg   %al
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @str_is_set(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i64 @strlen(i8* %6)
%8 = icmp sgt i64 %7, 0
br label %9
9: ; preds = %5, %1
%10 = phi i1 [ false, %1 ], [ %8, %5 ]
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @str_is_set(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i64 @strlen(i8* %0)
%5 = icmp sgt i64 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
void mat4_mul_quat(const float mat[4][4], const float q[4], float out[4][4]) {
  float qm[4][4];
  quat_to_mat4(q, qm);
  mat4_mul(mat, qm, out);
}


x86 assembly (clang, -O0):
<mat4_mul_quat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x60(%rbp),%rsi
mov    $0x0,%al
call   1030 <quat_to_mat4@plt>
mov    -0x8(%rbp),%rdi
lea    -0x60(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x0,%al
call   1040 <mat4_mul@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mat4_mul_quat>:
push   %r15
push   %r14
push   %rbx
sub    $0x40,%rsp
mov    %rdx,%r14
mov    %rdi,%rbx
mov    %rsp,%r15
mov    %rsi,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1030 <quat_to_mat4@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1040 <mat4_mul@plt>
add    $0x40,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @mat4_mul_quat([4 x float]* %0, float* %1, [4 x float]* %2) {
%4 = alloca [4 x float]*
%5 = alloca float*
%6 = alloca [4 x float]*
%7 = alloca [4 x [4 x float]]
store [4 x float]* %0, [4 x float]** %4
store float* %1, float** %5
store [4 x float]* %2, [4 x float]** %6
%8 = load float*, float** %5
%9 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %7, i64 0, i64 0
%10 = call i32 (float*, [4 x float]*, ...) bitcast (i32 (...)* @quat_to_mat4 to i32 (float*, [4 x float]*, ...)*)(float* %8, [4 x float]* %9)
%11 = load [4 x float]*, [4 x float]** %4
%12 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %7, i64 0, i64 0
%13 = load [4 x float]*, [4 x float]** %6
%14 = call i32 ([4 x float]*, [4 x float]*, [4 x float]*, ...) bitcast (i32 (...)* @mat4_mul to i32 ([4 x float]*, [4 x float]*, [4 x float]*, ...)*)([4 x float]* %11, [4 x float]* %12, [4 x float]* %13)
ret void
}

LLVM IR (-O2):
define void @mat4_mul_quat([4 x float]* %0, float* %1, [4 x float]* %2) {
%4 = alloca [4 x [4 x float]]
%5 = bitcast [4 x [4 x float]]* %4 to i8*
%6 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %4, i64 0, i64 0
%7 = call i32 (float*, [4 x float]*, ...) bitcast (i32 (...)* @quat_to_mat4 to i32 (float*, [4 x float]*, ...)*)(float* %1, [4 x float]* %6)
%8 = call i32 ([4 x float]*, [4 x float]*, [4 x float]*, ...) bitcast (i32 (...)* @mat4_mul to i32 ([4 x float]*, [4 x float]*, [4 x float]*, ...)*)([4 x float]* %0, [4 x float]* %6, [4 x float]* %2)
ret void
}
void GraphicsSetTitle(const char *title) {}


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

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

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

LLVM IR (-O2):
define void @GraphicsSetTitle(i8* nocapture %0) {
ret void
}
/* Type definitions */
struct lista {
  int dummy;
};

/* Variables and functions */
struct lista *inicializar_lista() {
  return NULL;
}


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

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

LLVM IR (-O0):
%struct.lista = type { i32 }
define %struct.lista* @inicializar_lista() {
ret %struct.lista* null
}

LLVM IR (-O2):
%struct.lista = type { i32 }
define noalias %struct.lista* @inicializar_lista() {
ret %struct.lista* null
}
int Operand_ulabel8_rtoa(unsigned int *valp, unsigned int pc) {
  *valp += pc;
  return 0;
}


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

x86 assembly (clang, -O2):
<Operand_ulabel8_rtoa>:
add    %esi,(%rdi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @Operand_ulabel8_rtoa(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = add i32 %3, %1
store i32 %4, i32* %0
ret i32 0
}
/* Variables and functions */
char *strstr(char *, char *);
int _bt_parse_ok(char *buf) {
  char *ok;
  if (!buf)
    return -1;
  ok = strstr(buf, "OK");
  return ok ? 0 : -1;
}


x86 assembly (clang, -O0):
<_bt_parse_ok>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <_bt_parse_ok+0x23>
movl   $0xffffffff,-0x4(%rbp)
jmp    115c <_bt_parse_ok+0x4c>
mov    -0x10(%rbp),%rdi
lea    0xec2(%rip),%rsi
call   1030 <strstr@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdx
mov    $0xffffffff,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_bt_parse_ok>:
test   %rdi,%rdi
je     112d <_bt_parse_ok+0x1d>
push   %rax
lea    0xee3(%rip),%rsi
call   1030 <strstr@plt>
cmp    $0x1,%rax
sbb    %eax,%eax
add    $0x8,%rsp
ret
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"OK\00"
define i32 @_bt_parse_ok(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i8* @strstr(i8* %0, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i8* %4, null
%6 = sext i1 %5 to i32
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ -1, %1 ]
ret i32 %8
}
double ts2mst(tsec)
double tsec;
{
  double dj;
  dj = ts2jd(tsec);
  return (jd2mst(dj));
}


x86 assembly (clang, -O0):
<ts2mst>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x1,%al
call   1040 <ts2jd@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    $0x1,%al
call   1030 <jd2mst@plt>
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ts2mst>:
push   %rax
mov    $0x1,%al
call   1040 <ts2jd@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mov    $0x1,%al
call   1030 <jd2mst@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @ts2mst(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call i32 (double, ...) bitcast (i32 (...)* @ts2jd to i32 (double, ...)*)(double %4)
%6 = sitofp i32 %5 to double
store double %6, double* %3
%7 = load double, double* %3
%8 = call i32 (double, ...) bitcast (i32 (...)* @jd2mst to i32 (double, ...)*)(double %7)
%9 = sitofp i32 %8 to double
ret double %9
}

LLVM IR (-O2):
define double @ts2mst(double %0) {
%2 = tail call i32 (double, ...) bitcast (i32 (...)* @ts2jd to i32 (double, ...)*)(double %0)
%3 = sitofp i32 %2 to double
%4 = tail call i32 (double, ...) bitcast (i32 (...)* @jd2mst to i32 (double, ...)*)(double %3)
%5 = sitofp i32 %4 to double
ret double %5
}
void *git___compare_and_swap(void *volatile *ptr, void *oldval, void *newval) {
  if (*ptr == oldval)
    *ptr = newval;
  else
    oldval = newval;
  return oldval;
}


x86 assembly (clang, -O0):
<git___compare_and_swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
cmp    -0x10(%rbp),%rax
jne    1131 <git___compare_and_swap+0x31>
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
jmp    1139 <git___compare_and_swap+0x39>
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<git___compare_and_swap>:
mov    (%rdi),%rcx
cmp    %rsi,%rcx
je     110c <git___compare_and_swap+0xc>
mov    %rdx,%rax
ret
mov    %rsi,%rax
mov    %rdx,(%rdi)
ret

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

LLVM IR (-O2):
define i8* @git___compare_and_swap(i8** %0, i8* readnone %1, i8* %2) {
%4 = load volatile i8*, i8** %0
%5 = icmp eq i8* %4, %1
br i1 %5, label %6, label %7
6: ; preds = %3
store volatile i8* %2, i8** %0
br label %7
7: ; preds = %3, %6
%8 = phi i8* [ %1, %6 ], [ %2, %3 ]
ret i8* %8
}
void EC_POINT_mul(void) {}


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

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

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

LLVM IR (-O2):
define void @EC_POINT_mul() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ aes_avx_test();
void __attribute__((no)) do_test(void) { aes_avx_test(); }


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

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

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

LLVM IR (-O2):
define void @do_test() {
%1 = tail call i32 (...) @aes_avx_test()
ret void
}
/* Variables and functions */
double pop();
int /*<<< orphan*/ push(double);
void swapItems() {
  double temp1 = pop();
  double temp2 = pop();
  push(temp1);
  push(temp2);
}


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

x86 assembly (clang, -O2):
<swapItems>:
sub    $0x18,%rsp
xor    %eax,%eax
call   1030 <pop@plt>
movsd  %xmm0,0x10(%rsp)
xor    %eax,%eax
call   1030 <pop@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1040 <push@plt>
movsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
jmp    1040 <push@plt>

LLVM IR (-O0):
define void @swapItems() {
%1 = alloca double
%2 = alloca double
%3 = call double (...) @pop()
store double %3, double* %1
%4 = call double (...) @pop()
store double %4, double* %2
%5 = load double, double* %1
%6 = call i32 @push(double %5)
%7 = load double, double* %2
%8 = call i32 @push(double %7)
ret void
}

LLVM IR (-O2):
define void @swapItems() {
%1 = tail call double (...) @pop()
%2 = tail call double (...) @pop()
%3 = tail call i32 @push(double %1)
%4 = tail call i32 @push(double %2)
ret void
}
int lm_hosts_sanlock(struct lockspace *ls, int notify) { return -1; }


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

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

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

LLVM IR (-O2):
%struct.lockspace = type opaque
define i32 @lm_hosts_sanlock(%struct.lockspace* nocapture readnone %0, i32 %1) {
ret i32 -1
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello Test0001\n");
  return (EXIT_SUCCESS);
}


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"Hello Test0001\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [15 x i8] c"Hello Test0001\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ fn_extern();
int /*<<< orphan*/ fn_test1();
int /*<<< orphan*/ fn_test2();
int /*<<< orphan*/ fn_test3();
int /*<<< orphan*/ fn_test4();
int main() {
  fn_test1();
  fn_test2();
  fn_test3();
  fn_test4();
  fn_extern();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <fn_test1@plt>
mov    $0x0,%al
call   1050 <fn_test2@plt>
mov    $0x0,%al
call   1070 <fn_test3@plt>
mov    $0x0,%al
call   1030 <fn_test4@plt>
mov    $0x0,%al
call   1040 <fn_extern@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <fn_test1@plt>
xor    %eax,%eax
call   1050 <fn_test2@plt>
xor    %eax,%eax
call   1070 <fn_test3@plt>
xor    %eax,%eax
call   1030 <fn_test4@plt>
xor    %eax,%eax
call   1040 <fn_extern@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @fn_test1()
%3 = call i32 (...) @fn_test2()
%4 = call i32 (...) @fn_test3()
%5 = call i32 (...) @fn_test4()
%6 = call i32 (...) @fn_extern()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @fn_test1()
%2 = tail call i32 (...) @fn_test2()
%3 = tail call i32 (...) @fn_test3()
%4 = tail call i32 (...) @fn_test4()
%5 = tail call i32 (...) @fn_extern()
ret i32 0
}
/* Variables and functions */
scalar_t__ isspace(unsigned char);
char *skip_spaces(const char *str) {
  while (isspace((unsigned char)*str)) {
    str++;
  }
  return (char *)str;
}


x86 assembly (clang, -O0):
<skip_spaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     1143 <skip_spaces+0x33>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <skip_spaces+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_spaces>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movzbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isspace@plt>
test   %rax,%rax
jne    1120 <skip_spaces+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @skip_spaces(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i64 @isspace(i8 zeroext %4)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i8* %3
}
void rpmv2i_(dx, dy) int *dx, *dy;
{ rpmv2((float)*dx, (float)*dy); }


x86 assembly (clang, -O0):
<rpmv2i_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cvtsi2ssl (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x10(%rbp),%rax
cvtsi2ssl (%rax),%xmm1
cvtss2sd %xmm1,%xmm1
mov    $0x2,%al
call   1030 <rpmv2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rpmv2i_>:
cvtsi2ssl (%rdi),%xmm0
cvtsi2ssl (%rsi),%xmm1
cvtss2sd %xmm0,%xmm0
cvtss2sd %xmm1,%xmm1
mov    $0x2,%al
jmp    1030 <rpmv2@plt>

LLVM IR (-O0):
define void @rpmv2i_(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 = sitofp i32 %6 to float
%8 = fpext float %7 to double
%9 = load i32*, i32** %4
%10 = load i32, i32* %9
%11 = sitofp i32 %10 to float
%12 = fpext float %11 to double
%13 = call i32 (double, double, ...) bitcast (i32 (...)* @rpmv2 to i32 (double, double, ...)*)(double %8, double %12)
ret void
}

LLVM IR (-O2):
define void @rpmv2i_(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = sitofp i32 %3 to float
%5 = fpext float %4 to double
%6 = load i32, i32* %1
%7 = sitofp i32 %6 to float
%8 = fpext float %7 to double
%9 = tail call i32 (double, double, ...) bitcast (i32 (...)* @rpmv2 to i32 (double, double, ...)*)(double %5, double %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ptr_glEndList();
extern void glEndList(void) { ptr_glEndList(); }


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

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

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

LLVM IR (-O2):
define void @glEndList() {
%1 = tail call i32 (...) @ptr_glEndList()
ret void
}
/* Variables and functions */
double sin(double);
double sqrt(double);
double sphsn(double a, double es, double sphi) {
  double sinSphi = sin(sphi);
  return a / sqrt(1.0 - es * (sinSphi * sinSphi));
}


x86 assembly (clang, -O0):
<sphsn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe7e(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
divsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sphsn>:
sub    $0x18,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
movapd %xmm2,%xmm0
call   1030 <sin@plt>
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  0x8(%rsp),%xmm1
movsd  0xeb1(%rip),%xmm0
subsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1163 <sphsn+0x43>
sqrtsd %xmm0,%xmm0
jmp    1168 <sphsn+0x48>
call   1040 <sqrt@plt>
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @sphsn(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%8 = load double, double* %6
%9 = call double @sin(double %8)
store double %9, double* %7
%10 = load double, double* %4
%11 = load double, double* %5
%12 = load double, double* %7
%13 = load double, double* %7
%14 = fmul double %12, %13
%15 = fneg double %11
%16 = call double @llvm.fmuladd.f64(double %15, double %14, double 1.000000e+00)
%17 = call double @sqrt(double %16)
%18 = fdiv double %10, %17
ret double %18
}

LLVM IR (-O2):
define double @sphsn(double %0, double %1, double %2) {
%4 = tail call double @sin(double %2)
%5 = fmul double %4, %4
%6 = fneg double %1
%7 = tail call double @llvm.fmuladd.f64(double %6, double %5, double 1.000000e+00)
%8 = tail call double @sqrt(double %7)
%9 = fdiv double %0, %8
ret double %9
}
A0RX1(r0, r1, x0, x1, p0, p1) unsigned char r0, r1;
unsigned char *p0, *p1;
{
  if ((*((unsigned char *)10000000)) <= (p1[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<A0RX1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %dil,%sil
mov    %sil,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    $0x989680,%eax
movzbl (%rax),%eax
mov    -0x20(%rbp),%rcx
movslq -0x10(%rbp),%rdx
movzbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jg     1146 <A0RX1+0x46>
movl   $0x1,-0x4(%rbp)
jmp    114d <A0RX1+0x4d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<A0RX1>:
mov    0x989680,%dl
movslq %ecx,%rcx
xor    %eax,%eax
cmp    (%r9,%rcx,1),%dl
setbe  %al
ret

LLVM IR (-O0):
define i32 @A0RX1(i32 %0, i32 %1, i32 %2, i32 %3, i8* %4, i8* %5) {
%7 = alloca i32
%8 = alloca i8
%9 = alloca i8
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i8*
%14 = trunc i32 %0 to i8
%15 = trunc i32 %1 to i8
store i8 %14, i8* %8
store i8 %15, i8* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i8* %4, i8** %12
store i8* %5, i8** %13
%16 = load i8, i8* inttoptr (i64 10000000 to i8*)
%17 = zext i8 %16 to i32
%18 = load i8*, i8** %13
%19 = load i32, i32* %11
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %18, i64 %20
%22 = load i8, i8* %21
%23 = zext i8 %22 to i32
%24 = icmp sle i32 %17, %23
br i1 %24, label %25, label %26
25: ; preds = %6
store i32 1, i32* %7
br label %27
26: ; preds = %6
store i32 0, i32* %7
br label %27
27: ; preds = %26, %25
%28 = load i32, i32* %7
ret i32 %28
}

LLVM IR (-O2):
define i32 @A0RX1(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture readnone %4, i8* nocapture %5) {
%7 = load i8, i8* inttoptr (i64 10000000 to i8*)
%8 = sext i32 %3 to i64
%9 = getelementptr inbounds i8, i8* %5, i64 %8
%10 = load i8, i8* %9
%11 = icmp ule i8 %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint8_t instruction_operation_extract_register_low(uint16_t instruction) {
  return (instruction >> 0x00) & 0x07;
}


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

x86 assembly (clang, -O2):
<instruction_operation_extract_register_low>:
mov    %edi,%eax
and    $0x7,%eax
ret

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

LLVM IR (-O2):
define i32 @instruction_operation_extract_register_low(i32 %0) {
%2 = and i32 %0, 7
ret i32 %2
}
int Int_bit_MINUS_not(int x) { return ~x; }


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

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

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

LLVM IR (-O2):
define i32 @Int_bit_MINUS_not(i32 %0) {
%2 = xor i32 %0, -1
ret i32 %2
}
void view_hotel_key_local(void) {}


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

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

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

LLVM IR (-O2):
define void @view_hotel_key_local() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
void help(void) {
  error("Usage:\n"
        "    convert <option> <input> <output>\n"
        "Options:\n"
        "    -a, --ascii: convert to ascii format\n"
        "    -b, --big-endian: convert to big-endian format\n"
        "    -l, --little-endian: convert to little-endian format\n");
}


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

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

LLVM IR (-O0):
@.str = [204 x i8] c"Usage:\0A convert <option> <input> <output>\0AOptions:\0A -a, --ascii: convert to ascii format\0A -b, --big-endian: convert to big-endian format\0A -l, --little-endian: convert to little-endian format\0A\00"
define void @help() {
%1 = call i32 @error(i8* getelementptr inbounds ([204 x i8], [204 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [204 x i8] c"Usage:\0A convert <option> <input> <output>\0AOptions:\0A -a, --ascii: convert to ascii format\0A -b, --big-endian: convert to big-endian format\0A -l, --little-endian: convert to little-endian format\0A\00"
define void @help() {
%1 = tail call i32 @error(i8* getelementptr inbounds ([204 x i8], [204 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct rlite {
  int dummy;
};

/* Variables and functions */
int rl_key_get_ignore_expire(struct rlite *, unsigned char const *, long,
                             unsigned char *, long *, long *,
                             unsigned long long *, long *, int /*<<< orphan*/);
int rl_key_get(struct rlite *db, const unsigned char *key, long keylen,
               unsigned char *type, long *string_page, long *value_page,
               unsigned long long *expires, long *version) {
  return rl_key_get_ignore_expire(db, key, keylen, type, string_page,
                                  value_page, expires, version, 0);
}


x86 assembly (clang, -O0):
<rl_key_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
mov    0x10(%rbp),%r10
mov    0x18(%rbp),%rax
xor    %r11d,%r11d
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
movl   $0x0,0x10(%rsp)
call   1030 <rl_key_get_ignore_expire@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rl_key_get>:
sub    $0x18,%rsp
movaps 0x20(%rsp),%xmm0
movups %xmm0,(%rsp)
movl   $0x0,0x10(%rsp)
call   1030 <rl_key_get_ignore_expire@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.rlite = type { i32 }
define i32 @rl_key_get(%struct.rlite* %0, i8* %1, i64 %2, i8* %3, i64* %4, i64* %5, i64* %6, i64* %7) {
%9 = alloca %struct.rlite*
%10 = alloca i8*
%11 = alloca i64
%12 = alloca i8*
%13 = alloca i64*
%14 = alloca i64*
%15 = alloca i64*
%16 = alloca i64*
store %struct.rlite* %0, %struct.rlite** %9
store i8* %1, i8** %10
store i64 %2, i64* %11
store i8* %3, i8** %12
store i64* %4, i64** %13
store i64* %5, i64** %14
store i64* %6, i64** %15
store i64* %7, i64** %16
%17 = load %struct.rlite*, %struct.rlite** %9
%18 = load i8*, i8** %10
%19 = load i64, i64* %11
%20 = load i8*, i8** %12
%21 = load i64*, i64** %13
%22 = load i64*, i64** %14
%23 = load i64*, i64** %15
%24 = load i64*, i64** %16
%25 = call i32 @rl_key_get_ignore_expire(%struct.rlite* %17, i8* %18, i64 %19, i8* %20, i64* %21, i64* %22, i64* %23, i64* %24, i32 0)
ret i32 %25
}

LLVM IR (-O2):
%struct.rlite = type { i32 }
define i32 @rl_key_get(%struct.rlite* %0, i8* %1, i64 %2, i8* %3, i64* %4, i64* %5, i64* %6, i64* %7) {
%9 = tail call i32 @rl_key_get_ignore_expire(%struct.rlite* %0, i8* %1, i64 %2, i8* %3, i64* %4, i64* %5, i64* %6, i64* %7, i32 0)
ret i32 %9
}
int strDelNL(char *suchen) {
  int counter = 0;
  while (*suchen != '\0') {
    if (*suchen == '\n')
      *suchen = '\0';
    suchen++;
  }
  return counter;
}


x86 assembly (clang, -O0):
<strDelNL>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1147 <strDelNL+0x47>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    1136 <strDelNL+0x36>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <strDelNL+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strDelNL>:
jmp    1117 <strDelNL+0x17>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movb   $0x0,(%rdi)
add    $0x1,%rdi
movzbl (%rdi),%eax
cmp    $0xa,%al
je     1110 <strDelNL+0x10>
test   %al,%al
jne    1113 <strDelNL+0x13>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strDelNL(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
switch i8 %4, label %6 [
i8 0, label %8
i8 10, label %5
]
5: ; preds = %2
store i8 0, i8* %3
br label %6
6: ; preds = %2, %5
%7 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
8: ; preds = %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Double2Stg(char *, double);
int /*<<< orphan*/ RTrimDecimal(char *);
void Double2TStg(char *lps, double factor) {
  Double2Stg(lps, factor);
  RTrimDecimal(lps);
}


x86 assembly (clang, -O0):
<Double2TStg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
movsd  -0x10(%rbp),%xmm0
call   1030 <Double2Stg@plt>
mov    -0x8(%rbp),%rdi
call   1040 <RTrimDecimal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Double2TStg>:
push   %rbx
mov    %rdi,%rbx
call   1030 <Double2Stg@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <RTrimDecimal@plt>

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

LLVM IR (-O2):
define void @Double2TStg(i8* %0, double %1) {
%3 = tail call i32 @Double2Stg(i8* %0, double %1)
%4 = tail call i32 @RTrimDecimal(i8* %0)
ret void
}
/* Variables and functions */
#define NID_sha1 131
#define NID_sha256 130
#define NID_sha384 129
#define NID_sha512 128
int RSA_X931_hash_id(int nid) {
  switch (nid) {
  case NID_sha1:
    return 0x33;
  case NID_sha256:
    return 0x34;
  case NID_sha384:
    return 0x36;
  case NID_sha512:
    return 0x35;
  }
  return -1;
}


x86 assembly (clang, -O0):
<RSA_X931_hash_id>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffff80,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x3,%eax
ja     1160 <RSA_X931_hash_id+0x60>
mov    -0x10(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x33,-0x4(%rbp)
jmp    1167 <RSA_X931_hash_id+0x67>
movl   $0x34,-0x4(%rbp)
jmp    1167 <RSA_X931_hash_id+0x67>
movl   $0x36,-0x4(%rbp)
jmp    1167 <RSA_X931_hash_id+0x67>
movl   $0x35,-0x4(%rbp)
jmp    1167 <RSA_X931_hash_id+0x67>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RSA_X931_hash_id>:
add    $0xffffff80,%edi
mov    $0xffffffff,%eax
cmp    $0x3,%edi
ja     111a <RSA_X931_hash_id+0x1a>
movslq %edi,%rax
lea    0xee9(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @RSA_X931_hash_id(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %9 [
i32 131, label %5
i32 130, label %6
i32 129, label %7
i32 128, label %8
]
5: ; preds = %1
store i32 51, i32* %2
br label %10
6: ; preds = %1
store i32 52, i32* %2
br label %10
7: ; preds = %1
store i32 54, i32* %2
br label %10
8: ; preds = %1
store i32 53, i32* %2
br label %10
9: ; preds = %1
store i32 -1, i32* %2
br label %10
10: ; preds = %9, %8, %7, %6, %5
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@switch.table.RSA_X931_hash_id = [4 x i32] [i32 53, i32 54, i32 52, i32 51]
define i32 @RSA_X931_hash_id(i32 %0) {
%2 = add i32 %0, -128
%3 = icmp ult i32 %2, 4
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [4 x i32], [4 x i32]* @switch.table.RSA_X931_hash_id, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ -1, %1 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void usage(char *exename) {
  fprintf(stderr, " Usage: %s <runtime>\n", exename);
  fprintf(stderr, "   where <runtime> is given in seconds\n");
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rdx
mov    0x2ec5(%rip),%rbx
mov    (%rbx),%edi
lea    0xedc(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xee2(%rip),%rsi
xor    %eax,%eax
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c" Usage: %s <runtime>\0A\00"
@.str.1 = [40 x i8] c" where <runtime> is given in seconds\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c" Usage: %s <runtime>\0A\00"
@.str.1 = [40 x i8] c" where <runtime> is given in seconds\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
void **malloc(int);
int /*<<< orphan*/ printf(char *);
void *voidptr_constructor(void) {
  void **a = malloc(sizeof(*a));
  if (a == NULL) {
    printf("err: node.c, voidptr_constructor(), malloc, a\n");
    return NULL;
  }
  return a;
}


x86 assembly (clang, -O0):
<voidptr_constructor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x8,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115a <voidptr_constructor+0x3a>
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
movq   $0x0,-0x8(%rbp)
jmp    1162 <voidptr_constructor+0x42>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<voidptr_constructor>:
push   %rax
mov    $0x8,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1132 <voidptr_constructor+0x12>
pop    %rcx
ret
lea    0xec7(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [46 x i8] c"err: node.c, voidptr_constructor(), malloc, a\00"
define noalias i8* @voidptr_constructor() {
%1 = tail call i8** @malloc(i32 8)
%2 = icmp eq i8** %1, null
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str, i64 0, i64 0))
br label %7
5: ; preds = %0
%6 = bitcast i8** %1 to i8*
br label %7
7: ; preds = %5, %3
%8 = phi i8* [ null, %3 ], [ %6, %5 ]
ret i8* %8
}
/* Variables and functions */
float __nv_exp2f(float);
float exp2f(float __a) { return __nv_exp2f(__a); }


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

x86 assembly (clang, -O2):
<exp2f>:
jmp    1030 <__nv_exp2f@plt>

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

LLVM IR (-O2):
define float @exp2f(float %0) {
%2 = tail call float @__nv_exp2f(float %0)
ret float %2
}
int main() {
  int i = 5;
  int *b = &i;
  int j = (i > 5) ? 1 : ((i == 5) ? *b : 3);
  return j;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x5,-0x8(%rbp)
jle    1131 <main+0x31>
mov    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    115c <main+0x5c>
cmpl   $0x5,-0x8(%rbp)
jne    1149 <main+0x49>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
jmp    1156 <main+0x56>
mov    $0x3,%eax
mov    %eax,-0x1c(%rbp)
jmp    1156 <main+0x56>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
store i32 0, i32* %1
store i32 5, i32* %2
store i32* %2, i32** %3
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 5
br i1 %6, label %7, label %8
7: ; preds = %0
br label %17
8: ; preds = %0
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 5
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32*, i32** %3
%13 = load i32, i32* %12
br label %15
14: ; preds = %8
br label %15
15: ; preds = %14, %11
%16 = phi i32 [ %13, %11 ], [ 3, %14 ]
br label %17
17: ; preds = %15, %7
%18 = phi i32 [ 1, %7 ], [ %16, %15 ]
store i32 %18, i32* %4
%19 = load i32, i32* %4
ret i32 %19
}

LLVM IR (-O2):
define i32 @main() {
ret i32 5
}
void CRYPTO_set_locking_callback(void) {}


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

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

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

LLVM IR (-O2):
define void @CRYPTO_set_locking_callback() {
ret void
}
int foo(int a, short b, short c) {
  int bc = b * c;
  return a + (short)bc;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %dx,%ax
mov    %si,%cx
mov    %edi,-0x4(%rbp)
mov    %cx,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
movswl -0x6(%rbp),%eax
movswl -0x8(%rbp),%ecx
imul   %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
movswl %cx,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
imul   %edx,%esi
movswl %si,%eax
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @foo(i32 %0, i16 signext %1, i16 signext %2) {
%4 = alloca i32
%5 = alloca i16
%6 = alloca i16
%7 = alloca i32
store i32 %0, i32* %4
store i16 %1, i16* %5
store i16 %2, i16* %6
%8 = load i16, i16* %5
%9 = sext i16 %8 to i32
%10 = load i16, i16* %6
%11 = sext i16 %10 to i32
%12 = mul nsw i32 %9, %11
store i32 %12, i32* %7
%13 = load i32, i32* %4
%14 = load i32, i32* %7
%15 = trunc i32 %14 to i16
%16 = sext i16 %15 to i32
%17 = add nsw i32 %13, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @foo(i32 %0, i16 signext %1, i16 signext %2) {
%4 = mul i16 %2, %1
%5 = sext i16 %4 to i32
%6 = add nsw i32 %5, %0
ret i32 %6
}
unsigned long long gcd(unsigned long long n1, unsigned long long n2) {
  unsigned long long tmp;
  while (n1 != 0) {
    tmp = n1;
    n1 = n2 % n1;
    n2 = tmp;
  }
  return n2;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113c <gcd+0x3c>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x8(%rbp)
mov    %rdx,-0x8(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    110c <gcd+0xc>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %rsi,%rax
test   %rdi,%rdi
je     1135 <gcd+0x35>
mov    %rdi,%rdx
jmp    111d <gcd+0x1d>
nopl   (%rax)
xor    %edx,%edx
div    %rcx
mov    %rcx,%rax
test   %rdx,%rdx
je     1132 <gcd+0x32>
mov    %rdx,%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
jne    1110 <gcd+0x10>
xor    %edx,%edx
div    %ecx
jmp    1115 <gcd+0x15>
mov    %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @gcd(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %7, %4 ], [ %0, %2 ]
%6 = phi i64 [ %5, %4 ], [ %1, %2 ]
%7 = urem i64 %6, %5
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i64 [ %1, %2 ], [ %5, %4 ]
ret i64 %10
}