// File: /workspace/github_c_makefile_star2_O1/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl 0x18(%rdi), %eax
movq 0x10(%rdi), %rcx
cmpl 0x30(%rcx), %eax
jne 0x78e6
movq %rdi, %rbx
leaq 0x410e(%rip), %r14      # 0xb8de
leaq 0x47b8(%rip), %r15      # 0xbf8f
leaq 0x42d4(%rip), %r12      # 0xbab2
movq 0x48(%rbx), %rax
movl $0x1, %ebp
testq %rax, %rax
sete %cl
je 0x7874
cmpb $0x0, 0x14(%rax)
jne 0x780f
movq 0x8(%rax), %rax
testq %rax, %rax
sete %cl
je 0x7843
cmpb $0x0, 0x14(%rax)
je 0x77f9
movq %rax, 0x48(%rbx)
testb %cl, %cl
jne 0x7874
movq 0x8(%rax), %rcx
movq %rcx, 0x48(%rbx)
movq 0x10(%rbx), %rcx
movq 0x58(%rbx), %rsi
addq 0x50(%rbx), %rsi
movl 0x14(%rcx), %ecx
cmpl $0xa, %ecx
je 0x7839
cmpl $0x1e, %ecx
je 0x7849
cmpl $0x14, %ecx
jne 0x785d
movq (%rax), %rdx
xorl %ebp, %ebp
movq %r14, %rdi
jmp 0x7851
movq %rax, 0x48(%rbx)
jmp 0x7874
movq (%rax), %rdx
xorl %ebp, %ebp
movq %r15, %rdi
xorl %eax, %eax
callq 0x3330
movq %rax, %r13
jmp 0x7874
movq 0x8724(%rip), %rax      # 0xff88
movq (%rax), %rdi
movq %r12, %rsi
callq 0x3120
movl $0x2, %ebp
testl %ebp, %ebp
je 0x78ff
cmpl $0x2, %ebp
je 0x78fc
incq 0x50(%rbx)
cmpb $0x1, 0x68(%rbx)
jne 0x78b2
movq 0x50(%rbx), %rax
cmpq 0x60(%rbx), %rax
jge 0x78b2
movq 0x28(%rbx), %rcx
movl (%rcx,%rax,4), %edi
callq 0x3290
testl %eax, %eax
je 0x78b2
movq 0x50(%rbx), %rax
incq %rax
movq %rax, 0x50(%rbx)
jmp 0x788f
movq 0x50(%rbx), %rax
cmpq 0x60(%rbx), %rax
jge 0x78fc
movq 0x40(%rbx), %rdi
movq 0x10(%rbx), %rcx
movq 0x28(%rbx), %rdx
movq 0x28(%rcx), %rsi
movl (%rdx,%rax,4), %edx
callq 0x773d
movq %rax, 0x40(%rbx)
testq %rax, %rax
je 0x7911
movq %rax, 0x48(%rbx)
jmp 0x77de
movq 0x869b(%rip), %rax      # 0xff88
movq (%rax), %rdi
leaq 0x4139(%rip), %rsi      # 0xba30
callq 0x3120
xorl %r13d, %r13d
movq %r13, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x452e