#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 char uint8_t;
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ convert_result;

/* Variables and functions */
int /*<<< orphan*/ bzero(char *, int);
int /*<<< orphan*/ convert(char *, char *);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ uvarint_encode64(int /*<<< orphan*/, char *, int);
char *Num_To_HexVar_64(uint64_t TOHVINPUT) {
  static char convert_result[800] = "\0";
  bzero(convert_result, 800);
  memset(convert_result, 0, sizeof(convert_result));
  uint8_t buf[400] = {0};
  bzero(buf, 400);
  uvarint_encode64(TOHVINPUT, buf, 800);
  convert(convert_result, buf);
  return convert_result;
}


x86 assembly (clang, -O0):
<Num_To_HexVar_64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1a0,%rsp
mov    %edi,-0x4(%rbp)
lea    0x2efb(%rip),%rdi
mov    $0x320,%esi
call   1060 <bzero@plt>
lea    0x2eea(%rip),%rdi
xor    %esi,%esi
mov    $0x320,%edx
call   1040 <memset@plt>
lea    -0x1a0(%rbp),%rdi
xor    %esi,%esi
mov    $0x190,%edx
call   1040 <memset@plt>
lea    -0x1a0(%rbp),%rdi
mov    $0x190,%esi
call   1060 <bzero@plt>
mov    -0x4(%rbp),%edi
lea    -0x1a0(%rbp),%rsi
mov    $0x320,%edx
call   1050 <uvarint_encode64@plt>
lea    -0x1a0(%rbp),%rsi
lea    0x2e98(%rip),%rdi
call   1030 <convert@plt>
lea    0x2e8c(%rip),%rax
add    $0x1a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Num_To_HexVar_64>:
push   %rbp
push   %r14
push   %rbx
sub    $0x190,%rsp
mov    %edi,%r14d
lea    0x2efb(%rip),%rbx
mov    %rbx,%rdi
mov    $0x320,%esi
call   1060 <bzero@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x320,%edx
call   1040 <memset@plt>
mov    %rsp,%rbp
mov    $0x190,%edx
mov    %rbp,%rdi
xor    %esi,%esi
call   1040 <memset@plt>
mov    %rbp,%rdi
mov    $0x190,%esi
call   1060 <bzero@plt>
mov    %r14d,%edi
mov    %rbp,%rsi
mov    $0x320,%edx
call   1050 <uvarint_encode64@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1030 <convert@plt>
mov    %rbx,%rax
add    $0x190,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@Num_To_HexVar_64.convert_result = internal global [800 x i8] zeroinitializer
define i8* @Num_To_HexVar_64(i32 %0) {
%2 = alloca i32
%3 = alloca [400 x i8]
store i32 %0, i32* %2
%4 = call i32 @bzero(i8* getelementptr inbounds ([800 x i8], [800 x i8]* @Num_To_HexVar_64.convert_result, i64 0, i64 0), i32 800)
%5 = call i32 @memset(i8* getelementptr inbounds ([800 x i8], [800 x i8]* @Num_To_HexVar_64.convert_result, i64 0, i64 0), i32 0, i32 800)
%6 = bitcast [400 x i8]* %3 to i8*
%7 = getelementptr inbounds [400 x i8], [400 x i8]* %3, i64 0, i64 0
%8 = call i32 @bzero(i8* %7, i32 400)
%9 = load i32, i32* %2
%10 = getelementptr inbounds [400 x i8], [400 x i8]* %3, i64 0, i64 0
%11 = call i32 @uvarint_encode64(i32 %9, i8* %10, i32 800)
%12 = getelementptr inbounds [400 x i8], [400 x i8]* %3, i64 0, i64 0
%13 = call i32 @convert(i8* getelementptr inbounds ([800 x i8], [800 x i8]* @Num_To_HexVar_64.convert_result, i64 0, i64 0), i8* %12)
ret i8* getelementptr inbounds ([800 x i8], [800 x i8]* @Num_To_HexVar_64.convert_result, i64 0, i64 0)
}

LLVM IR (-O2):
@Num_To_HexVar_64.convert_result = internal global [800 x i8] zeroinitializer
define i8* @Num_To_HexVar_64(i32 %0) {
%2 = alloca [400 x i8]
%3 = tail call i32 @bzero(i8* getelementptr inbounds ([800 x i8], [800 x i8]* @Num_To_HexVar_64.convert_result, i64 0, i64 0), i32 800)
%4 = tail call i32 @memset(i8* getelementptr inbounds ([800 x i8], [800 x i8]* @Num_To_HexVar_64.convert_result, i64 0, i64 0), i32 0, i32 800)
%5 = getelementptr inbounds [400 x i8], [400 x i8]* %2, i64 0, i64 0
%6 = call i32 @bzero(i8* %5, i32 400)
%7 = call i32 @uvarint_encode64(i32 %0, i8* %5, i32 800)
%8 = call i32 @convert(i8* getelementptr inbounds ([800 x i8], [800 x i8]* @Num_To_HexVar_64.convert_result, i64 0, i64 0), i8* %5)
ret i8* getelementptr inbounds ([800 x i8], [800 x i8]* @Num_To_HexVar_64.convert_result, i64 0, i64 0)
}