// File: /workspace/github_c_makefile_star2_O0/mkubecek[P]nperf/client/cmdline.c
// Function: parse_cmdline
int parse_cmdline(int argc, char *argv[], struct client_config *config)
{
	unsigned long val, val2;
	const char *arg;
	double dval;
	int ret;
	int c;

	while ((c = getopt_long(argc, argv, opts, long_opts, NULL)) != -1) {
		switch(c) {
		case 'h':
			fputs(help_text, stdout);
			exit(0);
		case 'H':
			config->server_host = optarg;
			break;
		case 'i':
			ret = parse_ulong_range_delim("iterations", optarg,
						      &val, 1, MAX_ITERATIONS,
						      ',', &arg);
			if (ret < 0)
				return -EINVAL;
			if (!*arg) {
				config->min_iter = config->max_iter = val;
				break;
			}
			ret = parse_ulong_range("iterations", ++arg, &val2,
						1, MAX_ITERATIONS);
			if (ret < 0)
				return -EINVAL;
			config->min_iter = (val < val2) ? val : val2;
			config->max_iter = (val < val2) ? val2 : val;
			break;
		case 'I':
			ret = parse_ulong_range_delim("confidence", optarg,
						      &val, 0, 100, ',', &arg);
			if (ret < 0)
				return -EINVAL;
			ret = confid_level_input(val);
			if (ret < 0) {
				fprintf(stderr, "only confidence level 95 or 99 are supported\n");
				return -EINVAL;
			}
			config->confid_level = ret;
			if (!*arg)
				break;
			ret = parse_double_range("confidence", ++arg, &dval,
						 1e-6, 100.0);
			if (ret < 0)
				return -EINVAL;
			config->confid_target = dval;
			config->confid_target_set = true;
			break;
		case 'l':
			ret = parse_ulong_range("test length", optarg, &val,
						0, UINT_MAX);
			if (ret < 0)
				return -EINVAL;
			config->test_length = val;
			break;
		case 'm':
			ret = parse_ulong_range("message size", optarg, &val,
						0, INT_MAX);
			if (ret < 0)
				return -EINVAL;
			config->msg_size = val;
			break;
		case 'M':
			ret = parse_ulong_range("thread count", optarg, &val,
						1, MAX_THREADS);
			if (ret < 0)
				return -EINVAL;
			config->n_threads = val;
			break;
		case 'n':
			config->tcp_nodelay = true;
			break;
		case 'p':
			ret = parse_ulong_range("port", optarg, &val,
						0, USHRT_MAX);
			if (ret < 0)
				return -EINVAL;
			config->ctrl_port = val;
			break;
		case 's':
			ret = parse_ulong_range("receive buffer size", optarg,
						&val, 0, INT_MAX);
			if (ret < 0)
				return -EINVAL;
			config->rcvbuf_size = val;
			break;
		case 'S':
			ret = parse_ulong_range("send buffer size", optarg,
						&val, 0, INT_MAX);
			if (ret < 0)
				return -EINVAL;
			config->sndbuf_size = val;
			break;
		case 't':
			ret = name_lookup(optarg, test_mode_names, MODE_COUNT);
			if (ret < 0) {
				fprintf(stderr, "invalid test '%s'\n", optarg);
				return -EINVAL;
			}
			config->test_mode = ret;
			break;
		case 'v':
			ret = name_lookup(optarg, verb_level_names, __VERB_CNT);
			if (ret >= 0) {
				config->stats_mask = verb_levels[ret];
				break;
			}
			ret = parse_ulong_range("verbosity mask", optarg,
						&val, 0, INT_MAX);
			if (ret < 0) {
				fprintf(stderr, "invalid verbosity '%s'\n",
					optarg);
				return -EINVAL;
			}
			config->stats_mask = val;
			break;
		case LOPT_BINARY:
			config->print_opts.binary_prefix = true;
			break;
		case LOPT_EXACT:
			config->print_opts.exact = true;
			break;
		case '?':
			fputs("\nUsage:", stdout);
			fputs(help_text, stdout);
			return -EINVAL;
		default:
			fprintf(stderr, "unknown option '-%c'\n", c);
			return -EINVAL;
		}
	}

	if (config->confid_target_set && (config->min_iter < 3)) {
		fputs("Use of confidence target requires at least 3 iterations (use -i option).\n",
		      stderr);
		return -EINVAL;
	}
	if (!config->confid_target_set &&
	    config->min_iter != config->max_iter) {
		config->confid_target = 10.0;
		config->confid_target_set = true;
	}

	if (!config->msg_size) {
		switch(config->test_mode) {
		case MODE_TCP_STREAM:
			config->msg_size = 1U << 20; /* 1 MB */
			break;
		case MODE_TCP_RR:
			config->msg_size = 1U;
			break;
		default:
			fprintf(stderr, "test mode %u not supported\n",
				config->test_mode);
			return -EINVAL;
		}
	}

	if (config->stats_mask == UINT_MAX) {
		if (config->max_iter == 1) {
			if (config->n_threads == 1)
				config->stats_mask = verb_levels[VERB_RESULT];
			else
				config->stats_mask = verb_levels[VERB_THREAD];
		} else {
			config->stats_mask = verb_levels[VERB_ITER];
		}
	}

	print_opts_setup(&config->print_opts, config->test_mode);

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
movq 0x6a1f(%rip), %rdx      # 0xb280
leaq 0x6358(%rip), %rcx      # 0xabc0
xorl %eax, %eax
movl %eax, %r8d
callq 0x2100
movl %eax, -0x40(%rbp)
cmpl $-0x1, %eax
je 0x4ede
movl -0x40(%rbp), %eax
movl %eax, -0x44(%rbp)
subl $0x3f, %eax
je 0x4e7a
jmp 0x488f
movl -0x44(%rbp), %eax
subl $0x48, %eax
je 0x4985
jmp 0x489d
movl -0x44(%rbp), %eax
subl $0x49, %eax
je 0x4a98
jmp 0x48ab
movl -0x44(%rbp), %eax
subl $0x4d, %eax
je 0x4c21
jmp 0x48b9
movl -0x44(%rbp), %eax
subl $0x53, %eax
je 0x4d12
jmp 0x48c7
movl -0x44(%rbp), %eax
subl $0x68, %eax
je 0x4968
jmp 0x48d5
movl -0x44(%rbp), %eax
subl $0x69, %eax
je 0x499b
jmp 0x48e3
movl -0x44(%rbp), %eax
subl $0x6c, %eax
je 0x4b8b
jmp 0x48f1
movl -0x44(%rbp), %eax
subl $0x6d, %eax
je 0x4bd6
jmp 0x48ff
movl -0x44(%rbp), %eax
subl $0x6e, %eax
je 0x4c6d
jmp 0x490d
movl -0x44(%rbp), %eax
subl $0x70, %eax
je 0x4c7a
jmp 0x491b
movl -0x44(%rbp), %eax
subl $0x73, %eax
je 0x4cc7
jmp 0x4929
movl -0x44(%rbp), %eax
subl $0x74, %eax
je 0x4d5d
jmp 0x4937
movl -0x44(%rbp), %eax
subl $0x76, %eax
je 0x4dbe
jmp 0x4945
movl -0x44(%rbp), %eax
subl $0x100, %eax            # imm = 0x100
je 0x4e70
jmp 0x4955
movl -0x44(%rbp), %eax
subl $0x101, %eax            # imm = 0x101
je 0x4e66
jmp 0x4eb2
movq 0x6919(%rip), %rdi      # 0xb288
movq 0x665a(%rip), %rax      # 0xafd0
movq (%rax), %rsi
callq 0x2160
xorl %edi, %edi
callq 0x2300
movq 0x664c(%rip), %rax      # 0xafd8
movq (%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
jmp 0x4ed9
movq 0x6636(%rip), %rax      # 0xafd8
movq (%rax), %rsi
leaq 0x298e(%rip), %rdi      # 0x733a
leaq -0x20(%rbp), %rdx
movl $0x1, %ecx
movl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
movl $0x2c, %r9d
leaq -0x30(%rbp), %rax
movq %rax, (%rsp)
callq 0x5f70
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
jge 0x49e3
movl $0xffffffea, -0x4(%rbp) # imm = 0xFFFFFFEA
jmp 0x5015
movq -0x30(%rbp), %rax
cmpb $0x0, (%rax)
jne 0x4a05
movq -0x20(%rbp), %rax
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x18(%rax)
movq -0x18(%rbp), %rax
movl %ecx, 0x14(%rax)
jmp 0x4ed9
movq -0x30(%rbp), %rsi
addq $0x1, %rsi
movq %rsi, -0x30(%rbp)
leaq 0x2922(%rip), %rdi      # 0x733a
leaq -0x28(%rbp), %rdx
movl $0x1, %ecx
movl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
callq 0x6050
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
jge 0x4a41
movl $0xffffffea, -0x4(%rbp) # imm = 0xFFFFFFEA
jmp 0x5015
movq -0x20(%rbp), %rax
cmpq -0x28(%rbp), %rax
jae 0x4a55
movq -0x20(%rbp), %rax
movq %rax, -0x50(%rbp)
jmp 0x4a5d
movq -0x28(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x14(%rax)
movq -0x20(%rbp), %rax
cmpq -0x28(%rbp), %rax
jae 0x4a7e
movq -0x28(%rbp), %rax
movq %rax, -0x58(%rbp)
jmp 0x4a86
movq -0x20(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x18(%rax)
jmp 0x4ed9
movq 0x6539(%rip), %rax      # 0xafd8
movq (%rax), %rsi
leaq 0x282a(%rip), %rdi      # 0x72d3
leaq -0x20(%rbp), %rdx
xorl %eax, %eax
movl %eax, %ecx
movl $0x64, %r8d
movl $0x2c, %r9d
leaq -0x30(%rbp), %rax
movq %rax, (%rsp)
callq 0x5f70
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
jge 0x4adf
movl $0xffffffea, -0x4(%rbp) # imm = 0xFFFFFFEA
jmp 0x5015
movq -0x20(%rbp), %rax
movl %eax, %edi
callq 0x5020
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
jge 0x4b17
movq 0x64fe(%rip), %rax      # 0xaff8
movq (%rax), %rdi
leaq 0x2841(%rip), %rsi      # 0x7345
movb $0x0, %al
callq 0x21f0
movl $0xffffffea, -0x4(%rbp) # imm = 0xFFFFFFEA
jmp 0x5015
movl -0x3c(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x20(%rax)
movq -0x30(%rbp), %rax
cmpb $0x0, (%rax)
jne 0x4b2f
jmp 0x4ed9
movq -0x30(%rbp), %rsi
addq $0x1, %rsi
movq %rsi, -0x30(%rbp)
leaq 0x2791(%rip), %rdi      # 0x72d3
leaq -0x38(%rbp), %rdx
movsd 0x2752(%rip), %xmm0     # 0x72a0
movsd 0x24d2(%rip), %xmm1     # 0x7028
callq 0x6280
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
jge 0x4b70
movl $0xffffffea, -0x4(%rbp) # imm = 0xFFFFFFEA
jmp 0x5015
movsd -0x38(%rbp), %xmm0
movq -0x18(%rbp), %rax
movsd %xmm0, 0x28(%rax)
movq -0x18(%rbp), %rax
movb $0x1, 0x30(%rax)
jmp 0x4ed9
movq 0x6446(%rip), %rax      # 0xafd8
movq (%rax), %rsi
leaq 0x27d7(%rip), %rdi      # 0x7373
leaq -0x20(%rbp), %rdx
xorl %eax, %eax
movl %eax, %ecx
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
callq 0x6050
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
jge 0x4bc4
movl $0xffffffea, -0x4(%rbp) # imm = 0xFFFFFFEA
jmp 0x5015
movq -0x20(%rbp), %rax
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x10(%rax)
jmp 0x4ed9
movq 0x63fb(%rip), %rax      # 0xafd8
movq (%rax), %rsi
leaq 0x2798(%rip), %rdi      # 0x737f
leaq -0x20(%rbp), %rdx
xorl %eax, %eax
movl %eax, %ecx
movl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
callq 0x6050
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
jge 0x4c0f
movl $0xffffffea, -0x4(%rbp) # imm = 0xFFFFFFEA
jmp 0x5015
movq -0x20(%rbp), %rax
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x40(%rax)
jmp 0x4ed9
movq 0x63b0(%rip), %rax      # 0xafd8
movq (%rax), %rsi
leaq 0x275a(%rip), %rdi      # 0x738c
leaq -0x20(%rbp), %rdx
movl $0x1, %ecx
movl $0x4000, %r8d           # imm = 0x4000
callq 0x6050
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
jge 0x4c5b
movl $0xffffffea, -0x4(%rbp) # imm = 0xFFFFFFEA
jmp 0x5015
movq -0x20(%rbp), %rax
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x1c(%rax)
jmp 0x4ed9
movq -0x18(%rbp), %rax
movb $0x1, 0x44(%rax)
jmp 0x4ed9
movq 0x6357(%rip), %rax      # 0xafd8
movq (%rax), %rsi
leaq 0x266c(%rip), %rdi      # 0x72f7
leaq -0x20(%rbp), %rdx
xorl %eax, %eax
movl %eax, %ecx
movl $0xffff, %r8d           # imm = 0xFFFF
callq 0x6050
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
jge 0x4cb3
movl $0xffffffea, -0x4(%rbp) # imm = 0xFFFFFFEA
jmp 0x5015
movq -0x20(%rbp), %rax
movw %ax, %cx
movq -0x18(%rbp), %rax
movw %cx, 0x8(%rax)
jmp 0x4ed9
movq 0x630a(%rip), %rax      # 0xafd8
movq (%rax), %rsi
leaq 0x26c1(%rip), %rdi      # 0x7399
leaq -0x20(%rbp), %rdx
xorl %eax, %eax
movl %eax, %ecx
movl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
callq 0x6050
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
jge 0x4d00
movl $0xffffffea, -0x4(%rbp) # imm = 0xFFFFFFEA
jmp 0x5015
movq -0x20(%rbp), %rax
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x38(%rax)
jmp 0x4ed9
movq 0x62bf(%rip), %rax      # 0xafd8
movq (%rax), %rsi
leaq 0x268a(%rip), %rdi      # 0x73ad
leaq -0x20(%rbp), %rdx
xorl %eax, %eax
movl %eax, %ecx
movl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
callq 0x6050
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
jge 0x4d4b
movl $0xffffffea, -0x4(%rbp) # imm = 0xFFFFFFEA
jmp 0x5015
movq -0x20(%rbp), %rax
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x3c(%rax)
jmp 0x4ed9
movq 0x6274(%rip), %rax      # 0xafd8
movq (%rax), %rdi
leaq 0x6052(%rip), %rsi      # 0xadc0
movl $0x2, %edx
callq 0x5060
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
jge 0x4daf
movq 0x6270(%rip), %rax      # 0xaff8
movq (%rax), %rdi
movq 0x6246(%rip), %rax      # 0xafd8
movq (%rax), %rdx
leaq 0x2622(%rip), %rsi      # 0x73be
movb $0x0, %al
callq 0x21f0
movl $0xffffffea, -0x4(%rbp) # imm = 0xFFFFFFEA
jmp 0x5015
movl -0x3c(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0xc(%rax)
jmp 0x4ed9
movq 0x6213(%rip), %rax      # 0xafd8
movq (%rax), %rdi
leaq 0x64c1(%rip), %rsi      # 0xb290
movl $0x5, %edx
callq 0x5060
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
jl 0x4dfc
movslq -0x3c(%rbp), %rcx
leaq 0x64d3(%rip), %rax      # 0xb2c0
movl (%rax,%rcx,4), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x34(%rax)
jmp 0x4ed9
movq 0x61d5(%rip), %rax      # 0xafd8
movq (%rax), %rsi
leaq 0x25c4(%rip), %rdi      # 0x73d1
leaq -0x20(%rbp), %rdx
xorl %eax, %eax
movl %eax, %ecx
movl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
callq 0x6050
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
jge 0x4e57
movq 0x61c8(%rip), %rax      # 0xaff8
movq (%rax), %rdi
movq 0x619e(%rip), %rax      # 0xafd8
movq (%rax), %rdx
leaq 0x259c(%rip), %rsi      # 0x73e0
movb $0x0, %al
callq 0x21f0
movl $0xffffffea, -0x4(%rbp) # imm = 0xFFFFFFEA
jmp 0x5015
movq -0x20(%rbp), %rax
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x34(%rax)
jmp 0x4ed9
movq -0x18(%rbp), %rax
movb $0x1, 0x51(%rax)
jmp 0x4ed9
movq -0x18(%rbp), %rax
movb $0x1, 0x50(%rax)
jmp 0x4ed9
movq 0x614f(%rip), %rax      # 0xafd0
movq (%rax), %rsi
leaq 0x256d(%rip), %rdi      # 0x73f8
callq 0x2160
movq 0x63f1(%rip), %rdi      # 0xb288
movq 0x6132(%rip), %rax      # 0xafd0
movq (%rax), %rsi
callq 0x2160
movl $0xffffffea, -0x4(%rbp) # imm = 0xFFFFFFEA
jmp 0x5015
movq 0x613f(%rip), %rax      # 0xaff8
movq (%rax), %rdi
movl -0x40(%rbp), %edx
leaq 0x253a(%rip), %rsi      # 0x7400
movb $0x0, %al
callq 0x21f0
movl $0xffffffea, -0x4(%rbp) # imm = 0xFFFFFFEA
jmp 0x5015
jmp 0x4853
movq -0x18(%rbp), %rax
testb $0x1, 0x30(%rax)
je 0x4f14
movq -0x18(%rbp), %rax
cmpl $0x3, 0x14(%rax)
jae 0x4f14
movq 0x60ff(%rip), %rax      # 0xaff8
movq (%rax), %rsi
leaq 0x2513(%rip), %rdi      # 0x7416
callq 0x2160
movl $0xffffffea, -0x4(%rbp) # imm = 0xFFFFFFEA
jmp 0x5015
movq -0x18(%rbp), %rax
testb $0x1, 0x30(%rax)
jne 0x4f47
movq -0x18(%rbp), %rax
movl 0x14(%rax), %eax
movq -0x18(%rbp), %rcx
cmpl 0x18(%rcx), %eax
je 0x4f47
movq -0x18(%rbp), %rax
movsd 0x235e(%rip), %xmm0     # 0x7298
movsd %xmm0, 0x28(%rax)
movq -0x18(%rbp), %rax
movb $0x1, 0x30(%rax)
movq -0x18(%rbp), %rax
cmpl $0x0, 0x40(%rax)
jne 0x4faf
movq -0x18(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0x5c(%rbp)
testl %eax, %eax
je 0x4f6b
jmp 0x4f61
movl -0x5c(%rbp), %eax
subl $0x1, %eax
je 0x4f78
jmp 0x4f85
movq -0x18(%rbp), %rax
movl $0x100000, 0x40(%rax)   # imm = 0x100000
jmp 0x4fad
movq -0x18(%rbp), %rax
movl $0x1, 0x40(%rax)
jmp 0x4fad
movq 0x606c(%rip), %rax      # 0xaff8
movq (%rax), %rdi
movq -0x18(%rbp), %rax
movl 0xc(%rax), %edx
leaq 0x24c3(%rip), %rsi      # 0x7460
movb $0x0, %al
callq 0x21f0
movl $0xffffffea, -0x4(%rbp) # imm = 0xFFFFFFEA
jmp 0x5015
jmp 0x4faf
movq -0x18(%rbp), %rax
cmpl $-0x1, 0x34(%rax)
jne 0x4ffa
movq -0x18(%rbp), %rax
cmpl $0x1, 0x18(%rax)
jne 0x4feb
movq -0x18(%rbp), %rax
cmpl $0x1, 0x1c(%rax)
jne 0x4fdc
movl 0x62ed(%rip), %ecx      # 0xb2c0
movq -0x18(%rbp), %rax
movl %ecx, 0x34(%rax)
jmp 0x4fe9
movl 0x62e6(%rip), %ecx      # 0xb2c8
movq -0x18(%rbp), %rax
movl %ecx, 0x34(%rax)
jmp 0x4ff8
movl 0x62d3(%rip), %ecx      # 0xb2c4
movq -0x18(%rbp), %rax
movl %ecx, 0x34(%rax)
jmp 0x4ffa
movq -0x18(%rbp), %rdi
addq $0x48, %rdi
movq -0x18(%rbp), %rax
movl 0xc(%rax), %esi
callq 0x5110
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq
nop