#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 */

/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *kitsune_get_symbol_key(char const *, char const *, char const *,
                             char const *);
int /*<<< orphan*/ kitsune_register_key(char *, void *, size_t, int,
                                        char const *, char const *,
                                        char const *, char const *);
void kitsune_register_var(const char *var_name, const char *funcname,
                          const char *filename, const char *namespace,
                          void *var_addr, size_t size, int auto_migrate) {
  char *key = kitsune_get_symbol_key(var_name, funcname, filename, namespace);
  kitsune_register_key(key, var_addr, size, auto_migrate, var_name, funcname,
                       filename, namespace);
  free(key);
}


x86 assembly (clang, -O0):
<kitsune_register_var>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0x10(%rbp),%eax
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
call   1050 <kitsune_get_symbol_key@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdx
mov    0x10(%rbp),%ecx
mov    -0x8(%rbp),%r8
mov    -0x10(%rbp),%r9
mov    -0x18(%rbp),%r10
mov    -0x20(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1040 <kitsune_register_key@plt>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kitsune_register_var>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r9,0x10(%rsp)
mov    %r8,0x8(%rsp)
mov    %rcx,%r13
mov    %rdx,%r12
mov    %rsi,%rbx
mov    %rdi,%rbp
mov    0x50(%rsp),%r14d
call   1050 <kitsune_get_symbol_key@plt>
mov    %rax,%r15
mov    %rax,%rdi
mov    0x8(%rsp),%rsi
mov    0x10(%rsp),%rdx
mov    %r14d,%ecx
mov    %rbp,%r8
mov    %rbx,%r9
push   %r13
push   %r12
call   1040 <kitsune_register_key@plt>
add    $0x10,%rsp
mov    %r15,%rdi
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @kitsune_register_var(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i64 %5, i32 %6) {
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i64
%14 = alloca i32
%15 = alloca i8*
store i8* %0, i8** %8
store i8* %1, i8** %9
store i8* %2, i8** %10
store i8* %3, i8** %11
store i8* %4, i8** %12
store i64 %5, i64* %13
store i32 %6, i32* %14
%16 = load i8*, i8** %8
%17 = load i8*, i8** %9
%18 = load i8*, i8** %10
%19 = load i8*, i8** %11
%20 = call i8* @kitsune_get_symbol_key(i8* %16, i8* %17, i8* %18, i8* %19)
store i8* %20, i8** %15
%21 = load i8*, i8** %15
%22 = load i8*, i8** %12
%23 = load i64, i64* %13
%24 = load i32, i32* %14
%25 = load i8*, i8** %8
%26 = load i8*, i8** %9
%27 = load i8*, i8** %10
%28 = load i8*, i8** %11
%29 = call i32 @kitsune_register_key(i8* %21, i8* %22, i64 %23, i32 %24, i8* %25, i8* %26, i8* %27, i8* %28)
%30 = load i8*, i8** %15
%31 = call i32 @free(i8* %30)
ret void
}

LLVM IR (-O2):
define void @kitsune_register_var(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i64 %5, i32 %6) {
%8 = tail call i8* @kitsune_get_symbol_key(i8* %0, i8* %1, i8* %2, i8* %3)
%9 = tail call i32 @kitsune_register_key(i8* %8, i8* %4, i64 %5, i32 %6, i8* %0, i8* %1, i8* %2, i8* %3)
%10 = tail call i32 @free(i8* %8)
ret void
}