// File: /workspace/github_c_makefile_star2_O2/GangZhuo[P]dohclient/src/config.c
// Function: conf_parse_args
int conf_parse_args(config_t *conf, int argc, char** argv)
{
	int ch;
	int option_index = 0;
	static struct option long_options[] = {
		{"daemon",       no_argument,       NULL, 1},
		{"pid",          required_argument, NULL, 2},
		{"log",          required_argument, NULL, 3},
		{"log-level",    required_argument, NULL, 4},
		{"config",       required_argument, NULL, 5},
		{"launch-log",   required_argument, NULL, 6},
		{"proxy",        required_argument, NULL, 7},
		{"chnroute",     required_argument, NULL, 8},
		{"channel",      required_argument, NULL, 9},
		{"channel-args", required_argument, NULL, 10},
		{"blacklist",    required_argument, NULL, 11},
		{"hosts",        required_argument, NULL, 12},
		{"cache-timeout",required_argument, NULL, 13},
		{"mode",         required_argument, NULL, 14},
		{"cache-api",    required_argument, NULL, 15},
		{"cache-db",     required_argument, NULL, 16},
		{"cache-autosave",required_argument, NULL,17},
		{"wwwroot",      required_argument, NULL, 18},
		{0, 0, 0, 0}
	};

	while ((ch = getopt_long(argc, argv, "hb:p:t:vV", long_options, &option_index)) != -1) {
		switch (ch) {
		case 1:
			conf->daemonize = 1;
			break;
		case 2:
			conf->pid_file = strdup(optarg);
			break;
		case 3:
			conf->log_file = strdup(optarg);
			break;
		case 4:
			conf->log_level = atoi(optarg);
			break;
		case 5:
			conf->config_file = strdup(optarg);
			break;
		case 6:
			conf->launch_log = strdup(optarg);
			break;
		case 7:
			conf->proxy = strdup(optarg);
			break;
		case 8:
			conf->chnroute = strdup(optarg);
			break;
		case 9:
			if (conf_add_channel(conf, optarg)) {
				return -1;
			}
			break;
		case 10:
			if (conf_add_channel_args(conf, optarg)) {
				return -1;
			}
			break;
		case 11:
			conf->blacklist = strdup(optarg);
			break;
		case 12:
			conf->hosts = strdup(optarg);
			break;
		case 13:
			conf->cache_timeout = atoi(optarg);
			break;
		case 14:
			conf->channel_choose_mode = atoi(optarg);
			break;
		case 15:
			conf->cache_api = strdup(optarg);
			break;
		case 16:
			conf->cachedb = strdup(optarg);
			break;
		case 17:
			conf->cachedb_autosave = strdup(optarg);
			break;
		case 18:
			conf->wwwroot = strdup(optarg);
			break;
		case 'h':
			conf->is_print_help = 1;
			break;
		case 'b':
			conf->listen_addr = strdup(optarg);
			break;
		case 'p':
			conf->listen_port = strdup(optarg);
			break;
		case 't':
			conf->timeout = atoi(optarg);
			break;
		case 'v':
			conf->log_level++;
			break;
		case 'V':
			conf->is_print_version = 1;
			break;
		default:
			return -1;
		}
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %r15
leaq 0x4(%rsp), %rax
andl $0x0, (%rax)
leaq 0xfcde(%rip), %r13      # 0x21a14
leaq 0x1c633(%rip), %rbx     # 0x2e370
leaq 0xfc00(%rip), %r12      # 0x21944
movl %ebp, %edi
movq %r14, %rsi
movq %r13, %rdx
movq %rbx, %rcx
leaq 0x4(%rsp), %r8
callq 0x35d0
leal 0x1(%rax), %ecx
cmpl $0x13, %ecx
ja 0x11d77
movslq (%r12,%rcx,4), %rax
addq %r12, %rax
jmpq *%rax
movl $0x1, 0x84(%r15)
jmp 0x11d44
cmpl $0x56, %eax
je 0x11f5d
cmpl $0x62, %eax
je 0x11fb0
cmpl $0x68, %eax
je 0x11f88
cmpl $0x70, %eax
je 0x11f98
cmpl $0x74, %eax
je 0x11f6d
cmpl $0x76, %eax
jne 0x11fc7
incl 0x90(%r15)
jmp 0x11d44
movq 0x1c20b(%rip), %rax     # 0x2dfc8
movq (%rax), %rdi
callq 0x3620
movq %rax, 0x40(%r15)
jmp 0x11d44
movq 0x1c1f3(%rip), %rax     # 0x2dfc8
movq (%rax), %rsi
movq %r15, %rdi
callq 0x11fdd
jmp 0x11ea5
movq 0x1c1dc(%rip), %rax     # 0x2dfc8
movq (%rax), %rdi
callq 0x3620
movq %rax, 0x30(%r15)
jmp 0x11d44
movq 0x1c1c4(%rip), %rax     # 0x2dfc8
movq (%rax), %rdi
callq 0x3580
movl %eax, 0x90(%r15)
jmp 0x11d44
movq 0x1c1a9(%rip), %rax     # 0x2dfc8
movq (%rax), %rdi
callq 0x3580
movl %eax, 0x8c(%r15)
jmp 0x11d44
movq 0x1c18e(%rip), %rax     # 0x2dfc8
movq (%rax), %rdi
callq 0x3620
movq %rax, 0x18(%r15)
jmp 0x11d44
movq 0x1c176(%rip), %rax     # 0x2dfc8
movq (%rax), %rdi
callq 0x3620
movq %rax, 0x10(%r15)
jmp 0x11d44
movq 0x1c15e(%rip), %rax     # 0x2dfc8
movq (%rax), %rdi
callq 0x3620
movq %rax, 0x28(%r15)
jmp 0x11d44
movq 0x1c146(%rip), %rax     # 0x2dfc8
movq (%rax), %rdi
callq 0x3620
movq %rax, 0x20(%r15)
jmp 0x11d44
movq 0x1c12e(%rip), %rax     # 0x2dfc8
movq (%rax), %rsi
movq %r15, %rdi
callq 0x12071
testl %eax, %eax
je 0x11d44
jmp 0x11fc7
movq 0x1c10f(%rip), %rax     # 0x2dfc8
movq (%rax), %rdi
callq 0x3620
movq %rax, 0x50(%r15)
jmp 0x11d44
movq 0x1c0f7(%rip), %rax     # 0x2dfc8
movq (%rax), %rdi
callq 0x3620
movq %rax, 0x68(%r15)
jmp 0x11d44
movq 0x1c0df(%rip), %rax     # 0x2dfc8
movq (%rax), %rdi
callq 0x3620
movq %rax, 0x38(%r15)
jmp 0x11d44
movq 0x1c0c7(%rip), %rax     # 0x2dfc8
movq (%rax), %rdi
callq 0x3620
movq %rax, 0x58(%r15)
jmp 0x11d44
movq 0x1c0af(%rip), %rax     # 0x2dfc8
movq (%rax), %rdi
callq 0x3620
movq %rax, 0x60(%r15)
jmp 0x11d44
movq 0x1c097(%rip), %rax     # 0x2dfc8
movq (%rax), %rdi
callq 0x3620
movq %rax, 0x48(%r15)
jmp 0x11d44
movq 0x1c07f(%rip), %rax     # 0x2dfc8
movq (%rax), %rdi
callq 0x3580
movl %eax, 0x80(%r15)
jmp 0x11d44
movl $0x1, 0x94(%r15)
jmp 0x11d44
movq 0x1c054(%rip), %rax     # 0x2dfc8
movq (%rax), %rdi
callq 0x3580
movl %eax, 0x88(%r15)
jmp 0x11d44
movl $0x1, 0x98(%r15)
jmp 0x11d44
movq 0x1c029(%rip), %rax     # 0x2dfc8
movq (%rax), %rdi
callq 0x3620
movq %rax, 0x8(%r15)
jmp 0x11d44
movq 0x1c011(%rip), %rax     # 0x2dfc8
movq (%rax), %rdi
callq 0x3620
movq %rax, (%r15)
jmp 0x11d44
pushq $-0x1
popq %rax
jmp 0x11fce
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq