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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x1c(%rbp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1040 <memset@plt>
mov    0xe93(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xe91(%rip),%eax
mov    %eax,-0x20(%rbp)
lea    -0x34(%rbp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1040 <memset@plt>
lea    -0x1c(%rbp),%rax
mov    %rax,-0x50(%rbp)
lea    -0x28(%rbp),%rax
mov    %rax,-0x48(%rbp)
lea    -0x34(%rbp),%rax
mov    %rax,-0x40(%rbp)
lea    -0x50(%rbp),%rdi
mov    $0x3,%edx
mov    %edx,%esi
call   1050 <uniquePathsWithObstacles@plt>
cmp    $0x2,%eax
je     11da <main+0x9a>
lea    0xe4a(%rip),%rdi
lea    0xe54(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>
lea    0xe44(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
movl   $0x0,0x28(%rsp)
movq   $0x0,0x20(%rsp)
mov    0xead(%rip),%eax
mov    %eax,0x18(%rsp)
mov    0xe9a(%rip),%rax
mov    %rax,0x10(%rsp)
movl   $0x0,0x8(%rsp)
movq   $0x0,(%rsp)
lea    0x20(%rsp),%rax
mov    %rax,0x30(%rsp)
lea    0x10(%rsp),%rax
mov    %rax,0x38(%rsp)
mov    %rsp,%rax
mov    %rax,0x40(%rsp)
lea    0x30(%rsp),%rdi
mov    $0x3,%esi
mov    $0x3,%edx
call   1050 <uniquePathsWithObstacles@plt>
cmp    $0x2,%eax
jne    11c3 <main+0x83>
lea    0xe6e(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x48,%rsp
ret
lea    0xe42(%rip),%rdi
lea    0xe4c(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@__const.main.g2 = [3 x i32] [i32 0, i32 1, i32 0]
@.str = [17 x i8] c"assert fail: %s\0A\00"
@.str.1 = [8 x i8] c"3 3 = 2\00"
@.str.2 = [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 [3 x i32]
%7 = alloca [3 x i32]
%8 = alloca [3 x i32]
%9 = alloca [3 x i32*]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = bitcast [3 x i32]* %6 to i8*
%11 = bitcast [3 x i32]* %7 to i8*
%12 = bitcast [3 x i32]* %8 to i8*
%13 = getelementptr inbounds [3 x i32*], [3 x i32*]* %9, i64 0, i64 0
%14 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 0
store i32* %14, i32** %13
%15 = getelementptr inbounds i32*, i32** %13, i64 1
%16 = getelementptr inbounds [3 x i32], [3 x i32]* %7, i64 0, i64 0
store i32* %16, i32** %15
%17 = getelementptr inbounds i32*, i32** %15, i64 1
%18 = getelementptr inbounds [3 x i32], [3 x i32]* %8, i64 0, i64 0
store i32* %18, i32** %17
%19 = getelementptr inbounds [3 x i32*], [3 x i32*]* %9, i64 0, i64 0
%20 = call i32 @uniquePathsWithObstacles(i32** %19, i32 3, i32 3)
%21 = icmp eq i32 %20, 2
br i1 %21, label %25, label %22
22: ; preds = %2
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%24 = call i32 @exit(i32 -1)
unreachable
25: ; preds = %2
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

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