xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ heapsort(int *, int);
int /*<<< orphan*/ printList(int *, int);
int main(int argc, char **argv) {
  int l[27] = {2, 4, 1, 5,   6,  7, 9,  20,  -2,  54, 345, 43, 2, 5,
               6, 3, 7, 345, 56, 7, 34, 654, 324, 6,  42,  4,  5};
  printList(l, 27);
  heapsort(l, 27);
  printList(l, 27);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x80(%rbp),%rdi
lea    0xeb3(%rip),%rsi
mov    $0x6c,%edx
call   1040 <memcpy@plt>
lea    -0x80(%rbp),%rdi
mov    $0x1b,%esi
call   1050 <printList@plt>
lea    -0x80(%rbp),%rdi
mov    $0x1b,%esi
call   1030 <heapsort@plt>
lea    -0x80(%rbp),%rdi
mov    $0x1b,%esi
call   1050 <printList@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
movups 0xf30(%rip),%xmm0
movups %xmm0,0x5c(%rsp)
movaps 0xf18(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xefc(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xee0(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xec4(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xea8(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe8c(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1b,%esi
call   1040 <printList@plt>
mov    %rbx,%rdi
mov    $0x1b,%esi
call   1030 <heapsort@plt>
mov    %rbx,%rdi
mov    $0x1b,%esi
call   1040 <printList@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.l = [27 x i32] [i32 2, i32 4, i32 1, i32 5, i32 6, i32 7, i32 9, i32 20, i32 -2, i32 54, i32 345, i32 43, i32 2, i32 5, i32 6, i32 3, i32 7, i32 345, i32 56, i32 7, i32 34, i32 654, i32 324, i32 6, i32 42, i32 4, i32 5]
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca [27 x i32]
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = bitcast [27 x i32]* %5 to i8*
%7 = getelementptr inbounds [27 x i32], [27 x i32]* %5, i64 0, i64 0
%8 = call i32 @printList(i32* %7, i32 27)
%9 = getelementptr inbounds [27 x i32], [27 x i32]* %5, i64 0, i64 0
%10 = call i32 @heapsort(i32* %9, i32 27)
%11 = getelementptr inbounds [27 x i32], [27 x i32]* %5, i64 0, i64 0
%12 = call i32 @printList(i32* %11, i32 27)
ret i32 0
}

LLVM IR (-O2):
@__const.main.l = [27 x i32] [i32 2, i32 4, i32 1, i32 5, i32 6, i32 7, i32 9, i32 20, i32 -2, i32 54, i32 345, i32 43, i32 2, i32 5, i32 6, i32 3, i32 7, i32 345, i32 56, i32 7, i32 34, i32 654, i32 324, i32 6, i32 42, i32 4, i32 5]
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [27 x i32]
%4 = bitcast [27 x i32]* %3 to i8*
%5 = getelementptr inbounds [27 x i32], [27 x i32]* %3, i64 0, i64 0
%6 = call i32 @printList(i32* %5, i32 27)
%7 = call i32 @heapsort(i32* %5, i32 27)
%8 = call i32 @printList(i32* %5, i32 27)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ xip_fpo_recsqrt_d(double *, double);
double xil_fpo_recsqrt_d(double a) {
  double res_d;
  xip_fpo_recsqrt_d(&res_d, a);
  return res_d;
}


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

x86 assembly (clang, -O2):
<xil_fpo_recsqrt_d>:
push   %rax
mov    %rsp,%rdi
call   1030 <xip_fpo_recsqrt_d@plt>
movsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @xil_fpo_recsqrt_d(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call i32 @xip_fpo_recsqrt_d(double* %3, double %4)
%6 = load double, double* %3
ret double %6
}

LLVM IR (-O2):
define double @xil_fpo_recsqrt_d(double %0) {
%2 = alloca double
%3 = bitcast double* %2 to i8*
%4 = call i32 @xip_fpo_recsqrt_d(double* %2, double %0)
%5 = load double, double* %2
ret double %5
}
int ft_isdigit(int c) {
  int res;
  res = 1;
  if (c >= '0' && c <= '9')
    return (res);
  return (0);
}


x86 assembly (clang, -O0):
<ft_isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x30,-0x8(%rbp)
jl     112d <ft_isdigit+0x2d>
cmpl   $0x39,-0x8(%rbp)
jg     112d <ft_isdigit+0x2d>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1134 <ft_isdigit+0x34>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isdigit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @ft_isdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
void snd_para(void) {}


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

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

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

LLVM IR (-O2):
define void @snd_para() {
ret void
}
/* Variables and functions */
char const *vp_file_write(char *);
const char *vp_pipe_write(char *args) { return vp_file_write(args); }


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

x86 assembly (clang, -O2):
<vp_pipe_write>:
jmp    1030 <vp_file_write@plt>

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

LLVM IR (-O2):
define i8* @vp_pipe_write(i8* %0) {
%2 = tail call i8* @vp_file_write(i8* %0)
ret i8* %2
}
void usage(void) {
  (void)("Usage: edid-decode <options> [in [out]]\n"
         "  [in]                  EDID file to parse. Read from standard input "
         "if none given\n"
         "                        or if the input filename is '-'.\n"
         "  [out]                 Output the read EDID to this file. Write to "
         "standard output\n"
         "                        if the output filename is '-'.\n"
         "\nOptions:\n"
         "  -o, --output-format=<fmt>\n"
         "                        if [out] is specified, then write the EDID "
         "in this format\n"
         "                        <fmt> is one of:\n"
         "                        hex:    hex numbers in ascii text (default "
         "for stdout)\n"
         "                        raw:    binary data (default unless writing "
         "to stdout)\n"
         "                        carray: c-program struct\n"
         "  -c, --check           check if the EDID conforms to the standards\n"
         "  -e, --extract         extract the contents of the first block in "
         "hex values\n"
         "  -h, --help            display this help message\n");
}


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

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

LLVM IR (-O0):
@.str = [884 x i8] c"Usage: edid-decode <options> [in [out]]\0A [in] EDID file to parse. Read from standard input if none given\0A or if the input filename is '-'.\0A [out] Output the read EDID to this file. Write to standard output\0A if the output filename is '-'.\0A\0AOptions:\0A -o, --output-format=<fmt>\0A if [out] is specified, then write the EDID in this format\0A <fmt> is one of:\0A hex: hex numbers in ascii text (default for stdout)\0A raw: binary data (default unless writing to stdout)\0A carray: c-program struct\0A -c, --check check if the EDID conforms to the standards\0A -e, --extract extract the contents of the first block in hex values\0A -h, --help display this help message\0A\00"
define void @usage() {
ret void
}

LLVM IR (-O2):
define void @usage() {
ret void
}
/* Type definitions */
struct mmpool {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mmp_destroy(struct mmpool *);
void __mmp_destroy_agent(void *alloc) { mmp_destroy((struct mmpool *)alloc); }


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

x86 assembly (clang, -O2):
<__mmp_destroy_agent>:
jmp    1030 <mmp_destroy@plt>

LLVM IR (-O0):
%struct.mmpool = type { i32 }
define void @__mmp_destroy_agent(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.mmpool*
%5 = call i32 @mmp_destroy(%struct.mmpool* %4)
ret void
}

LLVM IR (-O2):
%struct.mmpool = type { i32 }
define void @__mmp_destroy_agent(i8* %0) {
%2 = bitcast i8* %0 to %struct.mmpool*
%3 = tail call i32 @mmp_destroy(%struct.mmpool* %2)
ret void
}
/* Variables and functions */
int _lex_empty_list();
bool lex_empty_list(char **name) {
  *name = "lex_empty_list";
  return _lex_empty_list();
}


x86 assembly (clang, -O0):
<lex_empty_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
lea    0xed9(%rip),%rcx
mov    %rcx,(%rax)
mov    $0x0,%al
call   1030 <_lex_empty_list@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lex_empty_list>:
lea    0xee9(%rip),%rax
mov    %rax,(%rdi)
xor    %eax,%eax
jmp    1030 <_lex_empty_list@plt>

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

LLVM IR (-O2):
@.str = [15 x i8] c"lex_empty_list\00"
define i32 @lex_empty_list(i8** nocapture writeonly %0) {
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8** %0
%2 = tail call i32 (...) @_lex_empty_list()
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char getc(int /*<<< orphan*/ *);
void comment(FILE *fp) {
  char a = '/';
  while (a != '\n') {
    a = getc(fp);
  }
}


x86 assembly (clang, -O0):
<comment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movb   $0x2f,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0xa,%eax
je     113e <comment+0x2e>
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
mov    %al,-0x9(%rbp)
jmp    1120 <comment+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<comment>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <getc@plt>
cmp    $0xa,%al
jne    1120 <comment+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @comment(i32* %0) {
%2 = alloca i32*
%3 = alloca i8
store i32* %0, i32** %2
store i8 47, i8* %3
br label %4
4: ; preds = %8, %1
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 10
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = load i32*, i32** %2
%10 = call signext i8 @getc(i32* %9)
store i8 %10, i8* %3
br label %4
11: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @comment(i32* nocapture %0) {
br label %2
2: ; preds = %1, %2
%3 = tail call signext i8 @getc(i32* %0)
%4 = icmp eq i8 %3, 10
br i1 %4, label %5, label %2
5: ; preds = %2
ret void
}
void leftshift() {
  register int x = 50, y = 0;
  while (x) {
    y = x << 1;
    x--;
  }
}


x86 assembly (clang, -O0):
<leftshift>:
push   %rbp
mov    %rsp,%rbp
movl   $0x32,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1133 <leftshift+0x33>
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    1112 <leftshift+0x12>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @leftshift() {
%1 = alloca i32
%2 = alloca i32
store i32 50, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %6, %0
%4 = load i32, i32* %1
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = load i32, i32* %1
%8 = shl i32 %7, 1
store i32 %8, i32* %2
%9 = load i32, i32* %1
%10 = add nsw i32 %9, -1
store i32 %10, i32* %1
br label %3
11: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @leftshift() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
uint16_t __x2short(uint16_t x) { return x; }


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

x86 assembly (clang, -O2):
<__x2short>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @__x2short(i32 returned %0) {
ret i32 %0
}
int watchdog_device_is_poweron_reset() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @watchdog_device_is_poweron_reset() {
ret i32 1
}
void no_op(void *ignored) { (void)ignored; }


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

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

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

LLVM IR (-O2):
define void @no_op(i8* nocapture %0) {
ret void
}
__attribute__((always_)) void __set_64bit(unsigned long long *ptr,
                                          unsigned int low, unsigned int high) {
  __asm__ __volatile__("\n1:\t"
                       "movl (%0), %%eax\n\t"
                       "movl 4(%0), %%edx\n\t"
                       "lock cmpxchg8b (%0)\n\t"
                       "jnz 1b"
                       :
                       : "D"(ptr), "b"(low), "c"(high)
                       : "ax", "dx", "memory");
}


x86 assembly (clang, -O0):
<__set_64bit>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%ebx
mov    -0x18(%rbp),%ecx
mov    (%rdi),%eax
mov    0x4(%rdi),%edx
lock cmpxchg8b (%rdi)
jne    1119 <__set_64bit+0x19>
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<__set_64bit>:
push   %rbx
mov    %edx,%ecx
mov    %esi,%ebx
mov    (%rdi),%eax
mov    0x4(%rdi),%edx
lock cmpxchg8b (%rdi)
jne    1105 <__set_64bit+0x5>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @__set_64bit(i64* %0, i32 %1, i32 %2) {
tail call void asm sideeffect "\0A1:\09movl ($0), %eax\0A\09movl 4($0), %edx\0A\09lock cmpxchg8b ($0)\0A\09jnz 1b", "{di},{bx},{cx},~{ax},~{dx},~{memory},~{dirflag},~{fpsr},~{flags}"(i64* %0, i32 %1, i32 %2)
ret void
}
/* Variables and functions */
int close(int);
int /*<<< orphan*/ printf(char *, char *);
void closeUARTFd(int UARTFd) {
  int res = close(UARTFd);
  if (res != 0)
    printf("Close failed: %s\n", "/dev/ttyAMA0");
}


x86 assembly (clang, -O0):
<closeUARTFd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1153 <closeUARTFd+0x33>
lea    0xeb9(%rip),%rdi
lea    0xec4(%rip),%rsi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<closeUARTFd>:
push   %rax
call   1040 <close@plt>
test   %eax,%eax
je     113e <closeUARTFd+0x1e>
lea    0xecf(%rip),%rdi
lea    0xeda(%rip),%rsi
pop    %rax
jmp    1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Close failed: %s\0A\00"
@.str.1 = [13 x i8] c"/dev/ttyAMA0\00"
define void @closeUARTFd(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @close(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"Close failed: %s\0A\00"
@.str.1 = [13 x i8] c"/dev/ttyAMA0\00"
define void @closeUARTFd(i32 %0) {
%2 = tail call i32 @close(i32 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ logger_set_use_color(int);
void logger_auto_use_color() { logger_set_use_color(true); }


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

x86 assembly (clang, -O2):
<logger_auto_use_color>:
mov    $0x1,%edi
jmp    1030 <logger_set_use_color@plt>

LLVM IR (-O0):
define void @logger_auto_use_color() {
%1 = call i32 @logger_set_use_color(i32 1)
ret void
}

LLVM IR (-O2):
define void @logger_auto_use_color() {
%1 = tail call i32 @logger_set_use_color(i32 1)
ret void
}
/* Variables and functions */
size_t _sl4_hash_func_str(const void *key) {
  size_t h;
  const unsigned char *k;
  k = (const unsigned char *)key;
  for (h = 0; *k; k++) {
    h += 16777619;
    h ^= *k;
  }
  return h;
}


x86 assembly (clang, -O0):
<_sl4_hash_func_str>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1153 <_sl4_hash_func_str+0x53>
mov    -0x10(%rbp),%rax
add    $0x1000193,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
movzbl (%rax),%eax
xor    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1118 <_sl4_hash_func_str+0x18>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_sl4_hash_func_str>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <_sl4_hash_func_str+0x28>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
add    $0x1000193,%rax
movzbl %cl,%ecx
xor    %rcx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <_sl4_hash_func_str+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @_sl4_hash_func_str(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
store i8* %5, i8** %4
store i64 0, i64* %3
br label %6
6: ; preds = %18, %1
%7 = load i8*, i8** %4
%8 = load i8, i8* %7
%9 = icmp ne i8 %8, 0
br i1 %9, label %10, label %21
10: ; preds = %6
%11 = load i64, i64* %3
%12 = add i64 %11, 16777619
store i64 %12, i64* %3
%13 = load i8*, i8** %4
%14 = load i8, i8* %13
%15 = zext i8 %14 to i64
%16 = load i64, i64* %3
%17 = xor i64 %16, %15
store i64 %17, i64* %3
br label %18
18: ; preds = %10
%19 = load i8*, i8** %4
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %4
br label %6
21: ; preds = %6
%22 = load i64, i64* %3
ret i64 %22
}

LLVM IR (-O2):
define i64 @_sl4_hash_func_str(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %11, %4 ], [ %0, %1 ]
%7 = phi i64 [ %10, %4 ], [ 0, %1 ]
%8 = add i64 %7, 16777619
%9 = zext i8 %5 to i64
%10 = xor i64 %8, %9
%11 = getelementptr inbounds i8, i8* %6, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 0, %1 ], [ %10, %4 ]
ret i64 %15
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
uint8_t ssd1306_get_status(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ssd1306_get_status() {
ret i32 0
}
int isprimer(int a) {
  int j;
  for (j = 2; j < a; j++) {
    if (a % j == 0) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<isprimer>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1149 <isprimer+0x49>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1136 <isprimer+0x36>
movl   $0x1,-0x4(%rbp)
jmp    1150 <isprimer+0x50>
jmp    113b <isprimer+0x3b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <isprimer+0xe>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isprimer>:
xor    %ecx,%ecx
cmp    $0x3,%edi
jl     1120 <isprimer+0x20>
mov    $0x2,%esi
nopl   0x0(%rax)
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1123 <isprimer+0x23>
add    $0x1,%esi
cmp    %esi,%edi
jne    1110 <isprimer+0x10>
mov    %ecx,%eax
ret
mov    $0x1,%ecx
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @isprimer(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 2, i32* %4
br label %5
5: ; preds = %16, %1
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %19
9: ; preds = %5
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = srem i32 %10, %11
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %9
store i32 1, i32* %2
br label %20
15: ; preds = %9
br label %16
16: ; preds = %15
%17 = load i32, i32* %4
%18 = add nsw i32 %17, 1
store i32 %18, i32* %4
br label %5
19: ; preds = %5
store i32 0, i32* %2
br label %20
20: ; preds = %19, %14
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
define i32 @isprimer(i32 %0) {
%2 = icmp sgt i32 %0, 2
br i1 %2, label %5, label %10
3: ; preds = %5
%4 = icmp eq i32 %9, %0
br i1 %4, label %10, label %5
5: ; preds = %1, %3
%6 = phi i32 [ %9, %3 ], [ 2, %1 ]
%7 = srem i32 %0, %6
%8 = icmp eq i32 %7, 0
%9 = add nuw nsw i32 %6, 1
br i1 %8, label %10, label %3
10: ; preds = %5, %3, %1
%11 = phi i32 [ 0, %1 ], [ 0, %3 ], [ 1, %5 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ CAN0_DriverIRQHandler();
__attribute__((weak)) void CAN0_ORed_Message_buffer_IRQHandler(void) {
  CAN0_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @CAN0_ORed_Message_buffer_IRQHandler() {
%1 = call i32 (...) @CAN0_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @CAN0_ORed_Message_buffer_IRQHandler() {
%1 = tail call i32 (...) @CAN0_DriverIRQHandler()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *program_name) {
  fprintf(stderr,
          "USAGE: %s -v | [-s] data_header_filename index_header_filename "
          "data_sequence_filename index_sequence_filename fasta_filename\n"
          "\t-s\tsort index file\n"
          "\nBases on a Design and Implementation of Andreas W. Hauser "
          "<hauser@genzentrum.lmu.de>.\n",
          program_name);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [233 x i8] c"USAGE: %s -v | [-s] data_header_filename index_header_filename data_sequence_filename index_sequence_filename fasta_filename\0A\09-s\09sort index file\0A\0ABases on a Design and Implementation of Andreas W. Hauser <hauser@genzentrum.lmu.de>.\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([233 x i8], [233 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [233 x i8] c"USAGE: %s -v | [-s] data_header_filename index_header_filename data_sequence_filename index_sequence_filename fasta_filename\0A\09-s\09sort index file\0A\0ABases on a Design and Implementation of Andreas W. Hauser <hauser@genzentrum.lmu.de>.\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([233 x i8], [233 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, size_t);
void mini_printf(char *str, int fd) {
  char *p;
  if (str == NULL)
    return;
  p = str;
  while (*p)
    p++;
  write(fd, str, (size_t)(p - str));
}


x86 assembly (clang, -O0):
<mini_printf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112f <mini_printf+0x1f>
jmp    116c <mini_printf+0x5c>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1155 <mini_printf+0x45>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1137 <mini_printf+0x27>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x8(%rbp),%rax
sub    %rax,%rdx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mini_printf>:
test   %rdi,%rdi
je     1135 <mini_printf+0x25>
mov    %rdi,%rax
mov    $0xffffffffffffffff,%rdx
nop
cmpb   $0x0,0x1(%rax,%rdx,1)
lea    0x1(%rdx),%rdx
jne    1120 <mini_printf+0x10>
mov    %esi,%edi
mov    %rax,%rsi
jmp    1030 <write@plt>
ret

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

LLVM IR (-O2):
define void @mini_printf(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %14, label %4
4: ; preds = %2, %4
%5 = phi i8* [ %8, %4 ], [ %0, %2 ]
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = getelementptr inbounds i8, i8* %5, i64 1
br i1 %7, label %9, label %4
9: ; preds = %4
%10 = ptrtoint i8* %5 to i64
%11 = ptrtoint i8* %0 to i64
%12 = sub i64 %10, %11
%13 = tail call i32 @write(i32 %1, i8* %0, i64 %12)
br label %14
14: ; preds = %2, %9
ret void
}
void wait(unsigned char ms) {
  unsigned int t;
  while (ms > 0) {
    for (t = 210; t > 0; t--)
      ;
    ms--;
  }
}


x86 assembly (clang, -O0):
<wait>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x0,%eax
jle    1148 <wait+0x48>
movl   $0xd2,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jbe    113b <wait+0x3b>
jmp    112d <wait+0x2d>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    111e <wait+0x1e>
mov    -0x1(%rbp),%al
add    $0xff,%al
mov    %al,-0x1(%rbp)
jmp    110a <wait+0xa>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @wait(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
br label %4
4: ; preds = %16, %1
%5 = load i8, i8* %2
%6 = zext i8 %5 to i32
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %19
8: ; preds = %4
store i32 210, i32* %3
br label %9
9: ; preds = %13, %8
%10 = load i32, i32* %3
%11 = icmp ugt i32 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %9
br label %13
13: ; preds = %12
%14 = load i32, i32* %3
%15 = add i32 %14, -1
store i32 %15, i32* %3
br label %9
16: ; preds = %9
%17 = load i8, i8* %2
%18 = add i8 %17, -1
store i8 %18, i8* %2
br label %4
19: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @wait(i8 zeroext %0) {
ret void
}
subi(a) { return 100 - a; }


x86 assembly (clang, -O0):
<subi>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x64,%eax
sub    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<subi>:
mov    $0x64,%eax
sub    %edi,%eax
ret

LLVM IR (-O0):
define i32 @subi(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 100, %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @subi(i32 %0) {
%2 = sub nsw i32 100, %0
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
void testmain() { print("include guard"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"include guard\00"
define void @testmain() {
%1 = call i32 @print(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"include guard\00"
define void @testmain() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}
int test_imm_27uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x27 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_27uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 2555904
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ link_error();
int test7(int *intarr) {
  extern int foo7(int);
  int u = 7, v1;
  foo7(u);
  v1 = u;
  if (v1 != 7)
    link_error();
  return v1;
}


x86 assembly (clang, -O0):
<test7>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x7,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <foo7@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x7,-0x10(%rbp)
je     1152 <test7+0x32>
mov    $0x0,%al
call   1030 <link_error@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test7>:
push   %rax
mov    $0x7,%edi
call   1030 <foo7@plt>
mov    $0x7,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @test7(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
store i32 7, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @foo7(i32 %5)
%7 = load i32, i32* %3
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 7
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = call i32 (...) @link_error()
br label %12
12: ; preds = %10, %1
%13 = load i32, i32* %4
ret i32 %13
}

LLVM IR (-O2):
define i32 @test7(i32* nocapture readnone %0) {
%2 = tail call i32 @foo7(i32 7)
ret i32 7
}
void gkpd_report_key(int code, int value) {}


x86 assembly (clang, -O0):
<gkpd_report_key>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @gkpd_report_key(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
void foo(int *x) {
  free(x);
  free(x);
}


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

x86 assembly (clang, -O2):
<foo>:
push   %rbx
mov    %rdi,%rbx
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @foo(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @free(i32* %3)
%5 = load i32*, i32** %2
%6 = call i32 @free(i32* %5)
ret void
}

LLVM IR (-O2):
define void @foo(i32* nocapture %0) {
%2 = tail call i32 @free(i32* %0)
%3 = tail call i32 @free(i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ allocator_default();
int /*<<< orphan*/ buffer_init(int /*<<< orphan*/, int /*<<< orphan*/);
void _ensure_buffer_init_copes_with_null_buffer(void) {
  buffer_init(0, allocator_default());
}


x86 assembly (clang, -O0):
<_ensure_buffer_init_copes_with_null_buffer>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <allocator_default@plt>
mov    %eax,%esi
xor    %edi,%edi
call   1040 <buffer_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ensure_buffer_init_copes_with_null_buffer>:
push   %rax
xor    %eax,%eax
call   1030 <allocator_default@plt>
xor    %edi,%edi
mov    %eax,%esi
pop    %rax
jmp    1040 <buffer_init@plt>

LLVM IR (-O0):
define void @_ensure_buffer_init_copes_with_null_buffer() {
%1 = call i32 (...) @allocator_default()
%2 = call i32 @buffer_init(i32 0, i32 %1)
ret void
}

LLVM IR (-O2):
define void @_ensure_buffer_init_copes_with_null_buffer() {
%1 = tail call i32 (...) @allocator_default()
%2 = tail call i32 @buffer_init(i32 0, i32 %1)
ret void
}
/* Variables and functions */
char *concat(char *, char const *);
int /*<<< orphan*/ free(char *);
void append_to(char **target, const char *a) {
  char *dst = *target;
  if (!dst)
    *target = concat("", a);
  else {
    char *tmp = concat(dst, a);
    free(dst);
    *target = tmp;
  }
}


x86 assembly (clang, -O0):
<append_to>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1165 <append_to+0x45>
mov    -0x10(%rbp),%rsi
lea    0xeaf(%rip),%rdi
call   1040 <concat@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
jmp    118a <append_to+0x6a>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <concat@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<append_to>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
mov    (%rdi),%rbx
test   %rbx,%rbx
je     1145 <append_to+0x25>
mov    %rbx,%rdi
call   1040 <concat@plt>
mov    %rax,%r15
mov    %rbx,%rdi
call   1030 <free@plt>
jmp    1154 <append_to+0x34>
lea    0xeb4(%rip),%rdi
call   1040 <concat@plt>
mov    %rax,%r15
mov    %r15,(%r14)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @append_to(i8** %0, i8* %1) {
%3 = alloca i8**
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8** %0, i8*** %3
store i8* %1, i8** %4
%7 = load i8**, i8*** %3
%8 = load i8*, i8** %7
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %15, label %11
11: ; preds = %2
%12 = load i8*, i8** %4
%13 = call i8* @concat(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = load i8**, i8*** %3
store i8* %13, i8** %14
br label %23
15: ; preds = %2
%16 = load i8*, i8** %5
%17 = load i8*, i8** %4
%18 = call i8* @concat(i8* %16, i8* %17)
store i8* %18, i8** %6
%19 = load i8*, i8** %5
%20 = call i32 @free(i8* %19)
%21 = load i8*, i8** %6
%22 = load i8**, i8*** %3
store i8* %21, i8** %22
br label %23
23: ; preds = %15, %11
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define void @append_to(i8** nocapture %0, i8* %1) {
%3 = load i8*, i8** %0
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i8* @concat(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %1)
br label %10
7: ; preds = %2
%8 = tail call i8* @concat(i8* %3, i8* %1)
%9 = tail call i32 @free(i8* %3)
br label %10
10: ; preds = %7, %5
%11 = phi i8* [ %6, %5 ], [ %8, %7 ]
store i8* %11, i8** %0
ret void
}
int left(int i) { return (2 * i + 1); }


x86 assembly (clang, -O0):
<left>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<left>:
lea    (%rdi,%rdi,1),%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @left(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = or i32 %2, 1
ret i32 %3
}
void initv(double *r, const double x, const double y, const double z) {
  r[0] = x;
  r[1] = y;
  r[2] = z;
}


x86 assembly (clang, -O0):
<initv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x18(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0x20(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<initv>:
movsd  %xmm0,(%rdi)
movsd  %xmm1,0x8(%rdi)
movsd  %xmm2,0x10(%rdi)
ret

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

LLVM IR (-O2):
define void @initv(double* nocapture writeonly %0, double %1, double %2, double %3) {
store double %1, double* %0
%5 = getelementptr inbounds double, double* %0, i64 1
store double %2, double* %5
%6 = getelementptr inbounds double, double* %0, i64 2
store double %3, double* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void close_and_clean(int epollfd) { close(epollfd); }


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

x86 assembly (clang, -O2):
<close_and_clean>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @close_and_clean(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void landing(register void *any, const char *info) {
  printf("Monkey landing %s\n", info);
}


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

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

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

LLVM IR (-O2):
@.str = [19 x i8] c"Monkey landing %s\0A\00"
define void @landing(i8* nocapture readnone %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
long long __builtin_wasm_trunc_saturate_u_i64_f32(float);
long long trunc_saturate_u_i64_f32(float f) {
  return __builtin_wasm_trunc_saturate_u_i64_f32(f);
}


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

x86 assembly (clang, -O2):
<trunc_saturate_u_i64_f32>:
jmp    1030 <__builtin_wasm_trunc_saturate_u_i64_f32@plt>

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

LLVM IR (-O2):
define i64 @trunc_saturate_u_i64_f32(float %0) {
%2 = tail call i64 @__builtin_wasm_trunc_saturate_u_i64_f32(float %0)
ret i64 %2
}
void CopyRow_AVX() {}


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

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

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

LLVM IR (-O2):
define void @CopyRow_AVX() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("A .c is used to end a C program filename.\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [43 x i8] c"A .c is used to end a C program filename.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [42 x i8] c"A .c is used to end a C program filename.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void RTUtf16Len(void) {}


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

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

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

LLVM IR (-O2):
define void @RTUtf16Len() {
ret void
}
/* Variables and functions */
double alpha_n(double const);
double beta_n(double const);
double n_inf(const double V_tilde) {
  return alpha_n(V_tilde) / (alpha_n(V_tilde) + beta_n(V_tilde));
}


x86 assembly (clang, -O0):
<n_inf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <alpha_n@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <alpha_n@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <beta_n@plt>
movsd  -0x18(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x10(%rbp),%xmm0
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<n_inf>:
sub    $0x18,%rsp
movsd  %xmm0,(%rsp)
call   1030 <alpha_n@plt>
movsd  %xmm0,0x10(%rsp)
movsd  (%rsp),%xmm0
call   1030 <alpha_n@plt>
movsd  %xmm0,0x8(%rsp)
movsd  (%rsp),%xmm0
call   1040 <beta_n@plt>
addsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @n_inf(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @alpha_n(double %3)
%5 = load double, double* %2
%6 = call double @alpha_n(double %5)
%7 = load double, double* %2
%8 = call double @beta_n(double %7)
%9 = fadd double %6, %8
%10 = fdiv double %4, %9
ret double %10
}

LLVM IR (-O2):
define double @n_inf(double %0) {
%2 = tail call double @alpha_n(double %0)
%3 = tail call double @alpha_n(double %0)
%4 = tail call double @beta_n(double %0)
%5 = fadd double %3, %4
%6 = fdiv double %2, %5
ret double %6
}
/* Variables and functions */
int strcmp(char const *, char const *);
int bsearch_strcmp(const void *v1, const void *v2) {
  const char *s1 = *(const char **)v1;
  const char *s2 = *(const char **)v2;
  return strcmp(s1, s2);
}


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

x86 assembly (clang, -O2):
<bsearch_strcmp>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @bsearch_strcmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i8**
%9 = load i8*, i8** %8
store i8* %9, i8** %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i8**
%12 = load i8*, i8** %11
store i8* %12, i8** %6
%13 = load i8*, i8** %5
%14 = load i8*, i8** %6
%15 = call i32 @strcmp(i8* %13, i8* %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @bsearch_strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Variables and functions */
int ptrtest4(int(f)(int), int x) { return f(x); }


x86 assembly (clang, -O0):
<ptrtest4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%edi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptrtest4>:
mov    %rdi,%rax
mov    %esi,%edi
jmp    *%rax

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

LLVM IR (-O2):
define i32 @ptrtest4(i32 (i32)* nocapture %0, i32 %1) {
%3 = tail call i32 %0(i32 %1)
ret i32 %3
}
/* Variables and functions */
int strcmp(char *, char *);
int strpcmp(const void *ap, const void *bp) {
  return strcmp(*(char **)ap, *(char **)bp);
}


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

x86 assembly (clang, -O2):
<strpcmp>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @strpcmp(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 = bitcast i8* %5 to i8**
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = call i32 @strcmp(i8* %7, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @strpcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}