xunge/DecIR huggingface dataset:
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ putchar(int);
main() {
  int c;
  c = getchar();
  while (c != EOF) {
    putchar(c);
    c = getchar();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2ea5(%rip),%rcx
cmp    (%rcx),%eax
je     1162 <main+0x42>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
jmp    1139 <main+0x19>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb9(%rip),%rbx
cmp    (%rbx),%eax
je     1152 <main+0x32>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%eax
jne    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@EOF = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %10, label %4
4: ; preds = %0, %4
%5 = phi i32 [ %7, %4 ], [ %1, %0 ]
%6 = tail call i32 @putchar(i32 %5)
%7 = tail call i32 (...) @getchar()
%8 = load i32, i32* @EOF
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %4
10: ; preds = %4, %0
ret i32 0
}
unsigned int test_10(unsigned int a, int b) { return (a << 1) | (b & 1); }


x86 assembly (clang, -O0):
<test_10>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    -0x8(%rbp),%ecx
and    $0x1,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_10>:
and    $0x1,%esi
lea    (%rsi,%rdi,2),%eax
ret

LLVM IR (-O0):
define i32 @test_10(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 = shl i32 %5, 1
%7 = load i32, i32* %4
%8 = and i32 %7, 1
%9 = or i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_10(i32 %0, i32 %1) {
%3 = shl i32 %0, 1
%4 = and i32 %1, 1
%5 = or i32 %4, %3
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(int /*<<< orphan*/, int /*<<< orphan*/ *);
void fputl(const char *s, size_t len, FILE *stream) {
  while (len-- > 0) {
    fputc(*s++, stream);
  }
}


x86 assembly (clang, -O0):
<fputl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
cmp    $0x0,%rax
jbe    115d <fputl+0x4d>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
mov    -0x18(%rbp),%rsi
call   1030 <fputc@plt>
jmp    1124 <fputl+0x14>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fputl>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rsi,%rsi
je     1146 <fputl+0x36>
mov    %rdx,%r14
mov    %rsi,%r12
mov    %rdi,%r15
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <fputl+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

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


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

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

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

LLVM IR (-O2):
define void @free_buffer(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void chaz_ConfWriterRuby_add_sys_include(const char *header) { (void)header; }


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

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

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

LLVM IR (-O2):
define void @chaz_ConfWriterRuby_add_sys_include(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int tm_year;
};

/* Variables and functions */
scalar_t__ leap(int);
int /*<<< orphan*/ localtime_r(int /*<<< orphan*/ *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int days_last_year(void) {
  struct tm time_record;
  time_t current_time;
  time(&current_time);
  localtime_r(&current_time, &time_record);
  if (leap(time_record.tm_year - 1 + 1900)) {
    return 366;
  }
  return 365;
}


x86 assembly (clang, -O0):
<days_last_year>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0xc(%rbp),%rdi
call   1050 <time@plt>
lea    -0xc(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <localtime_r@plt>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
add    $0x76c,%edi
call   1040 <leap@plt>
cmp    $0x0,%rax
je     1175 <days_last_year+0x45>
movl   $0x16e,-0x4(%rbp)
jmp    117c <days_last_year+0x4c>
movl   $0x16d,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<days_last_year>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <time@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <localtime_r@plt>
mov    $0x76b,%edi
add    0x8(%rsp),%edi
call   1040 <leap@plt>
cmp    $0x1,%rax
mov    $0x16e,%eax
sbb    $0x0,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define i32 @days_last_year() {
%1 = alloca i32
%2 = alloca %struct.tm
%3 = alloca i32
%4 = call i32 @time(i32* %3)
%5 = call i32 @localtime_r(i32* %3, %struct.tm* %2)
%6 = getelementptr inbounds %struct.tm, %struct.tm* %2, i32 0, i32 0
%7 = load i32, i32* %6
%8 = sub nsw i32 %7, 1
%9 = add nsw i32 %8, 1900
%10 = call i64 @leap(i32 %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %0
store i32 366, i32* %1
br label %14
13: ; preds = %0
store i32 365, i32* %1
br label %14
14: ; preds = %13, %12
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define i32 @days_last_year() {
%1 = alloca %struct.tm
%2 = alloca i32
%3 = bitcast %struct.tm* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @time(i32* %2)
%6 = call i32 @localtime_r(i32* %2, %struct.tm* %1)
%7 = getelementptr inbounds %struct.tm, %struct.tm* %1, i64 0, i32 0
%8 = load i32, i32* %7
%9 = add nsw i32 %8, 1899
%10 = call i64 @leap(i32 %9)
%11 = icmp eq i64 %10, 0
%12 = select i1 %11, i32 365, i32 366
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int i, j;
  if (i)
    goto l;
  if (j)
    goto l;
  assert(!i && !j);
l:;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     112e <main+0x1e>
jmp    1165 <main+0x55>
cmpl   $0x0,-0xc(%rbp)
je     113d <main+0x2d>
jmp    1165 <main+0x55>
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0xd(%rbp)
jne    1158 <main+0x48>
cmpl   $0x0,-0xc(%rbp)
setne  %al
xor    $0xff,%al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %0
br label %22
7: ; preds = %0
%8 = load i32, i32* %3
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %7
br label %22
11: ; preds = %7
%12 = load i32, i32* %2
%13 = icmp ne i32 %12, 0
br i1 %13, label %18, label %14
14: ; preds = %11
%15 = load i32, i32* %3
%16 = icmp ne i32 %15, 0
%17 = xor i1 %16, true
br label %18
18: ; preds = %14, %11
%19 = phi i1 [ false, %11 ], [ %17, %14 ]
%20 = zext i1 %19 to i32
%21 = call i32 @assert(i32 %20)
br label %22
22: ; preds = %18, %10, %6
%23 = load i32, i32* %1
ret i32 %23
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 0)
ret i32 0
}
/* Type definitions */
typedef int __le16;

/* Variables and functions */
int cpu_to_le16(int);
int ieee80211_is_back_req(__le16 fc) {
  return (fc & cpu_to_le16(0x000c | 0x00f0)) == cpu_to_le16(0x0004 | 0x0080);
}


x86 assembly (clang, -O0):
<ieee80211_is_back_req>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0xfc,%edi
call   1030 <cpu_to_le16@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
and    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    $0x84,%edi
call   1030 <cpu_to_le16@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ieee80211_is_back_req>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0xfc,%edi
call   1030 <cpu_to_le16@plt>
mov    %eax,%ebp
and    %ebx,%ebp
mov    $0x84,%edi
call   1030 <cpu_to_le16@plt>
xor    %ecx,%ecx
cmp    %eax,%ebp
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ieee80211_is_back_req(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @cpu_to_le16(i32 252)
%5 = and i32 %3, %4
%6 = call i32 @cpu_to_le16(i32 132)
%7 = icmp eq i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @ieee80211_is_back_req(i32 %0) {
%2 = tail call i32 @cpu_to_le16(i32 252)
%3 = and i32 %2, %0
%4 = tail call i32 @cpu_to_le16(i32 132)
%5 = icmp eq i32 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ ESMUMPSF(int const *const, int const *const, int *const,
                            int const *const, int *const, int *const,
                            int *const, int *const, int *const, int *const);
void esmumpsf__(const int *const n, const int *const iwlen, int *const petab,
                const int *const pfree, int *const lentab, int *const iwtab,
                int *const nvtab, int *const elentab, int *const lasttab,
                int *const ncmpa) {
  ESMUMPSF(n, iwlen, petab, pfree, lentab, iwtab, nvtab, elentab, lasttab,
           ncmpa);
}


x86 assembly (clang, -O0):
<esmumpsf__>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x58,%rsp
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x30(%rbp),%r8
mov    -0x38(%rbp),%r9
mov    0x10(%rbp),%rbx
mov    0x18(%rbp),%r11
mov    0x20(%rbp),%r10
mov    0x28(%rbp),%rax
mov    %rbx,(%rsp)
mov    %r11,0x8(%rsp)
mov    %r10,0x10(%rsp)
mov    %rax,0x18(%rsp)
call   1030 <ESMUMPSF@plt>
add    $0x58,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<esmumpsf__>:
jmp    1030 <ESMUMPSF@plt>

LLVM IR (-O0):
define void @esmumpsf__(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4, i32* %5, i32* %6, i32* %7, i32* %8, i32* %9) {
%11 = alloca i32*
%12 = alloca i32*
%13 = alloca i32*
%14 = alloca i32*
%15 = alloca i32*
%16 = alloca i32*
%17 = alloca i32*
%18 = alloca i32*
%19 = alloca i32*
%20 = alloca i32*
store i32* %0, i32** %11
store i32* %1, i32** %12
store i32* %2, i32** %13
store i32* %3, i32** %14
store i32* %4, i32** %15
store i32* %5, i32** %16
store i32* %6, i32** %17
store i32* %7, i32** %18
store i32* %8, i32** %19
store i32* %9, i32** %20
%21 = load i32*, i32** %11
%22 = load i32*, i32** %12
%23 = load i32*, i32** %13
%24 = load i32*, i32** %14
%25 = load i32*, i32** %15
%26 = load i32*, i32** %16
%27 = load i32*, i32** %17
%28 = load i32*, i32** %18
%29 = load i32*, i32** %19
%30 = load i32*, i32** %20
%31 = call i32 @ESMUMPSF(i32* %21, i32* %22, i32* %23, i32* %24, i32* %25, i32* %26, i32* %27, i32* %28, i32* %29, i32* %30)
ret void
}

LLVM IR (-O2):
define void @esmumpsf__(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4, i32* %5, i32* %6, i32* %7, i32* %8, i32* %9) {
%11 = tail call i32 @ESMUMPSF(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4, i32* %5, i32* %6, i32* %7, i32* %8, i32* %9)
ret void
}
void rop3_69_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~S;
  stk2 = T & stk3;
  stk1 = *D | stk2;
  stk1 = ~stk1;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_69_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_69_1_0>:
mov    %esi,%eax
not    %al
and    %al,%dl
mov    (%rdi),%cl
or     %cl,%dl
not    %dl
and    %sil,%cl
and    %al,%dl
or     %cl,%dl
mov    %dl,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_69_1_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %5
%11 = zext i8 %10 to i32
%12 = xor i32 %11, -1
%13 = trunc i32 %12 to i8
store i8 %13, i8* %9
%14 = load i8, i8* %6
%15 = zext i8 %14 to i32
%16 = load i8, i8* %9
%17 = zext i8 %16 to i32
%18 = and i32 %15, %17
%19 = trunc i32 %18 to i8
store i8 %19, i8* %8
%20 = load i8*, i8** %4
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
%23 = load i8, i8* %8
%24 = zext i8 %23 to i32
%25 = or i32 %22, %24
%26 = trunc i32 %25 to i8
store i8 %26, i8* %7
%27 = load i8, i8* %7
%28 = zext i8 %27 to i32
%29 = xor i32 %28, -1
%30 = trunc i32 %29 to i8
store i8 %30, i8* %7
%31 = load i8, i8* %7
%32 = zext i8 %31 to i32
%33 = load i8, i8* %5
%34 = zext i8 %33 to i32
%35 = xor i32 %34, -1
%36 = and i32 %32, %35
%37 = load i8*, i8** %4
%38 = load i8, i8* %37
%39 = zext i8 %38 to i32
%40 = load i8, i8* %5
%41 = zext i8 %40 to i32
%42 = and i32 %39, %41
%43 = or i32 %36, %42
%44 = trunc i32 %43 to i8
%45 = load i8*, i8** %4
store i8 %44, i8* %45
ret void
}

LLVM IR (-O2):
define void @rop3_69_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %1, -1
%5 = and i8 %4, %2
%6 = load i8, i8* %0
%7 = or i8 %6, %5
%8 = xor i8 %7, -1
%9 = and i8 %6, %1
%10 = and i8 %8, %4
%11 = or i8 %10, %9
store i8 %11, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ poly_test(char *, char *);
int /*<<< orphan*/ putchar(char);
int main(void) {
  poly_test("x^2 - 7x + 1", "3x + 2");
  putchar('\n');
  poly_test("x^10000000 + 2", "2x^2 + 3x + 4");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    0xed0(%rip),%rsi
call   1040 <poly_test@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xec1(%rip),%rdi
lea    0xec9(%rip),%rsi
call   1040 <poly_test@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xede(%rip),%rsi
call   1040 <poly_test@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xecf(%rip),%rdi
lea    0xed7(%rip),%rsi
call   1040 <poly_test@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"x^2 - 7x + 1\00"
@.str.1 = [7 x i8] c"3x + 2\00"
@.str.2 = [15 x i8] c"x^10000000 + 2\00"
@.str.3 = [14 x i8] c"2x^2 + 3x + 4\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @poly_test(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @putchar(i8 signext 10)
%4 = call i32 @poly_test(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"x^2 - 7x + 1\00"
@.str.1 = [7 x i8] c"3x + 2\00"
@.str.2 = [15 x i8] c"x^10000000 + 2\00"
@.str.3 = [14 x i8] c"2x^2 + 3x + 4\00"
define i32 @main() {
%1 = tail call i32 @poly_test(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @putchar(i8 signext 10)
%3 = tail call i32 @poly_test(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
cvGetSize() { printf("size()\n"); }


x86 assembly (clang, -O0):
<cvGetSize>:
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):
<cvGetSize>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [7 x i8] c"size()\00"
define i32 @cvGetSize() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int help() { printf("help\n"); }


x86 assembly (clang, -O0):
<help>:
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):
<help>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [5 x i8] c"help\00"
define i32 @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ disable_interrupt(int /*<<< orphan*/);
void pit_disable(void) { disable_interrupt(0); }


x86 assembly (clang, -O0):
<pit_disable>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <disable_interrupt@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pit_disable>:
xor    %edi,%edi
jmp    1030 <disable_interrupt@plt>

LLVM IR (-O0):
define void @pit_disable() {
%1 = call i32 @disable_interrupt(i32 0)
ret void
}

LLVM IR (-O2):
define void @pit_disable() {
%1 = tail call i32 @disable_interrupt(i32 0)
ret void
}
long char_putlinep(px0, py0, px1, py1, level)
long px0, py0, px1, py1;
long level;
{
  long char_setcursor(), char_putline();
  if (char_setcursor(px0, py0) == 0)
    return (0);
  if (char_putline(px1, py1, level) == 0)
    return (0);
  return (1);
}


x86 assembly (clang, -O0):
<char_putlinep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1040 <char_setcursor@plt>
cmp    $0x0,%rax
jne    1162 <char_putlinep+0x42>
movq   $0x0,-0x8(%rbp)
jmp    1194 <char_putlinep+0x74>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdx
mov    $0x0,%al
call   1030 <char_putline@plt>
cmp    $0x0,%rax
jne    118c <char_putlinep+0x6c>
movq   $0x0,-0x8(%rbp)
jmp    1194 <char_putlinep+0x74>
movq   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_putlinep>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %r8,%r14
mov    %rcx,%r15
mov    %rdx,%r12
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <char_setcursor@plt>
test   %rax,%rax
je     1157 <char_putlinep+0x37>
mov    %r12,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1030 <char_putline@plt>
xor    %ebx,%ebx
test   %rax,%rax
setne  %bl
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i64 @char_putlinep(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
store i64 %0, i64* %7
store i64 %1, i64* %8
store i64 %2, i64* %9
store i64 %3, i64* %10
store i64 %4, i64* %11
%12 = load i64, i64* %7
%13 = load i64, i64* %8
%14 = call i64 (i64, i64, ...) bitcast (i64 (...)* @char_setcursor to i64 (i64, i64, ...)*)(i64 %12, i64 %13)
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %5
store i64 0, i64* %6
br label %25
17: ; preds = %5
%18 = load i64, i64* %9
%19 = load i64, i64* %10
%20 = load i64, i64* %11
%21 = call i64 (i64, i64, i64, ...) bitcast (i64 (...)* @char_putline to i64 (i64, i64, i64, ...)*)(i64 %18, i64 %19, i64 %20)
%22 = icmp eq i64 %21, 0
br i1 %22, label %23, label %24
23: ; preds = %17
store i64 0, i64* %6
br label %25
24: ; preds = %17
store i64 1, i64* %6
br label %25
25: ; preds = %24, %23, %16
%26 = load i64, i64* %6
ret i64 %26
}

LLVM IR (-O2):
define i64 @char_putlinep(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = tail call i64 (i64, i64, ...) bitcast (i64 (...)* @char_setcursor to i64 (i64, i64, ...)*)(i64 %0, i64 %1)
%7 = icmp eq i64 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %5
%9 = tail call i64 (i64, i64, i64, ...) bitcast (i64 (...)* @char_putline to i64 (i64, i64, i64, ...)*)(i64 %2, i64 %3, i64 %4)
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i64
br label %12
12: ; preds = %8, %5
%13 = phi i64 [ 0, %5 ], [ %11, %8 ]
ret i64 %13
}
void iTIO_KillError(void) { return; }


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

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

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

LLVM IR (-O2):
define void @iTIO_KillError() {
ret void
}
/* Variables and functions */
int querycns(int, int, int, int /*<<< orphan*/, int /*<<< orphan*/ *);
int cmd_time(int argc, char **argv) {
  int r;
  if ((r = querycns((1 << 0), 0x001B, 0x01, 0, NULL)) <= 0)
    return r;
  if ((r = querycns((1 << 0), 0x1032, 0x01, 0, NULL)) <= 0)
    return r;
  return -1;
}


x86 assembly (clang, -O0):
<cmd_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%edx
mov    $0x1b,%esi
xor    %ecx,%ecx
xor    %eax,%eax
mov    %eax,%r8d
mov    %edx,%edi
call   1030 <querycns@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jg     114e <cmd_time+0x3e>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1184 <cmd_time+0x74>
mov    $0x1,%edx
mov    $0x1032,%esi
xor    %ecx,%ecx
xor    %eax,%eax
mov    %eax,%r8d
mov    %edx,%edi
call   1030 <querycns@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jg     117d <cmd_time+0x6d>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1184 <cmd_time+0x74>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_time>:
push   %rax
mov    $0x1,%edi
mov    $0x1b,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <querycns@plt>
test   %eax,%eax
jle    1153 <cmd_time+0x43>
mov    $0x1,%edi
mov    $0x1032,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <querycns@plt>
mov    %eax,%ecx
test   %eax,%eax
mov    $0xffffffff,%eax
cmovle %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @cmd_time(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @querycns(i32 1, i32 27, i32 1, i32 0, i32* null)
%4 = icmp slt i32 %3, 1
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 @querycns(i32 1, i32 4146, i32 1, i32 0, i32* null)
%7 = icmp slt i32 %6, 1
%8 = select i1 %7, i32 %6, i32 -1
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ %3, %2 ], [ %8, %5 ]
ret i32 %10
}
/* Variables and functions */
unsigned long ntohl(unsigned long);
unsigned long network_long_to_host(unsigned long x) { return ntohl(x); }


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

x86 assembly (clang, -O2):
<network_long_to_host>:
jmp    1030 <ntohl@plt>

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

LLVM IR (-O2):
define i64 @network_long_to_host(i64 %0) {
%2 = tail call i64 @ntohl(i64 %0)
ret i64 %2
}
void RTLockValidatorRecSharedAddOwner(void) {}


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

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

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

LLVM IR (-O2):
define void @RTLockValidatorRecSharedAddOwner() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, int, int);
char *get_item_field_name(int class_num, int field_num, int item_num) {
  static char name[32];
  sprintf(name, "I_FNAM%d.%d.%d", class_num, field_num, item_num);
  return name;
}


x86 assembly (clang, -O0):
<get_item_field_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%r8d
lea    0x2f0e(%rip),%rdi
lea    0xec7(%rip),%rsi
call   1030 <sprintf@plt>
lea    0x2efb(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_item_field_name>:
push   %rbx
mov    %edx,%r8d
mov    %esi,%ecx
mov    %edi,%edx
lea    0x2f21(%rip),%rbx
lea    0xeda(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@get_item_field_name.name = internal global [32 x i8] zeroinitializer
@.str = [15 x i8] c"I_FNAM%d.%d.%d\00"
define i8* @get_item_field_name(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @sprintf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @get_item_field_name.name, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8, i32 %9)
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @get_item_field_name.name, i64 0, i64 0)
}

LLVM IR (-O2):
@get_item_field_name.name = internal global [32 x i8] zeroinitializer
@.str = [15 x i8] c"I_FNAM%d.%d.%d\00"
define i8* @get_item_field_name(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @get_item_field_name.name, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %2)
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @get_item_field_name.name, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int feof(int /*<<< orphan*/ *);
int getc(int /*<<< orphan*/ *);
int /*<<< orphan*/ ungetc(int const, int /*<<< orphan*/ *);
bool is_really_eof(FILE *input) {
  const int ch = getc(input);
  const bool real_eof = feof(input);
  (void)ungetc(ch, input);
  return real_eof;
}


x86 assembly (clang, -O0):
<is_really_eof>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <getc@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <feof@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1040 <ungetc@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_really_eof>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
call   1050 <getc@plt>
mov    %eax,%r14d
mov    %rbx,%rdi
call   1030 <feof@plt>
mov    %eax,%ebp
mov    %r14d,%edi
mov    %rbx,%rsi
call   1040 <ungetc@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @is_really_eof(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = call i32 @getc(i32* %5)
store i32 %6, i32* %3
%7 = load i32*, i32** %2
%8 = call i32 @feof(i32* %7)
store i32 %8, i32* %4
%9 = load i32, i32* %3
%10 = load i32*, i32** %2
%11 = call i32 @ungetc(i32 %9, i32* %10)
%12 = load i32, i32* %4
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_really_eof(i32* nocapture %0) {
%2 = tail call i32 @getc(i32* %0)
%3 = tail call i32 @feof(i32* %0)
%4 = tail call i32 @ungetc(i32 %2, i32* %0)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ CLOCK_SYS_GetSystemClockFreq();
uint32_t CLOCK_SYS_GetGpioFreq(uint32_t instance) {
  (void)instance;
  return CLOCK_SYS_GetSystemClockFreq();
}


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

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

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

LLVM IR (-O2):
define i32 @CLOCK_SYS_GetGpioFreq(i32 %0) {
%2 = tail call i32 (...) @CLOCK_SYS_GetSystemClockFreq()
ret i32 %2
}
int feed_device_null_query(void *const p_context,
                           unsigned short int *const p_columns,
                           unsigned short int *const p_rows) {
  (void)(p_context);
  (void)(p_columns);
  (void)(p_rows);
  return -1;
}


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

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

LLVM IR (-O0):
define i32 @feed_device_null_query(i8* %0, i16* %1, i16* %2) {
%4 = alloca i8*
%5 = alloca i16*
%6 = alloca i16*
store i8* %0, i8** %4
store i16* %1, i16** %5
store i16* %2, i16** %6
%7 = load i8*, i8** %4
%8 = load i16*, i16** %5
%9 = load i16*, i16** %6
ret i32 -1
}

LLVM IR (-O2):
define i32 @feed_device_null_query(i8* nocapture readnone %0, i16* nocapture readnone %1, i16* nocapture readnone %2) {
ret i32 -1
}
int floor_div(int dd, int dr) { return (dd / dr - (dd % dr < 0)); }


x86 assembly (clang, -O0):
<floor_div>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    -0xc(%rbp),%eax
cmp    $0x0,%edx
setl   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<floor_div>:
mov    %edi,%eax
cltd
idiv   %esi
sar    $0x1f,%edx
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @floor_div(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 = sdiv i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = srem i32 %8, %9
%11 = icmp slt i32 %10, 0
%12 = zext i1 %11 to i32
%13 = sub nsw i32 %7, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @floor_div(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
%4 = srem i32 %0, %1
%5 = ashr i32 %4, 31
%6 = add i32 %5, %3
ret i32 %6
}
int get_packages() {}


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

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

LLVM IR (-O0):
define i32 @get_packages() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @get_packages() {
ret i32 undef
}
/* Variables and functions */
int rename(char *, char *);
int ss_filemove(char *a, char *b) { return rename(a, b); }


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

x86 assembly (clang, -O2):
<ss_filemove>:
jmp    1030 <rename@plt>

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

LLVM IR (-O2):
define i32 @ss_filemove(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @rename(i8* %0, i8* %1)
ret i32 %3
}
getmnem(uid) { return ("mnemonic"); }


x86 assembly (clang, -O0):
<getmnem>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    0xef2(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [9 x i8] c"mnemonic\00"
define i32 @getmnem(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret i32 ptrtoint ([9 x i8]* @.str to i32)
}

LLVM IR (-O2):
@.str = [9 x i8] c"mnemonic\00"
define i32 @getmnem(i32 %0) {
ret i32 ptrtoint ([9 x i8]* @.str to i32)
}
int base5(int n) {
  int i = 1, n5 = 0;
  while (n != 0) {
    n5 += (n % 5) * i;
    n = (n - n % 5) / 5;
    i *= 10;
  }
  return n5;
}


x86 assembly (clang, -O0):
<base5>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1163 <base5+0x63>
mov    -0x4(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
imul   -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    -0x10(%rbp),%eax
sub    %edx,%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
imul   $0xa,-0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <base5+0x15>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<base5>:
test   %edi,%edi
je     1143 <base5+0x43>
mov    $0x1,%ecx
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
movslq %edi,%rdx
imul   $0x66666667,%rdx,%rdi
mov    %rdi,%rsi
shr    $0x3f,%rsi
sar    $0x21,%rdi
add    %esi,%edi
lea    (%rdi,%rdi,4),%r8d
mov    %edx,%esi
sub    %r8d,%esi
imul   %ecx,%esi
add    %esi,%eax
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
add    $0x4,%edx
cmp    $0x8,%edx
ja     1110 <base5+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @base5(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %8, %1
%6 = load i32, i32* %2
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %22
8: ; preds = %5
%9 = load i32, i32* %2
%10 = srem i32 %9, 5
%11 = load i32, i32* %3
%12 = mul nsw i32 %10, %11
%13 = load i32, i32* %4
%14 = add nsw i32 %13, %12
store i32 %14, i32* %4
%15 = load i32, i32* %2
%16 = load i32, i32* %2
%17 = srem i32 %16, 5
%18 = sub nsw i32 %15, %17
%19 = sdiv i32 %18, 5
store i32 %19, i32* %2
%20 = load i32, i32* %3
%21 = mul nsw i32 %20, 10
store i32 %21, i32* %3
br label %5
22: ; preds = %5
%23 = load i32, i32* %4
ret i32 %23
}

LLVM IR (-O2):
define i32 @base5(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %14, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %9, %3 ], [ 0, %1 ]
%5 = phi i32 [ %11, %3 ], [ 1, %1 ]
%6 = phi i32 [ %10, %3 ], [ %0, %1 ]
%7 = srem i32 %6, 5
%8 = mul nsw i32 %7, %5
%9 = add nsw i32 %4, %8
%10 = sdiv i32 %6, 5
%11 = mul nsw i32 %5, 10
%12 = add i32 %6, 4
%13 = icmp ult i32 %12, 9
br i1 %13, label %14, label %3
14: ; preds = %3, %1
%15 = phi i32 [ 0, %1 ], [ %9, %3 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: avromod [--codec=<compression codec>]\n"
                  "               [--block-size=<block size>]\n"
                  "               [<input avro file>]\n"
                  "                <output avro file>\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [159 x i8] c"Usage: avromod [--codec=<compression codec>]\0A [--block-size=<block size>]\0A [<input avro file>]\0A <output avro file>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([159 x i8], [159 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [159 x i8] c"Usage: avromod [--codec=<compression codec>]\0A [--block-size=<block size>]\0A [<input avro file>]\0A <output avro file>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([159 x i8], [159 x i8]* @.str, i64 0, i64 0))
ret void
}
float CubicEaseOut(float p) {
  float f = (p - 1);
  return f * f * f + 1;
}


x86 assembly (clang, -O0):
<CubicEaseOut>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xeea(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  0xec6(%rip),%xmm1
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<CubicEaseOut>:
addss  0xef8(%rip),%xmm0
movaps %xmm0,%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm1,%xmm0
addss  0xee9(%rip),%xmm0
ret

LLVM IR (-O0):
define float @CubicEaseOut(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = fsub float %4, 1.000000e+00
store float %5, float* %3
%6 = load float, float* %3
%7 = load float, float* %3
%8 = fmul float %6, %7
%9 = load float, float* %3
%10 = call float @llvm.fmuladd.f32(float %8, float %9, float 1.000000e+00)
ret float %10
}

LLVM IR (-O2):
define float @CubicEaseOut(float %0) {
%2 = fadd float %0, -1.000000e+00
%3 = fmul float %2, %2
%4 = tail call float @llvm.fmuladd.f32(float %3, float %2, float 1.000000e+00)
ret float %4
}
void g_param_value_validate() {}


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

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

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

LLVM IR (-O2):
define void @g_param_value_validate() {
ret void
}
unsigned long ICeilLog2(unsigned long a, unsigned long b) {
  return (a + (1 << b) - 1) >> b;
}


x86 assembly (clang, -O0):
<ICeilLog2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
movslq %ecx,%rcx
add    %rcx,%rax
sub    $0x1,%rax
mov    -0x10(%rbp),%rcx
shr    %cl,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ICeilLog2>:
mov    %rsi,%rcx
mov    $0x1,%eax
shl    %cl,%eax
cltq
add    %rdi,%rax
add    $0xffffffffffffffff,%rax
shr    %cl,%rax
ret

LLVM IR (-O0):
define i64 @ICeilLog2(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = trunc i64 %6 to i32
%8 = shl i32 1, %7
%9 = sext i32 %8 to i64
%10 = add i64 %5, %9
%11 = sub i64 %10, 1
%12 = load i64, i64* %4
%13 = lshr i64 %11, %12
ret i64 %13
}

LLVM IR (-O2):
define i64 @ICeilLog2(i64 %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = shl nuw i32 1, %3
%5 = sext i32 %4 to i64
%6 = add i64 %0, -1
%7 = add i64 %6, %5
%8 = lshr i64 %7, %1
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ list_test();
int main(int argc, char *argv[]) {
  list_test();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @list_test()
ret i32 0
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
int /*<<< orphan*/ basic_test(int);
int /*<<< orphan*/ cleanup_test();
int /*<<< orphan*/ init_test();
int log_write_end(int);
void write_one_sector_end(void) {
  ssize_t n;
  init_test();
  n = log_write_end(512);
  basic_test(n == 512);
  cleanup_test();
}


x86 assembly (clang, -O0):
<write_one_sector_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <init_test@plt>
mov    $0x200,%edi
call   1030 <log_write_end@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x200,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <basic_test@plt>
mov    $0x0,%al
call   1050 <cleanup_test@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_one_sector_end>:
push   %rax
xor    %eax,%eax
call   1060 <init_test@plt>
mov    $0x200,%edi
call   1030 <log_write_end@plt>
xor    %edi,%edi
cmp    $0x200,%eax
sete   %dil
call   1040 <basic_test@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <cleanup_test@plt>

LLVM IR (-O0):
define void @write_one_sector_end() {
%1 = alloca i32
%2 = call i32 (...) @init_test()
%3 = call i32 @log_write_end(i32 512)
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 512
%6 = zext i1 %5 to i32
%7 = call i32 @basic_test(i32 %6)
%8 = call i32 (...) @cleanup_test()
ret void
}

LLVM IR (-O2):
define void @write_one_sector_end() {
%1 = tail call i32 (...) @init_test()
%2 = tail call i32 @log_write_end(i32 512)
%3 = icmp eq i32 %2, 512
%4 = zext i1 %3 to i32
%5 = tail call i32 @basic_test(i32 %4)
%6 = tail call i32 (...) @cleanup_test()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GL_MODELVIEW;
int /*<<< orphan*/ GL_PROJECTION;
int /*<<< orphan*/ glMatrixMode(int /*<<< orphan*/);
int /*<<< orphan*/ glPopMatrix();
void resetPerspectiveProjection(void) {
  glMatrixMode(GL_PROJECTION);
  glPopMatrix();
  glMatrixMode(GL_MODELVIEW);
}


x86 assembly (clang, -O0):
<resetPerspectiveProjection>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
mov    $0x0,%al
call   1040 <glPopMatrix@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<resetPerspectiveProjection>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
xor    %eax,%eax
call   1040 <glPopMatrix@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1030 <glMatrixMode@plt>

LLVM IR (-O0):
@GL_PROJECTION = global i32 0
@GL_MODELVIEW = global i32 0
define void @resetPerspectiveProjection() {
%1 = load i32, i32* @GL_PROJECTION
%2 = call i32 @glMatrixMode(i32 %1)
%3 = call i32 (...) @glPopMatrix()
%4 = load i32, i32* @GL_MODELVIEW
%5 = call i32 @glMatrixMode(i32 %4)
ret void
}

LLVM IR (-O2):
@GL_PROJECTION = global i32 0
@GL_MODELVIEW = global i32 0
define void @resetPerspectiveProjection() {
%1 = load i32, i32* @GL_PROJECTION
%2 = tail call i32 @glMatrixMode(i32 %1)
%3 = tail call i32 (...) @glPopMatrix()
%4 = load i32, i32* @GL_MODELVIEW
%5 = tail call i32 @glMatrixMode(i32 %4)
ret void
}
int gca_cmp2_double(const void *aa, const void *bb, void *p) {
  (void)p;
  const double a = *(const double *)aa;
  const double b = *(const double *)bb;
  return (((a) > (b)) - ((b) > (a)));
}


x86 assembly (clang, -O0):
<gca_cmp2_double>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
ucomisd -0x28(%rbp),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
movsd  -0x28(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
seta   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gca_cmp2_double>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
xor    %eax,%eax
ucomisd %xmm1,%xmm0
seta   %al
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
seta   %cl
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @gca_cmp2_double(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca double
%8 = alloca double
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%9 = load i8*, i8** %6
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to double*
%12 = load double, double* %11
store double %12, double* %7
%13 = load i8*, i8** %5
%14 = bitcast i8* %13 to double*
%15 = load double, double* %14
store double %15, double* %8
%16 = load double, double* %7
%17 = load double, double* %8
%18 = fcmp ogt double %16, %17
%19 = zext i1 %18 to i32
%20 = load double, double* %8
%21 = load double, double* %7
%22 = fcmp ogt double %20, %21
%23 = zext i1 %22 to i32
%24 = sub nsw i32 %19, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @gca_cmp2_double(i8* nocapture %0, i8* nocapture %1, i8* nocapture readnone %2) {
%4 = bitcast i8* %0 to double*
%5 = load double, double* %4
%6 = bitcast i8* %1 to double*
%7 = load double, double* %6
%8 = fcmp ogt double %5, %7
%9 = zext i1 %8 to i32
%10 = fcmp ogt double %7, %5
%11 = sext i1 %10 to i32
%12 = add nsw i32 %11, %9
ret i32 %12
}