xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ inside_f3();
int usleep(int);
void *f3(void *arg) {
  int rc;
  rc = usleep(100000);
  assert(rc == 0);
  inside_f3();
  return NULL;
}


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x186a0,%edi
call   1050 <usleep@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x0,%al
call   1040 <inside_f3@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
push   %rax
mov    $0x186a0,%edi
call   1050 <usleep@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1030 <assert@plt>
xor    %eax,%eax
call   1040 <inside_f3@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @f3(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = call i32 @usleep(i32 100000)
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = call i32 (...) @inside_f3()
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @f3(i8* nocapture readnone %0) {
%2 = tail call i32 @usleep(i32 100000)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i32 (...) @inside_f3()
ret i8* null
}
int test_imm_03uint8_reg(unsigned char val) {
  return ((val) & (0x03 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_03uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0x3,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_03uint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 3
%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_03uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 3
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ OCSP_REVOKEDINFO;
typedef int /*<<< orphan*/ ASN1_VALUE;

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


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

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

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

LLVM IR (-O2):
@OCSP_REVOKEDINFO_it = global i32 0
define i32* @d2i_OCSP_REVOKEDINFO(i32** %0, i8** %1, i64 %2) {
%4 = tail call i64 @ASN1_item_d2i(i32** %0, i8** %1, i64 %2, i32* @OCSP_REVOKEDINFO_it)
%5 = inttoptr i64 %4 to i32*
ret i32* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fwrite(unsigned char *, int, int, int /*<<< orphan*/ *);
int write_short(FILE *out, unsigned int n) {
  unsigned char buffer[2];
  buffer[0] = n;
  buffer[1] = n >> 8;
  if (fwrite(buffer, 1, 2, out) != 2)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<write_short>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %al,-0x16(%rbp)
mov    -0x14(%rbp),%eax
shr    $0x8,%eax
mov    %al,-0x15(%rbp)
lea    -0x16(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x1,%esi
mov    $0x2,%edx
call   1030 <fwrite@plt>
cmp    $0x2,%eax
je     115a <write_short+0x4a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1161 <write_short+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_short>:
push   %rax
mov    %rdi,%rcx
mov    %si,0x6(%rsp)
lea    0x6(%rsp),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
call   1030 <fwrite@plt>
xor    %ecx,%ecx
cmp    $0x2,%eax
setne  %cl
neg    %ecx
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @write_short(i32* nocapture %0, i32 %1) {
%3 = alloca [2 x i8]
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%5 = trunc i32 %1 to i8
store i8 %5, i8* %4
%6 = lshr i32 %1, 8
%7 = trunc i32 %6 to i8
%8 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
store i8 %7, i8* %8
%9 = call i32 @fwrite(i8* %4, i32 1, i32 2, i32* %0)
%10 = icmp ne i32 %9, 2
%11 = sext i1 %10 to i32
ret i32 %11
}
int MinSize(int a, int b) { return (a < b) ? a : b; }


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

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

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

LLVM IR (-O2):
define i32 @MinSize(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Flush_Buffer(int);
unsigned int Show_Bits(int);
unsigned int Get_Bits(int N) {
  unsigned int Val;
  {
    Val = Show_Bits(N);
    Flush_Buffer(N);
    return (Val);
  }
}


x86 assembly (clang, -O0):
<Get_Bits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <Show_Bits@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <Flush_Buffer@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Get_Bits>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1030 <Show_Bits@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1040 <Flush_Buffer@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @Get_Bits(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @Show_Bits(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = call i32 @Flush_Buffer(i32 %6)
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @Get_Bits(i32 %0) {
%2 = tail call i32 @Show_Bits(i32 %0)
%3 = tail call i32 @Flush_Buffer(i32 %0)
ret i32 %2
}
void idle() {
  for (;;)
    ;
}


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

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

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

LLVM IR (-O2):
define void @idle() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ output_byte(char);
int /*<<< orphan*/ output_decimal(int);
void output_number(int num) {
  output_byte('#');
  output_decimal(num);
}


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

x86 assembly (clang, -O2):
<output_number>:
push   %rbx
mov    %edi,%ebx
mov    $0x23,%edi
call   1040 <output_byte@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <output_decimal@plt>

LLVM IR (-O0):
define void @output_number(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @output_byte(i8 signext 35)
%4 = load i32, i32* %2
%5 = call i32 @output_decimal(i32 %4)
ret void
}

LLVM IR (-O2):
define void @output_number(i32 %0) {
%2 = tail call i32 @output_byte(i8 signext 35)
%3 = tail call i32 @output_decimal(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int strlen(char *);
int intLen(int k) {
  char line[2097152];
  sprintf(line, "%i", k);
  return strlen(line);
}


x86 assembly (clang, -O0):
<intLen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x200010,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x200010(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xec1(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x200010(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x200010,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intLen>:
push   %rbx
sub    $0x200000,%rsp
mov    %edi,%edx
lea    0xecf(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
add    $0x200000,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%i\00"
define i32 @intLen(i32 %0) {
%2 = alloca i32
%3 = alloca [2097152 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [2097152 x i8], [2097152 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = getelementptr inbounds [2097152 x i8], [2097152 x i8]* %3, i64 0, i64 0
%8 = call i32 @strlen(i8* %7)
ret i32 %8
}

LLVM IR (-O2):
@.str = [3 x i8] c"%i\00"
define i32 @intLen(i32 %0) {
%2 = alloca [2097152 x i8]
%3 = getelementptr inbounds [2097152 x i8], [2097152 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = call i32 @strlen(i8* %3)
ret i32 %5
}
long fib(long n) {
  if (n < 2) {
    return n;
  } else {
    return fib(n - 1) + fib(n - 2);
  }
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x2,-0x10(%rbp)
jge    1134 <fib+0x24>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1160 <fib+0x50>
mov    -0x10(%rbp),%rdi
sub    $0x1,%rdi
call   1030 <fib@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
sub    $0x2,%rdi
call   1030 <fib@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %r14
push   %rbx
push   %rax
xor    %r14d,%r14d
cmp    $0x2,%rdi
jl     1139 <fib+0x29>
mov    %rdi,%rbx
lea    -0x1(%rbx),%rdi
call   1030 <fib@plt>
lea    -0x2(%rbx),%rdi
add    %rax,%r14
cmp    $0x3,%rbx
mov    %rdi,%rbx
ja     1120 <fib+0x10>
add    %rdi,%r14
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64 @fib(i64 %0) {
%2 = icmp slt i64 %0, 2
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %8, %3 ], [ %0, %1 ]
%5 = phi i64 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i64 %4, -1
%7 = tail call i64 @fib(i64 %6)
%8 = add nsw i64 %4, -2
%9 = add nsw i64 %7, %5
%10 = icmp ult i64 %4, 4
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i64 [ 0, %1 ], [ %9, %3 ]
%13 = phi i64 [ %0, %1 ], [ %8, %3 ]
%14 = add nsw i64 %13, %12
ret i64 %14
}
/* Type definitions */
struct dirent {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __opendirat(int, char const *);
int __scandir_tail(int /*<<< orphan*/, struct dirent ***,
                   int (*)(struct dirent const *),
                   int (*)(struct dirent const **, struct dirent const **));
int __scandirat(int dfd, const char *dir, struct dirent ***namelist,
                int (*select)(const struct dirent *),
                int (*cmp)(const struct dirent **, const struct dirent **)) {
  return __scandir_tail(__opendirat(dfd, dir), namelist, select, cmp);
}


x86 assembly (clang, -O0):
<__scandirat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <__opendirat@plt>
mov    %eax,%edi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
call   1040 <__scandir_tail@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__scandirat>:
push   %r15
push   %r14
push   %rbx
mov    %r8,%r14
mov    %rcx,%r15
mov    %rdx,%rbx
call   1030 <__opendirat@plt>
mov    %eax,%edi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <__scandir_tail@plt>

LLVM IR (-O0):
%struct.dirent = type { i32 }
define i32 @__scandirat(i32 %0, i8* %1, %struct.dirent*** %2, i32 (%struct.dirent*)* %3, i32 (%struct.dirent**, %struct.dirent**)* %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca %struct.dirent***
%9 = alloca i32 (%struct.dirent*)*
%10 = alloca i32 (%struct.dirent**, %struct.dirent**)*
store i32 %0, i32* %6
store i8* %1, i8** %7
store %struct.dirent*** %2, %struct.dirent**** %8
store i32 (%struct.dirent*)* %3, i32 (%struct.dirent*)** %9
store i32 (%struct.dirent**, %struct.dirent**)* %4, i32 (%struct.dirent**, %struct.dirent**)** %10
%11 = load i32, i32* %6
%12 = load i8*, i8** %7
%13 = call i32 @__opendirat(i32 %11, i8* %12)
%14 = load %struct.dirent***, %struct.dirent**** %8
%15 = load i32 (%struct.dirent*)*, i32 (%struct.dirent*)** %9
%16 = load i32 (%struct.dirent**, %struct.dirent**)*, i32 (%struct.dirent**, %struct.dirent**)** %10
%17 = call i32 @__scandir_tail(i32 %13, %struct.dirent*** %14, i32 (%struct.dirent*)* %15, i32 (%struct.dirent**, %struct.dirent**)* %16)
ret i32 %17
}

LLVM IR (-O2):
%struct.dirent = type { i32 }
define i32 @__scandirat(i32 %0, i8* %1, %struct.dirent*** %2, i32 (%struct.dirent*)* %3, i32 (%struct.dirent**, %struct.dirent**)* %4) {
%6 = tail call i32 @__opendirat(i32 %0, i8* %1)
%7 = tail call i32 @__scandir_tail(i32 %6, %struct.dirent*** %2, i32 (%struct.dirent*)* %3, i32 (%struct.dirent**, %struct.dirent**)* %4)
ret i32 %7
}
long int numeric_roman_to_arabic(char value[]) { return 0; }


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

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

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

LLVM IR (-O2):
define i64 @numeric_roman_to_arabic(i8* nocapture readnone %0) {
ret i64 0
}
/* Variables and functions */
int GetLine(char *, int);
int /*<<< orphan*/ Reverse(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char line[1024];
  int len;
  while ((len = GetLine(line, 1024)) > 0) {
    Reverse(line, len);
    printf("%s", line);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x410(%rbp),%rdi
mov    $0x400,%esi
call   1030 <GetLine@plt>
mov    %eax,-0x414(%rbp)
cmp    $0x0,%eax
jle    118c <main+0x5c>
lea    -0x410(%rbp),%rdi
mov    -0x414(%rbp),%esi
call   1050 <Reverse@plt>
lea    -0x410(%rbp),%rsi
lea    0xe7e(%rip),%rdi
call   1040 <printf@plt>
jmp    1142 <main+0x12>
xor    %eax,%eax
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x408,%rsp
mov    %rsp,%rdi
mov    $0x400,%esi
call   1030 <GetLine@plt>
test   %eax,%eax
jle    1186 <main+0x56>
mov    %rsp,%rbx
lea    0xeab(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbx,%rdi
mov    %eax,%esi
call   1050 <Reverse@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x400,%esi
call   1030 <GetLine@plt>
test   %eax,%eax
jg     1160 <main+0x30>
xor    %eax,%eax
add    $0x408,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1024 x i8]
%3 = alloca i32
store i32 0, i32* %1
br label %4
4: ; preds = %8, %0
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%6 = call i32 @GetLine(i8* %5, i32 1024)
store i32 %6, i32* %3
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %4
%9 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%10 = load i32, i32* %3
%11 = call i32 @Reverse(i8* %9, i32 %10)
%12 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%13 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %12)
br label %4
14: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = call i32 @GetLine(i8* %2, i32 1024)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %11
5: ; preds = %0, %5
%6 = phi i32 [ %9, %5 ], [ %3, %0 ]
%7 = call i32 @Reverse(i8* %2, i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%9 = call i32 @GetLine(i8* %2, i32 1024)
%10 = icmp sgt i32 %9, 0
br i1 %10, label %5, label %11
11: ; preds = %5, %0
ret i32 0
}
void show_read_lock(void) {
  asm volatile("/* start */");
  rcu_read_lock();
  asm volatile("/* end */");
}


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

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

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

LLVM IR (-O2):
define void @show_read_lock() {
tail call void asm sideeffect "/* start */", "~{dirflag},~{fpsr},~{flags}"()
%1 = tail call i32 (...) @rcu_read_lock()
tail call void asm sideeffect "/* end */", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
float flerp2D(float xx, float xy, float yx, float yy, float xt, float yt) {
  float a = xx + ((xy - xx) * yt);
  float b = yx + ((yy - yx) * yt);
  return a + ((b - a) * xt);
}


x86 assembly (clang, -O0):
<flerp2D>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  %xmm4,-0x14(%rbp)
movss  %xmm5,-0x18(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
subss  -0x4(%rbp),%xmm0
movss  -0x18(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0xc(%rbp),%xmm1
movss  -0x10(%rbp),%xmm0
subss  -0xc(%rbp),%xmm0
movss  -0x18(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x1c(%rbp),%xmm1
movss  -0x20(%rbp),%xmm0
subss  -0x1c(%rbp),%xmm0
movss  -0x14(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<flerp2D>:
unpcklps %xmm1,%xmm3
unpcklps %xmm0,%xmm2
subps  %xmm2,%xmm3
shufps $0x0,%xmm5,%xmm5
mulps  %xmm3,%xmm5
addps  %xmm2,%xmm5
movaps %xmm5,%xmm0
shufps $0x55,%xmm5,%xmm0
subss  %xmm0,%xmm5
mulss  %xmm4,%xmm5
addss  %xmm5,%xmm0
ret

LLVM IR (-O0):
define float @flerp2D(float %0, float %1, float %2, float %3, float %4, float %5) {
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
%13 = alloca float
%14 = alloca float
store float %0, float* %7
store float %1, float* %8
store float %2, float* %9
store float %3, float* %10
store float %4, float* %11
store float %5, float* %12
%15 = load float, float* %7
%16 = load float, float* %8
%17 = load float, float* %7
%18 = fsub float %16, %17
%19 = load float, float* %12
%20 = call float @llvm.fmuladd.f32(float %18, float %19, float %15)
store float %20, float* %13
%21 = load float, float* %9
%22 = load float, float* %10
%23 = load float, float* %9
%24 = fsub float %22, %23
%25 = load float, float* %12
%26 = call float @llvm.fmuladd.f32(float %24, float %25, float %21)
store float %26, float* %14
%27 = load float, float* %13
%28 = load float, float* %14
%29 = load float, float* %13
%30 = fsub float %28, %29
%31 = load float, float* %11
%32 = call float @llvm.fmuladd.f32(float %30, float %31, float %27)
ret float %32
}

LLVM IR (-O2):
define float @flerp2D(float %0, float %1, float %2, float %3, float %4, float %5) {
%7 = insertelement <2 x float> poison, float %3, i64 0
%8 = insertelement <2 x float> %7, float %1, i64 1
%9 = insertelement <2 x float> poison, float %2, i64 0
%10 = insertelement <2 x float> %9, float %0, i64 1
%11 = fsub <2 x float> %8, %10
%12 = insertelement <2 x float> poison, float %5, i64 0
%13 = shufflevector <2 x float> %12, <2 x float> poison, <2 x i32> zeroinitializer
%14 = call <2 x float> @llvm.fmuladd.v2f32(<2 x float> %11, <2 x float> %13, <2 x float> %10)
%15 = extractelement <2 x float> %14, i64 0
%16 = extractelement <2 x float> %14, i64 1
%17 = fsub float %15, %16
%18 = tail call float @llvm.fmuladd.f32(float %17, float %4, float %16)
ret float %18
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_find_config_file() {
  printf("NOT IMPLEMENTED:"
         "pa_find_config_file"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [37 x i8] c"NOT IMPLEMENTED:pa_find_config_file\0A\00"
define i32 @pa_find_config_file() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [36 x i8] c"NOT IMPLEMENTED:pa_find_config_file\00"
define i32 @pa_find_config_file() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int endian_little_read_16(int /*<<< orphan*/ *);
long endian_little_read_32(FILE *fp) {
  int a, b;
  long z;
  a = endian_little_read_16(fp) & 0x00ffff;
  b = endian_little_read_16(fp) & 0x00ffff;
  z = (a << 16) + (b);
  return (z);
}


x86 assembly (clang, -O0):
<endian_little_read_32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <endian_little_read_16@plt>
and    $0xffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <endian_little_read_16@plt>
and    $0xffff,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x10,%eax
add    -0x10(%rbp),%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<endian_little_read_32>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <endian_little_read_16@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <endian_little_read_16@plt>
movzwl %ax,%eax
shl    $0x10,%ebp
or     %eax,%ebp
movslq %ebp,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i64 @endian_little_read_32(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
store i32* %0, i32** %2
%6 = load i32*, i32** %2
%7 = call i32 @endian_little_read_16(i32* %6)
%8 = and i32 %7, 65535
store i32 %8, i32* %3
%9 = load i32*, i32** %2
%10 = call i32 @endian_little_read_16(i32* %9)
%11 = and i32 %10, 65535
store i32 %11, i32* %4
%12 = load i32, i32* %3
%13 = shl i32 %12, 16
%14 = load i32, i32* %4
%15 = add nsw i32 %13, %14
%16 = sext i32 %15 to i64
store i64 %16, i64* %5
%17 = load i64, i64* %5
ret i64 %17
}

LLVM IR (-O2):
define i64 @endian_little_read_32(i32* %0) {
%2 = tail call i32 @endian_little_read_16(i32* %0)
%3 = tail call i32 @endian_little_read_16(i32* %0)
%4 = and i32 %3, 65535
%5 = shl i32 %2, 16
%6 = or i32 %4, %5
%7 = sext i32 %6 to i64
ret i64 %7
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int int32_t;

/* Variables and functions */
bool DecodeNode(int32_t length, const uint8_t *data, char *node) {
  if (length != 1) {
    return false;
  }
  *node = (char)data[0];
  return true;
}


x86 assembly (clang, -O0):
<DecodeNode>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x1,-0x8(%rbp)
je     1125 <DecodeNode+0x25>
movl   $0x0,-0x4(%rbp)
jmp    113b <DecodeNode+0x3b>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<DecodeNode>:
xor    %eax,%eax
cmp    $0x1,%edi
jne    1110 <DecodeNode+0x10>
mov    (%rsi),%al
mov    %al,(%rdx)
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @DecodeNode(i32 %0, i64* nocapture %1, i8* nocapture writeonly %2) {
%4 = icmp eq i32 %0, 1
br i1 %4, label %5, label %8
5: ; preds = %3
%6 = load i64, i64* %1
%7 = trunc i64 %6 to i8
store i8 %7, i8* %2
br label %8
8: ; preds = %3, %5
%9 = phi i32 [ 1, %5 ], [ 0, %3 ]
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ GetFirstPIDbyName_implements(char const *,
                                                int /*<<< orphan*/,
                                                int /*<<< orphan*/,
                                                int /*<<< orphan*/);
pid_t GetFirstPIDbyName_Wrapper(const char *cchrptr_ProcessName) {
  return GetFirstPIDbyName_implements(cchrptr_ProcessName, 0, 0, 0);
}


x86 assembly (clang, -O0):
<GetFirstPIDbyName_Wrapper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %ecx,%ecx
mov    %ecx,%esi
mov    %ecx,%edx
call   1030 <GetFirstPIDbyName_implements@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetFirstPIDbyName_Wrapper>:
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <GetFirstPIDbyName_implements@plt>

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

LLVM IR (-O2):
define i32 @GetFirstPIDbyName_Wrapper(i8* %0) {
%2 = tail call i32 @GetFirstPIDbyName_implements(i8* %0, i32 0, i32 0, i32 0)
ret i32 %2
}
adr0adr1(r0, r1, x0, x1, p0, p1) unsigned int r0, r1;
unsigned int *p0, *p1;
{
  if ((*((unsigned int *)10000000)) <= (*((unsigned int *)11111111)))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<adr0adr1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    $0x989680,%eax
mov    (%rax),%eax
mov    $0xa98ac7,%ecx
cmp    (%rcx),%eax
ja     1138 <adr0adr1+0x38>
movl   $0x1,-0x4(%rbp)
jmp    113f <adr0adr1+0x3f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adr0adr1>:
mov    0x989680,%ecx
xor    %eax,%eax
cmp    0xa98ac7,%ecx
setbe  %al
ret

LLVM IR (-O0):
define i32 @adr0adr1(i32 %0, i32 %1, i32 %2, i32 %3, i32* %4, i32* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32*
%13 = alloca i32*
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32* %4, i32** %12
store i32* %5, i32** %13
%14 = load i32, i32* inttoptr (i64 10000000 to i32*)
%15 = load i32, i32* inttoptr (i64 11111111 to i32*)
%16 = icmp ule i32 %14, %15
br i1 %16, label %17, label %18
17: ; preds = %6
store i32 1, i32* %7
br label %19
18: ; preds = %6
store i32 0, i32* %7
br label %19
19: ; preds = %18, %17
%20 = load i32, i32* %7
ret i32 %20
}

LLVM IR (-O2):
define i32 @adr0adr1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture readnone %4, i32* nocapture readnone %5) {
%7 = load i32, i32* inttoptr (i64 10000000 to i32*)
%8 = load i32, i32* inttoptr (i64 11111111 to i32*)
%9 = icmp ule i32 %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ primeFactors(int);
int scanf(char *, int *);
int main() {
  int n;
  while (scanf("%d", &n) == 1) {
    primeFactors(n);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <scanf@plt>
cmp    $0x1,%eax
jne    1155 <main+0x35>
mov    -0x8(%rbp),%edi
call   1040 <primeFactors@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1030 <scanf@plt>
cmp    $0x1,%eax
jne    1169 <main+0x49>
lea    0xebf(%rip),%r14
lea    0x4(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
mov    0x4(%rsp),%edi
call   1040 <primeFactors@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <scanf@plt>
cmp    $0x1,%eax
je     1150 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %10
5: ; preds = %0, %5
%6 = load i32, i32* %1
%7 = call i32 @primeFactors(i32 %6)
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%9 = icmp eq i32 %8, 1
br i1 %9, label %5, label %10
10: ; preds = %5, %0
ret i32 0
}
/* Variables and functions */
int g3();
int h(int (*p)[sizeof(i())]) {
  int g2(), g3();
  return (*p)[0] + g3() + g2();
}


x86 assembly (clang, -O0):
<h>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <g3@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1040 <g2@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%ebp
xor    %eax,%eax
call   1030 <g3@plt>
mov    %eax,%ebx
add    %ebp,%ebx
xor    %eax,%eax
call   1040 <g2@plt>
add    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @h([4 x i32]* %0) {
%2 = alloca [4 x i32]*
store [4 x i32]* %0, [4 x i32]** %2
%3 = load [4 x i32]*, [4 x i32]** %2
%4 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 0
%5 = load i32, i32* %4
%6 = call i32 (...) @g3()
%7 = add nsw i32 %5, %6
%8 = call i32 (...) @g2()
%9 = add nsw i32 %7, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @h([4 x i32]* nocapture %0) {
%2 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 0, i64 0
%3 = load i32, i32* %2
%4 = tail call i32 (...) @g3()
%5 = add nsw i32 %4, %3
%6 = tail call i32 (...) @g2()
%7 = add nsw i32 %5, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ pop();
void __cyg_profile_func_exit(void *this_fn, void *call_site) { pop(); }


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

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

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

LLVM IR (-O2):
define void @__cyg_profile_func_exit(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call i32 (...) @pop()
ret void
}
void RTEnvSetEx(void) {}


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

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

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

LLVM IR (-O2):
define void @RTEnvSetEx() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ kprintf(char *, int);
void isrHandle28() { kprintf("ISR %d.\n", 28); }


x86 assembly (clang, -O0):
<isrHandle28>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x1c,%esi
call   1030 <kprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<isrHandle28>:
lea    0xee9(%rip),%rdi
mov    $0x1c,%esi
jmp    1030 <kprintf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"ISR %d.\0A\00"
define void @isrHandle28() {
%1 = call i32 @kprintf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 28)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"ISR %d.\0A\00"
define void @isrHandle28() {
%1 = tail call i32 @kprintf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 28)
ret void
}
/* Variables and functions */
int **calloc(int, int);
int x7(void) {
  int **md = calloc(1, 1);
  return md[0][0];
}


x86 assembly (clang, -O0):
<x7>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%esi
mov    %esi,%edi
call   1030 <calloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x7>:
push   %rax
mov    $0x1,%edi
mov    $0x1,%esi
call   1030 <calloc@plt>
mov    (%rax),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @x7() {
%1 = alloca i32**
%2 = call i32** @calloc(i32 1, i32 1)
store i32** %2, i32*** %1
%3 = load i32**, i32*** %1
%4 = getelementptr inbounds i32*, i32** %3, i64 0
%5 = load i32*, i32** %4
%6 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @x7() {
%1 = tail call i32** @calloc(i32 1, i32 1)
%2 = load i32*, i32** %1
%3 = load i32, i32* %2
ret i32 %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ x54x_outl(int, int, void *);
void x54x_writel(uint32_t port, uint32_t val, void *priv) {
  x54x_outl(port & 3, val, priv);
}


x86 assembly (clang, -O0):
<x54x_writel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
and    $0x3,%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1030 <x54x_outl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x54x_writel>:
and    $0x3,%edi
jmp    1030 <x54x_outl@plt>

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

LLVM IR (-O2):
define void @x54x_writel(i32 %0, i32 %1, i8* %2) {
%4 = and i32 %0, 3
%5 = tail call i32 @x54x_outl(i32 %4, i32 %1, i8* %2)
ret void
}
int hammingDistance(int x, int y) {
  int count = 0;
  while (x > 0 || y > 0) {
    if ((x & 1) != (y & 1)) {
      ++count;
    }
    x >>= 1;
    y >>= 1;
  }
  return count;
}


x86 assembly (clang, -O0):
<hammingDistance>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0xd(%rbp)
jg     112a <hammingDistance+0x2a>
cmpl   $0x0,-0x8(%rbp)
setg   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    113a <hammingDistance+0x3a>
jmp    116e <hammingDistance+0x6e>
mov    -0x4(%rbp),%eax
and    $0x1,%eax
mov    -0x8(%rbp),%ecx
and    $0x1,%ecx
cmp    %ecx,%eax
je     1157 <hammingDistance+0x57>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1111 <hammingDistance+0x11>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hammingDistance>:
test   %edi,%edi
jg     110a <hammingDistance+0xa>
xor    %eax,%eax
test   %esi,%esi
jle    112d <hammingDistance+0x2d>
xor    %eax,%eax
nopl   0x0(%rax)
mov    %edi,%edx
mov    %esi,%r8d
mov    %esi,%ecx
xor    %edi,%ecx
and    $0x1,%ecx
add    %ecx,%eax
sar    %edi
sar    %esi
cmp    $0x1,%edx
jg     1110 <hammingDistance+0x10>
cmp    $0x1,%r8d
jg     1110 <hammingDistance+0x10>
ret

LLVM IR (-O0):
define i32 @hammingDistance(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %23, %2
%7 = load i32, i32* %3
%8 = icmp sgt i32 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %6
%10 = load i32, i32* %4
%11 = icmp sgt i32 %10, 0
br label %12
12: ; preds = %9, %6
%13 = phi i1 [ true, %6 ], [ %11, %9 ]
br i1 %13, label %14, label %28
14: ; preds = %12
%15 = load i32, i32* %3
%16 = and i32 %15, 1
%17 = load i32, i32* %4
%18 = and i32 %17, 1
%19 = icmp ne i32 %16, %18
br i1 %19, label %20, label %23
20: ; preds = %14
%21 = load i32, i32* %5
%22 = add nsw i32 %21, 1
store i32 %22, i32* %5
br label %23
23: ; preds = %20, %14
%24 = load i32, i32* %3
%25 = ashr i32 %24, 1
store i32 %25, i32* %3
%26 = load i32, i32* %4
%27 = ashr i32 %26, 1
store i32 %27, i32* %4
br label %6
28: ; preds = %12
%29 = load i32, i32* %5
ret i32 %29
}

LLVM IR (-O2):
define i32 @hammingDistance(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, 0
%4 = icmp sgt i32 %1, 0
%5 = or i1 %3, %4
br i1 %5, label %6, label %18
6: ; preds = %2, %6
%7 = phi i32 [ %12, %6 ], [ 0, %2 ]
%8 = phi i32 [ %14, %6 ], [ %1, %2 ]
%9 = phi i32 [ %13, %6 ], [ %0, %2 ]
%10 = xor i32 %8, %9
%11 = and i32 %10, 1
%12 = add nuw nsw i32 %11, %7
%13 = ashr i32 %9, 1
%14 = ashr i32 %8, 1
%15 = icmp sgt i32 %9, 1
%16 = icmp sgt i32 %8, 1
%17 = select i1 %15, i1 true, i1 %16
br i1 %17, label %6, label %18
18: ; preds = %6, %2
%19 = phi i32 [ 0, %2 ], [ %12, %6 ]
ret i32 %19
}
/* Variables and functions */
int /*<<< orphan*/ Cvar_SetWithFlag_f(int);
void Cvar_Sets_f(void) { Cvar_SetWithFlag_f(4); }


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

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

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

LLVM IR (-O2):
define void @Cvar_Sets_f() {
%1 = tail call i32 @Cvar_SetWithFlag_f(i32 4)
ret void
}
int test_imm_28int8_mem(signed char *val) {
  return ((*val) & (-0x28 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_28int8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
and    $0xffffffd8,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_28int8_mem>:
testb  $0xd8,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_28int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -40
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *realloc(void *, size_t);
int /*<<< orphan*/ stderr;
void *kino_MemMan_wrapped_realloc(void *ptr, size_t size) {
  void *pointer = realloc(ptr, size);
  if (pointer == NULL && size != 0) {
    fprintf(stderr, "Out of memory.\n");
    exit(1);
  }
  return pointer;
}


x86 assembly (clang, -O0):
<kino_MemMan_wrapped_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1186 <kino_MemMan_wrapped_realloc+0x56>
cmpq   $0x0,-0x10(%rbp)
je     1186 <kino_MemMan_wrapped_realloc+0x56>
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
lea    0xe89(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kino_MemMan_wrapped_realloc>:
push   %rbx
mov    %rsi,%rbx
call   1040 <realloc@plt>
test   %rbx,%rbx
je     1143 <kino_MemMan_wrapped_realloc+0x13>
test   %rax,%rax
je     1145 <kino_MemMan_wrapped_realloc+0x15>
pop    %rbx
ret
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
lea    0xeab(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [16 x i8] c"Out of memory.\0A\00"
define i8* @kino_MemMan_wrapped_realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %18
11: ; preds = %2
%12 = load i64, i64* %4
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %18
14: ; preds = %11
%15 = load i32, i32* @stderr
%16 = call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%17 = call i32 @exit(i32 1)
unreachable
18: ; preds = %11, %2
%19 = load i8*, i8** %5
ret i8* %19
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [16 x i8] c"Out of memory.\0A\00"
define noalias i8* @kino_MemMan_wrapped_realloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
%5 = icmp ne i64 %1, 0
%6 = and i1 %5, %4
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 @exit(i32 1)
unreachable
11: ; preds = %2
ret i8* %3
}
/* Type definitions */
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int accept(int, struct sockaddr *, int /*<<< orphan*/ *);
int cw_accept(int s, struct sockaddr *addr, int *addrlen, int ssl) {
  return accept(s, addr, (socklen_t *)addrlen);
}


x86 assembly (clang, -O0):
<cw_accept>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <accept@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cw_accept>:
jmp    1030 <accept@plt>

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
define i32 @cw_accept(i32 %0, %struct.sockaddr* %1, i32* %2, i32 %3) {
%5 = alloca i32
%6 = alloca %struct.sockaddr*
%7 = alloca i32*
%8 = alloca i32
store i32 %0, i32* %5
store %struct.sockaddr* %1, %struct.sockaddr** %6
store i32* %2, i32** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load %struct.sockaddr*, %struct.sockaddr** %6
%11 = load i32*, i32** %7
%12 = call i32 @accept(i32 %9, %struct.sockaddr* %10, i32* %11)
ret i32 %12
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define i32 @cw_accept(i32 %0, %struct.sockaddr* %1, i32* %2, i32 %3) {
%5 = tail call i32 @accept(i32 %0, %struct.sockaddr* %1, i32* %2)
ret i32 %5
}
/* Variables and functions */
float add2(float);
float add1(float n) {
  if (n < 1)
    return 1;
  return 1 + add2(n - 1);
}


x86 assembly (clang, -O0):
<add1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  0xedb(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1141 <add1+0x31>
movss  0xec9(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    116b <add1+0x5b>
movss  -0x8(%rbp),%xmm0
movss  0xeb2(%rip),%xmm1
subss  %xmm1,%xmm0
call   1030 <add2@plt>
movaps %xmm0,%xmm1
movss  0xe9e(%rip),%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add1>:
push   %rax
movaps %xmm0,%xmm1
movss  0xee4(%rip),%xmm0
ucomiss %xmm1,%xmm0
ja     1139 <add1+0x29>
addss  0xedb(%rip),%xmm1
movaps %xmm1,%xmm0
call   1030 <add2@plt>
addss  0xec7(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @add1(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp olt float %4, 1.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store float 1.000000e+00, float* %2
br label %12
7: ; preds = %1
%8 = load float, float* %3
%9 = fsub float %8, 1.000000e+00
%10 = call float @add2(float %9)
%11 = fadd float 1.000000e+00, %10
store float %11, float* %2
br label %12
12: ; preds = %7, %6
%13 = load float, float* %2
ret float %13
}

LLVM IR (-O2):
define float @add1(float %0) {
%2 = fcmp olt float %0, 1.000000e+00
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = fadd float %0, -1.000000e+00
%5 = tail call float @add2(float %4)
%6 = fadd float %5, 1.000000e+00
br label %7
7: ; preds = %1, %3
%8 = phi float [ %6, %3 ], [ 1.000000e+00, %1 ]
ret float %8
}