// File: /workspace/github_c_makefile_star2_O2/aparrish[P]rwet-examples-c/ut_randlines.c
// Function: main
int main(int argc, char* argv[]) {

	/* create ut array, use built-in str array helper type */
	UT_array* lines;
	utarray_new(lines, &ut_str_icd);

	srand(time(NULL));

	/* read in lines */
	while (!feof(stdin)) {
		int len = 0;
		char* line = NULL;

		/* ap_getline populates line with pointer to malloced char* */
		len = ap_getline(&line, stdin);
		utarray_push_back(lines, &line);

		/* push_back copies the string, so we can free ours here */
		free(line); 
	}

	/* shuffle the lines */
	utarray_sort(lines, shuffle);

	/* iterate through the lines */
	char** current = NULL;
	while ((current = (char**)utarray_next(lines, current))) {
		printf("%s", *current);
	}

	utarray_free(lines);
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
pushq $0x1
popq %rdi
pushq $0x30
popq %rsi
callq 0x1070
leaq 0x8(%rax), %rcx
movq %rcx, 0x20(%rsp)
movups 0x2b8b(%rip), %xmm0     # 0x3dd0
movups %xmm0, 0x8(%rax)
movups 0x2b90(%rip), %xmm0     # 0x3de0
movq %rax, (%rsp)
movups %xmm0, 0x18(%rax)
movq $0x0, 0x8(%rsp)
xorl %edi, %edi
callq 0x10a0
movl %eax, %edi
callq 0x1060
pushq $0x8
popq %r15
leaq 0x1a9(%rip), %rax       # 0x1423
movq %rax, 0x18(%rsp)
movq 0x2d5a(%rip), %r14      # 0x3fe0
pushq $0x8
popq %rbp
xorl %ebx, %ebx
xorl %r13d, %r13d
movq (%r14), %rdi
callq 0x1080
movl %r13d, %r12d
testl %eax, %eax
jne 0x1364
andq $0x0, 0x10(%rsp)
movq (%r14), %rsi
leaq 0x10(%rsp), %rdi
callq 0x1448
incl %r13d
cmpl %ebx, %r13d
jbe 0x12d2
movq 0x8(%rsp), %rdi
cmpl %ebx, %r13d
jbe 0x12de
testl %ebx, %ebx
leal (%rbx,%rbx), %eax
cmovel %ebp, %eax
movl %eax, %ebx
jmp 0x12c1
movq 0x8(%rsp), %r14
movq 0x18(%rsp), %rcx
jmp 0x130a
movq (%rsp), %rcx
movl %ebx, 0x4(%rcx)
movl %ebx, %eax
imulq %rax, %r15
movq %r15, %rsi
movq %rcx, %r15
callq 0x10c0
movq %rax, 0x28(%r15)
testq %rax, %rax
je 0x141b
movq %rax, %r14
movq 0x18(%r15), %rcx
movq 0x20(%rsp), %rax
movq (%rax), %r15
imulq %r15, %r12
testq %rcx, %rcx
movq %rcx, 0x18(%rsp)
je 0x132f
addq %r14, %r12
movq %r12, %rdi
leaq 0x10(%rsp), %rsi
callq *%rcx
jmp 0x1342
addq %r14, %r12
movq %r12, %rdi
leaq 0x10(%rsp), %rsi
movq %r15, %rdx
callq 0x1090
movq %r14, 0x8(%rsp)
movq (%rsp), %rax
movl %r13d, (%rax)
movq 0x10(%rsp), %rdi
callq 0x1030
movq 0x2c81(%rip), %r14      # 0x3fe0
jmp 0x128e
leaq -0x15f(%rip), %rcx      # 0x120c
movq 0x8(%rsp), %r14
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x1040
leaq 0xc7f(%rip), %rbx       # 0x2004
xorl %ebp, %ebp
testq %rbp, %rbp
je 0x139a
subq %r14, %rbp
jae 0x13a4
testl %r13d, %r13d
je 0x13d3
xorl %ebp, %ebp
jmp 0x13b7
movq %r14, %rbp
testl %r13d, %r13d
jne 0x13be
jmp 0x13d3
movq %rbp, %rax
xorl %edx, %edx
divq %r15
movq %rax, %rbp
incq %rbp
cmpq %r12, %rbp
jae 0x13d3
imulq %r15, %rbp
addq %r14, %rbp
testq %rbp, %rbp
je 0x13d3
movq (%rbp), %rsi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1050
jmp 0x1387
movq (%rsp), %rdi
cmpl $0x0, 0x4(%rdi)
je 0x1405
movq 0x20(%rdi), %rbx
testq %rbx, %rbx
je 0x13f9
movq %r14, %r13
subq $0x1, %r12
jb 0x13f9
movq %r13, %rdi
callq *%rbx
addq %r15, %r13
jmp 0x13e9
movq %r14, %rdi
callq 0x1030
movq (%rsp), %rdi
callq 0x1030
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $-0x1
popq %rdi
callq 0x10d0