#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*/ cambia_letras(char *, char, char);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ test1();
int /*<<< orphan*/ test2();
int /*<<< orphan*/ test3();
void main(void) {
  test1();
  test2();
  test3();
  printf("Prueba cambia_letras\n");
  char cadena[15] = "Hola buenas";
  char letraorig = 'a';
  char letracamb = 'i';
  printf("%s\n", cadena);
  cambia_letras(cadena, letraorig, letracamb);
  printf("%s\n", cadena);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1040 <test1@plt>
mov    $0x0,%al
call   1060 <test2@plt>
mov    $0x0,%al
call   1030 <test3@plt>
lea    0xe8c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    0xe98(%rip),%rax
mov    %rax,-0xf(%rbp)
mov    0xe96(%rip),%eax
mov    %eax,-0x7(%rbp)
mov    0xe90(%rip),%ax
mov    %ax,-0x3(%rbp)
mov    0xe88(%rip),%al
mov    %al,-0x1(%rbp)
movb   $0x61,-0x10(%rbp)
movb   $0x69,-0x11(%rbp)
lea    -0xf(%rbp),%rsi
lea    0xe60(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0xf(%rbp),%rdi
mov    -0x10(%rbp),%al
movsbl %al,%esi
movsbl -0x11(%rbp),%edx
call   1070 <cambia_letras@plt>
lea    -0xf(%rbp),%rsi
lea    0xe3b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
xor    %eax,%eax
call   1050 <test1@plt>
xor    %eax,%eax
call   1060 <test2@plt>
xor    %eax,%eax
call   1040 <test3@plt>
lea    0xe9e(%rip),%rdi
call   1030 <puts@plt>
movabs $0x65756220616c6f48,%rax
62 75 65
mov    %rax,(%rsp)
movq   $0x73616e65,0x7(%rsp)
61 73
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    $0x61,%esi
mov    $0x69,%edx
call   1070 <cambia_letras@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Prueba cambia_letras\0A\00"
@__const.main.cadena = [15 x i8] c"Hola buenas\00\00\00\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @main() {
%1 = alloca [15 x i8]
%2 = alloca i8
%3 = alloca i8
%4 = call i32 (...) @test1()
%5 = call i32 (...) @test2()
%6 = call i32 (...) @test3()
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%8 = bitcast [15 x i8]* %1 to i8*
store i8 97, i8* %2
store i8 105, i8* %3
%9 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
%12 = load i8, i8* %2
%13 = load i8, i8* %3
%14 = call i32 @cambia_letras(i8* %11, i8 signext %12, i8 signext %13)
%15 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %15)
ret void
}

LLVM IR (-O2):
@__const.main.cadena = [15 x i8] c"Hola buenas\00\00\00\00"
@str = [21 x i8] c"Prueba cambia_letras\00"
define void @main() {
%1 = alloca [15 x i8]
%2 = tail call i32 (...) @test1()
%3 = tail call i32 (...) @test2()
%4 = tail call i32 (...) @test3()
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%6 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
%7 = call i32 @puts(i8* %6)
%8 = call i32 @cambia_letras(i8* %6, i8 signext 97, i8 signext 105)
%9 = call i32 @puts(i8* %6)
ret void
}