xunge/DecIR huggingface dataset:
char *skip_ws(char *p, unsigned int size) {
  char *end;
  end = p + size;
  for (; p < end; p++) {
    if ((*p != ' ') && (*p != '\t'))
      return p;
  }
  return p;
}


x86 assembly (clang, -O0):
<skip_ws>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
jae    116a <skip_ws+0x6a>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
je     1154 <skip_ws+0x54>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
je     1154 <skip_ws+0x54>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1172 <skip_ws+0x72>
jmp    1159 <skip_ws+0x59>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1119 <skip_ws+0x19>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_ws>:
mov    %rdi,%rax
test   %esi,%esi
je     1126 <skip_ws+0x26>
mov    %esi,%ecx
add    %rax,%rcx
jmp    1119 <skip_ws+0x19>
xchg   %ax,%ax
add    $0x1,%rax
cmp    %rcx,%rax
jae    1126 <skip_ws+0x26>
movzbl (%rax),%edx
cmp    $0x20,%dl
je     1110 <skip_ws+0x10>
cmp    $0x9,%dl
je     1110 <skip_ws+0x10>
ret

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

LLVM IR (-O2):
define i8* @skip_ws(i8* %0, i32 %1) {
%3 = zext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = icmp eq i32 %1, 0
br i1 %5, label %12, label %6
6: ; preds = %2, %9
%7 = phi i8* [ %10, %9 ], [ %0, %2 ]
%8 = load i8, i8* %7
switch i8 %8, label %12 [
i8 32, label %9
i8 9, label %9
]
9: ; preds = %6, %6
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = icmp ult i8* %10, %4
br i1 %11, label %6, label %12
12: ; preds = %6, %9, %2
%13 = phi i8* [ %0, %2 ], [ %10, %9 ], [ %7, %6 ]
ret i8* %13
}
/* Variables and functions */
int /*<<< orphan*/ _init_vita_heap();
int /*<<< orphan*/ _init_vita_io();
int /*<<< orphan*/ _init_vita_malloc();
int /*<<< orphan*/ _init_vita_reent();
void _init_vita_newlib(void) {
  _init_vita_heap();
  _init_vita_reent();
  _init_vita_malloc();
  _init_vita_io();
}


x86 assembly (clang, -O0):
<_init_vita_newlib>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <_init_vita_heap@plt>
mov    $0x0,%al
call   1050 <_init_vita_reent@plt>
mov    $0x0,%al
call   1060 <_init_vita_malloc@plt>
mov    $0x0,%al
call   1030 <_init_vita_io@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_init_vita_newlib>:
push   %rax
xor    %eax,%eax
call   1040 <_init_vita_heap@plt>
xor    %eax,%eax
call   1050 <_init_vita_reent@plt>
xor    %eax,%eax
call   1060 <_init_vita_malloc@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <_init_vita_io@plt>

LLVM IR (-O0):
define void @_init_vita_newlib() {
%1 = call i32 (...) @_init_vita_heap()
%2 = call i32 (...) @_init_vita_reent()
%3 = call i32 (...) @_init_vita_malloc()
%4 = call i32 (...) @_init_vita_io()
ret void
}

LLVM IR (-O2):
define void @_init_vita_newlib() {
%1 = tail call i32 (...) @_init_vita_heap()
%2 = tail call i32 (...) @_init_vita_reent()
%3 = tail call i32 (...) @_init_vita_malloc()
%4 = tail call i32 (...) @_init_vita_io()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello, two!\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"Hello, two!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [12 x i8] c"Hello, two!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printIntArray(int *, int);
int /*<<< orphan*/ quick_sort(int *, int /*<<< orphan*/, int);
int main(int argc, char **argv) {
  int array[] = {23, 54, 6, 12, 76, 3, 5, 8};
  quick_sort(array, 0, 7);
  printIntArray(array, 8);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec0(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xebd(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x7,%edx
call   1030 <quick_sort@plt>
lea    -0x30(%rbp),%rdi
mov    $0x8,%esi
call   1040 <printIntArray@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movaps 0xee4(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x7,%edx
call   1030 <quick_sort@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
call   1040 <printIntArray@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.array = [8 x i32] [i32 23, i32 54, i32 6, i32 12, i32 76, i32 3, i32 5, i32 8]
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [8 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [8 x i32]* %6 to i8*
%8 = getelementptr inbounds [8 x i32], [8 x i32]* %6, i64 0, i64 0
%9 = call i32 @quick_sort(i32* %8, i32 0, i32 7)
%10 = getelementptr inbounds [8 x i32], [8 x i32]* %6, i64 0, i64 0
%11 = call i32 @printIntArray(i32* %10, i32 8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.array = [8 x i32] [i32 23, i32 54, i32 6, i32 12, i32 76, i32 3, i32 5, i32 8]
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [8 x i32]
%4 = bitcast [8 x i32]* %3 to i8*
%5 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
%6 = call i32 @quick_sort(i32* %5, i32 0, i32 7)
%7 = call i32 @printIntArray(i32* %5, i32 8)
ret i32 0
}
/* Variables and functions */
scalar_t__ isgraph(int /*<<< orphan*/);
size_t strlen(char const *);
int is_empty_str(const char *s) {
  size_t slen = strlen(s);
  while (slen--) {
    if (isgraph(*s++))
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_empty_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x18(%rbp)
cmp    $0x0,%rax
je     1184 <is_empty_str+0x64>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%edi
call   1040 <isgraph@plt>
cmp    $0x0,%rax
je     117f <is_empty_str+0x5f>
movl   $0x0,-0x4(%rbp)
jmp    118b <is_empty_str+0x6b>
jmp    1139 <is_empty_str+0x19>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_empty_str>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
mov    %rax,%r15
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmp    %rbx,%r15
je     115c <is_empty_str+0x3c>
movsbl (%r14,%rbx,1),%edi
call   1040 <isgraph@plt>
add    $0x1,%rbx
test   %rax,%rax
je     1140 <is_empty_str+0x20>
xor    %eax,%eax
jmp    1161 <is_empty_str+0x41>
mov    $0x1,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @is_empty_str(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
br label %3
3: ; preds = %7, %1
%4 = phi i8* [ %0, %1 ], [ %9, %7 ]
%5 = phi i64 [ %2, %1 ], [ %8, %7 ]
%6 = icmp eq i64 %5, 0
br i1 %6, label %14, label %7
7: ; preds = %3
%8 = add i64 %5, -1
%9 = getelementptr inbounds i8, i8* %4, i64 1
%10 = load i8, i8* %4
%11 = sext i8 %10 to i32
%12 = tail call i64 @isgraph(i32 %11)
%13 = icmp eq i64 %12, 0
br i1 %13, label %3, label %14
14: ; preds = %3, %7
%15 = phi i32 [ 0, %7 ], [ 1, %3 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ prints(char *);
void main(void) {
  prints("Init.mod loaded. Hanging.");
  while (1)
    ;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <prints@plt>
jmp    1120 <main+0x10>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <prints@plt>
nopl   (%rax)
jmp    1120 <main+0x10>

LLVM IR (-O0):
@.str = [26 x i8] c"Init.mod loaded. Hanging.\00"
define void @main() {
%1 = call i32 @prints(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}

LLVM IR (-O2):
@.str = [26 x i8] c"Init.mod loaded. Hanging.\00"
define void @main() {
%1 = tail call i32 @prints(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}
__attribute__((no, noclone)) void foo(char *a, char *b) {
  a[0] = b[0] = 0;
  __builtin_memcpy(a, b, 4);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rcx),%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movb   $0x0,(%rsi)
movb   $0x0,(%rdi)
mov    (%rsi),%eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @foo(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = getelementptr inbounds i8, i8* %5, i64 0
store i8 0, i8* %6
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 0
store i8 0, i8* %8
%9 = load i8*, i8** %3
%10 = load i8*, i8** %4
ret void
}

LLVM IR (-O2):
define void @foo(i8* nocapture writeonly %0, i8* nocapture %1) {
store i8 0, i8* %1
store i8 0, i8* %0
%3 = bitcast i8* %1 to i32*
%4 = bitcast i8* %0 to i32*
%5 = load i32, i32* %3
store i32 %5, i32* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGINT;
int /*<<< orphan*/ SIGTERM;
int /*<<< orphan*/ SIGUSR1;
int /*<<< orphan*/ SIG_IGN;
int /*<<< orphan*/ signal(int /*<<< orphan*/, int /*<<< orphan*/);
void sig_lock() {
  signal(SIGTERM, SIG_IGN);
  signal(SIGINT, SIG_IGN);
  signal(SIGUSR1, SIG_IGN);
}


x86 assembly (clang, -O0):
<sig_lock>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    0x2eac(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
mov    0x2e95(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
mov    0x2e9f(%rip),%rax
mov    (%rax),%edi
mov    0x2e7e(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_lock>:
push   %rbx
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
mov    0x2eaf(%rip),%rbx
mov    (%rbx),%esi
call   1030 <signal@plt>
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%esi
call   1030 <signal@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%esi
pop    %rbx
jmp    1030 <signal@plt>

LLVM IR (-O0):
@SIGTERM = global i32 0
@SIG_IGN = global i32 0
@SIGINT = global i32 0
@SIGUSR1 = global i32 0
define void @sig_lock() {
%1 = load i32, i32* @SIGTERM
%2 = load i32, i32* @SIG_IGN
%3 = call i32 @signal(i32 %1, i32 %2)
%4 = load i32, i32* @SIGINT
%5 = load i32, i32* @SIG_IGN
%6 = call i32 @signal(i32 %4, i32 %5)
%7 = load i32, i32* @SIGUSR1
%8 = load i32, i32* @SIG_IGN
%9 = call i32 @signal(i32 %7, i32 %8)
ret void
}

LLVM IR (-O2):
@SIGTERM = global i32 0
@SIG_IGN = global i32 0
@SIGINT = global i32 0
@SIGUSR1 = global i32 0
define void @sig_lock() {
%1 = load i32, i32* @SIGTERM
%2 = load i32, i32* @SIG_IGN
%3 = tail call i32 @signal(i32 %1, i32 %2)
%4 = load i32, i32* @SIGINT
%5 = load i32, i32* @SIG_IGN
%6 = tail call i32 @signal(i32 %4, i32 %5)
%7 = load i32, i32* @SIGUSR1
%8 = load i32, i32* @SIG_IGN
%9 = tail call i32 @signal(i32 %7, i32 %8)
ret void
}
int test_imm_C2uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0xC2 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_C2uint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 194
%6 = icmp ne i64 %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_C2uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 194
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void board_device_reset(void) {}


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

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

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

LLVM IR (-O2):
define void @board_device_reset() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pause();
int /*<<< orphan*/ printf(char *);
void *thread_run(void *arg) {
  printf("thread started...\n");
  pause();
  return (void *)0;
}


x86 assembly (clang, -O0):
<thread_run>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <pause@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [19 x i8] c"thread started...\0A\00"
define i8* @thread_run(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @pause()
ret i8* null
}

LLVM IR (-O2):
@str = [18 x i8] c"thread started...\00"
define noalias i8* @thread_run(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (...) @pause()
ret i8* null
}
void Reset(void) { volatile int dummy = 0; }


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

x86 assembly (clang, -O2):
<Reset>:
movl   $0x0,-0x4(%rsp)
ret

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

LLVM IR (-O2):
define void @Reset() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store volatile i32 0, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, char);
void setPos(char x, char y) { printf("\e[%d;%dH", x, y); }


x86 assembly (clang, -O0):
<setPos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    -0x1(%rbp),%al
lea    0xed2(%rip),%rdi
movsbl %al,%esi
movsbl -0x2(%rbp),%edx
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [9 x i8] c"\1B[%d;%dH\00"
define void @setPos(i8 signext %0, i8 signext %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8 signext %0, i8 signext %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t float_to_bits(float a) {
  union {
    float f;
    uint32_t i;
  } x;
  x.f = a;
  return x.i;
}


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

x86 assembly (clang, -O2):
<float_to_bits>:
movd   %xmm0,%eax
ret

LLVM IR (-O0):
%union.anon = type { float }
define i32 @float_to_bits(float %0) {
%2 = alloca float
%3 = alloca %union.anon
store float %0, float* %2
%4 = load float, float* %2
%5 = bitcast %union.anon* %3 to float*
store float %4, float* %5
%6 = bitcast %union.anon* %3 to i32*
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @float_to_bits(float %0) {
%2 = bitcast float %0 to i32
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ ft_putendl(int /*<<< orphan*/);
void env_print(const char **env) {
  if (env) {
    while (*env)
      ft_putendl(*env++);
  }
}


x86 assembly (clang, -O0):
<env_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     115d <env_print+0x4d>
jmp    112c <env_print+0x1c>
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1158 <env_print+0x48>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%rax
mov    %eax,%edi
call   1030 <ft_putendl@plt>
jmp    112c <env_print+0x1c>
jmp    115d <env_print+0x4d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<env_print>:
push   %rbx
test   %rdi,%rdi
je     1141 <env_print+0x31>
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1141 <env_print+0x31>
add    $0x8,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
call   1030 <ft_putendl@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <env_print+0x20>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @env_print(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %15, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %15, label %6
6: ; preds = %3, %6
%7 = phi i8* [ %13, %6 ], [ %4, %3 ]
%8 = phi i8** [ %9, %6 ], [ %0, %3 ]
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = ptrtoint i8* %7 to i64
%11 = trunc i64 %10 to i32
%12 = tail call i32 @ft_putendl(i32 %11)
%13 = load i8*, i8** %9
%14 = icmp eq i8* %13, null
br i1 %14, label %15, label %6
15: ; preds = %6, %3, %1
ret void
}
void rtp_close_extra(void) {}


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

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

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

LLVM IR (-O2):
define void @rtp_close_extra() {
ret void
}
/* Variables and functions */
float sinf(float);
void sSin_process(float bIn, float *bOut) { *bOut = sinf(bIn); }


x86 assembly (clang, -O0):
<sSin_process>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <sinf@plt>
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sSin_process>:
push   %rbx
mov    %rdi,%rbx
call   1030 <sinf@plt>
movss  %xmm0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @sSin_process(float %0, float* %1) {
%3 = alloca float
%4 = alloca float*
store float %0, float* %3
store float* %1, float** %4
%5 = load float, float* %3
%6 = call float @sinf(float %5)
%7 = load float*, float** %4
store float %6, float* %7
ret void
}

LLVM IR (-O2):
define void @sSin_process(float %0, float* nocapture writeonly %1) {
%3 = tail call float @sinf(float %0)
store float %3, float* %1
ret void
}
void foo670() {}


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

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

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

LLVM IR (-O2):
define void @foo670() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ SYS_time;
int /*<<< orphan*/ syscall(int /*<<< orphan*/);
time_t time(time_t *t) {
  time_t result = syscall(SYS_time);
  if (t)
    *t = result;
  return result;
}


x86 assembly (clang, -O0):
<time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
call   1030 <syscall@plt>
mov    %eax,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1141 <time+0x31>
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <syscall@plt>
test   %rbx,%rbx
je     1129 <time+0x19>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
@SYS_time = global i32 0
define i32 @time(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32, i32* @SYS_time
%5 = call i32 @syscall(i32 %4)
store i32 %5, i32* %3
%6 = load i32*, i32** %2
%7 = icmp ne i32* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i32, i32* %3
%10 = load i32*, i32** %2
store i32 %9, i32* %10
br label %11
11: ; preds = %8, %1
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
@SYS_time = global i32 0
define i32 @time(i32* writeonly %0) {
%2 = load i32, i32* @SYS_time
%3 = tail call i32 @syscall(i32 %2)
%4 = icmp eq i32* %0, null
br i1 %4, label %6, label %5
5: ; preds = %1
store i32 %3, i32* %0
br label %6
6: ; preds = %5, %1
ret i32 %3
}
/* Type definitions */
struct netdev {
  int dummy;
};

/* Variables and functions */
int dhcp_recv(struct netdev *);
int dhcp_recv_ack(struct netdev *dev) { return dhcp_recv(dev); }


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

x86 assembly (clang, -O2):
<dhcp_recv_ack>:
jmp    1030 <dhcp_recv@plt>

LLVM IR (-O0):
%struct.netdev = type { i32 }
define i32 @dhcp_recv_ack(%struct.netdev* %0) {
%2 = alloca %struct.netdev*
store %struct.netdev* %0, %struct.netdev** %2
%3 = load %struct.netdev*, %struct.netdev** %2
%4 = call i32 @dhcp_recv(%struct.netdev* %3)
ret i32 %4
}

LLVM IR (-O2):
%struct.netdev = type { i32 }
define i32 @dhcp_recv_ack(%struct.netdev* %0) {
%2 = tail call i32 @dhcp_recv(%struct.netdev* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_array(int *l, int len) {
  int c;
  for (c = 0; c < len; c++) {
    printf("%d ", l[c]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<print_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <print_array+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print_array+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_array>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <print_array+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <print_array+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @print_array(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
void RTSemEventMultiRemoveSignaller(void) {}


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

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

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

LLVM IR (-O2):
define void @RTSemEventMultiRemoveSignaller() {
ret void
}
/* Variables and functions */
float floor(float);
float ceil(float d) { return (-floor(-d)); }


x86 assembly (clang, -O0):
<ceil>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
call   1030 <floor@plt>
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceil>:
push   %rax
xorps  0xee8(%rip),%xmm0
call   1030 <floorf@plt>
xorps  0xedc(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @ceil(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fneg float %3
%5 = call float @floor(float %4)
%6 = fneg float %5
ret float %6
}

LLVM IR (-O2):
define float @ceil(float %0) {
%2 = fneg float %0
%3 = tail call float @llvm.floor.f32(float %2)
%4 = fneg float %3
ret float %4
}
/* Variables and functions */
int getgid();
int getuid();
int /*<<< orphan*/ printf(char *, int, int);
int main(int argc, char **argv) {
  printf("user ID = %d, group ID = %d\n", getuid(), getgid());
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <getuid@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <getgid@plt>
lea    0xeb8(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"user ID = %d, group ID = %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @getuid()
%7 = call i32 (...) @getgid()
%8 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"user ID = %d, group ID = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @getuid()
%4 = tail call i32 (...) @getgid()
%5 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
scalar_t__ strncmp(char const *, char const *, int /*<<< orphan*/);
int strprefix(const char *s, const char *pre) {
  return strncmp(s, pre, strlen(pre)) == 0;
}


x86 assembly (clang, -O0):
<strprefix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strprefix>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @strprefix(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 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i64 @strncmp(i8* %5, i8* %6, i32 %8)
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @strprefix(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i64 @strncmp(i8* %0, i8* %1, i32 %3)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int plugin_main() {
  printf("Adiós desde plugin\n");
  return 99;
}


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"Adi\C3\B3s desde plugin\0A\00"
define i32 @plugin_main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret i32 99
}

LLVM IR (-O2):
@str = [20 x i8] c"Adi\C3\B3s desde plugin\00"
define i32 @plugin_main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret i32 99
}
/* Variables and functions */
int /*<<< orphan*/ rst(int);
void opcode_ff() { rst(0x38); }


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

x86 assembly (clang, -O2):
<opcode_ff>:
mov    $0x38,%edi
jmp    1030 <rst@plt>

LLVM IR (-O0):
define void @opcode_ff() {
%1 = call i32 @rst(i32 56)
ret void
}

LLVM IR (-O2):
define void @opcode_ff() {
%1 = tail call i32 @rst(i32 56)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fmt_devname(char *, int);
char *strdup(char *);
char *devnum2devname(int num) {
  char name[100];
  fmt_devname(name, num);
  return strdup(name);
}


x86 assembly (clang, -O0):
<devnum2devname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x70(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1030 <fmt_devname@plt>
lea    -0x70(%rbp),%rdi
call   1040 <strdup@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<devnum2devname>:
push   %rbx
sub    $0x70,%rsp
mov    %edi,%esi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <fmt_devname@plt>
mov    %rbx,%rdi
call   1040 <strdup@plt>
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i8* @devnum2devname(i32 %0) {
%2 = alloca i32
%3 = alloca [100 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 @fmt_devname(i8* %4, i32 %5)
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%8 = call i8* @strdup(i8* %7)
ret i8* %8
}

LLVM IR (-O2):
define noalias i8* @devnum2devname(i32 %0) {
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%4 = call i32 @fmt_devname(i8* %3, i32 %0)
%5 = call i8* @strdup(i8* %3)
ret i8* %5
}
__attribute__((always_)) void __attribute__((__section__(".cpuinit.text")))
__attribute__((__cold__)) ds_init_intel(struct cpuinfo_x86 *ignored) {}


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

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

LLVM IR (-O0):
%struct.cpuinfo_x86 = type opaque
define void @ds_init_intel(%struct.cpuinfo_x86* %0) section ".cpuinit.text" {
%2 = alloca %struct.cpuinfo_x86*
store %struct.cpuinfo_x86* %0, %struct.cpuinfo_x86** %2
ret void
}

LLVM IR (-O2):
%struct.cpuinfo_x86 = type opaque
define void @ds_init_intel(%struct.cpuinfo_x86* nocapture %0) section ".cpuinit.text" {
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ _write_decimal(scalar_t__);
void _write_decimal_100(uint16_t value) {
  uint8_t decimal_100 = (value % 1000) / 100;
  if (decimal_100 != 0) {
    _write_decimal(decimal_100);
  }
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cltq
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114a <_write_decimal_100+0x3a>
mov    -0x10(%rbp),%rdi
call   1030 <_write_decimal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
movslq %edi,%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x26,%rax
add    %ecx,%eax
imul   $0x3e8,%eax,%eax
mov    %eax,%ecx
neg    %ecx
add    %edi,%ecx
add    $0x63,%ecx
cmp    $0xc7,%ecx
jae    113f <_write_decimal_100+0x2f>
ret
sub    %eax,%edi
movswl %di,%eax
imul   $0x147b,%eax,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0x13,%eax
add    %ecx,%eax
movslq %eax,%rdi
jmp    1030 <_write_decimal@plt>

LLVM IR (-O0):
define void @_write_decimal_100(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = srem i32 %4, 1000
%6 = sdiv i32 %5, 100
%7 = sext i32 %6 to i64
store i64 %7, i64* %3
%8 = load i64, i64* %3
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = load i64, i64* %3
%12 = call i32 @_write_decimal(i64 %11)
br label %13
13: ; preds = %10, %1
ret void
}

LLVM IR (-O2):
define void @_write_decimal_100(i32 %0) {
%2 = srem i32 %0, 1000
%3 = add nsw i32 %2, 99
%4 = icmp ult i32 %3, 199
br i1 %4, label %10, label %5
5: ; preds = %1
%6 = trunc i32 %2 to i16
%7 = sdiv i16 %6, 100
%8 = sext i16 %7 to i64
%9 = tail call i32 @_write_decimal(i64 %8)
br label %10
10: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char const *, char const *);
int str_equal(const char *a, const char *b) { return !strcmp(a, b); }


x86 assembly (clang, -O0):
<str_equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_equal>:
push   %rax
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @str_equal(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 = load i8*, i8** %4
%7 = call i32 @strcmp(i8* %5, i8* %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @str_equal(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
float __infer_nondet_float();
float tanf(float x) { return __infer_nondet_float(); }


x86 assembly (clang, -O0):
<tanf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__infer_nondet_float@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define float @tanf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = call float (...) @__infer_nondet_float()
ret float %3
}

LLVM IR (-O2):
define float @tanf(float %0) {
%2 = tail call float (...) @__infer_nondet_float()
ret float %2
}
int movzbl_1(void) {
  int res;
  __asm__ __volatile__("movl $0x12345678, %%eax\n\t"
                       "movb $0x22, %%al\n\t"
                       "movzbl %%al,%%eax\n\t"
                       "mov %%eax, %0"
                       : "=r"(res)
                       :
                       : "eax");
  return res;
}


x86 assembly (clang, -O0):
<movzbl_1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x12345678,%eax
mov    $0x22,%al
movzbl %al,%eax
mov    %eax,%ecx
mov    %ecx,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<movzbl_1>:
mov    $0x12345678,%eax
mov    $0x22,%al
movzbl %al,%eax
mov    %eax,%ecx
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @movzbl_1() {
%1 = alloca i32
%2 = call i32 asm sideeffect "movl $$0x12345678, %eax\0A\09movb $$0x22, %al\0A\09movzbl %al,%eax\0A\09mov %eax, $0", "=r,~{eax},~{dirflag},~{fpsr},~{flags}"()
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @movzbl_1() {
%1 = tail call i32 asm sideeffect "movl $$0x12345678, %eax\0A\09movb $$0x22, %al\0A\09movzbl %al,%eax\0A\09mov %eax, $0", "=r,~{eax},~{dirflag},~{fpsr},~{flags}"()
ret i32 %1
}
/* Variables and functions */
scalar_t__ RAND_MAX;
double rand();
double rand_double() { return rand() / (double)RAND_MAX; }


x86 assembly (clang, -O0):
<rand_double>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
mov    0x2ec6(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_double>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
mov    0x2ec9(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define double @rand_double() {
%1 = call double (...) @rand()
%2 = load i64, i64* @RAND_MAX
%3 = sitofp i64 %2 to double
%4 = fdiv double %1, %3
ret double %4
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define double @rand_double() {
%1 = tail call double (...) @rand()
%2 = load i64, i64* @RAND_MAX
%3 = sitofp i64 %2 to double
%4 = fdiv double %1, %3
ret double %4
}
/* Variables and functions */
char *strstr(char const *, char const *);
extern long long str_idx(const char *s, const char *seq) {
  char *pos = strstr(s, seq);
  return (pos == NULL) ? -1 : pos - s;
}


x86 assembly (clang, -O0):
<str_idx>:
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 <strstr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    114c <str_idx+0x3c>
mov    $0xffffffffffffffff,%rax
mov    %rax,-0x20(%rbp)
jmp    115b <str_idx+0x4b>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_idx>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strstr@plt>
mov    %rax,%rcx
sub    %rbx,%rcx
cmp    $0x1,%rax
sbb    %rax,%rax
or     %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @str_idx(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i8* @strstr(i8* %6, i8* %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %12
11: ; preds = %2
br label %18
12: ; preds = %2
%13 = load i8*, i8** %5
%14 = load i8*, i8** %3
%15 = ptrtoint i8* %13 to i64
%16 = ptrtoint i8* %14 to i64
%17 = sub i64 %15, %16
br label %18
18: ; preds = %12, %11
%19 = phi i64 [ -1, %11 ], [ %17, %12 ]
ret i64 %19
}

LLVM IR (-O2):
define i64 @str_idx(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp eq i8* %3, null
%5 = ptrtoint i8* %3 to i64
%6 = ptrtoint i8* %0 to i64
%7 = sub i64 %5, %6
%8 = select i1 %4, i64 -1, i64 %7
ret i64 %8
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ memcpy(char *, char *, int);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
char *syck_strndup(char *buf, long len) {
  char *new = (char *)malloc(sizeof(char) * (len + 1));
  memset((new), 0, sizeof(char) * (len + 1));
  memcpy((new), (buf), sizeof(char) * (len));
  return new;
}


x86 assembly (clang, -O0):
<syck_strndup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
add    $0x1,%rax
shl    $0x0,%rax
mov    %eax,%edx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syck_strndup>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r15
mov    %rdi,%r14
lea    0x1(%rsi),%ebp
mov    %ebp,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    %ebp,%edx
call   1030 <memset@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15d,%edx
call   1040 <memcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i8* @syck_strndup(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = add nsw i64 %6, 1
%8 = mul i64 1, %7
%9 = trunc i64 %8 to i32
%10 = call i64 @malloc(i32 %9)
%11 = inttoptr i64 %10 to i8*
store i8* %11, i8** %5
%12 = load i8*, i8** %5
%13 = load i64, i64* %4
%14 = add nsw i64 %13, 1
%15 = mul i64 1, %14
%16 = trunc i64 %15 to i32
%17 = call i32 @memset(i8* %12, i32 0, i32 %16)
%18 = load i8*, i8** %5
%19 = load i8*, i8** %3
%20 = load i64, i64* %4
%21 = mul i64 1, %20
%22 = trunc i64 %21 to i32
%23 = call i32 @memcpy(i8* %18, i8* %19, i32 %22)
%24 = load i8*, i8** %5
ret i8* %24
}

LLVM IR (-O2):
define i8* @syck_strndup(i8* %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = add i32 %3, 1
%5 = tail call i64 @malloc(i32 %4)
%6 = inttoptr i64 %5 to i8*
%7 = tail call i32 @memset(i8* %6, i32 0, i32 %4)
%8 = tail call i32 @memcpy(i8* %6, i8* %0, i32 %3)
ret i8* %6
}
/* Variables and functions */
int core9_swap(char *, int);
int U_EMRCHORD_swap(char *record, int torev) {
  return (core9_swap(record, torev));
}


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

x86 assembly (clang, -O2):
<U_EMRCHORD_swap>:
jmp    1030 <core9_swap@plt>

LLVM IR (-O0):
define i32 @U_EMRCHORD_swap(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @core9_swap(i8* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @U_EMRCHORD_swap(i8* %0, i32 %1) {
%3 = tail call i32 @core9_swap(i8* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int);
int /*<<< orphan*/ stderr;
void usage(char *av0, int nthreads) {
  fprintf(stderr,
          "Usage: %s [-d <n>] [-n <n>] <N>\n"
          " -n        number of threads in pool, default %d\n",
          av0, nthreads);
  exit(0);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
lea    0xeba(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [82 x i8] c"Usage: %s [-d <n>] [-n <n>] <N>\0A -n number of threads in pool, default %d\0A\00"
define void @usage(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str, i64 0, i64 0), i8* %6, i32 %7)
%9 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [82 x i8] c"Usage: %s [-d <n>] [-n <n>] <N>\0A -n number of threads in pool, default %d\0A\00"
define void @usage(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
%5 = tail call i32 @exit(i32 0)
unreachable
}