#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 */
struct _persona {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ imprimir(struct _persona *);
int /*<<< orphan*/ llenarListaPersonas(struct _persona **);
int /*<<< orphan*/ ordenarListaPersonasPorMatricula(struct _persona **);
int /*<<< orphan*/ printf(char *);
int main() {
  struct _persona *lista = NULL;
  llenarListaPersonas(&lista);
  printf("Sin ordenar:\n");
  imprimir(lista);
  ordenarListaPersonasPorMatricula(&lista);
  printf("Ordenada por matricula:\n");
  imprimir(lista);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
call   1050 <llenarListaPersonas@plt>
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <imprimir@plt>
lea    -0x10(%rbp),%rdi
call   1060 <ordenarListaPersonasPorMatricula@plt>
lea    0xe89(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <imprimir@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movq   $0x0,0x8(%rsp)
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <llenarListaPersonas@plt>
lea    0xe9e(%rip),%rdi
call   1030 <puts@plt>
mov    0x8(%rsp),%rdi
call   1040 <imprimir@plt>
mov    %rbx,%rdi
call   1060 <ordenarListaPersonasPorMatricula@plt>
lea    0xe8d(%rip),%rdi
call   1030 <puts@plt>
mov    0x8(%rsp),%rdi
call   1040 <imprimir@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct._persona = type { i32 }
@.str = [14 x i8] c"Sin ordenar:\0A\00"
@.str.1 = [25 x i8] c"Ordenada por matricula:\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct._persona*
store i32 0, i32* %1
store %struct._persona* null, %struct._persona** %2
%3 = call i32 @llenarListaPersonas(%struct._persona** %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%5 = load %struct._persona*, %struct._persona** %2
%6 = call i32 @imprimir(%struct._persona* %5)
%7 = call i32 @ordenarListaPersonasPorMatricula(%struct._persona** %2)
%8 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%9 = load %struct._persona*, %struct._persona** %2
%10 = call i32 @imprimir(%struct._persona* %9)
ret i32 0
}

LLVM IR (-O2):
%struct._persona = type { i32 }
@str = [13 x i8] c"Sin ordenar:\00"
@str.2 = [24 x i8] c"Ordenada por matricula:\00"
define i32 @main() {
%1 = alloca %struct._persona*
%2 = bitcast %struct._persona** %1 to i8*
store %struct._persona* null, %struct._persona** %1
%3 = call i32 @llenarListaPersonas(%struct._persona** %1)
%4 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%5 = load %struct._persona*, %struct._persona** %1
%6 = call i32 @imprimir(%struct._persona* %5)
%7 = call i32 @ordenarListaPersonasPorMatricula(%struct._persona** %1)
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.2, i64 0, i64 0))
%9 = load %struct._persona*, %struct._persona** %1
%10 = call i32 @imprimir(%struct._persona* %9)
ret i32 0
}