// File: /workspace/github_c_makefile_star2_O1/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 0x157f(%rip), %r15      # 0x8e70
leaq 0x14d0(%rip), %r13      # 0x8dc8
movq 0x56d9(%rip), %r12      # 0xcfd8
movl %ebp, %edi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x23c0
leal -0x4d(%rax), %ecx
cmpl $0x29, %ecx
ja 0x7a35
movslq (%r13,%rcx,4), %rcx
addq %r13, %rcx
jmpq *%rcx
movl $0x0, 0x24(%r14)
jmp 0x78ff
incl 0x18(%r14)
jmp 0x78ff
movq (%r12), %rax
movq %rax, 0x28(%r14)
jmp 0x78ff
movq (%r12), %rdi
callq 0x23e0
movl %eax, 0xc(%r14)
jmp 0x78ff
movl $0x1, 0x40(%r14)
jmp 0x78ff
movq (%r12), %rdi
callq 0x23e0
movl %eax, 0x10(%r14)
jmp 0x78ff
movq (%r12), %rax
movq %rax, 0x50(%r14)
jmp 0x78ff
movq (%r12), %rdi
callq 0x20e0
movsd %xmm0, 0x30(%r14)
movsd 0x143b(%rip), %xmm1     # 0x8dc0
ucomisd %xmm0, %xmm1
jb 0x78ff
jmp 0x7a6a
movl $0x1, 0x3c(%r14)
jmp 0x78ff
movq (%r12), %rdi
callq 0x23e0
cltq
shlq $0x14, %rax
movq %rax, (%r14)
jmp 0x78ff
movq (%r12), %rsi
movl $0x2, %edi
leaq 0x4(%rsp), %rdx
callq 0x2290
testl %eax, %eax
je 0x7a71
movl 0x4(%rsp), %eax
movl %eax, 0x14(%r14)
jmp 0x78ff
movl $0x1, 0x20(%r14)
jmp 0x78ff
movq (%r12), %rdi
callq 0x23e0
movl %eax, 0x8(%r14)
jmp 0x78ff
movl $0x1, 0x44(%r14)
jmp 0x78ff
movq (%r12), %rax
movq %rax, 0x48(%r14)
jmp 0x78ff
movq (%r12), %rdi
callq 0x23e0
movl %eax, 0x38(%r14)
testl %eax, %eax
jne 0x78ff
callq 0x294d
jmp 0x7a3a
cmpl $-0x1, %eax
jne 0x7a4e
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x55a3(%rip), %rcx      # 0xcff8
movq (%rcx), %rdi
leaq 0x1485(%rip), %rsi      # 0x8ee4
movl %eax, %edx
xorl %eax, %eax
callq 0x2260
jmp 0x7a3a
callq 0x296f
jmp 0x7a3a
callq 0x2991
jmp 0x7a3a
callq 0x7b71
jmp 0x7a84
callq 0x7a8b
xorl %edi, %edi
callq 0x2410