// File: /workspace/github_c_makefile_star2_O2/WojciechMula[P]pyahocorasick/src/AutomatonSearchIter.c
// Function: automaton_search_iter_next
static PyObject*
automaton_search_iter_next(PyObject* self) {
    PyObject* output;

    if (iter->version != iter->automaton->version) {
        PyErr_SetString(PyExc_ValueError, "underlaying automaton has changed, iterator is not valid anymore");
        return NULL;
    }

return_output:
    switch (automaton_build_output(self, &output)) {
        case OutputValue:
            return output;

        case OutputNone:
            break;

        case OutputError:
            return NULL;
    }

#ifdef VARIABLE_LEN_CHARCODES
    if (!automaton_search_iter_advance_index(self)) {
        return NULL;
    }
#else
    iter->index += 1;
    if (iter->ignore_white_space) {
        while ((iter->index < iter->end) and iswspace(iter->input.word[iter->index])) {
            iter->index += 1;
        }
    }
#endif
    while (iter->index < iter->end) {
        // process single char
        iter->state = ahocorasick_next(
                        iter->state,
                        iter->automaton->root,
                        iter->input.word[iter->index]
                        );

        ASSERT(iter->state);

        iter->output = iter->state;
        goto return_output;

#ifdef VARIABLE_LEN_CHARCODES
        if (!automaton_search_iter_advance_index(self)) {
            return NULL;
        }
#else
        iter->index += 1;
#endif

    } // while

    return NULL;    // StopIteration
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl 0x18(%rdi), %eax
movq 0x10(%rdi), %r14
cmpl 0x30(%r14), %eax
jne 0x73c7
movq %rdi, %rbx
movq 0x48(%rdi), %rax
testq %rax, %rax
je 0x7366
movq %rax, %rcx
cmpb $0x0, 0x14(%rax)
movq 0x8(%rax), %rax
movq %rax, 0x48(%rbx)
je 0x734b
jmp 0x73e7
movq 0x50(%rbx), %rcx
incq %rcx
movq %rcx, 0x50(%rbx)
cmpb $0x1, 0x68(%rbx)
jne 0x739a
cmpq 0x60(%rbx), %rcx
jge 0x739a
movq 0x28(%rbx), %rax
movl (%rax,%rcx,4), %edi
callq 0x3290
movq 0x50(%rbx), %rcx
testl %eax, %eax
je 0x739a
incq %rcx
movq %rcx, 0x50(%rbx)
jmp 0x7377
cmpq 0x60(%rbx), %rcx
jge 0x73dd
movq 0x40(%rbx), %rdi
movq 0x10(%rbx), %r14
movq 0x28(%rbx), %rax
movq 0x28(%r14), %rsi
movl (%rax,%rcx,4), %edx
callq 0x72d8
movq %rax, 0x40(%rbx)
testq %rax, %rax
je 0x7439
movq %rax, 0x48(%rbx)
jmp 0x734b
movq 0x6bba(%rip), %rax      # 0xdf88
movq (%rax), %rdi
leaq 0x3658(%rip), %rsi      # 0xaa30
callq 0x3120
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x58(%rbx), %rsi
addq 0x50(%rbx), %rsi
movl 0x14(%r14), %eax
cmpl $0xa, %eax
je 0x7402
cmpl $0x1e, %eax
je 0x740e
cmpl $0x14, %eax
jne 0x7426
movq (%rcx), %rdx
leaq 0x34d2(%rip), %rdi      # 0xa8de
jmp 0x7418
movq (%rcx), %rdx
leaq 0x3b77(%rip), %rdi      # 0xaf8f
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3330
movq 0x6b5b(%rip), %rax      # 0xdf88
movq (%rax), %rdi
leaq 0x367b(%rip), %rsi      # 0xaab2
jmp 0x73d8
movq 0x6bb8(%rip), %rbx      # 0xdff8
movq (%rbx), %rdi
leaq 0xbe6(%rip), %rsi       # 0x8030
leaq 0x3620(%rip), %rdx      # 0xaa71
leaq 0x3633(%rip), %rcx      # 0xaa8b
leaq 0x3647(%rip), %r9       # 0xaaa6
movl $0x11c, %r8d            # imm = 0x11C
xorl %eax, %eax
callq 0x31b0
movq (%rbx), %rdi
callq 0x3230
pushq $0x1
popq %rdi
callq 0x3310