#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 */
unsigned int atoi(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ loadBlankBoard(unsigned char **, unsigned int, unsigned int);
int /*<<< orphan*/ loadBoard(char *, unsigned char **, unsigned int,
                             unsigned int);
int /*<<< orphan*/ printBoard(unsigned char **, unsigned int, unsigned int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stderr;
unsigned int vecinos(unsigned char **, unsigned int, unsigned int, unsigned int,
                     unsigned int);
int main(int argc, char *argv[]) {
  printf("start \n");
  if (argc != 5) {
    fprintf(stderr, "Wrong number of parameters!\n");
    exit(1);
  }
  char *fileName = argv[4];
  unsigned int rows = atoi(argv[2]);
  unsigned int cols = atoi(argv[3]);
  unsigned int actionsCount = atoi(argv[1]);
  printf("end loading parameters \n");
  printf("parameter 1 %i \n", actionsCount);
  printf("parameter 2 %i \n", cols);
  printf("parameter 3 %i \n", rows);
  printf("parameter 4 %s \n", fileName);
  printf("init the variables \n");
  unsigned char board[rows][cols];
  printf("end the init of the variables \n");
  printf("start loading blank board to work \n");
  loadBlankBoard(board, rows, cols);
  printf("end loading blank board to work \n");
  printBoard(board, rows, cols);
  printf("start loading the board from file \n");
  loadBoard(fileName, board, rows, cols);
  printf("end load board from file \n");
  printBoard(board, rows, cols);
  unsigned int i, j, k;
  for (i = 0; i <= actionsCount; i++) {
    printf("start the action %i \n", i);
    for (j = 0; j <= rows; j++) {
      for (k = 0; k <= cols; k++) {
        unsigned int neighbors = vecinos(board, j, k, rows, cols);
        if (((neighbors == 2) || (neighbors == 3)) && (board[j][k] == '1')) {
          board[j][k] = '1';
        }
        if ((board[j][k] == '0') && (neighbors == 3)) {
          board[j][k] = '1';
        }
        if ((neighbors < 2) || (neighbors > 3)) {
          board[j][k] = '0';
        }
      }
    }
    printBoard(board, rows, cols);
    printf("end the action %i \n", i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe63(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
cmpl   $0x5,-0x8(%rbp)
je     11cd <main+0x4d>
mov    0x2e2b(%rip),%rax
mov    (%rax),%edi
lea    0xe4a(%rip),%rsi
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1080 <atoi@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1080 <atoi@plt>
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1080 <atoi@plt>
mov    %eax,-0x24(%rbp)
lea    0xe15(%rip),%rdi
xor    %eax,%eax
mov    %al,-0x61(%rbp)
call   1050 <printf@plt>
mov    -0x61(%rbp),%al
mov    -0x24(%rbp),%esi
lea    0xe17(%rip),%rdi
call   1050 <printf@plt>
mov    -0x61(%rbp),%al
mov    -0x20(%rbp),%esi
lea    0xe16(%rip),%rdi
call   1050 <printf@plt>
mov    -0x61(%rbp),%al
mov    -0x1c(%rbp),%esi
lea    0xe15(%rip),%rdi
call   1050 <printf@plt>
mov    -0x61(%rbp),%al
mov    -0x18(%rbp),%rsi
lea    0xe13(%rip),%rdi
call   1050 <printf@plt>
mov    -0x61(%rbp),%al
lea    0xe15(%rip),%rdi
call   1050 <printf@plt>
mov    -0x1c(%rbp),%eax
mov    %eax,%ecx
mov    -0x20(%rbp),%eax
mov    %rax,-0x60(%rbp)
mov    %rsp,%rdx
mov    %rdx,-0x30(%rbp)
mov    %rcx,%rsi
imul   %rax,%rsi
add    $0xf,%rsi
and    $0xfffffffffffffff0,%rsi
mov    %rsp,%rdx
sub    %rsi,%rdx
mov    %rdx,-0x58(%rbp)
mov    %rdx,%rsp
mov    %rcx,-0x38(%rbp)
mov    %rax,-0x40(%rbp)
lea    0xde7(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xdf9(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x58(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x20(%rbp),%edx
call   1030 <loadBlankBoard@plt>
lea    0xe00(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x58(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x20(%rbp),%edx
call   1040 <printBoard@plt>
lea    0xe05(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x58(%rbp),%rsi
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
call   10a0 <loadBoard@plt>
lea    0xe08(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x58(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x20(%rbp),%edx
call   1040 <printBoard@plt>
movl   $0x0,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0x24(%rbp),%eax
ja     14a7 <main+0x327>
mov    -0x44(%rbp),%esi
lea    0xdf0(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x48(%rbp)
mov    -0x48(%rbp),%eax
cmp    -0x1c(%rbp),%eax
ja     1479 <main+0x2f9>
movl   $0x0,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
cmp    -0x20(%rbp),%eax
ja     1466 <main+0x2e6>
mov    -0x58(%rbp),%rdi
mov    -0x48(%rbp),%esi
mov    -0x4c(%rbp),%edx
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%r8d
call   1070 <vecinos@plt>
mov    %eax,-0x50(%rbp)
cmpl   $0x2,-0x50(%rbp)
je     13a6 <main+0x226>
cmpl   $0x3,-0x50(%rbp)
jne    13e1 <main+0x261>
mov    -0x58(%rbp),%rax
mov    -0x60(%rbp),%rdx
mov    -0x48(%rbp),%ecx
imul   %rdx,%rcx
add    %rcx,%rax
mov    -0x4c(%rbp),%ecx
movzbl (%rax,%rcx,1),%eax
cmp    $0x31,%eax
jne    13e1 <main+0x261>
mov    -0x58(%rbp),%rax
mov    -0x60(%rbp),%rdx
mov    -0x48(%rbp),%ecx
imul   %rdx,%rcx
add    %rcx,%rax
mov    -0x4c(%rbp),%ecx
movb   $0x31,(%rax,%rcx,1)
mov    -0x58(%rbp),%rax
mov    -0x60(%rbp),%rdx
mov    -0x48(%rbp),%ecx
imul   %rdx,%rcx
add    %rcx,%rax
mov    -0x4c(%rbp),%ecx
movzbl (%rax,%rcx,1),%eax
cmp    $0x30,%eax
jne    1426 <main+0x2a6>
cmpl   $0x3,-0x50(%rbp)
jne    1426 <main+0x2a6>
mov    -0x58(%rbp),%rax
mov    -0x60(%rbp),%rdx
mov    -0x48(%rbp),%ecx
imul   %rdx,%rcx
add    %rcx,%rax
mov    -0x4c(%rbp),%ecx
movb   $0x31,(%rax,%rcx,1)
cmpl   $0x2,-0x50(%rbp)
jb     143a <main+0x2ba>
cmpl   $0x3,-0x50(%rbp)
jbe    1453 <main+0x2d3>
mov    -0x58(%rbp),%rax
mov    -0x60(%rbp),%rdx
mov    -0x48(%rbp),%ecx
imul   %rdx,%rcx
add    %rcx,%rax
mov    -0x4c(%rbp),%ecx
movb   $0x30,(%rax,%rcx,1)
jmp    1458 <main+0x2d8>
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    136d <main+0x1ed>
jmp    146b <main+0x2eb>
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
jmp    135a <main+0x1da>
mov    -0x58(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x20(%rbp),%edx
call   1040 <printBoard@plt>
mov    -0x44(%rbp),%esi
lea    0xcc0(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1336 <main+0x1b6>
movl   $0x0,-0x4(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%rbx
mov    %edi,%r14d
lea    0xedd(%rip),%rdi
call   1050 <puts@plt>
cmp    $0x5,%r14d
jne    13bd <main+0x22d>
mov    0x10(%rbx),%rdi
mov    0x20(%rbx),%r15
call   1090 <atoi@plt>
mov    %eax,%r14d
mov    0x18(%rbx),%rdi
call   1090 <atoi@plt>
mov    %eax,%r13d
mov    0x8(%rbx),%rdi
mov    %r14d,%ebx
call   1090 <atoi@plt>
mov    %eax,%r14d
lea    0xea3(%rip),%rdi
call   1050 <puts@plt>
lea    0xe22(%rip),%rdi
mov    %r14d,-0x34(%rbp)
mov    %r14d,%esi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe1e(%rip),%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe1e(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe1f(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe68(%rip),%rdi
call   1050 <puts@plt>
mov    %ebx,%eax
mov    %r13d,%r12d
imul   %r12,%rax
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
mov    %rsp,%r14
sub    %rax,%r14
mov    %r14,%rsp
lea    0xe56(%rip),%rdi
call   1050 <puts@plt>
lea    0xe69(%rip),%rdi
call   1050 <puts@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    %r13d,%edx
call   1030 <loadBlankBoard@plt>
lea    0xe73(%rip),%rdi
call   1050 <puts@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    %r13d,%edx
call   1040 <printBoard@plt>
lea    0xe7b(%rip),%rdi
call   1050 <puts@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
mov    %r13d,%ecx
call   10b0 <loadBoard@plt>
lea    0xe82(%rip),%rdi
call   1050 <puts@plt>
mov    %r14,-0x30(%rbp)
mov    %r14,%rdi
mov    %ebx,%esi
mov    %r13d,%edx
call   1040 <printBoard@plt>
xor    %r14d,%r14d
jmp    1311 <main+0x181>
nopl   (%rax)
mov    -0x30(%rbp),%rdi
mov    %ebx,%esi
mov    %r12d,%edx
call   1040 <printBoard@plt>
lea    0xd82(%rip),%rdi
mov    -0x38(%rbp),%r14d
mov    %r14d,%esi
xor    %eax,%eax
call   1060 <printf@plt>
add    $0x1,%r14d
cmp    -0x34(%rbp),%r14d
ja     13ac <main+0x21c>
lea    0xd49(%rip),%rdi
mov    %r14d,-0x38(%rbp)
mov    %r14d,%esi
xor    %eax,%eax
call   1060 <printf@plt>
xor    %r14d,%r14d
jmp    1339 <main+0x1a9>
nopl   0x0(%rax,%rax,1)
add    $0x1,%r14d
cmp    %ebx,%r14d
ja     12e0 <main+0x150>
mov    %r14d,%r15d
imul   %r12,%r15
add    -0x30(%rbp),%r15
xor    %r13d,%r13d
jmp    135d <main+0x1cd>
mov    %esi,%ebx
nopl   0x0(%rax,%rax,1)
mov    %dl,(%r15,%r13,1)
add    $0x1,%r13d
cmp    %r12d,%r13d
ja     1330 <main+0x1a0>
mov    -0x30(%rbp),%rdi
mov    %r14d,%esi
mov    %r13d,%edx
mov    %ebx,%ecx
mov    %r12d,%r8d
call   1080 <vecinos@plt>
mov    %eax,%ecx
and    $0xfffffffe,%ecx
mov    %r13d,%r13d
mov    $0x30,%dl
cmp    $0x2,%ecx
jne    1350 <main+0x1c0>
mov    %ebx,%esi
movzbl (%r15,%r13,1),%edx
cmp    $0x31,%dl
jne    1391 <main+0x201>
movb   $0x31,(%r15,%r13,1)
cmp    $0x3,%eax
sete   %al
cmp    $0x30,%dl
sete   %bl
mov    $0x31,%dl
test   %al,%bl
jne    1349 <main+0x1b9>
cmp    $0x2,%ecx
mov    %esi,%ebx
je     1354 <main+0x1c4>
jmp    1350 <main+0x1c0>
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2c1c(%rip),%rax
mov    (%rax),%edi
lea    0xc33(%rip),%rsi
call   1070 <fprintf@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"start \0A\00"
@stderr = global i32 0
@.str.1 = [29 x i8] c"Wrong number of parameters!\0A\00"
@.str.2 = [25 x i8] c"end loading parameters \0A\00"
@.str.3 = [17 x i8] c"parameter 1 %i \0A\00"
@.str.4 = [17 x i8] c"parameter 2 %i \0A\00"
@.str.5 = [17 x i8] c"parameter 3 %i \0A\00"
@.str.6 = [17 x i8] c"parameter 4 %s \0A\00"
@.str.7 = [21 x i8] c"init the variables \0A\00"
@.str.8 = [32 x i8] c"end the init of the variables \0A\00"
@.str.9 = [36 x i8] c"start loading blank board to work \0A\00"
@.str.10 = [34 x i8] c"end loading blank board to work \0A\00"
@.str.11 = [36 x i8] c"start loading the board from file \0A\00"
@.str.12 = [27 x i8] c"end load board from file \0A\00"
@.str.13 = [22 x i8] c"start the action %i \0A\00"
@.str.14 = [20 x i8] c"end the action %i \0A\00"
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 i8*
%11 = alloca i64
%12 = alloca i64
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%18 = load i32, i32* %4
%19 = icmp ne i32 %18, 5
br i1 %19, label %20, label %24
20: ; preds = %2
%21 = load i32, i32* @stderr
%22 = call i32 @fprintf(i32 %21, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%23 = call i32 @exit(i32 1)
unreachable
24: ; preds = %2
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 4
%27 = load i8*, i8** %26
store i8* %27, i8** %6
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 2
%30 = load i8*, i8** %29
%31 = call i32 @atoi(i8* %30)
store i32 %31, i32* %7
%32 = load i8**, i8*** %5
%33 = getelementptr inbounds i8*, i8** %32, i64 3
%34 = load i8*, i8** %33
%35 = call i32 @atoi(i8* %34)
store i32 %35, i32* %8
%36 = load i8**, i8*** %5
%37 = getelementptr inbounds i8*, i8** %36, i64 1
%38 = load i8*, i8** %37
%39 = call i32 @atoi(i8* %38)
store i32 %39, i32* %9
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
%41 = load i32, i32* %9
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i32 %41)
%43 = load i32, i32* %8
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i32 %43)
%45 = load i32, i32* %7
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), i32 %45)
%47 = load i8*, i8** %6
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0), i8* %47)
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0))
%50 = load i32, i32* %7
%51 = zext i32 %50 to i64
%52 = load i32, i32* %8
%53 = zext i32 %52 to i64
%54 = call i8* @llvm.stacksave()
store i8* %54, i8** %10
%55 = mul nuw i64 %51, %53
%56 = alloca i8, i64 %55
store i64 %51, i64* %11
store i64 %53, i64* %12
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.8, i64 0, i64 0))
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.9, i64 0, i64 0))
%59 = bitcast i8* %56 to i8**
%60 = load i32, i32* %7
%61 = load i32, i32* %8
%62 = call i32 @loadBlankBoard(i8** %59, i32 %60, i32 %61)
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.10, i64 0, i64 0))
%64 = bitcast i8* %56 to i8**
%65 = load i32, i32* %7
%66 = load i32, i32* %8
%67 = call i32 @printBoard(i8** %64, i32 %65, i32 %66)
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.11, i64 0, i64 0))
%69 = load i8*, i8** %6
%70 = bitcast i8* %56 to i8**
%71 = load i32, i32* %7
%72 = load i32, i32* %8
%73 = call i32 @loadBoard(i8* %69, i8** %70, i32 %71, i32 %72)
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.12, i64 0, i64 0))
%75 = bitcast i8* %56 to i8**
%76 = load i32, i32* %7
%77 = load i32, i32* %8
%78 = call i32 @printBoard(i8** %75, i32 %76, i32 %77)
store i32 0, i32* %13
br label %79
79: ; preds = %177, %24
%80 = load i32, i32* %13
%81 = load i32, i32* %9
%82 = icmp ule i32 %80, %81
br i1 %82, label %83, label %180
83: ; preds = %79
%84 = load i32, i32* %13
%85 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.13, i64 0, i64 0), i32 %84)
store i32 0, i32* %14
br label %86
86: ; preds = %167, %83
%87 = load i32, i32* %14
%88 = load i32, i32* %7
%89 = icmp ule i32 %87, %88
br i1 %89, label %90, label %170
90: ; preds = %86
store i32 0, i32* %15
br label %91
91: ; preds = %163, %90
%92 = load i32, i32* %15
%93 = load i32, i32* %8
%94 = icmp ule i32 %92, %93
br i1 %94, label %95, label %166
95: ; preds = %91
%96 = bitcast i8* %56 to i8**
%97 = load i32, i32* %14
%98 = load i32, i32* %15
%99 = load i32, i32* %7
%100 = load i32, i32* %8
%101 = call i32 @vecinos(i8** %96, i32 %97, i32 %98, i32 %99, i32 %100)
store i32 %101, i32* %16
%102 = load i32, i32* %16
%103 = icmp eq i32 %102, 2
br i1 %103, label %107, label %104
104: ; preds = %95
%105 = load i32, i32* %16
%106 = icmp eq i32 %105, 3
br i1 %106, label %107, label %126
107: ; preds = %104, %95
%108 = load i32, i32* %14
%109 = zext i32 %108 to i64
%110 = mul nsw i64 %109, %53
%111 = getelementptr inbounds i8, i8* %56, i64 %110
%112 = load i32, i32* %15
%113 = zext i32 %112 to i64
%114 = getelementptr inbounds i8, i8* %111, i64 %113
%115 = load i8, i8* %114
%116 = zext i8 %115 to i32
%117 = icmp eq i32 %116, 49
br i1 %117, label %118, label %126
118: ; preds = %107
%119 = load i32, i32* %14
%120 = zext i32 %119 to i64
%121 = mul nsw i64 %120, %53
%122 = getelementptr inbounds i8, i8* %56, i64 %121
%123 = load i32, i32* %15
%124 = zext i32 %123 to i64
%125 = getelementptr inbounds i8, i8* %122, i64 %124
store i8 49, i8* %125
br label %126
126: ; preds = %118, %107, %104
%127 = load i32, i32* %14
%128 = zext i32 %127 to i64
%129 = mul nsw i64 %128, %53
%130 = getelementptr inbounds i8, i8* %56, i64 %129
%131 = load i32, i32* %15
%132 = zext i32 %131 to i64
%133 = getelementptr inbounds i8, i8* %130, i64 %132
%134 = load i8, i8* %133
%135 = zext i8 %134 to i32
%136 = icmp eq i32 %135, 48
br i1 %136, label %137, label %148
137: ; preds = %126
%138 = load i32, i32* %16
%139 = icmp eq i32 %138, 3
br i1 %139, label %140, label %148
140: ; preds = %137
%141 = load i32, i32* %14
%142 = zext i32 %141 to i64
%143 = mul nsw i64 %142, %53
%144 = getelementptr inbounds i8, i8* %56, i64 %143
%145 = load i32, i32* %15
%146 = zext i32 %145 to i64
%147 = getelementptr inbounds i8, i8* %144, i64 %146
store i8 49, i8* %147
br label %148
148: ; preds = %140, %137, %126
%149 = load i32, i32* %16
%150 = icmp ult i32 %149, 2
br i1 %150, label %154, label %151
151: ; preds = %148
%152 = load i32, i32* %16
%153 = icmp ugt i32 %152, 3
br i1 %153, label %154, label %162
154: ; preds = %151, %148
%155 = load i32, i32* %14
%156 = zext i32 %155 to i64
%157 = mul nsw i64 %156, %53
%158 = getelementptr inbounds i8, i8* %56, i64 %157
%159 = load i32, i32* %15
%160 = zext i32 %159 to i64
%161 = getelementptr inbounds i8, i8* %158, i64 %160
store i8 48, i8* %161
br label %162
162: ; preds = %154, %151
br label %163
163: ; preds = %162
%164 = load i32, i32* %15
%165 = add i32 %164, 1
store i32 %165, i32* %15
br label %91
166: ; preds = %91
br label %167
167: ; preds = %166
%168 = load i32, i32* %14
%169 = add i32 %168, 1
store i32 %169, i32* %14
br label %86
170: ; preds = %86
%171 = bitcast i8* %56 to i8**
%172 = load i32, i32* %7
%173 = load i32, i32* %8
%174 = call i32 @printBoard(i8** %171, i32 %172, i32 %173)
%175 = load i32, i32* %13
%176 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.14, i64 0, i64 0), i32 %175)
br label %177
177: ; preds = %170
%178 = load i32, i32* %13
%179 = add i32 %178, 1
store i32 %179, i32* %13
br label %79
180: ; preds = %79
store i32 0, i32* %3
%181 = load i8*, i8** %10
%182 = load i32, i32* %3
ret i32 %182
}

LLVM IR (-O2):
@stderr = global i32 0
@.str.1 = [29 x i8] c"Wrong number of parameters!\0A\00"
@.str.3 = [17 x i8] c"parameter 1 %i \0A\00"
@.str.4 = [17 x i8] c"parameter 2 %i \0A\00"
@.str.5 = [17 x i8] c"parameter 3 %i \0A\00"
@.str.6 = [17 x i8] c"parameter 4 %s \0A\00"
@.str.13 = [22 x i8] c"start the action %i \0A\00"
@.str.14 = [20 x i8] c"end the action %i \0A\00"
@str = [7 x i8] c"start \00"
@str.15 = [24 x i8] c"end loading parameters \00"
@str.16 = [20 x i8] c"init the variables \00"
@str.17 = [31 x i8] c"end the init of the variables \00"
@str.18 = [35 x i8] c"start loading blank board to work \00"
@str.19 = [33 x i8] c"end loading blank board to work \00"
@str.20 = [35 x i8] c"start loading the board from file \00"
@str.21 = [26 x i8] c"end load board from file \00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%4 = icmp eq i32 %0, 5
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
%10 = getelementptr inbounds i8*, i8** %1, i64 4
%11 = load i8*, i8** %10
%12 = getelementptr inbounds i8*, i8** %1, i64 2
%13 = load i8*, i8** %12
%14 = tail call i32 @atoi(i8* %13)
%15 = getelementptr inbounds i8*, i8** %1, i64 3
%16 = load i8*, i8** %15
%17 = tail call i32 @atoi(i8* %16)
%18 = getelementptr inbounds i8*, i8** %1, i64 1
%19 = load i8*, i8** %18
%20 = tail call i32 @atoi(i8* %19)
%21 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.15, i64 0, i64 0))
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i32 %20)
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i32 %17)
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), i32 %14)
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0), i8* %11)
%26 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.16, i64 0, i64 0))
%27 = zext i32 %14 to i64
%28 = zext i32 %17 to i64
%29 = mul nuw i64 %28, %27
%30 = alloca i8, i64 %29
%31 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.17, i64 0, i64 0))
%32 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.18, i64 0, i64 0))
%33 = bitcast i8* %30 to i8**
%34 = call i32 @loadBlankBoard(i8** %33, i32 %14, i32 %17)
%35 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.19, i64 0, i64 0))
%36 = call i32 @printBoard(i8** %33, i32 %14, i32 %17)
%37 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.20, i64 0, i64 0))
%38 = call i32 @loadBoard(i8* %11, i8** %33, i32 %14, i32 %17)
%39 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.21, i64 0, i64 0))
%40 = call i32 @printBoard(i8** %33, i32 %14, i32 %17)
br label %41
41: ; preds = %9, %75
%42 = phi i32 [ 0, %9 ], [ %78, %75 ]
%43 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.13, i64 0, i64 0), i32 %42)
br label %44
44: ; preds = %41, %72
%45 = phi i32 [ 0, %41 ], [ %73, %72 ]
%46 = zext i32 %45 to i64
%47 = mul nuw nsw i64 %46, %28
%48 = getelementptr inbounds i8, i8* %30, i64 %47
br label %49
49: ; preds = %44, %69
%50 = phi i32 [ 0, %44 ], [ %70, %69 ]
%51 = call i32 @vecinos(i8** %33, i32 %45, i32 %50, i32 %14, i32 %17)
%52 = icmp eq i32 %51, 3
%53 = and i32 %51, -2
%54 = icmp eq i32 %53, 2
%55 = zext i32 %50 to i64
br i1 %54, label %56, label %66
56: ; preds = %49
%57 = getelementptr inbounds i8, i8* %48, i64 %55
%58 = load i8, i8* %57
%59 = icmp eq i8 %58, 49
br i1 %59, label %60, label %61
60: ; preds = %56
store i8 49, i8* %57
br label %61
61: ; preds = %60, %56
%62 = icmp eq i8 %58, 48
%63 = select i1 %62, i1 %52, i1 false
%64 = xor i1 %54, true
%65 = or i1 %63, %64
br i1 %65, label %66, label %69
66: ; preds = %49, %61
%67 = phi i8 [ 48, %49 ], [ 49, %61 ]
%68 = getelementptr inbounds i8, i8* %48, i64 %55
store i8 %67, i8* %68
br label %69
69: ; preds = %61, %66
%70 = add i32 %50, 1
%71 = icmp ugt i32 %70, %17
br i1 %71, label %72, label %49
72: ; preds = %69
%73 = add i32 %45, 1
%74 = icmp ugt i32 %73, %14
br i1 %74, label %75, label %44
75: ; preds = %72
%76 = call i32 @printBoard(i8** %33, i32 %14, i32 %17)
%77 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.14, i64 0, i64 0), i32 %42)
%78 = add i32 %42, 1
%79 = icmp ugt i32 %78, %20
br i1 %79, label %80, label %41
80: ; preds = %75
ret i32 0
}