// File: /workspace/github_c_makefile_star2_O1/OpenKMIP[P]libkmip/demos/demo_get.c
// Function: parse_arguments
int
parse_arguments(int argc, char **argv,
                char **server_address, char **server_port,
                char **client_certificate, char **client_key, char **ca_certificate,
                char **username, char **password,
                char **id,
                int *print_usage)
{
    if(argc <= 1)
    {
        print_help(argv[0]);
        return(-1);
    }
    
    for(int i = 1; i < argc; i++)
    {
        if(strncmp(argv[i], "-a", 2) == 0)
        {
            *server_address = argv[++i];
        }
        else if(strncmp(argv[i], "-c", 2) == 0)
        {
            *client_certificate = argv[++i];
        }
        else if(strncmp(argv[i], "-h", 2) == 0)
        {
            *print_usage = 1;
        }
        else if(strncmp(argv[i], "-i", 2) == 0)
        {
            *id = argv[++i];
        }
        else if(strncmp(argv[i], "-k", 2) == 0)
        {
            *client_key = argv[++i];
        }
        else if(strncmp(argv[i], "-p", 2) == 0)
        {
            *server_port = argv[++i];
        }
        else if(strncmp(argv[i], "-r", 2) == 0)
        {
            *ca_certificate = argv[++i];
        }
        else if(strncmp(argv[i], "-s", 2) == 0)
        {
            *password = argv[++i];
        }
        else if(strncmp(argv[i], "-u", 2) == 0)
        {
            *username = argv[++i];
        }
        else
        {
            printf("Invalid option: '%s'\n", argv[i]);
            print_help(argv[0]);
            return(-1);
        }
    }
    
    return(0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r9, 0x10(%rsp)
movq %r8, 0x18(%rsp)
movq %rcx, 0x8(%rsp)
movq %rdx, 0x20(%rsp)
movq %rsi, %rbx
cmpl $0x2, %edi
jge 0x2513
movq (%rbx), %rdi
callq 0x244c
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x26cb
movl %edi, %ebp
movl $0x1, %r12d
movb $0x1, %r14b
movslq %r12d, %r13
movq (%rbx,%r13,8), %r15
movl $0x2, %edx
movq %r15, %rdi
leaq 0x1eb10(%rip), %rsi     # 0x21044
callq 0x20a0
testl %eax, %eax
je 0x2631
movl $0x2, %edx
movq %r15, %rdi
leaq 0x1eaf7(%rip), %rsi     # 0x21047
callq 0x20a0
testl %eax, %eax
je 0x2641
movl $0x2, %edx
movq %r15, %rdi
leaq 0x1eade(%rip), %rsi     # 0x2104a
callq 0x20a0
testl %eax, %eax
je 0x2651
movl $0x2, %edx
movq %r15, %rdi
leaq 0x1eac5(%rip), %rsi     # 0x2104d
callq 0x20a0
testl %eax, %eax
je 0x2661
movl $0x2, %edx
movq %r15, %rdi
leaq 0x1eaac(%rip), %rsi     # 0x21050
callq 0x20a0
testl %eax, %eax
je 0x2671
movl $0x2, %edx
movq %r15, %rdi
leaq 0x1ea93(%rip), %rsi     # 0x21053
callq 0x20a0
testl %eax, %eax
je 0x2681
movl $0x2, %edx
movq %r15, %rdi
leaq 0x1ea7a(%rip), %rsi     # 0x21056
callq 0x20a0
testl %eax, %eax
je 0x2691
movl $0x2, %edx
movq %r15, %rdi
leaq 0x1ea61(%rip), %rsi     # 0x21059
callq 0x20a0
testl %eax, %eax
je 0x26a1
movl $0x2, %edx
movq %r15, %rdi
leaq 0x1ea48(%rip), %rsi     # 0x2105c
callq 0x20a0
testl %eax, %eax
jne 0x26da
leal 0x1(%r13), %r12d
movq 0x8(%rbx,%r13,8), %rax
movq 0x68(%rsp), %rcx
jmp 0x26af
leal 0x1(%r13), %r12d
movq 0x8(%rbx,%r13,8), %rax
movq 0x20(%rsp), %rcx
jmp 0x26af
leal 0x1(%r13), %r12d
movq 0x8(%rbx,%r13,8), %rax
movq 0x18(%rsp), %rcx
jmp 0x26af
movq 0x80(%rsp), %rax
movl $0x1, (%rax)
jmp 0x26b2
leal 0x1(%r13), %r12d
movq 0x8(%rbx,%r13,8), %rax
movq 0x78(%rsp), %rcx
jmp 0x26af
leal 0x1(%r13), %r12d
movq 0x8(%rbx,%r13,8), %rax
movq 0x10(%rsp), %rcx
jmp 0x26af
leal 0x1(%r13), %r12d
movq 0x8(%rbx,%r13,8), %rax
movq 0x8(%rsp), %rcx
jmp 0x26af
leal 0x1(%r13), %r12d
movq 0x8(%rbx,%r13,8), %rax
movq 0x60(%rsp), %rcx
jmp 0x26af
leal 0x1(%r13), %r12d
movq 0x8(%rbx,%r13,8), %rax
movq 0x70(%rsp), %rcx
movq %rax, (%rcx)
incl %r12d
cmpl %ebp, %r12d
setl %r14b
jl 0x251e
movzbl %r14b, %eax
andl $0x1, %eax
negl %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1e97e(%rip), %rdi     # 0x2105f
movq %r15, %rsi
xorl %eax, %eax
callq 0x2040
movq (%rbx), %rdi
callq 0x244c
jmp 0x26c2