// File: /workspace/github_cpp_makefile_star2_O2/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 %rcx, 0x8(%rsp)
pushq $0x1
popq %rbx
movl %ebx, 0xec53(%rip)      # 0x111b8
movaps 0x9aa4(%rip), %xmm0     # 0xc010
movups %xmm0, 0xec75(%rip)     # 0x111e8
movaps 0x9aa6(%rip), %xmm0     # 0xc020
movups %xmm0, 0xec3f(%rip)     # 0x111c0
andl $0x0, 0xec48(%rip)      # 0x111d0
movl %ebx, 0xec72(%rip)      # 0x11200
andq $0x0, 0xec62(%rip)      # 0x111f8
movq %rdx, 0x20(%rsp)
andl $0x0, 0xec8e(%rip)      # 0x11230
movq %rsi, %r14
andl $0x0, 0xec8c(%rip)      # 0x11238
movl %edi, %ebp
andl $0x0, 0xec87(%rip)      # 0x1123c
movb $0x0, 0xec48(%rip)      # 0x11204
andl $0x0, 0xec7d(%rip)      # 0x11240
xorps %xmm0, %xmm0
andl $0x0, 0xec67(%rip)      # 0x11234
movups %xmm0, 0xec04(%rip)     # 0x111d8
movabsq $-0x4010000000000000, %rax # imm = 0xBFF0000000000000
movq %rax, 0xec63(%rip)      # 0x11248
movq $0x0, 0x18(%rsp)
movq $0x0, 0x10(%rsp)
movq $0x0, (%rsp)
cmpl %ebp, %ebx
jge 0x28fd
movslq %ebx, %r15
movq (%r14,%r15,8), %rax
cmpb $0x2d, (%rax)
jne 0x27ed
leal 0x1(%rbx), %r12d
cmpl %ebp, %r12d
jge 0x2906
movzbl 0x1(%rax), %eax
leal -0x6e(%rax), %ecx
movslq %r12d, %r13
cmpl $0x9, %ecx
ja 0x2659
leaq 0x9a16(%rip), %rdx      # 0xc050
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movq (%r14,%r13,8), %rdi
callq 0x21c0
movsd %xmm0, 0xeb9c(%rip)     # 0x111f0
jmp 0x27e2
cmpl $0x42, %eax
je 0x27b9
cmpl $0x43, %eax
je 0x27cc
cmpl $0x52, %eax
je 0x27d8
cmpl $0x63, %eax
je 0x279c
cmpl $0x65, %eax
jne 0x290b
movq (%r14,%r13,8), %rdi
callq 0x21c0
movsd %xmm0, 0xeb29(%rip)     # 0x111c0
jmp 0x27e2
movl %ebx, %r12d
leaq -0x2aa(%rip), %rax      # 0x23fc
movq %rax, (%rsp)
jmp 0x27e2
movq 0x10(%rsp), %rcx
leal 0x1(%rcx), %eax
movl %eax, 0xeb13(%rip)      # 0x111d0
movslq %ecx, %rax
leaq 0x4(,%rax,4), %rsi
movq 0x18(%rsp), %rdi
callq 0x2270
movq %rax, 0xeaff(%rip)      # 0x111d8
movq 0xeb00(%rip), %rdi      # 0x111e0
movslq 0xeae9(%rip), %rsi      # 0x111d0
shlq $0x3, %rsi
callq 0x2270
movq %rax, %rbx
movq %rax, 0xeae6(%rip)      # 0x111e0
movq (%r14,%r15,8), %rdi
addq $0x2, %rdi
callq 0x2240
movq 0xeaca(%rip), %rsi      # 0x111d8
movslq 0xeabb(%rip), %rcx      # 0x111d0
movq %rsi, 0x18(%rsp)
movl %eax, -0x4(%rsi,%rcx,4)
movq (%r14,%r13,8), %rdi
callq 0x21c0
movslq 0xeaa2(%rip), %rax      # 0x111d0
movq %rax, 0x10(%rsp)
movsd %xmm0, -0x8(%rbx,%rax,8)
jmp 0x27e2
movl $0x1, 0xeaf4(%rip)      # 0x1123c
movq (%r14,%r13,8), %rdi
callq 0x21c0
movsd %xmm0, 0xea8f(%rip)     # 0x111e8
jmp 0x27e2
movq (%r14,%r13,8), %rdi
callq 0x2240
movl %eax, 0xea4b(%rip)      # 0x111b8
movl $0x1, 0xeac9(%rip)      # 0x11240
jmp 0x27e2
movl $0x1, 0xeaad(%rip)      # 0x11230
movq (%r14,%r13,8), %rdi
callq 0x2240
movl %eax, 0xeab2(%rip)      # 0x11244
cmpl $0x1, %eax
jg 0x27e2
jmp 0x292b
movq (%r14,%r13,8), %rdi
callq 0x21c0
movsd %xmm0, 0xea1b(%rip)     # 0x111c8
movl $0x1, 0xea81(%rip)      # 0x11238
jmp 0x27e2
movq (%r14,%r13,8), %rdi
callq 0x21c0
movsd %xmm0, 0xea7e(%rip)     # 0x11248
jmp 0x27e2
movl $0x1, 0xea5e(%rip)      # 0x11234
jmp 0x27df
andl $0x0, 0xea21(%rip)      # 0x11200
movl %ebx, %r12d
incl %r12d
movl %r12d, %ebx
jmp 0x25ff
movq (%rsp), %rdi
callq 0xa3ae
movq (%r14,%r15,8), %rsi
movq 0x20(%rsp), %rdi
callq 0x2120
decl %ebp
cmpl %ebp, %ebx
jge 0x281b
movq 0x8(%r14,%r15,8), %rsi
movq 0x8(%rsp), %rdi
callq 0x2120
jmp 0x2848
movq (%r14,%r15,8), %rbx
pushq $0x2f
popq %rsi
movq %rbx, %rdi
callq 0x2160
leaq 0x1(%rax), %rdx
testq %rax, %rax
cmoveq %rbx, %rdx
leaq 0x9a6f(%rip), %rsi      # 0xc2ab
movq 0x8(%rsp), %rdi
xorl %eax, %eax
callq 0x2080
cmpl $0x0, 0xe9e5(%rip)      # 0x11234
je 0x288a
cmpl $0x0, 0xe9d8(%rip)      # 0x11230
jne 0x2864
movl $0x5, 0xe9e0(%rip)      # 0x11244
cmpl $0x0, 0xe9d5(%rip)      # 0x11240
je 0x28d5
movl 0xe945(%rip), %eax      # 0x111b8
cmpl $0xb, %eax
ja 0x294c
movl $0x805, %ecx            # imm = 0x805
btl %eax, %ecx
jae 0x294c
movsd 0xe92e(%rip), %xmm0     # 0x111c0
ucomisd 0x9796(%rip), %xmm0     # 0xc030
jb 0x28c6
movl 0xe916(%rip), %eax      # 0x111b8
cmpq $0x15, %rax
ja 0x28c6
movl $0x2038ff, %ecx         # imm = 0x2038FF
btl %eax, %ecx
jae 0x28c6
leaq 0x97bf(%rip), %rcx      # 0xc078
movsd (%rcx,%rax,8), %xmm0
movsd %xmm0, 0xe8fa(%rip)     # 0x111c0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xe704(%rip), %rax      # 0x10fe0
movq (%rax), %rcx
leaq 0x99ce(%rip), %rdi      # 0xc2b4
pushq $0x21
popq %rsi
pushq $0x1
popq %rdx
callq 0x22f0
movl $0x2, 0xe8bd(%rip)      # 0x111b8
jmp 0x288a
movq (%rsp), %rdi
callq 0xa3ae
callq 0x23fd
movsbl %al, %edx
movq 0xe6cb(%rip), %rax      # 0x10fe0
movq (%rax), %rdi
leaq 0x9977(%rip), %rsi      # 0xc296
xorl %eax, %eax
callq 0x2220
callq 0x23fd
movq 0xe6ae(%rip), %rax      # 0x10fe0
movq (%rax), %rcx
leaq 0x9934(%rip), %rdi      # 0xc270
pushq $0x25
popq %rsi
pushq $0x1
popq %rdx
callq 0x22f0
callq 0x23fd
movq 0xe68d(%rip), %rax      # 0x10fe0
movq (%rax), %rcx
leaq 0x9979(%rip), %rdi      # 0xc2d6
pushq $0x44
jmp 0x293e