// File: /workspace/github_cpp_makefile_star2_O1/pstuifzand[P]magento-tools/src/magento-helpers.cpp
// Function: main
int main(int argc, char** argv)
{
    // remove program name
    argc--;
    argv++;

    // no arguments
    if (!argc) return 0;

    // create parser
    xml_parser parser;

    while (argc) {
        user_data data = { State::WAIT_FOR_SECTION };
        data.filename = *argv;

        XML_SetUserData(parser.handle(), &data);
        XML_SetElementHandler(parser.handle(), root_start_element_handler, root_end_element_handler);
        XML_SetCharacterDataHandler(parser.handle(), character_data_handler);

        data.pool = find_code_pool(data.filename);
        if (data.pool != CodePool::ERROR) {
            std::ifstream in{data.filename};
            if (in) parse_xml(parser, in, &data);
            parser.reset();
        } else {
            std::cout << "File skipped: " << data.filename << "\n";
        }

        argc--;
        argv++;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x278, %rsp            # imm = 0x278
movq %rsi, 0x68(%rsp)
cmpl $0x1, %edi
je 0x29ea
movl %edi, %r15d
xorl %r12d, %r12d
xorl %edi, %edi
callq 0x21a0
movq %rax, %r14
leaq 0x8(%rsp), %rax
movq %r14, (%rax)
leaq 0x48(%rsp), %rbx
movl %r15d, %r13d
movl $0x1, %ebp
movl $0x1, 0x10(%rsp)
leaq 0x28(%rsp), %rax
movq %rax, 0x18(%rsp)
movq %r12, 0x20(%rsp)
movb %r12b, 0x28(%rsp)
movq %rbx, 0x38(%rsp)
movq %r12, 0x40(%rsp)
movb %r12b, 0x48(%rsp)
movq %r12, 0x58(%rsp)
movl $0x0, 0x60(%rsp)
movq 0x68(%rsp), %rax
movq (%rax,%rbp,8), %rax
movq %rax, 0x58(%rsp)
movq %r14, %rdi
leaq 0x10(%rsp), %rsi
callq 0x2050
movq %r14, %rdi
leaq -0x4b8(%rip), %rsi      # 0x23f7
leaq -0x3f3(%rip), %rdx      # 0x24c3
callq 0x20e0
movq %r14, %rdi
leaq -0x263(%rip), %rsi      # 0x2662
callq 0x2120
movq 0x58(%rsp), %r15
movq %r15, %rdi
callq 0x230c
movl %eax, 0x60(%rsp)
cmpl $0x3, %eax
jne 0x291e
movl $0xe, %edx
movq 0x26e4(%rip), %rdi      # 0x4fd0
leaq 0x75a(%rip), %rsi       # 0x304d
callq 0x2110
movq 0x58(%rsp), %r15
testq %r15, %r15
je 0x296d
movq %r15, %rdi
callq 0x2090
movq 0x26bf(%rip), %rdi      # 0x4fd0
movq %r15, %rsi
movq %rax, %rdx
callq 0x2110
jmp 0x298b
leaq 0x70(%rsp), %rdi
movq %r15, %rsi
movl $0x8, %edx
callq 0x21d0
movq 0x70(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x90(%rsp,%rax)
jne 0x2957
leaq 0x8(%rsp), %rdi
leaq 0x70(%rsp), %rsi
leaq 0x10(%rsp), %rdx
callq 0x2680
movq %r14, %rdi
xorl %esi, %esi
callq 0x2100
leaq 0x70(%rsp), %rdi
callq 0x2060
jmp 0x29a3
movq 0x265c(%rip), %rcx      # 0x4fd0
movq (%rcx), %rax
movq -0x18(%rax), %rax
leaq (%rcx,%rax), %rdi
movl 0x20(%rcx,%rax), %esi
orl $0x1, %esi
callq 0x2180
movl $0x1, %edx
movq 0x2639(%rip), %rdi      # 0x4fd0
leaq 0x6a1(%rip), %rsi       # 0x303f
callq 0x2110
movq 0x38(%rsp), %rdi
cmpq %rbx, %rdi
je 0x29ba
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x20f0
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x29d6
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x20f0
incq %rbp
cmpl %ebp, %r13d
jne 0x2852
movq %r14, %rdi
callq 0x20c0
xorl %eax, %eax
addq $0x278, %rsp            # imm = 0x278
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2a30
jmp 0x2a11
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x2060
jmp 0x2a14
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x2a38
movq 0x8(%rsp), %rdi
callq 0x20c0
movq %rbx, %rdi
callq 0x21b0
movq %rax, %rdi
callq 0x2a6f