#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*/ SEEK_END;
int /*<<< orphan*/ escribir_palabra(int /*<<< orphan*/ *, char *, int *);
int /*<<< orphan*/ escribir_reversa(int /*<<< orphan*/ *, int, int *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
int ftell(int /*<<< orphan*/ *);
scalar_t__ isalpha(int);
int leer_reversa(int /*<<< orphan*/ *, int *);
int /*<<< orphan*/ memset(char **, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, ...);
int strlen(char *);
scalar_t__ tiene_dos_consonantes(char *);
int /*<<< orphan*/ truncate(char *, int);
int /*<<< orphan*/ ungetc(int, int /*<<< orphan*/ *);
int main() {
  FILE *fp = fopen("palabras.txt", "r");
  int c;
  int nuevo_largo = 0;
  int seek_escritura = 0;
  int seek_lectura = 0;
  char palabra[20];
  memset(&palabra, 0, sizeof(char) * 20);
  int indice_palabra = 0;
  int largo_palabra;
  while ((c = fgetc(fp)) != EOF) {
    if (isalpha(c)) {
      palabra[indice_palabra++] = c;
    } else {
      int mult = tiene_dos_consonantes(palabra) ? 2 : 1;
      largo_palabra = strlen(palabra);
      nuevo_largo += largo_palabra * mult + 1;
      printf("Palabra: %s, Largo: %d\n", palabra, nuevo_largo);
      memset(&palabra, 0, sizeof(char) * 20);
      indice_palabra = 0;
    }
  }
  printf("%d\n", nuevo_largo);
  memset(&palabra, 0, sizeof(char) * 20);
  indice_palabra = 0;
  ungetc(c, fp);
  seek_lectura = ftell(fp);
  fclose(fp);
  truncate("palabras.txt", sizeof(char) * nuevo_largo);
  fp = fopen("palabras.txt", "rb+");
  fseek(fp, 0, SEEK_END);
  seek_escritura = ftell(fp);
  while (seek_lectura >= 0) {
    c = leer_reversa(fp, &seek_lectura);
    if (isalpha(c)) {
      palabra[indice_palabra++] = c;
    } else {
      escribir_palabra(fp, palabra, &seek_escritura);
      if (tiene_dos_consonantes(palabra)) {
        escribir_palabra(fp, palabra, &seek_escritura);
      }
      escribir_reversa(fp, c, &seek_escritura);
      memset(&palabra, 0, sizeof(char) * 20);
      indice_palabra = 0;
    }
    if (isalpha(c) && seek_lectura < 0) {
      escribir_palabra(fp, palabra, &seek_escritura);
      if (tiene_dos_consonantes(palabra)) {
        escribir_palabra(fp, palabra, &seek_escritura);
      }
    }
  }
  fclose(fp);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xdfa(%rip),%rdi
lea    0xe00(%rip),%rsi
call   1110 <fopen@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1080 <memset@plt>
movl   $0x0,-0x44(%rbp)
mov    -0x10(%rbp),%rdi
call   1090 <fgetc@plt>
mov    %eax,-0x14(%rbp)
mov    0x2d8b(%rip),%rcx
cmp    (%rcx),%eax
je     12f7 <main+0x107>
mov    -0x14(%rbp),%edi
call   10e0 <isalpha@plt>
cmp    $0x0,%rax
je     128a <main+0x9a>
mov    -0x14(%rbp),%eax
mov    %al,%cl
mov    -0x44(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x44(%rbp)
cltq
mov    %cl,-0x40(%rbp,%rax,1)
jmp    12f2 <main+0x102>
lea    -0x40(%rbp),%rdi
call   10f0 <tiene_dos_consonantes@plt>
mov    %rax,%rdx
mov    $0x1,%eax
mov    $0x2,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
mov    %eax,-0x4c(%rbp)
lea    -0x40(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,-0x48(%rbp)
mov    -0x48(%rbp),%eax
imul   -0x4c(%rbp),%eax
add    $0x1,%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
lea    -0x40(%rbp),%rsi
mov    -0x18(%rbp),%edx
lea    0xd3b(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1080 <memset@plt>
movl   $0x0,-0x44(%rbp)
jmp    1242 <main+0x52>
mov    -0x18(%rbp),%esi
lea    0xd22(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1080 <memset@plt>
movl   $0x0,-0x44(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   10c0 <ungetc@plt>
mov    -0x10(%rbp),%rdi
call   10a0 <ftell@plt>
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
movslq -0x18(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%esi
lea    0xcaf(%rip),%rdi
call   10b0 <truncate@plt>
lea    0xca3(%rip),%rdi
lea    0xcc3(%rip),%rsi
call   1110 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2c70(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   10d0 <fseek@plt>
mov    -0x10(%rbp),%rdi
call   10a0 <ftell@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x20(%rbp)
jl     148b <main+0x29b>
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1040 <leer_reversa@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   10e0 <isalpha@plt>
cmp    $0x0,%rax
je     13d4 <main+0x1e4>
mov    -0x14(%rbp),%eax
mov    %al,%cl
mov    -0x44(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x44(%rbp)
cltq
mov    %cl,-0x40(%rbp,%rax,1)
jmp    1430 <main+0x240>
mov    -0x10(%rbp),%rdi
lea    -0x40(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
call   1100 <escribir_palabra@plt>
lea    -0x40(%rbp),%rdi
call   10f0 <tiene_dos_consonantes@plt>
cmp    $0x0,%rax
je     1409 <main+0x219>
mov    -0x10(%rbp),%rdi
lea    -0x40(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
call   1100 <escribir_palabra@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
lea    -0x1c(%rbp),%rdx
call   1070 <escribir_reversa@plt>
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1080 <memset@plt>
movl   $0x0,-0x44(%rbp)
mov    -0x14(%rbp),%edi
call   10e0 <isalpha@plt>
cmp    $0x0,%rax
je     1486 <main+0x296>
cmpl   $0x0,-0x20(%rbp)
jge    1486 <main+0x296>
mov    -0x10(%rbp),%rdi
lea    -0x40(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
call   1100 <escribir_palabra@plt>
lea    -0x40(%rbp),%rdi
call   10f0 <tiene_dos_consonantes@plt>
cmp    $0x0,%rax
je     1481 <main+0x291>
mov    -0x10(%rbp),%rdi
lea    -0x40(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
call   1100 <escribir_palabra@plt>
jmp    1486 <main+0x296>
jmp    138d <main+0x19d>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
lea    0xdfb(%rip),%rdi
lea    0xe01(%rip),%rsi
call   1110 <fopen@plt>
mov    %rax,%r14
lea    0x10(%rsp),%rdi
xor    %ebx,%ebx
xor    %esi,%esi
mov    $0x14,%edx
call   1080 <memset@plt>
mov    %r14,%rdi
call   1090 <fgetc@plt>
mov    %eax,%ebp
mov    0x2da8(%rip),%r13
cmp    0x0(%r13),%eax
jne    13df <main+0x1ef>
lea    0xdda(%rip),%rdi
xor    %r13d,%r13d
mov    %ebx,%esi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0x10(%rsp),%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1080 <memset@plt>
mov    %ebp,%edi
mov    %r14,%rsi
call   10c0 <ungetc@plt>
mov    %r14,%rdi
call   10a0 <ftell@plt>
mov    %eax,%ebp
mov    %eax,0x8(%rsp)
mov    %r14,%rdi
call   1030 <fclose@plt>
lea    0xd73(%rip),%r14
mov    %r14,%rdi
mov    %ebx,%esi
call   10b0 <truncate@plt>
lea    0xd89(%rip),%rsi
mov    %r14,%rdi
call   1110 <fopen@plt>
mov    %rax,%rbx
mov    0x2d38(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   10d0 <fseek@plt>
mov    %rbx,%rdi
call   10a0 <ftell@plt>
mov    %eax,0xc(%rsp)
test   %ebp,%ebp
js     13c6 <main+0x1d6>
lea    0x8(%rsp),%r14
lea    0x10(%rsp),%r15
lea    0xc(%rsp),%r12
jmp    12fc <main+0x10c>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    0x8(%rsp),%ecx
test   %ecx,%ecx
js     13c6 <main+0x1d6>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <leer_reversa@plt>
mov    %eax,%ebp
mov    %eax,%edi
call   10e0 <isalpha@plt>
test   %rax,%rax
je     1330 <main+0x140>
movslq %r13d,%rax
add    $0x1,%r13d
mov    %bpl,0x10(%rsp,%rax,1)
jmp    1378 <main+0x188>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1100 <escribir_palabra@plt>
mov    %r15,%rdi
call   10f0 <tiene_dos_consonantes@plt>
test   %rax,%rax
je     1359 <main+0x169>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1100 <escribir_palabra@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r12,%rdx
call   1070 <escribir_reversa@plt>
xor    %r13d,%r13d
mov    %r15,%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1080 <memset@plt>
mov    %ebp,%edi
call   10e0 <isalpha@plt>
mov    0x8(%rsp),%ecx
test   %rax,%rax
je     12f4 <main+0x104>
test   %ecx,%ecx
jns    12f4 <main+0x104>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1100 <escribir_palabra@plt>
mov    %r15,%rdi
call   10f0 <tiene_dos_consonantes@plt>
test   %rax,%rax
je     12f0 <main+0x100>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1100 <escribir_palabra@plt>
jmp    12f0 <main+0x100>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %r12d,%r12d
lea    0x10(%rsp),%r15
xor    %ebx,%ebx
jmp    144d <main+0x25d>
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
call   10f0 <tiene_dos_consonantes@plt>
cmp    $0x1,%rax
mov    $0x2,%ebp
sbb    $0x0,%ebp
mov    %r15,%rdi
call   1050 <strlen@plt>
imul   %ebp,%eax
add    %eax,%ebx
add    $0x1,%ebx
xor    %r12d,%r12d
lea    0xbf1(%rip),%rdi
mov    %r15,%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r15,%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1080 <memset@plt>
mov    %r14,%rdi
call   1090 <fgetc@plt>
mov    %eax,%ebp
cmp    0x0(%r13),%eax
je     1242 <main+0x52>
mov    %ebp,%edi
call   10e0 <isalpha@plt>
test   %rax,%rax
je     13f0 <main+0x200>
movslq %r12d,%rax
add    $0x1,%r12d
mov    %bpl,0x10(%rsp,%rax,1)
jmp    1439 <main+0x249>

LLVM IR (-O0):
@.str = [13 x i8] c"palabras.txt\00"
@.str.1 = [2 x i8] c"r\00"
@EOF = global i32 0
@.str.2 = [24 x i8] c"Palabra: %s, Largo: %d\0A\00"
@.str.3 = [4 x i8] c"%d\0A\00"
@.str.4 = [4 x i8] c"rb+\00"
@SEEK_END = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca [20 x i8]
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %1
%11 = call i32* @fopen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %11, i32** %2
store i32 0, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
%12 = bitcast [20 x i8]* %7 to i8**
%13 = call i32 @memset(i8** %12, i32 0, i32 20)
store i32 0, i32* %8
br label %14
14: ; preds = %49, %0
%15 = load i32*, i32** %2
%16 = call i32 @fgetc(i32* %15)
store i32 %16, i32* %3
%17 = load i32, i32* @EOF
%18 = icmp ne i32 %16, %17
br i1 %18, label %19, label %50
19: ; preds = %14
%20 = load i32, i32* %3
%21 = call i64 @isalpha(i32 %20)
%22 = icmp ne i64 %21, 0
br i1 %22, label %23, label %30
23: ; preds = %19
%24 = load i32, i32* %3
%25 = trunc i32 %24 to i8
%26 = load i32, i32* %8
%27 = add nsw i32 %26, 1
store i32 %27, i32* %8
%28 = sext i32 %26 to i64
%29 = getelementptr inbounds [20 x i8], [20 x i8]* %7, i64 0, i64 %28
store i8 %25, i8* %29
br label %49
30: ; preds = %19
%31 = getelementptr inbounds [20 x i8], [20 x i8]* %7, i64 0, i64 0
%32 = call i64 @tiene_dos_consonantes(i8* %31)
%33 = icmp ne i64 %32, 0
%34 = zext i1 %33 to i64
%35 = select i1 %33, i32 2, i32 1
store i32 %35, i32* %10
%36 = getelementptr inbounds [20 x i8], [20 x i8]* %7, i64 0, i64 0
%37 = call i32 @strlen(i8* %36)
store i32 %37, i32* %9
%38 = load i32, i32* %9
%39 = load i32, i32* %10
%40 = mul nsw i32 %38, %39
%41 = add nsw i32 %40, 1
%42 = load i32, i32* %4
%43 = add nsw i32 %42, %41
store i32 %43, i32* %4
%44 = getelementptr inbounds [20 x i8], [20 x i8]* %7, i64 0, i64 0
%45 = load i32, i32* %4
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* %44, i32 %45)
%47 = bitcast [20 x i8]* %7 to i8**
%48 = call i32 @memset(i8** %47, i32 0, i32 20)
store i32 0, i32* %8
br label %49
49: ; preds = %30, %23
br label %14
50: ; preds = %14
%51 = load i32, i32* %4
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %51)
%53 = bitcast [20 x i8]* %7 to i8**
%54 = call i32 @memset(i8** %53, i32 0, i32 20)
store i32 0, i32* %8
%55 = load i32, i32* %3
%56 = load i32*, i32** %2
%57 = call i32 @ungetc(i32 %55, i32* %56)
%58 = load i32*, i32** %2
%59 = call i32 @ftell(i32* %58)
store i32 %59, i32* %6
%60 = load i32*, i32** %2
%61 = call i32 @fclose(i32* %60)
%62 = load i32, i32* %4
%63 = sext i32 %62 to i64
%64 = mul i64 1, %63
%65 = trunc i64 %64 to i32
%66 = call i32 @truncate(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %65)
%67 = call i32* @fopen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
store i32* %67, i32** %2
%68 = load i32*, i32** %2
%69 = load i32, i32* @SEEK_END
%70 = call i32 @fseek(i32* %68, i32 0, i32 %69)
%71 = load i32*, i32** %2
%72 = call i32 @ftell(i32* %71)
store i32 %72, i32* %5
br label %73
73: ; preds = %125, %50
%74 = load i32, i32* %6
%75 = icmp sge i32 %74, 0
br i1 %75, label %76, label %126
76: ; preds = %73
%77 = load i32*, i32** %2
%78 = call i32 @leer_reversa(i32* %77, i32* %6)
store i32 %78, i32* %3
%79 = load i32, i32* %3
%80 = call i64 @isalpha(i32 %79)
%81 = icmp ne i64 %80, 0
br i1 %81, label %82, label %89
82: ; preds = %76
%83 = load i32, i32* %3
%84 = trunc i32 %83 to i8
%85 = load i32, i32* %8
%86 = add nsw i32 %85, 1
store i32 %86, i32* %8
%87 = sext i32 %85 to i64
%88 = getelementptr inbounds [20 x i8], [20 x i8]* %7, i64 0, i64 %87
store i8 %84, i8* %88
br label %106
89: ; preds = %76
%90 = load i32*, i32** %2
%91 = getelementptr inbounds [20 x i8], [20 x i8]* %7, i64 0, i64 0
%92 = call i32 @escribir_palabra(i32* %90, i8* %91, i32* %5)
%93 = getelementptr inbounds [20 x i8], [20 x i8]* %7, i64 0, i64 0
%94 = call i64 @tiene_dos_consonantes(i8* %93)
%95 = icmp ne i64 %94, 0
br i1 %95, label %96, label %100
96: ; preds = %89
%97 = load i32*, i32** %2
%98 = getelementptr inbounds [20 x i8], [20 x i8]* %7, i64 0, i64 0
%99 = call i32 @escribir_palabra(i32* %97, i8* %98, i32* %5)
br label %100
100: ; preds = %96, %89
%101 = load i32*, i32** %2
%102 = load i32, i32* %3
%103 = call i32 @escribir_reversa(i32* %101, i32 %102, i32* %5)
%104 = bitcast [20 x i8]* %7 to i8**
%105 = call i32 @memset(i8** %104, i32 0, i32 20)
store i32 0, i32* %8
br label %106
106: ; preds = %100, %82
%107 = load i32, i32* %3
%108 = call i64 @isalpha(i32 %107)
%109 = icmp ne i64 %108, 0
br i1 %109, label %110, label %125
110: ; preds = %106
%111 = load i32, i32* %6
%112 = icmp slt i32 %111, 0
br i1 %112, label %113, label %125
113: ; preds = %110
%114 = load i32*, i32** %2
%115 = getelementptr inbounds [20 x i8], [20 x i8]* %7, i64 0, i64 0
%116 = call i32 @escribir_palabra(i32* %114, i8* %115, i32* %5)
%117 = getelementptr inbounds [20 x i8], [20 x i8]* %7, i64 0, i64 0
%118 = call i64 @tiene_dos_consonantes(i8* %117)
%119 = icmp ne i64 %118, 0
br i1 %119, label %120, label %124
120: ; preds = %113
%121 = load i32*, i32** %2
%122 = getelementptr inbounds [20 x i8], [20 x i8]* %7, i64 0, i64 0
%123 = call i32 @escribir_palabra(i32* %121, i8* %122, i32* %5)
br label %124
124: ; preds = %120, %113
br label %125
125: ; preds = %124, %110, %106
br label %73
126: ; preds = %73
%127 = load i32*, i32** %2
%128 = call i32 @fclose(i32* %127)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"palabras.txt\00"
@.str.1 = [2 x i8] c"r\00"
@EOF = global i32 0
@.str.2 = [24 x i8] c"Palabra: %s, Largo: %d\0A\00"
@.str.3 = [4 x i8] c"%d\0A\00"
@.str.4 = [4 x i8] c"rb+\00"
@SEEK_END = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [20 x i8]
%4 = tail call i32* @fopen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%8 = bitcast [20 x i8]* %3 to i8**
%9 = call i32 @memset(i8** %8, i32 0, i32 20)
%10 = call i32 @fgetc(i32* %4)
%11 = load i32, i32* @EOF
%12 = icmp eq i32 %10, %11
br i1 %12, label %40, label %13
13: ; preds = %0, %34
%14 = phi i32 [ %37, %34 ], [ %10, %0 ]
%15 = phi i32 [ %36, %34 ], [ 0, %0 ]
%16 = phi i32 [ %35, %34 ], [ 0, %0 ]
%17 = call i64 @isalpha(i32 %14)
%18 = icmp eq i64 %17, 0
br i1 %18, label %24, label %19
19: ; preds = %13
%20 = trunc i32 %14 to i8
%21 = add nsw i32 %15, 1
%22 = sext i32 %15 to i64
%23 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 %22
store i8 %20, i8* %23
br label %34
24: ; preds = %13
%25 = call i64 @tiene_dos_consonantes(i8* %7)
%26 = icmp eq i64 %25, 0
%27 = select i1 %26, i32 1, i32 2
%28 = call i32 @strlen(i8* %7)
%29 = mul nsw i32 %27, %28
%30 = add i32 %16, 1
%31 = add i32 %30, %29
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* %7, i32 %31)
%33 = call i32 @memset(i8** %8, i32 0, i32 20)
br label %34
34: ; preds = %24, %19
%35 = phi i32 [ %16, %19 ], [ %31, %24 ]
%36 = phi i32 [ %21, %19 ], [ 0, %24 ]
%37 = call i32 @fgetc(i32* %4)
%38 = load i32, i32* @EOF
%39 = icmp eq i32 %37, %38
br i1 %39, label %40, label %13
40: ; preds = %34, %0
%41 = phi i32 [ 0, %0 ], [ %35, %34 ]
%42 = phi i32 [ %10, %0 ], [ %37, %34 ]
%43 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %41)
%44 = call i32 @memset(i8** %8, i32 0, i32 20)
%45 = call i32 @ungetc(i32 %42, i32* %4)
%46 = call i32 @ftell(i32* %4)
store i32 %46, i32* %2
%47 = call i32 @fclose(i32* %4)
%48 = call i32 @truncate(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %41)
%49 = call i32* @fopen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%50 = load i32, i32* @SEEK_END
%51 = call i32 @fseek(i32* %49, i32 0, i32 %50)
%52 = call i32 @ftell(i32* %49)
store i32 %52, i32* %1
%53 = icmp sgt i32 %46, -1
br i1 %53, label %54, label %91
54: ; preds = %40, %88
%55 = phi i32 [ %74, %88 ], [ 0, %40 ]
%56 = call i32 @leer_reversa(i32* %49, i32* %2)
%57 = call i64 @isalpha(i32 %56)
%58 = icmp eq i64 %57, 0
br i1 %58, label %64, label %59
59: ; preds = %54
%60 = trunc i32 %56 to i8
%61 = add nsw i32 %55, 1
%62 = sext i32 %55 to i64
%63 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 %62
store i8 %60, i8* %63
br label %73
64: ; preds = %54
%65 = call i32 @escribir_palabra(i32* %49, i8* %7, i32* %1)
%66 = call i64 @tiene_dos_consonantes(i8* %7)
%67 = icmp eq i64 %66, 0
br i1 %67, label %70, label %68
68: ; preds = %64
%69 = call i32 @escribir_palabra(i32* %49, i8* %7, i32* %1)
br label %70
70: ; preds = %68, %64
%71 = call i32 @escribir_reversa(i32* %49, i32 %56, i32* %1)
%72 = call i32 @memset(i8** %8, i32 0, i32 20)
br label %73
73: ; preds = %70, %59
%74 = phi i32 [ %61, %59 ], [ 0, %70 ]
%75 = call i64 @isalpha(i32 %56)
%76 = icmp ne i64 %75, 0
%77 = load i32, i32* %2
%78 = icmp slt i32 %77, 0
%79 = select i1 %76, i1 %78, i1 false
br i1 %79, label %80, label %88
80: ; preds = %73
%81 = call i32 @escribir_palabra(i32* %49, i8* %7, i32* %1)
%82 = call i64 @tiene_dos_consonantes(i8* %7)
%83 = icmp eq i64 %82, 0
br i1 %83, label %86, label %84
84: ; preds = %80
%85 = call i32 @escribir_palabra(i32* %49, i8* %7, i32* %1)
br label %86
86: ; preds = %84, %80
%87 = load i32, i32* %2
br label %88
88: ; preds = %86, %73
%89 = phi i32 [ %87, %86 ], [ %77, %73 ]
%90 = icmp sgt i32 %89, -1
br i1 %90, label %54, label %91
91: ; preds = %88, %40
%92 = call i32 @fclose(i32* %49)
ret i32 0
}