// File: /workspace/github_c_makefile_star2_O0/lucvoo[P]sparse-dev/compile-i386.c
// Function: sort_array
static void sort_array(struct expression *expr)
{
	struct expression *entry, **list;
	unsigned int elem, sorted, i;

	elem = expression_list_size(expr->expr_list);
	if (!elem)
		return;

	list = malloc(sizeof(entry) * elem);
	if (!list)
		die("OOM in sort_array");

	/* this code is no doubt evil and ignores EXPR_INDEX possibly
	 * to its detriment and other nasty things.  improvements
	 * welcome.
	 */
	i = 0;
	sorted = 0;
	FOR_EACH_PTR(expr->expr_list, entry) {
		if ((entry->type == EXPR_POS) || (entry->type == EXPR_VALUE)) {
			/* add entry to list[], in sorted order */
			if (sorted == 0) {
				list[0] = entry;
				sorted = 1;
			} else {
				for (i = 0; i < sorted; i++)
					if (sort_array_cmp(entry, list[i]) <= 0)
						break;

				/* If inserting into the middle of list[]
				 * instead of appending, we memmove.
				 * This is ugly, but thankfully
				 * uncommon.  Input data with tons of
				 * entries very rarely have explicit
				 * offsets.  convert to qsort eventually...
				 */
				if (i != sorted)
					memmove(&list[i + 1], &list[i],
						(sorted - i) * sizeof(entry));
				list[i] = entry;
				sorted++;
			}
		}
	} END_FOR_EACH_PTR(entry);

	i = 0;
	FOR_EACH_PTR(expr->expr_list, entry) {
		if ((entry->type == EXPR_POS) || (entry->type == EXPR_VALUE))
			*THIS_ADDRESS(entry) = list[i++];
	} END_FOR_EACH_PTR(entry);

	free(list);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x628b0
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jne 0x62507
jmp 0x6279d
movl -0x1c(%rbp), %eax
movl %eax, %edi
shlq $0x3, %rdi
callq 0x11230
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x6252e
leaq 0x1029d(%rip), %rdi     # 0x727c4
movb $0x0, %al
callq 0x17200
movl $0x0, -0x24(%rbp)
movl $0x0, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x62564
jmp 0x626ae
jmp 0x62566
movl $0x0, -0x44(%rbp)
movl -0x44(%rbp), %eax
movq -0x38(%rbp), %rcx
movw (%rcx), %cx
shlw $0x8, %cx
sarw $0x8, %cx
movswl %cx, %ecx
cmpl %ecx, %eax
jge 0x62696
movq -0x38(%rbp), %rax
movslq -0x44(%rbp), %rcx
movq 0x18(%rax,%rcx,8), %rax
movq %rax, -0x10(%rbp)
movq -0x38(%rbp), %rax
movw (%rax), %ax
sarw $0x8, %ax
cwtl
cmpl $0x0, %eax
je 0x625b8
cmpq $0x0, -0x10(%rbp)
jne 0x625b8
jmp 0x62688
movq -0x10(%rbp), %rax
movl (%rax), %eax
andl $0xff, %eax
cmpl $0x1b, %eax
je 0x625dc
movq -0x10(%rbp), %rax
movl (%rax), %eax
andl $0xff, %eax
cmpl $0x1, %eax
jne 0x62686
cmpl $0x0, -0x20(%rbp)
jne 0x625f9
movq -0x10(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movl $0x1, -0x20(%rbp)
jmp 0x62684
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x20(%rbp), %eax
jae 0x62630
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movl -0x24(%rbp), %ecx
movq (%rax,%rcx,8), %rsi
callq 0x628d0
cmpl $0x0, %eax
jg 0x62623
jmp 0x62630
jmp 0x62625
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x62600
movl -0x24(%rbp), %eax
cmpl -0x20(%rbp), %eax
je 0x6266c
movq -0x18(%rbp), %rdi
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, %eax
shlq $0x3, %rax
addq %rax, %rdi
movq -0x18(%rbp), %rsi
movl -0x24(%rbp), %eax
shlq $0x3, %rax
addq %rax, %rsi
movl -0x20(%rbp), %eax
subl -0x24(%rbp), %eax
movl %eax, %eax
movl %eax, %edx
shlq $0x3, %rdx
callq 0x11290
movq -0x10(%rbp), %rdx
movq -0x18(%rbp), %rax
movl -0x24(%rbp), %ecx
movq %rdx, (%rax,%rcx,8)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x62686
jmp 0x62688
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x6256d
jmp 0x62698
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x38(%rbp)
cmpq -0x30(%rbp), %rax
jne 0x62566
movl $0x0, -0x24(%rbp)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x60(%rbp)
cmpq $0x0, -0x50(%rbp)
jne 0x626dd
jmp 0x62794
jmp 0x626df
movl $0x0, -0x64(%rbp)
movl -0x64(%rbp), %eax
movq -0x58(%rbp), %rcx
movw (%rcx), %cx
shlw $0x8, %cx
sarw $0x8, %cx
movswl %cx, %ecx
cmpl %ecx, %eax
jge 0x6277c
movq -0x58(%rbp), %rax
movslq -0x64(%rbp), %rcx
movq 0x18(%rax,%rcx,8), %rax
movq %rax, -0x10(%rbp)
movq -0x58(%rbp), %rax
movw (%rax), %ax
sarw $0x8, %ax
cwtl
cmpl $0x0, %eax
je 0x6272a
cmpq $0x0, -0x10(%rbp)
jne 0x6272a
jmp 0x6276e
movq -0x10(%rbp), %rax
movl (%rax), %eax
andl $0xff, %eax
cmpl $0x1b, %eax
je 0x6274a
movq -0x10(%rbp), %rax
movl (%rax), %eax
andl $0xff, %eax
cmpl $0x1, %eax
jne 0x6276c
movq -0x18(%rbp), %rax
movl -0x24(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x24(%rbp)
movl %ecx, %ecx
movq (%rax,%rcx,8), %rdx
movq -0x58(%rbp), %rax
movslq -0x64(%rbp), %rcx
movq %rdx, 0x18(%rax,%rcx,8)
jmp 0x6276e
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0x626e6
jmp 0x6277e
movq -0x58(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x58(%rbp)
cmpq -0x50(%rbp), %rax
jne 0x626df
movq -0x18(%rbp), %rdi
callq 0x11030
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)