#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
int fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, int *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  int i, key = 0;
  int r, nwd, a, q, b;
  int x, x1, x2;
  int y, y1, y2;
  int cez = 0, af = 0, enc = 0, dec = 0, cryan = 0;
  for (i = 0; i < argc; i++) {
    if (!strcmp(argv[i], "-c")) {
      cez = 1;
    }
    if (!strcmp(argv[i], "-a")) {
      af = 1;
    }
    if (!strcmp(argv[i], "-e")) {
      enc = 1;
    }
    if (!strcmp(argv[i], "-d")) {
      dec = 1;
    }
    if (!strcmp(argv[i], "-k")) {
      cryan = 1;
    }
  }
  if (argc >= 2) {
    printf("Podane Argumenty: ");
    for (i = 1; i < argc; i++) {
      printf("%s ", argv[i]);
    }
    printf("\n");
  } else {
    printf(
        "Za malo podanych argumentow!\n\n    Pierw wybierz szyfr:\n    -c "
        "(szyfr Cezara),\n    -a (szyfr afiniczny),\n\n    A następnie co "
        "chcesz zrobić:\n    -e (szyfrowanie),\n    -d (odszyfrowywanie),\n    "
        "-j (kryptoanaliza z tekstem jawnym),\n    -k (kryptoanaliza wyłącznie "
        "w oparciu o kryptogram).\n\n    Przykład: ./cezar.c -c -e\n");
    return 0;
  }
  FILE *klucz = fopen("key.txt", "r");
  if (klucz == 0) {
    printf("Nie mozna otworzyc pliku z kluczem! Upewnij sie ze instnieje.\n");
    return 0;
  }
  int key2 = 0;
  key = 0;
  int count = 0;
  int klucz1 = 0;
  fscanf(klucz, "%d", &klucz1);
  while (!feof(klucz)) {
    if (count == 0) {
      key = klucz1;
    }
    fscanf(klucz, "%d", &key2);
    count++;
  }
  fclose(klucz);
  int nwd_a = key, nwd_b = 26;
  FILE *plain = fopen("plain.txt", "r");
  FILE *crypto = fopen("crypto.txt", "r+");
  FILE *decrypt = fopen("decrypt.txt", "r+");
  FILE *cryptoanalysis = fopen("cryptoanalysis.txt", "w");
  if (plain == 0 || crypto == 0 || decrypt == 0) {
    printf("Nie mozna otworzyc ktoregos z plikow, upewnij sie ze wymagane "
           "plioki istnieja!!\n");
    return 0;
  }
  if (cez == 0 && af == 0) {
    printf("nie wybrales szyfru!\n");
    return 0;
  }
  if (cez == 1) {
    if (argc == 2) {
      printf("Zapomniales podac co chcesz zrobic przy pomocy szyfru Cezara!\n");
      return 0;
    }
    if (enc == 1) {
      printf("Klucz : %d\n", key);
      printf("\nSzyfrowanie szyfrem Cezara\n");
      printf("\nTekst znajdujacy sie w plain.txt:\n");
      while ((x = fgetc(plain)) != EOF) {
        printf("%c", x);
        if ((int)x >= 65 && (int)x <= 90) {
          int szyfrcezara = 65 + (((int)x + key) % 26);
          fprintf(crypto, "%c", szyfrcezara);
        }
      }
      fclose(crypto);
      fopen("crypto.txt", "r");
      printf("Tekst w crypto.txt po zaszyfrowaniu:\n");
      while ((x = fgetc(crypto)) != EOF) {
        printf("%c", x);
      }
      printf("\n");
      fclose(crypto);
      if (argc == 3) {
        return 0;
      }
    }
    if (dec == 1) {
      fopen("crypto.txt", "r");
      fopen("decrypt.txt", "r+");
      printf("Tekst w decrypt.txt po odszyfrowaniu:\n");
      while ((x = fgetc(crypto)) != EOF) {
        if ((int)x >= 65 && (int)x <= 90) {
          int deszyfrcezara = (((int)x - key) % 26) + 65;
          fprintf(decrypt, "%c", deszyfrcezara);
          printf("%c", deszyfrcezara);
        }
      }
      printf("\n");
      fclose(crypto);
      fclose(decrypt);
      if (argc == 3) {
        return 0;
      }
    }
    if (cryan == 1) {
      printf("Kryptoanaliza za pomoca kryptogramu\n");
      fopen("cryptoanalysis.txt", "a+");
      for (i = 0; i < 27; i++) {
        fopen("crypto.txt", "r");
        while ((x = fgetc(crypto)) != EOF) {
          if ((int)x >= 65 && (int)x <= 90) {
            int deszyfrcezara = (((int)x - i) % 26) + 65;
            fprintf(cryptoanalysis, "Klucz %d: %c", i, deszyfrcezara);
            printf("%c", deszyfrcezara);
          }
        }
        printf("\n");
        if (i < 26) {
          printf("Klucz %d: ", i + 1);
        }
        fprintf(cryptoanalysis, "\n");
        fclose(crypto);
      }
      printf("\n");
      fclose(decrypt);
      if (argc == 3) {
        return 0;
      }
    }
  } else if (af == 1) {
    printf("Klucz 1: %d\n", key);
    printf("Klucz 2: %d\n", key2);
    fopen("crypto.txt", "w");
    if (nwd_b > nwd_a) {
      nwd = nwd_b;
      nwd_b = nwd_a;
      nwd_a = nwd;
    }
    a = nwd_a;
    b = nwd_b;
    q = a / b;
    r = a - q * b;
    nwd = b;
    x2 = 1;
    x1 = 0;
    y2 = 0;
    y1 = 1;
    x = 1;
    y = y2 - (q - 1) * y1;
    while (r != 0) {
      a = b;
      b = r;
      x = x2 - q * x1;
      x2 = x1;
      x1 = x;
      y = y2 - q * y1;
      y2 = y1;
      y1 = y;
      nwd = r;
      q = a / b;
      r = a - q * b;
    }
    int multmodinverse = y % 26;
    if (argc == 2) {
      printf("nie podales co chcesz zrobic uzywajhac szyfru afinicznego\n");
      return 0;
    }
    if (enc == 1) {
      printf("\nSzyfrowanie szyfrem Afinicznym\n\n");
      printf("Tekst znajdujacy sie w plain.txt:\n");
      while ((x = fgetc(plain)) != EOF) {
        printf("%c", x);
        if ((int)x >= 65 && (int)x <= 90) {
          x = x - 65;
          int szyfrafi = ((key * x + key2) % 26) + 65;
          fprintf(crypto, "%c", szyfrafi);
        }
      }
      fclose(crypto);
      fopen("crypto.txt", "r");
      printf("Tekst w crypto.txt po zaszyfrowaniu:\n");
      while ((x = fgetc(crypto)) != EOF) {
        printf("%c", x);
      }
      printf("\n");
      fclose(crypto);
      if (argc == 3) {
        return 0;
      }
    }
    if (dec == 1) {
      fopen("crypto.txt", "r");
      fopen("decrypt.txt", "w");
      printf("Tekst w decrypt.txt po odszyfrowaniu:\n");
      while ((x = fgetc(crypto)) != EOF) {
        if ((int)x >= 65 && (int)x <= 90) {
          x = x - 65;
          int deszyfrafi = ((multmodinverse * (x - key2)) % 26);
          deszyfrafi = deszyfrafi + 65;
          if (deszyfrafi < 65) {
            deszyfrafi = 91 - (65 - deszyfrafi);
          }
          fprintf(decrypt, "%c", deszyfrafi);
          printf("%c", deszyfrafi);
        }
      }
      printf("\n");
      fclose(crypto);
      fclose(decrypt);
      if (argc == 3) {
        return 0;
      }
    }
    if (cryan == 1) {
      nwd_b = 26;
      int r, nwd, a, q, b;
      int x, x1, x2;
      int y, y1, y2;
      for (i = 1; i < 26; i++) {
        key = i;
        nwd_a = key;
        if (nwd_b > nwd_a) {
          nwd = nwd_b;
          nwd_b = nwd_a;
          nwd_a = nwd;
        }
        a = nwd_a;
        b = nwd_b;
        q = a / b;
        r = a - q * b;
        nwd = b;
        x2 = 1;
        x1 = 0;
        y2 = 0;
        y1 = 1;
        x = 1;
        y = y2 - (q - 1) * y1;
        while (r != 0) {
          a = b;
          b = r;
          x = x2 - q * x1;
          x2 = x1;
          x1 = x;
          y = y2 - q * y1;
          y2 = y1;
          y1 = y;
          nwd = r;
          q = a / b;
          r = a - q * b;
        }
        multmodinverse = y % 26;
        for (int j = 0; j < 26; j++) {
          key2 = j;
          fopen("crypto.txt", "r");
          fopen("cryptoanalysis.txt", "a+");
          while ((x = fgetc(crypto)) != EOF) {
            if ((int)x >= 65 && (int)x <= 90) {
              x = x - 65;
              int deszyfrafi = ((multmodinverse * (x - key2)) % 26);
              deszyfrafi = deszyfrafi + 65;
              if (deszyfrafi < 65) {
                deszyfrafi = 91 - (65 - deszyfrafi);
              }
              fprintf(cryptoanalysis, "%c", deszyfrafi);
            }
          }
          fprintf(cryptoanalysis, "\n");
          fclose(crypto);
          fclose(cryptoanalysis);
        }
      }
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x48(%rbp)
movl   $0x0,-0x4c(%rbp)
movl   $0x0,-0x50(%rbp)
movl   $0x0,-0x54(%rbp)
movl   $0x0,-0x58(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    12b1 <main+0x131>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xe17(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    11fe <main+0x7e>
movl   $0x1,-0x48(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xdf2(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    1226 <main+0xa6>
movl   $0x1,-0x4c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xdcd(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    124e <main+0xce>
movl   $0x1,-0x50(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xda8(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    1276 <main+0xf6>
movl   $0x1,-0x54(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd83(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    129e <main+0x11e>
movl   $0x1,-0x58(%rbp)
jmp    12a3 <main+0x123>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11ca <main+0x4a>
cmpl   $0x2,-0x8(%rbp)
jl     1317 <main+0x197>
lea    0xd4d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1304 <main+0x184>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xd33(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    12d0 <main+0x150>
lea    0x10d7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1331 <main+0x1b1>
lea    0xd08(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1fbd <main+0xe3d>
lea    0xe30(%rip),%rdi
lea    0xe31(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x60(%rbp)
cmpq   $0x0,-0x60(%rbp)
jne    136d <main+0x1ed>
lea    0xe18(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1fbd <main+0xe3d>
movl   $0x0,-0x64(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x68(%rbp)
movl   $0x0,-0x6c(%rbp)
mov    -0x60(%rbp),%rdi
lea    0xe1d(%rip),%rsi
lea    -0x6c(%rbp),%rdx
call   1050 <fscanf@plt>
mov    -0x60(%rbp),%rdi
call   1090 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    13bb <main+0x23b>
jmp    13ed <main+0x26d>
cmpl   $0x0,-0x68(%rbp)
jne    13cb <main+0x24b>
mov    -0x6c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x60(%rbp),%rdi
lea    0xddb(%rip),%rsi
lea    -0x64(%rbp),%rdx
call   1050 <fscanf@plt>
mov    -0x68(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x68(%rbp)
jmp    139d <main+0x21d>
mov    -0x60(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x18(%rbp),%eax
mov    %eax,-0x70(%rbp)
movl   $0x1a,-0x74(%rbp)
lea    0xdaa(%rip),%rdi
lea    0xd5f(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x80(%rbp)
lea    0xd9d(%rip),%rdi
lea    0xda1(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x88(%rbp)
lea    0xd91(%rip),%rdi
lea    0xd87(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x90(%rbp)
lea    0xd83(%rip),%rdi
lea    0xd8f(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x98(%rbp)
cmpq   $0x0,-0x80(%rbp)
je     148f <main+0x30f>
cmpq   $0x0,-0x88(%rbp)
je     148f <main+0x30f>
cmpq   $0x0,-0x90(%rbp)
jne    14a9 <main+0x329>
lea    0xd57(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1fbd <main+0xe3d>
cmpl   $0x0,-0x48(%rbp)
jne    14d7 <main+0x357>
cmpl   $0x0,-0x4c(%rbp)
jne    14d7 <main+0x357>
lea    0xd7a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1fbd <main+0xe3d>
cmpl   $0x1,-0x48(%rbp)
jne    18a9 <main+0x729>
cmpl   $0x2,-0x8(%rbp)
jne    1505 <main+0x385>
lea    0xd62(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1fbd <main+0xe3d>
cmpl   $0x1,-0x50(%rbp)
jne    1649 <main+0x4c9>
mov    -0x18(%rbp),%esi
lea    0xd7a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xd78(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xd87(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x80(%rbp),%rdi
call   1060 <fgetc@plt>
mov    %eax,-0x30(%rbp)
mov    0x2a99(%rip),%rcx
cmp    (%rcx),%eax
je     15b3 <main+0x433>
mov    -0x30(%rbp),%esi
lea    0xdfe(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmpl   $0x41,-0x30(%rbp)
jl     15ae <main+0x42e>
cmpl   $0x5a,-0x30(%rbp)
jg     15ae <main+0x42e>
mov    -0x30(%rbp),%eax
add    -0x18(%rbp),%eax
mov    $0x1a,%ecx
cltd
idiv   %ecx
add    $0x41,%edx
mov    %edx,-0x9c(%rbp)
mov    -0x88(%rbp),%rdi
mov    -0x9c(%rbp),%edx
lea    0xdb8(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
jmp    153c <main+0x3bc>
mov    -0x88(%rbp),%rdi
call   1030 <fclose@plt>
lea    0xbf8(%rip),%rdi
lea    0xba3(%rip),%rsi
call   10a0 <fopen@plt>
lea    0xd07(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x88(%rbp),%rdi
call   1060 <fgetc@plt>
mov    %eax,-0x30(%rbp)
mov    0x29f2(%rip),%rcx
cmp    (%rcx),%eax
je     1614 <main+0x494>
mov    -0x30(%rbp),%esi
lea    0xd57(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    15e0 <main+0x460>
lea    0xdc7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x88(%rbp),%rdi
call   1030 <fclose@plt>
cmpl   $0x3,-0x8(%rbp)
jne    1644 <main+0x4c4>
movl   $0x0,-0x4(%rbp)
jmp    1fbd <main+0xe3d>
jmp    1649 <main+0x4c9>
cmpl   $0x1,-0x54(%rbp)
jne    1745 <main+0x5c5>
lea    0xb64(%rip),%rdi
lea    0xb0f(%rip),%rsi
call   10a0 <fopen@plt>
lea    0xb5f(%rip),%rdi
lea    0xb55(%rip),%rsi
call   10a0 <fopen@plt>
lea    0xc86(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x88(%rbp),%rdi
call   1060 <fgetc@plt>
mov    %eax,-0x30(%rbp)
mov    0x294b(%rip),%rcx
cmp    (%rcx),%eax
je     1704 <main+0x584>
cmpl   $0x41,-0x30(%rbp)
jl     16ff <main+0x57f>
cmpl   $0x5a,-0x30(%rbp)
jg     16ff <main+0x57f>
mov    -0x30(%rbp),%eax
sub    -0x18(%rbp),%eax
mov    $0x1a,%ecx
cltd
idiv   %ecx
add    $0x41,%edx
mov    %edx,-0xa0(%rbp)
mov    -0x90(%rbp),%rdi
mov    -0xa0(%rbp),%edx
lea    0xc7b(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0xa0(%rbp),%esi
lea    0xc67(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1687 <main+0x507>
lea    0xcd7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x88(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x90(%rbp),%rdi
call   1030 <fclose@plt>
cmpl   $0x3,-0x8(%rbp)
jne    1740 <main+0x5c0>
movl   $0x0,-0x4(%rbp)
jmp    1fbd <main+0xe3d>
jmp    1745 <main+0x5c5>
cmpl   $0x1,-0x58(%rbp)
jne    18a4 <main+0x724>
lea    0xbd7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xa74(%rip),%rdi
lea    0xbe7(%rip),%rsi
call   10a0 <fopen@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0x1b,-0x14(%rbp)
jge    186f <main+0x6ef>
lea    0xa36(%rip),%rdi
lea    0x9e1(%rip),%rsi
call   10a0 <fopen@plt>
mov    -0x88(%rbp),%rdi
call   1060 <fgetc@plt>
mov    %eax,-0x30(%rbp)
mov    0x283e(%rip),%rcx
cmp    (%rcx),%eax
je     1814 <main+0x694>
cmpl   $0x41,-0x30(%rbp)
jl     180f <main+0x68f>
cmpl   $0x5a,-0x30(%rbp)
jg     180f <main+0x68f>
mov    -0x30(%rbp),%eax
sub    -0x14(%rbp),%eax
mov    $0x1a,%ecx
cltd
idiv   %ecx
add    $0x41,%edx
mov    %edx,-0xa4(%rbp)
mov    -0x98(%rbp),%rdi
mov    -0x14(%rbp),%edx
mov    -0xa4(%rbp),%ecx
lea    0xb61(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0xa4(%rbp),%esi
lea    0xb57(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1794 <main+0x614>
lea    0xbc7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmpl   $0x1a,-0x14(%rbp)
jge    1840 <main+0x6c0>
mov    -0x14(%rbp),%esi
add    $0x1,%esi
lea    0xb29(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x98(%rbp),%rdi
lea    0xb94(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x88(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1777 <main+0x5f7>
lea    0xb6c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x90(%rbp),%rdi
call   1030 <fclose@plt>
cmpl   $0x3,-0x8(%rbp)
jne    189f <main+0x71f>
movl   $0x0,-0x4(%rbp)
jmp    1fbd <main+0xe3d>
jmp    18a4 <main+0x724>
jmp    1fbd <main+0xe3d>
cmpl   $0x1,-0x4c(%rbp)
jne    1fb8 <main+0xe38>
mov    -0x18(%rbp),%esi
lea    0xab0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x64(%rbp),%esi
lea    0xaac(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0x8e2(%rip),%rdi
lea    0x908(%rip),%rsi
call   10a0 <fopen@plt>
mov    -0x74(%rbp),%eax
cmp    -0x70(%rbp),%eax
jle    1906 <main+0x786>
mov    -0x74(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x70(%rbp),%eax
mov    %eax,-0x74(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x70(%rbp)
mov    -0x70(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x74(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x24(%rbp),%eax
cltd
idivl  -0x2c(%rbp)
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%eax
mov    -0x28(%rbp),%ecx
imul   -0x2c(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,-0x20(%rbp)
movl   $0x1,-0x38(%rbp)
movl   $0x0,-0x34(%rbp)
movl   $0x0,-0x44(%rbp)
movl   $0x1,-0x40(%rbp)
movl   $0x1,-0x30(%rbp)
mov    -0x44(%rbp),%eax
mov    -0x28(%rbp),%ecx
sub    $0x1,%ecx
imul   -0x40(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x3c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     19d6 <main+0x856>
mov    -0x2c(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x38(%rbp),%eax
mov    -0x28(%rbp),%ecx
imul   -0x34(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x30(%rbp)
mov    -0x34(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x30(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x44(%rbp),%eax
mov    -0x28(%rbp),%ecx
imul   -0x40(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x3c(%rbp)
mov    -0x40(%rbp),%eax
mov    %eax,-0x44(%rbp)
mov    -0x3c(%rbp),%eax
mov    %eax,-0x40(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x24(%rbp),%eax
cltd
idivl  -0x2c(%rbp)
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%eax
mov    -0x28(%rbp),%ecx
imul   -0x2c(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x1c(%rbp)
jmp    1966 <main+0x7e6>
mov    -0x3c(%rbp),%eax
mov    $0x1a,%ecx
cltd
idiv   %ecx
mov    %edx,-0xa8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    1a0b <main+0x88b>
lea    0x98f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1fbd <main+0xe3d>
cmpl   $0x1,-0x50(%rbp)
jne    1b4b <main+0x9cb>
lea    0x9a6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0x893(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x80(%rbp),%rdi
call   1060 <fgetc@plt>
mov    %eax,-0x30(%rbp)
mov    0x25a4(%rip),%rcx
cmp    (%rcx),%eax
je     1ab5 <main+0x935>
mov    -0x30(%rbp),%esi
lea    0x909(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmpl   $0x41,-0x30(%rbp)
jl     1ab0 <main+0x930>
cmpl   $0x5a,-0x30(%rbp)
jg     1ab0 <main+0x930>
mov    -0x30(%rbp),%eax
sub    $0x41,%eax
mov    %eax,-0x30(%rbp)
mov    -0x18(%rbp),%eax
imul   -0x30(%rbp),%eax
add    -0x64(%rbp),%eax
mov    $0x1a,%ecx
cltd
idiv   %ecx
add    $0x41,%edx
mov    %edx,-0xac(%rbp)
mov    -0x88(%rbp),%rdi
mov    -0xac(%rbp),%edx
lea    0x8b6(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
jmp    1a31 <main+0x8b1>
mov    -0x88(%rbp),%rdi
call   1030 <fclose@plt>
lea    0x6f6(%rip),%rdi
lea    0x6a1(%rip),%rsi
call   10a0 <fopen@plt>
lea    0x805(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x88(%rbp),%rdi
call   1060 <fgetc@plt>
mov    %eax,-0x30(%rbp)
mov    0x24f0(%rip),%rcx
cmp    (%rcx),%eax
je     1b16 <main+0x996>
mov    -0x30(%rbp),%esi
lea    0x855(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1ae2 <main+0x962>
lea    0x8c5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x88(%rbp),%rdi
call   1030 <fclose@plt>
cmpl   $0x3,-0x8(%rbp)
jne    1b46 <main+0x9c6>
movl   $0x0,-0x4(%rbp)
jmp    1fbd <main+0xe3d>
jmp    1b4b <main+0x9cb>
cmpl   $0x1,-0x54(%rbp)
jne    1c8a <main+0xb0a>
lea    0x662(%rip),%rdi
lea    0x60d(%rip),%rsi
call   10a0 <fopen@plt>
lea    0x65d(%rip),%rdi
lea    0x675(%rip),%rsi
call   10a0 <fopen@plt>
lea    0x784(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x88(%rbp),%rdi
call   1060 <fgetc@plt>
mov    %eax,-0x30(%rbp)
mov    0x2449(%rip),%rcx
cmp    (%rcx),%eax
je     1c49 <main+0xac9>
cmpl   $0x41,-0x30(%rbp)
jl     1c44 <main+0xac4>
cmpl   $0x5a,-0x30(%rbp)
jg     1c44 <main+0xac4>
mov    -0x30(%rbp),%eax
sub    $0x41,%eax
mov    %eax,-0x30(%rbp)
mov    -0xa8(%rbp),%eax
mov    -0x30(%rbp),%ecx
sub    -0x64(%rbp),%ecx
imul   %ecx,%eax
mov    $0x1a,%ecx
cltd
idiv   %ecx
mov    %edx,-0xb0(%rbp)
mov    -0xb0(%rbp),%eax
add    $0x41,%eax
mov    %eax,-0xb0(%rbp)
cmpl   $0x41,-0xb0(%rbp)
jge    1c15 <main+0xa95>
mov    $0x41,%ecx
sub    -0xb0(%rbp),%ecx
mov    $0x5b,%eax
sub    %ecx,%eax
mov    %eax,-0xb0(%rbp)
mov    -0x90(%rbp),%rdi
mov    -0xb0(%rbp),%edx
lea    0x736(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0xb0(%rbp),%esi
lea    0x722(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1b89 <main+0xa09>
lea    0x792(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x88(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x90(%rbp),%rdi
call   1030 <fclose@plt>
cmpl   $0x3,-0x8(%rbp)
jne    1c85 <main+0xb05>
movl   $0x0,-0x4(%rbp)
jmp    1fbd <main+0xe3d>
jmp    1c8a <main+0xb0a>
cmpl   $0x1,-0x58(%rbp)
jne    1fb3 <main+0xe33>
movl   $0x1a,-0x74(%rbp)
movl   $0x1,-0x14(%rbp)
cmpl   $0x1a,-0x14(%rbp)
jge    1fae <main+0xe2e>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x70(%rbp)
mov    -0x74(%rbp),%eax
cmp    -0x70(%rbp),%eax
jle    1cdc <main+0xb5c>
mov    -0x74(%rbp),%eax
mov    %eax,-0xb8(%rbp)
mov    -0x70(%rbp),%eax
mov    %eax,-0x74(%rbp)
mov    -0xb8(%rbp),%eax
mov    %eax,-0x70(%rbp)
mov    -0x70(%rbp),%eax
mov    %eax,-0xbc(%rbp)
mov    -0x74(%rbp),%eax
mov    %eax,-0xc4(%rbp)
mov    -0xbc(%rbp),%eax
cltd
idivl  -0xc4(%rbp)
mov    %eax,-0xc0(%rbp)
mov    -0xbc(%rbp),%eax
mov    -0xc0(%rbp),%ecx
imul   -0xc4(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0xb4(%rbp)
mov    -0xc4(%rbp),%eax
mov    %eax,-0xb8(%rbp)
movl   $0x1,-0xd0(%rbp)
movl   $0x0,-0xcc(%rbp)
movl   $0x0,-0xdc(%rbp)
movl   $0x1,-0xd8(%rbp)
movl   $0x1,-0xc8(%rbp)
mov    -0xdc(%rbp),%eax
mov    -0xc0(%rbp),%ecx
sub    $0x1,%ecx
imul   -0xd8(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0xd4(%rbp)
cmpl   $0x0,-0xb4(%rbp)
je     1e42 <main+0xcc2>
mov    -0xc4(%rbp),%eax
mov    %eax,-0xbc(%rbp)
mov    -0xb4(%rbp),%eax
mov    %eax,-0xc4(%rbp)
mov    -0xd0(%rbp),%eax
mov    -0xc0(%rbp),%ecx
imul   -0xcc(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0xc8(%rbp)
mov    -0xcc(%rbp),%eax
mov    %eax,-0xd0(%rbp)
mov    -0xc8(%rbp),%eax
mov    %eax,-0xcc(%rbp)
mov    -0xdc(%rbp),%eax
mov    -0xc0(%rbp),%ecx
imul   -0xd8(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0xd4(%rbp)
mov    -0xd8(%rbp),%eax
mov    %eax,-0xdc(%rbp)
mov    -0xd4(%rbp),%eax
mov    %eax,-0xd8(%rbp)
mov    -0xb4(%rbp),%eax
mov    %eax,-0xb8(%rbp)
mov    -0xbc(%rbp),%eax
cltd
idivl  -0xc4(%rbp)
mov    %eax,-0xc0(%rbp)
mov    -0xbc(%rbp),%eax
mov    -0xc0(%rbp),%ecx
imul   -0xc4(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0xb4(%rbp)
jmp    1d78 <main+0xbf8>
mov    -0xd4(%rbp),%eax
mov    $0x1a,%ecx
cltd
idiv   %ecx
mov    %edx,-0xa8(%rbp)
movl   $0x0,-0xe0(%rbp)
cmpl   $0x1a,-0xe0(%rbp)
jge    1f9b <main+0xe1b>
mov    -0xe0(%rbp),%eax
mov    %eax,-0x64(%rbp)
lea    0x341(%rip),%rdi
lea    0x2ec(%rip),%rsi
call   10a0 <fopen@plt>
lea    0x348(%rip),%rdi
lea    0x4bb(%rip),%rsi
call   10a0 <fopen@plt>
mov    -0x88(%rbp),%rdi
call   1060 <fgetc@plt>
mov    %eax,-0xc8(%rbp)
mov    0x2133(%rip),%rcx
cmp    (%rcx),%eax
je     1f5a <main+0xdda>
cmpl   $0x41,-0xc8(%rbp)
jl     1f55 <main+0xdd5>
cmpl   $0x5a,-0xc8(%rbp)
jg     1f55 <main+0xdd5>
mov    -0xc8(%rbp),%eax
sub    $0x41,%eax
mov    %eax,-0xc8(%rbp)
mov    -0xa8(%rbp),%eax
mov    -0xc8(%rbp),%ecx
sub    -0x64(%rbp),%ecx
imul   %ecx,%eax
mov    $0x1a,%ecx
cltd
idiv   %ecx
mov    %edx,-0xe4(%rbp)
mov    -0xe4(%rbp),%eax
add    $0x41,%eax
mov    %eax,-0xe4(%rbp)
cmpl   $0x41,-0xe4(%rbp)
jge    1f3a <main+0xdba>
mov    $0x41,%ecx
sub    -0xe4(%rbp),%ecx
mov    $0x5b,%eax
sub    %ecx,%eax
mov    %eax,-0xe4(%rbp)
mov    -0x98(%rbp),%rdi
mov    -0xe4(%rbp),%edx
lea    0x411(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
jmp    1e9c <main+0xd1c>
mov    -0x98(%rbp),%rdi
lea    0x47a(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x88(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x98(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0xe0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xe0(%rbp)
jmp    1e60 <main+0xce0>
jmp    1fa0 <main+0xe20>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1ca2 <main+0xb22>
jmp    1fb3 <main+0xe33>
jmp    1fb8 <main+0xe38>
jmp    1fbd <main+0xe3d>
mov    -0x4(%rbp),%eax
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
test   %edi,%edi
jle    13de <main+0x22e>
mov    %edi,(%rsp)
mov    %edi,%eax
mov    %rax,0x10(%rsp)
xor    %ebx,%ebx
xor    %eax,%eax
movl   $0x0,0x8(%rsp)
mov    %rsi,0x20(%rsp)
xor    %r12d,%r12d
xor    %r13d,%r13d
xor    %ebp,%ebp
nopl   0x0(%rax)
mov    %eax,0x4(%rsp)
mov    0x20(%rsp),%rax
mov    (%rax,%rbx,8),%r14
mov    %r14,%rdi
lea    0xdf9(%rip),%rsi
call   10a0 <strcmp@plt>
test   %eax,%eax
mov    $0x1,%eax
cmove  %eax,%ebp
mov    $0x1,%r15d
mov    %r14,%rdi
lea    0xddd(%rip),%rsi
call   10a0 <strcmp@plt>
test   %eax,%eax
cmove  %r15d,%r13d
mov    %r14,%rdi
lea    0xfad(%rip),%rsi
call   10a0 <strcmp@plt>
test   %eax,%eax
cmove  %r15d,%r12d
mov    %r14,%rdi
lea    0xdb6(%rip),%rsi
call   10a0 <strcmp@plt>
test   %eax,%eax
mov    0x8(%rsp),%eax
cmove  %r15d,%eax
mov    $0x1,%r15d
mov    %eax,0x8(%rsp)
mov    %r14,%rdi
lea    0xd96(%rip),%rsi
call   10a0 <strcmp@plt>
test   %eax,%eax
mov    0x4(%rsp),%eax
cmove  %r15d,%eax
add    $0x1,%rbx
cmp    %rbx,0x10(%rsp)
jne    11f0 <main+0x40>
mov    %ebp,0x30(%rsp)
mov    %r13d,0x34(%rsp)
mov    %r12d,0x1c(%rsp)
cmpl   $0x2,(%rsp)
mov    0x20(%rsp),%r12
jl     13de <main+0x22e>
mov    %eax,0x4(%rsp)
lea    0xd53(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x1,%ebx
lea    0xd53(%rip),%r14
mov    0x10(%rsp),%rbp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r12,%rbx,8),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    12e0 <main+0x130>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xd1b(%rip),%rdi
lea    0xd1c(%rip),%rsi
call   10d0 <fopen@plt>
test   %rax,%rax
je     13fb <main+0x24b>
mov    %rax,%r13
movl   $0x0,0xc(%rsp)
movl   $0x0,0x2c(%rsp)
lea    0xcf6(%rip),%rsi
lea    0x2c(%rsp),%rdx
mov    %rax,%rdi
call   1070 <fscanf@plt>
mov    %r13,%rdi
call   10c0 <feof@plt>
xor    %r15d,%r15d
test   %eax,%eax
je     140d <main+0x25d>
mov    %r13,%rdi
call   1050 <fclose@plt>
lea    0xcca(%rip),%rdi
lea    0xcbe(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,%r12
lea    0xcbe(%rip),%rdi
lea    0xcc2(%rip),%rbx
mov    %rbx,%rsi
call   10d0 <fopen@plt>
mov    %rax,%r14
lea    0xcb3(%rip),%rdi
mov    %rbx,%rsi
call   10d0 <fopen@plt>
mov    %rax,%rbx
lea    0xcad(%rip),%rdi
lea    0xcb9(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,0x20(%rsp)
test   %r12,%r12
je     1404 <main+0x254>
test   %r14,%r14
je     1404 <main+0x254>
test   %rbx,%rbx
je     1404 <main+0x254>
mov    0x30(%rsp),%edx
mov    %edx,%eax
mov    0x34(%rsp),%ecx
or     %ecx,%eax
jne    144a <main+0x29a>
lea    0xf56(%rip),%rdi
jmp    13e5 <main+0x235>
lea    0xcc5(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xf95(%rip),%rdi
jmp    13e5 <main+0x235>
lea    0xf3c(%rip),%rdi
jmp    13e5 <main+0x235>
xor    %ebx,%ebx
lea    0xc17(%rip),%rbp
lea    0xc(%rsp),%r14
xor    %r15d,%r15d
jmp    143e <main+0x28e>
mov    %r13,%rdi
mov    %rbp,%rsi
mov    %r14,%rdx
call   1070 <fscanf@plt>
mov    %r13,%rdi
call   10c0 <feof@plt>
test   %eax,%eax
jne    1357 <main+0x1a7>
sub    $0x1,%ebx
jae    1420 <main+0x270>
mov    0x2c(%rsp),%r15d
jmp    1420 <main+0x270>
cmp    $0x1,%edx
jne    1462 <main+0x2b2>
cmpl   $0x2,(%rsp)
jne    1502 <main+0x352>
lea    0xe94(%rip),%rdi
jmp    13e5 <main+0x235>
mov    %rbx,0x10(%rsp)
cmp    $0x1,%ecx
jne    13ea <main+0x23a>
lea    0xc19(%rip),%rdi
xor    %ebp,%ebp
mov    %r15d,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0xc(%rsp),%esi
lea    0xc0f(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xb9e(%rip),%rdi
lea    0xbc4(%rip),%rsi
call   10d0 <fopen@plt>
cmp    $0x1a,%r15d
mov    $0x1a,%ebx
mov    %r15d,%eax
cmovl  %ebx,%eax
mov    %r15d,%r9d
cmovl  %r15d,%ebx
cltd
idiv   %ebx
mov    %eax,%esi
mov    $0x1,%edi
test   %edx,%edx
je     1792 <main+0x5e2>
mov    (%rsp),%r8d
mov    0x1c(%rsp),%r10d
nopl   0x0(%rax)
mov    %edx,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
imul   %edi,%esi
mov    %ebp,%r13d
sub    %esi,%r13d
mov    %ecx,%ebx
mov    %edi,%ebp
mov    %r13d,%edi
mov    %eax,%esi
test   %edx,%edx
jne    14e0 <main+0x330>
jmp    17a0 <main+0x5f0>
mov    %rbx,0x10(%rsp)
cmpl   $0x1,0x1c(%rsp)
jne    15b2 <main+0x402>
lea    0xb50(%rip),%rdi
mov    %r15d,%ebx
mov    %r15d,%esi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xd63(%rip),%rdi
call   1040 <puts@plt>
lea    0xd73(%rip),%rdi
call   1040 <puts@plt>
mov    %r12,%rdi
call   1080 <fgetc@plt>
mov    0x2a9b(%rip),%r15
cmp    (%r15),%eax
jne    184a <main+0x69a>
mov    %r14,%rdi
call   1050 <fclose@plt>
lea    0xad5(%rip),%rdi
lea    0xabf(%rip),%rsi
call   10d0 <fopen@plt>
lea    0xd57(%rip),%rdi
call   1040 <puts@plt>
mov    %r14,%rdi
call   1080 <fgetc@plt>
cmp    (%r15),%eax
je     1593 <main+0x3e3>
mov    %eax,%edi
call   1030 <putchar@plt>
jmp    157d <main+0x3cd>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r14,%rdi
call   1050 <fclose@plt>
cmpl   $0x3,(%rsp)
mov    %ebx,%r15d
je     13ea <main+0x23a>
cmpl   $0x1,0x8(%rsp)
jne    162d <main+0x47d>
lea    0xa7a(%rip),%rdi
lea    0xa64(%rip),%rsi
call   10d0 <fopen@plt>
lea    0xa75(%rip),%rdi
lea    0xa6b(%rip),%rsi
call   10d0 <fopen@plt>
lea    0xc84(%rip),%rdi
call   1040 <puts@plt>
mov    %r14,%rdi
call   1080 <fgetc@plt>
mov    0x29ee(%rip),%r13
cmp    0x0(%r13),%eax
mov    0x10(%rsp),%r12
jne    174e <main+0x59e>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r14,%rdi
call   1050 <fclose@plt>
mov    %r12,%rdi
call   1050 <fclose@plt>
cmpl   $0x3,(%rsp)
je     13ea <main+0x23a>
cmpl   $0x1,0x4(%rsp)
jne    13ea <main+0x23a>
lea    0xc07(%rip),%rdi
call   1040 <puts@plt>
lea    0xa09(%rip),%rdi
lea    0xa23(%rip),%rsi
call   10d0 <fopen@plt>
mov    0x298a(%rip),%rbx
lea    0xa13(%rip),%r12
xor    %r15d,%r15d
mov    0x20(%rsp),%r13
jmp    1697 <main+0x4e7>
mov    $0xa,%edi
mov    %r13,%rsi
call   1090 <fputc@plt>
mov    %r14,%rdi
call   1050 <fclose@plt>
mov    %r12d,%r15d
cmp    $0x1b,%r12d
mov    %rbx,%r12
mov    %rbp,%rbx
je     1831 <main+0x681>
lea    0x99c(%rip),%rdi
lea    0x986(%rip),%rsi
call   10d0 <fopen@plt>
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1080 <fgetc@plt>
cmp    (%rbx),%eax
je     1708 <main+0x558>
lea    -0x41(%rax),%ecx
cmp    $0x19,%ecx
ja     16b0 <main+0x500>
sub    %r15d,%eax
cltq
imul   $0x4ec4ec4f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%edx
lea    (%rdx,%rdx,4),%edx
add    %ecx,%edx
neg    %edx
lea    (%rax,%rdx,1),%ebp
add    $0x41,%ebp
mov    %r13,%rdi
mov    %r12,%rsi
mov    %r15d,%edx
mov    %ebp,%ecx
xor    %eax,%eax
call   10b0 <fprintf@plt>
mov    %ebp,%edi
call   1030 <putchar@plt>
jmp    16b0 <main+0x500>
mov    %rbx,%rbp
mov    %r12,%rbx
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%r15),%r12d
cmp    $0x19,%r15d
ja     166f <main+0x4bf>
lea    0x958(%rip),%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1060 <printf@plt>
jmp    166f <main+0x4bf>
mov    %r14,%rdi
call   1080 <fgetc@plt>
cmp    0x0(%r13),%eax
je     1609 <main+0x459>
lea    -0x41(%rax),%ecx
cmp    $0x19,%ecx
ja     173c <main+0x58c>
sub    %r15d,%eax
cltq
imul   $0x4ec4ec4f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%edx
lea    (%rdx,%rdx,4),%edx
add    %ecx,%edx
neg    %edx
lea    (%rax,%rdx,1),%ebp
add    $0x41,%ebp
mov    %ebp,%edi
mov    %r12,%rsi
call   1090 <fputc@plt>
mov    %ebp,%edi
call   1030 <putchar@plt>
jmp    173c <main+0x58c>
sub    %esi,%edi
mov    %edi,%r13d
mov    (%rsp),%r8d
mov    0x1c(%rsp),%r10d
cmp    $0x2,%r8d
jne    17b2 <main+0x602>
lea    0xa5f(%rip),%rdi
jmp    13e5 <main+0x235>
cmp    $0x1,%r10d
jne    18bc <main+0x70c>
mov    %r9d,%ebx
lea    0xa25(%rip),%rdi
call   1040 <puts@plt>
lea    0xadb(%rip),%rdi
call   1040 <puts@plt>
mov    %r12,%rbp
mov    %r12,%rdi
call   1080 <fgetc@plt>
mov    0x27ff(%rip),%r12
cmp    (%r12),%eax
jne    1aa7 <main+0x8f7>
mov    %r14,%rdi
call   1050 <fclose@plt>
lea    0x838(%rip),%rdi
lea    0x822(%rip),%rsi
call   10d0 <fopen@plt>
lea    0xaba(%rip),%rdi
call   1040 <puts@plt>
mov    %r14,%rdi
call   1080 <fgetc@plt>
cmp    (%r12),%eax
je     18a0 <main+0x6f0>
mov    %eax,%edi
call   1030 <putchar@plt>
jmp    181a <main+0x66a>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x10(%rsp),%rdi
call   1050 <fclose@plt>
jmp    13ea <main+0x23a>
mov    %eax,%ebp
jmp    1861 <main+0x6b1>
mov    %r12,%rdi
call   1080 <fgetc@plt>
mov    %eax,%ebp
cmp    (%r15),%eax
je     1556 <main+0x3a6>
mov    %ebp,%edi
call   1030 <putchar@plt>
lea    -0x41(%rbp),%eax
cmp    $0x19,%eax
ja     184e <main+0x69e>
add    %ebx,%ebp
movslq %ebp,%rdi
imul   $0x4ec4ec4f,%rdi,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x23,%rax
add    %ecx,%eax
lea    (%rax,%rax,4),%ecx
lea    (%rcx,%rcx,4),%ecx
add    %eax,%ecx
sub    %ecx,%edi
add    $0x41,%edi
mov    %r14,%rsi
call   1090 <fputc@plt>
jmp    184e <main+0x69e>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r14,%rdi
call   1050 <fclose@plt>
cmpl   $0x3,(%rsp)
je     13ea <main+0x23a>
cmpl   $0x1,0x8(%rsp)
jne    1933 <main+0x783>
lea    0x770(%rip),%rdi
lea    0x75a(%rip),%rsi
call   10d0 <fopen@plt>
lea    0x76b(%rip),%rdi
lea    0x783(%rip),%rsi
call   10d0 <fopen@plt>
lea    0x97a(%rip),%rdi
call   1040 <puts@plt>
mov    %r14,%rdi
call   1080 <fgetc@plt>
mov    0x26e4(%rip),%r15
cmp    (%r15),%eax
jne    1b0a <main+0x95a>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r14,%rdi
call   1050 <fclose@plt>
mov    0x10(%rsp),%rdi
call   1050 <fclose@plt>
cmpl   $0x3,(%rsp)
je     13ea <main+0x23a>
cmpl   $0x1,0x4(%rsp)
jne    13ea <main+0x23a>
mov    $0x1a,%edi
mov    $0x1,%ebp
mov    0x2699(%rip),%r15
jmp    1965 <main+0x7b5>
mov    0x4(%rsp),%ebp
add    $0x1,%ebp
cmp    $0x1a,%ebp
mov    0x8(%rsp),%edi
je     13ea <main+0x23a>
cmp    %ebp,%edi
mov    %ebp,%eax
cmovg  %edi,%eax
cmovg  %ebp,%edi
cltd
idiv   %edi
mov    %eax,%esi
test   %edx,%edx
mov    %edi,0x8(%rsp)
mov    %ebp,0x4(%rsp)
je     19ae <main+0x7fe>
mov    %edx,%ecx
mov    $0x1,%ebp
xor    %r8d,%r8d
nopw   0x0(%rax,%rax,1)
mov    %edi,%eax
cltd
idiv   %ecx
imul   %ebp,%esi
mov    %r8d,%ebx
sub    %esi,%ebx
mov    %ebp,%r8d
mov    %ebx,%ebp
mov    %ecx,%edi
mov    %edx,%ecx
mov    %eax,%esi
test   %edx,%edx
jne    1990 <main+0x7e0>
jmp    19b5 <main+0x805>
mov    $0x1,%ebx
sub    %esi,%ebx
movslq %ebx,%r12
imul   $0x4ec4ec4f,%r12,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x23,%rax
add    %ecx,%eax
lea    (%rax,%rax,4),%ecx
lea    (%rcx,%rcx,4),%ecx
add    %eax,%ecx
sub    %ecx,%r12d
xor    %r13d,%r13d
mov    0x20(%rsp),%rbx
lea    0x654(%rip),%rbp
jmp    1a1b <main+0x86b>
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
mov    %rbx,%rsi
call   1090 <fputc@plt>
mov    %r14,%rdi
call   1050 <fclose@plt>
mov    %rbx,%rdi
call   1050 <fclose@plt>
add    $0x1,%r13d
cmp    $0x1a,%r13d
je     1951 <main+0x7a1>
mov    %r13d,0xc(%rsp)
mov    %rbp,%rdi
lea    0x601(%rip),%rsi
call   10d0 <fopen@plt>
lea    0x61e(%rip),%rdi
lea    0x638(%rip),%rsi
call   10d0 <fopen@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
call   1080 <fgetc@plt>
cmp    (%r15),%eax
je     19f0 <main+0x840>
add    $0xffffffbf,%eax
cmp    $0x19,%eax
ja     1a50 <main+0x8a0>
sub    0xc(%rsp),%eax
imul   %r12d,%eax
cltq
imul   $0x4ec4ec4f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%edx
lea    (%rdx,%rdx,4),%edx
add    %ecx,%edx
mov    %eax,%ecx
sub    %edx,%ecx
lea    0x5b(%rcx),%esi
neg    %edx
test   %ecx,%ecx
lea    0x41(%rax,%rdx,1),%edi
cmovs  %esi,%edi
mov    %rbx,%rsi
call   1090 <fputc@plt>
jmp    1a50 <main+0x8a0>
mov    %eax,%r15d
jmp    1ac1 <main+0x911>
mov    %rbp,%rdi
call   1080 <fgetc@plt>
mov    %eax,%r15d
cmp    (%r12),%eax
je     17f3 <main+0x643>
mov    %r15d,%edi
call   1030 <putchar@plt>
add    $0xffffffbf,%r15d
cmp    $0x19,%r15d
ja     1aac <main+0x8fc>
imul   %ebx,%r15d
add    0xc(%rsp),%r15d
movslq %r15d,%rdi
imul   $0x4ec4ec4f,%rdi,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x23,%rax
add    %ecx,%eax
lea    (%rax,%rax,4),%ecx
lea    (%rcx,%rcx,4),%ecx
add    %eax,%ecx
sub    %ecx,%edi
add    $0x41,%edi
mov    %r14,%rsi
call   1090 <fputc@plt>
jmp    1aac <main+0x8fc>
movslq %r13d,%r12
imul   $0x4ec4ec4f,%r12,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%edx
lea    (%rdx,%rdx,4),%edx
add    %ecx,%edx
sub    %edx,%r12d
jmp    1b3f <main+0x98f>
mov    %r14,%rdi
call   1080 <fgetc@plt>
cmp    (%r15),%eax
je     190d <main+0x75d>
add    $0xffffffbf,%eax
cmp    $0x19,%eax
ja     1b2e <main+0x97e>
sub    0xc(%rsp),%eax
imul   %r12d,%eax
cltq
imul   $0x4ec4ec4f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%edx
lea    (%rdx,%rdx,4),%edx
add    %ecx,%edx
mov    %eax,%ecx
sub    %edx,%ecx
lea    0x5b(%rcx),%esi
neg    %edx
test   %ecx,%ecx
lea    0x41(%rax,%rdx,1),%ebp
cmovs  %esi,%ebp
mov    %ebp,%edi
mov    0x10(%rsp),%rsi
call   1090 <fputc@plt>
mov    %ebp,%edi
call   1030 <putchar@plt>
jmp    1b2e <main+0x97e>

LLVM IR (-O0):
@.str = [3 x i8] c"-c\00"
@.str.1 = [3 x i8] c"-a\00"
@.str.2 = [3 x i8] c"-e\00"
@.str.3 = [3 x i8] c"-d\00"
@.str.4 = [3 x i8] c"-k\00"
@.str.5 = [19 x i8] c"Podane Argumenty: \00"
@.str.6 = [4 x i8] c"%s \00"
@.str.7 = [2 x i8] c"\0A\00"
@.str.8 = [322 x i8] c"Za malo podanych argumentow!\0A\0A Pierw wybierz szyfr:\0A -c (szyfr Cezara),\0A -a (szyfr afiniczny),\0A\0A A nast\C4\99pnie co chcesz zrobi\C4\87:\0A -e (szyfrowanie),\0A -d (odszyfrowywanie),\0A -j (kryptoanaliza z tekstem jawnym),\0A -k (kryptoanaliza wy\C5\82\C4\85cznie w oparciu o kryptogram).\0A\0A Przyk\C5\82ad: ./cezar.c -c -e\0A\00"
@.str.9 = [8 x i8] c"key.txt\00"
@.str.10 = [2 x i8] c"r\00"
@.str.11 = [63 x i8] c"Nie mozna otworzyc pliku z kluczem! Upewnij sie ze instnieje.\0A\00"
@.str.12 = [3 x i8] c"%d\00"
@.str.13 = [10 x i8] c"plain.txt\00"
@.str.14 = [11 x i8] c"crypto.txt\00"
@.str.15 = [3 x i8] c"r+\00"
@.str.16 = [12 x i8] c"decrypt.txt\00"
@.str.17 = [19 x i8] c"cryptoanalysis.txt\00"
@.str.18 = [2 x i8] c"w\00"
@.str.19 = [81 x i8] c"Nie mozna otworzyc ktoregos z plikow, upewnij sie ze wymagane plioki istnieja!!\0A\00"
@.str.20 = [22 x i8] c"nie wybrales szyfru!\0A\00"
@.str.21 = [63 x i8] c"Zapomniales podac co chcesz zrobic przy pomocy szyfru Cezara!\0A\00"
@.str.22 = [12 x i8] c"Klucz : %d\0A\00"
@.str.23 = [29 x i8] c"\0ASzyfrowanie szyfrem Cezara\0A\00"
@.str.24 = [36 x i8] c"\0ATekst znajdujacy sie w plain.txt:\0A\00"
@EOF = global i32 0
@.str.25 = [3 x i8] c"%c\00"
@.str.26 = [38 x i8] c"Tekst w crypto.txt po zaszyfrowaniu:\0A\00"
@.str.27 = [39 x i8] c"Tekst w decrypt.txt po odszyfrowaniu:\0A\00"
@.str.28 = [37 x i8] c"Kryptoanaliza za pomoca kryptogramu\0A\00"
@.str.29 = [3 x i8] c"a+\00"
@.str.30 = [13 x i8] c"Klucz %d: %c\00"
@.str.31 = [11 x i8] c"Klucz %d: \00"
@.str.32 = [13 x i8] c"Klucz 1: %d\0A\00"
@.str.33 = [13 x i8] c"Klucz 2: %d\0A\00"
@.str.34 = [59 x i8] c"nie podales co chcesz zrobic uzywajhac szyfru afinicznego\0A\00"
@.str.35 = [34 x i8] c"\0ASzyfrowanie szyfrem Afinicznym\0A\0A\00"
@.str.36 = [35 x i8] c"Tekst znajdujacy sie w plain.txt:\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32*
%25 = alloca i32
%26 = alloca i32
%27 = alloca i32
%28 = alloca i32
%29 = alloca i32
%30 = alloca i32*
%31 = alloca i32*
%32 = alloca i32*
%33 = alloca i32*
%34 = alloca i32
%35 = alloca i32
%36 = alloca i32
%37 = alloca i32
%38 = alloca i32
%39 = alloca i32
%40 = alloca i32
%41 = alloca i32
%42 = alloca i32
%43 = alloca i32
%44 = alloca i32
%45 = alloca i32
%46 = alloca i32
%47 = alloca i32
%48 = alloca i32
%49 = alloca i32
%50 = alloca i32
%51 = alloca i32
%52 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %7
store i32 0, i32* %19
store i32 0, i32* %20
store i32 0, i32* %21
store i32 0, i32* %22
store i32 0, i32* %23
store i32 0, i32* %6
br label %53
53: ; preds = %103, %2
%54 = load i32, i32* %6
%55 = load i32, i32* %4
%56 = icmp slt i32 %54, %55
br i1 %56, label %57, label %106
57: ; preds = %53
%58 = load i8**, i8*** %5
%59 = load i32, i32* %6
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds i8*, i8** %58, i64 %60
%62 = load i8*, i8** %61
%63 = call i32 @strcmp(i8* %62, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%64 = icmp ne i32 %63, 0
br i1 %64, label %66, label %65
65: ; preds = %57
store i32 1, i32* %19
br label %66
66: ; preds = %65, %57
%67 = load i8**, i8*** %5
%68 = load i32, i32* %6
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds i8*, i8** %67, i64 %69
%71 = load i8*, i8** %70
%72 = call i32 @strcmp(i8* %71, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%73 = icmp ne i32 %72, 0
br i1 %73, label %75, label %74
74: ; preds = %66
store i32 1, i32* %20
br label %75
75: ; preds = %74, %66
%76 = load i8**, i8*** %5
%77 = load i32, i32* %6
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds i8*, i8** %76, i64 %78
%80 = load i8*, i8** %79
%81 = call i32 @strcmp(i8* %80, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%82 = icmp ne i32 %81, 0
br i1 %82, label %84, label %83
83: ; preds = %75
store i32 1, i32* %21
br label %84
84: ; preds = %83, %75
%85 = load i8**, i8*** %5
%86 = load i32, i32* %6
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds i8*, i8** %85, i64 %87
%89 = load i8*, i8** %88
%90 = call i32 @strcmp(i8* %89, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%91 = icmp ne i32 %90, 0
br i1 %91, label %93, label %92
92: ; preds = %84
store i32 1, i32* %22
br label %93
93: ; preds = %92, %84
%94 = load i8**, i8*** %5
%95 = load i32, i32* %6
%96 = sext i32 %95 to i64
%97 = getelementptr inbounds i8*, i8** %94, i64 %96
%98 = load i8*, i8** %97
%99 = call i32 @strcmp(i8* %98, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%100 = icmp ne i32 %99, 0
br i1 %100, label %102, label %101
101: ; preds = %93
store i32 1, i32* %23
br label %102
102: ; preds = %101, %93
br label %103
103: ; preds = %102
%104 = load i32, i32* %6
%105 = add nsw i32 %104, 1
store i32 %105, i32* %6
br label %53
106: ; preds = %53
%107 = load i32, i32* %4
%108 = icmp sge i32 %107, 2
br i1 %108, label %109, label %127
109: ; preds = %106
%110 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0))
store i32 1, i32* %6
br label %111
111: ; preds = %122, %109
%112 = load i32, i32* %6
%113 = load i32, i32* %4
%114 = icmp slt i32 %112, %113
br i1 %114, label %115, label %125
115: ; preds = %111
%116 = load i8**, i8*** %5
%117 = load i32, i32* %6
%118 = sext i32 %117 to i64
%119 = getelementptr inbounds i8*, i8** %116, i64 %118
%120 = load i8*, i8** %119
%121 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8* %120)
br label %122
122: ; preds = %115
%123 = load i32, i32* %6
%124 = add nsw i32 %123, 1
store i32 %124, i32* %6
br label %111
125: ; preds = %111
%126 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
br label %129
127: ; preds = %106
%128 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([322 x i8], [322 x i8]* @.str.8, i64 0, i64 0))
store i32 0, i32* %3
br label %639
129: ; preds = %125
%130 = call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
store i32* %130, i32** %24
%131 = load i32*, i32** %24
%132 = icmp eq i32* %131, null
br i1 %132, label %133, label %135
133: ; preds = %129
%134 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.11, i64 0, i64 0))
store i32 0, i32* %3
br label %639
135: ; preds = %129
store i32 0, i32* %25
store i32 0, i32* %7
store i32 0, i32* %26
store i32 0, i32* %27
%136 = load i32*, i32** %24
%137 = call i32 @fscanf(i32* %136, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), i32* %27)
br label %138
138: ; preds = %148, %135
%139 = load i32*, i32** %24
%140 = call i32 @feof(i32* %139)
%141 = icmp ne i32 %140, 0
%142 = xor i1 %141, true
br i1 %142, label %143, label %153
143: ; preds = %138
%144 = load i32, i32* %26
%145 = icmp eq i32 %144, 0
br i1 %145, label %146, label %148
146: ; preds = %143
%147 = load i32, i32* %27
store i32 %147, i32* %7
br label %148
148: ; preds = %146, %143
%149 = load i32*, i32** %24
%150 = call i32 @fscanf(i32* %149, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), i32* %25)
%151 = load i32, i32* %26
%152 = add nsw i32 %151, 1
store i32 %152, i32* %26
br label %138
153: ; preds = %138
%154 = load i32*, i32** %24
%155 = call i32 @fclose(i32* %154)
%156 = load i32, i32* %7
store i32 %156, i32* %28
store i32 26, i32* %29
%157 = call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
store i32* %157, i32** %30
%158 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0))
store i32* %158, i32** %31
%159 = call i32* @fopen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0))
store i32* %159, i32** %32
%160 = call i32* @fopen(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.18, i64 0, i64 0))
store i32* %160, i32** %33
%161 = load i32*, i32** %30
%162 = icmp eq i32* %161, null
br i1 %162, label %169, label %163
163: ; preds = %153
%164 = load i32*, i32** %31
%165 = icmp eq i32* %164, null
br i1 %165, label %169, label %166
166: ; preds = %163
%167 = load i32*, i32** %32
%168 = icmp eq i32* %167, null
br i1 %168, label %169, label %171
169: ; preds = %166, %163, %153
%170 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.19, i64 0, i64 0))
store i32 0, i32* %3
br label %639
171: ; preds = %166
%172 = load i32, i32* %19
%173 = icmp eq i32 %172, 0
br i1 %173, label %174, label %179
174: ; preds = %171
%175 = load i32, i32* %20
%176 = icmp eq i32 %175, 0
br i1 %176, label %177, label %179
177: ; preds = %174
%178 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.20, i64 0, i64 0))
store i32 0, i32* %3
br label %639
179: ; preds = %174, %171
%180 = load i32, i32* %19
%181 = icmp eq i32 %180, 1
br i1 %181, label %182, label %339
182: ; preds = %179
%183 = load i32, i32* %4
%184 = icmp eq i32 %183, 2
br i1 %184, label %185, label %187
185: ; preds = %182
%186 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.21, i64 0, i64 0))
store i32 0, i32* %3
br label %639
187: ; preds = %182
%188 = load i32, i32* %21
%189 = icmp eq i32 %188, 1
br i1 %189, label %190, label %239
190: ; preds = %187
%191 = load i32, i32* %7
%192 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.22, i64 0, i64 0), i32 %191)
%193 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.23, i64 0, i64 0))
%194 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.24, i64 0, i64 0))
br label %195
195: ; preds = %217, %190
%196 = load i32*, i32** %30
%197 = call i32 @fgetc(i32* %196)
store i32 %197, i32* %13
%198 = load i32, i32* @EOF
%199 = icmp ne i32 %197, %198
br i1 %199, label %200, label %218
200: ; preds = %195
%201 = load i32, i32* %13
%202 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.25, i64 0, i64 0), i32 %201)
%203 = load i32, i32* %13
%204 = icmp sge i32 %203, 65
br i1 %204, label %205, label %217
205: ; preds = %200
%206 = load i32, i32* %13
%207 = icmp sle i32 %206, 90
br i1 %207, label %208, label %217
208: ; preds = %205
%209 = load i32, i32* %13
%210 = load i32, i32* %7
%211 = add nsw i32 %209, %210
%212 = srem i32 %211, 26
%213 = add nsw i32 65, %212
store i32 %213, i32* %34
%214 = load i32*, i32** %31
%215 = load i32, i32* %34
%216 = call i32 (i32*, i8*, ...) @fprintf(i32* %214, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.25, i64 0, i64 0), i32 %215)
br label %217
217: ; preds = %208, %205, %200
br label %195
218: ; preds = %195
%219 = load i32*, i32** %31
%220 = call i32 @fclose(i32* %219)
%221 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%222 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.26, i64 0, i64 0))
br label %223
223: ; preds = %228, %218
%224 = load i32*, i32** %31
%225 = call i32 @fgetc(i32* %224)
store i32 %225, i32* %13
%226 = load i32, i32* @EOF
%227 = icmp ne i32 %225, %226
br i1 %227, label %228, label %231
228: ; preds = %223
%229 = load i32, i32* %13
%230 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.25, i64 0, i64 0), i32 %229)
br label %223
231: ; preds = %223
%232 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%233 = load i32*, i32** %31
%234 = call i32 @fclose(i32* %233)
%235 = load i32, i32* %4
%236 = icmp eq i32 %235, 3
br i1 %236, label %237, label %238
237: ; preds = %231
store i32 0, i32* %3
br label %639
238: ; preds = %231
br label %239
239: ; preds = %238, %187
%240 = load i32, i32* %22
%241 = icmp eq i32 %240, 1
br i1 %241, label %242, label %279
242: ; preds = %239
%243 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%244 = call i32* @fopen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0))
%245 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.27, i64 0, i64 0))
br label %246
246: ; preds = %268, %242
%247 = load i32*, i32** %31
%248 = call i32 @fgetc(i32* %247)
store i32 %248, i32* %13
%249 = load i32, i32* @EOF
%250 = icmp ne i32 %248, %249
br i1 %250, label %251, label %269
251: ; preds = %246
%252 = load i32, i32* %13
%253 = icmp sge i32 %252, 65
br i1 %253, label %254, label %268
254: ; preds = %251
%255 = load i32, i32* %13
%256 = icmp sle i32 %255, 90
br i1 %256, label %257, label %268
257: ; preds = %254
%258 = load i32, i32* %13
%259 = load i32, i32* %7
%260 = sub nsw i32 %258, %259
%261 = srem i32 %260, 26
%262 = add nsw i32 %261, 65
store i32 %262, i32* %35
%263 = load i32*, i32** %32
%264 = load i32, i32* %35
%265 = call i32 (i32*, i8*, ...) @fprintf(i32* %263, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.25, i64 0, i64 0), i32 %264)
%266 = load i32, i32* %35
%267 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.25, i64 0, i64 0), i32 %266)
br label %268
268: ; preds = %257, %254, %251
br label %246
269: ; preds = %246
%270 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%271 = load i32*, i32** %31
%272 = call i32 @fclose(i32* %271)
%273 = load i32*, i32** %32
%274 = call i32 @fclose(i32* %273)
%275 = load i32, i32* %4
%276 = icmp eq i32 %275, 3
br i1 %276, label %277, label %278
277: ; preds = %269
store i32 0, i32* %3
br label %639
278: ; preds = %269
br label %279
279: ; preds = %278, %239
%280 = load i32, i32* %23
%281 = icmp eq i32 %280, 1
br i1 %281, label %282, label %338
282: ; preds = %279
%283 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.28, i64 0, i64 0))
%284 = call i32* @fopen(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.29, i64 0, i64 0))
store i32 0, i32* %6
br label %285
285: ; preds = %327, %282
%286 = load i32, i32* %6
%287 = icmp slt i32 %286, 27
br i1 %287, label %288, label %330
288: ; preds = %285
%289 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
br label %290
290: ; preds = %313, %288
%291 = load i32*, i32** %31
%292 = call i32 @fgetc(i32* %291)
store i32 %292, i32* %13
%293 = load i32, i32* @EOF
%294 = icmp ne i32 %292, %293
br i1 %294, label %295, label %314
295: ; preds = %290
%296 = load i32, i32* %13
%297 = icmp sge i32 %296, 65
br i1 %297, label %298, label %313
298: ; preds = %295
%299 = load i32, i32* %13
%300 = icmp sle i32 %299, 90
br i1 %300, label %301, label %313
301: ; preds = %298
%302 = load i32, i32* %13
%303 = load i32, i32* %6
%304 = sub nsw i32 %302, %303
%305 = srem i32 %304, 26
%306 = add nsw i32 %305, 65
store i32 %306, i32* %36
%307 = load i32*, i32** %33
%308 = load i32, i32* %6
%309 = load i32, i32* %36
%310 = call i32 (i32*, i8*, ...) @fprintf(i32* %307, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.30, i64 0, i64 0), i32 %308, i32 %309)
%311 = load i32, i32* %36
%312 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.25, i64 0, i64 0), i32 %311)
br label %313
313: ; preds = %301, %298, %295
br label %290
314: ; preds = %290
%315 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%316 = load i32, i32* %6
%317 = icmp slt i32 %316, 26
br i1 %317, label %318, label %322
318: ; preds = %314
%319 = load i32, i32* %6
%320 = add nsw i32 %319, 1
%321 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.31, i64 0, i64 0), i32 %320)
br label %322
322: ; preds = %318, %314
%323 = load i32*, i32** %33
%324 = call i32 (i32*, i8*, ...) @fprintf(i32* %323, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%325 = load i32*, i32** %31
%326 = call i32 @fclose(i32* %325)
br label %327
327: ; preds = %322
%328 = load i32, i32* %6
%329 = add nsw i32 %328, 1
store i32 %329, i32* %6
br label %285
330: ; preds = %285
%331 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%332 = load i32*, i32** %32
%333 = call i32 @fclose(i32* %332)
%334 = load i32, i32* %4
%335 = icmp eq i32 %334, 3
br i1 %335, label %336, label %337
336: ; preds = %330
store i32 0, i32* %3
br label %639
337: ; preds = %330
br label %338
338: ; preds = %337, %279
br label %639
339: ; preds = %179
%340 = load i32, i32* %20
%341 = icmp eq i32 %340, 1
br i1 %341, label %342, label %638
342: ; preds = %339
%343 = load i32, i32* %7
%344 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.32, i64 0, i64 0), i32 %343)
%345 = load i32, i32* %25
%346 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.33, i64 0, i64 0), i32 %345)
%347 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.18, i64 0, i64 0))
%348 = load i32, i32* %29
%349 = load i32, i32* %28
%350 = icmp sgt i32 %348, %349
br i1 %350, label %351, label %355
351: ; preds = %342
%352 = load i32, i32* %29
store i32 %352, i32* %9
%353 = load i32, i32* %28
store i32 %353, i32* %29
%354 = load i32, i32* %9
store i32 %354, i32* %28
br label %355
355: ; preds = %351, %342
%356 = load i32, i32* %28
store i32 %356, i32* %10
%357 = load i32, i32* %29
store i32 %357, i32* %12
%358 = load i32, i32* %10
%359 = load i32, i32* %12
%360 = sdiv i32 %358, %359
store i32 %360, i32* %11
%361 = load i32, i32* %10
%362 = load i32, i32* %11
%363 = load i32, i32* %12
%364 = mul nsw i32 %362, %363
%365 = sub nsw i32 %361, %364
store i32 %365, i32* %8
%366 = load i32, i32* %12
store i32 %366, i32* %9
store i32 1, i32* %15
store i32 0, i32* %14
store i32 0, i32* %18
store i32 1, i32* %17
store i32 1, i32* %13
%367 = load i32, i32* %18
%368 = load i32, i32* %11
%369 = sub nsw i32 %368, 1
%370 = load i32, i32* %17
%371 = mul nsw i32 %369, %370
%372 = sub nsw i32 %367, %371
store i32 %372, i32* %16
br label %373
373: ; preds = %376, %355
%374 = load i32, i32* %8
%375 = icmp ne i32 %374, 0
br i1 %375, label %376, label %402
376: ; preds = %373
%377 = load i32, i32* %12
store i32 %377, i32* %10
%378 = load i32, i32* %8
store i32 %378, i32* %12
%379 = load i32, i32* %15
%380 = load i32, i32* %11
%381 = load i32, i32* %14
%382 = mul nsw i32 %380, %381
%383 = sub nsw i32 %379, %382
store i32 %383, i32* %13
%384 = load i32, i32* %14
store i32 %384, i32* %15
%385 = load i32, i32* %13
store i32 %385, i32* %14
%386 = load i32, i32* %18
%387 = load i32, i32* %11
%388 = load i32, i32* %17
%389 = mul nsw i32 %387, %388
%390 = sub nsw i32 %386, %389
store i32 %390, i32* %16
%391 = load i32, i32* %17
store i32 %391, i32* %18
%392 = load i32, i32* %16
store i32 %392, i32* %17
%393 = load i32, i32* %8
store i32 %393, i32* %9
%394 = load i32, i32* %10
%395 = load i32, i32* %12
%396 = sdiv i32 %394, %395
store i32 %396, i32* %11
%397 = load i32, i32* %10
%398 = load i32, i32* %11
%399 = load i32, i32* %12
%400 = mul nsw i32 %398, %399
%401 = sub nsw i32 %397, %400
store i32 %401, i32* %8
br label %373
402: ; preds = %373
%403 = load i32, i32* %16
%404 = srem i32 %403, 26
store i32 %404, i32* %37
%405 = load i32, i32* %4
%406 = icmp eq i32 %405, 2
br i1 %406, label %407, label %409
407: ; preds = %402
%408 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.34, i64 0, i64 0))
store i32 0, i32* %3
br label %639
409: ; preds = %402
%410 = load i32, i32* %21
%411 = icmp eq i32 %410, 1
br i1 %411, label %412, label %463
412: ; preds = %409
%413 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.35, i64 0, i64 0))
%414 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.36, i64 0, i64 0))
br label %415
415: ; preds = %441, %412
%416 = load i32*, i32** %30
%417 = call i32 @fgetc(i32* %416)
store i32 %417, i32* %13
%418 = load i32, i32* @EOF
%419 = icmp ne i32 %417, %418
br i1 %419, label %420, label %442
420: ; preds = %415
%421 = load i32, i32* %13
%422 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.25, i64 0, i64 0), i32 %421)
%423 = load i32, i32* %13
%424 = icmp sge i32 %423, 65
br i1 %424, label %425, label %441
425: ; preds = %420
%426 = load i32, i32* %13
%427 = icmp sle i32 %426, 90
br i1 %427, label %428, label %441
428: ; preds = %425
%429 = load i32, i32* %13
%430 = sub nsw i32 %429, 65
store i32 %430, i32* %13
%431 = load i32, i32* %7
%432 = load i32, i32* %13
%433 = mul nsw i32 %431, %432
%434 = load i32, i32* %25
%435 = add nsw i32 %433, %434
%436 = srem i32 %435, 26
%437 = add nsw i32 %436, 65
store i32 %437, i32* %38
%438 = load i32*, i32** %31
%439 = load i32, i32* %38
%440 = call i32 (i32*, i8*, ...) @fprintf(i32* %438, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.25, i64 0, i64 0), i32 %439)
br label %441
441: ; preds = %428, %425, %420
br label %415
442: ; preds = %415
%443 = load i32*, i32** %31
%444 = call i32 @fclose(i32* %443)
%445 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%446 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.26, i64 0, i64 0))
br label %447
447: ; preds = %452, %442
%448 = load i32*, i32** %31
%449 = call i32 @fgetc(i32* %448)
store i32 %449, i32* %13
%450 = load i32, i32* @EOF
%451 = icmp ne i32 %449, %450
br i1 %451, label %452, label %455
452: ; preds = %447
%453 = load i32, i32* %13
%454 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.25, i64 0, i64 0), i32 %453)
br label %447
455: ; preds = %447
%456 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%457 = load i32*, i32** %31
%458 = call i32 @fclose(i32* %457)
%459 = load i32, i32* %4
%460 = icmp eq i32 %459, 3
br i1 %460, label %461, label %462
461: ; preds = %455
store i32 0, i32* %3
br label %639
462: ; preds = %455
br label %463
463: ; preds = %462, %409
%464 = load i32, i32* %22
%465 = icmp eq i32 %464, 1
br i1 %465, label %466, label %515
466: ; preds = %463
%467 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%468 = call i32* @fopen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.18, i64 0, i64 0))
%469 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.27, i64 0, i64 0))
br label %470
470: ; preds = %504, %466
%471 = load i32*, i32** %31
%472 = call i32 @fgetc(i32* %471)
store i32 %472, i32* %13
%473 = load i32, i32* @EOF
%474 = icmp ne i32 %472, %473
br i1 %474, label %475, label %505
475: ; preds = %470
%476 = load i32, i32* %13
%477 = icmp sge i32 %476, 65
br i1 %477, label %478, label %504
478: ; preds = %475
%479 = load i32, i32* %13
%480 = icmp sle i32 %479, 90
br i1 %480, label %481, label %504
481: ; preds = %478
%482 = load i32, i32* %13
%483 = sub nsw i32 %482, 65
store i32 %483, i32* %13
%484 = load i32, i32* %37
%485 = load i32, i32* %13
%486 = load i32, i32* %25
%487 = sub nsw i32 %485, %486
%488 = mul nsw i32 %484, %487
%489 = srem i32 %488, 26
store i32 %489, i32* %39
%490 = load i32, i32* %39
%491 = add nsw i32 %490, 65
store i32 %491, i32* %39
%492 = load i32, i32* %39
%493 = icmp slt i32 %492, 65
br i1 %493, label %494, label %498
494: ; preds = %481
%495 = load i32, i32* %39
%496 = sub nsw i32 65, %495
%497 = sub nsw i32 91, %496
store i32 %497, i32* %39
br label %498
498: ; preds = %494, %481
%499 = load i32*, i32** %32
%500 = load i32, i32* %39
%501 = call i32 (i32*, i8*, ...) @fprintf(i32* %499, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.25, i64 0, i64 0), i32 %500)
%502 = load i32, i32* %39
%503 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.25, i64 0, i64 0), i32 %502)
br label %504
504: ; preds = %498, %478, %475
br label %470
505: ; preds = %470
%506 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%507 = load i32*, i32** %31
%508 = call i32 @fclose(i32* %507)
%509 = load i32*, i32** %32
%510 = call i32 @fclose(i32* %509)
%511 = load i32, i32* %4
%512 = icmp eq i32 %511, 3
br i1 %512, label %513, label %514
513: ; preds = %505
store i32 0, i32* %3
br label %639
514: ; preds = %505
br label %515
515: ; preds = %514, %463
%516 = load i32, i32* %23
%517 = icmp eq i32 %516, 1
br i1 %517, label %518, label %637
518: ; preds = %515
store i32 26, i32* %29
store i32 1, i32* %6
br label %519
519: ; preds = %633, %518
%520 = load i32, i32* %6
%521 = icmp slt i32 %520, 26
br i1 %521, label %522, label %636
522: ; preds = %519
%523 = load i32, i32* %6
store i32 %523, i32* %7
%524 = load i32, i32* %7
store i32 %524, i32* %28
%525 = load i32, i32* %29
%526 = load i32, i32* %28
%527 = icmp sgt i32 %525, %526
br i1 %527, label %528, label %532
528: ; preds = %522
%529 = load i32, i32* %29
store i32 %529, i32* %41
%530 = load i32, i32* %28
store i32 %530, i32* %29
%531 = load i32, i32* %41
store i32 %531, i32* %28
br label %532
532: ; preds = %528, %522
%533 = load i32, i32* %28
store i32 %533, i32* %42
%534 = load i32, i32* %29
store i32 %534, i32* %44
%535 = load i32, i32* %42
%536 = load i32, i32* %44
%537 = sdiv i32 %535, %536
store i32 %537, i32* %43
%538 = load i32, i32* %42
%539 = load i32, i32* %43
%540 = load i32, i32* %44
%541 = mul nsw i32 %539, %540
%542 = sub nsw i32 %538, %541
store i32 %542, i32* %40
%543 = load i32, i32* %44
store i32 %543, i32* %41
store i32 1, i32* %47
store i32 0, i32* %46
store i32 0, i32* %50
store i32 1, i32* %49
store i32 1, i32* %45
%544 = load i32, i32* %50
%545 = load i32, i32* %43
%546 = sub nsw i32 %545, 1
%547 = load i32, i32* %49
%548 = mul nsw i32 %546, %547
%549 = sub nsw i32 %544, %548
store i32 %549, i32* %48
br label %550
550: ; preds = %553, %532
%551 = load i32, i32* %40
%552 = icmp ne i32 %551, 0
br i1 %552, label %553, label %579
553: ; preds = %550
%554 = load i32, i32* %44
store i32 %554, i32* %42
%555 = load i32, i32* %40
store i32 %555, i32* %44
%556 = load i32, i32* %47
%557 = load i32, i32* %43
%558 = load i32, i32* %46
%559 = mul nsw i32 %557, %558
%560 = sub nsw i32 %556, %559
store i32 %560, i32* %45
%561 = load i32, i32* %46
store i32 %561, i32* %47
%562 = load i32, i32* %45
store i32 %562, i32* %46
%563 = load i32, i32* %50
%564 = load i32, i32* %43
%565 = load i32, i32* %49
%566 = mul nsw i32 %564, %565
%567 = sub nsw i32 %563, %566
store i32 %567, i32* %48
%568 = load i32, i32* %49
store i32 %568, i32* %50
%569 = load i32, i32* %48
store i32 %569, i32* %49
%570 = load i32, i32* %40
store i32 %570, i32* %41
%571 = load i32, i32* %42
%572 = load i32, i32* %44
%573 = sdiv i32 %571, %572
store i32 %573, i32* %43
%574 = load i32, i32* %42
%575 = load i32, i32* %43
%576 = load i32, i32* %44
%577 = mul nsw i32 %575, %576
%578 = sub nsw i32 %574, %577
store i32 %578, i32* %40
br label %550
579: ; preds = %550
%580 = load i32, i32* %48
%581 = srem i32 %580, 26
store i32 %581, i32* %37
store i32 0, i32* %51
br label %582
582: ; preds = %629, %579
%583 = load i32, i32* %51
%584 = icmp slt i32 %583, 26
br i1 %584, label %585, label %632
585: ; preds = %582
%586 = load i32, i32* %51
store i32 %586, i32* %25
%587 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%588 = call i32* @fopen(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.29, i64 0, i64 0))
br label %589
589: ; preds = %621, %585
%590 = load i32*, i32** %31
%591 = call i32 @fgetc(i32* %590)
store i32 %591, i32* %45
%592 = load i32, i32* @EOF
%593 = icmp ne i32 %591, %592
br i1 %593, label %594, label %622
594: ; preds = %589
%595 = load i32, i32* %45
%596 = icmp sge i32 %595, 65
br i1 %596, label %597, label %621
597: ; preds = %594
%598 = load i32, i32* %45
%599 = icmp sle i32 %598, 90
br i1 %599, label %600, label %621
600: ; preds = %597
%601 = load i32, i32* %45
%602 = sub nsw i32 %601, 65
store i32 %602, i32* %45
%603 = load i32, i32* %37
%604 = load i32, i32* %45
%605 = load i32, i32* %25
%606 = sub nsw i32 %604, %605
%607 = mul nsw i32 %603, %606
%608 = srem i32 %607, 26
store i32 %608, i32* %52
%609 = load i32, i32* %52
%610 = add nsw i32 %609, 65
store i32 %610, i32* %52
%611 = load i32, i32* %52
%612 = icmp slt i32 %611, 65
br i1 %612, label %613, label %617
613: ; preds = %600
%614 = load i32, i32* %52
%615 = sub nsw i32 65, %614
%616 = sub nsw i32 91, %615
store i32 %616, i32* %52
br label %617
617: ; preds = %613, %600
%618 = load i32*, i32** %33
%619 = load i32, i32* %52
%620 = call i32 (i32*, i8*, ...) @fprintf(i32* %618, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.25, i64 0, i64 0), i32 %619)
br label %621
621: ; preds = %617, %597, %594
br label %589
622: ; preds = %589
%623 = load i32*, i32** %33
%624 = call i32 (i32*, i8*, ...) @fprintf(i32* %623, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%625 = load i32*, i32** %31
%626 = call i32 @fclose(i32* %625)
%627 = load i32*, i32** %33
%628 = call i32 @fclose(i32* %627)
br label %629
629: ; preds = %622
%630 = load i32, i32* %51
%631 = add nsw i32 %630, 1
store i32 %631, i32* %51
br label %582
632: ; preds = %582
br label %633
633: ; preds = %632
%634 = load i32, i32* %6
%635 = add nsw i32 %634, 1
store i32 %635, i32* %6
br label %519
636: ; preds = %519
br label %637
637: ; preds = %636, %515
br label %638
638: ; preds = %637, %339
br label %639
639: ; preds = %127, %133, %169, %177, %185, %237, %277, %336, %407, %461, %513, %638, %338
%640 = load i32, i32* %3
ret i32 %640
}

LLVM IR (-O2):
@.str = [3 x i8] c"-c\00"
@.str.1 = [3 x i8] c"-a\00"
@.str.2 = [3 x i8] c"-e\00"
@.str.3 = [3 x i8] c"-d\00"
@.str.4 = [3 x i8] c"-k\00"
@.str.5 = [19 x i8] c"Podane Argumenty: \00"
@.str.6 = [4 x i8] c"%s \00"
@.str.9 = [8 x i8] c"key.txt\00"
@.str.10 = [2 x i8] c"r\00"
@.str.12 = [3 x i8] c"%d\00"
@.str.13 = [10 x i8] c"plain.txt\00"
@.str.14 = [11 x i8] c"crypto.txt\00"
@.str.15 = [3 x i8] c"r+\00"
@.str.16 = [12 x i8] c"decrypt.txt\00"
@.str.17 = [19 x i8] c"cryptoanalysis.txt\00"
@.str.18 = [2 x i8] c"w\00"
@.str.22 = [12 x i8] c"Klucz : %d\0A\00"
@EOF = global i32 0
@.str.29 = [3 x i8] c"a+\00"
@.str.30 = [13 x i8] c"Klucz %d: %c\00"
@.str.31 = [11 x i8] c"Klucz %d: \00"
@.str.32 = [13 x i8] c"Klucz 1: %d\0A\00"
@.str.33 = [13 x i8] c"Klucz 2: %d\0A\00"
@str = [321 x i8] c"Za malo podanych argumentow!\0A\0A Pierw wybierz szyfr:\0A -c (szyfr Cezara),\0A -a (szyfr afiniczny),\0A\0A A nast\C4\99pnie co chcesz zrobi\C4\87:\0A -e (szyfrowanie),\0A -d (odszyfrowywanie),\0A -j (kryptoanaliza z tekstem jawnym),\0A -k (kryptoanaliza wy\C5\82\C4\85cznie w oparciu o kryptogram).\0A\0A Przyk\C5\82ad: ./cezar.c -c -e\00"
@str.38 = [33 x i8] c"\0ASzyfrowanie szyfrem Afinicznym\0A\00"
@str.39 = [34 x i8] c"Tekst znajdujacy sie w plain.txt:\00"
@str.41 = [58 x i8] c"nie podales co chcesz zrobic uzywajhac szyfru afinicznego\00"
@str.42 = [36 x i8] c"Kryptoanaliza za pomoca kryptogramu\00"
@str.43 = [38 x i8] c"Tekst w decrypt.txt po odszyfrowaniu:\00"
@str.44 = [28 x i8] c"\0ASzyfrowanie szyfrem Cezara\00"
@str.45 = [35 x i8] c"\0ATekst znajdujacy sie w plain.txt:\00"
@str.46 = [37 x i8] c"Tekst w crypto.txt po zaszyfrowaniu:\00"
@str.47 = [62 x i8] c"Zapomniales podac co chcesz zrobic przy pomocy szyfru Cezara!\00"
@str.48 = [21 x i8] c"nie wybrales szyfru!\00"
@str.49 = [80 x i8] c"Nie mozna otworzyc ktoregos z plikow, upewnij sie ze wymagane plioki istnieja!!\00"
@str.50 = [62 x i8] c"Nie mozna otworzyc pliku z kluczem! Upewnij sie ze instnieje.\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca i32
%5 = icmp sgt i32 %0, 0
br i1 %5, label %6, label %50
6: ; preds = %2
%7 = zext i32 %0 to i64
br label %8
8: ; preds = %6, %8
%9 = phi i64 [ 0, %6 ], [ %32, %8 ]
%10 = phi i32 [ 0, %6 ], [ %31, %8 ]
%11 = phi i32 [ 0, %6 ], [ %28, %8 ]
%12 = phi i32 [ 0, %6 ], [ %25, %8 ]
%13 = phi i32 [ 0, %6 ], [ %22, %8 ]
%14 = phi i32 [ 0, %6 ], [ %19, %8 ]
%15 = getelementptr inbounds i8*, i8** %1, i64 %9
%16 = load i8*, i8** %15
%17 = tail call i32 @strcmp(i8* dereferenceable(1) %16, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%18 = icmp eq i32 %17, 0
%19 = select i1 %18, i32 1, i32 %14
%20 = tail call i32 @strcmp(i8* dereferenceable(1) %16, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%21 = icmp eq i32 %20, 0
%22 = select i1 %21, i32 1, i32 %13
%23 = tail call i32 @strcmp(i8* dereferenceable(1) %16, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%24 = icmp eq i32 %23, 0
%25 = select i1 %24, i32 1, i32 %12
%26 = tail call i32 @strcmp(i8* dereferenceable(1) %16, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%27 = icmp eq i32 %26, 0
%28 = select i1 %27, i32 1, i32 %11
%29 = tail call i32 @strcmp(i8* dereferenceable(1) %16, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%30 = icmp eq i32 %29, 0
%31 = select i1 %30, i32 1, i32 %10
%32 = add nuw nsw i64 %9, 1
%33 = icmp eq i64 %32, %7
br i1 %33, label %34, label %8
34: ; preds = %8
%35 = icmp sgt i32 %0, 1
br i1 %35, label %36, label %50
36: ; preds = %34
%37 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0))
%38 = zext i32 %0 to i64
br label %39
39: ; preds = %36, %39
%40 = phi i64 [ 1, %36 ], [ %44, %39 ]
%41 = getelementptr inbounds i8*, i8** %1, i64 %40
%42 = load i8*, i8** %41
%43 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8* %42)
%44 = add nuw nsw i64 %40, 1
%45 = icmp eq i64 %44, %38
br i1 %45, label %46, label %39
46: ; preds = %39
%47 = tail call i32 @putchar(i32 10)
%48 = tail call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%49 = icmp eq i32* %48, null
br i1 %49, label %52, label %54
50: ; preds = %2, %34
%51 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([321 x i8], [321 x i8]* @str, i64 0, i64 0))
br label %375
52: ; preds = %46
%53 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @str.50, i64 0, i64 0))
br label %375
54: ; preds = %46
%55 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%56 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%57 = call i32 @fscanf(i32* %48, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), i32* %4)
%58 = call i32 @feof(i32* %48)
%59 = icmp eq i32 %58, 0
br i1 %59, label %60, label %70
60: ; preds = %54, %60
%61 = phi i32 [ %65, %60 ], [ 0, %54 ]
%62 = phi i32 [ %67, %60 ], [ 0, %54 ]
%63 = icmp eq i32 %62, 0
%64 = load i32, i32* %4
%65 = select i1 %63, i32 %64, i32 %61
%66 = call i32 @fscanf(i32* %48, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), i32* %3)
%67 = add nuw nsw i32 %62, 1
%68 = call i32 @feof(i32* %48)
%69 = icmp eq i32 %68, 0
br i1 %69, label %60, label %70
70: ; preds = %60, %54
%71 = phi i32 [ 0, %54 ], [ %65, %60 ]
%72 = call i32 @fclose(i32* %48)
%73 = call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%74 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0))
%75 = call i32* @fopen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0))
%76 = call i32* @fopen(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.18, i64 0, i64 0))
%77 = icmp eq i32* %73, null
%78 = icmp eq i32* %74, null
%79 = or i1 %77, %78
%80 = icmp eq i32* %75, null
%81 = or i1 %79, %80
br i1 %81, label %82, label %84
82: ; preds = %70
%83 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([80 x i8], [80 x i8]* @str.49, i64 0, i64 0))
br label %374
84: ; preds = %70
%85 = icmp eq i32 %19, 0
%86 = icmp eq i32 %22, 0
%87 = select i1 %85, i1 %86, i1 false
br i1 %87, label %88, label %90
88: ; preds = %84
%89 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.48, i64 0, i64 0))
br label %374
90: ; preds = %84
%91 = icmp eq i32 %19, 1
br i1 %91, label %92, label %204
92: ; preds = %90
%93 = icmp eq i32 %0, 2
br i1 %93, label %94, label %96
94: ; preds = %92
%95 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @str.47, i64 0, i64 0))
br label %374
96: ; preds = %92
%97 = icmp eq i32 %25, 1
br i1 %97, label %98, label %136
98: ; preds = %96
%99 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.22, i64 0, i64 0), i32 %71)
%100 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.44, i64 0, i64 0))
%101 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.45, i64 0, i64 0))
%102 = call i32 @fgetc(i32* %73)
%103 = load i32, i32* @EOF
%104 = icmp eq i32 %102, %103
br i1 %104, label %119, label %105
105: ; preds = %98, %115
%106 = phi i32 [ %116, %115 ], [ %102, %98 ]
%107 = call i32 @putchar(i32 %106)
%108 = add i32 %106, -65
%109 = icmp ult i32 %108, 26
br i1 %109, label %110, label %115
110: ; preds = %105
%111 = add nsw i32 %106, %71
%112 = srem i32 %111, 26
%113 = add nsw i32 %112, 65
%114 = call i32 @fputc(i32 %113, i32* %74)
br label %115
115: ; preds = %110, %105
%116 = call i32 @fgetc(i32* %73)
%117 = load i32, i32* @EOF
%118 = icmp eq i32 %116, %117
br i1 %118, label %119, label %105
119: ; preds = %115, %98
%120 = call i32 @fclose(i32* %74)
%121 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%122 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.46, i64 0, i64 0))
%123 = call i32 @fgetc(i32* %74)
%124 = load i32, i32* @EOF
%125 = icmp eq i32 %123, %124
br i1 %125, label %132, label %126
126: ; preds = %119, %126
%127 = phi i32 [ %129, %126 ], [ %123, %119 ]
%128 = call i32 @putchar(i32 %127)
%129 = call i32 @fgetc(i32* %74)
%130 = load i32, i32* @EOF
%131 = icmp eq i32 %129, %130
br i1 %131, label %132, label %126
132: ; preds = %126, %119
%133 = call i32 @putchar(i32 10)
%134 = call i32 @fclose(i32* %74)
%135 = icmp eq i32 %0, 3
br i1 %135, label %374, label %136
136: ; preds = %132, %96
%137 = icmp eq i32 %28, 1
br i1 %137, label %138, label %166
138: ; preds = %136
%139 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%140 = call i32* @fopen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0))
%141 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.43, i64 0, i64 0))
%142 = call i32 @fgetc(i32* %74)
%143 = load i32, i32* @EOF
%144 = icmp eq i32 %142, %143
br i1 %144, label %159, label %145
145: ; preds = %138, %155
%146 = phi i32 [ %156, %155 ], [ %142, %138 ]
%147 = add i32 %146, -65
%148 = icmp ult i32 %147, 26
br i1 %148, label %149, label %155
149: ; preds = %145
%150 = sub nsw i32 %146, %71
%151 = srem i32 %150, 26
%152 = add nsw i32 %151, 65
%153 = call i32 @fputc(i32 %152, i32* %75)
%154 = call i32 @putchar(i32 %152)
br label %155
155: ; preds = %149, %145
%156 = call i32 @fgetc(i32* %74)
%157 = load i32, i32* @EOF
%158 = icmp eq i32 %156, %157
br i1 %158, label %159, label %145
159: ; preds = %155, %138
%160 = call i32 @putchar(i32 10)
%161 = call i32 @fclose(i32* %74)
%162 = call i32 @fclose(i32* %75)
%163 = icmp ne i32 %0, 3
%164 = icmp eq i32 %31, 1
%165 = select i1 %163, i1 %164, i1 false
br i1 %165, label %168, label %374
166: ; preds = %136
%167 = icmp eq i32 %31, 1
br i1 %167, label %168, label %374
168: ; preds = %159, %166
%169 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.42, i64 0, i64 0))
%170 = call i32* @fopen(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.29, i64 0, i64 0))
br label %171
171: ; preds = %168, %197
%172 = phi i32 [ 0, %168 ], [ %194, %197 ]
%173 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%174 = call i32 @fgetc(i32* %74)
%175 = load i32, i32* @EOF
%176 = icmp eq i32 %174, %175
br i1 %176, label %191, label %177
177: ; preds = %171, %187
%178 = phi i32 [ %188, %187 ], [ %174, %171 ]
%179 = add i32 %178, -65
%180 = icmp ult i32 %179, 26
br i1 %180, label %181, label %187
181: ; preds = %177
%182 = sub nsw i32 %178, %172
%183 = srem i32 %182, 26
%184 = add nsw i32 %183, 65
%185 = call i32 (i32*, i8*, ...) @fprintf(i32* %76, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.30, i64 0, i64 0), i32 %172, i32 %184)
%186 = call i32 @putchar(i32 %184)
br label %187
187: ; preds = %181, %177
%188 = call i32 @fgetc(i32* %74)
%189 = load i32, i32* @EOF
%190 = icmp eq i32 %188, %189
br i1 %190, label %191, label %177
191: ; preds = %187, %171
%192 = call i32 @putchar(i32 10)
%193 = icmp ult i32 %172, 26
%194 = add nuw nsw i32 %172, 1
br i1 %193, label %195, label %197
195: ; preds = %191
%196 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.31, i64 0, i64 0), i32 %194)
br label %197
197: ; preds = %191, %195
%198 = call i32 @fputc(i32 10, i32* %76)
%199 = call i32 @fclose(i32* %74)
%200 = icmp eq i32 %194, 27
br i1 %200, label %201, label %171
201: ; preds = %197
%202 = call i32 @putchar(i32 10)
%203 = call i32 @fclose(i32* %75)
br label %374
204: ; preds = %90
%205 = icmp eq i32 %22, 1
br i1 %205, label %206, label %374
206: ; preds = %204
%207 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.32, i64 0, i64 0), i32 %71)
%208 = load i32, i32* %3
%209 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.33, i64 0, i64 0), i32 %208)
%210 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.18, i64 0, i64 0))
%211 = icmp slt i32 %71, 26
%212 = select i1 %211, i32 26, i32 %71
%213 = select i1 %211, i32 %71, i32 26
%214 = sdiv i32 %212, %213
%215 = mul nsw i32 %214, %213
%216 = srem i32 %212, %213
%217 = sub i32 1, %214
%218 = icmp eq i32 %216, 0
br i1 %218, label %231, label %219
219: ; preds = %206, %219
%220 = phi i32 [ %229, %219 ], [ %216, %206 ]
%221 = phi i32 [ %227, %219 ], [ %214, %206 ]
%222 = phi i32 [ %220, %219 ], [ %213, %206 ]
%223 = phi i32 [ %224, %219 ], [ 0, %206 ]
%224 = phi i32 [ %226, %219 ], [ 1, %206 ]
%225 = mul nsw i32 %221, %224
%226 = sub nsw i32 %223, %225
%227 = sdiv i32 %222, %220
%228 = mul nsw i32 %227, %220
%229 = srem i32 %222, %220
%230 = icmp eq i32 %229, 0
br i1 %230, label %231, label %219
231: ; preds = %219, %206
%232 = phi i32 [ %217, %206 ], [ %226, %219 ]
%233 = srem i32 %232, 26
%234 = icmp eq i32 %0, 2
br i1 %234, label %235, label %237
235: ; preds = %231
%236 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str.41, i64 0, i64 0))
br label %374
237: ; preds = %231
%238 = icmp eq i32 %25, 1
br i1 %238, label %239, label %278
239: ; preds = %237
%240 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.38, i64 0, i64 0))
%241 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.39, i64 0, i64 0))
%242 = call i32 @fgetc(i32* %73)
%243 = load i32, i32* @EOF
%244 = icmp eq i32 %242, %243
br i1 %244, label %261, label %245
245: ; preds = %239, %257
%246 = phi i32 [ %258, %257 ], [ %242, %239 ]
%247 = call i32 @putchar(i32 %246)
%248 = add i32 %246, -65
%249 = icmp ult i32 %248, 26
br i1 %249, label %250, label %257
250: ; preds = %245
%251 = mul nsw i32 %248, %71
%252 = load i32, i32* %3
%253 = add nsw i32 %252, %251
%254 = srem i32 %253, 26
%255 = add nsw i32 %254, 65
%256 = call i32 @fputc(i32 %255, i32* %74)
br label %257
257: ; preds = %250, %245
%258 = call i32 @fgetc(i32* %73)
%259 = load i32, i32* @EOF
%260 = icmp eq i32 %258, %259
br i1 %260, label %261, label %245
261: ; preds = %257, %239
%262 = call i32 @fclose(i32* %74)
%263 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%264 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.46, i64 0, i64 0))
%265 = call i32 @fgetc(i32* %74)
%266 = load i32, i32* @EOF
%267 = icmp eq i32 %265, %266
br i1 %267, label %274, label %268
268: ; preds = %261, %268
%269 = phi i32 [ %271, %268 ], [ %265, %261 ]
%270 = call i32 @putchar(i32 %269)
%271 = call i32 @fgetc(i32* %74)
%272 = load i32, i32* @EOF
%273 = icmp eq i32 %271, %272
br i1 %273, label %274, label %268
274: ; preds = %268, %261
%275 = call i32 @putchar(i32 10)
%276 = call i32 @fclose(i32* %74)
%277 = icmp eq i32 %0, 3
br i1 %277, label %374, label %278
278: ; preds = %274, %237
%279 = icmp eq i32 %28, 1
br i1 %279, label %280, label %312
280: ; preds = %278
%281 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%282 = call i32* @fopen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.18, i64 0, i64 0))
%283 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.43, i64 0, i64 0))
%284 = call i32 @fgetc(i32* %74)
%285 = load i32, i32* @EOF
%286 = icmp eq i32 %284, %285
br i1 %286, label %305, label %287
287: ; preds = %280, %301
%288 = phi i32 [ %302, %301 ], [ %284, %280 ]
%289 = add i32 %288, -65
%290 = icmp ult i32 %289, 26
br i1 %290, label %291, label %301
291: ; preds = %287
%292 = load i32, i32* %3
%293 = sub nsw i32 %289, %292
%294 = mul nsw i32 %293, %233
%295 = srem i32 %294, 26
%296 = icmp slt i32 %295, 0
%297 = select i1 %296, i32 91, i32 65
%298 = add nsw i32 %297, %295
%299 = call i32 @fputc(i32 %298, i32* %75)
%300 = call i32 @putchar(i32 %298)
br label %301
301: ; preds = %291, %287
%302 = call i32 @fgetc(i32* %74)
%303 = load i32, i32* @EOF
%304 = icmp eq i32 %302, %303
br i1 %304, label %305, label %287
305: ; preds = %301, %280
%306 = call i32 @putchar(i32 10)
%307 = call i32 @fclose(i32* %74)
%308 = call i32 @fclose(i32* %75)
%309 = icmp ne i32 %0, 3
%310 = icmp eq i32 %31, 1
%311 = select i1 %309, i1 %310, i1 false
br i1 %311, label %314, label %374
312: ; preds = %278
%313 = icmp eq i32 %31, 1
br i1 %313, label %314, label %374
314: ; preds = %312, %305
br label %315
315: ; preds = %314, %341
%316 = phi i32 [ %342, %341 ], [ 1, %314 ]
%317 = phi i32 [ %320, %341 ], [ 26, %314 ]
%318 = icmp sgt i32 %317, %316
%319 = select i1 %318, i32 %317, i32 %316
%320 = select i1 %318, i32 %316, i32 %317
%321 = sdiv i32 %319, %320
%322 = mul nsw i32 %321, %320
%323 = srem i32 %319, %320
%324 = sub i32 1, %321
%325 = icmp eq i32 %323, 0
br i1 %325, label %338, label %326
326: ; preds = %315, %326
%327 = phi i32 [ %328, %326 ], [ 0, %315 ]
%328 = phi i32 [ %333, %326 ], [ 1, %315 ]
%329 = phi i32 [ %331, %326 ], [ %320, %315 ]
%330 = phi i32 [ %334, %326 ], [ %321, %315 ]
%331 = phi i32 [ %336, %326 ], [ %323, %315 ]
%332 = mul nsw i32 %328, %330
%333 = sub nsw i32 %327, %332
%334 = sdiv i32 %329, %331
%335 = mul nsw i32 %334, %331
%336 = srem i32 %329, %331
%337 = icmp eq i32 %336, 0
br i1 %337, label %338, label %326
338: ; preds = %326, %315
%339 = phi i32 [ %324, %315 ], [ %333, %326 ]
%340 = srem i32 %339, 26
br label %344
341: ; preds = %368
%342 = add nuw nsw i32 %316, 1
%343 = icmp eq i32 %342, 26
br i1 %343, label %374, label %315
344: ; preds = %338, %368
%345 = phi i32 [ 0, %338 ], [ %372, %368 ]
store i32 %345, i32* %3
%346 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%347 = call i32* @fopen(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.29, i64 0, i64 0))
%348 = call i32 @fgetc(i32* %74)
%349 = load i32, i32* @EOF
%350 = icmp eq i32 %348, %349
br i1 %350, label %368, label %351
351: ; preds = %344, %364
%352 = phi i32 [ %365, %364 ], [ %348, %344 ]
%353 = add i32 %352, -65
%354 = icmp ult i32 %353, 26
br i1 %354, label %355, label %364
355: ; preds = %351
%356 = load i32, i32* %3
%357 = sub nsw i32 %353, %356
%358 = mul nsw i32 %357, %340
%359 = srem i32 %358, 26
%360 = icmp slt i32 %359, 0
%361 = select i1 %360, i32 91, i32 65
%362 = add nsw i32 %361, %359
%363 = call i32 @fputc(i32 %362, i32* %76)
br label %364
364: ; preds = %355, %351
%365 = call i32 @fgetc(i32* %74)
%366 = load i32, i32* @EOF
%367 = icmp eq i32 %365, %366
br i1 %367, label %368, label %351
368: ; preds = %364, %344
%369 = call i32 @fputc(i32 10, i32* %76)
%370 = call i32 @fclose(i32* %74)
%371 = call i32 @fclose(i32* %76)
%372 = add nuw nsw i32 %345, 1
%373 = icmp eq i32 %372, 26
br i1 %373, label %341, label %344
374: ; preds = %341, %201, %305, %274, %166, %204, %312, %235, %159, %132, %94, %88, %82
br label %375
375: ; preds = %52, %374, %50
ret i32 0
}