xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main() {
  printf("%s\n", "Hello, world!");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [14 x i8] c"Hello, world!\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [14 x i8] c"Hello, world!\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
void tst_void_ptr(void *pv, int i) { i ? *pv : *pv; }


x86 assembly (clang, -O0):
<tst_void_ptr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     111e <tst_void_ptr+0x1e>
mov    -0x8(%rbp),%rax
jmp    1122 <tst_void_ptr+0x22>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define void @tst_void_ptr(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = load i8*, i8** %3
br label %11
9: ; preds = %2
%10 = load i8*, i8** %3
br label %11
11: ; preds = %9, %7
%12 = phi i8* [ %8, %7 ], [ %10, %9 ]
ret void
}

LLVM IR (-O2):
define void @tst_void_ptr(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EX_USAGE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: lpd [-cdlsW] [port#]\n");
  exit(EX_USAGE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [29 x i8] c"usage: lpd [-cdlsW] [port#]\0A\00"
@EX_USAGE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EX_USAGE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [29 x i8] c"usage: lpd [-cdlsW] [port#]\0A\00"
@EX_USAGE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EX_USAGE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
size_t errno;
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stderr;
char **sys_errlist;
void tty_warning(char *s) {
  fprintf(stderr, "\n\nwarning: %s, (%s)\n", s, sys_errlist[errno]);
  fflush(stderr);
}


x86 assembly (clang, -O0):
<tty_warning>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    0x2eb8(%rip),%rax
mov    (%rax),%rax
mov    0x2e86(%rip),%rcx
mov    (%rcx),%rcx
mov    (%rax,%rcx,8),%rcx
lea    0xea8(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tty_warning>:
push   %rbx
mov    %rdi,%rdx
mov    0x2ead(%rip),%rbx
mov    (%rbx),%edi
mov    0x2ec4(%rip),%rax
mov    (%rax),%rax
mov    0x2e92(%rip),%rcx
mov    (%rcx),%rcx
mov    (%rax,%rcx,8),%rcx
lea    0xeb4(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
pop    %rbx
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [21 x i8] c"\0A\0Awarning: %s, (%s)\0A\00"
@sys_errlist = global i8** null
@errno = global i64 0
define void @tty_warning(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = load i8**, i8*** @sys_errlist
%6 = load i64, i64* @errno
%7 = getelementptr inbounds i8*, i8** %5, i64 %6
%8 = load i8*, i8** %7
%9 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %8)
%10 = load i32, i32* @stderr
%11 = call i32 @fflush(i32 %10)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"\0A\0Awarning: %s, (%s)\0A\00"
@sys_errlist = global i8** null
@errno = global i64 0
define void @tty_warning(i8* %0) {
%2 = load i32, i32* @stderr
%3 = load i8**, i8*** @sys_errlist
%4 = load i64, i64* @errno
%5 = getelementptr inbounds i8*, i8** %3, i64 %4
%6 = load i8*, i8** %5
%7 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %6)
%8 = load i32, i32* @stderr
%9 = tail call i32 @fflush(i32 %8)
ret void
}
/* Variables and functions */
int dll_open(char const *, int);
int __wrap_open64(const char *file, int oflag, ...) {
  return dll_open(file, oflag);
}


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

x86 assembly (clang, -O2):
<__wrap_open64>:
jmp    1030 <dll_open@plt>

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

LLVM IR (-O2):
define i32 @__wrap_open64(i8* %0, i32 %1, ...) {
%3 = tail call i32 @dll_open(i8* %0, i32 %1)
ret i32 %3
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ TIOCGSID;
int ioctl(int, int /*<<< orphan*/, int *);
pid_t tcgetsid(int fildes) {
  pid_t pid;
  return ioctl(fildes, TIOCGSID, &pid) == -1 ? -1 : pid;
}


x86 assembly (clang, -O0):
<tcgetsid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
lea    -0x8(%rbp),%rdx
call   1030 <ioctl@plt>
cmp    $0xffffffff,%eax
jne    1146 <tcgetsid+0x36>
mov    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    114c <tcgetsid+0x3c>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcgetsid>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
lea    0x4(%rsp),%rdx
call   1030 <ioctl@plt>
cmp    $0xffffffff,%eax
je     112d <tcgetsid+0x1d>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@TIOCGSID = global i32 0
define i32 @tcgetsid(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i32, i32* @TIOCGSID
%5 = call i32 @ioctl(i32 %0, i32 %4, i32* %2)
%6 = icmp eq i32 %5, -1
%7 = load i32, i32* %2
%8 = select i1 %6, i32 -1, i32 %7
ret i32 %8
}
int main() {
  char supreme_alphabets[25];
  char word_container;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-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 [25 x i8]
%3 = alloca i8
store i32 0, i32* %1
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int test_16(unsigned char x, int y, int z) { return (x >> 2) & 16 ? y : z; }


x86 assembly (clang, -O0):
<test_16>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movzbl -0x1(%rbp),%eax
sar    $0x2,%eax
and    $0x10,%eax
cmp    $0x0,%eax
je     112e <test_16+0x2e>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1134 <test_16+0x34>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_16>:
mov    %esi,%eax
test   $0x40,%dil
cmove  %edx,%eax
ret

LLVM IR (-O0):
define i32 @test_16(i8 zeroext %0, i32 %1, i32 %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = ashr i32 %8, 2
%10 = and i32 %9, 16
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %3
%13 = load i32, i32* %5
br label %16
14: ; preds = %3
%15 = load i32, i32* %6
br label %16
16: ; preds = %14, %12
%17 = phi i32 [ %13, %12 ], [ %15, %14 ]
ret i32 %17
}

LLVM IR (-O2):
define i32 @test_16(i8 zeroext %0, i32 %1, i32 %2) {
%4 = and i8 %0, 64
%5 = icmp eq i8 %4, 0
%6 = select i1 %5, i32 %2, i32 %1
ret i32 %6
}
/* Variables and functions */
int recv(int, void *, size_t, int /*<<< orphan*/);
int c_read(int fd, void *buf, size_t count) { return recv(fd, buf, count, 0); }


x86 assembly (clang, -O0):
<c_read>:
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
xor    %ecx,%ecx
call   1030 <recv@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_read>:
xor    %ecx,%ecx
jmp    1030 <recv@plt>

LLVM IR (-O0):
define i32 @c_read(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 @recv(i32 %7, i8* %8, i64 %9, i32 0)
ret i32 %10
}

LLVM IR (-O2):
define i32 @c_read(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @recv(i32 %0, i8* %1, i64 %2, i32 0)
ret i32 %4
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  unsigned int state;
};
struct TYPE_4__ {
  TYPE_1__ xkey;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xkey_state(void *_p, unsigned _v) {
  ((XEvent *)_p)->xkey.state = (unsigned)_v;
}


x86 assembly (clang, -O0):
<set_XEvent_xkey_state>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XEvent_xkey_state>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i32 }
define void @set_XEvent_xkey_state(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 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i32 %5, i32* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xkey_state(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
unsigned char rotate2(unsigned char c) { return ((c << 2) | (c >> 2)) & 0xf; }


x86 assembly (clang, -O0):
<rotate2>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x2,%eax
movzbl -0x1(%rbp),%ecx
sar    $0x2,%ecx
or     %ecx,%eax
and    $0xf,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotate2>:
lea    0x0(,%rdi,4),%eax
shr    $0x2,%dil
or     %dil,%al
and    $0xf,%al
ret

LLVM IR (-O0):
define zeroext i8 @rotate2(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = shl i32 %4, 2
%6 = load i8, i8* %2
%7 = zext i8 %6 to i32
%8 = ashr i32 %7, 2
%9 = or i32 %5, %8
%10 = and i32 %9, 15
%11 = trunc i32 %10 to i8
ret i8 %11
}

LLVM IR (-O2):
define zeroext i8 @rotate2(i8 zeroext %0) {
%2 = shl i8 %0, 2
%3 = lshr i8 %0, 2
%4 = or i8 %2, %3
%5 = and i8 %4, 15
ret i8 %5
}
/* Variables and functions */
int putchar(char);
int /*<<< orphan*/ putstr(char const *);
int puts(const char *str) {
  putstr(str);
  return putchar('\n');
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <putstr@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %rax
call   1040 <putstr@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define i32 @puts(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @putstr(i8* %3)
%5 = call i32 @putchar(i8 signext 10)
ret i32 %5
}

LLVM IR (-O2):
define i32 @puts(i8* %0) {
%2 = tail call i32 @putstr(i8* %0)
%3 = tail call i32 @putchar(i8 signext 10)
ret i32 %3
}
void set_InitHHMn(unsigned char *pds, unsigned int hhmn) {
  pds[16] = hhmn % 100;
  hhmn /= 100;
  pds[15] = hhmn % 100;
}


x86 assembly (clang, -O0):
<set_InitHHMn>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x64,%ecx
xor    %edx,%edx
div    %ecx
mov    %dl,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x10(%rax)
mov    -0xc(%rbp),%eax
mov    $0x64,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x64,%ecx
xor    %edx,%edx
div    %ecx
mov    %dl,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0xf(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_InitHHMn>:
mov    %esi,%eax
imul   $0x51eb851f,%rax,%rax
shr    $0x25,%rax
imul   $0x64,%eax,%ecx
sub    %ecx,%esi
mov    %sil,0x10(%rdi)
imul   $0x51eb851f,%rax,%rcx
shr    $0x25,%rcx
imul   $0x64,%ecx,%ecx
sub    %ecx,%eax
mov    %al,0xf(%rdi)
ret

LLVM IR (-O0):
define void @set_InitHHMn(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 = urem i32 %5, 100
%7 = trunc i32 %6 to i8
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 16
store i8 %7, i8* %9
%10 = load i32, i32* %4
%11 = udiv i32 %10, 100
store i32 %11, i32* %4
%12 = load i32, i32* %4
%13 = urem i32 %12, 100
%14 = trunc i32 %13 to i8
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 15
store i8 %14, i8* %16
ret void
}

LLVM IR (-O2):
define void @set_InitHHMn(i8* nocapture writeonly %0, i32 %1) {
%3 = urem i32 %1, 100
%4 = trunc i32 %3 to i8
%5 = getelementptr inbounds i8, i8* %0, i64 16
store i8 %4, i8* %5
%6 = udiv i32 %1, 100
%7 = urem i32 %6, 100
%8 = trunc i32 %7 to i8
%9 = getelementptr inbounds i8, i8* %0, i64 15
store i8 %8, i8* %9
ret void
}
/* Type definitions */
struct battle_char {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ add_status(struct battle_char *, int);
scalar_t__ get_random(int /*<<< orphan*/, int);
scalar_t__ mod6(struct battle_char *, struct battle_char *, int);
void haste2(struct battle_char *origin, struct battle_char *target) {
  if (get_random(0, 100) < mod6(origin, target, 240)) {
    add_status(target, 21);
  }
}


x86 assembly (clang, -O0):
<haste2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
mov    $0x64,%esi
call   1030 <get_random@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0xf0,%edx
call   1040 <mod6@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
jge    1180 <haste2+0x50>
mov    -0x10(%rbp),%rdi
mov    $0x15,%esi
call   1050 <add_status@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<haste2>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
xor    %edi,%edi
mov    $0x64,%esi
call   1030 <get_random@plt>
mov    %rax,%rbx
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0xf0,%edx
call   1040 <mod6@plt>
cmp    %rax,%rbx
jge    1171 <haste2+0x41>
mov    %r14,%rdi
mov    $0x15,%esi
pop    %rbx
pop    %r14
pop    %r15
jmp    1050 <add_status@plt>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.battle_char = type { i32 }
define void @haste2(%struct.battle_char* %0, %struct.battle_char* %1) {
%3 = alloca %struct.battle_char*
%4 = alloca %struct.battle_char*
store %struct.battle_char* %0, %struct.battle_char** %3
store %struct.battle_char* %1, %struct.battle_char** %4
%5 = call i64 @get_random(i32 0, i32 100)
%6 = load %struct.battle_char*, %struct.battle_char** %3
%7 = load %struct.battle_char*, %struct.battle_char** %4
%8 = call i64 @mod6(%struct.battle_char* %6, %struct.battle_char* %7, i32 240)
%9 = icmp slt i64 %5, %8
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load %struct.battle_char*, %struct.battle_char** %4
%12 = call i32 @add_status(%struct.battle_char* %11, i32 21)
br label %13
13: ; preds = %10, %2
ret void
}

LLVM IR (-O2):
%struct.battle_char = type { i32 }
define void @haste2(%struct.battle_char* %0, %struct.battle_char* %1) {
%3 = tail call i64 @get_random(i32 0, i32 100)
%4 = tail call i64 @mod6(%struct.battle_char* %0, %struct.battle_char* %1, i32 240)
%5 = icmp slt i64 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @add_status(%struct.battle_char* %1, i32 21)
br label %8
8: ; preds = %6, %2
ret void
}
int test_imm_89int8_mem(signed char *val) {
  return ((*val) & (0x89 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_89int8_mem>:
testb  $0x89,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_89int8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, 137
%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_89int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -119
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
scalar_t__ return_double();
long return_long2(void) { return (long)return_double(); }


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

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

LLVM IR (-O0):
define i64 @return_long2() {
%1 = call i64 (...) @return_double()
ret i64 %1
}

LLVM IR (-O2):
define i64 @return_long2() {
%1 = tail call i64 (...) @return_double()
ret i64 %1
}
strlen(s) char *s;
{
  char *t;
  t = s;
  while (*s)
    s++;
  return (s - t);
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     112e <strlen+0x2e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void const *, size_t);
void retmem(void *dest, size_t *size, const void *src, size_t n) {
  if (n <= *size)
    memcpy(dest, src, n);
  *size = n;
}


x86 assembly (clang, -O0):
<retmem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%rax
ja     114a <retmem+0x3a>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<retmem>:
push   %r14
push   %rbx
push   %rax
mov    %rcx,%rbx
mov    %rsi,%r14
cmp    %rcx,(%rsi)
jb     112a <retmem+0x1a>
mov    %rdx,%rsi
mov    %rbx,%rdx
call   1030 <memcpy@plt>
mov    %rbx,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @retmem(i8* %0, i64* %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i64*
%7 = alloca i8*
%8 = alloca i64
store i8* %0, i8** %5
store i64* %1, i64** %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load i64, i64* %8
%10 = load i64*, i64** %6
%11 = load i64, i64* %10
%12 = icmp ule i64 %9, %11
br i1 %12, label %13, label %18
13: ; preds = %4
%14 = load i8*, i8** %5
%15 = load i8*, i8** %7
%16 = load i64, i64* %8
%17 = call i32 @memcpy(i8* %14, i8* %15, i64 %16)
br label %18
18: ; preds = %13, %4
%19 = load i64, i64* %8
%20 = load i64*, i64** %6
store i64 %19, i64* %20
ret void
}

LLVM IR (-O2):
define void @retmem(i8* %0, i64* nocapture %1, i8* %2, i64 %3) {
%5 = load i64, i64* %1
%6 = icmp ult i64 %5, %3
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @memcpy(i8* %0, i8* %2, i64 %3)
br label %9
9: ; preds = %7, %4
store i64 %3, i64* %1
ret void
}
int f3(int *p) {
  int r = 0;
  r += p == (char)0;
  r += p != (char)0;
  r += (char)0 == p;
  r += (char)0 != p;
  return r;
}


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f3(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
%4 = load i32*, i32** %2
%5 = icmp eq i32* %4, null
%6 = zext i1 %5 to i32
%7 = load i32, i32* %3
%8 = add nsw i32 %7, %6
store i32 %8, i32* %3
%9 = load i32*, i32** %2
%10 = icmp ne i32* %9, null
%11 = zext i1 %10 to i32
%12 = load i32, i32* %3
%13 = add nsw i32 %12, %11
store i32 %13, i32* %3
%14 = load i32*, i32** %2
%15 = icmp eq i32* null, %14
%16 = zext i1 %15 to i32
%17 = load i32, i32* %3
%18 = add nsw i32 %17, %16
store i32 %18, i32* %3
%19 = load i32*, i32** %2
%20 = icmp ne i32* null, %19
%21 = zext i1 %20 to i32
%22 = load i32, i32* %3
%23 = add nsw i32 %22, %21
store i32 %23, i32* %3
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @f3(i32* readnone %0) {
ret i32 2
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ close(int);
int open(char const *, int /*<<< orphan*/);
void write_marker(const char *name) {
  int descriptor = open(name, O_RDONLY);
  if (descriptor != -1) {
    close(descriptor);
  }
}


x86 assembly (clang, -O0):
<write_marker>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
call   1040 <open@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
je     1153 <write_marker+0x33>
mov    -0xc(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_marker>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
call   1040 <open@plt>
cmp    $0xffffffff,%eax
je     113c <write_marker+0x1c>
mov    %eax,%edi
pop    %rax
jmp    1030 <close@plt>
pop    %rax
ret

LLVM IR (-O0):
@O_RDONLY = global i32 0
define void @write_marker(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i32, i32* @O_RDONLY
%6 = call i32 @open(i8* %4, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp ne i32 %7, -1
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i32, i32* %3
%11 = call i32 @close(i32 %10)
br label %12
12: ; preds = %9, %1
ret void
}

LLVM IR (-O2):
@O_RDONLY = global i32 0
define void @write_marker(i8* nocapture %0) {
%2 = load i32, i32* @O_RDONLY
%3 = tail call i32 @open(i8* %0, i32 %2)
%4 = icmp eq i32 %3, -1
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @close(i32 %3)
br label %7
7: ; preds = %5, %1
ret void
}
char *get_misc_instr_string(int misc_type) {
  static char *opstr[6] = {"BX", "CLZ", "BXJ", "BLX", "BKPT", "SMC"};
  return opstr[misc_type];
}


x86 assembly (clang, -O0):
<get_misc_instr_string>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rcx
lea    0x2f1e(%rip),%rax
mov    (%rax,%rcx,8),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_misc_instr_string>:
movslq %edi,%rax
lea    0xef6(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
ret

LLVM IR (-O0):
@get_misc_instr_string.opstr = internal global [6 x i8*] [i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i32 0, i32 0)]
@.str = [3 x i8] c"BX\00"
@.str.1 = [4 x i8] c"CLZ\00"
@.str.2 = [4 x i8] c"BXJ\00"
@.str.3 = [4 x i8] c"BLX\00"
@.str.4 = [5 x i8] c"BKPT\00"
@.str.5 = [4 x i8] c"SMC\00"
define i8* @get_misc_instr_string(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds [6 x i8*], [6 x i8*]* @get_misc_instr_string.opstr, i64 0, i64 %4
%6 = load i8*, i8** %5
ret i8* %6
}

LLVM IR (-O2):
@reltable.get_misc_instr_string = internal unnamed_addr constant [6 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str to i64), i64 ptrtoint ([6 x i32]* @reltable.get_misc_instr_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.1 to i64), i64 ptrtoint ([6 x i32]* @reltable.get_misc_instr_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.2 to i64), i64 ptrtoint ([6 x i32]* @reltable.get_misc_instr_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.3 to i64), i64 ptrtoint ([6 x i32]* @reltable.get_misc_instr_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.4 to i64), i64 ptrtoint ([6 x i32]* @reltable.get_misc_instr_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.5 to i64), i64 ptrtoint ([6 x i32]* @reltable.get_misc_instr_string to i64)) to i32)]
@.str = [3 x i8] c"BX\00"
@.str.1 = [4 x i8] c"CLZ\00"
@.str.2 = [4 x i8] c"BXJ\00"
@.str.3 = [4 x i8] c"BLX\00"
@.str.4 = [5 x i8] c"BKPT\00"
@.str.5 = [4 x i8] c"SMC\00"
define i8* @get_misc_instr_string(i32 %0) {
%2 = sext i32 %0 to i64
%3 = shl i64 %2, 2
%4 = call i8* @llvm.load.relative.i64(i8* bitcast ([6 x i32]* @reltable.get_misc_instr_string to i8*), i64 %3)
ret i8* %4
}
/* Variables and functions */
bool is_empty() { return true; }


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

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

LLVM IR (-O0):
define i32 @is_empty() {
ret i32 1
}

LLVM IR (-O2):
define i32 @is_empty() {
ret i32 1
}
oraCmp(int **x, int **y) {
  return (*x[0] < *y[0] ? -1 : (*x[0] == *y[0] ? 0 : 1));
}


x86 assembly (clang, -O0):
<oraCmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
mov    (%rcx),%rcx
cmp    (%rcx),%eax
jge    1131 <oraCmp+0x31>
mov    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1152 <oraCmp+0x52>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%edx
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%esi
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    %esi,%edx
cmove  %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<oraCmp>:
mov    (%rdi),%rax
mov    (%rax),%eax
mov    (%rsi),%rcx
xor    %edx,%edx
cmp    (%rcx),%eax
setne  %dl
mov    $0xffffffff,%eax
cmovge %edx,%eax
ret

LLVM IR (-O0):
define i32 @oraCmp(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 = getelementptr inbounds i32*, i32** %5, i64 0
%7 = load i32*, i32** %6
%8 = load i32, i32* %7
%9 = load i32**, i32*** %4
%10 = getelementptr inbounds i32*, i32** %9, i64 0
%11 = load i32*, i32** %10
%12 = load i32, i32* %11
%13 = icmp slt i32 %8, %12
br i1 %13, label %14, label %15
14: ; preds = %2
br label %27
15: ; preds = %2
%16 = load i32**, i32*** %3
%17 = getelementptr inbounds i32*, i32** %16, i64 0
%18 = load i32*, i32** %17
%19 = load i32, i32* %18
%20 = load i32**, i32*** %4
%21 = getelementptr inbounds i32*, i32** %20, i64 0
%22 = load i32*, i32** %21
%23 = load i32, i32* %22
%24 = icmp eq i32 %19, %23
%25 = zext i1 %24 to i64
%26 = select i1 %24, i32 0, i32 1
br label %27
27: ; preds = %15, %14
%28 = phi i32 [ -1, %14 ], [ %26, %15 ]
ret i32 %28
}

LLVM IR (-O2):
define i32 @oraCmp(i32** nocapture %0, i32** nocapture %1) {
%3 = load i32*, i32** %0
%4 = load i32, i32* %3
%5 = load i32*, i32** %1
%6 = load i32, i32* %5
%7 = icmp slt i32 %4, %6
%8 = icmp ne i32 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
void f2(char s[100]) {
  s[0] = 'C';
  printf("f2: %s %lu\n", s, strlen(s));
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x43,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
lea    0xeaf(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
push   %rbx
mov    %rdi,%rbx
movb   $0x43,(%rdi)
call   1030 <strlen@plt>
lea    0xecd(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"f2: %s %lu\0A\00"
define void @f2(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
store i8 67, i8* %4
%5 = load i8*, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 @strlen(i8* %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"f2: %s %lu\0A\00"
define void @f2(i8* %0) {
store i8 67, i8* %0
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void fc(void) { printf("Presiono Ctrl-c\n"); }


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

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

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

LLVM IR (-O2):
@str = [16 x i8] c"Presiono Ctrl-c\00"
define void @fc() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret void
}
unsigned rol(unsigned v, short amt) {
  unsigned msk1 = (1 << amt) - 1;
  return ((v >> (32 - amt)) & msk1) | ((v << amt) & ~msk1);
}


x86 assembly (clang, -O0):
<rol>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
movswl -0x6(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
movswl -0x6(%rbp),%edx
mov    $0x20,%ecx
sub    %edx,%ecx
shr    %cl,%eax
and    -0xc(%rbp),%eax
mov    -0x4(%rbp),%edx
movswl -0x6(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
mov    -0xc(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rol>:
mov    $0xffffffff,%edx
mov    %esi,%ecx
shl    %cl,%edx
not    %edx
neg    %cl
mov    %edi,%eax
shr    %cl,%eax
and    %edx,%eax
mov    %esi,%ecx
shl    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @rol(i32 %0, i16 signext %1) {
%3 = alloca i32
%4 = alloca i16
%5 = alloca i32
store i32 %0, i32* %3
store i16 %1, i16* %4
%6 = load i16, i16* %4
%7 = sext i16 %6 to i32
%8 = shl i32 1, %7
%9 = sub nsw i32 %8, 1
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = load i16, i16* %4
%12 = sext i16 %11 to i32
%13 = sub nsw i32 32, %12
%14 = lshr i32 %10, %13
%15 = load i32, i32* %5
%16 = and i32 %14, %15
%17 = load i32, i32* %3
%18 = load i16, i16* %4
%19 = sext i16 %18 to i32
%20 = shl i32 %17, %19
%21 = load i32, i32* %5
%22 = xor i32 %21, -1
%23 = and i32 %20, %22
%24 = or i32 %16, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @rol(i32 %0, i16 signext %1) {
%3 = sext i16 %1 to i32
%4 = shl nsw i32 -1, %3
%5 = xor i32 %4, -1
%6 = sub nsw i32 32, %3
%7 = lshr i32 %0, %6
%8 = and i32 %7, %5
%9 = shl i32 %0, %3
%10 = or i32 %8, %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void help_switch() {
  puts("switch [<hotel name>]\n"
       "Switches to the mentioned hotel, so that further operations may be\n"
       "relative to it. Prompts for hotel name if not provided as parameter.\n"
       "Subsequent commands display the '@' character, followed by the hotel\n"
       "name as prompt.");
}


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

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

LLVM IR (-O0):
@.str = [243 x i8] c"switch [<hotel name>]\0ASwitches to the mentioned hotel, so that further operations may be\0Arelative to it. Prompts for hotel name if not provided as parameter.\0ASubsequent commands display the '@' character, followed by the hotel\0Aname as prompt.\00"
define void @help_switch() {
%1 = call i32 @puts(i8* getelementptr inbounds ([243 x i8], [243 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [243 x i8] c"switch [<hotel name>]\0ASwitches to the mentioned hotel, so that further operations may be\0Arelative to it. Prompts for hotel name if not provided as parameter.\0ASubsequent commands display the '@' character, followed by the hotel\0Aname as prompt.\00"
define void @help_switch() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([243 x i8], [243 x i8]* @.str, i64 0, i64 0))
ret void
}
int hithere2() {
  int a;
  a = 21;
  return a;
}


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

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

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

LLVM IR (-O2):
define i32 @hithere2() {
ret i32 21
}
void init_emif() {
  unsigned int val = 0;
  val = (*(volatile unsigned int *)(0x44E00000 + 0xD0));
  val &= ~0x3;
  val |= 0x2;
  (*(volatile unsigned int *)(0x44E00000 + 0xD0) = (val));
  val = (*(volatile unsigned int *)(0x44E00000 + 0x28));
  val &= ~0x3;
  val |= 0x2;
  (*(volatile unsigned int *)(0x44E00000 + 0x28) = (val));
  while (((*(volatile unsigned int *)(0x44E00000 + 0xC)) & 0x14) != 0x14)
    ;
}


x86 assembly (clang, -O0):
<init_emif>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x44e000d0,%eax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xfffffffc,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
or     $0x2,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x44e000d0,%eax
mov    %ecx,(%rax)
mov    $0x44e00028,%eax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xfffffffc,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
or     $0x2,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x44e00028,%eax
mov    %ecx,(%rax)
mov    $0x44e0000c,%eax
mov    (%rax),%eax
and    $0x14,%eax
cmp    $0x14,%eax
je     116f <init_emif+0x6f>
jmp    1157 <init_emif+0x57>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_emif>:
mov    0x44e000d0,%eax
and    $0xfffffffc,%eax
or     $0x2,%eax
mov    %eax,0x44e000d0
mov    0x44e00028,%eax
and    $0xfffffffc,%eax
or     $0x2,%eax
mov    %eax,0x44e00028
nopl   0x0(%rax,%rax,1)
mov    0x44e0000c,%eax
not    %eax
test   $0x14,%al
jne    1130 <init_emif+0x30>
ret

LLVM IR (-O0):
define void @init_emif() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load volatile i32, i32* inttoptr (i64 1155530960 to i32*)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = and i32 %3, -4
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = or i32 %5, 2
store i32 %6, i32* %1
%7 = load i32, i32* %1
store volatile i32 %7, i32* inttoptr (i64 1155530960 to i32*)
%8 = load volatile i32, i32* inttoptr (i64 1155530792 to i32*)
store i32 %8, i32* %1
%9 = load i32, i32* %1
%10 = and i32 %9, -4
store i32 %10, i32* %1
%11 = load i32, i32* %1
%12 = or i32 %11, 2
store i32 %12, i32* %1
%13 = load i32, i32* %1
store volatile i32 %13, i32* inttoptr (i64 1155530792 to i32*)
br label %14
14: ; preds = %18, %0
%15 = load volatile i32, i32* inttoptr (i64 1155530764 to i32*)
%16 = and i32 %15, 20
%17 = icmp ne i32 %16, 20
br i1 %17, label %18, label %19
18: ; preds = %14
br label %14
19: ; preds = %14
ret void
}

LLVM IR (-O2):
define void @init_emif() {
%1 = load volatile i32, i32* inttoptr (i64 1155530960 to i32*)
%2 = and i32 %1, -4
%3 = or i32 %2, 2
store volatile i32 %3, i32* inttoptr (i64 1155530960 to i32*)
%4 = load volatile i32, i32* inttoptr (i64 1155530792 to i32*)
%5 = and i32 %4, -4
%6 = or i32 %5, 2
store volatile i32 %6, i32* inttoptr (i64 1155530792 to i32*)
br label %7
7: ; preds = %7, %0
%8 = load volatile i32, i32* inttoptr (i64 1155530764 to i32*)
%9 = and i32 %8, 20
%10 = icmp eq i32 %9, 20
br i1 %10, label %11, label %7
11: ; preds = %7
ret void
}
/* Variables and functions */
char *wPopString();
int /*<<< orphan*/ wPushString(char *);
void wBasStrF() {
  char *string;
  string = wPopString();
  wPushString(string);
}


x86 assembly (clang, -O0):
<wBasStrF>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <wPopString@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <wPushString@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wBasStrF>:
push   %rax
xor    %eax,%eax
call   1030 <wPopString@plt>
mov    %rax,%rdi
pop    %rax
jmp    1040 <wPushString@plt>

LLVM IR (-O0):
define void @wBasStrF() {
%1 = alloca i8*
%2 = call i8* (...) @wPopString()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @wPushString(i8* %3)
ret void
}

LLVM IR (-O2):
define void @wBasStrF() {
%1 = tail call i8* (...) @wPopString()
%2 = tail call i32 @wPushString(i8* %1)
ret void
}
long unsigned int gcd(unsigned long int a, unsigned long int b) {
  if (a == b)
    return a;
  if (a > b)
    return gcd(a - b, b);
  else
    return gcd(a, b - a);
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    113b <gcd+0x2b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1178 <gcd+0x68>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jbe    1163 <gcd+0x53>
mov    -0x10(%rbp),%rdi
sub    -0x18(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <gcd@plt>
mov    %rax,-0x8(%rbp)
jmp    1178 <gcd+0x68>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
sub    -0x10(%rbp),%rsi
call   1030 <gcd@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
cmp    %rsi,%rdi
jne    1109 <gcd+0x9>
mov    %rdi,%rax
ret
mov    %rsi,%rax
mov    %rax,%rcx
nop
sub    %rdi,%rcx
jb     1120 <gcd+0x20>
mov    %rcx,%rax
cmp    %rcx,%rdi
jne    1110 <gcd+0x10>
jmp    1105 <gcd+0x5>
nop
sub    %rax,%rdi
cmp    %rdi,%rax
jne    110c <gcd+0xc>
jmp    1108 <gcd+0x8>

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

LLVM IR (-O2):
define i64 @gcd(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, %1
br i1 %3, label %16, label %4
4: ; preds = %2, %10
%5 = phi i64 [ %8, %10 ], [ %1, %2 ]
%6 = phi i64 [ %11, %10 ], [ %0, %2 ]
br label %7
7: ; preds = %4, %13
%8 = phi i64 [ %5, %4 ], [ %14, %13 ]
%9 = icmp ult i64 %8, %6
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = sub i64 %6, %8
%12 = icmp eq i64 %11, %8
br i1 %12, label %16, label %4
13: ; preds = %7
%14 = sub i64 %8, %6
%15 = icmp eq i64 %6, %14
br i1 %15, label %16, label %7
16: ; preds = %10, %13, %2
%17 = phi i64 [ %0, %2 ], [ %6, %13 ], [ %8, %10 ]
ret i64 %17
}
/* Variables and functions */
scalar_t__ is_matched();
int /*<<< orphan*/ make_empty();
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("enter parentheses and/or braces:\n");
  make_empty();
  if (is_matched()) {
    printf("parentheses/braces are nested properly\n");
  } else {
    printf("parentheses/braces aren't nested properly\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <make_empty@plt>
mov    $0x0,%al
call   1040 <is_matched@plt>
cmp    $0x0,%rax
je     1174 <main+0x44>
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
jmp    1180 <main+0x50>
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <make_empty@plt>
xor    %eax,%eax
call   1040 <is_matched@plt>
test   %rax,%rax
lea    0xecc(%rip),%rax
lea    0xeef(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [34 x i8] c"enter parentheses and/or braces:\0A\00"
@.str.1 = [40 x i8] c"parentheses/braces are nested properly\0A\00"
@.str.2 = [43 x i8] c"parentheses/braces aren't nested properly\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @make_empty()
%4 = call i64 (...) @is_matched()
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
br label %10
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0))
br label %10
10: ; preds = %8, %6
ret i32 0
}

LLVM IR (-O2):
@str = [33 x i8] c"enter parentheses and/or braces:\00"
@str.3 = [42 x i8] c"parentheses/braces aren't nested properly\00"
@str.4 = [39 x i8] c"parentheses/braces are nested properly\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @make_empty()
%3 = tail call i64 (...) @is_matched()
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @str.3, i64 0, i64 0), i8* getelementptr inbounds ([39 x i8], [39 x i8]* @str.4, i64 0, i64 0)
%6 = tail call i32 @puts(i8* dereferenceable(1) %5)
ret i32 0
}
void addrInfo(struct Chip8 *chip8, char *format, ...) {}


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

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

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

LLVM IR (-O2):
%struct.Chip8 = type opaque
define void @addrInfo(%struct.Chip8* nocapture %0, i8* nocapture %1, ...) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Again();
int /*<<< orphan*/ Then();
void Repeat() {
  Again();
  Then();
}


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

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

LLVM IR (-O0):
define void @Repeat() {
%1 = call i32 (...) @Again()
%2 = call i32 (...) @Then()
ret void
}

LLVM IR (-O2):
define void @Repeat() {
%1 = tail call i32 (...) @Again()
%2 = tail call i32 (...) @Then()
ret void
}