xunge/DecIR huggingface dataset:
/* Variables and functions */
char *XDisplayName(int /*<<< orphan*/ *);
char *x_display_name(void) { return XDisplayName(NULL); }


x86 assembly (clang, -O0):
<x_display_name>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <XDisplayName@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<x_display_name>:
xor    %edi,%edi
jmp    1030 <XDisplayName@plt>

LLVM IR (-O0):
define i8* @x_display_name() {
%1 = call i8* @XDisplayName(i32* null)
ret i8* %1
}

LLVM IR (-O2):
define i8* @x_display_name() {
%1 = tail call i8* @XDisplayName(i32* null)
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ orgfx_curve(int, int, int, int, int, int, unsigned int);
int /*<<< orphan*/ orgfx_enable_tex0(int /*<<< orphan*/);
int /*<<< orphan*/ orgfx_set_color(unsigned int);
void orgfxplus_curve(int x0, int y0, int x1, int y1, int x2, int y2,
                     unsigned int inside, unsigned int color) {
  orgfx_enable_tex0(0);
  orgfx_set_color(color);
  orgfx_curve(x0, y0, x1, y1, x2, y2, inside);
}


x86 assembly (clang, -O0):
<orgfxplus_curve>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
xor    %edi,%edi
call   1050 <orgfx_enable_tex0@plt>
mov    0x18(%rbp),%edi
call   1040 <orgfx_set_color@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
mov    0x10(%rbp),%eax
mov    %eax,(%rsp)
call   1030 <orgfx_curve@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<orgfxplus_curve>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9d,0x4(%rsp)
mov    %r8d,%r15d
mov    %ecx,%r12d
mov    %edx,%r13d
mov    %esi,%ebx
mov    %edi,%ebp
mov    0x48(%rsp),%r14d
xor    %edi,%edi
call   1050 <orgfx_enable_tex0@plt>
mov    %r14d,%edi
call   1040 <orgfx_set_color@plt>
mov    %ebp,%edi
mov    %ebx,%esi
mov    %r13d,%edx
mov    %r12d,%ecx
mov    %r15d,%r8d
mov    0x4(%rsp),%r9d
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <orgfx_curve@plt>

LLVM IR (-O0):
define void @orgfxplus_curve(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7) {
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
store i32 %0, i32* %9
store i32 %1, i32* %10
store i32 %2, i32* %11
store i32 %3, i32* %12
store i32 %4, i32* %13
store i32 %5, i32* %14
store i32 %6, i32* %15
store i32 %7, i32* %16
%17 = call i32 @orgfx_enable_tex0(i32 0)
%18 = load i32, i32* %16
%19 = call i32 @orgfx_set_color(i32 %18)
%20 = load i32, i32* %9
%21 = load i32, i32* %10
%22 = load i32, i32* %11
%23 = load i32, i32* %12
%24 = load i32, i32* %13
%25 = load i32, i32* %14
%26 = load i32, i32* %15
%27 = call i32 @orgfx_curve(i32 %20, i32 %21, i32 %22, i32 %23, i32 %24, i32 %25, i32 %26)
ret void
}

LLVM IR (-O2):
define void @orgfxplus_curve(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7) {
%9 = tail call i32 @orgfx_enable_tex0(i32 0)
%10 = tail call i32 @orgfx_set_color(i32 %7)
%11 = tail call i32 @orgfx_curve(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_rwlock_t;

/* Variables and functions */
int /*<<< orphan*/ *hybris_set_realrwlock(int /*<<< orphan*/ *);
int pthread_rwlock_wrlock(int /*<<< orphan*/ *);
int my_pthread_rwlock_wrlock(pthread_rwlock_t *__rwlock) {
  pthread_rwlock_t *realrwlock = hybris_set_realrwlock(__rwlock);
  return pthread_rwlock_wrlock(realrwlock);
}


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

x86 assembly (clang, -O2):
<my_pthread_rwlock_wrlock>:
push   %rax
call   1040 <hybris_set_realrwlock@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <pthread_rwlock_wrlock@plt>

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

LLVM IR (-O2):
define i32 @my_pthread_rwlock_wrlock(i32* %0) {
%2 = tail call i32* @hybris_set_realrwlock(i32* %0)
%3 = tail call i32 @pthread_rwlock_wrlock(i32* %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ bottom(int);
void left(int i) { bottom(i); }


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

x86 assembly (clang, -O2):
<left>:
jmp    1030 <bottom@plt>

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

LLVM IR (-O2):
define void @left(i32 %0) {
%2 = tail call i32 @bottom(i32 %0)
ret void
}
/* Type definitions */
struct cxl_event_afu_interrupt {
  int irq;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fprintf(int /*<<< orphan*/ *, char *, int);
int cxl_fprint_afu_interrupt(FILE *stream,
                             struct cxl_event_afu_interrupt *event) {
  return fprintf(stream, "AFU Interrupt %i\n", event->irq);
}


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

x86 assembly (clang, -O2):
<cxl_fprint_afu_interrupt>:
mov    (%rsi),%edx
lea    0xee7(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
%struct.cxl_event_afu_interrupt = type { i32 }
@.str = [18 x i8] c"AFU Interrupt %i\0A\00"
define i32 @cxl_fprint_afu_interrupt(i32* %0, %struct.cxl_event_afu_interrupt* %1) {
%3 = alloca i32*
%4 = alloca %struct.cxl_event_afu_interrupt*
store i32* %0, i32** %3
store %struct.cxl_event_afu_interrupt* %1, %struct.cxl_event_afu_interrupt** %4
%5 = load i32*, i32** %3
%6 = load %struct.cxl_event_afu_interrupt*, %struct.cxl_event_afu_interrupt** %4
%7 = getelementptr inbounds %struct.cxl_event_afu_interrupt, %struct.cxl_event_afu_interrupt* %6, i32 0, i32 0
%8 = load i32, i32* %7
%9 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.cxl_event_afu_interrupt = type { i32 }
@.str = [18 x i8] c"AFU Interrupt %i\0A\00"
define i32 @cxl_fprint_afu_interrupt(i32* nocapture %0, %struct.cxl_event_afu_interrupt* nocapture %1) {
%3 = getelementptr inbounds %struct.cxl_event_afu_interrupt, %struct.cxl_event_afu_interrupt* %1, i64 0, i32 0
%4 = load i32, i32* %3
%5 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ putc(char);
void puts(char *s) {
  do {
    putc(*s);
  } while (*s++);
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <putc@plt>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
jne    111c <puts+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl (%rbx),%edi
call   1030 <putc@plt>
cmpb   $0x0,(%rbx)
lea    0x1(%rbx),%rbx
jne    1120 <puts+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @puts(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = tail call i32 @putc(i8 signext %4)
%6 = getelementptr inbounds i8, i8* %3, i64 1
%7 = load i8, i8* %3
%8 = icmp eq i8 %7, 0
br i1 %8, label %9, label %2
9: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ol(char *);
zadd() { ol("addl %edx, %eax"); }


x86 assembly (clang, -O0):
<zadd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <ol@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [16 x i8] c"addl %edx, %eax\00"
define i32 @zadd() {
%1 = alloca i32
%2 = call i32 @ol(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [16 x i8] c"addl %edx, %eax\00"
define i32 @zadd() {
%1 = tail call i32 @ol(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
int c_roopen__(bb)
char bb[];
{ return (open(bb, 0)); }


x86 assembly (clang, -O0):
<c_roopen__>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x0,%al
call   1030 <open@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_roopen__>:
xor    %esi,%esi
xor    %eax,%eax
jmp    1030 <open@plt>

LLVM IR (-O0):
define i32 @c_roopen__(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @open to i32 (i8*, i32, ...)*)(i8* %3, i32 0)
ret i32 %4
}

LLVM IR (-O2):
define i32 @c_roopen__(i8* %0) {
%2 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @open to i32 (i8*, i32, ...)*)(i8* %0, i32 0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ nRF24L01P_setTxAddress(unsigned long long, int);
void nRF24L01P_setTxAddressNL(unsigned long msb_address,
                              unsigned long lsb_address, int width) {
  unsigned long long address = (((unsigned long long)msb_address) << 32) |
                               (((unsigned long long)lsb_address) << 0);
  nRF24L01P_setTxAddress(address, width);
}


x86 assembly (clang, -O0):
<nRF24L01P_setTxAddressNL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x20,%rax
mov    -0x10(%rbp),%rcx
shl    $0x0,%rcx
or     %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <nRF24L01P_setTxAddress@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nRF24L01P_setTxAddressNL>:
shl    $0x20,%rdi
or     %rsi,%rdi
mov    %edx,%esi
jmp    1030 <nRF24L01P_setTxAddress@plt>

LLVM IR (-O0):
define void @nRF24L01P_setTxAddressNL(i64 %0, i64 %1, i32 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i32
%7 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%8 = load i64, i64* %4
%9 = shl i64 %8, 32
%10 = load i64, i64* %5
%11 = shl i64 %10, 0
%12 = or i64 %9, %11
store i64 %12, i64* %7
%13 = load i64, i64* %7
%14 = load i32, i32* %6
%15 = call i32 @nRF24L01P_setTxAddress(i64 %13, i32 %14)
ret void
}

LLVM IR (-O2):
define void @nRF24L01P_setTxAddressNL(i64 %0, i64 %1, i32 %2) {
%4 = shl i64 %0, 32
%5 = or i64 %4, %1
%6 = tail call i32 @nRF24L01P_setTxAddress(i64 %5, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void do_irq(void) { puts("BAD\n"); }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"BAD\0A\00"
define void @do_irq() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *newDbSerializeDevsDev(int, int, int, char *);
char *newDbSerializeClimate(int MAXBUF, char *buf) {
  return newDbSerializeDevsDev(1, 5, MAXBUF, buf);
}


x86 assembly (clang, -O0):
<newDbSerializeClimate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rcx
mov    $0x1,%edi
mov    $0x5,%esi
call   1030 <newDbSerializeDevsDev@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<newDbSerializeClimate>:
mov    %rsi,%rcx
mov    %edi,%edx
mov    $0x1,%edi
mov    $0x5,%esi
jmp    1030 <newDbSerializeDevsDev@plt>

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

LLVM IR (-O2):
define i8* @newDbSerializeClimate(i32 %0, i8* %1) {
%3 = tail call i8* @newDbSerializeDevsDev(i32 1, i32 5, i32 %0, i8* %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ munmap(unsigned char *, int);
int shm_unlink(char *);
int ShMemFree(unsigned char *p, char *memname, int size, int unlink, int fd) {
  int s = 0;
  munmap(p, size);
  close(fd);
  if (unlink)
    s = shm_unlink(memname);
  return s;
}


x86 assembly (clang, -O0):
<ShMemFree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <munmap@plt>
mov    -0x1c(%rbp),%edi
call   1030 <close@plt>
cmpl   $0x0,-0x18(%rbp)
je     117b <ShMemFree+0x4b>
mov    -0x10(%rbp),%rdi
call   1050 <shm_unlink@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ShMemFree>:
push   %rbp
push   %r14
push   %rbx
mov    %r8d,%ebp
mov    %ecx,%ebx
mov    %rsi,%r14
mov    %edx,%esi
call   1040 <munmap@plt>
mov    %ebp,%edi
call   1030 <close@plt>
test   %ebx,%ebx
je     115a <ShMemFree+0x2a>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <shm_unlink@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @ShMemFree(i8* %0, i8* %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @munmap(i8* %0, i32 %2)
%7 = tail call i32 @close(i32 %4)
%8 = icmp eq i32 %3, 0
br i1 %8, label %11, label %9
9: ; preds = %5
%10 = tail call i32 @shm_unlink(i8* %1)
br label %11
11: ; preds = %9, %5
%12 = phi i32 [ %10, %9 ], [ 0, %5 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
void displayNames(char **names) {
  int i;
  for (i = 0; i < 4; i++)
    printf("Name[%d] = %s\n", i, names[i]);
}


x86 assembly (clang, -O0):
<displayNames>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    1156 <displayNames+0x46>
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <displayNames+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<displayNames>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%rdx
lea    0xedf(%rip),%r14
mov    %r14,%rdi
xor    %esi,%esi
call   1030 <printf@plt>
mov    0x8(%rbx),%rdx
mov    %r14,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    0x10(%rbx),%rdx
mov    %r14,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
mov    0x18(%rbx),%rdx
mov    %r14,%rdi
mov    $0x3,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [15 x i8] c"Name[%d] = %s\0A\00"
define void @displayNames(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 0, i8* %2)
%4 = getelementptr inbounds i8*, i8** %0, i64 1
%5 = load i8*, i8** %4
%6 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 1, i8* %5)
%7 = getelementptr inbounds i8*, i8** %0, i64 2
%8 = load i8*, i8** %7
%9 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 2, i8* %8)
%10 = getelementptr inbounds i8*, i8** %0, i64 3
%11 = load i8*, i8** %10
%12 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 3, i8* %11)
ret void
}
int fun1191() { return 1191; }


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

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

LLVM IR (-O0):
define i32 @fun1191() {
ret i32 1191
}

LLVM IR (-O2):
define i32 @fun1191() {
ret i32 1191
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void prefix_increment(uint8_t *prefix) {
  uint8_t i;
  for (i = 0; i < 32; ++i) {
    prefix[i] += 1;
    if (prefix[i] != 0)
      return;
  }
}


x86 assembly (clang, -O0):
<prefix_increment>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x20,-0xc(%rbp)
jge    1154 <prefix_increment+0x54>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
add    $0x1,%edx
mov    %edx,(%rax,%rcx,4)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     1141 <prefix_increment+0x41>
jmp    1154 <prefix_increment+0x54>
jmp    1146 <prefix_increment+0x46>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <prefix_increment+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<prefix_increment>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
addl   $0x1,(%rdi,%rax,4)
jne    1123 <prefix_increment+0x23>
lea    0x1(%rax),%rcx
cmp    $0x1f,%rax
mov    %rcx,%rax
jne    1110 <prefix_increment+0x10>
ret

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

LLVM IR (-O2):
define void @prefix_increment(i32* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %8, %2 ]
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = load i32, i32* %4
%6 = add nsw i32 %5, 1
store i32 %6, i32* %4
%7 = icmp ne i32 %6, 0
%8 = add nuw nsw i64 %3, 1
%9 = icmp eq i64 %8, 32
%10 = select i1 %7, i1 true, i1 %9
br i1 %10, label %11, label %2
11: ; preds = %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef size_t uint16_t;

/* Variables and functions */
size_t crc_ccitt_update(size_t, int /*<<< orphan*/);
uint16_t softcrc(uint16_t seed, uint8_t *data, uint16_t datalen) {
  for (uint16_t i = 0; i < datalen; i++) {
    seed = crc_ccitt_update(seed, data[i]);
  }
  return seed;
}


x86 assembly (clang, -O0):
<softcrc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1163 <softcrc+0x53>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
call   1030 <crc_ccitt_update@plt>
mov    %rax,-0x8(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    112c <softcrc+0x1c>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<softcrc>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rax
test   %rdx,%rdx
je     1145 <softcrc+0x35>
mov    %rdx,%r15
mov    %rsi,%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r14,%rbx,4),%esi
mov    %rax,%rdi
call   1030 <crc_ccitt_update@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <softcrc+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i64 @softcrc(i64 %0, i32* nocapture %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %5, label %7
5: ; preds = %7, %3
%6 = phi i64 [ %0, %3 ], [ %12, %7 ]
ret i64 %6
7: ; preds = %3, %7
%8 = phi i64 [ %13, %7 ], [ 0, %3 ]
%9 = phi i64 [ %12, %7 ], [ %0, %3 ]
%10 = getelementptr inbounds i32, i32* %1, i64 %8
%11 = load i32, i32* %10
%12 = tail call i64 @crc_ccitt_update(i64 %9, i32 %11)
%13 = add nuw i64 %8, 1
%14 = icmp eq i64 %13, %2
br i1 %14, label %5, label %7
}
int test_imm_E3uint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0xE3 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_E3uint64_highword_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, 32
%6 = and i64 %5, 227
%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_E3uint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 974957576192
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ create_init_state();
int main(void) {
  create_init_state();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <create_init_state@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @create_init_state()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @create_init_state()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void grid_err_abort(void) { abort(); }


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

x86 assembly (clang, -O2):
<grid_err_abort>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @grid_err_abort() {
%1 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define void @grid_err_abort() {
%1 = tail call i32 (...) @abort()
unreachable
}
const char *skip_leading_spaces(const char *str) {
  while (*str == ' ') {
    str++;
  }
  return str;
}


x86 assembly (clang, -O0):
<skip_leading_spaces>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    1129 <skip_leading_spaces+0x29>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <skip_leading_spaces+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_leading_spaces>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x20,0x1(%rax)
lea    0x1(%rax),%rax
je     1110 <skip_leading_spaces+0x10>
ret

LLVM IR (-O0):
define i8* @skip_leading_spaces(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %8, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 32
br i1 %7, label %8, label %11
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %2
br label %3
11: ; preds = %3
%12 = load i8*, i8** %2
ret i8* %12
}

LLVM IR (-O2):
define i8* @skip_leading_spaces(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 32
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %2, label %7
7: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ AF_UNIX;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int un__socket() {
  int fd;
  if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) {
    perror("socket");
    exit(1);
  }
  return fd;
}


x86 assembly (clang, -O0):
<un__socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
mov    0x2e90(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1050 <socket@plt>
mov    %eax,-0x4(%rbp)
cmp    $0xffffffff,%eax
jne    1173 <un__socket+0x43>
lea    0xe9c(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<un__socket>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
mov    0x2e97(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1050 <socket@plt>
cmp    $0xffffffff,%eax
je     1151 <un__socket+0x21>
pop    %rcx
ret
lea    0xea8(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@AF_UNIX = global i32 0
@SOCK_STREAM = global i32 0
@.str = [7 x i8] c"socket\00"
define i32 @un__socket() {
%1 = alloca i32
%2 = load i32, i32* @AF_UNIX
%3 = load i32, i32* @SOCK_STREAM
%4 = call i32 @socket(i32 %2, i32 %3, i32 0)
store i32 %4, i32* %1
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @exit(i32 1)
unreachable
9: ; preds = %0
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
@AF_UNIX = global i32 0
@SOCK_STREAM = global i32 0
@.str = [7 x i8] c"socket\00"
define i32 @un__socket() {
%1 = load i32, i32* @AF_UNIX
%2 = load i32, i32* @SOCK_STREAM
%3 = tail call i32 @socket(i32 %1, i32 %2, i32 0)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %0
ret i32 %3
}
OP(ed, a5) {}


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
ret i32 undef
}
void __cxa_guard_release() {}


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

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

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

LLVM IR (-O2):
define void @__cxa_guard_release() {
ret void
}
double __divdf3(double a __attribute__((unused)),
                double b __attribute__((unused))) {
  return 0.0;
}


x86 assembly (clang, -O0):
<__divdf3>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<__divdf3>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @__divdf3(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @__divdf3(double %0, double %1) {
ret double 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  char *str = "0123456789";
  char c1 = str[1];
  char **strh;
  strh = &str;
  c1 = (*strh)[1];
  str[2] = '3';
  assert(c1 == '1');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x1(%rax),%al
mov    %al,-0x11(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    0x1(%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x33,0x2(%rax)
movsbl -0x11(%rbp),%eax
cmp    $0x31,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"0123456789\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8
%4 = alloca i8**
store i32 0, i32* %1
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8** %2
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %6
store i8 %7, i8* %3
store i8** %2, i8*** %4
%8 = load i8**, i8*** %4
%9 = load i8*, i8** %8
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
store i8 %11, i8* %3
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i64 2
store i8 51, i8* %13
%14 = load i8, i8* %3
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 49
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ fd_set;

/* Variables and functions */
int FD_ISSET(int, int /*<<< orphan*/ *);
int check_fd(int fd, fd_set *set) { return (fd > 0) ? (FD_ISSET(fd, set)) : 0; }


x86 assembly (clang, -O0):
<check_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    113d <check_fd+0x2d>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <FD_ISSET@plt>
mov    %eax,-0x14(%rbp)
jmp    1147 <check_fd+0x37>
xor    %eax,%eax
mov    %eax,-0x14(%rbp)
jmp    1147 <check_fd+0x37>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_fd>:
test   %edi,%edi
jle    1119 <check_fd+0x9>
jmp    1030 <FD_ISSET@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @check_fd(i32 %0, i32* %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @FD_ISSET(i32 %0, i32* %1)
br label %6
6: ; preds = %2, %4
%7 = phi i32 [ %5, %4 ], [ 0, %2 ]
ret i32 %7
}
/* Variables and functions */
double o_sinc(double);
double F_ha(double t, double a) {
  int k;
  double y = 1., coef = a;
  for (k = 1; k < 50; k++) {
    y *= o_sinc(t / coef);
    coef *= a;
  }
  return y;
}


x86 assembly (clang, -O0):
<F_ha>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xed6(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movl   $0x1,-0x14(%rbp)
cmpl   $0x32,-0x14(%rbp)
jge    1180 <F_ha+0x70>
movsd  -0x8(%rbp),%xmm0
divsd  -0x28(%rbp),%xmm0
call   1030 <o_sinc@plt>
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1140 <F_ha+0x30>
movsd  -0x20(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<F_ha>:
push   %rbx
sub    $0x20,%rsp
movsd  %xmm0,0x8(%rsp)
movsd  0xedd(%rip),%xmm0
mov    $0x31,%ebx
movsd  %xmm1,0x10(%rsp)
xchg   %ax,%ax
movsd  %xmm1,0x18(%rsp)
movsd  %xmm0,(%rsp)
movsd  0x8(%rsp),%xmm0
divsd  %xmm1,%xmm0
call   1030 <o_sinc@plt>
movsd  (%rsp),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
movsd  0x18(%rsp),%xmm1
movsd  (%rsp),%xmm0
mulsd  0x10(%rsp),%xmm1
add    $0xffffffff,%ebx
jne    1130 <F_ha+0x20>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @F_ha(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca i32
%6 = alloca double
%7 = alloca double
store double %0, double* %3
store double %1, double* %4
store double 1.000000e+00, double* %6
%8 = load double, double* %4
store double %8, double* %7
store i32 1, i32* %5
br label %9
9: ; preds = %22, %2
%10 = load i32, i32* %5
%11 = icmp slt i32 %10, 50
br i1 %11, label %12, label %25
12: ; preds = %9
%13 = load double, double* %3
%14 = load double, double* %7
%15 = fdiv double %13, %14
%16 = call double @o_sinc(double %15)
%17 = load double, double* %6
%18 = fmul double %17, %16
store double %18, double* %6
%19 = load double, double* %4
%20 = load double, double* %7
%21 = fmul double %20, %19
store double %21, double* %7
br label %22
22: ; preds = %12
%23 = load i32, i32* %5
%24 = add nsw i32 %23, 1
store i32 %24, i32* %5
br label %9
25: ; preds = %9
%26 = load double, double* %6
ret double %26
}

LLVM IR (-O2):
define double @F_ha(double %0, double %1) {
br label %3
3: ; preds = %2, %3
%4 = phi double [ %1, %2 ], [ %10, %3 ]
%5 = phi double [ 1.000000e+00, %2 ], [ %9, %3 ]
%6 = phi i32 [ 1, %2 ], [ %11, %3 ]
%7 = fdiv double %0, %4
%8 = tail call double @o_sinc(double %7)
%9 = fmul double %5, %8
%10 = fmul double %4, %1
%11 = add nuw nsw i32 %6, 1
%12 = icmp eq i32 %11, 50
br i1 %12, label %13, label %3
13: ; preds = %3
ret double %9
}
int global_init(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @global_init() {
ret i32 1
}
void echanger(int *val1, int *val2) {
  int tmp = *val1;
  *val1 = *val2;
  *val2 = tmp;
}


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

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

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

LLVM IR (-O2):
define void @echanger(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
void RTTarFileSetMode(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTarFileSetMode() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void wes_help() {
  printf("usage: wes <filename> <args>\n"
         "Arguments can be:\n"
         " --help\t\tPrint this help and exit\n"
         " --verbose\tRun with much more verbosity\n");
}


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

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

LLVM IR (-O0):
@.str = [122 x i8] c"usage: wes <filename> <args>\0AArguments can be:\0A --help\09\09Print this help and exit\0A --verbose\09Run with much more verbosity\0A\00"
define void @wes_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([122 x i8], [122 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [121 x i8] c"usage: wes <filename> <args>\0AArguments can be:\0A --help\09\09Print this help and exit\0A --verbose\09Run with much more verbosity\00"
define void @wes_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([121 x i8], [121 x i8]* @str, i64 0, i64 0))
ret void
}
unsigned xrop3_38_0_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = T & S;
  stk2 = D | stk3;
  stk1 = S ^ stk2;
  return (stk1 & S) | (stk1 & (~T)) | (T & (~S) & D);
}


x86 assembly (clang, -O0):
<xrop3_38_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    -0xc(%rbp),%eax
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
and    -0x8(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_38_0_1>:
mov    %edi,%ecx
shl    $0x8,%ecx
mov    %esi,%edx
shl    $0x8,%edx
lea    (%rdx,%rsi,1),%eax
and    %ecx,%edx
or     %edi,%ecx
or     $0xff,%edx
xor    %ecx,%edx
not    %eax
or     %ecx,%eax
and    %edx,%eax
not    %edi
and    %esi,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_38_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %7
%24 = load i32, i32* %6
%25 = and i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %5
%27 = load i32, i32* %10
%28 = or i32 %26, %27
store i32 %28, i32* %9
%29 = load i32, i32* %6
%30 = load i32, i32* %9
%31 = xor i32 %29, %30
store i32 %31, i32* %8
%32 = load i32, i32* %8
%33 = load i32, i32* %6
%34 = and i32 %32, %33
%35 = load i32, i32* %8
%36 = load i32, i32* %7
%37 = xor i32 %36, -1
%38 = and i32 %35, %37
%39 = or i32 %34, %38
%40 = load i32, i32* %7
%41 = load i32, i32* %6
%42 = xor i32 %41, -1
%43 = and i32 %40, %42
%44 = load i32, i32* %5
%45 = and i32 %43, %44
%46 = or i32 %39, %45
ret i32 %46
}

LLVM IR (-O2):
define i32 @xrop3_38_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = or i32 %4, %3
%6 = zext i8 %1 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %6
%9 = and i32 %7, %4
%10 = or i32 %9, 255
%11 = xor i32 %10, %5
%12 = xor i32 %8, -1
%13 = or i32 %5, %12
%14 = and i32 %11, %13
%15 = xor i32 %3, -1
%16 = and i32 %15, %6
%17 = or i32 %14, %16
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ protect(unsigned int *, unsigned int *);
void protect_msg(unsigned int *key, char *buf, size_t buf_len) {
  unsigned int i;
  for (i = 0; i < buf_len / 8; ++i)
    protect(key, (unsigned int *)&buf[i * 8]);
}


x86 assembly (clang, -O0):
<protect_msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x18(%rbp),%rcx
shr    $0x3,%rcx
cmp    %rcx,%rax
jae    1165 <protect_msg+0x55>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x1c(%rbp),%eax
shl    $0x3,%eax
mov    %eax,%eax
add    %rax,%rsi
call   1030 <protect@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    112b <protect_msg+0x1b>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<protect_msg>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
cmp    $0x8,%rdx
jb     115a <protect_msg+0x4a>
mov    %rdx,%r12
mov    %rsi,%r14
mov    %rdi,%r15
shr    $0x3,%r12
mov    $0x1,%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %ebx,%esi
add    %r14,%rsi
mov    %r15,%rdi
call   1030 <protect@plt>
mov    %ebp,%eax
add    $0x1,%ebp
add    $0x8,%ebx
cmp    %rax,%r12
ja     1140 <protect_msg+0x30>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @protect_msg(i32* %0, i8* %1, i64 %2) {
%4 = lshr i64 %2, 3
%5 = icmp ult i64 %2, 8
br i1 %5, label %16, label %6
6: ; preds = %3, %6
%7 = phi i32 [ %13, %6 ], [ 0, %3 ]
%8 = shl i32 %7, 3
%9 = zext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %1, i64 %9
%11 = bitcast i8* %10 to i32*
%12 = tail call i32 @protect(i32* %0, i32* %11)
%13 = add i32 %7, 1
%14 = zext i32 %13 to i64
%15 = icmp ugt i64 %4, %14
br i1 %15, label %6, label %16
16: ; preds = %6, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, char, char);
void note_off(char a, char b, char c) {
  printf("note_off %d %d %d\n", a, b, c);
}


x86 assembly (clang, -O0):
<note_off>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %dil,%dl
mov    %dl,-0x1(%rbp)
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
mov    -0x1(%rbp),%cl
mov    -0x2(%rbp),%al
lea    0xeca(%rip),%rdi
movsbl %cl,%esi
movsbl %al,%edx
movsbl -0x3(%rbp),%ecx
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [19 x i8] c"note_off %d %d %d\0A\00"
define void @note_off(i8 signext %0, i8 signext %1, i8 signext %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
store i8 %0, i8* %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%7 = load i8, i8* %4
%8 = load i8, i8* %5
%9 = load i8, i8* %6
%10 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8 signext %7, i8 signext %8, i8 signext %9)
ret void
}

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