// File: /workspace/github_cpp_makefile_star2_O3/cjlin1[P]liblinear/train.c
// Function: parse_command_line(int, char**, char*, char*)
void parse_command_line(int argc, char **argv, char *input_file_name, char *model_file_name)
{
	int i;
	void (*print_func)(const char*) = NULL;  // default printing to stdout

	// default values
	param.solver_type = L2R_L2LOSS_SVC_DUAL;
	param.C = 1;
	param.p = 0.1;
	param.nu = 0.5;
	param.eps = INF; // see setting below
	param.nr_weight = 0;
	param.regularize_bias = 1;
	param.weight_label = NULL;
	param.weight = NULL;
	param.init_sol = NULL;
	param.w_recalc = false;
	flag_cross_validation = 0;
	flag_C_specified = 0;
	flag_p_specified = 0;
	flag_solver_specified = 0;
	flag_find_parameters = 0;
	bias = -1;

	// parse options
	for(i=1;i<argc;i++)
	{
		if(argv[i][0] != '-') break;
		if(++i>=argc)
			exit_with_help();
		switch(argv[i-1][1])
		{
			case 's':
				param.solver_type = atoi(argv[i]);
				flag_solver_specified = 1;
				break;

			case 'c':
				param.C = atof(argv[i]);
				flag_C_specified = 1;
				break;

			case 'p':
				flag_p_specified = 1;
				param.p = atof(argv[i]);
				break;

			case 'n':
				param.nu = atof(argv[i]);
				break;

			case 'e':
				param.eps = atof(argv[i]);
				break;

			case 'B':
				bias = atof(argv[i]);
				break;

			case 'w':
				++param.nr_weight;
				param.weight_label = (int *) realloc(param.weight_label,sizeof(int)*param.nr_weight);
				param.weight = (double *) realloc(param.weight,sizeof(double)*param.nr_weight);
				param.weight_label[param.nr_weight-1] = atoi(&argv[i-1][2]);
				param.weight[param.nr_weight-1] = atof(argv[i]);
				break;

			case 'v':
				flag_cross_validation = 1;
				nr_fold = atoi(argv[i]);
				if(nr_fold < 2)
				{
					fprintf(stderr,"n-fold cross validation: n must >= 2\n");
					exit_with_help();
				}
				break;

			case 'q':
				print_func = &print_null;
				i--;
				break;

			case 'C':
				flag_find_parameters = 1;
				i--;
				break;

			case 'R':
				param.regularize_bias = 0;
				i--;
				break;

			default:
				fprintf(stderr,"unknown option: -%c\n", argv[i-1][1]);
				exit_with_help();
				break;
		}
	}

	set_print_string_function(print_func);

	// determine filenames
	if(i>=argc)
		exit_with_help();

	strcpy(input_file_name, argv[i]);

	if(i<argc-1)
		strcpy(model_file_name,argv[i+1]);
	else
	{
		char *p = strrchr(argv[i],'/');
		if(p==NULL)
			p = argv[i];
		else
			++p;
		sprintf(model_file_name,"%s.model",p);
	}

	// default solver for parameter selection is L2R_L2LOSS_SVC
	if(flag_find_parameters)
	{
		if(!flag_cross_validation)
			nr_fold = 5;
		if(!flag_solver_specified)
		{
			fprintf(stderr, "Solver not specified. Using -s 2\n");
			param.solver_type = L2R_L2LOSS_SVC;
		}
		else if(param.solver_type != L2R_LR && param.solver_type != L2R_L2LOSS_SVC && param.solver_type != L2R_L2LOSS_SVR)
		{
			fprintf(stderr, "Warm-start parameter search only available for -s 0, -s 2 and -s 11\n");
			exit_with_help();
		}
	}

	if(param.eps == INF)
	{
		switch(param.solver_type)
		{
			case L2R_LR:
			case L2R_L2LOSS_SVC:
				param.eps = 0.01;
				break;
			case L2R_L2LOSS_SVR:
				param.eps = 0.0001;
				break;
			case L2R_L2LOSS_SVC_DUAL:
			case L2R_L1LOSS_SVC_DUAL:
			case MCSVM_CS:
			case L2R_LR_DUAL:
				param.eps = 0.1;
				break;
			case L1R_L2LOSS_SVC:
			case L1R_LR:
				param.eps = 0.01;
				break;
			case L2R_L1LOSS_SVR_DUAL:
			case L2R_L2LOSS_SVR_DUAL:
				param.eps = 0.1;
				break;
			case ONECLASS_SVM:
				param.eps = 0.01;
				break;
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movl $0x1, %eax
movl %eax, 0x106e8(%rip)     # 0x131b8
movaps 0xb539(%rip), %xmm0     # 0xe010
movups %xmm0, 0x1070a(%rip)    # 0x131e8
movaps 0xb53b(%rip), %xmm0     # 0xe020
movups %xmm0, 0x106d4(%rip)    # 0x131c0
xorl %r12d, %r12d
movl %r12d, 0x106da(%rip)    # 0x131d0
movl %eax, 0x10704(%rip)     # 0x13200
movq $0x0, 0x106f1(%rip) # 0x131f8
movb $0x0, 0x106f6(%rip)     # 0x13204
xorps %xmm0, %xmm0
movups %xmm0, 0x106c0(%rip)    # 0x131d8
movl %r12d, 0x10711(%rip)    # 0x13230
movl %r12d, 0x10712(%rip)    # 0x13238
movl %r12d, 0x1070f(%rip)    # 0x1323c
movl %r12d, 0x1070c(%rip)    # 0x13240
movl %r12d, 0x106f9(%rip)    # 0x13234
movabsq $-0x4010000000000000, %rsi # imm = 0xBFF0000000000000
movq %rsi, 0x106fc(%rip)     # 0x13248
cmpl $0x2, %edi
jl 0x2e7a
movl %edi, %ebp
movq %rdx, 0x20(%rsp)
movq %rcx, 0x10(%rsp)
leaq 0xb4e8(%rip), %rbx      # 0xe050
movq $0x0, 0x18(%rsp)
movq $0x0, 0x8(%rsp)
movslq %eax, %r15
movq (%r14,%r15,8), %rcx
cmpb $0x2d, (%rcx)
jne 0x2d7d
leal 0x1(%rax), %r13d
cmpl %ebp, %r13d
jge 0x2e8d
movzbl 0x1(%rcx), %edi
cmpl $0x62, %edi
jle 0x2bc7
leal -0x6e(%rdi), %ecx
cmpl $0x9, %ecx
ja 0x2c1d
movslq (%rbx,%rcx,4), %rcx
addq %rbx, %rcx
jmpq *%rcx
movslq %r13d, %rax
movq (%r14,%rax,8), %rdi
callq 0x21c0
movsd %xmm0, 0x1062b(%rip)    # 0x131f0
jmp 0x2c09
cmpl $0x42, %edi
je 0x2be6
cmpl $0x43, %edi
je 0x2bfc
cmpl $0x52, %edi
jne 0x2e70
movl $0x0, 0x1061c(%rip)     # 0x13200
jmp 0x2c06
movslq %r13d, %rax
movq (%r14,%rax,8), %rdi
callq 0x21c0
movsd %xmm0, 0x1064e(%rip)    # 0x13248
jmp 0x2c09
movl $0x1, 0x1062e(%rip)     # 0x13234
movl %eax, %r13d
incl %r13d
movl %r13d, %eax
cmpl %ebp, %r13d
jl 0x2b7a
jmp 0x2e83
cmpl $0x63, %edi
je 0x2d5a
cmpl $0x65, %edi
jne 0x2e70
movslq %r13d, %rax
movq (%r14,%rax,8), %rdi
callq 0x21c0
movsd %xmm0, 0x1057d(%rip)    # 0x131c0
jmp 0x2c09
leal 0x1(%r12), %eax
movl %eax, 0x10580(%rip)     # 0x131d0
movslq %r12d, %rax
leaq 0x4(,%rax,4), %rsi
movq 0x18(%rsp), %rdi
callq 0x2270
movq %rax, 0x1056c(%rip)     # 0x131d8
movq 0x1056d(%rip), %rdi     # 0x131e0
movslq 0x10556(%rip), %rsi     # 0x131d0
shlq $0x3, %rsi
callq 0x2270
movq %rbx, %r12
movq %rax, %rbx
movq %rax, 0x10550(%rip)     # 0x131e0
movq (%r14,%r15,8), %rdi
addq $0x2, %rdi
callq 0x2240
movq 0x10534(%rip), %rsi     # 0x131d8
movslq 0x10525(%rip), %rcx     # 0x131d0
movq %rsi, 0x18(%rsp)
movl %eax, -0x4(%rsi,%rcx,4)
movslq %r13d, %rax
movq (%r14,%rax,8), %rdi
callq 0x21c0
movslq 0x10509(%rip), %rax     # 0x131d0
movsd %xmm0, -0x8(%rbx,%rax,8)
movq %r12, %rbx
movq %rax, %r12
jmp 0x2c09
movl $0x1, 0x1054e(%rip)     # 0x13230
movslq %r13d, %rax
movq (%r14,%rax,8), %rdi
callq 0x2240
movl %eax, 0x10550(%rip)     # 0x13244
cmpl $0x1, %eax
jg 0x2c09
jmp 0x2e75
movslq %r13d, %rax
movq (%r14,%rax,8), %rdi
callq 0x2240
movl %eax, 0x104a4(%rip)     # 0x131b8
movl $0x1, 0x10522(%rip)     # 0x13240
jmp 0x2c09
movl %eax, %r13d
leaq -0x3a1(%rip), %rax      # 0x298c
movq %rax, 0x8(%rsp)
jmp 0x2c09
movl $0x1, 0x104fb(%rip)     # 0x1323c
movslq %r13d, %rax
movq (%r14,%rax,8), %rdi
callq 0x21c0
movsd %xmm0, 0x10493(%rip)    # 0x131e8
jmp 0x2c09
movslq %r13d, %rax
movq (%r14,%rax,8), %rdi
callq 0x21c0
movsd %xmm0, 0x1045a(%rip)    # 0x131c8
movl $0x1, 0x104c0(%rip)     # 0x13238
jmp 0x2c09
movq 0x8(%rsp), %rdi
callq 0xbd13
movq (%r14,%r15,8), %rsi
movq 0x20(%rsp), %rdi
callq 0x2130
decl %ebp
cmpl %ebp, %r15d
jge 0x2dad
movq 0x8(%r14,%r15,8), %rsi
movq 0x10(%rsp), %rdi
callq 0x2130
jmp 0x2ddc
movq (%r14,%r15,8), %rbx
movq %rbx, %rdi
movl $0x2f, %esi
callq 0x2160
leaq 0x1(%rax), %rdx
testq %rax, %rax
cmoveq %rbx, %rdx
leaq 0xb4db(%rip), %rsi      # 0xe2ab
movq 0x10(%rsp), %rdi
xorl %eax, %eax
callq 0x2080
cmpl $0x0, 0x10451(%rip)     # 0x13234
je 0x2e1e
cmpl $0x0, 0x10444(%rip)     # 0x13230
jne 0x2df8
movl $0x5, 0x1044c(%rip)     # 0x13244
cmpl $0x0, 0x10441(%rip)     # 0x13240
je 0x2e69
movl 0x103b1(%rip), %eax     # 0x131b8
cmpl $0xb, %eax
ja 0x2ea3
movl $0x805, %ecx            # imm = 0x805
btl %eax, %ecx
jae 0x2ea3
movsd 0x1039a(%rip), %xmm0    # 0x131c0
ucomisd 0xb202(%rip), %xmm0     # 0xe030
jb 0x2e5a
movl 0x10382(%rip), %eax     # 0x131b8
cmpq $0x15, %rax
ja 0x2e5a
movl $0x2038ff, %ecx         # imm = 0x2038FF
btl %eax, %ecx
jae 0x2e5a
leaq 0xb22b(%rip), %rcx      # 0xe078
movsd (%rcx,%rax,8), %xmm0
movsd %xmm0, 0x10366(%rip)    # 0x131c0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x2389
jmp 0x2e1e
callq 0x23e6
callq 0x23b5
movq $0x0, 0x8(%rsp)
movq 0x8(%rsp), %rdi
callq 0xbd13
leaq 0xb4ac(%rip), %rdi      # 0xe340
callq 0x2230
movl $0x1, %edi
callq 0x21b0
callq 0x2358