xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ SwapByteOrder_64(int /*<<< orphan*/);
void bswap_64(const size_t n, void *u) {
  uint64_t *T = u;
  size_t i;
  for (i = 0; i < n; i++) {
    *(T + i) = SwapByteOrder_64(*(T + i));
  }
  return;
}


x86 assembly (clang, -O0):
<bswap_64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    116c <bswap_64+0x5c>
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1030 <SwapByteOrder_64@plt>
mov    %eax,%edx
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1130 <bswap_64+0x20>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bswap_64>:
push   %r15
push   %r14
push   %rbx
test   %rdi,%rdi
je     1146 <bswap_64+0x36>
mov    %rsi,%r15
mov    %rdi,%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r15,%rbx,4),%edi
call   1030 <SwapByteOrder_64@plt>
mov    %eax,(%r15,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1130 <bswap_64+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @bswap_64(i64 %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i32*
%4 = icmp eq i64 %0, 0
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %10, %5 ], [ 0, %2 ]
%7 = getelementptr inbounds i32, i32* %3, i64 %6
%8 = load i32, i32* %7
%9 = tail call i32 @SwapByteOrder_64(i32 %8)
store i32 %9, i32* %7
%10 = add nuw i64 %6, 1
%11 = icmp eq i64 %10, %0
br i1 %11, label %12, label %5
12: ; preds = %5, %2
ret void
}
void jsr() {
  asm volatile("movq (%%r11), %%rax\n\t"
               "test %%rax, %%rax\n\t"
               "jz _skipJsr\n\t"
               "movq %%rsp, %%r13\n\t"
               "movq %%r15, %%rsp\n\t"
               "movq %%r14, %%rdx\n\t"
               "movq (%%rsp), %%rcx\n\t"
               "pushq (%%r13)\n\t"
               "pushq %%rdx\n\t"
               "subq %%rdx, %%rcx\n\t"
               "movq %%rsp, %%r15\n\t"
               "movq %%r13, %%rsp\n\t"
               "movq 0x8(%%rsp), %%rax\n\t"
               "movq -0x8(%%rax), %%rbx\n\t"
               "subq %%rcx, %%rbx\n\t"
               "subq %%rbx, %%r14\n\t"
               "popq %%rax\n\t"
               "subq %%rbx, (%%r15)\n\t"
               "popq %%rax\n\t"
               "add $0x8, %%r11\n\t"
               "jmp *%%rax\n\t"
               "_skipJsr:\n\t"
               "popq %%rax\n\t" ::
                   :);
}


x86 assembly (clang, -O0):
<jsr>:
push   %rbp
mov    %rsp,%rbp
mov    (%r11),%rax
test   %rax,%rax
je     1145 <_skipJsr>
mov    %rsp,%r13
mov    %r15,%rsp
mov    %r14,%rdx
mov    (%rsp),%rcx
push   0x0(%r13)
push   %rdx
sub    %rdx,%rcx
mov    %rsp,%r15
mov    %r13,%rsp
mov    0x8(%rsp),%rax
mov    -0x8(%rax),%rbx
sub    %rcx,%rbx
sub    %rbx,%r14
pop    %rax
sub    %rbx,(%r15)
pop    %rax
add    $0x8,%r11
jmp    *%rax

x86 assembly (clang, -O2):
<jsr>:
mov    (%r11),%rax
test   %rax,%rax
je     113d <_skipJsr>
mov    %rsp,%r13
mov    %r15,%rsp
mov    %r14,%rdx
mov    (%rsp),%rcx
push   0x0(%r13)
push   %rdx
sub    %rdx,%rcx
mov    %rsp,%r15
mov    %r13,%rsp
mov    0x8(%rsp),%rax
mov    -0x8(%rax),%rbx
sub    %rcx,%rbx
sub    %rbx,%r14
pop    %rax
sub    %rbx,(%r15)
pop    %rax
add    $0x8,%r11
jmp    *%rax

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

LLVM IR (-O2):
define void @jsr() {
tail call void asm sideeffect "movq (%r11), %rax\0A\09test %rax, %rax\0A\09jz _skipJsr\0A\09movq %rsp, %r13\0A\09movq %r15, %rsp\0A\09movq %r14, %rdx\0A\09movq (%rsp), %rcx\0A\09pushq (%r13)\0A\09pushq %rdx\0A\09subq %rdx, %rcx\0A\09movq %rsp, %r15\0A\09movq %r13, %rsp\0A\09movq 0x8(%rsp), %rax\0A\09movq -0x8(%rax), %rbx\0A\09subq %rcx, %rbx\0A\09subq %rbx, %r14\0A\09popq %rax\0A\09subq %rbx, (%r15)\0A\09popq %rax\0A\09add $$0x8, %r11\0A\09jmp *%rax\0A\09_skipJsr:\0A\09popq %rax\0A\09", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
void cpu_boost_startup(void) {}


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

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

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

LLVM IR (-O2):
define void @cpu_boost_startup() {
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int /*<<< orphan*/ *display;
};
typedef TYPE_1__ XKeyEvent;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
void set_XKeyEvent_display(void *_p, void *_v) {
  ((XKeyEvent *)_p)->display = (Display *)_v;
}


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

x86 assembly (clang, -O2):
<set_XKeyEvent_display>:
mov    %rsi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XKeyEvent_display(i8* nocapture writeonly %0, i8* %1) {
%3 = bitcast i8* %0 to i8**
store i8* %1, i8** %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ getpid();
int /*<<< orphan*/ printf(char *, long);
int main(void) {
  printf("hello world form process ID %ld\n", (long)getpid());
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %rax,%rsi
lea    0xeb0(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xec1(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"hello world form process ID %ld\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @getpid()
%3 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i64 %2)
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [33 x i8] c"hello world form process ID %ld\0A\00"
define i32 @main() {
%1 = tail call i64 (...) @getpid()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i64 %1)
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ snprintf(char *, int, char *, int);
int open_i2c_dev(int adapter_n) {
  char dev_fn[20];
  snprintf(dev_fn, 19, "/dev/i2c-%d", adapter_n);
  return open(dev_fn, O_RDWR);
}


x86 assembly (clang, -O0):
<open_i2c_dev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    $0x13,%esi
lea    0xec2(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x20(%rbp),%rdi
mov    0x2e9a(%rip),%rax
mov    (%rax),%esi
call   1040 <open@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_i2c_dev>:
push   %rbx
sub    $0x20,%rsp
mov    %edi,%ecx
lea    0xed2(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x13,%esi
call   1030 <snprintf@plt>
mov    0x2ea3(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1040 <open@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"/dev/i2c-%d\00"
@O_RDWR = global i32 0
define i32 @open_i2c_dev(i32 %0) {
%2 = alloca i32
%3 = alloca [20 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 @snprintf(i8* %4, i32 19, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%8 = load i32, i32* @O_RDWR
%9 = call i32 @open(i8* %7, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
@.str = [12 x i8] c"/dev/i2c-%d\00"
@O_RDWR = global i32 0
define i32 @open_i2c_dev(i32 %0) {
%2 = alloca [20 x i8]
%3 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%4 = call i32 @snprintf(i8* %3, i32 19, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = load i32, i32* @O_RDWR
%6 = call i32 @open(i8* %3, i32 %5)
ret i32 %6
}
int convert_method2(char *str) {
  __asm__ __volatile__("REP:  movl 0(%%ebx),%%edx;"
                       "movzbl  %%dl,%%ecx;"
                       "testl %%ecx,%%ecx;"
                       "je END1;"
                       "cmpl $97,%%ecx;"
                       "jb BEL;"
                       "cmpl $122,%%ecx; "
                       "ja BEL;"
                       "subl $32,(%%ebx);"
                       "BEL:addl $1,%%ebx;"
                       "jmp REP;"
                       "END1:;" ::"b"(str));
  printf("d = %s\n", str);
  return 1;
}


x86 assembly (clang, -O0):
<convert_method2>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
push   %rax
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rbx

x86 assembly (clang, -O2):
<convert_method2>:
push   %rbx
mov    %rdi,%rbx

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

LLVM IR (-O2):
@.str = [8 x i8] c"d = %s\0A\00"
define i32 @convert_method2(i8* %0) {
tail call void asm sideeffect "REP: movl 0(%ebx),%edx;movzbl %dl,%ecx;testl %ecx,%ecx;je END1;cmpl $$97,%ecx;jb BEL;cmpl $$122,%ecx; ja BEL;subl $$32,(%ebx);BEL:addl $$1,%ebx;jmp REP;END1:;", "{bx},~{dirflag},~{fpsr},~{flags}"(i8* %0)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ FUTEX_WAKE;
int /*<<< orphan*/ SYS_futex;
int syscall(int /*<<< orphan*/, int *, int /*<<< orphan*/, int,
            int /*<<< orphan*/ *, int /*<<< orphan*/ *, int /*<<< orphan*/);
int futex_wake(int *futex) {
  return syscall(SYS_futex, futex, FUTEX_WAKE, 1, NULL, NULL, 0);
}


x86 assembly (clang, -O0):
<futex_wake>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    0x2ea0(%rip),%rax
mov    (%rax),%edx
mov    $0x1,%ecx
xor    %eax,%eax
mov    %eax,%r9d
xor    %eax,%eax
mov    %r9,%r8
movl   $0x0,(%rsp)
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<futex_wake>:
push   %rax
mov    %rdi,%rsi
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
mov    0x2eac(%rip),%rax
mov    (%rax),%edx
movl   $0x0,(%rsp)
mov    $0x1,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <syscall@plt>
pop    %rcx
ret

LLVM IR (-O0):
@SYS_futex = global i32 0
@FUTEX_WAKE = global i32 0
define i32 @futex_wake(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32, i32* @SYS_futex
%4 = load i32*, i32** %2
%5 = load i32, i32* @FUTEX_WAKE
%6 = call i32 @syscall(i32 %3, i32* %4, i32 %5, i32 1, i32* null, i32* null, i32 0)
ret i32 %6
}

LLVM IR (-O2):
@SYS_futex = global i32 0
@FUTEX_WAKE = global i32 0
define i32 @futex_wake(i32* %0) {
%2 = load i32, i32* @SYS_futex
%3 = load i32, i32* @FUTEX_WAKE
%4 = tail call i32 @syscall(i32 %2, i32* %0, i32 %3, i32 1, i32* null, i32* null, i32 0)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ XKeyboardControl;

/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ malloc(int);
void *alloc_XKeyboardControl(void) {
  XKeyboardControl *_p = (XKeyboardControl *)malloc(sizeof(XKeyboardControl));
  if (_p == NULL)
    abort();
  return (void *)_p;
}


x86 assembly (clang, -O0):
<alloc_XKeyboardControl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1148 <alloc_XKeyboardControl+0x28>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_XKeyboardControl>:
push   %rax
mov    $0x4,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1132 <alloc_XKeyboardControl+0x12>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i8* @alloc_XKeyboardControl() {
%1 = alloca i32*
%2 = call i64 @malloc(i32 4)
%3 = inttoptr i64 %2 to i32*
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %0
%9 = load i32*, i32** %1
%10 = bitcast i32* %9 to i8*
ret i8* %10
}

LLVM IR (-O2):
define i8* @alloc_XKeyboardControl() {
%1 = tail call i64 @malloc(i32 4)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = inttoptr i64 %1 to i8*
ret i8* %6
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t bam_swap_endian_2(uint16_t v) {
  return (uint16_t)(((v & 0x00FF00FFU) << 8) | ((v & 0xFF00FF00U) >> 8));
}


x86 assembly (clang, -O0):
<bam_swap_endian_2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff00ff,%eax
shl    $0x8,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00ff00,%ecx
shr    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bam_swap_endian_2>:
mov    %edi,%eax
bswap  %eax
ror    $0x10,%eax
ret

LLVM IR (-O0):
define i32 @bam_swap_endian_2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 16711935
%5 = shl i32 %4, 8
%6 = load i32, i32* %2
%7 = and i32 %6, -16711936
%8 = lshr i32 %7, 8
%9 = or i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @bam_swap_endian_2(i32 %0) {
%2 = shl i32 %0, 8
%3 = and i32 %2, -16711936
%4 = lshr i32 %0, 8
%5 = and i32 %4, 16711935
%6 = or i32 %3, %5
ret i32 %6
}
int iabs(int i) {
  if (i < 0)
    return -i;
  return i;
}


x86 assembly (clang, -O0):
<iabs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    111e <iabs+0x1e>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1124 <iabs+0x24>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @iabs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
void log_close(FILE *log_fp) {
  if (log_fp != NULL) {
    fclose(log_fp);
  }
}


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

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

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

LLVM IR (-O2):
define void @log_close(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @fclose(i32* %0)
br label %5
5: ; preds = %3, %1
ret void
}
void palm27x_pmic_init(void) {}


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

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

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

LLVM IR (-O2):
define void @palm27x_pmic_init() {
ret void
}
int SysCall1(int EAX__) {
  asm volatile("" ::"a"(EAX__));
  asm volatile("int $0x40");
  register int res;
  asm volatile("" : "=a"(res) :);
  return res;
}


x86 assembly (clang, -O0):
<SysCall1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
int    $0x40
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCall1>:
mov    %edi,%eax
int    $0x40
ret

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

LLVM IR (-O2):
define i32 @SysCall1(i32 %0) {
tail call void asm sideeffect "", "{ax},~{dirflag},~{fpsr},~{flags}"(i32 %0)
tail call void asm sideeffect "int $$0x40", "~{dirflag},~{fpsr},~{flags}"()
%2 = tail call i32 asm sideeffect "", "={ax},~{dirflag},~{fpsr},~{flags}"()
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ GL_FLAT;
int /*<<< orphan*/ glClearColor(double, double, double, double);
int /*<<< orphan*/ glShadeModel(int /*<<< orphan*/);
void cube_init(void) {
  glClearColor(0.0, 0.0, 0.0, 0.0);
  glShadeModel(GL_FLAT);
}


x86 assembly (clang, -O0):
<cube_init>:
push   %rbp
mov    %rsp,%rbp
xorps  %xmm3,%xmm3
movaps %xmm3,%xmm0
movaps %xmm3,%xmm1
movaps %xmm3,%xmm2
call   1030 <glClearColor@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
call   1040 <glShadeModel@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cube_init>:
push   %rax
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
xorps  %xmm3,%xmm3
call   1030 <glClearColor@plt>
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <glShadeModel@plt>

LLVM IR (-O0):
@GL_FLAT = global i32 0
define void @cube_init() {
%1 = call i32 @glClearColor(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%2 = load i32, i32* @GL_FLAT
%3 = call i32 @glShadeModel(i32 %2)
ret void
}

LLVM IR (-O2):
@GL_FLAT = global i32 0
define void @cube_init() {
%1 = tail call i32 @glClearColor(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%2 = load i32, i32* @GL_FLAT
%3 = tail call i32 @glShadeModel(i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ dmap_read_u32(char const *);
int32_t dmap_read_i32(const char *buf) { return (int32_t)dmap_read_u32(buf); }


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

x86 assembly (clang, -O2):
<dmap_read_i32>:
jmp    1030 <dmap_read_u32@plt>

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

LLVM IR (-O2):
define i32 @dmap_read_i32(i8* %0) {
%2 = tail call i32 @dmap_read_u32(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ fft1D_512(double *, double *);
void workload(double work_x[512], double work_y[512]) {
#pragma HLS INTERFACE m_axi port = work_x offset = slave bundle = gmem
#pragma HLS INTERFACE m_axi port = work_y offset = slave bundle = gmem
#pragma HLS INTERFACE s_axilite port = work_x bundle = control
#pragma HLS INTERFACE s_axilite port = work_y bundle = control
#pragma HLS INTERFACE s_axilite port = return bundle = control
  fft1D_512(work_x, work_y);
  return;
}


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

x86 assembly (clang, -O2):
<workload>:
jmp    1030 <fft1D_512@plt>

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

LLVM IR (-O2):
define void @workload(double* %0, double* %1) {
%3 = tail call i32 @fft1D_512(double* %0, double* %1)
ret void
}
void *populateCommandTable(void) { return (void *)0; }


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

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

LLVM IR (-O0):
define i8* @populateCommandTable() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @populateCommandTable() {
ret i8* null
}
void rt_waitscanlines(void *voidhandle) {}


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

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

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

LLVM IR (-O2):
define void @rt_waitscanlines(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
typedef scalar_t__ uintmax_t;

/* Variables and functions */
int /*<<< orphan*/ ERANGE;
scalar_t__ ULONG_MAX;
int /*<<< orphan*/ errno;
scalar_t__ wcstoumax(int /*<<< orphan*/ const *, int /*<<< orphan*/ **, int);
unsigned long wcstoul(const wchar_t *s, wchar_t **p, int base) {
  uintmax_t x = wcstoumax(s, p, base);
  if (x > ULONG_MAX) {
    errno = ERANGE;
    return ULONG_MAX;
  }
  return x;
}


x86 assembly (clang, -O0):
<wcstoul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <wcstoumax@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    0x2e86(%rip),%rcx
cmp    (%rcx),%rax
jle    1170 <wcstoul+0x60>
mov    0x2e96(%rip),%rax
mov    (%rax),%ecx
mov    0x2e7d(%rip),%rax
mov    %ecx,(%rax)
mov    0x2e64(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    1178 <wcstoul+0x68>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcstoul>:
push   %rax
call   1030 <wcstoumax@plt>
mov    0x2eab(%rip),%rcx
mov    (%rcx),%rcx
cmp    %rcx,%rax
jle    113a <wcstoul+0x2a>
mov    0x2ebc(%rip),%rax
mov    (%rax),%eax
mov    0x2ea3(%rip),%rdx
mov    %eax,(%rdx)
mov    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@ULONG_MAX = global i64 0
@ERANGE = global i32 0
@errno = global i32 0
define i64 @wcstoul(i32* %0, i32** %1, i32 %2) {
%4 = alloca i64
%5 = alloca i32*
%6 = alloca i32**
%7 = alloca i32
%8 = alloca i64
store i32* %0, i32** %5
store i32** %1, i32*** %6
store i32 %2, i32* %7
%9 = load i32*, i32** %5
%10 = load i32**, i32*** %6
%11 = load i32, i32* %7
%12 = call i64 @wcstoumax(i32* %9, i32** %10, i32 %11)
store i64 %12, i64* %8
%13 = load i64, i64* %8
%14 = load i64, i64* @ULONG_MAX
%15 = icmp sgt i64 %13, %14
br i1 %15, label %16, label %19
16: ; preds = %3
%17 = load i32, i32* @ERANGE
store i32 %17, i32* @errno
%18 = load i64, i64* @ULONG_MAX
store i64 %18, i64* %4
br label %21
19: ; preds = %3
%20 = load i64, i64* %8
store i64 %20, i64* %4
br label %21
21: ; preds = %19, %16
%22 = load i64, i64* %4
ret i64 %22
}

LLVM IR (-O2):
@ULONG_MAX = global i64 0
@ERANGE = global i32 0
@errno = global i32 0
define i64 @wcstoul(i32* %0, i32** %1, i32 %2) {
%4 = tail call i64 @wcstoumax(i32* %0, i32** %1, i32 %2)
%5 = load i64, i64* @ULONG_MAX
%6 = icmp sgt i64 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = load i32, i32* @ERANGE
store i32 %8, i32* @errno
br label %9
9: ; preds = %3, %7
%10 = phi i64 [ %5, %7 ], [ %4, %3 ]
ret i64 %10
}
/* Type definitions */
typedef scalar_t__ int64_t;

/* Variables and functions */
scalar_t__ INT64_MIN;
void minus_minimum_Bad() {
  int64_t x = 0;
  int64_t y = x - INT64_MIN;
}


x86 assembly (clang, -O0):
<minus_minimum_Bad>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2ed1(%rip),%rcx
sub    (%rcx),%rax
mov    %rax,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
@INT64_MIN = global i64 0
define void @minus_minimum_Bad() {
%1 = alloca i64
%2 = alloca i64
store i64 0, i64* %1
%3 = load i64, i64* %1
%4 = load i64, i64* @INT64_MIN
%5 = sub nsw i64 %3, %4
store i64 %5, i64* %2
ret void
}

LLVM IR (-O2):
@INT64_MIN = global i64 0
define void @minus_minimum_Bad() {
ret void
}
void g_flags_get_first_value() {}


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

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

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

LLVM IR (-O2):
define void @g_flags_get_first_value() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ solve(int);
int main() {
  int level;
  scanf("%d", &level);
  solve(level);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <solve@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @solve(i32 %4)
ret i32 0
}
int U(int R, int G, int B) { return -38 * R - 74 * G + 112 * B; }


x86 assembly (clang, -O0):
<U>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
imul   $0xffffffda,-0x4(%rbp),%eax
imul   $0x4a,-0x8(%rbp),%ecx
sub    %ecx,%eax
imul   $0x70,-0xc(%rbp),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<U>:
imul   $0xffffffda,%edi,%eax
imul   $0xffffffb6,%esi,%ecx
add    %eax,%ecx
imul   $0x70,%edx,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @U(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = mul nsw i32 -38, %7
%9 = load i32, i32* %5
%10 = mul nsw i32 74, %9
%11 = sub nsw i32 %8, %10
%12 = load i32, i32* %6
%13 = mul nsw i32 112, %12
%14 = add nsw i32 %11, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @U(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %0, -38
%5 = mul i32 %1, -74
%6 = add i32 %5, %4
%7 = mul nsw i32 %2, 112
%8 = add nsw i32 %6, %7
ret i32 %8
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_ctime;
};

/* Variables and functions */
double difftime(int /*<<< orphan*/, int /*<<< orphan*/);
scalar_t__ stat(char const *, struct stat *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
double get_lock_time(const char *path) {
  struct stat st;
  if (stat(path, &st) < 0)
    return -1;
  return difftime(time(NULL), st.st_ctime);
}


x86 assembly (clang, -O0):
<get_lock_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <stat@plt>
cmp    $0x0,%rax
jge    1165 <get_lock_time+0x35>
movsd  0xea5(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    117d <get_lock_time+0x4d>
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
mov    -0x18(%rbp),%esi
call   1030 <difftime@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_lock_time>:
push   %rax
mov    %rsp,%rsi
call   1040 <stat@plt>
test   %rax,%rax
js     1151 <get_lock_time+0x21>
xor    %edi,%edi
call   1050 <time@plt>
mov    (%rsp),%esi
mov    %eax,%edi
call   1030 <difftime@plt>
pop    %rax
ret
movsd  0xea7(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define double @get_lock_time(i8* %0) {
%2 = alloca double
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @stat(i8* %5, %struct.stat* %4)
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store double -1.000000e+00, double* %2
br label %14
9: ; preds = %1
%10 = call i32 @time(i32* null)
%11 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%12 = load i32, i32* %11
%13 = call double @difftime(i32 %10, i32 %12)
store double %13, double* %2
br label %14
14: ; preds = %9, %8
%15 = load double, double* %2
ret double %15
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define double @get_lock_time(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp slt i64 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %1
%7 = call i32 @time(i32* null)
%8 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%9 = load i32, i32* %8
%10 = call double @difftime(i32 %7, i32 %9)
br label %11
11: ; preds = %1, %6
%12 = phi double [ %10, %6 ], [ -1.000000e+00, %1 ]
ret double %12
}
/* Variables and functions */
char *lp_internal_sconfig(int, char *);
char *lp_chn_call(int chn) { return lp_internal_sconfig(chn, "call"); }


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

x86 assembly (clang, -O2):
<lp_chn_call>:
lea    0xee9(%rip),%rsi
jmp    1030 <lp_internal_sconfig@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"call\00"
define i8* @lp_chn_call(i32 %0) {
%2 = tail call i8* @lp_internal_sconfig(i32 %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
/* Variables and functions */
int v_atomic_test_and_set_int(int volatile *, int, int);
int v_atomic_test_and_set_acquire_int(volatile int *ptr, int expected,
                                      int newval) {
  return v_atomic_test_and_set_int(ptr, expected, newval);
}


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

x86 assembly (clang, -O2):
<v_atomic_test_and_set_acquire_int>:
jmp    1030 <v_atomic_test_and_set_int@plt>

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

LLVM IR (-O2):
define i32 @v_atomic_test_and_set_acquire_int(i32* %0, i32 %1, i32 %2) {
%4 = tail call i32 @v_atomic_test_and_set_int(i32* %0, i32 %1, i32 %2)
ret i32 %4
}
int get_list_length(void *list) {
  void **l = list;
  int n = 0;
  while (l && *l++)
    n++;
  return n;
}


x86 assembly (clang, -O0):
<get_list_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x15(%rbp)
je     1140 <get_list_length+0x40>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
cmpq   $0x0,(%rax)
setne  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    1150 <get_list_length+0x50>
jmp    115e <get_list_length+0x5e>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1117 <get_list_length+0x17>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_list_length>:
xor    %eax,%eax
test   %rdi,%rdi
je     111c <get_list_length+0x1c>
cmpq   $0x0,(%rdi)
je     111c <get_list_length+0x1c>
xor    %eax,%eax
nop
cmpq   $0x0,0x8(%rdi,%rax,8)
lea    0x1(%rax),%rax
jne    1110 <get_list_length+0x10>
ret

LLVM IR (-O0):
define i32 @get_list_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 = %17, %1
%8 = load i8**, i8*** %3
%9 = icmp ne i8** %8, null
br i1 %9, label %10, label %15
10: ; preds = %7
%11 = load i8**, i8*** %3
%12 = getelementptr inbounds i8*, i8** %11, i32 1
store i8** %12, i8*** %3
%13 = load i8*, i8** %11
%14 = icmp ne i8* %13, null
br label %15
15: ; preds = %10, %7
%16 = phi i1 [ false, %7 ], [ %14, %10 ]
br i1 %16, label %17, label %20
17: ; preds = %15
%18 = load i32, i32* %4
%19 = add nsw i32 %18, 1
store i32 %19, i32* %4
br label %7
20: ; preds = %15
%21 = load i32, i32* %4
ret i32 %21
}

LLVM IR (-O2):
define i32 @get_list_length(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = bitcast i8* %0 to i8**
%5 = load i8*, i8** %4
%6 = icmp eq i8* %5, null
br i1 %6, label %14, label %7
7: ; preds = %3, %7
%8 = phi i8** [ %10, %7 ], [ %4, %3 ]
%9 = phi i32 [ %11, %7 ], [ 0, %3 ]
%10 = getelementptr inbounds i8*, i8** %8, i64 1
%11 = add nuw nsw i32 %9, 1
%12 = load i8*, i8** %10
%13 = icmp eq i8* %12, null
br i1 %13, label %14, label %7
14: ; preds = %7, %3, %1
%15 = phi i32 [ 0, %1 ], [ 0, %3 ], [ %11, %7 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void printUsage(char *cmd) {
  printf("Usage: %s [options] mult1 file1 [mult2 file2 ...]", cmd);
}


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

x86 assembly (clang, -O2):
<printUsage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [50 x i8] c"Usage: %s [options] mult1 file1 [mult2 file2 ...]\00"
define void @printUsage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [50 x i8] c"Usage: %s [options] mult1 file1 [mult2 file2 ...]\00"
define void @printUsage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ qd_add_dd(double *, double const *, double *);
int /*<<< orphan*/ qd_copy(double const *, double *);
int /*<<< orphan*/ qd_minus(double *);
void qd_sub_dd_qd(const double *a, const double *b, double *c) {
  double mb[4];
  qd_copy(b, mb);
  qd_minus(mb);
  qd_add_dd(mb, a, c);
}


x86 assembly (clang, -O0):
<qd_sub_dd_qd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1050 <qd_copy@plt>
lea    -0x40(%rbp),%rdi
call   1030 <qd_minus@plt>
lea    -0x40(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <qd_add_dd@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qd_sub_dd_qd>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %rdx,%r14
mov    %rdi,%r15
mov    %rsp,%rbx
mov    %rsi,%rdi
mov    %rbx,%rsi
call   1050 <qd_copy@plt>
mov    %rbx,%rdi
call   1030 <qd_minus@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1040 <qd_add_dd@plt>
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @qd_sub_dd_qd(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
%7 = alloca [4 x double]
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%8 = load double*, double** %5
%9 = getelementptr inbounds [4 x double], [4 x double]* %7, i64 0, i64 0
%10 = call i32 @qd_copy(double* %8, double* %9)
%11 = getelementptr inbounds [4 x double], [4 x double]* %7, i64 0, i64 0
%12 = call i32 @qd_minus(double* %11)
%13 = getelementptr inbounds [4 x double], [4 x double]* %7, i64 0, i64 0
%14 = load double*, double** %4
%15 = load double*, double** %6
%16 = call i32 @qd_add_dd(double* %13, double* %14, double* %15)
ret void
}

LLVM IR (-O2):
define void @qd_sub_dd_qd(double* %0, double* %1, double* %2) {
%4 = alloca [4 x double]
%5 = bitcast [4 x double]* %4 to i8*
%6 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 0
%7 = call i32 @qd_copy(double* %1, double* %6)
%8 = call i32 @qd_minus(double* %6)
%9 = call i32 @qd_add_dd(double* %6, double* %0, double* %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ add_sub_butterfly(int /*<<< orphan*/ *,
                                     int /*<<< orphan*/ *const, int);
int /*<<< orphan*/ idct32_1024_8x32_quarter_1(int /*<<< orphan*/ const *const,
                                              int /*<<< orphan*/ *);
int /*<<< orphan*/ idct32_1024_8x32_quarter_2(int /*<<< orphan*/ const *const,
                                              int /*<<< orphan*/ *);
void idct32_1024_8x32_quarter_1_2(const __m128i *const in, __m128i *const out) {
  __m128i temp[16];
  idct32_1024_8x32_quarter_1(in, temp);
  idct32_1024_8x32_quarter_2(in, temp);
  add_sub_butterfly(temp, out, 16);
}


x86 assembly (clang, -O0):
<idct32_1024_8x32_quarter_1_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x50(%rbp),%rsi
call   1050 <idct32_1024_8x32_quarter_1@plt>
mov    -0x8(%rbp),%rdi
lea    -0x50(%rbp),%rsi
call   1030 <idct32_1024_8x32_quarter_2@plt>
lea    -0x50(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x10,%edx
call   1040 <add_sub_butterfly@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<idct32_1024_8x32_quarter_1_2>:
push   %r15
push   %r14
push   %rbx
sub    $0x40,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsp,%r15
mov    %r15,%rsi
call   1050 <idct32_1024_8x32_quarter_1@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <idct32_1024_8x32_quarter_2@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0x10,%edx
call   1040 <add_sub_butterfly@plt>
add    $0x40,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @idct32_1024_8x32_quarter_1_2(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca [16 x i32]
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = getelementptr inbounds [16 x i32], [16 x i32]* %5, i64 0, i64 0
%8 = call i32 @idct32_1024_8x32_quarter_1(i32* %6, i32* %7)
%9 = load i32*, i32** %3
%10 = getelementptr inbounds [16 x i32], [16 x i32]* %5, i64 0, i64 0
%11 = call i32 @idct32_1024_8x32_quarter_2(i32* %9, i32* %10)
%12 = getelementptr inbounds [16 x i32], [16 x i32]* %5, i64 0, i64 0
%13 = load i32*, i32** %4
%14 = call i32 @add_sub_butterfly(i32* %12, i32* %13, i32 16)
ret void
}

LLVM IR (-O2):
define void @idct32_1024_8x32_quarter_1_2(i32* %0, i32* %1) {
%3 = alloca [16 x i32]
%4 = bitcast [16 x i32]* %3 to i8*
%5 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 0
%6 = call i32 @idct32_1024_8x32_quarter_1(i32* %0, i32* %5)
%7 = call i32 @idct32_1024_8x32_quarter_2(i32* %0, i32* %5)
%8 = call i32 @add_sub_butterfly(i32* %5, i32* %1, i32 16)
ret void
}
/* Type definitions */
struct t_infolist {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ infolist_free(struct t_infolist *);
scalar_t__ infolist_valid(struct t_infolist *);
void plugin_api_infolist_free(struct t_infolist *infolist) {
  if (infolist && infolist_valid(infolist))
    infolist_free(infolist);
}


x86 assembly (clang, -O0):
<plugin_api_infolist_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1153 <plugin_api_infolist_free+0x33>
mov    -0x8(%rbp),%rdi
call   1030 <infolist_valid@plt>
cmp    $0x0,%rax
je     1153 <plugin_api_infolist_free+0x33>
mov    -0x8(%rbp),%rdi
call   1040 <infolist_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plugin_api_infolist_free>:
push   %rbx
test   %rdi,%rdi
je     113c <plugin_api_infolist_free+0x1c>
mov    %rdi,%rbx
call   1030 <infolist_valid@plt>
test   %rax,%rax
je     113c <plugin_api_infolist_free+0x1c>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <infolist_free@plt>
pop    %rbx
ret

LLVM IR (-O0):
%struct.t_infolist = type { i32 }
define void @plugin_api_infolist_free(%struct.t_infolist* %0) {
%2 = alloca %struct.t_infolist*
store %struct.t_infolist* %0, %struct.t_infolist** %2
%3 = load %struct.t_infolist*, %struct.t_infolist** %2
%4 = icmp ne %struct.t_infolist* %3, null
br i1 %4, label %5, label %12
5: ; preds = %1
%6 = load %struct.t_infolist*, %struct.t_infolist** %2
%7 = call i64 @infolist_valid(%struct.t_infolist* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = load %struct.t_infolist*, %struct.t_infolist** %2
%11 = call i32 @infolist_free(%struct.t_infolist* %10)
br label %12
12: ; preds = %9, %5, %1
ret void
}

LLVM IR (-O2):
%struct.t_infolist = type { i32 }
define void @plugin_api_infolist_free(%struct.t_infolist* %0) {
%2 = icmp eq %struct.t_infolist* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i64 @infolist_valid(%struct.t_infolist* %0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @infolist_free(%struct.t_infolist* %0)
br label %8
8: ; preds = %6, %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a;
  scanf("%d", &a);
  printf("%d %d\n", (a - 1), (a + 1));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
mov    -0x8(%rbp),%edx
add    $0x1,%edx
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edx
lea    -0x1(%rdx),%esi
add    $0x1,%edx
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = sub nsw i32 %4, 1
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 1
%8 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %5, i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = add nsw i32 %4, -1
%6 = add nsw i32 %4, 1
%7 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %5, i32 %6)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, char *, int);
int8_t extract_8bits(char *p) {
  int8_t tmp;
  memcpy(&tmp, p, sizeof(int8_t));
  return tmp;
}


x86 assembly (clang, -O0):
<extract_8bits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<extract_8bits>:
push   %rax
mov    %rdi,%rsi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @extract_8bits(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @memcpy(i32* %2, i8* %0, i32 4)
%5 = load i32, i32* %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ __svgalib_driver8_copybox(int, int, int, int, int, int);
void __svgalib_driver24_copybox(int x1, int y1, int w, int h, int x2, int y2) {
  __svgalib_driver8_copybox(x1 * 3, y1, w * 3, h, x2 * 3, y2);
}


x86 assembly (clang, -O0):
<__svgalib_driver24_copybox>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
imul   $0x3,-0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
imul   $0x3,-0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
imul   $0x3,-0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
call   1030 <__svgalib_driver8_copybox@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__svgalib_driver24_copybox>:
lea    (%rdi,%rdi,2),%edi
lea    (%rdx,%rdx,2),%edx
lea    (%r8,%r8,2),%r8d
jmp    1030 <__svgalib_driver8_copybox@plt>

LLVM IR (-O0):
define void @__svgalib_driver24_copybox(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = load i32, i32* %7
%14 = mul nsw i32 %13, 3
%15 = load i32, i32* %8
%16 = load i32, i32* %9
%17 = mul nsw i32 %16, 3
%18 = load i32, i32* %10
%19 = load i32, i32* %11
%20 = mul nsw i32 %19, 3
%21 = load i32, i32* %12
%22 = call i32 @__svgalib_driver8_copybox(i32 %14, i32 %15, i32 %17, i32 %18, i32 %20, i32 %21)
ret void
}

LLVM IR (-O2):
define void @__svgalib_driver24_copybox(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = mul nsw i32 %0, 3
%8 = mul nsw i32 %2, 3
%9 = mul nsw i32 %4, 3
%10 = tail call i32 @__svgalib_driver8_copybox(i32 %7, i32 %1, i32 %8, i32 %3, i32 %9, i32 %5)
ret void
}
void ScalePlaneBilinearUp() {}


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

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

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

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