#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*/ fflush(int /*<<< orphan*/);
char getchar();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdin;
void cargarelvector(char v[], int Tope) {
  int i;
  if (Tope > 0) {
    for (i = 0; i < Tope; i++) {
      v[i] = 0;
    }
    for (i = 0; i < Tope; i++) {
      printf("Ingrese letras sin ordenar\n");
      fflush(stdin);
      v[i] = getchar();
    }
    for (i = 0; i < Tope; i++) {
      printf("Contenido del Vector: %c\n", v[i]);
    }
  }
}


x86 assembly (clang, -O0):
<cargarelvector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1207 <cargarelvector+0xd7>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1176 <cargarelvector+0x46>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1150 <cargarelvector+0x20>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11c7 <cargarelvector+0x97>
lea    0xe70(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e4a(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    117d <cargarelvector+0x4d>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1202 <cargarelvector+0xd2>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xe2f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11ce <cargarelvector+0x9e>
jmp    1207 <cargarelvector+0xd7>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cargarelvector>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
test   %esi,%esi
jle    11c8 <cargarelvector+0x78>
mov    %rdi,%r14
mov    %esi,%r13d
xor    %esi,%esi
mov    %r13,%rdx
call   1050 <memset@plt>
lea    0xea6(%rip),%r15
mov    0x2e6d(%rip),%r12
xor    %ebx,%ebx
nopl   (%rax)
mov    %r15,%rdi
call   1030 <puts@plt>
mov    (%r12),%edi
call   1070 <fflush@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r13
jne    1180 <cargarelvector+0x30>
lea    0xe54(%rip),%r15
xor    %ebx,%ebx
xchg   %ax,%ax
movsbl (%r14,%rbx,1),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r13
jne    11b0 <cargarelvector+0x60>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Ingrese letras sin ordenar\0A\00"
@stdin = global i32 0
@.str.1 = [26 x i8] c"Contenido del Vector: %c\0A\00"
define void @cargarelvector(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %55
8: ; preds = %2
store i32 0, i32* %5
br label %9
9: ; preds = %18, %8
%10 = load i32, i32* %5
%11 = load i32, i32* %4
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %21
13: ; preds = %9
%14 = load i8*, i8** %3
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
store i8 0, i8* %17
br label %18
18: ; preds = %13
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
br label %9
21: ; preds = %9
store i32 0, i32* %5
br label %22
22: ; preds = %35, %21
%23 = load i32, i32* %5
%24 = load i32, i32* %4
%25 = icmp slt i32 %23, %24
br i1 %25, label %26, label %38
26: ; preds = %22
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%28 = load i32, i32* @stdin
%29 = call i32 @fflush(i32 %28)
%30 = call signext i8 (...) @getchar()
%31 = load i8*, i8** %3
%32 = load i32, i32* %5
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds i8, i8* %31, i64 %33
store i8 %30, i8* %34
br label %35
35: ; preds = %26
%36 = load i32, i32* %5
%37 = add nsw i32 %36, 1
store i32 %37, i32* %5
br label %22
38: ; preds = %22
store i32 0, i32* %5
br label %39
39: ; preds = %51, %38
%40 = load i32, i32* %5
%41 = load i32, i32* %4
%42 = icmp slt i32 %40, %41
br i1 %42, label %43, label %54
43: ; preds = %39
%44 = load i8*, i8** %3
%45 = load i32, i32* %5
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds i8, i8* %44, i64 %46
%48 = load i8, i8* %47
%49 = sext i8 %48 to i32
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 %49)
br label %51
51: ; preds = %43
%52 = load i32, i32* %5
%53 = add nsw i32 %52, 1
store i32 %53, i32* %5
br label %39
54: ; preds = %39
br label %55
55: ; preds = %54, %2
ret void
}

LLVM IR (-O2):
@stdin = global i32 0
@.str.1 = [26 x i8] c"Contenido del Vector: %c\0A\00"
@str = [27 x i8] c"Ingrese letras sin ordenar\00"
define void @cargarelvector(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %23
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %13, %6 ]
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%9 = load i32, i32* @stdin
%10 = tail call i32 @fflush(i32 %9)
%11 = tail call signext i8 (...) @getchar()
%12 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 %11, i8* %12
%13 = add nuw nsw i64 %7, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %15, label %6
15: ; preds = %6, %15
%16 = phi i64 [ %21, %15 ], [ 0, %6 ]
%17 = getelementptr inbounds i8, i8* %0, i64 %16
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 %19)
%21 = add nuw nsw i64 %16, 1
%22 = icmp eq i64 %21, %5
br i1 %22, label %23, label %15
23: ; preds = %15, %2
ret void
}