// File: /workspace/github_c_makefile_star2_O1/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 0x1a56f(%rip), %r13     # 0x2d360
leaq 0x10b3c(%rip), %r12     # 0x23934
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
movl %ebp, %edi
movq %rbx, %rsi
leaq 0x10bfa(%rip), %rdx     # 0x23a04
movq %r13, %rcx
leaq 0x4(%rsp), %r8
callq 0x35c0
cmpl $0x55, %eax
jg 0x12e3d
incl %eax
cmpl $0x13, %eax
ja 0x13095
movslq (%r12,%rax,4), %rax
addq %r12, %rax
jmpq *%rax
movl $0x1, 0x84(%r14)
jmp 0x12dfe
cmpl $0x6f, %eax
jg 0x12e6a
cmpl $0x56, %eax
je 0x1306a
cmpl $0x62, %eax
je 0x13038
cmpl $0x68, %eax
jne 0x13095
movl $0x1, 0x98(%r14)
jmp 0x12dfe
cmpl $0x70, %eax
je 0x1307a
cmpl $0x74, %eax
je 0x1304f
cmpl $0x76, %eax
jne 0x13095
incl 0x90(%r14)
jmp 0x12dfe
movq 0x1a130(%rip), %rax     # 0x2cfc8
movq (%rax), %rdi
callq 0x3610
movq %rax, 0x68(%r14)
jmp 0x12dfe
movq 0x1a118(%rip), %rax     # 0x2cfc8
movq (%rax), %rdi
callq 0x3610
movq %rax, 0x58(%r14)
jmp 0x12dfe
movq 0x1a100(%rip), %rax     # 0x2cfc8
movq (%rax), %rdi
callq 0x3610
movq %rax, 0x38(%r14)
jmp 0x12dfe
movq 0x1a0e8(%rip), %rax     # 0x2cfc8
movq (%rax), %rdi
callq 0x3610
movq %rax, 0x20(%r14)
jmp 0x12dfe
movq 0x1a0d0(%rip), %rax     # 0x2cfc8
movq (%rax), %rdi
callq 0x3610
movq %rax, 0x18(%r14)
jmp 0x12dfe
movq 0x1a0b8(%rip), %rax     # 0x2cfc8
movq (%rax), %rdi
callq 0x3610
movq %rax, 0x10(%r14)
jmp 0x12dfe
movq 0x1a0a0(%rip), %rax     # 0x2cfc8
movq (%rax), %rdi
callq 0x3570
movl %eax, 0x90(%r14)
jmp 0x12dfe
movq 0x1a085(%rip), %rax     # 0x2cfc8
movq (%rax), %rsi
movq %r14, %rdi
callq 0x1314e
jmp 0x12ff8
movq 0x1a06e(%rip), %rax     # 0x2cfc8
movq (%rax), %rdi
callq 0x3610
movq %rax, 0x30(%r14)
jmp 0x12dfe
movq 0x1a056(%rip), %rax     # 0x2cfc8
movq (%rax), %rdi
callq 0x3570
movl %eax, 0x80(%r14)
jmp 0x12dfe
movq 0x1a03b(%rip), %rax     # 0x2cfc8
movq (%rax), %rdi
callq 0x3610
movq %rax, 0x40(%r14)
jmp 0x12dfe
movq 0x1a023(%rip), %rax     # 0x2cfc8
movq (%rax), %rdi
callq 0x3610
movq %rax, 0x28(%r14)
jmp 0x12dfe
movq 0x1a00b(%rip), %rax     # 0x2cfc8
movq (%rax), %rdi
callq 0x3610
movq %rax, 0x50(%r14)
jmp 0x12dfe
movq 0x19ff3(%rip), %rax     # 0x2cfc8
movq (%rax), %rdi
callq 0x3610
movq %rax, 0x48(%r14)
jmp 0x12dfe
movq 0x19fdb(%rip), %rax     # 0x2cfc8
movq (%rax), %rsi
movq %r14, %rdi
callq 0x130a7
testl %eax, %eax
je 0x12dfe
jmp 0x13095
movq 0x19fbc(%rip), %rax     # 0x2cfc8
movq (%rax), %rdi
callq 0x3610
movq %rax, 0x60(%r14)
jmp 0x12dfe
movq 0x19fa4(%rip), %rax     # 0x2cfc8
movq (%rax), %rdi
callq 0x3570
movl %eax, 0x8c(%r14)
jmp 0x12dfe
movq 0x19f89(%rip), %rax     # 0x2cfc8
movq (%rax), %rdi
callq 0x3610
movq %rax, (%r14)
jmp 0x12dfe
movq 0x19f72(%rip), %rax     # 0x2cfc8
movq (%rax), %rdi
callq 0x3570
movl %eax, 0x88(%r14)
jmp 0x12dfe
movl $0x1, 0x94(%r14)
jmp 0x12dfe
movq 0x19f47(%rip), %rax     # 0x2cfc8
movq (%rax), %rdi
callq 0x3610
movq %rax, 0x8(%r14)
jmp 0x12dfe
xorl %r15d, %r15d
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq