#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 INT_MIN;
int dfs(int **, int, int, int **, int, int, int);
int /*<<< orphan*/ free_2d_array(int **, int);
int **make_2d_array(int, int);
int biggest_island_size(int **graph, int rows, int cols) {
  int max = INT_MIN;
  int **visited = make_2d_array(cols, rows);
  int y, x;
  for (y = 0; y < rows; ++y) {
    for (x = 0; x < cols; ++x) {
      int ret = dfs(graph, x, y, visited, 1, rows, cols);
      if (ret > max) {
        max = ret;
      }
    }
  }
  free_2d_array(visited, rows);
  return max;
}


x86 assembly (clang, -O0):
<biggest_island_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    0x2e9f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <make_2d_array@plt>
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11e1 <biggest_island_size+0xb1>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11ce <biggest_island_size+0x9e>
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%esi
mov    -0x24(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    -0xc(%rbp),%r9d
mov    -0x10(%rbp),%eax
mov    $0x1,%r8d
mov    %eax,(%rsp)
call   1050 <dfs@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jle    11bb <biggest_island_size+0x8b>
mov    -0x2c(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    11c0 <biggest_island_size+0x90>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1177 <biggest_island_size+0x47>
jmp    11d3 <biggest_island_size+0xa3>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1164 <biggest_island_size+0x34>
mov    -0x20(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <free_2d_array@plt>
mov    -0x14(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<biggest_island_size>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %edx,%r15d
mov    %esi,%ebx
mov    %rdi,%r14
mov    0x2e9b(%rip),%rax
mov    (%rax),%ebp
mov    %edx,%edi
call   1030 <make_2d_array@plt>
mov    %rax,%r13
test   %ebx,%ebx
jle    11c0 <biggest_island_size+0x90>
mov    %r14,0x10(%rsp)
xor    %r12d,%r12d
jmp    1179 <biggest_island_size+0x49>
nopw   0x0(%rax,%rax,1)
add    $0x1,%r12d
cmp    %ebx,%r12d
je     11c0 <biggest_island_size+0x90>
test   %r15d,%r15d
jle    1170 <biggest_island_size+0x40>
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r15d,(%rsp)
mov    0x10(%rsp),%rdi
mov    %r14d,%esi
mov    %r12d,%edx
mov    %r13,%rcx
mov    $0x1,%r8d
mov    %ebx,%r9d
call   1050 <dfs@plt>
cmp    %ebp,%eax
cmovg  %eax,%ebp
add    $0x1,%r14d
cmp    %r14d,%r15d
jne    1190 <biggest_island_size+0x60>
jmp    1170 <biggest_island_size+0x40>
mov    %r13,%rdi
mov    %ebx,%esi
call   1040 <free_2d_array@plt>
mov    %ebp,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@INT_MIN = global i32 0
define i32 @biggest_island_size(i32** %0, i32 %1, i32 %2) {
%4 = alloca i32**
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32**
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32** %0, i32*** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%12 = load i32, i32* @INT_MIN
store i32 %12, i32* %7
%13 = load i32, i32* %6
%14 = load i32, i32* %5
%15 = call i32** @make_2d_array(i32 %13, i32 %14)
store i32** %15, i32*** %8
store i32 0, i32* %9
br label %16
16: ; preds = %43, %3
%17 = load i32, i32* %9
%18 = load i32, i32* %5
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %46
20: ; preds = %16
store i32 0, i32* %10
br label %21
21: ; preds = %39, %20
%22 = load i32, i32* %10
%23 = load i32, i32* %6
%24 = icmp slt i32 %22, %23
br i1 %24, label %25, label %42
25: ; preds = %21
%26 = load i32**, i32*** %4
%27 = load i32, i32* %10
%28 = load i32, i32* %9
%29 = load i32**, i32*** %8
%30 = load i32, i32* %5
%31 = load i32, i32* %6
%32 = call i32 @dfs(i32** %26, i32 %27, i32 %28, i32** %29, i32 1, i32 %30, i32 %31)
store i32 %32, i32* %11
%33 = load i32, i32* %11
%34 = load i32, i32* %7
%35 = icmp sgt i32 %33, %34
br i1 %35, label %36, label %38
36: ; preds = %25
%37 = load i32, i32* %11
store i32 %37, i32* %7
br label %38
38: ; preds = %36, %25
br label %39
39: ; preds = %38
%40 = load i32, i32* %10
%41 = add nsw i32 %40, 1
store i32 %41, i32* %10
br label %21
42: ; preds = %21
br label %43
43: ; preds = %42
%44 = load i32, i32* %9
%45 = add nsw i32 %44, 1
store i32 %45, i32* %9
br label %16
46: ; preds = %16
%47 = load i32**, i32*** %8
%48 = load i32, i32* %5
%49 = call i32 @free_2d_array(i32** %47, i32 %48)
%50 = load i32, i32* %7
ret i32 %50
}

LLVM IR (-O2):
@INT_MIN = global i32 0
define i32 @biggest_island_size(i32** %0, i32 %1, i32 %2) {
%4 = load i32, i32* @INT_MIN
%5 = tail call i32** @make_2d_array(i32 %2, i32 %1)
%6 = icmp sgt i32 %1, 0
br i1 %6, label %7, label %24
7: ; preds = %3
%8 = icmp sgt i32 %2, 0
br label %9
9: ; preds = %7, %20
%10 = phi i32 [ %4, %7 ], [ %21, %20 ]
%11 = phi i32 [ 0, %7 ], [ %22, %20 ]
br i1 %8, label %12, label %20
12: ; preds = %9, %12
%13 = phi i32 [ %17, %12 ], [ %10, %9 ]
%14 = phi i32 [ %18, %12 ], [ 0, %9 ]
%15 = tail call i32 @dfs(i32** %0, i32 %14, i32 %11, i32** %5, i32 1, i32 %1, i32 %2)
%16 = icmp sgt i32 %15, %13
%17 = select i1 %16, i32 %15, i32 %13
%18 = add nuw nsw i32 %14, 1
%19 = icmp eq i32 %18, %2
br i1 %19, label %20, label %12
20: ; preds = %12, %9
%21 = phi i32 [ %10, %9 ], [ %17, %12 ]
%22 = add nuw nsw i32 %11, 1
%23 = icmp eq i32 %22, %1
br i1 %23, label %24, label %9
24: ; preds = %20, %3
%25 = phi i32 [ %4, %3 ], [ %21, %20 ]
%26 = tail call i32 @free_2d_array(i32** %5, i32 %1)
ret i32 %25
}