// File: /workspace/github_c_makefile_star2_O1/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 $0x48, %rsp
movq %rdi, %rbx
movl 0x34(%rdi), %r13d
cmpl $0x0, 0x18(%rdi)
je 0x3253
movsd 0x28(%rbx), %xmm0
mulsd 0x1f72(%rip), %xmm0     # 0x5010
divsd 0x1f72(%rip), %xmm0     # 0x5018
movsd %xmm0, 0x20(%rsp)
movb 0x30(%rbx), %al
movb %al, 0x7(%rsp)
leaq 0x48(%rbx), %rax
movq %rax, 0x28(%rsp)
movsd 0x1f5c(%rip), %xmm0     # 0x5020
movsd %xmm0, 0x18(%rsp)
xorpd %xmm0, %xmm0
leaq 0x610b(%rip), %r15      # 0x91e0
xorl %r14d, %r14d
xorpd %xmm1, %xmm1
xorl %r12d, %r12d
movq %rbx, 0x30(%rsp)
movsd %xmm0, 0x10(%rsp)
movsd %xmm1, 0x8(%rsp)
testb $0xc, %r13b
je 0x3108
leal 0x1(%r14), %esi
leaq 0x1f37(%rip), %rdi      # 0x5038
xorl %eax, %eax
callq 0x2120
movq %r15, %rdi
leaq 0x40(%rsp), %rsi
callq 0x261c
movl %eax, %ebp
testl %eax, %eax
js 0x3229
movsd 0x40(%rsp), %xmm3
movq 0x6144(%rip), %rax      # 0x9270
movsd %xmm3, (%rax,%r14,8)
movsd 0x8(%rsp), %xmm0
addsd %xmm3, %xmm0
movapd %xmm3, %xmm1
mulsd %xmm3, %xmm1
addsd 0x10(%rsp), %xmm1
testq %r14, %r14
movsd %xmm0, 0x8(%rsp)
movsd %xmm1, 0x10(%rsp)
je 0x31af
movl 0x20(%rbx), %esi
movl %r12d, %ebx
movl %ebp, %r12d
movl %r13d, %ebp
movq %r15, %r13
leal 0x1(%r14), %r15d
movsd %xmm3, 0x38(%rsp)
movl %r15d, %edi
callq 0x48c4
xorps %xmm1, %xmm1
cvtsi2sd %r15, %xmm1
movq %r13, %r15
movl %ebp, %r13d
movl %r12d, %ebp
movl %ebx, %r12d
movq 0x30(%rsp), %rbx
movsd 0x8(%rsp), %xmm2
divsd %xmm1, %xmm2
movsd 0x38(%rsp), %xmm3
divsd %xmm2, %xmm0
movsd %xmm0, 0x18(%rsp)
testb $0x2, %r13b
je 0x31e8
movl 0x20(%rbx), %edx
leal 0x1(%r14), %edi
movl %edi, %esi
movapd %xmm3, %xmm0
movsd 0x8(%rsp), %xmm1
movsd 0x10(%rsp), %xmm2
movq 0x28(%rsp), %rcx
callq 0x46b3
testb $0xc, %r13b
je 0x31e8
movl $0xa, %edi
callq 0x2050
incl %r12d
movq 0x5dde(%rip), %rax      # 0x8fd0
movq (%rax), %rdi
callq 0x2210
cmpb $0x0, 0x7(%rsp)
je 0x3219
cmpl 0x14(%rbx), %r12d
jb 0x3219
movsd 0x20(%rsp), %xmm0
ucomisd 0x18(%rsp), %xmm0
jb 0x3219
xorl %eax, %eax
jmp 0x321b
movb $0x1, %al
movsd 0x8(%rsp), %xmm1
movsd 0x10(%rsp), %xmm2
jmp 0x3237
xorl %eax, %eax
movsd 0x10(%rsp), %xmm2
movsd 0x8(%rsp), %xmm1
testb %al, %al
je 0x324e
incq %r14
movl 0x18(%rbx), %eax
movapd %xmm2, %xmm0
cmpq %rax, %r14
jb 0x30e4
incl %r14d
jmp 0x3274
xorpd %xmm1, %xmm1
movsd 0x1dc1(%rip), %xmm0     # 0x5020
movsd %xmm0, 0x18(%rsp)
xorl %r12d, %r12d
movl $0x1, %r14d
xorpd %xmm2, %xmm2
xorl %ebp, %ebp
movl %r12d, %r15d
testl %ebp, %ebp
js 0x334c
cmpl $0x2, %r15d
jb 0x32f2
movl %r13d, %eax
andl $0x2, %eax
je 0x32f2
movl %r13d, %eax
andl $0xc, %eax
je 0x32f2
leaq 0x48(%rbx), %r14
xorpd %xmm2, %xmm2
xorl %r12d, %r12d
xorpd %xmm1, %xmm1
movq 0x5fc5(%rip), %rax      # 0x9270
movsd (%rax,%r12,8), %xmm0
addsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
movapd %xmm0, %xmm3
mulsd %xmm0, %xmm3
addsd %xmm3, %xmm2
movsd %xmm2, 0x10(%rsp)
incq %r12
movl 0x20(%rbx), %edx
movl %r12d, %edi
movl %r15d, %esi
movq %r14, %rcx
callq 0x46b3
movsd 0x10(%rsp), %xmm2
movsd 0x8(%rsp), %xmm1
cmpq %r12, %r15
jne 0x32a4
cmpb $0x1, 0x30(%rbx)
jne 0x331a
leaq 0x28(%rbx), %rdi
cmpl $0x2, %r15d
jb 0x338a
movsd 0x1d0a(%rip), %xmm0     # 0x5018
mulsd 0x18(%rsp), %xmm0
ucomisd (%rdi), %xmm0
ja 0x338a
testb $0x1, %r13b
je 0x333b
movl 0x20(%rbx), %edx
addq $0x48, %rbx
xorpd %xmm0, %xmm0
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
movl %r15d, %esi
movq %rbx, %rcx
callq 0x46b3
movl %ebp, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x5ca5(%rip), %rax      # 0x8ff8
movq (%rax), %rdi
leaq 0x1ce9(%rip), %rsi      # 0x5046
movl %r14d, %edx
xorl %eax, %eax
movsd %xmm1, 0x8(%rsp)
movsd %xmm2, 0x10(%rsp)
callq 0x21d0
movsd 0x10(%rsp), %xmm2
movsd 0x8(%rsp), %xmm1
testq %r15, %r15
jne 0x327f
jmp 0x333b
movsd 0x18(%rsp), %xmm0
movsd %xmm1, 0x8(%rsp)
movsd %xmm2, 0x10(%rsp)
callq 0x2437
movsd 0x10(%rsp), %xmm2
movsd 0x8(%rsp), %xmm1
jmp 0x331a