xunge/DecIR huggingface dataset:
/* Variables and functions */
int strcmp(char const *const, char const *const);
int compareTags(const void *const one, const void *const two) {
  const char *const line1 = *(const char *const *)one;
  const char *const line2 = *(const char *const *)two;
  return strcmp(line1, line2);
}


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

x86 assembly (clang, -O2):
<compareTags>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @compareTags(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i8**
%9 = load i8*, i8** %8
store i8* %9, i8** %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i8**
%12 = load i8*, i8** %11
store i8* %12, i8** %6
%13 = load i8*, i8** %5
%14 = load i8*, i8** %6
%15 = call i32 @strcmp(i8* %13, i8* %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @compareTags(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
unsigned int pos_ceil(long double num) {
  int inum = (int)num;
  if (num == (float)inum)
    return inum;
  return ((unsigned int)inum + 1);
}


x86 assembly (clang, -O0):
<pos_ceil>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x20(%rbp)
fnstcw -0x2e(%rbp)
movzwl -0x2e(%rbp),%eax
or     $0xc00,%eax
mov    %ax,-0x30(%rbp)
fldcw  -0x30(%rbp)
fistpl -0x28(%rbp)
fldcw  -0x2e(%rbp)
mov    -0x28(%rbp),%eax
mov    %eax,-0x24(%rbp)
fldt   -0x20(%rbp)
cvtsi2ssl -0x24(%rbp),%xmm0
movss  %xmm0,-0x2c(%rbp)
flds   -0x2c(%rbp)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
jne    115e <pos_ceil+0x5e>
jp     115e <pos_ceil+0x5e>
jmp    1153 <pos_ceil+0x53>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1167 <pos_ceil+0x67>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pos_ceil>:
fldt   0x8(%rsp)
fnstcw -0xc(%rsp)
movzwl -0xc(%rsp),%eax
or     $0xc00,%eax
mov    %ax,-0xa(%rsp)
fldcw  -0xa(%rsp)
fistl  -0x4(%rsp)
fldcw  -0xc(%rsp)
mov    -0x4(%rsp),%ecx
cvtsi2ss %ecx,%xmm0
movss  %xmm0,-0x8(%rsp)
flds   -0x8(%rsp)
fucomip %st(1),%st
fstp   %st(0)
setp   %al
setne  %dl
or     %al,%dl
movzbl %dl,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @pos_ceil(x86_fp80 %0) {
%2 = alloca i32
%3 = alloca x86_fp80
%4 = alloca i32
store x86_fp80 %0, x86_fp80* %3
%5 = load x86_fp80, x86_fp80* %3
%6 = fptosi x86_fp80 %5 to i32
store i32 %6, i32* %4
%7 = load x86_fp80, x86_fp80* %3
%8 = load i32, i32* %4
%9 = sitofp i32 %8 to float
%10 = fpext float %9 to x86_fp80
%11 = fcmp oeq x86_fp80 %7, %10
br i1 %11, label %12, label %14
12: ; preds = %1
%13 = load i32, i32* %4
store i32 %13, i32* %2
br label %17
14: ; preds = %1
%15 = load i32, i32* %4
%16 = add i32 %15, 1
store i32 %16, i32* %2
br label %17
17: ; preds = %14, %12
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @pos_ceil(x86_fp80 %0) {
%2 = fptosi x86_fp80 %0 to i32
%3 = sitofp i32 %2 to float
%4 = fpext float %3 to x86_fp80
%5 = fcmp une x86_fp80 %4, %0
%6 = zext i1 %5 to i32
%7 = add i32 %6, %2
ret i32 %7
}
double torad(double x) { return x * 3.14159 / 180; }


x86 assembly (clang, -O0):
<torad>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xef7(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xee2(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<torad>:
mulsd  0xef8(%rip),%xmm0
divsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @torad(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 3.141590e+00
%5 = fdiv double %4, 1.800000e+02
ret double %5
}

LLVM IR (-O2):
define double @torad(double %0) {
%2 = fmul double %0, 3.141590e+00
%3 = fdiv double %2, 1.800000e+02
ret double %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ *ptls_encode_quicint(int /*<<< orphan*/ *,
                                        int /*<<< orphan*/);
uint8_t *quicly_encode_max_data_frame(uint8_t *dst, uint64_t max_data) {
  *dst++ = 16;
  dst = ptls_encode_quicint(dst, max_data);
  return dst;
}


x86 assembly (clang, -O0):
<quicly_encode_max_data_frame>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
movl   $0x10,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <ptls_encode_quicint@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quicly_encode_max_data_frame>:
movl   $0x10,(%rdi)
add    $0x4,%rdi
jmp    1030 <ptls_encode_quicint@plt>

LLVM IR (-O0):
define i32* @quicly_encode_max_data_frame(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 = getelementptr inbounds i32, i32* %5, i32 1
store i32* %6, i32** %3
store i32 16, i32* %5
%7 = load i32*, i32** %3
%8 = load i32, i32* %4
%9 = call i32* @ptls_encode_quicint(i32* %7, i32 %8)
store i32* %9, i32** %3
%10 = load i32*, i32** %3
ret i32* %10
}

LLVM IR (-O2):
define i32* @quicly_encode_max_data_frame(i32* %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 1
store i32 16, i32* %0
%4 = tail call i32* @ptls_encode_quicint(i32* %3, i32 %1)
ret i32* %4
}
/* Type definitions */
struct cras_expr_expression {
  int dummy;
};

/* Variables and functions */
struct cras_expr_expression *parse_one_expr(char const **);
struct cras_expr_expression *cras_expr_expression_parse(const char *str) {
  if (!str)
    return NULL;
  return parse_one_expr(&str);
}


x86 assembly (clang, -O0):
<cras_expr_expression_parse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1134 <cras_expr_expression_parse+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1141 <cras_expr_expression_parse+0x31>
lea    -0x10(%rbp),%rdi
call   1030 <parse_one_expr@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cras_expr_expression_parse>:
push   %rax
mov    %rdi,(%rsp)
test   %rdi,%rdi
je     1124 <cras_expr_expression_parse+0x14>
mov    %rsp,%rdi
call   1030 <parse_one_expr@plt>
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.cras_expr_expression = type { i32 }
define %struct.cras_expr_expression* @cras_expr_expression_parse(i8* %0) {
%2 = alloca %struct.cras_expr_expression*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp ne i8* %4, null
br i1 %5, label %7, label %6
6: ; preds = %1
store %struct.cras_expr_expression* null, %struct.cras_expr_expression** %2
br label %9
7: ; preds = %1
%8 = call %struct.cras_expr_expression* @parse_one_expr(i8** %3)
store %struct.cras_expr_expression* %8, %struct.cras_expr_expression** %2
br label %9
9: ; preds = %7, %6
%10 = load %struct.cras_expr_expression*, %struct.cras_expr_expression** %2
ret %struct.cras_expr_expression* %10
}

LLVM IR (-O2):
%struct.cras_expr_expression = type { i32 }
define %struct.cras_expr_expression* @cras_expr_expression_parse(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = icmp eq i8* %0, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = call %struct.cras_expr_expression* @parse_one_expr(i8** %2)
br label %6
6: ; preds = %1, %4
%7 = phi %struct.cras_expr_expression* [ %5, %4 ], [ null, %1 ]
ret %struct.cras_expr_expression* %7
}
/* Variables and functions */
scalar_t__ getchar();
void b_getchar_8(char idx, char *cells, int size) {
  cells[idx] = (char)getchar();
}


x86 assembly (clang, -O0):
<b_getchar_8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %al,%dl
mov    -0x10(%rbp),%rax
movsbq -0x1(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_getchar_8>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <getchar@plt>
movslq %ebp,%rcx
mov    %al,(%rbx,%rcx,1)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @b_getchar_8(i8 signext %0, i8* %1, i32 %2) {
%4 = alloca i8
%5 = alloca i8*
%6 = alloca i32
store i8 %0, i8* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = call i64 (...) @getchar()
%8 = trunc i64 %7 to i8
%9 = load i8*, i8** %5
%10 = load i8, i8* %4
%11 = sext i8 %10 to i64
%12 = getelementptr inbounds i8, i8* %9, i64 %11
store i8 %8, i8* %12
ret void
}

LLVM IR (-O2):
define void @b_getchar_8(i8 signext %0, i8* nocapture writeonly %1, i32 %2) {
%4 = tail call i64 (...) @getchar()
%5 = trunc i64 %4 to i8
%6 = sext i8 %0 to i64
%7 = getelementptr inbounds i8, i8* %1, i64 %6
store i8 %5, i8* %7
ret void
}
unsigned LCGStep(unsigned z, unsigned A, unsigned C) { return (A * z + C); }


x86 assembly (clang, -O0):
<LCGStep>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x4(%rbp),%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCGStep>:
imul   %esi,%edi
lea    (%rdi,%rdx,1),%eax
ret

LLVM IR (-O0):
define i32 @LCGStep(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = mul i32 %7, %8
%10 = load i32, i32* %6
%11 = add i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @LCGStep(i32 %0, i32 %1, i32 %2) {
%4 = mul i32 %1, %0
%5 = add i32 %4, %2
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef unsigned int int32_t;

/* Variables and functions */
int /*<<< orphan*/ mdfour(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                          unsigned int);
unsigned Com_BlockChecksum(void *buffer, int32_t length) {
  int32_t digest[4];
  unsigned val;
  mdfour((uint8_t *)digest, (uint8_t *)buffer, length);
  val = digest[0] ^ digest[1] ^ digest[2] ^ digest[3];
  return val;
}


x86 assembly (clang, -O0):
<Com_BlockChecksum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <mdfour@plt>
mov    -0x20(%rbp),%eax
xor    -0x1c(%rbp),%eax
xor    -0x18(%rbp),%eax
xor    -0x14(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Com_BlockChecksum>:
sub    $0x18,%rsp
mov    %esi,%edx
mov    %rdi,%rsi
mov    %rsp,%rdi
call   1030 <mdfour@plt>
movdqa (%rsp),%xmm0
pshufd $0xee,%xmm0,%xmm1
pxor   %xmm0,%xmm1
pshufd $0x55,%xmm1,%xmm0
pxor   %xmm1,%xmm0
movd   %xmm0,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @Com_BlockChecksum(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [4 x i32]
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 0
%8 = load i8*, i8** %3
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %4
%11 = call i32 @mdfour(i32* %7, i32* %9, i32 %10)
%12 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 0
%13 = load i32, i32* %12
%14 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 1
%15 = load i32, i32* %14
%16 = xor i32 %13, %15
%17 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 2
%18 = load i32, i32* %17
%19 = xor i32 %16, %18
%20 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 3
%21 = load i32, i32* %20
%22 = xor i32 %19, %21
store i32 %22, i32* %6
%23 = load i32, i32* %6
ret i32 %23
}

LLVM IR (-O2):
define i32 @Com_BlockChecksum(i8* %0, i32 %1) {
%3 = alloca <4 x i32>
%4 = bitcast <4 x i32>* %3 to i8*
%5 = getelementptr inbounds <4 x i32>, <4 x i32>* %3, i64 0, i64 0
%6 = bitcast i8* %0 to i32*
%7 = call i32 @mdfour(i32* %5, i32* %6, i32 %1)
%8 = load <4 x i32>, <4 x i32>* %3
%9 = call i32 @llvm.vector.reduce.xor.v4i32(<4 x i32> %8)
ret i32 %9
}
void g_param_spec_unichar() {}


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

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

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

LLVM IR (-O2):
define void @g_param_spec_unichar() {
ret void
}
/* Variables and functions */
scalar_t__ EPERM;
scalar_t__ __rmdir(char const *);
scalar_t__ __unlink(char const *);
scalar_t__ errno;
int remove(const char *file) {
  if (__unlink(file) != 0 && (errno != EPERM || __rmdir(file) != 0))
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<remove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <__unlink@plt>
cmp    $0x0,%rax
je     1178 <remove+0x58>
mov    0x2e9a(%rip),%rax
mov    (%rax),%rax
mov    0x2e80(%rip),%rcx
cmp    (%rcx),%rax
jne    116c <remove+0x4c>
mov    -0x10(%rbp),%rdi
call   1040 <__rmdir@plt>
cmp    $0x0,%rax
je     1178 <remove+0x58>
movl   $0xffffffff,-0x4(%rbp)
jmp    117f <remove+0x5f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <__unlink@plt>
test   %rax,%rax
je     1158 <remove+0x38>
mov    0x2ea9(%rip),%rax
mov    (%rax),%rax
mov    0x2e8f(%rip),%rcx
mov    $0xffffffff,%ebp
cmp    (%rcx),%rax
jne    115a <remove+0x3a>
mov    %rbx,%rdi
call   1040 <__rmdir@plt>
test   %rax,%rax
jne    115a <remove+0x3a>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@errno = global i64 0
@EPERM = global i64 0
define i32 @remove(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @__unlink(i8* %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %16
7: ; preds = %1
%8 = load i64, i64* @errno
%9 = load i64, i64* @EPERM
%10 = icmp ne i64 %8, %9
br i1 %10, label %15, label %11
11: ; preds = %7
%12 = load i8*, i8** %3
%13 = call i64 @__rmdir(i8* %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %11, %7
store i32 -1, i32* %2
br label %17
16: ; preds = %11, %1
store i32 0, i32* %2
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
@errno = global i64 0
@EPERM = global i64 0
define i32 @remove(i8* %0) {
%2 = tail call i64 @__unlink(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = load i64, i64* @errno
%6 = load i64, i64* @EPERM
%7 = icmp eq i64 %5, %6
br i1 %7, label %8, label %12
8: ; preds = %4
%9 = tail call i64 @__rmdir(i8* %0)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %8, %1
br label %12
12: ; preds = %4, %8, %11
%13 = phi i32 [ 0, %11 ], [ -1, %8 ], [ -1, %4 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
scalar_t__ rc4_test();
int main() {
  printf("ARCFOUR tests: %s\n", rc4_test() ? "SUCCEEDED" : "FAILED");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <rc4_test@plt>
mov    %rax,%rcx
lea    0xedd(%rip),%rsi
lea    0xecc(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rsi
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <rc4_test@plt>
test   %rax,%rax
lea    0xeeb(%rip),%rax
lea    0xeda(%rip),%rsi
cmove  %rax,%rsi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"ARCFOUR tests: %s\0A\00"
@.str.1 = [10 x i8] c"SUCCEEDED\00"
@.str.2 = [7 x i8] c"FAILED\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @rc4_test()
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0)
%6 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"ARCFOUR tests: %s\0A\00"
@.str.1 = [10 x i8] c"SUCCEEDED\00"
@.str.2 = [7 x i8] c"FAILED\00"
define i32 @main() {
%1 = tail call i64 (...) @rc4_test()
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
void lcd_control(unsigned char disonoff, unsigned char curonoff,
                 unsigned char curblink) {}


x86 assembly (clang, -O0):
<lcd_control>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %dil,%dl
mov    %dl,-0x1(%rbp)
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @lcd_control(i8 zeroext %0, i8 zeroext %1, i8 zeroext %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
ret void
}

LLVM IR (-O2):
define void @lcd_control(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG(char *);
int check_map() {
  DEBUG("check_map");
  return 0;
}


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

x86 assembly (clang, -O2):
<check_map>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <DEBUG@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"check_map\00"
define i32 @check_map() {
%1 = tail call i32 @DEBUG(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ xfree(char *);
void free_mtnstatus_loglevel(char *buff) { xfree(buff); }


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

x86 assembly (clang, -O2):
<free_mtnstatus_loglevel>:
jmp    1030 <xfree@plt>

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

LLVM IR (-O2):
define void @free_mtnstatus_loglevel(i8* %0) {
%2 = tail call i32 @xfree(i8* %0)
ret void
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int FixedToRoundedInt(int32_t val) { return (val + 0x8000) >> 16; }


x86 assembly (clang, -O0):
<FixedToRoundedInt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x8000,%eax
sar    $0x10,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<FixedToRoundedInt>:
lea    0x8000(%rdi),%eax
sar    $0x10,%eax
ret

LLVM IR (-O0):
define i32 @FixedToRoundedInt(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 32768
%5 = ashr i32 %4, 16
ret i32 %5
}

LLVM IR (-O2):
define i32 @FixedToRoundedInt(i32 %0) {
%2 = add nsw i32 %0, 32768
%3 = ashr i32 %2, 16
ret i32 %3
}
/* Variables and functions */
size_t html_tbl_len(size_t sz, void *arg) { return sz; }


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

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

LLVM IR (-O0):
define i64 @html_tbl_len(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
store i8* %1, i8** %4
%5 = load i64, i64* %3
ret i64 %5
}

LLVM IR (-O2):
define i64 @html_tbl_len(i64 returned %0, i8* nocapture readnone %1) {
ret i64 %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ startCidades();
int main() {
  printf(" Hello, World!\n");
  startCidades();
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [16 x i8] c" Hello, World!\0A\00"
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 = call i32 (...) @startCidades()
ret i32 0
}

LLVM IR (-O2):
@str = [15 x i8] c" Hello, World!\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 = tail call i32 (...) @startCidades()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ IntDisable(unsigned long);
int /*<<< orphan*/ IntUnregister(unsigned long);
unsigned long PWMFaultIntGet(unsigned long);
void PWMFaultIntUnregister(unsigned long ulBase) {
  unsigned long ulInt;
  ;
  ulInt = PWMFaultIntGet(ulBase);
  IntDisable(ulInt);
  IntUnregister(ulInt);
}


x86 assembly (clang, -O0):
<PWMFaultIntUnregister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <PWMFaultIntGet@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <IntDisable@plt>
mov    -0x10(%rbp),%rdi
call   1050 <IntUnregister@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PWMFaultIntUnregister>:
push   %rbx
call   1030 <PWMFaultIntGet@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <IntDisable@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <IntUnregister@plt>

LLVM IR (-O0):
define void @PWMFaultIntUnregister(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i64 @PWMFaultIntGet(i64 %4)
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = call i32 @IntDisable(i64 %6)
%8 = load i64, i64* %3
%9 = call i32 @IntUnregister(i64 %8)
ret void
}

LLVM IR (-O2):
define void @PWMFaultIntUnregister(i64 %0) {
%2 = tail call i64 @PWMFaultIntGet(i64 %0)
%3 = tail call i32 @IntDisable(i64 %2)
%4 = tail call i32 @IntUnregister(i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ set_button_coordinates();
void lir_move_mouse_cursor(void) { set_button_coordinates(); }


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

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

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

LLVM IR (-O2):
define void @lir_move_mouse_cursor() {
%1 = tail call i32 (...) @set_button_coordinates()
ret void
}
void driver_attach(struct device_driver *drv) { return; }


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

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

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

LLVM IR (-O2):
%struct.device_driver = type opaque
define void @driver_attach(%struct.device_driver* nocapture %0) {
ret void
}
unsigned int agbnp3_two2n_size(unsigned int m) {
  unsigned int s = 1;
  unsigned int l = 2 * m;
  if (m <= 0)
    return 0;
  while (s < l) {
    s = (s << 1);
  }
  return s;
}


x86 assembly (clang, -O0):
<agbnp3_two2n_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
ja     112d <agbnp3_two2n_size+0x2d>
movl   $0x0,-0x4(%rbp)
jmp    1152 <agbnp3_two2n_size+0x52>
jmp    1132 <agbnp3_two2n_size+0x32>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jae    114c <agbnp3_two2n_size+0x4c>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1132 <agbnp3_two2n_size+0x32>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<agbnp3_two2n_size>:
test   %edi,%edi
je     111a <agbnp3_two2n_size+0x1a>
add    %edi,%edi
mov    $0x1,%ecx
nopl   0x0(%rax,%rax,1)
mov    %ecx,%eax
lea    (%rax,%rax,1),%ecx
cmp    %edi,%eax
jb     1110 <agbnp3_two2n_size+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @agbnp3_two2n_size(i32 %0) {
%2 = alloca i32
%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 = mul i32 2, %6
store i32 %7, i32* %5
%8 = load i32, i32* %3
%9 = icmp ule i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 0, i32* %2
br label %21
11: ; preds = %1
br label %12
12: ; preds = %16, %11
%13 = load i32, i32* %4
%14 = load i32, i32* %5
%15 = icmp ult i32 %13, %14
br i1 %15, label %16, label %19
16: ; preds = %12
%17 = load i32, i32* %4
%18 = shl i32 %17, 1
store i32 %18, i32* %4
br label %12
19: ; preds = %12
%20 = load i32, i32* %4
store i32 %20, i32* %2
br label %21
21: ; preds = %19, %10
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @agbnp3_two2n_size(i32 %0) {
%2 = shl i32 %0, 1
%3 = icmp eq i32 %0, 0
br i1 %3, label %8, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 1, %1 ]
%6 = icmp ult i32 %5, %2
%7 = shl i32 %5, 1
br i1 %6, label %4, label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %5, %4 ]
ret i32 %9
}
int fn2(int a, int b) {
  int tem1 = b & a;
  int tem2 = a ^ b;
  return tem1 | tem2;
}


x86 assembly (clang, -O0):
<fn2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
or     -0x10(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fn2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = and i32 %7, %8
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = xor i32 %10, %11
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = or i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @fn2(i32 %0, i32 %1) {
%3 = or i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M421_f(char *s) {
  debug("M421_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


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

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

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

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


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

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

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

LLVM IR (-O2):
define i32 @false_builtin(i8* nocapture readnone %0) {
ret i32 1
}
void __tone_off(struct tone_t *tone) {}


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

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

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

LLVM IR (-O2):
%struct.tone_t = type opaque
define void @__tone_off(%struct.tone_t* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void delay(int millis) {
  usleep(millis);
  return;
}


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

x86 assembly (clang, -O2):
<delay>:
jmp    1030 <usleep@plt>

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

LLVM IR (-O2):
define void @delay(i32 %0) {
%2 = tail call i32 @usleep(i32 %0)
ret void
}
int GetUserID(const char *Username) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @GetUserID(i8* nocapture readnone %0) {
ret i32 -1
}
int ld_eq_rm2(long double a1, long double *a2) { return !(((a1) == (*a2))); }


x86 assembly (clang, -O0):
<ld_eq_rm2>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
mov    %rdi,-0x18(%rbp)
fldt   -0x10(%rbp)
mov    -0x18(%rbp),%rax
fldt   (%rax)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setnp  %cl
sete   %al
and    %cl,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_eq_rm2>:
fldt   0x8(%rsp)
fldt   (%rdi)
fucomip %st(1),%st
fstp   %st(0)
setp   %al
setne  %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @ld_eq_rm2(x86_fp80 %0, x86_fp80* nocapture %1) {
%3 = load x86_fp80, x86_fp80* %1
%4 = fcmp une x86_fp80 %3, %0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", 99999);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 99999)
ret i32 0
}
/* Variables and functions */
int memcmp(void const *, void const *, int);
int dfltCompare(void *NotUsed, int n1, const void *p1, int n2, const void *p2) {
  int c;
  c = memcmp(p1, p2, n1 < n2 ? n1 : n2);
  if (c == 0) {
    c = n1 - n2;
  }
  return c;
}


x86 assembly (clang, -O0):
<dfltCompare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1151 <dfltCompare+0x41>
mov    -0xc(%rbp),%eax
mov    %eax,-0x44(%rbp)
jmp    1157 <dfltCompare+0x47>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x44(%rbp)
mov    -0x38(%rbp),%rsi
mov    -0x40(%rbp),%rdi
mov    -0x44(%rbp),%edx
call   1030 <memcmp@plt>
mov    %eax,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
jne    117d <dfltCompare+0x6d>
mov    -0xc(%rbp),%eax
sub    -0x1c(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dfltCompare>:
push   %rbx
mov    %rdx,%rdi
mov    %esi,%ebx
sub    %ecx,%ebx
cmovl  %esi,%ecx
mov    %r8,%rsi
mov    %ecx,%edx
call   1030 <memcmp@plt>
test   %eax,%eax
cmove  %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @dfltCompare(i8* %0, i32 %1, i8* %2, i32 %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i32
store i8* %0, i8** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%12 = load i8*, i8** %8
%13 = load i8*, i8** %10
%14 = load i32, i32* %7
%15 = load i32, i32* %9
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %19
17: ; preds = %5
%18 = load i32, i32* %7
br label %21
19: ; preds = %5
%20 = load i32, i32* %9
br label %21
21: ; preds = %19, %17
%22 = phi i32 [ %18, %17 ], [ %20, %19 ]
%23 = call i32 @memcmp(i8* %12, i8* %13, i32 %22)
store i32 %23, i32* %11
%24 = load i32, i32* %11
%25 = icmp eq i32 %24, 0
br i1 %25, label %26, label %30
26: ; preds = %21
%27 = load i32, i32* %7
%28 = load i32, i32* %9
%29 = sub nsw i32 %27, %28
store i32 %29, i32* %11
br label %30
30: ; preds = %26, %21
%31 = load i32, i32* %11
ret i32 %31
}

LLVM IR (-O2):
define i32 @dfltCompare(i8* nocapture readnone %0, i32 %1, i8* %2, i32 %3, i8* %4) {
%6 = icmp slt i32 %1, %3
%7 = select i1 %6, i32 %1, i32 %3
%8 = tail call i32 @memcmp(i8* %2, i8* %4, i32 %7)
%9 = icmp eq i32 %8, 0
%10 = sub nsw i32 %1, %3
%11 = select i1 %9, i32 %10, i32 %8
ret i32 %11
}
/* Variables and functions */
scalar_t__ get_length(int /*<<< orphan*/ *, int /*<<< orphan*/, int);
scalar_t__ get_length_brute(int /*<<< orphan*/ *, int /*<<< orphan*/, int);
int test_array_empty() {
  return 0 == get_length_brute(NULL, 0, 10) && 0 == get_length(NULL, 0, 10);
}


x86 assembly (clang, -O0):
<test_array_empty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
xor    %esi,%esi
mov    $0xa,%edx
call   1030 <get_length_brute@plt>
mov    %rax,%rdx
xor    %eax,%eax
xor    %ecx,%ecx
cmp    %rdx,%rcx
mov    %al,-0x1(%rbp)
jne    1169 <test_array_empty+0x49>
xor    %eax,%eax
mov    %eax,%edi
xor    %esi,%esi
mov    $0xa,%edx
call   1040 <get_length@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
sete   %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_array_empty>:
push   %rbx
xor    %ebx,%ebx
xor    %edi,%edi
xor    %esi,%esi
mov    $0xa,%edx
call   1030 <get_length_brute@plt>
test   %rax,%rax
jne    114c <test_array_empty+0x2c>
xor    %edi,%edi
xor    %esi,%esi
mov    $0xa,%edx
call   1040 <get_length@plt>
xor    %ebx,%ebx
test   %rax,%rax
sete   %bl
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @test_array_empty() {
%1 = call i64 @get_length_brute(i32* null, i32 0, i32 10)
%2 = icmp eq i64 0, %1
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = call i64 @get_length(i32* null, i32 0, i32 10)
%5 = icmp eq i64 0, %4
br label %6
6: ; preds = %3, %0
%7 = phi i1 [ false, %0 ], [ %5, %3 ]
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_array_empty() {
%1 = tail call i64 @get_length_brute(i32* null, i32 0, i32 10)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i64 @get_length(i32* null, i32 0, i32 10)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ 0, %0 ], [ %6, %3 ]
ret i32 %8
}
int test_imm_DDuint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0xDD << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_DDuint64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x10,%rdx
and    $0xdd,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_DDuint64_midword_reg(i64 %0) {
%2 = and i64 %0, 14483456
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void maze_solver_vi_list_display(struct maze_solver_vi_list *l) {}


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

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

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

LLVM IR (-O2):
%struct.maze_solver_vi_list = type opaque
define void @maze_solver_vi_list_display(%struct.maze_solver_vi_list* nocapture %0) {
ret void
}
void genbne() {}


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

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

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

LLVM IR (-O2):
define void @genbne() {
ret void
}
/* Variables and functions */
char *filename_non_directory(char *);
char *info_file_in_path(char *, char *);
char *strdup(char *);
char *info_absolute_file(char *fname) {
  char *containing_dir = strdup(fname);
  char *base = filename_non_directory(containing_dir);
  if (base > containing_dir)
    base[-1] = '\0';
  return info_file_in_path(filename_non_directory(fname), containing_dir);
}


x86 assembly (clang, -O0):
<info_absolute_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strdup@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <filename_non_directory@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jbe    116c <info_absolute_file+0x3c>
mov    -0x18(%rbp),%rax
movb   $0x0,-0x1(%rax)
mov    -0x8(%rbp),%rdi
call   1040 <filename_non_directory@plt>
mov    %rax,%rdi
mov    -0x10(%rbp),%rsi
call   1030 <info_file_in_path@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<info_absolute_file>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1050 <strdup@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <filename_non_directory@plt>
cmp    %rbx,%rax
jbe    1150 <info_absolute_file+0x20>
movb   $0x0,-0x1(%rax)
mov    %r14,%rdi
call   1040 <filename_non_directory@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <info_file_in_path@plt>

LLVM IR (-O0):
define i8* @info_absolute_file(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i8* @strdup(i8* %5)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = call i8* @filename_non_directory(i8* %7)
store i8* %8, i8** %4
%9 = load i8*, i8** %4
%10 = load i8*, i8** %3
%11 = icmp ugt i8* %9, %10
br i1 %11, label %12, label %15
12: ; preds = %1
%13 = load i8*, i8** %4
%14 = getelementptr inbounds i8, i8* %13, i64 -1
store i8 0, i8* %14
br label %15
15: ; preds = %12, %1
%16 = load i8*, i8** %2
%17 = call i8* @filename_non_directory(i8* %16)
%18 = load i8*, i8** %3
%19 = call i8* @info_file_in_path(i8* %17, i8* %18)
ret i8* %19
}

LLVM IR (-O2):
define i8* @info_absolute_file(i8* %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = tail call i8* @filename_non_directory(i8* %2)
%4 = icmp ugt i8* %3, %2
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = getelementptr inbounds i8, i8* %3, i64 -1
store i8 0, i8* %6
br label %7
7: ; preds = %5, %1
%8 = tail call i8* @filename_non_directory(i8* %0)
%9 = tail call i8* @info_file_in_path(i8* %8, i8* %2)
ret i8* %9
}
int isleap(unsigned yr) {
  return yr % 400 == 0 || (yr % 4 == 0 && yr % 100 != 0);
}


x86 assembly (clang, -O0):
<isleap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
xor    %edx,%edx
div    %ecx
mov    $0x1,%al
cmp    $0x0,%edx
mov    %al,-0x5(%rbp)
je     1150 <isleap+0x50>
mov    -0x4(%rbp),%ecx
and    $0x3,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x6(%rbp)
jne    114a <isleap+0x4a>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
xor    %edx,%edx
div    %ecx
cmp    $0x0,%edx
setne  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isleap>:
imul   $0xc28f5c29,%edi,%ecx
mov    %ecx,%eax
ror    $0x4,%eax
cmp    $0xa3d70b,%eax
jb     111b <isleap+0x1b>
xor    %eax,%eax
test   $0x3,%dil
je     1121 <isleap+0x21>
ret
mov    $0x1,%eax
ret
ror    $0x2,%ecx
xor    %eax,%eax
cmp    $0x28f5c29,%ecx
setae  %al
ret

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

LLVM IR (-O2):
define i32 @isleap(i32 %0) {
%2 = urem i32 %0, 400
%3 = icmp eq i32 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = and i32 %0, 3
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = urem i32 %0, 100
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %4, %7, %1
%12 = phi i32 [ 1, %1 ], [ 0, %4 ], [ %10, %7 ]
ret i32 %12
}
/* Variables and functions */
unsigned int read_wordL(int);
int /*<<< orphan*/ write_word(int, int);
unsigned char rx_event_poll(void) {
  unsigned int nReturn = 0x0000;
  write_word(0x000A, 0x0124);
  nReturn = read_wordL(0x000C);
  if ((nReturn & 0x0100) && !(nReturn & 0x0200))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<rx_event_poll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
mov    $0xa,%edi
mov    $0x124,%esi
call   1040 <write_word@plt>
mov    $0xc,%edi
call   1030 <read_wordL@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x100,%eax
cmp    $0x0,%eax
je     1176 <rx_event_poll+0x56>
mov    -0x8(%rbp),%eax
and    $0x200,%eax
cmp    $0x0,%eax
jne    1176 <rx_event_poll+0x56>
movb   $0x1,-0x1(%rbp)
jmp    117a <rx_event_poll+0x5a>
movb   $0x0,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rx_event_poll>:
push   %rax
mov    $0xa,%edi
mov    $0x124,%esi
call   1040 <write_word@plt>
mov    $0xc,%edi
call   1030 <read_wordL@plt>
and    $0x300,%eax
cmp    $0x100,%eax
sete   %al
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @rx_event_poll() {
%1 = alloca i8
%2 = alloca i32
store i32 0, i32* %2
%3 = call i32 @write_word(i32 10, i32 292)
%4 = call i32 @read_wordL(i32 12)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = and i32 %5, 256
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %0
%9 = load i32, i32* %2
%10 = and i32 %9, 512
%11 = icmp ne i32 %10, 0
br i1 %11, label %13, label %12
12: ; preds = %8
store i8 1, i8* %1
br label %14
13: ; preds = %8, %0
store i8 0, i8* %1
br label %14
14: ; preds = %13, %12
%15 = load i8, i8* %1
ret i8 %15
}

LLVM IR (-O2):
define zeroext i8 @rx_event_poll() {
%1 = tail call i32 @write_word(i32 10, i32 292)
%2 = tail call i32 @read_wordL(i32 12)
%3 = and i32 %2, 768
%4 = icmp eq i32 %3, 256
%5 = zext i1 %4 to i8
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void show_version(void) { printf("qcc version -1\n"); }


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"qcc version -1\0A\00"
define void @show_version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [15 x i8] c"qcc version -1\00"
define void @show_version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGINT;
int /*<<< orphan*/ SIG_DFL;
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ signal(int /*<<< orphan*/, int /*<<< orphan*/);
void ouch(int sig) {
  printf("OUCH! - I got signal %d\n", sig);
  (void)signal(SIGINT, SIG_DFL);
}


x86 assembly (clang, -O0):
<ouch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
mov    0x2e8e(%rip),%rax
mov    (%rax),%esi
call   1040 <signal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ouch>:
push   %rax
mov    %edi,%esi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
pop    %rax
jmp    1040 <signal@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"OUCH! - I got signal %d\0A\00"
@SIGINT = global i32 0
@SIG_DFL = global i32 0
define void @ouch(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @SIGINT
%6 = load i32, i32* @SIG_DFL
%7 = call i32 @signal(i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"OUCH! - I got signal %d\0A\00"
@SIGINT = global i32 0
@SIG_DFL = global i32 0
define void @ouch(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = load i32, i32* @SIGINT
%4 = load i32, i32* @SIG_DFL
%5 = tail call i32 @signal(i32 %3, i32 %4)
ret void
}