#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 */
struct Field {
  int dummy;
};

/* Variables and functions */
scalar_t__ check_fitting_cell(struct Field const *, int, int);
int check_fitting_cells(const struct Field *map, int left, int top) {
  if (check_fitting_cell(map, left, top) == 0)
    return 0;
  if (check_fitting_cell(map, left - 1, top - 1) == 0)
    return 0;
  if (check_fitting_cell(map, left, top - 1) == 0)
    return 0;
  if (check_fitting_cell(map, left + 1, top - 1) == 0)
    return 0;
  if (check_fitting_cell(map, left + 1, top) == 0)
    return 0;
  if (check_fitting_cell(map, left + 1, top + 1) == 0)
    return 0;
  if (check_fitting_cell(map, left, top + 1) == 0)
    return 0;
  if (check_fitting_cell(map, left - 1, top + 1) == 0)
    return 0;
  if (check_fitting_cell(map, left - 1, top) == 0)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<check_fitting_cells>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1030 <check_fitting_cell@plt>
cmp    $0x0,%rax
jne    1147 <check_fitting_cells+0x37>
movl   $0x0,-0x4(%rbp)
jmp    129a <check_fitting_cells+0x18a>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
sub    $0x1,%esi
mov    -0x18(%rbp),%edx
sub    $0x1,%edx
call   1030 <check_fitting_cell@plt>
cmp    $0x0,%rax
jne    1172 <check_fitting_cells+0x62>
movl   $0x0,-0x4(%rbp)
jmp    129a <check_fitting_cells+0x18a>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
sub    $0x1,%edx
call   1030 <check_fitting_cell@plt>
cmp    $0x0,%rax
jne    119a <check_fitting_cells+0x8a>
movl   $0x0,-0x4(%rbp)
jmp    129a <check_fitting_cells+0x18a>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x18(%rbp),%edx
sub    $0x1,%edx
call   1030 <check_fitting_cell@plt>
cmp    $0x0,%rax
jne    11c5 <check_fitting_cells+0xb5>
movl   $0x0,-0x4(%rbp)
jmp    129a <check_fitting_cells+0x18a>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x18(%rbp),%edx
call   1030 <check_fitting_cell@plt>
cmp    $0x0,%rax
jne    11ed <check_fitting_cells+0xdd>
movl   $0x0,-0x4(%rbp)
jmp    129a <check_fitting_cells+0x18a>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x18(%rbp),%edx
add    $0x1,%edx
call   1030 <check_fitting_cell@plt>
cmp    $0x0,%rax
jne    1218 <check_fitting_cells+0x108>
movl   $0x0,-0x4(%rbp)
jmp    129a <check_fitting_cells+0x18a>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
add    $0x1,%edx
call   1030 <check_fitting_cell@plt>
cmp    $0x0,%rax
jne    1240 <check_fitting_cells+0x130>
movl   $0x0,-0x4(%rbp)
jmp    129a <check_fitting_cells+0x18a>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
sub    $0x1,%esi
mov    -0x18(%rbp),%edx
add    $0x1,%edx
call   1030 <check_fitting_cell@plt>
cmp    $0x0,%rax
jne    126b <check_fitting_cells+0x15b>
movl   $0x0,-0x4(%rbp)
jmp    129a <check_fitting_cells+0x18a>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
sub    $0x1,%esi
mov    -0x18(%rbp),%edx
call   1030 <check_fitting_cell@plt>
cmp    $0x0,%rax
jne    1293 <check_fitting_cells+0x183>
movl   $0x0,-0x4(%rbp)
jmp    129a <check_fitting_cells+0x18a>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_fitting_cells>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %edx,%r12d
mov    %esi,%ebx
mov    %rdi,%r13
call   1030 <check_fitting_cell@plt>
xor    %r14d,%r14d
test   %rax,%rax
je     11ea <check_fitting_cells+0xda>
lea    -0x1(%rbx),%r15d
lea    -0x1(%r12),%ebp
mov    %r13,%rdi
mov    %r15d,%esi
mov    %ebp,%edx
call   1030 <check_fitting_cell@plt>
test   %rax,%rax
je     11ea <check_fitting_cells+0xda>
mov    %r13,%rdi
mov    %ebx,%esi
mov    %ebp,%edx
call   1030 <check_fitting_cell@plt>
test   %rax,%rax
je     11ea <check_fitting_cells+0xda>
mov    %r15d,0x4(%rsp)
lea    0x1(%rbx),%r15d
mov    %r13,%rdi
mov    %r15d,%esi
mov    %ebp,%edx
call   1030 <check_fitting_cell@plt>
test   %rax,%rax
je     11ea <check_fitting_cells+0xda>
mov    %r13,%rdi
mov    %r15d,%esi
mov    %r12d,%edx
call   1030 <check_fitting_cell@plt>
test   %rax,%rax
je     11ea <check_fitting_cells+0xda>
lea    0x1(%r12),%ebp
mov    %r13,%rdi
mov    %r15d,%esi
mov    %ebp,%edx
call   1030 <check_fitting_cell@plt>
test   %rax,%rax
je     11ea <check_fitting_cells+0xda>
mov    %r13,%rdi
mov    %ebx,%esi
mov    %ebp,%edx
call   1030 <check_fitting_cell@plt>
test   %rax,%rax
je     11ea <check_fitting_cells+0xda>
mov    %r13,%rdi
mov    0x4(%rsp),%ebx
mov    %ebx,%esi
mov    %ebp,%edx
call   1030 <check_fitting_cell@plt>
test   %rax,%rax
je     11ea <check_fitting_cells+0xda>
mov    %r13,%rdi
mov    %ebx,%esi
mov    %r12d,%edx
call   1030 <check_fitting_cell@plt>
xor    %r14d,%r14d
test   %rax,%rax
setne  %r14b
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.Field = type { i32 }
define i32 @check_fitting_cells(%struct.Field* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.Field*
%6 = alloca i32
%7 = alloca i32
store %struct.Field* %0, %struct.Field** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load %struct.Field*, %struct.Field** %5
%9 = load i32, i32* %6
%10 = load i32, i32* %7
%11 = call i64 @check_fitting_cell(%struct.Field* %8, i32 %9, i32 %10)
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %3
store i32 0, i32* %4
br label %83
14: ; preds = %3
%15 = load %struct.Field*, %struct.Field** %5
%16 = load i32, i32* %6
%17 = sub nsw i32 %16, 1
%18 = load i32, i32* %7
%19 = sub nsw i32 %18, 1
%20 = call i64 @check_fitting_cell(%struct.Field* %15, i32 %17, i32 %19)
%21 = icmp eq i64 %20, 0
br i1 %21, label %22, label %23
22: ; preds = %14
store i32 0, i32* %4
br label %83
23: ; preds = %14
%24 = load %struct.Field*, %struct.Field** %5
%25 = load i32, i32* %6
%26 = load i32, i32* %7
%27 = sub nsw i32 %26, 1
%28 = call i64 @check_fitting_cell(%struct.Field* %24, i32 %25, i32 %27)
%29 = icmp eq i64 %28, 0
br i1 %29, label %30, label %31
30: ; preds = %23
store i32 0, i32* %4
br label %83
31: ; preds = %23
%32 = load %struct.Field*, %struct.Field** %5
%33 = load i32, i32* %6
%34 = add nsw i32 %33, 1
%35 = load i32, i32* %7
%36 = sub nsw i32 %35, 1
%37 = call i64 @check_fitting_cell(%struct.Field* %32, i32 %34, i32 %36)
%38 = icmp eq i64 %37, 0
br i1 %38, label %39, label %40
39: ; preds = %31
store i32 0, i32* %4
br label %83
40: ; preds = %31
%41 = load %struct.Field*, %struct.Field** %5
%42 = load i32, i32* %6
%43 = add nsw i32 %42, 1
%44 = load i32, i32* %7
%45 = call i64 @check_fitting_cell(%struct.Field* %41, i32 %43, i32 %44)
%46 = icmp eq i64 %45, 0
br i1 %46, label %47, label %48
47: ; preds = %40
store i32 0, i32* %4
br label %83
48: ; preds = %40
%49 = load %struct.Field*, %struct.Field** %5
%50 = load i32, i32* %6
%51 = add nsw i32 %50, 1
%52 = load i32, i32* %7
%53 = add nsw i32 %52, 1
%54 = call i64 @check_fitting_cell(%struct.Field* %49, i32 %51, i32 %53)
%55 = icmp eq i64 %54, 0
br i1 %55, label %56, label %57
56: ; preds = %48
store i32 0, i32* %4
br label %83
57: ; preds = %48
%58 = load %struct.Field*, %struct.Field** %5
%59 = load i32, i32* %6
%60 = load i32, i32* %7
%61 = add nsw i32 %60, 1
%62 = call i64 @check_fitting_cell(%struct.Field* %58, i32 %59, i32 %61)
%63 = icmp eq i64 %62, 0
br i1 %63, label %64, label %65
64: ; preds = %57
store i32 0, i32* %4
br label %83
65: ; preds = %57
%66 = load %struct.Field*, %struct.Field** %5
%67 = load i32, i32* %6
%68 = sub nsw i32 %67, 1
%69 = load i32, i32* %7
%70 = add nsw i32 %69, 1
%71 = call i64 @check_fitting_cell(%struct.Field* %66, i32 %68, i32 %70)
%72 = icmp eq i64 %71, 0
br i1 %72, label %73, label %74
73: ; preds = %65
store i32 0, i32* %4
br label %83
74: ; preds = %65
%75 = load %struct.Field*, %struct.Field** %5
%76 = load i32, i32* %6
%77 = sub nsw i32 %76, 1
%78 = load i32, i32* %7
%79 = call i64 @check_fitting_cell(%struct.Field* %75, i32 %77, i32 %78)
%80 = icmp eq i64 %79, 0
br i1 %80, label %81, label %82
81: ; preds = %74
store i32 0, i32* %4
br label %83
82: ; preds = %74
store i32 1, i32* %4
br label %83
83: ; preds = %82, %81, %73, %64, %56, %47, %39, %30, %22, %13
%84 = load i32, i32* %4
ret i32 %84
}

LLVM IR (-O2):
%struct.Field = type { i32 }
define i32 @check_fitting_cells(%struct.Field* %0, i32 %1, i32 %2) {
%4 = tail call i64 @check_fitting_cell(%struct.Field* %0, i32 %1, i32 %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %35, label %6
6: ; preds = %3
%7 = add nsw i32 %1, -1
%8 = add nsw i32 %2, -1
%9 = tail call i64 @check_fitting_cell(%struct.Field* %0, i32 %7, i32 %8)
%10 = icmp eq i64 %9, 0
br i1 %10, label %35, label %11
11: ; preds = %6
%12 = tail call i64 @check_fitting_cell(%struct.Field* %0, i32 %1, i32 %8)
%13 = icmp eq i64 %12, 0
br i1 %13, label %35, label %14
14: ; preds = %11
%15 = add nsw i32 %1, 1
%16 = tail call i64 @check_fitting_cell(%struct.Field* %0, i32 %15, i32 %8)
%17 = icmp eq i64 %16, 0
br i1 %17, label %35, label %18
18: ; preds = %14
%19 = tail call i64 @check_fitting_cell(%struct.Field* %0, i32 %15, i32 %2)
%20 = icmp eq i64 %19, 0
br i1 %20, label %35, label %21
21: ; preds = %18
%22 = add nsw i32 %2, 1
%23 = tail call i64 @check_fitting_cell(%struct.Field* %0, i32 %15, i32 %22)
%24 = icmp eq i64 %23, 0
br i1 %24, label %35, label %25
25: ; preds = %21
%26 = tail call i64 @check_fitting_cell(%struct.Field* %0, i32 %1, i32 %22)
%27 = icmp eq i64 %26, 0
br i1 %27, label %35, label %28
28: ; preds = %25
%29 = tail call i64 @check_fitting_cell(%struct.Field* %0, i32 %7, i32 %22)
%30 = icmp eq i64 %29, 0
br i1 %30, label %35, label %31
31: ; preds = %28
%32 = tail call i64 @check_fitting_cell(%struct.Field* %0, i32 %7, i32 %2)
%33 = icmp ne i64 %32, 0
%34 = zext i1 %33 to i32
br label %35
35: ; preds = %31, %28, %25, %21, %18, %14, %11, %6, %3
%36 = phi i32 [ 0, %3 ], [ 0, %6 ], [ 0, %11 ], [ 0, %14 ], [ 0, %18 ], [ 0, %21 ], [ 0, %25 ], [ 0, %28 ], [ %34, %31 ]
ret i32 %36
}