#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*/ RPI_AuxMiniUartWrite(int);
void dump_hex(unsigned int value) {
  int i;
  for (i = 0; i < 8; i++) {
    int c = value >> 28;
    if (c < 10) {
      c = '0' + c;
    } else {
      c = 'A' + c - 10;
    }
    RPI_AuxMiniUartWrite(c);
    value <<= 4;
  }
}


x86 assembly (clang, -O0):
<dump_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x8,-0x8(%rbp)
jge    1178 <dump_hex+0x68>
mov    -0x4(%rbp),%eax
shr    $0x1c,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    114d <dump_hex+0x3d>
mov    -0xc(%rbp),%eax
add    $0x30,%eax
mov    %eax,-0xc(%rbp)
jmp    1159 <dump_hex+0x49>
mov    -0xc(%rbp),%eax
add    $0x41,%eax
sub    $0xa,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <RPI_AuxMiniUartWrite@plt>
mov    -0x4(%rbp),%eax
shl    $0x4,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <dump_hex+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_hex>:
push   %rbx
mov    %edi,%ebx
shr    $0x1c,%edi
lea    0x30(%rdi),%eax
add    $0x37,%edi
cmp    $0xa0000000,%ebx
cmovb  %eax,%edi
call   1030 <RPI_AuxMiniUartWrite@plt>
mov    %ebx,%eax
shl    $0x4,%eax
mov    %eax,%edi
shr    $0x1c,%edi
lea    0x30(%rdi),%ecx
add    $0x37,%edi
cmp    $0xa0000000,%eax
cmovb  %ecx,%edi
call   1030 <RPI_AuxMiniUartWrite@plt>
mov    %ebx,%eax
shl    $0x8,%eax
mov    %eax,%edi
shr    $0x1c,%edi
lea    0x30(%rdi),%ecx
add    $0x37,%edi
cmp    $0xa0000000,%eax
cmovb  %ecx,%edi
call   1030 <RPI_AuxMiniUartWrite@plt>
mov    %ebx,%eax
shl    $0xc,%eax
mov    %eax,%edi
shr    $0x1c,%edi
lea    0x30(%rdi),%ecx
add    $0x37,%edi
cmp    $0xa0000000,%eax
cmovb  %ecx,%edi
call   1030 <RPI_AuxMiniUartWrite@plt>
mov    %ebx,%eax
shl    $0x10,%eax
mov    %eax,%edi
shr    $0x1c,%edi
lea    0x30(%rdi),%ecx
add    $0x37,%edi
cmp    $0xa0000000,%eax
cmovb  %ecx,%edi
call   1030 <RPI_AuxMiniUartWrite@plt>
mov    %ebx,%eax
shl    $0x14,%eax
mov    %eax,%edi
shr    $0x1c,%edi
lea    0x30(%rdi),%ecx
add    $0x37,%edi
cmp    $0xa0000000,%eax
cmovb  %ecx,%edi
call   1030 <RPI_AuxMiniUartWrite@plt>
mov    %ebx,%eax
shl    $0x18,%eax
mov    %eax,%edi
shr    $0x1c,%edi
lea    0x30(%rdi),%ecx
add    $0x37,%edi
cmp    $0xa0000000,%eax
cmovb  %ecx,%edi
call   1030 <RPI_AuxMiniUartWrite@plt>
mov    %ebx,%eax
shl    $0x1c,%eax
and    $0xf,%ebx
lea    0x30(%rbx),%ecx
add    $0x37,%ebx
cmp    $0xa0000000,%eax
cmovb  %ecx,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <RPI_AuxMiniUartWrite@plt>

LLVM IR (-O0):
define void @dump_hex(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %5
5: ; preds = %25, %1
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 8
br i1 %7, label %8, label %28
8: ; preds = %5
%9 = load i32, i32* %2
%10 = lshr i32 %9, 28
store i32 %10, i32* %4
%11 = load i32, i32* %4
%12 = icmp slt i32 %11, 10
br i1 %12, label %13, label %16
13: ; preds = %8
%14 = load i32, i32* %4
%15 = add nsw i32 48, %14
store i32 %15, i32* %4
br label %20
16: ; preds = %8
%17 = load i32, i32* %4
%18 = add nsw i32 65, %17
%19 = sub nsw i32 %18, 10
store i32 %19, i32* %4
br label %20
20: ; preds = %16, %13
%21 = load i32, i32* %4
%22 = call i32 @RPI_AuxMiniUartWrite(i32 %21)
%23 = load i32, i32* %2
%24 = shl i32 %23, 4
store i32 %24, i32* %2
br label %25
25: ; preds = %20
%26 = load i32, i32* %3
%27 = add nsw i32 %26, 1
store i32 %27, i32* %3
br label %5
28: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @dump_hex(i32 %0) {
%2 = lshr i32 %0, 28
%3 = icmp ult i32 %0, -1610612736
%4 = or i32 %2, 48
%5 = add nuw nsw i32 %2, 55
%6 = select i1 %3, i32 %4, i32 %5
%7 = tail call i32 @RPI_AuxMiniUartWrite(i32 %6)
%8 = shl i32 %0, 4
%9 = lshr i32 %8, 28
%10 = icmp ult i32 %8, -1610612736
%11 = or i32 %9, 48
%12 = add nuw nsw i32 %9, 55
%13 = select i1 %10, i32 %11, i32 %12
%14 = tail call i32 @RPI_AuxMiniUartWrite(i32 %13)
%15 = shl i32 %0, 8
%16 = lshr i32 %15, 28
%17 = icmp ult i32 %15, -1610612736
%18 = or i32 %16, 48
%19 = add nuw nsw i32 %16, 55
%20 = select i1 %17, i32 %18, i32 %19
%21 = tail call i32 @RPI_AuxMiniUartWrite(i32 %20)
%22 = shl i32 %0, 12
%23 = lshr i32 %22, 28
%24 = icmp ult i32 %22, -1610612736
%25 = or i32 %23, 48
%26 = add nuw nsw i32 %23, 55
%27 = select i1 %24, i32 %25, i32 %26
%28 = tail call i32 @RPI_AuxMiniUartWrite(i32 %27)
%29 = shl i32 %0, 16
%30 = lshr i32 %29, 28
%31 = icmp ult i32 %29, -1610612736
%32 = or i32 %30, 48
%33 = add nuw nsw i32 %30, 55
%34 = select i1 %31, i32 %32, i32 %33
%35 = tail call i32 @RPI_AuxMiniUartWrite(i32 %34)
%36 = shl i32 %0, 20
%37 = lshr i32 %36, 28
%38 = icmp ult i32 %36, -1610612736
%39 = or i32 %37, 48
%40 = add nuw nsw i32 %37, 55
%41 = select i1 %38, i32 %39, i32 %40
%42 = tail call i32 @RPI_AuxMiniUartWrite(i32 %41)
%43 = shl i32 %0, 24
%44 = lshr i32 %43, 28
%45 = icmp ult i32 %43, -1610612736
%46 = or i32 %44, 48
%47 = add nuw nsw i32 %44, 55
%48 = select i1 %45, i32 %46, i32 %47
%49 = tail call i32 @RPI_AuxMiniUartWrite(i32 %48)
%50 = shl i32 %0, 28
%51 = and i32 %0, 15
%52 = icmp ult i32 %50, -1610612736
%53 = or i32 %51, 48
%54 = add nuw nsw i32 %51, 55
%55 = select i1 %52, i32 %53, i32 %54
%56 = tail call i32 @RPI_AuxMiniUartWrite(i32 %55)
ret void
}