// File: /workspace/github_cpp_makefile_star2_O1/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, %r14d
decl %r14d
je 0x2835
movq %rsi, %r15
movl %edi, %ebp
leaq 0x8(%rsi), %rbx
cmpl $0x3, %edi
jl 0x272e
movq (%rbx), %rsi
leaq 0x50(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x29d2
movq 0x50(%rsp), %r14
callq 0x2030
movq %rax, %rbx
movl (%rax), %r12d
movl $0x0, (%rax)
leaq 0x18(%rsp), %r13
movq %r14, %rdi
movq %r13, %rsi
movl $0xa, %edx
callq 0x21d0
cmpq %r14, (%r13)
je 0x2849
movslq %eax, %rcx
cmpq %rax, %rcx
jne 0x2855
movl (%rbx), %ecx
cmpl $0x22, %ecx
je 0x2855
movq %rax, 0x10(%rsp)
testl %ecx, %ecx
jne 0x2673
movl %r12d, (%rbx)
leaq 0x60(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x268e
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x2170
movq 0x10(%r15), %rsi
leaq 0x50(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x29d2
movq 0x50(%rsp), %r13
movq %rbx, %rax
movl (%rbx), %ebx
movq %rax, %r14
movl $0x0, (%rax)
leaq 0x18(%rsp), %r12
movq %r13, %rdi
movq %r12, %rsi
movl $0xa, %edx
callq 0x21d0
cmpq %r13, (%r12)
je 0x2861
movabsq $-0x100000000, %rdx     # imm = 0xFFFFFFFF00000000
leaq -0x80000000(%rax), %rcx
cmpq %rdx, %rcx
jb 0x286d
movl (%r14), %ecx
cmpl $0x22, %ecx
je 0x286d
testl %ecx, %ecx
jne 0x2700
movl %ebx, (%r14)
movq %rax, %r13
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x271f
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x2170
addl $-0x3, %ebp
addq $0x18, %r15
movl %ebp, %r14d
movq %r15, %rbx
jmp 0x273a
movq $0x0, 0x10(%rsp)
xorl %r13d, %r13d
xorl %edi, %edi
callq 0x2220
movq %rax, 0x8(%rsp)
testl %r14d, %r14d
je 0x282b
leaq 0x20(%rsp), %r15
movl %r14d, %r14d
xorl %r12d, %r12d
leaq 0x50(%rsp), %rbp
xorps %xmm0, %xmm0
movups %xmm0, (%r15)
movq $0x0, 0x10(%r15)
movq (%rbx,%r12,8), %rax
movq %rax, 0x18(%rsp)
leaq 0x8(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x10(%rsp), %rax
movl %eax, 0x40(%rsp)
movl %r13d, 0x44(%rsp)
movl $0x0, 0x48(%rsp)
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x2060
movq 0x8(%rsp), %rdi
leaq -0x396(%rip), %rsi      # 0x241c
leaq -0x2c9(%rip), %rdx      # 0x24f0
callq 0x2140
movq 0x8(%rsp), %rdi
leaq -0x253(%rip), %rsi      # 0x2577
callq 0x21a0
movq 0x18(%rsp), %rsi
movq %rbp, %rdi
movl $0x8, %edx
callq 0x2260
movq 0x50(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x70(%rsp,%rax)
jne 0x2803
leaq 0x8(%rsp), %rdi
movq %rbp, %rsi
leaq 0x18(%rsp), %rdx
callq 0x2a80
movq 0x8(%rsp), %rdi
xorl %esi, %esi
callq 0x2180
movq %rbp, %rdi
callq 0x2070
movq %r15, %rdi
callq 0x2c18
incq %r12
cmpl %r12d, %r14d
jne 0x275f
movq 0x8(%rsp), %rdi
callq 0x2120
xorl %eax, %eax
addq $0x258, %rsp            # imm = 0x258
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x7d2(%rip), %rdi       # 0x3022
callq 0x20d0
leaq 0x7c6(%rip), %rdi       # 0x3022
callq 0x21e0
leaq 0x7ba(%rip), %rdi       # 0x3022
callq 0x20d0
leaq 0x7ae(%rip), %rdi       # 0x3022
callq 0x21e0
jmp 0x287b
movq %rax, %r13
jmp 0x28e8
jmp 0x28f0
movq %rax, %r13
cmpl $0x0, (%r14)
jne 0x288e
movl %ebx, (%r14)
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
jmp 0x28ae
movq %rax, %r13
cmpl $0x0, (%rbx)
jne 0x28a5
movl %r12d, (%rbx)
leaq 0x60(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x28e8
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x2170
jmp 0x28e8
jmp 0x28d3
movq %rax, %r13
leaq 0x50(%rsp), %rdi
callq 0x2070
jmp 0x28d6
movq %rax, %r13
movq %r15, %rdi
callq 0x2c18
movq 0x8(%rsp), %rdi
callq 0x2120
movq %r13, %rdi
callq 0x2230
movq %rax, %rdi
callq 0x2c0d