#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 int);
void __console_tx_hex32(int loglevel, unsigned int value) {
  if (8 > loglevel) {
    __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    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x8,%eax
cmp    -0x4(%rbp),%eax
jle    1199 <__console_tx_hex32+0x89>
mov    -0x8(%rbp),%edi
shr    $0x1c,%edi
and    $0xf,%edi
call   1030 <__console_tx_nibble@plt>
mov    -0x8(%rbp),%edi
shr    $0x18,%edi
and    $0xf,%edi
call   1030 <__console_tx_nibble@plt>
mov    -0x8(%rbp),%edi
shr    $0x14,%edi
and    $0xf,%edi
call   1030 <__console_tx_nibble@plt>
mov    -0x8(%rbp),%edi
shr    $0x10,%edi
and    $0xf,%edi
call   1030 <__console_tx_nibble@plt>
mov    -0x8(%rbp),%edi
shr    $0xc,%edi
and    $0xf,%edi
call   1030 <__console_tx_nibble@plt>
mov    -0x8(%rbp),%edi
shr    $0x8,%edi
and    $0xf,%edi
call   1030 <__console_tx_nibble@plt>
mov    -0x8(%rbp),%edi
shr    $0x4,%edi
and    $0xf,%edi
call   1030 <__console_tx_nibble@plt>
mov    -0x8(%rbp),%edi
and    $0xf,%edi
call   1030 <__console_tx_nibble@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__console_tx_hex32>:
cmp    $0x7,%edi
jg     117b <__console_tx_hex32+0x6b>
push   %rbx
mov    %esi,%ebx
mov    %esi,%edi
shr    $0x1c,%edi
call   1030 <__console_tx_nibble@plt>
mov    %ebx,%edi
shr    $0x18,%edi
and    $0xf,%edi
call   1030 <__console_tx_nibble@plt>
mov    %ebx,%edi
shr    $0x14,%edi
and    $0xf,%edi
call   1030 <__console_tx_nibble@plt>
mov    %ebx,%edi
shr    $0x10,%edi
and    $0xf,%edi
call   1030 <__console_tx_nibble@plt>
mov    %ebx,%edi
shr    $0xc,%edi
and    $0xf,%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>
ret

LLVM IR (-O0):
define void @__console_tx_hex32(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = icmp sgt i32 8, %5
br i1 %6, label %7, label %39
7: ; preds = %2
%8 = load i32, i32* %4
%9 = lshr i32 %8, 28
%10 = and i32 %9, 15
%11 = call i32 @__console_tx_nibble(i32 %10)
%12 = load i32, i32* %4
%13 = lshr i32 %12, 24
%14 = and i32 %13, 15
%15 = call i32 @__console_tx_nibble(i32 %14)
%16 = load i32, i32* %4
%17 = lshr i32 %16, 20
%18 = and i32 %17, 15
%19 = call i32 @__console_tx_nibble(i32 %18)
%20 = load i32, i32* %4
%21 = lshr i32 %20, 16
%22 = and i32 %21, 15
%23 = call i32 @__console_tx_nibble(i32 %22)
%24 = load i32, i32* %4
%25 = lshr i32 %24, 12
%26 = and i32 %25, 15
%27 = call i32 @__console_tx_nibble(i32 %26)
%28 = load i32, i32* %4
%29 = lshr i32 %28, 8
%30 = and i32 %29, 15
%31 = call i32 @__console_tx_nibble(i32 %30)
%32 = load i32, i32* %4
%33 = lshr i32 %32, 4
%34 = and i32 %33, 15
%35 = call i32 @__console_tx_nibble(i32 %34)
%36 = load i32, i32* %4
%37 = and i32 %36, 15
%38 = call i32 @__console_tx_nibble(i32 %37)
br label %39
39: ; preds = %7, %2
ret void
}

LLVM IR (-O2):
define void @__console_tx_hex32(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, 8
br i1 %3, label %4, label %27
4: ; preds = %2
%5 = lshr i32 %1, 28
%6 = tail call i32 @__console_tx_nibble(i32 %5)
%7 = lshr i32 %1, 24
%8 = and i32 %7, 15
%9 = tail call i32 @__console_tx_nibble(i32 %8)
%10 = lshr i32 %1, 20
%11 = and i32 %10, 15
%12 = tail call i32 @__console_tx_nibble(i32 %11)
%13 = lshr i32 %1, 16
%14 = and i32 %13, 15
%15 = tail call i32 @__console_tx_nibble(i32 %14)
%16 = lshr i32 %1, 12
%17 = and i32 %16, 15
%18 = tail call i32 @__console_tx_nibble(i32 %17)
%19 = lshr i32 %1, 8
%20 = and i32 %19, 15
%21 = tail call i32 @__console_tx_nibble(i32 %20)
%22 = lshr i32 %1, 4
%23 = and i32 %22, 15
%24 = tail call i32 @__console_tx_nibble(i32 %23)
%25 = and i32 %1, 15
%26 = tail call i32 @__console_tx_nibble(i32 %25)
br label %27
27: ; preds = %4, %2
ret void
}