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

/* Forward declarations */

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

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, ...);
int strlen(char *);
int main(void) {
  FILE *f, *g;
  char codificado[10000];
  char txtplano[10000];
  char abc[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  int i, j;
  int k;
  int longitud;
  int codif, opcion;
  int longclave;
  printf("Decodificador para cifrado del Cesar \n\n");
  printf("(1) Cargar el mensaje cifrado desde el archivo cod_cesar.txt \n");
  printf("(2) Introducir el codigo manualmente \nOpcion: ");
  scanf("%d", &opcion);
  if (opcion == 2) {
    printf("Introduce el mensaje a decodificar: ");
    scanf("%s", codificado);
  } else {
    f = fopen("cod_cesar.txt", "r");
    fgets(codificado, 1000, f);
    fclose(f);
  }
  longitud = strlen(codificado);
  longclave = strlen(abc);
  g = fopen("dec_cesar_fb.txt", "w");
  fprintf(g, "Mensaje codificado = %s\nCaracteres = %d\n\n", codificado,
          longitud);
  for (k = 0; k < longclave; k++) {
    for (i = 0; i < longitud; i++) {
      codif = 0;
      j = 0;
      while (codif == 0) {
        if (codificado[i] == abc[j]) {
          txtplano[i] = abc[(j - k + longclave) % longclave];
          codif = 1;
        } else
          j++;
      }
    }
    txtplano[i] = '\0';
    fprintf(g, "Clave k = %d\nMensaje = %s\n\n", k, txtplano, strlen(txtplano));
  }
  fclose(g);
  printf("descifrado completo, pulsa intro \n");
  getchar();
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x4ea0,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xe67(%rip),%rax
mov    %rax,-0x4e60(%rbp)
mov    0xe61(%rip),%rax
mov    %rax,-0x4e58(%rbp)
mov    0xe5b(%rip),%rax
mov    %rax,-0x4e50(%rbp)
mov    0xe55(%rip),%ax
mov    %ax,-0x4e48(%rbp)
mov    0xe4a(%rip),%al
mov    %al,-0x4e46(%rbp)
lea    0xe3e(%rip),%rdi
call   1050 <printf@plt>
lea    0xe5a(%rip),%rdi
call   1050 <printf@plt>
lea    0xe8d(%rip),%rdi
call   1050 <printf@plt>
lea    0xeb0(%rip),%rdi
lea    -0x4e78(%rbp),%rsi
mov    $0x0,%al
call   1090 <scanf@plt>
cmpl   $0x2,-0x4e78(%rbp)
jne    1242 <main+0xc2>
lea    0xe91(%rip),%rdi
call   1050 <printf@plt>
lea    -0x2730(%rbp),%rsi
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1090 <scanf@plt>
jmp    1277 <main+0xf7>
lea    0xe93(%rip),%rdi
lea    0xe9a(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x10(%rbp)
lea    -0x2730(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x3e8,%esi
call   1060 <fgets@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
lea    -0x2730(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x4e70(%rbp)
lea    -0x4e60(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x4e7c(%rbp)
lea    0xe4a(%rip),%rdi
lea    0xe54(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0x2730(%rbp),%rdx
mov    -0x4e70(%rbp),%ecx
lea    0xe35(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0x0,-0x4e6c(%rbp)
mov    -0x4e6c(%rbp),%eax
cmp    -0x4e7c(%rbp),%eax
jge    1436 <main+0x2b6>
movl   $0x0,-0x4e64(%rbp)
mov    -0x4e64(%rbp),%eax
cmp    -0x4e70(%rbp),%eax
jge    13bd <main+0x23d>
movl   $0x0,-0x4e74(%rbp)
movl   $0x0,-0x4e68(%rbp)
cmpl   $0x0,-0x4e74(%rbp)
jne    13a4 <main+0x224>
movslq -0x4e64(%rbp),%rax
movsbl -0x2730(%rbp,%rax,1),%eax
ff
movslq -0x4e68(%rbp),%rcx
movsbl -0x4e60(%rbp,%rcx,1),%ecx
ff
cmp    %ecx,%eax
jne    1390 <main+0x210>
mov    -0x4e68(%rbp),%eax
sub    -0x4e6c(%rbp),%eax
add    -0x4e7c(%rbp),%eax
cltd
idivl  -0x4e7c(%rbp)
movslq %edx,%rax
mov    -0x4e60(%rbp,%rax,1),%cl
movslq -0x4e64(%rbp),%rax
mov    %cl,-0x4e40(%rbp,%rax,1)
movl   $0x1,-0x4e74(%rbp)
jmp    139f <main+0x21f>
mov    -0x4e68(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4e68(%rbp)
jmp    131d <main+0x19d>
jmp    13a9 <main+0x229>
mov    -0x4e64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4e64(%rbp)
jmp    12f7 <main+0x177>
movslq -0x4e64(%rbp),%rax
movb   $0x0,-0x4e40(%rbp,%rax,1)
mov    -0x18(%rbp),%rax
mov    %rax,-0x4e98(%rbp)
mov    -0x4e6c(%rbp),%eax
mov    %eax,-0x4e8c(%rbp)
lea    -0x4e40(%rbp),%rax
mov    %rax,-0x4e88(%rbp)
lea    -0x4e40(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x4e98(%rbp),%rdi
mov    -0x4e8c(%rbp),%edx
mov    -0x4e88(%rbp),%rcx
mov    %eax,%r8d
lea    0xd0e(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x4e6c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4e6c(%rbp)
jmp    12db <main+0x15b>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
lea    0xcff(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1070 <getchar@plt>
mov    $0x0,%al
call   1070 <getchar@plt>
mov    -0x4(%rbp),%eax
add    $0x4ea0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x4e58,%rsp
movups 0xe63(%rip),%xmm0
movups %xmm0,0x1b(%rsp)
movaps 0xe4c(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0xf1e(%rip),%rdi
call   1030 <puts@plt>
lea    0xf39(%rip),%rdi
call   1030 <puts@plt>
lea    0xe43(%rip),%rdi
call   1060 <printf@plt>
lea    0xe66(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   10a0 <scanf@plt>
cmpl   $0x2,0x4(%rsp)
jne    1218 <main+0x88>
lea    0xe4f(%rip),%rdi
call   1060 <printf@plt>
lea    0xe68(%rip),%rdi
lea    0x30(%rsp),%rsi
xor    %eax,%eax
call   10a0 <scanf@plt>
jmp    1248 <main+0xb8>
lea    0xe56(%rip),%rdi
lea    0xe5d(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,%rbx
lea    0x30(%rsp),%rdi
mov    $0x3e8,%esi
mov    %rax,%rdx
call   1070 <fgets@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
lea    0x30(%rsp),%r12
mov    %r12,%rdi
call   1050 <strlen@plt>
mov    %eax,%r14d
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    %eax,%ebp
lea    0xe17(%rip),%rdi
lea    0xe21(%rip),%rsi
call   10b0 <fopen@plt>
lea    0xe17(%rip),%rsi
mov    %rax,0x8(%rsp)
mov    %rax,%rdi
mov    %r12,%rdx
mov    %r14d,(%rsp)
mov    %r14d,%ecx
xor    %eax,%eax
call   1090 <fprintf@plt>
test   %ebp,%ebp
jle    1340 <main+0x1b0>
mov    (%rsp),%r15d
lea    -0x1(%rbp),%r12d
xor    %r13d,%r13d
jmp    12f5 <main+0x165>
nop
xor    %eax,%eax
mov    %eax,%eax
movb   $0x0,0x2740(%rsp,%rax,1)
lea    0x2740(%rsp),%r14
mov    %r14,%rdi
call   1050 <strlen@plt>
mov    0x8(%rsp),%rdi
lea    0xdea(%rip),%rsi
mov    %r13d,%edx
mov    %r14,%rcx
mov    %eax,%r8d
xor    %eax,%eax
call   1090 <fprintf@plt>
add    $0x1,%r13d
add    $0xffffffff,%r12d
cmp    %ebp,%r13d
je     1340 <main+0x1b0>
cmpl   $0x0,(%rsp)
jle    12b0 <main+0x120>
xor    %ecx,%ecx
nopl   (%rax)
mov    0x30(%rsp,%rcx,1),%dl
mov    %rbx,%rsi
mov    %r12d,%eax
nopw   0x0(%rax,%rax,1)
add    $0x1,%eax
lea    0x1(%rsi),%rdi
cmp    (%rsi),%dl
mov    %rdi,%rsi
jne    1310 <main+0x180>
cltd
idiv   %ebp
movslq %edx,%rax
mov    0x10(%rsp,%rax,1),%al
mov    %al,0x2740(%rsp,%rcx,1)
add    $0x1,%rcx
cmp    %r15,%rcx
jne    1300 <main+0x170>
mov    (%rsp),%eax
jmp    12b2 <main+0x122>
mov    0x8(%rsp),%rdi
call   1040 <fclose@plt>
lea    0xdf2(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1080 <getchar@plt>
xor    %eax,%eax
call   1080 <getchar@plt>
xor    %eax,%eax
add    $0x4e58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.abc = [27 x i8] c"ABCDEFGHIJKLMNOPQRSTUVWXYZ\00"
@.str = [40 x i8] c"Decodificador para cifrado del Cesar \0A\0A\00"
@.str.1 = [63 x i8] c"(1) Cargar el mensaje cifrado desde el archivo cod_cesar.txt \0A\00"
@.str.2 = [47 x i8] c"(2) Introducir el codigo manualmente \0AOpcion: \00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [37 x i8] c"Introduce el mensaje a decodificar: \00"
@.str.5 = [3 x i8] c"%s\00"
@.str.6 = [14 x i8] c"cod_cesar.txt\00"
@.str.7 = [2 x i8] c"r\00"
@.str.8 = [17 x i8] c"dec_cesar_fb.txt\00"
@.str.9 = [2 x i8] c"w\00"
@.str.10 = [42 x i8] c"Mensaje codificado = %s\0ACaracteres = %d\0A\0A\00"
@.str.11 = [28 x i8] c"Clave k = %d\0AMensaje = %s\0A\0A\00"
@.str.12 = [35 x i8] c"descifrado completo, pulsa intro \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca [10000 x i8]
%5 = alloca [10000 x i8]
%6 = alloca [27 x i8]
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i32 0, i32* %1
%14 = bitcast [27 x i8]* %6 to i8*
%15 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%16 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.1, i64 0, i64 0))
%17 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0))
%18 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %12)
%19 = load i32, i32* %12
%20 = icmp eq i32 %19, 2
br i1 %20, label %21, label %25
21: ; preds = %0
%22 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0))
%23 = getelementptr inbounds [10000 x i8], [10000 x i8]* %4, i64 0, i64 0
%24 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %23)
br label %32
25: ; preds = %0
%26 = call i32* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
store i32* %26, i32** %2
%27 = getelementptr inbounds [10000 x i8], [10000 x i8]* %4, i64 0, i64 0
%28 = load i32*, i32** %2
%29 = call i32 @fgets(i8* %27, i32 1000, i32* %28)
%30 = load i32*, i32** %2
%31 = call i32 @fclose(i32* %30)
br label %32
32: ; preds = %25, %21
%33 = getelementptr inbounds [10000 x i8], [10000 x i8]* %4, i64 0, i64 0
%34 = call i32 @strlen(i8* %33)
store i32 %34, i32* %10
%35 = getelementptr inbounds [27 x i8], [27 x i8]* %6, i64 0, i64 0
%36 = call i32 @strlen(i8* %35)
store i32 %36, i32* %13
%37 = call i32* @fopen(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
store i32* %37, i32** %3
%38 = load i32*, i32** %3
%39 = getelementptr inbounds [10000 x i8], [10000 x i8]* %4, i64 0, i64 0
%40 = load i32, i32* %10
%41 = call i32 (i32*, i8*, ...) @fprintf(i32* %38, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.10, i64 0, i64 0), i8* %39, i32 %40)
store i32 0, i32* %9
br label %42
42: ; preds = %99, %32
%43 = load i32, i32* %9
%44 = load i32, i32* %13
%45 = icmp slt i32 %43, %44
br i1 %45, label %46, label %102
46: ; preds = %42
store i32 0, i32* %7
br label %47
47: ; preds = %86, %46
%48 = load i32, i32* %7
%49 = load i32, i32* %10
%50 = icmp slt i32 %48, %49
br i1 %50, label %51, label %89
51: ; preds = %47
store i32 0, i32* %11
store i32 0, i32* %8
br label %52
52: ; preds = %84, %51
%53 = load i32, i32* %11
%54 = icmp eq i32 %53, 0
br i1 %54, label %55, label %85
55: ; preds = %52
%56 = load i32, i32* %7
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds [10000 x i8], [10000 x i8]* %4, i64 0, i64 %57
%59 = load i8, i8* %58
%60 = sext i8 %59 to i32
%61 = load i32, i32* %8
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds [27 x i8], [27 x i8]* %6, i64 0, i64 %62
%64 = load i8, i8* %63
%65 = sext i8 %64 to i32
%66 = icmp eq i32 %60, %65
br i1 %66, label %67, label %81
67: ; preds = %55
%68 = load i32, i32* %8
%69 = load i32, i32* %9
%70 = sub nsw i32 %68, %69
%71 = load i32, i32* %13
%72 = add nsw i32 %70, %71
%73 = load i32, i32* %13
%74 = srem i32 %72, %73
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds [27 x i8], [27 x i8]* %6, i64 0, i64 %75
%77 = load i8, i8* %76
%78 = load i32, i32* %7
%79 = sext i32 %78 to i64
%80 = getelementptr inbounds [10000 x i8], [10000 x i8]* %5, i64 0, i64 %79
store i8 %77, i8* %80
store i32 1, i32* %11
br label %84
81: ; preds = %55
%82 = load i32, i32* %8
%83 = add nsw i32 %82, 1
store i32 %83, i32* %8
br label %84
84: ; preds = %81, %67
br label %52
85: ; preds = %52
br label %86
86: ; preds = %85
%87 = load i32, i32* %7
%88 = add nsw i32 %87, 1
store i32 %88, i32* %7
br label %47
89: ; preds = %47
%90 = load i32, i32* %7
%91 = sext i32 %90 to i64
%92 = getelementptr inbounds [10000 x i8], [10000 x i8]* %5, i64 0, i64 %91
store i8 0, i8* %92
%93 = load i32*, i32** %3
%94 = load i32, i32* %9
%95 = getelementptr inbounds [10000 x i8], [10000 x i8]* %5, i64 0, i64 0
%96 = getelementptr inbounds [10000 x i8], [10000 x i8]* %5, i64 0, i64 0
%97 = call i32 @strlen(i8* %96)
%98 = call i32 (i32*, i8*, ...) @fprintf(i32* %93, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.11, i64 0, i64 0), i32 %94, i8* %95, i32 %97)
br label %99
99: ; preds = %89
%100 = load i32, i32* %9
%101 = add nsw i32 %100, 1
store i32 %101, i32* %9
br label %42
102: ; preds = %42
%103 = load i32*, i32** %3
%104 = call i32 @fclose(i32* %103)
%105 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.12, i64 0, i64 0))
%106 = call i32 (...) @getchar()
%107 = call i32 (...) @getchar()
%108 = load i32, i32* %1
ret i32 %108
}

LLVM IR (-O2):
@__const.main.abc = [27 x i8] c"ABCDEFGHIJKLMNOPQRSTUVWXYZ\00"
@.str.2 = [47 x i8] c"(2) Introducir el codigo manualmente \0AOpcion: \00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [37 x i8] c"Introduce el mensaje a decodificar: \00"
@.str.5 = [3 x i8] c"%s\00"
@.str.6 = [14 x i8] c"cod_cesar.txt\00"
@.str.7 = [2 x i8] c"r\00"
@.str.8 = [17 x i8] c"dec_cesar_fb.txt\00"
@.str.9 = [2 x i8] c"w\00"
@.str.10 = [42 x i8] c"Mensaje codificado = %s\0ACaracteres = %d\0A\0A\00"
@.str.11 = [28 x i8] c"Clave k = %d\0AMensaje = %s\0A\0A\00"
@str = [39 x i8] c"Decodificador para cifrado del Cesar \0A\00"
@str.13 = [62 x i8] c"(1) Cargar el mensaje cifrado desde el archivo cod_cesar.txt \00"
@str.14 = [34 x i8] c"descifrado completo, pulsa intro \00"
define i32 @main() {
%1 = alloca [10000 x i8]
%2 = alloca [10000 x i8]
%3 = alloca [27 x i8]
%4 = alloca i32
%5 = getelementptr inbounds [10000 x i8], [10000 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [10000 x i8], [10000 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [27 x i8], [27 x i8]* %3, i64 0, i64 0
%8 = bitcast i32* %4 to i8*
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @str.13, i64 0, i64 0))
%11 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %4)
%13 = load i32, i32* %4
%14 = icmp eq i32 %13, 2
br i1 %14, label %15, label %18
15: ; preds = %0
%16 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0))
%17 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %5)
br label %22
18: ; preds = %0
%19 = call i32* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%20 = call i32 @fgets(i8* %5, i32 1000, i32* %19)
%21 = call i32 @fclose(i32* %19)
br label %22
22: ; preds = %18, %15
%23 = call i32 @strlen(i8* %5)
%24 = call i32 @strlen(i8* %7)
%25 = call i32* @fopen(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%26 = call i32 (i32*, i8*, ...) @fprintf(i32* %25, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.10, i64 0, i64 0), i8* %5, i32 %23)
%27 = icmp sgt i32 %24, 0
br i1 %27, label %28, label %63
28: ; preds = %22
%29 = icmp sgt i32 %23, 0
%30 = zext i32 %23 to i64
br label %31
31: ; preds = %28, %55
%32 = phi i32 [ 0, %28 ], [ %61, %55 ]
br i1 %29, label %33, label %55
33: ; preds = %31
%34 = sub i32 %24, %32
br label %35
35: ; preds = %33, %47
%36 = phi i64 [ 0, %33 ], [ %53, %47 ]
%37 = getelementptr inbounds [10000 x i8], [10000 x i8]* %1, i64 0, i64 %36
%38 = load i8, i8* %37
%39 = getelementptr inbounds [10000 x i8], [10000 x i8]* %2, i64 0, i64 %36
br label %40
40: ; preds = %40, %35
%41 = phi i32 [ 0, %35 ], [ %46, %40 ]
%42 = zext i32 %41 to i64
%43 = getelementptr inbounds [27 x i8], [27 x i8]* %3, i64 0, i64 %42
%44 = load i8, i8* %43
%45 = icmp eq i8 %38, %44
%46 = add nuw nsw i32 %41, 1
br i1 %45, label %47, label %40
47: ; preds = %40
%48 = add i32 %34, %41
%49 = srem i32 %48, %24
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds [27 x i8], [27 x i8]* %3, i64 0, i64 %50
%52 = load i8, i8* %51
store i8 %52, i8* %39
%53 = add nuw nsw i64 %36, 1
%54 = icmp eq i64 %53, %30
br i1 %54, label %55, label %35
55: ; preds = %47, %31
%56 = phi i32 [ 0, %31 ], [ %23, %47 ]
%57 = zext i32 %56 to i64
%58 = getelementptr inbounds [10000 x i8], [10000 x i8]* %2, i64 0, i64 %57
store i8 0, i8* %58
%59 = call i32 @strlen(i8* %6)
%60 = call i32 (i32*, i8*, ...) @fprintf(i32* %25, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.11, i64 0, i64 0), i32 %32, i8* %6, i32 %59)
%61 = add nuw nsw i32 %32, 1
%62 = icmp eq i32 %61, %24
br i1 %62, label %63, label %31
63: ; preds = %55, %22
%64 = call i32 @fclose(i32* %25)
%65 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.14, i64 0, i64 0))
%66 = call i32 (...) @getchar()
%67 = call i32 (...) @getchar()
ret i32 0
}