#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 */
int /*<<< orphan*/ printf(char *, char *, ...);
int /*<<< orphan*/ strclear(char *);
int /*<<< orphan*/ strconcatchar(char *, char);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ strdel(char *, int, int);
int /*<<< orphan*/ strinsert(char *, char *, int);
int strlen(char *);
int strpos(char *, char *);
int /*<<< orphan*/ strreplace(char *, char *, char *);
int /*<<< orphan*/ strsubstring(char *, char *, int, int);
int /*<<< orphan*/ strtolower(char *);
int /*<<< orphan*/ strtoupper(char *);
int main() {
  char buffer[128];
  char buffer2[128];
  strcpy(buffer, "Esto ES UNA prueba");
  printf("Cadena original: '%s'\n", buffer);
  strtolower(buffer);
  printf("Cadena: '%s'\n", buffer);
  strtoupper(buffer);
  printf("Cadena: '%s'\n", buffer);
  strsubstring(buffer, buffer2, 0, 4);
  printf("Subcadena: '%s'\n", buffer2);
  printf("Posición de '%s' en '%s': %d\n", buffer2, buffer,
         strpos(buffer, buffer2));
  printf("Posición de 'ES' en '%s': %d\n", buffer, strpos(buffer, " ES "));
  printf("Posición de '%s' en '%s': %d\n", buffer, buffer2,
         strpos(buffer2, buffer));
  printf("Posición de NULL en '%s': %d\n", buffer, strpos(buffer, NULL));
  strinsert("NO ", buffer, 5);
  printf("Insertando NO queda: '%s'\n", buffer);
  strsubstring(buffer, buffer2, 100, 4);
  printf("Subcadena: '%s'\n", buffer2);
  strsubstring(buffer, buffer2, 5, 2);
  printf("Subcadena: '%s'\n", buffer2);
  strsubstring(buffer, buffer2, 5, 200);
  printf("Subcadena: '%s'\n", buffer2);
  printf("Buffer es '%s'\n", buffer);
  strdel(buffer, 4, 3);
  printf("Quitando 3 de 4, queda '%s'\n", buffer);
  strreplace(buffer, "S", "Z");
  printf("Reemplazando S por Z, queda '%s'\n", buffer);
  strreplace(buffer, "UNA", "OTRA");
  printf("Reemplazando UNA por OTRA, queda '%s'\n", buffer);
  strclear(buffer2);
  int i = 0;
  for (; i < strlen(buffer); ++i) {
    strconcatchar(buffer2, buffer[i]);
    printf("%s\n", buffer2);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x150,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x90(%rbp),%rdi
lea    0xe20(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x90(%rbp),%rsi
lea    0xe20(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0x90(%rbp),%rdi
call   1070 <strtolower@plt>
lea    -0x90(%rbp),%rsi
lea    0xe16(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0x90(%rbp),%rdi
call   1040 <strtoupper@plt>
lea    -0x90(%rbp),%rsi
lea    0xdf5(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0x90(%rbp),%rdi
lea    -0x110(%rbp),%rsi
xor    %edx,%edx
mov    $0x4,%ecx
call   10e0 <strsubstring@plt>
lea    -0x110(%rbp),%rsi
lea    0xdd4(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0x110(%rbp),%rax
mov    %rax,-0x148(%rbp)
lea    -0x90(%rbp),%rax
mov    %rax,-0x140(%rbp)
lea    -0x90(%rbp),%rdi
lea    -0x110(%rbp),%rsi
call   10b0 <strpos@plt>
mov    -0x148(%rbp),%rsi
mov    -0x140(%rbp),%rdx
mov    %eax,%ecx
lea    0xd98(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0x90(%rbp),%rax
mov    %rax,-0x138(%rbp)
lea    -0x90(%rbp),%rdi
lea    0xdb3(%rip),%rsi
call   10b0 <strpos@plt>
mov    -0x138(%rbp),%rsi
mov    %eax,%edx
lea    0xd7f(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0x90(%rbp),%rax
mov    %rax,-0x130(%rbp)
lea    -0x110(%rbp),%rax
mov    %rax,-0x128(%rbp)
lea    -0x110(%rbp),%rdi
lea    -0x90(%rbp),%rsi
call   10b0 <strpos@plt>
mov    -0x130(%rbp),%rsi
mov    -0x128(%rbp),%rdx
mov    %eax,%ecx
lea    0xd13(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0x90(%rbp),%rax
mov    %rax,-0x120(%rbp)
lea    -0x90(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   10b0 <strpos@plt>
mov    -0x120(%rbp),%rsi
mov    %eax,%edx
lea    0xd21(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0x90(%rbp),%rsi
lea    0xd2b(%rip),%rdi
mov    $0x5,%edx
call   10d0 <strinsert@plt>
lea    -0x90(%rbp),%rsi
lea    0xd17(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0x90(%rbp),%rdi
lea    -0x110(%rbp),%rsi
mov    $0x64,%edx
mov    $0x4,%ecx
call   10e0 <strsubstring@plt>
lea    -0x110(%rbp),%rsi
lea    0xc6e(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0x90(%rbp),%rdi
lea    -0x110(%rbp),%rsi
mov    $0x5,%edx
mov    $0x2,%ecx
call   10e0 <strsubstring@plt>
lea    -0x110(%rbp),%rsi
lea    0xc3c(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0x90(%rbp),%rdi
lea    -0x110(%rbp),%rsi
mov    $0x5,%edx
mov    $0xc8,%ecx
call   10e0 <strsubstring@plt>
lea    -0x110(%rbp),%rsi
lea    0xc0a(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0x90(%rbp),%rsi
lea    0xc87(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0x90(%rbp),%rdi
mov    $0x4,%esi
mov    $0x3,%edx
call   1050 <strdel@plt>
lea    -0x90(%rbp),%rsi
lea    0xc6c(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0x90(%rbp),%rdi
lea    0xc74(%rip),%rsi
lea    0xc6f(%rip),%rdx
call   1090 <strreplace@plt>
lea    -0x90(%rbp),%rsi
lea    0xc5e(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0x90(%rbp),%rdi
lea    0xc6b(%rip),%rsi
lea    0xc68(%rip),%rdx
call   1090 <strreplace@plt>
lea    -0x90(%rbp),%rsi
lea    0xc5a(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0x110(%rbp),%rdi
call   10a0 <strclear@plt>
movl   $0x0,-0x114(%rbp)
mov    -0x114(%rbp),%eax
mov    %eax,-0x14c(%rbp)
lea    -0x90(%rbp),%rdi
call   1060 <strlen@plt>
mov    %eax,%ecx
mov    -0x14c(%rbp),%eax
cmp    %ecx,%eax
jge    1555 <main+0x395>
lea    -0x110(%rbp),%rdi
movslq -0x114(%rbp),%rax
movsbl -0x90(%rbp,%rax,1),%esi
ff
call   10c0 <strconcatchar@plt>
lea    -0x110(%rbp),%rsi
lea    0xc13(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x114(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x114(%rbp)
jmp    14e9 <main+0x329>
xor    %eax,%eax
add    $0x150,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x108,%rsp
lea    0xe2b(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
lea    0xe2c(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %rbx,%rdi
call   1070 <strtolower@plt>
lea    0xe2a(%rip),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %rbx,%rdi
call   1040 <strtoupper@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0x80(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %edx,%edx
mov    $0x4,%ecx
call   10e0 <strsubstring@plt>
lea    0xdf5(%rip),%r15
mov    %r15,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   10b0 <strpos@plt>
lea    0xde7(%rip),%r12
mov    %r12,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
mov    %eax,%ecx
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xe0c(%rip),%rsi
mov    %rbx,%rdi
call   10b0 <strpos@plt>
lea    0xdde(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1080 <printf@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   10b0 <strpos@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    %eax,%ecx
xor    %eax,%eax
call   1080 <printf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   10b0 <strpos@plt>
lea    0xdc8(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xdd4(%rip),%rdi
mov    %rbx,%rsi
mov    $0x5,%edx
call   10d0 <strinsert@plt>
lea    0xdc4(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x64,%edx
mov    $0x4,%ecx
call   10e0 <strsubstring@plt>
mov    %r15,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x5,%edx
mov    $0x2,%ecx
call   10e0 <strsubstring@plt>
mov    %r15,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x5,%edx
mov    $0xc8,%ecx
call   10e0 <strsubstring@plt>
mov    %r15,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xd68(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x3,%edx
call   1050 <strdel@plt>
lea    0xd55(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xd61(%rip),%rsi
lea    0xd5c(%rip),%rdx
mov    %rbx,%rdi
call   1090 <strreplace@plt>
lea    0xd4f(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xd60(%rip),%rsi
lea    0xd5d(%rip),%rdx
mov    %rbx,%rdi
call   1090 <strreplace@plt>
lea    0xd53(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %r14,%rdi
call   10a0 <strclear@plt>
mov    %rbx,%rdi
call   1060 <strlen@plt>
test   %eax,%eax
jle    143c <main+0x27c>
lea    0x80(%rsp),%r12
lea    0xd4d(%rip),%r14
mov    %rsp,%r15
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
movsbl (%rsp,%rbx,1),%esi
mov    %r12,%rdi
call   10c0 <strconcatchar@plt>
mov    %r14,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
add    $0x1,%rbx
mov    %r15,%rdi
call   1060 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1410 <main+0x250>
xor    %eax,%eax
add    $0x108,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Esto ES UNA prueba\00"
@.str.1 = [23 x i8] c"Cadena original: '%s'\0A\00"
@.str.2 = [14 x i8] c"Cadena: '%s'\0A\00"
@.str.3 = [17 x i8] c"Subcadena: '%s'\0A\00"
@.str.4 = [31 x i8] c"Posici\C3\B3n de '%s' en '%s': %d\0A\00"
@.str.5 = [31 x i8] c"Posici\C3\B3n de 'ES' en '%s': %d\0A\00"
@.str.6 = [5 x i8] c" ES \00"
@.str.7 = [31 x i8] c"Posici\C3\B3n de NULL en '%s': %d\0A\00"
@.str.8 = [4 x i8] c"NO \00"
@.str.9 = [27 x i8] c"Insertando NO queda: '%s'\0A\00"
@.str.10 = [16 x i8] c"Buffer es '%s'\0A\00"
@.str.11 = [29 x i8] c"Quitando 3 de 4, queda '%s'\0A\00"
@.str.12 = [2 x i8] c"S\00"
@.str.13 = [2 x i8] c"Z\00"
@.str.14 = [34 x i8] c"Reemplazando S por Z, queda '%s'\0A\00"
@.str.15 = [4 x i8] c"UNA\00"
@.str.16 = [5 x i8] c"OTRA\00"
@.str.17 = [39 x i8] c"Reemplazando UNA por OTRA, queda '%s'\0A\00"
@.str.18 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [128 x i8]
%3 = alloca [128 x i8]
%4 = alloca i32
store i32 0, i32* %1
%5 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%6 = call i32 @strcpy(i8* %5, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%7 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%8 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%9 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%10 = call i32 @strtolower(i8* %9)
%11 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%12 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* %11)
%13 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%14 = call i32 @strtoupper(i8* %13)
%15 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%16 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* %15)
%17 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%18 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%19 = call i32 @strsubstring(i8* %17, i8* %18, i32 0, i32 4)
%20 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%21 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i8* %20)
%22 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%23 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%24 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%25 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%26 = call i32 @strpos(i8* %24, i8* %25)
%27 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0), i8* %22, i8* %23, i32 %26)
%28 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%29 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%30 = call i32 @strpos(i8* %29, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%31 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0), i8* %28, i32 %30)
%32 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%33 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%34 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%35 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%36 = call i32 @strpos(i8* %34, i8* %35)
%37 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0), i8* %32, i8* %33, i32 %36)
%38 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%39 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%40 = call i32 @strpos(i8* %39, i8* null)
%41 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.7, i64 0, i64 0), i8* %38, i32 %40)
%42 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%43 = call i32 @strinsert(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i8* %42, i32 5)
%44 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%45 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.9, i64 0, i64 0), i8* %44)
%46 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%47 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%48 = call i32 @strsubstring(i8* %46, i8* %47, i32 100, i32 4)
%49 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%50 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i8* %49)
%51 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%52 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%53 = call i32 @strsubstring(i8* %51, i8* %52, i32 5, i32 2)
%54 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%55 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i8* %54)
%56 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%57 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%58 = call i32 @strsubstring(i8* %56, i8* %57, i32 5, i32 200)
%59 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%60 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i8* %59)
%61 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%62 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.10, i64 0, i64 0), i8* %61)
%63 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%64 = call i32 @strdel(i8* %63, i32 4, i32 3)
%65 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%66 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.11, i64 0, i64 0), i8* %65)
%67 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%68 = call i32 @strreplace(i8* %67, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
%69 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%70 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.14, i64 0, i64 0), i8* %69)
%71 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%72 = call i32 @strreplace(i8* %71, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.16, i64 0, i64 0))
%73 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%74 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.17, i64 0, i64 0), i8* %73)
%75 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%76 = call i32 @strclear(i8* %75)
store i32 0, i32* %4
br label %77
77: ; preds = %91, %0
%78 = load i32, i32* %4
%79 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%80 = call i32 @strlen(i8* %79)
%81 = icmp slt i32 %78, %80
br i1 %81, label %82, label %94
82: ; preds = %77
%83 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%84 = load i32, i32* %4
%85 = sext i32 %84 to i64
%86 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 %85
%87 = load i8, i8* %86
%88 = call i32 @strconcatchar(i8* %83, i8 signext %87)
%89 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%90 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.18, i64 0, i64 0), i8* %89)
br label %91
91: ; preds = %82
%92 = load i32, i32* %4
%93 = add nsw i32 %92, 1
store i32 %93, i32* %4
br label %77
94: ; preds = %77
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"Esto ES UNA prueba\00"
@.str.1 = [23 x i8] c"Cadena original: '%s'\0A\00"
@.str.2 = [14 x i8] c"Cadena: '%s'\0A\00"
@.str.3 = [17 x i8] c"Subcadena: '%s'\0A\00"
@.str.4 = [31 x i8] c"Posici\C3\B3n de '%s' en '%s': %d\0A\00"
@.str.5 = [31 x i8] c"Posici\C3\B3n de 'ES' en '%s': %d\0A\00"
@.str.6 = [5 x i8] c" ES \00"
@.str.7 = [31 x i8] c"Posici\C3\B3n de NULL en '%s': %d\0A\00"
@.str.8 = [4 x i8] c"NO \00"
@.str.9 = [27 x i8] c"Insertando NO queda: '%s'\0A\00"
@.str.10 = [16 x i8] c"Buffer es '%s'\0A\00"
@.str.11 = [29 x i8] c"Quitando 3 de 4, queda '%s'\0A\00"
@.str.12 = [2 x i8] c"S\00"
@.str.13 = [2 x i8] c"Z\00"
@.str.14 = [34 x i8] c"Reemplazando S por Z, queda '%s'\0A\00"
@.str.15 = [4 x i8] c"UNA\00"
@.str.16 = [5 x i8] c"OTRA\00"
@.str.17 = [39 x i8] c"Reemplazando UNA por OTRA, queda '%s'\0A\00"
@.str.18 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [128 x i8]
%2 = alloca [128 x i8]
%3 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%5 = call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%7 = call i32 @strtolower(i8* %3)
%8 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* %3)
%9 = call i32 @strtoupper(i8* %3)
%10 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* %3)
%11 = call i32 @strsubstring(i8* %3, i8* %4, i32 0, i32 4)
%12 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i8* %4)
%13 = call i32 @strpos(i8* %3, i8* %4)
%14 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0), i8* %4, i8* %3, i32 %13)
%15 = call i32 @strpos(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%16 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0), i8* %3, i32 %15)
%17 = call i32 @strpos(i8* %4, i8* %3)
%18 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0), i8* %3, i8* %4, i32 %17)
%19 = call i32 @strpos(i8* %3, i8* null)
%20 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.7, i64 0, i64 0), i8* %3, i32 %19)
%21 = call i32 @strinsert(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i8* %3, i32 5)
%22 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.9, i64 0, i64 0), i8* %3)
%23 = call i32 @strsubstring(i8* %3, i8* %4, i32 100, i32 4)
%24 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i8* %4)
%25 = call i32 @strsubstring(i8* %3, i8* %4, i32 5, i32 2)
%26 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i8* %4)
%27 = call i32 @strsubstring(i8* %3, i8* %4, i32 5, i32 200)
%28 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i8* %4)
%29 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.10, i64 0, i64 0), i8* %3)
%30 = call i32 @strdel(i8* %3, i32 4, i32 3)
%31 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.11, i64 0, i64 0), i8* %3)
%32 = call i32 @strreplace(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
%33 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.14, i64 0, i64 0), i8* %3)
%34 = call i32 @strreplace(i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.16, i64 0, i64 0))
%35 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.17, i64 0, i64 0), i8* %3)
%36 = call i32 @strclear(i8* %4)
%37 = call i32 @strlen(i8* %3)
%38 = icmp sgt i32 %37, 0
br i1 %38, label %39, label %49
39: ; preds = %0, %39
%40 = phi i64 [ %45, %39 ], [ 0, %0 ]
%41 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 %40
%42 = load i8, i8* %41
%43 = call i32 @strconcatchar(i8* %4, i8 signext %42)
%44 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.18, i64 0, i64 0), i8* %4)
%45 = add nuw nsw i64 %40, 1
%46 = call i32 @strlen(i8* %3)
%47 = sext i32 %46 to i64
%48 = icmp slt i64 %45, %47
br i1 %48, label %39, label %49
49: ; preds = %39, %0
ret i32 0
}