// File: /workspace/github_c_makefile_star2_O3/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, %r13d
movl %edi, 0x3b65(%rip)      # 0x5190
movl $0x1e, %edi
callq 0x1170
movl $0xfffffff2, %ebp       # imm = 0xFFFFFFF2
testq %rax, %rax
js 0x1bda
movq %rax, %r14
movl 0x3b44(%rip), %edi      # 0x5190
leaq 0x3b41(%rip), %rsi      # 0x5194
movl $0x1c, %edx
callq 0x21be
testl %eax, %eax
js 0x194f
movl 0x3b35(%rip), %eax      # 0x51a0
bswapl %eax
movl %eax, 0x3add(%rip)      # 0x5150
movl 0x3b2b(%rip), %esi      # 0x51a4
bswapl %esi
movl %esi, 0x3ad7(%rip)      # 0x5158
movl 0x3b21(%rip), %eax      # 0x51a8
bswapl %eax
movl %eax, 0x3ad1(%rip)      # 0x5160
leaq (%r14,%rax), %rcx
decq %rcx
movq %rcx, %rax
cqto
idivq %r14
subq %rdx, %rcx
movq %rcx, 0x3ad0(%rip)      # 0x5178
imulq %rsi, %rcx
shlq $0x7, %rsi
addq %r14, %rsi
decq %rsi
xorl %r15d, %r15d
movq %rsi, %rax
xorl %edx, %edx
divq %r14
subq %rdx, %rsi
addq %rcx, %rsi
movq %rsi, 0x3ab2(%rip)      # 0x5180
xorl %edi, %edi
movl $0x3, %edx
movl $0x22, %ecx
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
xorl %r9d, %r9d
callq 0x1080
movq %rax, 0x3a81(%rip)      # 0x5170
cmpq $-0x1, %rax
je 0x1b1b
movl 0x3a59(%rip), %ecx      # 0x5158
movq 0x3a72(%rip), %rdx      # 0x5178
movq %rdx, %r8
imulq %rcx, %r8
leaq (%rax,%r8), %rsi
movq %rsi, 0x3a70(%rip)      # 0x5188
testq %rcx, %rcx
je 0x1759
cmpl $0x1, 0x3a2c(%rip)      # 0x5150
movl 0x3a36(%rip), %esi      # 0x5160
sete %dil
addq %rax, %r8
addq $0x20, %r8
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 0x1738
movl %ecx, %r15d
xorps %xmm0, %xmm0
movups %xmm0, 0x14(%rsp)
movq $0x0, 0x24(%rsp)
movl $0xa, 0x10(%rsp)
movl $0x1c, 0x50(%rsp)
movl $0xa, %edi
movl $0x1, %esi
movl $0x6, %edx
callq 0x1230
testl %eax, %eax
js 0x1b53
movl %eax, %r14d
leaq 0xc(%rsp), %rcx
movl $0x0, (%rcx)
movl %eax, %edi
movl $0x29, %esi
movl $0x1a, %edx
movl $0x4, %r8d
callq 0x1070
testl %eax, %eax
js 0x1b63
leaq 0xc(%rsp), %rcx
movl $0x1, (%rcx)
movl %r14d, %edi
movl $0x1, %esi
movl $0x2, %edx
movl $0x4, %r8d
callq 0x1070
testl %eax, %eax
js 0x1b73
leaq 0x10(%rsp), %rsi
movl %r14d, %edi
movl $0x1c, %edx
callq 0x1140
testl %eax, %eax
js 0x1b83
leaq 0x10(%rsp), %rsi
leaq 0x50(%rsp), %rdx
movl %r14d, %edi
callq 0x1190
testl %eax, %eax
js 0x1b93
movzwl 0x10(%rsp), %edx
movl %edx, %eax
orl $0x8, %eax
cmpl $0xa, %eax
jne 0x1bff
movzwl 0x12(%rsp), %eax
rolw $0x8, %ax
movw %ax, 0x3923(%rip)       # 0x5168
cmpl $0x11, %r15d
movl $0x10, %esi
cmovael %r15d, %esi
movl $0x4000, %eax           # imm = 0x4000
cmpl %eax, %esi
cmovael %eax, %esi
movl %r14d, %edi
callq 0x1110
testl %eax, %eax
js 0x1ba3
movabsq $0x100000010000000, %rax # imm = 0x100000010000000
leaq 0x10(%rsp), %rsi
movq %rax, (%rsi)
movl 0x3918(%rip), %eax      # 0x519c
movl %eax, 0x8(%rsi)
movw $0x0, 0xe(%rsi)
movzwl 0x38d4(%rip), %eax      # 0x5168
rolw $0x8, %ax
movw %ax, 0xc(%rsi)
movl 0x38ee(%rip), %edi      # 0x5190
movl $0x10, %edx
callq 0x21b9
testl %eax, %eax
js 0x1964
movl 0x389e(%rip), %ebx      # 0x5158
xorps %xmm0, %xmm0
movups %xmm0, 0x1c(%rsp)
movaps %xmm0, 0x10(%rsp)
testq %rbx, %rbx
je 0x19e4
movl %r13d, 0x8(%rsp)
xorl %ebp, %ebp
leaq 0x50(%rsp), %r12
movl $0x1c, 0x50(%rsp)
movl %r14d, %edi
leaq 0x10(%rsp), %rsi
movq %r12, %rdx
callq 0x1180
testl %eax, %eax
js 0x1941
movl %eax, %r13d
movl %ebp, %r15d
movzwl 0x10(%rsp), %eax
orl $0x8, %eax
cmpl $0xa, %eax
jne 0x1971
movzwl 0x12(%rsp), %eax
movq 0x3871(%rip), %rcx      # 0x5188
movq %r15, %rdx
shlq $0x7, %rdx
leaq (%rcx,%rdx), %rdi
rolw $0x8, %ax
movw %ax, 0x8(%rcx,%rdx)
movl %r13d, 0x4(%rcx,%rdx)
callq 0x1c20
testl %eax, %eax
js 0x1971
incl %ebp
cmpl %ebx, %ebp
jb 0x18dc
jmp 0x19bc
leaq 0x19dc(%rip), %rdi      # 0x3324
callq 0x1160
jmp 0x193b
movl 0x383b(%rip), %edi      # 0x5190
callq 0x10e0
movl $0xffffffea, %ebp       # imm = 0xFFFFFFEA
jmp 0x1bda
movl %r14d, %edi
callq 0x10e0
jmp 0x1bda
movl %r13d, %edi
callq 0x10e0
movl %r14d, %edi
callq 0x10e0
testl %ebp, %ebp
je 0x19a5
shlq $0x7, %r15
xorl %ebx, %ebx
movq 0x37f6(%rip), %rax      # 0x5188
movq 0x28(%rax,%rbx), %rdi
callq 0x1210
subq $-0x80, %rbx
cmpq %rbx, %r15
jne 0x198b
movl %r14d, %edi
callq 0x10e0
movl 0x8(%rsp), %r13d
movl $0xfffffff2, %ebp       # imm = 0xFFFFFFF2
jmp 0x1bda
shlq $0x7, %rbx
xorl %r15d, %r15d
movl 0x8(%rsp), %r13d
movq 0x37b9(%rip), %rax      # 0x5188
movq 0x28(%rax,%r15), %rdi
xorl %esi, %esi
callq 0x11f0
subq $-0x80, %r15
cmpq %r15, %rbx
jne 0x19c8
movl %r14d, %edi
callq 0x10e0
movabsq $0x100000018000000, %rax # imm = 0x100000018000000
leaq 0x50(%rsp), %rsi
movq %rax, (%rsi)
movl 0x3798(%rip), %eax      # 0x519c
movl %eax, 0x8(%rsi)
movabsq $0x3800000000000000, %rax # imm = 0x3800000000000000
movq %rax, 0xc(%rsi)
movl 0x373d(%rip), %eax      # 0x5158
bswapl %eax
movl %eax, 0x14(%rsi)
movl 0x376a(%rip), %ebp      # 0x5190
movl %ebp, %edi
movl $0x18, %edx
callq 0x21b9
testl %eax, %eax
js 0x1b08
cmpl $0x0, 0x3717(%rip)      # 0x5158
je 0x1b00
movl $0x58, %ebx
xorl %r12d, %r12d
leaq 0x10(%rsp), %r15
movq 0x372d(%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 %ebp, %edi
movq %r15, %rsi
movl $0x38, %edx
callq 0x21b9
testl %eax, %eax
js 0x1b13
incq %r12
movl 0x3665(%rip), %eax      # 0x5158
subq $-0x80, %rbx
cmpq %rax, %r12
jb 0x1a54
xorl %r14d, %r14d
jmp 0x1bc4
movl $0xfffffff2, %r14d      # imm = 0xFFFFFFF2
jmp 0x1bc4
movl %eax, %r14d
jmp 0x1bc4
callq 0x1040
movl (%rax), %ebx
movq 0x34cf(%rip), %rax      # 0x4ff8
movq (%rax), %rcx
leaq 0x17fd(%rip), %rdi      # 0x3330
movl $0x1b, %esi
movl $0x1, %edx
callq 0x11d0
testl %ebx, %ebx
jle 0x1bf3
negl %ebx
movl %ebx, %ebp
jmp 0x1bda
callq 0x1040
movl (%rax), %ebx
leaq 0x177f(%rip), %rdi      # 0x32e0
jmp 0x1bb1
callq 0x1040
movl (%rax), %ebx
leaq 0x1776(%rip), %rdi      # 0x32e7
jmp 0x1bb1
callq 0x1040
movl (%rax), %ebx
leaq 0x177e(%rip), %rdi      # 0x32ff
jmp 0x1bb1
callq 0x1040
movl (%rax), %ebx
leaq 0x1787(%rip), %rdi      # 0x3318
jmp 0x1bb1
callq 0x1040
movl (%rax), %ebx
leaq 0x17ab(%rip), %rdi      # 0x334c
jmp 0x1bb1
callq 0x1040
movl (%rax), %ebx
leaq 0x176c(%rip), %rdi      # 0x331d
callq 0x1160
movl %ebx, %r14d
negl %r14d
testl %ebx, %ebx
jle 0x186c
movq 0x35a5(%rip), %rdi      # 0x5170
movq 0x35ae(%rip), %rsi      # 0x5180
callq 0x1130
movl %r14d, %ebp
movl %r13d, %edi
callq 0x10e0
movl %ebp, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl 0x355e(%rip), %r15d     # 0x5158
jmp 0x1759
movq 0x33f2(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0x1748(%rip), %rsi      # 0x3358
xorl %eax, %eax
callq 0x1100
movl $0xffffffea, %r14d      # imm = 0xFFFFFFEA
jmp 0x1bc4
nop