#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;
int /*<<< orphan*/ printf(char *, ...);
int random();
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ srandom(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/);
int main(int argc, char **argv) {
  int taulell[5][5] = {0};
  int k, cont, fi = 0, ia, ja, i, j, orientacio, colocat = 0, afonat;
  srandom(time(0));
  do {
    ia = random() % 5;
    ja = random() % 5;
    orientacio = random() % 4;
    cont = 1;
    while (!colocat && cont <= 4) {
      switch (orientacio) {
      case 0:
        if (ja < 2) {
          for (k = 0; k < 5 - 1; k++)
            taulell[ia][ja + k] = 1;
          colocat = 1;
        }
        break;
      case 1:
        if (ia < 2) {
          for (k = 0; k < 5 - 1; k++)
            taulell[ia + k][ja] = 1;
          colocat = 1;
        }
        break;
      case 2:
        if (ja >= 5 - 2) {
          for (k = 0; k < 5 - 1; k++)
            taulell[ia][ja - k] = 1;
          colocat = 1;
        }
        break;
      case 3:
        if (ia >= 5 - 2) {
          for (k = 0; k < 5 - 1; k++)
            taulell[ia - k][ja] = 1;
          colocat = 1;
        }
      }
      if (!colocat) {
        orientacio = (++orientacio) % 4;
        cont++;
      }
    }
  } while (!colocat);
  cont = 1;
  while (!fi) {
    printf("\n#### Jugada nº %d #### \n", cont);
    do {
      printf("\nIntrodueix una fila (1-%d): \n", 5);
      scanf("%d", &i);
      if (i < 1 || i > 5)
        printf("\nFila incorrecta. Ha de ser entre (1-%d) \n", 5);
    } while (i < 1 || i > 5);
    do {
      printf("\nIntrodueix una columna (1-%d): \n", 5);
      scanf("%d", &j);
      if (j < 1 || j > 5)
        printf("\nColumna incorrecta. Ha de ser entre (1-%d) \n", 5);
    } while (j < 1 || j > 5);
    i--;
    j--;
    switch (taulell[i][j]) {
    case 0:
      printf("\nAigua!!");
      taulell[i][j] = 2;
      break;
    case 1:
      printf("\nTocat");
      taulell[i][j] = 3;
      afonat = 1;
      switch (orientacio) {
      case 0:
        for (k = 0; k < 5 - 1 && afonat; k++)
          if (taulell[ia][ja + k] == 1)
            afonat = 0;
        break;
      case 1:
        for (k = 0; k < 5 - 1 && afonat; k++)
          if (taulell[ia + k][ja] == 1)
            afonat = 0;
        break;
      case 2:
        for (k = 0; k < 5 - 1 && afonat; k++)
          if (taulell[ia][ja - k] == 1)
            afonat = 0;
        break;
      case 3:
        for (k = 0; k < 5 - 1 && afonat; k++)
          if (taulell[ia - k][ja] == 1)
            afonat = 0;
        break;
      }
      if (afonat) {
        printf(" i afonat!!\n");
        printf("T'has costat %d intents", cont);
      } else
        printf("!!\n");
      fi = afonat;
      break;
    case 2:
      printf("\nJa has disparat aquí i hi ha aigua");
      cont--;
      break;
    case 3:
      printf("\nJa has disparat aquí i hi ha un barco");
      cont--;
      break;
    }
    printf("\n\n");
    for (i = 0; i < 5; i++) {
      for (j = 0; j < 5; j++) {
        switch (taulell[i][j]) {
        case 0:
        case 1:
          printf("? ");
          break;
        case 2:
          printf("~ ");
          break;
        case 3:
          printf("X ");
          break;
        }
      }
      printf("\n");
    }
    cont++;
  }
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x80(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1050 <memset@plt>
movl   $0x0,-0x8c(%rbp)
movl   $0x0,-0xa4(%rbp)
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1030 <srandom@plt>
mov    $0x0,%al
call   1070 <random@plt>
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %edx,-0x90(%rbp)
mov    $0x0,%al
call   1070 <random@plt>
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %edx,-0x94(%rbp)
mov    $0x0,%al
call   1070 <random@plt>
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %edx,-0xa0(%rbp)
movl   $0x1,-0x88(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0xa4(%rbp)
mov    %al,-0xa9(%rbp)
jne    1219 <main+0xb9>
cmpl   $0x4,-0x88(%rbp)
setle  %al
mov    %al,-0xa9(%rbp)
mov    -0xa9(%rbp),%al
test   $0x1,%al
jne    122c <main+0xcc>
jmp    1454 <main+0x2f4>
mov    -0xa0(%rbp),%eax
mov    %rax,-0xb8(%rbp)
sub    $0x3,%rax
ja     1416 <main+0x2b6>
mov    -0xb8(%rbp),%rax
lea    0xdcf(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
cmpl   $0x2,-0x94(%rbp)
jge    12c4 <main+0x164>
movl   $0x0,-0x84(%rbp)
cmpl   $0x4,-0x84(%rbp)
jge    12ba <main+0x15a>
movslq -0x90(%rbp),%rcx
lea    -0x80(%rbp),%rax
imul   $0x14,%rcx,%rcx
add    %rcx,%rax
mov    -0x94(%rbp),%ecx
add    -0x84(%rbp),%ecx
movslq %ecx,%rcx
movl   $0x1,(%rax,%rcx,4)
mov    -0x84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84(%rbp)
jmp    1271 <main+0x111>
movl   $0x1,-0xa4(%rbp)
jmp    1416 <main+0x2b6>
cmpl   $0x2,-0x90(%rbp)
jge    1333 <main+0x1d3>
movl   $0x0,-0x84(%rbp)
cmpl   $0x4,-0x84(%rbp)
jge    1329 <main+0x1c9>
mov    -0x90(%rbp),%eax
add    -0x84(%rbp),%eax
movslq %eax,%rcx
lea    -0x80(%rbp),%rax
imul   $0x14,%rcx,%rcx
add    %rcx,%rax
movslq -0x94(%rbp),%rcx
movl   $0x1,(%rax,%rcx,4)
mov    -0x84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84(%rbp)
jmp    12e0 <main+0x180>
movl   $0x1,-0xa4(%rbp)
jmp    1416 <main+0x2b6>
cmpl   $0x3,-0x94(%rbp)
jl     13a2 <main+0x242>
movl   $0x0,-0x84(%rbp)
cmpl   $0x4,-0x84(%rbp)
jge    1398 <main+0x238>
movslq -0x90(%rbp),%rcx
lea    -0x80(%rbp),%rax
imul   $0x14,%rcx,%rcx
add    %rcx,%rax
mov    -0x94(%rbp),%ecx
sub    -0x84(%rbp),%ecx
movslq %ecx,%rcx
movl   $0x1,(%rax,%rcx,4)
mov    -0x84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84(%rbp)
jmp    134f <main+0x1ef>
movl   $0x1,-0xa4(%rbp)
jmp    1416 <main+0x2b6>
cmpl   $0x3,-0x90(%rbp)
jl     1411 <main+0x2b1>
movl   $0x0,-0x84(%rbp)
cmpl   $0x4,-0x84(%rbp)
jge    1407 <main+0x2a7>
mov    -0x90(%rbp),%eax
sub    -0x84(%rbp),%eax
movslq %eax,%rcx
lea    -0x80(%rbp),%rax
imul   $0x14,%rcx,%rcx
add    %rcx,%rax
movslq -0x94(%rbp),%rcx
movl   $0x1,(%rax,%rcx,4)
mov    -0x84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84(%rbp)
jmp    13be <main+0x25e>
movl   $0x1,-0xa4(%rbp)
jmp    1416 <main+0x2b6>
cmpl   $0x0,-0xa4(%rbp)
jne    144f <main+0x2ef>
mov    -0xa0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa0(%rbp)
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %edx,-0xa0(%rbp)
mov    -0x88(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x88(%rbp)
jmp    11f4 <main+0x94>
jmp    1459 <main+0x2f9>
cmpl   $0x0,-0xa4(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    11ab <main+0x4b>
movl   $0x1,-0x88(%rbp)
cmpl   $0x0,-0x8c(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1490 <main+0x330>
jmp    1ab1 <main+0x951>
mov    -0x88(%rbp),%esi
lea    0xb93(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xba0(%rip),%rdi
mov    $0x5,%esi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xbac(%rip),%rdi
lea    -0x98(%rbp),%rsi
call   1080 <scanf@plt>
cmpl   $0x1,-0x98(%rbp)
jl     14e4 <main+0x384>
cmpl   $0x5,-0x98(%rbp)
jle    14f7 <main+0x397>
lea    0xb82(%rip),%rdi
mov    $0x5,%esi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    14fc <main+0x39c>
mov    $0x1,%al
cmpl   $0x1,-0x98(%rbp)
mov    %al,-0xb9(%rbp)
jl     1521 <main+0x3c1>
cmpl   $0x5,-0x98(%rbp)
setg   %al
mov    %al,-0xb9(%rbp)
mov    -0xb9(%rbp),%al
test   $0x1,%al
jne    14a4 <main+0x344>
jmp    1534 <main+0x3d4>
lea    0xb5d(%rip),%rdi
mov    $0x5,%esi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xb1c(%rip),%rdi
lea    -0x9c(%rbp),%rsi
call   1080 <scanf@plt>
cmpl   $0x1,-0x9c(%rbp)
jl     1574 <main+0x414>
cmpl   $0x5,-0x9c(%rbp)
jle    1587 <main+0x427>
lea    0xb3f(%rip),%rdi
mov    $0x5,%esi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    158c <main+0x42c>
mov    $0x1,%al
cmpl   $0x1,-0x9c(%rbp)
mov    %al,-0xba(%rbp)
jl     15b1 <main+0x451>
cmpl   $0x5,-0x9c(%rbp)
setg   %al
mov    %al,-0xba(%rbp)
mov    -0xba(%rbp),%al
test   $0x1,%al
jne    1534 <main+0x3d4>
mov    -0x98(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x98(%rbp)
mov    -0x9c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x9c(%rbp)
movslq -0x98(%rbp),%rax
lea    (%rax,%rax,4),%rax
lea    -0x80(%rbp,%rax,4),%rax
movslq -0x9c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %rax,-0xc8(%rbp)
sub    $0x3,%rax
ja     199c <main+0x83c>
mov    -0xc8(%rbp),%rax
lea    0x9ea(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xac2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movslq -0x98(%rbp),%rcx
lea    -0x80(%rbp),%rax
imul   $0x14,%rcx,%rcx
add    %rcx,%rax
movslq -0x9c(%rbp),%rcx
movl   $0x2,(%rax,%rcx,4)
jmp    199c <main+0x83c>
lea    0xa98(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movslq -0x98(%rbp),%rax
lea    (%rax,%rax,4),%rax
lea    -0x80(%rbp,%rax,4),%rax
movslq -0x9c(%rbp),%rcx
movl   $0x3,(%rax,%rcx,4)
movl   $0x1,-0xa8(%rbp)
mov    -0xa0(%rbp),%eax
mov    %rax,-0xd0(%rbp)
sub    $0x3,%rax
ja     190a <main+0x7aa>
mov    -0xd0(%rbp),%rax
lea    0x963(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x0,-0x84(%rbp)
xor    %eax,%eax
cmpl   $0x4,-0x84(%rbp)
mov    %al,-0xd1(%rbp)
jge    16e5 <main+0x585>
cmpl   $0x0,-0xa8(%rbp)
setne  %al
mov    %al,-0xd1(%rbp)
mov    -0xd1(%rbp),%al
test   $0x1,%al
jne    16f8 <main+0x598>
jmp    1746 <main+0x5e6>
movslq -0x90(%rbp),%rcx
lea    -0x80(%rbp),%rax
imul   $0x14,%rcx,%rcx
add    %rcx,%rax
mov    -0x94(%rbp),%ecx
add    -0x84(%rbp),%ecx
movslq %ecx,%rcx
cmpl   $0x1,(%rax,%rcx,4)
jne    172d <main+0x5cd>
movl   $0x0,-0xa8(%rbp)
jmp    1732 <main+0x5d2>
mov    -0x84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84(%rbp)
jmp    16c0 <main+0x560>
jmp    190a <main+0x7aa>
movl   $0x0,-0x84(%rbp)
xor    %eax,%eax
cmpl   $0x4,-0x84(%rbp)
mov    %al,-0xd2(%rbp)
jge    177a <main+0x61a>
cmpl   $0x0,-0xa8(%rbp)
setne  %al
mov    %al,-0xd2(%rbp)
mov    -0xd2(%rbp),%al
test   $0x1,%al
jne    178d <main+0x62d>
jmp    17db <main+0x67b>
mov    -0x90(%rbp),%eax
add    -0x84(%rbp),%eax
movslq %eax,%rcx
lea    -0x80(%rbp),%rax
imul   $0x14,%rcx,%rcx
add    %rcx,%rax
movslq -0x94(%rbp),%rcx
cmpl   $0x1,(%rax,%rcx,4)
jne    17c2 <main+0x662>
movl   $0x0,-0xa8(%rbp)
jmp    17c7 <main+0x667>
mov    -0x84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84(%rbp)
jmp    1755 <main+0x5f5>
jmp    190a <main+0x7aa>
movl   $0x0,-0x84(%rbp)
xor    %eax,%eax
cmpl   $0x4,-0x84(%rbp)
mov    %al,-0xd3(%rbp)
jge    180f <main+0x6af>
cmpl   $0x0,-0xa8(%rbp)
setne  %al
mov    %al,-0xd3(%rbp)
mov    -0xd3(%rbp),%al
test   $0x1,%al
jne    1822 <main+0x6c2>
jmp    1870 <main+0x710>
movslq -0x90(%rbp),%rcx
lea    -0x80(%rbp),%rax
imul   $0x14,%rcx,%rcx
add    %rcx,%rax
mov    -0x94(%rbp),%ecx
sub    -0x84(%rbp),%ecx
movslq %ecx,%rcx
cmpl   $0x1,(%rax,%rcx,4)
jne    1857 <main+0x6f7>
movl   $0x0,-0xa8(%rbp)
jmp    185c <main+0x6fc>
mov    -0x84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84(%rbp)
jmp    17ea <main+0x68a>
jmp    190a <main+0x7aa>
movl   $0x0,-0x84(%rbp)
xor    %eax,%eax
cmpl   $0x4,-0x84(%rbp)
mov    %al,-0xd4(%rbp)
jge    18a4 <main+0x744>
cmpl   $0x0,-0xa8(%rbp)
setne  %al
mov    %al,-0xd4(%rbp)
mov    -0xd4(%rbp),%al
test   $0x1,%al
jne    18b7 <main+0x757>
jmp    1905 <main+0x7a5>
mov    -0x90(%rbp),%eax
sub    -0x84(%rbp),%eax
movslq %eax,%rcx
lea    -0x80(%rbp),%rax
imul   $0x14,%rcx,%rcx
add    %rcx,%rax
movslq -0x94(%rbp),%rcx
cmpl   $0x1,(%rax,%rcx,4)
jne    18ec <main+0x78c>
movl   $0x0,-0xa8(%rbp)
jmp    18f1 <main+0x791>
mov    -0x84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84(%rbp)
jmp    187f <main+0x71f>
jmp    190a <main+0x7aa>
cmpl   $0x0,-0xa8(%rbp)
je     193e <main+0x7de>
lea    0x7da(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x88(%rbp),%esi
lea    0x7d3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    194c <main+0x7ec>
lea    0x7bc(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xa8(%rbp),%eax
mov    %eax,-0x8c(%rbp)
jmp    199c <main+0x83c>
lea    0x7b9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x88(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x88(%rbp)
jmp    199c <main+0x83c>
lea    0x7bc(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x88(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x88(%rbp)
lea    0x7c7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x98(%rbp)
cmpl   $0x5,-0x98(%rbp)
jge    1a9d <main+0x93d>
movl   $0x0,-0x9c(%rbp)
cmpl   $0x5,-0x9c(%rbp)
jge    1a7b <main+0x91b>
movslq -0x98(%rbp),%rax
lea    (%rax,%rax,4),%rax
lea    -0x80(%rbp,%rax,4),%rax
movslq -0x9c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0xd8(%rbp)
sub    $0x2,%eax
jb     1a2e <main+0x8ce>
jmp    1a06 <main+0x8a6>
mov    -0xd8(%rbp),%eax
sub    $0x2,%eax
je     1a41 <main+0x8e1>
jmp    1a1a <main+0x8ba>
mov    -0xd8(%rbp),%eax
sub    $0x3,%eax
je     1a54 <main+0x8f4>
jmp    1a62 <main+0x902>
lea    0x738(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1a62 <main+0x902>
lea    0x728(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1a62 <main+0x902>
lea    0x718(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1a67 <main+0x907>
mov    -0x9c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c(%rbp)
jmp    19cb <main+0x86b>
lea    0x6e9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x98(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x98(%rbp)
jmp    19b4 <main+0x854>
mov    -0x88(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x88(%rbp)
jmp    1477 <main+0x317>
mov    0x2528(%rip),%rax
mov    (%rax),%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x88,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movl   $0x0,0x80(%rsp)
xor    %edi,%edi
call   1070 <time@plt>
mov    %eax,%edi
call   1040 <srandom@plt>
lea    0xe6e(%rip),%r14
lea    0xe57(%rip),%r15
lea    0xe40(%rip),%r12
lea    0xe29(%rip),%r13
jmp    11f0 <main+0x80>
cmp    $0x2,%ebp
jg     13c6 <main+0x256>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1080 <random@plt>
movslq %eax,%rbp
imul   $0x66666667,%rbp,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x21,%rax
add    %ecx,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%ebp
xor    %eax,%eax
call   1080 <random@plt>
movslq %eax,%rbx
imul   $0x66666667,%rbx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x21,%rax
add    %ecx,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%ebx
xor    %eax,%eax
call   1080 <random@plt>
lea    0x3(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xfffffffc,%ecx
sub    %ecx,%eax
cmp    $0x3,%eax
ja     12a0 <main+0x130>
movslq 0x0(%r13,%rax,4),%rcx
add    %r13,%rcx
jmp    *%rcx
cmp    $0x1,%ebx
jg     12a0 <main+0x130>
jmp    13fe <main+0x28e>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cmp    $0x1,%ebp
jg     12a0 <main+0x130>
jmp    1432 <main+0x2c2>
nopw   0x0(%rax,%rax,1)
cmp    $0x3,%ebx
jl     12a0 <main+0x130>
jmp    138c <main+0x21c>
nopw   0x0(%rax,%rax,1)
cmp    $0x3,%ebp
jge    13c6 <main+0x256>
nopl   0x0(%rax)
lea    0x1(%rax),%ecx
lea    0x4(%rax),%edx
test   %ecx,%ecx
cmovns %ecx,%edx
and    $0xfffffffc,%edx
neg    %edx
add    %edx,%eax
add    $0x1,%eax
cmp    $0x3,%eax
ja     12f0 <main+0x180>
movslq (%r12,%rax,4),%rcx
add    %r12,%rcx
jmp    *%rcx
cmp    $0x2,%ebx
jge    12f0 <main+0x180>
jmp    13fe <main+0x28e>
cmp    $0x2,%ebp
jge    12f0 <main+0x180>
jmp    1432 <main+0x2c2>
cmp    $0x2,%ebx
jle    12f0 <main+0x180>
jmp    138c <main+0x21c>
cmp    $0x2,%ebp
jg     13c6 <main+0x256>
nopw   0x0(%rax,%rax,1)
lea    0x1(%rax),%ecx
lea    0x4(%rax),%edx
test   %ecx,%ecx
cmovns %ecx,%edx
and    $0xfffffffc,%edx
neg    %edx
add    %edx,%eax
add    $0x1,%eax
cmp    $0x3,%eax
ja     1340 <main+0x1d0>
movslq (%r15,%rax,4),%rcx
add    %r15,%rcx
jmp    *%rcx
cmp    $0x2,%ebx
jge    1340 <main+0x1d0>
jmp    13fe <main+0x28e>
cmp    $0x2,%ebp
jge    1340 <main+0x1d0>
jmp    1432 <main+0x2c2>
cmp    $0x2,%ebx
jle    1340 <main+0x1d0>
jmp    138c <main+0x21c>
cmp    $0x2,%ebp
jg     13c6 <main+0x256>
nopw   0x0(%rax,%rax,1)
lea    0x1(%rax),%ecx
lea    0x4(%rax),%edx
test   %ecx,%ecx
cmovns %ecx,%edx
and    $0xfffffffc,%edx
neg    %edx
add    %edx,%eax
add    $0x1,%eax
cmp    $0x3,%eax
ja     11f0 <main+0x80>
movslq (%r14,%rax,4),%rax
add    %r14,%rax
jmp    *%rax
cmp    $0x2,%ebx
jge    11f0 <main+0x80>
jmp    13fe <main+0x28e>
cmp    $0x2,%ebp
jge    11f0 <main+0x80>
jmp    1432 <main+0x2c2>
cmp    $0x2,%ebx
jle    11f0 <main+0x80>
movslq %ebx,%rax
movslq %ebp,%rcx
lea    (%rcx,%rcx,4),%rdx
lea    (%rsp,%rdx,4),%rdx
add    $0x20,%rdx
movl   $0x1,(%rdx,%rax,4)
movabs $0x100000001,%rsi
mov    %rsi,-0x8(%rdx,%rax,4)
lea    (%rdx,%rax,4),%rsi
add    $0xfffffffffffffff4,%rsi
mov    $0x2,%edx
jmp    1468 <main+0x2f8>
movslq %ebx,%rax
movslq %ebp,%rcx
lea    (%rcx,%rcx,4),%rdx
lea    (%rsp,%rdx,4),%rdx
add    $0x20,%rdx
movl   $0x1,(%rdx,%rax,4)
movl   $0x1,-0x14(%rdx,%rax,4)
movl   $0x1,-0x28(%rdx,%rax,4)
lea    (%rdx,%rax,4),%rsi
add    $0xffffffffffffffc4,%rsi
mov    $0x3,%edx
jmp    1468 <main+0x2f8>
movslq %ebx,%rax
movslq %ebp,%rcx
lea    (%rcx,%rcx,4),%rdx
lea    (%rsp,%rdx,4),%rdx
add    $0x20,%rdx
movabs $0x100000001,%rsi
mov    %rsi,(%rdx,%rax,4)
movl   $0x1,0x8(%rdx,%rax,4)
lea    (%rdx,%rax,4),%rsi
add    $0xc,%rsi
xor    %edx,%edx
jmp    1468 <main+0x2f8>
movslq %ebx,%rax
movslq %ebp,%rcx
lea    (%rcx,%rcx,4),%rdx
lea    (%rsp,%rdx,4),%rdx
add    $0x20,%rdx
movl   $0x1,(%rdx,%rax,4)
movl   $0x1,0x14(%rdx,%rax,4)
movl   $0x1,0x28(%rdx,%rax,4)
lea    (%rdx,%rax,4),%rsi
add    $0x3c,%rsi
mov    $0x1,%edx
movl   $0x1,(%rsi)
lea    (%rcx,%rcx,4),%rcx
lea    (%rsp,%rcx,4),%rcx
add    $0x20,%rcx
lea    (%rcx,%rax,4),%rax
mov    %rax,0x10(%rsp)
mov    $0x1,%esi
lea    0xbfc(%rip),%r12
lea    0xc14(%rip),%rbp
mov    %rsp,%rbx
lea    0xc38(%rip),%r14
lea    0x4(%rsp),%r15
lea    0xbb4(%rip),%r13
mov    %edx,%eax
mov    %rax,0x18(%rsp)
jmp    14d2 <main+0x362>
cs nopw 0x0(%rax,%rax,1)
nop
mov    0x8(%rsp),%esi
add    $0x1,%esi
cmpb   $0x0,0xc(%rsp)
je     17ef <main+0x67f>
lea    0xb97(%rip),%rdi
mov    %esi,0x8(%rsp)
xor    %eax,%eax
call   1060 <printf@plt>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r12,%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1090 <scanf@plt>
mov    (%rsp),%eax
add    $0xfffffffa,%eax
cmp    $0xfffffffa,%eax
ja     1540 <main+0x3d0>
lea    0xb91(%rip),%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    (%rsp),%eax
add    $0xfffffffa,%eax
cmp    $0xfffffffb,%eax
jb     14f0 <main+0x380>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbp,%rdi
mov    %r15,%rsi
call   1090 <scanf@plt>
mov    0x4(%rsp),%eax
lea    -0x6(%rax),%ecx
cmp    $0xfffffffa,%ecx
ja     1585 <main+0x415>
lea    0xb8d(%rip),%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x4(%rsp),%eax
lea    -0x6(%rax),%ecx
cmp    $0xfffffffb,%ecx
jb     1540 <main+0x3d0>
movslq (%rsp),%rcx
add    $0xffffffffffffffff,%rcx
mov    %ecx,(%rsp)
add    $0xffffffff,%eax
mov    %eax,0x4(%rsp)
lea    (%rcx,%rcx,4),%rcx
lea    (%rsp,%rcx,4),%rcx
add    $0x20,%rcx
mov    (%rcx,%rax,4),%eax
mov    $0x1,%cl
mov    %ecx,0xc(%rsp)
cmp    $0x3,%rax
ja     1760 <main+0x5f0>
lea    0xa83(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xb5b(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movslq (%rsp),%rax
movslq 0x4(%rsp),%rcx
lea    (%rax,%rax,4),%rax
lea    (%rsp,%rax,4),%rax
add    $0x20,%rax
movl   $0x2,(%rax,%rcx,4)
jmp    1760 <main+0x5f0>
cs nopw 0x0(%rax,%rax,1)
nop
lea    0xb2a(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movslq (%rsp),%rax
movslq 0x4(%rsp),%rcx
lea    (%rax,%rax,4),%rax
lea    (%rsp,%rax,4),%rax
add    $0x20,%rax
movl   $0x3,(%rax,%rcx,4)
mov    0x18(%rsp),%rax
lea    0xa1a(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x10(%rsp),%rcx
cmpl   $0x1,(%rcx)
setne  %al
je     1720 <main+0x5b0>
cmpl   $0x1,0x4(%rcx)
setne  %al
je     1720 <main+0x5b0>
cmpl   $0x1,0x8(%rcx)
setne  %al
je     1720 <main+0x5b0>
cmpl   $0x1,0xc(%rcx)
jmp    1715 <main+0x5a5>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    0xac9(%rip),%rdi
jmp    1697 <main+0x527>
nopl   0x0(%rax)
lea    0xade(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
addl   $0xffffffff,0x8(%rsp)
jmp    1760 <main+0x5f0>
mov    0x10(%rsp),%rcx
cmpl   $0x1,(%rcx)
setne  %al
je     1720 <main+0x5b0>
cmpl   $0x1,-0x4(%rcx)
setne  %al
je     1720 <main+0x5b0>
cmpl   $0x1,-0x8(%rcx)
setne  %al
je     1720 <main+0x5b0>
cmpl   $0x1,-0xc(%rcx)
jmp    1715 <main+0x5a5>
mov    0x10(%rsp),%rcx
cmpl   $0x1,(%rcx)
setne  %al
je     1720 <main+0x5b0>
cmpl   $0x1,-0x14(%rcx)
setne  %al
je     1720 <main+0x5b0>
cmpl   $0x1,-0x28(%rcx)
setne  %al
je     1720 <main+0x5b0>
cmpl   $0x1,-0x3c(%rcx)
jmp    1715 <main+0x5a5>
mov    0x10(%rsp),%rcx
cmpl   $0x1,(%rcx)
setne  %al
je     1720 <main+0x5b0>
cmpl   $0x1,0x14(%rcx)
setne  %al
je     1720 <main+0x5b0>
cmpl   $0x1,0x28(%rcx)
setne  %al
je     1720 <main+0x5b0>
cmpl   $0x1,0x3c(%rcx)
setne  %al
nopl   0x0(%rax,%rax,1)
test   %al,%al
je     174c <main+0x5dc>
lea    0xa7b(%rip),%rdi
call   1050 <puts@plt>
movl   $0x0,0xc(%rsp)
lea    0x9f9(%rip),%rdi
mov    0x8(%rsp),%esi
xor    %eax,%eax
call   1060 <printf@plt>
jmp    1760 <main+0x5f0>
lea    0x9db(%rip),%rdi
call   1050 <puts@plt>
nopl   0x0(%rax,%rax,1)
lea    0x922(%rip),%rdi
call   1050 <puts@plt>
movl   $0x0,(%rsp)
xor    %eax,%eax
jmp    179c <main+0x62c>
nopw   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    (%rsp),%ecx
lea    0x1(%rcx),%eax
mov    %eax,(%rsp)
cmp    $0x4,%ecx
jge    14c0 <main+0x350>
movl   $0x0,0x4(%rsp)
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
cltq
movslq %ecx,%rcx
lea    (%rax,%rax,4),%rax
lea    (%rsp,%rax,4),%rax
add    $0x20,%rax
movslq (%rax,%rcx,4),%rax
cmp    $0x3,%rax
ja     17da <main+0x66a>
movslq 0x0(%r13,%rax,4),%rdi
add    %r13,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x4(%rsp),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x4(%rsp)
cmp    $0x3,%eax
jg     1780 <main+0x610>
mov    (%rsp),%eax
jmp    17b0 <main+0x640>
mov    0x27ea(%rip),%rax
mov    (%rax),%eax
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [27 x i8] c"\0A#### Jugada n\C2\BA %d #### \0A\00"
@.str.1 = [31 x i8] c"\0AIntrodueix una fila (1-%d): \0A\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [43 x i8] c"\0AFila incorrecta. Ha de ser entre (1-%d) \0A\00"
@.str.4 = [34 x i8] c"\0AIntrodueix una columna (1-%d): \0A\00"
@.str.5 = [46 x i8] c"\0AColumna incorrecta. Ha de ser entre (1-%d) \0A\00"
@.str.6 = [9 x i8] c"\0AAigua!!\00"
@.str.7 = [7 x i8] c"\0ATocat\00"
@.str.8 = [13 x i8] c" i afonat!!\0A\00"
@.str.9 = [24 x i8] c"T'has costat %d intents\00"
@.str.10 = [4 x i8] c"!!\0A\00"
@.str.11 = [37 x i8] c"\0AJa has disparat aqu\C3\AD i hi ha aigua\00"
@.str.12 = [40 x i8] c"\0AJa has disparat aqu\C3\AD i hi ha un barco\00"
@.str.13 = [3 x i8] c"\0A\0A\00"
@.str.14 = [3 x i8] c"? \00"
@.str.15 = [3 x i8] c"~ \00"
@.str.16 = [3 x i8] c"X \00"
@.str.17 = [2 x i8] c"\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 [5 x [5 x i32]]
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%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 = bitcast [5 x [5 x i32]]* %6 to i8*
store i32 0, i32* %9
store i32 0, i32* %15
%18 = call i32 @time(i32 0)
%19 = call i32 @srandom(i32 %18)
br label %20
20: ; preds = %132, %2
%21 = call i32 (...) @random()
%22 = srem i32 %21, 5
store i32 %22, i32* %10
%23 = call i32 (...) @random()
%24 = srem i32 %23, 5
store i32 %24, i32* %11
%25 = call i32 (...) @random()
%26 = srem i32 %25, 4
store i32 %26, i32* %14
store i32 1, i32* %8
br label %27
27: ; preds = %130, %20
%28 = load i32, i32* %15
%29 = icmp ne i32 %28, 0
br i1 %29, label %33, label %30
30: ; preds = %27
%31 = load i32, i32* %8
%32 = icmp sle i32 %31, 4
br label %33
33: ; preds = %30, %27
%34 = phi i1 [ false, %27 ], [ %32, %30 ]
br i1 %34, label %35, label %131
35: ; preds = %33
%36 = load i32, i32* %14
switch i32 %36, label %121 [
i32 0, label %37
i32 1, label %58
i32 2, label %79
i32 3, label %100
]
37: ; preds = %35
%38 = load i32, i32* %11
%39 = icmp slt i32 %38, 2
br i1 %39, label %40, label %57
40: ; preds = %37
store i32 0, i32* %7
br label %41
41: ; preds = %53, %40
%42 = load i32, i32* %7
%43 = icmp slt i32 %42, 4
br i1 %43, label %44, label %56
44: ; preds = %41
%45 = load i32, i32* %10
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %6, i64 0, i64 %46
%48 = load i32, i32* %11
%49 = load i32, i32* %7
%50 = add nsw i32 %48, %49
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds [5 x i32], [5 x i32]* %47, i64 0, i64 %51
store i32 1, i32* %52
br label %53
53: ; preds = %44
%54 = load i32, i32* %7
%55 = add nsw i32 %54, 1
store i32 %55, i32* %7
br label %41
56: ; preds = %41
store i32 1, i32* %15
br label %57
57: ; preds = %56, %37
br label %121
58: ; preds = %35
%59 = load i32, i32* %10
%60 = icmp slt i32 %59, 2
br i1 %60, label %61, label %78
61: ; preds = %58
store i32 0, i32* %7
br label %62
62: ; preds = %74, %61
%63 = load i32, i32* %7
%64 = icmp slt i32 %63, 4
br i1 %64, label %65, label %77
65: ; preds = %62
%66 = load i32, i32* %10
%67 = load i32, i32* %7
%68 = add nsw i32 %66, %67
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %6, i64 0, i64 %69
%71 = load i32, i32* %11
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds [5 x i32], [5 x i32]* %70, i64 0, i64 %72
store i32 1, i32* %73
br label %74
74: ; preds = %65
%75 = load i32, i32* %7
%76 = add nsw i32 %75, 1
store i32 %76, i32* %7
br label %62
77: ; preds = %62
store i32 1, i32* %15
br label %78
78: ; preds = %77, %58
br label %121
79: ; preds = %35
%80 = load i32, i32* %11
%81 = icmp sge i32 %80, 3
br i1 %81, label %82, label %99
82: ; preds = %79
store i32 0, i32* %7
br label %83
83: ; preds = %95, %82
%84 = load i32, i32* %7
%85 = icmp slt i32 %84, 4
br i1 %85, label %86, label %98
86: ; preds = %83
%87 = load i32, i32* %10
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %6, i64 0, i64 %88
%90 = load i32, i32* %11
%91 = load i32, i32* %7
%92 = sub nsw i32 %90, %91
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds [5 x i32], [5 x i32]* %89, i64 0, i64 %93
store i32 1, i32* %94
br label %95
95: ; preds = %86
%96 = load i32, i32* %7
%97 = add nsw i32 %96, 1
store i32 %97, i32* %7
br label %83
98: ; preds = %83
store i32 1, i32* %15
br label %99
99: ; preds = %98, %79
br label %121
100: ; preds = %35
%101 = load i32, i32* %10
%102 = icmp sge i32 %101, 3
br i1 %102, label %103, label %120
103: ; preds = %100
store i32 0, i32* %7
br label %104
104: ; preds = %116, %103
%105 = load i32, i32* %7
%106 = icmp slt i32 %105, 4
br i1 %106, label %107, label %119
107: ; preds = %104
%108 = load i32, i32* %10
%109 = load i32, i32* %7
%110 = sub nsw i32 %108, %109
%111 = sext i32 %110 to i64
%112 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %6, i64 0, i64 %111
%113 = load i32, i32* %11
%114 = sext i32 %113 to i64
%115 = getelementptr inbounds [5 x i32], [5 x i32]* %112, i64 0, i64 %114
store i32 1, i32* %115
br label %116
116: ; preds = %107
%117 = load i32, i32* %7
%118 = add nsw i32 %117, 1
store i32 %118, i32* %7
br label %104
119: ; preds = %104
store i32 1, i32* %15
br label %120
120: ; preds = %119, %100
br label %121
121: ; preds = %120, %35, %99, %78, %57
%122 = load i32, i32* %15
%123 = icmp ne i32 %122, 0
br i1 %123, label %130, label %124
124: ; preds = %121
%125 = load i32, i32* %14
%126 = add nsw i32 %125, 1
store i32 %126, i32* %14
%127 = srem i32 %126, 4
store i32 %127, i32* %14
%128 = load i32, i32* %8
%129 = add nsw i32 %128, 1
store i32 %129, i32* %8
br label %130
130: ; preds = %124, %121
br label %27
131: ; preds = %33
br label %132
132: ; preds = %131
%133 = load i32, i32* %15
%134 = icmp ne i32 %133, 0
%135 = xor i1 %134, true
br i1 %135, label %20, label %136
136: ; preds = %132
store i32 1, i32* %8
br label %137
137: ; preds = %367, %136
%138 = load i32, i32* %9
%139 = icmp ne i32 %138, 0
%140 = xor i1 %139, true
br i1 %140, label %141, label %370
141: ; preds = %137
%142 = load i32, i32* %8
%143 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %142)
br label %144
144: ; preds = %161, %141
%145 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 5)
%146 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %12)
%147 = load i32, i32* %12
%148 = icmp slt i32 %147, 1
br i1 %148, label %152, label %149
149: ; preds = %144
%150 = load i32, i32* %12
%151 = icmp sgt i32 %150, 5
br i1 %151, label %152, label %154
152: ; preds = %149, %144
%153 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0), i32 5)
br label %154
154: ; preds = %152, %149
br label %155
155: ; preds = %154
%156 = load i32, i32* %12
%157 = icmp slt i32 %156, 1
br i1 %157, label %161, label %158
158: ; preds = %155
%159 = load i32, i32* %12
%160 = icmp sgt i32 %159, 5
br label %161
161: ; preds = %158, %155
%162 = phi i1 [ true, %155 ], [ %160, %158 ]
br i1 %162, label %144, label %163
163: ; preds = %161
br label %164
164: ; preds = %181, %163
%165 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0), i32 5)
%166 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %13)
%167 = load i32, i32* %13
%168 = icmp slt i32 %167, 1
br i1 %168, label %172, label %169
169: ; preds = %164
%170 = load i32, i32* %13
%171 = icmp sgt i32 %170, 5
br i1 %171, label %172, label %174
172: ; preds = %169, %164
%173 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.5, i64 0, i64 0), i32 5)
br label %174
174: ; preds = %172, %169
br label %175
175: ; preds = %174
%176 = load i32, i32* %13
%177 = icmp slt i32 %176, 1
br i1 %177, label %181, label %178
178: ; preds = %175
%179 = load i32, i32* %13
%180 = icmp sgt i32 %179, 5
br label %181
181: ; preds = %178, %175
%182 = phi i1 [ true, %175 ], [ %180, %178 ]
br i1 %182, label %164, label %183
183: ; preds = %181
%184 = load i32, i32* %12
%185 = add nsw i32 %184, -1
store i32 %185, i32* %12
%186 = load i32, i32* %13
%187 = add nsw i32 %186, -1
store i32 %187, i32* %13
%188 = load i32, i32* %12
%189 = sext i32 %188 to i64
%190 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %6, i64 0, i64 %189
%191 = load i32, i32* %13
%192 = sext i32 %191 to i64
%193 = getelementptr inbounds [5 x i32], [5 x i32]* %190, i64 0, i64 %192
%194 = load i32, i32* %193
switch i32 %194, label %335 [
i32 0, label %195
i32 1, label %203
i32 2, label %327
i32 3, label %331
]
195: ; preds = %183
%196 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0))
%197 = load i32, i32* %12
%198 = sext i32 %197 to i64
%199 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %6, i64 0, i64 %198
%200 = load i32, i32* %13
%201 = sext i32 %200 to i64
%202 = getelementptr inbounds [5 x i32], [5 x i32]* %199, i64 0, i64 %201
store i32 2, i32* %202
br label %335
203: ; preds = %183
%204 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0))
%205 = load i32, i32* %12
%206 = sext i32 %205 to i64
%207 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %6, i64 0, i64 %206
%208 = load i32, i32* %13
%209 = sext i32 %208 to i64
%210 = getelementptr inbounds [5 x i32], [5 x i32]* %207, i64 0, i64 %209
store i32 3, i32* %210
store i32 1, i32* %16
%211 = load i32, i32* %14
switch i32 %211, label %316 [
i32 0, label %212
i32 1, label %238
i32 2, label %264
i32 3, label %290
]
212: ; preds = %203
store i32 0, i32* %7
br label %213
213: ; preds = %234, %212
%214 = load i32, i32* %7
%215 = icmp slt i32 %214, 4
br i1 %215, label %216, label %219
216: ; preds = %213
%217 = load i32, i32* %16
%218 = icmp ne i32 %217, 0
br label %219
219: ; preds = %216, %213
%220 = phi i1 [ false, %213 ], [ %218, %216 ]
br i1 %220, label %221, label %237
221: ; preds = %219
%222 = load i32, i32* %10
%223 = sext i32 %222 to i64
%224 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %6, i64 0, i64 %223
%225 = load i32, i32* %11
%226 = load i32, i32* %7
%227 = add nsw i32 %225, %226
%228 = sext i32 %227 to i64
%229 = getelementptr inbounds [5 x i32], [5 x i32]* %224, i64 0, i64 %228
%230 = load i32, i32* %229
%231 = icmp eq i32 %230, 1
br i1 %231, label %232, label %233
232: ; preds = %221
store i32 0, i32* %16
br label %233
233: ; preds = %232, %221
br label %234
234: ; preds = %233
%235 = load i32, i32* %7
%236 = add nsw i32 %235, 1
store i32 %236, i32* %7
br label %213
237: ; preds = %219
br label %316
238: ; preds = %203
store i32 0, i32* %7
br label %239
239: ; preds = %260, %238
%240 = load i32, i32* %7
%241 = icmp slt i32 %240, 4
br i1 %241, label %242, label %245
242: ; preds = %239
%243 = load i32, i32* %16
%244 = icmp ne i32 %243, 0
br label %245
245: ; preds = %242, %239
%246 = phi i1 [ false, %239 ], [ %244, %242 ]
br i1 %246, label %247, label %263
247: ; preds = %245
%248 = load i32, i32* %10
%249 = load i32, i32* %7
%250 = add nsw i32 %248, %249
%251 = sext i32 %250 to i64
%252 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %6, i64 0, i64 %251
%253 = load i32, i32* %11
%254 = sext i32 %253 to i64
%255 = getelementptr inbounds [5 x i32], [5 x i32]* %252, i64 0, i64 %254
%256 = load i32, i32* %255
%257 = icmp eq i32 %256, 1
br i1 %257, label %258, label %259
258: ; preds = %247
store i32 0, i32* %16
br label %259
259: ; preds = %258, %247
br label %260
260: ; preds = %259
%261 = load i32, i32* %7
%262 = add nsw i32 %261, 1
store i32 %262, i32* %7
br label %239
263: ; preds = %245
br label %316
264: ; preds = %203
store i32 0, i32* %7
br label %265
265: ; preds = %286, %264
%266 = load i32, i32* %7
%267 = icmp slt i32 %266, 4
br i1 %267, label %268, label %271
268: ; preds = %265
%269 = load i32, i32* %16
%270 = icmp ne i32 %269, 0
br label %271
271: ; preds = %268, %265
%272 = phi i1 [ false, %265 ], [ %270, %268 ]
br i1 %272, label %273, label %289
273: ; preds = %271
%274 = load i32, i32* %10
%275 = sext i32 %274 to i64
%276 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %6, i64 0, i64 %275
%277 = load i32, i32* %11
%278 = load i32, i32* %7
%279 = sub nsw i32 %277, %278
%280 = sext i32 %279 to i64
%281 = getelementptr inbounds [5 x i32], [5 x i32]* %276, i64 0, i64 %280
%282 = load i32, i32* %281
%283 = icmp eq i32 %282, 1
br i1 %283, label %284, label %285
284: ; preds = %273
store i32 0, i32* %16
br label %285
285: ; preds = %284, %273
br label %286
286: ; preds = %285
%287 = load i32, i32* %7
%288 = add nsw i32 %287, 1
store i32 %288, i32* %7
br label %265
289: ; preds = %271
br label %316
290: ; preds = %203
store i32 0, i32* %7
br label %291
291: ; preds = %312, %290
%292 = load i32, i32* %7
%293 = icmp slt i32 %292, 4
br i1 %293, label %294, label %297
294: ; preds = %291
%295 = load i32, i32* %16
%296 = icmp ne i32 %295, 0
br label %297
297: ; preds = %294, %291
%298 = phi i1 [ false, %291 ], [ %296, %294 ]
br i1 %298, label %299, label %315
299: ; preds = %297
%300 = load i32, i32* %10
%301 = load i32, i32* %7
%302 = sub nsw i32 %300, %301
%303 = sext i32 %302 to i64
%304 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %6, i64 0, i64 %303
%305 = load i32, i32* %11
%306 = sext i32 %305 to i64
%307 = getelementptr inbounds [5 x i32], [5 x i32]* %304, i64 0, i64 %306
%308 = load i32, i32* %307
%309 = icmp eq i32 %308, 1
br i1 %309, label %310, label %311
310: ; preds = %299
store i32 0, i32* %16
br label %311
311: ; preds = %310, %299
br label %312
312: ; preds = %311
%313 = load i32, i32* %7
%314 = add nsw i32 %313, 1
store i32 %314, i32* %7
br label %291
315: ; preds = %297
br label %316
316: ; preds = %203, %315, %289, %263, %237
%317 = load i32, i32* %16
%318 = icmp ne i32 %317, 0
br i1 %318, label %319, label %323
319: ; preds = %316
%320 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0))
%321 = load i32, i32* %8
%322 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.9, i64 0, i64 0), i32 %321)
br label %325
323: ; preds = %316
%324 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0))
br label %325
325: ; preds = %323, %319
%326 = load i32, i32* %16
store i32 %326, i32* %9
br label %335
327: ; preds = %183
%328 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.11, i64 0, i64 0))
%329 = load i32, i32* %8
%330 = add nsw i32 %329, -1
store i32 %330, i32* %8
br label %335
331: ; preds = %183
%332 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.12, i64 0, i64 0))
%333 = load i32, i32* %8
%334 = add nsw i32 %333, -1
store i32 %334, i32* %8
br label %335
335: ; preds = %183, %331, %327, %325, %195
%336 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0))
store i32 0, i32* %12
br label %337
337: ; preds = %364, %335
%338 = load i32, i32* %12
%339 = icmp slt i32 %338, 5
br i1 %339, label %340, label %367
340: ; preds = %337
store i32 0, i32* %13
br label %341
341: ; preds = %359, %340
%342 = load i32, i32* %13
%343 = icmp slt i32 %342, 5
br i1 %343, label %344, label %362
344: ; preds = %341
%345 = load i32, i32* %12
%346 = sext i32 %345 to i64
%347 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %6, i64 0, i64 %346
%348 = load i32, i32* %13
%349 = sext i32 %348 to i64
%350 = getelementptr inbounds [5 x i32], [5 x i32]* %347, i64 0, i64 %349
%351 = load i32, i32* %350
switch i32 %351, label %358 [
i32 0, label %352
i32 1, label %352
i32 2, label %354
i32 3, label %356
]
352: ; preds = %344, %344
%353 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0))
br label %358
354: ; preds = %344
%355 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0))
br label %358
356: ; preds = %344
%357 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.16, i64 0, i64 0))
br label %358
358: ; preds = %344, %356, %354, %352
br label %359
359: ; preds = %358
%360 = load i32, i32* %13
%361 = add nsw i32 %360, 1
store i32 %361, i32* %13
br label %341
362: ; preds = %341
%363 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.17, i64 0, i64 0))
br label %364
364: ; preds = %362
%365 = load i32, i32* %12
%366 = add nsw i32 %365, 1
store i32 %366, i32* %12
br label %337
367: ; preds = %337
%368 = load i32, i32* %8
%369 = add nsw i32 %368, 1
store i32 %369, i32* %8
br label %137
370: ; preds = %137
%371 = load i32, i32* @EXIT_SUCCESS
ret i32 %371
}

LLVM IR (-O2):
@.str = [27 x i8] c"\0A#### Jugada n\C2\BA %d #### \0A\00"
@.str.1 = [31 x i8] c"\0AIntrodueix una fila (1-%d): \0A\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [43 x i8] c"\0AFila incorrecta. Ha de ser entre (1-%d) \0A\00"
@.str.4 = [34 x i8] c"\0AIntrodueix una columna (1-%d): \0A\00"
@.str.5 = [46 x i8] c"\0AColumna incorrecta. Ha de ser entre (1-%d) \0A\00"
@.str.6 = [9 x i8] c"\0AAigua!!\00"
@.str.7 = [7 x i8] c"\0ATocat\00"
@.str.9 = [24 x i8] c"T'has costat %d intents\00"
@.str.11 = [37 x i8] c"\0AJa has disparat aqu\C3\AD i hi ha aigua\00"
@.str.12 = [40 x i8] c"\0AJa has disparat aqu\C3\AD i hi ha un barco\00"
@.str.14 = [3 x i8] c"? \00"
@.str.15 = [3 x i8] c"~ \00"
@.str.16 = [3 x i8] c"X \00"
@EXIT_SUCCESS = global i32 0
@str = [2 x i8] c"\0A\00"
@str.18 = [3 x i8] c"!!\00"
@str.19 = [12 x i8] c" i afonat!!\00"
@reltable.main = [4 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.14 to i64), i64 ptrtoint ([4 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.14 to i64), i64 ptrtoint ([4 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.15 to i64), i64 ptrtoint ([4 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.16 to i64), i64 ptrtoint ([4 x i32]* @reltable.main to i64)) to i32)]
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [5 x [5 x i32]]
%4 = alloca i32
%5 = alloca i32
%6 = bitcast [5 x [5 x i32]]* %3 to i8*
%7 = bitcast i32* %4 to i8*
%8 = bitcast i32* %5 to i8*
%9 = tail call i32 @time(i32 0)
%10 = tail call i32 @srandom(i32 %9)
br label %11
11: ; preds = %87, %2
%12 = tail call i32 (...) @random()
%13 = srem i32 %12, 5
%14 = tail call i32 (...) @random()
%15 = srem i32 %14, 5
%16 = tail call i32 (...) @random()
%17 = icmp sgt i32 %13, 2
%18 = icmp sgt i32 %15, 2
%19 = icmp slt i32 %13, 2
%20 = icmp slt i32 %15, 2
%21 = srem i32 %16, 4
switch i32 %21, label %66 [
i32 0, label %22
i32 1, label %33
i32 2, label %44
i32 3, label %55
]
22: ; preds = %11
br i1 %20, label %23, label %66
23: ; preds = %86, %79, %72, %22
%24 = sext i32 %15 to i64
%25 = sext i32 %13 to i64
%26 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %3, i64 0, i64 %25, i64 %24
store i32 1, i32* %26
%27 = add nsw i64 %24, 1
%28 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %3, i64 0, i64 %25, i64 %27
store i32 1, i32* %28
%29 = add nsw i64 %24, 2
%30 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %3, i64 0, i64 %25, i64 %29
store i32 1, i32* %30
%31 = add nsw i64 %24, 3
%32 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %3, i64 0, i64 %25, i64 %31
br label %88
33: ; preds = %11
br i1 %19, label %34, label %66
34: ; preds = %85, %78, %71, %33
%35 = sext i32 %15 to i64
%36 = sext i32 %13 to i64
%37 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %3, i64 0, i64 %36, i64 %35
store i32 1, i32* %37
%38 = add nsw i64 %36, 1
%39 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %3, i64 0, i64 %38, i64 %35
store i32 1, i32* %39
%40 = add nsw i64 %36, 2
%41 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %3, i64 0, i64 %40, i64 %35
store i32 1, i32* %41
%42 = add nsw i64 %36, 3
%43 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %3, i64 0, i64 %42, i64 %35
br label %88
44: ; preds = %11
br i1 %18, label %45, label %66
45: ; preds = %84, %77, %70, %44
%46 = sext i32 %15 to i64
%47 = sext i32 %13 to i64
%48 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %3, i64 0, i64 %47, i64 %46
store i32 1, i32* %48
%49 = add nsw i64 %46, -1
%50 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %3, i64 0, i64 %47, i64 %49
store i32 1, i32* %50
%51 = add nsw i64 %46, -2
%52 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %3, i64 0, i64 %47, i64 %51
store i32 1, i32* %52
%53 = add nsw i64 %46, -3
%54 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %3, i64 0, i64 %47, i64 %53
br label %88
55: ; preds = %11
br i1 %17, label %56, label %66
56: ; preds = %83, %76, %69, %55
%57 = sext i32 %15 to i64
%58 = sext i32 %13 to i64
%59 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %3, i64 0, i64 %58, i64 %57
store i32 1, i32* %59
%60 = add nsw i64 %58, -1
%61 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %3, i64 0, i64 %60, i64 %57
store i32 1, i32* %61
%62 = add nsw i64 %58, -2
%63 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %3, i64 0, i64 %62, i64 %57
store i32 1, i32* %63
%64 = add nsw i64 %58, -3
%65 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %3, i64 0, i64 %64, i64 %57
br label %88
66: ; preds = %22, %33, %44, %55, %11
%67 = add nsw i32 %21, 1
%68 = srem i32 %67, 4
switch i32 %68, label %73 [
i32 0, label %72
i32 1, label %71
i32 2, label %70
i32 3, label %69
]
69: ; preds = %66
br i1 %17, label %56, label %73
70: ; preds = %66
br i1 %18, label %45, label %73
71: ; preds = %66
br i1 %19, label %34, label %73
72: ; preds = %66
br i1 %20, label %23, label %73
73: ; preds = %72, %71, %70, %69, %66
%74 = add nsw i32 %68, 1
%75 = srem i32 %74, 4
switch i32 %75, label %80 [
i32 0, label %79
i32 1, label %78
i32 2, label %77
i32 3, label %76
]
76: ; preds = %73
br i1 %17, label %56, label %80
77: ; preds = %73
br i1 %18, label %45, label %80
78: ; preds = %73
br i1 %19, label %34, label %80
79: ; preds = %73
br i1 %20, label %23, label %80
80: ; preds = %79, %78, %77, %76, %73
%81 = add nsw i32 %75, 1
%82 = srem i32 %81, 4
switch i32 %82, label %87 [
i32 0, label %86
i32 1, label %85
i32 2, label %84
i32 3, label %83
]
83: ; preds = %80
br i1 %17, label %56, label %87
84: ; preds = %80
br i1 %18, label %45, label %87
85: ; preds = %80
br i1 %19, label %34, label %87
86: ; preds = %80
br i1 %20, label %23, label %87
87: ; preds = %86, %85, %84, %83, %80
br label %11
88: ; preds = %23, %34, %45, %56
%89 = phi i32* [ %32, %23 ], [ %43, %34 ], [ %54, %45 ], [ %65, %56 ]
%90 = phi i64 [ %24, %23 ], [ %35, %34 ], [ %46, %45 ], [ %57, %56 ]
%91 = phi i64 [ %25, %23 ], [ %36, %34 ], [ %47, %45 ], [ %58, %56 ]
%92 = phi i32 [ 0, %23 ], [ 1, %34 ], [ 2, %45 ], [ 3, %56 ]
store i32 1, i32* %89
%93 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %3, i64 0, i64 %91, i64 %90
%94 = add nsw i64 %91, -1
%95 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %3, i64 0, i64 %94, i64 %90
%96 = add nsw i64 %91, -2
%97 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %3, i64 0, i64 %96, i64 %90
%98 = add nsw i64 %91, -3
%99 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %3, i64 0, i64 %98, i64 %90
%100 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %3, i64 0, i64 %91, i64 %90
%101 = add nsw i64 %90, -1
%102 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %3, i64 0, i64 %91, i64 %101
%103 = add nsw i64 %90, -2
%104 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %3, i64 0, i64 %91, i64 %103
%105 = add nsw i64 %90, -3
%106 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %3, i64 0, i64 %91, i64 %105
%107 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %3, i64 0, i64 %91, i64 %90
%108 = add nsw i64 %91, 1
%109 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %3, i64 0, i64 %108, i64 %90
%110 = add nsw i64 %91, 2
%111 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %3, i64 0, i64 %110, i64 %90
%112 = add nsw i64 %91, 3
%113 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %3, i64 0, i64 %112, i64 %90
%114 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %3, i64 0, i64 %91, i64 %90
%115 = add nsw i64 %90, 1
%116 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %3, i64 0, i64 %91, i64 %115
%117 = add nsw i64 %90, 2
%118 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %3, i64 0, i64 %91, i64 %117
%119 = add nsw i64 %90, 3
%120 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %3, i64 0, i64 %91, i64 %119
br label %121
121: ; preds = %88, %262
%122 = phi i32 [ 1, %88 ], [ %263, %262 ]
%123 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %122)
br label %124
124: ; preds = %130, %121
%125 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 5)
%126 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %4)
%127 = load i32, i32* %4
%128 = add i32 %127, -6
%129 = icmp ult i32 %128, -5
br i1 %129, label %130, label %135
130: ; preds = %124
%131 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0), i32 5)
%132 = load i32, i32* %4
%133 = add i32 %132, -6
%134 = icmp ult i32 %133, -5
br i1 %134, label %124, label %135
135: ; preds = %124, %130
br label %136
136: ; preds = %135, %142
%137 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0), i32 5)
%138 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %5)
%139 = load i32, i32* %5
%140 = add i32 %139, -6
%141 = icmp ult i32 %140, -5
br i1 %141, label %142, label %147
142: ; preds = %136
%143 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.5, i64 0, i64 0), i32 5)
%144 = load i32, i32* %5
%145 = add i32 %144, -6
%146 = icmp ult i32 %145, -5
br i1 %146, label %136, label %147
147: ; preds = %136, %142
%148 = phi i32 [ %144, %142 ], [ %139, %136 ]
%149 = load i32, i32* %4
%150 = add nsw i32 %149, -1
store i32 %150, i32* %4
%151 = add nsw i32 %148, -1
store i32 %151, i32* %5
%152 = sext i32 %150 to i64
%153 = zext i32 %151 to i64
%154 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %3, i64 0, i64 %152, i64 %153
%155 = load i32, i32* %154
switch i32 %155, label %232 [
i32 0, label %156
i32 1, label %163
i32 2, label %226
i32 3, label %229
]
156: ; preds = %147
%157 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0))
%158 = load i32, i32* %4
%159 = sext i32 %158 to i64
%160 = load i32, i32* %5
%161 = sext i32 %160 to i64
%162 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %3, i64 0, i64 %159, i64 %161
store i32 2, i32* %162
br label %232
163: ; preds = %147
%164 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0))
%165 = load i32, i32* %4
%166 = sext i32 %165 to i64
%167 = load i32, i32* %5
%168 = sext i32 %167 to i64
%169 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %3, i64 0, i64 %166, i64 %168
store i32 3, i32* %169
switch i32 %92, label %220 [
i32 0, label %170
i32 1, label %182
i32 2, label %194
i32 3, label %206
]
170: ; preds = %163
%171 = load i32, i32* %114
%172 = icmp ne i32 %171, 1
br i1 %172, label %173, label %218
173: ; preds = %170
%174 = load i32, i32* %116
%175 = icmp ne i32 %174, 1
br i1 %175, label %176, label %218
176: ; preds = %173
%177 = load i32, i32* %118
%178 = icmp ne i32 %177, 1
br i1 %178, label %179, label %218
179: ; preds = %176
%180 = load i32, i32* %120
%181 = icmp ne i32 %180, 1
br label %218
182: ; preds = %163
%183 = load i32, i32* %107
%184 = icmp ne i32 %183, 1
br i1 %184, label %185, label %218
185: ; preds = %182
%186 = load i32, i32* %109
%187 = icmp ne i32 %186, 1
br i1 %187, label %188, label %218
188: ; preds = %185
%189 = load i32, i32* %111
%190 = icmp ne i32 %189, 1
br i1 %190, label %191, label %218
191: ; preds = %188
%192 = load i32, i32* %113
%193 = icmp ne i32 %192, 1
br label %218
194: ; preds = %163
%195 = load i32, i32* %100
%196 = icmp ne i32 %195, 1
br i1 %196, label %197, label %218
197: ; preds = %194
%198 = load i32, i32* %102
%199 = icmp ne i32 %198, 1
br i1 %199, label %200, label %218
200: ; preds = %197
%201 = load i32, i32* %104
%202 = icmp ne i32 %201, 1
br i1 %202, label %203, label %218
203: ; preds = %200
%204 = load i32, i32* %106
%205 = icmp ne i32 %204, 1
br label %218
206: ; preds = %163
%207 = load i32, i32* %93
%208 = icmp ne i32 %207, 1
br i1 %208, label %209, label %218
209: ; preds = %206
%210 = load i32, i32* %95
%211 = icmp ne i32 %210, 1
br i1 %211, label %212, label %218
212: ; preds = %209
%213 = load i32, i32* %97
%214 = icmp ne i32 %213, 1
br i1 %214, label %215, label %218
215: ; preds = %212
%216 = load i32, i32* %99
%217 = icmp ne i32 %216, 1
br label %218
218: ; preds = %206, %209, %212, %215, %194, %197, %200, %203, %182, %185, %188, %191, %170, %173, %176, %179
%219 = phi i1 [ %172, %170 ], [ %175, %173 ], [ %178, %176 ], [ %181, %179 ], [ %184, %182 ], [ %187, %185 ], [ %190, %188 ], [ %193, %191 ], [ %196, %194 ], [ %199, %197 ], [ %202, %200 ], [ %205, %203 ], [ %208, %206 ], [ %211, %209 ], [ %214, %212 ], [ %217, %215 ]
br i1 %219, label %221, label %224
220: ; preds = %163
unreachable
221: ; preds = %218
%222 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.19, i64 0, i64 0))
%223 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.9, i64 0, i64 0), i32 %122)
br label %232
224: ; preds = %218
%225 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str.18, i64 0, i64 0))
br label %232
226: ; preds = %147
%227 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.11, i64 0, i64 0))
%228 = add nsw i32 %122, -1
br label %232
229: ; preds = %147
%230 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.12, i64 0, i64 0))
%231 = add nsw i32 %122, -1
br label %232
232: ; preds = %221, %224, %147, %229, %226, %156
%233 = phi i1 [ false, %221 ], [ true, %224 ], [ true, %147 ], [ true, %229 ], [ true, %226 ], [ true, %156 ]
%234 = phi i32 [ %122, %221 ], [ %122, %224 ], [ %122, %147 ], [ %231, %229 ], [ %228, %226 ], [ %122, %156 ]
%235 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
store i32 0, i32* %4
br label %236
236: ; preds = %232, %257
%237 = phi i32 [ 0, %232 ], [ %260, %257 ]
store i32 0, i32* %5
br label %238
238: ; preds = %255, %236
%239 = phi i32 [ %237, %236 ], [ %256, %255 ]
%240 = phi i32 [ 0, %236 ], [ %253, %255 ]
%241 = sext i32 %239 to i64
%242 = sext i32 %240 to i64
%243 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %3, i64 0, i64 %241, i64 %242
%244 = load i32, i32* %243
%245 = icmp ult i32 %244, 4
br i1 %245, label %246, label %251
246: ; preds = %238
%247 = sext i32 %244 to i64
%248 = shl i64 %247, 2
%249 = call i8* @llvm.load.relative.i64(i8* bitcast ([4 x i32]* @reltable.main to i8*), i64 %248)
%250 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %249)
br label %251
251: ; preds = %238, %246
%252 = load i32, i32* %5
%253 = add nsw i32 %252, 1
store i32 %253, i32* %5
%254 = icmp slt i32 %252, 4
br i1 %254, label %255, label %257
255: ; preds = %251
%256 = load i32, i32* %4
br label %238
257: ; preds = %251
%258 = call i32 @putchar(i32 10)
%259 = load i32, i32* %4
%260 = add nsw i32 %259, 1
store i32 %260, i32* %4
%261 = icmp slt i32 %259, 4
br i1 %261, label %236, label %262
262: ; preds = %257
%263 = add nsw i32 %234, 1
br i1 %233, label %121, label %264
264: ; preds = %262
%265 = load i32, i32* @EXIT_SUCCESS
ret i32 %265
}