xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ run_shell();
int main(void) {
  run_shell();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <run_shell@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @run_shell()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @run_shell()
ret i32 0
}
/* Variables and functions */
scalar_t__ isWhite(char);
void skipSpace(char **s) {
  for (; isWhite(**s); (*s)++)
    ;
}


x86 assembly (clang, -O0):
<skipSpace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%edi
call   1030 <isWhite@plt>
cmp    $0x0,%rax
je     114d <skipSpace+0x3d>
jmp    113a <skipSpace+0x2a>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    111c <skipSpace+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipSpace>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rax
movsbl (%rax),%edi
nopw   0x0(%rax,%rax,1)
call   1030 <isWhite@plt>
test   %rax,%rax
je     113a <skipSpace+0x2a>
mov    (%rbx),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%rbx)
movsbl 0x1(%rax),%edi
jmp    1120 <skipSpace+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @skipSpace(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = tail call i64 @isWhite(i8 signext %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %12, label %6
6: ; preds = %1, %6
%7 = load i8*, i8** %0
%8 = getelementptr inbounds i8, i8* %7, i64 1
store i8* %8, i8** %0
%9 = load i8, i8* %8
%10 = tail call i64 @isWhite(i8 signext %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %6
12: ; preds = %6, %1
ret void
}
int do_916() { return 916; }


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

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

LLVM IR (-O0):
define i32 @do_916() {
ret i32 916
}

LLVM IR (-O2):
define i32 @do_916() {
ret i32 916
}
long double longdouble_ignoring_unsignedshort(long double x, unsigned short y) {
  return x;
}


x86 assembly (clang, -O0):
<longdouble_ignoring_unsignedshort>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
mov    %ax,-0x12(%rbp)
fldt   -0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<longdouble_ignoring_unsignedshort>:
fldt   0x8(%rsp)
ret

LLVM IR (-O0):
define x86_fp80 @longdouble_ignoring_unsignedshort(x86_fp80 %0, i16 zeroext %1) {
%3 = alloca x86_fp80
%4 = alloca i16
store x86_fp80 %0, x86_fp80* %3
store i16 %1, i16* %4
%5 = load x86_fp80, x86_fp80* %3
ret x86_fp80 %5
}

LLVM IR (-O2):
define x86_fp80 @longdouble_ignoring_unsignedshort(x86_fp80 returned %0, i16 zeroext %1) {
ret x86_fp80 %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char str[5] = "Hello";
  printf("%s\n", str);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movb   $0x6f,0x4(%rsp)
movl   $0x6c6c6548,(%rsp)
lea    0xee1(%rip),%rdi
mov    %rsp,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@__const.main.str = [5 x i8] c"Hello"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [5 x i8]
%2 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ X509;
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int /*<<< orphan*/ *ASN1_item_d2i_bio(int /*<<< orphan*/ *,
                                      int /*<<< orphan*/ *,
                                      int /*<<< orphan*/ **);
int /*<<< orphan*/ X509_it;
X509 *d2i_X509_bio(BIO *bp, X509 **x509) {
  return ASN1_item_d2i_bio(&X509_it, bp, x509);
}


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

x86 assembly (clang, -O2):
<d2i_X509_bio>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x2ecb(%rip),%rdi
jmp    1030 <ASN1_item_d2i_bio@plt>

LLVM IR (-O0):
@X509_it = global i32 0
define i32* @d2i_X509_bio(i32* %0, i32** %1) {
%3 = alloca i32*
%4 = alloca i32**
store i32* %0, i32** %3
store i32** %1, i32*** %4
%5 = load i32*, i32** %3
%6 = load i32**, i32*** %4
%7 = call i32* @ASN1_item_d2i_bio(i32* @X509_it, i32* %5, i32** %6)
ret i32* %7
}

LLVM IR (-O2):
@X509_it = global i32 0
define i32* @d2i_X509_bio(i32* %0, i32** %1) {
%3 = tail call i32* @ASN1_item_d2i_bio(i32* @X509_it, i32* %0, i32** %1)
ret i32* %3
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void err_sigaction(void) {
  fprintf(stderr, "error: sigaction(2) failed\n");
  fflush(stderr);
}


x86 assembly (clang, -O0):
<err_sigaction>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<err_sigaction>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
pop    %rbx
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [28 x i8] c"error: sigaction(2) failed\0A\00"
define void @err_sigaction() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fflush(i32 %3)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [28 x i8] c"error: sigaction(2) failed\0A\00"
define void @err_sigaction() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fflush(i32 %3)
ret void
}
int g_DUMMY_menu_get_toggle(int menu_id, int item_id) {
  menu_id = menu_id;
  item_id = item_id;
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @g_DUMMY_menu_get_toggle(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
store i32 %5, i32* %3
%6 = load i32, i32* %4
store i32 %6, i32* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @g_DUMMY_menu_get_toggle(i32 %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
scalar_t__ ft_strcmp(char const *, char const *);
int ft_strequ(char const *s1, char const *s2) {
  if (!s1 || !s2)
    return (0);
  if (ft_strcmp(s1, s2) == 0)
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<ft_strequ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1136 <ft_strequ+0x26>
cmpq   $0x0,-0x18(%rbp)
jne    1142 <ft_strequ+0x32>
movl   $0x0,-0x4(%rbp)
jmp    116c <ft_strequ+0x5c>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <ft_strcmp@plt>
cmp    $0x0,%rax
jne    1165 <ft_strequ+0x55>
movl   $0x1,-0x4(%rbp)
jmp    116c <ft_strequ+0x5c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strequ>:
xor    %eax,%eax
test   %rdi,%rdi
je     1131 <ft_strequ+0x21>
test   %rsi,%rsi
je     1131 <ft_strequ+0x21>
push   %rax
call   1030 <ft_strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define i32 @ft_strequ(i8* %0, i8* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne i8* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = tail call i64 @ft_strcmp(i8* %0, i8* %1)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %2
%11 = phi i32 [ 0, %2 ], [ %9, %6 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
double talla(int, int, double);
int main() {
  printf("La talla es %f \n", talla(1, 1, 9.7));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%esi
movsd  0xec4(%rip),%xmm0
mov    %esi,%edi
call   1040 <talla@plt>
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xed7(%rip),%xmm0
mov    $0x1,%edi
mov    $0x1,%esi
call   1040 <talla@plt>
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"La talla es %f \0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call double @talla(i32 1, i32 1, double 0x4023666666666666)
%3 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), double %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"La talla es %f \0A\00"
define i32 @main() {
%1 = tail call double @talla(i32 1, i32 1, double 0x4023666666666666)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), double %1)
ret i32 0
}
int get_bif_type(ibr, ntot, lab)
int ibr, ntot, lab;
{
  int type = 1;
  if (ibr < 0 && ntot < 0)
    type = 3;
  if (ibr < 0 && ntot > 0)
    type = 4;
  if (ibr > 0 && ntot > 0)
    type = 2;
  if (ibr > 0 && ntot < 0)
    type = 1;
  return (type);
}


x86 assembly (clang, -O0):
<get_bif_type>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    112f <get_bif_type+0x2f>
cmpl   $0x0,-0x8(%rbp)
jge    112f <get_bif_type+0x2f>
movl   $0x3,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    114a <get_bif_type+0x4a>
cmpl   $0x0,-0x8(%rbp)
jle    114a <get_bif_type+0x4a>
movl   $0x4,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1165 <get_bif_type+0x65>
cmpl   $0x0,-0x8(%rbp)
jle    1165 <get_bif_type+0x65>
movl   $0x2,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1180 <get_bif_type+0x80>
cmpl   $0x0,-0x8(%rbp)
jge    1180 <get_bif_type+0x80>
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_bif_type>:
mov    %esi,%eax
and    %edi,%eax
shr    $0x1e,%eax
or     $0x1,%eax
test   %esi,%esi
mov    $0x4,%ecx
cmovle %eax,%ecx
test   %edi,%edi
cmovns %eax,%ecx
test   %esi,%esi
mov    $0x2,%edx
cmovle %ecx,%edx
test   %edi,%edi
cmovle %ecx,%edx
test   %esi,%esi
mov    $0x1,%eax
cmovns %edx,%eax
test   %edi,%edi
cmovle %edx,%eax
ret

LLVM IR (-O0):
define i32 @get_bif_type(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 1, i32* %7
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %3
%11 = load i32, i32* %5
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %10
store i32 3, i32* %7
br label %14
14: ; preds = %13, %10, %3
%15 = load i32, i32* %4
%16 = icmp slt i32 %15, 0
br i1 %16, label %17, label %21
17: ; preds = %14
%18 = load i32, i32* %5
%19 = icmp sgt i32 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %17
store i32 4, i32* %7
br label %21
21: ; preds = %20, %17, %14
%22 = load i32, i32* %4
%23 = icmp sgt i32 %22, 0
br i1 %23, label %24, label %28
24: ; preds = %21
%25 = load i32, i32* %5
%26 = icmp sgt i32 %25, 0
br i1 %26, label %27, label %28
27: ; preds = %24
store i32 2, i32* %7
br label %28
28: ; preds = %27, %24, %21
%29 = load i32, i32* %4
%30 = icmp sgt i32 %29, 0
br i1 %30, label %31, label %35
31: ; preds = %28
%32 = load i32, i32* %5
%33 = icmp slt i32 %32, 0
br i1 %33, label %34, label %35
34: ; preds = %31
store i32 1, i32* %7
br label %35
35: ; preds = %34, %31, %28
%36 = load i32, i32* %7
ret i32 %36
}

LLVM IR (-O2):
define i32 @get_bif_type(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, 0
%5 = icmp slt i32 %1, 0
%6 = and i32 %1, %0
%7 = icmp slt i32 %6, 0
%8 = select i1 %7, i32 3, i32 1
%9 = icmp sgt i32 %1, 0
%10 = and i1 %4, %9
%11 = select i1 %10, i32 4, i32 %8
%12 = icmp sgt i32 %0, 0
%13 = and i1 %12, %9
%14 = select i1 %13, i32 2, i32 %11
%15 = and i1 %12, %5
%16 = select i1 %15, i32 1, i32 %14
ret i32 %16
}
/* Variables and functions */
int _isnan(double);
int isnan(double x) { return _isnan(x); }


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

x86 assembly (clang, -O2):
<isnan>:
jmp    1030 <_isnan@plt>

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

LLVM IR (-O2):
define i32 @isnan(double %0) {
%2 = tail call i32 @_isnan(double %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ X509;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int ASN1_item_i2d_fp(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                     int /*<<< orphan*/ *);
int /*<<< orphan*/ X509_it;
int i2d_X509_fp(FILE *fp, X509 *x509) {
  return ASN1_item_i2d_fp(&X509_it, fp, x509);
}


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

x86 assembly (clang, -O2):
<i2d_X509_fp>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x2ecb(%rip),%rdi
jmp    1030 <ASN1_item_i2d_fp@plt>

LLVM IR (-O0):
@X509_it = global i32 0
define i32 @i2d_X509_fp(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
%6 = load i32*, i32** %4
%7 = call i32 @ASN1_item_i2d_fp(i32* @X509_it, i32* %5, i32* %6)
ret i32 %7
}

LLVM IR (-O2):
@X509_it = global i32 0
define i32 @i2d_X509_fp(i32* %0, i32* %1) {
%3 = tail call i32 @ASN1_item_i2d_fp(i32* @X509_it, i32* %0, i32* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ list_add_tail_tst();
int /*<<< orphan*/ list_add_tst();
int /*<<< orphan*/ list_del_tst();
int main() {
  list_add_tst();
  list_add_tail_tst();
  list_del_tst();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <list_add_tst@plt>
mov    $0x0,%al
call   1040 <list_add_tail_tst@plt>
mov    $0x0,%al
call   1050 <list_del_tst@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <list_add_tst@plt>
xor    %eax,%eax
call   1040 <list_add_tail_tst@plt>
xor    %eax,%eax
call   1050 <list_del_tst@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @list_add_tst()
%3 = call i32 (...) @list_add_tail_tst()
%4 = call i32 (...) @list_del_tst()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @list_add_tst()
%2 = tail call i32 (...) @list_add_tail_tst()
%3 = tail call i32 (...) @list_del_tst()
ret i32 0
}
/* Variables and functions */
char *getenv(char *);
char *getRemoteAddr() {
  char *remote_addr;
  remote_addr = getenv("REMOTE_ADDR");
  if (remote_addr == NULL)
    return "127.0.0.1";
  return remote_addr;
}


x86 assembly (clang, -O0):
<getRemoteAddr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1143 <getRemoteAddr+0x33>
lea    0xed2(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    114b <getRemoteAddr+0x3b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getRemoteAddr>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
lea    0xee5(%rip),%rcx
cmove  %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"REMOTE_ADDR\00"
@.str.1 = [10 x i8] c"127.0.0.1\00"
define i8* @getRemoteAddr() {
%1 = alloca i8*
%2 = alloca i8*
%3 = call i8* @getenv(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %7
6: ; preds = %0
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8** %1
br label %9
7: ; preds = %0
%8 = load i8*, i8** %2
store i8* %8, i8** %1
br label %9
9: ; preds = %7, %6
%10 = load i8*, i8** %1
ret i8* %10
}

LLVM IR (-O2):
@.str = [12 x i8] c"REMOTE_ADDR\00"
@.str.1 = [10 x i8] c"127.0.0.1\00"
define i8* @getRemoteAddr() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8* %1, null
%3 = select i1 %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %1
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
void MAP2close(FILE *f) { fclose(f); }


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

x86 assembly (clang, -O2):
<MAP2close>:
jmp    1030 <fclose@plt>

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

LLVM IR (-O2):
define void @MAP2close(i32* nocapture %0) {
%2 = tail call i32 @fclose(i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __startrek_entry_pt_Reader();
void cil_keeperReader(void) {
  {
    __startrek_entry_pt_Reader();
    return;
  }
}


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

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

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

LLVM IR (-O2):
define void @cil_keeperReader() {
%1 = tail call i32 (...) @__startrek_entry_pt_Reader()
ret void
}
/* Variables and functions */
scalar_t__ floor(double);
double pow(int, scalar_t__);
double estimate_lbr(int N, double ledge) {
  return ledge * 1. / (pow(2., floor((double)(N) / 2.) + 1.));
}


x86 assembly (clang, -O0):
<estimate_lbr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  0xec8(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xeb9(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1040 <floor@plt>
cvtsi2sd %rax,%xmm0
movsd  0xe9b(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rsi
mov    $0x2,%edi
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<estimate_lbr>:
push   %rax
movsd  %xmm0,(%rsp)
xorps  %xmm0,%xmm0
cvtsi2sd %edi,%xmm0
mulsd  0xecb(%rip),%xmm0
call   1040 <floor@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  0xebe(%rip),%xmm0
cvttsd2si %xmm0,%rsi
mov    $0x2,%edi
call   1030 <pow@plt>
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @estimate_lbr(i32 %0, double %1) {
%3 = alloca i32
%4 = alloca double
store i32 %0, i32* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = fmul double %5, 1.000000e+00
%7 = load i32, i32* %3
%8 = sitofp i32 %7 to double
%9 = fdiv double %8, 2.000000e+00
%10 = call i64 @floor(double %9)
%11 = sitofp i64 %10 to double
%12 = fadd double %11, 1.000000e+00
%13 = fptosi double %12 to i64
%14 = call double @pow(i32 2, i64 %13)
%15 = fdiv double %6, %14
ret double %15
}

LLVM IR (-O2):
define double @estimate_lbr(i32 %0, double %1) {
%3 = sitofp i32 %0 to double
%4 = fmul double %3, 5.000000e-01
%5 = tail call i64 @floor(double %4)
%6 = sitofp i64 %5 to double
%7 = fadd double %6, 1.000000e+00
%8 = fptosi double %7 to i64
%9 = tail call double @pow(i32 2, i64 %8)
%10 = fdiv double %1, %9
ret double %10
}
void befs_debug(const struct super_block *sb, const char *fmt, ...) {}


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

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

LLVM IR (-O0):
%struct.super_block = type opaque
define void @befs_debug(%struct.super_block* %0, i8* %1, ...) {
%3 = alloca %struct.super_block*
%4 = alloca i8*
store %struct.super_block* %0, %struct.super_block** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
%struct.super_block = type opaque
define void @befs_debug(%struct.super_block* nocapture %0, i8* nocapture %1, ...) {
ret void
}
int test_imm_74int16_reg(short val) {
  return ((val) & (0x74 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_74int16_reg>:
test   $0x74,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

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


x86 assembly (clang, -O0):
<Op4848>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%edi
call   1030 <ExceptionGroup1@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Op4848>:
mov    $0x4,%edi
jmp    1030 <ExceptionGroup1@plt>

LLVM IR (-O0):
define void @Op4848() {
%1 = call i32 @ExceptionGroup1(i32 4)
ret void
}

LLVM IR (-O2):
define void @Op4848() {
%1 = tail call i32 @ExceptionGroup1(i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ unlink(char *);
void clean_up(void) {
  unlink("dummy0");
  unlink("dummy1");
}


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"dummy0\00"
@.str.1 = [7 x i8] c"dummy1\00"
define void @clean_up() {
%1 = call i32 @unlink(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @unlink(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"dummy0\00"
@.str.1 = [7 x i8] c"dummy1\00"
define void @clean_up() {
%1 = tail call i32 @unlink(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @unlink(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, int, char *);
int /*<<< orphan*/ system(char *);
void generate(int n, char *suf) {
  char buf[50];
  snprintf(buf, 50, "gen_all %d %s", n, suf);
  system(buf);
}


x86 assembly (clang, -O0):
<generate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x50(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%r8
mov    $0x32,%esi
lea    0xeba(%rip),%rdx
call   1040 <snprintf@plt>
lea    -0x50(%rbp),%rdi
call   1030 <system@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generate>:
push   %rbx
sub    $0x40,%rsp
mov    %rsi,%r8
mov    %edi,%ecx
lea    0xecf(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x32,%esi
call   1040 <snprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"gen_all %d %s\00"
define void @generate(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca [50 x i8]
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [50 x i8], [50 x i8]* %5, i64 0, i64 0
%7 = load i32, i32* %3
%8 = load i8*, i8** %4
%9 = call i32 @snprintf(i8* %6, i32 50, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %7, i8* %8)
%10 = getelementptr inbounds [50 x i8], [50 x i8]* %5, i64 0, i64 0
%11 = call i32 @system(i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"gen_all %d %s\00"
define void @generate(i32 %0, i8* %1) {
%3 = alloca [50 x i8]
%4 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 50, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1)
%6 = call i32 @system(i8* %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
uint64_t ffi_reinterpret_uint64_t(void *result) { return (uint64_t)result; }


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

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

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

LLVM IR (-O2):
define i32 @ffi_reinterpret_uint64_t(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
ret i32 %3
}
unsigned int myfree(void *ptr) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @myfree(i8* nocapture readnone %0) {
ret i32 1
}
int scsi_max_length(void) { return 255; }


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

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

LLVM IR (-O0):
define i32 @scsi_max_length() {
ret i32 255
}

LLVM IR (-O2):
define i32 @scsi_max_length() {
ret i32 255
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void mkdir_exit(char *message, int i) {
  printf("%s", message);
  exit(i);
}


x86 assembly (clang, -O0):
<mkdir_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<mkdir_exit>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rsi
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @mkdir_exit(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i32, i32* %4
%8 = call i32 @exit(i32 %7)
unreachable
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @mkdir_exit(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 %1)
unreachable
}
/* Variables and functions */
int cpuid(int);
bool my_crc32c_sse42_supported(void) { return (cpuid((1)) & (1 << 20)); }


x86 assembly (clang, -O0):
<my_crc32c_sse42_supported>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <cpuid@plt>
and    $0x100000,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_crc32c_sse42_supported>:
push   %rax
mov    $0x1,%edi
call   1030 <cpuid@plt>
and    $0x100000,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @my_crc32c_sse42_supported() {
%1 = call i32 @cpuid(i32 1)
%2 = and i32 %1, 1048576
ret i32 %2
}

LLVM IR (-O2):
define i32 @my_crc32c_sse42_supported() {
%1 = tail call i32 @cpuid(i32 1)
%2 = and i32 %1, 1048576
ret i32 %2
}
/* Variables and functions */
void *memchr(const void *s, int c, size_t n) {
  const char *tmp = (const char *)s;
  while (n) {
    if (*tmp == c) {
      return (void *)tmp;
    }
    ++tmp;
    --n;
  }
  return NULL;
}


x86 assembly (clang, -O0):
<memchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     115c <memchr+0x5c>
mov    -0x28(%rbp),%rax
movsbl (%rax),%eax
cmp    -0x14(%rbp),%eax
jne    113f <memchr+0x3f>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1164 <memchr+0x64>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x20(%rbp)
jmp    1117 <memchr+0x17>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memchr>:
test   %rdx,%rdx
je     1121 <memchr+0x21>
mov    %rdi,%rax
nopl   0x0(%rax,%rax,1)
movsbl (%rax),%ecx
cmp    %esi,%ecx
je     1123 <memchr+0x23>
add    $0x1,%rax
add    $0xffffffffffffffff,%rdx
jne    1110 <memchr+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @memchr(i8* %0, i32 %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %15, label %5
5: ; preds = %3, %11
%6 = phi i8* [ %12, %11 ], [ %0, %3 ]
%7 = phi i64 [ %13, %11 ], [ %2, %3 ]
%8 = load i8, i8* %6
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, %1
br i1 %10, label %15, label %11
11: ; preds = %5
%12 = getelementptr inbounds i8, i8* %6, i64 1
%13 = add i64 %7, -1
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %11, %3
%16 = phi i8* [ null, %3 ], [ null, %11 ], [ %6, %5 ]
ret i8* %16
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ read(int /*<<< orphan*/);
int main() {
  printf("Press any key to fault memory in\n");
  read(0);
  printf("Done. Press any key to continue\n");
  read(0);
  read(0);
  printf("Finished 1\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <read@plt>
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <read@plt>
xor    %edi,%edi
call   1040 <read@plt>
lea    0xee0(%rip),%rdi
call   1030 <printf@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    %edi,%edi
call   1040 <read@plt>
lea    0xee6(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <read@plt>
xor    %edi,%edi
call   1040 <read@plt>
lea    0xeec(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [34 x i8] c"Press any key to fault memory in\0A\00"
@.str.1 = [33 x i8] c"Done. Press any key to continue\0A\00"
@.str.2 = [12 x i8] c"Finished 1\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @read(i32 0)
%4 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @read(i32 0)
%6 = call i32 @read(i32 0)
%7 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [33 x i8] c"Press any key to fault memory in\00"
@str.3 = [32 x i8] c"Done. Press any key to continue\00"
@str.4 = [11 x i8] c"Finished 1\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @read(i32 0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.3, i64 0, i64 0))
%4 = tail call i32 @read(i32 0)
%5 = tail call i32 @read(i32 0)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.4, i64 0, i64 0))
ret i32 0
}
int valid_digit(char *ip_str) {
  int err = 0;
  while (*ip_str) {
    if (*ip_str >= '0' && *ip_str <= '9')
      ++ip_str;
    else
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<valid_digit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     115e <valid_digit+0x5e>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jl     114d <valid_digit+0x4d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
jg     114d <valid_digit+0x4d>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1159 <valid_digit+0x59>
movl   $0x0,-0x4(%rbp)
jmp    1165 <valid_digit+0x65>
jmp    110f <valid_digit+0xf>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<valid_digit>:
mov    (%rdi),%cl
mov    $0x1,%eax
test   %cl,%cl
je     1123 <valid_digit+0x23>
add    $0x1,%rdi
nop
add    $0xd0,%cl
cmp    $0xa,%cl
jae    1124 <valid_digit+0x24>
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <valid_digit+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @valid_digit(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %7
4: ; preds = %7
%5 = load i8, i8* %12
%6 = icmp eq i8 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %1, %4
%8 = phi i8 [ %5, %4 ], [ %2, %1 ]
%9 = phi i8* [ %12, %4 ], [ %0, %1 ]
%10 = add i8 %8, -48
%11 = icmp ult i8 %10, 10
%12 = getelementptr inbounds i8, i8* %9, i64 1
br i1 %11, label %4, label %13
13: ; preds = %7, %4, %1
%14 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %7 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void fast_alloc_free(void *tofree, void *params) {
  params = 0;
  free(tofree);
}


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

x86 assembly (clang, -O2):
<fast_alloc_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @fast_alloc_free(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
store i8* null, i8** %4
%5 = load i8*, i8** %3
%6 = call i32 @free(i8* %5)
ret void
}

LLVM IR (-O2):
define void @fast_alloc_free(i8* nocapture %0, i8* nocapture readnone %1) {
%3 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_current_date();
int main() {
  print_current_date();
  return (0);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <print_current_date@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @print_current_date()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @print_current_date()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ UPnPResponse_RenderingControl_SetVerticalKeystone(void *);
int /*<<< orphan*/ printf(char *, unsigned int, short);
void UPnPRenderingControl_SetVerticalKeystone(void *upnptoken,
                                              unsigned int InstanceID,
                                              short DesiredVerticalKeystone) {
  printf("Invoke: UPnPRenderingControl_SetVerticalKeystone(%u,%d);\r\n",
         InstanceID, DesiredVerticalKeystone);
  UPnPResponse_RenderingControl_SetVerticalKeystone(upnptoken);
}


x86 assembly (clang, -O0):
<UPnPRenderingControl_SetVerticalKeystone>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dx,%ax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %ax,-0xe(%rbp)
mov    -0xc(%rbp),%esi
lea    0xec0(%rip),%rdi
movswl -0xe(%rbp),%edx
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <UPnPResponse_RenderingControl_SetVerticalKeystone@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UPnPRenderingControl_SetVerticalKeystone>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <UPnPResponse_RenderingControl_SetVerticalKeystone@plt>

LLVM IR (-O0):
@.str = [59 x i8] c"Invoke: UPnPRenderingControl_SetVerticalKeystone(%u,%d);\0D\0A\00"
define void @UPnPRenderingControl_SetVerticalKeystone(i8* %0, i32 %1, i16 signext %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i16
store i8* %0, i8** %4
store i32 %1, i32* %5
store i16 %2, i16* %6
%7 = load i32, i32* %5
%8 = load i16, i16* %6
%9 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i32 %7, i16 signext %8)
%10 = load i8*, i8** %4
%11 = call i32 @UPnPResponse_RenderingControl_SetVerticalKeystone(i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [59 x i8] c"Invoke: UPnPRenderingControl_SetVerticalKeystone(%u,%d);\0D\0A\00"
define void @UPnPRenderingControl_SetVerticalKeystone(i8* %0, i32 %1, i16 signext %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i32 %1, i16 signext %2)
%5 = tail call i32 @UPnPResponse_RenderingControl_SetVerticalKeystone(i8* %0)
ret void
}
/* Variables and functions */
int bmp085_i2c_Begin(char const *);
unsigned int bmp085_i2c_Read_Int(int, int);
int /*<<< orphan*/ bmp085_i2c_Write_Byte(int, int, int);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ usleep(int);
unsigned int bmp085_ReadUT(const char *i2cFileName) {
  unsigned int ut = 0;
  int fd = bmp085_i2c_Begin(i2cFileName);
  bmp085_i2c_Write_Byte(fd, 0xF4, 0x2E);
  usleep(5000);
  ut = bmp085_i2c_Read_Int(fd, 0xF6);
  close(fd);
  return ut;
}


x86 assembly (clang, -O0):
<bmp085_ReadUT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <bmp085_i2c_Begin@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
mov    $0xf4,%esi
mov    $0x2e,%edx
call   1030 <bmp085_i2c_Write_Byte@plt>
mov    $0x1388,%edi
call   1070 <usleep@plt>
mov    -0x10(%rbp),%edi
mov    $0xf6,%esi
call   1060 <bmp085_i2c_Read_Int@plt>
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%edi
call   1040 <close@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bmp085_ReadUT>:
push   %rbp
push   %rbx
push   %rax
call   1050 <bmp085_i2c_Begin@plt>
mov    %eax,%ebx
mov    %eax,%edi
mov    $0xf4,%esi
mov    $0x2e,%edx
call   1030 <bmp085_i2c_Write_Byte@plt>
mov    $0x1388,%edi
call   1070 <usleep@plt>
mov    %ebx,%edi
mov    $0xf6,%esi
call   1060 <bmp085_i2c_Read_Int@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1040 <close@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @bmp085_ReadUT(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
%5 = load i8*, i8** %2
%6 = call i32 @bmp085_i2c_Begin(i8* %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = call i32 @bmp085_i2c_Write_Byte(i32 %7, i32 244, i32 46)
%9 = call i32 @usleep(i32 5000)
%10 = load i32, i32* %4
%11 = call i32 @bmp085_i2c_Read_Int(i32 %10, i32 246)
store i32 %11, i32* %3
%12 = load i32, i32* %4
%13 = call i32 @close(i32 %12)
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @bmp085_ReadUT(i8* %0) {
%2 = tail call i32 @bmp085_i2c_Begin(i8* %0)
%3 = tail call i32 @bmp085_i2c_Write_Byte(i32 %2, i32 244, i32 46)
%4 = tail call i32 @usleep(i32 5000)
%5 = tail call i32 @bmp085_i2c_Read_Int(i32 %2, i32 246)
%6 = tail call i32 @close(i32 %2)
ret i32 %5
}
void gensyscall() {}


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

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

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

LLVM IR (-O2):
define void @gensyscall() {
ret void
}
void foo3(signed char *w) {
  int i;
  signed char *ww = __builtin_assume_aligned(w, 8);
  for (i = 0; i < 32; i++)
    ww[i] = ww[i] / 2;
}


x86 assembly (clang, -O0):
<foo3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x20,-0xc(%rbp)
jge    1150 <foo3+0x50>
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %al,%dl
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1117 <foo3+0x17>
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo3>:
movdqu (%rdi),%xmm0
movdqu 0x10(%rdi),%xmm1
movdqa %xmm0,%xmm2
psrlw  $0x7,%xmm2
movdqa 0xee6(%rip),%xmm3
pand   %xmm3,%xmm2
paddb  %xmm0,%xmm2
psrlw  $0x1,%xmm2
movdqa 0xee1(%rip),%xmm0
pand   %xmm0,%xmm2
movdqa 0xee5(%rip),%xmm4
pxor   %xmm4,%xmm2
psubb  %xmm4,%xmm2
movdqu %xmm2,(%rdi)
movdqa %xmm1,%xmm2
psrlw  $0x7,%xmm2
pand   %xmm3,%xmm2
paddb  %xmm1,%xmm2
psrlw  $0x1,%xmm2
pand   %xmm0,%xmm2
pxor   %xmm4,%xmm2
psubb  %xmm4,%xmm2
movdqu %xmm2,0x10(%rdi)
ret

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

LLVM IR (-O2):
define void @foo3(i8* %0) {
%2 = bitcast i8* %0 to <16 x i8>*
%3 = load <16 x i8>, <16 x i8>* %2
%4 = sdiv <16 x i8> %3, <i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2>
%5 = bitcast i8* %0 to <16 x i8>*
store <16 x i8> %4, <16 x i8>* %5
%6 = getelementptr inbounds i8, i8* %0, i64 16
%7 = bitcast i8* %6 to <16 x i8>*
%8 = load <16 x i8>, <16 x i8>* %7
%9 = sdiv <16 x i8> %8, <i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2>
%10 = bitcast i8* %6 to <16 x i8>*
store <16 x i8> %9, <16 x i8>* %10
ret void
}
void gtk_size_group_get_mode() {}


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

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

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

LLVM IR (-O2):
define void @gtk_size_group_get_mode() {
ret void
}