#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*/ dbprintf(char *, ...);
void explaincol(int c) {
  dbprintf("==> ");
  if (c < 81) {
    dbprintf("row %d col %d\n", c / 9 + 1, c % 9 + 1);
  } else if (c < 162) {
    c -= 81;
    dbprintf("row %d val %d\n", c / 9 + 1, c % 9 + 1);
  } else if (c < 243) {
    c -= 162;
    dbprintf("col %d val %d\n", c / 9 + 1, c % 9 + 1);
  } else if (c < 324) {
    c -= 243;
    dbprintf("box %d val %d\n", c / 9 + 1, c % 9 + 1);
  }
}


x86 assembly (clang, -O0):
<explaincol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
mov    $0x0,%al
call   1030 <dbprintf@plt>
cmpl   $0x51,-0x4(%rbp)
jge    1164 <explaincol+0x54>
mov    -0x4(%rbp),%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
add    $0x1,%esi
mov    -0x4(%rbp),%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1030 <dbprintf@plt>
jmp    1247 <explaincol+0x137>
cmpl   $0xa2,-0x4(%rbp)
jge    11ab <explaincol+0x9b>
mov    -0x4(%rbp),%eax
sub    $0x51,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
add    $0x1,%esi
mov    -0x4(%rbp),%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
lea    0xe75(%rip),%rdi
mov    $0x0,%al
call   1030 <dbprintf@plt>
jmp    1242 <explaincol+0x132>
cmpl   $0xf3,-0x4(%rbp)
jge    11f4 <explaincol+0xe4>
mov    -0x4(%rbp),%eax
sub    $0xa2,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
add    $0x1,%esi
mov    -0x4(%rbp),%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
lea    0xe3b(%rip),%rdi
mov    $0x0,%al
call   1030 <dbprintf@plt>
jmp    123d <explaincol+0x12d>
cmpl   $0x144,-0x4(%rbp)
jge    1238 <explaincol+0x128>
mov    -0x4(%rbp),%eax
sub    $0xf3,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
add    $0x1,%esi
mov    -0x4(%rbp),%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
lea    0xe01(%rip),%rdi
mov    $0x0,%al
call   1030 <dbprintf@plt>
jmp    123d <explaincol+0x12d>
jmp    1242 <explaincol+0x132>
jmp    1247 <explaincol+0x137>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<explaincol>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rdi
xor    %eax,%eax
call   1030 <dbprintf@plt>
cmp    $0x50,%ebx
jg     115a <explaincol+0x4a>
movslq %ebx,%rax
imul   $0x38e38e39,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x21,%rax
lea    (%rax,%rcx,1),%esi
add    $0x1,%esi
add    %ecx,%eax
lea    (%rax,%rax,8),%eax
neg    %eax
lea    (%rbx,%rax,1),%edx
add    $0x1,%edx
lea    0xeb0(%rip),%rdi
jmp    11df <explaincol+0xcf>
cmp    $0xa1,%ebx
ja     1187 <explaincol+0x77>
add    $0xaf,%bl
movzbl %bl,%eax
imul   $0x39,%eax,%ecx
shr    $0x9,%ecx
lea    0x1(%rcx),%edx
movzbl %dl,%esi
lea    (%rcx,%rcx,8),%ecx
sub    %cl,%al
add    $0x1,%al
movzbl %al,%edx
lea    0xe8f(%rip),%rdi
jmp    11df <explaincol+0xcf>
cmp    $0xf2,%ebx
ja     11b4 <explaincol+0xa4>
add    $0x5e,%bl
movzbl %bl,%eax
imul   $0x39,%eax,%ecx
shr    $0x9,%ecx
lea    0x1(%rcx),%edx
movzbl %dl,%esi
lea    (%rcx,%rcx,8),%ecx
sub    %cl,%al
add    $0x1,%al
movzbl %al,%edx
lea    0xe71(%rip),%rdi
jmp    11df <explaincol+0xcf>
cmp    $0x143,%ebx
ja     11e7 <explaincol+0xd7>
add    $0xd,%bl
movzbl %bl,%eax
imul   $0x39,%eax,%ecx
shr    $0x9,%ecx
lea    0x1(%rcx),%edx
movzbl %dl,%esi
lea    (%rcx,%rcx,8),%ecx
sub    %cl,%al
add    $0x1,%al
movzbl %al,%edx
lea    0xe53(%rip),%rdi
xor    %eax,%eax
pop    %rbx
jmp    1030 <dbprintf@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"==> \00"
@.str.1 = [15 x i8] c"row %d col %d\0A\00"
@.str.2 = [15 x i8] c"row %d val %d\0A\00"
@.str.3 = [15 x i8] c"col %d val %d\0A\00"
@.str.4 = [15 x i8] c"box %d val %d\0A\00"
define void @explaincol(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i8*, ...) @dbprintf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 81
br i1 %5, label %6, label %14
6: ; preds = %1
%7 = load i32, i32* %2
%8 = sdiv i32 %7, 9
%9 = add nsw i32 %8, 1
%10 = load i32, i32* %2
%11 = srem i32 %10, 9
%12 = add nsw i32 %11, 1
%13 = call i32 (i8*, ...) @dbprintf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %9, i32 %12)
br label %56
14: ; preds = %1
%15 = load i32, i32* %2
%16 = icmp slt i32 %15, 162
br i1 %16, label %17, label %27
17: ; preds = %14
%18 = load i32, i32* %2
%19 = sub nsw i32 %18, 81
store i32 %19, i32* %2
%20 = load i32, i32* %2
%21 = sdiv i32 %20, 9
%22 = add nsw i32 %21, 1
%23 = load i32, i32* %2
%24 = srem i32 %23, 9
%25 = add nsw i32 %24, 1
%26 = call i32 (i8*, ...) @dbprintf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %22, i32 %25)
br label %55
27: ; preds = %14
%28 = load i32, i32* %2
%29 = icmp slt i32 %28, 243
br i1 %29, label %30, label %40
30: ; preds = %27
%31 = load i32, i32* %2
%32 = sub nsw i32 %31, 162
store i32 %32, i32* %2
%33 = load i32, i32* %2
%34 = sdiv i32 %33, 9
%35 = add nsw i32 %34, 1
%36 = load i32, i32* %2
%37 = srem i32 %36, 9
%38 = add nsw i32 %37, 1
%39 = call i32 (i8*, ...) @dbprintf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 %35, i32 %38)
br label %54
40: ; preds = %27
%41 = load i32, i32* %2
%42 = icmp slt i32 %41, 324
br i1 %42, label %43, label %53
43: ; preds = %40
%44 = load i32, i32* %2
%45 = sub nsw i32 %44, 243
store i32 %45, i32* %2
%46 = load i32, i32* %2
%47 = sdiv i32 %46, 9
%48 = add nsw i32 %47, 1
%49 = load i32, i32* %2
%50 = srem i32 %49, 9
%51 = add nsw i32 %50, 1
%52 = call i32 (i8*, ...) @dbprintf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i32 %48, i32 %51)
br label %53
53: ; preds = %43, %40
br label %54
54: ; preds = %53, %30
br label %55
55: ; preds = %54, %17
br label %56
56: ; preds = %55, %6
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"==> \00"
@.str.1 = [15 x i8] c"row %d col %d\0A\00"
@.str.2 = [15 x i8] c"row %d val %d\0A\00"
@.str.3 = [15 x i8] c"col %d val %d\0A\00"
@.str.4 = [15 x i8] c"box %d val %d\0A\00"
define void @explaincol(i32 %0) {
%2 = tail call i32 (i8*, ...) @dbprintf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = icmp slt i32 %0, 81
br i1 %3, label %4, label %10
4: ; preds = %1
%5 = sdiv i32 %0, 9
%6 = add nsw i32 %5, 1
%7 = srem i32 %0, 9
%8 = add nsw i32 %7, 1
%9 = tail call i32 (i8*, ...) @dbprintf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %6, i32 %8)
br label %46
10: ; preds = %1
%11 = icmp ult i32 %0, 162
br i1 %11, label %12, label %22
12: ; preds = %10
%13 = trunc i32 %0 to i8
%14 = add i8 %13, -81
%15 = udiv i8 %14, 9
%16 = add nuw nsw i8 %15, 1
%17 = zext i8 %16 to i32
%18 = urem i8 %14, 9
%19 = add nuw nsw i8 %18, 1
%20 = zext i8 %19 to i32
%21 = tail call i32 (i8*, ...) @dbprintf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %17, i32 %20)
br label %46
22: ; preds = %10
%23 = icmp ult i32 %0, 243
br i1 %23, label %24, label %34
24: ; preds = %22
%25 = trunc i32 %0 to i8
%26 = add nsw i8 %25, 94
%27 = udiv i8 %26, 9
%28 = add nuw nsw i8 %27, 1
%29 = zext i8 %28 to i32
%30 = urem i8 %26, 9
%31 = add nuw nsw i8 %30, 1
%32 = zext i8 %31 to i32
%33 = tail call i32 (i8*, ...) @dbprintf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 %29, i32 %32)
br label %46
34: ; preds = %22
%35 = icmp ult i32 %0, 324
br i1 %35, label %36, label %46
36: ; preds = %34
%37 = trunc i32 %0 to i8
%38 = add nsw i8 %37, 13
%39 = udiv i8 %38, 9
%40 = add nuw nsw i8 %39, 1
%41 = zext i8 %40 to i32
%42 = urem i8 %38, 9
%43 = add nuw nsw i8 %42, 1
%44 = zext i8 %43 to i32
%45 = tail call i32 (i8*, ...) @dbprintf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i32 %41, i32 %44)
br label %46
46: ; preds = %12, %34, %36, %24, %4
ret void
}