xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ func();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ subdir1_func();
int /*<<< orphan*/ subdir2_func();
int main(int argc, char *argv[]) {
  printf("Hello from prog3.c\n");
  func();
  subdir1_func();
  subdir2_func();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xea3(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <func@plt>
mov    $0x0,%al
call   1030 <subdir1_func@plt>
mov    $0x0,%al
call   1050 <subdir2_func@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1060 <func@plt>
xor    %eax,%eax
call   1040 <subdir1_func@plt>
xor    %eax,%eax
call   1050 <subdir2_func@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Hello from prog3.c\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 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @func()
%8 = call i32 (...) @subdir1_func()
%9 = call i32 (...) @subdir2_func()
ret i32 0
}

LLVM IR (-O2):
@str = [19 x i8] c"Hello from prog3.c\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @func()
%5 = tail call i32 (...) @subdir1_func()
%6 = tail call i32 (...) @subdir2_func()
ret i32 0
}
/* Variables and functions */
int __get_array_size(char const *);
char *malloc(int);
char *strdup(const char *s) {
  int size;
  size = __get_array_size(s);
  return malloc(size);
}


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

x86 assembly (clang, -O2):
<strdup>:
push   %rax
call   1030 <__get_array_size@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @strdup(i8* %0) {
%2 = tail call i32 @__get_array_size(i8* %0)
%3 = tail call i8* @malloc(i32 %2)
ret i8* %3
}
int f(int m, int n) {
  int i;
  i = m;
  m = n;
  n = i;
  return m + n;
}


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

x86 assembly (clang, -O2):
<f>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @f(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
store i32 %6, i32* %5
%7 = load i32, i32* %4
store i32 %7, i32* %3
%8 = load i32, i32* %5
store i32 %8, i32* %4
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = add nsw i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
void RandomFunc(unsigned int input[1], unsigned int output[1]) {
  unsigned int state[1];
  unsigned int local2;
  unsigned int local1;
  {
    state[0UL] = (input[0UL] | 51238316UL) >> 3U;
    local1 = 0UL;
    while (local1 < 1UL) {
      local2 = 0UL;
      while (local2 < 1UL) {
        local2 += 2UL;
      }
      local1 += 2UL;
    }
    output[0UL] = state[0UL] | 238489436UL;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
or     $0x30dd5ac,%rax
shr    $0x3,%rax
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    $0x1,%rax
jae    1165 <RandomFunc+0x65>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    $0x1,%rax
jae    1156 <RandomFunc+0x56>
mov    -0x18(%rbp),%eax
add    $0x2,%rax
mov    %eax,-0x18(%rbp)
jmp    113a <RandomFunc+0x3a>
mov    -0x1c(%rbp),%eax
add    $0x2,%rax
mov    %eax,-0x1c(%rbp)
jmp    1126 <RandomFunc+0x26>
mov    -0x14(%rbp),%eax
or     $0xe370f5c,%rax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
mov    (%rdi),%eax
shr    $0x3,%eax
or     $0xe77bffd,%eax
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca [1 x i32]
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 0
%10 = load i32, i32* %9
%11 = zext i32 %10 to i64
%12 = or i64 %11, 51238316
%13 = lshr i64 %12, 3
%14 = trunc i64 %13 to i32
%15 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
store i32 %14, i32* %15
store i32 0, i32* %7
br label %16
16: ; preds = %30, %2
%17 = load i32, i32* %7
%18 = zext i32 %17 to i64
%19 = icmp ult i64 %18, 1
br i1 %19, label %20, label %35
20: ; preds = %16
store i32 0, i32* %6
br label %21
21: ; preds = %25, %20
%22 = load i32, i32* %6
%23 = zext i32 %22 to i64
%24 = icmp ult i64 %23, 1
br i1 %24, label %25, label %30
25: ; preds = %21
%26 = load i32, i32* %6
%27 = zext i32 %26 to i64
%28 = add i64 %27, 2
%29 = trunc i64 %28 to i32
store i32 %29, i32* %6
br label %21
30: ; preds = %21
%31 = load i32, i32* %7
%32 = zext i32 %31 to i64
%33 = add i64 %32, 2
%34 = trunc i64 %33 to i32
store i32 %34, i32* %7
br label %16
35: ; preds = %16
%36 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%37 = load i32, i32* %36
%38 = zext i32 %37 to i64
%39 = or i64 %38, 238489436
%40 = trunc i64 %39 to i32
%41 = load i32*, i32** %4
%42 = getelementptr inbounds i32, i32* %41, i64 0
store i32 %40, i32* %42
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* %0
%4 = lshr i32 %3, 3
%5 = or i32 %4, 242728957
store i32 %5, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ err_msg_out_of_memory();
void *realloc(void *, size_t);
__attribute__((warn_unused_result)) void *reallocx(void *o, size_t l) {
  void *m = realloc(o, l);
  if (m == NULL)
    err_msg_out_of_memory();
  return m;
}


x86 assembly (clang, -O0):
<reallocx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1153 <reallocx+0x33>
mov    $0x0,%al
call   1030 <err_msg_out_of_memory@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reallocx>:
push   %rbx
call   1040 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1135 <reallocx+0x15>
xor    %eax,%eax
call   1030 <err_msg_out_of_memory@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @reallocx(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 (...) @err_msg_out_of_memory()
br label %13
13: ; preds = %11, %2
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
define noalias i8* @reallocx(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @err_msg_out_of_memory()
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void die(char *msg) {
  fprintf(stderr, "%s\n", msg);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rax
mov    %rdi,%rdx
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>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@EXIT_FAILURE = global i32 0
define void @die(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
int Cyc_Core_charcmp(char a, char b) {
  char _T0;
  int _T1;
  char _T2;
  int _T3;
  int _T4;
  _T0 = a;
  _T1 = (int)_T0;
  _T2 = b;
  _T3 = (int)_T2;
  _T4 = _T1 - _T3;
  return _T4;
}


x86 assembly (clang, -O0):
<Cyc_Core_charcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    -0x1(%rbp),%al
mov    %al,-0x3(%rbp)
movsbl -0x3(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x2(%rbp),%al
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_Core_charcmp>:
mov    %edi,%eax
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @Cyc_Core_charcmp(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
%6 = alloca i32
%7 = alloca i8
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
%10 = load i8, i8* %3
store i8 %10, i8* %5
%11 = load i8, i8* %5
%12 = sext i8 %11 to i32
store i32 %12, i32* %6
%13 = load i8, i8* %4
store i8 %13, i8* %7
%14 = load i8, i8* %7
%15 = sext i8 %14 to i32
store i32 %15, i32* %8
%16 = load i32, i32* %6
%17 = load i32, i32* %8
%18 = sub nsw i32 %16, %17
store i32 %18, i32* %9
%19 = load i32, i32* %9
ret i32 %19
}

LLVM IR (-O2):
define i32 @Cyc_Core_charcmp(i8 signext %0, i8 signext %1) {
%3 = sext i8 %0 to i32
%4 = sext i8 %1 to i32
%5 = sub nsw i32 %3, %4
ret i32 %5
}
/* Variables and functions */
long double powl(long double, long);
long double cbrtl(long double x) { return powl(x, 1.L / 3.L); }


x86 assembly (clang, -O0):
<cbrtl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
xor    %eax,%eax
mov    %eax,%edi
call   1030 <powl@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbrtl>:
xor    %edi,%edi
jmp    1030 <powl@plt>

LLVM IR (-O0):
define x86_fp80 @cbrtl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call x86_fp80 @powl(x86_fp80 %3, i64 0)
ret x86_fp80 %4
}

LLVM IR (-O2):
define x86_fp80 @cbrtl(x86_fp80 %0) {
%2 = tail call x86_fp80 @powl(x86_fp80 %0, i64 0)
ret x86_fp80 %2
}
/* Variables and functions */
int EOF;
int /*<<< orphan*/ printf(char *, int);
main() { printf("The value of the constant EOF = %d\n", EOF); }


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

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

LLVM IR (-O0):
@.str = [36 x i8] c"The value of the constant EOF = %d\0A\00"
@EOF = global i32 0
define i32 @main() {
%1 = load i32, i32* @EOF
%2 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [36 x i8] c"The value of the constant EOF = %d\0A\00"
@EOF = global i32 0
define i32 @main() {
%1 = load i32, i32* @EOF
%2 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
scalar_t__ misc_seek(int, int /*<<< orphan*/);
int misc_write(int, void *, size_t);
int misc_pwrite(int fd, void *buf, size_t size, off_t off) {
  if (misc_seek(fd, off))
    return -1;
  return misc_write(fd, buf, size);
}


x86 assembly (clang, -O0):
<misc_pwrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x1c(%rbp),%esi
call   1030 <misc_seek@plt>
cmp    $0x0,%rax
je     1157 <misc_pwrite+0x37>
movl   $0xffffffff,-0x4(%rbp)
jmp    116a <misc_pwrite+0x4a>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <misc_write@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<misc_pwrite>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %ecx,%esi
call   1030 <misc_seek@plt>
test   %rax,%rax
je     1142 <misc_pwrite+0x22>
mov    $0xffffffff,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <misc_write@plt>

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

LLVM IR (-O2):
define i32 @misc_pwrite(i32 %0, i8* %1, i64 %2, i32 %3) {
%5 = tail call i64 @misc_seek(i32 %0, i32 %3)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @misc_write(i32 %0, i8* %1, i64 %2)
br label %9
9: ; preds = %4, %7
%10 = phi i32 [ %8, %7 ], [ -1, %4 ]
ret i32 %10
}
void test75_Test_targetInit__I() {}


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

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

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

LLVM IR (-O2):
define void @test75_Test_targetInit__I() {
ret void
}
int check_any(const unsigned long int value,
              const unsigned long int check_value_data) {
  (void)value;
  (void)check_value_data;
  return 1;
}


x86 assembly (clang, -O0):
<check_any>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @check_any(i64 %0, i64 %1) {
ret i32 1
}
/* Type definitions */
struct timespec {
  long tv_nsec;
  long long tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC_RAW;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
long getTimestampHP() {
  struct timespec ts;
  clock_gettime(CLOCK_MONOTONIC_RAW, &ts);
  return (ts.tv_nsec + ts.tv_sec * 1000000000LL);
}


x86 assembly (clang, -O0):
<getTimestampHP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
mov    -0x10(%rbp),%rax
imul   $0x3b9aca00,-0x8(%rbp),%rcx
3b
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getTimestampHP>:
sub    $0x18,%rsp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
imul   $0x3b9aca00,0x10(%rsp),%rax
9a 3b
add    0x8(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
@CLOCK_MONOTONIC_RAW = global i32 0
define i64 @getTimestampHP() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_MONOTONIC_RAW
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%5 = load i64, i64* %4
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%7 = load i64, i64* %6
%8 = mul nsw i64 %7, 1000000000
%9 = add nsw i64 %5, %8
ret i64 %9
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
@CLOCK_MONOTONIC_RAW = global i32 0
define i64 @getTimestampHP() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_MONOTONIC_RAW
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%6 = load i64, i64* %5
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%8 = load i64, i64* %7
%9 = mul nsw i64 %8, 1000000000
%10 = add nsw i64 %9, %6
ret i64 %10
}
/* Type definitions */
typedef scalar_t__ time_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
scalar_t__ time(int /*<<< orphan*/ *);
int main(void) {
  time_t t;
  t = time(NULL);
  printf("The number of seconds since January 1, 1970 is %d\n", (int)t);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [51 x i8] c"The number of seconds since January 1, 1970 is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
%3 = call i64 @time(i32* null)
store i64 %3, i64* %2
%4 = load i64, i64* %2
%5 = trunc i64 %4 to i32
%6 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [51 x i8] c"The number of seconds since January 1, 1970 is %d\0A\00"
define i32 @main() {
%1 = tail call i64 @time(i32* null)
%2 = trunc i64 %1 to i32
%3 = tail call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}
void clockevents_resume_events(void) {}


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

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

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

LLVM IR (-O2):
define void @clockevents_resume_events() {
ret void
}
/* Variables and functions */
unsigned char *xsalsa20_decrypt(unsigned char *, size_t *,
                                unsigned char const *, size_t,
                                unsigned char const *, unsigned char const *);
unsigned char *crypt_decrypt_xsalsa20(unsigned char *out, size_t *out_len,
                                      const unsigned char *in, size_t in_len,
                                      const unsigned char *nonce,
                                      const unsigned char *key) {
  return xsalsa20_decrypt(out, out_len, in, in_len, nonce, key);
}


x86 assembly (clang, -O0):
<crypt_decrypt_xsalsa20>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
call   1030 <xsalsa20_decrypt@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crypt_decrypt_xsalsa20>:
jmp    1030 <xsalsa20_decrypt@plt>

LLVM IR (-O0):
define i8* @crypt_decrypt_xsalsa20(i8* %0, i64* %1, i8* %2, i64 %3, i8* %4, i8* %5) {
%7 = alloca i8*
%8 = alloca i64*
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i8*
%12 = alloca i8*
store i8* %0, i8** %7
store i64* %1, i64** %8
store i8* %2, i8** %9
store i64 %3, i64* %10
store i8* %4, i8** %11
store i8* %5, i8** %12
%13 = load i8*, i8** %7
%14 = load i64*, i64** %8
%15 = load i8*, i8** %9
%16 = load i64, i64* %10
%17 = load i8*, i8** %11
%18 = load i8*, i8** %12
%19 = call i8* @xsalsa20_decrypt(i8* %13, i64* %14, i8* %15, i64 %16, i8* %17, i8* %18)
ret i8* %19
}

LLVM IR (-O2):
define i8* @crypt_decrypt_xsalsa20(i8* %0, i64* %1, i8* %2, i64 %3, i8* %4, i8* %5) {
%7 = tail call i8* @xsalsa20_decrypt(i8* %0, i64* %1, i8* %2, i64 %3, i8* %4, i8* %5)
ret i8* %7
}
int foo(int *x, int z, int *y) { return *x + z + *y; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
add    -0xc(%rbp),%eax
mov    -0x18(%rbp),%rcx
add    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    %esi,%eax
add    (%rdi),%eax
add    (%rdx),%eax
ret

LLVM IR (-O0):
define i32 @foo(i32* %0, i32 %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32*
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = load i32, i32* %5
%10 = add nsw i32 %8, %9
%11 = load i32*, i32** %6
%12 = load i32, i32* %11
%13 = add nsw i32 %10, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @foo(i32* nocapture %0, i32 %1, i32* nocapture %2) {
%4 = load i32, i32* %0
%5 = add nsw i32 %4, %1
%6 = load i32, i32* %2
%7 = add nsw i32 %5, %6
ret i32 %7
}
long arch_calledby(long xt) {
  long t = *(long *)xt;
  t &= 0x3ffffffc;
  t <<= 6;
  t >>= 6;
  t += xt;
  return t;
}


x86 assembly (clang, -O0):
<arch_calledby>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0x3ffffffc,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x6,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
sar    $0x6,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<arch_calledby>:
mov    (%rdi),%rax
and    $0x3ffffffc,%eax
add    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @arch_calledby(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = inttoptr i64 %4 to i64*
%6 = load i64, i64* %5
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = and i64 %7, 1073741820
store i64 %8, i64* %3
%9 = load i64, i64* %3
%10 = shl i64 %9, 6
store i64 %10, i64* %3
%11 = load i64, i64* %3
%12 = ashr i64 %11, 6
store i64 %12, i64* %3
%13 = load i64, i64* %2
%14 = load i64, i64* %3
%15 = add nsw i64 %14, %13
store i64 %15, i64* %3
%16 = load i64, i64* %3
ret i64 %16
}

LLVM IR (-O2):
define i64 @arch_calledby(i64 %0) {
%2 = inttoptr i64 %0 to i64*
%3 = load i64, i64* %2
%4 = and i64 %3, 1073741820
%5 = add nsw i64 %4, %0
ret i64 %5
}
/* Variables and functions */
int abs(int);
int gcd(int a, int b) {
  int x, y, z;
  x = abs(a);
  y = abs(b);
  while (x > 0) {
    z = y % x;
    y = x;
    x = z;
  }
  return y;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1159 <gcd+0x49>
mov    -0x10(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1134 <gcd+0x24>
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %esi,%eax
neg    %eax
cmovs  %esi,%eax
test   %edi,%edi
je     112e <gcd+0x2e>
mov    %edi,%edx
neg    %edx
cmovs  %edi,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %edx,%ecx
xor    %edx,%edx
div    %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1120 <gcd+0x20>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = tail call i32 @llvm.abs.i32(i32 %1, i1 true)
%4 = icmp eq i32 %0, 0
br i1 %4, label %12, label %5
5: ; preds = %2
%6 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
br label %7
7: ; preds = %5, %7
%8 = phi i32 [ %10, %7 ], [ %6, %5 ]
%9 = phi i32 [ %8, %7 ], [ %3, %5 ]
%10 = urem i32 %9, %8
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %7
12: ; preds = %7, %2
%13 = phi i32 [ %3, %2 ], [ %8, %7 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ add_Byte(void *, int, int);
int /*<<< orphan*/ keccakP400NRounds(void *, int);
void Ketje_step(void *state, int block_size, unsigned char padding) {
  add_Byte(state, padding, block_size);
  add_Byte(state, 0x08, 4);
  keccakP400NRounds(state, 1);
}


x86 assembly (clang, -O0):
<Ketje_step>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rdi
movzbl -0xd(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1040 <add_Byte@plt>
mov    -0x8(%rbp),%rdi
mov    $0x8,%esi
mov    $0x4,%edx
call   1040 <add_Byte@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1030 <keccakP400NRounds@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Ketje_step>:
push   %rbx
mov    %esi,%eax
mov    %rdi,%rbx
mov    %edx,%esi
mov    %eax,%edx
call   1040 <add_Byte@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
mov    $0x4,%edx
call   1040 <add_Byte@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
pop    %rbx
jmp    1030 <keccakP400NRounds@plt>

LLVM IR (-O0):
define void @Ketje_step(i8* %0, i32 %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8 %2, i8* %6
%7 = load i8*, i8** %4
%8 = load i8, i8* %6
%9 = zext i8 %8 to i32
%10 = load i32, i32* %5
%11 = call i32 @add_Byte(i8* %7, i32 %9, i32 %10)
%12 = load i8*, i8** %4
%13 = call i32 @add_Byte(i8* %12, i32 8, i32 4)
%14 = load i8*, i8** %4
%15 = call i32 @keccakP400NRounds(i8* %14, i32 1)
ret void
}

LLVM IR (-O2):
define void @Ketje_step(i8* %0, i32 %1, i8 zeroext %2) {
%4 = zext i8 %2 to i32
%5 = tail call i32 @add_Byte(i8* %0, i32 %4, i32 %1)
%6 = tail call i32 @add_Byte(i8* %0, i32 8, i32 4)
%7 = tail call i32 @keccakP400NRounds(i8* %0, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Cmd_RemoveCommand(char *);
int /*<<< orphan*/ NET_Config(int /*<<< orphan*/);
void NET_Shutdown(void) {
  NET_Config(0);
  Cmd_RemoveCommand("net_restart");
}


x86 assembly (clang, -O0):
<NET_Shutdown>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <NET_Config@plt>
lea    0xece(%rip),%rdi
call   1040 <Cmd_RemoveCommand@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<NET_Shutdown>:
push   %rax
xor    %edi,%edi
call   1030 <NET_Config@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1040 <Cmd_RemoveCommand@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"net_restart\00"
define void @NET_Shutdown() {
%1 = call i32 @NET_Config(i32 0)
%2 = call i32 @Cmd_RemoveCommand(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"net_restart\00"
define void @NET_Shutdown() {
%1 = tail call i32 @NET_Config(i32 0)
%2 = tail call i32 @Cmd_RemoveCommand(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_cond_t;

/* Variables and functions */
int /*<<< orphan*/ _unsupported();
int pthread_cond_destroy(pthread_cond_t *cond) {
  _unsupported();
  return -1;
}


x86 assembly (clang, -O0):
<pthread_cond_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <_unsupported@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_cond_destroy>:
push   %rax
xor    %eax,%eax
call   1030 <_unsupported@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @pthread_cond_destroy(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 (...) @_unsupported()
ret i32 -1
}

LLVM IR (-O2):
define i32 @pthread_cond_destroy(i32* nocapture readnone %0) {
%2 = tail call i32 (...) @_unsupported()
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ KDSETLED;
int ioctl(int, int /*<<< orphan*/, long);
int set_leds(int console, long int state) {
  return ioctl(console, KDSETLED, state & 7);
}


x86 assembly (clang, -O0):
<set_leds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb7(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
and    $0x7,%rdx
call   1030 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_leds>:
mov    %rsi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%esi
and    $0x7,%edx
jmp    1030 <ioctl@plt>

LLVM IR (-O0):
@KDSETLED = global i32 0
define i32 @set_leds(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%5 = load i32, i32* %3
%6 = load i32, i32* @KDSETLED
%7 = load i64, i64* %4
%8 = and i64 %7, 7
%9 = call i32 @ioctl(i32 %5, i32 %6, i64 %8)
ret i32 %9
}

LLVM IR (-O2):
@KDSETLED = global i32 0
define i32 @set_leds(i32 %0, i64 %1) {
%3 = load i32, i32* @KDSETLED
%4 = and i64 %1, 7
%5 = tail call i32 @ioctl(i32 %0, i32 %3, i64 %4)
ret i32 %5
}
/* Type definitions */
typedef unsigned long uint32_t;

/* Variables and functions */
void ComparatorRefSet(uint32_t ui32Base, uint32_t ui32Ref) {
  ;
  (*((volatile unsigned long *)(ui32Base + 0x00000010))) = ui32Ref;
}


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

x86 assembly (clang, -O2):
<ComparatorRefSet>:
mov    %rsi,0x10(%rdi)
ret

LLVM IR (-O0):
define void @ComparatorRefSet(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add i64 %6, 16
%8 = inttoptr i64 %7 to i64*
store volatile i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @ComparatorRefSet(i64 %0, i64 %1) {
%3 = add i64 %0, 16
%4 = inttoptr i64 %3 to i64*
store volatile i64 %1, i64* %4
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t hash_32(uint32_t val, unsigned int bits) {
  uint32_t hash = val * 0x9e370001UL;
  return hash >> (32 - bits);
}


x86 assembly (clang, -O0):
<hash_32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movslq -0x4(%rbp),%rax
movabs $0x9e370001,%rcx
imul   %rcx,%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
sar    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_32>:
mov    %esi,%ecx
imul   $0x9e370001,%edi,%eax
neg    %cl
sar    %cl,%eax
ret

LLVM IR (-O0):
define i32 @hash_32(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = mul i64 %7, 2654404609
%9 = trunc i64 %8 to i32
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = load i32, i32* %4
%12 = sub i32 32, %11
%13 = ashr i32 %10, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @hash_32(i32 %0, i32 %1) {
%3 = mul i32 %0, -1640562687
%4 = sub i32 32, %1
%5 = ashr i32 %3, %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ error(int, int /*<<< orphan*/, char *, char const *);
void badfieldspec(const char *s) {
  error(2, 0, "invalid field specification `%s'", s);
}


x86 assembly (clang, -O0):
<badfieldspec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x2,%edi
xor    %esi,%esi
lea    0xed2(%rip),%rdx
call   1030 <error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<badfieldspec>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdx
mov    $0x2,%edi
xor    %esi,%esi
jmp    1030 <error@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"invalid field specification `%s'\00"
define void @badfieldspec(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @error(i32 2, i32 0, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"invalid field specification `%s'\00"
define void @badfieldspec(i8* %0) {
%2 = tail call i32 @error(i32 2, i32 0, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ptr_glPushMatrix();
extern void glPushMatrix(void) { ptr_glPushMatrix(); }


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

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

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

LLVM IR (-O2):
define void @glPushMatrix() {
%1 = tail call i32 (...) @ptr_glPushMatrix()
ret void
}
/* Variables and functions */
char *strrchr(char const *, char);
const char *Com_SkipPath(const char *pathname) {
  char const *const last = strrchr(pathname, '/');
  return last ? last + 1 : pathname;
}


x86 assembly (clang, -O0):
<Com_SkipPath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114a <Com_SkipPath+0x3a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1152 <Com_SkipPath+0x42>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Com_SkipPath>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @Com_SkipPath(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i8 signext 47)
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 = getelementptr inbounds i8, i8* %9, i64 1
br label %13
11: ; preds = %1
%12 = load i8*, i8** %2
br label %13
13: ; preds = %11, %8
%14 = phi i8* [ %10, %8 ], [ %12, %11 ]
ret i8* %14
}

LLVM IR (-O2):
define i8* @Com_SkipPath(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ yyerror(char *, int, int, int);
void range_check_char(int val, int min, int max) {
  if ((val < min) || (val > max))
    yyerror("value '%c' out of range ['%c', '%c']", val, min, max);
}


x86 assembly (clang, -O0):
<range_check_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     1139 <range_check_char+0x29>
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    114e <range_check_char+0x3e>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xeb7(%rip),%rdi
call   1030 <yyerror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<range_check_char>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
cmp    %edx,%edi
jl     111f <range_check_char+0xf>
cmp    %ecx,%esi
jg     111f <range_check_char+0xf>
ret
lea    0xeda(%rip),%rdi
jmp    1030 <yyerror@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"value '%c' out of range ['%c', '%c']\00"
define void @range_check_char(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = icmp slt i32 %7, %8
br i1 %9, label %14, label %10
10: ; preds = %3
%11 = load i32, i32* %4
%12 = load i32, i32* %6
%13 = icmp sgt i32 %11, %12
br i1 %13, label %14, label %19
14: ; preds = %10, %3
%15 = load i32, i32* %4
%16 = load i32, i32* %5
%17 = load i32, i32* %6
%18 = call i32 @yyerror(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %15, i32 %16, i32 %17)
br label %19
19: ; preds = %14, %10
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"value '%c' out of range ['%c', '%c']\00"
define void @range_check_char(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
%5 = icmp sgt i32 %0, %2
%6 = or i1 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 @yyerror(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %2)
br label %9
9: ; preds = %3, %7
ret void
}
int suit(c)
char c;
{
  switch (c) {
  case 'H':
    return 0;
    break;
  case 'D':
    return 1;
    break;
  case 'C':
    return 2;
    break;
  case 'S':
    return 3;
    break;
  default:
    return -1;
    break;
  }
}


x86 assembly (clang, -O0):
<suit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
add    $0xffffffbd,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x10,%eax
ja     1164 <suit+0x64>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x0,-0x4(%rbp)
jmp    116b <suit+0x6b>
movl   $0x1,-0x4(%rbp)
jmp    116b <suit+0x6b>
movl   $0x2,-0x4(%rbp)
jmp    116b <suit+0x6b>
movl   $0x3,-0x4(%rbp)
jmp    116b <suit+0x6b>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<suit>:
movsbl %dil,%ecx
add    $0xffffffbd,%ecx
cmp    $0x10,%ecx
ja     112a <suit+0x2a>
xor    %eax,%eax
lea    0xeeb(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
mov    $0x2,%eax
ret
mov    $0x1,%eax
ret
mov    $0xffffffff,%eax
ret
mov    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @suit(i32 %0) {
%2 = alloca i32
%3 = alloca i8
%4 = trunc i32 %0 to i8
store i8 %4, i8* %3
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
switch i32 %6, label %11 [
i32 72, label %7
i32 68, label %8
i32 67, label %9
i32 83, label %10
]
7: ; preds = %1
store i32 0, i32* %2
br label %12
8: ; preds = %1
store i32 1, i32* %2
br label %12
9: ; preds = %1
store i32 2, i32* %2
br label %12
10: ; preds = %1
store i32 3, i32* %2
br label %12
11: ; preds = %1
store i32 -1, i32* %2
br label %12
12: ; preds = %11, %10, %9, %8, %7
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @suit(i32 %0) {
%2 = shl i32 %0, 24
%3 = ashr exact i32 %2, 24
switch i32 %3, label %7 [
i32 72, label %8
i32 68, label %4
i32 67, label %5
i32 83, label %6
]
4: ; preds = %1
br label %8
5: ; preds = %1
br label %8
6: ; preds = %1
br label %8
7: ; preds = %1
br label %8
8: ; preds = %1, %7, %6, %5, %4
%9 = phi i32 [ -1, %7 ], [ 3, %6 ], [ 2, %5 ], [ 1, %4 ], [ 0, %1 ]
ret i32 %9
}
void nonzeroMemsetf32() {
  float arr[9] = {
      0x1.cacacap+75, 0x1.cacacap+75, 0x1.cacacap+75,
      0x1.cacacap+75, 0x1.cacacap+75, 0x1.cacacap+75,
      0x1.cacacap+75, 0x1.cacacap+75, 0x1.cacacap+75,
  };
}


x86 assembly (clang, -O0):
<nonzeroMemsetf32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
mov    $0x65,%esi
mov    $0x24,%edx
call   1030 <memset@plt>
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @nonzeroMemsetf32() {
%1 = alloca [9 x float]
%2 = bitcast [9 x float]* %1 to i8*
ret void
}

LLVM IR (-O2):
define void @nonzeroMemsetf32() {
ret void
}
void rcu_enter_nohz(void) {}


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

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

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

LLVM IR (-O2):
define void @rcu_enter_nohz() {
ret void
}
unsigned int vcmpeq2(unsigned int a, unsigned int b) {
  unsigned int r, c;
  r = a ^ b;
  c = r | 0x80008000;
  r = r ^ c;
  c = c - 0x00010001;
  c = r & ~c;
  r = c >> 15;
  r = c - r;
  r = c | r;
  return r;
}


x86 assembly (clang, -O0):
<vcmpeq2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
or     $0x80008000,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
sub    $0x10001,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
shr    $0xf,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vcmpeq2>:
xor    %esi,%edi
mov    %edi,%eax
or     $0x80008000,%eax
xor    %eax,%edi
mov    $0x10000,%ecx
sub    %eax,%ecx
and    %edi,%ecx
mov    %ecx,%edx
shr    $0xf,%edx
mov    %ecx,%eax
sub    %edx,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @vcmpeq2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = xor i32 %7, %8
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = or i32 %10, -2147450880
store i32 %11, i32* %6
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = xor i32 %12, %13
store i32 %14, i32* %5
%15 = load i32, i32* %6
%16 = sub i32 %15, 65537
store i32 %16, i32* %6
%17 = load i32, i32* %5
%18 = load i32, i32* %6
%19 = xor i32 %18, -1
%20 = and i32 %17, %19
store i32 %20, i32* %6
%21 = load i32, i32* %6
%22 = lshr i32 %21, 15
store i32 %22, i32* %5
%23 = load i32, i32* %6
%24 = load i32, i32* %5
%25 = sub i32 %23, %24
store i32 %25, i32* %5
%26 = load i32, i32* %6
%27 = load i32, i32* %5
%28 = or i32 %26, %27
store i32 %28, i32* %5
%29 = load i32, i32* %5
ret i32 %29
}

LLVM IR (-O2):
define i32 @vcmpeq2(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
%4 = or i32 %3, -2147450880
%5 = xor i32 %4, %3
%6 = sub i32 65536, %4
%7 = and i32 %5, %6
%8 = lshr i32 %7, 15
%9 = sub i32 %7, %8
%10 = or i32 %9, %7
ret i32 %10
}
void CGhostBusterRay_OnInitClass(void) {}


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

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

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

LLVM IR (-O2):
define void @CGhostBusterRay_OnInitClass() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ my_expand(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
main() {
  char a[100], b[100];
  char c[100], d[100];
  gets(c);
  my_expand(c, d);
  printf("my_expanded resulted %s\n", d);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1c0,%rsp
lea    -0x150(%rbp),%rdi
call   1050 <gets@plt>
lea    -0x150(%rbp),%rdi
lea    -0x1c0(%rbp),%rsi
call   1030 <my_expand@plt>
lea    -0x1c0(%rbp),%rsi
lea    0xe98(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x1c0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0xd8,%rsp
lea    0x70(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <gets@plt>
mov    %rsp,%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <my_expand@plt>
lea    0xea4(%rip),%rdi
mov    %r14,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xd8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [25 x i8] c"my_expanded resulted %s\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = alloca [100 x i8]
%3 = alloca [100 x i8]
%4 = alloca [100 x i8]
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%6 = call i32 @gets(i8* %5)
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%9 = call i32 @my_expand(i8* %7, i8* %8)
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%11 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"my_expanded resulted %s\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%5 = call i32 @gets(i8* %3)
%6 = call i32 @my_expand(i8* %3, i8* %4)
%7 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0x46() {
  Assert_real((iscntrl(70) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_iscntrl.c",
              355, ("iscntrl should be 0 for F"));
}


x86 assembly (clang, -O0):
<t_iscntrl_0x46>:
push   %rbp
mov    %rsp,%rbp
mov    $0x46,%edi
call   1030 <iscntrl@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x163,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_iscntrl_0x46>:
push   %rax
mov    $0x46,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x163,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for F\00"
define void @t_iscntrl_0x46() {
%1 = call i64 @iscntrl(i32 70)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 355, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for F\00"
define void @t_iscntrl_0x46() {
%1 = tail call i64 @iscntrl(i32 70)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 355, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}