#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*/ stdout_put_char(unsigned int);
void print_uhex(unsigned uhex) {
  unsigned digit_3 = (uhex >> 12) & 0xf;
  unsigned digit_2 = (uhex >> 8) & 0xf;
  unsigned digit_1 = (uhex >> 4) & 0xf;
  unsigned digit_0 = uhex & 0xf;
  if (digit_3 < 9)
    stdout_put_char(digit_3 | 0x30);
  else
    stdout_put_char(digit_3 + 87);
  if (digit_2 < 9)
    stdout_put_char(digit_2 | 0x30);
  else
    stdout_put_char(digit_2 + 87);
  if (digit_1 < 9)
    stdout_put_char(digit_1 | 0x30);
  else
    stdout_put_char(digit_1 + 87);
  if (digit_0 < 9)
    stdout_put_char(digit_0 | 0x30);
  else
    stdout_put_char(digit_0 + 87);
}


x86 assembly (clang, -O0):
<print_uhex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0xc,%eax
and    $0xf,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x8,%eax
and    $0xf,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x4,%eax
and    $0xf,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x9,-0x8(%rbp)
jae    1162 <print_uhex+0x52>
mov    -0x8(%rbp),%edi
or     $0x30,%edi
call   1030 <stdout_put_char@plt>
jmp    116d <print_uhex+0x5d>
mov    -0x8(%rbp),%edi
add    $0x57,%edi
call   1030 <stdout_put_char@plt>
cmpl   $0x9,-0xc(%rbp)
jae    1187 <print_uhex+0x77>
mov    -0xc(%rbp),%edi
or     $0x30,%edi
call   1030 <stdout_put_char@plt>
jmp    1192 <print_uhex+0x82>
mov    -0xc(%rbp),%edi
add    $0x57,%edi
call   1030 <stdout_put_char@plt>
cmpl   $0x9,-0x10(%rbp)
jae    11ac <print_uhex+0x9c>
mov    -0x10(%rbp),%edi
or     $0x30,%edi
call   1030 <stdout_put_char@plt>
jmp    11b7 <print_uhex+0xa7>
mov    -0x10(%rbp),%edi
add    $0x57,%edi
call   1030 <stdout_put_char@plt>
cmpl   $0x9,-0x14(%rbp)
jae    11d1 <print_uhex+0xc1>
mov    -0x14(%rbp),%edi
or     $0x30,%edi
call   1030 <stdout_put_char@plt>
jmp    11dc <print_uhex+0xcc>
mov    -0x14(%rbp),%edi
add    $0x57,%edi
call   1030 <stdout_put_char@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_uhex>:
push   %r15
push   %r14
push   %rbx
mov    %edi,%r14d
mov    %edi,%eax
shr    $0xc,%eax
and    $0xf,%eax
mov    %edi,%ebx
shr    $0x8,%ebx
and    $0xf,%ebx
mov    %edi,%r15d
shr    $0x4,%r15d
and    $0xf,%r15d
and    $0xf,%r14d
lea    0x57(%rax),%ecx
lea    0x30(%rax),%edi
cmp    $0x9,%eax
cmovae %ecx,%edi
call   1030 <stdout_put_char@plt>
lea    0x57(%rbx),%eax
lea    0x30(%rbx),%edi
cmp    $0x9,%ebx
cmovae %eax,%edi
call   1030 <stdout_put_char@plt>
lea    0x57(%r15),%eax
lea    0x30(%r15),%edi
cmp    $0x9,%r15d
cmovae %eax,%edi
call   1030 <stdout_put_char@plt>
lea    0x57(%r14),%eax
lea    0x30(%r14),%edi
cmp    $0x9,%r14d
cmovae %eax,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <stdout_put_char@plt>

LLVM IR (-O0):
define void @print_uhex(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %2
%7 = load i32, i32* %2
%8 = lshr i32 %7, 12
%9 = and i32 %8, 15
store i32 %9, i32* %3
%10 = load i32, i32* %2
%11 = lshr i32 %10, 8
%12 = and i32 %11, 15
store i32 %12, i32* %4
%13 = load i32, i32* %2
%14 = lshr i32 %13, 4
%15 = and i32 %14, 15
store i32 %15, i32* %5
%16 = load i32, i32* %2
%17 = and i32 %16, 15
store i32 %17, i32* %6
%18 = load i32, i32* %3
%19 = icmp ult i32 %18, 9
br i1 %19, label %20, label %24
20: ; preds = %1
%21 = load i32, i32* %3
%22 = or i32 %21, 48
%23 = call i32 @stdout_put_char(i32 %22)
br label %28
24: ; preds = %1
%25 = load i32, i32* %3
%26 = add i32 %25, 87
%27 = call i32 @stdout_put_char(i32 %26)
br label %28
28: ; preds = %24, %20
%29 = load i32, i32* %4
%30 = icmp ult i32 %29, 9
br i1 %30, label %31, label %35
31: ; preds = %28
%32 = load i32, i32* %4
%33 = or i32 %32, 48
%34 = call i32 @stdout_put_char(i32 %33)
br label %39
35: ; preds = %28
%36 = load i32, i32* %4
%37 = add i32 %36, 87
%38 = call i32 @stdout_put_char(i32 %37)
br label %39
39: ; preds = %35, %31
%40 = load i32, i32* %5
%41 = icmp ult i32 %40, 9
br i1 %41, label %42, label %46
42: ; preds = %39
%43 = load i32, i32* %5
%44 = or i32 %43, 48
%45 = call i32 @stdout_put_char(i32 %44)
br label %50
46: ; preds = %39
%47 = load i32, i32* %5
%48 = add i32 %47, 87
%49 = call i32 @stdout_put_char(i32 %48)
br label %50
50: ; preds = %46, %42
%51 = load i32, i32* %6
%52 = icmp ult i32 %51, 9
br i1 %52, label %53, label %57
53: ; preds = %50
%54 = load i32, i32* %6
%55 = or i32 %54, 48
%56 = call i32 @stdout_put_char(i32 %55)
br label %61
57: ; preds = %50
%58 = load i32, i32* %6
%59 = add i32 %58, 87
%60 = call i32 @stdout_put_char(i32 %59)
br label %61
61: ; preds = %57, %53
ret void
}

LLVM IR (-O2):
define void @print_uhex(i32 %0) {
%2 = lshr i32 %0, 12
%3 = and i32 %2, 15
%4 = lshr i32 %0, 8
%5 = and i32 %4, 15
%6 = lshr i32 %0, 4
%7 = and i32 %6, 15
%8 = and i32 %0, 15
%9 = icmp ult i32 %3, 9
%10 = add nuw nsw i32 %3, 87
%11 = or i32 %3, 48
%12 = select i1 %9, i32 %11, i32 %10
%13 = tail call i32 @stdout_put_char(i32 %12)
%14 = icmp ult i32 %5, 9
%15 = add nuw nsw i32 %5, 87
%16 = or i32 %5, 48
%17 = select i1 %14, i32 %16, i32 %15
%18 = tail call i32 @stdout_put_char(i32 %17)
%19 = icmp ult i32 %7, 9
%20 = add nuw nsw i32 %7, 87
%21 = or i32 %7, 48
%22 = select i1 %19, i32 %21, i32 %20
%23 = tail call i32 @stdout_put_char(i32 %22)
%24 = icmp ult i32 %8, 9
%25 = add nuw nsw i32 %8, 87
%26 = or i32 %8, 48
%27 = select i1 %24, i32 %26, i32 %25
%28 = tail call i32 @stdout_put_char(i32 %27)
ret void
}