#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_FAILURE;
int EXIT_SUCCESS;
int checkArguments(int, char **, char **, int *, int *);
int findTransformations(char *, int, int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  char *move;
  int boardSize;
  int transformations;
  int retValue =
      checkArguments(argc, argv, &move, &boardSize, &transformations);
  if (retValue == EXIT_FAILURE) {
    return EXIT_FAILURE;
  }
  int transformationsOut =
      findTransformations(move, boardSize, transformations);
  printf("%d\n", transformationsOut);
  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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x1c(%rbp),%rcx
lea    -0x20(%rbp),%r8
call   1040 <checkArguments@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    0x2e75(%rip),%rcx
cmp    (%rcx),%eax
jne    1184 <main+0x54>
mov    0x2e66(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11b1 <main+0x81>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x20(%rbp),%edx
call   1050 <findTransformations@plt>
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%esi
lea    0xe60(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e2c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
lea    0x8(%rsp),%r8
call   1040 <checkArguments@plt>
mov    0x2e91(%rip),%rcx
cmp    (%rcx),%eax
je     117c <main+0x4c>
mov    0x10(%rsp),%rdi
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
call   1050 <findTransformations@plt>
lea    0xe94(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    0x2e5e(%rip),%rax
mov    (%rax),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@.str = [4 x i8] c"%d\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 i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = load i32, i32* %4
%12 = load i8**, i8*** %5
%13 = call i32 @checkArguments(i32 %11, i8** %12, i8** %6, i32* %7, i32* %8)
store i32 %13, i32* %9
%14 = load i32, i32* %9
%15 = load i32, i32* @EXIT_FAILURE
%16 = icmp eq i32 %14, %15
br i1 %16, label %17, label %19
17: ; preds = %2
%18 = load i32, i32* @EXIT_FAILURE
store i32 %18, i32* %3
br label %27
19: ; preds = %2
%20 = load i8*, i8** %6
%21 = load i32, i32* %7
%22 = load i32, i32* %8
%23 = call i32 @findTransformations(i8* %20, i32 %21, i32 %22)
store i32 %23, i32* %10
%24 = load i32, i32* %10
%25 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %24)
%26 = load i32, i32* @EXIT_SUCCESS
store i32 %26, i32* %3
br label %27
27: ; preds = %19, %17
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@.str = [4 x i8] c"%d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i8** %3 to i8*
%7 = bitcast i32* %4 to i8*
%8 = bitcast i32* %5 to i8*
%9 = call i32 @checkArguments(i32 %0, i8** %1, i8** %3, i32* %4, i32* %5)
%10 = load i32, i32* @EXIT_FAILURE
%11 = icmp eq i32 %9, %10
br i1 %11, label %19, label %12
12: ; preds = %2
%13 = load i8*, i8** %3
%14 = load i32, i32* %4
%15 = load i32, i32* %5
%16 = call i32 @findTransformations(i8* %13, i32 %14, i32 %15)
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %16)
%18 = load i32, i32* @EXIT_SUCCESS
br label %19
19: ; preds = %2, %12
%20 = phi i32 [ %18, %12 ], [ %9, %2 ]
ret i32 %20
}