#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_tx_nibble(unsigned short);
void console_tx_hex32(unsigned short value) {
  console_tx_nibble((value >> 28U) & 0x0FU);
  console_tx_nibble((value >> 24U) & 0x0FU);
  console_tx_nibble((value >> 20U) & 0x0FU);
  console_tx_nibble((value >> 16U) & 0x0FU);
  console_tx_nibble((value >> 12U) & 0x0FU);
  console_tx_nibble((value >> 8U) & 0x0FU);
  console_tx_nibble((value >> 4U) & 0x0FU);
  console_tx_nibble(value & 0x0FU);
}


x86 assembly (clang, -O0):
<console_tx_hex32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
sar    $0x1c,%eax
and    $0xf,%eax
movzwl %ax,%edi
call   1030 <console_tx_nibble@plt>
movzwl -0x2(%rbp),%eax
sar    $0x18,%eax
and    $0xf,%eax
movzwl %ax,%edi
call   1030 <console_tx_nibble@plt>
movzwl -0x2(%rbp),%eax
sar    $0x14,%eax
and    $0xf,%eax
movzwl %ax,%edi
call   1030 <console_tx_nibble@plt>
movzwl -0x2(%rbp),%eax
sar    $0x10,%eax
and    $0xf,%eax
movzwl %ax,%edi
call   1030 <console_tx_nibble@plt>
movzwl -0x2(%rbp),%eax
sar    $0xc,%eax
and    $0xf,%eax
movzwl %ax,%edi
call   1030 <console_tx_nibble@plt>
movzwl -0x2(%rbp),%eax
sar    $0x8,%eax
and    $0xf,%eax
movzwl %ax,%edi
call   1030 <console_tx_nibble@plt>
movzwl -0x2(%rbp),%eax
sar    $0x4,%eax
and    $0xf,%eax
movzwl %ax,%edi
call   1030 <console_tx_nibble@plt>
movzwl -0x2(%rbp),%eax
and    $0xf,%eax
movzwl %ax,%edi
call   1030 <console_tx_nibble@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<console_tx_hex32>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
call   1030 <console_tx_nibble@plt>
xor    %edi,%edi
call   1030 <console_tx_nibble@plt>
xor    %edi,%edi
call   1030 <console_tx_nibble@plt>
xor    %edi,%edi
call   1030 <console_tx_nibble@plt>
mov    %ebx,%edi
shr    $0xc,%edi
call   1030 <console_tx_nibble@plt>
mov    %ebx,%edi
shr    $0x8,%edi
and    $0xf,%edi
call   1030 <console_tx_nibble@plt>
mov    %ebx,%edi
shr    $0x4,%edi
and    $0xf,%edi
call   1030 <console_tx_nibble@plt>
and    $0xf,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <console_tx_nibble@plt>

LLVM IR (-O0):
define void @console_tx_hex32(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = ashr i32 %4, 28
%6 = and i32 %5, 15
%7 = trunc i32 %6 to i16
%8 = call i32 @console_tx_nibble(i16 zeroext %7)
%9 = load i16, i16* %2
%10 = zext i16 %9 to i32
%11 = ashr i32 %10, 24
%12 = and i32 %11, 15
%13 = trunc i32 %12 to i16
%14 = call i32 @console_tx_nibble(i16 zeroext %13)
%15 = load i16, i16* %2
%16 = zext i16 %15 to i32
%17 = ashr i32 %16, 20
%18 = and i32 %17, 15
%19 = trunc i32 %18 to i16
%20 = call i32 @console_tx_nibble(i16 zeroext %19)
%21 = load i16, i16* %2
%22 = zext i16 %21 to i32
%23 = ashr i32 %22, 16
%24 = and i32 %23, 15
%25 = trunc i32 %24 to i16
%26 = call i32 @console_tx_nibble(i16 zeroext %25)
%27 = load i16, i16* %2
%28 = zext i16 %27 to i32
%29 = ashr i32 %28, 12
%30 = and i32 %29, 15
%31 = trunc i32 %30 to i16
%32 = call i32 @console_tx_nibble(i16 zeroext %31)
%33 = load i16, i16* %2
%34 = zext i16 %33 to i32
%35 = ashr i32 %34, 8
%36 = and i32 %35, 15
%37 = trunc i32 %36 to i16
%38 = call i32 @console_tx_nibble(i16 zeroext %37)
%39 = load i16, i16* %2
%40 = zext i16 %39 to i32
%41 = ashr i32 %40, 4
%42 = and i32 %41, 15
%43 = trunc i32 %42 to i16
%44 = call i32 @console_tx_nibble(i16 zeroext %43)
%45 = load i16, i16* %2
%46 = zext i16 %45 to i32
%47 = and i32 %46, 15
%48 = trunc i32 %47 to i16
%49 = call i32 @console_tx_nibble(i16 zeroext %48)
ret void
}

LLVM IR (-O2):
define void @console_tx_hex32(i16 zeroext %0) {
%2 = tail call i32 @console_tx_nibble(i16 zeroext 0)
%3 = tail call i32 @console_tx_nibble(i16 zeroext 0)
%4 = tail call i32 @console_tx_nibble(i16 zeroext 0)
%5 = tail call i32 @console_tx_nibble(i16 zeroext 0)
%6 = lshr i16 %0, 12
%7 = tail call i32 @console_tx_nibble(i16 zeroext %6)
%8 = lshr i16 %0, 8
%9 = and i16 %8, 15
%10 = tail call i32 @console_tx_nibble(i16 zeroext %9)
%11 = lshr i16 %0, 4
%12 = and i16 %11, 15
%13 = tail call i32 @console_tx_nibble(i16 zeroext %12)
%14 = and i16 %0, 15
%15 = tail call i32 @console_tx_nibble(i16 zeroext %14)
ret void
}