// File: /workspace/github_cpp_makefile_star2_O3/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, 0x8(%rsp)
cmpl $0x1, %edi
je 0x29dd
movl %edi, %r15d
xorl %r12d, %r12d
xorl %edi, %edi
callq 0x21a0
movq %rax, %rbx
leaq 0x68(%rsp), %rax
movq %rbx, (%rax)
leaq 0x48(%rsp), %r14
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 %r14, 0x38(%rsp)
movq %r12, 0x40(%rsp)
movb %r12b, 0x48(%rsp)
movl $0x0, 0x60(%rsp)
movq 0x8(%rsp), %rax
movq (%rax,%rbp,8), %rax
movq %rax, 0x58(%rsp)
movq %rbx, %rdi
leaq 0x10(%rsp), %rsi
callq 0x2050
movq %rbx, %rdi
leaq -0x488(%rip), %rsi      # 0x241a
leaq -0x3bc(%rip), %rdx      # 0x24ed
callq 0x20e0
movq %rbx, %rdi
leaq -0x228(%rip), %rsi      # 0x2690
callq 0x2120
movq 0x58(%rsp), %r15
movq %r15, %rdi
callq 0x230c
movl %eax, 0x60(%rsp)
cmpl $0x3, %eax
jne 0x2911
movl $0xe, %edx
movq 0x26f1(%rip), %rdi      # 0x4fd0
leaq 0x75b(%rip), %rsi       # 0x3041
callq 0x2110
movq 0x58(%rsp), %r15
testq %r15, %r15
je 0x2960
movq %r15, %rdi
callq 0x2090
movq 0x26cc(%rip), %rdi      # 0x4fd0
movq %r15, %rsi
movq %rax, %rdx
callq 0x2110
jmp 0x297e
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 0x294a
leaq 0x68(%rsp), %rdi
leaq 0x70(%rsp), %rsi
leaq 0x10(%rsp), %rdx
callq 0x26ae
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2100
leaq 0x70(%rsp), %rdi
callq 0x2060
jmp 0x2996
movq 0x2669(%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 0x2646(%rip), %rdi      # 0x4fd0
leaq 0x6a2(%rip), %rsi       # 0x3033
callq 0x2110
movq 0x38(%rsp), %rdi
cmpq %r14, %rdi
je 0x29ad
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x20f0
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x29c9
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x20f0
incq %rbp
cmpl %ebp, %r13d
jne 0x284a
movq %rbx, %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 0x2a21
jmp 0x2a04
movq %rax, %r14
leaq 0x70(%rsp), %rdi
callq 0x2060
jmp 0x2a07
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x2a2a
movq %rbx, %rdi
callq 0x20c0
movq %r14, %rdi
callq 0x21b0
movq %rax, %rdi
callq 0x2a61
nop