// File: /workspace/github_c_makefile_star2_O2/mijallen[P]SimpleHTTPServer/lib/libyaml/tests/run-dumper.c
// Function: compare_nodes
int compare_nodes(yaml_document_t *document1, int index1,
        yaml_document_t *document2, int index2)
{
    yaml_node_t *node1 = yaml_document_get_node(document1, index1);
    yaml_node_t *node2 = yaml_document_get_node(document2, index2);
    int k;

    assert(node1);
    assert(node2);

    if (node1->type != node2->type)
        return 0;

    if (strcmp((char *)node1->tag, (char *)node2->tag) != 0) return 0;

    switch (node1->type) {
        case YAML_SCALAR_NODE:
            if (node1->data.scalar.length != node2->data.scalar.length)
                return 0;
            if (strncmp((char *)node1->data.scalar.value, (char *)node2->data.scalar.value,
                        node1->data.scalar.length) != 0) return 0;
            break;
        case YAML_SEQUENCE_NODE:
            if ((node1->data.sequence.items.top - node1->data.sequence.items.start) !=
                    (node2->data.sequence.items.top - node2->data.sequence.items.start))
                return 0;
            for (k = 0; k < (node1->data.sequence.items.top - node1->data.sequence.items.start); k ++) {
                if (!compare_nodes(document1, node1->data.sequence.items.start[k],
                            document2, node2->data.sequence.items.start[k])) return 0;
            }
            break;
        case YAML_MAPPING_NODE:
            if ((node1->data.mapping.pairs.top - node1->data.mapping.pairs.start) !=
                    (node2->data.mapping.pairs.top - node2->data.mapping.pairs.start))
                return 0;
            for (k = 0; k < (node1->data.mapping.pairs.top - node1->data.mapping.pairs.start); k ++) {
                if (!compare_nodes(document1, node1->data.mapping.pairs.start[k].key,
                            document2, node2->data.mapping.pairs.start[k].key)) return 0;
                if (!compare_nodes(document1, node1->data.mapping.pairs.start[k].value,
                            document2, node2->data.mapping.pairs.start[k].value)) return 0;
            }
            break;
        default:
            assert(0);
            break;
    }
    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebp
movq %rdx, %r14
movq %rdi, %r15
callq 0x11f0
movq %rax, %rbx
movq %r14, %rdi
movl %ebp, %esi
callq 0x11f0
testq %rbx, %rbx
je 0x164e
movq %rax, %r12
testq %rax, %rax
je 0x1667
movl (%rbx), %r13d
xorl %ebp, %ebp
cmpl (%r12), %r13d
jne 0x152b
movq 0x8(%rbx), %rdi
movq 0x8(%r12), %rsi
callq 0x1170
testl %eax, %eax
je 0x153c
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x3, %r13d
je 0x15cc
cmpl $0x2, %r13d
je 0x1578
cmpl $0x1, %r13d
jne 0x1684
movq 0x18(%rbx), %rdx
cmpq 0x18(%r12), %rdx
jne 0x152b
movq 0x10(%rbx), %rdi
movq 0x10(%r12), %rsi
callq 0x1040
testl %eax, %eax
jne 0x152b
pushq $0x1
popq %rbp
jmp 0x152b
movq 0x20(%rbx), %rax
subq 0x10(%rbx), %rax
movq 0x20(%r12), %rcx
subq 0x10(%r12), %rcx
cmpq %rcx, %rax
jne 0x152b
xorl %r13d, %r13d
xorl %ebp, %ebp
movq 0x10(%rbx), %rax
movq 0x20(%rbx), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %r13, %rcx
jle 0x1573
movl (%rax,%r13,4), %esi
movq 0x10(%r12), %rax
movl (%rax,%r13,4), %ecx
movq %r15, %rdi
movq %r14, %rdx
callq 0x14d4
incq %r13
testl %eax, %eax
jne 0x1594
jmp 0x152b
movq 0x20(%rbx), %rax
subq 0x10(%rbx), %rax
movq 0x20(%r12), %rcx
subq 0x10(%r12), %rcx
cmpq %rcx, %rax
jne 0x152b
xorl %r13d, %r13d
xorl %ebp, %ebp
movq 0x10(%rbx), %rax
movq 0x20(%rbx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %r13, %rcx
jle 0x1573
movl (%rax,%r13,8), %esi
movq 0x10(%r12), %rax
movl (%rax,%r13,8), %ecx
movq %r15, %rdi
movq %r14, %rdx
callq 0x14d4
testl %eax, %eax
je 0x152b
movq 0x10(%rbx), %rax
movl 0x4(%rax,%r13,8), %esi
movq 0x10(%r12), %rax
movl 0x4(%rax,%r13,8), %ecx
movq %r15, %rdi
movq %r14, %rdx
callq 0x14d4
incq %r13
testl %eax, %eax
jne 0x15ec
jmp 0x152b
leaq 0x9f6(%rip), %rdi       # 0x204b
leaq 0x9aa(%rip), %rsi       # 0x2006
leaq 0x9ee(%rip), %rcx       # 0x2051
pushq $0x56
jmp 0x167e
leaq 0xa25(%rip), %rdi       # 0x2093
leaq 0x991(%rip), %rsi       # 0x2006
leaq 0x9d5(%rip), %rcx       # 0x2051
pushq $0x57
popq %rdx
callq 0x1120
leaq 0x979(%rip), %rdi       # 0x2004
leaq 0x974(%rip), %rsi       # 0x2006
leaq 0x9b8(%rip), %rcx       # 0x2051
pushq $0x7a
jmp 0x167e