// File: /workspace/github_cpp_makefile_star2_O1/uclaopt[P]AsyncQVI/include/util.h
// Function: parse_input_argv(Params*, int, char**)
void parse_input_argv(Params* para, int argc, char *argv[]){
	
	if (argc < 2) {
		cout << "Input number error: [0]" << endl;
		return;
	}

	for (int i = 1; i < argc; ++i)
	{
		if (argv[i][0] != '-') {
			break;
		}
		if (++i >= argc) {
			cout << "Input number error: [1]" << endl;
			return;
		}
		else if (std::string(argv[i - 1]) == "-len_state") {
			para->len_state = atoi(argv[i]);
		}
		else if (std::string(argv[i - 1]) == "-len_action") {
			para->len_action = atoi(argv[i]);
		}
		else if (std::string(argv[i - 1]) == "-probs") {
			para->probs = atof(argv[i]);
		}
		else if (std::string(argv[i - 1]) == "-d") {
			para->d = atof(argv[i]);
		}
		else if (std::string(argv[i - 1]) == "-max_outer_iter") {
			para->max_outer_iter = atoi(argv[i]);
		}
		else if (std::string(argv[i - 1]) == "-max_inner_iter") {
			para->max_inner_iter = atoi(argv[i]);
		}
		else if (std::string(argv[i - 1]) == "-test_max_episode") {
			para->test_max_episode = atoi(argv[i]);
		}
		else if (std::string(argv[i - 1]) == "-test_max_step") {
			para->test_max_step = atoi(argv[i]);
		}
		else if (std::string(argv[i - 1]) == "-sample_num_1") {
			para->sample_num_1 = atoi(argv[i]);
		}
		else if (std::string(argv[i - 1]) == "-sample_num_2") {
			para->sample_num_2 = atoi(argv[i]);
		}
		else if (std::string(argv[i - 1]) == "-check_step") {
			para->check_step = atoi(argv[i]);
		}
		else if (std::string(argv[i - 1]) == "-style") {
			para->style = atoi(argv[i]);
		}
		else if (std::string(argv[i - 1]) == "-save") {
			para->save = atoi(argv[i]);
		}
		else if (std::string(argv[i - 1]) == "-alpha") {
			para->alpha = atof(argv[i]);
		}
		else if (std::string(argv[i - 1]) == "-alpha1") {
			para->alpha1 = atof(argv[i]);
		}
		else if (std::string(argv[i - 1]) == "-explore") {
			para->explore = atof(argv[i]);
		}
		else if (std::string(argv[i - 1]) == "-gamma") {
			para->gamma = atof(argv[i]);
		}
		else if (std::string(argv[i - 1]) == "-epsilon") {
			para->epsilon = atof(argv[i]);
		}
		else if (std::string(argv[i - 1]) == "-algo") {
			para->algo = atoi(argv[i]);
		}
		else if (std::string(argv[i - 1]) == "-nthreads") {
			para->total_num_threads = atoi(argv[i]);
		}
		else {
			cout << "Input number error: [2]" << endl;
			return;
		}
	}
	return;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, 0x10(%rsp)
cmpl $0x2, %esi
jge 0x25d4
movq 0x6a4d(%rip), %rbx      # 0x8fd8
leaq 0x3b1a(%rip), %rsi      # 0x60ac
movl $0x17, %edx
movq %rbx, %rdi
callq 0x2220
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21e0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2100
movq %rdx, %rbx
movl %esi, %ebp
movl $0x2, %r14d
movl $0x1, %r12d
leaq 0x18(%rsp), %r15
movq -0x8(%rbx,%r14,8), %rsi
cmpb $0x2d, (%rsi)
jne 0x2db3
cmpl %ebp, %r14d
jge 0x2d71
movq %r15, %rdi
leaq 0xf(%rsp), %rdx
callq 0x3b92
movq %r15, %rdi
leaq 0x3ac4(%rip), %rsi      # 0x60dc
callq 0x2050
movl %eax, %r13d
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x263c
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x2200
testl %r13d, %r13d
je 0x2bc6
movq -0x8(%rbx,%r14,8), %rsi
movq %r15, %rdi
leaq 0xf(%rsp), %rdx
callq 0x3b92
movq %r15, %rdi
leaq 0x3a86(%rip), %rsi      # 0x60e7
callq 0x2050
movl %eax, %r13d
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x2685
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x2200
testl %r13d, %r13d
je 0x2bdb
movq -0x8(%rbx,%r14,8), %rsi
movq %r15, %rdi
leaq 0xf(%rsp), %rdx
callq 0x3b92
movq %r15, %rdi
leaq 0x3a49(%rip), %rsi      # 0x60f3
callq 0x2050
movl %eax, %r13d
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x26ce
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x2200
testl %r13d, %r13d
je 0x2bf1
movq -0x8(%rbx,%r14,8), %rsi
movq %r15, %rdi
leaq 0xf(%rsp), %rdx
callq 0x3b92
movq %r15, %rdi
leaq 0x3a07(%rip), %rsi      # 0x60fa
callq 0x2050
movl %eax, %r13d
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x2717
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x2200
testl %r13d, %r13d
je 0x2c09
movq -0x8(%rbx,%r14,8), %rsi
movq %r15, %rdi
leaq 0xf(%rsp), %rdx
callq 0x3b92
movq %r15, %rdi
leaq 0x39c1(%rip), %rsi      # 0x60fd
callq 0x2050
movl %eax, %r13d
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x2760
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x2200
testl %r13d, %r13d
je 0x2c21
movq -0x8(%rbx,%r14,8), %rsi
movq %r15, %rdi
leaq 0xf(%rsp), %rdx
callq 0x3b92
movq %r15, %rdi
leaq 0x3988(%rip), %rsi      # 0x610d
callq 0x2050
movl %eax, %r13d
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x27a9
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x2200
testl %r13d, %r13d
je 0x2c37
movq -0x8(%rbx,%r14,8), %rsi
movq %r15, %rdi
leaq 0xf(%rsp), %rdx
callq 0x3b92
movq %r15, %rdi
leaq 0x394f(%rip), %rsi      # 0x611d
callq 0x2050
movl %eax, %r13d
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x27f2
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x2200
testl %r13d, %r13d
je 0x2c4d
movq -0x8(%rbx,%r14,8), %rsi
movq %r15, %rdi
leaq 0xf(%rsp), %rdx
callq 0x3b92
movq %r15, %rdi
leaq 0x3918(%rip), %rsi      # 0x612f
callq 0x2050
movl %eax, %r13d
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x283b
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x2200
testl %r13d, %r13d
je 0x2c63
movq -0x8(%rbx,%r14,8), %rsi
movq %r15, %rdi
leaq 0xf(%rsp), %rdx
callq 0x3b92
movq %r15, %rdi
leaq 0x38de(%rip), %rsi      # 0x613e
callq 0x2050
movl %eax, %r13d
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x2884
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x2200
testl %r13d, %r13d
je 0x2c79
movq -0x8(%rbx,%r14,8), %rsi
movq %r15, %rdi
leaq 0xf(%rsp), %rdx
callq 0x3b92
movq %r15, %rdi
leaq 0x38a3(%rip), %rsi      # 0x614c
callq 0x2050
movl %eax, %r13d
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x28cd
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x2200
testl %r13d, %r13d
je 0x2c8f
movq -0x8(%rbx,%r14,8), %rsi
movq %r15, %rdi
leaq 0xf(%rsp), %rdx
callq 0x3b92
movq %r15, %rdi
leaq 0x3868(%rip), %rsi      # 0x615a
callq 0x2050
movl %eax, %r13d
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x2916
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x2200
testl %r13d, %r13d
je 0x2ca5
movq -0x8(%rbx,%r14,8), %rsi
movq %r15, %rdi
leaq 0xf(%rsp), %rdx
callq 0x3b92
movq %r15, %rdi
leaq 0x382b(%rip), %rsi      # 0x6166
callq 0x2050
movl %eax, %r13d
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x295f
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x2200
testl %r13d, %r13d
je 0x2cbb
movq -0x8(%rbx,%r14,8), %rsi
movq %r15, %rdi
leaq 0xf(%rsp), %rdx
callq 0x3b92
movq %r15, %rdi
leaq 0x37e9(%rip), %rsi      # 0x616d
callq 0x2050
movl %eax, %r13d
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x29a8
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x2200
testl %r13d, %r13d
je 0x2cd1
movq -0x8(%rbx,%r14,8), %rsi
movq %r15, %rdi
leaq 0xf(%rsp), %rdx
callq 0x3b92
movq %r15, %rdi
leaq 0x37a6(%rip), %rsi      # 0x6173
callq 0x2050
movl %eax, %r13d
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x29f1
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x2200
testl %r13d, %r13d
je 0x2ce4
movq -0x8(%rbx,%r14,8), %rsi
movq %r15, %rdi
leaq 0xf(%rsp), %rdx
callq 0x3b92
movq %r15, %rdi
leaq 0x3764(%rip), %rsi      # 0x617a
callq 0x2050
movl %eax, %r13d
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x2a3a
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x2200
testl %r13d, %r13d
je 0x2cf9
movq -0x8(%rbx,%r14,8), %rsi
movq %r15, %rdi
leaq 0xf(%rsp), %rdx
callq 0x3b92
movq %r15, %rdi
leaq 0x3723(%rip), %rsi      # 0x6182
callq 0x2050
movl %eax, %r13d
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x2a83
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x2200
testl %r13d, %r13d
je 0x2d0e
movq -0x8(%rbx,%r14,8), %rsi
movq %r15, %rdi
leaq 0xf(%rsp), %rdx
callq 0x3b92
movq %r15, %rdi
leaq 0x36e3(%rip), %rsi      # 0x618b
callq 0x2050
movl %eax, %r13d
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x2acc
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x2200
testl %r13d, %r13d
je 0x2d23
movq -0x8(%rbx,%r14,8), %rsi
movq %r15, %rdi
leaq 0xf(%rsp), %rdx
callq 0x3b92
movq %r15, %rdi
leaq 0x36a1(%rip), %rsi      # 0x6192
callq 0x2050
movl %eax, %r13d
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x2b15
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x2200
testl %r13d, %r13d
je 0x2d38
movq -0x8(%rbx,%r14,8), %rsi
movq %r15, %rdi
leaq 0xf(%rsp), %rdx
callq 0x3b92
movq %r15, %rdi
leaq 0x3661(%rip), %rsi      # 0x619b
callq 0x2050
movl %eax, %r13d
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x2b5e
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x2200
testl %r13d, %r13d
je 0x2d4d
movq -0x8(%rbx,%r14,8), %rsi
movq %r15, %rdi
leaq 0xf(%rsp), %rdx
callq 0x3b92
movq %r15, %rdi
leaq 0x361e(%rip), %rsi      # 0x61a1
callq 0x2050
movl %eax, %r13d
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x2ba7
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x2200
testl %r13d, %r13d
jne 0x2dc2
movq (%rbx,%r14,8), %rdi
callq 0x22c0
movq 0x10(%rsp), %rcx
movl %eax, 0x30(%rcx)
jmp 0x2d5e
movq (%rbx,%r14,8), %rdi
callq 0x22c0
movq 0x10(%rsp), %rcx
movl %eax, (%rcx)
jmp 0x2d5e
movq (%rbx,%r14,8), %rdi
callq 0x22c0
movq 0x10(%rsp), %rcx
movl %eax, 0x4(%rcx)
jmp 0x2d5e
movq (%rbx,%r14,8), %rdi
callq 0x2240
movq 0x10(%rsp), %rax
movsd %xmm0, 0x8(%rax)
jmp 0x2d5e
movq (%rbx,%r14,8), %rdi
callq 0x2240
movq 0x10(%rsp), %rax
movsd %xmm0, 0x10(%rax)
jmp 0x2d5e
movq (%rbx,%r14,8), %rdi
callq 0x22c0
movq 0x10(%rsp), %rcx
movl %eax, 0x34(%rcx)
jmp 0x2d5e
movq (%rbx,%r14,8), %rdi
callq 0x22c0
movq 0x10(%rsp), %rcx
movl %eax, 0x38(%rcx)
jmp 0x2d5e
movq (%rbx,%r14,8), %rdi
callq 0x22c0
movq 0x10(%rsp), %rcx
movl %eax, 0x20(%rcx)
jmp 0x2d5e
movq (%rbx,%r14,8), %rdi
callq 0x22c0
movq 0x10(%rsp), %rcx
movl %eax, 0x24(%rcx)
jmp 0x2d5e
movq (%rbx,%r14,8), %rdi
callq 0x22c0
movq 0x10(%rsp), %rcx
movl %eax, 0x3c(%rcx)
jmp 0x2d5e
movq (%rbx,%r14,8), %rdi
callq 0x22c0
movq 0x10(%rsp), %rcx
movl %eax, 0x40(%rcx)
jmp 0x2d5e
movq (%rbx,%r14,8), %rdi
callq 0x22c0
movq 0x10(%rsp), %rcx
movl %eax, 0x6c(%rcx)
jmp 0x2d5e
movq (%rbx,%r14,8), %rdi
callq 0x22c0
movq 0x10(%rsp), %rcx
movl %eax, 0x2c(%rcx)
jmp 0x2d5e
movq (%rbx,%r14,8), %rdi
callq 0x22c0
movq 0x10(%rsp), %rcx
movl %eax, 0x68(%rcx)
jmp 0x2d5e
movq (%rbx,%r14,8), %rdi
callq 0x2240
movq 0x10(%rsp), %rax
movsd %xmm0, 0x50(%rax)
jmp 0x2d5e
movq (%rbx,%r14,8), %rdi
callq 0x2240
movq 0x10(%rsp), %rax
movsd %xmm0, 0x58(%rax)
jmp 0x2d5e
movq (%rbx,%r14,8), %rdi
callq 0x2240
movq 0x10(%rsp), %rax
movsd %xmm0, 0x48(%rax)
jmp 0x2d5e
movq (%rbx,%r14,8), %rdi
callq 0x2240
movq 0x10(%rsp), %rax
movsd %xmm0, 0x18(%rax)
jmp 0x2d5e
movq (%rbx,%r14,8), %rdi
callq 0x2240
movq 0x10(%rsp), %rax
movsd %xmm0, 0x60(%rax)
jmp 0x2d5e
movq (%rbx,%r14,8), %rdi
callq 0x22c0
movq 0x10(%rsp), %rcx
movl %eax, 0x28(%rcx)
addq $0x2, %r14
addl $0x2, %r12d
cmpl %ebp, %r12d
jl 0x25ea
jmp 0x2db3
movq 0x6260(%rip), %rbx      # 0x8fd8
leaq 0x3345(%rip), %rsi      # 0x60c4
movl $0x17, %edx
movq %rbx, %rdi
callq 0x2220
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21e0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2100
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x620f(%rip), %rbx      # 0x8fd8
leaq 0x33db(%rip), %rsi      # 0x61ab
movl $0x17, %edx
movq %rbx, %rdi
callq 0x2220
movq %rbx, %rdi
callq 0x20b0
jmp 0x2db3