// File: /workspace/github_cpp_makefile_star2_O1/pstuifzand[P]magento-tools/src/magento-helpers.cpp
// Function: root_end_element_handler(void*, char const*)
void root_end_element_handler(void* udata, const XML_Char* name) {
    user_data* data = (user_data*)udata;

    switch (data->state) {
        case State::IN_HELPERS:
        case State::IN_MODELS:
        case State::IN_BLOCKS:
            if (strcmp("helpers", name) == 0) data->state = end_element_next_state[int(data->state)];
            if (strcmp("models", name) == 0) data->state = end_element_next_state[int(data->state)];
            if (strcmp("blocks", name) == 0) data->state = end_element_next_state[int(data->state)];
            break;
        case State::IN_HELPER:
        case State::IN_MODEL:
        case State::IN_BLOCK:
            // here is a tag with a variable name
            // expat checks mismatched tags
            data->state = end_element_next_state[int(data->state)];
            break;
        case State::IN_HELPER_CLASS:
        case State::IN_MODEL_CLASS:
        case State::IN_BLOCK_CLASS:
            // where about to leave the <class> block, so print the info we gathered
            if (strcmp("class", name) == 0) {
                std::cout << section_name[int(data->state)] << data->name << " => " << data->current_text << " (" << pool_name[int(data->pool)] << ")\n";
                data->current_text = "";
                data->state = end_element_next_state[int(data->state)];
            }
            break;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movslq (%rdi), %r15
cmpq $0xa, %r15
ja 0x2656
movq %rsi, %r14
movq %rdi, %rbx
movl $0x124, %eax            # imm = 0x124
btl %r15d, %eax
jb 0x25ef
movl $0x248, %eax            # imm = 0x248
btl %r15d, %eax
jb 0x2647
movl $0x490, %eax            # imm = 0x490
btl %r15d, %eax
jae 0x2656
leaq 0xb1e(%rip), %rdi       # 0x3030
movq %r14, %rsi
callq 0x2150
testl %eax, %eax
jne 0x2656
leaq 0x2807(%rip), %rax      # 0x4d30
movq (%rax,%r15,8), %r14
movq %r14, %rdi
callq 0x2090
movq 0x2a94(%rip), %r15      # 0x4fd0
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x2110
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rdx
movq %r15, %rdi
callq 0x2110
movq %rax, %r15
leaq 0xad2(%rip), %rsi       # 0x3036
movl $0x4, %edx
movq %rax, %rdi
callq 0x2110
leaq 0x28(%rbx), %r14
movq 0x28(%rbx), %rsi
movq 0x30(%rbx), %rdx
movq %r15, %rdi
callq 0x2110
movq %rax, %r15
leaq 0xaac(%rip), %rsi       # 0x303b
movl $0x2, %edx
movq %rax, %rdi
callq 0x2110
movslq 0x50(%rbx), %rax
leaq 0x27e9(%rip), %rcx      # 0x4d90
movq (%rcx,%rax,8), %r12
movq %r12, %rdi
callq 0x2090
movq %r15, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x2110
leaq 0xa76(%rip), %rsi       # 0x303e
movl $0x2, %edx
movq %r15, %rdi
callq 0x2110
movq 0x30(%rbx), %rdx
leaq 0xa60(%rip), %rcx       # 0x3040
movq %r14, %rdi
xorl %esi, %esi
xorl %r8d, %r8d
callq 0x2170
jmp 0x2644
leaq 0xa24(%rip), %rdi       # 0x301a
movq %r14, %rsi
callq 0x2150
testl %eax, %eax
jne 0x260f
leaq 0xab7(%rip), %rax       # 0x30c0
movl (%rax,%r15,4), %eax
movl %eax, (%rbx)
leaq 0xa0c(%rip), %rdi       # 0x3022
movq %r14, %rsi
callq 0x2150
testl %eax, %eax
jne 0x2631
movslq (%rbx), %rax
leaq 0xa94(%rip), %rcx       # 0x30c0
movl (%rcx,%rax,4), %eax
movl %eax, (%rbx)
leaq 0x9f1(%rip), %rdi       # 0x3029
movq %r14, %rsi
callq 0x2150
testl %eax, %eax
jne 0x2656
movl (%rbx), %r15d
movslq %r15d, %rax
leaq 0xa6f(%rip), %rcx       # 0x30c0
movl (%rcx,%rax,4), %eax
movl %eax, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq