// File: /workspace/github_c_makefile_star2_O1/mkubecek[P]nperf/client/main.c
// Function: main
int main(int argc, char *argv[])
{
	int ret;

	ret = parse_cmdline(argc, argv, &client_config);
	if (ret < 0)
		return 1;
	iter_results = calloc(client_config.max_iter, sizeof(iter_results[0]));
	if (!iter_results)
		return 2;

	printf("server: %s, port %hu\n", client_config.server_host,
	       client_config.ctrl_port);
	if (client_config.min_iter < client_config.max_iter)
		printf("iterations: %u-%u", client_config.min_iter,
		       client_config.max_iter);
	else
		printf("iterations: %u", client_config.min_iter);
	printf(", threads: %u, test length: %u\n",
	       client_config.n_threads, client_config.test_length);
	if (client_config.confid_target_set)
		printf("confidence target: %.1lf%% (+/- %.1lf%%) at %u%%\n",
		       client_config.confid_target,
		       client_config.confid_target / 2,
		       confid_level_output(client_config.confid_level));
	printf("test: %s, message size: %u\n",
	       test_mode_names[client_config.test_mode],
	       client_config.msg_size);
	putchar('\n');

	ret = client_init();
	if (ret < 0)
		goto out_results;
	ret = wsync_init(&client_worker_sync);
	if (ret < 0)
		goto out_results;
	ret = alloc_buffers(&client_config);
	if (ret < 0)
		goto out_ws;
	ret = all_iterations(&client_config);

	free_buffers(&client_config);
out_ws:
	wsync_destroy(&client_worker_sync);
out_results:
	free(iter_results);
	return (ret < 0) ? 2 : 0;
}

// Assembly:
pushq %rbx
subq $0xa0, %rsp
leaq 0x5e1f(%rip), %rdx      # 0x91e0
callq 0x3b18
testl %eax, %eax
js 0x3422
movl 0x5e28(%rip), %edi      # 0x91f8
movl $0x8, %esi
callq 0x21b0
movq %rax, 0x5e8f(%rip)      # 0x9270
testq %rax, %rax
je 0x342c
movq 0x5df3(%rip), %rsi      # 0x91e0
movzwl 0x5df4(%rip), %edx      # 0x91e8
leaq 0x1d0e(%rip), %rdi      # 0x5109
xorl %eax, %eax
callq 0x2120
movl 0x5dec(%rip), %esi      # 0x91f4
movl 0x5dea(%rip), %edx      # 0x91f8
cmpl %edx, %esi
jae 0x3436
leaq 0x1d06(%rip), %rdi      # 0x511f
xorl %eax, %eax
callq 0x2120
jmp 0x3444
movl $0x1, %ebx
jmp 0x3670
movl $0x2, %ebx
jmp 0x3670
leaq 0x1cf4(%rip), %rdi      # 0x5131
xorl %eax, %eax
callq 0x2120
movl 0x5db2(%rip), %esi      # 0x91fc
movl 0x5da0(%rip), %edx      # 0x91f0
leaq 0x1ce9(%rip), %rdi      # 0x5140
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x2120
cmpb $0x1, 0x5da9(%rip)      # 0x9210
jne 0x34a6
movsd 0x5d97(%rip), %xmm0     # 0x9208
movsd 0x1baf(%rip), %xmm1     # 0x5028
mulsd %xmm0, %xmm1
movl 0x5d7d(%rip), %eax      # 0x9200
cmpl $0x1, %eax
movl $0x63, %ecx
cmovel %ecx, %ebx
testl %eax, %eax
movl $0x5f, %esi
cmovnel %ebx, %esi
leaq 0x1cc1(%rip), %rdi      # 0x5160
movb $0x2, %al
callq 0x2120
movl 0x5d40(%rip), %eax      # 0x91ec
leaq 0x590d(%rip), %rcx      # 0x8dc0
movq (%rcx,%rax,8), %rsi
movl 0x5d63(%rip), %edx      # 0x9220
leaq 0x1cce(%rip), %rdi      # 0x5192
xorl %eax, %eax
callq 0x2120
movl $0xa, %edi
callq 0x2050
leaq 0x8(%rsp), %rdx
movl $0xa, %edi
xorl %esi, %esi
callq 0x2090
testl %eax, %eax
js 0x350d
leaq 0x8(%rsp), %rsi
movq $0x1, (%rsi)
andb $-0x11, 0x8b(%rsi)
movl $0xa, %edi
xorl %edx, %edx
callq 0x2090
testl %eax, %eax
jns 0x3520
callq 0x2070
cmpl $0x0, (%rax)
movl $0x2, %ebx
jg 0x3664
movl $0xd, %edi
callq 0x4cb2
movl $0x2, %ebx
testl %eax, %eax
js 0x3664
leaq 0x8(%rsp), %rdi
callq 0x2240
testl %eax, %eax
jne 0x357b
leaq 0x8(%rsp), %rdi
movl $0x1, %esi
callq 0x21a0
testl %eax, %eax
jne 0x357b
leaq 0x5d39(%rip), %rdi      # 0x9298
addq $0x28, %rdi
leaq 0x8(%rsp), %rsi
callq 0x21f0
testl %eax, %eax
jne 0x357b
leaq 0x8(%rsp), %rdi
callq 0x2170
testl %eax, %eax
jg 0x3664
movl $0x1e, %edi
callq 0x2290
movl $0x2, %ebx
testq %rax, %rax
js 0x3654
movq %rax, %rcx
movl 0x5c7c(%rip), %eax      # 0x9220
leaq (%rcx,%rax), %rsi
decq %rsi
movq %rsi, %rax
cqto
idivq %rcx
subq %rdx, %rsi
movq %rsi, 0x5c83(%rip)      # 0x9240
movl 0x5c39(%rip), %eax      # 0x91fc
imulq %rax, %rsi
shlq $0x7, %rax
leaq (%rax,%rcx), %r8
decq %r8
movq %r8, %rax
xorl %edx, %edx
divq %rcx
subq %rdx, %r8
addq %rsi, %r8
movq %r8, 0x5c61(%rip)       # 0x9248
xorl %edi, %edi
movq %r8, %rsi
movl $0x3, %edx
movl $0x22, %ecx
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
xorl %r9d, %r9d
callq 0x20f0
movq %rax, 0x5c2d(%rip)      # 0x9238
cmpq $-0x1, %rax
je 0x367b
movl 0x5be5(%rip), %eax      # 0x91fc
imulq 0x5c21(%rip), %rax      # 0x9240
addq 0x5c12(%rip), %rax      # 0x9238
movq %rax, 0x5c23(%rip)      # 0x9250
leaq 0x5bac(%rip), %rdi      # 0x91e0
callq 0x3072
movl %eax, %ebx
movq 0x5bf6(%rip), %rdi      # 0x9238
movq 0x5bff(%rip), %rsi      # 0x9248
callq 0x2230
shrl $0x1e, %ebx
andl $-0x2, %ebx
leaq 0x5c3d(%rip), %rdi      # 0x9298
addq $0x28, %rdi
callq 0x2270
movq 0x5c05(%rip), %rdi      # 0x9270
callq 0x2030
movl %ebx, %eax
addq $0xa0, %rsp
popq %rbx
retq
callq 0x246e
testb $0x1, %al
je 0x362d
jmp 0x3654
nop