#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 /*<<< orphan*/ colocar(char **, int, int, int, int, int, int, int, int *);
int /*<<< orphan*/ mostrarTaulell(char **, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ system(char *);
int configurar(char tau[11][11], int freq[5]) {
  int col, i, j, k, confirmacio, op, mida_v, orientacio, pos_x, pos_y, an_fil,
      an_col;
  int lim_v[5];
  system("cls");
  printf("\nConfiguracio del Taulell");
  printf("\n\nIntrodueix nombre de files i columnes del taulell: ");
  scanf("%d", &col);
  while (col < 6 || col > 11) {
    printf("\nIntrodueix un nombre valid de files i columnes: ");
    scanf("%d", &col);
  }
  for (k = 0; k < 5; k++) {
    freq[k] = 0;
  }
  for (k = 0; k < 5; k++) {
    lim_v[k] = 5 - k;
  }
  for (i = 0; i < col; i++) {
    for (j = 0; j < col; j++) {
      tau[i][j] = '*';
    }
  }
  while (op != 5 && (freq[1] != lim_v[1] || freq[2] != lim_v[2] ||
                     freq[3] != lim_v[3] || freq[4] != lim_v[4])) {
    printf("\nQuin vaixell vols colocar?\n");
    printf("\n\t1.Submari (Disposes de 4 submarins, cada un ocupa 1 casella)");
    printf("\n\t2.Draga mines (Disposes de 3 draga mines, cada un ocupa 2 "
           "caselles)");
    printf("\n\t3.Destructor (Disposes de 2 destructors, cada un ocupa 3 "
           "caselles)");
    printf("\n\t4.Portaavions (Disposes de 1 portaavions, cada un ocupa 4 "
           "caselles)");
    printf("\n\t5.Sortir\n\t");
    scanf("%d", &op);
    while (op < 1 || op > 5) {
      printf("Introdueix un nombre valid: ");
      scanf("%d", &op);
    }
    if (op > 0 && op < 5) {
      if (freq[op] != lim_v[op]) {
        mida_v = op;
        printf("\nIndica les coordenades on vols posicionar el vaixell (Primer "
               "el valor de x i despres el de y) \n");
        scanf("%d", &pos_x);
        scanf("%d", &pos_y);
        while (pos_x > col || pos_y > col) {
          printf("Torna a introduir uns valors valids (Primer el valor de x i "
                 "despres el de y) \n");
          scanf("%d", &pos_x);
          scanf("%d", &pos_y);
        }
        printf("\nIntrodueix la orientacio (0 Horitzontal, 1 vertical):\n");
        scanf("%d", &orientacio);
        while (orientacio != 0 && orientacio != 1) {
          printf("Introdueix 0 per a colocarlo horitzontalment o 1 per a "
                 "colocarlo verticalment: \n");
          scanf("%d", &orientacio);
        }
        if (orientacio == 0) {
          an_fil = 0;
          an_col = 1;
        } else {
          an_fil = 1;
          an_col = 0;
        }
        colocar(tau, mida_v, orientacio, pos_x, pos_y, an_fil, an_col, col,
                freq);
      } else {
        system("cls");
        printf("\nS'ha esgotat el vaixell seleccionat.\n");
      }
    }
  }
  printf("\nVols veure com esta configurat el taulell??");
  printf("\n\t0. No");
  printf("\n\t1. Si\n\t");
  scanf("%d", &confirmacio);
  while (confirmacio < 0 || confirmacio > 1) {
    printf("Introdueix un nombre valid: ");
    scanf("%d", &confirmacio);
  }
  if (confirmacio == 1) {
    mostrarTaulell(tau, col);
  }
  return col;
}


x86 assembly (clang, -O0):
<configurar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe96(%rip),%rdi
call   1030 <system@plt>
lea    0xe8e(%rip),%rdi
call   1040 <printf@plt>
lea    0xe9c(%rip),%rdi
call   1040 <printf@plt>
lea    0xec6(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1050 <scanf@plt>
mov    $0x1,%al
cmpl   $0x6,-0x14(%rbp)
mov    %al,-0x61(%rbp)
jl     11b0 <configurar+0x60>
cmpl   $0xb,-0x14(%rbp)
setg   %al
mov    %al,-0x61(%rbp)
mov    -0x61(%rbp),%al
test   $0x1,%al
jne    11c0 <configurar+0x70>
jmp    11e1 <configurar+0x91>
lea    0xe90(%rip),%rdi
call   1040 <printf@plt>
lea    0xe81(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1050 <scanf@plt>
jmp    1197 <configurar+0x47>
movl   $0x0,-0x20(%rbp)
cmpl   $0x5,-0x20(%rbp)
jge    120f <configurar+0xbf>
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    11e8 <configurar+0x98>
movl   $0x0,-0x20(%rbp)
cmpl   $0x5,-0x20(%rbp)
jge    123e <configurar+0xee>
mov    $0x5,%ecx
sub    -0x20(%rbp),%ecx
movslq -0x20(%rbp),%rax
mov    %ecx,-0x60(%rbp,%rax,4)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1216 <configurar+0xc6>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    129c <configurar+0x14c>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1289 <configurar+0x139>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
imul   $0xb,%rcx,%rcx
add    %rcx,%rax
movslq -0x1c(%rbp),%rcx
movb   $0x2a,(%rax,%rcx,1)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1258 <configurar+0x108>
jmp    128e <configurar+0x13e>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1245 <configurar+0xf5>
jmp    12a1 <configurar+0x151>
xor    %eax,%eax
cmpl   $0x5,-0x28(%rbp)
mov    %al,-0x62(%rbp)
je     1305 <configurar+0x1b5>
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%ecx
mov    $0x1,%al
cmp    -0x5c(%rbp),%ecx
mov    %al,-0x63(%rbp)
jne    12ff <configurar+0x1af>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%ecx
mov    $0x1,%al
cmp    -0x58(%rbp),%ecx
mov    %al,-0x63(%rbp)
jne    12ff <configurar+0x1af>
mov    -0x10(%rbp),%rax
mov    0xc(%rax),%ecx
mov    $0x1,%al
cmp    -0x54(%rbp),%ecx
mov    %al,-0x63(%rbp)
jne    12ff <configurar+0x1af>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%eax
cmp    -0x50(%rbp),%eax
setne  %al
mov    %al,-0x63(%rbp)
mov    -0x63(%rbp),%al
mov    %al,-0x62(%rbp)
mov    -0x62(%rbp),%al
test   $0x1,%al
jne    1315 <configurar+0x1c5>
jmp    1560 <configurar+0x410>
lea    0xd6d(%rip),%rdi
call   1040 <printf@plt>
lea    0xd7e(%rip),%rdi
call   1040 <printf@plt>
lea    0xdb1(%rip),%rdi
call   1040 <printf@plt>
lea    0xdeb(%rip),%rdi
call   1040 <printf@plt>
lea    0xe24(%rip),%rdi
call   1040 <printf@plt>
lea    0xe5e(%rip),%rdi
call   1040 <printf@plt>
lea    0xcf0(%rip),%rdi
lea    -0x28(%rbp),%rsi
call   1050 <scanf@plt>
mov    $0x1,%al
cmpl   $0x1,-0x28(%rbp)
mov    %al,-0x64(%rbp)
jl     1386 <configurar+0x236>
cmpl   $0x5,-0x28(%rbp)
setg   %al
mov    %al,-0x64(%rbp)
mov    -0x64(%rbp),%al
test   $0x1,%al
jne    1396 <configurar+0x246>
jmp    13b7 <configurar+0x267>
lea    0xe26(%rip),%rdi
call   1040 <printf@plt>
lea    0xcab(%rip),%rdi
lea    -0x28(%rbp),%rsi
call   1050 <scanf@plt>
jmp    136d <configurar+0x21d>
cmpl   $0x0,-0x28(%rbp)
jle    155b <configurar+0x40b>
cmpl   $0x5,-0x28(%rbp)
jge    155b <configurar+0x40b>
mov    -0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
movslq -0x28(%rbp),%rcx
cmp    -0x60(%rbp,%rcx,4),%eax
je     153e <configurar+0x3ee>
mov    -0x28(%rbp),%eax
mov    %eax,-0x2c(%rbp)
lea    0xdef(%rip),%rdi
call   1040 <printf@plt>
lea    0xc57(%rip),%rdi
lea    -0x34(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xc47(%rip),%rdi
lea    -0x38(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x34(%rbp),%ecx
mov    $0x1,%al
cmp    -0x14(%rbp),%ecx
mov    %al,-0x65(%rbp)
jg     1433 <configurar+0x2e3>
mov    -0x38(%rbp),%eax
cmp    -0x14(%rbp),%eax
setg   %al
mov    %al,-0x65(%rbp)
mov    -0x65(%rbp),%al
test   $0x1,%al
jne    1443 <configurar+0x2f3>
jmp    1474 <configurar+0x324>
lea    0xdf7(%rip),%rdi
call   1040 <printf@plt>
lea    0xbfe(%rip),%rdi
lea    -0x34(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xbee(%rip),%rdi
lea    -0x38(%rbp),%rsi
call   1050 <scanf@plt>
jmp    1416 <configurar+0x2c6>
lea    0xe15(%rip),%rdi
call   1040 <printf@plt>
lea    0xbcd(%rip),%rdi
lea    -0x30(%rbp),%rsi
call   1050 <scanf@plt>
xor    %eax,%eax
cmpl   $0x0,-0x30(%rbp)
mov    %al,-0x66(%rbp)
je     14a9 <configurar+0x359>
cmpl   $0x1,-0x30(%rbp)
setne  %al
mov    %al,-0x66(%rbp)
mov    -0x66(%rbp),%al
test   $0x1,%al
jne    14b9 <configurar+0x369>
jmp    14da <configurar+0x38a>
lea    0xe08(%rip),%rdi
call   1040 <printf@plt>
lea    0xb88(%rip),%rdi
lea    -0x30(%rbp),%rsi
call   1050 <scanf@plt>
jmp    1490 <configurar+0x340>
cmpl   $0x0,-0x30(%rbp)
jne    14f7 <configurar+0x3a7>
movl   $0x0,-0x3c(%rbp)
movl   $0x1,-0x40(%rbp)
jmp    1505 <configurar+0x3b5>
movl   $0x1,-0x3c(%rbp)
movl   $0x0,-0x40(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x2c(%rbp),%esi
mov    -0x30(%rbp),%edx
mov    -0x34(%rbp),%ecx
mov    -0x38(%rbp),%r8d
mov    -0x3c(%rbp),%r9d
mov    -0x40(%rbp),%r11d
mov    -0x14(%rbp),%r10d
mov    -0x10(%rbp),%rax
mov    %r11d,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1060 <colocar@plt>
jmp    1556 <configurar+0x406>
lea    0xabb(%rip),%rdi
call   1030 <system@plt>
lea    0xdc8(%rip),%rdi
call   1040 <printf@plt>
jmp    155b <configurar+0x40b>
jmp    12a1 <configurar+0x151>
lea    0xdd9(%rip),%rdi
call   1040 <printf@plt>
lea    0xdfa(%rip),%rdi
call   1040 <printf@plt>
lea    0xdf6(%rip),%rdi
call   1040 <printf@plt>
lea    0xac9(%rip),%rdi
lea    -0x24(%rbp),%rsi
call   1050 <scanf@plt>
mov    $0x1,%al
cmpl   $0x0,-0x24(%rbp)
mov    %al,-0x67(%rbp)
jl     15ad <configurar+0x45d>
cmpl   $0x1,-0x24(%rbp)
setg   %al
mov    %al,-0x67(%rbp)
mov    -0x67(%rbp),%al
test   $0x1,%al
jne    15bd <configurar+0x46d>
jmp    15de <configurar+0x48e>
lea    0xbff(%rip),%rdi
call   1040 <printf@plt>
lea    0xa84(%rip),%rdi
lea    -0x24(%rbp),%rsi
call   1050 <scanf@plt>
jmp    1594 <configurar+0x444>
cmpl   $0x1,-0x24(%rbp)
jne    15f4 <configurar+0x4a4>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1070 <mostrarTaulell@plt>
mov    -0x14(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<configurar>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %rsi,%r15
mov    %rdi,0x18(%rsp)
lea    0xe83(%rip),%rdi
call   1040 <system@plt>
lea    0xe7b(%rip),%rdi
call   1050 <printf@plt>
lea    0xe89(%rip),%rdi
call   1050 <printf@plt>
lea    0xeb3(%rip),%rdi
mov    %rsp,%rsi
call   1070 <scanf@plt>
mov    (%rsp),%eax
lea    -0xc(%rax),%ecx
cmp    $0xfffffff9,%ecx
ja     11fe <configurar+0x8e>
lea    0xe9c(%rip),%r14
lea    0xe92(%rip),%rbp
mov    %rsp,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
call   1050 <printf@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1070 <scanf@plt>
mov    (%rsp),%eax
lea    -0xc(%rax),%ecx
cmp    $0xfffffffa,%ecx
jb     11e0 <configurar+0x70>
xorps  %xmm0,%xmm0
movups %xmm0,(%r15)
movl   $0x0,0x10(%r15)
movaps 0xdec(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movl   $0x1,0x30(%rsp)
mov    %eax,%r12d
lea    -0x1(%r12),%rax
mov    %r12d,%r14d
and    $0x7,%r14d
cmp    $0x7,%rax
jae    123d <configurar+0xcd>
xor    %ebp,%ebp
jmp    12e8 <configurar+0x178>
mov    %r12d,%r13d
and    $0xfffffff8,%r13d
xor    %ebp,%ebp
mov    0x18(%rsp),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x2a,%esi
mov    %r12,%rdx
call   1060 <memset@plt>
lea    0xb(%rbx),%rdi
mov    $0x2a,%esi
mov    %r12,%rdx
call   1060 <memset@plt>
lea    0x16(%rbx),%rdi
mov    $0x2a,%esi
mov    %r12,%rdx
call   1060 <memset@plt>
lea    0x21(%rbx),%rdi
mov    $0x2a,%esi
mov    %r12,%rdx
call   1060 <memset@plt>
lea    0x2c(%rbx),%rdi
mov    $0x2a,%esi
mov    %r12,%rdx
call   1060 <memset@plt>
lea    0x37(%rbx),%rdi
mov    $0x2a,%esi
mov    %r12,%rdx
call   1060 <memset@plt>
lea    0x42(%rbx),%rdi
mov    $0x2a,%esi
mov    %r12,%rdx
call   1060 <memset@plt>
lea    0x4d(%rbx),%rdi
mov    $0x2a,%esi
mov    %r12,%rdx
call   1060 <memset@plt>
add    $0x8,%rbp
add    $0x58,%rbx
cmp    %rbp,%r13
jne    1250 <configurar+0xe0>
test   %r14,%r14
je     1363 <configurar+0x1f3>
lea    0x0(,%rbp,4),%rax
add    %rbp,%rax
lea    0x0(,%rax,2),%r13
add    %rbp,%r13
add    0x18(%rsp),%r13
lea    (%r14,%r14,4),%rax
lea    (%r14,%rax,2),%rbp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    (%rbx,%r13,1),%rdi
mov    $0x2a,%esi
mov    %r12,%rdx
call   1060 <memset@plt>
add    $0xb,%rbx
cmp    %rbx,%rbp
jne    1320 <configurar+0x1b0>
jmp    1363 <configurar+0x1f3>
nopl   0x0(%rax)
lea    0xcc9(%rip),%rdi
call   1040 <system@plt>
lea    0xedb(%rip),%rdi
call   1030 <puts@plt>
cmpl   $0x5,0xc(%rsp)
je     1563 <configurar+0x3f3>
cmpl   $0x4,0x4(%r15)
jne    1390 <configurar+0x220>
cmpl   $0x3,0x8(%r15)
jne    1390 <configurar+0x220>
cmpl   $0x2,0xc(%r15)
jne    1390 <configurar+0x220>
cmpl   $0x1,0x10(%r15)
je     1563 <configurar+0x3f3>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    0xe7b(%rip),%rdi
call   1030 <puts@plt>
lea    0xcf6(%rip),%rdi
call   1050 <printf@plt>
lea    0xd29(%rip),%rdi
call   1050 <printf@plt>
lea    0xd63(%rip),%rdi
call   1050 <printf@plt>
lea    0xd9c(%rip),%rdi
call   1050 <printf@plt>
lea    0xdd6(%rip),%rdi
call   1050 <printf@plt>
lea    0xc85(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1070 <scanf@plt>
mov    0xc(%rsp),%ebx
lea    -0x6(%rbx),%eax
cmp    $0xfffffffa,%eax
ja     142f <configurar+0x2bf>
lea    0xdba(%rip),%r14
lea    0xc61(%rip),%r12
lea    0xc(%rsp),%rbp
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1050 <printf@plt>
mov    %r12,%rdi
mov    %rbp,%rsi
call   1070 <scanf@plt>
mov    0xc(%rsp),%ebx
lea    -0x6(%rbx),%eax
cmp    $0xfffffffb,%eax
jb     1410 <configurar+0x2a0>
cmp    $0x4,%ebx
ja     1358 <configurar+0x1e8>
mov    %ebx,%eax
mov    (%r15,%rax,4),%ecx
cmp    0x20(%rsp,%rax,4),%ecx
je     1340 <configurar+0x1d0>
lea    0xe05(%rip),%rdi
call   1030 <puts@plt>
lea    0xc09(%rip),%rbp
lea    0x8(%rsp),%rsi
mov    %rbp,%rdi
call   1070 <scanf@plt>
lea    0x4(%rsp),%rsi
mov    %rbp,%rdi
call   1070 <scanf@plt>
mov    (%rsp),%eax
cmp    %eax,0x8(%rsp)
jg     1484 <configurar+0x314>
cmp    %eax,0x4(%rsp)
jle    14cd <configurar+0x35d>
lea    0xeb0(%rip),%r12
lea    0xbd2(%rip),%r13
lea    0x8(%rsp),%rbp
lea    0x4(%rsp),%r14
nopl   0x0(%rax)
mov    %r12,%rdi
call   1030 <puts@plt>
mov    %r13,%rdi
mov    %rbp,%rsi
call   1070 <scanf@plt>
mov    %r13,%rdi
mov    %r14,%rsi
call   1070 <scanf@plt>
mov    (%rsp),%eax
cmp    %eax,0x8(%rsp)
jg     14a0 <configurar+0x330>
cmp    %eax,0x4(%rsp)
jg     14a0 <configurar+0x330>
lea    0xde0(%rip),%rdi
call   1030 <puts@plt>
lea    0xb84(%rip),%rdi
lea    0x10(%rsp),%rsi
call   1070 <scanf@plt>
mov    0x10(%rsp),%edx
cmp    $0x2,%edx
jb     152c <configurar+0x3bc>
lea    0xdf1(%rip),%r14
lea    0xb63(%rip),%r12
lea    0x10(%rsp),%rbp
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %r12,%rdi
mov    %rbp,%rsi
call   1070 <scanf@plt>
mov    0x10(%rsp),%edx
cmp    $0x1,%edx
ja     1510 <configurar+0x3a0>
xor    %eax,%eax
xor    %r9d,%r9d
test   %edx,%edx
sete   %al
setne  %r9b
mov    0x8(%rsp),%ecx
mov    0x4(%rsp),%r8d
mov    (%rsp),%ebp
sub    $0x8,%rsp
mov    0x20(%rsp),%rdi
mov    %ebx,%esi
push   %r15
push   %rbp
push   %rax
call   1080 <colocar@plt>
add    $0x20,%rsp
jmp    1358 <configurar+0x1e8>
lea    0xc69(%rip),%rdi
call   1050 <printf@plt>
lea    0xc8a(%rip),%rdi
call   1050 <printf@plt>
lea    0xc86(%rip),%rdi
call   1050 <printf@plt>
lea    0xad6(%rip),%rdi
lea    0x14(%rsp),%rsi
call   1070 <scanf@plt>
mov    0x14(%rsp),%eax
cmp    $0x2,%eax
jb     15dc <configurar+0x46c>
lea    0xc0e(%rip),%r14
lea    0xab5(%rip),%rbp
lea    0x14(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
call   1050 <printf@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1070 <scanf@plt>
mov    0x14(%rsp),%eax
cmp    $0x1,%eax
ja     15c0 <configurar+0x450>
cmp    $0x1,%eax
jne    15ee <configurar+0x47e>
mov    (%rsp),%esi
mov    0x18(%rsp),%rdi
call   1090 <mostrarTaulell@plt>
mov    (%rsp),%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"cls\00"
@.str.1 = [26 x i8] c"\0AConfiguracio del Taulell\00"
@.str.2 = [54 x i8] c"\0A\0AIntrodueix nombre de files i columnes del taulell: \00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [50 x i8] c"\0AIntrodueix un nombre valid de files i columnes: \00"
@.str.5 = [29 x i8] c"\0AQuin vaixell vols colocar?\0A\00"
@.str.6 = [63 x i8] c"\0A\091.Submari (Disposes de 4 submarins, cada un ocupa 1 casella)\00"
@.str.7 = [70 x i8] c"\0A\092.Draga mines (Disposes de 3 draga mines, cada un ocupa 2 caselles)\00"
@.str.8 = [69 x i8] c"\0A\093.Destructor (Disposes de 2 destructors, cada un ocupa 3 caselles)\00"
@.str.9 = [70 x i8] c"\0A\094.Portaavions (Disposes de 1 portaavions, cada un ocupa 4 caselles)\00"
@.str.10 = [13 x i8] c"\0A\095.Sortir\0A\09\00"
@.str.11 = [29 x i8] c"Introdueix un nombre valid: \00"
@.str.12 = [97 x i8] c"\0AIndica les coordenades on vols posicionar el vaixell (Primer el valor de x i despres el de y) \0A\00"
@.str.13 = [79 x i8] c"Torna a introduir uns valors valids (Primer el valor de x i despres el de y) \0A\00"
@.str.14 = [56 x i8] c"\0AIntrodueix la orientacio (0 Horitzontal, 1 vertical):\0A\00"
@.str.15 = [81 x i8] c"Introdueix 0 per a colocarlo horitzontalment o 1 per a colocarlo verticalment: \0A\00"
@.str.16 = [39 x i8] c"\0AS'ha esgotat el vaixell seleccionat.\0A\00"
@.str.17 = [45 x i8] c"\0AVols veure com esta configurat el taulell??\00"
@.str.18 = [8 x i8] c"\0A\090. No\00"
@.str.19 = [10 x i8] c"\0A\091. Si\0A\09\00"
define i32 @configurar([11 x i8]* %0, i32* %1) {
%3 = alloca [11 x i8]*
%4 = alloca i32*
%5 = alloca i32
%6 = alloca 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
%17 = alloca [5 x i32]
store [11 x i8]* %0, [11 x i8]** %3
store i32* %1, i32** %4
%18 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%19 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%20 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.2, i64 0, i64 0))
%21 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %5)
br label %22
22: ; preds = %30, %2
%23 = load i32, i32* %5
%24 = icmp slt i32 %23, 6
br i1 %24, label %28, label %25
25: ; preds = %22
%26 = load i32, i32* %5
%27 = icmp sgt i32 %26, 11
br label %28
28: ; preds = %25, %22
%29 = phi i1 [ true, %22 ], [ %27, %25 ]
br i1 %29, label %30, label %33
30: ; preds = %28
%31 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.4, i64 0, i64 0))
%32 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %5)
br label %22
33: ; preds = %28
store i32 0, i32* %8
br label %34
34: ; preds = %42, %33
%35 = load i32, i32* %8
%36 = icmp slt i32 %35, 5
br i1 %36, label %37, label %45
37: ; preds = %34
%38 = load i32*, i32** %4
%39 = load i32, i32* %8
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds i32, i32* %38, i64 %40
store i32 0, i32* %41
br label %42
42: ; preds = %37
%43 = load i32, i32* %8
%44 = add nsw i32 %43, 1
store i32 %44, i32* %8
br label %34
45: ; preds = %34
store i32 0, i32* %8
br label %46
46: ; preds = %55, %45
%47 = load i32, i32* %8
%48 = icmp slt i32 %47, 5
br i1 %48, label %49, label %58
49: ; preds = %46
%50 = load i32, i32* %8
%51 = sub nsw i32 5, %50
%52 = load i32, i32* %8
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds [5 x i32], [5 x i32]* %17, i64 0, i64 %53
store i32 %51, i32* %54
br label %55
55: ; preds = %49
%56 = load i32, i32* %8
%57 = add nsw i32 %56, 1
store i32 %57, i32* %8
br label %46
58: ; preds = %46
store i32 0, i32* %6
br label %59
59: ; preds = %80, %58
%60 = load i32, i32* %6
%61 = load i32, i32* %5
%62 = icmp slt i32 %60, %61
br i1 %62, label %63, label %83
63: ; preds = %59
store i32 0, i32* %7
br label %64
64: ; preds = %76, %63
%65 = load i32, i32* %7
%66 = load i32, i32* %5
%67 = icmp slt i32 %65, %66
br i1 %67, label %68, label %79
68: ; preds = %64
%69 = load [11 x i8]*, [11 x i8]** %3
%70 = load i32, i32* %6
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds [11 x i8], [11 x i8]* %69, i64 %71
%73 = load i32, i32* %7
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds [11 x i8], [11 x i8]* %72, i64 0, i64 %74
store i8 42, i8* %75
br label %76
76: ; preds = %68
%77 = load i32, i32* %7
%78 = add nsw i32 %77, 1
store i32 %78, i32* %7
br label %64
79: ; preds = %64
br label %80
80: ; preds = %79
%81 = load i32, i32* %6
%82 = add nsw i32 %81, 1
store i32 %82, i32* %6
br label %59
83: ; preds = %59
br label %84
84: ; preds = %209, %83
%85 = load i32, i32* %10
%86 = icmp ne i32 %85, 5
br i1 %86, label %87, label %117
87: ; preds = %84
%88 = load i32*, i32** %4
%89 = getelementptr inbounds i32, i32* %88, i64 1
%90 = load i32, i32* %89
%91 = getelementptr inbounds [5 x i32], [5 x i32]* %17, i64 0, i64 1
%92 = load i32, i32* %91
%93 = icmp ne i32 %90, %92
br i1 %93, label %115, label %94
94: ; preds = %87
%95 = load i32*, i32** %4
%96 = getelementptr inbounds i32, i32* %95, i64 2
%97 = load i32, i32* %96
%98 = getelementptr inbounds [5 x i32], [5 x i32]* %17, i64 0, i64 2
%99 = load i32, i32* %98
%100 = icmp ne i32 %97, %99
br i1 %100, label %115, label %101
101: ; preds = %94
%102 = load i32*, i32** %4
%103 = getelementptr inbounds i32, i32* %102, i64 3
%104 = load i32, i32* %103
%105 = getelementptr inbounds [5 x i32], [5 x i32]* %17, i64 0, i64 3
%106 = load i32, i32* %105
%107 = icmp ne i32 %104, %106
br i1 %107, label %115, label %108
108: ; preds = %101
%109 = load i32*, i32** %4
%110 = getelementptr inbounds i32, i32* %109, i64 4
%111 = load i32, i32* %110
%112 = getelementptr inbounds [5 x i32], [5 x i32]* %17, i64 0, i64 4
%113 = load i32, i32* %112
%114 = icmp ne i32 %111, %113
br label %115
115: ; preds = %108, %101, %94, %87
%116 = phi i1 [ true, %101 ], [ true, %94 ], [ true, %87 ], [ %114, %108 ]
br label %117
117: ; preds = %115, %84
%118 = phi i1 [ false, %84 ], [ %116, %115 ]
br i1 %118, label %119, label %210
119: ; preds = %117
%120 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0))
%121 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.6, i64 0, i64 0))
%122 = call i32 @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.7, i64 0, i64 0))
%123 = call i32 @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.8, i64 0, i64 0))
%124 = call i32 @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.9, i64 0, i64 0))
%125 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0))
%126 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %10)
br label %127
127: ; preds = %135, %119
%128 = load i32, i32* %10
%129 = icmp slt i32 %128, 1
br i1 %129, label %133, label %130
130: ; preds = %127
%131 = load i32, i32* %10
%132 = icmp sgt i32 %131, 5
br label %133
133: ; preds = %130, %127
%134 = phi i1 [ true, %127 ], [ %132, %130 ]
br i1 %134, label %135, label %138
135: ; preds = %133
%136 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.11, i64 0, i64 0))
%137 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %10)
br label %127
138: ; preds = %133
%139 = load i32, i32* %10
%140 = icmp sgt i32 %139, 0
br i1 %140, label %141, label %209
141: ; preds = %138
%142 = load i32, i32* %10
%143 = icmp slt i32 %142, 5
br i1 %143, label %144, label %209
144: ; preds = %141
%145 = load i32*, i32** %4
%146 = load i32, i32* %10
%147 = sext i32 %146 to i64
%148 = getelementptr inbounds i32, i32* %145, i64 %147
%149 = load i32, i32* %148
%150 = load i32, i32* %10
%151 = sext i32 %150 to i64
%152 = getelementptr inbounds [5 x i32], [5 x i32]* %17, i64 0, i64 %151
%153 = load i32, i32* %152
%154 = icmp ne i32 %149, %153
br i1 %154, label %155, label %205
155: ; preds = %144
%156 = load i32, i32* %10
store i32 %156, i32* %11
%157 = call i32 @printf(i8* getelementptr inbounds ([97 x i8], [97 x i8]* @.str.12, i64 0, i64 0))
%158 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %13)
%159 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %14)
br label %160
160: ; preds = %170, %155
%161 = load i32, i32* %13
%162 = load i32, i32* %5
%163 = icmp sgt i32 %161, %162
br i1 %163, label %168, label %164
164: ; preds = %160
%165 = load i32, i32* %14
%166 = load i32, i32* %5
%167 = icmp sgt i32 %165, %166
br label %168
168: ; preds = %164, %160
%169 = phi i1 [ true, %160 ], [ %167, %164 ]
br i1 %169, label %170, label %174
170: ; preds = %168
%171 = call i32 @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.13, i64 0, i64 0))
%172 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %13)
%173 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %14)
br label %160
174: ; preds = %168
%175 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.14, i64 0, i64 0))
%176 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %12)
br label %177
177: ; preds = %185, %174
%178 = load i32, i32* %12
%179 = icmp ne i32 %178, 0
br i1 %179, label %180, label %183
180: ; preds = %177
%181 = load i32, i32* %12
%182 = icmp ne i32 %181, 1
br label %183
183: ; preds = %180, %177
%184 = phi i1 [ false, %177 ], [ %182, %180 ]
br i1 %184, label %185, label %188
185: ; preds = %183
%186 = call i32 @printf(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.15, i64 0, i64 0))
%187 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %12)
br label %177
188: ; preds = %183
%189 = load i32, i32* %12
%190 = icmp eq i32 %189, 0
br i1 %190, label %191, label %192
191: ; preds = %188
store i32 0, i32* %15
store i32 1, i32* %16
br label %193
192: ; preds = %188
store i32 1, i32* %15
store i32 0, i32* %16
br label %193
193: ; preds = %192, %191
%194 = load [11 x i8]*, [11 x i8]** %3
%195 = bitcast [11 x i8]* %194 to i8**
%196 = load i32, i32* %11
%197 = load i32, i32* %12
%198 = load i32, i32* %13
%199 = load i32, i32* %14
%200 = load i32, i32* %15
%201 = load i32, i32* %16
%202 = load i32, i32* %5
%203 = load i32*, i32** %4
%204 = call i32 @colocar(i8** %195, i32 %196, i32 %197, i32 %198, i32 %199, i32 %200, i32 %201, i32 %202, i32* %203)
br label %208
205: ; preds = %144
%206 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%207 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.16, i64 0, i64 0))
br label %208
208: ; preds = %205, %193
br label %209
209: ; preds = %208, %141, %138
br label %84
210: ; preds = %117
%211 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.17, i64 0, i64 0))
%212 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.18, i64 0, i64 0))
%213 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.19, i64 0, i64 0))
%214 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %9)
br label %215
215: ; preds = %223, %210
%216 = load i32, i32* %9
%217 = icmp slt i32 %216, 0
br i1 %217, label %221, label %218
218: ; preds = %215
%219 = load i32, i32* %9
%220 = icmp sgt i32 %219, 1
br label %221
221: ; preds = %218, %215
%222 = phi i1 [ true, %215 ], [ %220, %218 ]
br i1 %222, label %223, label %226
223: ; preds = %221
%224 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.11, i64 0, i64 0))
%225 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %9)
br label %215
226: ; preds = %221
%227 = load i32, i32* %9
%228 = icmp eq i32 %227, 1
br i1 %228, label %229, label %234
229: ; preds = %226
%230 = load [11 x i8]*, [11 x i8]** %3
%231 = bitcast [11 x i8]* %230 to i8**
%232 = load i32, i32* %5
%233 = call i32 @mostrarTaulell(i8** %231, i32 %232)
br label %234
234: ; preds = %229, %226
%235 = load i32, i32* %5
ret i32 %235
}

LLVM IR (-O2):
@.str = [4 x i8] c"cls\00"
@.str.1 = [26 x i8] c"\0AConfiguracio del Taulell\00"
@.str.2 = [54 x i8] c"\0A\0AIntrodueix nombre de files i columnes del taulell: \00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [50 x i8] c"\0AIntrodueix un nombre valid de files i columnes: \00"
@.str.6 = [63 x i8] c"\0A\091.Submari (Disposes de 4 submarins, cada un ocupa 1 casella)\00"
@.str.7 = [70 x i8] c"\0A\092.Draga mines (Disposes de 3 draga mines, cada un ocupa 2 caselles)\00"
@.str.8 = [69 x i8] c"\0A\093.Destructor (Disposes de 2 destructors, cada un ocupa 3 caselles)\00"
@.str.9 = [70 x i8] c"\0A\094.Portaavions (Disposes de 1 portaavions, cada un ocupa 4 caselles)\00"
@.str.10 = [13 x i8] c"\0A\095.Sortir\0A\09\00"
@.str.11 = [29 x i8] c"Introdueix un nombre valid: \00"
@.str.17 = [45 x i8] c"\0AVols veure com esta configurat el taulell??\00"
@.str.18 = [8 x i8] c"\0A\090. No\00"
@.str.19 = [10 x i8] c"\0A\091. Si\0A\09\00"
@str = [28 x i8] c"\0AQuin vaixell vols colocar?\00"
@str.20 = [38 x i8] c"\0AS'ha esgotat el vaixell seleccionat.\00"
@str.21 = [96 x i8] c"\0AIndica les coordenades on vols posicionar el vaixell (Primer el valor de x i despres el de y) \00"
@str.22 = [55 x i8] c"\0AIntrodueix la orientacio (0 Horitzontal, 1 vertical):\00"
@str.23 = [80 x i8] c"Introdueix 0 per a colocarlo horitzontalment o 1 per a colocarlo verticalment: \00"
@str.24 = [78 x i8] c"Torna a introduir uns valors valids (Primer el valor de x i despres el de y) \00"
define i32 @configurar([11 x i8]* %0, i32* %1) {
%3 = bitcast i32* %1 to i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca [5 x i32]
%11 = bitcast i32* %4 to i8*
%12 = bitcast i32* %5 to i8*
%13 = bitcast i32* %6 to i8*
%14 = bitcast i32* %7 to i8*
%15 = bitcast i32* %8 to i8*
%16 = bitcast i32* %9 to i8*
%17 = bitcast [5 x i32]* %10 to i8*
%18 = tail call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%19 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%20 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str.2, i64 0, i64 0))
%21 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %4)
%22 = load i32, i32* %4
%23 = add i32 %22, -12
%24 = icmp ult i32 %23, -6
br i1 %24, label %25, label %31
25: ; preds = %2, %25
%26 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.4, i64 0, i64 0))
%27 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %4)
%28 = load i32, i32* %4
%29 = add i32 %28, -12
%30 = icmp ult i32 %29, -6
br i1 %30, label %25, label %31
31: ; preds = %25, %2
%32 = phi i32 [ %22, %2 ], [ %28, %25 ]
%33 = bitcast [5 x i32]* %10 to <4 x i32>*
store <4 x i32> <i32 5, i32 4, i32 3, i32 2>, <4 x i32>* %33
%34 = getelementptr inbounds [5 x i32], [5 x i32]* %10, i64 0, i64 4
store i32 1, i32* %34
%35 = zext i32 %32 to i64
%36 = add nsw i64 %35, -1
%37 = and i64 %35, 7
%38 = icmp ult i64 %36, 7
br i1 %38, label %41, label %39
39: ; preds = %31
%40 = and i64 %35, 4294967288
br label %57
41: ; preds = %57, %31
%42 = phi i64 [ 0, %31 ], [ %75, %57 ]
%43 = icmp eq i64 %37, 0
br i1 %43, label %51, label %44
44: ; preds = %41, %44
%45 = phi i64 [ %48, %44 ], [ %42, %41 ]
%46 = phi i64 [ %49, %44 ], [ 0, %41 ]
%47 = getelementptr [11 x i8], [11 x i8]* %0, i64 %45, i64 0
%48 = add nuw nsw i64 %45, 1
%49 = add i64 %46, 1
%50 = icmp eq i64 %49, %37
br i1 %50, label %51, label %44
51: ; preds = %44, %41
%52 = getelementptr inbounds i32, i32* %1, i64 4
%53 = getelementptr inbounds i32, i32* %1, i64 1
%54 = getelementptr inbounds i32, i32* %1, i64 2
%55 = getelementptr inbounds i32, i32* %1, i64 3
%56 = bitcast [11 x i8]* %0 to i8**
br label %78
57: ; preds = %57, %39
%58 = phi i64 [ 0, %39 ], [ %75, %57 ]
%59 = phi i64 [ 0, %39 ], [ %76, %57 ]
%60 = getelementptr [11 x i8], [11 x i8]* %0, i64 %58, i64 0
%61 = or i64 %58, 1
%62 = getelementptr [11 x i8], [11 x i8]* %0, i64 %61, i64 0
%63 = or i64 %58, 2
%64 = getelementptr [11 x i8], [11 x i8]* %0, i64 %63, i64 0
%65 = or i64 %58, 3
%66 = getelementptr [11 x i8], [11 x i8]* %0, i64 %65, i64 0
%67 = or i64 %58, 4
%68 = getelementptr [11 x i8], [11 x i8]* %0, i64 %67, i64 0
%69 = or i64 %58, 5
%70 = getelementptr [11 x i8], [11 x i8]* %0, i64 %69, i64 0
%71 = or i64 %58, 6
%72 = getelementptr [11 x i8], [11 x i8]* %0, i64 %71, i64 0
%73 = or i64 %58, 7
%74 = getelementptr [11 x i8], [11 x i8]* %0, i64 %73, i64 0
%75 = add nuw nsw i64 %58, 8
%76 = add i64 %59, 8
%77 = icmp eq i64 %76, %40
br i1 %77, label %41, label %57
78: ; preds = %51, %160
%79 = load i32, i32* %53
%80 = icmp eq i32 %79, 4
br i1 %80, label %81, label %90
81: ; preds = %78
%82 = load i32, i32* %54
%83 = icmp eq i32 %82, 3
br i1 %83, label %84, label %90
84: ; preds = %81
%85 = load i32, i32* %55
%86 = icmp eq i32 %85, 2
br i1 %86, label %87, label %90
87: ; preds = %84
%88 = load i32, i32* %52
%89 = icmp eq i32 %88, 1
br i1 %89, label %163, label %90
90: ; preds = %78, %81, %84, %87
%91 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%92 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @.str.6, i64 0, i64 0))
%93 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([70 x i8], [70 x i8]* @.str.7, i64 0, i64 0))
%94 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([69 x i8], [69 x i8]* @.str.8, i64 0, i64 0))
%95 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([70 x i8], [70 x i8]* @.str.9, i64 0, i64 0))
%96 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0))
%97 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %6)
%98 = load i32, i32* %6
%99 = add i32 %98, -6
%100 = icmp ult i32 %99, -5
br i1 %100, label %101, label %107
101: ; preds = %90, %101
%102 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.11, i64 0, i64 0))
%103 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %6)
%104 = load i32, i32* %6
%105 = add i32 %104, -6
%106 = icmp ult i32 %105, -5
br i1 %106, label %101, label %107
107: ; preds = %101, %90
%108 = phi i32 [ %98, %90 ], [ %104, %101 ]
%109 = icmp ult i32 %108, 5
br i1 %109, label %110, label %160
110: ; preds = %107
%111 = zext i32 %108 to i64
%112 = getelementptr inbounds i32, i32* %1, i64 %111
%113 = load i32, i32* %112
%114 = getelementptr inbounds [5 x i32], [5 x i32]* %10, i64 0, i64 %111
%115 = load i32, i32* %114
%116 = icmp eq i32 %113, %115
br i1 %116, label %157, label %117
117: ; preds = %110
%118 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([96 x i8], [96 x i8]* @str.21, i64 0, i64 0))
%119 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %8)
%120 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %9)
%121 = load i32, i32* %8
%122 = load i32, i32* %4
%123 = icmp sgt i32 %121, %122
%124 = load i32, i32* %9
%125 = icmp sgt i32 %124, %122
%126 = select i1 %123, i1 true, i1 %125
br i1 %126, label %127, label %137
127: ; preds = %117, %127
%128 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([78 x i8], [78 x i8]* @str.24, i64 0, i64 0))
%129 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %8)
%130 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %9)
%131 = load i32, i32* %8
%132 = load i32, i32* %4
%133 = icmp sgt i32 %131, %132
%134 = load i32, i32* %9
%135 = icmp sgt i32 %134, %132
%136 = select i1 %133, i1 true, i1 %135
br i1 %136, label %127, label %137
137: ; preds = %127, %117
%138 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str.22, i64 0, i64 0))
%139 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %7)
%140 = load i32, i32* %7
%141 = icmp ult i32 %140, 2
br i1 %141, label %147, label %142
142: ; preds = %137, %142
%143 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([80 x i8], [80 x i8]* @str.23, i64 0, i64 0))
%144 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %7)
%145 = load i32, i32* %7
%146 = icmp ult i32 %145, 2
br i1 %146, label %147, label %142
147: ; preds = %142, %137
%148 = phi i32 [ %140, %137 ], [ %145, %142 ]
%149 = icmp eq i32 %148, 0
%150 = xor i1 %149, true
%151 = zext i1 %150 to i32
%152 = zext i1 %149 to i32
%153 = load i32, i32* %8
%154 = load i32, i32* %9
%155 = load i32, i32* %4
%156 = call i32 @colocar(i8** %56, i32 %108, i32 %148, i32 %153, i32 %154, i32 %151, i32 %152, i32 %155, i32* %1)
br label %160
157: ; preds = %110
%158 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%159 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.20, i64 0, i64 0))
br label %160
160: ; preds = %147, %157, %107
%161 = load i32, i32* %6
%162 = icmp eq i32 %161, 5
br i1 %162, label %163, label %78
163: ; preds = %87, %160
%164 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str.17, i64 0, i64 0))
%165 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.18, i64 0, i64 0))
%166 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.19, i64 0, i64 0))
%167 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %5)
%168 = load i32, i32* %5
%169 = icmp ugt i32 %168, 1
br i1 %169, label %170, label %175
170: ; preds = %163, %170
%171 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.11, i64 0, i64 0))
%172 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %5)
%173 = load i32, i32* %5
%174 = icmp ugt i32 %173, 1
br i1 %174, label %170, label %175
175: ; preds = %170, %163
%176 = phi i32 [ %168, %163 ], [ %173, %170 ]
%177 = icmp eq i32 %176, 1
br i1 %177, label %178, label %182
178: ; preds = %175
%179 = bitcast [11 x i8]* %0 to i8**
%180 = load i32, i32* %4
%181 = call i32 @mostrarTaulell(i8** %179, i32 %180)
br label %182
182: ; preds = %178, %175
%183 = load i32, i32* %4
ret i32 %183
}