#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*/ out_of_bounds(int, int);
int shift(int, int);
void fill_contiguous_space(char *board, int index) {
  if (board[index] == 1)
    return;
  board[index] = 1;
  if (!out_of_bounds(index, 0))
    fill_contiguous_space(board, shift(index, 0));
  if (!out_of_bounds(index, 2))
    fill_contiguous_space(board, shift(index, 2));
  if (!out_of_bounds(index, 4))
    fill_contiguous_space(board, shift(index, 4));
  if (!out_of_bounds(index, 6))
    fill_contiguous_space(board, shift(index, 6));
  if (!out_of_bounds(index, 8))
    fill_contiguous_space(board, shift(index, 8));
  if (!out_of_bounds(index, 10))
    fill_contiguous_space(board, shift(index, 10));
}


x86 assembly (clang, -O0):
<fill_contiguous_space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x1,%eax
jne    1159 <fill_contiguous_space+0x29>
jmp    12a3 <fill_contiguous_space+0x173>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x1,(%rax,%rcx,1)
mov    -0xc(%rbp),%edi
xor    %esi,%esi
call   1030 <out_of_bounds@plt>
cmp    $0x0,%eax
jne    1195 <fill_contiguous_space+0x65>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
xor    %esi,%esi
call   1050 <shift@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1040 <fill_contiguous_space@plt>
mov    -0xc(%rbp),%edi
mov    $0x2,%esi
call   1030 <out_of_bounds@plt>
cmp    $0x0,%eax
jne    11cb <fill_contiguous_space+0x9b>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%edi
mov    $0x2,%esi
call   1050 <shift@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
call   1040 <fill_contiguous_space@plt>
mov    -0xc(%rbp),%edi
mov    $0x4,%esi
call   1030 <out_of_bounds@plt>
cmp    $0x0,%eax
jne    1201 <fill_contiguous_space+0xd1>
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0xc(%rbp),%edi
mov    $0x4,%esi
call   1050 <shift@plt>
mov    -0x28(%rbp),%rdi
mov    %eax,%esi
call   1040 <fill_contiguous_space@plt>
mov    -0xc(%rbp),%edi
mov    $0x6,%esi
call   1030 <out_of_bounds@plt>
cmp    $0x0,%eax
jne    1237 <fill_contiguous_space+0x107>
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0xc(%rbp),%edi
mov    $0x6,%esi
call   1050 <shift@plt>
mov    -0x30(%rbp),%rdi
mov    %eax,%esi
call   1040 <fill_contiguous_space@plt>
mov    -0xc(%rbp),%edi
mov    $0x8,%esi
call   1030 <out_of_bounds@plt>
cmp    $0x0,%eax
jne    126d <fill_contiguous_space+0x13d>
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0xc(%rbp),%edi
mov    $0x8,%esi
call   1050 <shift@plt>
mov    -0x38(%rbp),%rdi
mov    %eax,%esi
call   1040 <fill_contiguous_space@plt>
mov    -0xc(%rbp),%edi
mov    $0xa,%esi
call   1030 <out_of_bounds@plt>
cmp    $0x0,%eax
jne    12a3 <fill_contiguous_space+0x173>
mov    -0x8(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0xc(%rbp),%edi
mov    $0xa,%esi
call   1050 <shift@plt>
mov    -0x40(%rbp),%rdi
mov    %eax,%esi
call   1040 <fill_contiguous_space@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill_contiguous_space>:
push   %rbp
push   %rbx
push   %rax
movslq %esi,%rax
cmpb   $0x1,(%rdi,%rax,1)
je     123a <fill_contiguous_space+0x10a>
mov    %esi,%ebp
mov    %rdi,%rbx
add    %rdi,%rax
nopl   0x0(%rax,%rax,1)
movb   $0x1,(%rax)
mov    %ebp,%edi
xor    %esi,%esi
call   1030 <out_of_bounds@plt>
test   %eax,%eax
jne    1173 <fill_contiguous_space+0x43>
mov    %ebp,%edi
xor    %esi,%esi
call   1050 <shift@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <fill_contiguous_space@plt>
mov    %ebp,%edi
mov    $0x2,%esi
call   1030 <out_of_bounds@plt>
test   %eax,%eax
jne    1199 <fill_contiguous_space+0x69>
mov    %ebp,%edi
mov    $0x2,%esi
call   1050 <shift@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <fill_contiguous_space@plt>
mov    %ebp,%edi
mov    $0x4,%esi
call   1030 <out_of_bounds@plt>
test   %eax,%eax
jne    11bf <fill_contiguous_space+0x8f>
mov    %ebp,%edi
mov    $0x4,%esi
call   1050 <shift@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <fill_contiguous_space@plt>
mov    %ebp,%edi
mov    $0x6,%esi
call   1030 <out_of_bounds@plt>
test   %eax,%eax
jne    11e5 <fill_contiguous_space+0xb5>
mov    %ebp,%edi
mov    $0x6,%esi
call   1050 <shift@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <fill_contiguous_space@plt>
mov    %ebp,%edi
mov    $0x8,%esi
call   1030 <out_of_bounds@plt>
test   %eax,%eax
jne    120b <fill_contiguous_space+0xdb>
mov    %ebp,%edi
mov    $0x8,%esi
call   1050 <shift@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <fill_contiguous_space@plt>
mov    %ebp,%edi
mov    $0xa,%esi
call   1030 <out_of_bounds@plt>
test   %eax,%eax
jne    123a <fill_contiguous_space+0x10a>
mov    %ebp,%edi
mov    $0xa,%esi
call   1050 <shift@plt>
mov    %eax,%ebp
movslq %eax,%rcx
lea    (%rbx,%rcx,1),%rax
cmpb   $0x1,(%rbx,%rcx,1)
jne    1150 <fill_contiguous_space+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @fill_contiguous_space(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 1
br i1 %11, label %12, label %13
12: ; preds = %2
br label %65
13: ; preds = %2
%14 = load i8*, i8** %3
%15 = load i32, i32* %4
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
store i8 1, i8* %17
%18 = load i32, i32* %4
%19 = call i32 @out_of_bounds(i32 %18, i32 0)
%20 = icmp ne i32 %19, 0
br i1 %20, label %25, label %21
21: ; preds = %13
%22 = load i8*, i8** %3
%23 = load i32, i32* %4
%24 = call i32 @shift(i32 %23, i32 0)
br label %25
25: ; preds = %21, %13
%26 = load i32, i32* %4
%27 = call i32 @out_of_bounds(i32 %26, i32 2)
%28 = icmp ne i32 %27, 0
br i1 %28, label %33, label %29
29: ; preds = %25
%30 = load i8*, i8** %3
%31 = load i32, i32* %4
%32 = call i32 @shift(i32 %31, i32 2)
br label %33
33: ; preds = %29, %25
%34 = load i32, i32* %4
%35 = call i32 @out_of_bounds(i32 %34, i32 4)
%36 = icmp ne i32 %35, 0
br i1 %36, label %41, label %37
37: ; preds = %33
%38 = load i8*, i8** %3
%39 = load i32, i32* %4
%40 = call i32 @shift(i32 %39, i32 4)
br label %41
41: ; preds = %37, %33
%42 = load i32, i32* %4
%43 = call i32 @out_of_bounds(i32 %42, i32 6)
%44 = icmp ne i32 %43, 0
br i1 %44, label %49, label %45
45: ; preds = %41
%46 = load i8*, i8** %3
%47 = load i32, i32* %4
%48 = call i32 @shift(i32 %47, i32 6)
br label %49
49: ; preds = %45, %41
%50 = load i32, i32* %4
%51 = call i32 @out_of_bounds(i32 %50, i32 8)
%52 = icmp ne i32 %51, 0
br i1 %52, label %57, label %53
53: ; preds = %49
%54 = load i8*, i8** %3
%55 = load i32, i32* %4
%56 = call i32 @shift(i32 %55, i32 8)
br label %57
57: ; preds = %53, %49
%58 = load i32, i32* %4
%59 = call i32 @out_of_bounds(i32 %58, i32 10)
%60 = icmp ne i32 %59, 0
br i1 %60, label %65, label %61
61: ; preds = %57
%62 = load i8*, i8** %3
%63 = load i32, i32* %4
%64 = call i32 @shift(i32 %63, i32 10)
br label %65
65: ; preds = %12, %61, %57
ret void
}

LLVM IR (-O2):
define void @fill_contiguous_space(i8* %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 1
br i1 %6, label %43, label %7
7: ; preds = %2, %37
%8 = phi i8* [ %40, %37 ], [ %4, %2 ]
%9 = phi i32 [ %38, %37 ], [ %1, %2 ]
store i8 1, i8* %8
%10 = tail call i32 @out_of_bounds(i32 %9, i32 0)
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %7
%13 = tail call i32 @shift(i32 %9, i32 0)
tail call void @fill_contiguous_space(i8* %0, i32 %13)
br label %14
14: ; preds = %12, %7
%15 = tail call i32 @out_of_bounds(i32 %9, i32 2)
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %14
%18 = tail call i32 @shift(i32 %9, i32 2)
tail call void @fill_contiguous_space(i8* %0, i32 %18)
br label %19
19: ; preds = %17, %14
%20 = tail call i32 @out_of_bounds(i32 %9, i32 4)
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %24
22: ; preds = %19
%23 = tail call i32 @shift(i32 %9, i32 4)
tail call void @fill_contiguous_space(i8* %0, i32 %23)
br label %24
24: ; preds = %22, %19
%25 = tail call i32 @out_of_bounds(i32 %9, i32 6)
%26 = icmp eq i32 %25, 0
br i1 %26, label %27, label %29
27: ; preds = %24
%28 = tail call i32 @shift(i32 %9, i32 6)
tail call void @fill_contiguous_space(i8* %0, i32 %28)
br label %29
29: ; preds = %27, %24
%30 = tail call i32 @out_of_bounds(i32 %9, i32 8)
%31 = icmp eq i32 %30, 0
br i1 %31, label %32, label %34
32: ; preds = %29
%33 = tail call i32 @shift(i32 %9, i32 8)
tail call void @fill_contiguous_space(i8* %0, i32 %33)
br label %34
34: ; preds = %32, %29
%35 = tail call i32 @out_of_bounds(i32 %9, i32 10)
%36 = icmp eq i32 %35, 0
br i1 %36, label %37, label %43
37: ; preds = %34
%38 = tail call i32 @shift(i32 %9, i32 10)
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds i8, i8* %0, i64 %39
%41 = load i8, i8* %40
%42 = icmp eq i8 %41, 1
br i1 %42, label %43, label %7
43: ; preds = %34, %37, %2
ret void
}