// File: /workspace/github_c_makefile_star2_O0/OpenKMIP[P]libkmip/tests/tests.c
// Function: test_decode_query_response_payload
int
test_decode_query_response_payload(TestTracker *tracker)
{
    TRACK_TEST(tracker);

    uint8 encoding[176] = {
        0x42, 0x00, 0x7C, 0x01, 0x00, 0x00, 0x00, 0x58,

        0x42, 0x00, 0x5C, 0x05, 0x00, 0x00, 0x00, 0x04,
        0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
        0x42, 0x00, 0x5C, 0x05, 0x00, 0x00, 0x00, 0x04,
        0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,

        0x42, 0x00, 0x57, 0x05, 0x00, 0x00, 0x00, 0x04,
        0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
        0x42, 0x00, 0x57, 0x05, 0x00, 0x00, 0x00, 0x04,
        0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,

        0x42, 0x00, 0x9D, 0x07, 0x00, 0x00, 0x00, 0x0A,
        0x56, 0x65, 0x6E, 0x64, 0x6F, 0x72, 0x20, 0x4F,
        0x6E, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    };

    struct kmip ctx = {0};
    kmip_init(&ctx, encoding, ARRAY_LENGTH(encoding), KMIP_1_0);

    struct text_string vendor = {0};
    vendor.value = "Vendor One";
    vendor.size = 10;

    // operations
    LinkedList oper_1  = {0};
    LinkedListItem item_1 = {0};
    int32 op_1 = KMIP_OP_CREATE;
    item_1.data = &op_1;

    LinkedListItem item_2 = {0};
    int32 op_2 = KMIP_OP_CREATE_KEY_PAIR;
    item_2.data = &op_2;

    kmip_linked_list_enqueue(&oper_1, &item_1);
    kmip_linked_list_enqueue(&oper_1, &item_2);

    Operations operations = {0};
    operations.operation_list = &oper_1;


    // objects
    LinkedList objlist  = {0};
    LinkedListItem obj_item_1 = {0};
    int32 obj_1 = KMIP_OBJTYPE_CERTIFICATE;
    obj_item_1.data = &obj_1;

    LinkedListItem obj_item_2 = {0};
    int32 obj_2 = KMIP_OBJTYPE_PUBLIC_KEY;
    obj_item_2.data = &obj_2;

    kmip_linked_list_enqueue(&objlist, &obj_item_1);
    kmip_linked_list_enqueue(&objlist, &obj_item_2);

    ObjectTypes objects = {0};
    objects.object_list = &objlist;

    struct query_response_payload expected = {0};
    expected.operations = &operations;
    expected.objects = &objects;
    expected.vendor_identification = &vendor;

    struct query_response_payload observed = {0};

    int result = kmip_decode_query_response_payload(&ctx, &observed);
    int comparison = kmip_compare_query_response_payload(&expected, &observed);
    if (!comparison)
    {
        kmip_print_query_response_payload(stderr, 1, &observed);
        kmip_print_query_response_payload(stderr, 1, &expected);
    }
    result = report_decoding_test_result(
        tracker,
        &ctx,
        comparison,
        result,
        __func__);
    kmip_free_query_response_payload(&ctx, &observed);
    kmip_destroy(&ctx);


    return (result);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa70, %rsp            # imm = 0xA70
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movw (%rax), %cx
addw $0x1, %cx
movw %cx, (%rax)
leaq -0xc0(%rbp), %rdi
leaq 0x2d2a5(%rip), %rsi     # 0x46b20
movl $0xb0, %edx
callq 0x10c0
leaq -0x958(%rbp), %rdi
xorl %esi, %esi
movl $0x898, %edx            # imm = 0x898
callq 0x1090
leaq -0xc0(%rbp), %rsi
leaq -0x958(%rbp), %rdi
movl $0xb0, %edx
xorl %ecx, %ecx
callq 0x1c6e0
leaq -0x968(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x1090
leaq 0x27ae4(%rip), %rax     # 0x413b0
movq %rax, -0x968(%rbp)
movq $0xa, -0x960(%rbp)
leaq -0x980(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x1090
leaq -0x998(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x1090
movl $0x1, -0x99c(%rbp)
leaq -0x99c(%rbp), %rax
movq %rax, -0x988(%rbp)
leaq -0x9b8(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x1090
movl $0x2, -0x9bc(%rbp)
leaq -0x9bc(%rbp), %rax
movq %rax, -0x9a8(%rbp)
leaq -0x980(%rbp), %rdi
leaq -0x998(%rbp), %rsi
callq 0x1b660
leaq -0x980(%rbp), %rdi
leaq -0x9b8(%rbp), %rsi
callq 0x1b660
leaq -0x9c8(%rbp), %rdi
xorl %esi, %esi
movl $0x8, %edx
callq 0x1090
leaq -0x980(%rbp), %rax
movq %rax, -0x9c8(%rbp)
leaq -0x9e0(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x1090
leaq -0x9f8(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x1090
movl $0x1, -0x9fc(%rbp)
leaq -0x9fc(%rbp), %rax
movq %rax, -0x9e8(%rbp)
leaq -0xa18(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x1090
movl $0x3, -0xa1c(%rbp)
leaq -0xa1c(%rbp), %rax
movq %rax, -0xa08(%rbp)
leaq -0x9e0(%rbp), %rdi
leaq -0x9f8(%rbp), %rsi
callq 0x1b660
leaq -0x9e0(%rbp), %rdi
leaq -0xa18(%rbp), %rsi
callq 0x1b660
leaq -0xa28(%rbp), %rdi
xorl %esi, %esi
movl $0x8, %edx
callq 0x1090
leaq -0x9e0(%rbp), %rax
movq %rax, -0xa28(%rbp)
leaq -0xa48(%rbp), %rdi
xorl %esi, %esi
movl $0x20, %edx
callq 0x1090
leaq -0x9c8(%rbp), %rax
movq %rax, -0xa48(%rbp)
leaq -0xa28(%rbp), %rax
movq %rax, -0xa40(%rbp)
leaq -0x968(%rbp), %rax
movq %rax, -0xa38(%rbp)
leaq -0xa68(%rbp), %rdi
xorl %esi, %esi
movl $0x20, %edx
callq 0x1090
leaq -0x958(%rbp), %rdi
leaq -0xa68(%rbp), %rsi
callq 0x34270
movl %eax, -0xa6c(%rbp)
leaq -0xa48(%rbp), %rdi
leaq -0xa68(%rbp), %rsi
callq 0x23150
movl %eax, -0xa70(%rbp)
cmpl $0x0, -0xa70(%rbp)
jne 0x19aff
movq 0x3a528(%rip), %rax     # 0x53ff8
movq (%rax), %rdi
movl $0x1, %esi
leaq -0xa68(%rbp), %rdx
callq 0x3cf10
movq 0x3a50d(%rip), %rax     # 0x53ff8
movq (%rax), %rdi
movl $0x1, %esi
leaq -0xa48(%rbp), %rdx
callq 0x3cf10
movq -0x8(%rbp), %rdi
movl -0xa70(%rbp), %edx
movl -0xa6c(%rbp), %ecx
leaq -0x958(%rbp), %rsi
leaq 0x2789e(%rip), %r8      # 0x413bb
callq 0x13a0
movl %eax, -0xa6c(%rbp)
leaq -0x958(%rbp), %rdi
leaq -0xa68(%rbp), %rsi
callq 0x1ede0
leaq -0x958(%rbp), %rdi
callq 0x1cab0
movl -0xa6c(%rbp), %eax
addq $0xa70, %rsp            # imm = 0xA70
popq %rbp
retq
nopw %cs:(%rax,%rax)