xunge/DecIR huggingface dataset:
int verify_keylength(int key) {
  if (key < 1)
    return 1;
  if (key > 40)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<verify_keylength>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jge    111d <verify_keylength+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    113a <verify_keylength+0x3a>
cmpl   $0x28,-0x8(%rbp)
jle    1133 <verify_keylength+0x33>
movl   $0x1,-0x4(%rbp)
jmp    113a <verify_keylength+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<verify_keylength>:
add    $0xffffffd7,%edi
xor    %eax,%eax
cmp    $0xffffffd8,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @verify_keylength(i32 %0) {
%2 = add i32 %0, -41
%3 = icmp ult i32 %2, -40
%4 = zext i1 %3 to i32
ret i32 %4
}
int stack_overflow_fn(void) {
  int ret = stack_overflow_fn() + stack_overflow_fn();
  return ret;
}


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

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

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

LLVM IR (-O2):
define i32 @stack_overflow_fn() {
%1 = tail call i32 @stack_overflow_fn()
%2 = shl nsw i32 %1, 1
ret i32 %2
}
void outsw(int port, const void *addr, int cnt) {
  asm volatile("cld\n\trepne\n\toutsw"
               : "=S"(addr), "=c"(cnt)
               : "d"(port), "0"(addr), "1"(cnt)
               : "cc");
}


x86 assembly (clang, -O0):
<outsw>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%ecx
cld
repnz outsw %ds:(%rsi),(%dx)
mov    %rsi,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outsw>:
mov    %edx,%ecx
mov    %edi,%edx
cld
repnz outsw %ds:(%rsi),(%dx)
ret

LLVM IR (-O0):
define void @outsw(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call { i8*, i32 } asm sideeffect "cld\0A\09repne\0A\09outsw", "={si},={cx},{dx},0,1,~{cc},~{dirflag},~{fpsr},~{flags}"(i32 %7, i8* %8, i32 %9)
%11 = extractvalue { i8*, i32 } %10, 0
%12 = extractvalue { i8*, i32 } %10, 1
store i8* %11, i8** %5
store i32 %12, i32* %6
ret void
}

LLVM IR (-O2):
define void @outsw(i32 %0, i8* %1, i32 %2) {
%4 = tail call { i8*, i32 } asm sideeffect "cld\0A\09repne\0A\09outsw", "={si},={cx},{dx},0,1,~{cc},~{dirflag},~{fpsr},~{flags}"(i32 %0, i8* %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SYS_wait4;
long syscall4(int /*<<< orphan*/, long, long, long, int /*<<< orphan*/);
long waitpid(long pid, int *status, long opts) {
  return syscall4(SYS_wait4, pid, (long)status, opts, 0);
}


x86 assembly (clang, -O0):
<waitpid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
xor    %r8d,%r8d
call   1030 <syscall4@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<waitpid>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
xor    %r8d,%r8d
jmp    1030 <syscall4@plt>

LLVM IR (-O0):
@SYS_wait4 = global i32 0
define i64 @waitpid(i64 %0, i32* %1, i64 %2) {
%4 = alloca i64
%5 = alloca i32*
%6 = alloca i64
store i64 %0, i64* %4
store i32* %1, i32** %5
store i64 %2, i64* %6
%7 = load i32, i32* @SYS_wait4
%8 = load i64, i64* %4
%9 = load i32*, i32** %5
%10 = ptrtoint i32* %9 to i64
%11 = load i64, i64* %6
%12 = call i64 @syscall4(i32 %7, i64 %8, i64 %10, i64 %11, i32 0)
ret i64 %12
}

LLVM IR (-O2):
@SYS_wait4 = global i32 0
define i64 @waitpid(i64 %0, i32* %1, i64 %2) {
%4 = load i32, i32* @SYS_wait4
%5 = ptrtoint i32* %1 to i64
%6 = tail call i64 @syscall4(i32 %4, i64 %0, i64 %5, i64 %2, i32 0)
ret i64 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ ucontext_t;

/* Variables and functions */
int __getcontextx_size(void) { return (sizeof(ucontext_t)); }


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

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

LLVM IR (-O0):
define i32 @__getcontextx_size() {
ret i32 4
}

LLVM IR (-O2):
define i32 @__getcontextx_size() {
ret i32 4
}
int read32(unsigned char *buf) {
  return (buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | (buf[3]);
}


x86 assembly (clang, -O0):
<read32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @read32(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl i32 %6, 24
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 16
%13 = or i32 %7, %12
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i64 2
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = or i32 %13, %18
%20 = load i8*, i8** %2
%21 = getelementptr inbounds i8, i8* %20, i64 3
%22 = load i8, i8* %21
%23 = zext i8 %22 to i32
%24 = or i32 %19, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @read32(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw i32 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 16
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 8
%14 = or i32 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = or i32 %14, %17
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ addbyte(int);
void MMX_PCMPGTB(int dst_reg, int src_reg) {
  addbyte(0x66);
  addbyte(0x0f);
  addbyte(0x64);
  addbyte(0xc0 | (dst_reg << 3) | src_reg);
}


x86 assembly (clang, -O0):
<MMX_PCMPGTB>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x66,%edi
call   1030 <addbyte@plt>
mov    $0xf,%edi
call   1030 <addbyte@plt>
mov    $0x64,%edi
call   1030 <addbyte@plt>
mov    -0x4(%rbp),%edi
shl    $0x3,%edi
or     $0xc0,%edi
or     -0x8(%rbp),%edi
call   1030 <addbyte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MMX_PCMPGTB>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x66,%edi
call   1030 <addbyte@plt>
mov    $0xf,%edi
call   1030 <addbyte@plt>
mov    $0x64,%edi
call   1030 <addbyte@plt>
shl    $0x3,%ebp
or     %ebx,%ebp
or     $0xc0,%ebp
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <addbyte@plt>

LLVM IR (-O0):
define void @MMX_PCMPGTB(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @addbyte(i32 102)
%6 = call i32 @addbyte(i32 15)
%7 = call i32 @addbyte(i32 100)
%8 = load i32, i32* %3
%9 = shl i32 %8, 3
%10 = or i32 192, %9
%11 = load i32, i32* %4
%12 = or i32 %10, %11
%13 = call i32 @addbyte(i32 %12)
ret void
}

LLVM IR (-O2):
define void @MMX_PCMPGTB(i32 %0, i32 %1) {
%3 = tail call i32 @addbyte(i32 102)
%4 = tail call i32 @addbyte(i32 15)
%5 = tail call i32 @addbyte(i32 100)
%6 = shl i32 %0, 3
%7 = or i32 %6, %1
%8 = or i32 %7, 192
%9 = tail call i32 @addbyte(i32 %8)
ret void
}
int do_690() { return 690; }


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

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

LLVM IR (-O0):
define i32 @do_690() {
ret i32 690
}

LLVM IR (-O2):
define i32 @do_690() {
ret i32 690
}
/* Variables and functions */
int /*<<< orphan*/ _c_setbyte(int);
void LAHF() {
  ;
  _c_setbyte(0x9f);
  ;
}


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

x86 assembly (clang, -O2):
<LAHF>:
mov    $0x9f,%edi
jmp    1030 <_c_setbyte@plt>

LLVM IR (-O0):
define void @LAHF() {
%1 = call i32 @_c_setbyte(i32 159)
ret void
}

LLVM IR (-O2):
define void @LAHF() {
%1 = tail call i32 @_c_setbyte(i32 159)
ret void
}
/* Type definitions */
struct i8x_readbuf {
  int dummy;
};
struct i8x_object {
  int dummy;
};

/* Variables and functions */
scalar_t__ i8x_ob_ref(struct i8x_object *);
struct i8x_readbuf *__attribute__((always_)) i8x_rb_ref(struct i8x_readbuf *x) {
  return (struct i8x_readbuf *)i8x_ob_ref((struct i8x_object *)x);
}


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

x86 assembly (clang, -O2):
<i8x_rb_ref>:
jmp    1030 <i8x_ob_ref@plt>

LLVM IR (-O0):
%struct.i8x_readbuf = type { i32 }
%struct.i8x_object = type { i32 }
define %struct.i8x_readbuf* @i8x_rb_ref(%struct.i8x_readbuf* %0) {
%2 = alloca %struct.i8x_readbuf*
store %struct.i8x_readbuf* %0, %struct.i8x_readbuf** %2
%3 = load %struct.i8x_readbuf*, %struct.i8x_readbuf** %2
%4 = bitcast %struct.i8x_readbuf* %3 to %struct.i8x_object*
%5 = call i64 @i8x_ob_ref(%struct.i8x_object* %4)
%6 = inttoptr i64 %5 to %struct.i8x_readbuf*
ret %struct.i8x_readbuf* %6
}

LLVM IR (-O2):
%struct.i8x_readbuf = type { i32 }
%struct.i8x_object = type { i32 }
define %struct.i8x_readbuf* @i8x_rb_ref(%struct.i8x_readbuf* %0) {
%2 = bitcast %struct.i8x_readbuf* %0 to %struct.i8x_object*
%3 = tail call i64 @i8x_ob_ref(%struct.i8x_object* %2)
%4 = inttoptr i64 %3 to %struct.i8x_readbuf*
ret %struct.i8x_readbuf* %4
}
void tcp_ack(struct Seaper *seap, struct NetFrame *frame) {
  seap;
  frame;
}


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

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

LLVM IR (-O0):
%struct.Seaper = type opaque
%struct.NetFrame = type opaque
define void @tcp_ack(%struct.Seaper* %0, %struct.NetFrame* %1) {
%3 = alloca %struct.Seaper*
%4 = alloca %struct.NetFrame*
store %struct.Seaper* %0, %struct.Seaper** %3
store %struct.NetFrame* %1, %struct.NetFrame** %4
%5 = load %struct.Seaper*, %struct.Seaper** %3
%6 = load %struct.NetFrame*, %struct.NetFrame** %4
ret void
}

LLVM IR (-O2):
%struct.Seaper = type opaque
%struct.NetFrame = type opaque
define void @tcp_ack(%struct.Seaper* nocapture %0, %struct.NetFrame* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ digitalWrite(int, int);
int /*<<< orphan*/ pinMode(int, int);
int /*<<< orphan*/ pioInit();
int main() {
  pioInit();
  pinMode(20, 1);
  digitalWrite(20, 1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <pioInit@plt>
mov    $0x14,%edi
mov    $0x1,%esi
call   1050 <pinMode@plt>
mov    $0x14,%edi
mov    $0x1,%esi
call   1030 <digitalWrite@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <pioInit@plt>
mov    $0x14,%edi
mov    $0x1,%esi
call   1050 <pinMode@plt>
mov    $0x14,%edi
mov    $0x1,%esi
call   1030 <digitalWrite@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @pioInit()
%2 = call i32 @pinMode(i32 20, i32 1)
%3 = call i32 @digitalWrite(i32 20, i32 1)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @pioInit()
%2 = tail call i32 @pinMode(i32 20, i32 1)
%3 = tail call i32 @digitalWrite(i32 20, i32 1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ mem_write8(int /*<<< orphan*/ *, int, int);
void mem_write16(uint8_t *mem, uint16_t addr, uint16_t value) {
  mem_write8(mem, addr, value & 0xFF);
  mem_write8(mem, addr + 1, value >> 8);
}


x86 assembly (clang, -O0):
<mem_write16>:
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
and    $0xff,%edx
call   1030 <mem_write8@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
sar    $0x8,%edx
call   1030 <mem_write8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_write16>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%ebp
mov    %rdi,%r14
movzbl %bl,%edx
call   1030 <mem_write8@plt>
add    $0x1,%ebp
sar    $0x8,%ebx
mov    %r14,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <mem_write8@plt>

LLVM IR (-O0):
define void @mem_write16(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 = and i32 %9, 255
%11 = call i32 @mem_write8(i32* %7, i32 %8, i32 %10)
%12 = load i32*, i32** %4
%13 = load i32, i32* %5
%14 = add nsw i32 %13, 1
%15 = load i32, i32* %6
%16 = ashr i32 %15, 8
%17 = call i32 @mem_write8(i32* %12, i32 %14, i32 %16)
ret void
}

LLVM IR (-O2):
define void @mem_write16(i32* %0, i32 %1, i32 %2) {
%4 = and i32 %2, 255
%5 = tail call i32 @mem_write8(i32* %0, i32 %1, i32 %4)
%6 = add nsw i32 %1, 1
%7 = ashr i32 %2, 8
%8 = tail call i32 @mem_write8(i32* %0, i32 %6, i32 %7)
ret void
}
/* Variables and functions */
unsigned long long gcd(unsigned long long, unsigned long long);
unsigned long long int lcm(unsigned long long int a, unsigned long long int b) {
  unsigned long long int ans = (a * b);
  return (ans / gcd(a, b));
}


x86 assembly (clang, -O0):
<lcm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
imul   -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <gcd@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
xor    %edx,%edx
div    %rcx
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcm>:
push   %rbx
mov    %rsi,%rbx
imul   %rdi,%rbx
call   1030 <gcd@plt>
mov    %rax,%rcx
or     %rbx,%rax
shr    $0x20,%rax
je     1133 <lcm+0x23>
mov    %rbx,%rax
xor    %edx,%edx
div    %rcx
pop    %rbx
ret
mov    %ebx,%eax
xor    %edx,%edx
div    %ecx
pop    %rbx
ret

LLVM IR (-O0):
define i64 @lcm(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = mul i64 %6, %7
store i64 %8, i64* %5
%9 = load i64, i64* %5
%10 = load i64, i64* %3
%11 = load i64, i64* %4
%12 = call i64 @gcd(i64 %10, i64 %11)
%13 = udiv i64 %9, %12
ret i64 %13
}

LLVM IR (-O2):
define i64 @lcm(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i64 @gcd(i64 %0, i64 %1)
%5 = udiv i64 %3, %4
ret i64 %5
}
void xorSwap(int *v1, int *v2) {
  if (v1 != v2) {
    *v1 ^= *v2;
    *v2 ^= *v1;
    *v1 ^= *v2;
  }
}


x86 assembly (clang, -O0):
<xorSwap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
je     1144 <xorSwap+0x44>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
xor    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
xor    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
xor    (%rax),%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<xorSwap>:
cmp    %rsi,%rdi
je     1111 <xorSwap+0x11>
mov    (%rdi),%eax
xor    (%rsi),%eax
mov    %eax,(%rdi)
xor    (%rsi),%eax
mov    %eax,(%rsi)
xor    %eax,(%rdi)
ret

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

LLVM IR (-O2):
define void @xorSwap(i32* %0, i32* %1) {
%3 = icmp eq i32* %0, %1
br i1 %3, label %12, label %4
4: ; preds = %2
%5 = load i32, i32* %1
%6 = load i32, i32* %0
%7 = xor i32 %6, %5
store i32 %7, i32* %0
%8 = load i32, i32* %1
%9 = xor i32 %8, %7
store i32 %9, i32* %1
%10 = load i32, i32* %0
%11 = xor i32 %10, %9
store i32 %11, i32* %0
br label %12
12: ; preds = %4, %2
ret void
}
int isxdigit(int c) {
  return (c >= '0' && c <= '9' || c >= 'a' && c <= 'f' || c >= 'A' && c <= 'F');
}


x86 assembly (clang, -O0):
<isxdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x30,-0x4(%rbp)
jl     1120 <isxdigit+0x20>
mov    $0x1,%al
cmpl   $0x39,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1158 <isxdigit+0x58>
cmpl   $0x61,-0x4(%rbp)
jl     1139 <isxdigit+0x39>
mov    $0x1,%al
cmpl   $0x66,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1158 <isxdigit+0x58>
xor    %eax,%eax
cmpl   $0x41,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     1152 <isxdigit+0x52>
cmpl   $0x46,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isxdigit>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%eax
setb   %al
and    $0xffffffdf,%edi
add    $0xffffffbf,%edi
cmp    $0x6,%edi
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isxdigit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 48
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 57
br i1 %7, label %22, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp sge i32 %9, 97
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 102
br i1 %13, label %22, label %14
14: ; preds = %11, %8
%15 = load i32, i32* %2
%16 = icmp sge i32 %15, 65
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i32, i32* %2
%19 = icmp sle i32 %18, 70
br label %20
20: ; preds = %17, %14
%21 = phi i1 [ false, %14 ], [ %19, %17 ]
br label %22
22: ; preds = %20, %11, %5
%23 = phi i1 [ true, %11 ], [ true, %5 ], [ %21, %20 ]
%24 = zext i1 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @isxdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = and i32 %0, -33
%5 = add i32 %4, -65
%6 = icmp ult i32 %5, 6
%7 = or i1 %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
void TP(long long *v0, long long *v1) {
  if (*v0 == 0) {
    if (*v1 == 0) {
      *v0 = 1;
      *v1 = 0;
    }
  } else {
    if (*v1 == 0) {
      *v0 = 0;
      *v1 = -1;
    } else {
      *v0 = -1;
      *v1 = 0;
    }
  }
}


x86 assembly (clang, -O0):
<TP>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1143 <TP+0x43>
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
jne    113e <TP+0x3e>
mov    -0x8(%rbp),%rax
movq   $0x1,(%rax)
mov    -0x10(%rbp),%rax
movq   $0x0,(%rax)
jmp    1187 <TP+0x87>
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
jne    116c <TP+0x6c>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x10(%rbp),%rax
movq   $0xffffffffffffffff,(%rax)
jmp    1182 <TP+0x82>
mov    -0x8(%rbp),%rax
movq   $0xffffffffffffffff,(%rax)
mov    -0x10(%rbp),%rax
movq   $0x0,(%rax)
jmp    1187 <TP+0x87>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TP>:
cmpq   $0x0,(%rdi)
mov    (%rsi),%rdx
je     1124 <TP+0x24>
xor    %eax,%eax
xor    %ecx,%ecx
test   %rdx,%rdx
sete   %al
setne  %cl
neg    %rcx
neg    %rax
mov    %rcx,(%rdi)
mov    %rax,(%rsi)
jmp    1129 <TP+0x29>
test   %rdx,%rdx
je     112a <TP+0x2a>
ret
mov    $0x1,%ecx
xor    %eax,%eax
jmp    111c <TP+0x1c>

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

LLVM IR (-O2):
define void @TP(i64* nocapture %0, i64* nocapture %1) {
%3 = load i64, i64* %0
%4 = icmp eq i64 %3, 0
%5 = load i64, i64* %1
%6 = icmp eq i64 %5, 0
br i1 %4, label %7, label %8
7: ; preds = %2
br i1 %6, label %12, label %15
8: ; preds = %2
%9 = xor i1 %6, true
%10 = sext i1 %9 to i64
%11 = sext i1 %6 to i64
br label %12
12: ; preds = %8, %7
%13 = phi i64 [ 1, %7 ], [ %10, %8 ]
%14 = phi i64 [ 0, %7 ], [ %11, %8 ]
store i64 %13, i64* %0
store i64 %14, i64* %1
br label %15
15: ; preds = %12, %7
ret void
}
int file_write_value(const char *path, const char *name, const char *format,
                     void *value) {
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @file_write_value(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
ret i32 0
}

LLVM IR (-O2):
define i32 @file_write_value(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i8* nocapture readnone %3) {
ret i32 0
}
f(int n) {
  short x[2][n][3];
  return sizeof x;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,-0x18(%rbp)
shl    $0x1,%rax
imul   $0x6,%rax,%rax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
shl    $0x2,%edi
lea    (%rdi,%rdi,2),%eax
ret

LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
%7 = call i8* @llvm.stacksave()
store i8* %7, i8** %3
%8 = mul nuw i64 2, %6
%9 = alloca [3 x i16], i64 %8
store i64 %6, i64* %4
%10 = mul nuw i64 2, %6
%11 = mul nuw i64 6, %10
%12 = trunc i64 %11 to i32
%13 = load i8*, i8** %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = mul i32 %0, 12
ret i32 %2
}
/* Variables and functions */
int ENAMETOOLONG;
int /*<<< orphan*/ strcpy(char *, char const *);
size_t strnlen(char const *, size_t);
int lvm_copy_name(char *dst, const char *src, size_t size) {
  if (strnlen(src, size) == size)
    return -ENAMETOOLONG;
  strcpy(dst, src);
  return 0;
}


x86 assembly (clang, -O0):
<lvm_copy_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <strnlen@plt>
cmp    -0x20(%rbp),%rax
jne    115e <lvm_copy_name+0x3e>
xor    %eax,%eax
mov    0x2e8c(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    1172 <lvm_copy_name+0x52>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcpy@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lvm_copy_name>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r15
mov    %rdi,%r14
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1040 <strnlen@plt>
cmp    %rbx,%rax
jne    114b <lvm_copy_name+0x2b>
mov    0x2e9b(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
jmp    1158 <lvm_copy_name+0x38>
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <strcpy@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@ENAMETOOLONG = global i32 0
define i32 @lvm_copy_name(i8* %0, i8* %1, i64 %2) {
%4 = tail call i64 @strnlen(i8* %1, i64 %2)
%5 = icmp eq i64 %4, %2
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = load i32, i32* @ENAMETOOLONG
%8 = sub nsw i32 0, %7
br label %11
9: ; preds = %3
%10 = tail call i32 @strcpy(i8* %0, i8* %1)
br label %11
11: ; preds = %9, %6
%12 = phi i32 [ %8, %6 ], [ 0, %9 ]
ret i32 %12
}
int test_imm_E8uint32_mem(unsigned int *val) {
  return ((*val) & (0xE8 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_E8uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 232
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ dis_reg();
int /*<<< orphan*/ info(char *);
int si_dispreg(int argc, char *argv[]) {
  info("\t\tREGISTER DUMP\n");
  dis_reg();
  return (0);
}


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

x86 assembly (clang, -O2):
<si_dispreg>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <info@plt>
xor    %eax,%eax
call   1030 <dis_reg@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"\09\09REGISTER DUMP\0A\00"
define i32 @si_dispreg(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @info(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (...) @dis_reg()
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"\09\09REGISTER DUMP\0A\00"
define i32 @si_dispreg(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @info(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (...) @dis_reg()
ret i32 0
}
/* Variables and functions */
int atoi(char *);
int dealwithargs(int argc, char *argv[]) {
  int level;
  if (argc > 1)
    level = atoi(argv[1]);
  else
    level = 15000;
  return level;
}


x86 assembly (clang, -O0):
<dealwithargs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x4(%rbp)
jle    113e <dealwithargs+0x2e>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <atoi@plt>
mov    %eax,-0x14(%rbp)
jmp    1145 <dealwithargs+0x35>
movl   $0x3a98,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dealwithargs>:
cmp    $0x2,%edi
jl     111e <dealwithargs+0xe>
mov    0x8(%rsi),%rdi
jmp    1030 <atoi@plt>
mov    $0x3a98,%eax
ret

LLVM IR (-O0):
define i32 @dealwithargs(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = load i32, i32* %3
%7 = icmp sgt i32 %6, 1
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8**, i8*** %4
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @atoi(i8* %11)
store i32 %12, i32* %5
br label %14
13: ; preds = %2
store i32 15000, i32* %5
br label %14
14: ; preds = %13, %8
%15 = load i32, i32* %5
ret i32 %15
}

LLVM IR (-O2):
define i32 @dealwithargs(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @atoi(i8* %6)
br label %8
8: ; preds = %2, %4
%9 = phi i32 [ %7, %4 ], [ 15000, %2 ]
ret i32 %9
}
/* Variables and functions */
float sqrt(float);
float distance(float x1, float y1, float x2, float y2) {
  float d1 = (x1 - x2) * (x1 - x2);
  float d2 = (y1 - y2) * (y1 - y2);
  return (sqrt(d1 + d2));
}


x86 assembly (clang, -O0):
<distance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0xc(%rbp),%xmm0
movss  -0x4(%rbp),%xmm1
subss  -0xc(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x8(%rbp),%xmm0
subss  -0x10(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
subss  -0x10(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x14(%rbp),%xmm0
addss  -0x18(%rbp),%xmm0
call   1030 <sqrt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<distance>:
movaps %xmm0,%xmm4
unpcklps %xmm1,%xmm4
unpcklps %xmm3,%xmm2
subps  %xmm2,%xmm4
mulps  %xmm4,%xmm4
movaps %xmm4,%xmm0
shufps $0x55,%xmm4,%xmm0
addss  %xmm4,%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1137 <distance+0x27>
sqrtss %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define float @distance(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%11 = load float, float* %5
%12 = load float, float* %7
%13 = fsub float %11, %12
%14 = load float, float* %5
%15 = load float, float* %7
%16 = fsub float %14, %15
%17 = fmul float %13, %16
store float %17, float* %9
%18 = load float, float* %6
%19 = load float, float* %8
%20 = fsub float %18, %19
%21 = load float, float* %6
%22 = load float, float* %8
%23 = fsub float %21, %22
%24 = fmul float %20, %23
store float %24, float* %10
%25 = load float, float* %9
%26 = load float, float* %10
%27 = fadd float %25, %26
%28 = call float @sqrt(float %27)
ret float %28
}

LLVM IR (-O2):
define float @distance(float %0, float %1, float %2, float %3) {
%5 = insertelement <2 x float> poison, float %0, i64 0
%6 = insertelement <2 x float> %5, float %1, i64 1
%7 = insertelement <2 x float> poison, float %2, i64 0
%8 = insertelement <2 x float> %7, float %3, i64 1
%9 = fsub <2 x float> %6, %8
%10 = fmul <2 x float> %9, %9
%11 = shufflevector <2 x float> %10, <2 x float> poison, <2 x i32> <i32 1, i32 undef>
%12 = fadd <2 x float> %10, %11
%13 = extractelement <2 x float> %12, i64 0
%14 = tail call float @sqrt(float %13)
ret float %14
}
/* Variables and functions */
int /*<<< orphan*/ test_goto2(int);
int main() {
  test_goto2(30);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test_goto2(i32 30)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ns2sevas(float, float, float);
void ns2sevas_(float *sx, float *sy, float *sz) { ns2sevas(*sx, *sy, *sz); }


x86 assembly (clang, -O0):
<ns2sevas_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm2
call   1030 <ns2sevas@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ns2sevas_>:
movss  (%rdi),%xmm0
movss  (%rsi),%xmm1
movss  (%rdx),%xmm2
jmp    1030 <ns2sevas@plt>

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

LLVM IR (-O2):
define void @ns2sevas_(float* nocapture %0, float* nocapture %1, float* nocapture %2) {
%4 = load float, float* %0
%5 = load float, float* %1
%6 = load float, float* %2
%7 = tail call i32 @ns2sevas(float %4, float %5, float %6)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ fatal(char *, char const *, int /*<<< orphan*/);
scalar_t__ fputs(char const *, int /*<<< orphan*/ *);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
void xfputs(const char *errtxt, const char *s, FILE *stream) {
  if (fputs(s, stream) < 0) {
    fatal("%s Writing output file.  Error was '%s'.\n", errtxt,
          strerror(errno));
  }
}


x86 assembly (clang, -O0):
<xfputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <fputs@plt>
cmp    $0x0,%rax
jge    1183 <xfputs+0x53>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    0x2e76(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
lea    0xe82(%rip),%rdi
call   1050 <fatal@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xfputs>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1030 <fputs@plt>
test   %rax,%rax
js     1146 <xfputs+0x16>
pop    %rbx
ret
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
lea    0xea5(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1050 <fatal@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"%s Writing output file. Error was '%s'.\0A\00"
@errno = global i32 0
define void @xfputs(i8* %0, i8* %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32* %2, i32** %6
%7 = load i8*, i8** %5
%8 = load i32*, i32** %6
%9 = call i64 @fputs(i8* %7, i32* %8)
%10 = icmp slt i64 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %3
%12 = load i8*, i8** %4
%13 = load i32, i32* @errno
%14 = call i32 @strerror(i32 %13)
%15 = call i32 @fatal(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* %12, i32 %14)
br label %16
16: ; preds = %11, %3
ret void
}

LLVM IR (-O2):
@.str = [42 x i8] c"%s Writing output file. Error was '%s'.\0A\00"
@errno = global i32 0
define void @xfputs(i8* %0, i8* nocapture %1, i32* nocapture %2) {
%4 = tail call i64 @fputs(i8* %1, i32* %2)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = load i32, i32* @errno
%8 = tail call i32 @strerror(i32 %7)
%9 = tail call i32 @fatal(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %8)
br label %10
10: ; preds = %6, %3
ret void
}
int board_row_to_matrix_idx(int row) {
  row -= 1;
  return row;
}


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

x86 assembly (clang, -O2):
<board_row_to_matrix_idx>:
lea    -0x1(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @board_row_to_matrix_idx(i32 %0) {
%2 = add nsw i32 %0, -1
ret i32 %2
}
/* Type definitions */
struct XDR {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ xdr_int(struct XDR *, int *);
int /*<<< orphan*/ xdrmem_create(struct XDR *, char *, int, int);
extern void decode(char *addr, struct XDR *xdrs, int *number) {
  xdrmem_create(xdrs, addr, 4, 1);
  xdr_int(xdrs, number);
  return;
}


x86 assembly (clang, -O0):
<decode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x4,%edx
mov    $0x1,%ecx
call   1040 <xdrmem_create@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <xdr_int@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%rsi
mov    %rbx,%rdi
mov    $0x4,%edx
mov    $0x1,%ecx
call   1040 <xdrmem_create@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <xdr_int@plt>

LLVM IR (-O0):
%struct.XDR = type { i32 }
define void @decode(i8* %0, %struct.XDR* %1, i32* %2) {
%4 = alloca i8*
%5 = alloca %struct.XDR*
%6 = alloca i32*
store i8* %0, i8** %4
store %struct.XDR* %1, %struct.XDR** %5
store i32* %2, i32** %6
%7 = load %struct.XDR*, %struct.XDR** %5
%8 = load i8*, i8** %4
%9 = call i32 @xdrmem_create(%struct.XDR* %7, i8* %8, i32 4, i32 1)
%10 = load %struct.XDR*, %struct.XDR** %5
%11 = load i32*, i32** %6
%12 = call i32 @xdr_int(%struct.XDR* %10, i32* %11)
ret void
}

LLVM IR (-O2):
%struct.XDR = type { i32 }
define void @decode(i8* %0, %struct.XDR* %1, i32* %2) {
%4 = tail call i32 @xdrmem_create(%struct.XDR* %1, i8* %0, i32 4, i32 1)
%5 = tail call i32 @xdr_int(%struct.XDR* %1, i32* %2)
ret void
}
void gdk_display_supports_cursor_color() {}


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

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

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

LLVM IR (-O2):
define void @gdk_display_supports_cursor_color() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ OPENSSL_free(void *);
void test_free(void *d) { OPENSSL_free(d); }


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

x86 assembly (clang, -O2):
<test_free>:
jmp    1030 <OPENSSL_free@plt>

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

LLVM IR (-O2):
define void @test_free(i8* %0) {
%2 = tail call i32 @OPENSSL_free(i8* %0)
ret void
}
void uh_tls_client_attach(struct client *cl) {}


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

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

LLVM IR (-O0):
%struct.client = type opaque
define void @uh_tls_client_attach(%struct.client* %0) {
%2 = alloca %struct.client*
store %struct.client* %0, %struct.client** %2
ret void
}

LLVM IR (-O2):
%struct.client = type opaque
define void @uh_tls_client_attach(%struct.client* nocapture %0) {
ret void
}
/* Variables and functions */
int cpuNum();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ proxyService();
int main(int argc, char **argv) {
  printf("DNS proxy server starting...\n");
  printf("Number of CPU %d\n", cpuNum());
  proxyService();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <cpuNum@plt>
mov    %eax,%esi
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <proxyService@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <cpuNum@plt>
lea    0xea5(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1060 <proxyService@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"DNS proxy server starting...\0A\00"
@.str.1 = [18 x i8] c"Number of CPU %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @cpuNum()
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = call i32 (...) @proxyService()
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [18 x i8] c"Number of CPU %d\0A\00"
@str = [29 x i8] c"DNS proxy server starting...\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @cpuNum()
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = tail call i32 (...) @proxyService()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  scanf("%d", &n);
  if (0 == n % 2)
    printf("YES");
  else
    printf("NO");
  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),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
cmp    %edx,%eax
jne    1165 <main+0x45>
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
jmp    1171 <main+0x51>
lea    0xe9b(%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>
testb  $0x1,0x4(%rsp)
lea    0xec5(%rip),%rax
lea    0xec2(%rip),%rdi
cmove  %rax,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"YES\00"
@.str.2 = [3 x i8] c"NO\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 = srem i32 %4, 2
%6 = icmp eq i32 0, %5
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %11
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %11
11: ; preds = %9, %7
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"YES\00"
@.str.2 = [3 x i8] c"NO\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 = and i32 %4, 1
%6 = icmp eq i32 %5, 0
%7 = select i1 %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%8 = call i32 @printf(i8* dereferenceable(1) %7)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, unsigned char);
void fprint_addc_atRi(FILE *stream, unsigned char i) {
  fprintf(stream, "ADDC  A, @R%X                    ", i);
}


x86 assembly (clang, -O0):
<fprint_addc_atRi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed3(%rip),%rsi
movzbl -0x9(%rbp),%edx
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [34 x i8] c"ADDC A, @R%X \00"
define void @fprint_addc_atRi(i32* %0, i8 zeroext %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 i32 @fprintf(i32* %5, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8 zeroext %6)
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"ADDC A, @R%X \00"
define void @fprint_addc_atRi(i32* nocapture %0, i8 zeroext %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8 zeroext %1)
ret void
}