#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 LeerCadena(char **, char **, int);
int /*<<< orphan*/ Ordenar(char **, int);
int /*<<< orphan*/ Visualizar(char **, int);
int /*<<< orphan*/ printf(char *, ...);
main() {
  char cad[25][81];
  char *pcad[25];
  int ncads = 0;
  printf("Ordenación de cadenas de caracteres.\n");
  printf("Introduzca las cadenas a ordenar.\n");
  printf("Pulse <Entrar> para salir.\n");
  if ((ncads = LeerCadena(cad, pcad, 25)) > 0) {
    printf("Cadenas leídas %d\n\n", ncads);
    printf("Proceso de ordenación.\n\n");
    Ordenar(pcad, ncads);
    Visualizar(pcad, ncads);
  } else
    printf("Matriz vacía\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x8d0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8c4(%rbp)
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x7f0(%rbp),%rdi
lea    -0x8c0(%rbp),%rsi
mov    $0x19,%edx
call   1060 <LeerCadena@plt>
mov    %eax,-0x8c4(%rbp)
cmp    $0x0,%eax
jle    11f8 <main+0xb8>
mov    -0x8c4(%rbp),%esi
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x8c0(%rbp),%rdi
mov    -0x8c4(%rbp),%esi
call   1030 <Ordenar@plt>
lea    -0x8c0(%rbp),%rdi
mov    -0x8c4(%rbp),%esi
call   1050 <Visualizar@plt>
jmp    1206 <main+0xc6>
lea    0xe96(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x8d0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x8c8,%rsp
lea    0xeb4(%rip),%rdi
call   1030 <puts@plt>
lea    0xece(%rip),%rdi
call   1030 <puts@plt>
lea    0xee4(%rip),%rdi
call   1030 <puts@plt>
lea    0xd0(%rsp),%rdi
mov    %rsp,%rsi
mov    $0x19,%edx
call   1070 <LeerCadena@plt>
test   %eax,%eax
jle    11ce <main+0x7e>
mov    %eax,%ebx
lea    0xe60(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xed6(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%r14
mov    %r14,%rdi
mov    %ebx,%esi
call   1040 <Ordenar@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1060 <Visualizar@plt>
jmp    11da <main+0x8a>
lea    0xea3(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x8c8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [39 x i8] c"Ordenaci\C3\B3n de cadenas de caracteres.\0A\00"
@.str.1 = [35 x i8] c"Introduzca las cadenas a ordenar.\0A\00"
@.str.2 = [28 x i8] c"Pulse <Entrar> para salir.\0A\00"
@.str.3 = [21 x i8] c"Cadenas le\C3\ADdas %d\0A\0A\00"
@.str.4 = [26 x i8] c"Proceso de ordenaci\C3\B3n.\0A\0A\00"
@.str.5 = [15 x i8] c"Matriz vac\C3\ADa\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [25 x [81 x i8]]
%3 = alloca [25 x i8*]
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %4
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
%8 = getelementptr inbounds [25 x [81 x i8]], [25 x [81 x i8]]* %2, i64 0, i64 0
%9 = bitcast [81 x i8]* %8 to i8**
%10 = getelementptr inbounds [25 x i8*], [25 x i8*]* %3, i64 0, i64 0
%11 = call i32 @LeerCadena(i8** %9, i8** %10, i32 25)
store i32 %11, i32* %4
%12 = icmp sgt i32 %11, 0
br i1 %12, label %13, label %23
13: ; preds = %0
%14 = load i32, i32* %4
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i32 %14)
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0))
%17 = getelementptr inbounds [25 x i8*], [25 x i8*]* %3, i64 0, i64 0
%18 = load i32, i32* %4
%19 = call i32 @Ordenar(i8** %17, i32 %18)
%20 = getelementptr inbounds [25 x i8*], [25 x i8*]* %3, i64 0, i64 0
%21 = load i32, i32* %4
%22 = call i32 @Visualizar(i8** %20, i32 %21)
br label %25
23: ; preds = %0
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0))
br label %25
25: ; preds = %23, %13
%26 = load i32, i32* %1
ret i32 %26
}

LLVM IR (-O2):
@.str.3 = [21 x i8] c"Cadenas le\C3\ADdas %d\0A\0A\00"
@str = [38 x i8] c"Ordenaci\C3\B3n de cadenas de caracteres.\00"
@str.6 = [34 x i8] c"Introduzca las cadenas a ordenar.\00"
@str.7 = [27 x i8] c"Pulse <Entrar> para salir.\00"
@str.8 = [14 x i8] c"Matriz vac\C3\ADa\00"
@str.9 = [25 x i8] c"Proceso de ordenaci\C3\B3n.\0A\00"
define i32 @main() {
%1 = alloca [25 x [81 x i8]]
%2 = alloca [25 x i8*]
%3 = getelementptr inbounds [25 x [81 x i8]], [25 x [81 x i8]]* %1, i64 0, i64 0, i64 0
%4 = bitcast [25 x i8*]* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.6, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.7, i64 0, i64 0))
%8 = bitcast [25 x [81 x i8]]* %1 to i8**
%9 = getelementptr inbounds [25 x i8*], [25 x i8*]* %2, i64 0, i64 0
%10 = call i32 @LeerCadena(i8** %8, i8** %9, i32 25)
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %0
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i32 %10)
%14 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.9, i64 0, i64 0))
%15 = call i32 @Ordenar(i8** %9, i32 %10)
%16 = call i32 @Visualizar(i8** %9, i32 %10)
br label %19
17: ; preds = %0
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.8, i64 0, i64 0))
br label %19
19: ; preds = %17, %12
ret i32 0
}