#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*/ convertir(char *, char *);
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
int col_adapt(FILE *archivo_entrada, FILE *archivo_salida) {
  char palabra[81] = "", palabra_salida[81] = "", buffer_linea[81] = "";
  while (!feof(archivo_entrada)) {
    fscanf(archivo_entrada, "%s", palabra);
    convertir(palabra, palabra_salida);
    strcat(palabra_salida, " ");
    printf("hhhhhhhhh");
    if ((strlen(buffer_linea) + strlen(palabra_salida)) < 29) {
      strcat(buffer_linea, palabra_salida);
      printf("%d\n", (strlen(buffer_linea) + strlen(palabra_salida)));
    } else {
      fprintf(archivo_salida, "\n");
      fprintf(archivo_salida, buffer_linea);
      strcpy(buffer_linea, palabra_salida);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<col_adapt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x140,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x70(%rbp),%rdi
xor    %esi,%esi
mov    $0x51,%edx
call   1070 <memset@plt>
lea    -0xd0(%rbp),%rdi
xor    %esi,%esi
mov    $0x51,%edx
call   1070 <memset@plt>
lea    -0x130(%rbp),%rdi
xor    %esi,%esi
mov    $0x51,%edx
call   1070 <memset@plt>
mov    -0x8(%rbp),%rdi
call   10a0 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    11f7 <col_adapt+0x67>
jmp    12f1 <col_adapt+0x161>
mov    -0x8(%rbp),%rdi
lea    -0x70(%rbp),%rdx
lea    0xdfa(%rip),%rsi
call   1080 <fscanf@plt>
lea    -0x70(%rbp),%rdi
lea    -0xd0(%rbp),%rsi
call   1030 <convertir@plt>
lea    -0xd0(%rbp),%rdi
lea    0xdda(%rip),%rsi
call   10b0 <strcat@plt>
lea    0xdd0(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x130(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,-0x134(%rbp)
lea    -0xd0(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,%ecx
mov    -0x134(%rbp),%eax
add    %ecx,%eax
cmp    $0x1d,%eax
jge    12b9 <col_adapt+0x129>
lea    -0x130(%rbp),%rdi
lea    -0xd0(%rbp),%rsi
call   10b0 <strcat@plt>
lea    -0x130(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,-0x138(%rbp)
lea    -0xd0(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x138(%rbp),%esi
add    %eax,%esi
lea    0xd62(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    12ec <col_adapt+0x15c>
mov    -0x10(%rbp),%rdi
lea    0xd4d(%rip),%rsi
call   1090 <fprintf@plt>
mov    -0x10(%rbp),%rdi
lea    -0x130(%rbp),%rsi
call   1090 <fprintf@plt>
lea    -0x130(%rbp),%rdi
lea    -0xd0(%rbp),%rsi
call   1040 <strcpy@plt>
jmp    11d9 <col_adapt+0x49>
xor    %eax,%eax
add    $0x140,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<col_adapt>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x128,%rsp
mov    %rsi,0x8(%rsp)
mov    %rdi,%r13
xorps  %xmm0,%xmm0
movaps %xmm0,0x110(%rsp)
movaps %xmm0,0x100(%rsp)
movaps %xmm0,0xf0(%rsp)
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0xd0(%rsp)
movb   $0x0,0x120(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movb   $0x0,0xc0(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movb   $0x0,0x60(%rsp)
call   10a0 <feof@plt>
test   %eax,%eax
je     1244 <col_adapt+0xb4>
xor    %eax,%eax
add    $0x128,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xd0(%rsp),%r12
lea    0x70(%rsp),%rbx
lea    0x10(%rsp),%r14
jmp    1294 <col_adapt+0x104>
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
mov    0x8(%rsp),%rbp
mov    %rbp,%rsi
call   1080 <fputc@plt>
mov    %rbp,%rdi
mov    %r14,%rsi
call   1090 <fprintf@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <strcpy@plt>
mov    %r13,%rdi
call   10a0 <feof@plt>
test   %eax,%eax
jne    1230 <col_adapt+0xa0>
mov    %r13,%rdi
lea    0xd62(%rip),%rsi
mov    %r12,%rdx
call   1070 <fscanf@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1030 <convertir@plt>
mov    %rbx,%rdi
lea    0xd48(%rip),%rsi
call   10b0 <strcat@plt>
lea    0xd3e(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r14,%rdi
call   1050 <strlen@plt>
mov    %eax,%r15d
mov    %rbx,%rdi
call   1050 <strlen@plt>
add    %r15d,%eax
cmp    $0x1c,%eax
jg     1260 <col_adapt+0xd0>
mov    %r14,%rdi
mov    %rbx,%rsi
call   10b0 <strcat@plt>
mov    %r14,%rdi
call   1050 <strlen@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1050 <strlen@plt>
add    %eax,%ebp
lea    0xcfc(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1060 <printf@plt>
jmp    1288 <col_adapt+0xf8>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [2 x i8] c" \00"
@.str.2 = [10 x i8] c"hhhhhhhhh\00"
@.str.3 = [4 x i8] c"%d\0A\00"
@.str.4 = [2 x i8] c"\0A\00"
define i32 @col_adapt(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca [81 x i8]
%6 = alloca [81 x i8]
%7 = alloca [81 x i8]
store i32* %0, i32** %3
store i32* %1, i32** %4
%8 = bitcast [81 x i8]* %5 to i8*
%9 = bitcast [81 x i8]* %6 to i8*
%10 = bitcast [81 x i8]* %7 to i8*
br label %11
11: ; preds = %51, %2
%12 = load i32*, i32** %3
%13 = call i32 @feof(i32* %12)
%14 = icmp ne i32 %13, 0
%15 = xor i1 %14, true
br i1 %15, label %16, label %52
16: ; preds = %11
%17 = load i32*, i32** %3
%18 = getelementptr inbounds [81 x i8], [81 x i8]* %5, i64 0, i64 0
%19 = call i32 @fscanf(i32* %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %18)
%20 = getelementptr inbounds [81 x i8], [81 x i8]* %5, i64 0, i64 0
%21 = getelementptr inbounds [81 x i8], [81 x i8]* %6, i64 0, i64 0
%22 = call i32 @convertir(i8* %20, i8* %21)
%23 = getelementptr inbounds [81 x i8], [81 x i8]* %6, i64 0, i64 0
%24 = call i32 @strcat(i8* %23, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%26 = getelementptr inbounds [81 x i8], [81 x i8]* %7, i64 0, i64 0
%27 = call i32 @strlen(i8* %26)
%28 = getelementptr inbounds [81 x i8], [81 x i8]* %6, i64 0, i64 0
%29 = call i32 @strlen(i8* %28)
%30 = add nsw i32 %27, %29
%31 = icmp slt i32 %30, 29
br i1 %31, label %32, label %42
32: ; preds = %16
%33 = getelementptr inbounds [81 x i8], [81 x i8]* %7, i64 0, i64 0
%34 = getelementptr inbounds [81 x i8], [81 x i8]* %6, i64 0, i64 0
%35 = call i32 @strcat(i8* %33, i8* %34)
%36 = getelementptr inbounds [81 x i8], [81 x i8]* %7, i64 0, i64 0
%37 = call i32 @strlen(i8* %36)
%38 = getelementptr inbounds [81 x i8], [81 x i8]* %6, i64 0, i64 0
%39 = call i32 @strlen(i8* %38)
%40 = add nsw i32 %37, %39
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %40)
br label %51
42: ; preds = %16
%43 = load i32*, i32** %4
%44 = call i32 @fprintf(i32* %43, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%45 = load i32*, i32** %4
%46 = getelementptr inbounds [81 x i8], [81 x i8]* %7, i64 0, i64 0
%47 = call i32 @fprintf(i32* %45, i8* %46)
%48 = getelementptr inbounds [81 x i8], [81 x i8]* %7, i64 0, i64 0
%49 = getelementptr inbounds [81 x i8], [81 x i8]* %6, i64 0, i64 0
%50 = call i32 @strcpy(i8* %48, i8* %49)
br label %51
51: ; preds = %42, %32
br label %11
52: ; preds = %11
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [2 x i8] c" \00"
@.str.2 = [10 x i8] c"hhhhhhhhh\00"
@.str.3 = [4 x i8] c"%d\0A\00"
define i32 @col_adapt(i32* nocapture %0, i32* nocapture %1) {
%3 = alloca [81 x i8]
%4 = alloca [81 x i8]
%5 = alloca [81 x i8]
%6 = getelementptr inbounds [81 x i8], [81 x i8]* %3, i64 0, i64 0
%7 = getelementptr inbounds [81 x i8], [81 x i8]* %4, i64 0, i64 0
%8 = getelementptr inbounds [81 x i8], [81 x i8]* %5, i64 0, i64 0
%9 = call i32 @feof(i32* %0)
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %33
11: ; preds = %2, %30
%12 = call i32 @fscanf(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6)
%13 = call i32 @convertir(i8* %6, i8* %7)
%14 = call i32 @strcat(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%16 = call i32 @strlen(i8* %8)
%17 = call i32 @strlen(i8* %7)
%18 = add nsw i32 %17, %16
%19 = icmp slt i32 %18, 29
br i1 %19, label %20, label %26
20: ; preds = %11
%21 = call i32 @strcat(i8* %8, i8* %7)
%22 = call i32 @strlen(i8* %8)
%23 = call i32 @strlen(i8* %7)
%24 = add nsw i32 %23, %22
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %24)
br label %30
26: ; preds = %11
%27 = call i32 @fputc(i32 10, i32* %1)
%28 = call i32 @fprintf(i32* %1, i8* %8)
%29 = call i32 @strcpy(i8* %8, i8* %7)
br label %30
30: ; preds = %26, %20
%31 = call i32 @feof(i32* %0)
%32 = icmp eq i32 %31, 0
br i1 %32, label %11, label %33
33: ; preds = %30, %2
ret i32 0
}