xunge/DecIR huggingface dataset:
unsigned short LINT_TO_UINT(long var) {
  unsigned short newvar;
  if (var >= 255)
    newvar = 255;
  else if (var < 0)
    newvar = 0;
  else
    newvar = (unsigned short)var;
  return newvar;
}


x86 assembly (clang, -O0):
<LINT_TO_UINT>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0xff,-0x8(%rbp)
jl     1121 <LINT_TO_UINT+0x21>
movw   $0xff,-0xa(%rbp)
jmp    1144 <LINT_TO_UINT+0x44>
cmpq   $0x0,-0x8(%rbp)
jge    1137 <LINT_TO_UINT+0x37>
movw   $0x0,-0xa(%rbp)
jmp    113f <LINT_TO_UINT+0x3f>
mov    -0x8(%rbp),%rax
mov    %ax,-0xa(%rbp)
jmp    1144 <LINT_TO_UINT+0x44>
movzwl -0xa(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<LINT_TO_UINT>:
xor    %eax,%eax
test   %rdi,%rdi
mov    %edi,%ecx
cmovle %eax,%ecx
cmp    $0xff,%rdi
mov    $0xff,%eax
cmovl  %ecx,%eax
ret

LLVM IR (-O0):
define zeroext i16 @LINT_TO_UINT(i64 %0) {
%2 = alloca i64
%3 = alloca i16
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = icmp sge i64 %4, 255
br i1 %5, label %6, label %7
6: ; preds = %1
store i16 255, i16* %3
br label %15
7: ; preds = %1
%8 = load i64, i64* %2
%9 = icmp slt i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %7
store i16 0, i16* %3
br label %14
11: ; preds = %7
%12 = load i64, i64* %2
%13 = trunc i64 %12 to i16
store i16 %13, i16* %3
br label %14
14: ; preds = %11, %10
br label %15
15: ; preds = %14, %6
%16 = load i16, i16* %3
ret i16 %16
}

LLVM IR (-O2):
define zeroext i16 @LINT_TO_UINT(i64 %0) {
%2 = icmp sgt i64 %0, 254
%3 = icmp sgt i64 %0, 0
%4 = select i1 %3, i64 %0, i64 0
%5 = trunc i64 %4 to i16
%6 = select i1 %2, i16 255, i16 %5
ret i16 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void showUsage(char *progname) {
  printf("usage:\n"
         "    -p port    the start port number\n"
         "    -h host    the address\n"
         "    -totalNum number  the port from port to port+totalNum\n");
}


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

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

LLVM IR (-O0):
@.str = [130 x i8] c"usage:\0A -p port the start port number\0A -h host the address\0A -totalNum number the port from port to port+totalNum\0A\00"
define void @showUsage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [129 x i8] c"usage:\0A -p port the start port number\0A -h host the address\0A -totalNum number the port from port to port+totalNum\00"
define void @showUsage(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([129 x i8], [129 x i8]* @str, i64 0, i64 0))
ret void
}
int llz_musicpitch_get_framelen(int sample_rate) {
  switch (sample_rate) {
  case 8000:
    return 256;
  case 11025:
    return 256;
  case 22050:
    return 512;
  case 32000:
    return 512;
  case 44100:
    return 1024;
  default:
    return 512;
  }
}


x86 assembly (clang, -O0):
<llz_musicpitch_get_framelen>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x1f40,%eax
je     1169 <llz_musicpitch_get_framelen+0x69>
jmp    111d <llz_musicpitch_get_framelen+0x1d>
mov    -0xc(%rbp),%eax
sub    $0x2b11,%eax
je     1175 <llz_musicpitch_get_framelen+0x75>
jmp    1130 <llz_musicpitch_get_framelen+0x30>
mov    -0xc(%rbp),%eax
sub    $0x5622,%eax
je     1181 <llz_musicpitch_get_framelen+0x81>
jmp    1143 <llz_musicpitch_get_framelen+0x43>
mov    -0xc(%rbp),%eax
sub    $0x7d00,%eax
je     118d <llz_musicpitch_get_framelen+0x8d>
jmp    1156 <llz_musicpitch_get_framelen+0x56>
mov    -0xc(%rbp),%eax
sub    $0xac44,%eax
je     1199 <llz_musicpitch_get_framelen+0x99>
jmp    11a5 <llz_musicpitch_get_framelen+0xa5>
movl   $0x100,-0x4(%rbp)
jmp    11ac <llz_musicpitch_get_framelen+0xac>
movl   $0x100,-0x4(%rbp)
jmp    11ac <llz_musicpitch_get_framelen+0xac>
movl   $0x200,-0x4(%rbp)
jmp    11ac <llz_musicpitch_get_framelen+0xac>
movl   $0x200,-0x4(%rbp)
jmp    11ac <llz_musicpitch_get_framelen+0xac>
movl   $0x400,-0x4(%rbp)
jmp    11ac <llz_musicpitch_get_framelen+0xac>
movl   $0x200,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<llz_musicpitch_get_framelen>:
cmp    $0x5621,%edi
jle    1120 <llz_musicpitch_get_framelen+0x20>
cmp    $0xac44,%edi
je     113c <llz_musicpitch_get_framelen+0x3c>
cmp    $0x7d00,%edi
je     1136 <llz_musicpitch_get_framelen+0x36>
cmp    $0x5622,%edi
jmp    1136 <llz_musicpitch_get_framelen+0x36>
mov    $0x100,%eax
cmp    $0x1f40,%edi
je     1135 <llz_musicpitch_get_framelen+0x35>
cmp    $0x2b11,%edi
jne    1136 <llz_musicpitch_get_framelen+0x36>
ret
mov    $0x200,%eax
ret
mov    $0x400,%eax
ret

LLVM IR (-O0):
define i32 @llz_musicpitch_get_framelen(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %10 [
i32 8000, label %5
i32 11025, label %6
i32 22050, label %7
i32 32000, label %8
i32 44100, label %9
]
5: ; preds = %1
store i32 256, i32* %2
br label %11
6: ; preds = %1
store i32 256, i32* %2
br label %11
7: ; preds = %1
store i32 512, i32* %2
br label %11
8: ; preds = %1
store i32 512, i32* %2
br label %11
9: ; preds = %1
store i32 1024, i32* %2
br label %11
10: ; preds = %1
store i32 512, i32* %2
br label %11
11: ; preds = %10, %9, %8, %7, %6, %5
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @llz_musicpitch_get_framelen(i32 %0) {
switch i32 %0, label %5 [
i32 8000, label %6
i32 11025, label %6
i32 22050, label %2
i32 32000, label %3
i32 44100, label %4
]
2: ; preds = %1
br label %6
3: ; preds = %1
br label %6
4: ; preds = %1
br label %6
5: ; preds = %1
br label %6
6: ; preds = %1, %1, %5, %4, %3, %2
%7 = phi i32 [ 512, %5 ], [ 1024, %4 ], [ 512, %3 ], [ 512, %2 ], [ 256, %1 ], [ 256, %1 ]
ret i32 %7
}
void spdif_iomux_config() {}


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

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

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

LLVM IR (-O2):
define void @spdif_iomux_config() {
ret void
}
int sgn(double x) {
  if (x >= 0)
    return 1;
  else
    return -1;
}


x86 assembly (clang, -O0):
<sgn>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1127 <sgn+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <sgn+0x2e>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sgn>:
xorpd  %xmm1,%xmm1
xor    %eax,%eax
ucomisd %xmm1,%xmm0
setae  %al
add    %eax,%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @sgn(double %0) {
%2 = alloca i32
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp oge double %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 1, i32* %2
br label %8
7: ; preds = %1
store i32 -1, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @sgn(double %0) {
%2 = fcmp ult double %0, 0.000000e+00
%3 = select i1 %2, i32 -1, i32 1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ __builtin_arm_wsrp(char *, void *);
void wsrp(void *v) { __builtin_arm_wsrp("sysreg", v); }


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"sysreg\00"
define void @wsrp(i8* %0) {
%2 = tail call i32 @__builtin_arm_wsrp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void push(int key, int a[], int *top) {
  (*top)++;
  a[*top] = key;
}


x86 assembly (clang, -O0):
<push>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movslq (%rcx),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<push>:
movslq (%rdx),%rax
lea    0x1(%rax),%rcx
mov    %ecx,(%rdx)
mov    %edi,0x4(%rsi,%rax,4)
ret

LLVM IR (-O0):
define void @push(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** %6
%8 = load i32, i32* %7
%9 = add nsw i32 %8, 1
store i32 %9, i32* %7
%10 = load i32, i32* %4
%11 = load i32*, i32** %5
%12 = load i32*, i32** %6
%13 = load i32, i32* %12
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %11, i64 %14
store i32 %10, i32* %15
ret void
}

LLVM IR (-O2):
define void @push(i32 %0, i32* nocapture writeonly %1, i32* nocapture %2) {
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 1
store i32 %5, i32* %2
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i32, i32* %1, i64 %6
store i32 %0, i32* %7
ret void
}
/* Variables and functions */
void *realloc(void *, unsigned int);
int /*<<< orphan*/ std_err(char *);
void *alloc_r(void *q, unsigned numb) {
  void *p;
  if (!numb)
    ++numb;
  if (!(p = realloc(q, numb)))
    std_err("failed memory allocate");
  return p;
}


x86 assembly (clang, -O0):
<alloc_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1142 <alloc_r+0x22>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1168 <alloc_r+0x48>
lea    0xe9d(%rip),%rdi
call   1040 <std_err@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_r>:
push   %rbx
test   %esi,%esi
mov    $0x1,%eax
cmove  %eax,%esi
call   1030 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1144 <alloc_r+0x24>
lea    0xec1(%rip),%rdi
call   1040 <std_err@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"failed memory allocate\00"
define i8* @alloc_r(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load i32, i32* %4
%10 = add i32 %9, 1
store i32 %10, i32* %4
br label %11
11: ; preds = %8, %2
%12 = load i8*, i8** %3
%13 = load i32, i32* %4
%14 = call i8* @realloc(i8* %12, i32 %13)
store i8* %14, i8** %5
%15 = icmp ne i8* %14, null
br i1 %15, label %18, label %16
16: ; preds = %11
%17 = call i32 @std_err(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %18
18: ; preds = %16, %11
%19 = load i8*, i8** %5
ret i8* %19
}

LLVM IR (-O2):
@.str = [23 x i8] c"failed memory allocate\00"
define i8* @alloc_r(i8* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = select i1 %3, i32 1, i32 %1
%5 = tail call i8* @realloc(i8* %0, i32 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @std_err(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %2
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int);
void printButton(char *value, int cmd) {
  printf("<input type='submit' value='%s' onclick='CtrlCommand(%d);' />\n",
         value, cmd);
}


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

x86 assembly (clang, -O2):
<printButton>:
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xee4(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [63 x i8] c"<input type='submit' value='%s' onclick='CtrlCommand(%d);' />\0A\00"
define void @printButton(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [63 x i8] c"<input type='submit' value='%s' onclick='CtrlCommand(%d);' />\0A\00"
define void @printButton(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ con_do_putc(unsigned char);
int /*<<< orphan*/ con_flush();
void con_puts(const char *s) {
  unsigned char c;
  while ((c = *s++))
    con_do_putc(c);
  con_flush();
}


x86 assembly (clang, -O0):
<con_puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0x9(%rbp)
cmp    $0x0,%al
je     1156 <con_puts+0x36>
movzbl -0x9(%rbp),%edi
call   1040 <con_do_putc@plt>
jmp    112c <con_puts+0xc>
mov    $0x0,%al
call   1030 <con_flush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<con_puts>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1143 <con_puts+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movzbl %al,%edi
call   1040 <con_do_putc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <con_puts+0x10>
xor    %eax,%eax
pop    %rbx
jmp    1030 <con_flush@plt>

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

LLVM IR (-O2):
define void @con_puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = tail call i32 @con_do_putc(i8 zeroext %5)
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = tail call i32 (...) @con_flush()
ret void
}
extern void f(int x) {}


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

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

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

LLVM IR (-O2):
define void @f(i32 %0) {
ret void
}
int isprint(int c) {
  if (c >= ' ' && c <= '~')
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<isprint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x20,-0x8(%rbp)
jl     1127 <isprint+0x27>
cmpl   $0x7e,-0x8(%rbp)
jg     1127 <isprint+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <isprint+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isprint>:
add    $0xffffffe0,%edi
xor    %eax,%eax
cmp    $0x5f,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @isprint(i32 %0) {
%2 = add i32 %0, -32
%3 = icmp ult i32 %2, 95
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ EPOLL_CTL_DEL;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ epoll_ctl(int, int /*<<< orphan*/, int, int /*<<< orphan*/);
void clear_client(int cli_fd, int epoll_fd) {
  epoll_ctl(epoll_fd, EPOLL_CTL_DEL, cli_fd, 0);
  close(cli_fd);
}


x86 assembly (clang, -O0):
<clear_client>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
mov    -0x4(%rbp),%edx
xor    %ecx,%ecx
call   1040 <epoll_ctl@plt>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_client>:
push   %rbx
mov    %esi,%eax
mov    %edi,%ebx
mov    0x2ecc(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
mov    %ebx,%edx
xor    %ecx,%ecx
call   1040 <epoll_ctl@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <close@plt>

LLVM IR (-O0):
@EPOLL_CTL_DEL = global i32 0
define void @clear_client(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* @EPOLL_CTL_DEL
%7 = load i32, i32* %3
%8 = call i32 @epoll_ctl(i32 %5, i32 %6, i32 %7, i32 0)
%9 = load i32, i32* %3
%10 = call i32 @close(i32 %9)
ret void
}

LLVM IR (-O2):
@EPOLL_CTL_DEL = global i32 0
define void @clear_client(i32 %0, i32 %1) {
%3 = load i32, i32* @EPOLL_CTL_DEL
%4 = tail call i32 @epoll_ctl(i32 %1, i32 %3, i32 %0, i32 0)
%5 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
float clamp(float, double, double);
float floor(float);
float mod(float, double);
float pow(double, float);
float extract_bit(float n, float b) {
  b = clamp(b, -1.0, 24.0);
  return floor(mod(floor(n / pow(2.0, floor(b))), 2.0));
}


x86 assembly (clang, -O0):
<extract_bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movsd  0xea9(%rip),%xmm1
movsd  0xea9(%rip),%xmm2
call   1040 <clamp@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
call   1060 <floor@plt>
movaps %xmm0,%xmm1
movsd  0xe70(%rip),%xmm0
call   1050 <pow@plt>
movaps %xmm0,%xmm1
movss  -0xc(%rbp),%xmm0
divss  %xmm1,%xmm0
call   1060 <floor@plt>
movsd  0xe52(%rip),%xmm1
call   1030 <mod@plt>
call   1060 <floor@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<extract_bit>:
push   %rax
movaps %xmm1,%xmm3
movss  %xmm0,0x4(%rsp)
movsd  0xeae(%rip),%xmm1
movsd  0xeae(%rip),%xmm2
movaps %xmm3,%xmm0
call   1040 <clamp@plt>
call   1050 <floorf@plt>
movaps %xmm0,%xmm1
movsd  0xe9e(%rip),%xmm0
call   1060 <pow@plt>
movss  0x4(%rsp),%xmm1
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
call   1050 <floorf@plt>
movsd  0xe7f(%rip),%xmm1
call   1030 <mod@plt>
pop    %rax
jmp    1050 <floorf@plt>

LLVM IR (-O0):
define float @extract_bit(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %4
%6 = call float @clamp(float %5, double -1.000000e+00, double 2.400000e+01)
store float %6, float* %4
%7 = load float, float* %3
%8 = load float, float* %4
%9 = call float @floor(float %8)
%10 = call float @pow(double 2.000000e+00, float %9)
%11 = fdiv float %7, %10
%12 = call float @floor(float %11)
%13 = call float @mod(float %12, double 2.000000e+00)
%14 = call float @floor(float %13)
ret float %14
}

LLVM IR (-O2):
define float @extract_bit(float %0, float %1) {
%3 = tail call float @clamp(float %1, double -1.000000e+00, double 2.400000e+01)
%4 = tail call float @llvm.floor.f32(float %3)
%5 = tail call float @pow(double 2.000000e+00, float %4)
%6 = fdiv float %0, %5
%7 = tail call float @llvm.floor.f32(float %6)
%8 = tail call float @mod(float %7, double 2.000000e+00)
%9 = tail call float @llvm.floor.f32(float %8)
ret float %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, void *);
void endElement(void *userData, const char *name) {
  printf("end(%s)\n", name, userData);
}


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

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

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

LLVM IR (-O2):
@.str = [9 x i8] c"end(%s)\0A\00"
define void @endElement(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %0)
ret void
}
/* Variables and functions */
int rand();
int rand_dont_convert_this_char(int prob) {
  int n = rand() % 100;
  if (n >= prob)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<rand_dont_convert_this_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     1145 <rand_dont_convert_this_char+0x35>
movl   $0x1,-0x4(%rbp)
jmp    114c <rand_dont_convert_this_char+0x3c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_dont_convert_this_char>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
movslq %eax,%rcx
imul   $0x51eb851f,%rcx,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rax
add    %edx,%eax
imul   $0x64,%eax,%eax
sub    %eax,%ecx
xor    %eax,%eax
cmp    %ebx,%ecx
setge  %al
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @rand_dont_convert_this_char(i32 %0) {
%2 = tail call i32 (...) @rand()
%3 = srem i32 %2, 100
%4 = icmp sge i32 %3, %0
%5 = zext i1 %4 to i32
ret i32 %5
}
void uart_init(void) {
  (*(volatile unsigned long *)0x56000070) &= ~((0x3 << 4) | (0x3 << 6));
  (*(volatile unsigned long *)0x56000070) |= ((0x2 << 4) | (0x2 << 6));
  (*(volatile unsigned char *)0x50000000) = 0x03;
  (*(volatile unsigned char *)0x50000004) = 0x09;
  (*(volatile unsigned long *)0x50000028) = (int)(50000000 / (115200 * 16) - 1);
}


x86 assembly (clang, -O0):
<uart_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x56000070,%eax
mov    (%rax),%rcx
and    $0xffffffffffffff0f,%rcx
mov    $0x56000070,%eax
mov    %rcx,(%rax)
mov    $0x56000070,%eax
mov    (%rax),%rcx
or     $0xa0,%rcx
mov    $0x56000070,%eax
mov    %rcx,(%rax)
mov    $0x50000000,%eax
movb   $0x3,(%rax)
mov    $0x50000004,%eax
movb   $0x9,(%rax)
mov    $0x50000028,%eax
movq   $0x1a,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_init>:
andq   $0xffffffffffffff0f,0x56000070
56 0f ff ff ff
orq    $0xa0,0x56000070
movb   $0x3,0x50000000
03
movb   $0x9,0x50000004
09
movq   $0x1a,0x50000028
ret

LLVM IR (-O0):
define void @uart_init() {
%1 = load volatile i64, i64* inttoptr (i64 1442840688 to i64*)
%2 = and i64 %1, -241
store volatile i64 %2, i64* inttoptr (i64 1442840688 to i64*)
%3 = load volatile i64, i64* inttoptr (i64 1442840688 to i64*)
%4 = or i64 %3, 160
store volatile i64 %4, i64* inttoptr (i64 1442840688 to i64*)
store volatile i8 3, i8* inttoptr (i64 1342177280 to i8*)
store volatile i8 9, i8* inttoptr (i64 1342177284 to i8*)
store volatile i64 26, i64* inttoptr (i64 1342177320 to i64*)
ret void
}

LLVM IR (-O2):
define void @uart_init() {
%1 = load volatile i64, i64* inttoptr (i64 1442840688 to i64*)
%2 = and i64 %1, -241
store volatile i64 %2, i64* inttoptr (i64 1442840688 to i64*)
%3 = load volatile i64, i64* inttoptr (i64 1442840688 to i64*)
%4 = or i64 %3, 160
store volatile i64 %4, i64* inttoptr (i64 1442840688 to i64*)
store volatile i8 3, i8* inttoptr (i64 1342177280 to i8*)
store volatile i8 9, i8* inttoptr (i64 1342177284 to i8*)
store volatile i64 26, i64* inttoptr (i64 1342177320 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
int pause(const char *what, int timeout) {
  if (timeout == 0)
    timeout = 1;
  usleep((1000000 / 1000) * timeout);
  return (0);
}


x86 assembly (clang, -O0):
<pause>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1130 <pause+0x20>
movl   $0x1,-0xc(%rbp)
imul   $0x3e8,-0xc(%rbp),%edi
call   1030 <usleep@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pause>:
push   %rax
imul   $0x3e8,%esi,%eax
test   %esi,%esi
mov    $0x3e8,%edi
cmovne %eax,%edi
call   1030 <usleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @pause(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %2
store i32 1, i32* %4
br label %8
8: ; preds = %7, %2
%9 = load i32, i32* %4
%10 = mul nsw i32 1000, %9
%11 = call i32 @usleep(i32 %10)
ret i32 0
}

LLVM IR (-O2):
define i32 @pause(i8* nocapture readnone %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = mul nsw i32 %1, 1000
%5 = select i1 %3, i32 1000, i32 %4
%6 = tail call i32 @usleep(i32 %5)
ret i32 0
}
unsigned makeOperand(char c, unsigned operand) {
  return (operand * 10) + (c - '0');
}


x86 assembly (clang, -O0):
<makeOperand>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
imul   $0xa,-0x8(%rbp),%eax
movsbl -0x1(%rbp),%ecx
sub    $0x30,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<makeOperand>:
lea    (%rsi,%rsi,4),%eax
lea    (%rdi,%rax,2),%eax
add    $0xffffffd0,%eax
ret

LLVM IR (-O0):
define i32 @makeOperand(i8 signext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = mul i32 %5, 10
%7 = load i8, i8* %3
%8 = sext i8 %7 to i32
%9 = sub nsw i32 %8, 48
%10 = add i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @makeOperand(i8 signext %0, i32 %1) {
%3 = mul i32 %1, 10
%4 = sext i8 %0 to i32
%5 = add nsw i32 %4, -48
%6 = add i32 %5, %3
ret i32 %6
}
int pathcon_nm10_f0(const double **arg, double **res, int *iw, double *w,
                    int mem) {
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @pathcon_nm10_f0(double** %0, double** %1, i32* %2, double* %3, i32 %4) {
%6 = alloca double**
%7 = alloca double**
%8 = alloca i32*
%9 = alloca double*
%10 = alloca i32
store double** %0, double*** %6
store double** %1, double*** %7
store i32* %2, i32** %8
store double* %3, double** %9
store i32 %4, i32* %10
ret i32 0
}

LLVM IR (-O2):
define i32 @pathcon_nm10_f0(double** nocapture readnone %0, double** nocapture readnone %1, i32* nocapture readnone %2, double* nocapture readnone %3, i32 %4) {
ret i32 0
}
/* Variables and functions */
size_t hash(size_t a) {
  a ^= (a >> 20) ^ (a >> 12);
  return a ^ (a >> 7) ^ (a >> 4);
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x14,%rax
mov    -0x8(%rbp),%rcx
shr    $0xc,%rcx
xor    %rcx,%rax
xor    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
shr    $0x7,%rcx
xor    %rcx,%rax
mov    -0x8(%rbp),%rcx
shr    $0x4,%rcx
xor    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    %rdi,%rax
shr    $0xc,%rax
xor    %rdi,%rax
shr    $0x14,%rdi
xor    %rdi,%rax
mov    %rax,%rcx
shr    $0x7,%rcx
xor    %rax,%rcx
shr    $0x4,%rax
xor    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @hash(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 20
%5 = load i64, i64* %2
%6 = lshr i64 %5, 12
%7 = xor i64 %4, %6
%8 = load i64, i64* %2
%9 = xor i64 %8, %7
store i64 %9, i64* %2
%10 = load i64, i64* %2
%11 = load i64, i64* %2
%12 = lshr i64 %11, 7
%13 = xor i64 %10, %12
%14 = load i64, i64* %2
%15 = lshr i64 %14, 4
%16 = xor i64 %13, %15
ret i64 %16
}

LLVM IR (-O2):
define i64 @hash(i64 %0) {
%2 = lshr i64 %0, 20
%3 = lshr i64 %0, 12
%4 = xor i64 %3, %0
%5 = xor i64 %4, %2
%6 = lshr i64 %5, 7
%7 = xor i64 %6, %5
%8 = lshr i64 %5, 4
%9 = xor i64 %7, %8
ret i64 %9
}
void foo(int *a) {
  if (a[0] != a[1] * 2333)
    __builtin_abort();
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x8(%rbp),%rcx
imul   $0x91d,0x4(%rcx),%ecx
cmp    %ecx,%eax
je     113a <foo+0x2a>
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
imul   $0x91d,0x4(%rdi),%eax
cmp    %eax,(%rdi)
jne    111e <foo+0xe>
pop    %rax
ret
call   1030 <abort@plt>

LLVM IR (-O0):
define void @foo(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 1
%8 = load i32, i32* %7
%9 = mul nsw i32 %8, 2333
%10 = icmp ne i32 %5, %9
br i1 %10, label %11, label %12
11: ; preds = %1
unreachable
12: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @foo(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = mul nsw i32 %4, 2333
%6 = icmp eq i32 %2, %5
br i1 %6, label %8, label %7
7: ; preds = %1
tail call void @abort()
unreachable
8: ; preds = %1
ret void
}
int test_signbitf(float x) { return __builtin_signbitf(x); }


x86 assembly (clang, -O0):
<test_signbitf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
cmp    $0x0,%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_signbitf>:
movmskps %xmm0,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @test_signbitf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = bitcast float %3 to i32
%5 = icmp slt i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @test_signbitf(float %0) {
%2 = bitcast float %0 to i32
%3 = lshr i32 %2, 31
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ sysctlbyname(char *, long *, size_t *, int /*<<< orphan*/,
                                int /*<<< orphan*/);
long long cpucycles_amd64tscfreq_persecond(void) {
  long result = 0;
  size_t resultlen = sizeof(long);
  sysctlbyname("machdep.tsc_freq", &result, &resultlen, 0, 0);
  return result;
}


x86 assembly (clang, -O0):
<cpucycles_amd64tscfreq_persecond>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
movq   $0x8,-0x10(%rbp)
lea    0xed1(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0x10(%rbp),%rdx
xor    %r8d,%r8d
mov    %r8d,%ecx
call   1030 <sysctlbyname@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpucycles_amd64tscfreq_persecond>:
sub    $0x18,%rsp
movq   $0x0,0x8(%rsp)
movq   $0x8,0x10(%rsp)
lea    0xed3(%rip),%rdi
lea    0x8(%rsp),%rsi
lea    0x10(%rsp),%rdx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <sysctlbyname@plt>
mov    0x8(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [17 x i8] c"machdep.tsc_freq\00"
define i64 @cpucycles_amd64tscfreq_persecond() {
%1 = alloca i64
%2 = alloca i64
store i64 0, i64* %1
store i64 8, i64* %2
%3 = call i32 @sysctlbyname(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i64* %1, i64* %2, i32 0, i32 0)
%4 = load i64, i64* %1
ret i64 %4
}

LLVM IR (-O2):
@.str = [17 x i8] c"machdep.tsc_freq\00"
define i64 @cpucycles_amd64tscfreq_persecond() {
%1 = alloca i64
%2 = alloca i64
%3 = bitcast i64* %1 to i8*
store i64 0, i64* %1
%4 = bitcast i64* %2 to i8*
store i64 8, i64* %2
%5 = call i32 @sysctlbyname(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i64* %1, i64* %2, i32 0, i32 0)
%6 = load i64, i64* %1
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ CL_AddBeams();
int /*<<< orphan*/ CL_AddExplosions();
int /*<<< orphan*/ CL_AddLasers();
int /*<<< orphan*/ CL_AddPlayerBeams();
int /*<<< orphan*/ CL_ProcessSustain();
void CL_AddTEnts(void) {
  CL_AddBeams();
  CL_AddPlayerBeams();
  CL_AddExplosions();
  CL_AddLasers();
  CL_ProcessSustain();
}


x86 assembly (clang, -O0):
<CL_AddTEnts>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <CL_AddBeams@plt>
mov    $0x0,%al
call   1030 <CL_AddPlayerBeams@plt>
mov    $0x0,%al
call   1060 <CL_AddExplosions@plt>
mov    $0x0,%al
call   1040 <CL_AddLasers@plt>
mov    $0x0,%al
call   1070 <CL_ProcessSustain@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<CL_AddTEnts>:
push   %rax
xor    %eax,%eax
call   1050 <CL_AddBeams@plt>
xor    %eax,%eax
call   1030 <CL_AddPlayerBeams@plt>
xor    %eax,%eax
call   1060 <CL_AddExplosions@plt>
xor    %eax,%eax
call   1040 <CL_AddLasers@plt>
xor    %eax,%eax
pop    %rcx
jmp    1070 <CL_ProcessSustain@plt>

LLVM IR (-O0):
define void @CL_AddTEnts() {
%1 = call i32 (...) @CL_AddBeams()
%2 = call i32 (...) @CL_AddPlayerBeams()
%3 = call i32 (...) @CL_AddExplosions()
%4 = call i32 (...) @CL_AddLasers()
%5 = call i32 (...) @CL_ProcessSustain()
ret void
}

LLVM IR (-O2):
define void @CL_AddTEnts() {
%1 = tail call i32 (...) @CL_AddBeams()
%2 = tail call i32 (...) @CL_AddPlayerBeams()
%3 = tail call i32 (...) @CL_AddExplosions()
%4 = tail call i32 (...) @CL_AddLasers()
%5 = tail call i32 (...) @CL_ProcessSustain()
ret void
}
int heap_rightIndex(int index) { return (2 * index) + 2; }


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

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

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

LLVM IR (-O2):
define i32 @heap_rightIndex(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = add nsw i32 %2, 2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void done(int sig) { exit(0); }


x86 assembly (clang, -O0):
<done>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<done>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @done(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @done(i32 %0) {
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct wl_shm_pool {
  int dummy;
};
struct wl_proxy {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_proxy_get_version(struct wl_proxy *);
uint32_t wl_shm_pool_get_version(struct wl_shm_pool *wl_shm_pool) {
  return wl_proxy_get_version((struct wl_proxy *)wl_shm_pool);
}


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

x86 assembly (clang, -O2):
<wl_shm_pool_get_version>:
jmp    1030 <wl_proxy_get_version@plt>

LLVM IR (-O0):
%struct.wl_shm_pool = type { i32 }
%struct.wl_proxy = type { i32 }
define i32 @wl_shm_pool_get_version(%struct.wl_shm_pool* %0) {
%2 = alloca %struct.wl_shm_pool*
store %struct.wl_shm_pool* %0, %struct.wl_shm_pool** %2
%3 = load %struct.wl_shm_pool*, %struct.wl_shm_pool** %2
%4 = bitcast %struct.wl_shm_pool* %3 to %struct.wl_proxy*
%5 = call i32 @wl_proxy_get_version(%struct.wl_proxy* %4)
ret i32 %5
}

LLVM IR (-O2):
%struct.wl_shm_pool = type { i32 }
%struct.wl_proxy = type { i32 }
define i32 @wl_shm_pool_get_version(%struct.wl_shm_pool* %0) {
%2 = bitcast %struct.wl_shm_pool* %0 to %struct.wl_proxy*
%3 = tail call i32 @wl_proxy_get_version(%struct.wl_proxy* %2)
ret i32 %3
}
int do_399() { return 399; }


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

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

LLVM IR (-O0):
define i32 @do_399() {
ret i32 399
}

LLVM IR (-O2):
define i32 @do_399() {
ret i32 399
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int print_version(void) {
  printf("serdi "
         "0.20.0"
         " <http://drobilla.net/software/serd>\n");
  printf("Copyright 2011-2013 David Robillard <http://drobilla.net>.\n"
         "License: <http://www.opensource.org/licenses/isc>\n"
         "This is free software; you are free to change and redistribute it."
         "\nThere is NO WARRANTY, to the extent permitted by law.\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [50 x i8] c"serdi 0.20.0 <http://drobilla.net/software/serd>\0A\00"
@.str.1 = [231 x i8] c"Copyright 2011-2013 David Robillard <http://drobilla.net>.\0ALicense: <http://www.opensource.org/licenses/isc>\0AThis is free software; you are free to change and redistribute it.\0AThere is NO WARRANTY, to the extent permitted by law.\0A\00"
define i32 @print_version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([231 x i8], [231 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [49 x i8] c"serdi 0.20.0 <http://drobilla.net/software/serd>\00"
@str.2 = [230 x i8] c"Copyright 2011-2013 David Robillard <http://drobilla.net>.\0ALicense: <http://www.opensource.org/licenses/isc>\0AThis is free software; you are free to change and redistribute it.\0AThere is NO WARRANTY, to the extent permitted by law.\00"
define i32 @print_version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([230 x i8], [230 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
const char *BF_options(void) { return ("blowfish(idx)"); }


x86 assembly (clang, -O0):
<BF_options>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BF_options>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [14 x i8] c"blowfish(idx)\00"
define i8* @BF_options() {
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [14 x i8] c"blowfish(idx)\00"
define i8* @BF_options() {
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}
unsigned long get_dmacfg_reg(int port) { return port == 0 ? 0x10 : 0x12; }


x86 assembly (clang, -O0):
<get_dmacfg_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0x12,%eax
mov    $0x10,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_dmacfg_reg>:
xor    %eax,%eax
test   %edi,%edi
setne  %al
add    %rax,%rax
add    $0x10,%rax
ret

LLVM IR (-O0):
define i64 @get_dmacfg_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 16, i32 18
%7 = sext i32 %6 to i64
ret i64 %7
}

LLVM IR (-O2):
define i64 @get_dmacfg_reg(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i64 16, i64 18
ret i64 %3
}
double epb2ts(epoch)
double epoch;
{
  double dj;
  dj = epb2jd(epoch);
  return ((dj - 2433282.5) * 86400.0);
}


x86 assembly (clang, -O0):
<epb2ts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x1,%al
call   1030 <epb2jd@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xec9(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xeb5(%rip),%xmm1
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<epb2ts>:
push   %rax
mov    $0x1,%al
call   1030 <epb2jd@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
addsd  0xed9(%rip),%xmm0
mulsd  0xed9(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @epb2ts(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call i32 (double, ...) bitcast (i32 (...)* @epb2jd to i32 (double, ...)*)(double %4)
%6 = sitofp i32 %5 to double
store double %6, double* %3
%7 = load double, double* %3
%8 = fsub double %7, 0x4142908140000000
%9 = fmul double %8, 8.640000e+04
ret double %9
}

LLVM IR (-O2):
define double @epb2ts(double %0) {
%2 = tail call i32 (double, ...) bitcast (i32 (...)* @epb2jd to i32 (double, ...)*)(double %0)
%3 = sitofp i32 %2 to double
%4 = fadd double %3, 0xC142908140000000
%5 = fmul double %4, 8.640000e+04
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char const *);
void err(const char *msg) {
  printf(msg);
  printf("------- End Graph Strongly Connected Components -------\n");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<err>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <printf@plt>
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<err>:
push   %rax
call   1040 <printf@plt>
lea    0xec3(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [57 x i8] c"------- End Graph Strongly Connected Components -------\0A\00"
@EXIT_FAILURE = global i32 0
define void @err(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@str = [56 x i8] c"------- End Graph Strongly Connected Components -------\00"
define void @err(i8* nocapture %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str, i64 0, i64 0))
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
int vz_fs_is_mounted(char *);
int vps_is_mounted(char *root) { return vz_fs_is_mounted(root); }


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

x86 assembly (clang, -O2):
<vps_is_mounted>:
jmp    1030 <vz_fs_is_mounted@plt>

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

LLVM IR (-O2):
define i32 @vps_is_mounted(i8* %0) {
%2 = tail call i32 @vz_fs_is_mounted(i8* %0)
ret i32 %2
}
int __unused() {}


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

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

LLVM IR (-O0):
define i32 @__unused() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @__unused() {
ret i32 undef
}
/* Type definitions */
struct termios {
  int dummy;
};

/* Variables and functions */
int tcgetattr(int, struct termios *);
int termios_tcgetattr(int fd, struct termios *t) { return tcgetattr(fd, t); }


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

x86 assembly (clang, -O2):
<termios_tcgetattr>:
jmp    1030 <tcgetattr@plt>

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

LLVM IR (-O2):
%struct.termios = type { i32 }
define i32 @termios_tcgetattr(i32 %0, %struct.termios* %1) {
%3 = tail call i32 @tcgetattr(i32 %0, %struct.termios* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0x2d() {
  Assert_real((isxdigit(45) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isxdigit.c",
              230, ("isxdigit should be 0 for -"));
}


x86 assembly (clang, -O0):
<t_isxdigit_0x2d>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2d,%edi
call   1030 <isxdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0xe6,%edx
lea    0xf5c(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isxdigit_0x2d>:
push   %rax
mov    $0x2d,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0xe6,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 0 for -\00"
define void @t_isxdigit_0x2d() {
%1 = call i64 @isxdigit(i32 45)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 230, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 0 for -\00"
define void @t_isxdigit_0x2d() {
%1 = tail call i64 @isxdigit(i32 45)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 230, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void g_get_system_data_dirs() {}


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

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

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

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