// File: /workspace/github_c_makefile_star2_O3/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, %ebx
movq %rdx, %r15
movq %rdi, %r12
callq 0x11f0
movq %rax, %r14
movq %r15, %rdi
movl %ebx, %esi
callq 0x11f0
testq %r14, %r14
je 0x1654
movq %rax, %r13
testq %rax, %rax
je 0x1673
movl (%r14), %ebp
xorl %ebx, %ebx
cmpl (%r13), %ebp
jne 0x152b
movq 0x8(%r14), %rdi
movq 0x8(%r13), %rsi
callq 0x1170
testl %eax, %eax
je 0x153c
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x3, %ebp
je 0x15ce
cmpl $0x2, %ebp
je 0x1573
cmpl $0x1, %ebp
jne 0x1692
movq 0x18(%r14), %rdx
cmpq 0x18(%r13), %rdx
jne 0x152b
movq 0x10(%r14), %rdi
movq 0x10(%r13), %rsi
callq 0x1040
testl %eax, %eax
jne 0x152b
jmp 0x164a
movq 0x10(%r14), %rax
movq 0x20(%r14), %rcx
subq %rax, %rcx
movq 0x20(%r13), %rdx
subq 0x10(%r13), %rdx
cmpq %rdx, %rcx
jne 0x152b
testq %rcx, %rcx
jle 0x164a
xorl %ebx, %ebx
xorl %ebp, %ebp
movl (%rax,%rbp,4), %esi
movq 0x10(%r13), %rax
movl (%rax,%rbp,4), %ecx
movq %r12, %rdi
movq %r15, %rdx
callq 0x14d5
testl %eax, %eax
je 0x152b
incq %rbp
movq 0x10(%r14), %rax
movq 0x20(%r14), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %rbp, %rcx
jg 0x1598
jmp 0x164a
movq 0x10(%r14), %rax
movq 0x20(%r14), %rcx
subq %rax, %rcx
movq 0x20(%r13), %rdx
subq 0x10(%r13), %rdx
cmpq %rdx, %rcx
jne 0x152b
testq %rcx, %rcx
jle 0x164a
xorl %ebx, %ebx
xorl %ebp, %ebp
movl (%rax,%rbp,8), %esi
movq 0x10(%r13), %rax
movl (%rax,%rbp,8), %ecx
movq %r12, %rdi
movq %r15, %rdx
callq 0x14d5
testl %eax, %eax
je 0x152b
movq 0x10(%r14), %rax
movl 0x4(%rax,%rbp,8), %esi
movq 0x10(%r13), %rax
movl 0x4(%rax,%rbp,8), %ecx
movq %r12, %rdi
movq %r15, %rdx
callq 0x14d5
testl %eax, %eax
je 0x152b
incq %rbp
movq 0x10(%r14), %rax
movq 0x20(%r14), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %rbp, %rcx
jg 0x15f3
movl $0x1, %ebx
jmp 0x152b
leaq 0x9f0(%rip), %rdi       # 0x204b
leaq 0x9a4(%rip), %rsi       # 0x2006
leaq 0x9e8(%rip), %rcx       # 0x2051
movl $0x56, %edx
callq 0x1120
leaq 0xa19(%rip), %rdi       # 0x2093
leaq 0x985(%rip), %rsi       # 0x2006
leaq 0x9c9(%rip), %rcx       # 0x2051
movl $0x57, %edx
callq 0x1120
leaq 0x96b(%rip), %rdi       # 0x2004
leaq 0x966(%rip), %rsi       # 0x2006
leaq 0x9aa(%rip), %rcx       # 0x2051
movl $0x7a, %edx
callq 0x1120