// File: /workspace/github_cpp_makefile_star2_O2/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 $0x48, %rsp
movq %rdi, 0x10(%rsp)
cmpl $0x2, %esi
jge 0x24ed
movq 0x6b0d(%rip), %rdi      # 0x8fd8
leaq 0x3bfa(%rip), %rsi      # 0x60cc
callq 0x21a0
movq %rax, %rdi
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x20a0
movq %rdx, %rbx
movl %esi, %ecx
movl %esi, %eax
movq %rax, 0x20(%rsp)
pushq $0x1
popq %r12
leaq 0x28(%rsp), %r15
leaq 0xf(%rsp), %rbp
movl %esi, 0x1c(%rsp)
cmpq 0x20(%rsp), %r12
jae 0x2acd
movq (%rbx,%r12,8), %rsi
cmpb $0x2d, (%rsi)
jne 0x2acd
leaq 0x1(%r12), %r14
cmpl %ecx, %r14d
jge 0x2ab2
movq %r15, %rdi
movq %rbp, %rdx
callq 0x35b4
movq %r15, %rdi
leaq 0x3bb6(%rip), %rsi      # 0x60fc
callq 0x35a6
movl %eax, %r13d
movq %r15, %rdi
callq 0x2080
testb %r13b, %r13b
je 0x2571
movq 0x8(%rbx,%r12,8), %rdi
callq 0x2280
movq 0x10(%rsp), %rcx
movl %eax, (%rcx)
jmp 0x2a9e
movq (%rbx,%r12,8), %rsi
movq %r15, %rdi
movq %rbp, %rdx
callq 0x35b4
movq %r15, %rdi
leaq 0x3b7d(%rip), %rsi      # 0x6107
callq 0x35a6
movl %eax, %r13d
movq %r15, %rdi
callq 0x2080
testb %r13b, %r13b
je 0x25b6
movq 0x8(%rbx,%r12,8), %rdi
callq 0x2280
movq 0x10(%rsp), %rcx
movl %eax, 0x4(%rcx)
jmp 0x2a9e
movq (%rbx,%r12,8), %rsi
movq %r15, %rdi
movq %rbp, %rdx
callq 0x35b4
movq %r15, %rdi
leaq 0x3b44(%rip), %rsi      # 0x6113
callq 0x35a6
movl %eax, %r13d
movq %r15, %rdi
callq 0x2080
testb %r13b, %r13b
je 0x25fd
movq 0x8(%rbx,%r12,8), %rdi
callq 0x2200
movq 0x10(%rsp), %rax
movsd %xmm0, 0x8(%rax)
jmp 0x2a9e
movq (%rbx,%r12,8), %rsi
movq %r15, %rdi
movq %rbp, %rdx
callq 0x35b4
movq %r15, %rdi
leaq 0x3b04(%rip), %rsi      # 0x611a
callq 0x35a6
movl %eax, %r13d
movq %r15, %rdi
callq 0x2080
testb %r13b, %r13b
je 0x2644
movq 0x8(%rbx,%r12,8), %rdi
callq 0x2200
movq 0x10(%rsp), %rax
movsd %xmm0, 0x10(%rax)
jmp 0x2a9e
movq (%rbx,%r12,8), %rsi
movq %r15, %rdi
movq %rbp, %rdx
callq 0x35b4
movq %r15, %rdi
leaq 0x3ac0(%rip), %rsi      # 0x611d
callq 0x35a6
movl %eax, %r13d
movq %r15, %rdi
callq 0x2080
testb %r13b, %r13b
je 0x2689
movq 0x8(%rbx,%r12,8), %rdi
callq 0x2280
movq 0x10(%rsp), %rcx
movl %eax, 0x34(%rcx)
jmp 0x2a9e
movq (%rbx,%r12,8), %rsi
movq %r15, %rdi
movq %rbp, %rdx
callq 0x35b4
movq %r15, %rdi
leaq 0x3a8b(%rip), %rsi      # 0x612d
callq 0x35a6
movl %eax, %r13d
movq %r15, %rdi
callq 0x2080
testb %r13b, %r13b
je 0x26ce
movq 0x8(%rbx,%r12,8), %rdi
callq 0x2280
movq 0x10(%rsp), %rcx
movl %eax, 0x38(%rcx)
jmp 0x2a9e
movq (%rbx,%r12,8), %rsi
movq %r15, %rdi
movq %rbp, %rdx
callq 0x35b4
movq %r15, %rdi
leaq 0x3a56(%rip), %rsi      # 0x613d
callq 0x35a6
movl %eax, %r13d
movq %r15, %rdi
callq 0x2080
testb %r13b, %r13b
je 0x2713
movq 0x8(%rbx,%r12,8), %rdi
callq 0x2280
movq 0x10(%rsp), %rcx
movl %eax, 0x20(%rcx)
jmp 0x2a9e
movq (%rbx,%r12,8), %rsi
movq %r15, %rdi
movq %rbp, %rdx
callq 0x35b4
movq %r15, %rdi
leaq 0x3a23(%rip), %rsi      # 0x614f
callq 0x35a6
movl %eax, %r13d
movq %r15, %rdi
callq 0x2080
testb %r13b, %r13b
je 0x2758
movq 0x8(%rbx,%r12,8), %rdi
callq 0x2280
movq 0x10(%rsp), %rcx
movl %eax, 0x24(%rcx)
jmp 0x2a9e
movq (%rbx,%r12,8), %rsi
movq %r15, %rdi
movq %rbp, %rdx
callq 0x35b4
movq %r15, %rdi
leaq 0x39ed(%rip), %rsi      # 0x615e
callq 0x35a6
movl %eax, %r13d
movq %r15, %rdi
callq 0x2080
testb %r13b, %r13b
je 0x279d
movq 0x8(%rbx,%r12,8), %rdi
callq 0x2280
movq 0x10(%rsp), %rcx
movl %eax, 0x3c(%rcx)
jmp 0x2a9e
movq (%rbx,%r12,8), %rsi
movq %r15, %rdi
movq %rbp, %rdx
callq 0x35b4
movq %r15, %rdi
leaq 0x39b6(%rip), %rsi      # 0x616c
callq 0x35a6
movl %eax, %r13d
movq %r15, %rdi
callq 0x2080
testb %r13b, %r13b
je 0x27e2
movq 0x8(%rbx,%r12,8), %rdi
callq 0x2280
movq 0x10(%rsp), %rcx
movl %eax, 0x40(%rcx)
jmp 0x2a9e
movq (%rbx,%r12,8), %rsi
movq %r15, %rdi
movq %rbp, %rdx
callq 0x35b4
movq %r15, %rdi
leaq 0x397f(%rip), %rsi      # 0x617a
callq 0x35a6
movl %eax, %r13d
movq %r15, %rdi
callq 0x2080
testb %r13b, %r13b
je 0x2827
movq 0x8(%rbx,%r12,8), %rdi
callq 0x2280
movq 0x10(%rsp), %rcx
movl %eax, 0x6c(%rcx)
jmp 0x2a9e
movq (%rbx,%r12,8), %rsi
movq %r15, %rdi
movq %rbp, %rdx
callq 0x35b4
movq %r15, %rdi
leaq 0x3946(%rip), %rsi      # 0x6186
callq 0x35a6
movl %eax, %r13d
movq %r15, %rdi
callq 0x2080
testb %r13b, %r13b
je 0x286c
movq 0x8(%rbx,%r12,8), %rdi
callq 0x2280
movq 0x10(%rsp), %rcx
movl %eax, 0x2c(%rcx)
jmp 0x2a9e
movq (%rbx,%r12,8), %rsi
movq %r15, %rdi
movq %rbp, %rdx
callq 0x35b4
movq %r15, %rdi
leaq 0x3908(%rip), %rsi      # 0x618d
callq 0x35a6
movl %eax, %r13d
movq %r15, %rdi
callq 0x2080
testb %r13b, %r13b
je 0x28b1
movq 0x8(%rbx,%r12,8), %rdi
callq 0x2280
movq 0x10(%rsp), %rcx
movl %eax, 0x68(%rcx)
jmp 0x2a9e
movq (%rbx,%r12,8), %rsi
movq %r15, %rdi
movq %rbp, %rdx
callq 0x35b4
movq %r15, %rdi
leaq 0x38c9(%rip), %rsi      # 0x6193
callq 0x35a6
movl %eax, %r13d
movq %r15, %rdi
callq 0x2080
testb %r13b, %r13b
je 0x28f8
movq 0x8(%rbx,%r12,8), %rdi
callq 0x2200
movq 0x10(%rsp), %rax
movsd %xmm0, 0x50(%rax)
jmp 0x2a9e
movq (%rbx,%r12,8), %rsi
movq %r15, %rdi
movq %rbp, %rdx
callq 0x35b4
movq %r15, %rdi
leaq 0x3889(%rip), %rsi      # 0x619a
callq 0x35a6
movl %eax, %r13d
movq %r15, %rdi
callq 0x2080
testb %r13b, %r13b
je 0x293f
movq 0x8(%rbx,%r12,8), %rdi
callq 0x2200
movq 0x10(%rsp), %rax
movsd %xmm0, 0x58(%rax)
jmp 0x2a9e
movq (%rbx,%r12,8), %rsi
movq %r15, %rdi
movq %rbp, %rdx
callq 0x35b4
movq %r15, %rdi
leaq 0x384a(%rip), %rsi      # 0x61a2
callq 0x35a6
movl %eax, %r13d
movq %r15, %rdi
callq 0x2080
testb %r13b, %r13b
je 0x2986
movq 0x8(%rbx,%r12,8), %rdi
callq 0x2200
movq 0x10(%rsp), %rax
movsd %xmm0, 0x48(%rax)
jmp 0x2a9e
movq (%rbx,%r12,8), %rsi
movq %r15, %rdi
leaq 0xf(%rsp), %rdx
callq 0x35b4
movq %r15, %rdi
leaq 0x380a(%rip), %rsi      # 0x61ab
callq 0x35a6
movl %eax, %r13d
movq %r15, %rdi
callq 0x2080
testb %r13b, %r13b
je 0x29cf
movq 0x8(%rbx,%r12,8), %rdi
callq 0x2200
movq 0x10(%rsp), %rax
movsd %xmm0, 0x18(%rax)
jmp 0x2a9e
movq (%rbx,%r12,8), %rsi
movq %r15, %rdi
leaq 0xf(%rsp), %rdx
callq 0x35b4
movq %r15, %rdi
leaq 0x37c8(%rip), %rsi      # 0x61b2
callq 0x35a6
movl %eax, %r13d
movq %r15, %rdi
callq 0x2080
testb %r13b, %r13b
je 0x2a18
movq 0x8(%rbx,%r12,8), %rdi
callq 0x2200
movq 0x10(%rsp), %rax
movsd %xmm0, 0x60(%rax)
jmp 0x2a9e
movq (%rbx,%r12,8), %rsi
movq %r15, %rdi
leaq 0xf(%rsp), %rdx
callq 0x35b4
movq %r15, %rdi
leaq 0x3788(%rip), %rsi      # 0x61bb
callq 0x35a6
movl %eax, %r13d
movq %r15, %rdi
callq 0x2080
testb %r13b, %r13b
je 0x2a5c
movq 0x8(%rbx,%r12,8), %rdi
callq 0x2280
movq 0x10(%rsp), %rcx
movl %eax, 0x28(%rcx)
jmp 0x2a9e
movq (%rbx,%r12,8), %rsi
movq %r15, %rdi
leaq 0xf(%rsp), %rdx
callq 0x35b4
movq %r15, %rdi
leaq 0x374a(%rip), %rsi      # 0x61c1
callq 0x35a6
movl %eax, %r13d
movq %r15, %rdi
callq 0x2080
testb %r13b, %r13b
je 0x2adc
movq 0x8(%rbx,%r12,8), %rdi
callq 0x2280
movq 0x10(%rsp), %rcx
movl %eax, 0x30(%rcx)
incq %r14
movq %r14, %r12
leaq 0xf(%rsp), %rbp
movl 0x1c(%rsp), %ecx
jmp 0x250b
movq 0x651f(%rip), %rdi      # 0x8fd8
leaq 0x3624(%rip), %rsi      # 0x60e4
callq 0x21a0
movq %rax, %rdi
callq 0x20a0
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x64f5(%rip), %rdi      # 0x8fd8
leaq 0x36e1(%rip), %rsi      # 0x61cb
jmp 0x2ac0