#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*/ outf(char *, unsigned int);
void outword(unsigned int word) {
  if (word > 0xFFFFFF)
    outf("0x%08X", word);
  else if (word > 0xFFFF)
    outf("0x%06X", word);
  else if (word > 15)
    outf("0x%X", word);
  else
    outf("%u", word);
}


x86 assembly (clang, -O0):
<outword>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xffffff,-0x4(%rbp)
jbe    113c <outword+0x2c>
mov    -0x4(%rbp),%esi
lea    0xece(%rip),%rdi
call   1030 <outf@plt>
jmp    1194 <outword+0x84>
cmpl   $0xffff,-0x4(%rbp)
jbe    115d <outword+0x4d>
mov    -0x4(%rbp),%esi
lea    0xeb4(%rip),%rdi
call   1030 <outf@plt>
jmp    118f <outword+0x7f>
cmpl   $0xf,-0x4(%rbp)
jbe    117b <outword+0x6b>
mov    -0x4(%rbp),%esi
lea    0xe9d(%rip),%rdi
call   1030 <outf@plt>
jmp    118a <outword+0x7a>
mov    -0x4(%rbp),%esi
lea    0xe8e(%rip),%rdi
call   1030 <outf@plt>
jmp    118f <outword+0x7f>
jmp    1194 <outword+0x84>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outword>:
mov    %edi,%esi
cmp    $0xffffff,%edi
jbe    1126 <outword+0x16>
lea    0xedf(%rip),%rdi
jmp    1030 <outf@plt>
cmp    $0xffff,%esi
jbe    113a <outword+0x2a>
lea    0xed2(%rip),%rdi
jmp    1030 <outf@plt>
cmp    $0x10,%esi
lea    0xeca(%rip),%rax
lea    0xec8(%rip),%rdi
cmovae %rax,%rdi
jmp    1030 <outf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"0x%08X\00"
@.str.1 = [7 x i8] c"0x%06X\00"
@.str.2 = [5 x i8] c"0x%X\00"
@.str.3 = [3 x i8] c"%u\00"
define void @outword(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ugt i32 %3, 16777215
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i32 @outf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %6)
br label %25
8: ; preds = %1
%9 = load i32, i32* %2
%10 = icmp ugt i32 %9, 65535
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = call i32 @outf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %12)
br label %24
14: ; preds = %8
%15 = load i32, i32* %2
%16 = icmp ugt i32 %15, 15
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i32, i32* %2
%19 = call i32 @outf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %18)
br label %23
20: ; preds = %14
%21 = load i32, i32* %2
%22 = call i32 @outf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %21)
br label %23
23: ; preds = %20, %17
br label %24
24: ; preds = %23, %11
br label %25
25: ; preds = %24, %5
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"0x%08X\00"
@.str.1 = [7 x i8] c"0x%06X\00"
@.str.2 = [5 x i8] c"0x%X\00"
@.str.3 = [3 x i8] c"%u\00"
define void @outword(i32 %0) {
%2 = icmp ugt i32 %0, 16777215
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = icmp ugt i32 %0, 65535
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = icmp ugt i32 %0, 15
%7 = select i1 %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0)
br label %8
8: ; preds = %5, %3, %1
%9 = phi i8* [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), %1 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), %3 ], [ %7, %5 ]
%10 = tail call i32 @outf(i8* %9, i32 %0)
ret void
}