xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int EINVAL;
int ESRCH;
int pthread_kill(int /*<<< orphan*/, int /*<<< orphan*/);
int _pthread_alive(pthread_t thread) {
  int callStat = pthread_kill(thread, 0);
  if (ESRCH == callStat) {
    return (0);
  } else if (EINVAL == callStat) {
    return (0);
  } else {
    return (!((0)));
  }
}


x86 assembly (clang, -O0):
<_pthread_alive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
xor    %esi,%esi
call   1030 <pthread_kill@plt>
mov    %eax,-0xc(%rbp)
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
cmp    -0xc(%rbp),%eax
jne    1146 <_pthread_alive+0x36>
movl   $0x0,-0x4(%rbp)
jmp    116b <_pthread_alive+0x5b>
mov    0x2e93(%rip),%rax
mov    (%rax),%eax
cmp    -0xc(%rbp),%eax
jne    1164 <_pthread_alive+0x54>
movl   $0x0,-0x4(%rbp)
jmp    116b <_pthread_alive+0x5b>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_pthread_alive>:
push   %rax
xor    %esi,%esi
call   1030 <pthread_kill@plt>
mov    0x2eb1(%rip),%rcx
cmp    %eax,(%rcx)
setne  %cl
mov    0x2eb5(%rip),%rdx
cmp    %eax,(%rdx)
setne  %al
and    %cl,%al
movzbl %al,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ESRCH = global i32 0
@EINVAL = global i32 0
define i32 @_pthread_alive(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @pthread_kill(i32 %5, i32 0)
store i32 %6, i32* %4
%7 = load i32, i32* @ESRCH
%8 = load i32, i32* %4
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 0, i32* %2
br label %17
11: ; preds = %1
%12 = load i32, i32* @EINVAL
%13 = load i32, i32* %4
%14 = icmp eq i32 %12, %13
br i1 %14, label %15, label %16
15: ; preds = %11
store i32 0, i32* %2
br label %17
16: ; preds = %11
store i32 1, i32* %2
br label %17
17: ; preds = %16, %15, %10
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
@ESRCH = global i32 0
@EINVAL = global i32 0
define i32 @_pthread_alive(i32 %0) {
%2 = tail call i32 @pthread_kill(i32 %0, i32 0)
%3 = load i32, i32* @ESRCH
%4 = icmp ne i32 %3, %2
%5 = load i32, i32* @EINVAL
%6 = icmp ne i32 %5, %2
%7 = select i1 %4, i1 %6, i1 false
%8 = zext i1 %7 to i32
ret i32 %8
}
int kgetchar() { return 0; }


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

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

LLVM IR (-O0):
define i32 @kgetchar() {
ret i32 0
}

LLVM IR (-O2):
define i32 @kgetchar() {
ret i32 0
}
unsigned short inb(unsigned short port) {
  unsigned char ret;
  asm volatile("inb %1, %0" : "=a"(ret) : "Nd"(port));
  return ret;
}


x86 assembly (clang, -O0):
<inb>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%al
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inb>:
mov    %edi,%edx
in     (%dx),%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define zeroext i16 @inb(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i8
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i8 asm sideeffect "inb $1, $0", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
%7 = zext i8 %6 to i16
ret i16 %7
}

LLVM IR (-O2):
define zeroext i16 @inb(i16 zeroext %0) {
%2 = tail call i8 asm sideeffect "inb $1, $0", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
%3 = zext i8 %2 to i16
ret i16 %3
}
void osm_read(void) {}


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

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

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

LLVM IR (-O2):
define void @osm_read() {
ret void
}
int test_imm_43int32_mem(int *val) {
  return ((*val) & (0x43 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_43int32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 67
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
char *string_duplicate(char *);
char *string_new() { return string_duplicate(""); }


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

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @string_new() {
%1 = call i8* @string_duplicate(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @string_new() {
%1 = tail call i8* @string_duplicate(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int ascii = 255;
  while (ascii--) {
    printf("%c\t", 255 - ascii);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xff,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     1153 <main+0x43>
mov    $0xff,%esi
sub    -0x8(%rbp),%esi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%ebx
lea    0xee0(%rip),%r14
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x100,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%c\09\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 255, i32* %2
br label %3
3: ; preds = %7, %0
%4 = load i32, i32* %2
%5 = add nsw i32 %4, -1
store i32 %5, i32* %2
%6 = icmp ne i32 %4, 0
br i1 %6, label %7, label %11
7: ; preds = %3
%8 = load i32, i32* %2
%9 = sub nsw i32 255, %8
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %3
11: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%c\09\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 255, %0 ], [ %3, %1 ]
%3 = add nsw i32 %2, -1
%4 = sub nuw nsw i32 256, %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = icmp eq i32 %3, 0
br i1 %6, label %7, label %1
7: ; preds = %1
ret i32 0
}
/* Variables and functions */
scalar_t__ rte_eal_pci_probe();
scalar_t__ rte_pmd_init_all();
int init_drivers(void) {
  if (rte_pmd_init_all() < 0 || rte_eal_pci_probe() < 0)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<init_drivers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <rte_pmd_init_all@plt>
cmp    $0x0,%rax
jl     114a <init_drivers+0x2a>
mov    $0x0,%al
call   1030 <rte_eal_pci_probe@plt>
cmp    $0x0,%rax
jge    1156 <init_drivers+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    115d <init_drivers+0x3d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_drivers>:
push   %rax
xor    %eax,%eax
call   1040 <rte_pmd_init_all@plt>
test   %rax,%rax
js     113a <init_drivers+0x1a>
xor    %eax,%eax
call   1030 <rte_eal_pci_probe@plt>
sar    $0x3f,%rax
pop    %rcx
ret
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @init_drivers() {
%1 = tail call i64 (...) @rte_pmd_init_all()
%2 = icmp slt i64 %1, 0
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = tail call i64 (...) @rte_eal_pci_probe()
%5 = ashr i64 %4, 63
%6 = trunc i64 %5 to i32
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ -1, %0 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
int random();
int rand_value_int(void) { return random(); }


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

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

LLVM IR (-O0):
define i32 @rand_value_int() {
%1 = call i32 (...) @random()
ret i32 %1
}

LLVM IR (-O2):
define i32 @rand_value_int() {
%1 = tail call i32 (...) @random()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main(int argc, char **argv) { exit(EXIT_SUCCESS); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* @EXIT_SUCCESS
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @EXIT_SUCCESS
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Type definitions */
struct node {
  int dummy;
};

/* Variables and functions */
int subtree_get_count(struct node *);
int tree_get_count(struct node *node) {
  int result = subtree_get_count(node);
  return result;
}


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

x86 assembly (clang, -O2):
<tree_get_count>:
jmp    1030 <subtree_get_count@plt>

LLVM IR (-O0):
%struct.node = type { i32 }
define i32 @tree_get_count(%struct.node* %0) {
%2 = alloca %struct.node*
%3 = alloca i32
store %struct.node* %0, %struct.node** %2
%4 = load %struct.node*, %struct.node** %2
%5 = call i32 @subtree_get_count(%struct.node* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
%struct.node = type { i32 }
define i32 @tree_get_count(%struct.node* %0) {
%2 = tail call i32 @subtree_get_count(%struct.node* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ vector_nd_free(void **, int *, int);
void vector_3d_free(void **ptr, int d1, int d2, int d3) {
  int dims[3];
  dims[0] = d1;
  dims[1] = d2;
  dims[2] = d3;
  vector_nd_free(ptr, dims, 3);
}


x86 assembly (clang, -O0):
<vector_3d_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x3,%edx
call   1030 <vector_nd_free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vector_3d_free>:
sub    $0x18,%rsp
mov    %esi,0xc(%rsp)
mov    %edx,0x10(%rsp)
mov    %ecx,0x14(%rsp)
lea    0xc(%rsp),%rsi
mov    $0x3,%edx
call   1030 <vector_nd_free@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @vector_3d_free(i8** %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca [3 x i32]
store i8** %0, i8*** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %6
%11 = getelementptr inbounds [3 x i32], [3 x i32]* %9, i64 0, i64 0
store i32 %10, i32* %11
%12 = load i32, i32* %7
%13 = getelementptr inbounds [3 x i32], [3 x i32]* %9, i64 0, i64 1
store i32 %12, i32* %13
%14 = load i32, i32* %8
%15 = getelementptr inbounds [3 x i32], [3 x i32]* %9, i64 0, i64 2
store i32 %14, i32* %15
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds [3 x i32], [3 x i32]* %9, i64 0, i64 0
%18 = call i32 @vector_nd_free(i8** %16, i32* %17, i32 3)
ret void
}

LLVM IR (-O2):
define void @vector_3d_free(i8** %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca [3 x i32]
%6 = bitcast [3 x i32]* %5 to i8*
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 0
store i32 %1, i32* %7
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 1
store i32 %2, i32* %8
%9 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 2
store i32 %3, i32* %9
%10 = call i32 @vector_nd_free(i8** %0, i32* %7, i32 3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setTimer(int, int /*<<< orphan*/);
int main() {
  int i;
  for (i = 0; i < 100; i++)
    setTimer(1, 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    114a <main+0x3a>
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <setTimer@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x64,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <setTimer@plt>
add    $0xffffffff,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %8, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 100
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = call i32 @setTimer(i32 1, i32 0)
br label %8
8: ; preds = %6
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 1
store i32 %10, i32* %2
br label %3
11: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @setTimer(i32 1, i32 0)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 100
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void sayhello(char *s) { puts(s); }


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

x86 assembly (clang, -O2):
<sayhello>:
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
define void @sayhello(i8* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fileFree();
int /*<<< orphan*/ pushNumber(int /*<<< orphan*/);
void basFreeFile() { pushNumber(fileFree()); }


x86 assembly (clang, -O0):
<basFreeFile>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <fileFree@plt>
mov    %eax,%edi
call   1040 <pushNumber@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<basFreeFile>:
push   %rax
xor    %eax,%eax
call   1030 <fileFree@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <pushNumber@plt>

LLVM IR (-O0):
define void @basFreeFile() {
%1 = call i32 (...) @fileFree()
%2 = call i32 @pushNumber(i32 %1)
ret void
}

LLVM IR (-O2):
define void @basFreeFile() {
%1 = tail call i32 (...) @fileFree()
%2 = tail call i32 @pushNumber(i32 %1)
ret void
}
unsigned sum(unsigned *p) {
  unsigned s = 0;
  while ((*p | 0xFF) <= 255) {
    s += *p++ & 0xFF;
  }
  return s;
}


x86 assembly (clang, -O0):
<sum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
or     $0xff,%eax
cmp    $0xff,%eax
ja     1146 <sum+0x46>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%eax
and    $0xff,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110f <sum+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum>:
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    $0xff,%ecx
ja     1130 <sum+0x30>
add    $0x4,%rdi
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    %ecx,%eax
mov    (%rdi),%ecx
add    $0x4,%rdi
cmp    $0x100,%ecx
jb     1120 <sum+0x20>
ret

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

LLVM IR (-O2):
define i32 @sum(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp ult i32 %2, 256
br i1 %3, label %4, label %12
4: ; preds = %1, %4
%5 = phi i32 [ %10, %4 ], [ %2, %1 ]
%6 = phi i32 [ %9, %4 ], [ 0, %1 ]
%7 = phi i32* [ %8, %4 ], [ %0, %1 ]
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = add i32 %5, %6
%10 = load i32, i32* %8
%11 = icmp ult i32 %10, 256
br i1 %11, label %4, label %12
12: ; preds = %4, %1
%13 = phi i32 [ 0, %1 ], [ %9, %4 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ yy_push_state(int);
void asn1p_lexer_hack_enable_with_syntax() { yy_push_state(7); }


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

x86 assembly (clang, -O2):
<asn1p_lexer_hack_enable_with_syntax>:
mov    $0x7,%edi
jmp    1030 <yy_push_state@plt>

LLVM IR (-O0):
define void @asn1p_lexer_hack_enable_with_syntax() {
%1 = call i32 @yy_push_state(i32 7)
ret void
}

LLVM IR (-O2):
define void @asn1p_lexer_hack_enable_with_syntax() {
%1 = tail call i32 @yy_push_state(i32 7)
ret void
}
/* Variables and functions */
int getpid();
int getppid();
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf(" my pid is %d \n", getpid());
  printf(" my parentid pid is %d \n", getppid());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getppid@plt>
mov    %eax,%esi
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [16 x i8] c" my pid is %d \0A\00"
@.str.1 = [25 x i8] c" my parentid pid is %d \0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @getpid()
%3 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 (...) @getppid()
%5 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c" my pid is %d \0A\00"
@.str.1 = [25 x i8] c" my parentid pid is %d \0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @getppid()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}
int charToInt(char a) { return a - 48; }


x86 assembly (clang, -O0):
<charToInt>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @charToInt(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = sub nsw i32 %4, 48
ret i32 %5
}

LLVM IR (-O2):
define i32 @charToInt(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -48
ret i32 %3
}
int getoutputcirclesize(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @getoutputcirclesize() {
ret i32 0
}

LLVM IR (-O2):
define i32 @getoutputcirclesize() {
ret i32 0
}
void setpin0() {
  (*(volatile unsigned long *)(0x3FFFC000 + 0x1C)) = (1 << 7);
  (*(volatile unsigned long *)(0x3FFFC000 + 0x00)) |= (1 << 7);
}


x86 assembly (clang, -O0):
<setpin0>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3fffc01c,%eax
movq   $0x80,(%rax)
mov    $0x3fffc000,%eax
mov    (%rax),%rcx
or     $0x80,%rcx
mov    $0x3fffc000,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setpin0>:
movq   $0x80,0x3fffc01c
orq    $0x80,0x3fffc000
ret

LLVM IR (-O0):
define void @setpin0() {
store volatile i64 128, i64* inttoptr (i64 1073725468 to i64*)
%1 = load volatile i64, i64* inttoptr (i64 1073725440 to i64*)
%2 = or i64 %1, 128
store volatile i64 %2, i64* inttoptr (i64 1073725440 to i64*)
ret void
}

LLVM IR (-O2):
define void @setpin0() {
store volatile i64 128, i64* inttoptr (i64 1073725468 to i64*)
%1 = load volatile i64, i64* inttoptr (i64 1073725440 to i64*)
%2 = or i64 %1, 128
store volatile i64 %2, i64* inttoptr (i64 1073725440 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(char const *);
void gms_command_undo(const char *argument) { assert(argument); }


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

x86 assembly (clang, -O2):
<gms_command_undo>:
jmp    1030 <assert@plt>

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

LLVM IR (-O2):
define void @gms_command_undo(i8* %0) {
%2 = tail call i32 @assert(i8* %0)
ret void
}
reverse(char *c, int strt, int end) {
  if (strt < end) {
    char temp;
    temp = *(c + strt);
    *(c + strt) = *(c + end);
    *(c + end) = temp;
    reverse(c, strt + 1, end - 1);
  }
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1175 <reverse+0x65>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x19(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x19(%rbp),%dl
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x18(%rbp),%edx
sub    $0x1,%edx
call   1030 <reverse@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
cmp    %edx,%esi
jge    1131 <reverse+0x31>
movslq %edx,%rax
movslq %esi,%rcx
add    $0xffffffffffffffff,%rax
xchg   %ax,%ax
movzbl (%rdi,%rcx,1),%esi
movzbl 0x1(%rdi,%rax,1),%edx
mov    %dl,(%rdi,%rcx,1)
mov    %sil,0x1(%rdi,%rax,1)
add    $0x1,%rcx
lea    -0x1(%rax),%rdx
cmp    %rax,%rcx
mov    %rdx,%rax
jl     1110 <reverse+0x10>
ret

LLVM IR (-O0):
define i32 @reverse(i8* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%9 = load i32, i32* %6
%10 = load i32, i32* %7
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %38
12: ; preds = %3
%13 = load i8*, i8** %5
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
store i8 %17, i8* %8
%18 = load i8*, i8** %5
%19 = load i32, i32* %7
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %18, i64 %20
%22 = load i8, i8* %21
%23 = load i8*, i8** %5
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8, i8* %23, i64 %25
store i8 %22, i8* %26
%27 = load i8, i8* %8
%28 = load i8*, i8** %5
%29 = load i32, i32* %7
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i8, i8* %28, i64 %30
store i8 %27, i8* %31
%32 = load i8*, i8** %5
%33 = load i32, i32* %6
%34 = add nsw i32 %33, 1
%35 = load i32, i32* %7
%36 = sub nsw i32 %35, 1
%37 = call i32 @reverse(i8* %32, i32 %34, i32 %36)
br label %38
38: ; preds = %12, %3
%39 = load i32, i32* %4
ret i32 %39
}

LLVM IR (-O2):
define i32 @reverse(i8* nocapture %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %18
5: ; preds = %3
%6 = sext i32 %2 to i64
%7 = sext i32 %1 to i64
br label %8
8: ; preds = %5, %8
%9 = phi i64 [ %7, %5 ], [ %15, %8 ]
%10 = phi i64 [ %6, %5 ], [ %16, %8 ]
%11 = getelementptr inbounds i8, i8* %0, i64 %9
%12 = load i8, i8* %11
%13 = getelementptr inbounds i8, i8* %0, i64 %10
%14 = load i8, i8* %13
store i8 %14, i8* %11
store i8 %12, i8* %13
%15 = add nsw i64 %9, 1
%16 = add nsw i64 %10, -1
%17 = icmp slt i64 %15, %16
br i1 %17, label %8, label %18
18: ; preds = %8, %3
ret i32 undef
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
void rtp3640_set_au_headers_length(uint8_t *header, uint16_t size) {
  header[0] = size >> 8;
  header[1] = size & 0xff;
}


x86 assembly (clang, -O0):
<rtp3640_set_au_headers_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtp3640_set_au_headers_length>:
movzbl %sil,%eax
sar    $0x8,%esi
mov    %esi,(%rdi)
mov    %eax,0x4(%rdi)
ret

LLVM IR (-O0):
define void @rtp3640_set_au_headers_length(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 = ashr i32 %5, 8
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 0
store i32 %6, i32* %8
%9 = load i32, i32* %4
%10 = and i32 %9, 255
%11 = load i32*, i32** %3
%12 = getelementptr inbounds i32, i32* %11, i64 1
store i32 %10, i32* %12
ret void
}

LLVM IR (-O2):
define void @rtp3640_set_au_headers_length(i32* nocapture writeonly %0, i32 %1) {
%3 = ashr i32 %1, 8
store i32 %3, i32* %0
%4 = and i32 %1, 255
%5 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %4, i32* %5
ret void
}
/* Variables and functions */
int read_db_value(char const *, char const *, char **, size_t *);
int /*<<< orphan*/ usleep(int);
void read_db_value_blocking(const char *params_path, const char *key,
                            char **value, size_t *value_sz) {
  while (1) {
    const int result = read_db_value(params_path, key, value, value_sz);
    if (result == 0) {
      return;
    } else {
      usleep(100000);
    }
  }
}


x86 assembly (clang, -O0):
<read_db_value_blocking>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <read_db_value@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jne    1160 <read_db_value_blocking+0x40>
add    $0x30,%rsp
pop    %rbp
ret
mov    $0x186a0,%edi
call   1040 <usleep@plt>
jmp    1138 <read_db_value_blocking+0x18>

x86 assembly (clang, -O2):
<read_db_value_blocking>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
call   1030 <read_db_value@plt>
test   %eax,%eax
je     1161 <read_db_value_blocking+0x41>
mov    $0x186a0,%edi
call   1040 <usleep@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
jmp    1140 <read_db_value_blocking+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @read_db_value_blocking(i8* %0, i8* %1, i8** %2, i64* %3) {
%5 = tail call i32 @read_db_value(i8* %0, i8* %1, i8** %2, i64* %3)
%6 = icmp eq i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %4, %7
%8 = tail call i32 @usleep(i32 100000)
%9 = tail call i32 @read_db_value(i8* %0, i8* %1, i8** %2, i64* %3)
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %7
11: ; preds = %7, %4
ret void
}
/* Variables and functions */
long math___Int_band___impl(long, long);
long core__math___Int___band(long self, long p0) {
  long var;
  long var1;
  var1 = math___Int_band___impl(self, p0);
  var = var1;
  goto RET_LABEL;
RET_LABEL:;
  return var;
}


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

x86 assembly (clang, -O2):
<core__math___Int___band>:
jmp    1030 <math___Int_band___impl@plt>

LLVM IR (-O0):
define i64 @core__math___Int___band(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%7 = load i64, i64* %3
%8 = load i64, i64* %4
%9 = call i64 @math___Int_band___impl(i64 %7, i64 %8)
store i64 %9, i64* %6
%10 = load i64, i64* %6
store i64 %10, i64* %5
br label %11
11: ; preds = %2
%12 = load i64, i64* %5
ret i64 %12
}

LLVM IR (-O2):
define i64 @core__math___Int___band(i64 %0, i64 %1) {
%3 = tail call i64 @math___Int_band___impl(i64 %0, i64 %1)
ret i64 %3
}
/* Variables and functions */
char sccb_read();
int /*<<< orphan*/ sccb_stop();
int /*<<< orphan*/ sccb_write(char);
char sccb_read_reg(char reg) {
  sccb_write(reg);
  sccb_stop();
  return sccb_read();
}


x86 assembly (clang, -O0):
<sccb_read_reg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1040 <sccb_write@plt>
mov    $0x0,%al
call   1030 <sccb_stop@plt>
mov    $0x0,%al
call   1050 <sccb_read@plt>
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sccb_read_reg>:
push   %rax
call   1040 <sccb_write@plt>
xor    %eax,%eax
call   1030 <sccb_stop@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <sccb_read@plt>

LLVM IR (-O0):
define signext i8 @sccb_read_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @sccb_write(i8 signext %3)
%5 = call i32 (...) @sccb_stop()
%6 = call signext i8 (...) @sccb_read()
ret i8 %6
}

LLVM IR (-O2):
define signext i8 @sccb_read_reg(i8 signext %0) {
%2 = tail call i32 @sccb_write(i8 signext %0)
%3 = tail call i32 (...) @sccb_stop()
%4 = tail call signext i8 (...) @sccb_read()
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ close(unsigned long);
void OS_file_close(unsigned long file_handle) { close(file_handle); }


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

x86 assembly (clang, -O2):
<OS_file_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @OS_file_close(i64 %0) {
%2 = tail call i32 @close(i64 %0)
ret void
}
/* Variables and functions */
int getchar();
int scanInt() {
  register int retVar = 0, d;
  while ((d = getchar()) < '0')
    ;
  do {
    retVar = (retVar << 3) + (retVar << 1) + d - '0';
  } while ((d = getchar()) >= '0');
  return retVar;
}


x86 assembly (clang, -O0):
<scanInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x30,%eax
jge    1137 <scanInt+0x27>
jmp    111f <scanInt+0xf>
jmp    113c <scanInt+0x2c>
mov    -0x4(%rbp),%eax
shl    $0x3,%eax
mov    -0x4(%rbp),%ecx
shl    $0x1,%ecx
add    %ecx,%eax
add    -0x8(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x30,%eax
jge    113c <scanInt+0x2c>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scanInt>:
push   %rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0x30,%eax
jl     1120 <scanInt+0x10>
xor    %ebx,%ebx
xchg   %ax,%ax
lea    (%rbx,%rbx,4),%ecx
lea    (%rax,%rcx,2),%ebx
add    $0xffffffd0,%ebx
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0x2f,%eax
jg     1130 <scanInt+0x20>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @scanInt() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %6, %0
%4 = call i32 (...) @getchar()
store i32 %4, i32* %2
%5 = icmp slt i32 %4, 48
br i1 %5, label %6, label %7
6: ; preds = %3
br label %3
7: ; preds = %3
br label %8
8: ; preds = %17, %7
%9 = load i32, i32* %1
%10 = shl i32 %9, 3
%11 = load i32, i32* %1
%12 = shl i32 %11, 1
%13 = add nsw i32 %10, %12
%14 = load i32, i32* %2
%15 = add nsw i32 %13, %14
%16 = sub nsw i32 %15, 48
store i32 %16, i32* %1
br label %17
17: ; preds = %8
%18 = call i32 (...) @getchar()
store i32 %18, i32* %2
%19 = icmp sge i32 %18, 48
br i1 %19, label %8, label %20
20: ; preds = %17
%21 = load i32, i32* %1
ret i32 %21
}

LLVM IR (-O2):
define i32 @scanInt() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @getchar()
%3 = icmp slt i32 %2, 48
br i1 %3, label %1, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %9, %4 ], [ 0, %1 ]
%6 = phi i32 [ %10, %4 ], [ %2, %1 ]
%7 = mul i32 %5, 10
%8 = add nsw i32 %6, -48
%9 = add i32 %8, %7
%10 = tail call i32 (...) @getchar()
%11 = icmp sgt i32 %10, 47
br i1 %11, label %4, label %12
12: ; preds = %4
ret i32 %9
}
int default_secret_bits_cb(int modsize) { return 256; }


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

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

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

LLVM IR (-O2):
define i32 @default_secret_bits_cb(i32 %0) {
ret i32 256
}
/* Variables and functions */
unsigned char getch();
int /*<<< orphan*/ kbhit();
unsigned char wait_data() {
  while (!kbhit())
    ;
  unsigned char ch = getch();
  return ch;
}


x86 assembly (clang, -O0):
<wait_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <kbhit@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1144 <wait_data+0x24>
jmp    1149 <wait_data+0x29>
jmp    1128 <wait_data+0x8>
mov    $0x0,%al
call   1040 <getch@plt>
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait_data>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <kbhit@plt>
test   %eax,%eax
je     1130 <wait_data+0x10>
xor    %eax,%eax
pop    %rcx
jmp    1040 <getch@plt>

LLVM IR (-O0):
define zeroext i8 @wait_data() {
%1 = alloca i8
br label %2
2: ; preds = %6, %0
%3 = call i32 (...) @kbhit()
%4 = icmp ne i32 %3, 0
%5 = xor i1 %4, true
br i1 %5, label %6, label %7
6: ; preds = %2
br label %2
7: ; preds = %2
%8 = call zeroext i8 (...) @getch()
store i8 %8, i8* %1
%9 = load i8, i8* %1
ret i8 %9
}

LLVM IR (-O2):
define zeroext i8 @wait_data() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @kbhit()
%3 = icmp eq i32 %2, 0
br i1 %3, label %1, label %4
4: ; preds = %1
%5 = tail call zeroext i8 (...) @getch()
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ copy_string(char *, char *, int);
int v5dSetUnits(int, char *);
int v5dsetunits_(int *var, char *name) {
  char buf[20];
  copy_string(buf, name, 20);
  return v5dSetUnits(*var, buf);
}


x86 assembly (clang, -O0):
<v5dsetunits_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x14,%edx
call   1030 <copy_string@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
lea    -0x30(%rbp),%rsi
call   1040 <v5dSetUnits@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<v5dsetunits_>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x14,%edx
call   1030 <copy_string@plt>
mov    (%rbx),%edi
mov    %r14,%rsi
call   1040 <v5dSetUnits@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @v5dsetunits_(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
%5 = alloca [20 x i8]
store i32* %0, i32** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %4
%8 = call i32 @copy_string(i8* %6, i8* %7, i32 20)
%9 = load i32*, i32** %3
%10 = load i32, i32* %9
%11 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%12 = call i32 @v5dSetUnits(i32 %10, i8* %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @v5dsetunits_(i32* nocapture %0, i8* %1) {
%3 = alloca [20 x i8]
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%5 = call i32 @copy_string(i8* %4, i8* %1, i32 20)
%6 = load i32, i32* %0
%7 = call i32 @v5dSetUnits(i32 %6, i8* %4)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ PC_UART_UartPostEnable();
void PC_UART_ScbModePostEnable(void) { PC_UART_UartPostEnable(); }


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

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

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

LLVM IR (-O2):
define void @PC_UART_ScbModePostEnable() {
%1 = tail call i32 (...) @PC_UART_UartPostEnable()
ret void
}
/* Variables and functions */
unsigned short float2half(float);
float half2float(unsigned short);
unsigned short multiply(unsigned short a, unsigned short b) {
  float op1 = half2float(a);
  float op2 = half2float(b);
  return float2half(op1 * op2);
}


x86 assembly (clang, -O0):
<multiply>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movzwl -0x2(%rbp),%edi
call   1040 <half2float@plt>
movss  %xmm0,-0x8(%rbp)
movzwl -0x4(%rbp),%edi
call   1040 <half2float@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
call   1030 <float2half@plt>
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<multiply>:
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
call   1040 <half2float@plt>
movss  %xmm0,0xc(%rsp)
mov    %ebx,%edi
call   1040 <half2float@plt>
mulss  0xc(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
jmp    1030 <float2half@plt>

LLVM IR (-O0):
define zeroext i16 @multiply(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
%5 = alloca float
%6 = alloca float
store i16 %0, i16* %3
store i16 %1, i16* %4
%7 = load i16, i16* %3
%8 = call float @half2float(i16 zeroext %7)
store float %8, float* %5
%9 = load i16, i16* %4
%10 = call float @half2float(i16 zeroext %9)
store float %10, float* %6
%11 = load float, float* %5
%12 = load float, float* %6
%13 = fmul float %11, %12
%14 = call zeroext i16 @float2half(float %13)
ret i16 %14
}

LLVM IR (-O2):
define zeroext i16 @multiply(i16 zeroext %0, i16 zeroext %1) {
%3 = tail call float @half2float(i16 zeroext %0)
%4 = tail call float @half2float(i16 zeroext %1)
%5 = fmul float %3, %4
%6 = tail call zeroext i16 @float2half(float %5)
ret i16 %6
}
/* Variables and functions */
int /*<<< orphan*/ driverTimer_Reset();
void Timer_Reset(void) { driverTimer_Reset(); }


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @sp_tree()
ret void
}
int fun1082() { return 1082; }


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

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

LLVM IR (-O0):
define i32 @fun1082() {
ret i32 1082
}

LLVM IR (-O2):
define i32 @fun1082() {
ret i32 1082
}
/* Variables and functions */
scalar_t__ COND_LE();
int /*<<< orphan*/ EA_AY_IX_8();
int /*<<< orphan*/ m68ki_write_8(int /*<<< orphan*/, int);
void m68k_op_sle_8_ix(void) {
  m68ki_write_8(EA_AY_IX_8(), COND_LE() ? 0xff : 0);
}


x86 assembly (clang, -O0):
<m68k_op_sle_8_ix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <EA_AY_IX_8@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <COND_LE@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rcx
xor    %esi,%esi
mov    $0xff,%eax
cmp    $0x0,%rcx
cmovne %eax,%esi
call   1050 <m68ki_write_8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_op_sle_8_ix>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <EA_AY_IX_8@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <COND_LE@plt>
test   %rax,%rax
mov    $0xff,%esi
cmove  %ebp,%esi
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <m68ki_write_8@plt>

LLVM IR (-O0):
define void @m68k_op_sle_8_ix() {
%1 = call i32 (...) @EA_AY_IX_8()
%2 = call i64 (...) @COND_LE()
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 255, i32 0
%6 = call i32 @m68ki_write_8(i32 %1, i32 %5)
ret void
}

LLVM IR (-O2):
define void @m68k_op_sle_8_ix() {
%1 = tail call i32 (...) @EA_AY_IX_8()
%2 = tail call i64 (...) @COND_LE()
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 0, i32 255
%5 = tail call i32 @m68ki_write_8(i32 %1, i32 %4)
ret void
}
void omap_fbdev_fini(struct drm_device *dev) {}


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

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

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

LLVM IR (-O2):
%struct.drm_device = type opaque
define void @omap_fbdev_fini(%struct.drm_device* nocapture %0) {
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int permutation_after_dobldobl_loop(int d, int *permutation) {
  int *a, fail;
  double *c;
  fail = _ada_use_c2phc(642, a, permutation, c);
  return fail;
}


x86 assembly (clang, -O0):
<permutation_after_dobldobl_loop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    $0x282,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<permutation_after_dobldobl_loop>:
mov    %rsi,%rdx
mov    $0x282,%edi
jmp    1030 <_ada_use_c2phc@plt>

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

LLVM IR (-O2):
define i32 @permutation_after_dobldobl_loop(i32 %0, i32* %1) {
%3 = tail call i32 @_ada_use_c2phc(i32 642, i32* undef, i32* %1, double* undef)
ret i32 %3
}
void timeout(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @g_rand_double_range() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr, "usage: fish [-p]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [18 x i8] c"usage: fish [-p]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [18 x i8] c"usage: fish [-p]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}