// File: /workspace/github_c_makefile_star2_O1/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, %r15d
movl %edi, 0x3b2d(%rip)      # 0x5190
movl $0x1e, %edi
callq 0x1170
movb $0x1, %bl
testq %rax, %rax
js 0x1703
movq %rax, %r14
movl 0x3b0f(%rip), %edi      # 0x5190
leaq 0x3b0c(%rip), %rsi      # 0x5194
movl $0x1c, %edx
callq 0x2223
testl %eax, %eax
js 0x170b
movl 0x3b04(%rip), %eax      # 0x51a0
bswapl %eax
movl %eax, 0x3aac(%rip)      # 0x5150
movl 0x3afa(%rip), %esi      # 0x51a4
bswapl %esi
movl %esi, 0x3aa6(%rip)      # 0x5158
movl 0x3af0(%rip), %eax      # 0x51a8
bswapl %eax
movl %eax, 0x3aa0(%rip)      # 0x5160
leaq (%r14,%rax), %rcx
decq %rcx
movq %rcx, %rax
cqto
idivq %r14
subq %rdx, %rcx
movq %rcx, 0x3a9f(%rip)      # 0x5178
imulq %rsi, %rcx
shlq $0x7, %rsi
addq %r14, %rsi
decq %rsi
xorl %ebx, %ebx
movq %rsi, %rax
xorl %edx, %edx
divq %r14
subq %rdx, %rsi
addq %rcx, %rsi
movq %rsi, 0x3a82(%rip)      # 0x5180
xorl %r14d, %r14d
jmp 0x171c
movl $0xfffffff2, %r14d      # imm = 0xFFFFFFF2
jmp 0x171c
movl 0x3a7f(%rip), %edi      # 0x5190
callq 0x10e0
movl $0xffffffea, %r14d      # imm = 0xFFFFFFEA
testb %bl, %bl
jne 0x1c37
movq 0x3a55(%rip), %rsi      # 0x5180
xorl %r14d, %r14d
xorl %edi, %edi
movl $0x3, %edx
movl $0x22, %ecx
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
xorl %r9d, %r9d
callq 0x1080
movq %rax, 0x3a21(%rip)      # 0x5170
cmpq $-0x1, %rax
je 0x18ee
movl 0x39f9(%rip), %ecx      # 0x5158
movq 0x3a12(%rip), %rdx      # 0x5178
movq %rdx, %r8
imulq %rcx, %r8
leaq (%rax,%r8), %rsi
movq %rsi, 0x3a10(%rip)      # 0x5188
testq %rcx, %rcx
je 0x17b9
movl 0x39dd(%rip), %esi      # 0x5160
cmpl $0x1, 0x39c6(%rip)      # 0x5150
sete %dil
addq %rax, %r8
addq $0x20, %r8
xorl %r14d, %r14d
xorl %r9d, %r9d
movl %r9d, -0x20(%r8)
movq %rax, -0x10(%r8)
movq %rsi, (%r8)
movb %dil, -0x8(%r8)
incq %r9
addq %rdx, %rax
subq $-0x80, %r8
cmpq %r9, %rcx
jne 0x179b
testl %r14d, %r14d
js 0x1c37
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movups %xmm0, 0x1c(%rsp)
movl $0xa, 0x10(%rsp)
movl 0x397b(%rip), %ebx      # 0x5158
movl $0x1c, 0x50(%rsp)
movl $0xa, %edi
movl $0x1, %esi
movl $0x6, %edx
callq 0x1230
testl %eax, %eax
js 0x1903
movl %eax, %ebp
leaq 0x4c(%rsp), %rcx
movl $0x0, (%rcx)
movl %eax, %edi
movl $0x29, %esi
movl $0x1a, %edx
movl $0x4, %r8d
callq 0x1070
testl %eax, %eax
js 0x1915
leaq 0x4c(%rsp), %rcx
movl $0x1, (%rcx)
movl %ebp, %edi
movl $0x1, %esi
movl $0x2, %edx
movl $0x4, %r8d
callq 0x1070
testl %eax, %eax
js 0x1927
leaq 0x10(%rsp), %rsi
movl %ebp, %edi
movl $0x1c, %edx
callq 0x1140
testl %eax, %eax
js 0x1939
leaq 0x10(%rsp), %rsi
leaq 0x50(%rsp), %rdx
movl %ebp, %edi
callq 0x1190
testl %eax, %eax
js 0x194b
movzwl 0x10(%rsp), %edx
cmpl $0xa, %edx
je 0x189d
movl $0xffffffea, %eax       # imm = 0xFFFFFFEA
cmpl $0x2, %edx
jne 0x18a9
movzwl 0x12(%rsp), %eax
rolw $0x8, %ax
movzwl %ax, %eax
testl %eax, %eax
js 0x1c51
movw %ax, 0x38b0(%rip)       # 0x5168
cmpl $0x11, %ebx
movl $0x10, %esi
cmovael %ebx, %esi
movl $0x4000, %eax           # imm = 0x4000
cmpl %eax, %esi
cmovael %eax, %esi
movl %ebp, %edi
callq 0x1110
testl %eax, %eax
jns 0x1960
callq 0x1040
xorl %ebp, %ebp
subl (%rax), %ebp
leaq 0x1a31(%rip), %rdi      # 0x331d
jmp 0x195b
leaq 0x10(%rsp), %r14
movq %r14, %rdi
callq 0x1260
movl (%r14), %r14d
jmp 0x17b9
callq 0x1040
xorl %ebp, %ebp
subl (%rax), %ebp
leaq 0x19cd(%rip), %rdi      # 0x32e0
jmp 0x195b
callq 0x1040
xorl %ebp, %ebp
subl (%rax), %ebp
leaq 0x19c2(%rip), %rdi      # 0x32e7
jmp 0x195b
callq 0x1040
xorl %ebp, %ebp
subl (%rax), %ebp
leaq 0x19c8(%rip), %rdi      # 0x32ff
jmp 0x195b
callq 0x1040
xorl %ebp, %ebp
subl (%rax), %ebp
leaq 0x19cf(%rip), %rdi      # 0x3318
jmp 0x195b
callq 0x1040
xorl %ebp, %ebp
subl (%rax), %ebp
leaq 0x19f1(%rip), %rdi      # 0x334c
callq 0x1160
testl %ebp, %ebp
js 0x1c21
movabsq $0x100000010000000, %rax # imm = 0x100000010000000
leaq 0x10(%rsp), %rsi
movq %rax, (%rsi)
movl 0x381c(%rip), %eax      # 0x519c
movl %eax, 0x8(%rsi)
movw $0x0, 0xe(%rsi)
movzwl 0x37d8(%rip), %eax      # 0x5168
rolw $0x8, %ax
movw %ax, 0xc(%rsi)
movl 0x37f2(%rip), %edi      # 0x5190
movl $0x10, %edx
callq 0x221e
testl %eax, %eax
js 0x1a65
movl %r15d, 0xc(%rsp)
movl 0x379c(%rip), %r12d     # 0x5158
xorps %xmm0, %xmm0
movups %xmm0, 0x1c(%rsp)
movaps %xmm0, 0x10(%rsp)
testq %r12, %r12
je 0x1a77
xorl %ebx, %ebx
leaq 0x10(%rsp), %r14
leaq 0x50(%rsp), %r15
movl $0x1c, 0x50(%rsp)
movl %ebp, %edi
movq %r14, %rsi
movq %r15, %rdx
callq 0x1180
testl %eax, %eax
js 0x1a57
movl %eax, %r13d
movzwl 0x10(%rsp), %ecx
cmpl $0xa, %ecx
je 0x1a0e
movl $0xffffffea, %eax       # imm = 0xFFFFFFEA
cmpl $0x2, %ecx
jne 0x1a1a
movzwl 0x12(%rsp), %eax
rolw $0x8, %ax
movzwl %ax, %eax
testl %eax, %eax
js 0x1a42
movl %ebx, %edi
shlq $0x7, %rdi
addq 0x375d(%rip), %rdi      # 0x5188
movw %ax, 0x8(%rdi)
movl %r13d, 0x4(%rdi)
callq 0x1c74
testl %eax, %eax
js 0x1a42
incl %ebx
xorl %eax, %eax
jmp 0x1a4c
movl %r13d, %edi
callq 0x10e0
movb $0x1, %al
testb %al, %al
jne 0x1a7f
cmpl %r12d, %ebx
jb 0x19de
jmp 0x1ab8
leaq 0x18c6(%rip), %rdi      # 0x3324
callq 0x1160
jmp 0x1a3e
movl %ebp, %edi
callq 0x10e0
movl $0xfffffff2, %r14d      # imm = 0xFFFFFFF2
jmp 0x1c37
xorl %r15d, %r15d
xorl %r14d, %r14d
jmp 0x1ae0
movl %ebp, %edi
callq 0x10e0
movl $0xfffffff2, %r14d      # imm = 0xFFFFFFF2
movb $0x1, %r15b
testl %ebx, %ebx
je 0x1ae0
movl %ebx, %ebx
shlq $0x7, %rbx
xorl %r12d, %r12d
movq 0x36e5(%rip), %rax      # 0x5188
movq 0x28(%rax,%r12), %rdi
callq 0x1210
subq $-0x80, %r12
cmpq %r12, %rbx
jne 0x1a9c
jmp 0x1ae0
shlq $0x7, %r12
xorl %r14d, %r14d
xorl %ebx, %ebx
movq 0x36c0(%rip), %rax      # 0x5188
movq 0x28(%rax,%rbx), %rdi
xorl %esi, %esi
callq 0x11f0
subq $-0x80, %rbx
cmpq %rbx, %r12
jne 0x1ac1
xorl %r15d, %r15d
movl %ebp, %edi
callq 0x10e0
testb %r15b, %r15b
movl 0xc(%rsp), %r15d
jne 0x1c37
movabsq $0x100000018000000, %rax # imm = 0x100000018000000
leaq 0x50(%rsp), %rsi
movq %rax, (%rsi)
movl 0x368f(%rip), %eax      # 0x519c
movl %eax, 0x8(%rsi)
movabsq $0x3800000000000000, %rax # imm = 0x3800000000000000
movq %rax, 0xc(%rsi)
movl 0x3634(%rip), %eax      # 0x5158
bswapl %eax
movl %eax, 0x14(%rsi)
movl 0x3660(%rip), %r14d     # 0x5190
movl %r14d, %edi
movl $0x18, %edx
callq 0x221e
testl %eax, %eax
js 0x1c18
cmpl $0x0, 0x360c(%rip)      # 0x5158
je 0x1c1f
movl $0x58, %ebx
xorl %r12d, %r12d
leaq 0x10(%rsp), %r15
movq 0x3622(%rip), %rax      # 0x5188
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, 0x30(%rsp)
movq $0x0, 0x40(%rsp)
movq -0x28(%rax,%rbx), %rcx
rolq $0x20, %rcx
movq %rcx, 0x10(%rsp)
movq -0x20(%rax,%rbx), %rcx
rolq $0x20, %rcx
movq %rcx, 0x18(%rsp)
movq -0x18(%rax,%rbx), %rcx
rolq $0x20, %rcx
movq %rcx, 0x20(%rsp)
movq -0x10(%rax,%rbx), %rcx
rolq $0x20, %rcx
movq %rcx, 0x28(%rsp)
movq -0x8(%rax,%rbx), %rcx
rolq $0x20, %rcx
movq %rcx, 0x30(%rsp)
movq (%rax,%rbx), %rcx
rolq $0x20, %rcx
movq %rcx, 0x38(%rsp)
movzwl -0x50(%rax,%rbx), %eax
rolw $0x8, %ax
movw %ax, 0x44(%rsp)
movl %r14d, %edi
movq %r15, %rsi
movl $0x38, %edx
callq 0x221e
testl %eax, %eax
cmovsl %eax, %ebp
js 0x1c11
incq %r12
movl 0x3556(%rip), %eax      # 0x5158
subq $-0x80, %rbx
cmpq %rax, %r12
jb 0x1b5f
xorl %ebp, %ebp
movl 0xc(%rsp), %r15d
jmp 0x1c21
movl $0xfffffff2, %ebp       # imm = 0xFFFFFFF2
jmp 0x1c21
xorl %ebp, %ebp
movq 0x3548(%rip), %rdi      # 0x5170
movq 0x3551(%rip), %rsi      # 0x5180
callq 0x1130
movl %ebp, %r14d
movl %r15d, %edi
callq 0x10e0
movl %r14d, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x33a0(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0x16f6(%rip), %rsi      # 0x3358
xorl %eax, %eax
callq 0x1100
movl $0xffffffea, %ebp       # imm = 0xFFFFFFEA
jmp 0x1960
nop