#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 */
size_t convert_char_int(int /*<<< orphan*/);
int /*<<< orphan*/ get_cell(int, int);
scalar_t__ is_close(int, int, char);
scalar_t__ is_color(int, int);
int /*<<< orphan*/ printf(char *, int, int);
void avail_colo(char player, int *available) {
  int i, j;
  for (i = 0; i < 25; i++) {
    for (j = 0; j < 25; j++) {
      if ((is_color(i, j)) && (is_close(i, j, player))) {
        printf("%d %d \n", i, j);
        available[convert_char_int(get_cell(i, j))] = 1;
      }
    }
  }
}


x86 assembly (clang, -O0):
<avail_colo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x19,-0x14(%rbp)
jge    1212 <avail_colo+0xc2>
movl   $0x0,-0x18(%rbp)
cmpl   $0x19,-0x18(%rbp)
jge    11ff <avail_colo+0xaf>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1050 <is_color@plt>
cmp    $0x0,%rax
je     11ec <avail_colo+0x9c>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
movsbl -0x1(%rbp),%edx
call   1070 <is_close@plt>
cmp    $0x0,%rax
je     11ec <avail_colo+0x9c>
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xe41(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1040 <get_cell@plt>
mov    %eax,%edi
call   1060 <convert_char_int@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
movl   $0x1,(%rax,%rcx,4)
jmp    11f1 <avail_colo+0xa1>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    117a <avail_colo+0x2a>
jmp    1204 <avail_colo+0xb4>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1169 <avail_colo+0x19>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<avail_colo>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rsi,%r14
xor    %ebp,%ebp
movsbl %dil,%r12d
lea    0xe98(%rip),%r15
jmp    1178 <avail_colo+0x28>
nopw   0x0(%rax,%rax,1)
add    $0x1,%ebp
cmp    $0x19,%ebp
je     11cd <avail_colo+0x7d>
xor    %ebx,%ebx
jmp    1188 <avail_colo+0x38>
nopl   0x0(%rax)
add    $0x1,%ebx
cmp    $0x19,%ebx
je     1170 <avail_colo+0x20>
mov    %ebp,%edi
mov    %ebx,%esi
call   1050 <is_color@plt>
test   %rax,%rax
je     1180 <avail_colo+0x30>
mov    %ebp,%edi
mov    %ebx,%esi
mov    %r12d,%edx
call   1070 <is_close@plt>
test   %rax,%rax
je     1180 <avail_colo+0x30>
mov    %r15,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
mov    %ebp,%edi
mov    %ebx,%esi
call   1040 <get_cell@plt>
mov    %eax,%edi
call   1060 <convert_char_int@plt>
movl   $0x1,(%r14,%rax,4)
jmp    1180 <avail_colo+0x30>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%d %d \0A\00"
define void @avail_colo(i8 signext %0, i32* %1) {
%3 = alloca i8
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %3
store i32* %1, i32** %4
store i32 0, i32* %5
br label %7
7: ; preds = %40, %2
%8 = load i32, i32* %5
%9 = icmp slt i32 %8, 25
br i1 %9, label %10, label %43
10: ; preds = %7
store i32 0, i32* %6
br label %11
11: ; preds = %36, %10
%12 = load i32, i32* %6
%13 = icmp slt i32 %12, 25
br i1 %13, label %14, label %39
14: ; preds = %11
%15 = load i32, i32* %5
%16 = load i32, i32* %6
%17 = call i64 @is_color(i32 %15, i32 %16)
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %35
19: ; preds = %14
%20 = load i32, i32* %5
%21 = load i32, i32* %6
%22 = load i8, i8* %3
%23 = call i64 @is_close(i32 %20, i32 %21, i8 signext %22)
%24 = icmp ne i64 %23, 0
br i1 %24, label %25, label %35
25: ; preds = %19
%26 = load i32, i32* %5
%27 = load i32, i32* %6
%28 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %26, i32 %27)
%29 = load i32*, i32** %4
%30 = load i32, i32* %5
%31 = load i32, i32* %6
%32 = call i32 @get_cell(i32 %30, i32 %31)
%33 = call i64 @convert_char_int(i32 %32)
%34 = getelementptr inbounds i32, i32* %29, i64 %33
store i32 1, i32* %34
br label %35
35: ; preds = %25, %19, %14
br label %36
36: ; preds = %35
%37 = load i32, i32* %6
%38 = add nsw i32 %37, 1
store i32 %38, i32* %6
br label %11
39: ; preds = %11
br label %40
40: ; preds = %39
%41 = load i32, i32* %5
%42 = add nsw i32 %41, 1
store i32 %42, i32* %5
br label %7
43: ; preds = %7
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%d %d \0A\00"
define void @avail_colo(i8 signext %0, i32* nocapture writeonly %1) {
br label %3
3: ; preds = %2, %20
%4 = phi i32 [ 0, %2 ], [ %21, %20 ]
br label %5
5: ; preds = %3, %17
%6 = phi i32 [ 0, %3 ], [ %18, %17 ]
%7 = tail call i64 @is_color(i32 %4, i32 %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %17, label %9
9: ; preds = %5
%10 = tail call i64 @is_close(i32 %4, i32 %6, i8 signext %0)
%11 = icmp eq i64 %10, 0
br i1 %11, label %17, label %12
12: ; preds = %9
%13 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %6)
%14 = tail call i32 @get_cell(i32 %4, i32 %6)
%15 = tail call i64 @convert_char_int(i32 %14)
%16 = getelementptr inbounds i32, i32* %1, i64 %15
store i32 1, i32* %16
br label %17
17: ; preds = %5, %9, %12
%18 = add nuw nsw i32 %6, 1
%19 = icmp eq i32 %18, 25
br i1 %19, label %20, label %5
20: ; preds = %17
%21 = add nuw nsw i32 %4, 1
%22 = icmp eq i32 %21, 25
br i1 %22, label %23, label %3
23: ; preds = %20
ret void
}