// File: cjlin1[P]liblinear/predict.c
// Function: main
int main(int argc, char **argv)
{
	FILE *input, *output;
	int i;

	// parse options
	for(i=1;i<argc;i++)
	{
		if(argv[i][0] != '-') break;
		++i;
		switch(argv[i-1][1])
		{
			case 'b':
				flag_predict_probability = atoi(argv[i]);
				break;
			case 'q':
				info = &print_null;
				i--;
				break;
			default:
				fprintf(stderr,"unknown option: -%c\n", argv[i-1][1]);
				exit_with_help();
				break;
		}
	}
	if(i>=argc)
		exit_with_help();

	input = fopen(argv[i],"r");
	if(input == NULL)
	{
		fprintf(stderr,"can't open input file %s\n",argv[i]);
		exit(1);
	}

	output = fopen(argv[i+2],"w");
	if(output == NULL)
	{
		fprintf(stderr,"can't open output file %s\n",argv[i+2]);
		exit(1);
	}

	if((model_=load_model(argv[i+1]))==0)
	{
		fprintf(stderr,"can't open model file %s\n",argv[i+1]);
		exit(1);
	}

	x = (struct feature_node *) malloc(max_nr_attr*sizeof(struct feature_node));
	do_predict(input, output);
	free_and_destroy_model(&model_);
	free(line);
	free(x);
	fclose(input);
	fclose(output);
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x1, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0x2d16
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
je 0x2c72
jmp 0x2d16
movl -0x24(%rbp), %eax
incl %eax
movl %eax, -0x24(%rbp)
movq -0x10(%rbp), %rax
movl -0x24(%rbp), %ecx
decl %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movsbl 0x1(%rax), %eax
movl %eax, -0x28(%rbp)
subl $0x62, %eax
je 0x2ca2
jmp 0x2c98
movl -0x28(%rbp), %eax
subl $0x71, %eax
je 0x2cbb
jmp 0x2cd4
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x21c0
movl %eax, 0x13597(%rip)     # 0x16250
jmp 0x2d06
leaq -0x942(%rip), %rax      # 0x2380
movq %rax, 0x1348f(%rip)     # 0x16158
movl -0x24(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x2d06
movq 0x13305(%rip), %rax     # 0x15fe0
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movl -0x24(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movsbl 0x1(%rax), %edx
leaq 0xf4dc(%rip), %rsi      # 0x121d6
movb $0x0, %al
callq 0x21b0
callq 0x2c10
jmp 0x2d08
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x2c4d
movl -0x24(%rbp), %eax
cmpl -0x8(%rbp), %eax
jl 0x2d23
callq 0x2c10
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xf4b5(%rip), %rsi      # 0x121eb
callq 0x2140
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x2d74
movq 0x13293(%rip), %rax     # 0x15fe0
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
leaq 0xf48a(%rip), %rsi      # 0x121ed
movb $0x0, %al
callq 0x21b0
movl $0x1, %edi
callq 0x2160
movq -0x10(%rbp), %rax
movl -0x24(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xf47b(%rip), %rsi      # 0x12207
callq 0x2140
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x2dcf
movq 0x1323d(%rip), %rax     # 0x15fe0
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movl -0x24(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdx
leaq 0xf44b(%rip), %rsi      # 0x12209
movb $0x0, %al
callq 0x21b0
movl $0x1, %edi
callq 0x2160
movq -0x10(%rbp), %rax
movl -0x24(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0xad60
movq %rax, 0x1345c(%rip)     # 0x16248
cmpq $0x0, %rax
jne 0x2e25
movq 0x131e7(%rip), %rax     # 0x15fe0
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movl -0x24(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdx
leaq 0xf410(%rip), %rsi      # 0x12224
movb $0x0, %al
callq 0x21b0
movl $0x1, %edi
callq 0x2160
movslq 0x13324(%rip), %rdi     # 0x16150
shlq $0x4, %rdi
callq 0x2180
movq %rax, 0x13404(%rip)     # 0x16240
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x23c0
leaq 0x133f8(%rip), %rdi     # 0x16248
callq 0x95d0
movq 0x133fc(%rip), %rdi     # 0x16258
callq 0x2150
movq 0x133d8(%rip), %rdi     # 0x16240
callq 0x2150
movq -0x18(%rbp), %rdi
callq 0x20f0
movq -0x20(%rbp), %rdi
callq 0x20f0
xorl %eax, %eax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)