// File: /workspace/github_c_makefile_star2_O1/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, %r12
callq 0x11f0
movq %rax, %rbx
movq %r14, %rdi
movl %ebp, %esi
callq 0x11f0
testq %rbx, %rbx
je 0x1661
movq %rax, %r13
testq %rax, %rax
je 0x1680
movl (%rbx), %ebp
xorl %r15d, %r15d
cmpl (%r13), %ebp
jne 0x1521
movq 0x8(%rbx), %rdi
movq 0x8(%r13), %rsi
callq 0x1170
testl %eax, %eax
je 0x1533
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x3, %ebp
je 0x15d1
cmpl $0x2, %ebp
je 0x156a
cmpl $0x1, %ebp
jne 0x169f
movq 0x18(%rbx), %rdx
cmpq 0x18(%r13), %rdx
jne 0x1521
movq 0x10(%rbx), %rdi
movq 0x10(%r13), %rsi
callq 0x1040
testl %eax, %eax
jne 0x1521
jmp 0x1656
movq 0x20(%rbx), %rax
subq 0x10(%rbx), %rax
movq 0x20(%r13), %rcx
subq 0x10(%r13), %rcx
cmpq %rcx, %rax
jne 0x1521
movq 0x10(%rbx), %rax
movq 0x20(%rbx), %rcx
subq %rax, %rcx
testq %rcx, %rcx
jle 0x1656
xorl %r15d, %r15d
xorl %ebp, %ebp
movl (%rax,%rbp,4), %esi
movq 0x10(%r13), %rax
movl (%rax,%rbp,4), %ecx
movq %r12, %rdi
movq %r14, %rdx
callq 0x14cb
testl %eax, %eax
je 0x1521
incq %rbp
movq 0x10(%rbx), %rax
movq 0x20(%rbx), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %rbp, %rcx
jg 0x1598
jmp 0x1656
movq 0x20(%rbx), %rax
subq 0x10(%rbx), %rax
movq 0x20(%r13), %rcx
subq 0x10(%r13), %rcx
cmpq %rcx, %rax
jne 0x1521
movq 0x10(%rbx), %rax
movq 0x20(%rbx), %rcx
subq %rax, %rcx
testq %rcx, %rcx
jle 0x1656
xorl %r15d, %r15d
xorl %ebp, %ebp
movl (%rax,%rbp,8), %esi
movq 0x10(%r13), %rax
movl (%rax,%rbp,8), %ecx
movq %r12, %rdi
movq %r14, %rdx
callq 0x14cb
testl %eax, %eax
je 0x1521
movq 0x10(%rbx), %rax
movl 0x4(%rax,%rbp,8), %esi
movq 0x10(%r13), %rax
movl 0x4(%rax,%rbp,8), %ecx
movq %r12, %rdi
movq %r14, %rdx
callq 0x14cb
testl %eax, %eax
je 0x1521
incq %rbp
movq 0x10(%rbx), %rax
movq 0x20(%rbx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %rbp, %rcx
jg 0x15ff
movl $0x1, %r15d
jmp 0x1521
leaq 0x9e3(%rip), %rdi       # 0x204b
leaq 0x997(%rip), %rsi       # 0x2006
leaq 0x9db(%rip), %rcx       # 0x2051
movl $0x56, %edx
callq 0x1120
leaq 0xa0c(%rip), %rdi       # 0x2093
leaq 0x978(%rip), %rsi       # 0x2006
leaq 0x9bc(%rip), %rcx       # 0x2051
movl $0x57, %edx
callq 0x1120
leaq 0x95e(%rip), %rdi       # 0x2004
leaq 0x959(%rip), %rsi       # 0x2006
leaq 0x99d(%rip), %rcx       # 0x2051
movl $0x7a, %edx
callq 0x1120