// File: /workspace/github_c_makefile_star2_O3/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, %rbx
movl %esi, %ebp
movq %rdi, %r14
leaq 0x4(%rsp), %rax
movl $0x0, (%rax)
leaq 0x1aadb(%rip), %r13     # 0x2d360
leaq 0x110b8(%rip), %r12     # 0x23944
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
movl %ebp, %edi
movq %rbx, %rsi
leaq 0x11176(%rip), %rdx     # 0x23a14
movq %r13, %rcx
leaq 0x4(%rsp), %r8
callq 0x35c0
cmpl $0x55, %eax
jg 0x128d1
incl %eax
cmpl $0x13, %eax
ja 0x12b29
movslq (%r12,%rax,4), %rax
addq %r12, %rax
jmpq *%rax
movl $0x1, 0x84(%r14)
jmp 0x12892
cmpl $0x6f, %eax
jg 0x128fe
cmpl $0x56, %eax
je 0x12afe
cmpl $0x62, %eax
je 0x12acc
cmpl $0x68, %eax
jne 0x12b29
movl $0x1, 0x98(%r14)
jmp 0x12892
cmpl $0x70, %eax
je 0x12b0e
cmpl $0x74, %eax
je 0x12ae3
cmpl $0x76, %eax
jne 0x12b29
incl 0x90(%r14)
jmp 0x12892
movq 0x1a69c(%rip), %rax     # 0x2cfc8
movq (%rax), %rdi
callq 0x3610
movq %rax, 0x68(%r14)
jmp 0x12892
movq 0x1a684(%rip), %rax     # 0x2cfc8
movq (%rax), %rdi
callq 0x3610
movq %rax, 0x58(%r14)
jmp 0x12892
movq 0x1a66c(%rip), %rax     # 0x2cfc8
movq (%rax), %rdi
callq 0x3610
movq %rax, 0x38(%r14)
jmp 0x12892
movq 0x1a654(%rip), %rax     # 0x2cfc8
movq (%rax), %rdi
callq 0x3610
movq %rax, 0x20(%r14)
jmp 0x12892
movq 0x1a63c(%rip), %rax     # 0x2cfc8
movq (%rax), %rdi
callq 0x3610
movq %rax, 0x18(%r14)
jmp 0x12892
movq 0x1a624(%rip), %rax     # 0x2cfc8
movq (%rax), %rdi
callq 0x3610
movq %rax, 0x10(%r14)
jmp 0x12892
movq 0x1a60c(%rip), %rax     # 0x2cfc8
movq (%rax), %rdi
callq 0x3570
movl %eax, 0x90(%r14)
jmp 0x12892
movq 0x1a5f1(%rip), %rax     # 0x2cfc8
movq (%rax), %rsi
movq %r14, %rdi
callq 0x12be2
jmp 0x12a8c
movq 0x1a5da(%rip), %rax     # 0x2cfc8
movq (%rax), %rdi
callq 0x3610
movq %rax, 0x30(%r14)
jmp 0x12892
movq 0x1a5c2(%rip), %rax     # 0x2cfc8
movq (%rax), %rdi
callq 0x3570
movl %eax, 0x80(%r14)
jmp 0x12892
movq 0x1a5a7(%rip), %rax     # 0x2cfc8
movq (%rax), %rdi
callq 0x3610
movq %rax, 0x40(%r14)
jmp 0x12892
movq 0x1a58f(%rip), %rax     # 0x2cfc8
movq (%rax), %rdi
callq 0x3610
movq %rax, 0x28(%r14)
jmp 0x12892
movq 0x1a577(%rip), %rax     # 0x2cfc8
movq (%rax), %rdi
callq 0x3610
movq %rax, 0x50(%r14)
jmp 0x12892
movq 0x1a55f(%rip), %rax     # 0x2cfc8
movq (%rax), %rdi
callq 0x3610
movq %rax, 0x48(%r14)
jmp 0x12892
movq 0x1a547(%rip), %rax     # 0x2cfc8
movq (%rax), %rsi
movq %r14, %rdi
callq 0x12b3b
testl %eax, %eax
je 0x12892
jmp 0x12b29
movq 0x1a528(%rip), %rax     # 0x2cfc8
movq (%rax), %rdi
callq 0x3610
movq %rax, 0x60(%r14)
jmp 0x12892
movq 0x1a510(%rip), %rax     # 0x2cfc8
movq (%rax), %rdi
callq 0x3570
movl %eax, 0x8c(%r14)
jmp 0x12892
movq 0x1a4f5(%rip), %rax     # 0x2cfc8
movq (%rax), %rdi
callq 0x3610
movq %rax, (%r14)
jmp 0x12892
movq 0x1a4de(%rip), %rax     # 0x2cfc8
movq (%rax), %rdi
callq 0x3570
movl %eax, 0x88(%r14)
jmp 0x12892
movl $0x1, 0x94(%r14)
jmp 0x12892
movq 0x1a4b3(%rip), %rax     # 0x2cfc8
movq (%rax), %rdi
callq 0x3610
movq %rax, 0x8(%r14)
jmp 0x12892
xorl %r15d, %r15d
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq