xunge/DecIR huggingface dataset:
/* Type definitions */
struct AddressBook {
  int dummy;
};

/* Variables and functions */
int AddressBook_write_delimited_to(struct AddressBook *, void *, int);
int write_raw_varint32(int, void *, int);
int AddressBook_write_with_tag(struct AddressBook *_AddressBook, void *_buffer,
                               int offset, int tag) {
  offset = write_raw_varint32((tag << 3) + 2, _buffer, offset);
  offset = AddressBook_write_delimited_to(_AddressBook, _buffer, offset);
  return offset;
}


x86 assembly (clang, -O0):
<AddressBook_write_with_tag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x18(%rbp),%edi
shl    $0x3,%edi
add    $0x2,%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <write_raw_varint32@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <AddressBook_write_delimited_to@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AddressBook_write_with_tag>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0x2(,%rcx,8),%edi
call   1040 <write_raw_varint32@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <AddressBook_write_delimited_to@plt>

LLVM IR (-O0):
%struct.AddressBook = type { i32 }
define i32 @AddressBook_write_with_tag(%struct.AddressBook* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca %struct.AddressBook*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store %struct.AddressBook* %0, %struct.AddressBook** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %8
%10 = shl i32 %9, 3
%11 = add nsw i32 %10, 2
%12 = load i8*, i8** %6
%13 = load i32, i32* %7
%14 = call i32 @write_raw_varint32(i32 %11, i8* %12, i32 %13)
store i32 %14, i32* %7
%15 = load %struct.AddressBook*, %struct.AddressBook** %5
%16 = load i8*, i8** %6
%17 = load i32, i32* %7
%18 = call i32 @AddressBook_write_delimited_to(%struct.AddressBook* %15, i8* %16, i32 %17)
store i32 %18, i32* %7
%19 = load i32, i32* %7
ret i32 %19
}

LLVM IR (-O2):
%struct.AddressBook = type { i32 }
define i32 @AddressBook_write_with_tag(%struct.AddressBook* %0, i8* %1, i32 %2, i32 %3) {
%5 = shl i32 %3, 3
%6 = or i32 %5, 2
%7 = tail call i32 @write_raw_varint32(i32 %6, i8* %1, i32 %2)
%8 = tail call i32 @AddressBook_write_delimited_to(%struct.AddressBook* %0, i8* %1, i32 %7)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ SoftwareAckLayerC__0__SubSend__ready();
void RFA1DriverLayerP__RadioSend__ready(void) {
  SoftwareAckLayerC__0__SubSend__ready();
}


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

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

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

LLVM IR (-O2):
define void @RFA1DriverLayerP__RadioSend__ready() {
%1 = tail call i32 (...) @SoftwareAckLayerC__0__SubSend__ready()
ret void
}
long CDRinit(void) { return 0; }


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

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

LLVM IR (-O0):
define i64 @CDRinit() {
ret i64 0
}

LLVM IR (-O2):
define i64 @CDRinit() {
ret i64 0
}
/* Variables and functions */
int yahoo_M1Common(unsigned int, int);
int yahoo_f01_0f(int Salt, int Parameter) {
  unsigned b = Salt ^ 0x2D3F30D3;
  return yahoo_M1Common(b, Parameter);
}


x86 assembly (clang, -O0):
<yahoo_f01_0f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    $0x2d3f30d3,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <yahoo_M1Common@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yahoo_f01_0f>:
xor    $0x2d3f30d3,%edi
jmp    1030 <yahoo_M1Common@plt>

LLVM IR (-O0):
define i32 @yahoo_f01_0f(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = xor i32 %6, 759115987
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = call i32 @yahoo_M1Common(i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @yahoo_f01_0f(i32 %0, i32 %1) {
%3 = xor i32 %0, 759115987
%4 = tail call i32 @yahoo_M1Common(i32 %3, i32 %1)
ret i32 %4
}
/* Variables and functions */
int rand();
short randomLocation() { return rand() % 4; }


x86 assembly (clang, -O0):
<randomLocation>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %dx,%ax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<randomLocation>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
lea    0x3(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xfffc,%ecx
sub    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define signext i16 @randomLocation() {
%1 = call i32 (...) @rand()
%2 = srem i32 %1, 4
%3 = trunc i32 %2 to i16
ret i16 %3
}

LLVM IR (-O2):
define signext i16 @randomLocation() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 4
%3 = trunc i32 %2 to i16
ret i16 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *const, void const *const);
void bfdebug_ptr(char const *const str, void const *const p) {
  printf("[BAREFLANK DEBUG] %s: %p\n", str, p);
}


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

x86 assembly (clang, -O2):
<bfdebug_ptr>:
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"[BAREFLANK DEBUG] %s: %p\0A\00"
define void @bfdebug_ptr(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 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"[BAREFLANK DEBUG] %s: %p\0A\00"
define void @bfdebug_ptr(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
int WIN32_Subsystem_Init(int *foo, char ***bar) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @WIN32_Subsystem_Init(i32* nocapture readnone %0, i8*** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
scalar_t__ islower(int);
scalar_t__ isupper(int);
int isalpha(int c) {
  if (isupper(c) || islower(c))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isalpha>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <isupper@plt>
cmp    $0x0,%rax
jne    114f <isalpha+0x2f>
mov    -0x8(%rbp),%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
je     115b <isalpha+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    1162 <isalpha+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isalpha>:
push   %rbx
mov    %edi,%ebx
call   1040 <isupper@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <isalpha+0x17>
pop    %rbx
ret
mov    %ebx,%edi
call   1030 <islower@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @isalpha(i32 %0) {
%2 = tail call i64 @isupper(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @islower(i32 %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ __NR_lseek;
int /*<<< orphan*/ syscall_3(int /*<<< orphan*/, long, long, int);
int fseek(FILE *fp, long offset, int whence) {
  syscall_3(__NR_lseek, (long int)fp, offset, whence);
  return 0;
}


x86 assembly (clang, -O0):
<fseek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
call   1030 <syscall_3@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fseek>:
push   %rax
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
call   1030 <syscall_3@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__NR_lseek = global i32 0
define i32 @fseek(i32* %0, i64 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i64
%6 = alloca i32
store i32* %0, i32** %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%7 = load i32, i32* @__NR_lseek
%8 = load i32*, i32** %4
%9 = ptrtoint i32* %8 to i64
%10 = load i64, i64* %5
%11 = load i32, i32* %6
%12 = call i32 @syscall_3(i32 %7, i64 %9, i64 %10, i32 %11)
ret i32 0
}

LLVM IR (-O2):
@__NR_lseek = global i32 0
define i32 @fseek(i32* %0, i64 %1, i32 %2) {
%4 = load i32, i32* @__NR_lseek
%5 = ptrtoint i32* %0 to i64
%6 = tail call i32 @syscall_3(i32 %4, i64 %5, i64 %1, i32 %2)
ret i32 0
}
int char_find(int idx, const char *s, char ch) {
  int i = idx;
  for (i = idx; s[i]; ++i) {
    if (s[i] == ch)
      break;
  }
  return i;
}


x86 assembly (clang, -O0):
<char_find>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     115e <char_find+0x5e>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    114b <char_find+0x4b>
jmp    115e <char_find+0x5e>
jmp    1150 <char_find+0x50>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    111c <char_find+0x1c>
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_find>:
movslq %edi,%rcx
lea    -0x1(%rcx),%eax
add    %rcx,%rsi
nopl   0x0(%rax)
movzbl (%rsi),%ecx
add    $0x1,%eax
test   %cl,%cl
je     1122 <char_find+0x22>
add    $0x1,%rsi
cmp    %dl,%cl
jne    1110 <char_find+0x10>
ret

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

LLVM IR (-O2):
define i32 @char_find(i32 %0, i8* nocapture %1, i8 signext %2) {
%4 = sext i32 %0 to i64
br label %5
5: ; preds = %5, %3
%6 = phi i64 [ %12, %5 ], [ %4, %3 ]
%7 = getelementptr inbounds i8, i8* %1, i64 %6
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 0
%10 = icmp eq i8 %8, %2
%11 = or i1 %9, %10
%12 = add i64 %6, 1
br i1 %11, label %13, label %5
13: ; preds = %5
%14 = trunc i64 %6 to i32
ret i32 %14
}
int isNewline(char c) {
  return c == '\n' || c == '\f' || c == '\r' || c == '\0';
}


x86 assembly (clang, -O0):
<isNewline>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xa,%ecx
mov    %al,-0x2(%rbp)
je     114d <isNewline+0x4d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xc,%ecx
mov    %al,-0x2(%rbp)
je     114d <isNewline+0x4d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xd,%ecx
mov    %al,-0x2(%rbp)
je     114d <isNewline+0x4d>
movsbl -0x1(%rbp),%eax
cmp    $0x0,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isNewline>:
cmp    $0xd,%dil
ja     111b <isNewline+0x1b>
mov    $0x1,%eax
movzbl %dil,%ecx
mov    $0x3400,%edx
bt     %rcx,%rdx
jae    111b <isNewline+0x1b>
ret
xor    %eax,%eax
test   %dil,%dil
sete   %al
ret

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

LLVM IR (-O2):
define i32 @isNewline(i8 signext %0) {
switch i8 %0, label %2 [
i8 13, label %5
i8 12, label %5
i8 10, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 0
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
void *Hunk_AllocName(int, char *);
void *Hunk_Alloc(int size) { return Hunk_AllocName(size, "unknown"); }


x86 assembly (clang, -O0):
<Hunk_Alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0xedb(%rip),%rsi
call   1030 <Hunk_AllocName@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Hunk_Alloc>:
lea    0xee9(%rip),%rsi
jmp    1030 <Hunk_AllocName@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"unknown\00"
define i8* @Hunk_Alloc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i8* @Hunk_AllocName(i32 %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %4
}

LLVM IR (-O2):
@.str = [8 x i8] c"unknown\00"
define i8* @Hunk_Alloc(i32 %0) {
%2 = tail call i8* @Hunk_AllocName(i32 %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
/* Type definitions */
typedef int ssize_t;
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ printf(char *);
int pwrite(int, char *, int, int /*<<< orphan*/);
void mfd_fail_grow_write(int fd) {
  static char buf[8192 * 8];
  ssize_t l;
  l = pwrite(fd, buf, sizeof(buf), 0);
  if (l == sizeof(buf)) {
    printf("pwrite() didn't fail as expected\n");
    abort();
  }
}


x86 assembly (clang, -O0):
<mfd_fail_grow_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0x2f0b(%rip),%rsi
mov    $0x10000,%edx
xor    %ecx,%ecx
call   1050 <pwrite@plt>
mov    %eax,-0x8(%rbp)
movslq -0x8(%rbp),%rax
cmp    $0x10000,%rax
jne    1177 <mfd_fail_grow_write+0x47>
lea    0xe95(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mfd_fail_grow_write>:
push   %rax
lea    0x2f18(%rip),%rsi
mov    $0x10000,%edx
xor    %ecx,%ecx
call   1050 <pwrite@plt>
cmp    $0x10000,%eax
je     114d <mfd_fail_grow_write+0x1d>
pop    %rax
ret
lea    0xeac(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@mfd_fail_grow_write.buf = internal global [65536 x i8] zeroinitializer
@.str = [34 x i8] c"pwrite() didn't fail as expected\0A\00"
define void @mfd_fail_grow_write(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @pwrite(i32 %4, i8* getelementptr inbounds ([65536 x i8], [65536 x i8]* @mfd_fail_grow_write.buf, i64 0, i64 0), i32 65536, i32 0)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = icmp eq i64 %7, 65536
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%11 = call i32 (...) @abort()
unreachable
12: ; preds = %1
ret void
}

LLVM IR (-O2):
@mfd_fail_grow_write.buf = internal global [65536 x i8] zeroinitializer
@str = [33 x i8] c"pwrite() didn't fail as expected\00"
define void @mfd_fail_grow_write(i32 %0) {
%2 = tail call i32 @pwrite(i32 %0, i8* getelementptr inbounds ([65536 x i8], [65536 x i8]* @mfd_fail_grow_write.buf, i64 0, i64 0), i32 65536, i32 0)
%3 = icmp eq i32 %2, 65536
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %1
ret void
}
void __cxa_guard_acquire(void) {}


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

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

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

LLVM IR (-O2):
define void @__cxa_guard_acquire() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __fpurge(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int scanf(char *, long *);
int /*<<< orphan*/ stdin;
void readLong2(long *variableAddress, char headerMessage[]) {
  bool ret;
  do {
    printf("%s", headerMessage);
    ret = scanf("\n%ld", variableAddress);
    __fpurge(stdin);
  } while (ret != true);
}


x86 assembly (clang, -O0):
<readLong2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xeb5(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xea8(%rip),%rdi
call   1050 <scanf@plt>
mov    %eax,-0x14(%rbp)
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
call   1030 <__fpurge@plt>
cmpl   $0x1,-0x14(%rbp)
jne    1140 <readLong2+0x10>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readLong2>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xeb8(%rip),%r15
lea    0xeb4(%rip),%r12
mov    0x2e92(%rip),%r13
cs nopw 0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %r14,%rsi
call   1040 <printf@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %eax,%ebp
mov    0x0(%r13),%edi
call   1030 <__fpurge@plt>
cmp    $0x1,%ebp
jne    1160 <readLong2+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [5 x i8] c"\0A%ld\00"
@stdin = global i32 0
define void @readLong2(i64* %0, i8* %1) {
%3 = alloca i64*
%4 = alloca i8*
%5 = alloca i32
store i64* %0, i64** %3
store i8* %1, i8** %4
br label %6
6: ; preds = %13, %2
%7 = load i8*, i8** %4
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = load i64*, i64** %3
%10 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64* %9)
store i32 %10, i32* %5
%11 = load i32, i32* @stdin
%12 = call i32 @__fpurge(i32 %11)
br label %13
13: ; preds = %6
%14 = load i32, i32* %5
%15 = icmp ne i32 %14, 1
br i1 %15, label %6, label %16
16: ; preds = %13
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [5 x i8] c"\0A%ld\00"
@stdin = global i32 0
define void @readLong2(i64* %0, i8* %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%5 = tail call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64* %0)
%6 = load i32, i32* @stdin
%7 = tail call i32 @__fpurge(i32 %6)
%8 = icmp eq i32 %5, 1
br i1 %8, label %9, label %3
9: ; preds = %3
ret void
}
int calculateHexCoordinates(int x, int y, int sizeBoard) {
  return sizeBoard * x + y;
}


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

x86 assembly (clang, -O2):
<calculateHexCoordinates>:
imul   %edx,%edi
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @calculateHexCoordinates(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* %6
%8 = load i32, i32* %4
%9 = mul nsw i32 %7, %8
%10 = load i32, i32* %5
%11 = add nsw i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @calculateHexCoordinates(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %2, %0
%5 = add nsw i32 %4, %1
ret i32 %5
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t ceil(uint64_t a, uint64_t b) { return (a + b - 1) / b; }


x86 assembly (clang, -O0):
<ceil>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
sub    $0x1,%eax
cltd
idivl  -0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceil>:
lea    (%rdi,%rsi,1),%eax
add    $0xffffffff,%eax
cltd
idiv   %esi
ret

LLVM IR (-O0):
define i32 @ceil(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 = add nsw i32 %5, %6
%8 = sub nsw i32 %7, 1
%9 = load i32, i32* %4
%10 = sdiv i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @ceil(i32 %0, i32 %1) {
%3 = add i32 %0, -1
%4 = add i32 %3, %1
%5 = sdiv i32 %4, %1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void ex1() {
  for (int x = 0; x < 256; x++) {
    printf("%3d || %c\n", x, x);
  }
}


x86 assembly (clang, -O0):
<ex1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x100,-0x4(%rbp)
jge    114c <ex1+0x3c>
mov    -0x4(%rbp),%esi
mov    -0x4(%rbp),%edx
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <ex1+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ex1>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x100,%ebx
jne    1120 <ex1+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [11 x i8] c"%3d || %c\0A\00"
define void @ex1() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %9, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 256
br i1 %4, label %5, label %12
5: ; preds = %2
%6 = load i32, i32* %1
%7 = load i32, i32* %1
%8 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
br label %9
9: ; preds = %5
%10 = load i32, i32* %1
%11 = add nsw i32 %10, 1
store i32 %11, i32* %1
br label %2
12: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"%3d || %c\0A\00"
define void @ex1() {
br label %2
1: ; preds = %2
ret void
2: ; preds = %0, %2
%3 = phi i32 [ 0, %0 ], [ %5, %2 ]
%4 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %3)
%5 = add nuw nsw i32 %3, 1
%6 = icmp eq i32 %5, 256
br i1 %6, label %1, label %2
}
/* Type definitions */
struct lfr_filter {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct lfr_filter *);
void lfr_filter_free(struct lfr_filter *fp) { free(fp); }


x86 assembly (clang, -O0):
<lfr_filter_free>:
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):
<lfr_filter_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.lfr_filter = type { i32 }
define void @lfr_filter_free(%struct.lfr_filter* %0) {
%2 = alloca %struct.lfr_filter*
store %struct.lfr_filter* %0, %struct.lfr_filter** %2
%3 = load %struct.lfr_filter*, %struct.lfr_filter** %2
%4 = call i32 @free(%struct.lfr_filter* %3)
ret void
}

LLVM IR (-O2):
%struct.lfr_filter = type { i32 }
define void @lfr_filter_free(%struct.lfr_filter* nocapture %0) {
%2 = tail call i32 @free(%struct.lfr_filter* %0)
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  unsigned long event;
};
struct TYPE_4__ {
  TYPE_1__ xcirculate;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xcirculate_event(void *_p, unsigned long _v) {
  ((XEvent *)_p)->xcirculate.event = (unsigned long)_v;
}


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

x86 assembly (clang, -O2):
<set_XEvent_xcirculate_event>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define void @set_XEvent_xcirculate_event(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i64 %5, i64* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xcirculate_event(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
int rand();
void fillRand(int arr[], size_t sz) {
  for (size_t i = 0; i < sz; i++)
    arr[i] = rand() % 100;
}


x86 assembly (clang, -O0):
<fillRand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1161 <fillRand+0x51>
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <fillRand+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fillRand>:
push   %r15
push   %r14
push   %rbx
test   %rsi,%rsi
je     115f <fillRand+0x4f>
mov    %rsi,%r15
mov    %rdi,%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <fillRand+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @fillRand(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
%5 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
store i64 0, i64* %5
br label %6
6: ; preds = %16, %2
%7 = load i64, i64* %5
%8 = load i64, i64* %4
%9 = icmp ult i64 %7, %8
br i1 %9, label %10, label %19
10: ; preds = %6
%11 = call i32 (...) @rand()
%12 = srem i32 %11, 100
%13 = load i32*, i32** %3
%14 = load i64, i64* %5
%15 = getelementptr inbounds i32, i32* %13, i64 %14
store i32 %12, i32* %15
br label %16
16: ; preds = %10
%17 = load i64, i64* %5
%18 = add i64 %17, 1
store i64 %18, i64* %5
br label %6
19: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @fillRand(i32* nocapture writeonly %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %4, label %5
4: ; preds = %5, %2
ret void
5: ; preds = %2, %5
%6 = phi i64 [ %10, %5 ], [ 0, %2 ]
%7 = tail call i32 (...) @rand()
%8 = srem i32 %7, 100
%9 = getelementptr inbounds i32, i32* %0, i64 %6
store i32 %8, i32* %9
%10 = add nuw i64 %6, 1
%11 = icmp eq i64 %10, %1
br i1 %11, label %4, label %5
}
int isupper(const int c) { return c >= 'A' && c <= 'Z'; }


x86 assembly (clang, -O0):
<isupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x41,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <isupper+0x20>
cmpl   $0x5a,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isupper>:
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 65
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 90
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @isupper(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
void remove_debug_files(struct imx21 *imx21) {}


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

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

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

LLVM IR (-O2):
%struct.imx21 = type opaque
define void @remove_debug_files(%struct.imx21* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Mensagem qualquer (aperte uma tecla para encerrar)...");
  getchar();
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [54 x i8] c"Mensagem qualquer (aperte uma tecla para encerrar)...\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [54 x i8] c"Mensagem qualquer (aperte uma tecla para encerrar)...\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @getchar()
ret i32 0
}
void g_object_steal_data() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @XBitmapUnit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ unlink(char const *);
int slate_UnlinkFile(const char *path) { return !unlink(path); }


x86 assembly (clang, -O0):
<slate_UnlinkFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <unlink@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<slate_UnlinkFile>:
push   %rax
call   1030 <unlink@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @slate_UnlinkFile(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @unlink(i8* %3)
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @slate_UnlinkFile(i8* nocapture %0) {
%2 = tail call i32 @unlink(i8* %0)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
int c090(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @c090() {
ret i32 0
}

LLVM IR (-O2):
define i32 @c090() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
void *malloc(int);
int /*<<< orphan*/ stderr;
void *malloc_or_die(int num_bytes) {
  void *rv = malloc(num_bytes);
  if (rv == 0) {
    fprintf(stderr, "malloc(%d) failed.\n", num_bytes);
    exit(1);
  }
  return rv;
}


x86 assembly (clang, -O0):
<malloc_or_die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1174 <malloc_or_die+0x44>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xe9b(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc_or_die>:
push   %rbx
mov    %edi,%ebx
call   1040 <malloc@plt>
test   %rax,%rax
je     113f <malloc_or_die+0xf>
pop    %rbx
ret
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
lea    0xeb1(%rip),%rsi
mov    %ebx,%edx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [20 x i8] c"malloc(%d) failed.\0A\00"
define i8* @malloc_or_die(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = load i32, i32* %2
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"malloc(%d) failed.\0A\00"
define noalias i8* @malloc_or_die(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %0)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret i8* %2
}
double roundaway(double x) {
  if (x < 0.)
    return x - 0.5;
  else
    return x + 0.5;
}


x86 assembly (clang, -O0):
<roundaway>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1132 <roundaway+0x32>
movsd  -0x10(%rbp),%xmm0
movsd  0xedc(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1144 <roundaway+0x44>
movsd  0xec6(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<roundaway>:
xorpd  %xmm1,%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
lea    0xeec(%rip),%rcx
addsd  (%rcx,%rax,8),%xmm0
ret

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

LLVM IR (-O2):
define double @roundaway(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = select i1 %2, double -5.000000e-01, double 5.000000e-01
%4 = fadd double %3, %0
ret double %4
}
/* Variables and functions */
scalar_t__ LINES;
int /*<<< orphan*/ mvprintw(scalar_t__, int /*<<< orphan*/, char *,
                            char const *);
void saywhat(const char *text) { mvprintw(LINES - 1, 0, "%-20.20s", text); }


x86 assembly (clang, -O0):
<saywhat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%rdi
sub    $0x1,%rdi
mov    -0x8(%rbp),%rcx
xor    %esi,%esi
lea    0xec9(%rip),%rdx
call   1030 <mvprintw@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<saywhat>:
mov    %rdi,%rcx
mov    0x2ece(%rip),%rax
mov    (%rax),%rdi
add    $0xffffffffffffffff,%rdi
lea    0xed8(%rip),%rdx
xor    %esi,%esi
jmp    1030 <mvprintw@plt>

LLVM IR (-O0):
@LINES = global i64 0
@.str = [9 x i8] c"%-20.20s\00"
define void @saywhat(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i64, i64* @LINES
%4 = sub nsw i64 %3, 1
%5 = load i8*, i8** %2
%6 = call i32 @mvprintw(i64 %4, i32 0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %5)
ret void
}

LLVM IR (-O2):
@LINES = global i64 0
@.str = [9 x i8] c"%-20.20s\00"
define void @saywhat(i8* %0) {
%2 = load i64, i64* @LINES
%3 = add nsw i64 %2, -1
%4 = tail call i32 @mvprintw(i64 %3, i32 0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
struct sockaddr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int bind(int sockfd, const struct sockaddr *addr, unsigned int addrlen) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<bind>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2ed3(%rip),%rax
mov    (%rax),%ecx
mov    0x2eba(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bind>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @bind(i32 %0, %struct.sockaddr* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.sockaddr*
%6 = alloca i32
store i32 %0, i32* %4
store %struct.sockaddr* %1, %struct.sockaddr** %5
store i32 %2, i32* %6
%7 = load i32, i32* @ENOSYS
store i32 %7, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @bind(i32 %0, %struct.sockaddr* nocapture readnone %1, i32 %2) {
%4 = load i32, i32* @ENOSYS
store i32 %4, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_version_details(const char *name, int alwaysprint) {
  if (alwaysprint) {
    printf("%s\n", " Thu May  7 08:43:38 PDT 2015  ");
  }
}


x86 assembly (clang, -O0):
<print_version_details>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     113c <print_version_details+0x2c>
lea    0xed0(%rip),%rdi
lea    0xecd(%rip),%rsi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_version_details>:
test   %esi,%esi
je     1127 <print_version_details+0x17>
lea    0xee5(%rip),%rdi
lea    0xee2(%rip),%rsi
jmp    1030 <printf@plt>
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [32 x i8] c" Thu May 7 08:43:38 PDT 2015 \00"
define void @print_version_details(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %7, %2
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [32 x i8] c" Thu May 7 08:43:38 PDT 2015 \00"
define void @print_version_details(i8* nocapture readnone %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %4, %2
ret void
}
void gtk_paint_slider() {}


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

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

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

LLVM IR (-O2):
define void @gtk_paint_slider() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
void outDouble(double *x) {
  if (x)
    printf("%.2f ", *x);
}


x86 assembly (clang, -O0):
<outDouble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113b <outDouble+0x2b>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outDouble>:
test   %rdi,%rdi
je     1125 <outDouble+0x15>
movsd  (%rdi),%xmm0
lea    0xee0(%rip),%rdi
jmp    1030 <printf@plt>
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%.2f \00"
define void @outDouble(double* %0) {
%2 = icmp eq double* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = load double, double* %0
%5 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %4)
br label %6
6: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put8(int);
void movsx_reg32_reg16(int reg32, int reg16) {
  put8(0x0F);
  put8(0xBF);
  put8((reg32 << 3) | reg16 | 0xC0);
}


x86 assembly (clang, -O0):
<movsx_reg32_reg16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0xf,%edi
call   1030 <put8@plt>
mov    $0xbf,%edi
call   1030 <put8@plt>
mov    -0x4(%rbp),%edi
shl    $0x3,%edi
or     -0x8(%rbp),%edi
or     $0xc0,%edi
call   1030 <put8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<movsx_reg32_reg16>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0xf,%edi
call   1030 <put8@plt>
mov    $0xbf,%edi
call   1030 <put8@plt>
shl    $0x3,%ebp
or     %ebx,%ebp
or     $0xc0,%ebp
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @movsx_reg32_reg16(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @put8(i32 15)
%6 = call i32 @put8(i32 191)
%7 = load i32, i32* %3
%8 = shl i32 %7, 3
%9 = load i32, i32* %4
%10 = or i32 %8, %9
%11 = or i32 %10, 192
%12 = call i32 @put8(i32 %11)
ret void
}

LLVM IR (-O2):
define void @movsx_reg32_reg16(i32 %0, i32 %1) {
%3 = tail call i32 @put8(i32 15)
%4 = tail call i32 @put8(i32 191)
%5 = shl i32 %0, 3
%6 = or i32 %5, %1
%7 = or i32 %6, 192
%8 = tail call i32 @put8(i32 %7)
ret void
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ printf(char *, int);
void divide(char *arg1, char *arg2) {
  int a, b;
  a = atoi(arg1);
  b = atoi(arg2);
  printf("%d\n", a / b);
}


x86 assembly (clang, -O0):
<divide>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cltd
idivl  -0x18(%rbp)
mov    %eax,%esi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<divide>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1040 <atoi@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <atoi@plt>
mov    %eax,%ecx
mov    %ebp,%eax
cltd
idiv   %ecx
lea    0xebd(%rip),%rdi
mov    %eax,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define void @divide(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = call i32 @atoi(i8* %7)
store i32 %8, i32* %5
%9 = load i8*, i8** %4
%10 = call i32 @atoi(i8* %9)
store i32 %10, i32* %6
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = sdiv i32 %11, %12
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %13)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @divide(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @atoi(i8* %0)
%4 = tail call i32 @atoi(i8* %1)
%5 = sdiv i32 %3, %4
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}
int LZ4_versionNumber(void) { return (1 * 100 * 100 + 9 * 100 + 2); }


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

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

LLVM IR (-O0):
define i32 @LZ4_versionNumber() {
ret i32 10902
}

LLVM IR (-O2):
define i32 @LZ4_versionNumber() {
ret i32 10902
}
void arch_perfc_printall(void) {}


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

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

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

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