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

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

    int line = 0;
    int col  = 0;

    if (argc >= 2) {
        line = std::stoi(argv[0]);
        col = std::stoi(argv[1]);
        argc -= 2;
        argv += 2;
    }

    // create parser
    xml_parser parser;

    while (argc) {
        user_data data;
        data.filename = *argv;
        data.parser = &parser;
        data.line = line;
        data.col = col;
        data.state = State::NOT_FOUND;

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

        std::ifstream in{data.filename};
        if (in) parse_xml(parser, in, &data);
        parser.reset();

        argc--;
        argv++;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x258, %rsp            # imm = 0x258
movl %edi, %ebp
decl %ebp
je 0x26ea
movq %rsi, %r14
movl %edi, %r15d
leaq 0x8(%rsi), %rbx
movl $0x0, 0x14(%rsp)
cmpl $0x3, %edi
jl 0x25fa
movq (%rbx), %rsi
leaq 0x50(%rsp), %rdi
leaq 0x18(%rsp), %rdx
callq 0x275c
leaq 0x50(%rsp), %rdi
pushq $0xa
popq %rdx
xorl %esi, %esi
callq 0x280c
movl %eax, 0x14(%rsp)
leaq 0x50(%rsp), %rdi
callq 0x20b0
movq 0x10(%r14), %rsi
leaq 0x50(%rsp), %rdi
leaq 0x18(%rsp), %rdx
callq 0x275c
leaq 0x50(%rsp), %rdi
pushq $0xa
popq %rdx
xorl %esi, %esi
callq 0x280c
movl %eax, 0x10(%rsp)
leaq 0x50(%rsp), %rdi
callq 0x20b0
addl $-0x3, %r15d
addq $0x18, %r14
movl %r15d, %ebp
movq %r14, %rbx
jmp 0x2602
movl $0x0, 0x10(%rsp)
xorl %r12d, %r12d
xorl %edi, %edi
callq 0x2220
leaq 0x8(%rsp), %r15
movq %rax, (%r15)
leaq 0x20(%rsp), %r14
movl %ebp, %ebp
leaq 0x50(%rsp), %r13
cmpl %r12d, %ebp
je 0x26e0
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
andq $0x0, 0x10(%r14)
movq (%rbx,%r12,8), %rax
movq %rax, 0x18(%rsp)
movq %r15, 0x38(%rsp)
movl 0x14(%rsp), %eax
movl %eax, 0x40(%rsp)
movl 0x10(%rsp), %eax
movl %eax, 0x44(%rsp)
andl $0x0, 0x48(%rsp)
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x2050
movq 0x8(%rsp), %rdi
leaq -0x28d(%rip), %rsi      # 0x23e6
leaq -0x1e7(%rip), %rdx      # 0x2493
callq 0x2150
movq 0x8(%rsp), %rdi
leaq -0x190(%rip), %rsi      # 0x24fb
callq 0x21b0
movq 0x18(%rsp), %rsi
movq %r13, %rdi
pushq $0x8
popq %rdx
callq 0x2260
movq 0x50(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x70(%rsp,%rax)
jne 0x26c0
movq %r15, %rdi
movq %r13, %rsi
leaq 0x18(%rsp), %rdx
callq 0x2828
movq %r15, %rdi
callq 0x290c
movq %r13, %rdi
callq 0x2060
movq %r14, %rdi
callq 0x29f8
incq %r12
jmp 0x2620
leaq 0x8(%rsp), %rdi
callq 0x2916
xorl %eax, %eax
addq $0x258, %rsp            # imm = 0x258
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2702
jmp 0x2711
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x20b0
jmp 0x273c
movq %rax, %rbx
jmp 0x273c
jmp 0x2727
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x2060
jmp 0x272a
movq %rax, %rbx
movq %r14, %rdi
callq 0x29f8
leaq 0x8(%rsp), %rdi
callq 0x2916
movq %rbx, %rdi
callq 0x2230