// File: jpcima[P]faustmd/metadata.cpp
// Function: dump_metadata(std::ostream&, Metadata&)
void dump_metadata(std::ostream &o, Metadata &md)
{
    std::string ident_classname = md.classname;
    std::string ident_meta = ident_classname + "_meta";

    o << "#ifndef __" << ident_meta << "_H__" "\n";
    o << "#define __" << ident_meta << "_H__" "\n";

    o << "\n";

    o << "#include <cstddef>" "\n";

    o << "\n";

    o << "#ifndef FAUSTMETA" << "\n";
    o << "#define FAUSTMETA " << ident_meta << "\n";
    o << "#endif" "\n";

    o << "\n";

    o << "#ifdef __GNUC__" "\n";
    o << "#define FMSTATIC __attribute__((unused)) static" "\n";
    o << "#else" "\n";
    o << "#define FMSTATIC static" "\n";
    o << "#endif" "\n";

    o << "\n";

    o << "namespace " << ident_meta << " {" "\n";

    o << "\t" "struct metadata_t { const char *key; const char *value; };" "\n";
    o << "\t" "enum class active_type_t { button, checkbox, vslider, hslider, nentry };\n";
    o << "\t" "enum class passive_type_t { vbargraph, hbargraph };\n";
    o << "\t" "enum class scale_t { linear, log, exp };\n";

    o << "\n";

    o << "\t" "FMSTATIC constexpr char name[] = " << cstrlit(md.name) << ";" "\n";
    o << "\t" "FMSTATIC constexpr char author[] = " << cstrlit(md.author) << ";" "\n";
    o << "\t" "FMSTATIC constexpr char copyright[] = " << cstrlit(md.copyright) << ";" "\n";
    o << "\t" "FMSTATIC constexpr char license[] = " << cstrlit(md.license) << ";" "\n";
    o << "\t" "FMSTATIC constexpr char version[] = " << cstrlit(md.version) << ";" "\n";
    o << "\t" "FMSTATIC constexpr char classname[] = " << cstrlit(md.classname) << ";" "\n";
    o << "\t" "FMSTATIC constexpr unsigned inputs = " << md.inputs << ";" "\n";
    o << "\t" "FMSTATIC constexpr unsigned outputs = " << md.outputs << ";" "\n";
    o << "\t" "FMSTATIC constexpr unsigned actives = " << md.active.size() << ";" "\n";
    o << "\t" "FMSTATIC constexpr unsigned passives = " << md.passive.size() << ";" "\n";

    o << "\n";

    const char *separator;

    o << "\t" "FMSTATIC const metadata_t metadata[] = {";
    separator = "";
    for (const std::pair<std::string, std::string> &md : md.metadata) {
        o << separator << "{" << cstrlit(md.first) << ", " << cstrlit(md.second) << "}";
        separator = ", ";
    }
    o << "};" "\n";

    o << "\n";

    dump_widgets(o, md.active, true);

    o << "\n";

    dump_widgets(o, md.passive, false);

    o << "}\n";

    o << "\n";

    o << "#undef FMSTATIC";

    o << "\n";

    o << "#endif // __" << ident_meta << "_H__" "\n";
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x330, %rsp            # imm = 0x330
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rsi
addq $0xa0, %rsi
leaq -0x30(%rbp), %rdi
movq %rdi, -0x210(%rbp)
callq 0x7220
movq -0x210(%rbp), %rsi
leaq 0x2e3de(%rip), %rdx     # 0x6769a
leaq -0x50(%rbp), %rdi
callq 0x3bc70
jmp 0x392c7
movq -0x8(%rbp), %rdi
leaq 0x2e3ce(%rip), %rsi     # 0x676a0
callq 0x7540
movq %rax, -0x218(%rbp)
jmp 0x392e0
movq -0x218(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x7500
movq %rax, -0x220(%rbp)
jmp 0x392f9
movq -0x220(%rbp), %rdi
leaq 0x2e3a4(%rip), %rsi     # 0x676ab
callq 0x7540
jmp 0x3930e
movq -0x8(%rbp), %rdi
leaq 0x2e398(%rip), %rsi     # 0x676b1
callq 0x7540
movq %rax, -0x228(%rbp)
jmp 0x39327
movq -0x228(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x7500
movq %rax, -0x230(%rbp)
jmp 0x39340
movq -0x230(%rbp), %rdi
leaq 0x2e35d(%rip), %rsi     # 0x676ab
callq 0x7540
jmp 0x39355
movq -0x8(%rbp), %rdi
leaq 0x2d3eb(%rip), %rsi     # 0x6674b
callq 0x7540
jmp 0x39367
movq -0x8(%rbp), %rdi
leaq 0x2e34a(%rip), %rsi     # 0x676bc
callq 0x7540
jmp 0x39379
movq -0x8(%rbp), %rdi
leaq 0x2d3c7(%rip), %rsi     # 0x6674b
callq 0x7540
jmp 0x3938b
movq -0x8(%rbp), %rdi
leaq 0x2e33a(%rip), %rsi     # 0x676d0
callq 0x7540
movq %rax, -0x238(%rbp)
jmp 0x393a4
movq -0x238(%rbp), %rdi
leaq 0x2d399(%rip), %rsi     # 0x6674b
callq 0x7540
jmp 0x393b9
movq -0x8(%rbp), %rdi
leaq 0x2e31e(%rip), %rsi     # 0x676e2
callq 0x7540
movq %rax, -0x240(%rbp)
jmp 0x393d2
movq -0x240(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x7500
movq %rax, -0x248(%rbp)
jmp 0x393eb
movq -0x248(%rbp), %rdi
leaq 0x2d352(%rip), %rsi     # 0x6674b
callq 0x7540
jmp 0x39400
movq -0x8(%rbp), %rdi
leaq 0x2e2ea(%rip), %rsi     # 0x676f5
callq 0x7540
jmp 0x39412
movq -0x8(%rbp), %rdi
leaq 0x2d32e(%rip), %rsi     # 0x6674b
callq 0x7540
jmp 0x39424
movq -0x8(%rbp), %rdi
leaq 0x2e2ce(%rip), %rsi     # 0x676fd
callq 0x7540
jmp 0x39436
movq -0x8(%rbp), %rdi
leaq 0x2e2cd(%rip), %rsi     # 0x6770e
callq 0x7540
jmp 0x39448
movq -0x8(%rbp), %rdi
leaq 0x2e2ec(%rip), %rsi     # 0x6773f
callq 0x7540
jmp 0x3945a
movq -0x8(%rbp), %rdi
leaq 0x2e2e1(%rip), %rsi     # 0x67746
callq 0x7540
jmp 0x3946c
movq -0x8(%rbp), %rdi
leaq 0x2e27e(%rip), %rsi     # 0x676f5
callq 0x7540
jmp 0x3947e
movq -0x8(%rbp), %rdi
leaq 0x2d2c2(%rip), %rsi     # 0x6674b
callq 0x7540
jmp 0x39490
movq -0x8(%rbp), %rdi
leaq 0x2e2c4(%rip), %rsi     # 0x6775f
callq 0x7540
movq %rax, -0x250(%rbp)
jmp 0x394a9
movq -0x250(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x7500
movq %rax, -0x258(%rbp)
jmp 0x394c2
movq -0x258(%rbp), %rdi
leaq 0x2e29a(%rip), %rsi     # 0x6776a
callq 0x7540
jmp 0x394d7
movq -0x8(%rbp), %rdi
leaq 0x2e28c(%rip), %rsi     # 0x6776e
callq 0x7540
jmp 0x394e9
movq -0x8(%rbp), %rdi
leaq 0x2e2b7(%rip), %rsi     # 0x677ab
callq 0x7540
jmp 0x394fb
movq -0x8(%rbp), %rdi
leaq 0x2e2f0(%rip), %rsi     # 0x677f6
callq 0x7540
jmp 0x3950d
movq -0x8(%rbp), %rdi
leaq 0x2e314(%rip), %rsi     # 0x6782c
callq 0x7540
jmp 0x3951f
movq -0x8(%rbp), %rdi
leaq 0x2d221(%rip), %rsi     # 0x6674b
callq 0x7540
jmp 0x39531
movq -0x8(%rbp), %rdi
leaq 0x2e31b(%rip), %rsi     # 0x67857
callq 0x7540
movq %rax, -0x260(%rbp)
jmp 0x3954a
movq -0x10(%rbp), %rsi
leaq -0x90(%rbp), %rdi
callq 0x3bcf0
jmp 0x3955c
movq -0x90(%rbp), %rsi
movq -0x88(%rbp), %rdx
leaq -0x80(%rbp), %rdi
callq 0x39db0
jmp 0x39575
movq -0x260(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x7500
movq %rax, -0x268(%rbp)
jmp 0x3958e
movq -0x268(%rbp), %rdi
leaq 0x2e20c(%rip), %rsi     # 0x677a8
callq 0x7540
jmp 0x395a3
leaq -0x80(%rbp), %rdi
callq 0x7380
movq -0x8(%rbp), %rdi
leaq 0x2e2c3(%rip), %rsi     # 0x6787a
callq 0x7540
movq %rax, -0x270(%rbp)
jmp 0x395c5
movq -0x10(%rbp), %rsi
addq $0x20, %rsi
leaq -0xc0(%rbp), %rdi
callq 0x3bcf0
jmp 0x395db
movq -0xc0(%rbp), %rsi
movq -0xb8(%rbp), %rdx
leaq -0xb0(%rbp), %rdi
callq 0x39db0
jmp 0x395f7
movq -0x270(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x7500
movq %rax, -0x278(%rbp)
jmp 0x39613
movq -0x278(%rbp), %rdi
leaq 0x2e187(%rip), %rsi     # 0x677a8
callq 0x7540
jmp 0x39628
leaq -0xb0(%rbp), %rdi
callq 0x7380
movq -0x8(%rbp), %rdi
leaq 0x2e260(%rip), %rsi     # 0x6789f
callq 0x7540
movq %rax, -0x280(%rbp)
jmp 0x3964d
movq -0x10(%rbp), %rsi
addq $0x40, %rsi
leaq -0xf0(%rbp), %rdi
callq 0x3bcf0
jmp 0x39663
movq -0xf0(%rbp), %rsi
movq -0xe8(%rbp), %rdx
leaq -0xe0(%rbp), %rdi
callq 0x39db0
jmp 0x3967f
movq -0x280(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0x7500
movq %rax, -0x288(%rbp)
jmp 0x3969b
movq -0x288(%rbp), %rdi
leaq 0x2e0ff(%rip), %rsi     # 0x677a8
callq 0x7540
jmp 0x396b0
leaq -0xe0(%rbp), %rdi
callq 0x7380
movq -0x8(%rbp), %rdi
leaq 0x2e200(%rip), %rsi     # 0x678c7
callq 0x7540
movq %rax, -0x290(%rbp)
jmp 0x396d5
movq -0x10(%rbp), %rsi
addq $0x60, %rsi
leaq -0x120(%rbp), %rdi
callq 0x3bcf0
jmp 0x396eb
movq -0x120(%rbp), %rsi
movq -0x118(%rbp), %rdx
leaq -0x110(%rbp), %rdi
callq 0x39db0
jmp 0x39707
movq -0x290(%rbp), %rdi
leaq -0x110(%rbp), %rsi
callq 0x7500
movq %rax, -0x298(%rbp)
jmp 0x39723
movq -0x298(%rbp), %rdi
leaq 0x2e077(%rip), %rsi     # 0x677a8
callq 0x7540
jmp 0x39738
leaq -0x110(%rbp), %rdi
callq 0x7380
movq -0x8(%rbp), %rdi
leaq 0x2e19e(%rip), %rsi     # 0x678ed
callq 0x7540
movq %rax, -0x2a0(%rbp)
jmp 0x3975d
movq -0x10(%rbp), %rsi
subq $-0x80, %rsi
leaq -0x150(%rbp), %rdi
callq 0x3bcf0
jmp 0x39773
movq -0x150(%rbp), %rsi
movq -0x148(%rbp), %rdx
leaq -0x140(%rbp), %rdi
callq 0x39db0
jmp 0x3978f
movq -0x2a0(%rbp), %rdi
leaq -0x140(%rbp), %rsi
callq 0x7500
movq %rax, -0x2a8(%rbp)
jmp 0x397ab
movq -0x2a8(%rbp), %rdi
leaq 0x2dfef(%rip), %rsi     # 0x677a8
callq 0x7540
jmp 0x397c0
leaq -0x140(%rbp), %rdi
callq 0x7380
movq -0x8(%rbp), %rdi
leaq 0x2e13c(%rip), %rsi     # 0x67913
callq 0x7540
movq %rax, -0x2b0(%rbp)
jmp 0x397e5
movq -0x10(%rbp), %rsi
addq $0xa0, %rsi
leaq -0x180(%rbp), %rdi
callq 0x3bcf0
jmp 0x397fe
movq -0x180(%rbp), %rsi
movq -0x178(%rbp), %rdx
leaq -0x170(%rbp), %rdi
callq 0x39db0
jmp 0x3981a
movq -0x2b0(%rbp), %rdi
leaq -0x170(%rbp), %rsi
callq 0x7500
movq %rax, -0x2b8(%rbp)
jmp 0x39836
movq -0x2b8(%rbp), %rdi
leaq 0x2df64(%rip), %rsi     # 0x677a8
callq 0x7540
jmp 0x3984b
leaq -0x170(%rbp), %rdi
callq 0x7380
movq -0x8(%rbp), %rdi
leaq 0x2e0d9(%rip), %rsi     # 0x6793b
callq 0x7540
movq %rax, -0x2c0(%rbp)
jmp 0x39870
movq -0x2c0(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0xd8(%rax), %esi
callq 0x77a0
movq %rax, -0x2c8(%rbp)
jmp 0x3988f
movq -0x2c8(%rbp), %rdi
leaq 0x2df0b(%rip), %rsi     # 0x677a8
callq 0x7540
jmp 0x398a4
movq -0x8(%rbp), %rdi
leaq 0x2e0b3(%rip), %rsi     # 0x67962
callq 0x7540
movq %rax, -0x2d0(%rbp)
jmp 0x398bd
movq -0x2d0(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0xdc(%rax), %esi
callq 0x77a0
movq %rax, -0x2d8(%rbp)
jmp 0x398dc
movq -0x2d8(%rbp), %rdi
leaq 0x2debe(%rip), %rsi     # 0x677a8
callq 0x7540
jmp 0x398f1
movq -0x8(%rbp), %rdi
leaq 0x2e08e(%rip), %rsi     # 0x6798a
callq 0x7540
movq %rax, -0x2e0(%rbp)
jmp 0x3990a
movq -0x10(%rbp), %rdi
addq $0xe0, %rdi
callq 0x3bd40
movq -0x2e0(%rbp), %rdi
movq %rax, %rsi
callq 0x7130
movq %rax, -0x2e8(%rbp)
jmp 0x39932
movq -0x2e8(%rbp), %rdi
leaq 0x2de68(%rip), %rsi     # 0x677a8
callq 0x7540
jmp 0x39947
movq -0x8(%rbp), %rdi
leaq 0x2e060(%rip), %rsi     # 0x679b2
callq 0x7540
movq %rax, -0x2f0(%rbp)
jmp 0x39960
movq -0x10(%rbp), %rdi
addq $0xf8, %rdi
callq 0x3bd40
movq -0x2f0(%rbp), %rdi
movq %rax, %rsi
callq 0x7130
movq %rax, -0x2f8(%rbp)
jmp 0x39988
movq -0x2f8(%rbp), %rdi
leaq 0x2de12(%rip), %rsi     # 0x677a8
callq 0x7540
jmp 0x3999d
movq -0x8(%rbp), %rdi
leaq 0x2cda3(%rip), %rsi     # 0x6674b
callq 0x7540
jmp 0x399af
movq -0x8(%rbp), %rdi
leaq 0x2e021(%rip), %rsi     # 0x679db
callq 0x7540
jmp 0x399c1
leaq 0x2e4c2(%rip), %rax     # 0x67e8a
movq %rax, -0x188(%rbp)
movq -0x10(%rbp), %rax
addq $0xc0, %rax
movq %rax, -0x190(%rbp)
movq -0x190(%rbp), %rdi
callq 0x293c0
movq %rax, -0x198(%rbp)
movq -0x190(%rbp), %rdi
callq 0x291c0
movq %rax, -0x1a0(%rbp)
leaq -0x198(%rbp), %rdi
leaq -0x1a0(%rbp), %rsi
callq 0x3bd70
testb $0x1, %al
jne 0x39a22
jmp 0x39c74
leaq -0x198(%rbp), %rdi
callq 0x296f0
movq %rax, -0x1a8(%rbp)
movq -0x8(%rbp), %rdi
movq -0x188(%rbp), %rsi
callq 0x7540
movq %rax, -0x300(%rbp)
jmp 0x39a4e
movq -0x300(%rbp), %rdi
leaq 0x2e452(%rip), %rsi     # 0x67eae
callq 0x7540
movq %rax, -0x308(%rbp)
jmp 0x39a6a
movq -0x1a8(%rbp), %rsi
leaq -0x1d8(%rbp), %rdi
callq 0xd840
jmp 0x39a7f
movq -0x1d8(%rbp), %rsi
movq -0x1d0(%rbp), %rdx
leaq -0x1c8(%rbp), %rdi
callq 0x39db0
jmp 0x39a9b
movq -0x308(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
callq 0x7500
movq %rax, -0x310(%rbp)
jmp 0x39ab7
movq -0x310(%rbp), %rdi
leaq 0x2df40(%rip), %rsi     # 0x67a05
callq 0x7540
movq %rax, -0x318(%rbp)
jmp 0x39ad3
movq -0x1a8(%rbp), %rsi
addq $0x20, %rsi
leaq -0x208(%rbp), %rdi
callq 0xd840
jmp 0x39aec
movq -0x208(%rbp), %rsi
movq -0x200(%rbp), %rdx
leaq -0x1f8(%rbp), %rdi
callq 0x39db0
jmp 0x39b08
movq -0x318(%rbp), %rdi
leaq -0x1f8(%rbp), %rsi
callq 0x7500
movq %rax, -0x320(%rbp)
jmp 0x39b24
movq -0x320(%rbp), %rdi
leaq 0x2ded6(%rip), %rsi     # 0x67a08
callq 0x7540
jmp 0x39b39
leaq -0x1f8(%rbp), %rdi
callq 0x7380
leaq -0x1c8(%rbp), %rdi
callq 0x7380
leaq 0x2dead(%rip), %rax     # 0x67a05
movq %rax, -0x188(%rbp)
leaq -0x198(%rbp), %rdi
callq 0x3bdb0
jmp 0x39a06
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x39d90
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x39d87
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x7380
jmp 0x39d87
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0x7380
jmp 0x39d87
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0x7380
jmp 0x39d87
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x110(%rbp), %rdi
callq 0x7380
jmp 0x39d87
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x140(%rbp), %rdi
callq 0x7380
jmp 0x39d87
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x170(%rbp), %rdi
callq 0x7380
jmp 0x39d87
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x39c63
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x1f8(%rbp), %rdi
callq 0x7380
leaq -0x1c8(%rbp), %rdi
callq 0x7380
jmp 0x39d87
movq -0x8(%rbp), %rdi
leaq 0x2db28(%rip), %rsi     # 0x677a7
callq 0x7540
jmp 0x39c86
movq -0x8(%rbp), %rdi
leaq 0x2caba(%rip), %rsi     # 0x6674b
callq 0x7540
jmp 0x39c98
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0xe0, %rsi
movl $0x1, %edx
callq 0x3a000
jmp 0x39cb3
movq -0x8(%rbp), %rdi
leaq 0x2ca8d(%rip), %rsi     # 0x6674b
callq 0x7540
jmp 0x39cc5
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0xf8, %rsi
xorl %edx, %edx
callq 0x3a000
jmp 0x39cdd
movq -0x8(%rbp), %rdi
leaq 0x2dd22(%rip), %rsi     # 0x67a0a
callq 0x7540
jmp 0x39cef
movq -0x8(%rbp), %rdi
leaq 0x2ca51(%rip), %rsi     # 0x6674b
callq 0x7540
jmp 0x39d01
movq -0x8(%rbp), %rdi
leaq 0x2dd01(%rip), %rsi     # 0x67a0d
callq 0x7540
jmp 0x39d13
movq -0x8(%rbp), %rdi
leaq 0x2ca2d(%rip), %rsi     # 0x6674b
callq 0x7540
jmp 0x39d25
movq -0x8(%rbp), %rdi
leaq 0x2dced(%rip), %rsi     # 0x67a1d
callq 0x7540
movq %rax, -0x328(%rbp)
jmp 0x39d3e
movq -0x328(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x7500
movq %rax, -0x330(%rbp)
jmp 0x39d57
movq -0x330(%rbp), %rdi
leaq 0x2d946(%rip), %rsi     # 0x676ab
callq 0x7540
jmp 0x39d6c
leaq -0x50(%rbp), %rdi
callq 0x7380
leaq -0x30(%rbp), %rdi
callq 0x7380
addq $0x330, %rsp            # imm = 0x330
popq %rbp
retq
leaq -0x50(%rbp), %rdi
callq 0x7380
leaq -0x30(%rbp), %rdi
callq 0x7380
movq -0x58(%rbp), %rdi
callq 0x7a20
nopw %cs:(%rax,%rax)