#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*/ pokech(int, int /*<<< orphan*/, int, int);
int pokehint(int row, int column, int n, int color) {
  int i = 1;
  if (n > 99) {
    pokech(row, column++, '0' + n / 100, 14);
    n %= 100;
    i++;
  }
  if (n > 9) {
    pokech(row, column++, '0' + n / 10, 14);
    n %= 10;
    i++;
  }
  pokech(row, column++, '0' + n, 14);
  return i;
}


x86 assembly (clang, -O0):
<pokehint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
cmpl   $0x63,-0xc(%rbp)
jle    1174 <pokehint+0x64>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
add    $0x30,%edx
mov    $0xe,%ecx
call   1030 <pokech@plt>
mov    -0xc(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x9,-0xc(%rbp)
jle    11bd <pokehint+0xad>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
add    $0x30,%edx
mov    $0xe,%ecx
call   1030 <pokech@plt>
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%edx
add    $0x30,%edx
mov    $0xe,%ecx
call   1030 <pokech@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pokehint>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %edx,%ebx
mov    %edi,%r14d
mov    $0x1,%r12d
cmp    $0x64,%edx
jl     1157 <pokehint+0x47>
lea    0x1(%rsi),%r15d
mov    %ebx,%eax
imul   $0x51eb851f,%rax,%rbp
shr    $0x25,%rbp
lea    0x30(%rbp),%edx
mov    %r14d,%edi
mov    $0xe,%ecx
call   1030 <pokech@plt>
imul   $0x64,%ebp,%eax
sub    %eax,%ebx
mov    $0x2,%r12d
mov    %r15d,%esi
cmp    $0xa,%ebx
jl     1191 <pokehint+0x81>
lea    0x1(%rsi),%r15d
movzbl %bl,%ebx
imul   $0xcd,%ebx,%ebp
shr    $0xb,%ebp
lea    0x30(%rbp),%eax
movzbl %al,%edx
mov    %r14d,%edi
mov    $0xe,%ecx
call   1030 <pokech@plt>
add    %ebp,%ebp
lea    0x0(%rbp,%rbp,4),%eax
sub    %al,%bl
movzbl %bl,%ebx
add    $0x1,%r12d
mov    %r15d,%esi
add    $0x30,%ebx
mov    %r14d,%edi
mov    %ebx,%edx
mov    $0xe,%ecx
call   1030 <pokech@plt>
mov    %r12d,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @pokehint(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
store i32 1, i32* %9
%10 = load i32, i32* %7
%11 = icmp sgt i32 %10, 99
br i1 %11, label %12, label %24
12: ; preds = %4
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = add nsw i32 %14, 1
store i32 %15, i32* %6
%16 = load i32, i32* %7
%17 = sdiv i32 %16, 100
%18 = add nsw i32 48, %17
%19 = call i32 @pokech(i32 %13, i32 %14, i32 %18, i32 14)
%20 = load i32, i32* %7
%21 = srem i32 %20, 100
store i32 %21, i32* %7
%22 = load i32, i32* %9
%23 = add nsw i32 %22, 1
store i32 %23, i32* %9
br label %24
24: ; preds = %12, %4
%25 = load i32, i32* %7
%26 = icmp sgt i32 %25, 9
br i1 %26, label %27, label %39
27: ; preds = %24
%28 = load i32, i32* %5
%29 = load i32, i32* %6
%30 = add nsw i32 %29, 1
store i32 %30, i32* %6
%31 = load i32, i32* %7
%32 = sdiv i32 %31, 10
%33 = add nsw i32 48, %32
%34 = call i32 @pokech(i32 %28, i32 %29, i32 %33, i32 14)
%35 = load i32, i32* %7
%36 = srem i32 %35, 10
store i32 %36, i32* %7
%37 = load i32, i32* %9
%38 = add nsw i32 %37, 1
store i32 %38, i32* %9
br label %39
39: ; preds = %27, %24
%40 = load i32, i32* %5
%41 = load i32, i32* %6
%42 = add nsw i32 %41, 1
store i32 %42, i32* %6
%43 = load i32, i32* %7
%44 = add nsw i32 48, %43
%45 = call i32 @pokech(i32 %40, i32 %41, i32 %44, i32 14)
%46 = load i32, i32* %9
ret i32 %46
}

LLVM IR (-O2):
define i32 @pokehint(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp sgt i32 %2, 99
br i1 %5, label %6, label %12
6: ; preds = %4
%7 = add nsw i32 %1, 1
%8 = udiv i32 %2, 100
%9 = add nuw nsw i32 %8, 48
%10 = tail call i32 @pokech(i32 %0, i32 %1, i32 %9, i32 14)
%11 = urem i32 %2, 100
br label %12
12: ; preds = %6, %4
%13 = phi i32 [ %11, %6 ], [ %2, %4 ]
%14 = phi i32 [ %7, %6 ], [ %1, %4 ]
%15 = phi i32 [ 2, %6 ], [ 1, %4 ]
%16 = icmp sgt i32 %13, 9
br i1 %16, label %17, label %27
17: ; preds = %12
%18 = add nsw i32 %14, 1
%19 = trunc i32 %13 to i8
%20 = udiv i8 %19, 10
%21 = add nuw nsw i8 %20, 48
%22 = zext i8 %21 to i32
%23 = tail call i32 @pokech(i32 %0, i32 %14, i32 %22, i32 14)
%24 = urem i8 %19, 10
%25 = zext i8 %24 to i32
%26 = add nuw nsw i32 %15, 1
br label %27
27: ; preds = %17, %12
%28 = phi i32 [ %25, %17 ], [ %13, %12 ]
%29 = phi i32 [ %18, %17 ], [ %14, %12 ]
%30 = phi i32 [ %26, %17 ], [ %15, %12 ]
%31 = add nsw i32 %28, 48
%32 = tail call i32 @pokech(i32 %0, i32 %29, i32 %31, i32 14)
ret i32 %30
}