xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ putc(int, int /*<<< orphan*/ *);
void putshort(int val, FILE *f) {
  putc(val >> 8, f);
  putc(val & 0xff, f);
}


x86 assembly (clang, -O0):
<putshort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
sar    $0x8,%edi
mov    -0x10(%rbp),%rsi
call   1030 <putc@plt>
mov    -0x4(%rbp),%edi
and    $0xff,%edi
mov    -0x10(%rbp),%rsi
call   1030 <putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putshort>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
sar    $0x8,%edi
call   1030 <putc@plt>
movzbl %bpl,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <putc@plt>

LLVM IR (-O0):
define void @putshort(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 = ashr i32 %5, 8
%7 = load i32*, i32** %4
%8 = call i32 @putc(i32 %6, i32* %7)
%9 = load i32, i32* %3
%10 = and i32 %9, 255
%11 = load i32*, i32** %4
%12 = call i32 @putc(i32 %10, i32* %11)
ret void
}

LLVM IR (-O2):
define void @putshort(i32 %0, i32* nocapture %1) {
%3 = ashr i32 %0, 8
%4 = tail call i32 @putc(i32 %3, i32* %1)
%5 = and i32 %0, 255
%6 = tail call i32 @putc(i32 %5, i32* %1)
ret void
}
void _M2_termios_finish(void) {}


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

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

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

LLVM IR (-O2):
define void @_M2_termios_finish() {
ret void
}
int test_imm_FCuint8_mem(unsigned char *val) {
  return ((*val) & (0xFC << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_FCuint8_mem>:
cmpb   $0x4,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmovb  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_FCuint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp ult i8 %2, 4
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
scalar_t__ isupper(int);
int tolower(int);
maplow(int i) {
  if (isupper(i))
    i = tolower(i);
  return (i);
}


x86 assembly (clang, -O0):
<maplow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <isupper@plt>
cmp    $0x0,%rax
je     1148 <maplow+0x28>
mov    -0x4(%rbp),%edi
call   1030 <tolower@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<maplow>:
push   %rbx
mov    %edi,%ebx
call   1040 <isupper@plt>
test   %rax,%rax
je     1135 <maplow+0x15>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <tolower@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @maplow(i32 %0) {
%2 = tail call i64 @isupper(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @tolower(i32 %0)
br label %6
6: ; preds = %4, %1
%7 = phi i32 [ %5, %4 ], [ %0, %1 ]
ret i32 %7
}
void v9fs_uncache_page(struct inode *inode, struct page *page) {}


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

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

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

LLVM IR (-O2):
%struct.inode = type opaque
%struct.page = type opaque
define void @v9fs_uncache_page(%struct.inode* nocapture %0, %struct.page* nocapture %1) {
ret void
}
/* Variables and functions */
scalar_t__ memcmp(char const *, char const *, size_t);
size_t strlen(char const *);
int strnequal(const char *a, const char *b, size_t b_len) {
  return a && (strlen(a) == b_len) && (memcmp(a, b, b_len) == 0);
}


x86 assembly (clang, -O0):
<strnequal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x19(%rbp)
je     117a <strnequal+0x5a>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    -0x18(%rbp),%rcx
mov    %al,-0x19(%rbp)
jne    117a <strnequal+0x5a>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <memcmp@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strnequal>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
xor    %ebp,%ebp
test   %rdi,%rdi
je     1158 <strnequal+0x38>
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
call   1030 <strlen@plt>
cmp    %r14,%rax
jne    1158 <strnequal+0x38>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1040 <memcmp@plt>
xor    %ebp,%ebp
test   %rax,%rax
sete   %bpl
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @strnequal(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 = icmp ne i8* %7, null
br i1 %8, label %9, label %20
9: ; preds = %3
%10 = load i8*, i8** %4
%11 = call i64 @strlen(i8* %10)
%12 = load i64, i64* %6
%13 = icmp eq i64 %11, %12
br i1 %13, label %14, label %20
14: ; preds = %9
%15 = load i8*, i8** %4
%16 = load i8*, i8** %5
%17 = load i64, i64* %6
%18 = call i64 @memcmp(i8* %15, i8* %16, i64 %17)
%19 = icmp eq i64 %18, 0
br label %20
20: ; preds = %14, %9, %3
%21 = phi i1 [ false, %9 ], [ false, %3 ], [ %19, %14 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @strnequal(i8* %0, i8* %1, i64 %2) {
%4 = icmp eq i8* %0, null
br i1 %4, label %12, label %5
5: ; preds = %3
%6 = tail call i64 @strlen(i8* %0)
%7 = icmp eq i64 %6, %2
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = tail call i64 @memcmp(i8* %0, i8* %1, i64 %2)
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %8, %5, %3
%13 = phi i32 [ 0, %5 ], [ 0, %3 ], [ %11, %8 ]
ret i32 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ set_port(int /*<<< orphan*/, int /*<<< orphan*/, int, int);
void io_write_port(uint8_t port, uint8_t value) {
  set_port(port, value, 0x12, 0x13);
}


x86 assembly (clang, -O0):
<io_write_port>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x12,%edx
mov    $0x13,%ecx
call   1030 <set_port@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<io_write_port>:
mov    $0x12,%edx
mov    $0x13,%ecx
jmp    1030 <set_port@plt>

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

LLVM IR (-O2):
define void @io_write_port(i32 %0, i32 %1) {
%3 = tail call i32 @set_port(i32 %0, i32 %1, i32 18, i32 19)
ret void
}
/* Variables and functions */
char *realloc(char *, int);
int strlen(char *);
char *append(char *s, char c) {
  int size = strlen(s);
  char *s1 = realloc(s, size + 1);
  s1[size] = c;
  return s1;
}


x86 assembly (clang, -O0):
<append>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
add    $0x1,%esi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x9(%rbp),%dl
mov    -0x18(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<append>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %eax,%ebp
lea    0x1(%rbp),%esi
mov    %rbx,%rdi
call   1040 <realloc@plt>
movslq %ebp,%rcx
mov    %r14b,(%rax,%rcx,1)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @append(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %3
store i8 %1, i8* %4
%7 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
store i32 %8, i32* %5
%9 = load i8*, i8** %3
%10 = load i32, i32* %5
%11 = add nsw i32 %10, 1
%12 = call i8* @realloc(i8* %9, i32 %11)
store i8* %12, i8** %6
%13 = load i8, i8* %4
%14 = load i8*, i8** %6
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
store i8 %13, i8* %17
%18 = load i8*, i8** %6
ret i8* %18
}

LLVM IR (-O2):
define i8* @append(i8* %0, i8 signext %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = add nsw i32 %3, 1
%5 = tail call i8* @realloc(i8* %0, i32 %4)
%6 = sext i32 %3 to i64
%7 = getelementptr inbounds i8, i8* %5, i64 %6
store i8 %1, i8* %7
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ fib(int);
int input();
int /*<<< orphan*/ output(int /*<<< orphan*/);
int main(void) {
  int n;
  int i;
  i = 0;
  n = input();
  while (i <= n) {
    output(fib(i));
    i = i + 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1030 <input@plt>
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1179 <main+0x49>
mov    -0xc(%rbp),%edi
call   1050 <fib@plt>
mov    %eax,%edi
call   1040 <output@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1150 <main+0x20>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <input@plt>
test   %eax,%eax
js     1165 <main+0x35>
mov    %eax,%ebp
add    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebx,%edi
call   1050 <fib@plt>
mov    %eax,%edi
call   1040 <output@plt>
add    $0x1,%ebx
cmp    %ebx,%ebp
jne    1150 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @input()
%2 = icmp slt i32 %1, 0
br i1 %2, label %9, label %3
3: ; preds = %0, %3
%4 = phi i32 [ %7, %3 ], [ 0, %0 ]
%5 = tail call i32 @fib(i32 %4)
%6 = tail call i32 @output(i32 %5)
%7 = add nuw i32 %4, 1
%8 = icmp eq i32 %4, %1
br i1 %8, label %9, label %3
9: ; preds = %3, %0
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
#define IPPROTO_TCP 129
#define IPPROTO_UDP 128
int ntohl(int /*<<< orphan*/);
const char *protoname(uint32_t proto) {
  switch (ntohl(proto)) {
  case IPPROTO_TCP:
    return "tcp";
  case IPPROTO_UDP:
    return "udp";
  default:
    return NULL;
  }
}


x86 assembly (clang, -O0):
<protoname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <ntohl@plt>
mov    %eax,%ecx
mov    %ecx,-0x10(%rbp)
sub    $0x80,%eax
je     115b <protoname+0x4b>
jmp    1138 <protoname+0x28>
mov    -0x10(%rbp),%eax
sub    $0x81,%eax
jne    116b <protoname+0x5b>
jmp    114b <protoname+0x3b>
lea    0xeae(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1173 <protoname+0x63>
lea    0xea2(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1173 <protoname+0x63>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<protoname>:
push   %rax
call   1030 <ntohl@plt>
xor    %ecx,%ecx
cmp    $0x80,%eax
lea    0xee0(%rip),%rdx
cmove  %rdx,%rcx
cmp    $0x81,%eax
lea    0xecc(%rip),%rax
cmovne %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"tcp\00"
@.str.1 = [4 x i8] c"udp\00"
define i8* @protoname(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 @ntohl(i32 %4)
switch i32 %5, label %8 [
i32 129, label %6
i32 128, label %7
]
6: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %2
br label %9
7: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %9
8: ; preds = %1
store i8* null, i8** %2
br label %9
9: ; preds = %8, %7, %6
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@.str = [4 x i8] c"tcp\00"
@.str.1 = [4 x i8] c"udp\00"
define i8* @protoname(i32 %0) {
%2 = tail call i32 @ntohl(i32 %0)
%3 = icmp eq i32 %2, 128
%4 = select i1 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* null
%5 = icmp eq i32 %2, 129
%6 = select i1 %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4
ret i8* %6
}
int fun157() { return 157; }


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

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

LLVM IR (-O0):
define i32 @fun157() {
ret i32 157
}

LLVM IR (-O2):
define i32 @fun157() {
ret i32 157
}
/* Variables and functions */
int /*<<< orphan*/ bigloo_initialize(int, char **, char **);
int /*<<< orphan*/ puts(char *);
int main(int argc, char *argv[], char *env[]) {
  puts("Before Bigloo init");
  bigloo_initialize(argc, argv, env);
  puts("After Bigloo stuff");
  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)
mov    %rdx,-0x18(%rbp)
lea    0xebf(%rip),%rdi
call   1030 <puts@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <bigloo_initialize@plt>
lea    0xeb6(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <bigloo_initialize@plt>
lea    0xec7(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Before Bigloo init\00"
@.str.1 = [19 x i8] c"After Bigloo stuff\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%8 = call i32 @puts(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* %5
%10 = load i8**, i8*** %6
%11 = load i8**, i8*** %7
%12 = call i32 @bigloo_initialize(i32 %9, i8** %10, i8** %11)
%13 = call i32 @puts(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"Before Bigloo init\00"
@.str.1 = [19 x i8] c"After Bigloo stuff\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @bigloo_initialize(i32 %0, i8** %1, i8** %2)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void printStrings(char *pointers[], int wordCount) {
  int i = 0;
  for (i = 0; i < wordCount; i++) {
    printf("%s\n", pointers[i]);
  }
}


x86 assembly (clang, -O0):
<printStrings>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115f <printStrings+0x4f>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112d <printStrings+0x1d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printStrings>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1145 <printStrings+0x35>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,8),%rsi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <printStrings+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define void @printStrings(i8** %0, i32 %1) {
%3 = alloca i8**
%4 = alloca i32
%5 = alloca i32
store i8** %0, i8*** %3
store i32 %1, i32* %4
store i32 0, i32* %5
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i8**, i8*** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8*, i8** %11, i64 %13
%15 = load i8*, i8** %14
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @printStrings(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), 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 void
}
int do_969() { return 969; }


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

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

LLVM IR (-O0):
define i32 @do_969() {
ret i32 969
}

LLVM IR (-O2):
define i32 @do_969() {
ret i32 969
}
/* Variables and functions */
int /*<<< orphan*/ alarm(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
void il_child(void) {
  printf("        child: I'm the child\n");
  alarm(2);
  sleep(4);
  printf("        child: I'm exiting\n");
}


x86 assembly (clang, -O0):
<il_child>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1040 <alarm@plt>
mov    $0x4,%edi
call   1050 <sleep@plt>
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<il_child>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x2,%edi
call   1040 <alarm@plt>
mov    $0x4,%edi
call   1050 <sleep@plt>
lea    0xec5(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [30 x i8] c" child: I'm the child\0A\00"
@.str.1 = [28 x i8] c" child: I'm exiting\0A\00"
define void @il_child() {
%1 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @alarm(i32 2)
%3 = call i32 @sleep(i32 4)
%4 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [29 x i8] c" child: I'm the child\00"
@str.2 = [27 x i8] c" child: I'm exiting\00"
define void @il_child() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @alarm(i32 2)
%3 = tail call i32 @sleep(i32 4)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.2, i64 0, i64 0))
ret void
}
int CountYear(long date) {
  int n = 0;
  date = (date - date % 10000) / 10000;
  n = (int)date;
  return (n);
}


x86 assembly (clang, -O0):
<CountYear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x2710,%ecx
cqto
idiv   %rcx
mov    -0x18(%rbp),%rax
sub    %rdx,%rax
mov    $0x2710,%ecx
cqto
idiv   %rcx
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CountYear>:
mov    %rdi,%rax
movabs $0x346dc5d63886594b,%rcx
c5 6d 34
imul   %rcx
mov    %rdx,%rax
shr    $0x3f,%rax
shr    $0xb,%rdx
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @CountYear(i64 %0) {
%2 = alloca i64
%3 = alloca i32
store i64 %0, i64* %2
store i32 0, i32* %3
%4 = load i64, i64* %2
%5 = load i64, i64* %2
%6 = srem i64 %5, 10000
%7 = sub nsw i64 %4, %6
%8 = sdiv i64 %7, 10000
store i64 %8, i64* %2
%9 = load i64, i64* %2
%10 = trunc i64 %9 to i32
store i32 %10, i32* %3
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @CountYear(i64 %0) {
%2 = sdiv i64 %0, 10000
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Variables and functions */
float sqrtf(float);
float dist(int ax, int ay, int bx, int by) {
  int x = ax - bx;
  int y = ay - by;
  return sqrtf((float)(x * x + y * y));
}


x86 assembly (clang, -O0):
<dist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
imul   -0x14(%rbp),%eax
mov    -0x18(%rbp),%ecx
imul   -0x18(%rbp),%ecx
add    %ecx,%eax
cvtsi2ss %eax,%xmm0
call   1030 <sqrtf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dist>:
sub    %edx,%edi
sub    %ecx,%esi
imul   %edi,%edi
imul   %esi,%esi
add    %edi,%esi
cvtsi2ss %esi,%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     112d <dist+0x1d>
sqrtss %xmm0,%xmm0
ret
jmp    1030 <sqrtf@plt>

LLVM IR (-O0):
define float @dist(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%11 = load i32, i32* %5
%12 = load i32, i32* %7
%13 = sub nsw i32 %11, %12
store i32 %13, i32* %9
%14 = load i32, i32* %6
%15 = load i32, i32* %8
%16 = sub nsw i32 %14, %15
store i32 %16, i32* %10
%17 = load i32, i32* %9
%18 = load i32, i32* %9
%19 = mul nsw i32 %17, %18
%20 = load i32, i32* %10
%21 = load i32, i32* %10
%22 = mul nsw i32 %20, %21
%23 = add nsw i32 %19, %22
%24 = sitofp i32 %23 to float
%25 = call float @sqrtf(float %24)
ret float %25
}

LLVM IR (-O2):
define float @dist(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = sub nsw i32 %0, %2
%6 = sub nsw i32 %1, %3
%7 = mul nsw i32 %5, %5
%8 = mul nsw i32 %6, %6
%9 = add nuw nsw i32 %8, %7
%10 = sitofp i32 %9 to float
%11 = tail call float @sqrtf(float %10)
ret float %11
}
/* Variables and functions */
float tanf(float);
float __glsl_tan(float angle) { return tanf(angle); }


x86 assembly (clang, -O0):
<__glsl_tan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <tanf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__glsl_tan>:
jmp    1030 <tanf@plt>

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

LLVM IR (-O2):
define float @__glsl_tan(float %0) {
%2 = tail call float @tanf(float %0)
ret float %2
}
main() {
  int sum;
  int a, b;
  a = 10;
  b = 20;
  sum = a + b;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0xa,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 10, i32* %2
store i32 20, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = add nsw i32 %4, %5
store i32 %6, i32* %1
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ POLLOUT;
int /*<<< orphan*/ daemon_poll_addfd(int, int /*<<< orphan*/);
void daemon_poll_addfd_write(int fd) { daemon_poll_addfd(fd, POLLOUT); }


x86 assembly (clang, -O0):
<daemon_poll_addfd_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ed3(%rip),%rax
mov    (%rax),%esi
call   1030 <daemon_poll_addfd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<daemon_poll_addfd_write>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%esi
jmp    1030 <daemon_poll_addfd@plt>

LLVM IR (-O0):
@POLLOUT = global i32 0
define void @daemon_poll_addfd_write(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @POLLOUT
%5 = call i32 @daemon_poll_addfd(i32 %3, i32 %4)
ret void
}

LLVM IR (-O2):
@POLLOUT = global i32 0
define void @daemon_poll_addfd_write(i32 %0) {
%2 = load i32, i32* @POLLOUT
%3 = tail call i32 @daemon_poll_addfd(i32 %0, i32 %2)
ret void
}
/* Type definitions */
typedef int time_t;

/* Variables and functions */
bool isLeapYear(time_t year) {
  return !(year % 4) && ((year % 100) || !(year % 400));
}


x86 assembly (clang, -O0):
<isLeapYear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
cmp    $0x0,%edx
mov    %al,-0x5(%rbp)
jne    1155 <isLeapYear+0x55>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    $0x1,%al
cmp    $0x0,%edx
mov    %al,-0x6(%rbp)
jne    114f <isLeapYear+0x4f>
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
setne  %al
xor    $0xff,%al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isLeapYear>:
xor    %eax,%eax
test   $0x3,%dil
je     1109 <isLeapYear+0x9>
ret
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb850,%ecx
mov    %ecx,%edx
ror    $0x2,%edx
mov    $0x1,%eax
cmp    $0x28f5c28,%edx
ja     1108 <isLeapYear+0x8>
ror    $0x4,%ecx
xor    %eax,%eax
cmp    $0xa3d70b,%ecx
setb   %al
ret

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

LLVM IR (-O2):
define i32 @isLeapYear(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = srem i32 %0, 100
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = srem i32 %0, 400
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %4, %7, %1
%12 = phi i32 [ 0, %1 ], [ 1, %4 ], [ %10, %7 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void msg_error_unknown_op() {
  printf("Error: unknown arithmetic operation.\n");
}


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

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

LLVM IR (-O0):
@.str = [38 x i8] c"Error: unknown arithmetic operation.\0A\00"
define void @msg_error_unknown_op() {
%1 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [37 x i8] c"Error: unknown arithmetic operation.\00"
define void @msg_error_unknown_op() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
ret void
}
void g_list_concat() {}


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

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

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

LLVM IR (-O2):
define void @g_list_concat() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sched_yield();
void _pthread_yield(void) { sched_yield(); }


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

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

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

LLVM IR (-O2):
define void @_pthread_yield() {
%1 = tail call i32 (...) @sched_yield()
ret void
}
int test_imm_62uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x62 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_62uint64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x20,%rdx
and    $0x62,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_62uint64_highword_reg>:
movabs $0x6200000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_62uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 420906795008
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int ssl_new(BIO *bio) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @ssl_new(i32* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void show_usage() {
  printf("Usage: ps2-packer [-h] [-v] [-a X] [-b X] "
         "[-p X] [-s X] "
         "<in_elf> <out_elf>\n"
         "    -h             show this help.\n"
         "    -v             verbose mode.\n"
         "    -b base        sets the loading base of the compressed data. "
         "When activated\n"
         "                     it will activate the alternative packing way.\n"
         "    -p packer      sets a packer name. lzma by default.\n"
         "    -s stub        sets another uncruncher stub. stub/lzma-1d00-stub "
         "by default,\n"
         "                     or stub/lzma-0088-stub when using alternative "
         "packing.\n"
         "    -a align       sets section alignment. 16 by default. Any value "
         "accepted.\n");
}


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

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

LLVM IR (-O0):
@.str = [582 x i8] c"Usage: ps2-packer [-h] [-v] [-a X] [-b X] [-p X] [-s X] <in_elf> <out_elf>\0A -h show this help.\0A -v verbose mode.\0A -b base sets the loading base of the compressed data. When activated\0A it will activate the alternative packing way.\0A -p packer sets a packer name. lzma by default.\0A -s stub sets another uncruncher stub. stub/lzma-1d00-stub by default,\0A or stub/lzma-0088-stub when using alternative packing.\0A -a align sets section alignment. 16 by default. Any value accepted.\0A\00"
define void @show_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([582 x i8], [582 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [581 x i8] c"Usage: ps2-packer [-h] [-v] [-a X] [-b X] [-p X] [-s X] <in_elf> <out_elf>\0A -h show this help.\0A -v verbose mode.\0A -b base sets the loading base of the compressed data. When activated\0A it will activate the alternative packing way.\0A -p packer sets a packer name. lzma by default.\0A -s stub sets another uncruncher stub. stub/lzma-1d00-stub by default,\0A or stub/lzma-0088-stub when using alternative packing.\0A -a align sets section alignment. 16 by default. Any value accepted.\00"
define void @show_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([581 x i8], [581 x i8]* @str, i64 0, i64 0))
ret void
}
void gtk_drag_unhighlight() {}


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

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

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

LLVM IR (-O2):
define void @gtk_drag_unhighlight() {
ret void
}
/* Variables and functions */
int abc_test();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ test_hello();
int main() {
  test_hello();
  printf("hello serv exec.%d\n", abc_test());
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_hello@plt>
xor    %eax,%eax
call   1050 <abc_test@plt>
lea    0xeba(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"hello serv exec.%d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_hello()
%3 = call i32 (...) @abc_test()
%4 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"hello serv exec.%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @test_hello()
%2 = tail call i32 (...) @abc_test()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}
int trailingZeroes(int n) { return n == 0 ? 0 : n / 5 + trailingZeroes(n / 5); }


x86 assembly (clang, -O0):
<trailingZeroes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    112f <trailingZeroes+0x1f>
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    1159 <trailingZeroes+0x49>
mov    -0x4(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <trailingZeroes@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trailingZeroes>:
xor    %eax,%eax
test   %edi,%edi
je     1131 <trailingZeroes+0x31>
cs nopw 0x0(%rax,%rax,1)
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x21,%rdi
add    %edx,%edi
add    %edi,%eax
add    $0x4,%ecx
cmp    $0x8,%ecx
ja     1110 <trailingZeroes+0x10>
ret

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

LLVM IR (-O2):
define i32 @trailingZeroes(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ %0, %1 ]
%5 = phi i32 [ %7, %3 ], [ 0, %1 ]
%6 = sdiv i32 %4, 5
%7 = add nsw i32 %6, %5
%8 = add i32 %4, 4
%9 = icmp ult i32 %8, 9
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %11
}
void ff_hevc_put_hevc_bi_w_pel_pixels16_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_w_pel_pixels16_10_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned long long);
int main(void) {
  unsigned long long ll_mac = 0xffffffffffffLL;
  printf("### %llu.\n", ll_mac);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
movabs $0xffffffffffff,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"### %llu.\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i64 281474976710655)
ret i32 0
}
int f(int x, int y) {
  int ret;
  if (x == y)
    ret = x ^ y;
  else
    ret = 1;
  return ret;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1124 <f+0x24>
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    112b <f+0x2b>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
xor    %eax,%eax
cmp    %esi,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @f(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 = load i32, i32* %4
%8 = icmp eq i32 %6, %7
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = xor i32 %10, %11
store i32 %12, i32* %5
br label %14
13: ; preds = %2
store i32 1, i32* %5
br label %14
14: ; preds = %13, %9
%15 = load i32, i32* %5
ret i32 %15
}

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1) {
%3 = icmp ne i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm_setzero_ps();
__m128 test_mm_setzero_ps() { return _mm_setzero_ps(); }


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

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

LLVM IR (-O0):
define i32 @test_mm_setzero_ps() {
%1 = call i32 (...) @_mm_setzero_ps()
ret i32 %1
}

LLVM IR (-O2):
define i32 @test_mm_setzero_ps() {
%1 = tail call i32 (...) @_mm_setzero_ps()
ret i32 %1
}
void ELMErrLocProcessingStart(unsigned int baseAddr) {
  (*((volatile unsigned int *)(baseAddr + (0x400 + ((6) * 4))))) =
      ((0x00010000u));
}


x86 assembly (clang, -O0):
<ELMErrLocProcessingStart>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x418,%eax
mov    %eax,%eax
movl   $0x10000,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ELMErrLocProcessingStart>:
add    $0x418,%edi
movl   $0x10000,(%rdi)
ret

LLVM IR (-O0):
define void @ELMErrLocProcessingStart(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 1048
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
store volatile i32 65536, i32* %6
ret void
}

LLVM IR (-O2):
define void @ELMErrLocProcessingStart(i32 %0) {
%2 = add i32 %0, 1048
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
store volatile i32 65536, i32* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pmmap_mark_all_unused();
void pmmap_init() { pmmap_mark_all_unused(); }


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

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

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

LLVM IR (-O2):
define void @pmmap_init() {
%1 = tail call i32 (...) @pmmap_mark_all_unused()
ret void
}
int blank_size(void *state, int type) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @blank_size(i8* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int write(int, void const *, size_t);
int do_write(int fd, const void *buf, size_t count) {
  return write(fd, buf, count);
}


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

x86 assembly (clang, -O2):
<do_write>:
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define i32 @do_write(i32 %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i64 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: mkfs.jffs -d root_directory [-a little|big] [-e "
                  "erase_size] [-o output_file] [-v[0-9]] [-q]\n");
  fprintf(stderr, "       By default, the file system is built using the same "
                  "endianness as the\n");
  fprintf(
      stderr,
      "       host.  If building for a different target, use the -a option.\n");
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf35(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf75(%rip),%rsi
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [100 x i8] c"Usage: mkfs.jffs -d root_directory [-a little|big] [-e erase_size] [-o output_file] [-v[0-9]] [-q]\0A\00"
@.str.1 = [78 x i8] c" By default, the file system is built using the same endianness as the\0A\00"
@.str.2 = [70 x i8] c" host. If building for a different target, use the -a option.\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([100 x i8], [100 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [100 x i8] c"Usage: mkfs.jffs -d root_directory [-a little|big] [-e erase_size] [-o output_file] [-v[0-9]] [-q]\0A\00"
@.str.1 = [78 x i8] c" By default, the file system is built using the same endianness as the\0A\00"
@.str.2 = [70 x i8] c" host. If building for a different target, use the -a option.\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([100 x i8], [100 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.2, i64 0, i64 0))
ret void
}
long simple_master_callback(struct AEffect *fx, long opcode, long index,
                            long value, void *ptr, float opt) {
  if (opcode == 1)
    return 2;
  else
    return 0;
}


x86 assembly (clang, -O0):
<simple_master_callback>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
movss  %xmm0,-0x34(%rbp)
cmpq   $0x1,-0x18(%rbp)
jne    1135 <simple_master_callback+0x35>
movq   $0x2,-0x8(%rbp)
jmp    113d <simple_master_callback+0x3d>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<simple_master_callback>:
xor    %eax,%eax
cmp    $0x1,%rsi
sete   %al
add    %rax,%rax
ret

LLVM IR (-O0):
%struct.AEffect = type opaque
define i64 @simple_master_callback(%struct.AEffect* %0, i64 %1, i64 %2, i64 %3, i8* %4, float %5) {
%7 = alloca i64
%8 = alloca %struct.AEffect*
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i8*
%13 = alloca float
store %struct.AEffect* %0, %struct.AEffect** %8
store i64 %1, i64* %9
store i64 %2, i64* %10
store i64 %3, i64* %11
store i8* %4, i8** %12
store float %5, float* %13
%14 = load i64, i64* %9
%15 = icmp eq i64 %14, 1
br i1 %15, label %16, label %17
16: ; preds = %6
store i64 2, i64* %7
br label %18
17: ; preds = %6
store i64 0, i64* %7
br label %18
18: ; preds = %17, %16
%19 = load i64, i64* %7
ret i64 %19
}

LLVM IR (-O2):
%struct.AEffect = type opaque
define i64 @simple_master_callback(%struct.AEffect* nocapture readnone %0, i64 %1, i64 %2, i64 %3, i8* nocapture readnone %4, float %5) {
%7 = icmp eq i64 %1, 1
%8 = select i1 %7, i64 2, i64 0
ret i64 %8
}