#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 comprimeCar(char, int *, char *, int);
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  char s[] = "Aaa, bb aaa a c c a a a";
  int vec[10];
  int maxDim = 10;
  int dim = comprimeCar('a', vec, s, maxDim);
  printf("%s.\n", s);
  printf("%d caracteres borrados.\n", dim);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
movl   $0xa,-0x54(%rbp)
lea    -0x50(%rbp),%rsi
lea    -0x20(%rbp),%rdx
mov    -0x54(%rbp),%ecx
mov    $0x61,%edi
call   1040 <comprimeCar@plt>
mov    %eax,-0x58(%rbp)
lea    -0x20(%rbp),%rsi
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x58(%rbp),%esi
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x48,%rsp
movaps 0xed3(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0x61206120612063,%rax
mov    %rax,0x10(%rsp)
lea    0x20(%rsp),%rsi
mov    %rsp,%rbx
mov    $0x61,%edi
mov    %rbx,%rdx
mov    $0xa,%ecx
call   1040 <comprimeCar@plt>
mov    %eax,%ebp
lea    0xeb5(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xea9(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.s = [24 x i8] c"Aaa, bb aaa a c c a a a\00"
@.str = [5 x i8] c"%s.\0A\00"
@.str.1 = [25 x i8] c"%d caracteres borrados.\0A\00"
define i32 @main() {
%1 = alloca [24 x i8]
%2 = alloca [10 x i32]
%3 = alloca i32
%4 = alloca i32
%5 = bitcast [24 x i8]* %1 to i8*
store i32 10, i32* %3
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%7 = getelementptr inbounds [24 x i8], [24 x i8]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call i32 @comprimeCar(i8 signext 97, i32* %6, i8* %7, i32 %8)
store i32 %9, i32* %4
%10 = getelementptr inbounds [24 x i8], [24 x i8]* %1, i64 0, i64 0
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = load i32, i32* %4
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %12)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s = [24 x i8] c"Aaa, bb aaa a c c a a a\00"
@.str = [5 x i8] c"%s.\0A\00"
@.str.1 = [25 x i8] c"%d caracteres borrados.\0A\00"
define i32 @main() {
%1 = alloca [24 x i8]
%2 = alloca [10 x i32]
%3 = getelementptr inbounds [24 x i8], [24 x i8]* %1, i64 0, i64 0
%4 = bitcast [10 x i32]* %2 to i8*
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%6 = call i32 @comprimeCar(i8 signext 97, i32* %5, i8* %3, i32 10)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %3)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}