#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, ...);
void main() {
  char filename[100];
  FILE *fd;
  unsigned int nodos = 1, filas = 1, columnas = 1, i, j, mc;
  printf("Numero de nodos en el sistema:\n");
  scanf("%d", &nodos);
  printf("Numero de filas:\n");
  scanf("%d", &filas);
  printf("Numero mc:\n");
  scanf("%d", &mc);
  printf("Nombre del fichero de configuracion de red:\n");
  scanf("%s", filename);
  columnas = nodos / filas;
  if (nodos != columnas * filas) {
    printf("ERROR EL NUMERO DE NODOS NO ES DIVISIBLE POR EL NUMERO DE FILAS\n");
    exit(-1);
  }
  printf("Fichero: %s\n", filename);
  printf("Nodos totales: %d\n", nodos);
  printf("Nodos por fila: %d\n", columnas);
  printf("Filas: %d\n", filas);
  fd = fopen(filename, "w");
  fprintf(fd, "[ Network.mesh ] \n  DefaultInputBufferSize = 128 \n  "
              "DefaultOutputBufferSize = 128 \n  DefaultBandwidth = 64 "
              "\n\n;;;;;;;;;; NODES ;;;;;;;;;; \n");
  for (i = 0; i < nodos + mc; i++) {
    fprintf(fd, "\n[ Network.mesh.Node.n%d ] \nType = EndNode \n", i);
  }
  fprintf(fd, "\n;;;;;;;; SWITCHES ;;;;;;;; \n");
  for (i = 0; i < nodos; i++) {
    fprintf(fd, "\n[ Network.mesh.Node.s%d ] \nType = Switch \n", i);
  }
  fprintf(fd, "\n;;;;;;;; LINKS ;;;;;;;; \n");
  for (i = 0; i < filas; i++) {
    for (j = 0; j < columnas - 1; j++) {
      int actual = columnas * i + j;
      fprintf(fd,
              "\n[ Network.mesh.Link.s%ds%d ] \n  Source = s%d \n  Dest = s%d "
              "\n  Type = Bidirectional \n",
              actual, actual + 1, actual, actual + 1);
    }
  }
  for (i = 0; i < filas - 1; i++) {
    for (j = 0; j < columnas; j++) {
      int actual = columnas * i + j;
      fprintf(fd,
              "\n[ Network.mesh.Link.s%ds%d ] \n  Source = s%d \n  Dest = s%d "
              "\n  Type = Bidirectional \n",
              actual, actual + columnas, actual, actual + columnas);
    }
  }
  for (i = 0; i < nodos; i++) {
    fprintf(fd,
            "\n[ Network.mesh.Link.n%ds%d ] \n  Source = n%d \n  Dest = s%d \n "
            " Type = Bidirectional \n",
            i, i, i, i);
  }
  for (i = nodos; i < nodos + mc; i++) {
    fprintf(fd,
            "\n[ Network.mesh.Link.n%ds%d ] \n  Source = n%d \n  Dest = s%d \n "
            " Type = Bidirectional \n",
            i, -mc + i, i, -mc + i);
  }
  fprintf(fd, "\n[ Network.mesh.Routes ]\n");
  for (i = 0; i < nodos; i++) {
    for (j = 0; j < nodos + mc; j++) {
      if (i != j)
        fprintf(fd, "n%d.to.n%d = s%d\n", i, j, i);
    }
  }
  for (i = nodos; i < nodos + mc; i++) {
    for (j = 0; j < nodos; j++) {
      if (i != j)
        fprintf(fd, "n%d.to.n%d = s%d\n", i, j, i - mc);
    }
  }
  for (i = 0; i < nodos; i++) {
    for (j = 0; j < nodos; j++) {
      unsigned int next;
      if (i != j) {
        if (i % columnas != j % columnas) {
          if (i % columnas > j % columnas) {
            next = i - 1;
          } else {
            next = i + 1;
          }
        } else {
          if (i > j) {
            next = i - columnas;
          } else {
            next = i + columnas;
          }
        }
        fprintf(fd, "s%d.to.n%d = s%d\n", i, j, next);
      }
    }
  }
  for (i = 0; i < nodos; i++) {
    for (j = nodos; j < nodos + mc; j++) {
      int j_aux = j - mc;
      unsigned int next;
      if (i != j_aux) {
        if (i % columnas != j_aux % columnas) {
          if (i % columnas > j_aux % columnas) {
            next = i - 1;
          } else {
            next = i + 1;
          }
        } else {
          if (i > j_aux) {
            next = i - columnas;
          } else {
            next = i + columnas;
          }
        }
        fprintf(fd, "s%d.to.n%d = s%d\n", i, j, next);
      }
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movl   $0x1,-0x7c(%rbp)
movl   $0x1,-0x80(%rbp)
movl   $0x1,-0x84(%rbp)
lea    0xe86(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe98(%rip),%rdi
lea    -0x7c(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
lea    0xe89(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe78(%rip),%rdi
lea    -0x80(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
lea    0xe7b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe58(%rip),%rdi
lea    -0x90(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
lea    0xe64(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x70(%rbp),%rsi
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1050 <scanf@plt>
mov    -0x7c(%rbp),%eax
xor    %edx,%edx
divl   -0x80(%rbp)
mov    %eax,-0x84(%rbp)
mov    -0x7c(%rbp),%eax
mov    -0x84(%rbp),%ecx
imul   -0x80(%rbp),%ecx
cmp    %ecx,%eax
je     1231 <main+0xe1>
lea    0xe51(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>
lea    -0x70(%rbp),%rsi
lea    0xe76(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x7c(%rbp),%esi
lea    0xe72(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x84(%rbp),%esi
lea    0xe71(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x80(%rbp),%esi
lea    0xe74(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x70(%rbp),%rdi
lea    0xe6d(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x78(%rbp)
mov    -0x78(%rbp),%rdi
lea    0xe5b(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0x0,-0x88(%rbp)
mov    -0x88(%rbp),%eax
mov    -0x7c(%rbp),%ecx
add    -0x90(%rbp),%ecx
cmp    %ecx,%eax
jae    12ec <main+0x19c>
mov    -0x78(%rbp),%rdi
mov    -0x88(%rbp),%edx
lea    0xead(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x88(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x88(%rbp)
jmp    12a9 <main+0x159>
mov    -0x78(%rbp),%rdi
lea    0xeb4(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0x0,-0x88(%rbp)
mov    -0x88(%rbp),%eax
cmp    -0x7c(%rbp),%eax
jae    1343 <main+0x1f3>
mov    -0x78(%rbp),%rdi
mov    -0x88(%rbp),%edx
lea    0xea1(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x88(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x88(%rbp)
jmp    1308 <main+0x1b8>
mov    -0x78(%rbp),%rdi
lea    0xea7(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0x0,-0x88(%rbp)
mov    -0x88(%rbp),%eax
cmp    -0x80(%rbp),%eax
jae    1408 <main+0x2b8>
movl   $0x0,-0x8c(%rbp)
mov    -0x8c(%rbp),%eax
mov    -0x84(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jae    13ef <main+0x29f>
mov    -0x84(%rbp),%eax
imul   -0x88(%rbp),%eax
add    -0x8c(%rbp),%eax
mov    %eax,-0x94(%rbp)
mov    -0x78(%rbp),%rdi
mov    -0x94(%rbp),%edx
mov    -0x94(%rbp),%ecx
add    $0x1,%ecx
mov    -0x94(%rbp),%r8d
mov    -0x94(%rbp),%r9d
add    $0x1,%r9d
lea    0xe3c(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8c(%rbp)
jmp    1378 <main+0x228>
jmp    13f4 <main+0x2a4>
mov    -0x88(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x88(%rbp)
jmp    135f <main+0x20f>
movl   $0x0,-0x88(%rbp)
mov    -0x88(%rbp),%eax
mov    -0x80(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jae    14c1 <main+0x371>
movl   $0x0,-0x8c(%rbp)
mov    -0x8c(%rbp),%eax
cmp    -0x84(%rbp),%eax
jae    14a8 <main+0x358>
mov    -0x84(%rbp),%eax
imul   -0x88(%rbp),%eax
add    -0x8c(%rbp),%eax
mov    %eax,-0x98(%rbp)
mov    -0x78(%rbp),%rdi
mov    -0x98(%rbp),%edx
mov    -0x98(%rbp),%ecx
add    -0x84(%rbp),%ecx
mov    -0x98(%rbp),%r8d
mov    -0x98(%rbp),%r9d
add    -0x84(%rbp),%r9d
lea    0xd83(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8c(%rbp)
jmp    1430 <main+0x2e0>
jmp    14ad <main+0x35d>
mov    -0x88(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x88(%rbp)
jmp    1412 <main+0x2c2>
movl   $0x0,-0x88(%rbp)
mov    -0x88(%rbp),%eax
cmp    -0x7c(%rbp),%eax
jae    151a <main+0x3ca>
mov    -0x78(%rbp),%rdi
mov    -0x88(%rbp),%edx
mov    -0x88(%rbp),%ecx
mov    -0x88(%rbp),%r8d
mov    -0x88(%rbp),%r9d
lea    0xd67(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x88(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x88(%rbp)
jmp    14cb <main+0x37b>
mov    -0x7c(%rbp),%eax
mov    %eax,-0x88(%rbp)
mov    -0x88(%rbp),%eax
mov    -0x7c(%rbp),%ecx
add    -0x90(%rbp),%ecx
cmp    %ecx,%eax
jae    158c <main+0x43c>
mov    -0x78(%rbp),%rdi
mov    -0x88(%rbp),%edx
xor    %ecx,%ecx
sub    -0x90(%rbp),%ecx
add    -0x88(%rbp),%ecx
mov    -0x88(%rbp),%r8d
xor    %r9d,%r9d
sub    -0x90(%rbp),%r9d
add    -0x88(%rbp),%r9d
lea    0xcf5(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x88(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x88(%rbp)
jmp    1523 <main+0x3d3>
mov    -0x78(%rbp),%rdi
lea    0xd25(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0x0,-0x88(%rbp)
mov    -0x88(%rbp),%eax
cmp    -0x7c(%rbp),%eax
jae    1641 <main+0x4f1>
movl   $0x0,-0x8c(%rbp)
mov    -0x8c(%rbp),%eax
mov    -0x7c(%rbp),%ecx
add    -0x90(%rbp),%ecx
cmp    %ecx,%eax
jae    1628 <main+0x4d8>
mov    -0x88(%rbp),%eax
cmp    -0x8c(%rbp),%eax
je     160f <main+0x4bf>
mov    -0x78(%rbp),%rdi
mov    -0x88(%rbp),%edx
mov    -0x8c(%rbp),%ecx
mov    -0x88(%rbp),%r8d
lea    0xcce(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    1614 <main+0x4c4>
mov    -0x8c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8c(%rbp)
jmp    15c1 <main+0x471>
jmp    162d <main+0x4dd>
mov    -0x88(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x88(%rbp)
jmp    15a8 <main+0x458>
mov    -0x7c(%rbp),%eax
mov    %eax,-0x88(%rbp)
mov    -0x88(%rbp),%eax
mov    -0x7c(%rbp),%ecx
add    -0x90(%rbp),%ecx
cmp    %ecx,%eax
jae    16ea <main+0x59a>
movl   $0x0,-0x8c(%rbp)
mov    -0x8c(%rbp),%eax
cmp    -0x7c(%rbp),%eax
jae    16d1 <main+0x581>
mov    -0x88(%rbp),%eax
cmp    -0x8c(%rbp),%eax
je     16b8 <main+0x568>
mov    -0x78(%rbp),%rdi
mov    -0x88(%rbp),%edx
mov    -0x8c(%rbp),%ecx
mov    -0x88(%rbp),%r8d
sub    -0x90(%rbp),%r8d
lea    0xc25(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    16bd <main+0x56d>
mov    -0x8c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8c(%rbp)
jmp    166b <main+0x51b>
jmp    16d6 <main+0x586>
mov    -0x88(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x88(%rbp)
jmp    164a <main+0x4fa>
movl   $0x0,-0x88(%rbp)
mov    -0x88(%rbp),%eax
cmp    -0x7c(%rbp),%eax
jae    1851 <main+0x701>
movl   $0x0,-0x8c(%rbp)
mov    -0x8c(%rbp),%eax
cmp    -0x7c(%rbp),%eax
jae    1838 <main+0x6e8>
mov    -0x88(%rbp),%eax
cmp    -0x8c(%rbp),%eax
je     181f <main+0x6cf>
mov    -0x88(%rbp),%eax
xor    %edx,%edx
divl   -0x84(%rbp)
mov    %edx,-0xa8(%rbp)
mov    -0x8c(%rbp),%eax
xor    %edx,%edx
divl   -0x84(%rbp)
mov    %edx,%eax
mov    -0xa8(%rbp),%edx
cmp    %eax,%edx
je     17ba <main+0x66a>
mov    -0x88(%rbp),%eax
xor    %edx,%edx
divl   -0x84(%rbp)
mov    %edx,-0xac(%rbp)
mov    -0x8c(%rbp),%eax
xor    %edx,%edx
divl   -0x84(%rbp)
mov    %edx,%eax
mov    -0xac(%rbp),%edx
cmp    %eax,%edx
jbe    17a6 <main+0x656>
mov    -0x88(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x9c(%rbp)
jmp    17b5 <main+0x665>
mov    -0x88(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c(%rbp)
jmp    17fa <main+0x6aa>
mov    -0x88(%rbp),%eax
cmp    -0x8c(%rbp),%eax
jbe    17e3 <main+0x693>
mov    -0x88(%rbp),%eax
sub    -0x84(%rbp),%eax
mov    %eax,-0x9c(%rbp)
jmp    17f5 <main+0x6a5>
mov    -0x88(%rbp),%eax
add    -0x84(%rbp),%eax
mov    %eax,-0x9c(%rbp)
jmp    17fa <main+0x6aa>
mov    -0x78(%rbp),%rdi
mov    -0x88(%rbp),%edx
mov    -0x8c(%rbp),%ecx
mov    -0x9c(%rbp),%r8d
lea    0xad0(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    1824 <main+0x6d4>
mov    -0x8c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8c(%rbp)
jmp    170d <main+0x5bd>
jmp    183d <main+0x6ed>
mov    -0x88(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x88(%rbp)
jmp    16f4 <main+0x5a4>
movl   $0x0,-0x88(%rbp)
mov    -0x88(%rbp),%eax
cmp    -0x7c(%rbp),%eax
jae    19d1 <main+0x881>
mov    -0x7c(%rbp),%eax
mov    %eax,-0x8c(%rbp)
mov    -0x8c(%rbp),%eax
mov    -0x7c(%rbp),%ecx
add    -0x90(%rbp),%ecx
cmp    %ecx,%eax
jae    19b8 <main+0x868>
mov    -0x8c(%rbp),%eax
sub    -0x90(%rbp),%eax
mov    %eax,-0xa0(%rbp)
mov    -0x88(%rbp),%eax
cmp    -0xa0(%rbp),%eax
je     199f <main+0x84f>
mov    -0x88(%rbp),%eax
xor    %edx,%edx
divl   -0x84(%rbp)
mov    %edx,-0xb0(%rbp)
mov    -0xa0(%rbp),%eax
xor    %edx,%edx
divl   -0x84(%rbp)
mov    %edx,%eax
mov    -0xb0(%rbp),%edx
cmp    %eax,%edx
je     193a <main+0x7ea>
mov    -0x88(%rbp),%eax
xor    %edx,%edx
divl   -0x84(%rbp)
mov    %edx,-0xb4(%rbp)
mov    -0xa0(%rbp),%eax
xor    %edx,%edx
divl   -0x84(%rbp)
mov    %edx,%eax
mov    -0xb4(%rbp),%edx
cmp    %eax,%edx
jbe    1926 <main+0x7d6>
mov    -0x88(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xa4(%rbp)
jmp    1935 <main+0x7e5>
mov    -0x88(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa4(%rbp)
jmp    197a <main+0x82a>
mov    -0x88(%rbp),%eax
cmp    -0xa0(%rbp),%eax
jbe    1963 <main+0x813>
mov    -0x88(%rbp),%eax
sub    -0x84(%rbp),%eax
mov    %eax,-0xa4(%rbp)
jmp    1975 <main+0x825>
mov    -0x88(%rbp),%eax
add    -0x84(%rbp),%eax
mov    %eax,-0xa4(%rbp)
jmp    197a <main+0x82a>
mov    -0x78(%rbp),%rdi
mov    -0x88(%rbp),%edx
mov    -0x8c(%rbp),%ecx
mov    -0xa4(%rbp),%r8d
lea    0x950(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    19a4 <main+0x854>
mov    -0x8c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8c(%rbp)
jmp    1873 <main+0x723>
jmp    19bd <main+0x86d>
mov    -0x88(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x88(%rbp)
jmp    185b <main+0x70b>
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x88,%rsp
movl   $0x1,0x8(%rsp)
movl   $0x1,0x10(%rsp)
lea    0x10b6(%rip),%rdi
call   1030 <puts@plt>
lea    0xe5c(%rip),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0x10b3(%rip),%rdi
call   1030 <puts@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0x10a9(%rip),%rdi
call   1030 <puts@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0x1099(%rip),%rdi
call   1030 <puts@plt>
lea    0xe07(%rip),%rdi
lea    0x20(%rsp),%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
mov    0x8(%rsp),%ecx
mov    0x10(%rsp),%esi
mov    %ecx,%eax
xor    %edx,%edx
div    %esi
mov    %eax,%r12d
mov    %esi,0x18(%rsp)
imul   %esi,%eax
mov    %ecx,0x1c(%rsp)
cmp    %eax,%ecx
jne    16e7 <main+0x577>
lea    0xdd3(%rip),%rdi
lea    0x20(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rsp),%esi
lea    0xdc6(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xdcb(%rip),%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%rsp),%esi
lea    0xdca(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xdc7(%rip),%rsi
mov    %rbx,%rdi
call   1070 <fopen@plt>
mov    %rax,%r14
lea    0xdb7(%rip),%rdi
mov    $0x8a,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1090 <fwrite@plt>
mov    0xc(%rsp),%eax
add    0x8(%rsp),%eax
je     12de <main+0x16e>
lea    0xe1f(%rip),%rbx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1050 <fprintf@plt>
add    $0x1,%ebp
mov    0xc(%rsp),%eax
add    0x8(%rsp),%eax
cmp    %eax,%ebp
jb     12c0 <main+0x150>
lea    0xe1a(%rip),%rdi
mov    $0x1d,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1090 <fwrite@plt>
cmpl   $0x0,0x8(%rsp)
je     1328 <main+0x1b8>
lea    0xe18(%rip),%rbx
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1050 <fprintf@plt>
add    $0x1,%ebp
cmp    0x8(%rsp),%ebp
jb     1310 <main+0x1a0>
lea    0xe1a(%rip),%rdi
mov    $0x1a,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1090 <fwrite@plt>
mov    0x10(%rsp),%ecx
mov    $0x0,%eax
test   %ecx,%ecx
je     1404 <main+0x294>
lea    -0x1(%r12),%ebp
lea    0xe06(%rip),%rbx
mov    %ecx,%eax
xor    %ecx,%ecx
jmp    1377 <main+0x207>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%ecx
cmp    %eax,%ecx
jae    13c1 <main+0x251>
test   %ebp,%ebp
je     1370 <main+0x200>
mov    %ecx,0x14(%rsp)
mov    %ecx,%r15d
imul   %r12d,%r15d
xor    %r13d,%r13d
nopl   0x0(%rax)
lea    (%r15,%r13,1),%edx
lea    (%r15,%r13,1),%ecx
add    $0x1,%ecx
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %edx,%r8d
mov    %ecx,%r9d
xor    %eax,%eax
call   1050 <fprintf@plt>
add    $0x1,%r13d
cmp    %ebp,%r13d
jne    1390 <main+0x220>
mov    0x10(%rsp),%eax
mov    0x14(%rsp),%ecx
jmp    1370 <main+0x200>
cmp    $0x1,%eax
jne    1404 <main+0x294>
cmpl   $0x0,0x8(%rsp)
je     147e <main+0x30e>
lea    0xde2(%rip),%r15
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r15,%rsi
mov    %ebp,%edx
mov    %ebp,%ecx
mov    %ebp,%r8d
mov    %ebp,%r9d
xor    %eax,%eax
call   1050 <fprintf@plt>
add    $0x1,%ebp
mov    0x8(%rsp),%ebx
cmp    %ebx,%ebp
jb     13e0 <main+0x270>
jmp    1480 <main+0x310>
cmp    $0x2,%r12d
mov    $0x1,%ebp
cmovae %r12d,%ebp
lea    0xd4c(%rip),%r15
xor    %edx,%edx
jmp    142a <main+0x2ba>
nopl   0x0(%rax)
add    $0x1,%edx
lea    -0x1(%rax),%ecx
cmp    %ecx,%edx
jae    13c6 <main+0x256>
mov    0x18(%rsp),%ecx
cmp    0x1c(%rsp),%ecx
ja     1420 <main+0x2b0>
mov    %edx,0x14(%rsp)
mov    %edx,%ebx
imul   %r12d,%ebx
xor    %r13d,%r13d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    (%rbx,%r13,1),%edx
lea    (%rdx,%r12,1),%ecx
mov    %r14,%rdi
mov    %r15,%rsi
mov    %edx,%r8d
mov    %ecx,%r9d
xor    %eax,%eax
call   1050 <fprintf@plt>
add    $0x1,%r13d
cmp    %ebp,%r13d
jne    1450 <main+0x2e0>
mov    0x10(%rsp),%eax
mov    0x14(%rsp),%edx
jmp    1420 <main+0x2b0>
xor    %ebx,%ebx
mov    0xc(%rsp),%eax
lea    (%rax,%rbx,1),%ecx
cmp    %ecx,%ebx
jae    14ca <main+0x35a>
lea    0xd28(%rip),%rbp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %ebx,%ecx
sub    %eax,%ecx
mov    %r14,%rdi
mov    %rbp,%rsi
mov    %ebx,%edx
mov    %ebx,%r8d
mov    %ecx,%r9d
xor    %eax,%eax
call   1050 <fprintf@plt>
add    $0x1,%ebx
mov    0xc(%rsp),%eax
mov    0x8(%rsp),%ecx
add    %eax,%ecx
cmp    %ecx,%ebx
jb     14a0 <main+0x330>
lea    0xd3f(%rip),%rdi
mov    $0x19,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1090 <fwrite@plt>
mov    0x8(%rsp),%ecx
mov    0xc(%rsp),%edx
test   %ecx,%ecx
je     154c <main+0x3dc>
lea    0xd34(%rip),%r15
xor    %ebp,%ebp
jmp    1507 <main+0x397>
nopw   0x0(%rax,%rax,1)
add    $0x1,%ebp
cmp    %ecx,%ebp
jae    154e <main+0x3de>
mov    %edx,%eax
add    %ecx,%eax
je     1500 <main+0x390>
xor    %ebx,%ebx
jmp    152a <main+0x3ba>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebx
lea    (%rdx,%rcx,1),%eax
cmp    %eax,%ebx
jae    1500 <main+0x390>
cmp    %ebx,%ebp
je     1520 <main+0x3b0>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %ebp,%edx
mov    %ebx,%ecx
mov    %ebp,%r8d
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    0x8(%rsp),%ecx
mov    0xc(%rsp),%edx
jmp    1520 <main+0x3b0>
xor    %ecx,%ecx
lea    (%rdx,%rcx,1),%eax
cmp    %eax,%ecx
jae    15aa <main+0x43a>
lea    0xcce(%rip),%r15
mov    %ecx,%ebx
jmp    1572 <main+0x402>
mov    0xc(%rsp),%edx
mov    %ecx,%eax
add    $0x1,%ebx
lea    (%rdx,%rax,1),%esi
mov    %eax,%ecx
cmp    %esi,%ebx
jae    15ac <main+0x43c>
mov    $0x0,%eax
test   %ecx,%ecx
je     1566 <main+0x3f6>
xor    %ebp,%ebp
jmp    1587 <main+0x417>
nop
add    $0x1,%ebp
cmp    %ecx,%ebp
jae    1560 <main+0x3f0>
cmp    %ebp,%ebx
je     1580 <main+0x410>
mov    %ebx,%r8d
sub    0xc(%rsp),%r8d
mov    %r14,%rdi
mov    %r15,%rsi
mov    %ebx,%edx
mov    %ebp,%ecx
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    0x8(%rsp),%ecx
jmp    1580 <main+0x410>
mov    %ecx,%eax
test   %eax,%eax
je     16d5 <main+0x565>
mov    %r12d,%r13d
neg    %r13d
lea    0xc7b(%rip),%r15
xor    %ebp,%ebp
jmp    15d7 <main+0x467>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%ebp
cmp    %eax,%ebp
jae    162f <main+0x4bf>
xor    %ebx,%ebx
jmp    15e7 <main+0x477>
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebx
cmp    %eax,%ebx
jae    15d0 <main+0x460>
cmp    %ebx,%ebp
je     15e0 <main+0x470>
mov    %ebp,%eax
xor    %edx,%edx
div    %r12d
mov    %edx,%ecx
mov    %ebx,%eax
xor    %edx,%edx
div    %r12d
cmp    %ebx,%ebp
mov    %r12d,%eax
cmova  %r13d,%eax
xor    %esi,%esi
cmp    %edx,%ecx
setbe  %sil
lea    -0x1(%rsi,%rsi,1),%r8d
cmove  %eax,%r8d
add    %ebp,%r8d
mov    %r14,%rdi
mov    %r15,%rsi
mov    %ebp,%edx
mov    %ebx,%ecx
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    0x8(%rsp),%eax
jmp    15e0 <main+0x470>
test   %eax,%eax
je     16d5 <main+0x565>
mov    0xc(%rsp),%ecx
xor    %r15d,%r15d
mov    %ecx,%edx
xor    %ebp,%ebp
jmp    165f <main+0x4ef>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %edx,%esi
add    $0x1,%ebp
add    $0xffffffff,%r15d
mov    %esi,%edx
cmp    %eax,%ebp
jae    16d5 <main+0x565>
lea    (%rdx,%rax,1),%esi
cmp    %esi,%eax
jae    1650 <main+0x4e0>
mov    %eax,%ebx
jmp    167e <main+0x50e>
nopw   0x0(%rax,%rax,1)
add    $0x1,%ebx
lea    (%rcx,%rax,1),%edi
mov    %ecx,%edx
mov    %ecx,%esi
cmp    %edi,%ebx
jae    1652 <main+0x4e2>
lea    (%r15,%rbx,1),%esi
cmp    %edx,%esi
je     1670 <main+0x500>
mov    %ebx,%ecx
sub    %edx,%ecx
mov    %ebp,%eax
xor    %edx,%edx
div    %r12d
mov    %edx,%esi
mov    %ecx,%eax
xor    %edx,%edx
div    %r12d
cmp    %ecx,%ebp
mov    %r12d,%eax
cmova  %r13d,%eax
xor    %ecx,%ecx
cmp    %edx,%esi
setbe  %cl
lea    -0x1(%rcx,%rcx,1),%r8d
cmove  %eax,%r8d
add    %ebp,%r8d
mov    %r14,%rdi
lea    0xb7c(%rip),%rsi
mov    %ebp,%edx
mov    %ebx,%ecx
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    0x8(%rsp),%eax
mov    0xc(%rsp),%ecx
jmp    1670 <main+0x500>
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xbc7(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"Numero de nodos en el sistema:\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [18 x i8] c"Numero de filas:\0A\00"
@.str.3 = [12 x i8] c"Numero mc:\0A\00"
@.str.4 = [45 x i8] c"Nombre del fichero de configuracion de red:\0A\00"
@.str.5 = [3 x i8] c"%s\00"
@.str.6 = [65 x i8] c"ERROR EL NUMERO DE NODOS NO ES DIVISIBLE POR EL NUMERO DE FILAS\0A\00"
@.str.7 = [13 x i8] c"Fichero: %s\0A\00"
@.str.8 = [19 x i8] c"Nodos totales: %d\0A\00"
@.str.9 = [20 x i8] c"Nodos por fila: %d\0A\00"
@.str.10 = [11 x i8] c"Filas: %d\0A\00"
@.str.11 = [2 x i8] c"w\00"
@.str.12 = [139 x i8] c"[ Network.mesh ] \0A DefaultInputBufferSize = 128 \0A DefaultOutputBufferSize = 128 \0A DefaultBandwidth = 64 \0A\0A;;;;;;;;;; NODES ;;;;;;;;;; \0A\00"
@.str.13 = [45 x i8] c"\0A[ Network.mesh.Node.n%d ] \0AType = EndNode \0A\00"
@.str.14 = [30 x i8] c"\0A;;;;;;;; SWITCHES ;;;;;;;; \0A\00"
@.str.15 = [44 x i8] c"\0A[ Network.mesh.Node.s%d ] \0AType = Switch \0A\00"
@.str.16 = [27 x i8] c"\0A;;;;;;;; LINKS ;;;;;;;; \0A\00"
@.str.17 = [86 x i8] c"\0A[ Network.mesh.Link.s%ds%d ] \0A Source = s%d \0A Dest = s%d \0A Type = Bidirectional \0A\00"
@.str.18 = [86 x i8] c"\0A[ Network.mesh.Link.n%ds%d ] \0A Source = n%d \0A Dest = s%d \0A Type = Bidirectional \0A\00"
@.str.19 = [26 x i8] c"\0A[ Network.mesh.Routes ]\0A\00"
@.str.20 = [18 x i8] c"n%d.to.n%d = s%d\0A\00"
@.str.21 = [18 x i8] c"s%d.to.n%d = s%d\0A\00"
define void @main() {
%1 = alloca [100 x i8]
%2 = alloca i32*
%3 = alloca i32
%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
store i32 1, i32* %3
store i32 1, i32* %4
store i32 1, i32* %5
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%15 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%17 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%19 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %8)
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.4, i64 0, i64 0))
%21 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%22 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %21)
%23 = load i32, i32* %3
%24 = load i32, i32* %4
%25 = udiv i32 %23, %24
store i32 %25, i32* %5
%26 = load i32, i32* %3
%27 = load i32, i32* %5
%28 = load i32, i32* %4
%29 = mul i32 %27, %28
%30 = icmp ne i32 %26, %29
br i1 %30, label %31, label %34
31: ; preds = %0
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.6, i64 0, i64 0))
%33 = call i32 @exit(i32 -1)
unreachable
34: ; preds = %0
%35 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i8* %35)
%37 = load i32, i32* %3
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0), i32 %37)
%39 = load i32, i32* %5
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.9, i64 0, i64 0), i32 %39)
%41 = load i32, i32* %4
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0), i32 %41)
%43 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%44 = call i32* @fopen(i8* %43, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
store i32* %44, i32** %2
%45 = load i32*, i32** %2
%46 = call i32 (i32*, i8*, ...) @fprintf(i32* %45, i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str.12, i64 0, i64 0))
store i32 0, i32* %6
br label %47
47: ; preds = %57, %34
%48 = load i32, i32* %6
%49 = load i32, i32* %3
%50 = load i32, i32* %8
%51 = add i32 %49, %50
%52 = icmp ult i32 %48, %51
br i1 %52, label %53, label %60
53: ; preds = %47
%54 = load i32*, i32** %2
%55 = load i32, i32* %6
%56 = call i32 (i32*, i8*, ...) @fprintf(i32* %54, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.13, i64 0, i64 0), i32 %55)
br label %57
57: ; preds = %53
%58 = load i32, i32* %6
%59 = add i32 %58, 1
store i32 %59, i32* %6
br label %47
60: ; preds = %47
%61 = load i32*, i32** %2
%62 = call i32 (i32*, i8*, ...) @fprintf(i32* %61, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.14, i64 0, i64 0))
store i32 0, i32* %6
br label %63
63: ; preds = %71, %60
%64 = load i32, i32* %6
%65 = load i32, i32* %3
%66 = icmp ult i32 %64, %65
br i1 %66, label %67, label %74
67: ; preds = %63
%68 = load i32*, i32** %2
%69 = load i32, i32* %6
%70 = call i32 (i32*, i8*, ...) @fprintf(i32* %68, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.15, i64 0, i64 0), i32 %69)
br label %71
71: ; preds = %67
%72 = load i32, i32* %6
%73 = add i32 %72, 1
store i32 %73, i32* %6
br label %63
74: ; preds = %63
%75 = load i32*, i32** %2
%76 = call i32 (i32*, i8*, ...) @fprintf(i32* %75, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.16, i64 0, i64 0))
store i32 0, i32* %6
br label %77
77: ; preds = %105, %74
%78 = load i32, i32* %6
%79 = load i32, i32* %4
%80 = icmp ult i32 %78, %79
br i1 %80, label %81, label %108
81: ; preds = %77
store i32 0, i32* %7
br label %82
82: ; preds = %101, %81
%83 = load i32, i32* %7
%84 = load i32, i32* %5
%85 = sub i32 %84, 1
%86 = icmp ult i32 %83, %85
br i1 %86, label %87, label %104
87: ; preds = %82
%88 = load i32, i32* %5
%89 = load i32, i32* %6
%90 = mul i32 %88, %89
%91 = load i32, i32* %7
%92 = add i32 %90, %91
store i32 %92, i32* %9
%93 = load i32*, i32** %2
%94 = load i32, i32* %9
%95 = load i32, i32* %9
%96 = add nsw i32 %95, 1
%97 = load i32, i32* %9
%98 = load i32, i32* %9
%99 = add nsw i32 %98, 1
%100 = call i32 (i32*, i8*, ...) @fprintf(i32* %93, i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str.17, i64 0, i64 0), i32 %94, i32 %96, i32 %97, i32 %99)
br label %101
101: ; preds = %87
%102 = load i32, i32* %7
%103 = add i32 %102, 1
store i32 %103, i32* %7
br label %82
104: ; preds = %82
br label %105
105: ; preds = %104
%106 = load i32, i32* %6
%107 = add i32 %106, 1
store i32 %107, i32* %6
br label %77
108: ; preds = %77
store i32 0, i32* %6
br label %109
109: ; preds = %139, %108
%110 = load i32, i32* %6
%111 = load i32, i32* %4
%112 = sub i32 %111, 1
%113 = icmp ult i32 %110, %112
br i1 %113, label %114, label %142
114: ; preds = %109
store i32 0, i32* %7
br label %115
115: ; preds = %135, %114
%116 = load i32, i32* %7
%117 = load i32, i32* %5
%118 = icmp ult i32 %116, %117
br i1 %118, label %119, label %138
119: ; preds = %115
%120 = load i32, i32* %5
%121 = load i32, i32* %6
%122 = mul i32 %120, %121
%123 = load i32, i32* %7
%124 = add i32 %122, %123
store i32 %124, i32* %10
%125 = load i32*, i32** %2
%126 = load i32, i32* %10
%127 = load i32, i32* %10
%128 = load i32, i32* %5
%129 = add i32 %127, %128
%130 = load i32, i32* %10
%131 = load i32, i32* %10
%132 = load i32, i32* %5
%133 = add i32 %131, %132
%134 = call i32 (i32*, i8*, ...) @fprintf(i32* %125, i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str.17, i64 0, i64 0), i32 %126, i32 %129, i32 %130, i32 %133)
br label %135
135: ; preds = %119
%136 = load i32, i32* %7
%137 = add i32 %136, 1
store i32 %137, i32* %7
br label %115
138: ; preds = %115
br label %139
139: ; preds = %138
%140 = load i32, i32* %6
%141 = add i32 %140, 1
store i32 %141, i32* %6
br label %109
142: ; preds = %109
store i32 0, i32* %6
br label %143
143: ; preds = %154, %142
%144 = load i32, i32* %6
%145 = load i32, i32* %3
%146 = icmp ult i32 %144, %145
br i1 %146, label %147, label %157
147: ; preds = %143
%148 = load i32*, i32** %2
%149 = load i32, i32* %6
%150 = load i32, i32* %6
%151 = load i32, i32* %6
%152 = load i32, i32* %6
%153 = call i32 (i32*, i8*, ...) @fprintf(i32* %148, i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str.18, i64 0, i64 0), i32 %149, i32 %150, i32 %151, i32 %152)
br label %154
154: ; preds = %147
%155 = load i32, i32* %6
%156 = add i32 %155, 1
store i32 %156, i32* %6
br label %143
157: ; preds = %143
%158 = load i32, i32* %3
store i32 %158, i32* %6
br label %159
159: ; preds = %178, %157
%160 = load i32, i32* %6
%161 = load i32, i32* %3
%162 = load i32, i32* %8
%163 = add i32 %161, %162
%164 = icmp ult i32 %160, %163
br i1 %164, label %165, label %181
165: ; preds = %159
%166 = load i32*, i32** %2
%167 = load i32, i32* %6
%168 = load i32, i32* %8
%169 = sub i32 0, %168
%170 = load i32, i32* %6
%171 = add i32 %169, %170
%172 = load i32, i32* %6
%173 = load i32, i32* %8
%174 = sub i32 0, %173
%175 = load i32, i32* %6
%176 = add i32 %174, %175
%177 = call i32 (i32*, i8*, ...) @fprintf(i32* %166, i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str.18, i64 0, i64 0), i32 %167, i32 %171, i32 %172, i32 %176)
br label %178
178: ; preds = %165
%179 = load i32, i32* %6
%180 = add i32 %179, 1
store i32 %180, i32* %6
br label %159
181: ; preds = %159
%182 = load i32*, i32** %2
%183 = call i32 (i32*, i8*, ...) @fprintf(i32* %182, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.19, i64 0, i64 0))
store i32 0, i32* %6
br label %184
184: ; preds = %210, %181
%185 = load i32, i32* %6
%186 = load i32, i32* %3
%187 = icmp ult i32 %185, %186
br i1 %187, label %188, label %213
188: ; preds = %184
store i32 0, i32* %7
br label %189
189: ; preds = %206, %188
%190 = load i32, i32* %7
%191 = load i32, i32* %3
%192 = load i32, i32* %8
%193 = add i32 %191, %192
%194 = icmp ult i32 %190, %193
br i1 %194, label %195, label %209
195: ; preds = %189
%196 = load i32, i32* %6
%197 = load i32, i32* %7
%198 = icmp ne i32 %196, %197
br i1 %198, label %199, label %205
199: ; preds = %195
%200 = load i32*, i32** %2
%201 = load i32, i32* %6
%202 = load i32, i32* %7
%203 = load i32, i32* %6
%204 = call i32 (i32*, i8*, ...) @fprintf(i32* %200, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.20, i64 0, i64 0), i32 %201, i32 %202, i32 %203)
br label %205
205: ; preds = %199, %195
br label %206
206: ; preds = %205
%207 = load i32, i32* %7
%208 = add i32 %207, 1
store i32 %208, i32* %7
br label %189
209: ; preds = %189
br label %210
210: ; preds = %209
%211 = load i32, i32* %6
%212 = add i32 %211, 1
store i32 %212, i32* %6
br label %184
213: ; preds = %184
%214 = load i32, i32* %3
store i32 %214, i32* %6
br label %215
215: ; preds = %243, %213
%216 = load i32, i32* %6
%217 = load i32, i32* %3
%218 = load i32, i32* %8
%219 = add i32 %217, %218
%220 = icmp ult i32 %216, %219
br i1 %220, label %221, label %246
221: ; preds = %215
store i32 0, i32* %7
br label %222
222: ; preds = %239, %221
%223 = load i32, i32* %7
%224 = load i32, i32* %3
%225 = icmp ult i32 %223, %224
br i1 %225, label %226, label %242
226: ; preds = %222
%227 = load i32, i32* %6
%228 = load i32, i32* %7
%229 = icmp ne i32 %227, %228
br i1 %229, label %230, label %238
230: ; preds = %226
%231 = load i32*, i32** %2
%232 = load i32, i32* %6
%233 = load i32, i32* %7
%234 = load i32, i32* %6
%235 = load i32, i32* %8
%236 = sub i32 %234, %235
%237 = call i32 (i32*, i8*, ...) @fprintf(i32* %231, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.20, i64 0, i64 0), i32 %232, i32 %233, i32 %236)
br label %238
238: ; preds = %230, %226
br label %239
239: ; preds = %238
%240 = load i32, i32* %7
%241 = add i32 %240, 1
store i32 %241, i32* %7
br label %222
242: ; preds = %222
br label %243
243: ; preds = %242
%244 = load i32, i32* %6
%245 = add i32 %244, 1
store i32 %245, i32* %6
br label %215
246: ; preds = %215
store i32 0, i32* %6
br label %247
247: ; preds = %307, %246
%248 = load i32, i32* %6
%249 = load i32, i32* %3
%250 = icmp ult i32 %248, %249
br i1 %250, label %251, label %310
251: ; preds = %247
store i32 0, i32* %7
br label %252
252: ; preds = %303, %251
%253 = load i32, i32* %7
%254 = load i32, i32* %3
%255 = icmp ult i32 %253, %254
br i1 %255, label %256, label %306
256: ; preds = %252
%257 = load i32, i32* %6
%258 = load i32, i32* %7
%259 = icmp ne i32 %257, %258
br i1 %259, label %260, label %302
260: ; preds = %256
%261 = load i32, i32* %6
%262 = load i32, i32* %5
%263 = urem i32 %261, %262
%264 = load i32, i32* %7
%265 = load i32, i32* %5
%266 = urem i32 %264, %265
%267 = icmp ne i32 %263, %266
br i1 %267, label %268, label %283
268: ; preds = %260
%269 = load i32, i32* %6
%270 = load i32, i32* %5
%271 = urem i32 %269, %270
%272 = load i32, i32* %7
%273 = load i32, i32* %5
%274 = urem i32 %272, %273
%275 = icmp ugt i32 %271, %274
br i1 %275, label %276, label %279
276: ; preds = %268
%277 = load i32, i32* %6
%278 = sub i32 %277, 1
store i32 %278, i32* %11
br label %282
279: ; preds = %268
%280 = load i32, i32* %6
%281 = add i32 %280, 1
store i32 %281, i32* %11
br label %282
282: ; preds = %279, %276
br label %296
283: ; preds = %260
%284 = load i32, i32* %6
%285 = load i32, i32* %7
%286 = icmp ugt i32 %284, %285
br i1 %286, label %287, label %291
287: ; preds = %283
%288 = load i32, i32* %6
%289 = load i32, i32* %5
%290 = sub i32 %288, %289
store i32 %290, i32* %11
br label %295
291: ; preds = %283
%292 = load i32, i32* %6
%293 = load i32, i32* %5
%294 = add i32 %292, %293
store i32 %294, i32* %11
br label %295
295: ; preds = %291, %287
br label %296
296: ; preds = %295, %282
%297 = load i32*, i32** %2
%298 = load i32, i32* %6
%299 = load i32, i32* %7
%300 = load i32, i32* %11
%301 = call i32 (i32*, i8*, ...) @fprintf(i32* %297, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.21, i64 0, i64 0), i32 %298, i32 %299, i32 %300)
br label %302
302: ; preds = %296, %256
br label %303
303: ; preds = %302
%304 = load i32, i32* %7
%305 = add i32 %304, 1
store i32 %305, i32* %7
br label %252
306: ; preds = %252
br label %307
307: ; preds = %306
%308 = load i32, i32* %6
%309 = add i32 %308, 1
store i32 %309, i32* %6
br label %247
310: ; preds = %247
store i32 0, i32* %6
br label %311
311: ; preds = %377, %310
%312 = load i32, i32* %6
%313 = load i32, i32* %3
%314 = icmp ult i32 %312, %313
br i1 %314, label %315, label %380
315: ; preds = %311
%316 = load i32, i32* %3
store i32 %316, i32* %7
br label %317
317: ; preds = %373, %315
%318 = load i32, i32* %7
%319 = load i32, i32* %3
%320 = load i32, i32* %8
%321 = add i32 %319, %320
%322 = icmp ult i32 %318, %321
br i1 %322, label %323, label %376
323: ; preds = %317
%324 = load i32, i32* %7
%325 = load i32, i32* %8
%326 = sub i32 %324, %325
store i32 %326, i32* %12
%327 = load i32, i32* %6
%328 = load i32, i32* %12
%329 = icmp ne i32 %327, %328
br i1 %329, label %330, label %372
330: ; preds = %323
%331 = load i32, i32* %6
%332 = load i32, i32* %5
%333 = urem i32 %331, %332
%334 = load i32, i32* %12
%335 = load i32, i32* %5
%336 = urem i32 %334, %335
%337 = icmp ne i32 %333, %336
br i1 %337, label %338, label %353
338: ; preds = %330
%339 = load i32, i32* %6
%340 = load i32, i32* %5
%341 = urem i32 %339, %340
%342 = load i32, i32* %12
%343 = load i32, i32* %5
%344 = urem i32 %342, %343
%345 = icmp ugt i32 %341, %344
br i1 %345, label %346, label %349
346: ; preds = %338
%347 = load i32, i32* %6
%348 = sub i32 %347, 1
store i32 %348, i32* %13
br label %352
349: ; preds = %338
%350 = load i32, i32* %6
%351 = add i32 %350, 1
store i32 %351, i32* %13
br label %352
352: ; preds = %349, %346
br label %366
353: ; preds = %330
%354 = load i32, i32* %6
%355 = load i32, i32* %12
%356 = icmp ugt i32 %354, %355
br i1 %356, label %357, label %361
357: ; preds = %353
%358 = load i32, i32* %6
%359 = load i32, i32* %5
%360 = sub i32 %358, %359
store i32 %360, i32* %13
br label %365
361: ; preds = %353
%362 = load i32, i32* %6
%363 = load i32, i32* %5
%364 = add i32 %362, %363
store i32 %364, i32* %13
br label %365
365: ; preds = %361, %357
br label %366
366: ; preds = %365, %352
%367 = load i32*, i32** %2
%368 = load i32, i32* %6
%369 = load i32, i32* %7
%370 = load i32, i32* %13
%371 = call i32 (i32*, i8*, ...) @fprintf(i32* %367, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.21, i64 0, i64 0), i32 %368, i32 %369, i32 %370)
br label %372
372: ; preds = %366, %323
br label %373
373: ; preds = %372
%374 = load i32, i32* %7
%375 = add i32 %374, 1
store i32 %375, i32* %7
br label %317
376: ; preds = %317
br label %377
377: ; preds = %376
%378 = load i32, i32* %6
%379 = add i32 %378, 1
store i32 %379, i32* %6
br label %311
380: ; preds = %311
ret void
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.5 = [3 x i8] c"%s\00"
@.str.7 = [13 x i8] c"Fichero: %s\0A\00"
@.str.8 = [19 x i8] c"Nodos totales: %d\0A\00"
@.str.9 = [20 x i8] c"Nodos por fila: %d\0A\00"
@.str.10 = [11 x i8] c"Filas: %d\0A\00"
@.str.11 = [2 x i8] c"w\00"
@.str.12 = [139 x i8] c"[ Network.mesh ] \0A DefaultInputBufferSize = 128 \0A DefaultOutputBufferSize = 128 \0A DefaultBandwidth = 64 \0A\0A;;;;;;;;;; NODES ;;;;;;;;;; \0A\00"
@.str.13 = [45 x i8] c"\0A[ Network.mesh.Node.n%d ] \0AType = EndNode \0A\00"
@.str.14 = [30 x i8] c"\0A;;;;;;;; SWITCHES ;;;;;;;; \0A\00"
@.str.15 = [44 x i8] c"\0A[ Network.mesh.Node.s%d ] \0AType = Switch \0A\00"
@.str.16 = [27 x i8] c"\0A;;;;;;;; LINKS ;;;;;;;; \0A\00"
@.str.17 = [86 x i8] c"\0A[ Network.mesh.Link.s%ds%d ] \0A Source = s%d \0A Dest = s%d \0A Type = Bidirectional \0A\00"
@.str.18 = [86 x i8] c"\0A[ Network.mesh.Link.n%ds%d ] \0A Source = n%d \0A Dest = s%d \0A Type = Bidirectional \0A\00"
@.str.19 = [26 x i8] c"\0A[ Network.mesh.Routes ]\0A\00"
@.str.20 = [18 x i8] c"n%d.to.n%d = s%d\0A\00"
@.str.21 = [18 x i8] c"s%d.to.n%d = s%d\0A\00"
@str = [31 x i8] c"Numero de nodos en el sistema:\00"
@str.22 = [17 x i8] c"Numero de filas:\00"
@str.23 = [11 x i8] c"Numero mc:\00"
@str.24 = [44 x i8] c"Nombre del fichero de configuracion de red:\00"
@str.25 = [64 x i8] c"ERROR EL NUMERO DE NODOS NO ES DIVISIBLE POR EL NUMERO DE FILAS\00"
define void @main() {
%1 = alloca [100 x i8]
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%6 = bitcast i32* %2 to i8*
store i32 1, i32* %2
%7 = bitcast i32* %3 to i8*
store i32 1, i32* %3
%8 = bitcast i32* %4 to i8*
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.22, i64 0, i64 0))
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.23, i64 0, i64 0))
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str.24, i64 0, i64 0))
%16 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %5)
%17 = load i32, i32* %2
%18 = load i32, i32* %3
%19 = udiv i32 %17, %18
%20 = mul i32 %19, %18
%21 = icmp eq i32 %17, %20
br i1 %21, label %25, label %22
22: ; preds = %0
%23 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @str.25, i64 0, i64 0))
%24 = call i32 @exit(i32 -1)
unreachable
25: ; preds = %0
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i8* %5)
%27 = load i32, i32* %2
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0), i32 %27)
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.9, i64 0, i64 0), i32 %19)
%30 = load i32, i32* %3
%31 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0), i32 %30)
%32 = call i32* @fopen(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
%33 = call i64 @fwrite(i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str.12, i64 0, i64 0), i64 138, i64 1, i32* %32)
%34 = load i32, i32* %2
%35 = load i32, i32* %4
%36 = sub i32 0, %34
%37 = icmp eq i32 %35, %36
br i1 %37, label %46, label %38
38: ; preds = %25, %38
%39 = phi i32 [ %41, %38 ], [ 0, %25 ]
%40 = call i32 (i32*, i8*, ...) @fprintf(i32* %32, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.13, i64 0, i64 0), i32 %39)
%41 = add nuw i32 %39, 1
%42 = load i32, i32* %2
%43 = load i32, i32* %4
%44 = add i32 %43, %42
%45 = icmp ult i32 %41, %44
br i1 %45, label %38, label %46
46: ; preds = %38, %25
%47 = call i64 @fwrite(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.14, i64 0, i64 0), i64 29, i64 1, i32* %32)
%48 = load i32, i32* %2
%49 = icmp eq i32 %48, 0
br i1 %49, label %56, label %50
50: ; preds = %46, %50
%51 = phi i32 [ %53, %50 ], [ 0, %46 ]
%52 = call i32 (i32*, i8*, ...) @fprintf(i32* %32, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.15, i64 0, i64 0), i32 %51)
%53 = add nuw i32 %51, 1
%54 = load i32, i32* %2
%55 = icmp ult i32 %53, %54
br i1 %55, label %50, label %56
56: ; preds = %50, %46
%57 = call i64 @fwrite(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.16, i64 0, i64 0), i64 26, i64 1, i32* %32)
%58 = load i32, i32* %3
%59 = icmp eq i32 %58, 0
br i1 %59, label %70, label %60
60: ; preds = %56
%61 = add i32 %19, -1
%62 = icmp eq i32 %61, 0
br label %63
63: ; preds = %60, %83
%64 = phi i32 [ %58, %60 ], [ %84, %83 ]
%65 = phi i32 [ 0, %60 ], [ %85, %83 ]
br i1 %62, label %83, label %66
66: ; preds = %63
%67 = mul i32 %65, %19
br label %74
68: ; preds = %83
%69 = icmp eq i32 %84, 1
br i1 %69, label %92, label %70
70: ; preds = %56, %68
%71 = phi i32 [ %84, %68 ], [ 0, %56 ]
%72 = icmp ugt i32 %18, %17
%73 = call i32 @llvm.umax.i32(i32 %19, i32 1)
br label %87
74: ; preds = %66, %74
%75 = phi i32 [ 0, %66 ], [ %79, %74 ]
%76 = add i32 %75, %67
%77 = add nsw i32 %76, 1
%78 = call i32 (i32*, i8*, ...) @fprintf(i32* %32, i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str.17, i64 0, i64 0), i32 %76, i32 %77, i32 %76, i32 %77)
%79 = add nuw i32 %75, 1
%80 = icmp eq i32 %79, %61
br i1 %80, label %81, label %74
81: ; preds = %74
%82 = load i32, i32* %3
br label %83
83: ; preds = %81, %63
%84 = phi i32 [ %82, %81 ], [ %64, %63 ]
%85 = add nuw i32 %65, 1
%86 = icmp ult i32 %85, %84
br i1 %86, label %63, label %68
87: ; preds = %70, %104
%88 = phi i32 [ %71, %70 ], [ %105, %104 ]
%89 = phi i32 [ 0, %70 ], [ %106, %104 ]
br i1 %72, label %104, label %90
90: ; preds = %87
%91 = mul i32 %89, %19
br label %95
92: ; preds = %104, %68
%93 = load i32, i32* %2
%94 = icmp eq i32 %93, 0
br i1 %94, label %109, label %114
95: ; preds = %90, %95
%96 = phi i32 [ 0, %90 ], [ %100, %95 ]
%97 = add i32 %96, %91
%98 = add i32 %97, %19
%99 = call i32 (i32*, i8*, ...) @fprintf(i32* %32, i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str.17, i64 0, i64 0), i32 %97, i32 %98, i32 %97, i32 %98)
%100 = add nuw i32 %96, 1
%101 = icmp eq i32 %100, %73
br i1 %101, label %102, label %95
102: ; preds = %95
%103 = load i32, i32* %3
br label %104
104: ; preds = %102, %87
%105 = phi i32 [ %103, %102 ], [ %88, %87 ]
%106 = add nuw i32 %89, 1
%107 = add i32 %105, -1
%108 = icmp ult i32 %106, %107
br i1 %108, label %87, label %92
109: ; preds = %114, %92
%110 = phi i32 [ 0, %92 ], [ %118, %114 ]
%111 = load i32, i32* %4
%112 = add i32 %111, %110
%113 = icmp ult i32 %110, %112
br i1 %113, label %120, label %130
114: ; preds = %92, %114
%115 = phi i32 [ %117, %114 ], [ 0, %92 ]
%116 = call i32 (i32*, i8*, ...) @fprintf(i32* %32, i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str.18, i64 0, i64 0), i32 %115, i32 %115, i32 %115, i32 %115)
%117 = add nuw i32 %115, 1
%118 = load i32, i32* %2
%119 = icmp ult i32 %117, %118
br i1 %119, label %114, label %109
120: ; preds = %109, %120
%121 = phi i32 [ %127, %120 ], [ %111, %109 ]
%122 = phi i32 [ %125, %120 ], [ %110, %109 ]
%123 = sub i32 %122, %121
%124 = call i32 (i32*, i8*, ...) @fprintf(i32* %32, i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str.18, i64 0, i64 0), i32 %122, i32 %123, i32 %122, i32 %123)
%125 = add nuw i32 %122, 1
%126 = load i32, i32* %2
%127 = load i32, i32* %4
%128 = add i32 %127, %126
%129 = icmp ult i32 %125, %128
br i1 %129, label %120, label %130
130: ; preds = %120, %109
%131 = call i64 @fwrite(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.19, i64 0, i64 0), i64 25, i64 1, i32* %32)
%132 = load i32, i32* %2
%133 = icmp eq i32 %132, 0
%134 = load i32, i32* %4
br i1 %133, label %142, label %135
135: ; preds = %130, %164
%136 = phi i32 [ %165, %164 ], [ %132, %130 ]
%137 = phi i32 [ %166, %164 ], [ %134, %130 ]
%138 = phi i32 [ %167, %164 ], [ %134, %130 ]
%139 = phi i32 [ %168, %164 ], [ 0, %130 ]
%140 = sub i32 0, %136
%141 = icmp eq i32 %138, %140
br i1 %141, label %164, label %147
142: ; preds = %164, %130
%143 = phi i32 [ %134, %130 ], [ %166, %164 ]
%144 = phi i32 [ 0, %130 ], [ %165, %164 ]
%145 = add i32 %143, %144
%146 = icmp ult i32 %144, %145
br i1 %146, label %170, label %175
147: ; preds = %135, %157
%148 = phi i32 [ %158, %157 ], [ %136, %135 ]
%149 = phi i32 [ %159, %157 ], [ %137, %135 ]
%150 = phi i32 [ %160, %157 ], [ %136, %135 ]
%151 = phi i32 [ %161, %157 ], [ 0, %135 ]
%152 = icmp eq i32 %139, %151
br i1 %152, label %157, label %153
153: ; preds = %147
%154 = call i32 (i32*, i8*, ...) @fprintf(i32* %32, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.20, i64 0, i64 0), i32 %139, i32 %151, i32 %139)
%155 = load i32, i32* %2
%156 = load i32, i32* %4
br label %157
157: ; preds = %147, %153
%158 = phi i32 [ %148, %147 ], [ %155, %153 ]
%159 = phi i32 [ %149, %147 ], [ %156, %153 ]
%160 = phi i32 [ %150, %147 ], [ %155, %153 ]
%161 = add nuw i32 %151, 1
%162 = add i32 %159, %160
%163 = icmp ult i32 %161, %162
br i1 %163, label %147, label %164
164: ; preds = %157, %135
%165 = phi i32 [ %136, %135 ], [ %158, %157 ]
%166 = phi i32 [ %137, %135 ], [ %159, %157 ]
%167 = phi i32 [ %138, %135 ], [ %159, %157 ]
%168 = add nuw i32 %139, 1
%169 = icmp ult i32 %168, %165
br i1 %169, label %135, label %142
170: ; preds = %142, %197
%171 = phi i32 [ %198, %197 ], [ %143, %142 ]
%172 = phi i32 [ %199, %197 ], [ %144, %142 ]
%173 = phi i32 [ %200, %197 ], [ %144, %142 ]
%174 = icmp eq i32 %172, 0
br i1 %174, label %197, label %180
175: ; preds = %197, %142
%176 = phi i32 [ %144, %142 ], [ %199, %197 ]
%177 = icmp eq i32 %176, 0
br i1 %177, label %277, label %178
178: ; preds = %175
%179 = sub i32 0, %19
br label %203
180: ; preds = %170, %190
%181 = phi i32 [ %191, %190 ], [ %172, %170 ]
%182 = phi i32 [ %192, %190 ], [ %172, %170 ]
%183 = phi i32 [ %193, %190 ], [ 0, %170 ]
%184 = icmp eq i32 %173, %183
br i1 %184, label %190, label %185
185: ; preds = %180
%186 = load i32, i32* %4
%187 = sub i32 %173, %186
%188 = call i32 (i32*, i8*, ...) @fprintf(i32* %32, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.20, i64 0, i64 0), i32 %173, i32 %183, i32 %187)
%189 = load i32, i32* %2
br label %190
190: ; preds = %180, %185
%191 = phi i32 [ %181, %180 ], [ %189, %185 ]
%192 = phi i32 [ %182, %180 ], [ %189, %185 ]
%193 = add nuw i32 %183, 1
%194 = icmp ult i32 %193, %192
br i1 %194, label %180, label %195
195: ; preds = %190
%196 = load i32, i32* %4
br label %197
197: ; preds = %195, %170
%198 = phi i32 [ %196, %195 ], [ %171, %170 ]
%199 = phi i32 [ %191, %195 ], [ 0, %170 ]
%200 = add nuw i32 %173, 1
%201 = add i32 %198, %199
%202 = icmp ult i32 %200, %201
br i1 %202, label %170, label %175
203: ; preds = %233, %178
%204 = phi i32 [ %229, %233 ], [ %176, %178 ]
%205 = phi i32 [ %234, %233 ], [ 0, %178 ]
br label %211
206: ; preds = %233
%207 = icmp eq i32 %229, 0
br i1 %207, label %277, label %208
208: ; preds = %206
%209 = load i32, i32* %4
%210 = sub i32 0, %19
br label %236
211: ; preds = %203, %228
%212 = phi i32 [ %204, %203 ], [ %229, %228 ]
%213 = phi i32 [ %204, %203 ], [ %230, %228 ]
%214 = phi i32 [ 0, %203 ], [ %231, %228 ]
%215 = icmp eq i32 %205, %214
br i1 %215, label %228, label %216
216: ; preds = %211
%217 = urem i32 %205, %19
%218 = urem i32 %214, %19
%219 = icmp eq i32 %217, %218
%220 = icmp ugt i32 %217, %218
%221 = select i1 %220, i32 -1, i32 1
%222 = icmp ugt i32 %205, %214
%223 = select i1 %222, i32 %179, i32 %19
%224 = select i1 %219, i32 %223, i32 %221
%225 = add i32 %205, %224
%226 = call i32 (i32*, i8*, ...) @fprintf(i32* %32, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.21, i64 0, i64 0), i32 %205, i32 %214, i32 %225)
%227 = load i32, i32* %2
br label %228
228: ; preds = %216, %211
%229 = phi i32 [ %227, %216 ], [ %212, %211 ]
%230 = phi i32 [ %227, %216 ], [ %213, %211 ]
%231 = add nuw i32 %214, 1
%232 = icmp ult i32 %231, %230
br i1 %232, label %211, label %233
233: ; preds = %228
%234 = add nuw i32 %205, 1
%235 = icmp ult i32 %234, %229
br i1 %235, label %203, label %206
236: ; preds = %208, %271
%237 = phi i32 [ %272, %271 ], [ %229, %208 ]
%238 = phi i32 [ %273, %271 ], [ %209, %208 ]
%239 = phi i32 [ %274, %271 ], [ %209, %208 ]
%240 = phi i32 [ %275, %271 ], [ 0, %208 ]
%241 = add i32 %239, %237
%242 = icmp ult i32 %237, %241
br i1 %242, label %243, label %271
243: ; preds = %236, %264
%244 = phi i32 [ %265, %264 ], [ %237, %236 ]
%245 = phi i32 [ %266, %264 ], [ %238, %236 ]
%246 = phi i32 [ %267, %264 ], [ %237, %236 ]
%247 = phi i32 [ %266, %264 ], [ %239, %236 ]
%248 = phi i32 [ %268, %264 ], [ %237, %236 ]
%249 = sub i32 %248, %247
%250 = icmp eq i32 %240, %249
br i1 %250, label %264, label %251
251: ; preds = %243
%252 = urem i32 %240, %19
%253 = urem i32 %249, %19
%254 = icmp eq i32 %252, %253
%255 = icmp ugt i32 %252, %253
%256 = select i1 %255, i32 -1, i32 1
%257 = icmp ugt i32 %240, %249
%258 = select i1 %257, i32 %210, i32 %19
%259 = select i1 %254, i32 %258, i32 %256
%260 = add i32 %240, %259
%261 = call i32 (i32*, i8*, ...) @fprintf(i32* %32, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.21, i64 0, i64 0), i32 %240, i32 %248, i32 %260)
%262 = load i32, i32* %2
%263 = load i32, i32* %4
br label %264
264: ; preds = %251, %243
%265 = phi i32 [ %262, %251 ], [ %244, %243 ]
%266 = phi i32 [ %263, %251 ], [ %245, %243 ]
%267 = phi i32 [ %262, %251 ], [ %246, %243 ]
%268 = add nuw i32 %248, 1
%269 = add i32 %266, %267
%270 = icmp ult i32 %268, %269
br i1 %270, label %243, label %271
271: ; preds = %264, %236
%272 = phi i32 [ %237, %236 ], [ %265, %264 ]
%273 = phi i32 [ %238, %236 ], [ %266, %264 ]
%274 = phi i32 [ %239, %236 ], [ %266, %264 ]
%275 = add nuw i32 %240, 1
%276 = icmp ult i32 %275, %272
br i1 %276, label %236, label %277
277: ; preds = %271, %175, %206
ret void
}