// File: /workspace/github_cpp_makefile_star2_O3/jpcima[P]faustmd/metadata.cpp
// Function: extract_metadata(pugi::xml_document const&, Metadata&)
int extract_metadata(const pugi::xml_document &doc, Metadata &md)
{
    pugi::xml_node root = doc.child("faust");

    md.name = root.child_value("name");
    md.author = root.child_value("author");
    md.copyright = root.child_value("copyright");
    md.license = root.child_value("license");
    md.version = root.child_value("version");
    md.classname = root.child_value("classname");
    md.inputs = std::stoi(root.child_value("inputs"));
    md.outputs = std::stoi(root.child_value("outputs"));

    for (pugi::xml_node meta : root.children("meta")) {
        std::string key = meta.attribute("key").value();
        std::string value = meta.child_value();
        md.metadata.emplace_back(key, value);
    }

    for (pugi::xml_node node : root.child("ui").child("activewidgets").children("widget")) {
        if (extract_widget(node, true, md) == -1)
            return -1;
    }

    for (pugi::xml_node node : root.child("ui").child("passivewidgets").children("widget")) {
        if (extract_widget(node, false, md) == -1)
            return -1;
    }

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rsi, %r13
leaq 0x16eff(%rip), %rsi     # 0x2e3d6
callq 0x1b994
leaq 0x8(%rsp), %r14
movq %rax, (%r14)
leaq 0x1ac15(%rip), %rsi     # 0x32100
movq %r14, %rdi
callq 0x1bd3a
movq %rax, %rbx
movq 0x8(%r13), %r15
movq %rax, %rdi
callq 0x51a0
movq %r13, %rdi
xorl %esi, %esi
movq %r15, %rdx
movq %rbx, %rcx
movq %rax, %r8
callq 0x55d0
leaq 0x17dec(%rip), %rsi     # 0x2f308
movq %r14, %rdi
callq 0x1bd3a
movq %rax, %rbx
leaq 0x20(%r13), %r15
movq 0x28(%r13), %r12
movq %rax, %rdi
callq 0x51a0
movq %r15, %rdi
xorl %esi, %esi
movq %r12, %rdx
movq %rbx, %rcx
movq %rax, %r8
callq 0x55d0
leaq 0x17dbe(%rip), %rsi     # 0x2f30f
movq %r14, %rdi
callq 0x1bd3a
movq %rax, %rbx
leaq 0x40(%r13), %r15
movq 0x48(%r13), %r12
movq %rax, %rdi
callq 0x51a0
movq %r15, %rdi
xorl %esi, %esi
movq %r12, %rdx
movq %rbx, %rcx
movq %rax, %r8
callq 0x55d0
leaq 0x17d93(%rip), %rsi     # 0x2f319
movq %r14, %rdi
callq 0x1bd3a
movq %rax, %rbx
leaq 0x60(%r13), %r15
movq 0x68(%r13), %r12
movq %rax, %rdi
callq 0x51a0
movq %r15, %rdi
xorl %esi, %esi
movq %r12, %rdx
movq %rbx, %rcx
movq %rax, %r8
callq 0x55d0
leaq 0x17d66(%rip), %rsi     # 0x2f321
movq %r14, %rdi
callq 0x1bd3a
movq %rax, %rbx
leaq 0x80(%r13), %r15
movq 0x88(%r13), %r12
movq %rax, %rdi
callq 0x51a0
movq %r15, %rdi
xorl %esi, %esi
movq %r12, %rdx
movq %rbx, %rcx
movq %rax, %r8
callq 0x55d0
leaq 0x17d33(%rip), %rsi     # 0x2f329
movq %r14, %rdi
callq 0x1bd3a
movq %rax, %rbx
leaq 0xa0(%r13), %r15
movq 0xa8(%r13), %r12
movq %rax, %rdi
callq 0x51a0
movq %r15, %rdi
xorl %esi, %esi
movq %r12, %rdx
movq %rbx, %rcx
movq %rax, %r8
callq 0x55d0
leaq 0x17d02(%rip), %rsi     # 0x2f333
movq %r14, %rdi
callq 0x1bd3a
leaq 0x58(%rsp), %rdi
leaq 0x10(%rsp), %rdx
movq %rax, %rsi
callq 0x76b4
movq 0x58(%rsp), %rbx
callq 0x5070
movq %rax, %r14
movl (%rax), %ebp
movl $0x0, (%rax)
leaq 0x30(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rsi
movl $0xa, %edx
callq 0x5540
cmpq %rbx, (%r15)
je 0x17a36
movslq %eax, %rcx
cmpq %rax, %rcx
jne 0x17a42
movl (%r14), %ecx
cmpl $0x22, %ecx
je 0x17a42
testl %ecx, %ecx
jne 0x1769d
movl %ebp, (%r14)
movl %eax, 0xd8(%r13)
leaq 0x68(%rsp), %r12
movq -0x10(%r12), %rdi
cmpq %r12, %rdi
je 0x176c0
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x5380
leaq 0x17c73(%rip), %rsi     # 0x2f33a
leaq 0x8(%rsp), %rdi
callq 0x1bd3a
leaq 0x58(%rsp), %rdi
leaq 0x10(%rsp), %rdx
movq %rax, %rsi
callq 0x76b4
movq 0x58(%rsp), %rbx
movl (%r14), %ebp
movl $0x0, (%r14)
leaq 0x30(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rsi
movl $0xa, %edx
callq 0x5540
cmpq %rbx, (%r15)
je 0x17a4e
movabsq $-0x100000000, %rcx     # imm = 0xFFFFFFFF00000000
leaq -0x80000000(%rax), %rdx
cmpq %rcx, %rdx
jb 0x17a5a
movl (%r14), %ecx
cmpl $0x22, %ecx
je 0x17a5a
testl %ecx, %ecx
jne 0x1773d
movl %ebp, (%r14)
movq %r13, 0x50(%rsp)
movl %eax, 0xdc(%r13)
movq 0x58(%rsp), %rdi
cmpq %r12, %rdi
je 0x17760
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x5380
leaq 0x17bdc(%rip), %rdx     # 0x2f343
leaq 0x58(%rsp), %rbx
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x1b954
movq 0x10(%rbx), %rax
leaq 0xb0(%rsp), %rdi
movq %rax, 0x10(%rdi)
movups (%rbx), %xmm0
movaps %xmm0, (%rdi)
movq 0x28(%rbx), %rax
leaq 0x90(%rsp), %rsi
movq %rax, 0x10(%rsi)
movups 0x18(%rbx), %xmm0
movaps %xmm0, (%rsi)
callq 0x20522
testb %al, %al
je 0x17897
movq 0x50(%rsp), %rax
leaq 0xc0(%rax), %r14
leaq 0xb0(%rsp), %r15
leaq 0x88(%rsp), %r13
leaq 0x10(%rsp), %rbp
leaq 0x30(%rsp), %rbx
leaq 0x7(%rsp), %r12
movq %r15, %rdi
callq 0x20542
movq (%rax), %rax
movq %rax, 0x88(%rsp)
movq %r13, %rdi
leaq 0x16cc7(%rip), %rsi     # 0x2e4c2
callq 0x1bad4
movq %rax, 0x10(%rsp)
movq %rbp, %rdi
callq 0x1b0dc
movq %rbx, %rdi
movq %rax, %rsi
movq %r12, %rdx
callq 0x76b4
movq %r13, %rdi
callq 0x1bcee
movq %rbp, %rdi
movq %rax, %rsi
movq %r12, %rdx
callq 0x76b4
movq %r14, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
callq 0x1a7b0
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x1785b
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x5380
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x17877
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x5380
movq %r15, %rdi
callq 0x20596
movq %r15, %rdi
leaq 0x90(%rsp), %rsi
callq 0x20522
testb %al, %al
jne 0x177de
leaq 0x16b57(%rip), %rsi     # 0x2e3f5
leaq 0x8(%rsp), %rdi
callq 0x1b994
leaq 0x10(%rsp), %rbx
movq %rax, (%rbx)
leaq 0x16b41(%rip), %rsi     # 0x2e3f8
movq %rbx, %rdi
callq 0x1b994
leaq 0x30(%rsp), %r14
movq %rax, (%r14)
leaq 0x16b38(%rip), %rdx     # 0x2e406
leaq 0x58(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x1b954
movq 0x10(%r15), %rax
movq %rax, 0x10(%r14)
movups (%r15), %xmm0
movaps %xmm0, (%r14)
movq 0x28(%r15), %rax
movq %rax, 0x10(%rbx)
movups 0x18(%r15), %xmm0
movaps %xmm0, (%rbx)
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x20522
testb %al, %al
movq 0x50(%rsp), %r12
je 0x17958
leaq 0x30(%rsp), %rbx
leaq 0x10(%rsp), %r14
movq %rbx, %rdi
callq 0x20542
movq (%rax), %rdi
movl $0x1, %esi
movq %r12, %rdx
callq 0x17af2
cmpl $-0x1, %eax
je 0x17a1f
movq %rbx, %rdi
callq 0x20596
movq %rbx, %rdi
movq %r14, %rsi
callq 0x20522
testb %al, %al
jne 0x17920
leaq 0x16a96(%rip), %rsi     # 0x2e3f5
leaq 0x8(%rsp), %rdi
callq 0x1b994
leaq 0x10(%rsp), %rbx
movq %rax, (%rbx)
leaq 0x16a9d(%rip), %rsi     # 0x2e415
movq %rbx, %rdi
callq 0x1b994
leaq 0x30(%rsp), %r14
movq %rax, (%r14)
leaq 0x16a77(%rip), %rdx     # 0x2e406
leaq 0x58(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x1b954
movq 0x10(%r15), %rax
movq %rax, 0x10(%r14)
movups (%r15), %xmm0
movaps %xmm0, (%r14)
movq 0x28(%r15), %rax
movq %rax, 0x10(%rbx)
movups 0x18(%r15), %xmm0
movaps %xmm0, (%rbx)
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x20522
movl %eax, %ecx
xorl %eax, %eax
testb %cl, %cl
je 0x17a24
leaq 0x30(%rsp), %rbx
leaq 0x10(%rsp), %r14
movq %rbx, %rdi
callq 0x20542
movq (%rax), %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x17af2
movl %eax, %ebp
cmpl $-0x1, %eax
je 0x17a13
movq %rbx, %rdi
callq 0x20596
movq %rbx, %rdi
movq %r14, %rsi
callq 0x20522
testb %al, %al
jne 0x179e0
xorl %eax, %eax
cmpl $-0x1, %ebp
sete %al
negl %eax
jmp 0x17a24
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x17d75(%rip), %rdi     # 0x2f7b2
callq 0x5220
leaq 0x17d69(%rip), %rdi     # 0x2f7b2
callq 0x5590
leaq 0x17d5d(%rip), %rdi     # 0x2f7b2
callq 0x5220
leaq 0x17d51(%rip), %rdi     # 0x2f7b2
callq 0x5590
jmp 0x17aa3
jmp 0x17aa3
movq %rax, %rbx
cmpl $0x0, (%r14)
jne 0x17a76
movl %ebp, (%r14)
movq 0x58(%rsp), %rdi
cmpq %r12, %rdi
jne 0x17a9c
jmp 0x17aea
movq %rax, %rbx
cmpl $0x0, (%r14)
jne 0x17a8e
movl %ebp, (%r14)
leaq 0x68(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x17aea
movq 0x68(%rsp), %rsi
jmp 0x17ae2
movq %rax, %rbx
jmp 0x17aea
jmp 0x17aaa
movq %rax, %rbx
jmp 0x17ace
movq %rax, %rbx
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x17ace
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x5380
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x17aea
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x5380
movq %rbx, %rdi
callq 0x56d0