#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 */
typedef int /*<<< orphan*/ board;

/* Variables and functions */
int maxarea(char **, int, int);
int /*<<< orphan*/ printf(char *, int);
int strlen(char *);
void main() {
  char *board[] = {"101", "011", "101", "010"};
  int rows = sizeof(board) / sizeof(board[0]);
  int cols = strlen(board[0]);
  int res = maxarea(board, rows, cols);
  printf("Max area is %d", res);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x2cc1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0x2cbe(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0x2cbb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0x2cb8(%rip),%rax
mov    %rax,-0x8(%rbp)
movl   $0x4,-0x24(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x28(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    -0x28(%rbp),%edx
call   1050 <maxarea@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%esi
lea    0xe79(%rip),%rdi
call   1040 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0x2cd5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0x2cb9(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xeae(%rip),%rdi
call   1030 <strlen@plt>
mov    %rsp,%rdi
mov    $0x4,%esi
mov    %eax,%edx
call   1050 <maxarea@plt>
lea    0xe9f(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"101\00"
@.str.1 = [4 x i8] c"011\00"
@.str.2 = [4 x i8] c"010\00"
@__const.main.board = [4 x i8*] [i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i32 0, i32 0)]
@.str.3 = [15 x i8] c"Max area is %d\00"
define void @main() {
%1 = alloca [4 x i8*]
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast [4 x i8*]* %1 to i8*
store i32 4, i32* %2
%6 = getelementptr inbounds [4 x i8*], [4 x i8*]* %1, i64 0, i64 0
%7 = load i8*, i8** %6
%8 = call i32 @strlen(i8* %7)
store i32 %8, i32* %3
%9 = getelementptr inbounds [4 x i8*], [4 x i8*]* %1, i64 0, i64 0
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = call i32 @maxarea(i8** %9, i32 %10, i32 %11)
store i32 %12, i32* %4
%13 = load i32, i32* %4
%14 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 %13)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"101\00"
@.str.1 = [4 x i8] c"011\00"
@.str.2 = [4 x i8] c"010\00"
@__const.main.board = [4 x i8*] [i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i32 0, i32 0)]
@.str.3 = [15 x i8] c"Max area is %d\00"
define void @main() {
%1 = alloca [4 x i8*]
%2 = bitcast [4 x i8*]* %1 to i8*
%3 = getelementptr inbounds [4 x i8*], [4 x i8*]* %1, i64 0, i64 0
%4 = tail call i32 @strlen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @maxarea(i8** %3, i32 4, i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 %5)
ret void
}