#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 acumulador(int **, int *);
int /*<<< orphan*/ ascu(char, int *, int **);
int /*<<< orphan*/ dificuldade(int **, int **, int);
int /*<<< orphan*/ escreve_matriz(int **);
int /*<<< orphan*/ printf(char *, ...);
int rand();
int /*<<< orphan*/ scanf(char *, ...);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int /*<<< orphan*/ troca_coluna(int **, int, int);
int /*<<< orphan*/ troca_linha(int **, int, int);
int main(void) {
  int mainBoard[9][9], showBoard[9][9] = {0}, i, j, cont = 0, cont2 = 1,
                       soma = 0, num, x, y, dificult, embaralhador, acerto;
  char cx, cy, cnum;
  const char *const green = "\033[0;40;32m";
  const char *const red = "\033[0;40;31m";
  const char *const normal = "\033[0m";
  const char *const yellow = "\033[0;40;33m";
  printf("\n*** Bem vindo ao Sudoku de Tuy e Eddie ***\n\n");
  printf("\nSiga as instrucoes do jogo para completa-lo\nDigite 'q' para sair "
         "ou 'c' para completar o sudoku");
  srand(time(NULL));
  for (i = 0; i < 9; i++) {
    for (j = 0; j < 9; j++) {
      if (cont == 9)
        cont = 0;
      cont++;
      mainBoard[j][i] = cont;
    }
    cont2 = cont2 + 2;
    if (i == 2)
      cont2 = cont2 - 8;
    if (i == 5)
      cont2 = cont2 - 8;
    cont = i + cont2;
  }
  embaralhador = rand() % 7 + 1;
  for (i = 0; i < embaralhador; i++) {
    troca_linha(mainBoard, 0, 2);
    troca_coluna(mainBoard, 0, 2);
    troca_linha(mainBoard, 3, 5);
    troca_coluna(mainBoard, 3, 5);
    troca_linha(mainBoard, 6, 8);
    troca_coluna(mainBoard, 6, 8);
  }
  printf("\nDigite sua dificuldade de acordo com a legenda:\n");
  printf("\n(1) - Facil\n(2) - Medio\n(3) - Dificil\n(4) - Finalizar o jogo\n");
  scanf("%d", &dificult);
  switch (dificult) {
  case 1:
    dificuldade(showBoard, mainBoard, 42);
    break;
  case 2:
    dificuldade(showBoard, mainBoard, 36);
    break;
  case 3:
    dificuldade(showBoard, mainBoard, 30);
    break;
  default:
    printf("\nPrograma Finalizado");
    return 1;
  }
  printf("\nInicio!!\n\n");
  while (soma != 405) {
    soma = 0;
    escreve_matriz(showBoard);
    printf("\nEscolha o numero da linha: ");
    scanf(" %c", &cx);
    ascu(cx, &x, mainBoard);
    x = x - 1;
    printf("Escolha o numero da coluna: ");
    scanf(" %c", &cy);
    ascu(cy, &y, mainBoard);
    y = y - 1;
    printf("Digite o numero: ");
    scanf(" %c", &cnum);
    ascu(cnum, &num, mainBoard);
    if (num == mainBoard[x][y]) {
      if (num == showBoard[x][y])
        printf("\n%sEsta casa ja esta preenchida!!%s\n\n", yellow, normal);
      else {
        showBoard[x][y] = mainBoard[x][y];
        printf("\n\n%sJogada valida!!%s\n\n", green, normal);
        acerto = acerto + 1;
        if (acerto == 1)
          printf("**  Um acerto? Isso nao eh nada, aposto que nao chega ate o "
                 "fim!!  **\n\n");
        if (acerto == 10)
          printf("**  ZzZzZzZz 10 acertos ainda, esta longe do fim...  **\n\n");
        if (acerto == 30)
          printf("**  Soh agora 30 acertos? Estou ativo faz tempo, acabe logo "
                 "minha execucao para eu poder descansar!  **\n\n");
        if (acerto == 48 && dificult == 3)
          printf("**  Esta quase la!!! Nao acredito! Nunca imaginei que iria "
                 "chegar ate aqui, ja estava me preparando para ser finalizado "
                 "no Alt+F4!  **\n\n");
        if (acerto == 40 && dificult == 2)
          printf("**  Esta quase la!!! Nao acredito! Nunca imaginei que iria "
                 "chegar ate aqui, ja estava me preparando para ser finalizado "
                 "no Alt+F4!  **\n\n");
        if (acerto == 35 && dificult == 1)
          printf("**  Esta quase la!!! Nao acredito! Nunca imaginei que iria "
                 "chegar ate aqui, ja estava me preparando para ser finalizado "
                 "no Alt+F4!  **\n\n");
      }
    } else
      printf("\n%sJogada invalida!!%s\n\n", red, normal);
    soma = acumulador(showBoard, &soma);
  }
  printf("*******************FIM DE JOGO*******************\n");
  printf("\n\n**Sorte de principiante, aposto que nao ganha outra!**\n\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x300,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x2a0(%rbp),%rdi
xor    %esi,%esi
mov    $0x144,%edx
call   1050 <memset@plt>
movl   $0x0,-0x2ac(%rbp)
movl   $0x1,-0x2b0(%rbp)
movl   $0x0,-0x2b4(%rbp)
lea    0xdf6(%rip),%rax
mov    %rax,-0x2d8(%rbp)
lea    0xdf3(%rip),%rax
mov    %rax,-0x2e0(%rbp)
lea    0xdf0(%rip),%rax
mov    %rax,-0x2e8(%rbp)
lea    0xde7(%rip),%rax
mov    %rax,-0x2f0(%rbp)
lea    0xde4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe04(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   10a0 <time@plt>
mov    %eax,%edi
call   1060 <srand@plt>
movl   $0x0,-0x2a4(%rbp)
cmpl   $0x9,-0x2a4(%rbp)
jge    1361 <main+0x1a1>
movl   $0x0,-0x2a8(%rbp)
cmpl   $0x9,-0x2a8(%rbp)
jge    12f4 <main+0x134>
cmpl   $0x9,-0x2ac(%rbp)
jne    12ac <main+0xec>
movl   $0x0,-0x2ac(%rbp)
mov    -0x2ac(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2ac(%rbp)
mov    -0x2ac(%rbp),%edx
movslq -0x2a8(%rbp),%rcx
lea    -0x150(%rbp),%rax
imul   $0x24,%rcx,%rcx
add    %rcx,%rax
movslq -0x2a4(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x2a8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2a8(%rbp)
jmp    1288 <main+0xc8>
mov    -0x2b0(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x2b0(%rbp)
cmpl   $0x2,-0x2a4(%rbp)
jne    131f <main+0x15f>
mov    -0x2b0(%rbp),%eax
sub    $0x8,%eax
mov    %eax,-0x2b0(%rbp)
cmpl   $0x5,-0x2a4(%rbp)
jne    133b <main+0x17b>
mov    -0x2b0(%rbp),%eax
sub    $0x8,%eax
mov    %eax,-0x2b0(%rbp)
mov    -0x2a4(%rbp),%eax
add    -0x2b0(%rbp),%eax
mov    %eax,-0x2ac(%rbp)
mov    -0x2a4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2a4(%rbp)
jmp    1271 <main+0xb1>
mov    $0x0,%al
call   10e0 <rand@plt>
mov    $0x7,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x2c8(%rbp)
movl   $0x0,-0x2a4(%rbp)
mov    -0x2a4(%rbp),%eax
cmp    -0x2c8(%rbp),%eax
jge    1427 <main+0x267>
lea    -0x150(%rbp),%rdi
xor    %esi,%esi
mov    $0x2,%edx
call   1070 <troca_linha@plt>
lea    -0x150(%rbp),%rdi
xor    %esi,%esi
mov    $0x2,%edx
call   1080 <troca_coluna@plt>
lea    -0x150(%rbp),%rdi
mov    $0x3,%esi
mov    $0x5,%edx
call   1070 <troca_linha@plt>
lea    -0x150(%rbp),%rdi
mov    $0x3,%esi
mov    $0x5,%edx
call   1080 <troca_coluna@plt>
lea    -0x150(%rbp),%rdi
mov    $0x6,%esi
mov    $0x8,%edx
call   1070 <troca_linha@plt>
lea    -0x150(%rbp),%rdi
mov    $0x6,%esi
mov    $0x8,%edx
call   1080 <troca_coluna@plt>
mov    -0x2a4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2a4(%rbp)
jmp    1383 <main+0x1c3>
lea    0xc87(%rip),%rdi
xor    %eax,%eax
mov    %al,-0x2f5(%rbp)
call   1040 <printf@plt>
mov    -0x2f5(%rbp),%al
lea    0xc9f(%rip),%rdi
call   1040 <printf@plt>
mov    -0x2f5(%rbp),%al
lea    0xccc(%rip),%rdi
lea    -0x2c4(%rbp),%rsi
call   10c0 <scanf@plt>
mov    -0x2c4(%rbp),%eax
mov    %eax,-0x2f4(%rbp)
sub    $0x1,%eax
je     14a8 <main+0x2e8>
jmp    1480 <main+0x2c0>
mov    -0x2f4(%rbp),%eax
sub    $0x2,%eax
je     14c5 <main+0x305>
jmp    1494 <main+0x2d4>
mov    -0x2f4(%rbp),%eax
sub    $0x3,%eax
je     14e2 <main+0x322>
jmp    14ff <main+0x33f>
lea    -0x2a0(%rbp),%rdi
lea    -0x150(%rbp),%rsi
mov    $0x2a,%edx
call   10d0 <dificuldade@plt>
jmp    1519 <main+0x359>
lea    -0x2a0(%rbp),%rdi
lea    -0x150(%rbp),%rsi
mov    $0x24,%edx
call   10d0 <dificuldade@plt>
jmp    1519 <main+0x359>
lea    -0x2a0(%rbp),%rdi
lea    -0x150(%rbp),%rsi
mov    $0x1e,%edx
call   10d0 <dificuldade@plt>
jmp    1519 <main+0x359>
lea    0xc23(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1838 <main+0x678>
lea    0xc1e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmpl   $0x195,-0x2b4(%rbp)
je     1815 <main+0x655>
movl   $0x0,-0x2b4(%rbp)
lea    -0x2a0(%rbp),%rdi
call   1030 <escreve_matriz@plt>
lea    0xbf6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xc05(%rip),%rdi
lea    -0x2cd(%rbp),%rsi
mov    $0x0,%al
call   10c0 <scanf@plt>
mov    -0x2cd(%rbp),%al
lea    -0x150(%rbp),%rdx
lea    -0x2bc(%rbp),%rsi
movsbl %al,%edi
call   1090 <ascu@plt>
mov    -0x2bc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x2bc(%rbp)
lea    0xbc9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xbb7(%rip),%rdi
lea    -0x2ce(%rbp),%rsi
mov    $0x0,%al
call   10c0 <scanf@plt>
mov    -0x2ce(%rbp),%al
lea    -0x150(%rbp),%rdx
lea    -0x2c0(%rbp),%rsi
movsbl %al,%edi
call   1090 <ascu@plt>
mov    -0x2c0(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x2c0(%rbp)
lea    0xb98(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xb69(%rip),%rdi
lea    -0x2cf(%rbp),%rsi
mov    $0x0,%al
call   10c0 <scanf@plt>
mov    -0x2cf(%rbp),%al
lea    -0x150(%rbp),%rdx
lea    -0x2b8(%rbp),%rsi
movsbl %al,%edi
call   1090 <ascu@plt>
mov    -0x2b8(%rbp),%eax
movslq -0x2bc(%rbp),%rdx
lea    -0x150(%rbp),%rcx
imul   $0x24,%rdx,%rdx
add    %rdx,%rcx
movslq -0x2c0(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jne    17db <main+0x61b>
mov    -0x2b8(%rbp),%eax
movslq -0x2bc(%rbp),%rdx
lea    -0x2a0(%rbp),%rcx
imul   $0x24,%rdx,%rdx
add    %rdx,%rcx
movslq -0x2c0(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jne    169f <main+0x4df>
lea    0xb15(%rip),%rdi
lea    0x98f(%rip),%rsi
lea    0x983(%rip),%rdx
mov    $0x0,%al
call   1040 <printf@plt>
jmp    17d6 <main+0x616>
movslq -0x2bc(%rbp),%rcx
lea    -0x150(%rbp),%rax
imul   $0x24,%rcx,%rcx
add    %rcx,%rax
movslq -0x2c0(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
movslq -0x2bc(%rbp),%rcx
lea    -0x2a0(%rbp),%rax
imul   $0x24,%rcx,%rcx
add    %rcx,%rax
movslq -0x2c0(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
lea    0xadc(%rip),%rdi
lea    0x915(%rip),%rsi
lea    0x924(%rip),%rdx
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x2cc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2cc(%rbp)
cmpl   $0x1,-0x2cc(%rbp)
jne    1723 <main+0x563>
lea    0xabc(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmpl   $0xa,-0x2cc(%rbp)
jne    173e <main+0x57e>
lea    0xae9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmpl   $0x1e,-0x2cc(%rbp)
jne    1759 <main+0x599>
lea    0xb08(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmpl   $0x30,-0x2cc(%rbp)
jne    1781 <main+0x5c1>
cmpl   $0x3,-0x2c4(%rbp)
jne    1781 <main+0x5c1>
lea    0xb4a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmpl   $0x28,-0x2cc(%rbp)
jne    17a9 <main+0x5e9>
cmpl   $0x2,-0x2c4(%rbp)
jne    17a9 <main+0x5e9>
lea    0xb22(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmpl   $0x23,-0x2cc(%rbp)
jne    17d1 <main+0x611>
cmpl   $0x1,-0x2c4(%rbp)
jne    17d1 <main+0x611>
lea    0xafa(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    17d6 <main+0x616>
jmp    17f7 <main+0x637>
lea    0xb6b(%rip),%rdi
lea    0x822(%rip),%rsi
lea    0x826(%rip),%rdx
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x2a0(%rbp),%rdi
lea    -0x2b4(%rbp),%rsi
call   10b0 <acumulador@plt>
mov    %eax,-0x2b4(%rbp)
jmp    1527 <main+0x367>
lea    0xb4a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xb6f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x300,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x2b8,%rsp
lea    0x170(%rsp),%rdi
xor    %ebx,%ebx
mov    $0x144,%edx
xor    %esi,%esi
call   1060 <memset@plt>
movl   $0x0,0xc(%rsp)
lea    0xf40(%rip),%rdi
call   1030 <puts@plt>
lea    0xe14(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %edi,%edi
call   10b0 <time@plt>
mov    %eax,%edi
call   1070 <srand@plt>
mov    $0x1,%eax
xor    %edx,%edx
mov    $0x1,%ecx
jmp    1279 <main+0xa9>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %edx,0x140(%rsp,%rbx,4)
xor    %edx,%edx
cmp    $0x2,%rbx
setne  %dl
lea    (%rcx,%rdx,8),%edx
xor    %esi,%esi
cmp    $0x5,%rbx
setne  %sil
lea    (%rdx,%rsi,8),%ecx
add    $0xfffffff2,%ecx
lea    (%rdx,%rsi,8),%edx
add    %ebx,%edx
add    $0xfffffff2,%edx
add    $0x1,%rbx
cmp    $0x9,%rbx
je     1320 <main+0x150>
lea    0x1(%rdx),%esi
cmp    $0x9,%edx
cmove  %eax,%esi
mov    %esi,0x20(%rsp,%rbx,4)
lea    0x1(%rsi),%edx
cmp    $0x9,%esi
cmove  %eax,%edx
mov    %edx,0x44(%rsp,%rbx,4)
lea    0x1(%rdx),%edi
cmp    $0x9,%edx
cmove  %eax,%edi
lea    0x1(%rdi),%esi
cmp    $0x9,%edi
cmove  %eax,%esi
mov    %edi,0x68(%rsp,%rbx,4)
mov    %esi,0x8c(%rsp,%rbx,4)
mov    $0x1,%edx
cmp    $0x9,%esi
je     12bf <main+0xef>
add    $0x1,%esi
mov    %esi,%edx
mov    %edx,0xb0(%rsp,%rbx,4)
mov    $0x1,%esi
cmp    $0x9,%edx
je     12d5 <main+0x105>
add    $0x1,%edx
mov    %edx,%esi
mov    %esi,0xd4(%rsp,%rbx,4)
mov    $0x1,%edx
cmp    $0x9,%esi
je     12eb <main+0x11b>
add    $0x1,%esi
mov    %esi,%edx
mov    %edx,0xf8(%rsp,%rbx,4)
mov    $0x1,%esi
cmp    $0x9,%edx
je     1301 <main+0x131>
add    $0x1,%edx
mov    %edx,%esi
mov    %esi,0x11c(%rsp,%rbx,4)
mov    $0x1,%edx
cmp    $0x9,%esi
je     1240 <main+0x70>
add    $0x1,%esi
mov    %esi,%edx
jmp    1240 <main+0x70>
xor    %eax,%eax
call   10f0 <rand@plt>
cltq
imul   $0xffffffff92492493,%rax,%rbp
shr    $0x20,%rbp
add    %eax,%ebp
mov    %ebp,%ecx
shr    $0x1f,%ecx
sar    $0x2,%ebp
add    %ecx,%ebp
lea    0x0(,%rbp,8),%ecx
sub    %ecx,%ebp
add    %eax,%ebp
js     13cb <main+0x1fb>
add    $0x1,%ebp
lea    0x20(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x2,%edx
call   1080 <troca_linha@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x2,%edx
call   1090 <troca_coluna@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x5,%edx
call   1080 <troca_linha@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x5,%edx
call   1090 <troca_coluna@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
mov    $0x8,%edx
call   1080 <troca_linha@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
mov    $0x8,%edx
call   1090 <troca_coluna@plt>
add    $0xffffffff,%ebp
jne    1360 <main+0x190>
lea    0xda1(%rip),%rdi
call   1030 <puts@plt>
lea    0xdc6(%rip),%rdi
call   1030 <puts@plt>
lea    0xc9d(%rip),%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   10d0 <scanf@plt>
mov    0x10(%rsp),%eax
add    $0xffffffff,%eax
cmp    $0x3,%eax
jae    164d <main+0x47d>
add    %eax,%eax
lea    (%rax,%rax,2),%eax
mov    $0x2a,%edx
sub    %eax,%edx
lea    0x170(%rsp),%r14
lea    0x20(%rsp),%r12
mov    %r14,%rdi
mov    %r12,%rsi
call   10e0 <dificuldade@plt>
lea    0xdb1(%rip),%rdi
call   1030 <puts@plt>
lea    0xc7f(%rip),%rbx
lea    0xbd2(%rip),%r15
lea    0xc(%rsp),%r13
jmp    1482 <main+0x2b2>
nopl   0x0(%rax,%rax,1)
lea    0xcd6(%rip),%rdi
lea    0xbad(%rip),%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r14,%rdi
mov    %r13,%rsi
call   10c0 <acumulador@plt>
mov    %eax,0xc(%rsp)
cmp    $0x195,%eax
je     1662 <main+0x492>
movl   $0x0,0xc(%rsp)
mov    %r14,%rdi
call   1040 <escreve_matriz@plt>
lea    0xc06(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
lea    0xb(%rsp),%rsi
xor    %eax,%eax
call   10d0 <scanf@plt>
movsbl 0xb(%rsp),%edi
lea    0x18(%rsp),%rsi
mov    %r12,%rdx
call   10a0 <ascu@plt>
addl   $0xffffffff,0x18(%rsp)
lea    0xbf3(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
lea    0xa(%rsp),%rsi
xor    %eax,%eax
call   10d0 <scanf@plt>
movsbl 0xa(%rsp),%edi
lea    0x14(%rsp),%rsi
mov    %r12,%rdx
call   10a0 <ascu@plt>
addl   $0xffffffff,0x14(%rsp)
lea    0xbdc(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
lea    0x9(%rsp),%rsi
xor    %eax,%eax
call   10d0 <scanf@plt>
movsbl 0x9(%rsp),%edi
lea    0x1c(%rsp),%rsi
mov    %r12,%rdx
call   10a0 <ascu@plt>
mov    0x1c(%rsp),%eax
movslq 0x18(%rsp),%rdx
movslq 0x14(%rsp),%rcx
lea    (%rdx,%rdx,8),%rdx
lea    (%rsp,%rdx,4),%rsi
add    $0x20,%rsi
cmp    (%rsi,%rcx,4),%eax
jne    1450 <main+0x280>
lea    (%rsp,%rdx,4),%rdx
add    $0x170,%rdx
cmp    (%rdx,%rcx,4),%eax
jne    1570 <main+0x3a0>
lea    0xb8c(%rip),%rdi
lea    0xab1(%rip),%rsi
jmp    145e <main+0x28e>
nop
lea    (%rdx,%rcx,4),%rcx
mov    %eax,(%rcx)
lea    0xb98(%rip),%rdi
lea    0xa7c(%rip),%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1050 <printf@plt>
cmp    $0x1d,%ebp
je     15b2 <main+0x3e2>
cmp    $0x9,%ebp
je     15c8 <main+0x3f8>
test   %ebp,%ebp
jne    15de <main+0x40e>
lea    0xde0(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%ebp
jmp    1468 <main+0x298>
lea    0xd28(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1e,%ebp
jmp    1468 <main+0x298>
lea    0xd7b(%rip),%rdi
call   1030 <puts@plt>
mov    $0xa,%ebp
jmp    1468 <main+0x298>
add    $0x1,%ebp
mov    0x10(%rsp),%eax
cmp    $0x30,%ebp
jne    1605 <main+0x435>
cmp    $0x3,%eax
jne    1605 <main+0x435>
lea    0xc63(%rip),%rdi
call   1030 <puts@plt>
mov    $0x30,%ebp
jmp    1468 <main+0x298>
cmp    $0x28,%ebp
jne    1625 <main+0x455>
cmp    $0x2,%eax
jne    1625 <main+0x455>
lea    0xc43(%rip),%rdi
call   1030 <puts@plt>
mov    $0x28,%ebp
jmp    1468 <main+0x298>
cmp    $0x23,%ebp
jne    1468 <main+0x298>
cmp    $0x1,%eax
jne    1468 <main+0x298>
lea    0xc1b(%rip),%rdi
call   1030 <puts@plt>
mov    $0x23,%ebp
jmp    1468 <main+0x298>
lea    0xa36(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x1,%eax
jmp    167c <main+0x4ac>
lea    0xb84(%rip),%rdi
call   1030 <puts@plt>
lea    0xbaa(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x2b8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"\1B[0;40;32m\00"
@.str.1 = [11 x i8] c"\1B[0;40;31m\00"
@.str.2 = [5 x i8] c"\1B[0m\00"
@.str.3 = [11 x i8] c"\1B[0;40;33m\00"
@.str.4 = [46 x i8] c"\0A*** Bem vindo ao Sudoku de Tuy e Eddie ***\0A\0A\00"
@.str.5 = [97 x i8] c"\0ASiga as instrucoes do jogo para completa-lo\0ADigite 'q' para sair ou 'c' para completar o sudoku\00"
@.str.6 = [50 x i8] c"\0ADigite sua dificuldade de acordo com a legenda:\0A\00"
@.str.7 = [63 x i8] c"\0A(1) - Facil\0A(2) - Medio\0A(3) - Dificil\0A(4) - Finalizar o jogo\0A\00"
@.str.8 = [3 x i8] c"%d\00"
@.str.9 = [21 x i8] c"\0APrograma Finalizado\00"
@.str.10 = [12 x i8] c"\0AInicio!!\0A\0A\00"
@.str.11 = [29 x i8] c"\0AEscolha o numero da linha: \00"
@.str.12 = [4 x i8] c" %c\00"
@.str.13 = [29 x i8] c"Escolha o numero da coluna: \00"
@.str.14 = [18 x i8] c"Digite o numero: \00"
@.str.15 = [38 x i8] c"\0A%sEsta casa ja esta preenchida!!%s\0A\0A\00"
@.str.16 = [24 x i8] c"\0A\0A%sJogada valida!!%s\0A\0A\00"
@.str.17 = [72 x i8] c"** Um acerto? Isso nao eh nada, aposto que nao chega ate o fim!! **\0A\0A\00"
@.str.18 = [58 x i8] c"** ZzZzZzZz 10 acertos ainda, esta longe do fim... **\0A\0A\00"
@.str.19 = [106 x i8] c"** Soh agora 30 acertos? Estou ativo faz tempo, acabe logo minha execucao para eu poder descansar! **\0A\0A\00"
@.str.20 = [137 x i8] c"** Esta quase la!!! Nao acredito! Nunca imaginei que iria chegar ate aqui, ja estava me preparando para ser finalizado no Alt+F4! **\0A\0A\00"
@.str.21 = [25 x i8] c"\0A%sJogada invalida!!%s\0A\0A\00"
@.str.22 = [51 x i8] c"*******************FIM DE JOGO*******************\0A\00"
@.str.23 = [59 x i8] c"\0A\0A**Sorte de principiante, aposto que nao ganha outra!**\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [9 x [9 x i32]]
%3 = alloca [9 x [9 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
%14 = alloca i32
%15 = alloca i8
%16 = alloca i8
%17 = alloca i8
%18 = alloca i8*
%19 = alloca i8*
%20 = alloca i8*
%21 = alloca i8*
store i32 0, i32* %1
%22 = bitcast [9 x [9 x i32]]* %3 to i8*
store i32 0, i32* %6
store i32 1, i32* %7
store i32 0, i32* %8
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8** %18
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8** %19
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8** %20
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i8** %21
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.4, i64 0, i64 0))
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([97 x i8], [97 x i8]* @.str.5, i64 0, i64 0))
%25 = call i32 @time(i32* null)
%26 = call i32 @srand(i32 %25)
store i32 0, i32* %4
br label %27
27: ; preds = %69, %0
%28 = load i32, i32* %4
%29 = icmp slt i32 %28, 9
br i1 %29, label %30, label %72
30: ; preds = %27
store i32 0, i32* %5
br label %31
31: ; preds = %48, %30
%32 = load i32, i32* %5
%33 = icmp slt i32 %32, 9
br i1 %33, label %34, label %51
34: ; preds = %31
%35 = load i32, i32* %6
%36 = icmp eq i32 %35, 9
br i1 %36, label %37, label %38
37: ; preds = %34
store i32 0, i32* %6
br label %38
38: ; preds = %37, %34
%39 = load i32, i32* %6
%40 = add nsw i32 %39, 1
store i32 %40, i32* %6
%41 = load i32, i32* %6
%42 = load i32, i32* %5
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %2, i64 0, i64 %43
%45 = load i32, i32* %4
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds [9 x i32], [9 x i32]* %44, i64 0, i64 %46
store i32 %41, i32* %47
br label %48
48: ; preds = %38
%49 = load i32, i32* %5
%50 = add nsw i32 %49, 1
store i32 %50, i32* %5
br label %31
51: ; preds = %31
%52 = load i32, i32* %7
%53 = add nsw i32 %52, 2
store i32 %53, i32* %7
%54 = load i32, i32* %4
%55 = icmp eq i32 %54, 2
br i1 %55, label %56, label %59
56: ; preds = %51
%57 = load i32, i32* %7
%58 = sub nsw i32 %57, 8
store i32 %58, i32* %7
br label %59
59: ; preds = %56, %51
%60 = load i32, i32* %4
%61 = icmp eq i32 %60, 5
br i1 %61, label %62, label %65
62: ; preds = %59
%63 = load i32, i32* %7
%64 = sub nsw i32 %63, 8
store i32 %64, i32* %7
br label %65
65: ; preds = %62, %59
%66 = load i32, i32* %4
%67 = load i32, i32* %7
%68 = add nsw i32 %66, %67
store i32 %68, i32* %6
br label %69
69: ; preds = %65
%70 = load i32, i32* %4
%71 = add nsw i32 %70, 1
store i32 %71, i32* %4
br label %27
72: ; preds = %27
%73 = call i32 (...) @rand()
%74 = srem i32 %73, 7
%75 = add nsw i32 %74, 1
store i32 %75, i32* %13
store i32 0, i32* %4
br label %76
76: ; preds = %99, %72
%77 = load i32, i32* %4
%78 = load i32, i32* %13
%79 = icmp slt i32 %77, %78
br i1 %79, label %80, label %102
80: ; preds = %76
%81 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %2, i64 0, i64 0
%82 = bitcast [9 x i32]* %81 to i32**
%83 = call i32 @troca_linha(i32** %82, i32 0, i32 2)
%84 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %2, i64 0, i64 0
%85 = bitcast [9 x i32]* %84 to i32**
%86 = call i32 @troca_coluna(i32** %85, i32 0, i32 2)
%87 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %2, i64 0, i64 0
%88 = bitcast [9 x i32]* %87 to i32**
%89 = call i32 @troca_linha(i32** %88, i32 3, i32 5)
%90 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %2, i64 0, i64 0
%91 = bitcast [9 x i32]* %90 to i32**
%92 = call i32 @troca_coluna(i32** %91, i32 3, i32 5)
%93 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %2, i64 0, i64 0
%94 = bitcast [9 x i32]* %93 to i32**
%95 = call i32 @troca_linha(i32** %94, i32 6, i32 8)
%96 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %2, i64 0, i64 0
%97 = bitcast [9 x i32]* %96 to i32**
%98 = call i32 @troca_coluna(i32** %97, i32 6, i32 8)
br label %99
99: ; preds = %80
%100 = load i32, i32* %4
%101 = add nsw i32 %100, 1
store i32 %101, i32* %4
br label %76
102: ; preds = %76
%103 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.6, i64 0, i64 0))
%104 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.7, i64 0, i64 0))
%105 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i32* %12)
%106 = load i32, i32* %12
switch i32 %106, label %125 [
i32 1, label %107
i32 2, label %113
i32 3, label %119
]
107: ; preds = %102
%108 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %3, i64 0, i64 0
%109 = bitcast [9 x i32]* %108 to i32**
%110 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %2, i64 0, i64 0
%111 = bitcast [9 x i32]* %110 to i32**
%112 = call i32 @dificuldade(i32** %109, i32** %111, i32 42)
br label %127
113: ; preds = %102
%114 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %3, i64 0, i64 0
%115 = bitcast [9 x i32]* %114 to i32**
%116 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %2, i64 0, i64 0
%117 = bitcast [9 x i32]* %116 to i32**
%118 = call i32 @dificuldade(i32** %115, i32** %117, i32 36)
br label %127
119: ; preds = %102
%120 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %3, i64 0, i64 0
%121 = bitcast [9 x i32]* %120 to i32**
%122 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %2, i64 0, i64 0
%123 = bitcast [9 x i32]* %122 to i32**
%124 = call i32 @dificuldade(i32** %121, i32** %123, i32 30)
br label %127
125: ; preds = %102
%126 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.9, i64 0, i64 0))
store i32 1, i32* %1
br label %245
127: ; preds = %119, %113, %107
%128 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.10, i64 0, i64 0))
br label %129
129: ; preds = %238, %127
%130 = load i32, i32* %8
%131 = icmp ne i32 %130, 405
br i1 %131, label %132, label %242
132: ; preds = %129
store i32 0, i32* %8
%133 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %3, i64 0, i64 0
%134 = bitcast [9 x i32]* %133 to i32**
%135 = call i32 @escreve_matriz(i32** %134)
%136 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.11, i64 0, i64 0))
%137 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0), i8* %15)
%138 = load i8, i8* %15
%139 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %2, i64 0, i64 0
%140 = bitcast [9 x i32]* %139 to i32**
%141 = call i32 @ascu(i8 signext %138, i32* %10, i32** %140)
%142 = load i32, i32* %10
%143 = sub nsw i32 %142, 1
store i32 %143, i32* %10
%144 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.13, i64 0, i64 0))
%145 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0), i8* %16)
%146 = load i8, i8* %16
%147 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %2, i64 0, i64 0
%148 = bitcast [9 x i32]* %147 to i32**
%149 = call i32 @ascu(i8 signext %146, i32* %11, i32** %148)
%150 = load i32, i32* %11
%151 = sub nsw i32 %150, 1
store i32 %151, i32* %11
%152 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.14, i64 0, i64 0))
%153 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0), i8* %17)
%154 = load i8, i8* %17
%155 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %2, i64 0, i64 0
%156 = bitcast [9 x i32]* %155 to i32**
%157 = call i32 @ascu(i8 signext %154, i32* %9, i32** %156)
%158 = load i32, i32* %9
%159 = load i32, i32* %10
%160 = sext i32 %159 to i64
%161 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %2, i64 0, i64 %160
%162 = load i32, i32* %11
%163 = sext i32 %162 to i64
%164 = getelementptr inbounds [9 x i32], [9 x i32]* %161, i64 0, i64 %163
%165 = load i32, i32* %164
%166 = icmp eq i32 %158, %165
br i1 %166, label %167, label %236
167: ; preds = %132
%168 = load i32, i32* %9
%169 = load i32, i32* %10
%170 = sext i32 %169 to i64
%171 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %3, i64 0, i64 %170
%172 = load i32, i32* %11
%173 = sext i32 %172 to i64
%174 = getelementptr inbounds [9 x i32], [9 x i32]* %171, i64 0, i64 %173
%175 = load i32, i32* %174
%176 = icmp eq i32 %168, %175
br i1 %176, label %177, label %179
177: ; preds = %167
%178 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i32 0, i32 0))
br label %235
179: ; preds = %167
%180 = load i32, i32* %10
%181 = sext i32 %180 to i64
%182 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %2, i64 0, i64 %181
%183 = load i32, i32* %11
%184 = sext i32 %183 to i64
%185 = getelementptr inbounds [9 x i32], [9 x i32]* %182, i64 0, i64 %184
%186 = load i32, i32* %185
%187 = load i32, i32* %10
%188 = sext i32 %187 to i64
%189 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %3, i64 0, i64 %188
%190 = load i32, i32* %11
%191 = sext i32 %190 to i64
%192 = getelementptr inbounds [9 x i32], [9 x i32]* %189, i64 0, i64 %191
store i32 %186, i32* %192
%193 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i32 0, i32 0))
%194 = load i32, i32* %14
%195 = add nsw i32 %194, 1
store i32 %195, i32* %14
%196 = load i32, i32* %14
%197 = icmp eq i32 %196, 1
br i1 %197, label %198, label %200
198: ; preds = %179
%199 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.17, i64 0, i64 0))
br label %200
200: ; preds = %198, %179
%201 = load i32, i32* %14
%202 = icmp eq i32 %201, 10
br i1 %202, label %203, label %205
203: ; preds = %200
%204 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.18, i64 0, i64 0))
br label %205
205: ; preds = %203, %200
%206 = load i32, i32* %14
%207 = icmp eq i32 %206, 30
br i1 %207, label %208, label %210
208: ; preds = %205
%209 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([106 x i8], [106 x i8]* @.str.19, i64 0, i64 0))
br label %210
210: ; preds = %208, %205
%211 = load i32, i32* %14
%212 = icmp eq i32 %211, 48
br i1 %212, label %213, label %218
213: ; preds = %210
%214 = load i32, i32* %12
%215 = icmp eq i32 %214, 3
br i1 %215, label %216, label %218
216: ; preds = %213
%217 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([137 x i8], [137 x i8]* @.str.20, i64 0, i64 0))
br label %218
218: ; preds = %216, %213, %210
%219 = load i32, i32* %14
%220 = icmp eq i32 %219, 40
br i1 %220, label %221, label %226
221: ; preds = %218
%222 = load i32, i32* %12
%223 = icmp eq i32 %222, 2
br i1 %223, label %224, label %226
224: ; preds = %221
%225 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([137 x i8], [137 x i8]* @.str.20, i64 0, i64 0))
br label %226
226: ; preds = %224, %221, %218
%227 = load i32, i32* %14
%228 = icmp eq i32 %227, 35
br i1 %228, label %229, label %234
229: ; preds = %226
%230 = load i32, i32* %12
%231 = icmp eq i32 %230, 1
br i1 %231, label %232, label %234
232: ; preds = %229
%233 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([137 x i8], [137 x i8]* @.str.20, i64 0, i64 0))
br label %234
234: ; preds = %232, %229, %226
br label %235
235: ; preds = %234, %177
br label %238
236: ; preds = %132
%237 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.21, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i32 0, i32 0))
br label %238
238: ; preds = %236, %235
%239 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %3, i64 0, i64 0
%240 = bitcast [9 x i32]* %239 to i32**
%241 = call i32 @acumulador(i32** %240, i32* %8)
store i32 %241, i32* %8
br label %129
242: ; preds = %129
%243 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.22, i64 0, i64 0))
%244 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.23, i64 0, i64 0))
store i32 0, i32* %1
br label %245
245: ; preds = %242, %125
%246 = load i32, i32* %1
ret i32 %246
}

LLVM IR (-O2):
@.str = [11 x i8] c"\1B[0;40;32m\00"
@.str.1 = [11 x i8] c"\1B[0;40;31m\00"
@.str.2 = [5 x i8] c"\1B[0m\00"
@.str.3 = [11 x i8] c"\1B[0;40;33m\00"
@.str.5 = [97 x i8] c"\0ASiga as instrucoes do jogo para completa-lo\0ADigite 'q' para sair ou 'c' para completar o sudoku\00"
@.str.8 = [3 x i8] c"%d\00"
@.str.9 = [21 x i8] c"\0APrograma Finalizado\00"
@.str.11 = [29 x i8] c"\0AEscolha o numero da linha: \00"
@.str.12 = [4 x i8] c" %c\00"
@.str.13 = [29 x i8] c"Escolha o numero da coluna: \00"
@.str.14 = [18 x i8] c"Digite o numero: \00"
@.str.15 = [38 x i8] c"\0A%sEsta casa ja esta preenchida!!%s\0A\0A\00"
@.str.16 = [24 x i8] c"\0A\0A%sJogada valida!!%s\0A\0A\00"
@.str.21 = [25 x i8] c"\0A%sJogada invalida!!%s\0A\0A\00"
@str = [45 x i8] c"\0A*** Bem vindo ao Sudoku de Tuy e Eddie ***\0A\00"
@str.24 = [49 x i8] c"\0ADigite sua dificuldade de acordo com a legenda:\00"
@str.25 = [62 x i8] c"\0A(1) - Facil\0A(2) - Medio\0A(3) - Dificil\0A(4) - Finalizar o jogo\00"
@str.26 = [11 x i8] c"\0AInicio!!\0A\00"
@str.27 = [50 x i8] c"*******************FIM DE JOGO*******************\00"
@str.28 = [58 x i8] c"\0A\0A**Sorte de principiante, aposto que nao ganha outra!**\0A\00"
@str.31 = [136 x i8] c"** Esta quase la!!! Nao acredito! Nunca imaginei que iria chegar ate aqui, ja estava me preparando para ser finalizado no Alt+F4! **\0A\00"
@str.32 = [105 x i8] c"** Soh agora 30 acertos? Estou ativo faz tempo, acabe logo minha execucao para eu poder descansar! **\0A\00"
@str.33 = [57 x i8] c"** ZzZzZzZz 10 acertos ainda, esta longe do fim... **\0A\00"
@str.34 = [71 x i8] c"** Um acerto? Isso nao eh nada, aposto que nao chega ate o fim!! **\0A\00"
define i32 @main() {
%1 = alloca [9 x [9 x i32]]
%2 = alloca [9 x [9 x i32]]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8
%9 = alloca i8
%10 = alloca i8
%11 = bitcast [9 x [9 x i32]]* %1 to i8*
%12 = bitcast [9 x [9 x i32]]* %2 to i8*
%13 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%14 = bitcast i32* %4 to i8*
%15 = bitcast i32* %5 to i8*
%16 = bitcast i32* %6 to i8*
%17 = bitcast i32* %7 to i8*
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([97 x i8], [97 x i8]* @.str.5, i64 0, i64 0))
%20 = tail call i32 @time(i32* null)
%21 = tail call i32 @srand(i32 %20)
br label %22
22: ; preds = %0, %22
%23 = phi i64 [ 0, %0 ], [ %70, %22 ]
%24 = phi i32 [ 0, %0 ], [ %69, %22 ]
%25 = phi i32 [ 1, %0 ], [ %67, %22 ]
%26 = icmp eq i32 %24, 9
%27 = add nsw i32 %24, 1
%28 = select i1 %26, i32 1, i32 %27
%29 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %1, i64 0, i64 0, i64 %23
store i32 %28, i32* %29
%30 = icmp eq i32 %28, 9
%31 = add nsw i32 %28, 1
%32 = select i1 %30, i32 1, i32 %31
%33 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %1, i64 0, i64 1, i64 %23
store i32 %32, i32* %33
%34 = icmp eq i32 %32, 9
%35 = add nsw i32 %32, 1
%36 = select i1 %34, i32 1, i32 %35
%37 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %1, i64 0, i64 2, i64 %23
store i32 %36, i32* %37
%38 = icmp eq i32 %36, 9
%39 = add nsw i32 %36, 1
%40 = select i1 %38, i32 1, i32 %39
%41 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %1, i64 0, i64 3, i64 %23
store i32 %40, i32* %41
%42 = icmp eq i32 %40, 9
%43 = add nsw i32 %40, 1
%44 = select i1 %42, i32 1, i32 %43
%45 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %1, i64 0, i64 4, i64 %23
store i32 %44, i32* %45
%46 = icmp eq i32 %44, 9
%47 = add nsw i32 %44, 1
%48 = select i1 %46, i32 1, i32 %47
%49 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %1, i64 0, i64 5, i64 %23
store i32 %48, i32* %49
%50 = icmp eq i32 %48, 9
%51 = add nsw i32 %48, 1
%52 = select i1 %50, i32 1, i32 %51
%53 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %1, i64 0, i64 6, i64 %23
store i32 %52, i32* %53
%54 = icmp eq i32 %52, 9
%55 = add nsw i32 %52, 1
%56 = select i1 %54, i32 1, i32 %55
%57 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %1, i64 0, i64 7, i64 %23
store i32 %56, i32* %57
%58 = icmp eq i32 %56, 9
%59 = add nsw i32 %56, 1
%60 = select i1 %58, i32 1, i32 %59
%61 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %1, i64 0, i64 8, i64 %23
store i32 %60, i32* %61
%62 = icmp eq i64 %23, 2
%63 = select i1 %62, i32 -6, i32 2
%64 = add nsw i32 %63, %25
%65 = icmp eq i64 %23, 5
%66 = add nsw i32 %64, -8
%67 = select i1 %65, i32 %66, i32 %64
%68 = trunc i64 %23 to i32
%69 = add nsw i32 %67, %68
%70 = add nuw nsw i64 %23, 1
%71 = icmp eq i64 %70, 9
br i1 %71, label %72, label %22
72: ; preds = %22
%73 = tail call i32 (...) @rand()
%74 = srem i32 %73, 7
%75 = icmp slt i32 %74, 0
br i1 %75, label %88, label %76
76: ; preds = %72
%77 = bitcast [9 x [9 x i32]]* %1 to i32**
br label %78
78: ; preds = %76, %78
%79 = phi i32 [ 0, %76 ], [ %86, %78 ]
%80 = call i32 @troca_linha(i32** %77, i32 0, i32 2)
%81 = call i32 @troca_coluna(i32** %77, i32 0, i32 2)
%82 = call i32 @troca_linha(i32** %77, i32 3, i32 5)
%83 = call i32 @troca_coluna(i32** %77, i32 3, i32 5)
%84 = call i32 @troca_linha(i32** %77, i32 6, i32 8)
%85 = call i32 @troca_coluna(i32** %77, i32 6, i32 8)
%86 = add nuw nsw i32 %79, 1
%87 = icmp eq i32 %79, %74
br i1 %87, label %88, label %78
88: ; preds = %78, %72
%89 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str.24, i64 0, i64 0))
%90 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @str.25, i64 0, i64 0))
%91 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i32* %7)
%92 = load i32, i32* %7
%93 = add i32 %92, -1
%94 = icmp ult i32 %93, 3
br i1 %94, label %97, label %95
95: ; preds = %88
%96 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.9, i64 0, i64 0))
br label %176
97: ; preds = %88
%98 = mul i32 %93, -6
%99 = add i32 %98, 42
%100 = bitcast [9 x [9 x i32]]* %2 to i32**
%101 = bitcast [9 x [9 x i32]]* %1 to i32**
%102 = call i32 @dificuldade(i32** %100, i32** %101, i32 %99)
%103 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.26, i64 0, i64 0))
%104 = bitcast [9 x [9 x i32]]* %2 to i32**
%105 = bitcast [9 x [9 x i32]]* %1 to i32**
br label %106
106: ; preds = %97, %169
%107 = phi i32 [ undef, %97 ], [ %170, %169 ]
store i32 0, i32* %3
%108 = call i32 @escreve_matriz(i32** %104)
%109 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.11, i64 0, i64 0))
%110 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0), i8* %8)
%111 = load i8, i8* %8
%112 = call i32 @ascu(i8 signext %111, i32* %5, i32** %105)
%113 = load i32, i32* %5
%114 = add nsw i32 %113, -1
store i32 %114, i32* %5
%115 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.13, i64 0, i64 0))
%116 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0), i8* %9)
%117 = load i8, i8* %9
%118 = call i32 @ascu(i8 signext %117, i32* %6, i32** %105)
%119 = load i32, i32* %6
%120 = add nsw i32 %119, -1
store i32 %120, i32* %6
%121 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.14, i64 0, i64 0))
%122 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0), i8* %10)
%123 = load i8, i8* %10
%124 = call i32 @ascu(i8 signext %123, i32* %4, i32** %105)
%125 = load i32, i32* %4
%126 = load i32, i32* %5
%127 = sext i32 %126 to i64
%128 = load i32, i32* %6
%129 = sext i32 %128 to i64
%130 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %1, i64 0, i64 %127, i64 %129
%131 = load i32, i32* %130
%132 = icmp eq i32 %125, %131
br i1 %132, label %133, label %167
133: ; preds = %106
%134 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %2, i64 0, i64 %127, i64 %129
%135 = load i32, i32* %134
%136 = icmp eq i32 %125, %135
br i1 %136, label %137, label %139
137: ; preds = %133
%138 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %169
139: ; preds = %133
store i32 %125, i32* %134
%140 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%141 = add nsw i32 %107, 1
switch i32 %107, label %148 [
i32 0, label %142
i32 9, label %144
i32 29, label %146
]
142: ; preds = %139
%143 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([71 x i8], [71 x i8]* @str.34, i64 0, i64 0))
br label %169
144: ; preds = %139
%145 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str.33, i64 0, i64 0))
br label %169
146: ; preds = %139
%147 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([105 x i8], [105 x i8]* @str.32, i64 0, i64 0))
br label %169
148: ; preds = %139
%149 = icmp eq i32 %141, 48
%150 = load i32, i32* %7
%151 = icmp eq i32 %150, 3
%152 = select i1 %149, i1 %151, i1 false
br i1 %152, label %153, label %155
153: ; preds = %148
%154 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([136 x i8], [136 x i8]* @str.31, i64 0, i64 0))
br label %169
155: ; preds = %148
%156 = icmp eq i32 %141, 40
%157 = icmp eq i32 %150, 2
%158 = select i1 %156, i1 %157, i1 false
br i1 %158, label %159, label %161
159: ; preds = %155
%160 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([136 x i8], [136 x i8]* @str.31, i64 0, i64 0))
br label %169
161: ; preds = %155
%162 = icmp eq i32 %141, 35
%163 = icmp eq i32 %150, 1
%164 = select i1 %162, i1 %163, i1 false
br i1 %164, label %165, label %169
165: ; preds = %161
%166 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([136 x i8], [136 x i8]* @str.31, i64 0, i64 0))
br label %169
167: ; preds = %106
%168 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.21, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %169
169: ; preds = %153, %142, %144, %146, %159, %137, %165, %161, %167
%170 = phi i32 [ %107, %137 ], [ 35, %165 ], [ %141, %161 ], [ %107, %167 ], [ 40, %159 ], [ 30, %146 ], [ 10, %144 ], [ 1, %142 ], [ 48, %153 ]
%171 = call i32 @acumulador(i32** %104, i32* %3)
store i32 %171, i32* %3
%172 = icmp eq i32 %171, 405
br i1 %172, label %173, label %106
173: ; preds = %169
%174 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.27, i64 0, i64 0))
%175 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str.28, i64 0, i64 0))
br label %176
176: ; preds = %173, %95
%177 = phi i32 [ 1, %95 ], [ 0, %173 ]
ret i32 %177
}