#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 */
scalar_t__ on_csquare(short, short, short);
short on_column(short side, short piece, short c) {
  short sq;
  for (sq = c; sq < 81; sq += 9) {
    if (on_csquare(side, piece, sq))
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<on_column>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dx,%ax
mov    %si,%cx
mov    %di,%dx
mov    %dx,-0x4(%rbp)
mov    %cx,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    -0x8(%rbp),%ax
mov    %ax,-0xa(%rbp)
movswl -0xa(%rbp),%eax
cmp    $0x51,%eax
jge    1183 <on_column+0x73>
mov    -0x4(%rbp),%cx
mov    -0x6(%rbp),%ax
movswl %cx,%edi
movswl %ax,%esi
movswl -0xa(%rbp),%edx
call   1030 <on_csquare@plt>
cmp    $0x0,%rax
je     116e <on_column+0x5e>
movw   $0x1,-0x2(%rbp)
jmp    1189 <on_column+0x79>
jmp    1173 <on_column+0x63>
movswl -0xa(%rbp),%eax
add    $0x9,%eax
mov    %ax,-0xa(%rbp)
jmp    1135 <on_column+0x25>
movw   $0x0,-0x2(%rbp)
movswl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<on_column>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
cmp    $0x50,%bx
jg     114d <on_column+0x3d>
movswl %di,%r14d
movswl %si,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movswl %bx,%edx
mov    %r14d,%edi
mov    %ebp,%esi
call   1030 <on_csquare@plt>
test   %rax,%rax
jne    1151 <on_column+0x41>
lea    0x9(%rbx),%eax
cmp    $0x47,%bx
mov    %eax,%ebx
jle    1130 <on_column+0x20>
xor    %eax,%eax
jmp    1155 <on_column+0x45>
mov    $0x1,%ax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define signext i16 @on_column(i16 signext %0, i16 signext %1, i16 signext %2) {
%4 = alloca i16
%5 = alloca i16
%6 = alloca i16
%7 = alloca i16
%8 = alloca i16
store i16 %0, i16* %5
store i16 %1, i16* %6
store i16 %2, i16* %7
%9 = load i16, i16* %7
store i16 %9, i16* %8
br label %10
10: ; preds = %22, %3
%11 = load i16, i16* %8
%12 = sext i16 %11 to i32
%13 = icmp slt i32 %12, 81
br i1 %13, label %14, label %27
14: ; preds = %10
%15 = load i16, i16* %5
%16 = load i16, i16* %6
%17 = load i16, i16* %8
%18 = call i64 @on_csquare(i16 signext %15, i16 signext %16, i16 signext %17)
%19 = icmp ne i64 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %14
store i16 1, i16* %4
br label %28
21: ; preds = %14
br label %22
22: ; preds = %21
%23 = load i16, i16* %8
%24 = sext i16 %23 to i32
%25 = add nsw i32 %24, 9
%26 = trunc i32 %25 to i16
store i16 %26, i16* %8
br label %10
27: ; preds = %10
store i16 0, i16* %4
br label %28
28: ; preds = %27, %20
%29 = load i16, i16* %4
ret i16 %29
}

LLVM IR (-O2):
define signext i16 @on_column(i16 signext %0, i16 signext %1, i16 signext %2) {
%4 = icmp slt i16 %2, 81
br i1 %4, label %8, label %12
5: ; preds = %8
%6 = add nsw i16 %9, 9
%7 = icmp slt i16 %9, 72
br i1 %7, label %8, label %12
8: ; preds = %3, %5
%9 = phi i16 [ %6, %5 ], [ %2, %3 ]
%10 = tail call i64 @on_csquare(i16 signext %0, i16 signext %1, i16 signext %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %5, label %12
12: ; preds = %8, %5, %3
%13 = phi i16 [ 0, %3 ], [ 0, %5 ], [ 1, %8 ]
ret i16 %13
}