#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;
  int longclave;
  int opcion;
  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);
  }
  printf("Introduce k: ");
  scanf("%d", &k);
  longitud = strlen(codificado);
  longclave = strlen(abc);
  g = fopen("dec_cesar_k.txt", "w");
  fprintf(g, "Mensaje codificado = %s\nCaracteres = %d\n\n", codificado,
          longitud);
  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, "Decodificacion usando 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    -0x4e7c(%rbp),%rsi
mov    $0x0,%al
call   1090 <scanf@plt>
cmpl   $0x2,-0x4e7c(%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    0xe6e(%rip),%rdi
call   1050 <printf@plt>
lea    0xe27(%rip),%rdi
lea    -0x4e6c(%rbp),%rsi
mov    $0x0,%al
call   1090 <scanf@plt>
lea    -0x2730(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x4e70(%rbp)
lea    -0x4e60(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x4e78(%rbp)
lea    0xe37(%rip),%rdi
lea    0xe40(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0x2730(%rbp),%rdx
mov    -0x4e70(%rbp),%ecx
lea    0xe21(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0x0,-0x4e64(%rbp)
mov    -0x4e64(%rbp),%eax
cmp    -0x4e70(%rbp),%eax
jge    13c2 <main+0x242>
movl   $0x0,-0x4e74(%rbp)
movl   $0x0,-0x4e68(%rbp)
cmpl   $0x0,-0x4e74(%rbp)
jne    13a9 <main+0x229>
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    1395 <main+0x215>
mov    -0x4e68(%rbp),%eax
sub    -0x4e6c(%rbp),%eax
add    -0x4e78(%rbp),%eax
cltd
idivl  -0x4e78(%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    13a4 <main+0x224>
mov    -0x4e68(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4e68(%rbp)
jmp    1322 <main+0x1a2>
jmp    13ae <main+0x22e>
mov    -0x4e64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4e64(%rbp)
jmp    12fc <main+0x17c>
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    0xd16(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
lea    0xd31(%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    0xf41(%rip),%rdi
call   1030 <puts@plt>
lea    0xf5c(%rip),%rdi
call   1030 <puts@plt>
lea    0xe43(%rip),%rdi
call   1060 <printf@plt>
lea    0xe66(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   10a0 <scanf@plt>
cmpl   $0x2,0x8(%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    0xe36(%rip),%rdi
call   1060 <printf@plt>
lea    0xdef(%rip),%rdi
xor    %r15d,%r15d
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   10a0 <scanf@plt>
lea    0x30(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    %eax,%r12d
lea    0x10(%rsp),%r13
mov    %r13,%rdi
call   1050 <strlen@plt>
mov    %eax,%ebp
lea    0xe03(%rip),%rdi
lea    0xe0c(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,%r14
lea    0xdff(%rip),%rsi
mov    %rax,%rdi
mov    %rbx,%rdx
mov    %r12d,%ecx
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    0xc(%rsp),%ecx
test   %r12d,%r12d
jle    130a <main+0x17a>
mov    %r12d,%r15d
mov    %ecx,%r12d
not    %ecx
add    %ebp,%ecx
xor    %esi,%esi
nopl   0x0(%rax,%rax,1)
mov    0x30(%rsp,%rsi,1),%dl
mov    %r13,%rdi
mov    %ecx,%eax
nopl   0x0(%rax)
add    $0x1,%eax
lea    0x1(%rdi),%rbx
cmp    (%rdi),%dl
mov    %rbx,%rdi
jne    12e0 <main+0x150>
cltd
idiv   %ebp
movslq %edx,%rax
mov    0x10(%rsp,%rax,1),%al
mov    %al,0x2740(%rsp,%rsi,1)
add    $0x1,%rsi
cmp    %r15,%rsi
jne    12d0 <main+0x140>
jmp    130d <main+0x17d>
mov    %ecx,%r12d
movb   $0x0,0x2740(%rsp,%r15,1)
lea    0x2740(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <strlen@plt>
lea    0xda2(%rip),%rsi
mov    %r14,%rdi
mov    %r12d,%edx
mov    %rbx,%rcx
mov    %eax,%r8d
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    %r14,%rdi
call   1040 <fclose@plt>
lea    0xe17(%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 = [14 x i8] c"Introduce k: \00"
@.str.9 = [16 x i8] c"dec_cesar_k.txt\00"
@.str.10 = [2 x i8] c"w\00"
@.str.11 = [42 x i8] c"Mensaje codificado = %s\0ACaracteres = %d\0A\0A\00"
@.str.12 = [50 x i8] c"Decodificacion usando clave k = %d\0AMensaje = %s\0A\0A\00"
@.str.13 = [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* %13)
%19 = load i32, i32* %13
%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 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0))
%34 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %9)
%35 = getelementptr inbounds [10000 x i8], [10000 x i8]* %4, i64 0, i64 0
%36 = call i32 @strlen(i8* %35)
store i32 %36, i32* %10
%37 = getelementptr inbounds [27 x i8], [27 x i8]* %6, i64 0, i64 0
%38 = call i32 @strlen(i8* %37)
store i32 %38, i32* %12
%39 = call i32* @fopen(i8* getelementptr inbounds ([16 x i8], [16 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* %39, i32** %3
%40 = load i32*, i32** %3
%41 = getelementptr inbounds [10000 x i8], [10000 x i8]* %4, i64 0, i64 0
%42 = load i32, i32* %10
%43 = call i32 (i32*, i8*, ...) @fprintf(i32* %40, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.11, i64 0, i64 0), i8* %41, i32 %42)
store i32 0, i32* %7
br label %44
44: ; preds = %83, %32
%45 = load i32, i32* %7
%46 = load i32, i32* %10
%47 = icmp slt i32 %45, %46
br i1 %47, label %48, label %86
48: ; preds = %44
store i32 0, i32* %11
store i32 0, i32* %8
br label %49
49: ; preds = %81, %48
%50 = load i32, i32* %11
%51 = icmp eq i32 %50, 0
br i1 %51, label %52, label %82
52: ; preds = %49
%53 = load i32, i32* %7
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds [10000 x i8], [10000 x i8]* %4, i64 0, i64 %54
%56 = load i8, i8* %55
%57 = sext i8 %56 to i32
%58 = load i32, i32* %8
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds [27 x i8], [27 x i8]* %6, i64 0, i64 %59
%61 = load i8, i8* %60
%62 = sext i8 %61 to i32
%63 = icmp eq i32 %57, %62
br i1 %63, label %64, label %78
64: ; preds = %52
%65 = load i32, i32* %8
%66 = load i32, i32* %9
%67 = sub nsw i32 %65, %66
%68 = load i32, i32* %12
%69 = add nsw i32 %67, %68
%70 = load i32, i32* %12
%71 = srem i32 %69, %70
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds [27 x i8], [27 x i8]* %6, i64 0, i64 %72
%74 = load i8, i8* %73
%75 = load i32, i32* %7
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds [10000 x i8], [10000 x i8]* %5, i64 0, i64 %76
store i8 %74, i8* %77
store i32 1, i32* %11
br label %81
78: ; preds = %52
%79 = load i32, i32* %8
%80 = add nsw i32 %79, 1
store i32 %80, i32* %8
br label %81
81: ; preds = %78, %64
br label %49
82: ; preds = %49
br label %83
83: ; preds = %82
%84 = load i32, i32* %7
%85 = add nsw i32 %84, 1
store i32 %85, i32* %7
br label %44
86: ; preds = %44
%87 = load i32, i32* %7
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds [10000 x i8], [10000 x i8]* %5, i64 0, i64 %88
store i8 0, i8* %89
%90 = load i32*, i32** %3
%91 = load i32, i32* %9
%92 = getelementptr inbounds [10000 x i8], [10000 x i8]* %5, i64 0, i64 0
%93 = getelementptr inbounds [10000 x i8], [10000 x i8]* %5, i64 0, i64 0
%94 = call i32 @strlen(i8* %93)
%95 = call i32 (i32*, i8*, ...) @fprintf(i32* %90, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.12, i64 0, i64 0), i32 %91, i8* %92, i32 %94)
%96 = load i32*, i32** %3
%97 = call i32 @fclose(i32* %96)
%98 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.13, i64 0, i64 0))
%99 = call i32 (...) @getchar()
%100 = call i32 (...) @getchar()
%101 = load i32, i32* %1
ret i32 %101
}

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 = [14 x i8] c"Introduce k: \00"
@.str.9 = [16 x i8] c"dec_cesar_k.txt\00"
@.str.10 = [2 x i8] c"w\00"
@.str.11 = [42 x i8] c"Mensaje codificado = %s\0ACaracteres = %d\0A\0A\00"
@.str.12 = [50 x i8] c"Decodificacion usando clave k = %d\0AMensaje = %s\0A\0A\00"
@str = [39 x i8] c"Decodificador para cifrado del Cesar \0A\00"
@str.14 = [62 x i8] c"(1) Cargar el mensaje cifrado desde el archivo cod_cesar.txt \00"
@str.15 = [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 = alloca i32
%6 = getelementptr inbounds [10000 x i8], [10000 x i8]* %1, i64 0, i64 0
%7 = getelementptr inbounds [10000 x i8], [10000 x i8]* %2, i64 0, i64 0
%8 = getelementptr inbounds [27 x i8], [27 x i8]* %3, i64 0, i64 0
%9 = bitcast i32* %4 to i8*
%10 = bitcast i32* %5 to i8*
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @str.14, i64 0, i64 0))
%13 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0))
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %5)
%15 = load i32, i32* %5
%16 = icmp eq i32 %15, 2
br i1 %16, label %17, label %20
17: ; preds = %0
%18 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0))
%19 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %6)
br label %24
20: ; preds = %0
%21 = 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))
%22 = call i32 @fgets(i8* %6, i32 1000, i32* %21)
%23 = call i32 @fclose(i32* %21)
br label %24
24: ; preds = %20, %17
%25 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0))
%26 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %4)
%27 = call i32 @strlen(i8* %6)
%28 = call i32 @strlen(i8* %8)
%29 = call i32* @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%30 = call i32 (i32*, i8*, ...) @fprintf(i32* %29, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.11, i64 0, i64 0), i8* %6, i32 %27)
%31 = icmp sgt i32 %27, 0
%32 = load i32, i32* %4
br i1 %31, label %33, label %58
33: ; preds = %24
%34 = zext i32 %27 to i64
br label %35
35: ; preds = %33, %47
%36 = phi i64 [ 0, %33 ], [ %54, %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 %41, %28
%49 = sub i32 %48, %32
%50 = srem i32 %49, %28
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds [27 x i8], [27 x i8]* %3, i64 0, i64 %51
%53 = load i8, i8* %52
store i8 %53, i8* %39
%54 = add nuw nsw i64 %36, 1
%55 = icmp eq i64 %54, %34
br i1 %55, label %56, label %35
56: ; preds = %47
%57 = zext i32 %27 to i64
br label %58
58: ; preds = %24, %56
%59 = phi i64 [ %57, %56 ], [ 0, %24 ]
%60 = getelementptr inbounds [10000 x i8], [10000 x i8]* %2, i64 0, i64 %59
store i8 0, i8* %60
%61 = call i32 @strlen(i8* %7)
%62 = call i32 (i32*, i8*, ...) @fprintf(i32* %29, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.12, i64 0, i64 0), i32 %32, i8* %7, i32 %61)
%63 = call i32 @fclose(i32* %29)
%64 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.15, i64 0, i64 0))
%65 = call i32 (...) @getchar()
%66 = call i32 (...) @getchar()
ret i32 0
}