// File: /workspace/github_c_makefile_star2_O2/mkubecek[P]nperf/client/main.c
// Function: all_iterations
int all_iterations(struct client_config *config)
{
	double confid_target_hw, confid_ival_hw;
	unsigned int n_iter, iter;
	unsigned int stats_mask;
	bool confid_target_set;
	double sum, sum_sqr;
	int ret = 0;

	stats_mask = config->stats_mask;
	confid_target_hw = 0.999 * config->confid_target / 200.0;
	confid_target_set = config->confid_target_set;
	confid_ival_hw = HUGE_VAL;

	sum = sum_sqr = 0.0;
	n_iter = 0;
	for (iter = 0; iter < config->max_iter; iter++) {
		double iter_result;

		if (stats_mask & (STATS_F_THREAD | STATS_F_RAW))
			printf("iteration %u\n", iter + 1);
		ret = one_iteration(&client_config, &iter_result);
		if (ret < 0)
			break;
		n_iter++;

		iter_results[iter] = iter_result;
		sum += iter_result;
		sum_sqr += iter_result * iter_result;
		if (iter > 0)
			confid_ival_hw = confid_interval(sum, sum_sqr, iter + 1,
							 config->confid_level) /
					 (sum / (iter + 1));
		if (stats_mask & STATS_F_ITER) {
			print_iter_result(iter + 1, iter + 1, iter_result,
					  sum, sum_sqr, config->confid_level,
					  &config->print_opts);
			if (stats_mask & (STATS_F_THREAD | STATS_F_RAW))
				putchar('\n');
		}
		fflush(stdout);

		if (confid_target_set && (n_iter >= config->min_iter) &&
		    (confid_ival_hw <= confid_target_hw))
			break;
	}
	if (ret < 0) {
		fprintf(stderr, "*** Iteration %u failed, quitting. ***\n\n",
			iter + 1);
		if (!n_iter)
			return ret;
	}

	if (n_iter > 1 &&
	    (stats_mask & STATS_F_ITER) &&
	    (stats_mask & (STATS_F_THREAD | STATS_F_RAW))) {
		sum = sum_sqr = 0.0;
		for (iter = 0; iter < n_iter; iter++) {
			double result = iter_results[iter];

			sum += result;
			sum_sqr += result * result;
			print_iter_result(iter + 1, n_iter, result, sum,
					  sum_sqr, config->confid_level,
					  &config->print_opts);
		}
	}

	if (config->confid_target_set &&
	    ((n_iter < 2) || (200.0 * confid_ival_hw > config->confid_target)))
		fprintf(stderr,
			"*** Failed to reach confidence target.\n"
			"*** Confidence interval width is %.4lg%% (+/- %.4lg%%), requested %.4lg%%.\n"
			"*** The result is not reliable enough.\n",
			200.0 * confid_ival_hw, 100.0 * confid_ival_hw,
			config->confid_target);
	if (stats_mask & STATS_F_TOTAL)
		print_iter_result(XFER_STATS_TOTAL, n_iter, 0.0,
				  sum, sum_sqr, config->confid_level,
				  &config->print_opts);

	return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %r14
movl 0x34(%rdi), %ebx
movsd 0x28(%rdi), %xmm0
mulsd 0x21e7(%rip), %xmm0     # 0x5010
divsd 0x21e7(%rip), %xmm0     # 0x5018
movsd %xmm0, 0x20(%rsp)
movb 0x30(%rdi), %r15b
leaq 0x48(%rdi), %rax
movq %rax, 0x18(%rsp)
xorpd %xmm3, %xmm3
movsd 0x21d0(%rip), %xmm0     # 0x5020
movsd %xmm0, 0x10(%rsp)
xorl %r12d, %r12d
xorpd %xmm4, %xmm4
xorl %ebp, %ebp
movl 0x18(%r14), %eax
cmpq %rax, %r12
jae 0x2fa1
movsd %xmm4, 0x8(%rsp)
movsd %xmm3, (%rsp)
testb $0xc, %bl
je 0x2e8f
leal 0x1(%r12), %esi
leaq 0x21b0(%rip), %rdi      # 0x5038
xorl %eax, %eax
callq 0x2120
leaq 0x634a(%rip), %rdi      # 0x91e0
leaq 0x30(%rsp), %rsi
callq 0x249c
movl %eax, %ebp
testl %eax, %eax
js 0x3083
movsd 0x30(%rsp), %xmm2
movq 0x63e9(%rip), %rax      # 0x92a0
movsd %xmm2, (%rax,%r12,8)
movsd (%rsp), %xmm0
addsd %xmm2, %xmm0
movapd %xmm2, %xmm3
mulsd %xmm2, %xmm3
movsd 0x8(%rsp), %xmm1
addsd %xmm3, %xmm1
testq %r12, %r12
movsd %xmm0, (%rsp)
movsd %xmm1, 0x8(%rsp)
je 0x2f1d
leal 0x1(%r12), %r13d
movl 0x20(%r14), %esi
movl %r13d, %edi
movsd %xmm2, 0x28(%rsp)
callq 0x4636
cvtsi2sd %r13, %xmm3
movsd (%rsp), %xmm2
divsd %xmm3, %xmm2
divsd %xmm2, %xmm0
movsd 0x28(%rsp), %xmm2
movsd %xmm0, 0x10(%rsp)
testb $0x2, %bl
je 0x2f53
leal 0x1(%r12), %edi
movl 0x20(%r14), %edx
movl %edi, %esi
movapd %xmm2, %xmm0
movsd (%rsp), %xmm1
movsd 0x8(%rsp), %xmm2
movq 0x18(%rsp), %rcx
callq 0x4435
testb $0xc, %bl
je 0x2f53
pushq $0xa
popq %rdi
callq 0x2050
leaq 0x1(%r12), %r13
movq 0x6071(%rip), %rax      # 0x8fd0
movq (%rax), %rdi
callq 0x2210
testb %r15b, %r15b
je 0x2f80
cmpl %r13d, 0x14(%r14)
ja 0x2f80
movsd 0x20(%rsp), %xmm0
ucomisd 0x10(%rsp), %xmm0
jae 0x2f93
movq %r13, %r12
movsd (%rsp), %xmm3
movsd 0x8(%rsp), %xmm4
jmp 0x2e5f
incl %r12d
movsd (%rsp), %xmm3
movsd 0x8(%rsp), %xmm4
movl %r12d, %r15d
cmpl $0x2, %r12d
jb 0x3026
movl %ebx, %eax
andl $0x2, %eax
je 0x3026
movl %ebx, %eax
andl $0xc, %eax
je 0x3026
xorpd %xmm0, %xmm0
movsd %xmm0, (%rsp)
xorl %r12d, %r12d
movsd %xmm0, 0x8(%rsp)
cmpq %r12, %r15
je 0x301b
movq 0x62ca(%rip), %rax      # 0x92a0
movsd (%rax,%r12,8), %xmm0
movsd (%rsp), %xmm1
addsd %xmm0, %xmm1
movapd %xmm0, %xmm3
mulsd %xmm0, %xmm3
movsd 0x8(%rsp), %xmm2
addsd %xmm3, %xmm2
incq %r12
movl 0x20(%r14), %edx
movl %r12d, %edi
movl %r15d, %esi
movsd %xmm1, (%rsp)
movsd %xmm2, 0x8(%rsp)
movq 0x18(%rsp), %rcx
callq 0x4435
jmp 0x2fca
movsd (%rsp), %xmm3
movsd 0x8(%rsp), %xmm4
cmpb $0x1, 0x30(%r14)
jne 0x304d
movsd 0x28(%r14), %xmm2
movsd 0x1fdd(%rip), %xmm0     # 0x5018
mulsd 0x10(%rsp), %xmm0
cmpl $0x2, %r15d
jb 0x30ab
ucomisd %xmm2, %xmm0
ja 0x30ab
testb $0x1, %bl
je 0x3072
movl 0x20(%r14), %edx
pushq $-0x1
popq %rdi
xorpd %xmm0, %xmm0
movl %r15d, %esi
movapd %xmm3, %xmm1
movapd %xmm4, %xmm2
movq 0x18(%rsp), %rcx
callq 0x4435
movl %ebp, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x5f6e(%rip), %rax      # 0x8ff8
movq (%rax), %rdi
leal 0x1(%r12), %edx
leaq 0x1fad(%rip), %rsi      # 0x5046
xorl %eax, %eax
callq 0x21d0
testl %r12d, %r12d
jne 0x2f96
jmp 0x3072
movq 0x5f46(%rip), %rax      # 0x8ff8
movq (%rax), %rdi
movsd 0x10(%rsp), %xmm1
mulsd 0x1f65(%rip), %xmm1     # 0x5028
leaq 0x1fa5(%rip), %rsi      # 0x506f
movb $0x3, %al
movsd %xmm3, (%rsp)
movsd %xmm4, 0x8(%rsp)
callq 0x21d0
movsd 0x8(%rsp), %xmm4
movsd (%rsp), %xmm3
jmp 0x304d