#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*/ Console_Char(unsigned char);
void Console_Hex(long long i) {
  long long k, n;
  k = -28;
  while (k <= 0) {
    n = ((((k) >= 0 ? ((long long)(i) << (k)) : ((long long)(i) >> (-(k))))) &
         ~(-16));
    if (n <= 9) {
      Console_Char((unsigned char)(48 + n));
    } else {
      Console_Char((unsigned char)(55 + n));
    }
    k += 4;
  }
}


x86 assembly (clang, -O0):
<Console_Hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0xffffffffffffffe4,-0x10(%rbp)
ff
cmpq   $0x0,-0x10(%rbp)
jg     11ac <Console_Hex+0x9c>
cmpq   $0x0,-0x10(%rbp)
jl     114e <Console_Hex+0x3e>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
shl    %cl,%rax
mov    %rax,-0x20(%rbp)
jmp    115f <Console_Hex+0x4f>
mov    -0x8(%rbp),%rax
xor    %ecx,%ecx
sub    -0x10(%rbp),%rcx
sar    %cl,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
and    $0xf,%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x9,-0x18(%rbp)
jg     118b <Console_Hex+0x7b>
mov    -0x18(%rbp),%rax
add    $0x30,%rax
movzbl %al,%edi
call   1030 <Console_Char@plt>
jmp    119b <Console_Hex+0x8b>
mov    -0x18(%rbp),%rax
add    $0x37,%rax
movzbl %al,%edi
call   1030 <Console_Char@plt>
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <Console_Hex+0x14>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Console_Hex>:
push   %rbx
mov    %rdi,%rbx
mov    %ebx,%eax
shr    $0x1c,%eax
lea    0x37(%rax),%ecx
lea    0x30(%rax),%edx
cmp    $0xa,%eax
movzbl %dl,%eax
movzbl %cl,%ecx
cmovb  %eax,%ecx
movzbl %cl,%edi
call   1030 <Console_Char@plt>
mov    %ebx,%eax
shr    $0x18,%eax
and    $0xf,%eax
lea    0x30(%rax),%ecx
lea    0x37(%rax),%edx
cmp    $0xa,%eax
movzbl %cl,%eax
movzbl %dl,%ecx
cmovb  %eax,%ecx
movzbl %cl,%edi
call   1030 <Console_Char@plt>
mov    %ebx,%eax
shr    $0x14,%eax
and    $0xf,%eax
lea    0x30(%rax),%ecx
lea    0x37(%rax),%edx
cmp    $0xa,%eax
movzbl %cl,%eax
movzbl %dl,%ecx
cmovb  %eax,%ecx
movzbl %cl,%edi
call   1030 <Console_Char@plt>
mov    %ebx,%eax
shr    $0x10,%eax
and    $0xf,%eax
lea    0x30(%rax),%ecx
lea    0x37(%rax),%edx
cmp    $0xa,%eax
movzbl %cl,%eax
movzbl %dl,%ecx
cmovb  %eax,%ecx
movzbl %cl,%edi
call   1030 <Console_Char@plt>
mov    %ebx,%eax
shr    $0xc,%eax
and    $0xf,%eax
lea    0x30(%rax),%ecx
lea    0x37(%rax),%edx
cmp    $0xa,%eax
movzbl %cl,%eax
movzbl %dl,%ecx
cmovb  %eax,%ecx
movzbl %cl,%edi
call   1030 <Console_Char@plt>
mov    %ebx,%eax
shr    $0x8,%eax
and    $0xf,%eax
lea    0x30(%rax),%ecx
lea    0x37(%rax),%edx
cmp    $0xa,%eax
movzbl %cl,%eax
movzbl %dl,%ecx
cmovb  %eax,%ecx
movzbl %cl,%edi
call   1030 <Console_Char@plt>
mov    %ebx,%eax
shr    $0x4,%eax
and    $0xf,%eax
lea    0x30(%rax),%ecx
lea    0x37(%rax),%edx
cmp    $0xa,%eax
movzbl %cl,%eax
movzbl %dl,%ecx
cmovb  %eax,%ecx
movzbl %cl,%edi
call   1030 <Console_Char@plt>
and    $0xf,%ebx
lea    0x30(%rbx),%eax
lea    0x37(%rbx),%ecx
cmp    $0xa,%rbx
movzbl %al,%eax
movzbl %cl,%ecx
cmovb  %eax,%ecx
movzbl %cl,%edi
pop    %rbx
jmp    1030 <Console_Char@plt>

LLVM IR (-O0):
define void @Console_Hex(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %2
store i64 -28, i64* %3
br label %5
5: ; preds = %35, %1
%6 = load i64, i64* %3
%7 = icmp sle i64 %6, 0
br i1 %7, label %8, label %38
8: ; preds = %5
%9 = load i64, i64* %3
%10 = icmp sge i64 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %8
%12 = load i64, i64* %2
%13 = load i64, i64* %3
%14 = shl i64 %12, %13
br label %20
15: ; preds = %8
%16 = load i64, i64* %2
%17 = load i64, i64* %3
%18 = sub nsw i64 0, %17
%19 = ashr i64 %16, %18
br label %20
20: ; preds = %15, %11
%21 = phi i64 [ %14, %11 ], [ %19, %15 ]
%22 = and i64 %21, 15
store i64 %22, i64* %4
%23 = load i64, i64* %4
%24 = icmp sle i64 %23, 9
br i1 %24, label %25, label %30
25: ; preds = %20
%26 = load i64, i64* %4
%27 = add nsw i64 48, %26
%28 = trunc i64 %27 to i8
%29 = call i32 @Console_Char(i8 zeroext %28)
br label %35
30: ; preds = %20
%31 = load i64, i64* %4
%32 = add nsw i64 55, %31
%33 = trunc i64 %32 to i8
%34 = call i32 @Console_Char(i8 zeroext %33)
br label %35
35: ; preds = %30, %25
%36 = load i64, i64* %3
%37 = add nsw i64 %36, 4
store i64 %37, i64* %3
br label %5
38: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @Console_Hex(i64 %0) {
%2 = lshr i64 %0, 28
%3 = and i64 %2, 15
%4 = icmp ult i64 %3, 10
%5 = trunc i64 %3 to i8
%6 = add nuw nsw i8 %5, 55
%7 = or i8 %5, 48
%8 = select i1 %4, i8 %7, i8 %6
%9 = tail call i32 @Console_Char(i8 zeroext %8)
%10 = lshr i64 %0, 24
%11 = and i64 %10, 15
%12 = icmp ult i64 %11, 10
%13 = trunc i64 %11 to i8
%14 = or i8 %13, 48
%15 = trunc i64 %11 to i8
%16 = add nuw nsw i8 %15, 55
%17 = select i1 %12, i8 %14, i8 %16
%18 = tail call i32 @Console_Char(i8 zeroext %17)
%19 = lshr i64 %0, 20
%20 = and i64 %19, 15
%21 = icmp ult i64 %20, 10
%22 = trunc i64 %20 to i8
%23 = or i8 %22, 48
%24 = trunc i64 %20 to i8
%25 = add nuw nsw i8 %24, 55
%26 = select i1 %21, i8 %23, i8 %25
%27 = tail call i32 @Console_Char(i8 zeroext %26)
%28 = lshr i64 %0, 16
%29 = and i64 %28, 15
%30 = icmp ult i64 %29, 10
%31 = trunc i64 %29 to i8
%32 = or i8 %31, 48
%33 = trunc i64 %29 to i8
%34 = add nuw nsw i8 %33, 55
%35 = select i1 %30, i8 %32, i8 %34
%36 = tail call i32 @Console_Char(i8 zeroext %35)
%37 = lshr i64 %0, 12
%38 = and i64 %37, 15
%39 = icmp ult i64 %38, 10
%40 = trunc i64 %38 to i8
%41 = or i8 %40, 48
%42 = trunc i64 %38 to i8
%43 = add nuw nsw i8 %42, 55
%44 = select i1 %39, i8 %41, i8 %43
%45 = tail call i32 @Console_Char(i8 zeroext %44)
%46 = lshr i64 %0, 8
%47 = and i64 %46, 15
%48 = icmp ult i64 %47, 10
%49 = trunc i64 %47 to i8
%50 = or i8 %49, 48
%51 = trunc i64 %47 to i8
%52 = add nuw nsw i8 %51, 55
%53 = select i1 %48, i8 %50, i8 %52
%54 = tail call i32 @Console_Char(i8 zeroext %53)
%55 = lshr i64 %0, 4
%56 = and i64 %55, 15
%57 = icmp ult i64 %56, 10
%58 = trunc i64 %56 to i8
%59 = or i8 %58, 48
%60 = trunc i64 %56 to i8
%61 = add nuw nsw i8 %60, 55
%62 = select i1 %57, i8 %59, i8 %61
%63 = tail call i32 @Console_Char(i8 zeroext %62)
%64 = and i64 %0, 15
%65 = icmp ult i64 %64, 10
%66 = trunc i64 %64 to i8
%67 = or i8 %66, 48
%68 = trunc i64 %64 to i8
%69 = add nuw nsw i8 %68, 55
%70 = select i1 %65, i8 %67, i8 %69
%71 = tail call i32 @Console_Char(i8 zeroext %70)
ret void
}