#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 cuentaCaracteres(char **, int *, int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int total = 0;
  int tam = argc;
  int numcaracteres[tam];
  total = cuentaCaracteres(argv + 1, numcaracteres, tam);
  printf("El número total de letras en la línea de comandos es: %d.\n", total);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x20(%rbp)
lea    0xf(,%rax,4),%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rsi
sub    %rcx,%rsi
mov    %rsi,%rsp
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x8,%rdi
mov    -0x18(%rbp),%edx
call   1040 <cuentaCaracteres@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe7d(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,%edx
mov    %edi,%ecx
mov    %rsp,%rax
lea    0xf(,%rcx,4),%rcx
and    $0xfffffffffffffff0,%rcx
sub    %rcx,%rax
mov    %rax,%rsp
lea    0x8(%rsi),%rdi
mov    %rax,%rsi
call   1040 <cuentaCaracteres@plt>
lea    0xeb0(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
mov    %rbp,%rsp
pop    %rbp
ret

LLVM IR (-O0):
@.str = [61 x i8] c"El n\C3\BAmero total de letras en la l\C3\ADnea de comandos es: %d.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%10 = load i32, i32* %4
store i32 %10, i32* %7
%11 = load i32, i32* %7
%12 = zext i32 %11 to i64
%13 = call i8* @llvm.stacksave()
store i8* %13, i8** %8
%14 = alloca i32, i64 %12
store i64 %12, i64* %9
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i32, i32* %7
%18 = call i32 @cuentaCaracteres(i8** %16, i32* %14, i32 %17)
store i32 %18, i32* %6
%19 = load i32, i32* %6
%20 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0), i32 %19)
store i32 0, i32* %3
%21 = load i8*, i8** %8
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
@.str = [61 x i8] c"El n\C3\BAmero total de letras en la l\C3\ADnea de comandos es: %d.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = zext i32 %0 to i64
%4 = alloca i32, i64 %3
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = call i32 @cuentaCaracteres(i8** %5, i32* %4, i32 %0)
%7 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}