// File: /workspace/github_c_makefile_star2_O1/OpenKMIP[P]libkmip/src/kmip.c
// Function: kmip_decode_alternative_endpoints
int
kmip_decode_alternative_endpoints(KMIP *ctx, AltEndpoints* value)
{
    int result = 0;

    value->endpoint_list = ctx->calloc_func(ctx->state, 1, sizeof(LinkedList));
    CHECK_NEW_MEMORY(ctx, value->endpoint_list, sizeof(LinkedList), "LinkedList");

    uint32 tag = kmip_peek_tag(ctx);
    while(tag == KMIP_TAG_ALTERNATE_FAILOVER_ENDPOINTS)
    {
        LinkedListItem *item = ctx->calloc_func(ctx->state, 1, sizeof(LinkedListItem));
        CHECK_NEW_MEMORY(ctx, item, sizeof(LinkedListItem), "LinkedListItem");
        kmip_linked_list_enqueue(value->endpoint_list, item);

        item->data = ctx->calloc_func(ctx->state, 1, sizeof(TextString));
        CHECK_NEW_MEMORY(ctx, item->data, sizeof(TextString), "Endpoint text string");

        result = kmip_decode_text_string(ctx, KMIP_TAG_ALTERNATE_FAILOVER_ENDPOINTS, item->data);
        CHECK_RESULT(ctx, result);

        tag = kmip_peek_tag(ctx);
    }

    return(KMIP_OK);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x890(%rdi), %rdi
movl $0x1, %esi
movl $0x18, %edx
callq *0x868(%rbx)
movq %rax, (%r14)
testq %rax, %rax
je 0x1d9f2
movq 0x8(%rbx), %rcx
movq 0x10(%rbx), %rdx
subq %rcx, %rdx
addq (%rbx), %rdx
xorl %eax, %eax
cmpq $0x3, %rdx
jb 0x1d8ac
movzbl (%rcx), %eax
shll $0x10, %eax
movzbl 0x1(%rcx), %edx
shll $0x8, %edx
orl %eax, %edx
movzbl 0x2(%rcx), %eax
orl %edx, %eax
leaq 0x3d2d(%rip), %r15      # 0x215e0
leaq 0x4ac4(%rip), %r12      # 0x2237e
cmpl $0x420135, %eax         # imm = 0x420135
jne 0x1da21
movq 0x890(%rbx), %rdi
movl $0x1, %esi
movl $0x18, %edx
callq *0x868(%rbx)
testq %rax, %rax
je 0x1d96c
movq %rax, %r13
movq (%r14), %rax
testq %rax, %rax
je 0x1d919
movq 0x8(%rax), %rcx
movq %r13, 0x8(%rax)
movq $0x0, (%r13)
movq %rcx, 0x8(%r13)
incq 0x10(%rax)
testq %rcx, %rcx
je 0x1d910
movq %r13, (%rcx)
cmpq $0x0, (%rax)
jne 0x1d919
movq %r13, (%rax)
movq 0x890(%rbx), %rdi
movl $0x1, %esi
movl $0x10, %edx
callq *0x868(%rbx)
movq %rax, 0x10(%r13)
testq %rax, %rax
je 0x1d989
movq %rbx, %rdi
movl $0x420135, %esi         # imm = 0x420135
movq %rax, %rdx
callq 0x6540
testl %eax, %eax
je 0x1d9c3
movl %eax, %r13d
movq %rbx, %rdi
movq %r12, %rsi
movl $0x2bb5, %edx           # imm = 0x2BB5
callq 0x6de0
movl $0x420135, %eax         # imm = 0x420135
xorl %ecx, %ecx
movl %r13d, %ebp
jmp 0x1d9b9
movl $0x18, %esi
movq %rbx, %rdi
movq %r15, %rdx
callq 0x6ba0
movq %rbx, %rdi
movq %r12, %rsi
movl $0x2bae, %edx           # imm = 0x2BAE
jmp 0x1d9a8
movl $0x10, %esi
movq %rbx, %rdi
leaq 0x4a08(%rip), %rdx      # 0x223a0
callq 0x6ba0
movq %rbx, %rdi
movq %r12, %rsi
movl $0x2bb2, %edx           # imm = 0x2BB2
callq 0x6de0
movl $0xfffffff4, %ebp       # imm = 0xFFFFFFF4
movl $0x420135, %eax         # imm = 0x420135
xorl %ecx, %ecx
testb %cl, %cl
jne 0x1d8ba
jmp 0x1da23
movq 0x8(%rbx), %rdx
movq 0x10(%rbx), %rsi
subq %rdx, %rsi
addq (%rbx), %rsi
xorl %eax, %eax
movb $0x1, %cl
cmpq $0x3, %rsi
jb 0x1d9b9
movzbl (%rdx), %eax
shll $0x10, %eax
movzbl 0x1(%rdx), %esi
shll $0x8, %esi
orl %eax, %esi
movzbl 0x2(%rdx), %eax
orl %esi, %eax
jmp 0x1d9b9
leaq 0x3bdc(%rip), %rdx      # 0x215d5
movl $0x18, %esi
movq %rbx, %rdi
callq 0x6ba0
leaq 0x4971(%rip), %rsi      # 0x2237e
movq %rbx, %rdi
movl $0x2ba8, %edx           # imm = 0x2BA8
callq 0x6de0
movl $0xfffffff4, %ebp       # imm = 0xFFFFFFF4
jmp 0x1da23
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq