#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*/ debug_putc(char);
void debug_put_uint(unsigned int value) {
  int i;
  unsigned char c;
  debug_putc('0');
  debug_putc('x');
  for (i = 0; i < 8; i++) {
    c = (value & 0xf0000000) >> 28;
    if (c < 10) {
      debug_putc('0' + c);
    } else {
      debug_putc('A' + (c - 10));
    }
    value = (value & 0x0fffffff) << 4;
  }
  debug_putc(' ');
}


x86 assembly (clang, -O0):
<debug_put_uint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x30,%edi
call   1030 <debug_putc@plt>
mov    $0x78,%edi
call   1030 <debug_putc@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x8,-0x8(%rbp)
jge    119d <debug_put_uint+0x8d>
mov    -0x4(%rbp),%eax
and    $0xf0000000,%eax
shr    $0x1c,%eax
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
cmp    $0xa,%eax
jge    116f <debug_put_uint+0x5f>
movzbl -0x9(%rbp),%eax
add    $0x30,%eax
movsbl %al,%edi
call   1030 <debug_putc@plt>
jmp    1181 <debug_put_uint+0x71>
movzbl -0x9(%rbp),%eax
sub    $0xa,%eax
add    $0x41,%eax
movsbl %al,%edi
call   1030 <debug_putc@plt>
mov    -0x4(%rbp),%eax
and    $0xfffffff,%eax
shl    $0x4,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <debug_put_uint+0x26>
mov    $0x20,%edi
call   1030 <debug_putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<debug_put_uint>:
push   %rbx
mov    %edi,%ebx
mov    $0x30,%edi
call   1030 <debug_putc@plt>
mov    $0x78,%edi
call   1030 <debug_putc@plt>
mov    %ebx,%eax
shr    $0x1c,%eax
lea    0x37(%rax),%ecx
or     $0x30,%al
cmp    $0xa0000000,%ebx
movzbl %al,%eax
movzbl %cl,%ecx
cmovb  %eax,%ecx
movzbl %cl,%edi
call   1030 <debug_putc@plt>
mov    %ebx,%eax
shl    $0x4,%eax
mov    %eax,%ecx
shr    $0x1c,%ecx
lea    0x30(%rcx),%edx
add    $0x37,%cl
cmp    $0xa0000000,%eax
movzbl %dl,%eax
movzbl %cl,%ecx
cmovb  %eax,%ecx
movzbl %cl,%edi
call   1030 <debug_putc@plt>
mov    %ebx,%eax
shl    $0x8,%eax
mov    %eax,%ecx
shr    $0x1c,%ecx
lea    0x30(%rcx),%edx
add    $0x37,%cl
cmp    $0xa0000000,%eax
movzbl %dl,%eax
movzbl %cl,%ecx
cmovb  %eax,%ecx
movzbl %cl,%edi
call   1030 <debug_putc@plt>
mov    %ebx,%eax
shl    $0xc,%eax
mov    %eax,%ecx
shr    $0x1c,%ecx
lea    0x30(%rcx),%edx
add    $0x37,%cl
cmp    $0xa0000000,%eax
movzbl %dl,%eax
movzbl %cl,%ecx
cmovb  %eax,%ecx
movzbl %cl,%edi
call   1030 <debug_putc@plt>
mov    %ebx,%eax
shl    $0x10,%eax
mov    %eax,%ecx
shr    $0x1c,%ecx
lea    0x30(%rcx),%edx
add    $0x37,%cl
cmp    $0xa0000000,%eax
movzbl %dl,%eax
movzbl %cl,%ecx
cmovb  %eax,%ecx
movzbl %cl,%edi
call   1030 <debug_putc@plt>
mov    %ebx,%eax
shl    $0x14,%eax
mov    %eax,%ecx
shr    $0x1c,%ecx
lea    0x30(%rcx),%edx
add    $0x37,%cl
cmp    $0xa0000000,%eax
movzbl %dl,%eax
movzbl %cl,%ecx
cmovb  %eax,%ecx
movzbl %cl,%edi
call   1030 <debug_putc@plt>
mov    %ebx,%eax
shl    $0x18,%eax
mov    %eax,%ecx
shr    $0x1c,%ecx
lea    0x30(%rcx),%edx
add    $0x37,%cl
cmp    $0xa0000000,%eax
movzbl %dl,%eax
movzbl %cl,%ecx
cmovb  %eax,%ecx
movzbl %cl,%edi
call   1030 <debug_putc@plt>
mov    %ebx,%eax
shl    $0x1c,%eax
and    $0xf,%bl
lea    0x30(%rbx),%ecx
add    $0x37,%bl
cmp    $0xa0000000,%eax
movzbl %cl,%eax
movzbl %bl,%ecx
cmovb  %eax,%ecx
movzbl %cl,%edi
call   1030 <debug_putc@plt>
mov    $0x20,%edi
pop    %rbx
jmp    1030 <debug_putc@plt>

LLVM IR (-O0):
define void @debug_put_uint(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8
store i32 %0, i32* %2
%5 = call i32 @debug_putc(i8 signext 48)
%6 = call i32 @debug_putc(i8 signext 120)
store i32 0, i32* %3
br label %7
7: ; preds = %35, %1
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 8
br i1 %9, label %10, label %38
10: ; preds = %7
%11 = load i32, i32* %2
%12 = and i32 %11, -268435456
%13 = lshr i32 %12, 28
%14 = trunc i32 %13 to i8
store i8 %14, i8* %4
%15 = load i8, i8* %4
%16 = zext i8 %15 to i32
%17 = icmp slt i32 %16, 10
br i1 %17, label %18, label %24
18: ; preds = %10
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = add nsw i32 48, %20
%22 = trunc i32 %21 to i8
%23 = call i32 @debug_putc(i8 signext %22)
br label %31
24: ; preds = %10
%25 = load i8, i8* %4
%26 = zext i8 %25 to i32
%27 = sub nsw i32 %26, 10
%28 = add nsw i32 65, %27
%29 = trunc i32 %28 to i8
%30 = call i32 @debug_putc(i8 signext %29)
br label %31
31: ; preds = %24, %18
%32 = load i32, i32* %2
%33 = and i32 %32, 268435455
%34 = shl i32 %33, 4
store i32 %34, i32* %2
br label %35
35: ; preds = %31
%36 = load i32, i32* %3
%37 = add nsw i32 %36, 1
store i32 %37, i32* %3
br label %7
38: ; preds = %7
%39 = call i32 @debug_putc(i8 signext 32)
ret void
}

LLVM IR (-O2):
define void @debug_put_uint(i32 %0) {
%2 = tail call i32 @debug_putc(i8 signext 48)
%3 = tail call i32 @debug_putc(i8 signext 120)
%4 = lshr i32 %0, 28
%5 = icmp ult i32 %0, -1610612736
%6 = trunc i32 %4 to i8
%7 = add nuw nsw i8 %6, 55
%8 = or i8 %6, 48
%9 = select i1 %5, i8 %8, i8 %7
%10 = tail call i32 @debug_putc(i8 signext %9)
%11 = shl i32 %0, 4
%12 = lshr i32 %11, 28
%13 = icmp ult i32 %11, -1610612736
%14 = trunc i32 %12 to i8
%15 = or i8 %14, 48
%16 = trunc i32 %12 to i8
%17 = add nuw nsw i8 %16, 55
%18 = select i1 %13, i8 %15, i8 %17
%19 = tail call i32 @debug_putc(i8 signext %18)
%20 = shl i32 %0, 8
%21 = lshr i32 %20, 28
%22 = icmp ult i32 %20, -1610612736
%23 = trunc i32 %21 to i8
%24 = or i8 %23, 48
%25 = trunc i32 %21 to i8
%26 = add nuw nsw i8 %25, 55
%27 = select i1 %22, i8 %24, i8 %26
%28 = tail call i32 @debug_putc(i8 signext %27)
%29 = shl i32 %0, 12
%30 = lshr i32 %29, 28
%31 = icmp ult i32 %29, -1610612736
%32 = trunc i32 %30 to i8
%33 = or i8 %32, 48
%34 = trunc i32 %30 to i8
%35 = add nuw nsw i8 %34, 55
%36 = select i1 %31, i8 %33, i8 %35
%37 = tail call i32 @debug_putc(i8 signext %36)
%38 = shl i32 %0, 16
%39 = lshr i32 %38, 28
%40 = icmp ult i32 %38, -1610612736
%41 = trunc i32 %39 to i8
%42 = or i8 %41, 48
%43 = trunc i32 %39 to i8
%44 = add nuw nsw i8 %43, 55
%45 = select i1 %40, i8 %42, i8 %44
%46 = tail call i32 @debug_putc(i8 signext %45)
%47 = shl i32 %0, 20
%48 = lshr i32 %47, 28
%49 = icmp ult i32 %47, -1610612736
%50 = trunc i32 %48 to i8
%51 = or i8 %50, 48
%52 = trunc i32 %48 to i8
%53 = add nuw nsw i8 %52, 55
%54 = select i1 %49, i8 %51, i8 %53
%55 = tail call i32 @debug_putc(i8 signext %54)
%56 = shl i32 %0, 24
%57 = lshr i32 %56, 28
%58 = icmp ult i32 %56, -1610612736
%59 = trunc i32 %57 to i8
%60 = or i8 %59, 48
%61 = trunc i32 %57 to i8
%62 = add nuw nsw i8 %61, 55
%63 = select i1 %58, i8 %60, i8 %62
%64 = tail call i32 @debug_putc(i8 signext %63)
%65 = shl i32 %0, 28
%66 = and i32 %0, 15
%67 = icmp ult i32 %65, -1610612736
%68 = trunc i32 %66 to i8
%69 = or i8 %68, 48
%70 = trunc i32 %66 to i8
%71 = add nuw nsw i8 %70, 55
%72 = select i1 %67, i8 %69, i8 %71
%73 = tail call i32 @debug_putc(i8 signext %72)
%74 = tail call i32 @debug_putc(i8 signext 32)
ret void
}