#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 EXIT_SUCCESS;
scalar_t__ checkFile();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ runPrograms(char, char, int);
int strtoimax(char *, char **, int);
int main(int argc, char *argv[]) {
  int boardSize;
  char *endPtr;
  boardSize = strtoimax(argv[1], &endPtr, 10);
  char colourA, colourB;
  colourA = *argv[2];
  colourB = *(argv[2] + 1);
  if (checkFile()) {
    runPrograms(colourA, colourB, boardSize);
  } else
    printf("Not able to find executables 'A' and 'B',exiting!\n");
  return (EXIT_SUCCESS);
}


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    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    -0x20(%rbp),%rsi
mov    $0xa,%edx
call   1030 <strtoimax@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    (%rax),%al
mov    %al,-0x21(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    0x1(%rax),%al
mov    %al,-0x22(%rbp)
mov    $0x0,%al
call   1040 <checkFile@plt>
cmp    $0x0,%rax
je     11b4 <main+0x74>
mov    -0x21(%rbp),%cl
mov    -0x22(%rbp),%al
mov    -0x14(%rbp),%edx
movsbl %cl,%edi
movsbl %al,%esi
call   1060 <runPrograms@plt>
jmp    11c0 <main+0x80>
lea    0xe45(%rip),%rdi
call   1050 <printf@plt>
mov    0x2e19(%rip),%rax
mov    (%rax),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
lea    0x8(%rsp),%rsi
mov    $0xa,%edx
call   1030 <strtoimax@plt>
mov    %eax,%ebp
mov    0x10(%rbx),%rax
mov    (%rax),%bl
mov    0x1(%rax),%r14b
xor    %eax,%eax
call   1050 <checkFile@plt>
test   %rax,%rax
je     1186 <main+0x46>
movsbl %bl,%edi
movsbl %r14b,%esi
mov    %ebp,%edx
call   1060 <runPrograms@plt>
jmp    1192 <main+0x52>
lea    0xe73(%rip),%rdi
call   1040 <puts@plt>
mov    0x2e47(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [51 x i8] c"Not able to find executables 'A' and 'B',exiting!\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8
%9 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i32 @strtoimax(i8* %12, i8** %7, i32 10)
store i32 %13, i32* %6
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 2
%16 = load i8*, i8** %15
%17 = load i8, i8* %16
store i8 %17, i8* %8
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 2
%20 = load i8*, i8** %19
%21 = getelementptr inbounds i8, i8* %20, i64 1
%22 = load i8, i8* %21
store i8 %22, i8* %9
%23 = call i64 (...) @checkFile()
%24 = icmp ne i64 %23, 0
br i1 %24, label %25, label %30
25: ; preds = %2
%26 = load i8, i8* %8
%27 = load i8, i8* %9
%28 = load i32, i32* %6
%29 = call i32 @runPrograms(i8 signext %26, i8 signext %27, i32 %28)
br label %32
30: ; preds = %2
%31 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
br label %32
32: ; preds = %30, %25
%33 = load i32, i32* @EXIT_SUCCESS
ret i32 %33
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [50 x i8] c"Not able to find executables 'A' and 'B',exiting!\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = call i32 @strtoimax(i8* %6, i8** %3, i32 10)
%8 = getelementptr inbounds i8*, i8** %1, i64 2
%9 = load i8*, i8** %8
%10 = load i8, i8* %9
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = load i8, i8* %11
%13 = call i64 (...) @checkFile()
%14 = icmp eq i64 %13, 0
br i1 %14, label %17, label %15
15: ; preds = %2
%16 = call i32 @runPrograms(i8 signext %10, i8 signext %12, i32 %7)
br label %19
17: ; preds = %2
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str, i64 0, i64 0))
br label %19
19: ; preds = %17, %15
%20 = load i32, i32* @EXIT_SUCCESS
ret i32 %20
}