// File: /workspace/github_c_makefile_star2_O1/WojciechMula[P]pyahocorasick/src/Automaton.c
// Function: automaton_iter
static PyObject*
automaton_iter(PyObject* self, PyObject* args, PyObject* keywds) {
#define automaton ((Automaton*)self)
    static char *kwlist[] = {"string", "start", "end", "ignore_white_space", NULL};

    PyObject* object;
    Py_ssize_t start, start_tmp = -1;
    Py_ssize_t end, end_tmp = -1;
    int ignore_white_space_tmp = -1;
    bool ignore_white_space = false;

    if (automaton->kind != AHOCORASICK) {
        PyErr_SetString(PyExc_AttributeError,"Not an Aho-Corasick automaton yet: "
            "call add_word to add some keys and call make_automaton to "
            "convert the trie to an automaton.");
        return NULL;
    }

    if (!F(PyArg_ParseTupleAndKeywords)(args, keywds, "O|iii", kwlist, &object, &start_tmp, &end_tmp, &ignore_white_space_tmp)) {
        return NULL;
    }

    if (ignore_white_space_tmp == 1) {
        ignore_white_space = true;
    }

    if (object) {
        if (automaton->key_type == KEY_STRING) {
#ifdef PY3K
    #ifdef AHOCORASICK_UNICODE
        if (F(PyUnicode_Check)(object)) {
            start   = 0;
            #if PY_MINOR_VERSION >= 3
                end = PyUnicode_GET_LENGTH(object);
            #else
                end = PyUnicode_GET_SIZE(object);
            #endif
        }
        else {
            PyErr_SetString(PyExc_TypeError, "string required");
            return NULL;
        }
    #else
        if (F(PyBytes_Check)(object)) {
            start   = 0;
            end     = PyBytes_GET_SIZE(object);
        }
        else {
            PyErr_SetString(PyExc_TypeError, "bytes required");
            return NULL;
        }
    #endif
#else
        if (F(PyString_Check)(object)) {
            start   = 0;
            end     = PyString_GET_SIZE(object);
        } else {
            PyErr_SetString(PyExc_TypeError, "string required");
            return NULL;
        }
#endif
        }
        else {
        if (F(PyTuple_Check)(object)) {
            start = 0;
            end = PyTuple_GET_SIZE(object);
        } else {
            PyErr_SetString(PyExc_TypeError, "tuple required");
            return NULL;
        }
        }
    }
    else
        return NULL;

    if (start_tmp != -1) {
        start = start_tmp;
    }

    if (end_tmp != -1) {
        end = end_tmp;
    }

    return automaton_search_iter_new(
        automaton,
        object,
        (int)start,
        (int)end,
        ignore_white_space
    );
#undef automaton
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq $-0x1, %rax
movq %rax, 0x18(%rsp)
movq %rax, 0x10(%rsp)
movl $0xffffffff, 0xc(%rsp)  # imm = 0xFFFFFFFF
cmpl $0x2, 0x10(%rdi)
jne 0x6bed
movq %rdi, %r14
leaq 0xc(%rsp), %r10
leaq 0x10(%rsp), %r11
leaq 0x4d56(%rip), %rax      # 0xb8db
leaq 0x9cf4(%rip), %rcx      # 0x10880
xorl %ebx, %ebx
leaq 0x20(%rsp), %r8
leaq 0x18(%rsp), %r9
movq %rsi, %rdi
movq %rdx, %rsi
movq %rax, %rdx
xorl %eax, %eax
pushq %r10
pushq %r11
callq 0x3270
addq $0x10, %rsp
testl %eax, %eax
je 0x6c05
movq 0x20(%rsp), %r15
testq %r15, %r15
je 0x6c03
movl 0xc(%rsp), %ebp
cmpl $0x64, 0x18(%r14)
movq 0x8(%r15), %rax
movq 0xa8(%rax), %rax
jne 0x6c17
btl $0x1c, %eax
jb 0x6c30
movq 0x93af(%rip), %rax      # 0xff90
movq (%rax), %rdi
leaq 0x4d4e(%rip), %rsi      # 0xb939
jmp 0x6bfe
movq 0x93e4(%rip), %rax      # 0xffd8
movq (%rax), %rdi
leaq 0x4c5e(%rip), %rsi      # 0xb85c
callq 0x3120
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
btl $0x1a, %eax
jb 0x6c3b
movq 0x936c(%rip), %rax      # 0xff90
movq (%rax), %rdi
leaq 0x4d1b(%rip), %rsi      # 0xb949
jmp 0x6bfe
testb $-0x80, 0x20(%r15)
je 0x6cdb
movq 0x10(%rsp), %r12
cmpq $-0x1, %r12
jne 0x6c4a
movq 0x10(%r15), %r12
movq 0x18(%rsp), %r13
leaq 0x9c52(%rip), %rdi      # 0x108a8
callq 0x32b0
testq %rax, %rax
je 0x6c03
movq %rax, %rbx
xorl %eax, %eax
cmpl $0x1, %ebp
movq %r14, 0x10(%rbx)
movl 0x30(%r14), %ecx
movl %ecx, 0x18(%rbx)
movq 0x28(%r14), %rcx
movq %rcx, 0x40(%rbx)
movq %rax, 0x48(%rbx)
movq %rax, 0x58(%rbx)
sete 0x68(%rbx)
movq %rbx, %rdx
addq $0x20, %rdx
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rbx)
incq (%r14)
movq %r14, %rdi
movq %r15, %rsi
callq 0x471d
testb %al, %al
je 0x6cc5
leal -0x1(%r13), %eax
cmpq $-0x1, %r13
cltq
cmoveq %r13, %rax
movq %rax, 0x50(%rbx)
movslq %r12d, %rax
movq %rax, 0x60(%rbx)
jmp 0x6c05
decq (%rbx)
jne 0x6c03
movq %rbx, %rdi
callq 0x30d0
jmp 0x6c03
leaq 0x4c3c(%rip), %rdi      # 0xb91e
leaq 0x4a39(%rip), %rsi      # 0xb722
leaq 0x4bf1(%rip), %rcx      # 0xb8e1
movl $0x38c, %edx            # imm = 0x38C
callq 0x3130