// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movq 0x30(%rbp), %rax
movq 0x28(%rbp), %rax
movq 0x20(%rbp), %rax
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
cmpl $0x1, -0x8(%rbp)
jg 0x2411
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x2310
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x26b5
movl $0x1, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0x26ae
movq -0x10(%rbp), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x27d8a(%rip), %rsi     # 0x2a1c1
movl $0x2, %edx
callq 0x20a0
cmpl $0x0, %eax
jne 0x2466
movq -0x10(%rbp), %rax
movl -0x34(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, -0x34(%rbp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
jmp 0x269e
movq -0x10(%rbp), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x27d4b(%rip), %rsi     # 0x2a1c4
movl $0x2, %edx
callq 0x20a0
cmpl $0x0, %eax
jne 0x24a8
movq -0x10(%rbp), %rax
movl -0x34(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, -0x34(%rbp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
jmp 0x269c
movq -0x10(%rbp), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x27d0c(%rip), %rsi     # 0x2a1c7
movl $0x2, %edx
callq 0x20a0
cmpl $0x0, %eax
jne 0x24d9
movq 0x30(%rbp), %rax
movl $0x1, (%rax)
jmp 0x269a
movq -0x10(%rbp), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x27cde(%rip), %rsi     # 0x2a1ca
movl $0x2, %edx
callq 0x20a0
cmpl $0x0, %eax
jne 0x251b
movq -0x10(%rbp), %rax
movl -0x34(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, -0x34(%rbp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rcx
movq 0x28(%rbp), %rax
movq %rcx, (%rax)
jmp 0x2698
movq -0x10(%rbp), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x27c9f(%rip), %rsi     # 0x2a1cd
movl $0x2, %edx
callq 0x20a0
cmpl $0x0, %eax
jne 0x255d
movq -0x10(%rbp), %rax
movl -0x34(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, -0x34(%rbp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
jmp 0x2696
movq -0x10(%rbp), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x27c60(%rip), %rsi     # 0x2a1d0
movl $0x2, %edx
callq 0x20a0
cmpl $0x0, %eax
jne 0x259f
movq -0x10(%rbp), %rax
movl -0x34(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, -0x34(%rbp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
jmp 0x2694
movq -0x10(%rbp), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x27c21(%rip), %rsi     # 0x2a1d3
movl $0x2, %edx
callq 0x20a0
cmpl $0x0, %eax
jne 0x25e1
movq -0x10(%rbp), %rax
movl -0x34(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, -0x34(%rbp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rcx
movq 0x10(%rbp), %rax
movq %rcx, (%rax)
jmp 0x2692
movq -0x10(%rbp), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x27be2(%rip), %rsi     # 0x2a1d6
movl $0x2, %edx
callq 0x20a0
cmpl $0x0, %eax
jne 0x2620
movq -0x10(%rbp), %rax
movl -0x34(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, -0x34(%rbp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rcx
movq 0x20(%rbp), %rax
movq %rcx, (%rax)
jmp 0x2690
movq -0x10(%rbp), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x27ba6(%rip), %rsi     # 0x2a1d9
movl $0x2, %edx
callq 0x20a0
cmpl $0x0, %eax
jne 0x265f
movq -0x10(%rbp), %rax
movl -0x34(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, -0x34(%rbp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rcx
movq 0x18(%rbp), %rax
movq %rcx, (%rax)
jmp 0x268e
movq -0x10(%rbp), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
leaq 0x27b6a(%rip), %rdi     # 0x2a1dc
movb $0x0, %al
callq 0x2040
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x2310
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x26b5
jmp 0x2690
jmp 0x2692
jmp 0x2694
jmp 0x2696
jmp 0x2698
jmp 0x269a
jmp 0x269c
jmp 0x269e
jmp 0x26a0
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x2418
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nop