// File: /workspace/github_c_makefile_star2_O2/mkubecek[P]nperf/server/control.c
// Function: ctrl_main
int ctrl_main(int ctrl_sd)
{
	int ret;
	int sd;

	config.ctrl_sd = ctrl_sd;
	ret = ctrl_get_config(&config);
	if (ret < 0)
		goto out_close;
	ret = prepare_buffers(&config);
	if (ret < 0)
		goto out_close;
	sd = setup_listener(&config);
	if (sd < 0) {
		ret = sd;
		goto out_buffers;
	}
	ret = ctrl_send_start(&config);
	if (ret < 0) {
		close(sd);
		goto out_close;
	}
	ret = ctrl_run_test(sd, &config);
	close(sd);
	if (ret < 0)
		goto out_close;
	ret = ctrl_send_end(&config);

out_buffers:
	cleanup_buffers(&config);
out_close:
	close(ctrl_sd);
	return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movl %edi, %r12d
movl %edi, 0x3b9d(%rip)      # 0x5190
pushq $0x1e
popq %rdi
callq 0x1170
pushq $-0xe
popq %r14
testq %rax, %rax
js 0x1b60
movq %rax, %r15
movl 0x3b7f(%rip), %edi      # 0x5190
leaq 0x3b7c(%rip), %rsi      # 0x5194
pushq $0x1c
popq %rdx
callq 0x212f
testl %eax, %eax
js 0x1709
movl 0x3b72(%rip), %eax      # 0x51a0
bswapl %eax
movl %eax, 0x3b1a(%rip)      # 0x5150
movl 0x3b68(%rip), %esi      # 0x51a4
bswapl %esi
movl %esi, 0x3b14(%rip)      # 0x5158
movl 0x3b5e(%rip), %eax      # 0x51a8
bswapl %eax
movl %eax, 0x3b0e(%rip)      # 0x5160
leaq (%r15,%rax), %rcx
decq %rcx
movq %rcx, %rax
cqto
idivq %r15
subq %rdx, %rcx
movq %rcx, 0x3b0d(%rip)      # 0x5178
imulq %rsi, %rcx
shlq $0x7, %rsi
addq %r15, %rsi
decq %rsi
movq %rsi, %rax
xorl %edx, %edx
divq %r15
subq %rdx, %rsi
addq %rcx, %rsi
movq %rsi, 0x3af2(%rip)      # 0x5180
pushq $0x3
popq %rdx
pushq $0x22
popq %rcx
pushq $-0x1
popq %r8
xorl %edi, %edi
xorl %r9d, %r9d
callq 0x1080
movq %rax, 0x3ac7(%rip)      # 0x5170
cmpq $-0x1, %rax
je 0x171d
movl 0x3aa3(%rip), %ebx      # 0x5158
movq 0x3abc(%rip), %rcx      # 0x5178
movq %rcx, %rdi
imulq %rbx, %rdi
leaq (%rax,%rdi), %rdx
movq %rdx, 0x3aba(%rip)      # 0x5188
cmpl $0x1, 0x3a7b(%rip)      # 0x5150
movl 0x3a85(%rip), %edx      # 0x5160
sete %sil
addq %rax, %rdi
addq $0x20, %rdi
xorl %r8d, %r8d
cmpq %r8, %rbx
je 0x1751
movl %r8d, -0x20(%rdi)
movq %rax, -0x10(%rdi)
movq %rdx, (%rdi)
movb %sil, -0x8(%rdi)
incq %r8
addq %rcx, %rax
subq $-0x80, %rdi
jmp 0x16e9
movl 0x3a81(%rip), %edi      # 0x5190
callq 0x10e0
pushq $-0x16
popq %r14
jmp 0x1b60
callq 0x1040
movl (%rax), %ebx
movq 0x38cd(%rip), %rax      # 0x4ff8
movq (%rax), %rcx
leaq 0x1bfb(%rip), %rdi      # 0x3330
pushq $0x1b
popq %rsi
pushq $0x1
popq %rdx
callq 0x11d0
testl %ebx, %ebx
jle 0x174b
negl %ebx
jmp 0x1b5d
movl 0x3a07(%rip), %ebx      # 0x5158
andq $0x0, 0x24(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x14(%rsp)
movl $0xa, 0x10(%rsp)
movl $0x1c, 0x50(%rsp)
pushq $0xa
popq %rdi
pushq $0x1
popq %rsi
pushq $0x6
popq %rdx
callq 0x1230
testl %eax, %eax
js 0x1ad9
movl %eax, %ebp
leaq 0xc(%rsp), %rcx
andl $0x0, (%rcx)
pushq $0x29
popq %rsi
pushq $0x1a
popq %rdx
pushq $0x4
popq %r8
movl %eax, %edi
callq 0x1070
testl %eax, %eax
js 0x1ae9
leaq 0xc(%rsp), %rcx
movl $0x1, (%rcx)
pushq $0x1
popq %rsi
pushq $0x2
popq %rdx
pushq $0x4
popq %r8
movl %ebp, %edi
callq 0x1070
testl %eax, %eax
js 0x1af9
leaq 0x10(%rsp), %rsi
pushq $0x1c
popq %rdx
movl %ebp, %edi
callq 0x1140
testl %eax, %eax
js 0x1b09
leaq 0x10(%rsp), %rsi
leaq 0x50(%rsp), %rdx
movl %ebp, %r15d
movl %ebp, %edi
callq 0x1190
testl %eax, %eax
js 0x1b19
movzwl 0x10(%rsp), %edx
movl %edx, %eax
orl $0x8, %eax
cmpl $0xa, %eax
jne 0x1b7a
movzwl 0x12(%rsp), %eax
rolw $0x8, %ax
movw %ax, 0x3946(%rip)       # 0x5168
cmpl $0x11, %ebx
pushq $0x10
popq %rsi
cmovael %ebx, %esi
movl $0x4000, %eax           # imm = 0x4000
cmpl %eax, %esi
cmovael %eax, %esi
movl %r15d, %ebx
movl %r15d, %edi
callq 0x1110
testl %eax, %eax
js 0x1b29
movabsq $0x100000010000000, %rax # imm = 0x100000010000000
leaq 0x10(%rsp), %rsi
movq %rax, (%rsi)
movl 0x393c(%rip), %eax      # 0x519c
movl %eax, 0x8(%rsi)
andw $0x0, 0xe(%rsi)
movzwl 0x38f9(%rip), %eax      # 0x5168
rolw $0x8, %ax
movw %ax, 0xc(%rsi)
movl 0x3913(%rip), %edi      # 0x5190
pushq $0x10
popq %rdx
callq 0x212a
testl %eax, %eax
js 0x1956
movl %r12d, 0x4(%rsp)
movl 0x38c0(%rip), %ebp      # 0x5158
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %r14
movups %xmm0, 0xc(%r14)
movaps %xmm0, (%r14)
xorl %r12d, %r12d
leaq 0x50(%rsp), %r15
movl %ebx, 0x8(%rsp)
cmpl %ebp, %r12d
jae 0x192b
movl $0x1c, 0x50(%rsp)
movl %ebx, %edi
movq %r14, %rsi
movq %r15, %rdx
callq 0x1180
testl %eax, %eax
jns 0x18e1
leaq 0x1a4a(%rip), %rdi      # 0x3324
callq 0x1160
jmp 0x18b5
movl %eax, %r13d
movzwl 0x10(%rsp), %eax
orl $0x8, %eax
movl %r12d, %ebx
cmpl $0xa, %eax
jne 0x1962
movq 0x388d(%rip), %rax      # 0x5188
movq %rbx, %rcx
shlq $0x7, %rcx
leaq (%rax,%rcx), %rdi
movzwl 0x12(%rsp), %edx
rolw $0x8, %dx
movw %dx, 0x8(%rax,%rcx)
movl %r13d, 0x4(%rax,%rcx)
callq 0x1b9c
testl %eax, %eax
js 0x1962
incl %r12d
movl 0x8(%rsp), %ebx
jmp 0x18b5
movq %rbp, %r15
shlq $0x7, %r15
xorl %r14d, %r14d
xorl %r13d, %r13d
cmpq %r13, %r15
je 0x199e
movq 0x3844(%rip), %rax      # 0x5188
movq 0x28(%rax,%r13), %rdi
xorl %esi, %esi
callq 0x11f0
subq $-0x80, %r13
jmp 0x1938
movl %ebx, %edi
callq 0x10e0
jmp 0x1b60
movl %r13d, %edi
callq 0x10e0
movl 0x8(%rsp), %edi
callq 0x10e0
shlq $0x7, %rbx
xorl %r13d, %r13d
pushq $-0xe
popq %r14
cmpq %r13, %rbx
je 0x199a
movq 0x37fe(%rip), %rax      # 0x5188
movq 0x28(%rax,%r13), %rdi
callq 0x1210
subq $-0x80, %r13
jmp 0x197e
movl 0x8(%rsp), %ebx
movl %ebx, %edi
callq 0x10e0
cmpl %ebp, %r12d
movl 0x4(%rsp), %r12d
jb 0x1b60
movabsq $0x100000018000000, %rax # imm = 0x100000018000000
leaq 0x50(%rsp), %rsi
movq %rax, (%rsi)
movl 0x37d1(%rip), %eax      # 0x519c
movl %eax, 0x8(%rsi)
movabsq $0x3800000000000000, %rax # imm = 0x3800000000000000
movq %rax, 0xc(%rsi)
movl 0x3776(%rip), %eax      # 0x5158
bswapl %eax
movl %eax, 0x14(%rsi)
movl 0x37a2(%rip), %r14d     # 0x5190
pushq $0x18
popq %rdx
movl %r14d, %edi
callq 0x212a
testl %eax, %eax
js 0x1acb
pushq $0x58
popq %rsi
pushq $-0x1
popq %rbx
leaq 0x10(%rsp), %r15
pushq $0x38
popq %r12
movl 0x3742(%rip), %ecx      # 0x5158
incq %rbx
cmpq %rcx, %rbx
jae 0x1ad0
leaq 0x80(%rsi), %r13
movq 0x3758(%rip), %rcx      # 0x5188
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, 0x30(%rsp)
andq $0x0, 0x40(%rsp)
movq -0x28(%rcx,%rsi), %rdx
rolq $0x20, %rdx
movq %rdx, 0x10(%rsp)
movq -0x20(%rcx,%rsi), %rdx
rolq $0x20, %rdx
movq %rdx, 0x18(%rsp)
movq -0x18(%rcx,%rsi), %rdx
rolq $0x20, %rdx
movq %rdx, 0x20(%rsp)
movq -0x10(%rcx,%rsi), %rdx
rolq $0x20, %rdx
movq %rdx, 0x28(%rsp)
movq -0x8(%rcx,%rsi), %rdx
rolq $0x20, %rdx
movq %rdx, 0x30(%rsp)
movq (%rcx,%rsi), %rdx
rolq $0x20, %rdx
movq %rdx, 0x38(%rsp)
movzwl -0x50(%rcx,%rsi), %eax
rolw $0x8, %ax
movw %ax, 0x44(%rsp)
movl %r14d, %edi
movq %r15, %rsi
movl %r12d, %edx
callq 0x212a
movq %r13, %rsi
testl %eax, %eax
jns 0x1a10
movl 0x4(%rsp), %r12d
movl %eax, %ebx
jmp 0x1b4a
pushq $-0xe
popq %rbx
jmp 0x1b4a
xorl %ebx, %ebx
movl 0x4(%rsp), %r12d
jmp 0x1b4a
callq 0x1040
movl (%rax), %ebx
leaq 0x17f9(%rip), %rdi      # 0x32e0
jmp 0x1b37
callq 0x1040
movl (%rax), %ebx
leaq 0x17f0(%rip), %rdi      # 0x32e7
jmp 0x1b37
callq 0x1040
movl (%rax), %ebx
leaq 0x17f8(%rip), %rdi      # 0x32ff
jmp 0x1b37
callq 0x1040
movl (%rax), %ebx
leaq 0x1801(%rip), %rdi      # 0x3318
jmp 0x1b37
callq 0x1040
movl (%rax), %ebx
leaq 0x1825(%rip), %rdi      # 0x334c
jmp 0x1b37
callq 0x1040
movl (%rax), %ebx
leaq 0x17e6(%rip), %rdi      # 0x331d
callq 0x1160
movl %ebx, %eax
negl %eax
testl %ebx, %ebx
movl %eax, %ebx
jle 0x1848
movq 0x361f(%rip), %rdi      # 0x5170
movq 0x3628(%rip), %rsi      # 0x5180
callq 0x1130
movl %ebx, %r14d
movl %r12d, %edi
callq 0x10e0
movl %r14d, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x3477(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0x17cd(%rip), %rsi      # 0x3358
xorl %eax, %eax
callq 0x1100
pushq $-0x16
jmp 0x1acd
nopl (%rax)