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

    ByteString expected = {0};
    uint8 value[24] = {
        0x73, 0x67, 0x57, 0x80, 0x51, 0x01, 0x2A, 0x6D,
        0x13, 0x4A, 0x85, 0x5E, 0x25, 0xC8, 0xCD, 0x5E,
        0x4C, 0xA1, 0x31, 0x45, 0x57, 0x29, 0xD3, 0xC8
    };
    expected.value = value;
    expected.size = ARRAY_LENGTH(value);

    ByteString *observed = NULL;
    observed = kmip_deep_copy_byte_string(NULL, NULL);
    if(NULL != observed)
    {
        TEST_FAILED(tracker, __func__, __LINE__);
    }

    KMIP ctx = {0};
    kmip_init(&ctx, NULL, 0, KMIP_1_0);

    observed = kmip_deep_copy_byte_string(&ctx, NULL);
    if(NULL != observed)
    {
        kmip_destroy(&ctx);
        TEST_FAILED(tracker, __func__, __LINE__);
    }

    observed = kmip_deep_copy_byte_string(&ctx, &expected);
    if(NULL == observed)
    {
        kmip_destroy(&ctx);
        TEST_FAILED(tracker, __func__, __LINE__);
    }
    if(!kmip_compare_byte_string(&expected, observed))
    {
        kmip_print_byte_string(stderr, 1, "ByteString", &expected);
        kmip_print_byte_string(stderr, 1, "ByteString", observed);
        kmip_free_byte_string(&ctx, observed);
        ctx.free_func(ctx.state, observed);
        kmip_destroy(&ctx);
        TEST_FAILED(tracker, __func__, __LINE__);
    }

    kmip_free_byte_string(&ctx, observed);
    ctx.free_func(ctx.state, observed);
    kmip_destroy(&ctx);

    TEST_PASSED(tracker, __func__);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x8e0, %rsp            # imm = 0x8E0
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movw (%rax), %cx
addw $0x1, %cx
movw %cx, (%rax)
leaq -0x20(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x1090
movq 0x3c84c(%rip), %rax     # 0x41910
movq %rax, -0x40(%rbp)
movq 0x3c849(%rip), %rax     # 0x41918
movq %rax, -0x38(%rbp)
movq 0x3c846(%rip), %rax     # 0x41920
movq %rax, -0x30(%rbp)
leaq -0x40(%rbp), %rax
movq %rax, -0x20(%rbp)
movq $0x18, -0x18(%rbp)
movq $0x0, -0x48(%rbp)
xorl %eax, %eax
movl %eax, %esi
movq %rsi, %rdi
callq 0x20010
movq %rax, -0x48(%rbp)
xorl %eax, %eax
cmpq -0x48(%rbp), %rax
je 0x5146
jmp 0x5110
leaq 0x39f9e(%rip), %rdi     # 0x3f0b5
leaq 0x3a3b6(%rip), %rsi     # 0x3f4d4
movl $0x5ae, %edx            # imm = 0x5AE
movb $0x0, %al
callq 0x1070
movq -0x10(%rbp), %rax
movw 0x2(%rax), %cx
addw $0x1, %cx
movw %cx, 0x2(%rax)
movl $0x1, -0x4(%rbp)
jmp 0x5331
leaq -0x8e0(%rbp), %rdi
xorl %esi, %esi
movl $0x898, %edx            # imm = 0x898
callq 0x1090
leaq -0x8e0(%rbp), %rdi
xorl %eax, %eax
movl %eax, %edx
xorl %ecx, %ecx
movq %rdx, %rsi
callq 0x1c6e0
leaq -0x8e0(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x20010
movq %rax, -0x48(%rbp)
xorl %eax, %eax
cmpq -0x48(%rbp), %rax
je 0x51cc
leaq -0x8e0(%rbp), %rdi
callq 0x1cab0
leaq 0x39f18(%rip), %rdi     # 0x3f0b5
leaq 0x3a330(%rip), %rsi     # 0x3f4d4
movl $0x5b8, %edx            # imm = 0x5B8
movb $0x0, %al
callq 0x1070
movq -0x10(%rbp), %rax
movw 0x2(%rax), %cx
addw $0x1, %cx
movw %cx, 0x2(%rax)
movl $0x1, -0x4(%rbp)
jmp 0x5331
leaq -0x8e0(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x20010
movq %rax, -0x48(%rbp)
xorl %eax, %eax
cmpq -0x48(%rbp), %rax
jne 0x522a
leaq -0x8e0(%rbp), %rdi
callq 0x1cab0
leaq 0x39eba(%rip), %rdi     # 0x3f0b5
leaq 0x3a2d2(%rip), %rsi     # 0x3f4d4
movl $0x5bf, %edx            # imm = 0x5BF
movb $0x0, %al
callq 0x1070
movq -0x10(%rbp), %rax
movw 0x2(%rax), %cx
addw $0x1, %cx
movw %cx, 0x2(%rax)
movl $0x1, -0x4(%rbp)
jmp 0x5331
movq -0x48(%rbp), %rsi
leaq -0x20(%rbp), %rdi
callq 0x20c80
cmpl $0x0, %eax
jne 0x52db
movq 0x4edb1(%rip), %rax     # 0x53ff8
movq (%rax), %rdi
movl $0x1, %esi
leaq 0x3a299(%rip), %rdx     # 0x3f4ef
leaq -0x20(%rbp), %rcx
callq 0x3b540
movq 0x4ed92(%rip), %rax     # 0x53ff8
movq (%rax), %rdi
movq -0x48(%rbp), %rcx
movl $0x1, %esi
leaq 0x3a276(%rip), %rdx     # 0x3f4ef
callq 0x3b540
movq -0x48(%rbp), %rsi
leaq -0x8e0(%rbp), %rdi
callq 0x1d720
movq -0x68(%rbp), %rax
movq -0x50(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq *%rax
leaq -0x8e0(%rbp), %rdi
callq 0x1cab0
leaq 0x39e06(%rip), %rdi     # 0x3f0b5
leaq 0x3a21e(%rip), %rsi     # 0x3f4d4
movl $0x5c8, %edx            # imm = 0x5C8
movb $0x0, %al
callq 0x1070
movq -0x10(%rbp), %rax
movw 0x2(%rax), %cx
addw $0x1, %cx
movw %cx, 0x2(%rax)
movl $0x1, -0x4(%rbp)
jmp 0x5331
movq -0x48(%rbp), %rsi
leaq -0x8e0(%rbp), %rdi
callq 0x1d720
movq -0x68(%rbp), %rax
movq -0x50(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq *%rax
leaq -0x8e0(%rbp), %rdi
callq 0x1cab0
leaq 0x39d3f(%rip), %rdi     # 0x3f04b
leaq 0x3a1c1(%rip), %rsi     # 0x3f4d4
movb $0x0, %al
callq 0x1070
movq -0x10(%rbp), %rax
movw 0x4(%rax), %cx
addw $0x1, %cx
movw %cx, 0x4(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x8e0, %rsp            # imm = 0x8E0
popq %rbp
retq
nopl (%rax)