// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movl %esi, 0x24(%rsp)
movq %rdx, 0x18(%rsp)
movl 0x24(%rsp), %edi
movq 0x18(%rsp), %rsi
leaq 0x1d5e(%rip), %rdx      # 0xce20
callq 0x23e0
movl %eax, 0x14(%rsp)
cmpl $-0x1, %eax
je 0xb36b
movl 0x14(%rsp), %eax
addl $-0x4d, %eax
movl %eax, %ecx
movq %rcx, 0x8(%rsp)
subl $0x29, %eax
ja 0xb340
movq 0x8(%rsp), %rax
leaq 0x1c81(%rip), %rcx      # 0xcd78
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x5ed1(%rip), %rax      # 0x10fd8
movq (%rax), %rdi
callq 0x2400
movl %eax, %ecx
movq 0x28(%rsp), %rax
movl %ecx, 0x10(%rax)
jmp 0xb366
movq 0x28(%rsp), %rax
movl $0x1, 0x20(%rax)
jmp 0xb366
movq 0x5ea2(%rip), %rax      # 0x10fd8
movq (%rax), %rdi
callq 0x2400
movl %eax, %ecx
movq 0x28(%rsp), %rax
movl %ecx, 0xc(%rax)
jmp 0xb366
movq 0x5e84(%rip), %rax      # 0x10fd8
movq (%rax), %rcx
movq 0x28(%rsp), %rax
movq %rcx, 0x28(%rax)
jmp 0xb366
movq 0x5e6c(%rip), %rax      # 0x10fd8
movq (%rax), %rdi
callq 0x2400
movslq %eax, %rcx
shlq $0xa, %rcx
shlq $0xa, %rcx
movq 0x28(%rsp), %rax
movq %rcx, (%rax)
jmp 0xb366
movq 0x28(%rsp), %rax
movl $0x0, 0x24(%rax)
jmp 0xb366
movq 0x5e34(%rip), %rax      # 0x10fd8
movq (%rax), %rdi
callq 0x2400
movl %eax, %ecx
movq 0x28(%rsp), %rax
movl %ecx, 0x8(%rax)
jmp 0xb366
callq 0xb380
xorl %edi, %edi
callq 0x2430
callq 0xb490
xorl %edi, %edi
callq 0x2430
movq 0x28(%rsp), %rax
movl $0x1, 0x3c(%rax)
jmp 0xb366
movq 0x28(%rsp), %rax
movl 0x18(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x18(%rax)
jmp 0xb366
movq 0x5dda(%rip), %rax      # 0x10fd8
movq (%rax), %rsi
movl $0x2, %edi
leaq 0x10(%rsp), %rdx
callq 0x22b0
cmpl $0x0, %eax
jne 0xb244
movq 0x5ddc(%rip), %rax      # 0x10ff8
movq (%rax), %rdi
movq 0x5db2(%rip), %rax      # 0x10fd8
movq (%rax), %rdx
leaq 0x1c0d(%rip), %rsi      # 0xce3d
movb $0x0, %al
callq 0x2280
movl $0x1, 0x34(%rsp)
jmp 0xb373
movq 0x28(%rsp), %rax
movl 0x10(%rsp), %ecx
movl %ecx, 0x14(%rax)
jmp 0xb366
movq 0x28(%rsp), %rax
movl $0x1, 0x40(%rax)
jmp 0xb366
movq 0x28(%rsp), %rax
movl $0x1, 0x44(%rax)
jmp 0xb366
movq 0x5d5a(%rip), %rax      # 0x10fd8
movq (%rax), %rcx
movq 0x28(%rsp), %rax
movq %rcx, 0x48(%rax)
jmp 0xb366
movq 0x5d42(%rip), %rax      # 0x10fd8
movq (%rax), %rcx
movq 0x28(%rsp), %rax
movq %rcx, 0x50(%rax)
jmp 0xb366
movq 0x5d2a(%rip), %rax      # 0x10fd8
movq (%rax), %rdi
callq 0x20d0
movq 0x28(%rsp), %rax
movsd %xmm0, 0x30(%rax)
movq 0x28(%rsp), %rax
movsd 0x1aa3(%rip), %xmm0     # 0xcd70
ucomisd 0x30(%rax), %xmm0
jb 0xb2f6
movq 0x5d1d(%rip), %rax      # 0x10ff8
movq (%rax), %rdi
leaq 0x1b6d(%rip), %rsi      # 0xce52
movb $0x0, %al
callq 0x2280
movl $0x1, 0x34(%rsp)
jmp 0xb373
jmp 0xb366
movq 0x5cd9(%rip), %rax      # 0x10fd8
movq (%rax), %rdi
callq 0x2400
movl %eax, %ecx
movq 0x28(%rsp), %rax
movl %ecx, 0x38(%rax)
movq 0x28(%rsp), %rax
cmpl $0x0, 0x38(%rax)
jne 0xb33e
movq 0x5cd5(%rip), %rax      # 0x10ff8
movq (%rax), %rdi
leaq 0x1b44(%rip), %rsi      # 0xce71
movb $0x0, %al
callq 0x2280
movl $0x1, 0x34(%rsp)
jmp 0xb373
jmp 0xb366
movq 0x5cb1(%rip), %rax      # 0x10ff8
movq (%rax), %rdi
movl 0x14(%rsp), %edx
leaq 0x1b3f(%rip), %rsi      # 0xce94
movb $0x0, %al
callq 0x2280
movl $0x1, 0x34(%rsp)
jmp 0xb373
jmp 0xb0b2
movl $0x1, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopl (%rax)