#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ encode_chrom(char const *, size_t);
int /*<<< orphan*/ encode_refalt(char const *, size_t, char const *, size_t);
int /*<<< orphan*/ encode_variantkey(int /*<<< orphan*/, int /*<<< orphan*/,
                                     int /*<<< orphan*/);
uint64_t variantkey(const char *chrom, size_t sizechrom, uint32_t pos,
                    const char *ref, size_t sizeref, const char *alt,
                    size_t sizealt) {
  return encode_variantkey(encode_chrom(chrom, sizechrom), pos,
                           encode_refalt(ref, sizeref, alt, sizealt));
}


x86 assembly (clang, -O0):
<variantkey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <encode_chrom@plt>
mov    %eax,-0x38(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdx
mov    0x10(%rbp),%rcx
call   1040 <encode_refalt@plt>
mov    -0x38(%rbp),%edi
mov    -0x34(%rbp),%esi
mov    %eax,%edx
call   1030 <encode_variantkey@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<variantkey>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9,%r14
mov    %r8,%r15
mov    %rcx,%r13
mov    %edx,%r12d
mov    0x40(%rsp),%rbp
call   1050 <encode_chrom@plt>
mov    %eax,%ebx
mov    %r13,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
mov    %rbp,%rcx
call   1040 <encode_refalt@plt>
mov    %ebx,%edi
mov    %r12d,%esi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <encode_variantkey@plt>

LLVM IR (-O0):
define i32 @variantkey(i8* %0, i64 %1, i32 %2, i8* %3, i64 %4, i8* %5, i64 %6) {
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i64
%13 = alloca i8*
%14 = alloca i64
store i8* %0, i8** %8
store i64 %1, i64* %9
store i32 %2, i32* %10
store i8* %3, i8** %11
store i64 %4, i64* %12
store i8* %5, i8** %13
store i64 %6, i64* %14
%15 = load i8*, i8** %8
%16 = load i64, i64* %9
%17 = call i32 @encode_chrom(i8* %15, i64 %16)
%18 = load i32, i32* %10
%19 = load i8*, i8** %11
%20 = load i64, i64* %12
%21 = load i8*, i8** %13
%22 = load i64, i64* %14
%23 = call i32 @encode_refalt(i8* %19, i64 %20, i8* %21, i64 %22)
%24 = call i32 @encode_variantkey(i32 %17, i32 %18, i32 %23)
ret i32 %24
}

LLVM IR (-O2):
define i32 @variantkey(i8* %0, i64 %1, i32 %2, i8* %3, i64 %4, i8* %5, i64 %6) {
%8 = tail call i32 @encode_chrom(i8* %0, i64 %1)
%9 = tail call i32 @encode_refalt(i8* %3, i64 %4, i8* %5, i64 %6)
%10 = tail call i32 @encode_variantkey(i32 %8, i32 %2, i32 %9)
ret i32 %10
}