#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*/ DrawCharacter(unsigned int, unsigned int, unsigned int);
void print_number(unsigned int number, unsigned int x, unsigned int y) {
  unsigned int nibble, i, j;
  DrawCharacter('0', x, y);
  x += 10;
  DrawCharacter('x', x, y);
  x += 10;
  for (i = 0; i < 8; i++) {
    nibble = number;
    nibble >>= 28;
    number <<= 4;
    if (nibble < 0x0A) {
      DrawCharacter(nibble + '0', x, y);
      x += 10;
    } else {
      DrawCharacter(nibble - 10 + 'A', x, y);
      x += 10;
    }
  }
}


x86 assembly (clang, -O0):
<print_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    $0x30,%edi
call   1030 <DrawCharacter@plt>
mov    -0x8(%rbp),%eax
add    $0xa,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    $0x78,%edi
call   1030 <DrawCharacter@plt>
mov    -0x8(%rbp),%eax
add    $0xa,%eax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x8,-0x14(%rbp)
jae    11d5 <print_number+0xc5>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
shr    $0x1c,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x4,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0xa,-0x10(%rbp)
jae    11a5 <print_number+0x95>
mov    -0x10(%rbp),%edi
add    $0x30,%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <DrawCharacter@plt>
mov    -0x8(%rbp),%eax
add    $0xa,%eax
mov    %eax,-0x8(%rbp)
jmp    11c2 <print_number+0xb2>
mov    -0x10(%rbp),%edi
sub    $0xa,%edi
add    $0x41,%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <DrawCharacter@plt>
mov    -0x8(%rbp),%eax
add    $0xa,%eax
mov    %eax,-0x8(%rbp)
jmp    11c7 <print_number+0xb7>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    115a <print_number+0x4a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_number>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %edx,%r14d
mov    %esi,%r15d
mov    %edi,%r12d
mov    $0x30,%edi
call   1030 <DrawCharacter@plt>
lea    0xa(%r15),%esi
mov    $0x78,%edi
mov    %r14d,%edx
call   1030 <DrawCharacter@plt>
lea    0x14(%r15),%esi
mov    %r12d,%edi
shr    $0x1c,%edi
mov    %r12d,%ebx
shl    $0x4,%ebx
lea    0x30(%rdi),%eax
add    $0x37,%edi
cmp    $0xa0000000,%r12d
cmovb  %eax,%edi
mov    %r14d,%edx
call   1030 <DrawCharacter@plt>
lea    0x1e(%r15),%esi
mov    %ebx,%edi
shr    $0x1c,%edi
mov    %r12d,%ebp
shl    $0x8,%ebp
lea    0x30(%rdi),%eax
add    $0x37,%edi
cmp    $0xa0000000,%ebx
cmovb  %eax,%edi
mov    %r14d,%edx
call   1030 <DrawCharacter@plt>
lea    0x28(%r15),%esi
mov    %ebp,%edi
shr    $0x1c,%edi
mov    %r12d,%ebx
shl    $0xc,%ebx
lea    0x30(%rdi),%eax
add    $0x37,%edi
cmp    $0xa0000000,%ebp
cmovb  %eax,%edi
mov    %r14d,%edx
call   1030 <DrawCharacter@plt>
lea    0x32(%r15),%esi
mov    %ebx,%edi
shr    $0x1c,%edi
mov    %r12d,%ebp
shl    $0x10,%ebp
lea    0x30(%rdi),%eax
add    $0x37,%edi
cmp    $0xa0000000,%ebx
cmovb  %eax,%edi
mov    %r14d,%edx
call   1030 <DrawCharacter@plt>
lea    0x3c(%r15),%esi
mov    %ebp,%edi
shr    $0x1c,%edi
mov    %r12d,%ebx
shl    $0x14,%ebx
lea    0x30(%rdi),%eax
add    $0x37,%edi
cmp    $0xa0000000,%ebp
cmovb  %eax,%edi
mov    %r14d,%edx
call   1030 <DrawCharacter@plt>
lea    0x46(%r15),%esi
mov    %ebx,%edi
shr    $0x1c,%edi
mov    %r12d,%ebp
shl    $0x18,%ebp
lea    0x30(%rdi),%eax
add    $0x37,%edi
cmp    $0xa0000000,%ebx
cmovb  %eax,%edi
mov    %r14d,%edx
call   1030 <DrawCharacter@plt>
lea    0x50(%r15),%esi
mov    %ebp,%edi
shr    $0x1c,%edi
mov    %r12d,%ebx
shl    $0x1c,%ebx
lea    0x30(%rdi),%eax
add    $0x37,%edi
cmp    $0xa0000000,%ebp
cmovb  %eax,%edi
mov    %r14d,%edx
call   1030 <DrawCharacter@plt>
add    $0x5a,%r15d
and    $0xf,%r12d
lea    0x30(%r12),%eax
add    $0x37,%r12d
cmp    $0xa0000000,%ebx
cmovb  %eax,%r12d
mov    %r12d,%edi
mov    %r15d,%esi
mov    %r14d,%edx
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <DrawCharacter@plt>

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

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