xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ putch(char const);
unsigned int put_cstr(const char *str) {
  unsigned int max = 2048;
  while (*str != '\0') {
    putch(*str);
    ++str;
    --max;
    if (max == 0) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<put_cstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x800,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     116f <put_cstr+0x5f>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <putch@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    116a <put_cstr+0x5a>
movl   $0x0,-0x4(%rbp)
jmp    1176 <put_cstr+0x66>
jmp    1123 <put_cstr+0x13>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_cstr>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %ebx,%ebx
nopl   0x0(%rax)
movzbl (%r14,%rbx,1),%eax
test   %al,%al
je     1141 <put_cstr+0x31>
movsbl %al,%edi
call   1030 <putch@plt>
add    $0x1,%rbx
cmp    $0x800,%ebx
jne    1120 <put_cstr+0x10>
xor    %eax,%eax
jmp    1146 <put_cstr+0x36>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @put_cstr(i8* nocapture %0) {
br label %2
2: ; preds = %7, %1
%3 = phi i8* [ %0, %1 ], [ %9, %7 ]
%4 = phi i32 [ 2048, %1 ], [ %10, %7 ]
%5 = load i8, i8* %3
%6 = icmp eq i8 %5, 0
br i1 %6, label %12, label %7
7: ; preds = %2
%8 = tail call i32 @putch(i8 signext %5)
%9 = getelementptr inbounds i8, i8* %3, i64 1
%10 = add nsw i32 %4, -1
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %2
12: ; preds = %2, %7
%13 = phi i32 [ 0, %7 ], [ 1, %2 ]
ret i32 %13
}
int main(argc, argv)
int argc;
char *argv[];
{
  while (yylex() != 0)
    ;
  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 <yylex@plt>
cmp    $0x0,%eax
je     113b <main+0x2b>
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <yylex@plt>
test   %eax,%eax
jne    1120 <main+0x10>
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
br label %6
6: ; preds = %9, %2
%7 = call i32 (...) @yylex()
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %6
br label %6
10: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i32 (...) @yylex()
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %3
6: ; preds = %3
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMR44_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMR44_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

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

LLVM IR (-O2):
define void @U_WMR44_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
__attribute__((no)) int bar(long long x) {
  long long y = (x >> 31LL) & 1LL;
  if (y == 0LL)
    return 0;
  return -1;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
sar    $0x1f,%rax
and    $0x1,%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    112f <bar+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    1136 <bar+0x36>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
movslq %edi,%rax
shr    $0x1f,%rax
ret

LLVM IR (-O0):
define i32 @bar(i64 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
%5 = load i64, i64* %3
%6 = ashr i64 %5, 31
%7 = and i64 %6, 1
store i64 %7, i64* %4
%8 = load i64, i64* %4
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 0, i32* %2
br label %12
11: ; preds = %1
store i32 -1, i32* %2
br label %12
12: ; preds = %11, %10
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @bar(i64 %0) {
%2 = shl i64 %0, 32
%3 = ashr i64 %2, 63
%4 = trunc i64 %3 to i32
ret i32 %4
}
void gribapiLibraryVersion(int *major_version, int *minor_version,
                           int *revision_version) {
  (*major_version) = 0;
  (*minor_version) = 0;
  (*revision_version) = 0;
}


x86 assembly (clang, -O0):
<gribapiLibraryVersion>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<gribapiLibraryVersion>:
movl   $0x0,(%rdi)
movl   $0x0,(%rsi)
movl   $0x0,(%rdx)
ret

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

LLVM IR (-O2):
define void @gribapiLibraryVersion(i32* nocapture writeonly %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
store i32 0, i32* %0
store i32 0, i32* %1
store i32 0, i32* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fpga_dma_write_bit(void *, int, int, int);
void fpga_dma_start_transfer(void *addr) {
  fpga_dma_write_bit(addr, 6, 0b0000000001000, 1);
}


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

x86 assembly (clang, -O2):
<fpga_dma_start_transfer>:
mov    $0x6,%esi
mov    $0x8,%edx
mov    $0x1,%ecx
jmp    1030 <fpga_dma_write_bit@plt>

LLVM IR (-O0):
define void @fpga_dma_start_transfer(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @fpga_dma_write_bit(i8* %3, i32 6, i32 8, i32 1)
ret void
}

LLVM IR (-O2):
define void @fpga_dma_start_transfer(i8* %0) {
%2 = tail call i32 @fpga_dma_write_bit(i8* %0, i32 6, i32 8, i32 1)
ret void
}
void d2i_PrivateKey_bio(void) {}


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

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

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

LLVM IR (-O2):
define void @d2i_PrivateKey_bio() {
ret void
}
int do_472() { return 472; }


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

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

LLVM IR (-O0):
define i32 @do_472() {
ret i32 472
}

LLVM IR (-O2):
define i32 @do_472() {
ret i32 472
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int open(char *, int /*<<< orphan*/);
int open_flv_file(char *in_flv_file) { return open(in_flv_file, O_RDONLY); }


x86 assembly (clang, -O0):
<open_flv_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
call   1030 <open@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_flv_file>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
jmp    1030 <open@plt>

LLVM IR (-O0):
@O_RDONLY = global i32 0
define i32 @open_flv_file(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @O_RDONLY
%5 = call i32 @open(i8* %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@O_RDONLY = global i32 0
define i32 @open_flv_file(i8* nocapture %0) {
%2 = load i32, i32* @O_RDONLY
%3 = tail call i32 @open(i8* %0, i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ ExtSelect(char *, char *, int /*<<< orphan*/);
void ExttMonthSelect(void) {
  ExtSelect("tMonth",
            "tMonth.uMonth,tMonth.cLabel,tMonth.uOwner,tMonth.uCreatedBy,"
            "tMonth.uCreatedDate,tMonth.uModBy,tMonth.uModDate",
            0);
}


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

x86 assembly (clang, -O2):
<ExttMonthSelect>:
lea    0xee9(%rip),%rdi
lea    0xee9(%rip),%rsi
xor    %edx,%edx
jmp    1030 <ExtSelect@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"tMonth\00"
@.str.1 = [110 x i8] c"tMonth.uMonth,tMonth.cLabel,tMonth.uOwner,tMonth.uCreatedBy,tMonth.uCreatedDate,tMonth.uModBy,tMonth.uModDate\00"
define void @ExttMonthSelect() {
%1 = call i32 @ExtSelect(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([110 x i8], [110 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"tMonth\00"
@.str.1 = [110 x i8] c"tMonth.uMonth,tMonth.cLabel,tMonth.uOwner,tMonth.uCreatedBy,tMonth.uCreatedDate,tMonth.uModBy,tMonth.uModDate\00"
define void @ExttMonthSelect() {
%1 = tail call i32 @ExtSelect(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([110 x i8], [110 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
void get_sysinfo(void) {
  int32_t param;
  int32_t pushed;
}


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

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

LLVM IR (-O0):
define void @get_sysinfo() {
%1 = alloca i32
%2 = alloca i32
ret void
}

LLVM IR (-O2):
define void @get_sysinfo() {
ret void
}
fib(n) {
  if (n <= 2)
    return 1;
  else
    return fib(n - 1) + fib(n - 2);
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jg     1131 <fib+0x21>
movl   $0x1,-0x4(%rbp)
jmp    1154 <fib+0x44>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fib@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%ebp
cmp    $0x3,%edi
jl     1145 <fib+0x35>
mov    %edi,%ebx
add    $0x2,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    -0x3(%rbx),%edi
call   1030 <fib@plt>
add    %eax,%ebp
add    $0xfffffffe,%ebx
cmp    $0x4,%ebx
ja     1130 <fib+0x20>
add    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fib(i32 %0) {
%2 = icmp slt i32 %0, 3
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -1
%7 = tail call i32 @fib(i32 %6)
%8 = add nsw i32 %4, -2
%9 = add nsw i32 %7, %5
%10 = icmp ult i32 %4, 5
br i1 %10, label %11, label %3
11: ; preds = %3
%12 = add i32 %9, 1
br label %13
13: ; preds = %11, %1
%14 = phi i32 [ 1, %1 ], [ %12, %11 ]
ret i32 %14
}
void RotatePlane() {}


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

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

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

LLVM IR (-O2):
define void @RotatePlane() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LoadData();
int /*<<< orphan*/ LoadLabs();
void LoadFiles(void) {
  LoadData();
  LoadLabs();
}


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

x86 assembly (clang, -O2):
<LoadFiles>:
push   %rax
xor    %eax,%eax
call   1040 <LoadData@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <LoadLabs@plt>

LLVM IR (-O0):
define void @LoadFiles() {
%1 = call i32 (...) @LoadData()
%2 = call i32 (...) @LoadLabs()
ret void
}

LLVM IR (-O2):
define void @LoadFiles() {
%1 = tail call i32 (...) @LoadData()
%2 = tail call i32 (...) @LoadLabs()
ret void
}
void ft_get_values(char **data, char **s1, char **s2) {
  *s1 = data[0];
  *s2 = data[1];
}


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

x86 assembly (clang, -O2):
<ft_get_values>:
mov    (%rdi),%rax
mov    %rax,(%rsi)
mov    0x8(%rdi),%rax
mov    %rax,(%rdx)
ret

LLVM IR (-O0):
define void @ft_get_values(i8** %0, i8** %1, i8** %2) {
%4 = alloca i8**
%5 = alloca i8**
%6 = alloca i8**
store i8** %0, i8*** %4
store i8** %1, i8*** %5
store i8** %2, i8*** %6
%7 = load i8**, i8*** %4
%8 = getelementptr inbounds i8*, i8** %7, i64 0
%9 = load i8*, i8** %8
%10 = load i8**, i8*** %5
store i8* %9, i8** %10
%11 = load i8**, i8*** %4
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = load i8**, i8*** %6
store i8* %13, i8** %14
ret void
}

LLVM IR (-O2):
define void @ft_get_values(i8** nocapture %0, i8** nocapture writeonly %1, i8** nocapture writeonly %2) {
%4 = load i8*, i8** %0
store i8* %4, i8** %1
%5 = getelementptr inbounds i8*, i8** %0, i64 1
%6 = load i8*, i8** %5
store i8* %6, i8** %2
ret void
}
/* Type definitions */
struct line_segments {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ init_line_segments(struct line_segments *);
int /*<<< orphan*/ trace_edges(unsigned char *, int, int,
                               struct line_segments *);
void get_line_segments(unsigned char *edgesImage, int width, int height,
                       struct line_segments *segments) {
  init_line_segments(segments);
  trace_edges(edgesImage, width, height, segments);
}


x86 assembly (clang, -O0):
<get_line_segments>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <init_line_segments@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
call   1040 <trace_edges@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_line_segments>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%rbx
mov    %edx,%r14d
mov    %esi,%r15d
mov    %rdi,%rbp
mov    %rcx,%rdi
call   1030 <init_line_segments@plt>
mov    %rbp,%rdi
mov    %r15d,%esi
mov    %r14d,%edx
mov    %rbx,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <trace_edges@plt>

LLVM IR (-O0):
%struct.line_segments = type { i32 }
define void @get_line_segments(i8* %0, i32 %1, i32 %2, %struct.line_segments* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca %struct.line_segments*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store %struct.line_segments* %3, %struct.line_segments** %8
%9 = load %struct.line_segments*, %struct.line_segments** %8
%10 = call i32 @init_line_segments(%struct.line_segments* %9)
%11 = load i8*, i8** %5
%12 = load i32, i32* %6
%13 = load i32, i32* %7
%14 = load %struct.line_segments*, %struct.line_segments** %8
%15 = call i32 @trace_edges(i8* %11, i32 %12, i32 %13, %struct.line_segments* %14)
ret void
}

LLVM IR (-O2):
%struct.line_segments = type { i32 }
define void @get_line_segments(i8* %0, i32 %1, i32 %2, %struct.line_segments* %3) {
%5 = tail call i32 @init_line_segments(%struct.line_segments* %3)
%6 = tail call i32 @trace_edges(i8* %0, i32 %1, i32 %2, %struct.line_segments* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ heapify(void **, int (*)(void const *, void const *), int,
                           int);
void buildHeap(void **ar, int (*cmp)(const void *, const void *), int n) {
  int i;
  for (i = n / 2 - 1; i >= 0; i--) {
    heapify(ar, cmp, i, n);
  }
}


x86 assembly (clang, -O0):
<buildHeap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
sub    $0x1,%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jl     115f <buildHeap+0x4f>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   1030 <heapify@plt>
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
jmp    1134 <buildHeap+0x24>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buildHeap>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    $0x2,%edx
jl     1148 <buildHeap+0x38>
mov    %edx,%ebp
mov    %rsi,%r14
mov    %rdi,%r15
mov    %edx,%ebx
shr    %ebx
add    $0x1,%ebx
nopl   0x0(%rax,%rax,1)
lea    -0x2(%rbx),%edx
mov    %r15,%rdi
mov    %r14,%rsi
mov    %ebp,%ecx
call   1030 <heapify@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1130 <buildHeap+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @buildHeap(i8** %0, i32 (i8*, i8*)* %1, i32 %2) {
%4 = icmp sgt i32 %2, 1
br i1 %4, label %5, label %12
5: ; preds = %3
%6 = lshr i32 %2, 1
br label %7
7: ; preds = %5, %7
%8 = phi i32 [ %9, %7 ], [ %6, %5 ]
%9 = add nsw i32 %8, -1
%10 = tail call i32 @heapify(i8** %0, i32 (i8*, i8*)* %1, i32 %9, i32 %2)
%11 = icmp ugt i32 %8, 1
br i1 %11, label %7, label %12
12: ; preds = %7, %3
ret void
}
unsigned hash(char *s) {
  unsigned val = 0;
  while (*s) {
    val = val * 103 + *s++;
  }
  return val;
}


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

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1124 <hash+0x24>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
imul   $0x67,%eax,%edx
movsbl %cl,%eax
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = mul i32 %6, 103
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = sext i8 %5 to i32
%11 = add i32 %8, %10
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %15
}
double fibonacci(int n) {
  double a = 0;
  double b = 1;
  while (n > 1) {
    double t = b;
    b = a + b;
    a = t;
    n--;
  }
  return b;
}


x86 assembly (clang, -O0):
<fibonacci>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xee9(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
cmpl   $0x1,-0x4(%rbp)
jle    1157 <fibonacci+0x57>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    111c <fibonacci+0x1c>
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibonacci>:
cmp    $0x2,%edi
jl     1139 <fibonacci+0x39>
add    $0x1,%edi
xorpd  %xmm1,%xmm1
movsd  0xeec(%rip),%xmm0
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movapd %xmm0,%xmm2
movapd %xmm1,%xmm0
addsd  %xmm2,%xmm0
add    $0xffffffff,%edi
movapd %xmm2,%xmm1
cmp    $0x2,%edi
ja     1120 <fibonacci+0x20>
ret
movsd  0xebf(%rip),%xmm0
ret

LLVM IR (-O0):
define double @fibonacci(i32 %0) {
%2 = alloca i32
%3 = alloca double
%4 = alloca double
%5 = alloca double
store i32 %0, i32* %2
store double 0.000000e+00, double* %3
store double 1.000000e+00, double* %4
br label %6
6: ; preds = %9, %1
%7 = load i32, i32* %2
%8 = icmp sgt i32 %7, 1
br i1 %8, label %9, label %17
9: ; preds = %6
%10 = load double, double* %4
store double %10, double* %5
%11 = load double, double* %3
%12 = load double, double* %4
%13 = fadd double %11, %12
store double %13, double* %4
%14 = load double, double* %5
store double %14, double* %3
%15 = load i32, i32* %2
%16 = add nsw i32 %15, -1
store i32 %16, i32* %2
br label %6
17: ; preds = %6
%18 = load double, double* %4
ret double %18
}

LLVM IR (-O2):
define double @fibonacci(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %10
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi double [ %7, %3 ], [ 1.000000e+00, %1 ]
%6 = phi double [ %5, %3 ], [ 0.000000e+00, %1 ]
%7 = fadd double %6, %5
%8 = add nsw i32 %4, -1
%9 = icmp ugt i32 %4, 2
br i1 %9, label %3, label %10
10: ; preds = %3, %1
%11 = phi double [ 1.000000e+00, %1 ], [ %7, %3 ]
ret double %11
}
/* Type definitions */
struct procstat_min {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
scalar_t__ readprocstat(int /*<<< orphan*/, struct procstat_min *);
int /*<<< orphan*/ samthread_tid();
int thread(void *arg) {
  struct procstat_min *stat = arg;
  if (readprocstat(samthread_tid(), stat)) {
    printf("Child failed readprocstat\n");
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<thread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <samthread_tid@plt>
mov    %eax,%edi
mov    -0x18(%rbp),%rsi
call   1050 <readprocstat@plt>
cmp    $0x0,%rax
je     1178 <thread+0x48>
lea    0xe99(%rip),%rdi
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    117f <thread+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <samthread_tid@plt>
mov    %eax,%edi
mov    %r14,%rsi
call   1050 <readprocstat@plt>
test   %rax,%rax
je     1160 <thread+0x30>
lea    0xeaa(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.procstat_min = type { i32 }
@.str = [27 x i8] c"Child failed readprocstat\0A\00"
define i32 @thread(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.procstat_min*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to %struct.procstat_min*
store %struct.procstat_min* %6, %struct.procstat_min** %4
%7 = call i32 (...) @samthread_tid()
%8 = load %struct.procstat_min*, %struct.procstat_min** %4
%9 = call i64 @readprocstat(i32 %7, %struct.procstat_min* %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %1
%12 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %2
br label %14
13: ; preds = %1
store i32 0, i32* %2
br label %14
14: ; preds = %13, %11
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
%struct.procstat_min = type { i32 }
@str = [26 x i8] c"Child failed readprocstat\00"
define i32 @thread(i8* %0) {
%2 = bitcast i8* %0 to %struct.procstat_min*
%3 = tail call i32 (...) @samthread_tid()
%4 = tail call i64 @readprocstat(i32 %3, %struct.procstat_min* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
br label %8
8: ; preds = %1, %6
%9 = phi i32 [ 1, %6 ], [ 0, %1 ]
ret i32 %9
}
/* Variables and functions */
void *memmove(void *, void const *, size_t);
void *mm_block_memmove(void *dest, const void *src, size_t n) {
  return memmove(dest, src, n);
}


x86 assembly (clang, -O0):
<mm_block_memmove>:
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    %rdi,-0x20(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memmove@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mm_block_memmove>:
jmp    1030 <memmove@plt>

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

LLVM IR (-O2):
define i8* @mm_block_memmove(i8* returned writeonly %0, i8* nocapture %1, i64 %2) {
tail call void @llvm.memmove.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 %1, i64 %2, i1 false)
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *strerror(int);
void fig08_34() { printf("%s\n", strerror(2)); }


x86 assembly (clang, -O0):
<fig08_34>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1040 <strerror@plt>
mov    %rax,%rsi
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fig08_34>:
push   %rax
mov    $0x2,%edi
call   1040 <strerror@plt>
lea    0xece(%rip),%rdi
mov    %rax,%rsi
pop    %rax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @fig08_34() {
%1 = tail call i8* @strerror(i32 2)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void message1() { printf("What's up doc?"); }


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"What's up doc?\00"
define void @message1() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"What's up doc?\00"
define void @message1() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ bc_is_branch(unsigned char);
int /*<<< orphan*/ bc_is_goto(unsigned char);
bool bc_branches_to_follower(unsigned char code) {
  return bc_is_branch(code) && !bc_is_goto(code);
}


x86 assembly (clang, -O0):
<bc_branches_to_follower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1040 <bc_is_branch@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
je     115d <bc_branches_to_follower+0x3d>
movzbl -0x1(%rbp),%edi
call   1030 <bc_is_goto@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bc_branches_to_follower>:
push   %rbx
mov    %edi,%ebx
call   1040 <bc_is_branch@plt>
test   %rax,%rax
je     1140 <bc_branches_to_follower+0x20>
movzbl %bl,%edi
call   1030 <bc_is_goto@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @bc_branches_to_follower(i8 zeroext %0) {
%2 = tail call i64 @bc_is_branch(i8 zeroext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @bc_is_goto(i8 zeroext %0)
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
void MDIOInit(unsigned int baseAddr, unsigned int mdioInputFreq,
              unsigned int mdioOutputFreq) {
  unsigned int clkDiv = (mdioInputFreq / mdioOutputFreq) - 1;
  (*((volatile unsigned int *)(baseAddr + (0x4)))) =
      ((clkDiv & (0x0000FFFFu)) | (0x40000000u) | (0x00100000u) |
       (0x00040000u));
}


x86 assembly (clang, -O0):
<MDIOInit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
xor    %edx,%edx
divl   -0xc(%rbp)
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%ecx
and    $0xffff,%ecx
or     $0x40000000,%ecx
or     $0x100000,%ecx
or     $0x40000,%ecx
mov    -0x4(%rbp),%eax
add    $0x4,%eax
mov    %eax,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<MDIOInit>:
mov    %edx,%ecx
mov    %esi,%eax
xor    %edx,%edx
div    %ecx
add    $0xffffffff,%eax
movzwl %ax,%eax
or     $0x40140000,%eax
add    $0x4,%edi
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @MDIOInit(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = udiv i32 %8, %9
%11 = sub i32 %10, 1
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = and i32 %12, 65535
%14 = or i32 %13, 1073741824
%15 = or i32 %14, 1048576
%16 = or i32 %15, 262144
%17 = load i32, i32* %4
%18 = add i32 %17, 4
%19 = zext i32 %18 to i64
%20 = inttoptr i64 %19 to i32*
store volatile i32 %16, i32* %20
ret void
}

LLVM IR (-O2):
define void @MDIOInit(i32 %0, i32 %1, i32 %2) {
%4 = udiv i32 %1, %2
%5 = add i32 %4, 65535
%6 = and i32 %5, 65535
%7 = or i32 %6, 1075052544
%8 = add i32 %0, 4
%9 = zext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
store volatile i32 %7, i32* %10
ret void
}
INI_Motif_io() { ; }


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

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

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

LLVM IR (-O2):
define i32 @INI_Motif_io() {
ret i32 undef
}
void initialize_arr(int *arr, int count) {
  for (int i = 0; i < count; ++i) {
    arr[i] = 0;
  }
}


x86 assembly (clang, -O0):
<initialize_arr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113b <initialize_arr+0x3b>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <initialize_arr+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initialize_arr>:
test   %esi,%esi
jle    1126 <initialize_arr+0x16>
push   %rax
mov    %esi,%edx
shl    $0x2,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @initialize_arr(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 = %15, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %18
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
store i32 0, i32* %14
br label %15
15: ; preds = %10
%16 = load i32, i32* %5
%17 = add nsw i32 %16, 1
store i32 %17, i32* %5
br label %6
18: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @initialize_arr(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = bitcast i32* %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 2
br label %8
8: ; preds = %4, %2
ret void
}
int toascii(int c) { return ((unsigned char)(c)&0x7f); }


x86 assembly (clang, -O0):
<toascii>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
movzbl %al,%eax
and    $0x7f,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @toascii(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = trunc i32 %3 to i8
%5 = zext i8 %4 to i32
%6 = and i32 %5, 127
ret i32 %6
}

LLVM IR (-O2):
define i32 @toascii(i32 %0) {
%2 = and i32 %0, 127
ret i32 %2
}
/* Variables and functions */
char toupper(unsigned char);
char toupper_c(char c) { return toupper((unsigned char)c); }


x86 assembly (clang, -O0):
<toupper_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <toupper@plt>
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper_c>:
movzbl %dil,%edi
jmp    1030 <toupper@plt>

LLVM IR (-O0):
define signext i8 @toupper_c(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call signext i8 @toupper(i8 zeroext %3)
ret i8 %4
}

LLVM IR (-O2):
define signext i8 @toupper_c(i8 signext %0) {
%2 = tail call signext i8 @toupper(i8 zeroext %0)
ret i8 %2
}
void xputc2(char **buff, char c) {
  if (0 && c == '\n')
    xputc2(buff, '\r');
  **buff = (unsigned char)c;
  (*buff)++;
  return;
}


x86 assembly (clang, -O0):
<xputc2>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<xputc2>:
mov    (%rdi),%rax
mov    %sil,(%rax)
addq   $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @xputc2(i8** %0, i8 signext %1) {
%3 = alloca i8**
%4 = alloca i8
store i8** %0, i8*** %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = load i8**, i8*** %3
%7 = load i8*, i8** %6
store i8 %5, i8* %7
%8 = load i8**, i8*** %3
%9 = load i8*, i8** %8
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %8
ret void
}

LLVM IR (-O2):
define void @xputc2(i8** nocapture %0, i8 signext %1) {
%3 = load i8*, i8** %0
store i8 %1, i8* %3
%4 = load i8*, i8** %0
%5 = getelementptr inbounds i8, i8* %4, i64 1
store i8* %5, i8** %0
ret void
}
/* Variables and functions */
size_t get_nchan_from_depth(int);
size_t burst_get_num_dispersions(size_t nfreq, float freq0, float delta_f,
                                 int depth) {
  return get_nchan_from_depth(depth);
}


x86 assembly (clang, -O0):
<burst_get_num_dispersions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <get_nchan_from_depth@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<burst_get_num_dispersions>:
mov    %esi,%edi
jmp    1030 <get_nchan_from_depth@plt>

LLVM IR (-O0):
define i64 @burst_get_num_dispersions(i64 %0, float %1, float %2, i32 %3) {
%5 = alloca i64
%6 = alloca float
%7 = alloca float
%8 = alloca i32
store i64 %0, i64* %5
store float %1, float* %6
store float %2, float* %7
store i32 %3, i32* %8
%9 = load i32, i32* %8
%10 = call i64 @get_nchan_from_depth(i32 %9)
ret i64 %10
}

LLVM IR (-O2):
define i64 @burst_get_num_dispersions(i64 %0, float %1, float %2, i32 %3) {
%5 = tail call i64 @get_nchan_from_depth(i32 %3)
ret i64 %5
}
/* Type definitions */
struct vec2i {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ vec2i_project(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                 int /*<<< orphan*/ *);
__attribute__((always_)) struct vec2i *
psvec2i_project(struct vec2i *result, struct vec2i *a, struct vec2i *b) {
  vec2i_project((int32_t *)result, (int32_t *)a, (int32_t *)b);
  return result;
}


x86 assembly (clang, -O0):
<psvec2i_project>:
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
call   1030 <vec2i_project@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psvec2i_project>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vec2i_project@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.vec2i = type { i32 }
define %struct.vec2i* @psvec2i_project(%struct.vec2i* %0, %struct.vec2i* %1, %struct.vec2i* %2) {
%4 = alloca %struct.vec2i*
%5 = alloca %struct.vec2i*
%6 = alloca %struct.vec2i*
store %struct.vec2i* %0, %struct.vec2i** %4
store %struct.vec2i* %1, %struct.vec2i** %5
store %struct.vec2i* %2, %struct.vec2i** %6
%7 = load %struct.vec2i*, %struct.vec2i** %4
%8 = bitcast %struct.vec2i* %7 to i32*
%9 = load %struct.vec2i*, %struct.vec2i** %5
%10 = bitcast %struct.vec2i* %9 to i32*
%11 = load %struct.vec2i*, %struct.vec2i** %6
%12 = bitcast %struct.vec2i* %11 to i32*
%13 = call i32 @vec2i_project(i32* %8, i32* %10, i32* %12)
%14 = load %struct.vec2i*, %struct.vec2i** %4
ret %struct.vec2i* %14
}

LLVM IR (-O2):
%struct.vec2i = type { i32 }
define %struct.vec2i* @psvec2i_project(%struct.vec2i* returned %0, %struct.vec2i* %1, %struct.vec2i* %2) {
%4 = getelementptr %struct.vec2i, %struct.vec2i* %0, i64 0, i32 0
%5 = getelementptr %struct.vec2i, %struct.vec2i* %1, i64 0, i32 0
%6 = getelementptr %struct.vec2i, %struct.vec2i* %2, i64 0, i32 0
%7 = tail call i32 @vec2i_project(i32* %4, i32* %5, i32* %6)
ret %struct.vec2i* %0
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int copy_standard_Laurent_container_to_target_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(780, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<copy_standard_Laurent_container_to_target_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x30c,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_standard_Laurent_container_to_target_system>:
mov    $0x30c,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @copy_standard_Laurent_container_to_target_system() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc4c(i32 780, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @copy_standard_Laurent_container_to_target_system() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 780, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t gvalue_hashInt(uint32_t i) {
  return (i | 64) ^ ((i >> 15) | (i << 17));
}


x86 assembly (clang, -O0):
<gvalue_hashInt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
or     $0x40,%eax
mov    -0x4(%rbp),%ecx
sar    $0xf,%ecx
mov    -0x4(%rbp),%edx
shl    $0x11,%edx
or     %edx,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gvalue_hashInt>:
mov    %edi,%ecx
or     $0x40,%ecx
mov    %edi,%eax
sar    $0xf,%eax
shl    $0x11,%edi
or     %edi,%eax
xor    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @gvalue_hashInt(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = or i32 %3, 64
%5 = load i32, i32* %2
%6 = ashr i32 %5, 15
%7 = load i32, i32* %2
%8 = shl i32 %7, 17
%9 = or i32 %6, %8
%10 = xor i32 %4, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @gvalue_hashInt(i32 %0) {
%2 = or i32 %0, 64
%3 = ashr i32 %0, 15
%4 = shl i32 %0, 17
%5 = or i32 %3, %4
%6 = xor i32 %5, %2
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ outb(int, int);
void mask_pic_interrupts(void) {
  outb(0xff, 0x21);
  outb(0xff, 0xa1);
}


x86 assembly (clang, -O0):
<mask_pic_interrupts>:
push   %rbp
mov    %rsp,%rbp
mov    $0xff,%edi
mov    $0x21,%esi
call   1030 <outb@plt>
mov    $0xff,%edi
mov    $0xa1,%esi
call   1030 <outb@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mask_pic_interrupts>:
push   %rax
mov    $0xff,%edi
mov    $0x21,%esi
call   1030 <outb@plt>
mov    $0xff,%edi
mov    $0xa1,%esi
pop    %rax
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @mask_pic_interrupts() {
%1 = call i32 @outb(i32 255, i32 33)
%2 = call i32 @outb(i32 255, i32 161)
ret void
}

LLVM IR (-O2):
define void @mask_pic_interrupts() {
%1 = tail call i32 @outb(i32 255, i32 33)
%2 = tail call i32 @outb(i32 255, i32 161)
ret void
}
void gtk_radio_menu_item_set_group() {}


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

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

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

LLVM IR (-O2):
define void @gtk_radio_menu_item_set_group() {
ret void
}
/* Variables and functions */
char **stb_getopt_param(int *, char **, char *);
char **stb_getopt(int *argc, char **argv) {
  return stb_getopt_param(argc, argv, "");
}


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

x86 assembly (clang, -O2):
<stb_getopt>:
lea    0xee9(%rip),%rdx
jmp    1030 <stb_getopt_param@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8** @stb_getopt(i32* %0, i8** %1) {
%3 = alloca i32*
%4 = alloca i8**
store i32* %0, i32** %3
store i8** %1, i8*** %4
%5 = load i32*, i32** %3
%6 = load i8**, i8*** %4
%7 = call i8** @stb_getopt_param(i32* %5, i8** %6, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i8** %7
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8** @stb_getopt(i32* %0, i8** %1) {
%3 = tail call i8** @stb_getopt_param(i32* %0, i8** %1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i8** %3
}
/* Variables and functions */
int /*<<< orphan*/ do_one_file(char *);
int main(int argc, char *argv[]) {
  int i;
  for (i = 1; i < argc; i++)
    do_one_file(argv[i]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1158 <main+0x48>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <do_one_file@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
cmp    $0x2,%edi
jl     1142 <main+0x32>
mov    %rsi,%r14
mov    %edi,%r15d
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r14,%rbx,8),%rdi
call   1030 <do_one_file@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 1, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i32 @do_one_file(i8* %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret i32 0
}