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

    TextString value = {0};
    value.value = "example";
    value.size = 7;
    Name expected = {0};
    expected.value = &value;
    expected.type = KMIP_NAME_UNINTERPRETED_TEXT_STRING;
    Name *observed = NULL;

    observed = kmip_deep_copy_name(NULL, NULL);
    if(observed != NULL)
        TEST_FAILED(tracker, __func__, __LINE__);

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

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

    observed = kmip_deep_copy_name(&ctx, &expected);
    if(observed == NULL)
    {
        kmip_destroy(&ctx);
        TEST_FAILED(tracker, __func__, __LINE__);
    }
    if(!kmip_compare_name(&expected, observed))
    {
        kmip_print_name(stderr, 1, &expected);
        kmip_print_name(stderr, 1, observed);
        kmip_free_name(&ctx, observed);
        ctx.free_func(ctx.state, observed);
        kmip_destroy(&ctx);
        TEST_FAILED(tracker, __func__, __LINE__);
    }

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

    TEST_PASSED(tracker, __func__);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x8d0, %rsp            # imm = 0x8D0
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
leaq 0x3a132(%rip), %rax     # 0x3f4a6
movq %rax, -0x20(%rbp)
movq $0x7, -0x18(%rbp)
leaq -0x30(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x1090
leaq -0x20(%rbp), %rax
movq %rax, -0x30(%rbp)
movl $0x1, -0x28(%rbp)
movq $0x0, -0x38(%rbp)
xorl %eax, %eax
movl %eax, %esi
movq %rsi, %rdi
callq 0x20150
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0x53f6
jmp 0x53c0
leaq 0x39cee(%rip), %rdi     # 0x3f0b5
leaq 0x3a12c(%rip), %rsi     # 0x3f4fa
movl $0x5e1, %edx            # imm = 0x5E1
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 0x55d1
leaq -0x8d0(%rbp), %rdi
xorl %esi, %esi
movl $0x898, %edx            # imm = 0x898
callq 0x1090
leaq -0x8d0(%rbp), %rdi
xorl %eax, %eax
movl %eax, %edx
xorl %ecx, %ecx
movq %rdx, %rsi
callq 0x1c6e0
leaq -0x8d0(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x20150
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0x547b
leaq -0x8d0(%rbp), %rdi
callq 0x1cab0
leaq 0x39c69(%rip), %rdi     # 0x3f0b5
leaq 0x3a0a7(%rip), %rsi     # 0x3f4fa
movl $0x5ea, %edx            # imm = 0x5EA
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 0x55d1
leaq -0x8d0(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x20150
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x54d8
leaq -0x8d0(%rbp), %rdi
callq 0x1cab0
leaq 0x39c0c(%rip), %rdi     # 0x3f0b5
leaq 0x3a04a(%rip), %rsi     # 0x3f4fa
movl $0x5f1, %edx            # imm = 0x5F1
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 0x55d1
movq -0x38(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0x20d60
cmpl $0x0, %eax
jne 0x557b
movq 0x4eb03(%rip), %rax     # 0x53ff8
movq (%rax), %rdi
movl $0x1, %esi
leaq -0x30(%rbp), %rdx
callq 0x3b730
movq 0x4eaeb(%rip), %rax     # 0x53ff8
movq (%rax), %rdi
movq -0x38(%rbp), %rdx
movl $0x1, %esi
callq 0x3b730
movq -0x38(%rbp), %rsi
leaq -0x8d0(%rbp), %rdi
callq 0x1d7a0
movq -0x58(%rbp), %rax
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq *%rax
leaq -0x8d0(%rbp), %rdi
callq 0x1cab0
leaq 0x39b66(%rip), %rdi     # 0x3f0b5
leaq 0x39fa4(%rip), %rsi     # 0x3f4fa
movl $0x5fa, %edx            # imm = 0x5FA
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 0x55d1
movq -0x38(%rbp), %rsi
leaq -0x8d0(%rbp), %rdi
callq 0x1d7a0
movq -0x58(%rbp), %rax
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq *%rax
leaq -0x8d0(%rbp), %rdi
callq 0x1cab0
leaq 0x39a9f(%rip), %rdi     # 0x3f04b
leaq 0x39f47(%rip), %rsi     # 0x3f4fa
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 $0x8d0, %rsp            # imm = 0x8D0
popq %rbp
retq
nopl (%rax)