xunge/DecIR huggingface dataset:
int compar_float(void *f1, void *f2) {
  int fl1 = *((float *)f1), fl2 = *((float *)f2);
  if (fl1 > fl2)
    return 1;
  else if (fl2 > fl1)
    return -1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<compar_float>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cvttss2si (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
cvttss2si (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jle    113a <compar_float+0x3a>
movl   $0x1,-0x4(%rbp)
jmp    1159 <compar_float+0x59>
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jle    1152 <compar_float+0x52>
movl   $0xffffffff,-0x4(%rbp)
jmp    1159 <compar_float+0x59>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compar_float>:
cvttss2si (%rdi),%eax
cvttss2si (%rsi),%ecx
xor    %edx,%edx
cmp    %eax,%ecx
setg   %dl
neg    %edx
cmp    %ecx,%eax
mov    $0x1,%eax
cmovle %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @compar_float(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to float*
%4 = load float, float* %3
%5 = fptosi float %4 to i32
%6 = bitcast i8* %1 to float*
%7 = load float, float* %6
%8 = fptosi float %7 to i32
%9 = icmp sgt i32 %5, %8
%10 = icmp sgt i32 %8, %5
%11 = sext i1 %10 to i32
%12 = select i1 %9, i32 1, i32 %11
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ prune_add2(int);
void call_prune_add2_1_Good() { prune_add2(5); }


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

x86 assembly (clang, -O2):
<call_prune_add2_1_Good>:
mov    $0x5,%edi
jmp    1030 <prune_add2@plt>

LLVM IR (-O0):
define void @call_prune_add2_1_Good() {
%1 = call i32 @prune_add2(i32 5)
ret void
}

LLVM IR (-O2):
define void @call_prune_add2_1_Good() {
%1 = tail call i32 @prune_add2(i32 5)
ret void
}
int test_imm_F6int8_reg(signed char val) {
  return ((val) & (-0xF6 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_F6int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffff0a,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_F6int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, -246
%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_F6int8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -246
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
float p1(float f) { return 2 * f; }


x86 assembly (clang, -O0):
<p1>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<p1>:
addss  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @p1(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float 2.000000e+00, %3
ret float %4
}

LLVM IR (-O2):
define float @p1(float %0) {
%2 = fmul float %0, 2.000000e+00
ret float %2
}
/* Variables and functions */
int read(long, char *, int);
char _ReceiveChar(long port) {
  char buf;
  int res;
  do {
    res = read(port, &buf, 1);
  } while (res < 0);
  return buf;
}


x86 assembly (clang, -O0):
<_ReceiveChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x9(%rbp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     111c <_ReceiveChar+0xc>
movsbl -0x9(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ReceiveChar>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0x7(%rsp),%r14
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <read@plt>
test   %eax,%eax
js     1120 <_ReceiveChar+0x10>
mov    0x7(%rsp),%al
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define signext i8 @_ReceiveChar(i64 %0) {
%2 = alloca i8
br label %3
3: ; preds = %3, %1
%4 = call i32 @read(i64 %0, i8* %2, i32 1)
%5 = icmp slt i32 %4, 0
br i1 %5, label %3, label %6
6: ; preds = %3
%7 = load i8, i8* %2
ret i8 %7
}
void yahdlc_escape_value(char value, char *dest, int *dest_index) {
  if ((value == 0x7E) || (value == 0x7D)) {
    dest[(*dest_index)++] = 0x7D;
    value ^= 0x20;
  }
  dest[(*dest_index)++] = value;
}


x86 assembly (clang, -O0):
<yahdlc_escape_value>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x7e,%eax
je     112c <yahdlc_escape_value+0x2c>
movsbl -0x1(%rbp),%eax
cmp    $0x7d,%eax
jne    114e <yahdlc_escape_value+0x4e>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rdx
mov    (%rdx),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,(%rdx)
movslq %ecx,%rcx
movb   $0x7d,(%rax,%rcx,1)
movsbl -0x1(%rbp),%eax
xor    $0x20,%eax
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%dl
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rsi
mov    (%rsi),%ecx
mov    %ecx,%edi
add    $0x1,%edi
mov    %edi,(%rsi)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<yahdlc_escape_value>:
lea    -0x7d(%rdi),%eax
cmp    $0x1,%al
ja     1117 <yahdlc_escape_value+0x17>
movslq (%rdx),%rax
lea    0x1(%rax),%ecx
mov    %ecx,(%rdx)
movb   $0x7d,(%rsi,%rax,1)
xor    $0x20,%dil
movslq (%rdx),%rax
lea    0x1(%rax),%ecx
mov    %ecx,(%rdx)
mov    %dil,(%rsi,%rax,1)
ret

LLVM IR (-O0):
define void @yahdlc_escape_value(i8 signext %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* %4
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 126
br i1 %9, label %14, label %10
10: ; preds = %3
%11 = load i8, i8* %4
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 125
br i1 %13, label %14, label %25
14: ; preds = %10, %3
%15 = load i8*, i8** %5
%16 = load i32*, i32** %6
%17 = load i32, i32* %16
%18 = add nsw i32 %17, 1
store i32 %18, i32* %16
%19 = sext i32 %17 to i64
%20 = getelementptr inbounds i8, i8* %15, i64 %19
store i8 125, i8* %20
%21 = load i8, i8* %4
%22 = sext i8 %21 to i32
%23 = xor i32 %22, 32
%24 = trunc i32 %23 to i8
store i8 %24, i8* %4
br label %25
25: ; preds = %14, %10
%26 = load i8, i8* %4
%27 = load i8*, i8** %5
%28 = load i32*, i32** %6
%29 = load i32, i32* %28
%30 = add nsw i32 %29, 1
store i32 %30, i32* %28
%31 = sext i32 %29 to i64
%32 = getelementptr inbounds i8, i8* %27, i64 %31
store i8 %26, i8* %32
ret void
}

LLVM IR (-O2):
define void @yahdlc_escape_value(i8 signext %0, i8* nocapture writeonly %1, i32* nocapture %2) {
%4 = add i8 %0, -125
%5 = icmp ult i8 %4, 2
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 1
store i32 %8, i32* %2
%9 = sext i32 %7 to i64
%10 = getelementptr inbounds i8, i8* %1, i64 %9
store i8 125, i8* %10
%11 = xor i8 %0, 32
br label %12
12: ; preds = %3, %6
%13 = phi i8 [ %11, %6 ], [ %0, %3 ]
%14 = load i32, i32* %2
%15 = add nsw i32 %14, 1
store i32 %15, i32* %2
%16 = sext i32 %14 to i64
%17 = getelementptr inbounds i8, i8* %1, i64 %16
store i8 %13, i8* %17
ret void
}
int f1(int n) {
  int i, sum;
  for (i = 0, sum = 0; i < n; i++) {
    sum += i;
  }
  return sum;
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1138 <f1+0x38>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <f1+0x15>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
test   %edi,%edi
jle    1118 <f1+0x18>
lea    -0x1(%rdi),%eax
lea    -0x2(%rdi),%ecx
imul   %rax,%rcx
shr    %rcx
lea    (%rcx,%rdi,1),%eax
add    $0xffffffff,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @f1(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %13
3: ; preds = %1
%4 = add nsw i32 %0, -1
%5 = zext i32 %4 to i33
%6 = add nsw i32 %0, -2
%7 = zext i32 %6 to i33
%8 = mul i33 %5, %7
%9 = lshr i33 %8, 1
%10 = trunc i33 %9 to i32
%11 = add i32 %10, %0
%12 = add i32 %11, -1
br label %13
13: ; preds = %3, %1
%14 = phi i32 [ 0, %1 ], [ %12, %3 ]
ret i32 %14
}
/* Variables and functions */
char const *remote_l2();
const char *__attribute__((section(".test.b"))) call_remote_l2(void) {
  return remote_l2() + 1;
}


x86 assembly (clang, -O0):
<call_remote_l2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <remote_l2@plt>
add    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_remote_l2>:
push   %rax
xor    %eax,%eax
call   1030 <remote_l2@plt>
add    $0x1,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @call_remote_l2() section ".test.b" {
%1 = call i8* (...) @remote_l2()
%2 = getelementptr inbounds i8, i8* %1, i64 1
ret i8* %2
}

LLVM IR (-O2):
define i8* @call_remote_l2() section ".test.b" {
%1 = tail call i8* (...) @remote_l2()
%2 = getelementptr inbounds i8, i8* %1, i64 1
ret i8* %2
}
extern unsigned int cpuid_ebx(unsigned int op) {
  unsigned int eax, ebx;
  __asm__("cpuid" : "=a"(eax), "=b"(ebx) : "0"(op) : "cx", "dx");
  return ebx;
}


x86 assembly (clang, -O0):
<cpuid_ebx>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cpuid
mov    %eax,-0x10(%rbp)
mov    %ebx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuid_ebx>:
push   %rbx
mov    %edi,%eax
cpuid
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @cpuid_ebx(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = call { i32, i32 } asm "cpuid", "={ax},={bx},0,~{cx},~{dx},~{dirflag},~{fpsr},~{flags}"(i32 %5)
%7 = extractvalue { i32, i32 } %6, 0
%8 = extractvalue { i32, i32 } %6, 1
store i32 %7, i32* %3
store i32 %8, i32* %4
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
define i32 @cpuid_ebx(i32 %0) {
%2 = tail call { i32, i32 } asm "cpuid", "={ax},={bx},0,~{cx},~{dx},~{dirflag},~{fpsr},~{flags}"(i32 %0)
%3 = extractvalue { i32, i32 } %2, 1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ printf(char *);
void print_usage() {
  printf("Usage: frisky [-c] [-m] [-x] [-n <number>] [-? help]\n");
  abort();
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<print_usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [54 x i8] c"Usage: frisky [-c] [-m] [-x] [-n <number>] [-? help]\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@str = [53 x i8] c"Usage: frisky [-c] [-m] [-x] [-n <number>] [-? help]\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int isonum_731(unsigned char *);
int isonum_733(unsigned char *p) { return (isonum_731(p)); }


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

x86 assembly (clang, -O2):
<isonum_733>:
jmp    1030 <isonum_731@plt>

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

LLVM IR (-O2):
define i32 @isonum_733(i8* %0) {
%2 = tail call i32 @isonum_731(i8* %0)
ret i32 %2
}
long getBCD(long w) {
  return ((w >> 0x0) & 0xf) + ((w >> 0x4) & 0xf) * 10 +
         ((w >> 0x8) & 0xf) * 100 + ((w >> 0xc) & 0xf) * 1000;
}


x86 assembly (clang, -O0):
<getBCD>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
sar    $0x0,%rax
and    $0xf,%rax
mov    -0x8(%rbp),%rcx
sar    $0x4,%rcx
and    $0xf,%rcx
imul   $0xa,%rcx,%rcx
add    %rcx,%rax
mov    -0x8(%rbp),%rcx
sar    $0x8,%rcx
and    $0xf,%rcx
imul   $0x64,%rcx,%rcx
add    %rcx,%rax
mov    -0x8(%rbp),%rcx
sar    $0xc,%rcx
and    $0xf,%rcx
imul   $0x3e8,%rcx,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getBCD>:
mov    %edi,%eax
and    $0xf,%eax
mov    %edi,%ecx
shr    $0x4,%ecx
and    $0xf,%ecx
lea    (%rcx,%rcx,4),%rcx
lea    (%rax,%rcx,2),%rax
mov    %edi,%ecx
shr    $0x8,%ecx
and    $0xf,%ecx
imul   $0x64,%rcx,%rcx
add    %rax,%rcx
shr    $0xc,%edi
and    $0xf,%edi
imul   $0x3e8,%rdi,%rax
add    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @getBCD(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 0
%5 = and i64 %4, 15
%6 = load i64, i64* %2
%7 = ashr i64 %6, 4
%8 = and i64 %7, 15
%9 = mul nsw i64 %8, 10
%10 = add nsw i64 %5, %9
%11 = load i64, i64* %2
%12 = ashr i64 %11, 8
%13 = and i64 %12, 15
%14 = mul nsw i64 %13, 100
%15 = add nsw i64 %10, %14
%16 = load i64, i64* %2
%17 = ashr i64 %16, 12
%18 = and i64 %17, 15
%19 = mul nsw i64 %18, 1000
%20 = add nsw i64 %15, %19
ret i64 %20
}

LLVM IR (-O2):
define i64 @getBCD(i64 %0) {
%2 = and i64 %0, 15
%3 = lshr i64 %0, 4
%4 = and i64 %3, 15
%5 = mul nuw nsw i64 %4, 10
%6 = add nuw nsw i64 %5, %2
%7 = lshr i64 %0, 8
%8 = and i64 %7, 15
%9 = mul nuw nsw i64 %8, 100
%10 = add nuw nsw i64 %6, %9
%11 = lshr i64 %0, 12
%12 = and i64 %11, 15
%13 = mul nuw nsw i64 %12, 1000
%14 = add nuw nsw i64 %10, %13
ret i64 %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void Usage(char *name) {
  printf("Usage:\n\t%s <mac addr> <device> <npkts> <packet size>\n", name);
}


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

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

LLVM IR (-O0):
@.str = [54 x i8] c"Usage:\0A\09%s <mac addr> <device> <npkts> <packet size>\0A\00"
define void @Usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [54 x i8] c"Usage:\0A\09%s <mac addr> <device> <npkts> <packet size>\0A\00"
define void @Usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void str_copy(char *to, char *from) {
  while ((*to++ = *from++) != 0)
    ;
}


x86 assembly (clang, -O0):
<str_copy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     113f <str_copy+0x3f>
jmp    110c <str_copy+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_copy>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <str_copy+0x10>
ret

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

LLVM IR (-O2):
define void @str_copy(i8* nocapture writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %8, %3 ]
%5 = phi i8* [ %1, %2 ], [ %6, %3 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %5
%8 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %7, i8* %4
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret void
}
/* Variables and functions */
void stub1();
void *bootstrap_pthread(void *func) {
  ((void (*)(void))func)();
  return NULL;
}


x86 assembly (clang, -O0):
<bootstrap_pthread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
call   *-0x8(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bootstrap_pthread>:
push   %rax
call   *%rdi
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i8* @bootstrap_pthread(i8* nocapture %0) {
%2 = bitcast i8* %0 to void ()*
tail call void %2()
ret i8* null
}
int sys$delmbx(unsigned short int chan) {
  return ({
    unsigned long resultvar;
    register long int _a1 asm("rdi") = (long)((unsigned long)chan);
    asm volatile("movq %1, %%rax\n\t"
                 "int $0x81\n\t"
                 : "=a"(resultvar)
                 : "i"(46), "r"(_a1)
                 : "memory", "cc", "r11", "cx");
    (long)resultvar;
  });
}


x86 assembly (clang, -O0):
<sys$delmbx>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x2e,%rax
int    $0x81
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys$delmbx>:
mov    %edi,%edi
mov    $0x2e,%rax
int    $0x81
ret

LLVM IR (-O0):
define i32 @"sys$delmbx"(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i16 %0, i16* %2
%6 = load i16, i16* %2
%7 = zext i16 %6 to i64
store i64 %7, i64* %4
%8 = load i64, i64* %4
%9 = call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x81\0A\09", "={ax},i,{rdi},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 46, i64 %8)
store i64 %9, i64* %3
%10 = load i64, i64* %3
store i64 %10, i64* %5
%11 = load i64, i64* %5
%12 = trunc i64 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @"sys$delmbx"(i16 zeroext %0) {
%2 = zext i16 %0 to i64
%3 = tail call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x81\0A\09", "={ax},i,{rdi},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 46, i64 %2)
%4 = trunc i64 %3 to i32
ret i32 %4
}
char *indexed_load_cmplt(i)
unsigned long i;
{
  if (((i >> 13) & 1) == 0)
    if (((i >> 5) & 1) == 0)
      return "";
    else
      return ",m";
  else if (((i >> 5) & 1) == 0)
    return ",s";
  else
    return ",sm";
}


x86 assembly (clang, -O0):
<indexed_load_cmplt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shr    $0xd,%rax
and    $0x1,%rax
cmp    $0x0,%rax
jne    1154 <indexed_load_cmplt+0x54>
mov    -0x10(%rbp),%rax
shr    $0x5,%rax
and    $0x1,%rax
cmp    $0x0,%rax
jne    1144 <indexed_load_cmplt+0x44>
lea    0xec7(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1185 <indexed_load_cmplt+0x85>
lea    0xeb5(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1185 <indexed_load_cmplt+0x85>
mov    -0x10(%rbp),%rax
shr    $0x5,%rax
and    $0x1,%rax
cmp    $0x0,%rax
jne    117a <indexed_load_cmplt+0x7a>
lea    0xe92(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1185 <indexed_load_cmplt+0x85>
lea    0xe85(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<indexed_load_cmplt>:
test   $0x20,%dil
lea    0xef7(%rip),%rax
lea    0xeee(%rip),%rcx
cmove  %rax,%rcx
lea    0xee6(%rip),%rdx
lea    0xee2(%rip),%rax
cmove  %rdx,%rax
test   $0x2000,%edi
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [3 x i8] c",m\00"
@.str.2 = [3 x i8] c",s\00"
@.str.3 = [4 x i8] c",sm\00"
define i8* @indexed_load_cmplt(i64 %0) {
%2 = alloca i8*
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = lshr i64 %4, 13
%6 = and i64 %5, 1
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %15
8: ; preds = %1
%9 = load i64, i64* %3
%10 = lshr i64 %9, 5
%11 = and i64 %10, 1
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %8
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %2
br label %22
14: ; preds = %8
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %22
15: ; preds = %1
%16 = load i64, i64* %3
%17 = lshr i64 %16, 5
%18 = and i64 %17, 1
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %15
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %22
21: ; preds = %15
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %22
22: ; preds = %21, %20, %14, %13
%23 = load i8*, i8** %2
ret i8* %23
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [3 x i8] c",m\00"
@.str.2 = [3 x i8] c",s\00"
@.str.3 = [4 x i8] c",sm\00"
define i8* @indexed_load_cmplt(i64 %0) {
%2 = and i64 %0, 8192
%3 = icmp eq i64 %2, 0
%4 = and i64 %0, 32
%5 = icmp eq i64 %4, 0
%6 = select i1 %5, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0)
%7 = select i1 %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0)
%8 = select i1 %3, i8* %6, i8* %7
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ GL_FLAT;
int /*<<< orphan*/ glClearColor(double, double, double, double);
int /*<<< orphan*/ glShadeModel(int /*<<< orphan*/);
void polys_init(void) {
  glClearColor(0.0, 0.0, 0.0, 0.0);
  glShadeModel(GL_FLAT);
}


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

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

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

LLVM IR (-O2):
@GL_FLAT = global i32 0
define void @polys_init() {
%1 = tail call i32 @glClearColor(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%2 = load i32, i32* @GL_FLAT
%3 = tail call i32 @glShadeModel(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
unsigned long setbit(unsigned long, int);
void main(void) {
  assert(setbit((unsigned long)(8), 0) == (unsigned long)(9));
  assert(setbit((unsigned long)(100), 0) == (unsigned long)(101));
  assert(setbit((unsigned long)(97), 0) == (unsigned long)(97));
  assert(setbit((unsigned long)(7), 3) == (unsigned long)(15));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8,%edi
xor    %esi,%esi
call   1040 <setbit@plt>
cmp    $0x9,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x64,%edi
xor    %esi,%esi
call   1040 <setbit@plt>
cmp    $0x65,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x61,%edi
xor    %esi,%esi
call   1040 <setbit@plt>
cmp    $0x61,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x7,%edi
mov    $0x3,%esi
call   1040 <setbit@plt>
cmp    $0xf,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x8,%edi
xor    %esi,%esi
call   1040 <setbit@plt>
xor    %edi,%edi
cmp    $0x9,%rax
sete   %dil
call   1030 <assert@plt>
mov    $0x64,%edi
xor    %esi,%esi
call   1040 <setbit@plt>
xor    %edi,%edi
cmp    $0x65,%rax
sete   %dil
call   1030 <assert@plt>
mov    $0x61,%edi
xor    %esi,%esi
call   1040 <setbit@plt>
xor    %edi,%edi
cmp    $0x61,%rax
sete   %dil
call   1030 <assert@plt>
mov    $0x7,%edi
mov    $0x3,%esi
call   1040 <setbit@plt>
xor    %edi,%edi
cmp    $0xf,%rax
sete   %dil
pop    %rax
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @main() {
%1 = call i64 @setbit(i64 8, i32 0)
%2 = icmp eq i64 %1, 9
%3 = zext i1 %2 to i32
%4 = call i32 @assert(i32 %3)
%5 = call i64 @setbit(i64 100, i32 0)
%6 = icmp eq i64 %5, 101
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = call i64 @setbit(i64 97, i32 0)
%10 = icmp eq i64 %9, 97
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = call i64 @setbit(i64 7, i32 3)
%14 = icmp eq i64 %13, 15
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i64 @setbit(i64 8, i32 0)
%2 = icmp eq i64 %1, 9
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i64 @setbit(i64 100, i32 0)
%6 = icmp eq i64 %5, 101
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i64 @setbit(i64 97, i32 0)
%10 = icmp eq i64 %9, 97
%11 = zext i1 %10 to i32
%12 = tail call i32 @assert(i32 %11)
%13 = tail call i64 @setbit(i64 7, i32 3)
%14 = icmp eq i64 %13, 15
%15 = zext i1 %14 to i32
%16 = tail call i32 @assert(i32 %15)
ret void
}
int INT_TO_DINT(short var) {
  int newvar;
  newvar = (int)var;
  return newvar;
}


x86 assembly (clang, -O0):
<INT_TO_DINT>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @INT_TO_DINT(i16 signext %0) {
%2 = alloca i16
%3 = alloca i32
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = sext i16 %4 to i32
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @INT_TO_DINT(i16 signext %0) {
%2 = sext i16 %0 to i32
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ rend_authorized_client_free(void *);
void rend_authorized_client_strmap_item_free(void *authorized_client) {
  rend_authorized_client_free(authorized_client);
}


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

x86 assembly (clang, -O2):
<rend_authorized_client_strmap_item_free>:
jmp    1030 <rend_authorized_client_free@plt>

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

LLVM IR (-O2):
define void @rend_authorized_client_strmap_item_free(i8* %0) {
%2 = tail call i32 @rend_authorized_client_free(i8* %0)
ret void
}
/* Type definitions */
struct suffix_mult {
  int dummy;
};

/* Variables and functions */
unsigned int xatoull_sfx(char const *, struct suffix_mult const *);
unsigned int xatou_sfx(const char *str, const struct suffix_mult *sfx) {
  return xatoull_sfx(str, sfx);
}


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

x86 assembly (clang, -O2):
<xatou_sfx>:
jmp    1030 <xatoull_sfx@plt>

LLVM IR (-O0):
%struct.suffix_mult = type { i32 }
define i32 @xatou_sfx(i8* %0, %struct.suffix_mult* %1) {
%3 = alloca i8*
%4 = alloca %struct.suffix_mult*
store i8* %0, i8** %3
store %struct.suffix_mult* %1, %struct.suffix_mult** %4
%5 = load i8*, i8** %3
%6 = load %struct.suffix_mult*, %struct.suffix_mult** %4
%7 = call i32 @xatoull_sfx(i8* %5, %struct.suffix_mult* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.suffix_mult = type { i32 }
define i32 @xatou_sfx(i8* %0, %struct.suffix_mult* %1) {
%3 = tail call i32 @xatoull_sfx(i8* %0, %struct.suffix_mult* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *, char *);
void usage(char *name) {
  printf("Usage: %s [options]\n"
         "Options: -f<pixelformat>\n"
         "            where format is one of:\n"
         "              CLUT4,CLUT8,ARGB1555,RGB565,ARGB\n"
         "         -s<width>x<heigth>\n"
         "            where width is either 720,640,360,320\n"
         "                  and height is either 288,240,480,576\n"
         "         -n\n"
         "            disables clearing the framebuffer after drawing\n"
         "            the testimage. This can be useful to keep the last\n"
         "            drawn image onscreen.\n"
         "\nExample: %s -fRGB322\n",
         name, name);
  exit(0);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x8(%rbp),%rdx
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [453 x i8] c"Usage: %s [options]\0AOptions: -f<pixelformat>\0A where format is one of:\0A CLUT4,CLUT8,ARGB1555,RGB565,ARGB\0A -s<width>x<heigth>\0A where width is either 720,640,360,320\0A and height is either 288,240,480,576\0A -n\0A disables clearing the framebuffer after drawing\0A the testimage. This can be useful to keep the last\0A drawn image onscreen.\0A\0AExample: %s -fRGB322\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([453 x i8], [453 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %4)
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [453 x i8] c"Usage: %s [options]\0AOptions: -f<pixelformat>\0A where format is one of:\0A CLUT4,CLUT8,ARGB1555,RGB565,ARGB\0A -s<width>x<heigth>\0A where width is either 720,640,360,320\0A and height is either 288,240,480,576\0A -n\0A disables clearing the framebuffer after drawing\0A the testimage. This can be useful to keep the last\0A drawn image onscreen.\0A\0AExample: %s -fRGB322\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([453 x i8], [453 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %0)
%3 = tail call i32 @exit(i32 0)
unreachable
}
double ls_cost_nm8_sign(double x) { return x < 0 ? -1 : x > 0 ? 1 : x; }


x86 assembly (clang, -O0):
<ls_cost_nm8_sign>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1129 <ls_cost_nm8_sign+0x29>
movsd  0xee9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1161 <ls_cost_nm8_sign+0x61>
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    114d <ls_cost_nm8_sign+0x4d>
movsd  0xebd(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1157 <ls_cost_nm8_sign+0x57>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_cost_nm8_sign>:
xorpd  %xmm1,%xmm1
xorpd  %xmm2,%xmm2
cmpltsd %xmm0,%xmm2
movsd  0xeeb(%rip),%xmm3
andpd  %xmm2,%xmm3
andnpd %xmm0,%xmm2
orpd   %xmm3,%xmm2
cmpltsd %xmm1,%xmm0
movapd %xmm0,%xmm1
andnpd %xmm2,%xmm1
movsd  0xed2(%rip),%xmm2
andpd  %xmm2,%xmm0
orpd   %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @ls_cost_nm8_sign(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 0.000000e+00
br i1 %4, label %5, label %6
5: ; preds = %1
br label %14
6: ; preds = %1
%7 = load double, double* %2
%8 = fcmp ogt double %7, 0.000000e+00
br i1 %8, label %9, label %10
9: ; preds = %6
br label %12
10: ; preds = %6
%11 = load double, double* %2
br label %12
12: ; preds = %10, %9
%13 = phi double [ 1.000000e+00, %9 ], [ %11, %10 ]
br label %14
14: ; preds = %12, %5
%15 = phi double [ -1.000000e+00, %5 ], [ %13, %12 ]
ret double %15
}

LLVM IR (-O2):
define double @ls_cost_nm8_sign(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fcmp ogt double %0, 0.000000e+00
%4 = select i1 %3, double 1.000000e+00, double %0
%5 = select i1 %2, double -1.000000e+00, double %4
ret double %5
}
_Atomic(int) compound_sub(_Atomic(int) in) { return (in -= 5); }


x86 assembly (clang, -O0):
<compound_sub>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0xfffffffb,%eax
lock xadd %eax,-0x4(%rbp)
sub    $0x5,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compound_sub>:
mov    %edi,-0x4(%rsp)
mov    $0xfffffffb,%eax
lock xadd %eax,-0x4(%rsp)
add    $0xfffffffb,%eax
ret

LLVM IR (-O0):
define i32 @compound_sub(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = atomicrmw sub i32* %2, i32 5 seq_cst
%4 = sub i32 %3, 5
ret i32 %4
}

LLVM IR (-O2):
define i32 @compound_sub(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = atomicrmw sub i32* %2, i32 5 seq_cst
%4 = add i32 %3, -5
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ isspace(char);
char *skip_over_word(char *cp) {
  while (*cp && !isspace(*cp))
    cp++;
  return cp;
}


x86 assembly (clang, -O0):
<skip_over_word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1148 <skip_over_word+0x38>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1158 <skip_over_word+0x48>
jmp    1169 <skip_over_word+0x59>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <skip_over_word+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_over_word>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1138 <skip_over_word+0x28>
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <isspace@plt>
test   %eax,%eax
jne    1138 <skip_over_word+0x28>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <skip_over_word+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @skip_over_word(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %16, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = call i32 @isspace(i8 signext %10)
%12 = icmp ne i32 %11, 0
%13 = xor i1 %12, true
br label %14
14: ; preds = %8, %3
%15 = phi i1 [ false, %3 ], [ %13, %8 ]
br i1 %15, label %16, label %19
16: ; preds = %14
%17 = load i8*, i8** %2
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %2
br label %3
19: ; preds = %14
%20 = load i8*, i8** %2
ret i8* %20
}

LLVM IR (-O2):
define i8* @skip_over_word(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %9
%5 = phi i8 [ %11, %9 ], [ %2, %1 ]
%6 = phi i8* [ %10, %9 ], [ %0, %1 ]
%7 = tail call i32 @isspace(i8 signext %5)
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %9, %1
%14 = phi i8* [ %0, %1 ], [ %10, %9 ], [ %6, %4 ]
ret i8* %14
}
/* Variables and functions */
int strlen(char *);
void erase(char arr[]) {
  int i;
  for (i = 1; i <= strlen(arr); i++) {
    arr[i - 1] = arr[i];
  }
}


x86 assembly (clang, -O0):
<erase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jg     1168 <erase+0x58>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <erase+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<erase>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
test   %eax,%eax
jle    114d <erase+0x3d>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl 0x1(%r14,%rbx,1),%eax
mov    %al,(%r14,%rbx,1)
mov    %r14,%rdi
call   1030 <strlen@plt>
cltq
add    $0x1,%rbx
cmp    %rax,%rbx
jl     1130 <erase+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @erase(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp slt i32 %2, 1
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %10, %4 ], [ 1, %1 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = add nsw i64 %5, -1
%9 = getelementptr inbounds i8, i8* %0, i64 %8
store i8 %7, i8* %9
%10 = add nuw nsw i64 %5, 1
%11 = tail call i32 @strlen(i8* %0)
%12 = sext i32 %11 to i64
%13 = icmp slt i64 %5, %12
br i1 %13, label %4, label %14
14: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int logmsg_t(char *, char *, int /*<<< orphan*/ *, unsigned int, int);
int eslib_logcritical_t(char *name, char *msg, time_t *timer,
                        unsigned int seconds) {
  return logmsg_t(name, msg, timer, seconds, 3);
}


x86 assembly (clang, -O0):
<eslib_logcritical_t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    $0x3,%r8d
call   1030 <logmsg_t@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eslib_logcritical_t>:
mov    $0x3,%r8d
jmp    1030 <logmsg_t@plt>

LLVM IR (-O0):
define i32 @eslib_logcritical_t(i8* %0, i8* %1, i32* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32*
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32* %2, i32** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i32*, i32** %7
%12 = load i32, i32* %8
%13 = call i32 @logmsg_t(i8* %9, i8* %10, i32* %11, i32 %12, i32 3)
ret i32 %13
}

LLVM IR (-O2):
define i32 @eslib_logcritical_t(i8* %0, i8* %1, i32* %2, i32 %3) {
%5 = tail call i32 @logmsg_t(i8* %0, i8* %1, i32* %2, i32 %3, i32 3)
ret i32 %5
}
int cycle_is_check_spr_dma(unsigned int flags) {
  return (flags & 0x0e000000) == 0x02000000;
}


x86 assembly (clang, -O0):
<cycle_is_check_spr_dma>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xe000000,%eax
cmp    $0x2000000,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cycle_is_check_spr_dma>:
and    $0xe000000,%edi
xor    %eax,%eax
cmp    $0x2000000,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @cycle_is_check_spr_dma(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 234881024
%5 = icmp eq i32 %4, 33554432
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @cycle_is_check_spr_dma(i32 %0) {
%2 = and i32 %0, 234881024
%3 = icmp eq i32 %2, 33554432
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int tri_num = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8;
  printf("The eighth triangular number is: %i\n", tri_num);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [37 x i8] c"The eighth triangular number is: %i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 36, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [37 x i8] c"The eighth triangular number is: %i\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 36)
ret i32 0
}
unsigned int rotint(unsigned int x, int rotnum) {
  int count;
  unsigned int y;
  y = 0;
  for (count = 0; count < 32; count++) {
    y <<= 1;
    y |= ((x >> ((count + rotnum) & 31)) & 1);
  }
  return (y);
}


x86 assembly (clang, -O0):
<rotint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x20,-0xc(%rbp)
jge    1150 <rotint+0x50>
mov    -0x10(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
add    -0x8(%rbp),%ecx
and    $0x1f,%ecx
shr    %cl,%eax
and    $0x1,%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1118 <rotint+0x18>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotint>:
xor    %eax,%eax
mov    $0x20,%r8d
nopl   0x0(%rax,%rax,1)
mov    %edi,%edx
mov    %esi,%ecx
shr    %cl,%edx
and    $0x1,%edx
add    %edx,%edx
lea    (%rdx,%rax,4),%edx
lea    0x1(%rsi),%ecx
mov    %edi,%eax
shr    %cl,%eax
and    $0x1,%eax
or     %edx,%eax
add    $0x2,%esi
add    $0xfffffffe,%r8d
jne    1110 <rotint+0x10>
ret

LLVM IR (-O0):
define i32 @rotint(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %6
store i32 0, i32* %5
br label %7
7: ; preds = %22, %2
%8 = load i32, i32* %5
%9 = icmp slt i32 %8, 32
br i1 %9, label %10, label %25
10: ; preds = %7
%11 = load i32, i32* %6
%12 = shl i32 %11, 1
store i32 %12, i32* %6
%13 = load i32, i32* %3
%14 = load i32, i32* %5
%15 = load i32, i32* %4
%16 = add nsw i32 %14, %15
%17 = and i32 %16, 31
%18 = lshr i32 %13, %17
%19 = and i32 %18, 1
%20 = load i32, i32* %6
%21 = or i32 %20, %19
store i32 %21, i32* %6
br label %22
22: ; preds = %10
%23 = load i32, i32* %5
%24 = add nsw i32 %23, 1
store i32 %24, i32* %5
br label %7
25: ; preds = %7
%26 = load i32, i32* %6
ret i32 %26
}

LLVM IR (-O2):
define i32 @rotint(i32 %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ 0, %2 ], [ %18, %3 ]
%5 = phi i32 [ 0, %2 ], [ %19, %3 ]
%6 = add nsw i32 %5, %1
%7 = and i32 %6, 31
%8 = lshr i32 %0, %7
%9 = or i32 %5, 1
%10 = shl i32 %4, 2
%11 = shl i32 %8, 1
%12 = and i32 %11, 2
%13 = or i32 %10, %12
%14 = add nsw i32 %9, %1
%15 = and i32 %14, 31
%16 = lshr i32 %0, %15
%17 = and i32 %16, 1
%18 = or i32 %17, %13
%19 = add nuw nsw i32 %5, 2
%20 = icmp eq i32 %19, 32
br i1 %20, label %21, label %3
21: ; preds = %3
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a;
  scanf("%d", &a);
  printf("%d\n", a);
  if (a < 0)
    printf("음수입니다.");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0x8(%rbp)
jge    1168 <main+0x48>
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
lea    0xec6(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
cmpl   $0x0,0x4(%rsp)
jns    1159 <main+0x39>
lea    0xeb5(%rip),%rdi
xor    %eax,%eax
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"%d\0A\00"
@.str.2 = [17 x i8] c"\EC\9D\8C\EC\88\98\EC\9E\85\EB\8B\88\EB\8B\A4.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
br label %10
10: ; preds = %8, %0
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
@.str.2 = [17 x i8] c"\EC\9D\8C\EC\88\98\EC\9E\85\EB\8B\88\EB\8B\A4.\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %1
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
br label %10
10: ; preds = %8, %0
ret i32 0
}