xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ tmpl(char *);
void main() {
  int n;
  int i = 0;
  int k = 0;
  tmpl("(le(i,j,k,n),le(i,j,k,n))");
  while (i < n) {
    i++;
    k++;
  }
  int j = 0;
  while (j < n) {
    assert(k > 0);
    j++;
    k--;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <tmpl@plt>
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1165 <main+0x45>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1142 <main+0x22>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    11a0 <main+0x80>
cmpl   $0x0,-0xc(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    116c <main+0x4c>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [26 x i8] c"(le(i,j,k,n),le(i,j,k,n))\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %2
store i32 0, i32* %3
%5 = call i32 @tmpl(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %10, %0
%7 = load i32, i32* %2
%8 = load i32, i32* %1
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %15
10: ; preds = %6
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %6
15: ; preds = %6
store i32 0, i32* %4
br label %16
16: ; preds = %20, %15
%17 = load i32, i32* %4
%18 = load i32, i32* %1
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %29
20: ; preds = %16
%21 = load i32, i32* %3
%22 = icmp sgt i32 %21, 0
%23 = zext i1 %22 to i32
%24 = call i32 @assert(i32 %23)
%25 = load i32, i32* %4
%26 = add nsw i32 %25, 1
store i32 %26, i32* %4
%27 = load i32, i32* %3
%28 = add nsw i32 %27, -1
store i32 %28, i32* %3
br label %16
29: ; preds = %16
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"(le(i,j,k,n),le(i,j,k,n))\00"
define void @main() {
%1 = tail call i32 @tmpl(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}
void bar_long_double(void) { foo_long_double(2.0L - 2.5Li); }


x86 assembly (clang, -O0):
<bar_long_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
flds   0xee2(%rip)
fstpt  -0x20(%rbp)
flds   0xedd(%rip)
fstpt  -0x10(%rbp)
lea    -0x20(%rbp),%rax
mov    (%rax),%rcx
mov    %rcx,(%rsp)
mov    0x8(%rax),%rcx
mov    %rcx,0x8(%rsp)
mov    0x10(%rax),%rcx
mov    %rcx,0x10(%rsp)
mov    0x18(%rax),%rax
mov    %rax,0x18(%rsp)
mov    $0x0,%al
call   1030 <foo_long_double@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar_long_double>:
sub    $0x48,%rsp
flds   0xee6(%rip)
fstpt  0x20(%rsp)
flds   0xee0(%rip)
fstpt  0x30(%rsp)
movaps 0x20(%rsp),%xmm0
movaps 0x30(%rsp),%xmm1
movaps %xmm1,0x10(%rsp)
movaps %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <foo_long_double@plt>
add    $0x48,%rsp
ret

LLVM IR (-O0):
define void @bar_long_double() {
%1 = alloca { x86_fp80, x86_fp80 }
%2 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %1, i32 0, i32 0
%3 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %1, i32 0, i32 1
store x86_fp80 0xK40008000000000000000, x86_fp80* %2
store x86_fp80 0xKC000A000000000000000, x86_fp80* %3
%4 = call i32 ({ x86_fp80, x86_fp80 }*, ...) bitcast (i32 (...)* @foo_long_double to i32 ({ x86_fp80, x86_fp80 }*, ...)*)({ x86_fp80, x86_fp80 }* byval({ x86_fp80, x86_fp80 }) align 16 %1)
ret void
}

LLVM IR (-O2):
define void @bar_long_double() {
%1 = alloca { x86_fp80, x86_fp80 }
%2 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %1, i64 0, i32 0
%3 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %1, i64 0, i32 1
store x86_fp80 0xK40008000000000000000, x86_fp80* %2
store x86_fp80 0xKC000A000000000000000, x86_fp80* %3
%4 = tail call i32 ({ x86_fp80, x86_fp80 }*, ...) bitcast (i32 (...)* @foo_long_double to i32 ({ x86_fp80, x86_fp80 }*, ...)*)({ x86_fp80, x86_fp80 }* byval({ x86_fp80, x86_fp80 }) align 16 %1)
ret void
}
void nand_wait_Rnb_ready(void) {
  while (!((*(volatile unsigned int *)0x4E000028) & (1 << 4)))
    ;
}


x86 assembly (clang, -O0):
<nand_wait_Rnb_ready>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <nand_wait_Rnb_ready+0x9>
mov    $0x4e000028,%eax
mov    (%rax),%eax
and    $0x10,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1128 <nand_wait_Rnb_ready+0x28>
jmp    112d <nand_wait_Rnb_ready+0x2d>
jmp    1109 <nand_wait_Rnb_ready+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<nand_wait_Rnb_ready>:
testl  $0x10,0x4e000028
je     1100 <nand_wait_Rnb_ready>
ret

LLVM IR (-O0):
define void @nand_wait_Rnb_ready() {
br label %1
1: ; preds = %6, %0
%2 = load volatile i32, i32* inttoptr (i64 1308622888 to i32*)
%3 = and i32 %2, 16
%4 = icmp ne i32 %3, 0
%5 = xor i1 %4, true
br i1 %5, label %6, label %7
6: ; preds = %1
br label %1
7: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @nand_wait_Rnb_ready() {
br label %1
1: ; preds = %1, %0
%2 = load volatile i32, i32* inttoptr (i64 1308622888 to i32*)
%3 = and i32 %2, 16
%4 = icmp eq i32 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
ret void
}
void no_menu_action() { return; }


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

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

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

LLVM IR (-O2):
define void @no_menu_action() {
ret void
}
int sh_cannot_fetch_register(int regno) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @sh_cannot_fetch_register(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ IPC_RMID;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int shmctl(int, int /*<<< orphan*/, int /*<<< orphan*/ *);
void remove_shm_block(int shmid) {
  if (shmctl(shmid, IPC_RMID, NULL) == -1) {
    perror("shmctl");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<remove_shm_block>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e9b(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <shmctl@plt>
cmp    $0xffffffff,%eax
jne    116f <remove_shm_block+0x3f>
lea    0xea0(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_shm_block>:
push   %rax
mov    0x2ea8(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <shmctl@plt>
cmp    $0xffffffff,%eax
je     1148 <remove_shm_block+0x18>
pop    %rax
ret
lea    0xeb1(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@IPC_RMID = global i32 0
@.str = [7 x i8] c"shmctl\00"
define void @remove_shm_block(i32 %0) {
%2 = load i32, i32* @IPC_RMID
%3 = tail call i32 @shmctl(i32 %0, i32 %2, i32* null)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret void
}
/* Variables and functions */
int mu_badv_mesh_n_nodes(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, int);
int main(void) { printf("%d", mu_badv_mesh_n_nodes("not_default", NULL)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed8(%rip),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <mu_badv_mesh_n_nodes@plt>
mov    %eax,%esi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [12 x i8] c"not_default\00"
define i32 @main() {
%1 = call i32 @mu_badv_mesh_n_nodes(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32* null)
%2 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [12 x i8] c"not_default\00"
define i32 @main() {
%1 = tail call i32 @mu_badv_mesh_n_nodes(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32* null)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gpio_set(int, int);
void water_back(void) {
  gpio_set(20, 0);
  gpio_set(21, 1);
}


x86 assembly (clang, -O0):
<water_back>:
push   %rbp
mov    %rsp,%rbp
mov    $0x14,%edi
xor    %esi,%esi
call   1030 <gpio_set@plt>
mov    $0x15,%edi
mov    $0x1,%esi
call   1030 <gpio_set@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<water_back>:
push   %rax
mov    $0x14,%edi
xor    %esi,%esi
call   1030 <gpio_set@plt>
mov    $0x15,%edi
mov    $0x1,%esi
pop    %rax
jmp    1030 <gpio_set@plt>

LLVM IR (-O0):
define void @water_back() {
%1 = call i32 @gpio_set(i32 20, i32 0)
%2 = call i32 @gpio_set(i32 21, i32 1)
ret void
}

LLVM IR (-O2):
define void @water_back() {
%1 = tail call i32 @gpio_set(i32 20, i32 0)
%2 = tail call i32 @gpio_set(i32 21, i32 1)
ret void
}
void cycles_vblank() { return; }


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

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

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

LLVM IR (-O2):
define void @cycles_vblank() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printStr(char *str) {
  while (*str != '\0')
    printf("%c", *str++);
  printf("\n");
}


x86 assembly (clang, -O0):
<printStr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1151 <printStr+0x41>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%esi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    111c <printStr+0xc>
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printStr>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <printStr+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <printStr+0x10>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @printStr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = tail call i32 @putchar(i32 %7)
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
%13 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bad_if_alias(int, int);
void call_bad_if_alias_Good() {
  int x, y;
  bad_if_alias(x, y);
}


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

x86 assembly (clang, -O2):
<call_bad_if_alias_Good>:
jmp    1030 <bad_if_alias@plt>

LLVM IR (-O0):
define void @call_bad_if_alias_Good() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* %1
%4 = load i32, i32* %2
%5 = call i32 @bad_if_alias(i32 %3, i32 %4)
ret void
}

LLVM IR (-O2):
define void @call_bad_if_alias_Good() {
%1 = tail call i32 @bad_if_alias(i32 undef, i32 undef)
ret void
}
/* Variables and functions */
int getchar();
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ ungetc(int, int /*<<< orphan*/);
int limpia_bufEntrada(int c) {
  while (c == ' ' || c == '\t')
    c = getchar();
  if (c != '\n')
    ungetc(c, stdin);
}


x86 assembly (clang, -O0):
<limpia_bufEntrada>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1144 <limpia_bufEntrada+0x24>
cmpl   $0x9,-0x8(%rbp)
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1154 <limpia_bufEntrada+0x34>
jmp    1163 <limpia_bufEntrada+0x43>
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,-0x8(%rbp)
jmp    112b <limpia_bufEntrada+0xb>
cmpl   $0xa,-0x8(%rbp)
je     117e <limpia_bufEntrada+0x5e>
mov    -0x8(%rbp),%edi
mov    0x2e71(%rip),%rax
mov    (%rax),%esi
call   1040 <ungetc@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<limpia_bufEntrada>:
push   %rax
mov    %edi,%eax
jmp    1137 <limpia_bufEntrada+0x17>
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0x9,%eax
je     1130 <limpia_bufEntrada+0x10>
cmp    $0x20,%eax
je     1130 <limpia_bufEntrada+0x10>
cmp    $0xa,%eax
je     1156 <limpia_bufEntrada+0x36>
mov    0x2e9b(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
call   1040 <ungetc@plt>
pop    %rcx
ret

LLVM IR (-O0):
@stdin = global i32 0
define i32 @limpia_bufEntrada(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
br label %4
4: ; preds = %12, %1
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 32
br i1 %6, label %10, label %7
7: ; preds = %4
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 9
br label %10
10: ; preds = %7, %4
%11 = phi i1 [ true, %4 ], [ %9, %7 ]
br i1 %11, label %12, label %14
12: ; preds = %10
%13 = call i32 (...) @getchar()
store i32 %13, i32* %3
br label %4
14: ; preds = %10
%15 = load i32, i32* %3
%16 = icmp ne i32 %15, 10
br i1 %16, label %17, label %21
17: ; preds = %14
%18 = load i32, i32* %3
%19 = load i32, i32* @stdin
%20 = call i32 @ungetc(i32 %18, i32 %19)
br label %21
21: ; preds = %17, %14
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @limpia_bufEntrada(i32 %0) {
br label %2
2: ; preds = %4, %1
%3 = phi i32 [ %0, %1 ], [ %5, %4 ]
switch i32 %3, label %6 [
i32 32, label %4
i32 9, label %4
i32 10, label %9
]
4: ; preds = %2, %2
%5 = tail call i32 (...) @getchar()
br label %2
6: ; preds = %2
%7 = load i32, i32* @stdin
%8 = tail call i32 @ungetc(i32 %3, i32 %7)
br label %9
9: ; preds = %2, %6
ret i32 undef
}
/* Variables and functions */
int sinh(double);
double math_csch(double x) { return 1 / sinh(x); }


x86 assembly (clang, -O0):
<math_csch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sinh@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<math_csch>:
push   %rax
call   1030 <sinh@plt>
lea    0x1(%rax),%ecx
xor    %edx,%edx
cmp    $0x3,%ecx
cmovb  %eax,%edx
xorps  %xmm0,%xmm0
cvtsi2sd %edx,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @math_csch(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @sinh(double %3)
%5 = sdiv i32 1, %4
%6 = sitofp i32 %5 to double
ret double %6
}

LLVM IR (-O2):
define double @math_csch(double %0) {
%2 = tail call i32 @sinh(double %0)
%3 = add i32 %2, 1
%4 = icmp ult i32 %3, 3
%5 = select i1 %4, i32 %2, i32 0
%6 = sitofp i32 %5 to double
ret double %6
}
int test_imm_6Fint16_mem(short *val) {
  return ((*val) & (0x6F << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_6Fint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 111
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void genreserved(void) {}


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

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

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

LLVM IR (-O2):
define void @genreserved() {
ret void
}
/* Variables and functions */
int swap_endian(int);
char int2char(int value, unsigned int index) {
  value = swap_endian(value);
  char *ptr = (char *)&value;
  return ptr[index];
}


x86 assembly (clang, -O0):
<int2char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <swap_endian@plt>
mov    %eax,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int2char>:
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
call   1030 <swap_endian@plt>
mov    %eax,0xc(%rsp)
mov    %ebx,%eax
mov    0xc(%rsp,%rax,1),%al
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @int2char(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = call i32 @swap_endian(i32 %6)
store i32 %7, i32* %3
%8 = bitcast i32* %3 to i8*
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = load i32, i32* %4
%11 = zext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %9, i64 %11
%13 = load i8, i8* %12
ret i8 %13
}

LLVM IR (-O2):
define signext i8 @int2char(i32 %0, i32 %1) {
%3 = alloca i32
%4 = tail call i32 @swap_endian(i32 %0)
store i32 %4, i32* %3
%5 = bitcast i32* %3 to i8*
%6 = zext i32 %1 to i64
%7 = getelementptr inbounds i8, i8* %5, i64 %6
%8 = load i8, i8* %7
ret i8 %8
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void usage(const char *mess) {
  fprintf(stderr, "Error: %s\n", mess);
  fprintf(stderr, "Usage: [board] input_file output_file magic_number\n");
  fprintf(stderr, "\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
lea    0xeb4(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rbx
mov    (%rbx),%edi
lea    0xecc(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xec7(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xee9(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [11 x i8] c"Error: %s\0A\00"
@.str.1 = [52 x i8] c"Usage: [board] input_file output_file magic_number\0A\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0))
%8 = load i32, i32* @stderr
%9 = call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"Error: %s\0A\00"
@.str.1 = [52 x i8] c"Usage: [board] input_file output_file magic_number\0A\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* @stderr
%7 = tail call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int stat(char *, struct stat *);
void check_file(char *pth, bool inv) {
  struct stat buf;
  int ret = stat(pth, &buf);
  if ((ret == 0 && !inv) || (ret == -1 && inv))
    puts(pth);
}


x86 assembly (clang, -O0):
<check_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <stat@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1153 <check_file+0x33>
cmpl   $0x0,-0xc(%rbp)
je     1167 <check_file+0x47>
cmpl   $0xffffffff,-0x14(%rbp)
jne    1170 <check_file+0x50>
cmpl   $0x0,-0xc(%rbp)
je     1170 <check_file+0x50>
mov    -0x8(%rbp),%rdi
call   1030 <puts@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_file>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    %rsp,%rsi
call   1040 <stat@plt>
mov    %eax,%ecx
or     %ebp,%ecx
je     113f <check_file+0x1f>
test   %ebp,%ebp
je     114d <check_file+0x2d>
cmp    $0xffffffff,%eax
jne    114d <check_file+0x2d>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <puts@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define void @check_file(i8* nocapture %0, i32 %1) {
%3 = alloca %struct.stat
%4 = bitcast %struct.stat* %3 to i8*
%5 = call i32 @stat(i8* %0, %struct.stat* %3)
%6 = or i32 %5, %1
%7 = icmp eq i32 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %2
%9 = icmp ne i32 %1, 0
%10 = icmp eq i32 %5, -1
%11 = and i1 %9, %10
br i1 %11, label %12, label %14
12: ; preds = %8, %2
%13 = tail call i32 @puts(i8* dereferenceable(1) %0)
br label %14
14: ; preds = %12, %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ f(int);
int main() {
  if (f(0x80000000L) == 0)
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x80000000,%edi
call   1040 <f@plt>
cmp    $0x0,%rax
jne    115a <main+0x2a>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x80000000,%edi
call   1040 <f@plt>
test   %rax,%rax
jne    1147 <main+0x17>
xor    %eax,%eax
call   1030 <abort@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @f(i32 -2147483648)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @f(i32 -2147483648)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_strings();
int main() {
  test_strings();
  printf("All assertions passed!\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <test_strings@plt>
lea    0xece(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [24 x i8] c"All assertions passed!\0A\00"
define i32 @main() {
%1 = call i32 (...) @test_strings()
%2 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [23 x i8] c"All assertions passed!\00"
define i32 @main() {
%1 = tail call i32 (...) @test_strings()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ cleanup();
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, int);
int read_meminfo(char *);
void check_free_huge_pages(int nr_pages_needed) {
  int freepages = read_meminfo("HugePages_Free:");
  if (freepages < nr_pages_needed)
    do {
      cleanup();
      printf("Bad configuration: "
             "Must have at least %i free hugepages"
             "\n",
             nr_pages_needed);
      exit(1);
    } while (0);
}


x86 assembly (clang, -O0):
<check_free_huge_pages>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xeae(%rip),%rdi
call   1030 <read_meminfo@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    118b <check_free_huge_pages+0x4b>
jmp    116b <check_free_huge_pages+0x2b>
mov    $0x0,%al
call   1050 <cleanup@plt>
mov    -0x4(%rbp),%esi
lea    0xe94(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_free_huge_pages>:
push   %rbx
mov    %edi,%ebx
lea    0xeb6(%rip),%rdi
call   1030 <read_meminfo@plt>
cmp    %ebx,%eax
jl     1155 <check_free_huge_pages+0x15>
pop    %rbx
ret
xor    %eax,%eax
call   1050 <cleanup@plt>
lea    0xead(%rip),%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"HugePages_Free:\00"
@.str.1 = [57 x i8] c"Bad configuration: Must have at least %i free hugepages\0A\00"
define void @check_free_huge_pages(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 @read_meminfo(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %15
8: ; preds = %1
br label %9
9: ; preds = %8
%10 = call i32 (...) @cleanup()
%11 = load i32, i32* %2
%12 = call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = call i32 @exit(i32 1)
unreachable
14: ; No predecessors!
br label %15
15: ; preds = %14, %1
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"HugePages_Free:\00"
@.str.1 = [57 x i8] c"Bad configuration: Must have at least %i free hugepages\0A\00"
define void @check_free_huge_pages(i32 %0) {
%2 = tail call i32 @read_meminfo(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = icmp slt i32 %2, %0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 (...) @cleanup()
%6 = tail call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.1, i64 0, i64 0), i32 %0)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret void
}
void rtw_android_wifictrl_func_del(void) {}


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

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

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

LLVM IR (-O2):
define void @rtw_android_wifictrl_func_del() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LC_ALL;
int /*<<< orphan*/ mc_crc_init();
int /*<<< orphan*/ mc_id_init();
int /*<<< orphan*/ mc_rand_seed();
int /*<<< orphan*/ mc_socket_init();
int /*<<< orphan*/ mc_time_init();
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
int mc_init(void) {
  setlocale(LC_ALL, "");
  mc_time_init();
  mc_rand_seed();
  mc_socket_init();
  mc_id_init();
  mc_crc_init();
  return 0;
}


x86 assembly (clang, -O0):
<mc_init>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
lea    0xe8c(%rip),%rsi
call   1080 <setlocale@plt>
mov    $0x0,%al
call   1070 <mc_time_init@plt>
mov    $0x0,%al
call   1060 <mc_rand_seed@plt>
mov    $0x0,%al
call   1040 <mc_socket_init@plt>
mov    $0x0,%al
call   1030 <mc_id_init@plt>
mov    $0x0,%al
call   1050 <mc_crc_init@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mc_init>:
push   %rax
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
lea    0xe8f(%rip),%rsi
call   1080 <setlocale@plt>
xor    %eax,%eax
call   1070 <mc_time_init@plt>
xor    %eax,%eax
call   1060 <mc_rand_seed@plt>
xor    %eax,%eax
call   1040 <mc_socket_init@plt>
xor    %eax,%eax
call   1030 <mc_id_init@plt>
xor    %eax,%eax
call   1050 <mc_crc_init@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@LC_ALL = global i32 0
@.str = [1 x i8] zeroinitializer
define i32 @mc_init() {
%1 = load i32, i32* @LC_ALL
%2 = call i32 @setlocale(i32 %1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @mc_time_init()
%4 = call i32 (...) @mc_rand_seed()
%5 = call i32 (...) @mc_socket_init()
%6 = call i32 (...) @mc_id_init()
%7 = call i32 (...) @mc_crc_init()
ret i32 0
}

LLVM IR (-O2):
@LC_ALL = global i32 0
@.str = [1 x i8] zeroinitializer
define i32 @mc_init() {
%1 = load i32, i32* @LC_ALL
%2 = tail call i32 @setlocale(i32 %1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @mc_time_init()
%4 = tail call i32 (...) @mc_rand_seed()
%5 = tail call i32 (...) @mc_socket_init()
%6 = tail call i32 (...) @mc_id_init()
%7 = tail call i32 (...) @mc_crc_init()
ret i32 0
}
/* Type definitions */
struct utcb {
  int dummy;
};

/* Variables and functions */
scalar_t__ l4_cp15_read_tid_usr_ro();
struct utcb *l4_get_utcb() {
  return (struct utcb *)l4_cp15_read_tid_usr_ro();
}


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

x86 assembly (clang, -O2):
<l4_get_utcb>:
xor    %eax,%eax
jmp    1030 <l4_cp15_read_tid_usr_ro@plt>

LLVM IR (-O0):
%struct.utcb = type { i32 }
define %struct.utcb* @l4_get_utcb() {
%1 = call i64 (...) @l4_cp15_read_tid_usr_ro()
%2 = inttoptr i64 %1 to %struct.utcb*
ret %struct.utcb* %2
}

LLVM IR (-O2):
%struct.utcb = type { i32 }
define %struct.utcb* @l4_get_utcb() {
%1 = tail call i64 (...) @l4_cp15_read_tid_usr_ro()
%2 = inttoptr i64 %1 to %struct.utcb*
ret %struct.utcb* %2
}
/* Variables and functions */
int bs2c_disasm_decnbl(char *);
int bs2c_disasm_decbyte(char *ps) {
  int i0, i1;
  i0 = bs2c_disasm_decnbl(ps + 0);
  i1 = bs2c_disasm_decnbl(ps + 1);
  if ((i0 >= 0) && (i1 >= 0))
    return ((i0 << 4) | i1);
  return (-1);
}


x86 assembly (clang, -O0):
<bs2c_disasm_decbyte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <bs2c_disasm_decnbl@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1030 <bs2c_disasm_decnbl@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     115d <bs2c_disasm_decbyte+0x4d>
cmpl   $0x0,-0x18(%rbp)
jl     115d <bs2c_disasm_decbyte+0x4d>
mov    -0x14(%rbp),%eax
shl    $0x4,%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1164 <bs2c_disasm_decbyte+0x54>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bs2c_disasm_decbyte>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <bs2c_disasm_decnbl@plt>
mov    %eax,%ebp
add    $0x1,%rbx
mov    %rbx,%rdi
call   1030 <bs2c_disasm_decnbl@plt>
mov    %ebp,%ecx
shl    $0x4,%ecx
or     %eax,%ecx
or     %eax,%ebp
mov    $0xffffffff,%eax
cmovns %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @bs2c_disasm_decbyte(i8* %0) {
%2 = tail call i32 @bs2c_disasm_decnbl(i8* %0)
%3 = getelementptr inbounds i8, i8* %0, i64 1
%4 = tail call i32 @bs2c_disasm_decnbl(i8* %3)
%5 = icmp sgt i32 %2, -1
%6 = icmp sgt i32 %4, -1
%7 = select i1 %5, i1 %6, i1 false
%8 = shl i32 %2, 4
%9 = or i32 %8, %4
%10 = select i1 %7, i32 %9, i32 -1
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *);
void die(char const *fn) {
  perror(fn);
  exit(2);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rax
call   1030 <perror@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @die(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
define void @die(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 2)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int sayi_oku() {
  int sayi;
  printf("sayi girin:");
  scanf("%d", &sayi);
  return sayi;
}


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

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

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

LLVM IR (-O2):
@.str = [12 x i8] c"sayi girin:\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @sayi_oku() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
ret i32 %5
}
/* Variables and functions */
int cp850_to_latin1(unsigned int);
unsigned hpfs_char_to_linux(unsigned c) { return cp850_to_latin1(c); }


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

x86 assembly (clang, -O2):
<hpfs_char_to_linux>:
jmp    1030 <cp850_to_latin1@plt>

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

LLVM IR (-O2):
define i32 @hpfs_char_to_linux(i32 %0) {
%2 = tail call i32 @cp850_to_latin1(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ R0_SaveConfig();
void R0_Sleep(void) { R0_SaveConfig(); }


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

x86 assembly (clang, -O2):
<R0_Sleep>:
xor    %eax,%eax
jmp    1030 <R0_SaveConfig@plt>

LLVM IR (-O0):
define void @R0_Sleep() {
%1 = call i32 (...) @R0_SaveConfig()
ret void
}

LLVM IR (-O2):
define void @R0_Sleep() {
%1 = tail call i32 (...) @R0_SaveConfig()
ret void
}
void grace_get_widest_world_y(double *new_world_min_y, double *new_world_max_y,
                              double graph_world_min_y,
                              double graph_world_max_y,
                              double anchor_graph_world_min_y,
                              double anchor_graph_world_max_y) {
  if (graph_world_min_y < anchor_graph_world_min_y)
    *new_world_min_y = graph_world_min_y;
  else
    *new_world_min_y = anchor_graph_world_min_y;
  if (graph_world_max_y > anchor_graph_world_max_y)
    *new_world_max_y = graph_world_max_y;
  else
    *new_world_max_y = anchor_graph_world_max_y;
}


x86 assembly (clang, -O0):
<grace_get_widest_world_y>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
movsd  %xmm2,-0x28(%rbp)
movsd  %xmm3,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1146 <grace_get_widest_world_y+0x46>
movsd  -0x18(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    1153 <grace_get_widest_world_y+0x53>
movsd  -0x28(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x20(%rbp),%xmm0
ucomisd -0x30(%rbp),%xmm0
jbe    1175 <grace_get_widest_world_y+0x75>
movsd  -0x20(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    1182 <grace_get_widest_world_y+0x82>
movsd  -0x30(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<grace_get_widest_world_y>:
minsd  %xmm2,%xmm0
movsd  %xmm0,(%rdi)
maxsd  %xmm3,%xmm1
movsd  %xmm1,(%rsi)
ret

LLVM IR (-O0):
define void @grace_get_widest_world_y(double* %0, double* %1, double %2, double %3, double %4, double %5) {
%7 = alloca double*
%8 = alloca double*
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
store double* %0, double** %7
store double* %1, double** %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
store double %5, double* %12
%13 = load double, double* %9
%14 = load double, double* %11
%15 = fcmp olt double %13, %14
br i1 %15, label %16, label %19
16: ; preds = %6
%17 = load double, double* %9
%18 = load double*, double** %7
store double %17, double* %18
br label %22
19: ; preds = %6
%20 = load double, double* %11
%21 = load double*, double** %7
store double %20, double* %21
br label %22
22: ; preds = %19, %16
%23 = load double, double* %10
%24 = load double, double* %12
%25 = fcmp ogt double %23, %24
br i1 %25, label %26, label %29
26: ; preds = %22
%27 = load double, double* %10
%28 = load double*, double** %8
store double %27, double* %28
br label %32
29: ; preds = %22
%30 = load double, double* %12
%31 = load double*, double** %8
store double %30, double* %31
br label %32
32: ; preds = %29, %26
ret void
}

LLVM IR (-O2):
define void @grace_get_widest_world_y(double* nocapture writeonly %0, double* nocapture writeonly %1, double %2, double %3, double %4, double %5) {
%7 = fcmp olt double %2, %4
%8 = select i1 %7, double %2, double %4
store double %8, double* %0
%9 = fcmp ogt double %3, %5
%10 = select i1 %9, double %3, double %5
store double %10, double* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ err(char *, char const *const);
int errno;
int glob_err(const char *const epath, const int eerno) {
  errno = eerno;
  err("%s: %m\n", epath);
  return 0;
}


x86 assembly (clang, -O0):
<glob_err>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    0x2eb7(%rip),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rsi
lea    0xeca(%rip),%rdi
call   1030 <err@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glob_err>:
push   %rax
mov    %rdi,%rax
mov    0x2ec5(%rip),%rcx
mov    %esi,(%rcx)
lea    0xedc(%rip),%rdi
mov    %rax,%rsi
call   1030 <err@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@errno = global i32 0
@.str = [8 x i8] c"%s: %m\0A\00"
define i32 @glob_err(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
store i32 %5, i32* @errno
%6 = load i8*, i8** %3
%7 = call i32 @err(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@errno = global i32 0
@.str = [8 x i8] c"%s: %m\0A\00"
define i32 @glob_err(i8* %0, i32 %1) {
store i32 %1, i32* @errno
%3 = tail call i32 @err(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 0
}
int test_imm_A6uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0xA6 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_A6uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 10878976
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void called(int b) {
  printf("\tb   : %d\n", b);
  printf("\tb*2 : %d\n", b * 2);
  printf("Call back function being called\n");
}


x86 assembly (clang, -O0):
<called>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
shl    $0x1,%esi
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<called>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    %ebx,%ebx
lea    0xecf(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeca(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"\09b : %d\0A\00"
@.str.1 = [11 x i8] c"\09b*2 : %d\0A\00"
@.str.2 = [33 x i8] c"Call back function being called\0A\00"
define void @called(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %2
%6 = mul nsw i32 %5, 2
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"\09b : %d\0A\00"
@.str.1 = [11 x i8] c"\09b*2 : %d\0A\00"
@str = [32 x i8] c"Call back function being called\00"
define void @called(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = shl nsw i32 %0, 1
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int process_entry(char *str, void *ptr) {
  printf("%s\n", str);
  return 0;
}


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

x86 assembly (clang, -O2):
<process_entry>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @process_entry(i8* %0, i8* nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 0
}