xunge/DecIR huggingface dataset:
void call(void (*f)()) { f(); }


x86 assembly (clang, -O0):
<call>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call>:
xor    %eax,%eax
jmp    *%rdi

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

LLVM IR (-O2):
define void @call(void (...)* nocapture %0) {
tail call void (...) %0()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printUsage();
void actionArg_help() {
  printUsage();
  exit(0);
}


x86 assembly (clang, -O0):
<actionArg_help>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <printUsage@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
define void @actionArg_help() {
%1 = call i32 (...) @printUsage()
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @actionArg_help() {
%1 = tail call i32 (...) @printUsage()
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ hello_world();
int /*<<< orphan*/ puts(int /*<<< orphan*/);
int main(void) { puts(hello_world()); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <hello_world@plt>
mov    %eax,%edi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @hello_world()
%2 = call i32 @puts(i32 %1)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @hello_world()
%2 = tail call i32 @puts(i32 %1)
ret i32 0
}
int get_salt_size(void) { return 10; }


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

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

LLVM IR (-O0):
define i32 @get_salt_size() {
ret i32 10
}

LLVM IR (-O2):
define i32 @get_salt_size() {
ret i32 10
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "\nUsage mkrandtable <alpha : float> <CW : int> <basis_start "
                  ": int> <basis_end : int>\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [85 x i8] c"\0AUsage mkrandtable <alpha : float> <CW : int> <basis_start : int> <basis_end : int>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([85 x i8], [85 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [85 x i8] c"\0AUsage mkrandtable <alpha : float> <CW : int> <basis_start : int> <basis_end : int>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([85 x i8], [85 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ printf(char *, char const *);
void die2(const char *message) {
  if (errno) {
    perror(message);
  } else {
    printf("ERROR: %s\n", message);
  }
  exit(1);
}


x86 assembly (clang, -O0):
<die2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
cmpq   $0x0,(%rax)
je     115b <die2+0x2b>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
jmp    116b <die2+0x3b>
mov    -0x8(%rbp),%rsi
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<die2>:
push   %rax
mov    %rdi,%rsi
mov    0x2ea5(%rip),%rax
cmpq   $0x0,(%rax)
je     1153 <die2+0x23>
mov    %rsi,%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@errno = global i64 0
@.str = [11 x i8] c"ERROR: %s\0A\00"
define void @die2(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i64, i64* @errno
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @perror(i8* %6)
br label %11
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %9)
br label %11
11: ; preds = %8, %5
%12 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@errno = global i64 0
@.str = [11 x i8] c"ERROR: %s\0A\00"
define void @die2(i8* %0) {
%2 = load i64, i64* @errno
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @perror(i8* %0)
br label %8
6: ; preds = %1
%7 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %8
8: ; preds = %6, %4
%9 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
char *strtok(char *, char *);
char *split(char *qname) {
  char *token;
  char *search = ".";
  token = strtok(qname, search);
  token = strtok(NULL, search);
  return token;
}


x86 assembly (clang, -O0):
<split>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strtok@plt>
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
call   1030 <strtok@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<split>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rsi
call   1030 <strtok@plt>
xor    %edi,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <strtok@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c".\00"
define i8* @split(i8* %0) {
%2 = tail call i8* @strtok(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i8* %3
}
/* Type definitions */
struct stack_st_OPENSSL_BLOCK {
  int dummy;
};
typedef int /*<<< orphan*/ OPENSSL_STACK;

/* Variables and functions */
int /*<<< orphan*/ OPENSSL_sk_free(int /*<<< orphan*/ *);
void sk_OPENSSL_BLOCK_free(struct stack_st_OPENSSL_BLOCK *sk) {
  OPENSSL_sk_free((OPENSSL_STACK *)sk);
}


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

x86 assembly (clang, -O2):
<sk_OPENSSL_BLOCK_free>:
jmp    1030 <OPENSSL_sk_free@plt>

LLVM IR (-O0):
%struct.stack_st_OPENSSL_BLOCK = type { i32 }
define void @sk_OPENSSL_BLOCK_free(%struct.stack_st_OPENSSL_BLOCK* %0) {
%2 = alloca %struct.stack_st_OPENSSL_BLOCK*
store %struct.stack_st_OPENSSL_BLOCK* %0, %struct.stack_st_OPENSSL_BLOCK** %2
%3 = load %struct.stack_st_OPENSSL_BLOCK*, %struct.stack_st_OPENSSL_BLOCK** %2
%4 = bitcast %struct.stack_st_OPENSSL_BLOCK* %3 to i32*
%5 = call i32 @OPENSSL_sk_free(i32* %4)
ret void
}

LLVM IR (-O2):
%struct.stack_st_OPENSSL_BLOCK = type { i32 }
define void @sk_OPENSSL_BLOCK_free(%struct.stack_st_OPENSSL_BLOCK* %0) {
%2 = getelementptr %struct.stack_st_OPENSSL_BLOCK, %struct.stack_st_OPENSSL_BLOCK* %0, i64 0, i32 0
%3 = tail call i32 @OPENSSL_sk_free(i32* %2)
ret void
}
void txt_metamisc(type, leng, mess) char *mess;
{
  prtime();
  printf("Meta event, unrecognized, type=0x%02x leng=%d\n", type, leng);
}


x86 assembly (clang, -O0):
<txt_metamisc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    $0x0,%al
call   1040 <prtime@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<txt_metamisc>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <prtime@plt>
lea    0xecb(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [47 x i8] c"Meta event, unrecognized, type=0x%02x leng=%d\0A\00"
define void @txt_metamisc(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = call i32 (...) @prtime()
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [47 x i8] c"Meta event, unrecognized, type=0x%02x leng=%d\0A\00"
define void @txt_metamisc(i32 %0, i32 %1, i8* nocapture readnone %2) {
%4 = tail call i32 (...) @prtime()
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret void
}
void fd65(int n) {
P0A:
  goto P0A;
  {
    typedef int(*b)[n];
  P01A:
    goto P01A;
    {
      typedef int(*c)[n];
    P012A:
      goto P012A;
      0;
    }
  p01B:
    goto p01B;
    goto a;
  P01B:
    goto P01B;
    {
      typedef int(*d)[n];
    P013A:
      goto P013A;
      0;
    }
  P01C:
    goto P01C;
    ;
    typedef int(*e)[n];
  P014A:
    goto P014A;
    0;
  };
P0B:
  goto P0B;
  {
    typedef int(*f)[n];
  P02A:
    goto P02A;
    {
      typedef int(*g)[n];
    P024A:
      goto P024A;
      0;
    };
  P02B:
    goto P02B;
    {
      typedef int(*h)[n];
    P025A:
      goto P025A;
      0;
    };
  P02C:
    goto P02C;
    ;
    typedef int(*i)[n];
  P026A:
    goto P026A;
    0;
  };
a:;
  typedef int(*j)[n];
P03A:
  goto P03A;
  0;
P03B:
  goto P03B;
}


x86 assembly (clang, -O0):
<fd65>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <fd65+0x7>

x86 assembly (clang, -O2):
<fd65>:
jmp    1100 <fd65>

LLVM IR (-O0):
define void @fd65(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %3, %1
br label %3
4: ; No predecessors!
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
br label %7
7: ; preds = %7, %4
br label %7
8: ; No predecessors!
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
br label %11
11: ; preds = %11, %8
br label %11
12: ; preds = %12
br label %12
13: ; preds = %13
br label %13
14: ; No predecessors!
%15 = load i32, i32* %2
%16 = zext i32 %15 to i64
br label %17
17: ; preds = %17, %14
br label %17
18: ; preds = %18
br label %18
19: ; No predecessors!
%20 = load i32, i32* %2
%21 = zext i32 %20 to i64
br label %22
22: ; preds = %22, %19
br label %22
23: ; preds = %23
br label %23
24: ; No predecessors!
%25 = load i32, i32* %2
%26 = zext i32 %25 to i64
br label %27
27: ; preds = %27, %24
br label %27
28: ; No predecessors!
%29 = load i32, i32* %2
%30 = zext i32 %29 to i64
br label %31
31: ; preds = %31, %28
br label %31
32: ; preds = %32
br label %32
33: ; No predecessors!
%34 = load i32, i32* %2
%35 = zext i32 %34 to i64
br label %36
36: ; preds = %36, %33
br label %36
37: ; preds = %37
br label %37
38: ; No predecessors!
%39 = load i32, i32* %2
%40 = zext i32 %39 to i64
br label %41
41: ; preds = %41, %38
br label %41
42: ; No predecessors!
%43 = load i32, i32* %2
%44 = zext i32 %43 to i64
br label %45
45: ; preds = %45, %42
br label %45
46: ; preds = %46
br label %46
}

LLVM IR (-O2):
define void @fd65(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
void kasan_early_init(void) {}


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

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

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

LLVM IR (-O2):
define void @kasan_early_init() {
ret void
}
/* Variables and functions */
int ft_is_prime(int);
int ft_find_next_prime(int nb) {
  int i;
  if (ft_is_prime(nb) == 1)
    return (nb);
  else {
    i = nb + 1;
    while ((ft_is_prime(i)) != 1)
      i++;
    return (i);
  }
}


x86 assembly (clang, -O0):
<ft_find_next_prime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <ft_is_prime@plt>
cmp    $0x1,%eax
jne    1137 <ft_find_next_prime+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1165 <ft_find_next_prime+0x55>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <ft_is_prime@plt>
cmp    $0x1,%eax
je     115f <ft_find_next_prime+0x4f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1140 <ft_find_next_prime+0x30>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_find_next_prime>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
call   1030 <ft_is_prime@plt>
cmp    $0x1,%eax
je     1131 <ft_find_next_prime+0x21>
add    $0x1,%ebx
mov    %ebx,%edi
jmp    1120 <ft_find_next_prime+0x10>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @ft_find_next_prime(i32 %0) {
%2 = tail call i32 @ft_is_prime(i32 %0)
%3 = icmp eq i32 %2, 1
br i1 %3, label %9, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %6, %4 ], [ %0, %1 ]
%6 = add nsw i32 %5, 1
%7 = tail call i32 @ft_is_prime(i32 %6)
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %4
9: ; preds = %4, %1
%10 = phi i32 [ %0, %1 ], [ %6, %4 ]
ret i32 %10
}
int setuid() { return -1; }


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

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

LLVM IR (-O0):
define i32 @setuid() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @setuid() {
ret i32 -1
}
/* Variables and functions */
int asinhf(float);
float hz2bark(float hz) { return 6 * asinhf(hz / 600); }


x86 assembly (clang, -O0):
<hz2bark>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xed6(%rip),%xmm1
divss  %xmm1,%xmm0
call   1030 <asinhf@plt>
imul   $0x6,%eax,%eax
cvtsi2ss %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hz2bark>:
push   %rax
divss  0xee7(%rip),%xmm0
call   1030 <asinhf@plt>
add    %eax,%eax
lea    (%rax,%rax,2),%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @hz2bark(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fdiv float %3, 6.000000e+02
%5 = call i32 @asinhf(float %4)
%6 = mul nsw i32 6, %5
%7 = sitofp i32 %6 to float
ret float %7
}

LLVM IR (-O2):
define float @hz2bark(float %0) {
%2 = fdiv float %0, 6.000000e+02
%3 = tail call i32 @asinhf(float %2)
%4 = mul nsw i32 %3, 6
%5 = sitofp i32 %4 to float
ret float %5
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *, int /*<<< orphan*/);
int write_standard_start_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(14, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<write_standard_start_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0xe,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_standard_start_system>:
mov    $0xe,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc@plt>

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

LLVM IR (-O2):
define i32 @write_standard_start_system() {
%1 = tail call i32 @_ada_use_c2phc(i32 14, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
double volume_cylinder(double radius, double height) {
  double volume_cylinder = 0.0;
  volume_cylinder = 3.14159265 * radius * radius * height;
  return volume_cylinder;
}


x86 assembly (clang, -O0):
<volume_cylinder>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xee2(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<volume_cylinder>:
movsd  0xef8(%rip),%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm2,%xmm0
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @volume_cylinder(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
store double 0.000000e+00, double* %5
%6 = load double, double* %3
%7 = fmul double 0x400921FB53C8D4F1, %6
%8 = load double, double* %3
%9 = fmul double %7, %8
%10 = load double, double* %4
%11 = fmul double %9, %10
store double %11, double* %5
%12 = load double, double* %5
ret double %12
}

LLVM IR (-O2):
define double @volume_cylinder(double %0, double %1) {
%3 = fmul double %0, 0x400921FB53C8D4F1
%4 = fmul double %3, %0
%5 = fmul double %4, %1
ret double %5
}
/* Variables and functions */
scalar_t__ tolower(unsigned char);
const char *rangematch(const char *pattern, int test, int c) {
  if ((c <= test) | (tolower(c) <= tolower((unsigned char)test)))
    return 0;
  return pattern;
}


x86 assembly (clang, -O0):
<rangematch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
setle  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
movzbl %al,%edi
call   1030 <tolower@plt>
mov    %rax,-0x28(%rbp)
mov    -0x14(%rbp),%eax
movzbl %al,%edi
call   1030 <tolower@plt>
mov    -0x28(%rbp),%rcx
mov    %rax,%rdx
mov    -0x1c(%rbp),%eax
cmp    %rdx,%rcx
setle  %cl
and    $0x1,%cl
movzbl %cl,%ecx
or     %ecx,%eax
cmp    $0x0,%eax
je     117b <rangematch+0x6b>
movq   $0x0,-0x8(%rbp)
jmp    1183 <rangematch+0x73>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rangematch>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
movzbl %r14b,%edi
call   1030 <tolower@plt>
mov    %rax,%r15
movzbl %bpl,%edi
call   1030 <tolower@plt>
xor    %ecx,%ecx
cmp    %rax,%r15
cmovle %rcx,%rbx
cmp    %ebp,%r14d
cmovle %rcx,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i8* @rangematch(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %7
%9 = load i32, i32* %6
%10 = icmp sle i32 %8, %9
%11 = zext i1 %10 to i32
%12 = load i32, i32* %7
%13 = trunc i32 %12 to i8
%14 = call i64 @tolower(i8 zeroext %13)
%15 = load i32, i32* %6
%16 = trunc i32 %15 to i8
%17 = call i64 @tolower(i8 zeroext %16)
%18 = icmp sle i64 %14, %17
%19 = zext i1 %18 to i32
%20 = or i32 %11, %19
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %23
22: ; preds = %3
store i8* null, i8** %4
br label %25
23: ; preds = %3
%24 = load i8*, i8** %5
store i8* %24, i8** %4
br label %25
25: ; preds = %23, %22
%26 = load i8*, i8** %4
ret i8* %26
}

LLVM IR (-O2):
define i8* @rangematch(i8* readnone %0, i32 %1, i32 %2) {
%4 = icmp sle i32 %2, %1
%5 = trunc i32 %2 to i8
%6 = tail call i64 @tolower(i8 zeroext %5)
%7 = trunc i32 %1 to i8
%8 = tail call i64 @tolower(i8 zeroext %7)
%9 = icmp sle i64 %6, %8
%10 = or i1 %4, %9
%11 = select i1 %10, i8* null, i8* %0
ret i8* %11
}
/* Variables and functions */
int /*<<< orphan*/ gen(char *);
void cgbool(void) {
  gen("neg\tax");
  gen("sbb\tax,ax");
  gen("neg\tax");
}


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

x86 assembly (clang, -O2):
<cgbool>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <gen@plt>
lea    0xee0(%rip),%rdi
call   1030 <gen@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <gen@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"neg\09ax\00"
@.str.1 = [10 x i8] c"sbb\09ax,ax\00"
define void @cgbool() {
%1 = call i32 @gen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @gen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @gen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"neg\09ax\00"
@.str.1 = [10 x i8] c"sbb\09ax,ax\00"
define void @cgbool() {
%1 = tail call i32 @gen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @gen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @gen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  while (1) {
    printf("Hello, world!\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>
jmp    111f <main+0xf>

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

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

LLVM IR (-O2):
@str = [14 x i8] c"Hello, world!\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ stdout;
int ubitmap_fprint_range(void const *, size_t, size_t, int /*<<< orphan*/);
int ubitmap_print_range(const void *b, size_t l, size_t r) {
  return ubitmap_fprint_range(b, l, r, stdout);
}


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

x86 assembly (clang, -O2):
<ubitmap_print_range>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%ecx
jmp    1030 <ubitmap_fprint_range@plt>

LLVM IR (-O0):
@stdout = global i32 0
define i32 @ubitmap_print_range(i8* %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = load i64, i64* %6
%10 = load i32, i32* @stdout
%11 = call i32 @ubitmap_fprint_range(i8* %7, i64 %8, i64 %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
@stdout = global i32 0
define i32 @ubitmap_print_range(i8* %0, i64 %1, i64 %2) {
%4 = load i32, i32* @stdout
%5 = tail call i32 @ubitmap_fprint_range(i8* %0, i64 %1, i64 %2, i32 %4)
ret i32 %5
}
/* Type definitions */
struct i8x_xctx {
  int dummy;
};
struct i8x_object {
  int dummy;
};

/* Variables and functions */
void *i8x_ob_get_userdata(struct i8x_object *);
void *__attribute__((always_)) i8x_xctx_get_userdata(struct i8x_xctx *x) {
  return i8x_ob_get_userdata((struct i8x_object *)x);
}


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

x86 assembly (clang, -O2):
<i8x_xctx_get_userdata>:
jmp    1030 <i8x_ob_get_userdata@plt>

LLVM IR (-O0):
%struct.i8x_xctx = type { i32 }
%struct.i8x_object = type { i32 }
define i8* @i8x_xctx_get_userdata(%struct.i8x_xctx* %0) {
%2 = alloca %struct.i8x_xctx*
store %struct.i8x_xctx* %0, %struct.i8x_xctx** %2
%3 = load %struct.i8x_xctx*, %struct.i8x_xctx** %2
%4 = bitcast %struct.i8x_xctx* %3 to %struct.i8x_object*
%5 = call i8* @i8x_ob_get_userdata(%struct.i8x_object* %4)
ret i8* %5
}

LLVM IR (-O2):
%struct.i8x_xctx = type { i32 }
%struct.i8x_object = type { i32 }
define i8* @i8x_xctx_get_userdata(%struct.i8x_xctx* %0) {
%2 = bitcast %struct.i8x_xctx* %0 to %struct.i8x_object*
%3 = tail call i8* @i8x_ob_get_userdata(%struct.i8x_object* %2)
ret i8* %3
}
char **copyblk(v)
register char **v;
{
  register char **nv =
      (char **)calloc((unsigned)(blklen(v) + 1), sizeof(char **));
  return (blkcpy(nv, v));
}


x86 assembly (clang, -O0):
<copyblk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <blklen@plt>
add    $0x1,%eax
mov    %eax,%eax
mov    %eax,%edi
mov    $0x8,%esi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1050 <blkcpy@plt>
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copyblk>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <blklen@plt>
lea    0x1(%rax),%edi
mov    $0x8,%esi
call   1030 <calloc@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <blkcpy@plt>
cltq
pop    %rbx
ret

LLVM IR (-O0):
define i8** @copyblk(i8** %0) {
%2 = alloca i8**
%3 = alloca i8**
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
%5 = call i32 (i8**, ...) bitcast (i32 (...)* @blklen to i32 (i8**, ...)*)(i8** %4)
%6 = add nsw i32 %5, 1
%7 = zext i32 %6 to i64
%8 = call i8* @calloc(i64 %7, i64 8)
%9 = bitcast i8* %8 to i8**
store i8** %9, i8*** %3
%10 = load i8**, i8*** %3
%11 = load i8**, i8*** %2
%12 = call i32 (i8**, i8**, ...) bitcast (i32 (...)* @blkcpy to i32 (i8**, i8**, ...)*)(i8** %10, i8** %11)
%13 = sext i32 %12 to i64
%14 = inttoptr i64 %13 to i8**
ret i8** %14
}

LLVM IR (-O2):
define i8** @copyblk(i8** %0) {
%2 = tail call i32 (i8**, ...) bitcast (i32 (...)* @blklen to i32 (i8**, ...)*)(i8** %0)
%3 = add nsw i32 %2, 1
%4 = zext i32 %3 to i64
%5 = tail call i8* @calloc(i64 %4, i64 8)
%6 = bitcast i8* %5 to i8**
%7 = tail call i32 (i8**, i8**, ...) bitcast (i32 (...)* @blkcpy to i32 (i8**, i8**, ...)*)(i8** %6, i8** %0)
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8**
ret i8** %9
}
/* Variables and functions */
int /*<<< orphan*/ putchar0(int);
void _ttywrch(int ch) { putchar0(ch); }


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

x86 assembly (clang, -O2):
<_ttywrch>:
jmp    1030 <putchar0@plt>

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

LLVM IR (-O2):
define void @_ttywrch(i32 %0) {
%2 = tail call i32 @putchar0(i32 %0)
ret void
}
/* Variables and functions */
scalar_t__ FLT_EPSILON;
scalar_t__ fabs(float);
int NJ_FLT_EQ(float x, float y) {
  if (fabs(x - y) < FLT_EPSILON) {
    return (1);
  } else {
    return (0);
  }
}


x86 assembly (clang, -O0):
<NJ_FLT_EQ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
subss  -0xc(%rbp),%xmm0
call   1030 <fabs@plt>
mov    0x2ea8(%rip),%rcx
cmp    (%rcx),%rax
jge    114d <NJ_FLT_EQ+0x3d>
movl   $0x1,-0x4(%rbp)
jmp    1154 <NJ_FLT_EQ+0x44>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NJ_FLT_EQ>:
push   %rax
subss  %xmm1,%xmm0
call   1030 <fabs@plt>
mov    0x2ebf(%rip),%rdx
xor    %ecx,%ecx
cmp    (%rdx),%rax
setl   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@FLT_EPSILON = global i64 0
define i32 @NJ_FLT_EQ(float %0, float %1) {
%3 = alloca i32
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %4
%7 = load float, float* %5
%8 = fsub float %6, %7
%9 = call i64 @fabs(float %8)
%10 = load i64, i64* @FLT_EPSILON
%11 = icmp slt i64 %9, %10
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 1, i32* %3
br label %14
13: ; preds = %2
store i32 0, i32* %3
br label %14
14: ; preds = %13, %12
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
@FLT_EPSILON = global i64 0
define i32 @NJ_FLT_EQ(float %0, float %1) {
%3 = fsub float %0, %1
%4 = tail call i64 @fabs(float %3)
%5 = load i64, i64* @FLT_EPSILON
%6 = icmp slt i64 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
calloc(n, s) { return (alloc(n * s)); }


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

x86 assembly (clang, -O2):
<calloc>:
imul   %esi,%edi
xor    %eax,%eax
jmp    1030 <alloc@plt>

LLVM IR (-O0):
define i32 @calloc(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = mul nsw i32 %5, %6
%8 = call i32 (i32, ...) bitcast (i32 (...)* @alloc to i32 (i32, ...)*)(i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @calloc(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @alloc to i32 (i32, ...)*)(i32 %3)
ret i32 %4
}
/* Variables and functions */
char *index_find(int);
int /*<<< orphan*/ jump_linenum_slow(int);
int /*<<< orphan*/ tokenizer_goto(char const *);
void jump_linenum(int linenum) {
  char const *pos = index_find(linenum);
  if (pos != NULL) {
    ;
    tokenizer_goto(pos);
  } else {
    ;
    jump_linenum_slow(linenum);
  }
}


x86 assembly (clang, -O0):
<jump_linenum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <index_find@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1160 <jump_linenum+0x30>
mov    -0x10(%rbp),%rdi
call   1030 <tokenizer_goto@plt>
jmp    1168 <jump_linenum+0x38>
mov    -0x4(%rbp),%edi
call   1050 <jump_linenum_slow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jump_linenum>:
push   %rbx
mov    %edi,%ebx
call   1040 <index_find@plt>
test   %rax,%rax
je     1146 <jump_linenum+0x16>
mov    %rax,%rdi
pop    %rbx
jmp    1030 <tokenizer_goto@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1050 <jump_linenum_slow@plt>

LLVM IR (-O0):
define void @jump_linenum(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @index_find(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i32 @tokenizer_goto(i8* %9)
br label %14
11: ; preds = %1
%12 = load i32, i32* %2
%13 = call i32 @jump_linenum_slow(i32 %12)
br label %14
14: ; preds = %11, %8
ret void
}

LLVM IR (-O2):
define void @jump_linenum(i32 %0) {
%2 = tail call i8* @index_find(i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @tokenizer_goto(i8* %2)
br label %8
6: ; preds = %1
%7 = tail call i32 @jump_linenum_slow(i32 %0)
br label %8
8: ; preds = %6, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _IOFBF;
int /*<<< orphan*/ delay(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ setvbuf(int /*<<< orphan*/, int /*<<< orphan*/ *,
                           int /*<<< orphan*/, int);
int /*<<< orphan*/ stdout;
int main() {
  setvbuf(stdout, NULL, _IOFBF, 5);
  printf("Hello, world!\n");
  delay(3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
mov    0x2e89(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
mov    $0x5,%ecx
call   1050 <setvbuf@plt>
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
mov    $0x3,%edi
call   1040 <delay@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
mov    0x2e97(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
mov    $0x5,%ecx
call   1050 <setvbuf@plt>
lea    0xeaa(%rip),%rdi
call   1030 <puts@plt>
mov    $0x3,%edi
call   1040 <delay@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdout = global i32 0
@_IOFBF = global i32 0
@.str = [15 x i8] c"Hello, world!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @stdout
%3 = load i32, i32* @_IOFBF
%4 = call i32 @setvbuf(i32 %2, i32* null, i32 %3, i32 5)
%5 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @delay(i32 3)
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@_IOFBF = global i32 0
@str = [14 x i8] c"Hello, world!\00"
define i32 @main() {
%1 = load i32, i32* @stdout
%2 = load i32, i32* @_IOFBF
%3 = tail call i32 @setvbuf(i32 %1, i32* null, i32 %2, i32 5)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @delay(i32 3)
ret i32 0
}
/* Variables and functions */
size_t strlen(char const *);
scalar_t__ strncasecmp(char const *, char const *, size_t);
bool katana_string_has_prefix(const char *str, const char *prefix) {
  size_t pre_len = strlen(prefix);
  size_t str_len = strlen(str);
  return pre_len <= str_len && strncasecmp(prefix, str, pre_len);
}


x86 assembly (clang, -O0):
<katana_string_has_prefix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rcx
xor    %eax,%eax
cmp    -0x20(%rbp),%rcx
mov    %al,-0x21(%rbp)
ja     1178 <katana_string_has_prefix+0x58>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <strncasecmp@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<katana_string_has_prefix>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %rax,%rbx
mov    %r15,%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rbx
ja     1161 <katana_string_has_prefix+0x41>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1040 <strncasecmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @katana_string_has_prefix(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%5 = icmp ugt i64 %3, %4
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = tail call i64 @strncasecmp(i8* %1, i8* %0, i64 %3)
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %2
%11 = phi i32 [ 0, %2 ], [ %9, %6 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int geteuid();
int getuid();
int /*<<< orphan*/ printf(char *, int, int);
int main(int argc, char **argv) {
  printf("real uid = %d, effective uid = %d\n", getuid(), geteuid());
  exit(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 <geteuid@plt>
mov    -0x14(%rbp),%esi
mov    %eax,%edx
lea    0xe8d(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <getuid@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <geteuid@plt>
lea    0xea8(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"real uid = %d, effective uid = %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 (...) @geteuid()
%8 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
%9 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [35 x i8] c"real uid = %d, effective uid = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @getuid()
%4 = tail call i32 (...) @geteuid()
%5 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
%6 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
struct sched_param {
  int dummy;
};
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int sched_setparam(pid_t pid, const struct sched_param *param) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<sched_setparam>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ed6(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebd(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sched_setparam>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.sched_param = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @sched_setparam(i32 %0, %struct.sched_param* %1) {
%3 = alloca i32
%4 = alloca %struct.sched_param*
store i32 %0, i32* %3
store %struct.sched_param* %1, %struct.sched_param** %4
%5 = load i32, i32* @ENOSYS
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
%struct.sched_param = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @sched_setparam(i32 %0, %struct.sched_param* nocapture readnone %1) {
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}
/* Type definitions */
typedef scalar_t__ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ panic(char *);
scalar_t__ read(int, char *, size_t);
ssize_t must_read(int fd, char *buf, size_t amt) {
  ssize_t did;
  did = read(fd, buf, amt);
  if (did < 0)
    panic("i/o error on input");
  return did;
}


x86 assembly (clang, -O0):
<must_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <read@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jge    115e <must_read+0x3e>
lea    0xea7(%rip),%rdi
call   1030 <panic@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<must_read>:
push   %rbx
call   1040 <read@plt>
mov    %rax,%rbx
test   %rax,%rax
jns    113a <must_read+0x1a>
lea    0xecb(%rip),%rdi
call   1030 <panic@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"i/o error on input\00"
define i64 @must_read(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = call i64 @read(i32 %8, i8* %9, i64 %10)
store i64 %11, i64* %7
%12 = load i64, i64* %7
%13 = icmp slt i64 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %3
%15 = call i32 @panic(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %16
16: ; preds = %14, %3
%17 = load i64, i64* %7
ret i64 %17
}

LLVM IR (-O2):
@.str = [19 x i8] c"i/o error on input\00"
define i64 @must_read(i32 %0, i8* nocapture %1, i64 %2) {
%4 = tail call i64 @read(i32 %0, i8* %1, i64 %2)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @panic(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret i64 %4
}
/* Type definitions */
struct forf_stack {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ forf_print_stack(struct forf_stack *);
int /*<<< orphan*/ printf(char *, ...);
void forf_dump_stack(struct forf_stack *s) {
  printf("Stack at %p: ", s);
  forf_print_stack(s);
  printf("\n");
}


x86 assembly (clang, -O0):
<forf_dump_stack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <forf_print_stack@plt>
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<forf_dump_stack>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1050 <forf_print_stack@plt>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

LLVM IR (-O0):
%struct.forf_stack = type { i32 }
@.str = [14 x i8] c"Stack at %p: \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @forf_dump_stack(%struct.forf_stack* %0) {
%2 = alloca %struct.forf_stack*
store %struct.forf_stack* %0, %struct.forf_stack** %2
%3 = load %struct.forf_stack*, %struct.forf_stack** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), %struct.forf_stack* %3)
%5 = load %struct.forf_stack*, %struct.forf_stack** %2
%6 = call i32 @forf_print_stack(%struct.forf_stack* %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.forf_stack = type { i32 }
@.str = [14 x i8] c"Stack at %p: \00"
define void @forf_dump_stack(%struct.forf_stack* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), %struct.forf_stack* %0)
%3 = tail call i32 @forf_print_stack(%struct.forf_stack* %0)
%4 = tail call i32 @putchar(i32 10)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ arr;

/* Variables and functions */
int /*<<< orphan*/ insert_sort(int *, int);
int /*<<< orphan*/ println(int *, int);
int main() {
  int arr[] = {43, 454, 23, 74, 32, 765, 1};
  int len = sizeof(arr) / sizeof(*arr);
  println(arr, len);
  insert_sort(arr, len);
  println(arr, len);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec2(%rip),%eax
mov    %eax,-0x8(%rbp)
movl   $0x7,-0x24(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1030 <println@plt>
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1040 <insert_sort@plt>
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1030 <println@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movups 0xee0(%rip),%xmm0
movups %xmm0,0xc(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x7,%esi
call   1030 <println@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
call   1040 <insert_sort@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
call   1030 <println@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.arr = [7 x i32] [i32 43, i32 454, i32 23, i32 74, i32 32, i32 765, i32 1]
define i32 @main() {
%1 = alloca i32
%2 = alloca [7 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [7 x i32]* %2 to i8*
store i32 7, i32* %3
%5 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 0
%6 = load i32, i32* %3
%7 = call i32 @println(i32* %5, i32 %6)
%8 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 0
%9 = load i32, i32* %3
%10 = call i32 @insert_sort(i32* %8, i32 %9)
%11 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 0
%12 = load i32, i32* %3
%13 = call i32 @println(i32* %11, i32 %12)
ret i32 0
}

LLVM IR (-O2):
@__const.main.arr = [7 x i32] [i32 43, i32 454, i32 23, i32 74, i32 32, i32 765, i32 1]
define i32 @main() {
%1 = alloca [7 x i32]
%2 = bitcast [7 x i32]* %1 to i8*
%3 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 0
%4 = call i32 @println(i32* %3, i32 7)
%5 = call i32 @insert_sort(i32* %3, i32 7)
%6 = call i32 @println(i32* %3, i32 7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ DrawLetter();
int /*<<< orphan*/ DrawLetterInfo();
int /*<<< orphan*/ DrawMailList();
int /*<<< orphan*/ DrawStatusBar();
int /*<<< orphan*/ InitTWB();
void DrawMailBox() {
  DrawMailList();
  DrawLetterInfo();
  InitTWB();
  DrawLetter();
  DrawStatusBar();
}


x86 assembly (clang, -O0):
<DrawMailBox>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1070 <DrawMailList@plt>
mov    $0x0,%al
call   1030 <DrawLetterInfo@plt>
mov    $0x0,%al
call   1050 <InitTWB@plt>
mov    $0x0,%al
call   1040 <DrawLetter@plt>
mov    $0x0,%al
call   1060 <DrawStatusBar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DrawMailBox>:
push   %rax
xor    %eax,%eax
call   1070 <DrawMailList@plt>
xor    %eax,%eax
call   1030 <DrawLetterInfo@plt>
xor    %eax,%eax
call   1050 <InitTWB@plt>
xor    %eax,%eax
call   1040 <DrawLetter@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <DrawStatusBar@plt>

LLVM IR (-O0):
define void @DrawMailBox() {
%1 = call i32 (...) @DrawMailList()
%2 = call i32 (...) @DrawLetterInfo()
%3 = call i32 (...) @InitTWB()
%4 = call i32 (...) @DrawLetter()
%5 = call i32 (...) @DrawStatusBar()
ret void
}

LLVM IR (-O2):
define void @DrawMailBox() {
%1 = tail call i32 (...) @DrawMailList()
%2 = tail call i32 (...) @DrawLetterInfo()
%3 = tail call i32 (...) @InitTWB()
%4 = tail call i32 (...) @DrawLetter()
%5 = tail call i32 (...) @DrawStatusBar()
ret void
}