#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 */

/* Variables and functions */
char *malloc(int);
int strlen(char *);
int alterations(char *word, char **posibles, int index) {
  int j, k = 0;
  char alphabet[26] = "abcdefghijklmnopqrstuvwxyz";
  for (int i = 26; i < (strlen(word) + 1) * 26; i++) {
    k = 0;
    char *new_word = malloc(strlen(word) + 1);
    for (j = 0; j < i / 26; j++) {
      *(new_word + j) = word[k];
      k++;
    }
    *(new_word + j - 1) = alphabet[i % 26];
    for (; j < (strlen(word) + 1); j++) {
      *(new_word + j) = word[k];
      k++;
    }
    *(posibles + index) = new_word;
    index++;
  }
  return index;
}


x86 assembly (clang, -O0):
<alterations>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    0xebf(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xebc(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xeb9(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xeb6(%rip),%ax
mov    %ax,-0x28(%rbp)
movl   $0x1a,-0x44(%rbp)
mov    -0x44(%rbp),%eax
mov    %eax,-0x54(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x54(%rbp),%eax
add    $0x1,%ecx
imul   $0x1a,%ecx,%ecx
cmp    %ecx,%eax
jge    1290 <alterations+0x170>
movl   $0x0,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%edi
add    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x50(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x58(%rbp)
mov    -0x44(%rbp),%eax
mov    $0x1a,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x58(%rbp),%eax
cmp    %ecx,%eax
jge    11ff <alterations+0xdf>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x50(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11b4 <alterations+0x94>
mov    -0x44(%rbp),%eax
mov    $0x1a,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
mov    -0x40(%rbp,%rax,1),%dl
mov    -0x50(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    %dl,-0x1(%rax,%rcx,1)
mov    -0x18(%rbp),%eax
mov    %eax,-0x5c(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x5c(%rbp),%eax
add    $0x1,%ecx
cmp    %ecx,%eax
jge    1269 <alterations+0x149>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x50(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    121d <alterations+0xfd>
mov    -0x50(%rbp),%rdx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    116d <alterations+0x4d>
mov    -0x14(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alterations>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %edx,%ebx
mov    %rsi,0x8(%rsp)
mov    %rdi,%r13
call   1030 <strlen@plt>
lea    (%rax,%rax,4),%ecx
lea    (%rcx,%rcx,4),%ecx
add    %ecx,%eax
add    $0x1a,%eax
cmp    $0x1b,%eax
jl     1252 <alterations+0x122>
movslq %ebx,%rbx
mov    $0x1a,%r12d
xor    %r14d,%r14d
jmp    11a6 <alterations+0x76>
nop
mov    0x10(%rsp),%rbx
mov    0x8(%rsp),%rax
mov    %rbp,(%rax,%rbx,8)
add    $0x1,%rbx
add    $0x1,%r12
mov    %r13,%rdi
call   1030 <strlen@plt>
lea    (%rax,%rax,4),%ecx
lea    (%rcx,%rcx,4),%ecx
add    %ecx,%eax
add    $0x1a,%eax
add    $0x1,%r14
cmp    %eax,%r12d
jge    1252 <alterations+0x122>
mov    %rbx,0x10(%rsp)
mov    %r12,%rax
movabs $0x4ec4ec4ec4ec4ec5,%r15
ec c4 4e
mul    %r15
mov    %rdx,%rbx
mov    %r13,%rdi
call   1030 <strlen@plt>
lea    0x1(%rax),%edi
call   1050 <malloc@plt>
mov    %rax,%rbp
lea    0x1a(%r14),%rax
mul    %r15
shr    $0x3,%rdx
mov    %rbp,%rdi
mov    %r13,%rsi
call   1040 <memcpy@plt>
mov    %r12d,%eax
imul   $0x4ec4ec4f,%rax,%r15
shr    $0x23,%r15
lea    (%r15,%r15,4),%eax
lea    (%rax,%rax,4),%eax
add    %r15d,%eax
mov    %r12d,%ecx
sub    %eax,%ecx
lea    0xdf5(%rip),%rax
mov    (%rcx,%rax,1),%al
mov    %al,-0x1(%rbp,%r15,1)
mov    %r13,%rdi
call   1030 <strlen@plt>
cmp    %eax,%r15d
jg     1170 <alterations+0x40>
shr    $0x3,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax)
movzbl 0x1(%r13,%rbx,1),%eax
mov    %al,0x1(%rbp,%rbx,1)
mov    %r13,%rdi
call   1030 <strlen@plt>
cltq
add    $0x1,%rbx
cmp    %rax,%rbx
jl     1230 <alterations+0x100>
jmp    1170 <alterations+0x40>
mov    %ebx,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.alterations.alphabet = [26 x i8] c"abcdefghijklmnopqrstuvwxyz"
define i32 @alterations(i8* %0, i8** %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca [26 x i8]
%10 = alloca i32
%11 = alloca i8*
store i8* %0, i8** %4
store i8** %1, i8*** %5
store i32 %2, i32* %6
store i32 0, i32* %8
%12 = bitcast [26 x i8]* %9 to i8*
store i32 26, i32* %10
br label %13
13: ; preds = %85, %3
%14 = load i32, i32* %10
%15 = load i8*, i8** %4
%16 = call i32 @strlen(i8* %15)
%17 = add nsw i32 %16, 1
%18 = mul nsw i32 %17, 26
%19 = icmp slt i32 %14, %18
br i1 %19, label %20, label %88
20: ; preds = %13
store i32 0, i32* %8
%21 = load i8*, i8** %4
%22 = call i32 @strlen(i8* %21)
%23 = add nsw i32 %22, 1
%24 = call i8* @malloc(i32 %23)
store i8* %24, i8** %11
store i32 0, i32* %7
br label %25
25: ; preds = %42, %20
%26 = load i32, i32* %7
%27 = load i32, i32* %10
%28 = sdiv i32 %27, 26
%29 = icmp slt i32 %26, %28
br i1 %29, label %30, label %45
30: ; preds = %25
%31 = load i8*, i8** %4
%32 = load i32, i32* %8
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds i8, i8* %31, i64 %33
%35 = load i8, i8* %34
%36 = load i8*, i8** %11
%37 = load i32, i32* %7
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds i8, i8* %36, i64 %38
store i8 %35, i8* %39
%40 = load i32, i32* %8
%41 = add nsw i32 %40, 1
store i32 %41, i32* %8
br label %42
42: ; preds = %30
%43 = load i32, i32* %7
%44 = add nsw i32 %43, 1
store i32 %44, i32* %7
br label %25
45: ; preds = %25
%46 = load i32, i32* %10
%47 = srem i32 %46, 26
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds [26 x i8], [26 x i8]* %9, i64 0, i64 %48
%50 = load i8, i8* %49
%51 = load i8*, i8** %11
%52 = load i32, i32* %7
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds i8, i8* %51, i64 %53
%55 = getelementptr inbounds i8, i8* %54, i64 -1
store i8 %50, i8* %55
br label %56
56: ; preds = %74, %45
%57 = load i32, i32* %7
%58 = load i8*, i8** %4
%59 = call i32 @strlen(i8* %58)
%60 = add nsw i32 %59, 1
%61 = icmp slt i32 %57, %60
br i1 %61, label %62, label %77
62: ; preds = %56
%63 = load i8*, i8** %4
%64 = load i32, i32* %8
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds i8, i8* %63, i64 %65
%67 = load i8, i8* %66
%68 = load i8*, i8** %11
%69 = load i32, i32* %7
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds i8, i8* %68, i64 %70
store i8 %67, i8* %71
%72 = load i32, i32* %8
%73 = add nsw i32 %72, 1
store i32 %73, i32* %8
br label %74
74: ; preds = %62
%75 = load i32, i32* %7
%76 = add nsw i32 %75, 1
store i32 %76, i32* %7
br label %56
77: ; preds = %56
%78 = load i8*, i8** %11
%79 = load i8**, i8*** %5
%80 = load i32, i32* %6
%81 = sext i32 %80 to i64
%82 = getelementptr inbounds i8*, i8** %79, i64 %81
store i8* %78, i8** %82
%83 = load i32, i32* %6
%84 = add nsw i32 %83, 1
store i32 %84, i32* %6
br label %85
85: ; preds = %77
%86 = load i32, i32* %10
%87 = add nsw i32 %86, 1
store i32 %87, i32* %10
br label %13
88: ; preds = %13
%89 = load i32, i32* %6
ret i32 %89
}

LLVM IR (-O2):
@__const.alterations.alphabet = [26 x i8] c"abcdefghijklmnopqrstuvwxyz"
define i32 @alterations(i8* %0, i8** nocapture writeonly %1, i32 %2) {
%4 = tail call i32 @strlen(i8* %0)
%5 = mul i32 %4, 26
%6 = add i32 %5, 26
%7 = icmp sgt i32 %6, 26
br i1 %7, label %8, label %12
8: ; preds = %3
%9 = sext i32 %2 to i64
br label %14
10: ; preds = %44
%11 = trunc i64 %46 to i32
br label %12
12: ; preds = %10, %3
%13 = phi i32 [ %2, %3 ], [ %11, %10 ]
ret i32 %13
14: ; preds = %44, %8
%15 = phi i64 [ %9, %8 ], [ %46, %44 ]
%16 = phi i64 [ 0, %8 ], [ %52, %44 ]
%17 = phi i32 [ 26, %8 ], [ %47, %44 ]
%18 = udiv i32 %17, 26
%19 = tail call i32 @strlen(i8* %0)
%20 = add nsw i32 %19, 1
%21 = tail call i8* @malloc(i32 %20)
%22 = add nuw nsw i64 %16, 26
%23 = udiv i64 %22, 26
%24 = zext i32 %18 to i64
%25 = urem i32 %17, 26
%26 = zext i32 %25 to i64
%27 = getelementptr inbounds [26 x i8], [26 x i8]* @__const.alterations.alphabet, i64 0, i64 %26
%28 = load i8, i8* %27
%29 = getelementptr inbounds i8, i8* %21, i64 -1
%30 = getelementptr inbounds i8, i8* %29, i64 %24
store i8 %28, i8* %30
%31 = tail call i32 @strlen(i8* %0)
%32 = icmp sgt i32 %18, %31
br i1 %32, label %44, label %33
33: ; preds = %14, %33
%34 = phi i64 [ %40, %33 ], [ %24, %14 ]
%35 = phi i64 [ %39, %33 ], [ %24, %14 ]
%36 = getelementptr inbounds i8, i8* %0, i64 %35
%37 = load i8, i8* %36
%38 = getelementptr inbounds i8, i8* %21, i64 %34
store i8 %37, i8* %38
%39 = add nuw nsw i64 %35, 1
%40 = add nuw nsw i64 %34, 1
%41 = tail call i32 @strlen(i8* %0)
%42 = sext i32 %41 to i64
%43 = icmp slt i64 %34, %42
br i1 %43, label %33, label %44
44: ; preds = %33, %14
%45 = getelementptr inbounds i8*, i8** %1, i64 %15
store i8* %21, i8** %45
%46 = add nsw i64 %15, 1
%47 = add nuw nsw i32 %17, 1
%48 = tail call i32 @strlen(i8* %0)
%49 = mul i32 %48, 26
%50 = add i32 %49, 26
%51 = icmp slt i32 %47, %50
%52 = add nuw nsw i64 %16, 1
br i1 %51, label %14, label %10
}