xunge/DecIR huggingface dataset:
void __attribute__((weak)) __init_user(void) {}


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

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

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

LLVM IR (-O2):
define weak void @__init_user() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void handle_fizzbuzz(unsigned long int const i) {
  (void)i;
  (void)puts("fizzbuzz");
}


x86 assembly (clang, -O0):
<handle_fizzbuzz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [9 x i8] c"fizzbuzz\00"
define void @handle_fizzbuzz(i64 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}
int maxi(int n, int m) { return n >= m ? n : m; }


x86 assembly (clang, -O0):
<maxi>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     1121 <maxi+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <maxi+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<maxi>:
mov    %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @maxi(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Variables and functions */
scalar_t__ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ printf(char *, char const *);
void perror_exit(const char *msg) {
  if (errno)
    perror(msg);
  else
    printf("Error: %s!\n", msg);
  exit(-1);
}


x86 assembly (clang, -O0):
<perror_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
cmpq   $0x0,(%rax)
je     115b <perror_exit+0x2b>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
jmp    116b <perror_exit+0x3b>
mov    -0x8(%rbp),%rsi
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<perror_exit>:
push   %rax
mov    %rdi,%rsi
mov    0x2ea5(%rip),%rax
cmpq   $0x0,(%rax)
je     1153 <perror_exit+0x23>
mov    %rsi,%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@errno = global i64 0
@.str = [12 x i8] c"Error: %s!\0A\00"
define void @perror_exit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i64, i64* @errno
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @perror(i8* %6)
br label %11
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %9)
br label %11
11: ; preds = %8, %5
%12 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@errno = global i64 0
@.str = [12 x i8] c"Error: %s!\0A\00"
define void @perror_exit(i8* %0) {
%2 = load i64, i64* @errno
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @perror(i8* %0)
br label %8
6: ; preds = %1
%7 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %8
8: ; preds = %6, %4
%9 = tail call i32 @exit(i32 -1)
unreachable
}
int mycmp(const char *s1, const char *s2) {
  while (1) {
    if (*s1 != *s2) {
      break;
    } else if (*s1 == '\0') {
      break;
    }
    s1++;
    s2++;
  }
  return *s1 - *s2;
}


x86 assembly (clang, -O0):
<mycmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1127 <mycmp+0x27>
jmp    115e <mycmp+0x5e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    113c <mycmp+0x3c>
jmp    115e <mycmp+0x5e>
jmp    1141 <mycmp+0x41>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <mycmp+0xc>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mycmp>:
mov    (%rdi),%al
mov    (%rsi),%cl
test   %al,%al
je     1134 <mycmp+0x34>
cmp    %cl,%al
jne    1134 <mycmp+0x34>
mov    $0x1,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl (%rdi,%rdx,1),%eax
movzbl (%rsi,%rdx,1),%ecx
test   %al,%al
je     1134 <mycmp+0x34>
add    $0x1,%rdx
cmp    %cl,%al
je     1120 <mycmp+0x20>
movsbl %al,%eax
movsbl %cl,%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @mycmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp ne i8 %3, %4
%6 = icmp eq i8 %3, 0
%7 = or i1 %6, %5
br i1 %7, label %18, label %8
8: ; preds = %2, %8
%9 = phi i8* [ %12, %8 ], [ %1, %2 ]
%10 = phi i8* [ %11, %8 ], [ %0, %2 ]
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = getelementptr inbounds i8, i8* %9, i64 1
%13 = load i8, i8* %11
%14 = load i8, i8* %12
%15 = icmp ne i8 %13, %14
%16 = icmp eq i8 %13, 0
%17 = or i1 %16, %15
br i1 %17, label %18, label %8
18: ; preds = %8, %2
%19 = phi i8 [ %3, %2 ], [ %13, %8 ]
%20 = phi i8 [ %4, %2 ], [ %14, %8 ]
%21 = sext i8 %19 to i32
%22 = sext i8 %20 to i32
%23 = sub nsw i32 %21, %22
ret i32 %23
}
/* Variables and functions */
unsigned char gfx_inb(int);
int /*<<< orphan*/ gfx_outb(int, unsigned char);
unsigned char init_Centaurus_9211(void) {
  unsigned char ReadData;
  ReadData = gfx_inb(0xE0);
  ReadData &= ~0x10 & ~0x80;
  gfx_outb(0xE0, ReadData);
  ReadData = gfx_inb(0xE4);
  ReadData &= ~0x01 & ~0x02;
  gfx_outb(0xE4, ReadData);
  return (1);
}


x86 assembly (clang, -O0):
<init_Centaurus_9211>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xe0,%edi
call   1030 <gfx_inb@plt>
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0xffffff6f,%eax
mov    %al,-0x1(%rbp)
mov    $0xe0,%edi
movzbl -0x1(%rbp),%esi
call   1040 <gfx_outb@plt>
mov    $0xe4,%edi
call   1030 <gfx_inb@plt>
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0xfffffffc,%eax
mov    %al,-0x1(%rbp)
mov    $0xe4,%edi
movzbl -0x1(%rbp),%esi
call   1040 <gfx_outb@plt>
mov    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_Centaurus_9211>:
push   %rax
mov    $0xe0,%edi
call   1030 <gfx_inb@plt>
and    $0x6f,%al
movzbl %al,%esi
mov    $0xe0,%edi
call   1040 <gfx_outb@plt>
mov    $0xe4,%edi
call   1030 <gfx_inb@plt>
and    $0xfc,%al
movzbl %al,%esi
mov    $0xe4,%edi
call   1040 <gfx_outb@plt>
mov    $0x1,%al
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @init_Centaurus_9211() {
%1 = alloca i8
%2 = call zeroext i8 @gfx_inb(i32 224)
store i8 %2, i8* %1
%3 = load i8, i8* %1
%4 = zext i8 %3 to i32
%5 = and i32 %4, -145
%6 = trunc i32 %5 to i8
store i8 %6, i8* %1
%7 = load i8, i8* %1
%8 = call i32 @gfx_outb(i32 224, i8 zeroext %7)
%9 = call zeroext i8 @gfx_inb(i32 228)
store i8 %9, i8* %1
%10 = load i8, i8* %1
%11 = zext i8 %10 to i32
%12 = and i32 %11, -4
%13 = trunc i32 %12 to i8
store i8 %13, i8* %1
%14 = load i8, i8* %1
%15 = call i32 @gfx_outb(i32 228, i8 zeroext %14)
ret i8 1
}

LLVM IR (-O2):
define zeroext i8 @init_Centaurus_9211() {
%1 = tail call zeroext i8 @gfx_inb(i32 224)
%2 = and i8 %1, 111
%3 = tail call i32 @gfx_outb(i32 224, i8 zeroext %2)
%4 = tail call zeroext i8 @gfx_inb(i32 228)
%5 = and i8 %4, -4
%6 = tail call i32 @gfx_outb(i32 228, i8 zeroext %5)
ret i8 1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ readidel(int);
uint32_t ide_read_ter_l(uint16_t addr, void *priv) { return readidel(2); }


x86 assembly (clang, -O0):
<ide_read_ter_l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x2,%edi
call   1030 <readidel@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ide_read_ter_l>:
mov    $0x2,%edi
jmp    1030 <readidel@plt>

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

LLVM IR (-O2):
define i32 @ide_read_ter_l(i32 %0, i8* nocapture readnone %1) {
%3 = tail call i32 @readidel(i32 2)
ret i32 %3
}
/* Variables and functions */
scalar_t__ memcmp(void const *, void const *, size_t);
bool mem_equal(const void *p1, const void *p2, size_t n) {
  return memcmp(p1, p2, n) == 0;
}


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

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

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

LLVM IR (-O2):
define i32 @mem_equal(i8* %0, i8* %1, i64 %2) {
%4 = tail call i64 @memcmp(i8* %0, i8* %1, i64 %2)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
void Init_proj4_c_impl() {}


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

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

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

LLVM IR (-O2):
define void @Init_proj4_c_impl() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int usage(void) {
  fprintf(stderr,
          "Usage: igzip_file_perf [options] <infile>\n"
          "  -h        help\n"
          "  -X        use compression level X with 0 <= X <= 1\n"
          "  -b <size> input buffer size, 0 buffers all the input\n"
          "  -i <time> time in seconds to benchmark (at least 0)\n"
          "  -o <file> output file for compresed data\n"
          "  -d <file> dictionary file used by compression\n"
          "  -w <size> log base 2 size of history window, between 8 and 15\n");
  exit(0);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [377 x i8] c"Usage: igzip_file_perf [options] <infile>\0A -h help\0A -X use compression level X with 0 <= X <= 1\0A -b <size> input buffer size, 0 buffers all the input\0A -i <time> time in seconds to benchmark (at least 0)\0A -o <file> output file for compresed data\0A -d <file> dictionary file used by compression\0A -w <size> log base 2 size of history window, between 8 and 15\0A\00"
define i32 @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([377 x i8], [377 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [377 x i8] c"Usage: igzip_file_perf [options] <infile>\0A -h help\0A -X use compression level X with 0 <= X <= 1\0A -b <size> input buffer size, 0 buffers all the input\0A -i <time> time in seconds to benchmark (at least 0)\0A -o <file> output file for compresed data\0A -d <file> dictionary file used by compression\0A -w <size> log base 2 size of history window, between 8 and 15\0A\00"
define i32 @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([377 x i8], [377 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ freepowtable(int);
void freeallpowtable() {
  int base;
  for (base = 2; base <= 36; base++)
    if (base != 10)
      freepowtable(base);
}


x86 assembly (clang, -O0):
<freeallpowtable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x2,-0x4(%rbp)
cmpl   $0x24,-0x4(%rbp)
jg     114e <freeallpowtable+0x3e>
cmpl   $0xa,-0x4(%rbp)
je     113b <freeallpowtable+0x2b>
mov    -0x4(%rbp),%edi
call   1030 <freepowtable@plt>
jmp    1140 <freeallpowtable+0x30>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <freeallpowtable+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeallpowtable>:
push   %rbx
mov    $0x2,%ebx
jmp    1128 <freeallpowtable+0x18>
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebx
cmp    $0x25,%ebx
je     1136 <freeallpowtable+0x26>
cmp    $0xa,%ebx
je     1120 <freeallpowtable+0x10>
mov    %ebx,%edi
call   1030 <freepowtable@plt>
jmp    1120 <freeallpowtable+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @freeallpowtable() {
br label %1
1: ; preds = %0, %6
%2 = phi i32 [ 2, %0 ], [ %7, %6 ]
%3 = icmp eq i32 %2, 10
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @freepowtable(i32 %2)
br label %6
6: ; preds = %1, %4
%7 = add nuw nsw i32 %2, 1
%8 = icmp eq i32 %7, 37
br i1 %8, label %9, label %1
9: ; preds = %6
ret void
}
/* Type definitions */
struct irc_in_addr {
  int dummy;
};

/* Variables and functions */
char const *ircd_ntoa_r(char *, struct irc_in_addr const *);
const char *ircd_ntoa(const struct irc_in_addr *in) {
  static char buf[45];
  return ircd_ntoa_r(buf, in);
}


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

x86 assembly (clang, -O2):
<ircd_ntoa>:
mov    %rdi,%rsi
lea    0x2f26(%rip),%rdi
jmp    1030 <ircd_ntoa_r@plt>

LLVM IR (-O0):
%struct.irc_in_addr = type { i32 }
@ircd_ntoa.buf = internal global [45 x i8] zeroinitializer
define i8* @ircd_ntoa(%struct.irc_in_addr* %0) {
%2 = alloca %struct.irc_in_addr*
store %struct.irc_in_addr* %0, %struct.irc_in_addr** %2
%3 = load %struct.irc_in_addr*, %struct.irc_in_addr** %2
%4 = call i8* @ircd_ntoa_r(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @ircd_ntoa.buf, i64 0, i64 0), %struct.irc_in_addr* %3)
ret i8* %4
}

LLVM IR (-O2):
%struct.irc_in_addr = type { i32 }
@ircd_ntoa.buf = internal global [45 x i8] zeroinitializer
define i8* @ircd_ntoa(%struct.irc_in_addr* %0) {
%2 = tail call i8* @ircd_ntoa_r(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @ircd_ntoa.buf, i64 0, i64 0), %struct.irc_in_addr* %0)
ret i8* %2
}
/* Variables and functions */
scalar_t__ mysyscall(char *, long);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  char process_name[16];
  long id = 0;
  while (mysyscall(process_name, id) == 0) {
    id++;
    printf("%s\n", process_name);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x28(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1030 <mysyscall@plt>
cmp    $0x0,%rax
jne    1176 <main+0x56>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
lea    -0x20(%rbp),%rsi
lea    0xe94(%rip),%rdi
call   1040 <printf@plt>
jmp    113e <main+0x1e>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <mysyscall@plt>
test   %rax,%rax
jne    116f <main+0x4f>
mov    $0x1,%ebx
lea    0xebc(%rip),%r14
mov    %rsp,%r15
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <mysyscall@plt>
add    $0x1,%rbx
test   %rax,%rax
je     1150 <main+0x30>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [16 x i8]
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%5 = call i64 @mysyscall(i8* %4, i64 0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %2, %7
%8 = phi i64 [ %9, %7 ], [ 0, %2 ]
%9 = add nuw nsw i64 %8, 1
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%11 = call i64 @mysyscall(i8* %4, i64 %9)
%12 = icmp eq i64 %11, 0
br i1 %12, label %7, label %13
13: ; preds = %7, %2
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ s;

/* Variables and functions */
unsigned short htons(unsigned short);
int /*<<< orphan*/ memcpy(char *, unsigned short *, int);
unsigned short rfc1035Qid();
unsigned short rfc1035RetryQuery(char *buf) {
  unsigned short qid = rfc1035Qid();
  unsigned short s = htons(qid);
  memcpy(buf, &s, sizeof(s));
  return qid;
}


x86 assembly (clang, -O0):
<rfc1035RetryQuery>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1050 <rfc1035Qid@plt>
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%edi
call   1030 <htons@plt>
mov    %ax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x2,%edx
call   1040 <memcpy@plt>
movzwl -0xa(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rfc1035RetryQuery>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <rfc1035Qid@plt>
movzwl %ax,%ebp
mov    %ebp,%edi
call   1030 <htons@plt>
mov    %ax,0x6(%rsp)
lea    0x6(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x2,%edx
call   1040 <memcpy@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define zeroext i16 @rfc1035RetryQuery(i8* %0) {
%2 = alloca i8*
%3 = alloca i16
%4 = alloca i16
store i8* %0, i8** %2
%5 = call zeroext i16 (...) @rfc1035Qid()
store i16 %5, i16* %3
%6 = load i16, i16* %3
%7 = call zeroext i16 @htons(i16 zeroext %6)
store i16 %7, i16* %4
%8 = load i8*, i8** %2
%9 = call i32 @memcpy(i8* %8, i16* %4, i32 2)
%10 = load i16, i16* %3
ret i16 %10
}

LLVM IR (-O2):
define zeroext i16 @rfc1035RetryQuery(i8* %0) {
%2 = alloca i16
%3 = tail call zeroext i16 (...) @rfc1035Qid()
%4 = bitcast i16* %2 to i8*
%5 = tail call zeroext i16 @htons(i16 zeroext %3)
store i16 %5, i16* %2
%6 = call i32 @memcpy(i8* %0, i16* %2, i32 2)
ret i16 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void putint(int n) { printf("%d\n", n); }


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

x86 assembly (clang, -O2):
<putint>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @putint(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
void DestroyString() {}


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

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

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

LLVM IR (-O2):
define void @DestroyString() {
ret void
}
unsigned calc_width_bits(unsigned baudrate, unsigned widthselect,
                         unsigned clockselect) {
  unsigned tmp;
  if (widthselect)
    return (clockselect) ? 12 : 24;
  tmp = ((clockselect) ? 12 : 24) / (((115200 / (baudrate)) - 1) + 1);
  return (tmp > 0) ? (tmp - 1) : 0;
}


x86 assembly (clang, -O0):
<calc_width_bits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1132 <calc_width_bits+0x32>
mov    -0x10(%rbp),%edx
mov    $0x18,%eax
mov    $0xc,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    118c <calc_width_bits+0x8c>
mov    -0x10(%rbp),%edx
mov    $0x18,%eax
mov    $0xc,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    $0x1c200,%eax
xor    %edx,%edx
divl   -0x8(%rbp)
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
sub    $0x1,%ecx
add    $0x1,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jbe    117c <calc_width_bits+0x7c>
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1186 <calc_width_bits+0x86>
xor    %eax,%eax
mov    %eax,-0x1c(%rbp)
jmp    1186 <calc_width_bits+0x86>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_width_bits>:
test   %edx,%edx
mov    $0x18,%eax
mov    $0xc,%ecx
cmove  %eax,%ecx
test   %esi,%esi
je     1116 <calc_width_bits+0x16>
mov    %ecx,%eax
ret
xor    %r8d,%r8d
mov    $0x1c200,%eax
xor    %edx,%edx
div    %edi
mov    %eax,%esi
mov    %ecx,%eax
xor    %edx,%edx
div    %esi
add    $0xffffffff,%eax
cmp    %ecx,%esi
cmova  %r8d,%eax
mov    %eax,%ecx
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @calc_width_bits(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%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
%9 = load i32, i32* %6
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %3
%12 = load i32, i32* %7
%13 = icmp ne i32 %12, 0
%14 = zext i1 %13 to i64
%15 = select i1 %13, i32 12, i32 24
store i32 %15, i32* %4
br label %34
16: ; preds = %3
%17 = load i32, i32* %7
%18 = icmp ne i32 %17, 0
%19 = zext i1 %18 to i64
%20 = select i1 %18, i32 12, i32 24
%21 = load i32, i32* %5
%22 = udiv i32 115200, %21
%23 = sub i32 %22, 1
%24 = add i32 %23, 1
%25 = udiv i32 %20, %24
store i32 %25, i32* %8
%26 = load i32, i32* %8
%27 = icmp ugt i32 %26, 0
br i1 %27, label %28, label %31
28: ; preds = %16
%29 = load i32, i32* %8
%30 = sub i32 %29, 1
br label %32
31: ; preds = %16
br label %32
32: ; preds = %31, %28
%33 = phi i32 [ %30, %28 ], [ 0, %31 ]
store i32 %33, i32* %4
br label %34
34: ; preds = %32, %11
%35 = load i32, i32* %4
ret i32 %35
}

LLVM IR (-O2):
define i32 @calc_width_bits(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %1, 0
%5 = icmp eq i32 %2, 0
%6 = select i1 %5, i32 24, i32 12
br i1 %4, label %7, label %13
7: ; preds = %3
%8 = udiv i32 115200, %0
%9 = udiv i32 %6, %8
%10 = icmp ugt i32 %8, %6
%11 = add nsw i32 %9, -1
%12 = select i1 %10, i32 0, i32 %11
br label %13
13: ; preds = %3, %7
%14 = phi i32 [ %12, %7 ], [ %6, %3 ]
ret i32 %14
}
void changeValue(int *p) { *p = 500; }


x86 assembly (clang, -O0):
<changeValue>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x1f4,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<changeValue>:
movl   $0x1f4,(%rdi)
ret

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

LLVM IR (-O2):
define void @changeValue(i32* nocapture writeonly %0) {
store i32 500, i32* %0
ret void
}
int test_imm_C0int64_midword_reg(long long val) {
  return ((val >> 16) & (0xC0 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_C0int64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x10,%rdx
and    $0xc0,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_C0int64_midword_reg>:
test   $0xc00000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_C0int64_midword_reg(i64 %0) {
%2 = and i64 %0, 12582912
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int test_imm_D3uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0xD3 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_D3uint64_lowword_reg>:
test   $0xd3,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_D3uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 211
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ state;
};
struct TYPE_4__ {
  TYPE_1__ xcolormap;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
int get_XEvent_xcolormap_state(void *_p) {
  return (int)((XEvent *)_p)->xcolormap.state;
}


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

x86 assembly (clang, -O2):
<get_XEvent_xcolormap_state>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @get_XEvent_xcolormap_state(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
double distance_delta_periodic(double *, double *, double *, double *,
                               double *);
double distance_periodic(double *a, double *b, double *matrix,
                         double *reciprocal) {
  double delta[3];
  return distance_delta_periodic(a, b, delta, matrix, reciprocal);
}


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

x86 assembly (clang, -O2):
<distance_periodic>:
sub    $0x18,%rsp
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsp,%rdx
call   1030 <distance_delta_periodic@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @distance_periodic(double* %0, double* %1, double* %2, double* %3) {
%5 = alloca double*
%6 = alloca double*
%7 = alloca double*
%8 = alloca double*
%9 = alloca [3 x double]
store double* %0, double** %5
store double* %1, double** %6
store double* %2, double** %7
store double* %3, double** %8
%10 = load double*, double** %5
%11 = load double*, double** %6
%12 = getelementptr inbounds [3 x double], [3 x double]* %9, i64 0, i64 0
%13 = load double*, double** %7
%14 = load double*, double** %8
%15 = call double @distance_delta_periodic(double* %10, double* %11, double* %12, double* %13, double* %14)
ret double %15
}

LLVM IR (-O2):
define double @distance_periodic(double* %0, double* %1, double* %2, double* %3) {
%5 = alloca [3 x double]
%6 = bitcast [3 x double]* %5 to i8*
%7 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 0
%8 = call double @distance_delta_periodic(double* %0, double* %1, double* %7, double* %2, double* %3)
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ die(char *, unsigned long);
void *malloc(size_t);
void *safe_malloc(size_t size) {
  void *m = malloc(size);
  if (NULL == m) {
    die("Out of memory for %lu bytes", (unsigned long)size);
  }
  return m;
}


x86 assembly (clang, -O0):
<safe_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jne    1155 <safe_malloc+0x35>
mov    -0x8(%rbp),%rsi
lea    0xeb0(%rip),%rdi
call   1040 <die@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_malloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1143 <safe_malloc+0x23>
lea    0xec5(%rip),%rdi
mov    %r14,%rsi
call   1040 <die@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Out of memory for %lu bytes\00"
define i8* @safe_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* null, %6
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i64, i64* %2
%10 = call i32 @die(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i64 %9)
br label %11
11: ; preds = %8, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [28 x i8] c"Out of memory for %lu bytes\00"
define noalias i8* @safe_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @die(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int MV_VoiceAvailable(int);
int FX_VoiceAvailable(int priority) { return MV_VoiceAvailable(priority); }


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

x86 assembly (clang, -O2):
<FX_VoiceAvailable>:
jmp    1030 <MV_VoiceAvailable@plt>

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

LLVM IR (-O2):
define i32 @FX_VoiceAvailable(i32 %0) {
%2 = tail call i32 @MV_VoiceAvailable(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void main(int argc, char *argv[]) {
  while (--argc > 0) {
    printf("%s\n", argv[argc]);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
jle    114e <main+0x3e>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
jmp    111f <main+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
cmp    $0x2,%edi
jl     1149 <main+0x39>
mov    %rsi,%r15
mov    %edi,%ebx
add    $0x1,%rbx
lea    0xed6(%rip),%r14
nopw   0x0(%rax,%rax,1)
lea    -0x2(%rbx),%eax
mov    (%r15,%rax,8),%rsi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0xffffffffffffffff,%rbx
cmp    $0x2,%rbx
ja     1130 <main+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ %5, %4 ], [ %8, %6 ]
%8 = add nsw i64 %7, -1
%9 = and i64 %8, 4294967295
%10 = getelementptr inbounds i8*, i8** %1, i64 %9
%11 = load i8*, i8** %10
%12 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = icmp ugt i64 %7, 2
br i1 %13, label %6, label %14
14: ; preds = %6, %2
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ plabort(char *);
int /*<<< orphan*/ strcpy(char *, char const *);
int strlen(char const *);
char *plstrdup(const char *src) {
  char *dest = (char *)malloc((strlen(src) + 1) * sizeof(char));
  if (dest != NULL)
    strcpy(dest, src);
  else
    plabort("Out of memory");
  return dest;
}


x86 assembly (clang, -O0):
<plstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1186 <plstrdup+0x46>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
jmp    1192 <plstrdup+0x52>
lea    0xe73(%rip),%rdi
call   1050 <plabort@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plstrdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1169 <plstrdup+0x29>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
jmp    1175 <plstrdup+0x35>
lea    0xe90(%rip),%rdi
call   1050 <plabort@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"Out of memory\00"
define i8* @plstrdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i64 @malloc(i32 %3)
%5 = inttoptr i64 %4 to i8*
%6 = icmp eq i64 %4, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @strcpy(i8* %5, i8* %0)
br label %11
9: ; preds = %1
%10 = tail call i32 @plabort(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %7
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ TVM_Printf(char *);
void TVM_Shutdown(void) { TVM_Printf("==== TVM_Shutdown ====\n"); }


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

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

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

LLVM IR (-O2):
@.str = [24 x i8] c"==== TVM_Shutdown ====\0A\00"
define void @TVM_Shutdown() {
%1 = tail call i32 @TVM_Printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
int8_t stdlib_ndarray_set_ptr_int8(uint8_t *idx, const int8_t v) {
  *(int8_t *)idx = v;
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @stdlib_ndarray_set_ptr_int8(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
%6 = load i32*, i32** %3
store i32 %5, i32* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @stdlib_ndarray_set_ptr_int8(i32* nocapture writeonly %0, i32 %1) {
store i32 %1, i32* %0
ret i32 0
}
void BTIC1H_Range_Lock() {}


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

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

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

LLVM IR (-O2):
define void @BTIC1H_Range_Lock() {
ret void
}
int sys_strcpy(char *dst, char *src) {
  int i = 0;
  while (*(src + i) != 0x0) {
    *(dst + i) = *(src + i);
    i++;
  }
  *(dst + i) = 0x0;
  return i;
}


x86 assembly (clang, -O0):
<sys_strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     114c <sys_strcpy+0x4c>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <sys_strcpy+0x13>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_strcpy>:
mov    (%rsi),%cl
xor    %eax,%eax
test   %cl,%cl
je     1120 <sys_strcpy+0x20>
nopl   0x0(%rax,%rax,1)
mov    %cl,(%rdi,%rax,1)
movzbl 0x1(%rsi,%rax,1),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <sys_strcpy+0x10>
mov    %eax,%ecx
movb   $0x0,(%rdi,%rcx,1)
ret

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

LLVM IR (-O2):
define i32 @sys_strcpy(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %9, %5 ], [ 0, %2 ]
%7 = phi i8 [ %11, %5 ], [ %3, %2 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 %7, i8* %8
%9 = add nuw nsw i64 %6, 1
%10 = getelementptr inbounds i8, i8* %1, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5
%14 = trunc i64 %9 to i32
br label %15
15: ; preds = %13, %2
%16 = phi i32 [ 0, %2 ], [ %14, %13 ]
%17 = zext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %0, i64 %17
store i8 0, i8* %18
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ test_page();
int main(int argc, char **argv) {
  test_page();
  while (--argc)
    puts(*++argv);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <test_page@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     116c <main+0x4c>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    0x8(%rax),%rdi
call   1030 <puts@plt>
jmp    113d <main+0x1d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <test_page@plt>
cmp    $0x1,%ebp
je     1151 <main+0x31>
mov    %ebp,%ebp
mov    $0x1,%ebx
nopl   0x0(%rax)
mov    (%r14,%rbx,8),%rdi
call   1030 <puts@plt>
add    $0x1,%rbx
cmp    %ebx,%ebp
jne    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 (...) @test_page()
%4 = add nsw i32 %0, -1
%5 = icmp eq i32 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %2, %6
%7 = phi i32 [ %12, %6 ], [ %4, %2 ]
%8 = phi i8** [ %9, %6 ], [ %1, %2 ]
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32 @puts(i8* dereferenceable(1) %10)
%12 = add nsw i32 %7, -1
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret i32 0
}
int list_get_length(void *list) {
  void **l = list;
  int n = 0;
  while (*(l++))
    n++;
  return n;
}


x86 assembly (clang, -O0):
<list_get_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
cmpq   $0x0,(%rax)
je     113e <list_get_length+0x3e>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1117 <list_get_length+0x17>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_get_length>:
cmpq   $0x0,(%rdi)
je     111d <list_get_length+0x1d>
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
cmpq   $0x0,0x8(%rdi,%rax,8)
lea    0x1(%rax),%rax
jne    1110 <list_get_length+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @list_get_length(i8* nocapture %0) {
%2 = bitcast i8* %0 to i8**
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %12, label %5
5: ; preds = %1, %5
%6 = phi i32 [ %9, %5 ], [ 0, %1 ]
%7 = phi i8** [ %8, %5 ], [ %2, %1 ]
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = add nuw nsw i32 %6, 1
%10 = load i8*, i8** %8
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %5
12: ; preds = %5, %1
%13 = phi i32 [ 0, %1 ], [ %9, %5 ]
ret i32 %13
}