#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*/ frndship;

/* Variables and functions */
int minimalDays(char **, int);
int /*<<< orphan*/ printf(char *, int);
void main() {
  char *frndship[] = {"NNYYNN", "NNNNYY", "YNNNYN",
                      "YNNNNY", "NYYNNN", "NYNYNN"};
  int len = sizeof(frndship) / sizeof(frndship[0]);
  int res = minimalDays(frndship, len);
  printf("Min days required = %d", res);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x30,%edx
call   1040 <memset@plt>
lea    0xeb1(%rip),%rax
mov    %rax,-0x30(%rbp)
lea    0xead(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0xea9(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0xea5(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xea1(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xe9d(%rip),%rax
mov    %rax,-0x8(%rbp)
movl   $0x6,-0x34(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1050 <minimalDays@plt>
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%esi
lea    0xe80(%rip),%rdi
call   1030 <printf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
lea    0xed5(%rip),%rax
mov    %rax,(%rsp)
lea    0xed1(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0xecc(%rip),%rax
mov    %rax,0x10(%rsp)
lea    0xec7(%rip),%rax
mov    %rax,0x18(%rsp)
lea    0xec2(%rip),%rax
mov    %rax,0x20(%rsp)
lea    0xebd(%rip),%rax
mov    %rax,0x28(%rsp)
mov    %rsp,%rdi
mov    $0x6,%esi
call   1040 <minimalDays@plt>
lea    0xeab(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
add    $0x38,%rsp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"NNYYNN\00"
@.str.1 = [7 x i8] c"NNNNYY\00"
@.str.2 = [7 x i8] c"YNNNYN\00"
@.str.3 = [7 x i8] c"YNNNNY\00"
@.str.4 = [7 x i8] c"NYYNNN\00"
@.str.5 = [7 x i8] c"NYNYNN\00"
@.str.6 = [23 x i8] c"Min days required = %d\00"
define void @main() {
%1 = alloca [6 x i8*]
%2 = alloca i32
%3 = alloca i32
%4 = bitcast [6 x i8*]* %1 to i8*
%5 = bitcast i8* %4 to [6 x i8*]*
%6 = getelementptr inbounds [6 x i8*], [6 x i8*]* %5, i32 0, i32 0
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i32 0, i32 0), i8** %6
%7 = getelementptr inbounds [6 x i8*], [6 x i8*]* %5, i32 0, i32 1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i32 0, i32 0), i8** %7
%8 = getelementptr inbounds [6 x i8*], [6 x i8*]* %5, i32 0, i32 2
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i32 0, i32 0), i8** %8
%9 = getelementptr inbounds [6 x i8*], [6 x i8*]* %5, i32 0, i32 3
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i32 0, i32 0), i8** %9
%10 = getelementptr inbounds [6 x i8*], [6 x i8*]* %5, i32 0, i32 4
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i32 0, i32 0), i8** %10
%11 = getelementptr inbounds [6 x i8*], [6 x i8*]* %5, i32 0, i32 5
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i32 0, i32 0), i8** %11
store i32 6, i32* %2
%12 = getelementptr inbounds [6 x i8*], [6 x i8*]* %1, i64 0, i64 0
%13 = load i32, i32* %2
%14 = call i32 @minimalDays(i8** %12, i32 %13)
store i32 %14, i32* %3
%15 = load i32, i32* %3
%16 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0), i32 %15)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"NNYYNN\00"
@.str.1 = [7 x i8] c"NNNNYY\00"
@.str.2 = [7 x i8] c"YNNNYN\00"
@.str.3 = [7 x i8] c"YNNNNY\00"
@.str.4 = [7 x i8] c"NYYNNN\00"
@.str.5 = [7 x i8] c"NYNYNN\00"
@.str.6 = [23 x i8] c"Min days required = %d\00"
define void @main() {
%1 = alloca [6 x i8*]
%2 = bitcast [6 x i8*]* %1 to i8*
%3 = getelementptr inbounds [6 x i8*], [6 x i8*]* %1, i64 0, i64 0
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = getelementptr inbounds [6 x i8*], [6 x i8*]* %1, i64 0, i64 1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8** %4
%5 = getelementptr inbounds [6 x i8*], [6 x i8*]* %1, i64 0, i64 2
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8** %5
%6 = getelementptr inbounds [6 x i8*], [6 x i8*]* %1, i64 0, i64 3
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8** %6
%7 = getelementptr inbounds [6 x i8*], [6 x i8*]* %1, i64 0, i64 4
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8** %7
%8 = getelementptr inbounds [6 x i8*], [6 x i8*]* %1, i64 0, i64 5
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i8** %8
%9 = call i32 @minimalDays(i8** %3, i32 6)
%10 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0), i32 %9)
ret void
}