xunge/DecIR huggingface dataset:
int execute_io_getevents() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_io_getevents() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
void usleep(int usec) { sleep(usec * 168); }


x86 assembly (clang, -O0):
<usleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
imul   $0xa8,-0x4(%rbp),%edi
call   1030 <sleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usleep>:
imul   $0xa8,%edi,%edi
jmp    1030 <sleep@plt>

LLVM IR (-O0):
define void @usleep(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 168
%5 = call i32 @sleep(i32 %4)
ret void
}

LLVM IR (-O2):
define void @usleep(i32 %0) {
%2 = mul nsw i32 %0, 168
%3 = tail call i32 @sleep(i32 %2)
ret void
}
void rotr(int *a, int *b, int *c) {
  int change = *a;
  *a = *c;
  *c = *b;
  *b = change;
}


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

x86 assembly (clang, -O2):
<rotr>:
mov    (%rdi),%eax
mov    (%rdx),%ecx
mov    %ecx,(%rdi)
mov    (%rsi),%ecx
mov    %ecx,(%rdx)
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @rotr(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
store i32 %9, i32* %7
%10 = load i32*, i32** %6
%11 = load i32, i32* %10
%12 = load i32*, i32** %4
store i32 %11, i32* %12
%13 = load i32*, i32** %5
%14 = load i32, i32* %13
%15 = load i32*, i32** %6
store i32 %14, i32* %15
%16 = load i32, i32* %7
%17 = load i32*, i32** %5
store i32 %16, i32* %17
ret void
}

LLVM IR (-O2):
define void @rotr(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2) {
%4 = load i32, i32* %0
%5 = load i32, i32* %2
store i32 %5, i32* %0
%6 = load i32, i32* %1
store i32 %6, i32* %2
store i32 %4, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void showUsage(char *prname) {
  printf("Usage: %s [-nrfd] [+fieldStart] [-fieldStop]\n", prname);
  exit(1);
}


x86 assembly (clang, -O0):
<showUsage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<showUsage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [46 x i8] c"Usage: %s [-nrfd] [+fieldStart] [-fieldStop]\0A\00"
define void @showUsage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [46 x i8] c"Usage: %s [-nrfd] [+fieldStart] [-fieldStop]\0A\00"
define void @showUsage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct inode {
  int dummy;
};
struct dentry {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pr_debug(char *, struct dentry *, int);
int vfs_whiteout(struct inode *, struct dentry *);
int ovl_do_whiteout_v2(struct inode *dir, struct dentry *dentry) {
  int err = vfs_whiteout(dir, dentry);
  pr_debug("whiteout(%pd2) = %i\n", dentry, err);
  return err;
}


x86 assembly (clang, -O0):
<ovl_do_whiteout_v2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <vfs_whiteout@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
lea    0xeb2(%rip),%rdi
call   1040 <pr_debug@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ovl_do_whiteout_v2>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1030 <vfs_whiteout@plt>
mov    %eax,%ebp
lea    0xecc(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <pr_debug@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.inode = type { i32 }
%struct.dentry = type { i32 }
@.str = [21 x i8] c"whiteout(%pd2) = %i\0A\00"
define i32 @ovl_do_whiteout_v2(%struct.inode* %0, %struct.dentry* %1) {
%3 = alloca %struct.inode*
%4 = alloca %struct.dentry*
%5 = alloca i32
store %struct.inode* %0, %struct.inode** %3
store %struct.dentry* %1, %struct.dentry** %4
%6 = load %struct.inode*, %struct.inode** %3
%7 = load %struct.dentry*, %struct.dentry** %4
%8 = call i32 @vfs_whiteout(%struct.inode* %6, %struct.dentry* %7)
store i32 %8, i32* %5
%9 = load %struct.dentry*, %struct.dentry** %4
%10 = load i32, i32* %5
%11 = call i32 @pr_debug(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), %struct.dentry* %9, i32 %10)
%12 = load i32, i32* %5
ret i32 %12
}

LLVM IR (-O2):
%struct.inode = type { i32 }
%struct.dentry = type { i32 }
@.str = [21 x i8] c"whiteout(%pd2) = %i\0A\00"
define i32 @ovl_do_whiteout_v2(%struct.inode* %0, %struct.dentry* %1) {
%3 = tail call i32 @vfs_whiteout(%struct.inode* %0, %struct.dentry* %1)
%4 = tail call i32 @pr_debug(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), %struct.dentry* %1, i32 %3)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void do_print(void) { printf("In the emk tutorial, part 1\n"); }


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

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

LLVM IR (-O0):
@.str = [29 x i8] c"In the emk tutorial, part 1\0A\00"
define void @do_print() {
%1 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [28 x i8] c"In the emk tutorial, part 1\00"
define void @do_print() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putc(char);
void _putchar(char c) { putc(c); }


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

x86 assembly (clang, -O2):
<_putchar>:
jmp    1030 <putc@plt>

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

LLVM IR (-O2):
define void @_putchar(i8 signext %0) {
%2 = tail call i32 @putc(i8 signext %0)
ret void
}
/* Variables and functions */
char *mkfn(char const *, char const *, char const *);
extern char *mksibfn(const char *name, const char *dir, const char *ext) {
  return mkfn(name, dir, ext);
}


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

x86 assembly (clang, -O2):
<mksibfn>:
jmp    1030 <mkfn@plt>

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

LLVM IR (-O2):
define i8* @mksibfn(i8* %0, i8* %1, i8* %2) {
%4 = tail call i8* @mkfn(i8* %0, i8* %1, i8* %2)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ strncmp(char const *, char const *, size_t);
int str_nequ(const char *s1, const char *s2, size_t n) {
  return (!strncmp(s1, s2, n));
}


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

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

LLVM IR (-O0):
define i32 @str_nequ(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @strncmp(i8* %7, i8* %8, i64 %9)
%11 = icmp ne i32 %10, 0
%12 = xor i1 %11, true
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @str_nequ(i8* nocapture %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @strncmp(i8* %0, i8* %1, i64 %2)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int O_NONBLOCK;
int O_RDWR;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int open(char *, int);
int /*<<< orphan*/ perror(char *);
int OpenCamera() {
  int fd;
  if ((fd = open("/dev/video0", O_RDWR | O_NONBLOCK)) < 0) {
    perror("Fail to open");
    exit(EXIT_FAILURE);
  }
  return fd;
}


x86 assembly (clang, -O0):
<OpenCamera>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
mov    0x2e98(%rip),%rax
or     (%rax),%esi
lea    0xeaf(%rip),%rdi
call   1030 <open@plt>
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
jge    117c <OpenCamera+0x4c>
lea    0xea3(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e5b(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OpenCamera>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    0x2ea1(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
lea    0xeb6(%rip),%rdi
call   1030 <open@plt>
test   %eax,%eax
js     1155 <OpenCamera+0x25>
pop    %rcx
ret
lea    0xeb0(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e68(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"/dev/video0\00"
@O_RDWR = global i32 0
@O_NONBLOCK = global i32 0
@.str.1 = [13 x i8] c"Fail to open\00"
@EXIT_FAILURE = global i32 0
define i32 @OpenCamera() {
%1 = alloca i32
%2 = load i32, i32* @O_RDWR
%3 = load i32, i32* @O_NONBLOCK
%4 = or i32 %2, %3
%5 = call i32 @open(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %4)
store i32 %5, i32* %1
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %0
%8 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%9 = load i32, i32* @EXIT_FAILURE
%10 = call i32 @exit(i32 %9)
unreachable
11: ; preds = %0
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@.str = [12 x i8] c"/dev/video0\00"
@O_RDWR = global i32 0
@O_NONBLOCK = global i32 0
@.str.1 = [13 x i8] c"Fail to open\00"
@EXIT_FAILURE = global i32 0
define i32 @OpenCamera() {
%1 = load i32, i32* @O_RDWR
%2 = load i32, i32* @O_NONBLOCK
%3 = or i32 %2, %1
%4 = tail call i32 @open(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = tail call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %0
ret i32 %4
}
/* Variables and functions */
int isalnum(int);
void test_alnum_symbolic2(int x) {
  if (x > 255) {
    int ret = isalnum(x);
    (void)ret;
  }
}


x86 assembly (clang, -O0):
<test_alnum_symbolic2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xff,-0x4(%rbp)
jle    1133 <test_alnum_symbolic2+0x23>
mov    -0x4(%rbp),%edi
call   1030 <isalnum@plt>
mov    %eax,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test_alnum_symbolic2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 255
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 @isalnum(i32 %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
br label %10
10: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
define void @test_alnum_symbolic2(i32 %0) {
ret void
}
/* Variables and functions */
#define F_RDLCK 130
#define F_UNLCK 129
#define F_WRLCK 128
short fuserl_l_type_canonicalize(short l_type) {
  switch (l_type) {
  case F_RDLCK:
    return 0;
  case F_WRLCK:
    return 1;
  case F_UNLCK:
    return 2;
  default:
    return 3;
  }
}


x86 assembly (clang, -O0):
<fuserl_l_type_canonicalize>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x4(%rbp)
movswl -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0x80,%eax
je     1153 <fuserl_l_type_canonicalize+0x53>
jmp    1122 <fuserl_l_type_canonicalize+0x22>
mov    -0x8(%rbp),%eax
sub    $0x81,%eax
je     115e <fuserl_l_type_canonicalize+0x5e>
jmp    1135 <fuserl_l_type_canonicalize+0x35>
mov    -0x8(%rbp),%eax
sub    $0x82,%eax
jne    1169 <fuserl_l_type_canonicalize+0x69>
jmp    1148 <fuserl_l_type_canonicalize+0x48>
movw   $0x0,-0x2(%rbp)
jmp    116f <fuserl_l_type_canonicalize+0x6f>
movw   $0x1,-0x2(%rbp)
jmp    116f <fuserl_l_type_canonicalize+0x6f>
movw   $0x2,-0x2(%rbp)
jmp    116f <fuserl_l_type_canonicalize+0x6f>
movw   $0x3,-0x2(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fuserl_l_type_canonicalize>:
add    $0xffffff80,%edi
mov    %edi,%ecx
shl    $0x4,%ecx
mov    $0x20001,%edx
shr    %cl,%rdx
cmp    $0x3,%edi
mov    $0x3,%eax
cmovb  %edx,%eax
ret

LLVM IR (-O0):
define signext i16 @fuserl_l_type_canonicalize(i16 signext %0) {
%2 = alloca i16
%3 = alloca i16
store i16 %0, i16* %3
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
switch i32 %5, label %9 [
i32 130, label %6
i32 128, label %7
i32 129, label %8
]
6: ; preds = %1
store i16 0, i16* %2
br label %10
7: ; preds = %1
store i16 1, i16* %2
br label %10
8: ; preds = %1
store i16 2, i16* %2
br label %10
9: ; preds = %1
store i16 3, i16* %2
br label %10
10: ; preds = %9, %8, %7, %6
%11 = load i16, i16* %2
ret i16 %11
}

LLVM IR (-O2):
define signext i16 @fuserl_l_type_canonicalize(i16 signext %0) {
%2 = sext i16 %0 to i32
%3 = add nsw i32 %2, -128
%4 = icmp ult i32 %3, 3
%5 = zext i32 %3 to i48
%6 = shl nuw nsw i48 %5, 4
%7 = lshr i48 131073, %6
%8 = trunc i48 %7 to i16
%9 = select i1 %4, i16 %8, i16 3
ret i16 %9
}
void window_cheats_emptysub() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @_asm_generic3parm_end() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void display_usrs() {
  fprintf(stderr, "-print-usrs options:\n"
                  " ObjCCategory <class name> <category name>\n"
                  " ObjCClass <class name>\n"
                  " ObjCIvar <ivar name> <class USR>\n"
                  " ObjCMethod <selector> [0=class method|1=instance method] "
                  "<class USR>\n"
                  " ObjCProperty <property name> <class USR>\n"
                  " ObjCProtocol <protocol name>\n");
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [265 x i8] c"-print-usrs options:\0A ObjCCategory <class name> <category name>\0A ObjCClass <class name>\0A ObjCIvar <ivar name> <class USR>\0A ObjCMethod <selector> [0=class method|1=instance method] <class USR>\0A ObjCProperty <property name> <class USR>\0A ObjCProtocol <protocol name>\0A\00"
define void @display_usrs() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([265 x i8], [265 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [265 x i8] c"-print-usrs options:\0A ObjCCategory <class name> <category name>\0A ObjCClass <class name>\0A ObjCIvar <ivar name> <class USR>\0A ObjCMethod <selector> [0=class method|1=instance method] <class USR>\0A ObjCProperty <property name> <class USR>\0A ObjCProtocol <protocol name>\0A\00"
define void @display_usrs() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([265 x i8], [265 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ indent();
int /*<<< orphan*/ stdout;
void affiche_texte(char *texte_, int trace_xml) {
  if (trace_xml) {
    indent();
    fprintf(stdout, "%s\n", texte_);
  }
}


x86 assembly (clang, -O0):
<affiche_texte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1159 <affiche_texte+0x39>
mov    $0x0,%al
call   1030 <indent@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xeac(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<affiche_texte>:
test   %esi,%esi
je     1148 <affiche_texte+0x28>
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <indent@plt>
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
lea    0xec1(%rip),%rsi
mov    %rbx,%rdx
pop    %rbx
jmp    1040 <fprintf@plt>
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @affiche_texte(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 %12
7: ; preds = %2
%8 = call i32 (...) @indent()
%9 = load i32, i32* @stdout
%10 = load i8*, i8** %3
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %10)
br label %12
12: ; preds = %7, %2
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @affiche_texte(i8* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = tail call i32 (...) @indent()
%6 = load i32, i32* @stdout
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %8
8: ; preds = %4, %2
ret void
}
/* Variables and functions */
int snprintf(char *, size_t, char *, char const *);
int rc_url_get_badge_image(char *buffer, size_t size, const char *badge_name) {
  int written = snprintf(buffer, size,
                         "http://i.retroachievements.org/Badge/%s", badge_name);
  return (size_t)written >= size ? -1 : 0;
}


x86 assembly (clang, -O0):
<rc_url_get_badge_image>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
lea    0xec9(%rip),%rdx
call   1030 <snprintf@plt>
mov    %eax,-0x1c(%rbp)
movslq -0x1c(%rbp),%rdx
mov    -0x10(%rbp),%rsi
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    %rsi,%rdx
cmovae %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rc_url_get_badge_image>:
push   %rbx
mov    %rdx,%rcx
mov    %rsi,%rbx
lea    0xee2(%rip),%rdx
call   1030 <snprintf@plt>
movslq %eax,%rcx
xor    %eax,%eax
cmp    %rbx,%rcx
adc    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [40 x i8] c"http://i.retroachievements.org/Badge/%s\00"
define i32 @rc_url_get_badge_image(i8* %0, i64 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
%7 = alloca i32
store i8* %0, i8** %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%8 = load i8*, i8** %4
%9 = load i64, i64* %5
%10 = load i8*, i8** %6
%11 = call i32 @snprintf(i8* %8, i64 %9, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = sext i32 %12 to i64
%14 = load i64, i64* %5
%15 = icmp uge i64 %13, %14
%16 = zext i1 %15 to i64
%17 = select i1 %15, i32 -1, i32 0
ret i32 %17
}

LLVM IR (-O2):
@.str = [40 x i8] c"http://i.retroachievements.org/Badge/%s\00"
define i32 @rc_url_get_badge_image(i8* %0, i64 %1, i8* %2) {
%4 = tail call i32 @snprintf(i8* %0, i64 %1, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %2)
%5 = sext i32 %4 to i64
%6 = icmp uge i64 %5, %1
%7 = sext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int errno;
void c_set_errno_(int *errc) { errno = *errc; }


x86 assembly (clang, -O0):
<c_set_errno_>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    0x2ecb(%rip),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_set_errno_>:
mov    (%rdi),%eax
mov    0x2ed7(%rip),%rcx
mov    %eax,(%rcx)
ret

LLVM IR (-O0):
@errno = global i32 0
define void @c_set_errno_(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
store i32 %4, i32* @errno
ret void
}

LLVM IR (-O2):
@errno = global i32 0
define void @c_set_errno_(i32* nocapture %0) {
%2 = load i32, i32* %0
store i32 %2, i32* @errno
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_mystruct();
int /*<<< orphan*/ test_password();
int main(int argc, char **argv) {
  test_password();
  test_mystruct();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_password()
%4 = tail call i32 (...) @test_mystruct()
ret i32 0
}
/* Type definitions */
struct dirent {
  int dummy;
};
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
struct dirent *_readdir_unlocked(int /*<<< orphan*/ *, int);
struct dirent *readdir(DIR *dirp) {
  struct dirent *dp;
  dp = _readdir_unlocked(dirp, 1);
  return (dp);
}


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

x86 assembly (clang, -O2):
<readdir>:
mov    $0x1,%esi
jmp    1030 <_readdir_unlocked@plt>

LLVM IR (-O0):
%struct.dirent = type { i32 }
define %struct.dirent* @readdir(i32* %0) {
%2 = alloca i32*
%3 = alloca %struct.dirent*
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call %struct.dirent* @_readdir_unlocked(i32* %4, i32 1)
store %struct.dirent* %5, %struct.dirent** %3
%6 = load %struct.dirent*, %struct.dirent** %3
ret %struct.dirent* %6
}

LLVM IR (-O2):
%struct.dirent = type { i32 }
define %struct.dirent* @readdir(i32* %0) {
%2 = tail call %struct.dirent* @_readdir_unlocked(i32* %0, i32 1)
ret %struct.dirent* %2
}
/* Type definitions */
struct timespec {
  double tv_sec;
  double tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_REALTIME;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
double get_time() {
  struct timespec ts;
  clock_gettime(CLOCK_REALTIME, &ts);
  return ts.tv_sec * 1000.0 + ts.tv_nsec / 1000000.0;
}


x86 assembly (clang, -O0):
<get_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  0xecc(%rip),%xmm2
divsd  %xmm2,%xmm1
movsd  0xeb8(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time>:
sub    $0x18,%rsp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
movsd  0x10(%rsp),%xmm1
divsd  0xecb(%rip),%xmm1
movsd  0x8(%rsp),%xmm0
mulsd  0xec5(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { double, double }
@CLOCK_REALTIME = global i32 0
define double @get_time() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_REALTIME
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%5 = load double, double* %4
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%7 = load double, double* %6
%8 = fdiv double %7, 1.000000e+06
%9 = call double @llvm.fmuladd.f64(double %5, double 1.000000e+03, double %8)
ret double %9
}

LLVM IR (-O2):
%struct.timespec = type { double, double }
@CLOCK_REALTIME = global i32 0
define double @get_time() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_REALTIME
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%6 = load double, double* %5
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%8 = load double, double* %7
%9 = fdiv double %8, 1.000000e+06
%10 = call double @llvm.fmuladd.f64(double %6, double 1.000000e+03, double %9)
ret double %10
}
int popcount3(int *array) {
  int i, numero, contador;
  for (i = 0; i < (1 << 20); i++) {
    numero = array[i];
    asm("movl	%[n],%%eax		\n"
        "			testl	%%eax,%%eax		\n"
        "			je		fin			"
        "	\n"
        "			movl	%[r],%%edx		\n"
        "bucle:								\n"
        "			movl	%%eax, %%ecx	\n"
        "			andl	$1, %%ecx		\n"
        "			addl	%%ecx, %%edx	\n"
        "			sarl	%%eax			\n"
        "			jnc		bucle			\n"
        "			movl	%%edx, %[r]		\n"
        "fin:								\n"
        : [r] "+r"(contador)
        : [n] "r"(numero));
  }
  return contador;
}


x86 assembly (clang, -O0):
<popcount3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x100000,-0xc(%rbp)
jge    115e <fin+0x11>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x10(%rbp),%ecx
mov    %ecx,%eax
test   %eax,%eax
je     114d <fin>
mov    %eax,%edx

x86 assembly (clang, -O2):
<popcount3>:
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%rdi,%rcx,4),%edx
mov    %edx,%eax
test   %eax,%eax
je     1128 <fin>
mov    %eax,%edx

LLVM IR (-O0):
define i32 @popcount3(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
br label %6
6: ; preds = %18, %1
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 1048576
br i1 %8, label %9, label %21
9: ; preds = %6
%10 = load i32*, i32** %2
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %10, i64 %12
%14 = load i32, i32* %13
store i32 %14, i32* %4
%15 = load i32, i32* %5
%16 = load i32, i32* %4
%17 = call i32 asm "movl\09$1,%eax\09\09\0A\09\09\09testl\09%eax,%eax\09\09\0A\09\09\09je\09\09fin\09\09\09\09\0A\09\09\09movl\09$0,%edx\09\09\0Abucle:\09\09\09\09\09\09\09\09\0A\09\09\09movl\09%eax, %ecx\09\0A\09\09\09andl\09$$1, %ecx\09\09\0A\09\09\09addl\09%ecx, %edx\09\0A\09\09\09sarl\09%eax\09\09\09\0A\09\09\09jnc\09\09bucle\09\09\09\0A\09\09\09movl\09%edx, $0\09\09\0Afin:\09\09\09\09\09\09\09\09\0A", "=r,r,0,~{dirflag},~{fpsr},~{flags}"(i32 %16, i32 %15)
store i32 %17, i32* %5
br label %18
18: ; preds = %9
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
br label %6
21: ; preds = %6
%22 = load i32, i32* %5
ret i32 %22
}

LLVM IR (-O2):
define i32 @popcount3(i32* nocapture %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i64 [ 0, %1 ], [ %8, %2 ]
%4 = phi i32 [ undef, %1 ], [ %7, %2 ]
%5 = getelementptr inbounds i32, i32* %0, i64 %3
%6 = load i32, i32* %5
%7 = tail call i32 asm "movl\09$1,%eax\09\09\0A\09\09\09testl\09%eax,%eax\09\09\0A\09\09\09je\09\09fin\09\09\09\09\0A\09\09\09movl\09$0,%edx\09\09\0Abucle:\09\09\09\09\09\09\09\09\0A\09\09\09movl\09%eax, %ecx\09\0A\09\09\09andl\09$$1, %ecx\09\09\0A\09\09\09addl\09%ecx, %edx\09\0A\09\09\09sarl\09%eax\09\09\09\0A\09\09\09jnc\09\09bucle\09\09\09\0A\09\09\09movl\09%edx, $0\09\09\0Afin:\09\09\09\09\09\09\09\09\0A", "=r,r,0,~{dirflag},~{fpsr},~{flags}"(i32 %6, i32 %4)
%8 = add nuw nsw i64 %3, 1
%9 = icmp eq i64 %8, 1048576
br i1 %9, label %10, label %2
10: ; preds = %2
ret i32 %7
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void gpu_send_control_gp1(int v) {
  ;
  (*(volatile uint32_t *)(0x00000000 + 0x1F801814)) = v;
}


x86 assembly (clang, -O0):
<gpu_send_control_gp1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x1f801814,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<gpu_send_control_gp1>:
mov    %edi,0x1f801814
ret

LLVM IR (-O0):
define void @gpu_send_control_gp1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
store volatile i32 %3, i32* inttoptr (i64 528488468 to i32*)
ret void
}

LLVM IR (-O2):
define void @gpu_send_control_gp1(i32 %0) {
store volatile i32 %0, i32* inttoptr (i64 528488468 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *const);
void free_command_line(int argc, char *const argv[]) {
  int i;
  for (i = 0; i < argc; i++)
    free(argv[i]);
}


x86 assembly (clang, -O0):
<free_command_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1151 <free_command_line+0x41>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <free_command_line+0x16>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @free_command_line(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %3
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i8**, i8*** %4
%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 @free(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):
define void @free_command_line(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i32 @free(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
}
const char *__malidrv_build_info(void) {
  return "malidrv:  API_VERSION=401 REPO_URL= REVISION= CHANGED_REVISION= "
         "CHANGE_DATE= BUILD_DATE=Thu Dec  5 10:02:48 CST 2013 BUILD=debug "
         "TARGET_PLATFORM=balong MALI_PLATFORM= KDIR= "
         "OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_PROFILING= "
         "USING_INTERNAL_PROFILING= USING_GPU_UTILIZATION=1 "
         "USING_POWER_PERFORMANCE_POLICY= MALI_UPPER_HALF_SCHEDULING=1";
}


x86 assembly (clang, -O0):
<__malidrv_build_info>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [339 x i8] c"malidrv: API_VERSION=401 REPO_URL= REVISION= CHANGED_REVISION= CHANGE_DATE= BUILD_DATE=Thu Dec 5 10:02:48 CST 2013 BUILD=debug TARGET_PLATFORM=balong MALI_PLATFORM= KDIR= OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_PROFILING= USING_INTERNAL_PROFILING= USING_GPU_UTILIZATION=1 USING_POWER_PERFORMANCE_POLICY= MALI_UPPER_HALF_SCHEDULING=1\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([339 x i8], [339 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [339 x i8] c"malidrv: API_VERSION=401 REPO_URL= REVISION= CHANGED_REVISION= CHANGE_DATE= BUILD_DATE=Thu Dec 5 10:02:48 CST 2013 BUILD=debug TARGET_PLATFORM=balong MALI_PLATFORM= KDIR= OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_PROFILING= USING_INTERNAL_PROFILING= USING_GPU_UTILIZATION=1 USING_POWER_PERFORMANCE_POLICY= MALI_UPPER_HALF_SCHEDULING=1\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([339 x i8], [339 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int fib(int);
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int i;
  for (i = 0; i < 100; i++) {
    printf("f(%d)=%d\n", i, fib(i));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    116d <main+0x4d>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <fib@plt>
mov    -0xc(%rbp),%esi
mov    %eax,%edx
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xed3(%rip),%r14
nopl   (%rax)
mov    %ebx,%edi
call   1040 <fib@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x64,%ebx
jne    1130 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"f(%d)=%d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %5, %1 ]
%3 = tail call i32 @fib(i32 %2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %3)
%5 = add nuw nsw i32 %2, 1
%6 = icmp eq i32 %5, 100
br i1 %6, label %7, label %1
7: ; preds = %1
ret i32 0
}
void crontab_setval(char *flagarray, int min, int max, int step) {
  int i;
  if (max == -1) {
    *(flagarray + min) = 1;
  } else {
    for (i = min; i <= max; i += step)
      *(flagarray + i) = 1;
  }
}


x86 assembly (clang, -O0):
<crontab_setval>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
cmpl   $0xffffffff,-0x10(%rbp)
jne    112c <crontab_setval+0x2c>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x1,(%rax,%rcx,1)
jmp    115d <crontab_setval+0x5d>
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     1158 <crontab_setval+0x58>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
movb   $0x1,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    1132 <crontab_setval+0x32>
jmp    115d <crontab_setval+0x5d>
pop    %rbp
ret

x86 assembly (clang, -O2):
<crontab_setval>:
cmp    $0xffffffff,%edx
je     112d <crontab_setval+0x2d>
cmp    %edx,%esi
jg     112c <crontab_setval+0x2c>
movslq %esi,%rax
movslq %ecx,%rcx
movslq %edx,%rdx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movb   $0x1,(%rdi,%rax,1)
add    %rcx,%rax
cmp    %rdx,%rax
jle    1120 <crontab_setval+0x20>
ret
movslq %esi,%rax
movb   $0x1,(%rdi,%rax,1)
ret

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

LLVM IR (-O2):
define void @crontab_setval(i8* nocapture writeonly %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %2, -1
br i1 %5, label %12, label %6
6: ; preds = %4
%7 = icmp sgt i32 %1, %2
br i1 %7, label %20, label %8
8: ; preds = %6
%9 = sext i32 %1 to i64
%10 = sext i32 %3 to i64
%11 = sext i32 %2 to i64
br label %15
12: ; preds = %4
%13 = sext i32 %1 to i64
%14 = getelementptr inbounds i8, i8* %0, i64 %13
store i8 1, i8* %14
br label %20
15: ; preds = %8, %15
%16 = phi i64 [ %9, %8 ], [ %18, %15 ]
%17 = getelementptr inbounds i8, i8* %0, i64 %16
store i8 1, i8* %17
%18 = add i64 %16, %10
%19 = icmp sgt i64 %18, %11
br i1 %19, label %20, label %15
20: ; preds = %15, %6, %12
ret void
}
/* Type definitions */
typedef char *uint16_t;

/* Variables and functions */
uint16_t inw(uint16_t port) {
  uint16_t result;
  __asm__("in %%dx, %%ax" : "=a"(result) : "d"(port));
  return result;
}


x86 assembly (clang, -O0):
<inw>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
in     (%dx),%ax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inw>:
mov    %rdi,%rdx
in     (%dx),%ax
ret

LLVM IR (-O0):
define i8* @inw(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* asm "in %dx, %ax", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
ret i8* %6
}

LLVM IR (-O2):
define i8* @inw(i8* readnone %0) {
%2 = tail call i8* asm "in %dx, %ax", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret i8* %2
}
void tdefault_files_info(struct target_ops *self) {}


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

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

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

LLVM IR (-O2):
%struct.target_ops = type opaque
define void @tdefault_files_info(%struct.target_ops* nocapture %0) {
ret void
}
void g_node_last_sibling() {}


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

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

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

LLVM IR (-O2):
define void @g_node_last_sibling() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void my_init(void) { fputs("libstupid loaded\n", stdout); }


x86 assembly (clang, -O0):
<my_init>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_init>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
lea    0xee0(%rip),%rdi
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"libstupid loaded\0A\00"
@stdout = global i32 0
define void @my_init() {
%1 = load i32, i32* @stdout
%2 = call i32 @fputs(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"libstupid loaded\0A\00"
@stdout = global i32 0
define void @my_init() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int vsnprintf(char *, int, char const *, int /*<<< orphan*/);
int vsprintf(char *buf, const char *fmt, va_list args) {
  return vsnprintf(buf, 0x0FFFFFFFUL, fmt, args);
}


x86 assembly (clang, -O0):
<vsprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    $0xfffffff,%esi
call   1030 <vsnprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vsprintf>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    $0xfffffff,%esi
jmp    1030 <vsnprintf@plt>

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

LLVM IR (-O2):
define i32 @vsprintf(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @vsnprintf(i8* %0, i32 268435455, i8* %1, i32 %2)
ret i32 %4
}
void foo586() {}


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

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

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

LLVM IR (-O2):
define void @foo586() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void wprint_indent(int indent) {
  for (int i = 0; i < indent; i++) {
    printf("  ");
  }
}


x86 assembly (clang, -O0):
<wprint_indent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1148 <wprint_indent+0x38>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <wprint_indent+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wprint_indent>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
jle    113d <wprint_indent+0x2d>
mov    %edi,%ebx
lea    0xedf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0xffffffff,%ebx
jne    1130 <wprint_indent+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c" \00"
define void @wprint_indent(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %4, label %3
3: ; preds = %4, %1
ret void
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %0
br i1 %8, label %3, label %4
}
int touppers(int c) {
  if ('a' <= c && c <= 'z') {
    c -= 'a' - 'A';
  }
  return c;
}


x86 assembly (clang, -O0):
<touppers>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x61,%eax
cmp    -0x4(%rbp),%eax
jg     1128 <touppers+0x28>
cmpl   $0x7a,-0x4(%rbp)
jg     1128 <touppers+0x28>
mov    -0x4(%rbp),%eax
sub    $0x20,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<touppers>:
lea    -0x61(%rdi),%ecx
lea    -0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @touppers(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 97, %3
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 122
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* %2
%10 = sub nsw i32 %9, 32
store i32 %10, i32* %2
br label %11
11: ; preds = %8, %5, %1
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @touppers(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Variables and functions */
double __llvm_amdgcn_rcp_f64(double);
double __drcp_rn(double x) { return __llvm_amdgcn_rcp_f64(x); }


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

x86 assembly (clang, -O2):
<__drcp_rn>:
jmp    1030 <__llvm_amdgcn_rcp_f64@plt>

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

LLVM IR (-O2):
define double @__drcp_rn(double %0) {
%2 = tail call double @__llvm_amdgcn_rcp_f64(double %0)
ret double %2
}