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

/* Variables and functions */
int /*<<< orphan*/ localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strftime(char *, int, char *, int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
char *_strdate(char *s) {
  time_t now;
  time(&now);
  strftime(s, 9, "%D", localtime(&now));
  return s;
}


x86 assembly (clang, -O0):
<_strdate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
call   1040 <time@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0xc(%rbp),%rdi
call   1030 <localtime@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%ecx
mov    $0x9,%esi
lea    0xe98(%rip),%rdx
call   1050 <strftime@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_strdate>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0x4(%rsp),%r14
mov    %r14,%rdi
call   1040 <time@plt>
mov    %r14,%rdi
call   1030 <localtime@plt>
lea    0xead(%rip),%rdx
mov    %rbx,%rdi
mov    $0x9,%esi
mov    %eax,%ecx
call   1050 <strftime@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%D\00"
define i8* @_strdate(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = call i32 @time(i32* %3)
%5 = load i8*, i8** %2
%6 = call i32 @localtime(i32* %3)
%7 = call i32 @strftime(i8* %5, i32 9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i8*, i8** %2
ret i8* %8
}

LLVM IR (-O2):
@.str = [3 x i8] c"%D\00"
define i8* @_strdate(i8* returned %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @time(i32* %2)
%5 = call i32 @localtime(i32* %2)
%6 = call i32 @strftime(i8* %0, i32 9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i8* %0
}
/* Variables and functions */
char *resolve_path(char const *);
char *resolve_path_at(int dirfd, const char *p) { return resolve_path(p); }


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

x86 assembly (clang, -O2):
<resolve_path_at>:
mov    %rsi,%rdi
jmp    1030 <resolve_path@plt>

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

LLVM IR (-O2):
define i8* @resolve_path_at(i32 %0, i8* %1) {
%3 = tail call i8* @resolve_path(i8* %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int help(char *prg) {
  printf("usage: %s opts* infile outfile\n", prg);
  printf("\t-d Decode\n");
  printf("\t-1 .. -9 Compression Level\n");
  return (0);
}


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

x86 assembly (clang, -O2):
<help>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xee7(%rip),%rdi
call   1030 <puts@plt>
lea    0xee6(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"usage: %s opts* infile outfile\0A\00"
@.str.1 = [12 x i8] c"\09-d Decode\0A\00"
@.str.2 = [29 x i8] c"\09-1 .. -9 Compression Level\0A\00"
define i32 @help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [32 x i8] c"usage: %s opts* infile outfile\0A\00"
@str = [11 x i8] c"\09-d Decode\00"
@str.3 = [28 x i8] c"\09-1 .. -9 Compression Level\00"
define i32 @help(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.3, i64 0, i64 0))
ret i32 0
}
long min5(long a, long b, long c, long d, long e) {
  long out = a;
  if (b < out) {
    out = b;
  }
  if (c < out) {
    out = c;
  }
  if (d < out) {
    out = d;
  }
  if (e < out) {
    out = e;
  }
  return out;
}


x86 assembly (clang, -O0):
<min5>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x30(%rbp),%rax
jge    1136 <min5+0x36>
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x30(%rbp),%rax
jge    114c <min5+0x4c>
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x30(%rbp),%rax
jge    1162 <min5+0x62>
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x30(%rbp),%rax
jge    1178 <min5+0x78>
mov    -0x28(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min5>:
mov    %rdi,%rax
cmp    %rdi,%rsi
cmovl  %rsi,%rax
cmp    %rdx,%rax
cmovg  %rdx,%rax
cmp    %rcx,%rax
cmovg  %rcx,%rax
cmp    %r8,%rax
cmovg  %r8,%rax
ret

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

LLVM IR (-O2):
define i64 @min5(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = icmp slt i64 %1, %0
%7 = select i1 %6, i64 %1, i64 %0
%8 = icmp sgt i64 %7, %2
%9 = select i1 %8, i64 %2, i64 %7
%10 = icmp sgt i64 %9, %3
%11 = select i1 %10, i64 %3, i64 %9
%12 = icmp sgt i64 %11, %4
%13 = select i1 %12, i64 %4, i64 %11
ret i64 %13
}
/* Variables and functions */
scalar_t__ asm_checkkbdbuf();
int /*<<< orphan*/ asm_inputc(void *);
void clearkbdbuf() {
  while (asm_checkkbdbuf())
    asm_inputc(((void *)0));
}


x86 assembly (clang, -O0):
<clearkbdbuf>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <clearkbdbuf+0x9>
mov    $0x0,%al
call   1030 <asm_checkkbdbuf@plt>
cmp    $0x0,%rax
je     1148 <clearkbdbuf+0x28>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <asm_inputc@plt>
jmp    1129 <clearkbdbuf+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clearkbdbuf>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <asm_checkkbdbuf@plt>
test   %rax,%rax
je     1145 <clearkbdbuf+0x25>
xor    %edi,%edi
call   1040 <asm_inputc@plt>
jmp    1130 <clearkbdbuf+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @clearkbdbuf() {
br label %1
1: ; preds = %4, %0
%2 = call i64 (...) @asm_checkkbdbuf()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = call i32 @asm_inputc(i8* null)
br label %1
6: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @clearkbdbuf() {
%1 = tail call i64 (...) @asm_checkkbdbuf()
%2 = icmp eq i64 %1, 0
br i1 %2, label %7, label %3
3: ; preds = %0, %3
%4 = tail call i32 @asm_inputc(i8* null)
%5 = tail call i64 (...) @asm_checkkbdbuf()
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %3
7: ; preds = %3, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ check_endian();
void hecmw_set_endian_info(void) { check_endian(); }


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

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

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

LLVM IR (-O2):
define void @hecmw_set_endian_info() {
%1 = tail call i32 (...) @check_endian()
ret void
}
/* Variables and functions */
scalar_t__ isalpha(char);
int inword_first(char c) {
  if (isalpha(c)) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<inword_first>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
call   1030 <isalpha@plt>
cmp    $0x0,%rax
je     113d <inword_first+0x2d>
movl   $0x1,-0x4(%rbp)
jmp    1144 <inword_first+0x34>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @inword_first(i8 signext %0) {
%2 = tail call i64 @isalpha(i8 signext %0)
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main(int argc, char **argv) {
  int x = 2;
  if (argc)
    x = -x;
  printf("hello world - %d args, and x is %d\n", -argc, x);
  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)
movl   $0x2,-0x14(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     113f <main+0x2f>
xor    %eax,%eax
sub    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
xor    %esi,%esi
sub    -0x8(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %edi,%esi
xor    %eax,%eax
test   %edi,%edi
sete   %al
lea    -0x2(,%rax,4),%edx
neg    %esi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [36 x i8] c"hello world - %d args, and x is %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 2, i32* %6
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i32, i32* %6
%11 = sub nsw i32 0, %10
store i32 %11, i32* %6
br label %12
12: ; preds = %9, %2
%13 = load i32, i32* %4
%14 = sub nsw i32 0, %13
%15 = load i32, i32* %6
%16 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %14, i32 %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [36 x i8] c"hello world - %d args, and x is %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = icmp eq i32 %0, 0
%4 = select i1 %3, i32 2, i32 -2
%5 = sub nsw i32 0, %0
%6 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ compute(int);
int example_set_var5(int *array, int array_size) {
  compute(10);
  return 0;
}


x86 assembly (clang, -O0):
<example_set_var5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0xa,%edi
call   1030 <compute@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<example_set_var5>:
push   %rax
mov    $0xa,%edi
call   1030 <compute@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @example_set_var5(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = call i32 @compute(i32 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @example_set_var5(i32* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @compute(i32 10)
ret i32 0
}
void method() {
  int x = 10;
  int y = 20;
  int z = x + y;
}


x86 assembly (clang, -O0):
<method>:
push   %rbp
mov    %rsp,%rbp
movl   $0xa,-0x4(%rbp)
movl   $0x14,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @method() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 10, i32* %1
store i32 20, i32* %2
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = add nsw i32 %4, %5
store i32 %6, i32* %3
ret void
}

LLVM IR (-O2):
define void @method() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fatal_error(int /*<<< orphan*/, char *, char *);
void jacobierror(char *error_text) {
  fatal_error(0, "Error: %s\n", error_text);
}


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

x86 assembly (clang, -O2):
<jacobierror>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rsi
xor    %edi,%edi
jmp    1030 <fatal_error@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"Error: %s\0A\00"
define void @jacobierror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @fatal_error(i32 0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"Error: %s\0A\00"
define void @jacobierror(i8* %0) {
%2 = tail call i32 @fatal_error(i32 0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fork();
int getpid();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ wait();
int main() {
  if (!fork()) {
    printf("child pid=%d\n", getpid());
    exit(0);
  }
  wait();
  sleep(60);
  printf("parent pid=%d \n", getpid());
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1080 <fork@plt>
cmp    $0x0,%eax
jne    119b <main+0x3b>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xe71(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>
mov    $0x0,%al
call   1070 <wait@plt>
mov    $0x3c,%edi
call   1060 <sleep@plt>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xe52(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1080 <fork@plt>
test   %eax,%eax
jne    117c <main+0x1c>
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xe86(%rip),%rdi
jmp    119b <main+0x3b>
xor    %eax,%eax
call   1070 <wait@plt>
mov    $0x3c,%edi
call   1060 <sleep@plt>
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xe73(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"child pid=%d\0A\00"
@.str.1 = [16 x i8] c"parent pid=%d \0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @fork()
%3 = icmp ne i32 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %0
%5 = call i32 (...) @getpid()
%6 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 @exit(i32 0)
unreachable
8: ; preds = %0
%9 = call i32 (...) @wait()
%10 = call i32 @sleep(i32 60)
%11 = call i32 (...) @getpid()
%12 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [14 x i8] c"child pid=%d\0A\00"
@.str.1 = [16 x i8] c"parent pid=%d \0A\00"
define i32 @main() {
%1 = tail call i32 (...) @fork()
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i32 (...) @getpid()
%5 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %0
%8 = tail call i32 (...) @wait()
%9 = tail call i32 @sleep(i32 60)
%10 = tail call i32 (...) @getpid()
%11 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %10)
%12 = tail call i32 @exit(i32 0)
unreachable
}
void f2() {
  _Complex int a = 1;
  int b = __imag a;
  int *c = &__real a;
  int *d = &__imag a;
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x8(%rbp)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x20(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @f2() {
ret void
}
char hextoascii(unsigned char value) {
  value &= 0x0F;
  return ((value <= 0x09) ? (value + 0x30) : (value + 0x57));
}


x86 assembly (clang, -O0):
<hextoascii>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0xf,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x9,%eax
jg     1130 <hextoascii+0x30>
movzbl -0x1(%rbp),%eax
add    $0x30,%eax
mov    %eax,-0x8(%rbp)
jmp    113a <hextoascii+0x3a>
movzbl -0x1(%rbp),%eax
add    $0x57,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hextoascii>:
and    $0xf,%dil
lea    0x30(%rdi),%eax
lea    0x57(%rdi),%ecx
cmp    $0xa,%dil
movzbl %al,%edx
movzbl %cl,%eax
cmovb  %edx,%eax
ret

LLVM IR (-O0):
define signext i8 @hextoascii(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 15
%6 = trunc i32 %5 to i8
store i8 %6, i8* %2
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = icmp sle i32 %8, 9
br i1 %9, label %10, label %14
10: ; preds = %1
%11 = load i8, i8* %2
%12 = zext i8 %11 to i32
%13 = add nsw i32 %12, 48
br label %18
14: ; preds = %1
%15 = load i8, i8* %2
%16 = zext i8 %15 to i32
%17 = add nsw i32 %16, 87
br label %18
18: ; preds = %14, %10
%19 = phi i32 [ %13, %10 ], [ %17, %14 ]
%20 = trunc i32 %19 to i8
ret i8 %20
}

LLVM IR (-O2):
define signext i8 @hextoascii(i8 zeroext %0) {
%2 = and i8 %0, 15
%3 = icmp ult i8 %2, 10
%4 = or i8 %2, 48
%5 = add nuw nsw i8 %2, 87
%6 = select i1 %3, i8 %4, i8 %5
ret i8 %6
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ font;
};
typedef TYPE_1__ XEDataObject;

/* Variables and functions */
void *get_XEDataObject_font(void *_p) {
  return (void *)((XEDataObject *)_p)->font;
}


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

x86 assembly (clang, -O2):
<get_XEDataObject_font>:
mov    (%rdi),%rax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i8* @get_XEDataObject_font(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}

LLVM IR (-O2):
define i8* @get_XEDataObject_font(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Variables and functions */
int random();
int roll(int ndie, int nsides) {
  long tot;
  tot = 0;
  while (ndie--)
    tot += (random() % nsides) + 1;
  return (int)tot;
}


x86 assembly (clang, -O0):
<roll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     1158 <roll+0x48>
mov    $0x0,%al
call   1030 <random@plt>
cltd
idivl  -0x8(%rbp)
add    $0x1,%edx
movslq %edx,%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1126 <roll+0x16>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<roll>:
push   %rbp
push   %r14
push   %rbx
test   %edi,%edi
je     1138 <roll+0x28>
mov    %esi,%r14d
mov    %edi,%ebp
xor    %ebx,%ebx
nop
xor    %eax,%eax
call   1030 <random@plt>
cltd
idiv   %r14d
add    $0x1,%edx
add    %rdx,%rbx
add    $0xffffffff,%ebp
jne    1120 <roll+0x10>
jmp    113a <roll+0x2a>
xor    %ebx,%ebx
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @roll(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
store i32 %0, i32* %3
store i32 %1, i32* %4
store i64 0, i64* %5
br label %6
6: ; preds = %10, %2
%7 = load i32, i32* %3
%8 = add nsw i32 %7, -1
store i32 %8, i32* %3
%9 = icmp ne i32 %7, 0
br i1 %9, label %10, label %18
10: ; preds = %6
%11 = call i32 (...) @random()
%12 = load i32, i32* %4
%13 = srem i32 %11, %12
%14 = add nsw i32 %13, 1
%15 = sext i32 %14 to i64
%16 = load i64, i64* %5
%17 = add nsw i64 %16, %15
store i64 %17, i64* %5
br label %6
18: ; preds = %6
%19 = load i64, i64* %5
%20 = trunc i64 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @roll(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %16, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %12, %4 ], [ 0, %2 ]
%6 = phi i32 [ %7, %4 ], [ %0, %2 ]
%7 = add nsw i32 %6, -1
%8 = tail call i32 (...) @random()
%9 = srem i32 %8, %1
%10 = add nsw i32 %9, 1
%11 = zext i32 %10 to i64
%12 = add i64 %5, %11
%13 = icmp eq i32 %7, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = trunc i64 %12 to i32
br label %16
16: ; preds = %14, %2
%17 = phi i32 [ 0, %2 ], [ %15, %14 ]
ret i32 %17
}
unsigned short __inwc_p(unsigned short port) {
  unsigned short _v;
  __asm__ __volatile__("in"
                       "w"
                       " %"
                       ""
                       "1,%"
                       ""
                       "0"
                       : "=a"(_v)
                       : "id"(port));
  __asm__ __volatile__("outb %al,$0x80");
  return _v;
}


x86 assembly (clang, -O0):
<__inwc_p>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%ax
mov    %ax,-0x4(%rbp)
out    %al,$0x80
movzwl -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__inwc_p>:
mov    %edi,%edx
in     (%dx),%ax
out    %al,$0x80
ret

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

LLVM IR (-O2):
define zeroext i16 @__inwc_p(i16 zeroext %0) {
%2 = tail call i16 asm sideeffect "inw $1,$0", "={ax},i{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
tail call void asm sideeffect "outb %al,$$0x80", "~{dirflag},~{fpsr},~{flags}"()
ret i16 %2
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(
      stderr,
      "noyuck: usage: noyuck --current HOSTS1 --new HOSTS2 --prefix PREFIX\n");
  exit(EXIT_FAILURE);
}


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    0x2e98(%rip),%rax
mov    (%rax),%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    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [69 x i8] c"noyuck: usage: noyuck --current HOSTS1 --new HOSTS2 --prefix PREFIX\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [69 x i8] c"noyuck: usage: noyuck --current HOSTS1 --new HOSTS2 --prefix PREFIX\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
void f(int i) {
  i >> -1;
  i >> 250;
  i << -1;
  i << 250;
}


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

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

LLVM IR (-O0):
define void @f(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, -1
%5 = load i32, i32* %2
%6 = ashr i32 %5, 250
%7 = load i32, i32* %2
%8 = shl i32 %7, -1
%9 = load i32, i32* %2
%10 = shl i32 %9, 250
ret void
}

LLVM IR (-O2):
define void @f(i32 %0) {
ret void
}
void *alloc_remap(int nid, unsigned long size) { return ((void *)0); }


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

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

LLVM IR (-O0):
define i8* @alloc_remap(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @alloc_remap(i32 %0, i64 %1) {
ret i8* null
}
/* Type definitions */
struct sembuf {
  int sem_op;
  scalar_t__ sem_flg;
  scalar_t__ sem_num;
};

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
scalar_t__ semop(int, struct sembuf *, int);
void opsem(int sem, int i) {
  struct sembuf op;
  op.sem_num = 0;
  op.sem_op = i;
  op.sem_flg = 0;
  if ((semop(sem, &op, 1)) < 0) {
    perror("[semop]");
    exit(-1);
  }
}


x86 assembly (clang, -O0):
<opsem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x20(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    $0x1,%edx
call   1040 <semop@plt>
cmp    $0x0,%rax
jge    1185 <opsem+0x55>
lea    0xe8a(%rip),%rdi
call   1030 <perror@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opsem>:
sub    $0x18,%rsp
mov    %esi,(%rsp)
xorps  %xmm0,%xmm0
movups %xmm0,0x8(%rsp)
mov    %rsp,%rsi
mov    $0x1,%edx
call   1040 <semop@plt>
test   %rax,%rax
js     1156 <opsem+0x26>
add    $0x18,%rsp
ret
lea    0xea3(%rip),%rdi
call   1030 <perror@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
%struct.sembuf = type { i32, i64, i64 }
@.str = [8 x i8] c"[semop]\00"
define void @opsem(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.sembuf
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %5, i32 0, i32 2
store i64 0, i64* %6
%7 = load i32, i32* %4
%8 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %5, i32 0, i32 0
store i32 %7, i32* %8
%9 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %5, i32 0, i32 1
store i64 0, i64* %9
%10 = load i32, i32* %3
%11 = call i64 @semop(i32 %10, %struct.sembuf* %5, i32 1)
%12 = icmp slt i64 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %2
%14 = call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%15 = call i32 @exit(i32 -1)
unreachable
16: ; preds = %2
ret void
}

LLVM IR (-O2):
%struct.sembuf = type { i32, i64, i64 }
@.str = [8 x i8] c"[semop]\00"
define void @opsem(i32 %0, i32 %1) {
%3 = alloca %struct.sembuf
%4 = bitcast %struct.sembuf* %3 to i8*
%5 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i64 0, i32 0
store i32 %1, i32* %5
%6 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i64 0, i32 1
%7 = bitcast i64* %6 to <2 x i64>*
store <2 x i64> zeroinitializer, <2 x i64>* %7
%8 = call i64 @semop(i32 %0, %struct.sembuf* %3, i32 1)
%9 = icmp slt i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @exit(i32 -1)
unreachable
13: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lost_owning_controller(char *, char *);
void owning_controller_procmon_cb(void *unused) {
  (void)unused;
  lost_owning_controller("process", "vanished");
}


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

x86 assembly (clang, -O2):
<owning_controller_procmon_cb>:
lea    0xee9(%rip),%rdi
lea    0xeea(%rip),%rsi
jmp    1030 <lost_owning_controller@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"process\00"
@.str.1 = [9 x i8] c"vanished\00"
define void @owning_controller_procmon_cb(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @lost_owning_controller(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"process\00"
@.str.1 = [9 x i8] c"vanished\00"
define void @owning_controller_procmon_cb(i8* nocapture readnone %0) {
%2 = tail call i32 @lost_owning_controller(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
char *getprogname();
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr, "usage: %s [-p] [-m mode] dirname ...\n",
                getprogname());
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getprogname@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rdx
lea    0xea8(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2ea8(%rip),%rax
mov    (%rax),%ebx
xor    %eax,%eax
call   1030 <getprogname@plt>
lea    0xeb8(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   1040 <fprintf@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [38 x i8] c"usage: %s [-p] [-m mode] dirname ...\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i8* (...) @getprogname()
%3 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
void get_delim(char *dest, const char *p) {
  if (p[0] == '\0' || p[1] == '\0') {
    dest[0] = '\0';
    return;
  }
  dest[0] = *(p + 1);
}


x86 assembly (clang, -O0):
<get_delim>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     112d <get_delim+0x2d>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
jne    1139 <get_delim+0x39>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
jmp    1146 <get_delim+0x46>
mov    -0x10(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_delim>:
cmpb   $0x0,(%rsi)
je     110b <get_delim+0xb>
mov    0x1(%rsi),%al
mov    %al,(%rdi)
ret
xor    %eax,%eax
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @get_delim(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
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 0
br i1 %9, label %16, label %10
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = getelementptr inbounds i8, i8* %11, i64 1
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %10, %2
%17 = load i8*, i8** %3
%18 = getelementptr inbounds i8, i8* %17, i64 0
store i8 0, i8* %18
br label %25
19: ; preds = %10
%20 = load i8*, i8** %4
%21 = getelementptr inbounds i8, i8* %20, i64 1
%22 = load i8, i8* %21
%23 = load i8*, i8** %3
%24 = getelementptr inbounds i8, i8* %23, i64 0
store i8 %22, i8* %24
br label %25
25: ; preds = %19, %16
ret void
}

LLVM IR (-O2):
define void @get_delim(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %1, i64 1
%7 = load i8, i8* %6
br label %8
8: ; preds = %5, %2
%9 = phi i8 [ 0, %2 ], [ %7, %5 ]
store i8 %9, i8* %0
ret void
}
/* Variables and functions */
size_t strnlen(const char *s, size_t n) {
  size_t i;
  for (i = 0; s[i] != '\0' && i < n; i++)
    ;
  return i;
}


x86 assembly (clang, -O0):
<strnlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x19(%rbp)
je     113c <strnlen+0x3c>
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
setb   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    114c <strnlen+0x4c>
jmp    1162 <strnlen+0x62>
jmp    1151 <strnlen+0x51>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <strnlen+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strnlen>:
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    0x1(%rcx),%rax
cmpb   $0x0,(%rdi,%rcx,1)
je     1122 <strnlen+0x22>
cmp    %rsi,%rcx
mov    %rax,%rcx
jb     1110 <strnlen+0x10>
add    $0xffffffffffffffff,%rax
ret

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

LLVM IR (-O2):
define i64 @strnlen(i8* nocapture %0, i64 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ 0, %2 ], [ %10, %3 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp ne i8 %6, 0
%8 = icmp ult i64 %4, %1
%9 = select i1 %7, i1 %8, i1 false
%10 = add nuw i64 %4, 1
br i1 %9, label %3, label %11
11: ; preds = %3
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void ImprimirMenu() {
  printf("MENÚ DEL JUEGO:\n");
  printf("1. Juego de dos jugadores\n");
  printf("2. Juego contra computadora\n");
  printf("3. Recuperar un juego grabado\n");
  printf("4. Terminar\n");
}


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

x86 assembly (clang, -O2):
<ImprimirMenu>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xeed(%rip),%rdi
call   1030 <puts@plt>
lea    0xefb(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0b(%rip),%rdi
call   1030 <puts@plt>
lea    0xf1d(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"MEN\C3\9A DEL JUEGO:\0A\00"
@.str.1 = [27 x i8] c"1. Juego de dos jugadores\0A\00"
@.str.2 = [29 x i8] c"2. Juego contra computadora\0A\00"
@.str.3 = [31 x i8] c"3. Recuperar un juego grabado\0A\00"
@.str.4 = [13 x i8] c"4. Terminar\0A\00"
define void @ImprimirMenu() {
%1 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [17 x i8] c"MEN\C3\9A DEL JUEGO:\00"
@str.5 = [26 x i8] c"1. Juego de dos jugadores\00"
@str.6 = [28 x i8] c"2. Juego contra computadora\00"
@str.7 = [30 x i8] c"3. Recuperar un juego grabado\00"
@str.8 = [12 x i8] c"4. Terminar\00"
define void @ImprimirMenu() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.5, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.6, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.7, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.8, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EVP_sha256();
int PKCS1_MGF1(unsigned char *, long, unsigned char const *, long,
               int /*<<< orphan*/);
int MGF1_SHA256(unsigned char *mask, long len, const unsigned char *seed,
                long seedlen) {
  return PKCS1_MGF1(mask, len, seed, seedlen, EVP_sha256());
}


x86 assembly (clang, -O0):
<MGF1_SHA256>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    $0x0,%al
call   1040 <EVP_sha256@plt>
mov    -0x40(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    -0x30(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    %eax,%r8d
call   1030 <PKCS1_MGF1@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MGF1_SHA256>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <EVP_sha256@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
mov    %eax,%r8d
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <PKCS1_MGF1@plt>

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

LLVM IR (-O2):
define i32 @MGF1_SHA256(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = tail call i32 (...) @EVP_sha256()
%6 = tail call i32 @PKCS1_MGF1(i8* %0, i64 %1, i8* %2, i64 %3, i32 %5)
ret i32 %6
}
/* Variables and functions */
float exp(double);
float dbtopow(float f) {
  if (f <= 0)
    return (0);
  else {
    if (f > 870)
      f = 870;
    return (exp((2.302585092994 * 0.1) * (f - 100.)));
  }
}


x86 assembly (clang, -O0):
<dbtopow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jb     1137 <dbtopow+0x27>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1185 <dbtopow+0x75>
movss  -0x8(%rbp),%xmm0
movss  0xebc(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    115a <dbtopow+0x4a>
movss  0xeab(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xea5(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xe91(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dbtopow>:
xorps  %xmm1,%xmm1
ucomiss %xmm0,%xmm1
jae    1140 <dbtopow+0x30>
movss  0xee0(%rip),%xmm1
minss  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
addsd  0xed5(%rip),%xmm0
mulsd  0xed5(%rip),%xmm0
jmp    1030 <exp@plt>
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @dbtopow(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp ole float %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store float 0.000000e+00, float* %2
br label %17
7: ; preds = %1
%8 = load float, float* %3
%9 = fcmp ogt float %8, 8.700000e+02
br i1 %9, label %10, label %11
10: ; preds = %7
store float 8.700000e+02, float* %3
br label %11
11: ; preds = %10, %7
%12 = load float, float* %3
%13 = fpext float %12 to double
%14 = fsub double %13, 1.000000e+02
%15 = fmul double 0x3FCD791C5F88877F, %14
%16 = call float @exp(double %15)
store float %16, float* %2
br label %17
17: ; preds = %11, %6
%18 = load float, float* %2
ret float %18
}

LLVM IR (-O2):
define float @dbtopow(float %0) {
%2 = fcmp ugt float %0, 0.000000e+00
br i1 %2, label %3, label %10
3: ; preds = %1
%4 = fcmp ogt float %0, 8.700000e+02
%5 = select i1 %4, float 8.700000e+02, float %0
%6 = fpext float %5 to double
%7 = fadd double %6, -1.000000e+02
%8 = fmul double %7, 0x3FCD791C5F88877F
%9 = tail call float @exp(double %8)
br label %10
10: ; preds = %1, %3
%11 = phi float [ %9, %3 ], [ 0.000000e+00, %1 ]
ret float %11
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char const *);
int /*<<< orphan*/ stdout;
void sanityTest(const char *socketPath) {
  printf("sanityTest: %s\n", socketPath);
  fflush(stdout);
  exit(0);
}


x86 assembly (clang, -O0):
<sanityTest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<sanityTest>:
push   %rax
mov    %rdi,%rsi
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"sanityTest: %s\0A\00"
@stdout = global i32 0
define void @sanityTest(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i32, i32* @stdout
%6 = call i32 @fflush(i32 %5)
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [16 x i8] c"sanityTest: %s\0A\00"
@stdout = global i32 0
define void @sanityTest(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
%5 = tail call i32 @exit(i32 0)
unreachable
}
char to_hex_char(int a) {
  if (a < 10) {
    return '0' + a;
  } else {
    return 'a' + (a - 10);
  }
}


x86 assembly (clang, -O0):
<to_hex_char>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    111f <to_hex_char+0x1f>
mov    -0x8(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    112b <to_hex_char+0x2b>
mov    -0x8(%rbp),%eax
sub    $0xa,%eax
add    $0x61,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_hex_char>:
cmp    $0xa,%edi
mov    $0x30,%ecx
mov    $0x57,%eax
cmovl  %ecx,%eax
add    %dil,%al
ret

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

LLVM IR (-O2):
define signext i8 @to_hex_char(i32 %0) {
%2 = icmp slt i32 %0, 10
%3 = trunc i32 %0 to i8
%4 = select i1 %2, i8 48, i8 87
%5 = add i8 %4, %3
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMR3B_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


x86 assembly (clang, -O0):
<U_WMR3B_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 <U_WMRNOTIMPLEMENTED_swap@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<U_WMR3B_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

LLVM IR (-O0):
define void @U_WMR3B_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 @U_WMRNOTIMPLEMENTED_swap(i8* %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @U_WMR3B_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}