// File: /workspace/github_c_makefile_star2_O2/zuocheng-liu[P]ae-memcached/src/settings.c
// Function: process_arguments
u_int32_t process_arguments(struct settings *settings, int argc, char **argv) {
    int c;
    struct in_addr addr;
    while ((c = getopt(argc, argv, "bp:s:U:m:Mc:khirvdl:u:P:f:s:")) != -1) {
        switch (c) {
            case 'U':
                settings->udpport = atoi(optarg);
                break;
            case 'b':
                settings->managed = 1;
                break;
            case 'p':
                settings->port = atoi(optarg);
                break;
            case 's':
                settings->socketpath = optarg;
                break;
            case 'm':
                settings->maxbytes = ((size_t)atoi(optarg))*1024*1024;
                break;
            case 'M':
                settings->evict_to_free = 0;
                break;
            case 'c':
                settings->maxconns = atoi(optarg);
                break;
            case 'h':
                usage();
                exit(0);
            case 'i':
                usage_license();
                exit(0);
            case 'k':
                settings->lock_memory = 1;
                break;
            case 'v':
                settings->verbose++;
                break;
            case 'l':
                if (!inet_pton(AF_INET, optarg, &addr)) {
                    fprintf(stderr, "Illegal address: %s\n", optarg);
                    return 1;
                } else {
                    settings->interface = addr;
                }
                break;
            case 'd':
                settings->daemonize = 1;
                break;
            case 'r':
                settings->maxcore = 1;
                break;
            case 'u':
                settings->username = optarg;
                break;
            case 'P':
                settings->pid_file = optarg;
                break;
            case 'f':
                settings->factor = atof(optarg);
                if (settings->factor <= 1.0) {
                    fprintf(stderr, "Factor must be greater than 1\n");
                    return 1;
                }
                break;
            case 'n':
                settings->chunk_size = atoi(optarg);
                if (settings->chunk_size == 0) {
                    fprintf(stderr, "Chunk size must be greater than 0\n");
                    return 1;
                }
                break;
            default:
                fprintf(stderr, "Illegal argument \"%c\"\n", c);
                return 1;
        }
    }
    return 1;
}

// 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 0x206e(%rip), %r15      # 0x8e30
leaq 0x1fbf(%rip), %r13      # 0x8d88
movq 0x6208(%rip), %r12      # 0xcfd8
movl %ebp, %edi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x23c0
leal -0x4d(%rax), %ecx
cmpl $0x29, %ecx
ja 0x6f0f
movslq (%r13,%rcx,4), %rcx
addq %r13, %rcx
jmpq *%rcx
andl $0x0, 0x24(%r14)
jmp 0x6dd0
incl 0x18(%r14)
jmp 0x6dd0
movq (%r12), %rax
movq %rax, 0x28(%r14)
jmp 0x6dd0
movq (%r12), %rdi
callq 0x23e0
movl %eax, 0xc(%r14)
jmp 0x6dd0
movl $0x1, 0x40(%r14)
jmp 0x6dd0
movq (%r12), %rdi
callq 0x23e0
movl %eax, 0x10(%r14)
jmp 0x6dd0
movq (%r12), %rax
movq %rax, 0x50(%r14)
jmp 0x6dd0
movq (%r12), %rdi
callq 0x20e0
movsd %xmm0, 0x30(%r14)
movsd 0x1f2d(%rip), %xmm1     # 0x8d80
ucomisd %xmm0, %xmm1
jb 0x6dd0
jmp 0x6f42
movl $0x1, 0x3c(%r14)
jmp 0x6dd0
movq (%r12), %rdi
callq 0x23e0
cltq
shlq $0x14, %rax
movq %rax, (%r14)
jmp 0x6dd0
movq (%r12), %rsi
pushq $0x2
popq %rdi
leaq 0x4(%rsp), %rdx
callq 0x2290
testl %eax, %eax
je 0x6f60
movl 0x4(%rsp), %eax
movl %eax, 0x14(%r14)
jmp 0x6dd0
movl $0x1, 0x20(%r14)
jmp 0x6dd0
movq (%r12), %rdi
callq 0x23e0
movl %eax, 0x8(%r14)
jmp 0x6dd0
movl $0x1, 0x44(%r14)
jmp 0x6dd0
movq (%r12), %rax
movq %rax, 0x48(%r14)
jmp 0x6dd0
movq (%r12), %rdi
callq 0x23e0
movl %eax, 0x38(%r14)
testl %eax, %eax
jne 0x6dd0
movq 0x60f7(%rip), %rax      # 0xcff8
movq (%rax), %rcx
leaq 0x1f76(%rip), %rdi      # 0x8e81
pushq $0x22
jmp 0x6f55
cmpl $-0x1, %eax
jne 0x6f26
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x60cb(%rip), %rcx      # 0xcff8
movq (%rcx), %rdi
leaq 0x1f6d(%rip), %rsi      # 0x8ea4
movl %eax, %edx
xorl %eax, %eax
callq 0x2260
jmp 0x6f14
movq 0x60af(%rip), %rax      # 0xcff8
movq (%rax), %rcx
leaq 0x1f0f(%rip), %rdi      # 0x8e62
pushq $0x1e
popq %rsi
pushq $0x1
popq %rdx
callq 0x2420
jmp 0x6f14
movq 0x6091(%rip), %rax      # 0xcff8
movq (%rax), %rdi
movq (%r12), %rdx
leaq 0x1ed8(%rip), %rsi      # 0x8e4d
xorl %eax, %eax
callq 0x2260
jmp 0x6f14
callq 0x7077
jmp 0x6f8a
callq 0x6f91
xorl %edi, %edi
callq 0x2410