#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*/ getch();
int /*<<< orphan*/ printf(char *, ...);
int rand();
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  int campominado[10][10];
  int jogadas[10][10];
  int codigo, bombas, i, j, rodadas, rodada, vidas, sorteiobombas, a, b;
  srand(time(NULL));
  rodadas = 1;
  for (j = 0; j < 10; j++) {
    for (i = 0; i < 10; i++) {
      campominado[i][j] = 0;
      jogadas[i][j] = 0;
    }
  }
  printf("===========================================\n\tHabilitar "
         "Trapaca?\n\t|- Digite 1 para ATIVAR\n\t|- Digite 0 para "
         "CONTINUAR\n===========================================\n");
  scanf("%d", &codigo);
  while ((codigo != 1) && (codigo != 0)) {
    printf("\n[ATENCAO]\tOpcao invalida!\n\t|- Digite 1 para ATIVAR\n\t|- "
           "Digite 0 para CONTINUAR\n");
    scanf("%d", &codigo);
  }
  printf("Vamos jogar campo minado em um campo 10x10?\nDigite quantas bombas "
         "terao [De 1 (Facil) ate 99 (Impossivel)]:\n");
  scanf("%d", &bombas);
  sorteiobombas = 1;
  while (bombas < 1) {
    printf("Tem que ter pelo menos uma bomba, se nao nao e um Campo "
           "Minado!\nDigite um valor de bombas valido (ate 99)\n");
    scanf("%d", &bombas);
  }
  while (bombas > 99) {
    printf("O campo tem 100 quadrados, voce nao quer ganhar?\nDigite um numero "
           "menor que 99 e maior que 1 para as bombas\n");
    scanf("%d", &bombas);
  }
  if ((bombas <= 99) && (bombas >= 75)) {
    rodada = 100 - bombas;
    printf("Voce escolheu %d bombas e acaba de entrar no MODO DIFICIL!\nVoce "
           "tera %d rodadas para completar o jogo.\n(Sem choro!)\n",
           bombas, rodada);
  } else {
    printf("Voce escolheu %d bombas e entrou no MODO FACIL do jogo!\nDigite "
           "quantas rodadas voce deseja para completar o jogo.\n",
           bombas);
    scanf("%d", &rodada);
  }
  printf("Quantas vidas voce deseja ter?\n");
  scanf("%d", &vidas);
  if (vidas == 1) {
    printf("Desculpa ai Senhor Perfeito!\nBoa sorte com sua unica vida.\n");
  }
  printf("\n\n");
  printf("Voce esta preparado?!\n Vamos JOGAR!\n\n");
  while (sorteiobombas <= bombas) {
    i = rand() % 10;
    j = rand() % 10;
    if (campominado[i][j] == 0) {
      campominado[i][j] = 1;
      sorteiobombas++;
    }
  }
  while (vidas > 0 && rodada > 0) {
    printf("Digite uma linha [De 0 a 9]\n");
    scanf("%d", &a);
    while ((a < 0) || (a > 9)) {
      printf("Digite um valor valido para a linha [De 0 a 9]\n");
      scanf("%d", &a);
    }
    printf("Digite uma coluna [De 0 a 9]\n");
    scanf("%d", &b);
    while ((b < 0) || (b > 9)) {
      printf("Digite um valor valido para a coluna [De 0 a 9]\n");
      scanf("%d", &b);
    }
    while (jogadas[a][b] == 1) {
      printf("\n[ATENCAO]\tVoce ja fez essa jogada!\n");
      printf("Digite uma linha [De 0 a 9]\n");
      scanf("%d", &a);
      while ((a < 0) || (a > 9)) {
        printf("Digite um valor valido para a linha [De 0 a 9]\n\n");
        scanf("%d", &a);
      }
      printf("Digite uma coluna [De 0 a 9]\n");
      scanf("%d", &b);
      while ((b < 0) || (b > 9)) {
        printf("Digite um valor valido para a coluna [De 0 a 9]\n");
        scanf("%d", &b);
      }
    }
    if (campominado[a][b] == 1) {
      campominado[a][b] = 2;
      vidas--;
    } else {
      campominado[a][b] = 3;
    }
    jogadas[a][b] = 1;
    printf("\n\n----- Rodada: %d -----\n", rodadas);
    for (i = 0; i < 10; i++) {
      for (j = 0; j < 10; j++) {
        if (codigo && campominado[i][j] == 1) {
          printf("[B]\t");
        } else if (campominado[i][j] == 2) {
          printf("[X]\t");
        } else if (campominado[i][j] == 3) {
          printf("[O]\t");
        } else {
          printf("[ ]\t");
        }
      }
      printf("\n");
    }
    rodada = rodada - 1;
    if (campominado[a][b] == 2) {
      printf("Voce acertou uma BOMBA! [-1 VIDA]\nVoce ainda tem: %d vidas\nLhe "
             "restam %d jogadas\n\n",
             vidas, rodada);
    } else {
      printf("UFA, ali nao tinha bomba!\nContinue assim por mais %d jogadas "
             "que voce ganha!\n\n",
             rodada);
    }
    rodadas++;
  }
  if (vidas == 0) {
    printf("Que pena, suas vidas acabaram!\nTente novamente outra hora.\[Tente "
           "diminuir a dificuldade tambem]\n");
  } else if (rodada == 0) {
    printf("AE! Parabens! Voce ganhou!!! (Musica de vitoria)\nObrigado por "
           "jogar.\t~~~~\n");
  }
  getch();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x360,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
movl   $0x1,-0x344(%rbp)
movl   $0x0,-0x340(%rbp)
cmpl   $0xa,-0x340(%rbp)
jge    122d <main+0xcd>
movl   $0x0,-0x33c(%rbp)
cmpl   $0xa,-0x33c(%rbp)
jge    1214 <main+0xb4>
movslq -0x33c(%rbp),%rcx
lea    -0x1a0(%rbp),%rax
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
movslq -0x340(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
movslq -0x33c(%rbp),%rcx
lea    -0x330(%rbp),%rax
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
movslq -0x340(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x33c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x33c(%rbp)
jmp    11ad <main+0x4d>
jmp    1219 <main+0xb9>
mov    -0x340(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x340(%rbp)
jmp    1196 <main+0x36>
lea    0xdcc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe60(%rip),%rdi
lea    -0x334(%rbp),%rsi
call   1060 <scanf@plt>
xor    %eax,%eax
cmpl   $0x1,-0x334(%rbp)
mov    %al,-0x359(%rbp)
je     1273 <main+0x113>
cmpl   $0x0,-0x334(%rbp)
setne  %al
mov    %al,-0x359(%rbp)
mov    -0x359(%rbp),%al
test   $0x1,%al
jne    1286 <main+0x126>
jmp    12ac <main+0x14c>
lea    0xe18(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe07(%rip),%rdi
lea    -0x334(%rbp),%rsi
call   1060 <scanf@plt>
jmp    124e <main+0xee>
lea    0xe43(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xde1(%rip),%rdi
lea    -0x338(%rbp),%rsi
call   1060 <scanf@plt>
movl   $0x1,-0x350(%rbp)
cmpl   $0x1,-0x338(%rbp)
jge    130a <main+0x1aa>
lea    0xe78(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xda9(%rip),%rdi
lea    -0x338(%rbp),%rsi
call   1060 <scanf@plt>
jmp    12d7 <main+0x177>
jmp    130f <main+0x1af>
cmpl   $0x63,-0x338(%rbp)
jle    1342 <main+0x1e2>
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xd71(%rip),%rdi
lea    -0x338(%rbp),%rsi
call   1060 <scanf@plt>
jmp    130f <main+0x1af>
cmpl   $0x63,-0x338(%rbp)
jg     138c <main+0x22c>
cmpl   $0x4b,-0x338(%rbp)
jl     138c <main+0x22c>
mov    $0x64,%eax
sub    -0x338(%rbp),%eax
mov    %eax,-0x348(%rbp)
mov    -0x338(%rbp),%esi
mov    -0x348(%rbp),%edx
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    13b3 <main+0x253>
mov    -0x338(%rbp),%esi
lea    0xf17(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xcfb(%rip),%rdi
lea    -0x348(%rbp),%rsi
call   1060 <scanf@plt>
lea    0xf69(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xcda(%rip),%rdi
lea    -0x34c(%rbp),%rsi
call   1060 <scanf@plt>
cmpl   $0x1,-0x34c(%rbp)
jne    13ef <main+0x28f>
lea    0xf5b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xfac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf7b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x350(%rbp),%eax
cmp    -0x338(%rbp),%eax
jg     14a4 <main+0x344>
mov    $0x0,%al
call   1080 <rand@plt>
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x33c(%rbp)
mov    $0x0,%al
call   1080 <rand@plt>
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x340(%rbp)
movslq -0x33c(%rbp),%rcx
lea    -0x1a0(%rbp),%rax
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
movslq -0x340(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jne    149f <main+0x33f>
movslq -0x33c(%rbp),%rcx
lea    -0x1a0(%rbp),%rax
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
movslq -0x340(%rbp),%rcx
movl   $0x1,(%rax,%rcx,4)
mov    -0x350(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x350(%rbp)
jmp    140b <main+0x2ab>
jmp    14a9 <main+0x349>
xor    %eax,%eax
cmpl   $0x0,-0x34c(%rbp)
mov    %al,-0x35a(%rbp)
jle    14ce <main+0x36e>
cmpl   $0x0,-0x348(%rbp)
setg   %al
mov    %al,-0x35a(%rbp)
mov    -0x35a(%rbp),%al
test   $0x1,%al
jne    14e1 <main+0x381>
jmp    1987 <main+0x827>
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xbac(%rip),%rdi
lea    -0x354(%rbp),%rsi
call   1060 <scanf@plt>
mov    $0x1,%al
cmpl   $0x0,-0x354(%rbp)
mov    %al,-0x35b(%rbp)
jl     1527 <main+0x3c7>
cmpl   $0x9,-0x354(%rbp)
setg   %al
mov    %al,-0x35b(%rbp)
mov    -0x35b(%rbp),%al
test   $0x1,%al
jne    153a <main+0x3da>
jmp    1560 <main+0x400>
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xb53(%rip),%rdi
lea    -0x354(%rbp),%rsi
call   1060 <scanf@plt>
jmp    1502 <main+0x3a2>
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xb2d(%rip),%rdi
lea    -0x358(%rbp),%rsi
call   1060 <scanf@plt>
mov    $0x1,%al
cmpl   $0x0,-0x358(%rbp)
mov    %al,-0x35c(%rbp)
jl     15a6 <main+0x446>
cmpl   $0x9,-0x358(%rbp)
setg   %al
mov    %al,-0x35c(%rbp)
mov    -0x35c(%rbp),%al
test   $0x1,%al
jne    15b9 <main+0x459>
jmp    15df <main+0x47f>
lea    0xe50(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xad4(%rip),%rdi
lea    -0x358(%rbp),%rsi
call   1060 <scanf@plt>
jmp    1581 <main+0x421>
jmp    15e4 <main+0x484>
movslq -0x354(%rbp),%rcx
lea    -0x330(%rbp),%rax
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
movslq -0x358(%rbp),%rcx
cmpl   $0x1,(%rax,%rcx,4)
jne    171b <main+0x5bb>
lea    0xe30(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xd86(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xa75(%rip),%rdi
lea    -0x354(%rbp),%rsi
call   1060 <scanf@plt>
mov    $0x1,%al
cmpl   $0x0,-0x354(%rbp)
mov    %al,-0x35d(%rbp)
jl     165e <main+0x4fe>
cmpl   $0x9,-0x354(%rbp)
setg   %al
mov    %al,-0x35d(%rbp)
mov    -0x35d(%rbp),%al
test   $0x1,%al
jne    1671 <main+0x511>
jmp    1697 <main+0x537>
lea    0xdee(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xa1c(%rip),%rdi
lea    -0x354(%rbp),%rsi
call   1060 <scanf@plt>
jmp    1639 <main+0x4d9>
lea    0xd54(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x9f6(%rip),%rdi
lea    -0x358(%rbp),%rsi
call   1060 <scanf@plt>
mov    $0x1,%al
cmpl   $0x0,-0x358(%rbp)
mov    %al,-0x35e(%rbp)
jl     16dd <main+0x57d>
cmpl   $0x9,-0x358(%rbp)
setg   %al
mov    %al,-0x35e(%rbp)
mov    -0x35e(%rbp),%al
test   $0x1,%al
jne    16f0 <main+0x590>
jmp    1716 <main+0x5b6>
lea    0xd19(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x99d(%rip),%rdi
lea    -0x358(%rbp),%rsi
call   1060 <scanf@plt>
jmp    16b8 <main+0x558>
jmp    15e4 <main+0x484>
movslq -0x354(%rbp),%rcx
lea    -0x1a0(%rbp),%rax
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
movslq -0x358(%rbp),%rcx
cmpl   $0x1,(%rax,%rcx,4)
jne    1778 <main+0x618>
movslq -0x354(%rbp),%rcx
lea    -0x1a0(%rbp),%rax
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
movslq -0x358(%rbp),%rcx
movl   $0x2,(%rax,%rcx,4)
mov    -0x34c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x34c(%rbp)
jmp    179b <main+0x63b>
movslq -0x354(%rbp),%rcx
lea    -0x1a0(%rbp),%rax
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
movslq -0x358(%rbp),%rcx
movl   $0x3,(%rax,%rcx,4)
movslq -0x354(%rbp),%rcx
lea    -0x330(%rbp),%rax
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
movslq -0x358(%rbp),%rcx
movl   $0x1,(%rax,%rcx,4)
mov    -0x344(%rbp),%esi
lea    0xccc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x33c(%rbp)
cmpl   $0xa,-0x33c(%rbp)
jge    190b <main+0x7ab>
movl   $0x0,-0x340(%rbp)
cmpl   $0xa,-0x340(%rbp)
jge    18e9 <main+0x789>
cmpl   $0x0,-0x334(%rbp)
je     1846 <main+0x6e6>
movslq -0x33c(%rbp),%rcx
lea    -0x1a0(%rbp),%rax
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
movslq -0x340(%rbp),%rcx
cmpl   $0x1,(%rax,%rcx,4)
jne    1846 <main+0x6e6>
lea    0xc77(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    18d0 <main+0x770>
movslq -0x33c(%rbp),%rcx
lea    -0x1a0(%rbp),%rax
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
movslq -0x340(%rbp),%rcx
cmpl   $0x2,(%rax,%rcx,4)
jne    187f <main+0x71f>
lea    0xc43(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    18cb <main+0x76b>
movslq -0x33c(%rbp),%rcx
lea    -0x1a0(%rbp),%rax
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
movslq -0x340(%rbp),%rcx
cmpl   $0x3,(%rax,%rcx,4)
jne    18b8 <main+0x758>
lea    0xc0f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    18c6 <main+0x766>
lea    0xc01(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    18cb <main+0x76b>
jmp    18d0 <main+0x770>
jmp    18d5 <main+0x775>
mov    -0x340(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x340(%rbp)
jmp    17f3 <main+0x693>
lea    0xab3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x33c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x33c(%rbp)
jmp    17dc <main+0x67c>
mov    -0x348(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x348(%rbp)
movslq -0x354(%rbp),%rcx
lea    -0x1a0(%rbp),%rax
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
movslq -0x358(%rbp),%rcx
cmpl   $0x2,(%rax,%rcx,4)
jne    195f <main+0x7ff>
mov    -0x34c(%rbp),%esi
mov    -0x348(%rbp),%edx
lea    0xb72(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1973 <main+0x813>
mov    -0x348(%rbp),%esi
lea    0xbac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x344(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x344(%rbp)
jmp    14a9 <main+0x349>
cmpl   $0x0,-0x34c(%rbp)
jne    19a7 <main+0x847>
lea    0xbcc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    19c7 <main+0x867>
cmpl   $0x0,-0x348(%rbp)
jne    19c2 <main+0x862>
lea    0xc0d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    19c7 <main+0x867>
mov    $0x0,%al
call   1070 <getch@plt>
xor    %eax,%eax
add    $0x360,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x348,%rsp
xor    %edi,%edi
call   1080 <time@plt>
mov    %eax,%edi
call   1070 <srand@plt>
lea    0x20(%rsp),%rdi
mov    $0x190,%edx
xor    %esi,%esi
call   1060 <memset@plt>
lea    0x1b0(%rsp),%rdi
mov    $0x190,%edx
xor    %esi,%esi
call   1060 <memset@plt>
lea    0xfe0(%rip),%rdi
call   1040 <puts@plt>
lea    0xe19(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1090 <scanf@plt>
cmpl   $0x2,0x4(%rsp)
jb     122a <main+0x9a>
lea    0x13b4(%rip),%r14
lea    0xdfa(%rip),%rbp
lea    0x4(%rsp),%rbx
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1040 <puts@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1090 <scanf@plt>
cmpl   $0x1,0x4(%rsp)
ja     1210 <main+0x80>
lea    0x102b(%rip),%rdi
call   1040 <puts@plt>
lea    0xdc3(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1090 <scanf@plt>
mov    0xc(%rsp),%esi
test   %esi,%esi
jg     128b <main+0xfb>
lea    0x12f3(%rip),%r14
lea    0xda3(%rip),%rbp
lea    0xc(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
call   1040 <puts@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1090 <scanf@plt>
mov    0xc(%rsp),%esi
test   %esi,%esi
jle    1270 <main+0xe0>
cmp    $0x64,%esi
jb     12cc <main+0x13c>
lea    0x1246(%rip),%r14
lea    0xd62(%rip),%rbp
lea    0xc(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
call   1040 <puts@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1090 <scanf@plt>
mov    0xc(%rsp),%esi
cmp    $0x63,%esi
jg     12b0 <main+0x120>
cmp    $0x4b,%esi
jl     12ec <main+0x15c>
mov    $0x64,%edx
sub    %esi,%edx
mov    %edx,0x18(%rsp)
lea    0xd20(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    130b <main+0x17b>
lea    0xd85(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xcff(%rip),%rdi
lea    0x18(%rsp),%rsi
call   1090 <scanf@plt>
lea    0xfb6(%rip),%rdi
call   1040 <puts@plt>
lea    0xce2(%rip),%rdi
lea    0x14(%rsp),%rsi
call   1090 <scanf@plt>
cmpl   $0x1,0x14(%rsp)
jne    133b <main+0x1ab>
lea    0x116c(%rip),%rdi
call   1040 <puts@plt>
lea    0xe77(%rip),%rdi
call   1040 <puts@plt>
lea    0xf99(%rip),%rdi
call   1040 <puts@plt>
cmpl   $0x0,0xc(%rsp)
jle    13e5 <main+0x255>
mov    $0x1,%ebx
jmp    1376 <main+0x1e6>
cs nopw 0x0(%rax,%rax,1)
nop
cmp    0xc(%rsp),%ebx
jg     13e5 <main+0x255>
xor    %eax,%eax
call   10b0 <rand@plt>
movslq %eax,%rbp
imul   $0x66666667,%rbp,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%ebp
xor    %eax,%eax
call   10b0 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
movslq %ebp,%rcx
cltq
lea    (%rcx,%rcx,4),%rcx
lea    (%rsp,%rcx,8),%rcx
add    $0x20,%rcx
cmpl   $0x0,(%rcx,%rax,4)
jne    1370 <main+0x1e0>
lea    (%rcx,%rax,4),%rax
movl   $0x1,(%rax)
add    $0x1,%ebx
jmp    1370 <main+0x1e0>
mov    0x14(%rsp),%eax
mov    0x18(%rsp),%ecx
test   %eax,%eax
jle    1872 <main+0x6e2>
test   %ecx,%ecx
jle    1872 <main+0x6e2>
mov    $0x1,%edx
lea    0xbf7(%rip),%r12
lea    0x1063(%rip),%rbx
lea    0xcfd(%rip),%r15
lea    0xce7(%rip),%r13
xchg   %ax,%ax
mov    %edx,0x1c(%rsp)
lea    0xfaf(%rip),%rdi
call   1040 <puts@plt>
mov    %r12,%rdi
lea    0x8(%rsp),%r14
mov    %r14,%rsi
call   1090 <scanf@plt>
cmpl   $0xa,0x8(%rsp)
jb     146a <main+0x2da>
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    %r12,%rdi
mov    %r14,%rsi
call   1090 <scanf@plt>
cmpl   $0x9,0x8(%rsp)
ja     1450 <main+0x2c0>
lea    0xf85(%rip),%rdi
call   1040 <puts@plt>
mov    %r12,%rdi
lea    0x10(%rsp),%r14
mov    %r14,%rsi
call   1090 <scanf@plt>
mov    0x10(%rsp),%eax
cmp    $0xa,%eax
lea    0xfaf(%rip),%rbx
jb     157c <main+0x3ec>
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    %r12,%rdi
mov    %r14,%rsi
call   1090 <scanf@plt>
mov    0x10(%rsp),%eax
cmp    $0x9,%eax
ja     14a0 <main+0x310>
jmp    157c <main+0x3ec>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    0xedf(%rip),%rdi
call   1040 <puts@plt>
lea    0xef7(%rip),%rdi
call   1040 <puts@plt>
mov    %r12,%rdi
lea    0x8(%rsp),%rbx
mov    %rbx,%rsi
call   1090 <scanf@plt>
cmpl   $0xa,0x8(%rsp)
lea    0xf0f(%rip),%rbp
jb     152a <main+0x39a>
cs nopw 0x0(%rax,%rax,1)
mov    %rbp,%rdi
call   1040 <puts@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1090 <scanf@plt>
cmpl   $0x9,0x8(%rsp)
ja     1510 <main+0x380>
lea    0xec5(%rip),%rdi
call   1040 <puts@plt>
mov    %r12,%rdi
lea    0x10(%rsp),%rbx
mov    %rbx,%rsi
call   1090 <scanf@plt>
mov    0x10(%rsp),%eax
cmp    $0xa,%eax
lea    0xeef(%rip),%r14
jb     157c <main+0x3ec>
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1040 <puts@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1090 <scanf@plt>
mov    0x10(%rsp),%eax
cmp    $0x9,%eax
ja     1560 <main+0x3d0>
movslq 0x8(%rsp),%rcx
mov    %eax,%eax
lea    (%rcx,%rcx,4),%rdx
lea    (%rsp,%rdx,8),%rdx
add    $0x1b0,%rdx
cmpl   $0x1,(%rdx,%rax,4)
je     14d0 <main+0x340>
lea    (%rdx,%rax,4),%rdx
lea    (%rcx,%rcx,4),%rcx
lea    (%rsp,%rcx,8),%rsi
add    $0x20,%rsi
lea    (%rsi,%rax,4),%rcx
cmpl   $0x1,(%rsi,%rax,4)
lea    0xb54(%rip),%rbp
jne    15d0 <main+0x440>
movl   $0x2,(%rcx)
addl   $0xffffffff,0x14(%rsp)
jmp    15d6 <main+0x446>
nopw   0x0(%rax,%rax,1)
movl   $0x3,(%rcx)
mov    0x1c(%rsp),%esi
movl   $0x1,(%rdx)
lea    0xb04(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x24,%r14d
lea    0xb0f(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    -0x4(%rsp,%r14,1),%eax
cmp    $0x3,%eax
mov    %r15,%rcx
cmove  %rbp,%rcx
cmp    $0x2,%eax
cmove  %rbx,%rcx
cmp    $0x1,%eax
mov    %rcx,%rdi
cmove  %r13,%rdi
cmpl   $0x0,0x4(%rsp)
cmove  %rcx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    (%rsp,%r14,1),%eax
cmp    $0x3,%eax
mov    %r15,%rcx
cmove  %rbp,%rcx
cmp    $0x2,%eax
cmove  %rbx,%rcx
cmp    $0x1,%eax
mov    %rcx,%rdi
cmove  %r13,%rdi
cmpl   $0x0,0x4(%rsp)
cmove  %rcx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x4(%rsp,%r14,1),%eax
cmp    $0x3,%eax
mov    %r15,%rcx
cmove  %rbp,%rcx
cmp    $0x2,%eax
cmove  %rbx,%rcx
cmp    $0x1,%eax
mov    %rcx,%rdi
cmove  %r13,%rdi
cmpl   $0x0,0x4(%rsp)
cmove  %rcx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x8(%rsp,%r14,1),%eax
cmp    $0x3,%eax
mov    %r15,%rcx
cmove  %rbp,%rcx
cmp    $0x2,%eax
cmove  %rbx,%rcx
cmp    $0x1,%eax
mov    %rcx,%rdi
cmove  %r13,%rdi
cmpl   $0x0,0x4(%rsp)
cmove  %rcx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0xc(%rsp,%r14,1),%eax
cmp    $0x3,%eax
mov    %r15,%rcx
cmove  %rbp,%rcx
cmp    $0x2,%eax
cmove  %rbx,%rcx
cmp    $0x1,%eax
mov    %rcx,%rdi
cmove  %r13,%rdi
cmpl   $0x0,0x4(%rsp)
cmove  %rcx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x10(%rsp,%r14,1),%eax
cmp    $0x3,%eax
mov    %r15,%rcx
cmove  %rbp,%rcx
cmp    $0x2,%eax
cmove  %rbx,%rcx
cmp    $0x1,%eax
mov    %rcx,%rdi
cmove  %r13,%rdi
cmpl   $0x0,0x4(%rsp)
cmove  %rcx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x14(%rsp,%r14,1),%eax
cmp    $0x3,%eax
mov    %r15,%rcx
cmove  %rbp,%rcx
cmp    $0x2,%eax
cmove  %rbx,%rcx
cmp    $0x1,%eax
mov    %rcx,%rdi
cmove  %r13,%rdi
cmpl   $0x0,0x4(%rsp)
cmove  %rcx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x18(%rsp,%r14,1),%eax
cmp    $0x3,%eax
mov    %r15,%rcx
cmove  %rbp,%rcx
cmp    $0x2,%eax
cmove  %rbx,%rcx
cmp    $0x1,%eax
mov    %rcx,%rdi
cmove  %r13,%rdi
cmpl   $0x0,0x4(%rsp)
cmove  %rcx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x1c(%rsp,%r14,1),%eax
cmp    $0x3,%eax
mov    %r15,%rcx
cmove  %rbp,%rcx
cmp    $0x2,%eax
cmove  %rbx,%rcx
cmp    $0x1,%eax
mov    %rcx,%rdi
cmove  %r13,%rdi
cmpl   $0x0,0x4(%rsp)
cmove  %rcx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x20(%rsp,%r14,1),%eax
cmp    $0x3,%eax
mov    %r15,%rcx
cmove  %rbp,%rcx
cmp    $0x2,%eax
cmove  %rbx,%rcx
cmp    $0x1,%eax
mov    %rcx,%rdi
cmove  %r13,%rdi
cmpl   $0x0,0x4(%rsp)
cmove  %rcx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x28,%r14
cmp    $0x1b4,%r14
jne    1600 <main+0x470>
mov    0x18(%rsp),%edx
add    $0xffffffff,%edx
mov    %edx,0x18(%rsp)
movslq 0x8(%rsp),%rax
movslq 0x10(%rsp),%rcx
lea    (%rax,%rax,4),%rax
lea    (%rsp,%rax,8),%rax
add    $0x20,%rax
cmpl   $0x2,(%rax,%rcx,4)
jne    1840 <main+0x6b0>
mov    0x14(%rsp),%esi
lea    0x8ed(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    1850 <main+0x6c0>
cs nopw 0x0(%rax,%rax,1)
nop
lea    0x925(%rip),%rdi
mov    %edx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x1c(%rsp),%edx
lea    0xc18(%rip),%rbx
mov    0x14(%rsp),%eax
mov    0x18(%rsp),%ecx
test   %eax,%eax
jle    1872 <main+0x6e2>
add    $0x1,%edx
test   %ecx,%ecx
jg     1420 <main+0x290>
test   %eax,%eax
je     1883 <main+0x6f3>
test   %ecx,%ecx
jne    188f <main+0x6ff>
lea    0xa8b(%rip),%rdi
jmp    188a <main+0x6fa>
lea    0xacc(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   10a0 <getch@plt>
xor    %eax,%eax
add    $0x348,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [162 x i8] c"===========================================\0A\09Habilitar Trapaca?\0A\09|- Digite 1 para ATIVAR\0A\09|- Digite 0 para CONTINUAR\0A===========================================\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [81 x i8] c"\0A[ATENCAO]\09Opcao invalida!\0A\09|- Digite 1 para ATIVAR\0A\09|- Digite 0 para CONTINUAR\0A\00"
@.str.3 = [109 x i8] c"Vamos jogar campo minado em um campo 10x10?\0ADigite quantas bombas terao [De 1 (Facil) ate 99 (Impossivel)]:\0A\00"
@.str.4 = [107 x i8] c"Tem que ter pelo menos uma bomba, se nao nao e um Campo Minado!\0ADigite um valor de bombas valido (ate 99)\0A\00"
@.str.5 = [109 x i8] c"O campo tem 100 quadrados, voce nao quer ganhar?\0ADigite um numero menor que 99 e maior que 1 para as bombas\0A\00"
@.str.6 = [117 x i8] c"Voce escolheu %d bombas e acaba de entrar no MODO DIFICIL!\0AVoce tera %d rodadas para completar o jogo.\0A(Sem choro!)\0A\00"
@.str.7 = [115 x i8] c"Voce escolheu %d bombas e entrou no MODO FACIL do jogo!\0ADigite quantas rodadas voce deseja para completar o jogo.\0A\00"
@.str.8 = [32 x i8] c"Quantas vidas voce deseja ter?\0A\00"
@.str.9 = [60 x i8] c"Desculpa ai Senhor Perfeito!\0ABoa sorte com sua unica vida.\0A\00"
@.str.10 = [3 x i8] c"\0A\0A\00"
@.str.11 = [38 x i8] c"Voce esta preparado?!\0A Vamos JOGAR!\0A\0A\00"
@.str.12 = [29 x i8] c"Digite uma linha [De 0 a 9]\0A\00"
@.str.13 = [48 x i8] c"Digite um valor valido para a linha [De 0 a 9]\0A\00"
@.str.14 = [30 x i8] c"Digite uma coluna [De 0 a 9]\0A\00"
@.str.15 = [49 x i8] c"Digite um valor valido para a coluna [De 0 a 9]\0A\00"
@.str.16 = [37 x i8] c"\0A[ATENCAO]\09Voce ja fez essa jogada!\0A\00"
@.str.17 = [49 x i8] c"Digite um valor valido para a linha [De 0 a 9]\0A\0A\00"
@.str.18 = [26 x i8] c"\0A\0A----- Rodada: %d -----\0A\00"
@.str.19 = [5 x i8] c"[B]\09\00"
@.str.20 = [5 x i8] c"[X]\09\00"
@.str.21 = [5 x i8] c"[O]\09\00"
@.str.22 = [5 x i8] c"[ ]\09\00"
@.str.23 = [2 x i8] c"\0A\00"
@.str.24 = [83 x i8] c"Voce acertou uma BOMBA! [-1 VIDA]\0AVoce ainda tem: %d vidas\0ALhe restam %d jogadas\0A\0A\00"
@.str.25 = [79 x i8] c"UFA, ali nao tinha bomba!\0AContinue assim por mais %d jogadas que voce ganha!\0A\0A\00"
@.str.26 = [97 x i8] c"Que pena, suas vidas acabaram!\0ATente novamente outra hora.[Tente diminuir a dificuldade tambem]\0A\00"
@.str.27 = [75 x i8] c"AE! Parabens! Voce ganhou!!! (Musica de vitoria)\0AObrigado por jogar.\09~~~~\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x [10 x i32]]
%3 = alloca [10 x [10 x 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 0, i32* %1
%14 = call i32 @time(i32* null)
%15 = call i32 @srand(i32 %14)
store i32 1, i32* %8
store i32 0, i32* %7
br label %16
16: ; preds = %40, %0
%17 = load i32, i32* %7
%18 = icmp slt i32 %17, 10
br i1 %18, label %19, label %43
19: ; preds = %16
store i32 0, i32* %6
br label %20
20: ; preds = %36, %19
%21 = load i32, i32* %6
%22 = icmp slt i32 %21, 10
br i1 %22, label %23, label %39
23: ; preds = %20
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %2, i64 0, i64 %25
%27 = load i32, i32* %7
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [10 x i32], [10 x i32]* %26, i64 0, i64 %28
store i32 0, i32* %29
%30 = load i32, i32* %6
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %3, i64 0, i64 %31
%33 = load i32, i32* %7
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [10 x i32], [10 x i32]* %32, i64 0, i64 %34
store i32 0, i32* %35
br label %36
36: ; preds = %23
%37 = load i32, i32* %6
%38 = add nsw i32 %37, 1
store i32 %38, i32* %6
br label %20
39: ; preds = %20
br label %40
40: ; preds = %39
%41 = load i32, i32* %7
%42 = add nsw i32 %41, 1
store i32 %42, i32* %7
br label %16
43: ; preds = %16
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0))
%45 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
br label %46
46: ; preds = %54, %43
%47 = load i32, i32* %4
%48 = icmp ne i32 %47, 1
br i1 %48, label %49, label %52
49: ; preds = %46
%50 = load i32, i32* %4
%51 = icmp ne i32 %50, 0
br label %52
52: ; preds = %49, %46
%53 = phi i1 [ false, %46 ], [ %51, %49 ]
br i1 %53, label %54, label %57
54: ; preds = %52
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.2, i64 0, i64 0))
%56 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
br label %46
57: ; preds = %52
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([109 x i8], [109 x i8]* @.str.3, i64 0, i64 0))
%59 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %5)
store i32 1, i32* %11
br label %60
60: ; preds = %63, %57
%61 = load i32, i32* %5
%62 = icmp slt i32 %61, 1
br i1 %62, label %63, label %66
63: ; preds = %60
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([107 x i8], [107 x i8]* @.str.4, i64 0, i64 0))
%65 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %5)
br label %60
66: ; preds = %60
br label %67
67: ; preds = %70, %66
%68 = load i32, i32* %5
%69 = icmp sgt i32 %68, 99
br i1 %69, label %70, label %73
70: ; preds = %67
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([109 x i8], [109 x i8]* @.str.5, i64 0, i64 0))
%72 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %5)
br label %67
73: ; preds = %67
%74 = load i32, i32* %5
%75 = icmp sle i32 %74, 99
br i1 %75, label %76, label %85
76: ; preds = %73
%77 = load i32, i32* %5
%78 = icmp sge i32 %77, 75
br i1 %78, label %79, label %85
79: ; preds = %76
%80 = load i32, i32* %5
%81 = sub nsw i32 100, %80
store i32 %81, i32* %9
%82 = load i32, i32* %5
%83 = load i32, i32* %9
%84 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([117 x i8], [117 x i8]* @.str.6, i64 0, i64 0), i32 %82, i32 %83)
br label %89
85: ; preds = %76, %73
%86 = load i32, i32* %5
%87 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([115 x i8], [115 x i8]* @.str.7, i64 0, i64 0), i32 %86)
%88 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %9)
br label %89
89: ; preds = %85, %79
%90 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.8, i64 0, i64 0))
%91 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %10)
%92 = load i32, i32* %10
%93 = icmp eq i32 %92, 1
br i1 %93, label %94, label %96
94: ; preds = %89
%95 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.9, i64 0, i64 0))
br label %96
96: ; preds = %94, %89
%97 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
%98 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.11, i64 0, i64 0))
br label %99
99: ; preds = %125, %96
%100 = load i32, i32* %11
%101 = load i32, i32* %5
%102 = icmp sle i32 %100, %101
br i1 %102, label %103, label %126
103: ; preds = %99
%104 = call i32 (...) @rand()
%105 = srem i32 %104, 10
store i32 %105, i32* %6
%106 = call i32 (...) @rand()
%107 = srem i32 %106, 10
store i32 %107, i32* %7
%108 = load i32, i32* %6
%109 = sext i32 %108 to i64
%110 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %2, i64 0, i64 %109
%111 = load i32, i32* %7
%112 = sext i32 %111 to i64
%113 = getelementptr inbounds [10 x i32], [10 x i32]* %110, i64 0, i64 %112
%114 = load i32, i32* %113
%115 = icmp eq i32 %114, 0
br i1 %115, label %116, label %125
116: ; preds = %103
%117 = load i32, i32* %6
%118 = sext i32 %117 to i64
%119 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %2, i64 0, i64 %118
%120 = load i32, i32* %7
%121 = sext i32 %120 to i64
%122 = getelementptr inbounds [10 x i32], [10 x i32]* %119, i64 0, i64 %121
store i32 1, i32* %122
%123 = load i32, i32* %11
%124 = add nsw i32 %123, 1
store i32 %124, i32* %11
br label %125
125: ; preds = %116, %103
br label %99
126: ; preds = %99
br label %127
127: ; preds = %311, %126
%128 = load i32, i32* %10
%129 = icmp sgt i32 %128, 0
br i1 %129, label %130, label %133
130: ; preds = %127
%131 = load i32, i32* %9
%132 = icmp sgt i32 %131, 0
br label %133
133: ; preds = %130, %127
%134 = phi i1 [ false, %127 ], [ %132, %130 ]
br i1 %134, label %135, label %314
135: ; preds = %133
%136 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.12, i64 0, i64 0))
%137 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %12)
br label %138
138: ; preds = %146, %135
%139 = load i32, i32* %12
%140 = icmp slt i32 %139, 0
br i1 %140, label %144, label %141
141: ; preds = %138
%142 = load i32, i32* %12
%143 = icmp sgt i32 %142, 9
br label %144
144: ; preds = %141, %138
%145 = phi i1 [ true, %138 ], [ %143, %141 ]
br i1 %145, label %146, label %149
146: ; preds = %144
%147 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.13, i64 0, i64 0))
%148 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %12)
br label %138
149: ; preds = %144
%150 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.14, i64 0, i64 0))
%151 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %13)
br label %152
152: ; preds = %160, %149
%153 = load i32, i32* %13
%154 = icmp slt i32 %153, 0
br i1 %154, label %158, label %155
155: ; preds = %152
%156 = load i32, i32* %13
%157 = icmp sgt i32 %156, 9
br label %158
158: ; preds = %155, %152
%159 = phi i1 [ true, %152 ], [ %157, %155 ]
br i1 %159, label %160, label %163
160: ; preds = %158
%161 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.15, i64 0, i64 0))
%162 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %13)
br label %152
163: ; preds = %158
br label %164
164: ; preds = %202, %163
%165 = load i32, i32* %12
%166 = sext i32 %165 to i64
%167 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %3, i64 0, i64 %166
%168 = load i32, i32* %13
%169 = sext i32 %168 to i64
%170 = getelementptr inbounds [10 x i32], [10 x i32]* %167, i64 0, i64 %169
%171 = load i32, i32* %170
%172 = icmp eq i32 %171, 1
br i1 %172, label %173, label %203
173: ; preds = %164
%174 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.16, i64 0, i64 0))
%175 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.12, i64 0, i64 0))
%176 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %12)
br label %177
177: ; preds = %185, %173
%178 = load i32, i32* %12
%179 = icmp slt i32 %178, 0
br i1 %179, label %183, label %180
180: ; preds = %177
%181 = load i32, i32* %12
%182 = icmp sgt i32 %181, 9
br label %183
183: ; preds = %180, %177
%184 = phi i1 [ true, %177 ], [ %182, %180 ]
br i1 %184, label %185, label %188
185: ; preds = %183
%186 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.17, i64 0, i64 0))
%187 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %12)
br label %177
188: ; preds = %183
%189 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.14, i64 0, i64 0))
%190 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %13)
br label %191
191: ; preds = %199, %188
%192 = load i32, i32* %13
%193 = icmp slt i32 %192, 0
br i1 %193, label %197, label %194
194: ; preds = %191
%195 = load i32, i32* %13
%196 = icmp sgt i32 %195, 9
br label %197
197: ; preds = %194, %191
%198 = phi i1 [ true, %191 ], [ %196, %194 ]
br i1 %198, label %199, label %202
199: ; preds = %197
%200 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.15, i64 0, i64 0))
%201 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %13)
br label %191
202: ; preds = %197
br label %164
203: ; preds = %164
%204 = load i32, i32* %12
%205 = sext i32 %204 to i64
%206 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %2, i64 0, i64 %205
%207 = load i32, i32* %13
%208 = sext i32 %207 to i64
%209 = getelementptr inbounds [10 x i32], [10 x i32]* %206, i64 0, i64 %208
%210 = load i32, i32* %209
%211 = icmp eq i32 %210, 1
br i1 %211, label %212, label %221
212: ; preds = %203
%213 = load i32, i32* %12
%214 = sext i32 %213 to i64
%215 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %2, i64 0, i64 %214
%216 = load i32, i32* %13
%217 = sext i32 %216 to i64
%218 = getelementptr inbounds [10 x i32], [10 x i32]* %215, i64 0, i64 %217
store i32 2, i32* %218
%219 = load i32, i32* %10
%220 = add nsw i32 %219, -1
store i32 %220, i32* %10
br label %228
221: ; preds = %203
%222 = load i32, i32* %12
%223 = sext i32 %222 to i64
%224 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %2, i64 0, i64 %223
%225 = load i32, i32* %13
%226 = sext i32 %225 to i64
%227 = getelementptr inbounds [10 x i32], [10 x i32]* %224, i64 0, i64 %226
store i32 3, i32* %227
br label %228
228: ; preds = %221, %212
%229 = load i32, i32* %12
%230 = sext i32 %229 to i64
%231 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %3, i64 0, i64 %230
%232 = load i32, i32* %13
%233 = sext i32 %232 to i64
%234 = getelementptr inbounds [10 x i32], [10 x i32]* %231, i64 0, i64 %233
store i32 1, i32* %234
%235 = load i32, i32* %8
%236 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.18, i64 0, i64 0), i32 %235)
store i32 0, i32* %6
br label %237
237: ; preds = %290, %228
%238 = load i32, i32* %6
%239 = icmp slt i32 %238, 10
br i1 %239, label %240, label %293
240: ; preds = %237
store i32 0, i32* %7
br label %241
241: ; preds = %285, %240
%242 = load i32, i32* %7
%243 = icmp slt i32 %242, 10
br i1 %243, label %244, label %288
244: ; preds = %241
%245 = load i32, i32* %4
%246 = icmp ne i32 %245, 0
br i1 %246, label %247, label %258
247: ; preds = %244
%248 = load i32, i32* %6
%249 = sext i32 %248 to i64
%250 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %2, i64 0, i64 %249
%251 = load i32, i32* %7
%252 = sext i32 %251 to i64
%253 = getelementptr inbounds [10 x i32], [10 x i32]* %250, i64 0, i64 %252
%254 = load i32, i32* %253
%255 = icmp eq i32 %254, 1
br i1 %255, label %256, label %258
256: ; preds = %247
%257 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.19, i64 0, i64 0))
br label %284
258: ; preds = %247, %244
%259 = load i32, i32* %6
%260 = sext i32 %259 to i64
%261 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %2, i64 0, i64 %260
%262 = load i32, i32* %7
%263 = sext i32 %262 to i64
%264 = getelementptr inbounds [10 x i32], [10 x i32]* %261, i64 0, i64 %263
%265 = load i32, i32* %264
%266 = icmp eq i32 %265, 2
br i1 %266, label %267, label %269
267: ; preds = %258
%268 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.20, i64 0, i64 0))
br label %283
269: ; preds = %258
%270 = load i32, i32* %6
%271 = sext i32 %270 to i64
%272 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %2, i64 0, i64 %271
%273 = load i32, i32* %7
%274 = sext i32 %273 to i64
%275 = getelementptr inbounds [10 x i32], [10 x i32]* %272, i64 0, i64 %274
%276 = load i32, i32* %275
%277 = icmp eq i32 %276, 3
br i1 %277, label %278, label %280
278: ; preds = %269
%279 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.21, i64 0, i64 0))
br label %282
280: ; preds = %269
%281 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.22, i64 0, i64 0))
br label %282
282: ; preds = %280, %278
br label %283
283: ; preds = %282, %267
br label %284
284: ; preds = %283, %256
br label %285
285: ; preds = %284
%286 = load i32, i32* %7
%287 = add nsw i32 %286, 1
store i32 %287, i32* %7
br label %241
288: ; preds = %241
%289 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.23, i64 0, i64 0))
br label %290
290: ; preds = %288
%291 = load i32, i32* %6
%292 = add nsw i32 %291, 1
store i32 %292, i32* %6
br label %237
293: ; preds = %237
%294 = load i32, i32* %9
%295 = sub nsw i32 %294, 1
store i32 %295, i32* %9
%296 = load i32, i32* %12
%297 = sext i32 %296 to i64
%298 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %2, i64 0, i64 %297
%299 = load i32, i32* %13
%300 = sext i32 %299 to i64
%301 = getelementptr inbounds [10 x i32], [10 x i32]* %298, i64 0, i64 %300
%302 = load i32, i32* %301
%303 = icmp eq i32 %302, 2
br i1 %303, label %304, label %308
304: ; preds = %293
%305 = load i32, i32* %10
%306 = load i32, i32* %9
%307 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str.24, i64 0, i64 0), i32 %305, i32 %306)
br label %311
308: ; preds = %293
%309 = load i32, i32* %9
%310 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.25, i64 0, i64 0), i32 %309)
br label %311
311: ; preds = %308, %304
%312 = load i32, i32* %8
%313 = add nsw i32 %312, 1
store i32 %313, i32* %8
br label %127
314: ; preds = %133
%315 = load i32, i32* %10
%316 = icmp eq i32 %315, 0
br i1 %316, label %317, label %319
317: ; preds = %314
%318 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([97 x i8], [97 x i8]* @.str.26, i64 0, i64 0))
br label %325
319: ; preds = %314
%320 = load i32, i32* %9
%321 = icmp eq i32 %320, 0
br i1 %321, label %322, label %324
322: ; preds = %319
%323 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.27, i64 0, i64 0))
br label %324
324: ; preds = %322, %319
br label %325
325: ; preds = %324, %317
%326 = call i32 (...) @getch()
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.6 = [117 x i8] c"Voce escolheu %d bombas e acaba de entrar no MODO DIFICIL!\0AVoce tera %d rodadas para completar o jogo.\0A(Sem choro!)\0A\00"
@.str.7 = [115 x i8] c"Voce escolheu %d bombas e entrou no MODO FACIL do jogo!\0ADigite quantas rodadas voce deseja para completar o jogo.\0A\00"
@.str.18 = [26 x i8] c"\0A\0A----- Rodada: %d -----\0A\00"
@.str.19 = [5 x i8] c"[B]\09\00"
@.str.20 = [5 x i8] c"[X]\09\00"
@.str.21 = [5 x i8] c"[O]\09\00"
@.str.22 = [5 x i8] c"[ ]\09\00"
@.str.24 = [83 x i8] c"Voce acertou uma BOMBA! [-1 VIDA]\0AVoce ainda tem: %d vidas\0ALhe restam %d jogadas\0A\0A\00"
@.str.25 = [79 x i8] c"UFA, ali nao tinha bomba!\0AContinue assim por mais %d jogadas que voce ganha!\0A\0A\00"
@str = [161 x i8] c"===========================================\0A\09Habilitar Trapaca?\0A\09|- Digite 1 para ATIVAR\0A\09|- Digite 0 para CONTINUAR\0A===========================================\00"
@str.28 = [108 x i8] c"Vamos jogar campo minado em um campo 10x10?\0ADigite quantas bombas terao [De 1 (Facil) ate 99 (Impossivel)]:\00"
@str.29 = [31 x i8] c"Quantas vidas voce deseja ter?\00"
@str.30 = [2 x i8] c"\0A\00"
@str.31 = [37 x i8] c"Voce esta preparado?!\0A Vamos JOGAR!\0A\00"
@str.32 = [74 x i8] c"AE! Parabens! Voce ganhou!!! (Musica de vitoria)\0AObrigado por jogar.\09~~~~\00"
@str.33 = [96 x i8] c"Que pena, suas vidas acabaram!\0ATente novamente outra hora.[Tente diminuir a dificuldade tambem]\00"
@str.36 = [36 x i8] c"\0A[ATENCAO]\09Voce ja fez essa jogada!\00"
@str.37 = [28 x i8] c"Digite uma linha [De 0 a 9]\00"
@str.38 = [29 x i8] c"Digite uma coluna [De 0 a 9]\00"
@str.40 = [48 x i8] c"Digite um valor valido para a linha [De 0 a 9]\0A\00"
@str.41 = [48 x i8] c"Digite um valor valido para a coluna [De 0 a 9]\00"
@str.42 = [47 x i8] c"Digite um valor valido para a linha [De 0 a 9]\00"
@str.43 = [59 x i8] c"Desculpa ai Senhor Perfeito!\0ABoa sorte com sua unica vida.\00"
@str.44 = [108 x i8] c"O campo tem 100 quadrados, voce nao quer ganhar?\0ADigite um numero menor que 99 e maior que 1 para as bombas\00"
@str.45 = [106 x i8] c"Tem que ter pelo menos uma bomba, se nao nao e um Campo Minado!\0ADigite um valor de bombas valido (ate 99)\00"
@str.46 = [80 x i8] c"\0A[ATENCAO]\09Opcao invalida!\0A\09|- Digite 1 para ATIVAR\0A\09|- Digite 0 para CONTINUAR\00"
define i32 @main() {
%1 = alloca [10 x [10 x i32]]
%2 = bitcast [10 x [10 x i32]]* %1 to i8*
%3 = alloca [10 x [10 x i32]]
%4 = bitcast [10 x [10 x i32]]* %3 to i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = bitcast i32* %5 to i8*
%12 = bitcast i32* %6 to i8*
%13 = bitcast i32* %7 to i8*
%14 = bitcast i32* %8 to i8*
%15 = bitcast i32* %9 to i8*
%16 = bitcast i32* %10 to i8*
%17 = tail call i32 @time(i32* null)
%18 = tail call i32 @srand(i32 %17)
%19 = bitcast [10 x [10 x i32]]* %1 to i8*
%20 = bitcast [10 x [10 x i32]]* %3 to i8*
%21 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([161 x i8], [161 x i8]* @str, i64 0, i64 0))
%22 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%23 = load i32, i32* %5
%24 = icmp ult i32 %23, 2
br i1 %24, label %30, label %25
25: ; preds = %0, %25
%26 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([80 x i8], [80 x i8]* @str.46, i64 0, i64 0))
%27 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%28 = load i32, i32* %5
%29 = icmp ult i32 %28, 2
br i1 %29, label %30, label %25
30: ; preds = %25, %0
%31 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([108 x i8], [108 x i8]* @str.28, i64 0, i64 0))
%32 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%33 = load i32, i32* %6
%34 = icmp slt i32 %33, 1
br i1 %34, label %38, label %35
35: ; preds = %38, %30
%36 = phi i32 [ %33, %30 ], [ %41, %38 ]
%37 = icmp ugt i32 %36, 99
br i1 %37, label %43, label %48
38: ; preds = %30, %38
%39 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([106 x i8], [106 x i8]* @str.45, i64 0, i64 0))
%40 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%41 = load i32, i32* %6
%42 = icmp slt i32 %41, 1
br i1 %42, label %38, label %35
43: ; preds = %35, %43
%44 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([108 x i8], [108 x i8]* @str.44, i64 0, i64 0))
%45 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%46 = load i32, i32* %6
%47 = icmp sgt i32 %46, 99
br i1 %47, label %43, label %48
48: ; preds = %43, %35
%49 = phi i32 [ %36, %35 ], [ %46, %43 ]
%50 = icmp sgt i32 %49, 74
br i1 %50, label %51, label %54
51: ; preds = %48
%52 = sub nuw nsw i32 100, %49
store i32 %52, i32* %7
%53 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([117 x i8], [117 x i8]* @.str.6, i64 0, i64 0), i32 %49, i32 %52)
br label %57
54: ; preds = %48
%55 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([115 x i8], [115 x i8]* @.str.7, i64 0, i64 0), i32 %49)
%56 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %7)
br label %57
57: ; preds = %54, %51
%58 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.29, i64 0, i64 0))
%59 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %8)
%60 = load i32, i32* %8
%61 = icmp eq i32 %60, 1
br i1 %61, label %62, label %64
62: ; preds = %57
%63 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str.43, i64 0, i64 0))
br label %64
64: ; preds = %62, %57
%65 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.30, i64 0, i64 0))
%66 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.31, i64 0, i64 0))
%67 = load i32, i32* %6
%68 = icmp slt i32 %67, 1
br i1 %68, label %69, label %75
69: ; preds = %88, %64
%70 = load i32, i32* %8
%71 = icmp sgt i32 %70, 0
%72 = load i32, i32* %7
%73 = icmp sgt i32 %72, 0
%74 = select i1 %71, i1 %73, i1 false
br i1 %74, label %92, label %313
75: ; preds = %64, %88
%76 = phi i32 [ %89, %88 ], [ 1, %64 ]
%77 = call i32 (...) @rand()
%78 = srem i32 %77, 10
%79 = call i32 (...) @rand()
%80 = srem i32 %79, 10
%81 = sext i32 %78 to i64
%82 = sext i32 %80 to i64
%83 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %1, i64 0, i64 %81, i64 %82
%84 = load i32, i32* %83
%85 = icmp eq i32 %84, 0
br i1 %85, label %86, label %88
86: ; preds = %75
store i32 1, i32* %83
%87 = add nsw i32 %76, 1
br label %88
88: ; preds = %86, %75
%89 = phi i32 [ %87, %86 ], [ %76, %75 ]
%90 = load i32, i32* %6
%91 = icmp sgt i32 %89, %90
br i1 %91, label %69, label %75
92: ; preds = %69, %306
%93 = phi i32 [ %307, %306 ], [ 1, %69 ]
%94 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.37, i64 0, i64 0))
%95 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %9)
%96 = load i32, i32* %9
%97 = icmp ugt i32 %96, 9
br i1 %97, label %98, label %103
98: ; preds = %92, %98
%99 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str.42, i64 0, i64 0))
%100 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %9)
%101 = load i32, i32* %9
%102 = icmp ugt i32 %101, 9
br i1 %102, label %98, label %103
103: ; preds = %98, %92
%104 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.38, i64 0, i64 0))
%105 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %10)
%106 = load i32, i32* %10
%107 = icmp ugt i32 %106, 9
br i1 %107, label %116, label %108
108: ; preds = %116, %103
%109 = phi i32 [ %106, %103 ], [ %119, %116 ]
%110 = load i32, i32* %9
%111 = sext i32 %110 to i64
%112 = zext i32 %109 to i64
%113 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %3, i64 0, i64 %111, i64 %112
%114 = load i32, i32* %113
%115 = icmp eq i32 %114, 1
br i1 %115, label %129, label %153
116: ; preds = %103, %116
%117 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.41, i64 0, i64 0))
%118 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %10)
%119 = load i32, i32* %10
%120 = icmp ugt i32 %119, 9
br i1 %120, label %116, label %108
121: ; preds = %145, %140
%122 = phi i32 [ %143, %140 ], [ %148, %145 ]
%123 = load i32, i32* %9
%124 = sext i32 %123 to i64
%125 = zext i32 %122 to i64
%126 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %3, i64 0, i64 %124, i64 %125
%127 = load i32, i32* %126
%128 = icmp eq i32 %127, 1
br i1 %128, label %129, label %150
129: ; preds = %108, %121
%130 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.36, i64 0, i64 0))
%131 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.37, i64 0, i64 0))
%132 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %9)
%133 = load i32, i32* %9
%134 = icmp ugt i32 %133, 9
br i1 %134, label %135, label %140
135: ; preds = %129, %135
%136 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.40, i64 0, i64 0))
%137 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %9)
%138 = load i32, i32* %9
%139 = icmp ugt i32 %138, 9
br i1 %139, label %135, label %140
140: ; preds = %135, %129
%141 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.38, i64 0, i64 0))
%142 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %10)
%143 = load i32, i32* %10
%144 = icmp ugt i32 %143, 9
br i1 %144, label %145, label %121
145: ; preds = %140, %145
%146 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.41, i64 0, i64 0))
%147 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %10)
%148 = load i32, i32* %10
%149 = icmp ugt i32 %148, 9
br i1 %149, label %145, label %121
150: ; preds = %121
%151 = sext i32 %123 to i64
%152 = zext i32 %122 to i64
br label %153
153: ; preds = %150, %108
%154 = phi i64 [ %112, %108 ], [ %152, %150 ]
%155 = phi i64 [ %111, %108 ], [ %151, %150 ]
%156 = phi i32* [ %113, %108 ], [ %126, %150 ]
%157 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %1, i64 0, i64 %155, i64 %154
%158 = load i32, i32* %157
%159 = icmp eq i32 %158, 1
br i1 %159, label %160, label %163
160: ; preds = %153
store i32 2, i32* %157
%161 = load i32, i32* %8
%162 = add nsw i32 %161, -1
store i32 %162, i32* %8
br label %164
163: ; preds = %153
store i32 3, i32* %157
br label %164
164: ; preds = %163, %160
store i32 1, i32* %156
%165 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.18, i64 0, i64 0), i32 %93)
br label %166
166: ; preds = %164, %166
%167 = phi i64 [ 0, %164 ], [ %289, %166 ]
%168 = load i32, i32* %5
%169 = icmp ne i32 %168, 0
%170 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %1, i64 0, i64 %167, i64 0
%171 = load i32, i32* %170
%172 = icmp eq i32 %171, 1
%173 = select i1 %169, i1 %172, i1 false
%174 = icmp eq i32 %171, 3
%175 = select i1 %174, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.21, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.22, i64 0, i64 0)
%176 = icmp eq i32 %171, 2
%177 = select i1 %176, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.20, i64 0, i64 0), i8* %175
%178 = select i1 %173, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.19, i64 0, i64 0), i8* %177
%179 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %178)
%180 = load i32, i32* %5
%181 = icmp ne i32 %180, 0
%182 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %1, i64 0, i64 %167, i64 1
%183 = load i32, i32* %182
%184 = icmp eq i32 %183, 1
%185 = select i1 %181, i1 %184, i1 false
%186 = icmp eq i32 %183, 3
%187 = select i1 %186, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.21, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.22, i64 0, i64 0)
%188 = icmp eq i32 %183, 2
%189 = select i1 %188, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.20, i64 0, i64 0), i8* %187
%190 = select i1 %185, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.19, i64 0, i64 0), i8* %189
%191 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %190)
%192 = load i32, i32* %5
%193 = icmp ne i32 %192, 0
%194 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %1, i64 0, i64 %167, i64 2
%195 = load i32, i32* %194
%196 = icmp eq i32 %195, 1
%197 = select i1 %193, i1 %196, i1 false
%198 = icmp eq i32 %195, 3
%199 = select i1 %198, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.21, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.22, i64 0, i64 0)
%200 = icmp eq i32 %195, 2
%201 = select i1 %200, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.20, i64 0, i64 0), i8* %199
%202 = select i1 %197, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.19, i64 0, i64 0), i8* %201
%203 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %202)
%204 = load i32, i32* %5
%205 = icmp ne i32 %204, 0
%206 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %1, i64 0, i64 %167, i64 3
%207 = load i32, i32* %206
%208 = icmp eq i32 %207, 1
%209 = select i1 %205, i1 %208, i1 false
%210 = icmp eq i32 %207, 3
%211 = select i1 %210, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.21, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.22, i64 0, i64 0)
%212 = icmp eq i32 %207, 2
%213 = select i1 %212, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.20, i64 0, i64 0), i8* %211
%214 = select i1 %209, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.19, i64 0, i64 0), i8* %213
%215 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %214)
%216 = load i32, i32* %5
%217 = icmp ne i32 %216, 0
%218 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %1, i64 0, i64 %167, i64 4
%219 = load i32, i32* %218
%220 = icmp eq i32 %219, 1
%221 = select i1 %217, i1 %220, i1 false
%222 = icmp eq i32 %219, 3
%223 = select i1 %222, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.21, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.22, i64 0, i64 0)
%224 = icmp eq i32 %219, 2
%225 = select i1 %224, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.20, i64 0, i64 0), i8* %223
%226 = select i1 %221, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.19, i64 0, i64 0), i8* %225
%227 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %226)
%228 = load i32, i32* %5
%229 = icmp ne i32 %228, 0
%230 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %1, i64 0, i64 %167, i64 5
%231 = load i32, i32* %230
%232 = icmp eq i32 %231, 1
%233 = select i1 %229, i1 %232, i1 false
%234 = icmp eq i32 %231, 3
%235 = select i1 %234, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.21, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.22, i64 0, i64 0)
%236 = icmp eq i32 %231, 2
%237 = select i1 %236, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.20, i64 0, i64 0), i8* %235
%238 = select i1 %233, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.19, i64 0, i64 0), i8* %237
%239 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %238)
%240 = load i32, i32* %5
%241 = icmp ne i32 %240, 0
%242 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %1, i64 0, i64 %167, i64 6
%243 = load i32, i32* %242
%244 = icmp eq i32 %243, 1
%245 = select i1 %241, i1 %244, i1 false
%246 = icmp eq i32 %243, 3
%247 = select i1 %246, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.21, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.22, i64 0, i64 0)
%248 = icmp eq i32 %243, 2
%249 = select i1 %248, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.20, i64 0, i64 0), i8* %247
%250 = select i1 %245, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.19, i64 0, i64 0), i8* %249
%251 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %250)
%252 = load i32, i32* %5
%253 = icmp ne i32 %252, 0
%254 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %1, i64 0, i64 %167, i64 7
%255 = load i32, i32* %254
%256 = icmp eq i32 %255, 1
%257 = select i1 %253, i1 %256, i1 false
%258 = icmp eq i32 %255, 3
%259 = select i1 %258, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.21, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.22, i64 0, i64 0)
%260 = icmp eq i32 %255, 2
%261 = select i1 %260, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.20, i64 0, i64 0), i8* %259
%262 = select i1 %257, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.19, i64 0, i64 0), i8* %261
%263 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %262)
%264 = load i32, i32* %5
%265 = icmp ne i32 %264, 0
%266 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %1, i64 0, i64 %167, i64 8
%267 = load i32, i32* %266
%268 = icmp eq i32 %267, 1
%269 = select i1 %265, i1 %268, i1 false
%270 = icmp eq i32 %267, 3
%271 = select i1 %270, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.21, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.22, i64 0, i64 0)
%272 = icmp eq i32 %267, 2
%273 = select i1 %272, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.20, i64 0, i64 0), i8* %271
%274 = select i1 %269, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.19, i64 0, i64 0), i8* %273
%275 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %274)
%276 = load i32, i32* %5
%277 = icmp ne i32 %276, 0
%278 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %1, i64 0, i64 %167, i64 9
%279 = load i32, i32* %278
%280 = icmp eq i32 %279, 1
%281 = select i1 %277, i1 %280, i1 false
%282 = icmp eq i32 %279, 3
%283 = select i1 %282, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.21, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.22, i64 0, i64 0)
%284 = icmp eq i32 %279, 2
%285 = select i1 %284, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.20, i64 0, i64 0), i8* %283
%286 = select i1 %281, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.19, i64 0, i64 0), i8* %285
%287 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %286)
%288 = call i32 @putchar(i32 10)
%289 = add nuw nsw i64 %167, 1
%290 = icmp eq i64 %289, 10
br i1 %290, label %291, label %166
291: ; preds = %166
%292 = load i32, i32* %7
%293 = add nsw i32 %292, -1
store i32 %293, i32* %7
%294 = load i32, i32* %9
%295 = sext i32 %294 to i64
%296 = load i32, i32* %10
%297 = sext i32 %296 to i64
%298 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %1, i64 0, i64 %295, i64 %297
%299 = load i32, i32* %298
%300 = icmp eq i32 %299, 2
br i1 %300, label %301, label %304
301: ; preds = %291
%302 = load i32, i32* %8
%303 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([83 x i8], [83 x i8]* @.str.24, i64 0, i64 0), i32 %302, i32 %293)
br label %306
304: ; preds = %291
%305 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([79 x i8], [79 x i8]* @.str.25, i64 0, i64 0), i32 %293)
br label %306
306: ; preds = %304, %301
%307 = add nuw nsw i32 %93, 1
%308 = load i32, i32* %8
%309 = icmp sgt i32 %308, 0
%310 = load i32, i32* %7
%311 = icmp sgt i32 %310, 0
%312 = select i1 %309, i1 %311, i1 false
br i1 %312, label %92, label %313
313: ; preds = %306, %69
%314 = phi i32 [ %70, %69 ], [ %308, %306 ]
%315 = phi i32 [ %72, %69 ], [ %310, %306 ]
%316 = icmp eq i32 %314, 0
br i1 %316, label %319, label %317
317: ; preds = %313
%318 = icmp eq i32 %315, 0
br i1 %318, label %319, label %322
319: ; preds = %317, %313
%320 = phi i8* [ getelementptr inbounds ([96 x i8], [96 x i8]* @str.33, i64 0, i64 0), %313 ], [ getelementptr inbounds ([74 x i8], [74 x i8]* @str.32, i64 0, i64 0), %317 ]
%321 = call i32 @puts(i8* dereferenceable(1) %320)
br label %322
322: ; preds = %319, %317
%323 = call i32 (...) @getch()
ret i32 0
}