// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %rbx
subq $0x98, %rsp
leaq 0x60e4(%rip), %rdx      # 0x91e0
callq 0x38c8
testl %eax, %eax
js 0x315b
movl 0x60ed(%rip), %edi      # 0x91f8
pushq $0x8
popq %rsi
callq 0x21b0
movq %rax, 0x6186(%rip)      # 0x92a0
testq %rax, %rax
je 0x315f
movq 0x60ba(%rip), %rsi      # 0x91e0
movzwl 0x60bb(%rip), %edx      # 0x91e8
leaq 0x1fd5(%rip), %rdi      # 0x5109
xorl %eax, %eax
callq 0x2120
movl 0x60b3(%rip), %esi      # 0x91f4
movl 0x60b1(%rip), %edx      # 0x91f8
cmpl %edx, %esi
jae 0x3167
leaq 0x1fcd(%rip), %rdi      # 0x511f
xorl %eax, %eax
callq 0x2120
jmp 0x3175
pushq $0x1
jmp 0x3161
pushq $0x2
popq %rbx
jmp 0x3374
leaq 0x1fc3(%rip), %rdi      # 0x5131
xorl %eax, %eax
callq 0x2120
movl 0x6081(%rip), %esi      # 0x91fc
movl 0x606f(%rip), %edx      # 0x91f0
leaq 0x1fb8(%rip), %rdi      # 0x5140
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x2120
cmpb $0x1, 0x6078(%rip)      # 0x9210
jne 0x31d3
movsd 0x6066(%rip), %xmm0     # 0x9208
movsd 0x1e86(%rip), %xmm1     # 0x5030
mulsd %xmm0, %xmm1
movl 0x604c(%rip), %eax      # 0x9200
cmpl $0x1, %eax
pushq $0x63
popq %rcx
cmovel %ecx, %ebx
testl %eax, %eax
pushq $0x5f
popq %rsi
cmovnel %ebx, %esi
leaq 0x1f94(%rip), %rdi      # 0x5160
movb $0x2, %al
callq 0x2120
movl 0x6013(%rip), %eax      # 0x91ec
leaq 0x5be0(%rip), %rcx      # 0x8dc0
movq (%rcx,%rax,8), %rsi
movl 0x6036(%rip), %edx      # 0x9220
leaq 0x1fa1(%rip), %rdi      # 0x5192
xorl %eax, %eax
callq 0x2120
pushq $0xa
popq %rbx
movl %ebx, %edi
callq 0x2050
movq %rsp, %rdx
movl %ebx, %edi
xorl %esi, %esi
callq 0x2090
testl %eax, %eax
js 0x3231
movq %rsp, %rsi
movq $0x1, (%rsi)
andb $-0x11, 0x8b(%rsi)
pushq $0xa
popq %rdi
xorl %edx, %edx
callq 0x2090
testl %eax, %eax
jns 0x3240
callq 0x2070
movl (%rax), %eax
testl %eax, %eax
jle 0x3240
negl %eax
jmp 0x3248
pushq $0xd
popq %rdi
callq 0x49cd
pushq $0x2
popq %rbx
testl %eax, %eax
js 0x3368
movq %rsp, %rdi
callq 0x2240
testl %eax, %eax
jne 0x328d
movq %rsp, %rdi
pushq $0x1
popq %rsi
callq 0x21a0
testl %eax, %eax
jne 0x328d
leaq 0x6053(%rip), %rdi      # 0x92c8
addq $0x28, %rdi
movq %rsp, %rsi
callq 0x21f0
testl %eax, %eax
jne 0x328d
movq %rsp, %rdi
callq 0x2170
testl %eax, %eax
jg 0x3368
pushq $0x1e
popq %rdi
callq 0x2290
pushq $0x2
popq %rbx
testq %rax, %rax
js 0x3358
movq %rax, %rcx
movl 0x5f6e(%rip), %eax      # 0x9220
leaq (%rcx,%rax), %rsi
decq %rsi
movq %rsi, %rax
cqto
idivq %rcx
subq %rdx, %rsi
movq %rsi, 0x5f75(%rip)      # 0x9240
movl 0x5f2b(%rip), %eax      # 0x91fc
imulq %rax, %rsi
shlq $0x7, %rax
leaq (%rax,%rcx), %r9
decq %r9
movq %r9, %rax
xorl %edx, %edx
divq %rcx
subq %rdx, %r9
addq %rsi, %r9
movq %r9, 0x5f53(%rip)       # 0x9248
pushq $0x3
popq %rdx
pushq $0x22
popq %rcx
pushq $-0x1
popq %r8
xorl %edi, %edi
movq %r9, %rsi
xorl %r9d, %r9d
callq 0x20f0
movq %rax, 0x5f25(%rip)      # 0x9238
cmpq $-0x1, %rax
je 0x3380
movl 0x5edd(%rip), %ecx      # 0x91fc
imulq 0x5f19(%rip), %rcx      # 0x9240
addq %rcx, %rax
movq %rax, 0x5f1f(%rip)      # 0x9250
leaq 0x5ea8(%rip), %rdi      # 0x91e0
callq 0x2e08
movl %eax, %ebx
movq 0x5ef2(%rip), %rdi      # 0x9238
movq 0x5efb(%rip), %rsi      # 0x9248
callq 0x2230
shrl $0x1e, %ebx
andl $-0x2, %ebx
leaq 0x5f69(%rip), %rdi      # 0x92c8
addq $0x28, %rdi
callq 0x2270
movq 0x5f31(%rip), %rdi      # 0x92a0
callq 0x2030
movl %ebx, %eax
addq $0x98, %rsp
popq %rbx
popq %rbp
retq
callq 0x2070
movq 0x5c6c(%rip), %rcx      # 0x8ff8
movq (%rcx), %rcx
movl (%rax), %ebp
leaq 0x1e97(%rip), %rdi      # 0x522f
pushq $0x1b
popq %rsi
pushq $0x1
popq %rdx
callq 0x22f0
movq 0x5ea6(%rip), %rdi      # 0x9250
callq 0x2030
movl 0x5e47(%rip), %eax      # 0x91fc
imulq 0x5e83(%rip), %rax      # 0x9240
addq 0x5e74(%rip), %rax      # 0x9238
movq %rax, 0x5e85(%rip)      # 0x9250
testl %ebp, %ebp
jg 0x3358
jmp 0x3331