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

/* Variables and functions */
int /*<<< orphan*/ *wscnchr(int /*<<< orphan*/ const *, int /*<<< orphan*/,
                            size_t);
size_t wsccnlen(const wchar_t *string, wchar_t stop, size_t maxlen) {
  const wchar_t *end = wscnchr(string, stop, maxlen);
  return end ? (size_t)(end - string) : maxlen;
}


x86 assembly (clang, -O0):
<wsccnlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <wscnchr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     115a <wsccnlen+0x4a>
mov    -0x20(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
sar    $0x2,%rax
mov    %rax,-0x28(%rbp)
jmp    1162 <wsccnlen+0x52>
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wsccnlen>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
call   1030 <wscnchr@plt>
mov    %rax,%rcx
sub    %rbx,%rcx
sar    $0x2,%rcx
test   %rax,%rax
cmove  %r14,%rcx
mov    %rcx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @wsccnlen(i32* %0, i32 %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i64
%7 = alloca i32*
store i32* %0, i32** %4
store i32 %1, i32* %5
store i64 %2, i64* %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %5
%10 = load i64, i64* %6
%11 = call i32* @wscnchr(i32* %8, i32 %9, i64 %10)
store i32* %11, i32** %7
%12 = load i32*, i32** %7
%13 = icmp ne i32* %12, null
br i1 %13, label %14, label %21
14: ; preds = %3
%15 = load i32*, i32** %7
%16 = load i32*, i32** %4
%17 = ptrtoint i32* %15 to i64
%18 = ptrtoint i32* %16 to i64
%19 = sub i64 %17, %18
%20 = sdiv exact i64 %19, 4
br label %23
21: ; preds = %3
%22 = load i64, i64* %6
br label %23
23: ; preds = %21, %14
%24 = phi i64 [ %20, %14 ], [ %22, %21 ]
ret i64 %24
}

LLVM IR (-O2):
define i64 @wsccnlen(i32* %0, i32 %1, i64 %2) {
%4 = tail call i32* @wscnchr(i32* %0, i32 %1, i64 %2)
%5 = icmp eq i32* %4, null
%6 = ptrtoint i32* %4 to i64
%7 = ptrtoint i32* %0 to i64
%8 = sub i64 %6, %7
%9 = ashr exact i64 %8, 2
%10 = select i1 %5, i64 %2, i64 %9
ret i64 %10
}
int mus_wav_fadeout_stop(int ch) {
  printf("%s not implemented\n", __func__);
  return (-1);
}


x86 assembly (clang, -O0):
<mus_wav_fadeout_stop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
lea    0xeeb(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mus_wav_fadeout_stop>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xef5(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"%s not implemented\0A\00"
@__func__.mus_wav_fadeout_stop = [21 x i8] c"mus_wav_fadeout_stop\00"
define i32 @mus_wav_fadeout_stop(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @__func__.mus_wav_fadeout_stop, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@.str = [20 x i8] c"%s not implemented\0A\00"
@__func__.mus_wav_fadeout_stop = [21 x i8] c"mus_wav_fadeout_stop\00"
define i32 @mus_wav_fadeout_stop(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @__func__.mus_wav_fadeout_stop, i64 0, i64 0))
ret i32 -1
}
void genc_eq_d() {}


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

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

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

LLVM IR (-O2):
define void @genc_eq_d() {
ret void
}
int test_imm_90int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x90 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_90int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 9437184
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void avio_protocol_get_class() {}


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

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

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

LLVM IR (-O2):
define void @avio_protocol_get_class() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ x_msg(int, char *, char const *);
void platform_chroot(const char *path) {
  if (path) {
    x_msg((1 << 4),
          "Sorry but I can't chroot to '%s' because this operating system "
          "doesn't appear to support the chroot() system call",
          path);
  }
}


x86 assembly (clang, -O0):
<platform_chroot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113c <platform_chroot+0x2c>
mov    -0x8(%rbp),%rdx
mov    $0x10,%edi
lea    0xec9(%rip),%rsi
call   1030 <x_msg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<platform_chroot>:
test   %rdi,%rdi
je     1129 <platform_chroot+0x19>
mov    %rdi,%rdx
lea    0xee1(%rip),%rsi
mov    $0x10,%edi
jmp    1030 <x_msg@plt>
ret

LLVM IR (-O0):
@.str = [114 x i8] c"Sorry but I can't chroot to '%s' because this operating system doesn't appear to support the chroot() system call\00"
define void @platform_chroot(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @x_msg(i32 16, i8* getelementptr inbounds ([114 x i8], [114 x i8]* @.str, i64 0, i64 0), i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
@.str = [114 x i8] c"Sorry but I can't chroot to '%s' because this operating system doesn't appear to support the chroot() system call\00"
define void @platform_chroot(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @x_msg(i32 16, i8* getelementptr inbounds ([114 x i8], [114 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
void XCheckTypedWindowEvent() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int nl_sendgetaddr_do(int, int /*<<< orphan*/, int /*<<< orphan*/, int,
                      int /*<<< orphan*/, int);
int nl_sendgetaddr4(int fd, uint32_t seq, uint32_t ifindex) {
  return nl_sendgetaddr_do(fd, seq, ifindex, 1, AF_INET, 1);
}


x86 assembly (clang, -O0):
<nl_sendgetaddr4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    0x2eb7(%rip),%rax
mov    (%rax),%r8d
mov    $0x1,%r9d
mov    %r9d,%ecx
call   1030 <nl_sendgetaddr_do@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nl_sendgetaddr4>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%r8d
mov    $0x1,%ecx
mov    $0x1,%r9d
jmp    1030 <nl_sendgetaddr_do@plt>

LLVM IR (-O0):
@AF_INET = global i32 0
define i32 @nl_sendgetaddr4(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 = load i32, i32* %6
%10 = load i32, i32* @AF_INET
%11 = call i32 @nl_sendgetaddr_do(i32 %7, i32 %8, i32 %9, i32 1, i32 %10, i32 1)
ret i32 %11
}

LLVM IR (-O2):
@AF_INET = global i32 0
define i32 @nl_sendgetaddr4(i32 %0, i32 %1, i32 %2) {
%4 = load i32, i32* @AF_INET
%5 = tail call i32 @nl_sendgetaddr_do(i32 %0, i32 %1, i32 %2, i32 1, i32 %4, i32 1)
ret i32 %5
}
/* Type definitions */
struct timespec {
  int tv_sec;
  long tv_nsec;
};

/* Variables and functions */
long int getTimeInNanos(struct timespec t) {
  return t.tv_sec * 1000000000 + t.tv_nsec;
}


x86 assembly (clang, -O0):
<getTimeInNanos>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x10(%rbp)
mov    %rsi,-0x8(%rbp)
imul   $0x3b9aca00,-0x10(%rbp),%eax
cltq
add    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getTimeInNanos>:
imul   $0x3b9aca00,%edi,%eax
cltq
add    %rsi,%rax
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i64 }
define i64 @getTimeInNanos(i32 %0, i64 %1) {
%3 = alloca %struct.timespec
%4 = bitcast %struct.timespec* %3 to { i32, i64 }*
%5 = getelementptr inbounds { i32, i64 }, { i32, i64 }* %4, i32 0, i32 0
store i32 %0, i32* %5
%6 = getelementptr inbounds { i32, i64 }, { i32, i64 }* %4, i32 0, i32 1
store i64 %1, i64* %6
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%8 = load i32, i32* %7
%9 = mul nsw i32 %8, 1000000000
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
%12 = load i64, i64* %11
%13 = add nsw i64 %10, %12
ret i64 %13
}

LLVM IR (-O2):
define i64 @getTimeInNanos(i32 %0, i64 %1) {
%3 = mul nsw i32 %0, 1000000000
%4 = sext i32 %3 to i64
%5 = add nsw i64 %4, %1
ret i64 %5
}
/* Variables and functions */
char *iposix_path_abspath_u(char const *, char *, int);
char *iposix_path_abspath(const char *srcpath, char *path, int maxsize) {
  return iposix_path_abspath_u(srcpath, path, maxsize);
}


x86 assembly (clang, -O0):
<iposix_path_abspath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <iposix_path_abspath_u@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iposix_path_abspath>:
jmp    1030 <iposix_path_abspath_u@plt>

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

LLVM IR (-O2):
define i8* @iposix_path_abspath(i8* %0, i8* %1, i32 %2) {
%4 = tail call i8* @iposix_path_abspath_u(i8* %0, i8* %1, i32 %2)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ sprintf(char *, char *, int /*<<< orphan*/, int, int);
void display_version(void) {
  char str[32];
  sprintf(str,
          "queenbee"
          " version %d.%d.%d",
          0, 2, 2);
  puts(str);
}


x86 assembly (clang, -O0):
<display_version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x20(%rbp),%rdi
lea    0xecd(%rip),%rsi
xor    %edx,%edx
mov    $0x2,%r8d
mov    %r8d,%ecx
call   1040 <sprintf@plt>
lea    -0x20(%rbp),%rdi
call   1030 <puts@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_version>:
push   %rbx
sub    $0x20,%rsp
lea    0xed4(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %edx,%edx
mov    $0x2,%ecx
mov    $0x2,%r8d
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"queenbee version %d.%d.%d\00"
define void @display_version() {
%1 = alloca [32 x i8]
%2 = getelementptr inbounds [32 x i8], [32 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 0, i32 2, i32 2)
%4 = getelementptr inbounds [32 x i8], [32 x i8]* %1, i64 0, i64 0
%5 = call i32 @puts(i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"queenbee version %d.%d.%d\00"
define void @display_version() {
%1 = alloca [32 x i8]
%2 = getelementptr inbounds [32 x i8], [32 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 0, i32 2, i32 2)
%4 = call i32 @puts(i8* %2)
ret void
}
int main() { int y = 7; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x7,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void gtk_window_set_focus_on_map() {}


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

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

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

LLVM IR (-O2):
define void @gtk_window_set_focus_on_map() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ c();
int /*<<< orphan*/ printf(char *);
int main() {
  c();
  printf("done.\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [6 x i8] c"done.\00"
define i32 @main() {
%1 = tail call i32 (...) @c()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void foo792(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo792(i32 %0) {
ret void
}
/* Variables and functions */
int isPrime(int);
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ solutDivisor(int);
int main() {
  int n;
  scanf("%d", &n);
  if (isPrime(n) == 1) {
    printf("%d=%d", n, n);
  } else {
    solutDivisor(n);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xead(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1050 <isPrime@plt>
cmp    $0x1,%eax
jne    1187 <main+0x47>
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xe83(%rip),%rdi
call   1040 <printf@plt>
jmp    118f <main+0x4f>
mov    -0x8(%rbp),%edi
call   1030 <solutDivisor@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xebb(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%edi
call   1050 <isPrime@plt>
mov    0x4(%rsp),%edx
cmp    $0x1,%eax
jne    1174 <main+0x34>
lea    0xe95(%rip),%rdi
mov    %edx,%esi
call   1040 <printf@plt>
jmp    117b <main+0x3b>
mov    %edx,%edi
call   1030 <solutDivisor@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [6 x i8] c"%d=%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = call i32 @isPrime(i32 %4)
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %11
7: ; preds = %0
%8 = load i32, i32* %2
%9 = load i32, i32* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %8, i32 %9)
br label %14
11: ; preds = %0
%12 = load i32, i32* %2
%13 = call i32 @solutDivisor(i32 %12)
br label %14
14: ; preds = %11, %7
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [6 x i8] c"%d=%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @isPrime(i32 %4)
%6 = icmp eq i32 %5, 1
%7 = load i32, i32* %1
br i1 %6, label %8, label %10
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %7, i32 %7)
br label %12
10: ; preds = %0
%11 = call i32 @solutDivisor(i32 %7)
br label %12
12: ; preds = %10, %8
ret i32 0
}
float lerp(float a, float b, float f) { return (b - a) * f + a; }


x86 assembly (clang, -O0):
<lerp>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
subss  -0x4(%rbp),%xmm0
movss  -0xc(%rbp),%xmm2
movss  -0x4(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<lerp>:
subss  %xmm0,%xmm1
mulss  %xmm2,%xmm1
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @lerp(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %5
%8 = load float, float* %4
%9 = fsub float %7, %8
%10 = load float, float* %6
%11 = load float, float* %4
%12 = call float @llvm.fmuladd.f32(float %9, float %10, float %11)
ret float %12
}

LLVM IR (-O2):
define float @lerp(float %0, float %1, float %2) {
%4 = fsub float %1, %0
%5 = tail call float @llvm.fmuladd.f32(float %4, float %2, float %0)
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void insert() { printf("\ninsertion completed, thank you\n"); }


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

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

LLVM IR (-O0):
@.str = [33 x i8] c"\0Ainsertion completed, thank you\0A\00"
define void @insert() {
%1 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [32 x i8] c"\0Ainsertion completed, thank you\00"
define void @insert() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lua_check_number(int, char *);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
void math_randomseed(void) { srand(lua_check_number(1, "randomseed")); }


x86 assembly (clang, -O0):
<math_randomseed>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xed0(%rip),%rsi
call   1030 <lua_check_number@plt>
mov    %eax,%edi
call   1040 <srand@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<math_randomseed>:
push   %rax
lea    0xed8(%rip),%rsi
mov    $0x1,%edi
call   1030 <lua_check_number@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <srand@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"randomseed\00"
define void @math_randomseed() {
%1 = call i32 @lua_check_number(i32 1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @srand(i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"randomseed\00"
define void @math_randomseed() {
%1 = tail call i32 @lua_check_number(i32 1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @srand(i32 %1)
ret void
}
int event_pending(const struct event *ev, short events, struct timeval *tv) {
  (void)ev;
  (void)events;
  (void)tv;
  return 0;
}


x86 assembly (clang, -O0):
<event_pending>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.event = type opaque
%struct.timeval = type opaque
define i32 @event_pending(%struct.event* %0, i16 signext %1, %struct.timeval* %2) {
%4 = alloca %struct.event*
%5 = alloca i16
%6 = alloca %struct.timeval*
store %struct.event* %0, %struct.event** %4
store i16 %1, i16* %5
store %struct.timeval* %2, %struct.timeval** %6
%7 = load %struct.event*, %struct.event** %4
%8 = load i16, i16* %5
%9 = load %struct.timeval*, %struct.timeval** %6
ret i32 0
}

LLVM IR (-O2):
%struct.event = type opaque
%struct.timeval = type opaque
define i32 @event_pending(%struct.event* nocapture readnone %0, i16 signext %1, %struct.timeval* nocapture readnone %2) {
ret i32 0
}
/* Variables and functions */
int matche(char *, char *);
int match(char *p, char *t) {
  int error_type;
  error_type = matche(p, t);
  return (error_type == 1) ? 1 : 0;
}


x86 assembly (clang, -O0):
<match>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <matche@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x1,%edx
cmove  %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<match>:
push   %rax
call   1030 <matche@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @match(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32 @matche(i8* %6, i8* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp eq i32 %9, 1
%11 = zext i1 %10 to i64
%12 = select i1 %10, i32 1, i32 0
ret i32 %12
}

LLVM IR (-O2):
define i32 @match(i8* %0, i8* %1) {
%3 = tail call i32 @matche(i8* %0, i8* %1)
%4 = icmp eq i32 %3, 1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
struct timeval {
  int dummy;
};
typedef int /*<<< orphan*/ fd_set;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int __select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
             struct timeval *timeout) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<__select>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__select>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
@ENOSYS = global i32 0
define i32 @__select(i32 %0, i32* %1, i32* %2, i32* %3, %struct.timeval* %4) {
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca %struct.timeval*
store i32 %0, i32* %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store %struct.timeval* %4, %struct.timeval** %10
%11 = load i32, i32* @ENOSYS
%12 = call i32 @__set_errno(i32 %11)
ret i32 -1
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
@ENOSYS = global i32 0
define i32 @__select(i32 %0, i32* nocapture readnone %1, i32* nocapture readnone %2, i32* nocapture readnone %3, %struct.timeval* nocapture readnone %4) {
%6 = load i32, i32* @ENOSYS
%7 = tail call i32 @__set_errno(i32 %6)
ret i32 -1
}
/* Variables and functions */
scalar_t__ atof(char const *);
float string_parseFloat(const char *str) { return (float)atof(str); }


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

x86 assembly (clang, -O2):
<string_parseFloat>:
push   %rax
call   1030 <atof@plt>
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @string_parseFloat(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @atof(i8* %3)
%5 = sitofp i64 %4 to float
ret float %5
}

LLVM IR (-O2):
define float @string_parseFloat(i8* nocapture %0) {
%2 = tail call i64 @atof(i8* %0)
%3 = sitofp i64 %2 to float
ret float %3
}
/* Variables and functions */
int EOF;
int getchar();
clear_error() {
  int c;
  while ((c = getchar()) != '\n' && c != EOF)
    ;
}


x86 assembly (clang, -O0):
<clear_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,%ecx
mov    %ecx,-0x8(%rbp)
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0x9(%rbp)
je     1144 <clear_error+0x34>
mov    -0x8(%rbp),%eax
mov    0x2eac(%rip),%rcx
cmp    (%rcx),%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1154 <clear_error+0x44>
jmp    1159 <clear_error+0x49>
jmp    1118 <clear_error+0x8>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_error>:
push   %rbx
mov    0x2ed0(%rip),%rbx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%eax
je     1130 <clear_error+0x20>
cmp    (%rbx),%eax
jne    1120 <clear_error+0x10>
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @clear_error() {
%1 = alloca i32
%2 = alloca i32
br label %3
3: ; preds = %12, %0
%4 = call i32 (...) @getchar()
store i32 %4, i32* %2
%5 = icmp ne i32 %4, 10
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = load i32, i32* %2
%8 = load i32, i32* @EOF
%9 = icmp ne i32 %7, %8
br label %10
10: ; preds = %6, %3
%11 = phi i1 [ false, %3 ], [ %9, %6 ]
br i1 %11, label %12, label %13
12: ; preds = %10
br label %3
13: ; preds = %10
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @clear_error() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @getchar()
%3 = icmp ne i32 %2, 10
%4 = load i32, i32* @EOF
%5 = icmp ne i32 %2, %4
%6 = select i1 %3, i1 %5, i1 false
br i1 %6, label %1, label %7
7: ; preds = %1
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ strcspn(char const *, char const *);
char *strpbrk(const char *s, const char *accept) {
  s += strcspn(s, accept);
  return *s ? (char *)s : NULL;
}


x86 assembly (clang, -O0):
<strpbrk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcspn@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     115a <strpbrk+0x4a>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1165 <strpbrk+0x55>
xor    %eax,%eax
mov    %rax,-0x18(%rbp)
jmp    1165 <strpbrk+0x55>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strpbrk>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strcspn@plt>
movslq %eax,%rcx
lea    (%rbx,%rcx,1),%rdx
xor    %eax,%eax
cmpb   $0x0,(%rbx,%rcx,1)
cmovne %rdx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @strpbrk(i8* %0, i8* nocapture %1) {
%3 = tail call i32 @strcspn(i8* %0, i8* %1)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = select i1 %7, i8* null, i8* %5
ret i8* %8
}
signed long long signedlonglong_ignoring_longdouble(signed long long x,
                                                    long double y) {
  return x;
}


x86 assembly (clang, -O0):
<signedlonglong_ignoring_longdouble>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
mov    %rdi,-0x8(%rbp)
fstpt  -0x20(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @signedlonglong_ignoring_longdouble(i64 returned %0, x86_fp80 %1) {
ret i64 %0
}
/* Variables and functions */
unsigned int bar();
void foo20x3(void) {
  unsigned int a = bar();
  if (a > 0x3)
    bar();
}


x86 assembly (clang, -O0):
<foo20x3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <bar@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x3,-0x4(%rbp)
jbe    1133 <foo20x3+0x23>
mov    $0x0,%al
call   1030 <bar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo20x3>:
push   %rax
xor    %eax,%eax
call   1030 <bar@plt>
cmp    $0x4,%eax
jb     1125 <foo20x3+0x15>
xor    %eax,%eax
pop    %rcx
jmp    1030 <bar@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @foo20x3() {
%1 = alloca i32
%2 = call i32 (...) @bar()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp ugt i32 %3, 3
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 (...) @bar()
br label %7
7: ; preds = %5, %0
ret void
}

LLVM IR (-O2):
define void @foo20x3() {
%1 = tail call i32 (...) @bar()
%2 = icmp ugt i32 %1, 3
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @bar()
br label %5
5: ; preds = %3, %0
ret void
}
max2(a, b) int a, b;
{ return ((a < b ? b : a)); }


x86 assembly (clang, -O0):
<max2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <max2+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <max2+0x27>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max2>:
mov    %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

LLVM IR (-O0):
define i32 @max2(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 = icmp slt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %4
br label %12
10: ; preds = %2
%11 = load i32, i32* %3
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @max2(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
float cgo_callback_conv_get_single(void *addr) {
  return *(float *)((char *)addr);
}


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

x86 assembly (clang, -O2):
<cgo_callback_conv_get_single>:
movss  (%rdi),%xmm0
ret

LLVM IR (-O0):
define float @cgo_callback_conv_get_single(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to float*
%5 = load float, float* %4
ret float %5
}

LLVM IR (-O2):
define float @cgo_callback_conv_get_single(i8* nocapture %0) {
%2 = bitcast i8* %0 to float*
%3 = load float, float* %2
ret float %3
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ chr1setBank7(int);
void m32setParamsBXX7(uint16_t addr, uint8_t val) {
  (void)addr;
  chr1setBank7(val << 10);
}


x86 assembly (clang, -O0):
<m32setParamsBXX7>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
shl    $0xa,%edi
call   1030 <chr1setBank7@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m32setParamsBXX7>:
mov    %esi,%edi
shl    $0xa,%edi
jmp    1030 <chr1setBank7@plt>

LLVM IR (-O0):
define void @m32setParamsBXX7(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 = shl i32 %6, 10
%8 = call i32 @chr1setBank7(i32 %7)
ret void
}

LLVM IR (-O2):
define void @m32setParamsBXX7(i32 %0, i32 %1) {
%3 = shl i32 %1, 10
%4 = tail call i32 @chr1setBank7(i32 %3)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int rotr(int, int);
uint32_t sigma1(uint32_t x) { return rotr(x, 6) ^ rotr(x, 11) ^ rotr(x, 25); }


x86 assembly (clang, -O0):
<sigma1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x6,%esi
call   1030 <rotr@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    $0xb,%esi
call   1030 <rotr@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
xor    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x19,%esi
call   1030 <rotr@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
xor    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigma1>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
mov    $0x6,%esi
call   1030 <rotr@plt>
mov    %eax,%r14d
mov    %ebx,%edi
mov    $0xb,%esi
call   1030 <rotr@plt>
mov    %eax,%ebp
xor    %r14d,%ebp
mov    %ebx,%edi
mov    $0x19,%esi
call   1030 <rotr@plt>
xor    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @sigma1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @rotr(i32 %3, i32 6)
%5 = load i32, i32* %2
%6 = call i32 @rotr(i32 %5, i32 11)
%7 = xor i32 %4, %6
%8 = load i32, i32* %2
%9 = call i32 @rotr(i32 %8, i32 25)
%10 = xor i32 %7, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @sigma1(i32 %0) {
%2 = tail call i32 @rotr(i32 %0, i32 6)
%3 = tail call i32 @rotr(i32 %0, i32 11)
%4 = xor i32 %3, %2
%5 = tail call i32 @rotr(i32 %0, i32 25)
%6 = xor i32 %4, %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void keyboard(unsigned char key, int mousePositionX, int mousePositionY) {
  switch (key) {
  case 27:
    exit(0);
    break;
  default:
    break;
  }
}


x86 assembly (clang, -O0):
<keyboard>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x1(%rbp),%al
sub    $0x1b,%al
jne    113b <keyboard+0x2b>
jmp    1134 <keyboard+0x24>
xor    %edi,%edi
call   1030 <exit@plt>
jmp    1140 <keyboard+0x30>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<keyboard>:
cmp    $0x1b,%dil
je     1117 <keyboard+0x7>
ret
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @keyboard(i8 zeroext %0, i32 %1, i32 %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
switch i32 %8, label %11 [
i32 27, label %9
]
9: ; preds = %3
%10 = call i32 @exit(i32 0)
unreachable
11: ; preds = %3
br label %12
12: ; preds = %11
ret void
}

LLVM IR (-O2):
define void @keyboard(i8 zeroext %0, i32 %1, i32 %2) {
%4 = icmp eq i8 %0, 27
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %3
ret void
}
int ld_eq_cr1(long double a1) { return (((100) == (a1))); }


x86 assembly (clang, -O0):
<ld_eq_cr1>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
flds   0xeed(%rip)
fucomip %st(1),%st
fstp   %st(0)
setnp  %cl
sete   %al
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_eq_cr1>:
fldt   0x8(%rsp)
flds   0xef6(%rip)
fucomip %st(1),%st
fstp   %st(0)
setnp  %al
sete   %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @ld_eq_cr1(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fcmp oeq x86_fp80 0xK4005C800000000000000, %3
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @ld_eq_cr1(x86_fp80 %0) {
%2 = fcmp oeq x86_fp80 %0, 0xK4005C800000000000000
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
float simple_acos(float);
float simple_asin(float x) { return (3.141592653589793 / 2) - simple_acos(x); }


x86 assembly (clang, -O0):
<simple_asin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <simple_acos@plt>
cvtss2sd %xmm0,%xmm1
movsd  0xecd(%rip),%xmm0
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<simple_asin>:
push   %rax
call   1030 <simple_acos@plt>
cvtss2sd %xmm0,%xmm0
movsd  0xede(%rip),%xmm1
subsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @simple_asin(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @simple_acos(float %3)
%5 = fpext float %4 to double
%6 = fsub double 0x3FF921FB54442D18, %5
%7 = fptrunc double %6 to float
ret float %7
}

LLVM IR (-O2):
define float @simple_asin(float %0) {
%2 = tail call float @simple_acos(float %0)
%3 = fpext float %2 to double
%4 = fsub double 0x3FF921FB54442D18, %3
%5 = fptrunc double %4 to float
ret float %5
}
/* Variables and functions */
scalar_t__ atol(char const *);
int atoi(const char *nptr) { return (int)atol(nptr); }


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

x86 assembly (clang, -O2):
<atoi>:
jmp    1030 <atol@plt>

LLVM IR (-O0):
define i32 @atoi(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @atol(i8* %3)
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @atoi(i8* nocapture %0) {
%2 = tail call i64 @atol(i8* %0)
%3 = trunc i64 %2 to i32
ret i32 %3
}
long NETtest() { return 0; }


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

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

LLVM IR (-O0):
define i64 @NETtest() {
ret i64 0
}

LLVM IR (-O2):
define i64 @NETtest() {
ret i64 0
}
unsigned xrop3_109_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  unsigned stk4;
  stk4 = T | D;
  stk3 = S & stk4;
  stk2 = D ^ stk3;
  stk1 = T ^ stk2;
  stk1 = ~stk1;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_109_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
and    -0x20(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_109_0_0>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%eax
shl    $0x8,%eax
lea    (%rsi,%rax,1),%edx
or     $0xff,%eax
and    %ecx,%eax
xor    %edx,%eax
xor    $0xffffff00,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_109_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = shl i32 %13, 8
%15 = load i8, i8* %3
%16 = zext i8 %15 to i32
%17 = or i32 %14, %16
store i32 %17, i32* %6
%18 = load i8, i8* %4
%19 = zext i8 %18 to i32
%20 = shl i32 %19, 8
%21 = load i8, i8* %4
%22 = zext i8 %21 to i32
%23 = or i32 %20, %22
store i32 %23, i32* %7
%24 = load i32, i32* %7
%25 = load i32, i32* %5
%26 = or i32 %24, %25
store i32 %26, i32* %11
%27 = load i32, i32* %6
%28 = load i32, i32* %11
%29 = and i32 %27, %28
store i32 %29, i32* %10
%30 = load i32, i32* %5
%31 = load i32, i32* %10
%32 = xor i32 %30, %31
store i32 %32, i32* %9
%33 = load i32, i32* %7
%34 = load i32, i32* %9
%35 = xor i32 %33, %34
store i32 %35, i32* %8
%36 = load i32, i32* %8
%37 = xor i32 %36, -1
store i32 %37, i32* %8
%38 = load i32, i32* %8
ret i32 %38
}

LLVM IR (-O2):
define i32 @xrop3_109_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = shl nuw nsw i32 %5, 8
%7 = or i32 %6, %5
%8 = or i32 %6, 255
%9 = and i32 %8, %4
%10 = xor i32 %7, %9
%11 = xor i32 %10, -256
ret i32 %11
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t clr_trail_1s(uint64_t u) { return (u + 1) & u; }


x86 assembly (clang, -O0):
<clr_trail_1s>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
and    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clr_trail_1s>:
lea    0x1(%rdi),%eax
and    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @clr_trail_1s(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = and i32 %2, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ pv_destroy_buffer();
int /*<<< orphan*/ pv_table_free();
int /*<<< orphan*/ tr_table_free();
void pv_destroy_api(void) {
  pv_table_free();
  tr_table_free();
  pv_destroy_buffer();
  return;
}


x86 assembly (clang, -O0):
<pv_destroy_api>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <pv_table_free@plt>
mov    $0x0,%al
call   1050 <tr_table_free@plt>
mov    $0x0,%al
call   1040 <pv_destroy_buffer@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pv_destroy_api>:
push   %rax
xor    %eax,%eax
call   1030 <pv_table_free@plt>
xor    %eax,%eax
call   1050 <tr_table_free@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <pv_destroy_buffer@plt>

LLVM IR (-O0):
define void @pv_destroy_api() {
%1 = call i32 (...) @pv_table_free()
%2 = call i32 (...) @tr_table_free()
%3 = call i32 (...) @pv_destroy_buffer()
ret void
}

LLVM IR (-O2):
define void @pv_destroy_api() {
%1 = tail call i32 (...) @pv_table_free()
%2 = tail call i32 (...) @tr_table_free()
%3 = tail call i32 (...) @pv_destroy_buffer()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_stream_proplist_update() {
  printf("NOT IMPLEMENTED:"
         "pa_stream_proplist_update"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [43 x i8] c"NOT IMPLEMENTED:pa_stream_proplist_update\0A\00"
define i32 @pa_stream_proplist_update() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [42 x i8] c"NOT IMPLEMENTED:pa_stream_proplist_update\00"
define i32 @pa_stream_proplist_update() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int japi_getstringwidth(int, char *);
int j_getstringwidth(int arg0, char *arg1) {
  return (japi_getstringwidth(arg0, arg1));
}


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

x86 assembly (clang, -O2):
<j_getstringwidth>:
jmp    1030 <japi_getstringwidth@plt>

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

LLVM IR (-O2):
define i32 @j_getstringwidth(i32 %0, i8* %1) {
%3 = tail call i32 @japi_getstringwidth(i32 %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ ROL_();
int /*<<< orphan*/ c64_memZero();
void ROL_zp(void) {
  c64_memZero();
  ROL_();
}


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

x86 assembly (clang, -O2):
<ROL_zp>:
push   %rax
xor    %eax,%eax
call   1040 <c64_memZero@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <ROL_@plt>

LLVM IR (-O0):
define void @ROL_zp() {
%1 = call i32 (...) @c64_memZero()
%2 = call i32 (...) @ROL_()
ret void
}

LLVM IR (-O2):
define void @ROL_zp() {
%1 = tail call i32 (...) @c64_memZero()
%2 = tail call i32 (...) @ROL_()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cudaFree(int /*<<< orphan*/);
void dxInitDevice() { cudaFree(0); }


x86 assembly (clang, -O0):
<dxInitDevice>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <cudaFree@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @dxInitDevice() {
%1 = call i32 @cudaFree(i32 0)
ret void
}

LLVM IR (-O2):
define void @dxInitDevice() {
%1 = tail call i32 @cudaFree(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, int, char const *, char const *,
                          char const *);
void default_reporter(const char *msg, const char *expr, const char *file,
                      int line, const char *function, void *usr) {
  (void)usr;
  printf("%s(%d) - %s()\n\t%s\n\t%s\n", file, line, function, msg, expr);
}


x86 assembly (clang, -O0):
<default_reporter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0x28(%rbp),%rcx
mov    -0x8(%rbp),%r8
mov    -0x10(%rbp),%r9
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<default_reporter>:
mov    %rsi,%r9
mov    %rdi,%rax
lea    0xee3(%rip),%rdi
mov    %rdx,%rsi
mov    %ecx,%edx
mov    %r8,%rcx
mov    %rax,%r8
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"%s(%d) - %s()\0A\09%s\0A\09%s\0A\00"
define void @default_reporter(i8* %0, i8* %1, i8* %2, i32 %3, i8* %4, i8* %5) {
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i8*
store i8* %0, i8** %7
store i8* %1, i8** %8
store i8* %2, i8** %9
store i32 %3, i32* %10
store i8* %4, i8** %11
store i8* %5, i8** %12
%13 = load i8*, i8** %12
%14 = load i8*, i8** %9
%15 = load i32, i32* %10
%16 = load i8*, i8** %11
%17 = load i8*, i8** %7
%18 = load i8*, i8** %8
%19 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %14, i32 %15, i8* %16, i8* %17, i8* %18)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"%s(%d) - %s()\0A\09%s\0A\09%s\0A\00"
define void @default_reporter(i8* %0, i8* %1, i8* %2, i32 %3, i8* %4, i8* nocapture readnone %5) {
%7 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %2, i32 %3, i8* %4, i8* %0, i8* %1)
ret void
}
void stub() {}


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

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

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

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