xunge/DecIR huggingface dataset:
void bitFlipBit(void *bitarray, int bitno) {
  ((char *)bitarray)[bitno / 8] ^= (1 << (bitno % 8));
}


x86 assembly (clang, -O0):
<bitFlipBit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    $0x1,%esi
shl    %cl,%esi
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%edx
xor    %esi,%edx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitFlipBit>:
mov    %esi,%ecx
and    $0x7,%cl
mov    $0x1,%eax
shl    %cl,%eax
lea    0x7(%rsi),%ecx
test   %esi,%esi
cmovns %esi,%ecx
sar    $0x3,%ecx
movslq %ecx,%rcx
xor    %al,(%rdi,%rcx,1)
ret

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

LLVM IR (-O2):
define void @bitFlipBit(i8* nocapture %0, i32 %1) {
%3 = and i32 %1, 7
%4 = shl nuw nsw i32 1, %3
%5 = sdiv i32 %1, 8
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = trunc i32 %4 to i8
%10 = xor i8 %8, %9
store i8 %10, i8* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void handle_fd(int fd, int instr) {
  static int f;
  switch (instr) {
  case 1:
    f = fd ? fd : -1;
    break;
  case 2:
    close(f);
    break;
  }
}


x86 assembly (clang, -O0):
<handle_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x1,%eax
je     1143 <handle_fd+0x33>
jmp    1132 <handle_fd+0x22>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     1173 <handle_fd+0x63>
jmp    117e <handle_fd+0x6e>
cmpl   $0x0,-0x4(%rbp)
je     1158 <handle_fd+0x48>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1165 <handle_fd+0x55>
mov    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1165 <handle_fd+0x55>
mov    -0x10(%rbp),%eax
mov    %eax,0x2ebe(%rip)
jmp    117e <handle_fd+0x6e>
mov    0x2eb3(%rip),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_fd>:
cmp    $0x2,%esi
je     1128 <handle_fd+0x18>
cmp    $0x1,%esi
jne    1127 <handle_fd+0x17>
cmp    $0x1,%edi
sbb    %eax,%eax
or     %edi,%eax
mov    %eax,0x2f05(%rip)
ret
mov    0x2efe(%rip),%edi
jmp    1030 <close@plt>

LLVM IR (-O0):
@handle_fd.f = internal global i32 0
define void @handle_fd(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
switch i32 %5, label %17 [
i32 1, label %6
i32 2, label %14
]
6: ; preds = %2
%7 = load i32, i32* %3
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = load i32, i32* %3
br label %12
11: ; preds = %6
br label %12
12: ; preds = %11, %9
%13 = phi i32 [ %10, %9 ], [ -1, %11 ]
store i32 %13, i32* @handle_fd.f
br label %17
14: ; preds = %2
%15 = load i32, i32* @handle_fd.f
%16 = call i32 @close(i32 %15)
br label %17
17: ; preds = %2, %14, %12
ret void
}

LLVM IR (-O2):
@handle_fd.f = internal unnamed_addr global i32 0
define void @handle_fd(i32 %0, i32 %1) {
switch i32 %1, label %9 [
i32 1, label %3
i32 2, label %6
]
3: ; preds = %2
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i32 -1, i32 %0
store i32 %5, i32* @handle_fd.f
br label %9
6: ; preds = %2
%7 = load i32, i32* @handle_fd.f
%8 = tail call i32 @close(i32 %7)
br label %9
9: ; preds = %2, %6, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void func() { printf("This is a void function\n"); }


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

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

LLVM IR (-O0):
@.str = [25 x i8] c"This is a void function\0A\00"
define void @func() {
%1 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [24 x i8] c"This is a void function\00"
define void @func() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void show_help() {
  fprintf(stderr, "Usage: entropy_monitor -dhltvz\n"
                  "Collect and output information about available entropy in "
                  "/dev/random\n\n"
                  "  -d     debugging output to stderr\n"
                  "  -h     show this help\n"
                  "  -l     log to syslog\n"
                  "  -v     verbose output to stderr\n"
                  "  -z     output for suitable for zabbix_sender to stdout\n");
}


x86 assembly (clang, -O0):
<show_help>:
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):
<show_help>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [277 x i8] c"Usage: entropy_monitor -dhltvz\0ACollect and output information about available entropy in /dev/random\0A\0A -d debugging output to stderr\0A -h show this help\0A -l log to syslog\0A -v verbose output to stderr\0A -z output for suitable for zabbix_sender to stdout\0A\00"
define void @show_help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([277 x i8], [277 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [277 x i8] c"Usage: entropy_monitor -dhltvz\0ACollect and output information about available entropy in /dev/random\0A\0A -d debugging output to stderr\0A -h show this help\0A -l log to syslog\0A -v verbose output to stderr\0A -z output for suitable for zabbix_sender to stdout\0A\00"
define void @show_help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([277 x i8], [277 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cmd_clear();
void usrClear(void) { cmd_clear(); }


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

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

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

LLVM IR (-O2):
define void @usrClear() {
%1 = tail call i32 (...) @cmd_clear()
ret void
}
int fun808() { return 808; }


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

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

LLVM IR (-O0):
define i32 @fun808() {
ret i32 808
}

LLVM IR (-O2):
define i32 @fun808() {
ret i32 808
}
int do_signbit_tf(long double a) { return __builtin_signbit(a); }


x86 assembly (clang, -O0):
<do_signbit_tf>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
movzwl -0x8(%rbp),%eax
shr    $0xf,%rax
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_signbit_tf>:
movzwl 0x10(%rsp),%eax
shr    $0xf,%rax
ret

LLVM IR (-O0):
define i32 @do_signbit_tf(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = bitcast x86_fp80 %3 to i80
%5 = icmp slt i80 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @do_signbit_tf(x86_fp80 %0) {
%2 = bitcast x86_fp80 %0 to i80
%3 = lshr i80 %2, 79
%4 = trunc i80 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ dac_configure();
void init_vga(void) { dac_configure(); }


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

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

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

LLVM IR (-O2):
define void @init_vga() {
%1 = tail call i32 (...) @dac_configure()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, int);
unsigned long strtoul(char *, void *, int);
unsigned long cpio_value(const char *field) {
  char buf[9];
  memcpy(buf, field, (sizeof(buf) - 1));
  buf[sizeof(buf) - 1] = '\0';
  return strtoul(buf, ((void *)0), 16);
}


x86 assembly (clang, -O0):
<cpio_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x11(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x8,%edx
call   1030 <memcpy@plt>
movb   $0x0,-0x9(%rbp)
lea    -0x11(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x10,%edx
call   1040 <strtoul@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpio_value>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rsi
lea    0x7(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x8,%edx
call   1030 <memcpy@plt>
movb   $0x0,0xf(%rsp)
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1040 <strtoul@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i64 @cpio_value(i8* %0) {
%2 = alloca i8*
%3 = alloca [9 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @memcpy(i8* %4, i8* %5, i32 8)
%7 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 8
store i8 0, i8* %7
%8 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 0
%9 = call i64 @strtoul(i8* %8, i8* null, i32 16)
ret i64 %9
}

LLVM IR (-O2):
define i64 @cpio_value(i8* %0) {
%2 = alloca [9 x i8]
%3 = getelementptr inbounds [9 x i8], [9 x i8]* %2, i64 0, i64 0
%4 = call i32 @memcpy(i8* %3, i8* %0, i32 8)
%5 = getelementptr inbounds [9 x i8], [9 x i8]* %2, i64 0, i64 8
store i8 0, i8* %5
%6 = call i64 @strtoul(i8* nocapture %3, i8* null, i32 16)
ret i64 %6
}
void _M2_delay_finish(__attribute__((unused)) int argc,
                      __attribute__((unused)) char *argv[]) {}


x86 assembly (clang, -O0):
<_M2_delay_finish>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @_M2_delay_finish(i32 %0, i8** nocapture %1) {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ _HibernateWriteComplete();
void HibernateTamperEventsClear(void) {
  (*((volatile uint32_t *)(0x400FC360))) = 0xA3359554;
  _HibernateWriteComplete();
  (*((volatile uint32_t *)(0x400FC400))) |= 0x00000010;
  _HibernateWriteComplete();
  (*((volatile uint32_t *)(0x400FC360))) = 0;
  _HibernateWriteComplete();
}


x86 assembly (clang, -O0):
<HibernateTamperEventsClear>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400fc360,%eax
movl   $0xa3359554,(%rax)
mov    $0x0,%al
call   1030 <_HibernateWriteComplete@plt>
mov    $0x400fc400,%eax
mov    (%rax),%ecx
or     $0x10,%ecx
mov    $0x400fc400,%eax
mov    %ecx,(%rax)
mov    $0x0,%al
call   1030 <_HibernateWriteComplete@plt>
mov    $0x400fc360,%eax
movl   $0x0,(%rax)
mov    $0x0,%al
call   1030 <_HibernateWriteComplete@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<HibernateTamperEventsClear>:
push   %rax
movl   $0xa3359554,0x400fc360
54 95 35 a3
xor    %eax,%eax
call   1030 <_HibernateWriteComplete@plt>
orl    $0x10,0x400fc400
10
xor    %eax,%eax
call   1030 <_HibernateWriteComplete@plt>
movl   $0x0,0x400fc360
xor    %eax,%eax
pop    %rcx
jmp    1030 <_HibernateWriteComplete@plt>

LLVM IR (-O0):
define void @HibernateTamperEventsClear() {
store volatile i32 -1556769452, i32* inttoptr (i64 1074774880 to i32*)
%1 = call i32 (...) @_HibernateWriteComplete()
%2 = load volatile i32, i32* inttoptr (i64 1074775040 to i32*)
%3 = or i32 %2, 16
store volatile i32 %3, i32* inttoptr (i64 1074775040 to i32*)
%4 = call i32 (...) @_HibernateWriteComplete()
store volatile i32 0, i32* inttoptr (i64 1074774880 to i32*)
%5 = call i32 (...) @_HibernateWriteComplete()
ret void
}

LLVM IR (-O2):
define void @HibernateTamperEventsClear() {
store volatile i32 -1556769452, i32* inttoptr (i64 1074774880 to i32*)
%1 = tail call i32 (...) @_HibernateWriteComplete()
%2 = load volatile i32, i32* inttoptr (i64 1074775040 to i32*)
%3 = or i32 %2, 16
store volatile i32 %3, i32* inttoptr (i64 1074775040 to i32*)
%4 = tail call i32 (...) @_HibernateWriteComplete()
store volatile i32 0, i32* inttoptr (i64 1074774880 to i32*)
%5 = tail call i32 (...) @_HibernateWriteComplete()
ret void
}
char *RCSid() {
  return RCSid("$Id: doc2rnh.c,v 1.17.4.1 2011/12/08 21:01:52 sfeam Exp $");
}


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

x86 assembly (clang, -O2):
<RCSid>:
jmp    1100 <RCSid>

LLVM IR (-O0):
@.str = [58 x i8] c"$Id: doc2rnh.c,v 1.17.4.1 2011/12/08 21:01:52 sfeam Exp $\00"
define i8* @RCSid() {
%1 = call i8* (i8*, ...) bitcast (i8* ()* @RCSid to i8* (i8*, ...)*)(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
define noalias i8* @RCSid() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int strcasecmp(char const *, char const *);
int OPENSSL_strcasecmp(const char *str1, const char *str2) {
  return strcasecmp(str1, str2);
}


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

x86 assembly (clang, -O2):
<OPENSSL_strcasecmp>:
jmp    1030 <strcasecmp@plt>

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

LLVM IR (-O2):
define i32 @OPENSSL_strcasecmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcasecmp(i8* %0, i8* %1)
ret i32 %3
}
int foo(int align) {
  int off = 0 % align;
  return off ? align - off : 0;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cltd
idivl  -0x4(%rbp)
mov    %edx,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1128 <foo+0x28>
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1132 <foo+0x32>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    1132 <foo+0x32>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
ret i32 0
}
/* Type definitions */
struct dm_interface {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ DM_DEV_SUSPEND;
int dev_cmd(struct dm_interface *, char const *, int /*<<< orphan*/,
            int /*<<< orphan*/);
int dm_resume_device(struct dm_interface *dmi, const char *name) {
  return dev_cmd(dmi, name, DM_DEV_SUSPEND, 0);
}


x86 assembly (clang, -O0):
<dm_resume_device>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    0x2eb1(%rip),%rax
mov    (%rax),%edx
xor    %ecx,%ecx
call   1030 <dev_cmd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dm_resume_device>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edx
xor    %ecx,%ecx
jmp    1030 <dev_cmd@plt>

LLVM IR (-O0):
%struct.dm_interface = type { i32 }
@DM_DEV_SUSPEND = global i32 0
define i32 @dm_resume_device(%struct.dm_interface* %0, i8* %1) {
%3 = alloca %struct.dm_interface*
%4 = alloca i8*
store %struct.dm_interface* %0, %struct.dm_interface** %3
store i8* %1, i8** %4
%5 = load %struct.dm_interface*, %struct.dm_interface** %3
%6 = load i8*, i8** %4
%7 = load i32, i32* @DM_DEV_SUSPEND
%8 = call i32 @dev_cmd(%struct.dm_interface* %5, i8* %6, i32 %7, i32 0)
ret i32 %8
}

LLVM IR (-O2):
%struct.dm_interface = type { i32 }
@DM_DEV_SUSPEND = global i32 0
define i32 @dm_resume_device(%struct.dm_interface* %0, i8* %1) {
%3 = load i32, i32* @DM_DEV_SUSPEND
%4 = tail call i32 @dev_cmd(%struct.dm_interface* %0, i8* %1, i32 %3, i32 0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(void) {
  int x = 5;
  int y = 8;
  if (y == 8) {
    if (x == 5) {
      puts("@@@@@");
    } else {
      puts("#####");
      puts("$$$$$");
    }
    puts("&&&&&");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movl   $0x8,-0xc(%rbp)
cmpl   $0x8,-0xc(%rbp)
jne    1176 <main+0x66>
cmpl   $0x5,-0x8(%rbp)
jne    1152 <main+0x42>
lea    0xeb8(%rip),%rdi
call   1030 <puts@plt>
jmp    116a <main+0x5a>
lea    0xead(%rip),%rdi
call   1030 <puts@plt>
lea    0xea7(%rip),%rdi
call   1030 <puts@plt>
lea    0xea1(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"@@@@@\00"
@.str.1 = [6 x i8] c"#####\00"
@.str.2 = [6 x i8] c"$$$$$\00"
@.str.3 = [6 x i8] c"&&&&&\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 5, i32* %2
store i32 8, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 8
br i1 %5, label %6, label %16
6: ; preds = %0
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, 5
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = call i32 @puts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %14
11: ; preds = %6
%12 = call i32 @puts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%13 = call i32 @puts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %14
14: ; preds = %11, %9
%15 = call i32 @puts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
br label %16
16: ; preds = %14, %0
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"@@@@@\00"
@.str.3 = [6 x i8] c"&&&&&\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}
float min2(float x, float y) { return x < y ? x : y; }


x86 assembly (clang, -O0):
<min2>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1130 <min2+0x30>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    113a <min2+0x3a>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<min2>:
minss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @min2(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp olt float %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load float, float* %3
br label %12
10: ; preds = %2
%11 = load float, float* %4
br label %12
12: ; preds = %10, %8
%13 = phi float [ %9, %8 ], [ %11, %10 ]
ret float %13
}

LLVM IR (-O2):
define float @min2(float %0, float %1) {
%3 = fcmp olt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
void ff_hevc_put_hevc_bi_epel_v64_10_avx2() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_epel_v64_10_avx2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ merge(int *, int, int, int);
void mergesort(int a[], int low, int high) {
  if (low < high) {
    int m = (high + low) / 2;
    mergesort(a, low, m);
    mergesort(a, m + 1, high);
    merge(a, low, m, high);
  }
}


x86 assembly (clang, -O0):
<mergesort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1182 <mergesort+0x62>
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1040 <mergesort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <mergesort@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1030 <merge@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mergesort>:
cmp    %edx,%esi
jge    1172 <mergesort+0x52>
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %esi,%r12d
mov    %rdi,%r15
lea    (%r14,%r12,1),%eax
mov    %eax,%ebx
shr    $0x1f,%ebx
add    %eax,%ebx
sar    %ebx
mov    %ebx,%edx
call   1040 <mergesort@plt>
lea    0x1(%rbx),%esi
mov    %r15,%rdi
mov    %r14d,%edx
call   1040 <mergesort@plt>
mov    %r15,%rdi
mov    %r12d,%esi
mov    %ebx,%edx
mov    %r14d,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <merge@plt>
ret

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

LLVM IR (-O2):
define void @mergesort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %6, label %5
5: ; preds = %3, %6
ret void
6: ; preds = %3
%7 = add nsw i32 %2, %1
%8 = sdiv i32 %7, 2
tail call void @mergesort(i32* %0, i32 %1, i32 %8)
%9 = add nsw i32 %8, 1
tail call void @mergesort(i32* %0, i32 %9, i32 %2)
%10 = tail call i32 @merge(i32* %0, i32 %1, i32 %8, i32 %2)
br label %5
}
int ddcl_path_absolute(const char *path) { return path[0] == '/'; }


x86 assembly (clang, -O0):
<ddcl_path_absolute>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ddcl_path_absolute>:
xor    %eax,%eax
cmpb   $0x2f,(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @ddcl_path_absolute(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 47
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @ddcl_path_absolute(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 47
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void yield(void) { usleep(100); }


x86 assembly (clang, -O0):
<yield>:
push   %rbp
mov    %rsp,%rbp
mov    $0x64,%edi
call   1030 <usleep@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<yield>:
mov    $0x64,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @yield() {
%1 = call i32 @usleep(i32 100)
ret void
}

LLVM IR (-O2):
define void @yield() {
%1 = tail call i32 @usleep(i32 100)
ret void
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
int32_t Function4Int32(int32_t a, int32_t b, int32_t c, int32_t d) {
  return a + b + c + d;
}


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

x86 assembly (clang, -O2):
<Function4Int32>:
lea    (%rdi,%rsi,1),%rax
add    %rdx,%rax
add    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @Function4Int32(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i64, i64* %5
%10 = load i64, i64* %6
%11 = add nsw i64 %9, %10
%12 = load i64, i64* %7
%13 = add nsw i64 %11, %12
%14 = load i64, i64* %8
%15 = add nsw i64 %13, %14
ret i64 %15
}

LLVM IR (-O2):
define i64 @Function4Int32(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = add nsw i64 %1, %0
%6 = add nsw i64 %5, %2
%7 = add nsw i64 %6, %3
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, size_t);
void *safe_malloc(size_t);
void *flatcopy(void *src, size_t len) {
  void *dst = safe_malloc(len);
  memcpy(dst, src, len);
  return dst;
}


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

x86 assembly (clang, -O2):
<flatcopy>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <safe_malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @flatcopy(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = call i8* @safe_malloc(i64 %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = load i8*, i8** %3
%10 = load i64, i64* %4
%11 = call i32 @memcpy(i8* %8, i8* %9, i64 %10)
%12 = load i8*, i8** %5
ret i8* %12
}

LLVM IR (-O2):
define i8* @flatcopy(i8* %0, i64 %1) {
%3 = tail call i8* @safe_malloc(i64 %1)
%4 = tail call i32 @memcpy(i8* %3, i8* %0, i64 %1)
ret i8* %3
}
int _is_leap_year(int year) {
  if (year & 0x3) {
    return 0;
  }
  return !!(year % 25) || !(year & 15);
}


x86 assembly (clang, -O0):
<_is_leap_year>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x3,%eax
cmp    $0x0,%eax
je     1122 <_is_leap_year+0x22>
movl   $0x0,-0x4(%rbp)
jmp    1157 <_is_leap_year+0x57>
mov    -0x8(%rbp),%eax
mov    $0x19,%ecx
cltd
idiv   %ecx
mov    $0x1,%al
cmp    $0x0,%edx
mov    %al,-0x9(%rbp)
jne    114c <_is_leap_year+0x4c>
mov    -0x8(%rbp),%eax
and    $0xf,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_is_leap_year>:
xor    %eax,%eax
test   $0x3,%dil
je     1109 <_is_leap_year+0x9>
ret
imul   $0xc28f5c29,%edi,%eax
add    $0x51eb851,%eax
cmp    $0xa3d70a3,%eax
setae  %al
test   $0xf,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @_is_leap_year(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = srem i32 %0, 25
%6 = icmp ne i32 %5, 0
%7 = and i32 %0, 15
%8 = icmp eq i32 %7, 0
%9 = or i1 %6, %8
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %1, %4
%12 = phi i32 [ %10, %4 ], [ 0, %1 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ foo(double);
int main() {
  foo(1.0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xed9(%rip),%xmm0
call   1030 <foo@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xee7(%rip),%xmm0
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @foo(double 1.000000e+00)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(double 1.000000e+00)
ret i32 0
}
void dummy_rectangle(long x1, long y1, long x2, long y2) {
  x1 = x1;
  y1 = y1;
  x2 = x2;
  y2 = y2;
}


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

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

LLVM IR (-O0):
define void @dummy_rectangle(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i64, i64* %5
store i64 %9, i64* %5
%10 = load i64, i64* %6
store i64 %10, i64* %6
%11 = load i64, i64* %7
store i64 %11, i64* %7
%12 = load i64, i64* %8
store i64 %12, i64* %8
ret void
}

LLVM IR (-O2):
define void @dummy_rectangle(i64 %0, i64 %1, i64 %2, i64 %3) {
ret void
}
/* Variables and functions */
double asin(double);
double acos(double x) {
  double pi;
  pi = 3.14159265358979;
  return (pi / 2) - asin(x);
}


x86 assembly (clang, -O0):
<acos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xee3(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xec9(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <asin@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
subsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<acos>:
push   %rax
call   1030 <asin@plt>
movsd  0xee2(%rip),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @acos(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
store double 0x400921FB54442D11, double* %3
%4 = load double, double* %3
%5 = fdiv double %4, 2.000000e+00
%6 = load double, double* %2
%7 = call double @asin(double %6)
%8 = fsub double %5, %7
ret double %8
}

LLVM IR (-O2):
define double @acos(double %0) {
%2 = tail call double @asin(double %0)
%3 = fsub double 0x3FF921FB54442D11, %2
ret double %3
}
unsigned long long get_cpu_clock(void) {
  unsigned long long ret;
  __asm__ __volatile__("rdtsc" : "=A"(ret));
  return ret;
}


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

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

LLVM IR (-O0):
define i64 @get_cpu_clock() {
%1 = alloca i64
%2 = call i64 asm sideeffect "rdtsc", "=A,~{dirflag},~{fpsr},~{flags}"()
store i64 %2, i64* %1
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @get_cpu_clock() {
%1 = tail call i64 asm sideeffect "rdtsc", "=A,~{dirflag},~{fpsr},~{flags}"()
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void dis_print_indent(int indent) {
  int i;
  for (i = 0; i < indent; i++) {
    printf(" ");
  }
}


x86 assembly (clang, -O0):
<dis_print_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 <dis_print_indent+0x38>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <dis_print_indent+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dis_print_indent>:
push   %rbx
test   %edi,%edi
jle    112f <dis_print_indent+0x1f>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <dis_print_indent+0x10>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
define void @dis_print_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 ([2 x i8], [2 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):
define void @dis_print_indent(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @putchar(i32 32)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
char *savestr(cp)
register char *cp;
{
  register int len;
  register char *new;
  len = strlen(cp) + 1;
  new = malloc(len);
  if (!new) {
    error("out of memory");
    exit(1);
  }
  return strncpy(new, cp, len);
}


x86 assembly (clang, -O0):
<savestr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%rax
mov    %eax,-0xc(%rbp)
movslq -0xc(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    119c <savestr+0x4c>
lea    0xe75(%rip),%rdi
mov    $0x0,%al
call   1060 <error@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rdx
call   1030 <strncpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<savestr>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
add    $0x1,%eax
movslq %eax,%rbx
mov    %rbx,%rdi
call   1050 <malloc@plt>
test   %rax,%rax
je     1184 <savestr+0x34>
mov    %rax,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <strncpy@plt>
lea    0xe75(%rip),%rdi
xor    %eax,%eax
call   1060 <error@plt>
mov    $0x1,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"out of memory\00"
define i8* @savestr(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @strlen(i8* %5)
%7 = add i64 %6, 1
%8 = trunc i64 %7 to i32
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = call i8* @malloc(i64 %10)
store i8* %11, i8** %4
%12 = load i8*, i8** %4
%13 = icmp ne i8* %12, null
br i1 %13, label %16, label %14
14: ; preds = %1
%15 = call i32 (i8*, ...) bitcast (i32 (...)* @error to i32 (i8*, ...)*)(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
unreachable
16: ; preds = %1
%17 = load i8*, i8** %4
%18 = load i8*, i8** %2
%19 = load i32, i32* %3
%20 = sext i32 %19 to i64
%21 = call i8* @strncpy(i8* %17, i8* %18, i64 %20)
ret i8* %21
}

LLVM IR (-O2):
@.str = [14 x i8] c"out of memory\00"
define i8* @savestr(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = shl i64 %2, 32
%4 = add i64 %3, 4294967296
%5 = ashr exact i64 %4, 32
%6 = tail call i8* @malloc(i64 %5)
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = tail call i32 (i8*, ...) bitcast (i32 (...)* @error to i32 (i8*, ...)*)(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
tail call void @exit(i32 1)
unreachable
10: ; preds = %1
%11 = tail call i8* @strncpy(i8* %6, i8* %0, i64 %5)
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void destroy_string(char *str) {
  if (str) {
    free(str);
  }
  return;
}


x86 assembly (clang, -O0):
<destroy_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <destroy_string+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<destroy_string>:
test   %rdi,%rdi
je     111a <destroy_string+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @destroy_string(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @destroy_string(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
scalar_t__ PATH_MAX;
char *malloc(scalar_t__);
char *realpath(char *, char *);
char *np_get_absolute_path(char *filename) {
  char *buf;
  if ((buf = malloc(PATH_MAX + 1)) == NULL) {
    return NULL;
  }
  char *exists = realpath(filename, buf);
  if (exists) {
    return buf;
  } else {
    return NULL;
  }
}


x86 assembly (clang, -O0):
<np_get_absolute_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%rdi
add    $0x1,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    115a <np_get_absolute_path+0x3a>
movq   $0x0,-0x8(%rbp)
jmp    118b <np_get_absolute_path+0x6b>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <realpath@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1183 <np_get_absolute_path+0x63>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    118b <np_get_absolute_path+0x6b>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<np_get_absolute_path>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    0x2ec2(%rip),%rax
mov    (%rax),%rdi
add    $0x1,%rdi
call   1040 <malloc@plt>
test   %rax,%rax
je     1156 <np_get_absolute_path+0x36>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
call   1030 <realpath@plt>
test   %rax,%rax
cmove  %rax,%rbx
jmp    1158 <np_get_absolute_path+0x38>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@PATH_MAX = global i64 0
define i8* @np_get_absolute_path(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
%6 = load i64, i64* @PATH_MAX
%7 = add nsw i64 %6, 1
%8 = call i8* @malloc(i64 %7)
store i8* %8, i8** %4
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %11
10: ; preds = %1
store i8* null, i8** %2
br label %20
11: ; preds = %1
%12 = load i8*, i8** %3
%13 = load i8*, i8** %4
%14 = call i8* @realpath(i8* %12, i8* %13)
store i8* %14, i8** %5
%15 = load i8*, i8** %5
%16 = icmp ne i8* %15, null
br i1 %16, label %17, label %19
17: ; preds = %11
%18 = load i8*, i8** %4
store i8* %18, i8** %2
br label %20
19: ; preds = %11
store i8* null, i8** %2
br label %20
20: ; preds = %19, %17, %10
%21 = load i8*, i8** %2
ret i8* %21
}

LLVM IR (-O2):
@PATH_MAX = global i64 0
define i8* @np_get_absolute_path(i8* nocapture %0) {
%2 = load i64, i64* @PATH_MAX
%3 = add nsw i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = tail call i8* @realpath(i8* %0, i8* %4)
%8 = icmp eq i8* %7, null
%9 = select i1 %8, i8* null, i8* %4
br label %10
10: ; preds = %1, %6
%11 = phi i8* [ %9, %6 ], [ null, %1 ]
ret i8* %11
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, int);
char *mp_encode_extl(char *, int /*<<< orphan*/, int);
char *mp_encode_ext(char *data, const char *str, uint8_t type, uint32_t len) {
  data = mp_encode_extl(data, type, len);
  memcpy(data, str, len);
  return data + len;
}


x86 assembly (clang, -O0):
<mp_encode_ext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1030 <mp_encode_extl@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%edx
call   1040 <memcpy@plt>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp_encode_ext>:
push   %r15
push   %r14
push   %rbx
mov    %ecx,%ebx
mov    %rsi,%r14
mov    %edx,%esi
mov    %ecx,%edx
call   1030 <mp_encode_extl@plt>
mov    %rax,%r15
mov    %rax,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   1040 <memcpy@plt>
movslq %ebx,%rax
add    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @mp_encode_ext(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i32, i32* %7
%11 = load i32, i32* %8
%12 = call i8* @mp_encode_extl(i8* %9, i32 %10, i32 %11)
store i8* %12, i8** %5
%13 = load i8*, i8** %5
%14 = load i8*, i8** %6
%15 = load i32, i32* %8
%16 = call i32 @memcpy(i8* %13, i8* %14, i32 %15)
%17 = load i8*, i8** %5
%18 = load i32, i32* %8
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %17, i64 %19
ret i8* %20
}

LLVM IR (-O2):
define i8* @mp_encode_ext(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i8* @mp_encode_extl(i8* %0, i32 %2, i32 %3)
%6 = tail call i32 @memcpy(i8* %5, i8* %1, i32 %3)
%7 = sext i32 %3 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
ret i8* %8
}
/* Variables and functions */
#define GLUT_DOWN 129
#define GLUT_LEFT_BUTTON 128
void mousedown(int button, int state, int x, int y) {
  switch (button) {
  case GLUT_LEFT_BUTTON:
    switch (state) { case GLUT_DOWN:; }
  }
}


x86 assembly (clang, -O0):
<mousedown>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x80,%eax
jne    1140 <mousedown+0x40>
jmp    1123 <mousedown+0x23>
mov    -0x8(%rbp),%eax
sub    $0x81,%eax
jne    113b <mousedown+0x3b>
jmp    1136 <mousedown+0x36>
jmp    113b <mousedown+0x3b>
jmp    1140 <mousedown+0x40>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @mousedown(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
switch i32 %9, label %14 [
i32 128, label %10
]
10: ; preds = %4
%11 = load i32, i32* %6
switch i32 %11, label %13 [
i32 129, label %12
]
12: ; preds = %10
br label %13
13: ; preds = %12, %10
br label %14
14: ; preds = %13, %4
ret void
}

LLVM IR (-O2):
define void @mousedown(i32 %0, i32 %1, i32 %2, i32 %3) {
ret void
}
/* Variables and functions */
float fmax(float a, float b) { return (a > b ? a : b); }


x86 assembly (clang, -O0):
<fmax>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    112c <fmax+0x2c>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1136 <fmax+0x36>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmax>:
maxss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @fmax(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp ogt float %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load float, float* %3
br label %12
10: ; preds = %2
%11 = load float, float* %4
br label %12
12: ; preds = %10, %8
%13 = phi float [ %9, %8 ], [ %11, %10 ]
ret float %13
}

LLVM IR (-O2):
define float @fmax(float %0, float %1) {
%3 = fcmp ogt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
char const *menu(void) { return "brazilske orahe"; }


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"brazilske orahe\00"
define i8* @menu() {
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [16 x i8] c"brazilske orahe\00"
define i8* @menu() {
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
scalar_t__ is_ready(int);
scalar_t__ read(int, void *, int);
size_t empty_fd(int fd, void *buffer, int size) {
  size_t bytes_copied = 0;
  while (is_ready(fd)) {
    bytes_copied += read(fd, buffer, size);
  }
  return bytes_copied;
}


x86 assembly (clang, -O0):
<empty_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <is_ready@plt>
cmp    $0x0,%rax
je     1168 <empty_fd+0x48>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <read@plt>
add    -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    113a <empty_fd+0x1a>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<empty_fd>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %rsi,%r15
mov    %edi,%ebp
call   1040 <is_ready@plt>
xor    %ebx,%ebx
test   %rax,%rax
je     115c <empty_fd+0x3c>
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
mov    %r15,%rsi
mov    %r14d,%edx
call   1030 <read@plt>
add    %rax,%rbx
mov    %ebp,%edi
call   1040 <is_ready@plt>
test   %rax,%rax
jne    1140 <empty_fd+0x20>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i64 @empty_fd(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i64 @is_ready(i32 %0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %12, label %6
6: ; preds = %3, %6
%7 = phi i64 [ %9, %6 ], [ 0, %3 ]
%8 = tail call i64 @read(i32 %0, i8* %1, i32 %2)
%9 = add i64 %8, %7
%10 = tail call i64 @is_ready(i32 %0)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %6
12: ; preds = %6, %3
%13 = phi i64 [ 0, %3 ], [ %9, %6 ]
ret i64 %13
}