#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*/ uint32_t;
typedef int /*<<< orphan*/ convert_result2;

/* Variables and functions */
int /*<<< orphan*/ bzero(char *, int);
int /*<<< orphan*/ convert2(char *, char *);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ uvarint_encode32(int /*<<< orphan*/, char *, int);
char *Num_To_HexVar_32(uint32_t TOHVINPUT) {
  static char convert_result2[3] = "\0";
  bzero(convert_result2, 3);
  convert_result2[2] = '\0';
  memset(convert_result2, 0, sizeof(convert_result2));
  uint8_t buf[1] = {0};
  bzero(buf, 1);
  uvarint_encode32(TOHVINPUT, buf, 1);
  convert2(convert_result2, buf);
  return convert_result2;
}


x86 assembly (clang, -O0):
<Num_To_HexVar_32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0x2eef(%rip),%rdi
mov    $0x3,%esi
call   1060 <bzero@plt>
movb   $0x0,0x2ee0(%rip)
lea    0x2ed7(%rip),%rdi
xor    %esi,%esi
mov    $0x3,%edx
call   1030 <memset@plt>
lea    -0x5(%rbp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <memset@plt>
lea    -0x5(%rbp),%rdi
mov    $0x1,%esi
call   1060 <bzero@plt>
mov    -0x4(%rbp),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1040 <uvarint_encode32@plt>
lea    -0x5(%rbp),%rsi
lea    0x2e91(%rip),%rdi
call   1050 <convert2@plt>
lea    0x2e85(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Num_To_HexVar_32>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edi,%r14d
lea    0x2eef(%rip),%rbx
mov    %rbx,%rdi
mov    $0x3,%esi
call   1060 <bzero@plt>
movb   $0x0,0x2edd(%rip)
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x3,%edx
call   1030 <memset@plt>
movb   $0x0,0xf(%rsp)
lea    0xf(%rsp),%rbp
mov    %rbp,%rdi
mov    $0x1,%esi
call   1060 <bzero@plt>
mov    %r14d,%edi
mov    %rbp,%rsi
mov    $0x1,%edx
call   1040 <uvarint_encode32@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1050 <convert2@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@Num_To_HexVar_32.convert_result2 = internal global [3 x i8] zeroinitializer
define i8* @Num_To_HexVar_32(i32 %0) {
%2 = alloca [1 x i8]
%3 = tail call i32 @bzero(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @Num_To_HexVar_32.convert_result2, i64 0, i64 0), i32 3)
store i8 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @Num_To_HexVar_32.convert_result2, i64 0, i64 2)
%4 = tail call i32 @memset(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @Num_To_HexVar_32.convert_result2, i64 0, i64 0), i32 0, i32 3)
%5 = getelementptr inbounds [1 x i8], [1 x i8]* %2, i64 0, i64 0
store i8 0, i8* %5
%6 = call i32 @bzero(i8* %5, i32 1)
%7 = call i32 @uvarint_encode32(i32 %0, i8* %5, i32 1)
%8 = call i32 @convert2(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @Num_To_HexVar_32.convert_result2, i64 0, i64 0), i8* %5)
ret i8* getelementptr inbounds ([3 x i8], [3 x i8]* @Num_To_HexVar_32.convert_result2, i64 0, i64 0)
}