#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*/ exit(int);
int largestRectangleArea(int *, int);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  int h[] = {0, 9};
  int h2[] = {9, 0};
  int h3[] = {2, 1, 2};
  if (!(largestRectangleArea(h, 2) == 9)) {
    printf("assert fail: %s\n", "0 9");
    exit(-1);
  };
  if (!(largestRectangleArea(h2, 2) == 9)) {
    printf("assert fail: %s\n", "9 0");
    exit(-1);
  };
  if (!(largestRectangleArea(h3, 3) == 3)) {
    printf("assert fail: %s\n", "2 1 2");
    exit(-1);
  };
  printf("everything is fine!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xeb3(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xeb0(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xead(%rip),%rax
mov    %rax,-0x2c(%rbp)
mov    0xeab(%rip),%eax
mov    %eax,-0x24(%rbp)
lea    -0x18(%rbp),%rdi
mov    $0x2,%esi
call   1040 <largestRectangleArea@plt>
cmp    $0x9,%eax
je     11a6 <main+0x76>
lea    0xe8e(%rip),%rdi
lea    0xe98(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
lea    -0x20(%rbp),%rdi
mov    $0x2,%esi
call   1040 <largestRectangleArea@plt>
cmp    $0x9,%eax
je     11dc <main+0xac>
lea    0xe58(%rip),%rdi
lea    0xe66(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
lea    -0x2c(%rbp),%rdi
mov    $0x3,%esi
call   1040 <largestRectangleArea@plt>
cmp    $0x3,%eax
je     1212 <main+0xe2>
lea    0xe22(%rip),%rdi
lea    0xe34(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
lea    0xe22(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movabs $0x900000000,%rax
mov    %rax,0x20(%rsp)
movq   $0x9,0x18(%rsp)
mov    0xea6(%rip),%eax
mov    %eax,0x10(%rsp)
mov    0xe93(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0x20(%rsp),%rdi
mov    $0x2,%esi
call   1050 <largestRectangleArea@plt>
cmp    $0x9,%eax
jne    11c1 <main+0x81>
lea    0x18(%rsp),%rdi
mov    $0x2,%esi
call   1050 <largestRectangleArea@plt>
cmp    $0x9,%eax
jne    11d1 <main+0x91>
lea    0x8(%rsp),%rdi
mov    $0x3,%esi
call   1050 <largestRectangleArea@plt>
cmp    $0x3,%eax
jne    11e1 <main+0xa1>
lea    0xe76(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret
lea    0xe44(%rip),%rdi
lea    0xe4e(%rip),%rsi
jmp    11ef <main+0xaf>
lea    0xe34(%rip),%rdi
lea    0xe42(%rip),%rsi
jmp    11ef <main+0xaf>
lea    0xe24(%rip),%rdi
lea    0xe36(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@__const.main.h = [2 x i32] [i32 0, i32 9]
@__const.main.h2 = [2 x i32] [i32 9, i32 0]
@__const.main.h3 = [3 x i32] [i32 2, i32 1, i32 2]
@.str = [17 x i8] c"assert fail: %s\0A\00"
@.str.1 = [4 x i8] c"0 9\00"
@.str.2 = [4 x i8] c"9 0\00"
@.str.3 = [6 x i8] c"2 1 2\00"
@.str.4 = [21 x i8] c"everything is fine!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [2 x i32]
%7 = alloca [2 x i32]
%8 = alloca [3 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = bitcast [2 x i32]* %6 to i8*
%10 = bitcast [2 x i32]* %7 to i8*
%11 = bitcast [3 x i32]* %8 to i8*
%12 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%13 = call i32 @largestRectangleArea(i32* %12, i32 2)
%14 = icmp eq i32 %13, 9
br i1 %14, label %18, label %15
15: ; preds = %2
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%17 = call i32 @exit(i32 -1)
unreachable
18: ; preds = %2
%19 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
%20 = call i32 @largestRectangleArea(i32* %19, i32 2)
%21 = icmp eq i32 %20, 9
br i1 %21, label %25, label %22
22: ; preds = %18
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%24 = call i32 @exit(i32 -1)
unreachable
25: ; preds = %18
%26 = getelementptr inbounds [3 x i32], [3 x i32]* %8, i64 0, i64 0
%27 = call i32 @largestRectangleArea(i32* %26, i32 3)
%28 = icmp eq i32 %27, 3
br i1 %28, label %32, label %29
29: ; preds = %25
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%31 = call i32 @exit(i32 -1)
unreachable
32: ; preds = %25
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@__const.main.h3 = [3 x i32] [i32 2, i32 1, i32 2]
@.str = [17 x i8] c"assert fail: %s\0A\00"
@.str.1 = [4 x i8] c"0 9\00"
@.str.2 = [4 x i8] c"9 0\00"
@.str.3 = [6 x i8] c"2 1 2\00"
@str = [20 x i8] c"everything is fine!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca [3 x i32]
%6 = bitcast i64* %3 to i8*
store i64 38654705664, i64* %3
%7 = bitcast i64* %4 to i8*
store i64 9, i64* %4
%8 = bitcast [3 x i32]* %5 to i8*
%9 = bitcast i64* %3 to i32*
%10 = call i32 @largestRectangleArea(i32* %9, i32 2)
%11 = icmp eq i32 %10, 9
br i1 %11, label %15, label %12
12: ; preds = %2
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%14 = call i32 @exit(i32 -1)
unreachable
15: ; preds = %2
%16 = bitcast i64* %4 to i32*
%17 = call i32 @largestRectangleArea(i32* %16, i32 2)
%18 = icmp eq i32 %17, 9
br i1 %18, label %22, label %19
19: ; preds = %15
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%21 = call i32 @exit(i32 -1)
unreachable
22: ; preds = %15
%23 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 0
%24 = call i32 @largestRectangleArea(i32* %23, i32 3)
%25 = icmp eq i32 %24, 3
br i1 %25, label %29, label %26
26: ; preds = %22
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%28 = call i32 @exit(i32 -1)
unreachable
29: ; preds = %22
%30 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret i32 0
}