// File: /workspace/github_c_makefile_star2_O2/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
orq $-0x1, 0x18(%rsp)
orq $-0x1, 0x10(%rsp)
orl $-0x1, 0xc(%rsp)
cmpl $0x2, 0x10(%rdi)
jne 0x6787
movq %rdi, %r14
leaq 0xc(%rsp), %r10
leaq 0x10(%rsp), %r11
leaq 0x41ba(%rip), %rax      # 0xa8db
leaq 0x8158(%rip), %rcx      # 0xe880
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
popq %rcx
popq %rdx
testl %eax, %eax
je 0x679f
movq 0x20(%rsp), %r15
testq %r15, %r15
je 0x679d
movl 0xc(%rsp), %ebp
cmpl $0x64, 0x18(%r14)
movq 0x8(%r15), %rax
movq 0xa8(%rax), %rax
jne 0x67b1
btl $0x1c, %eax
jb 0x67ca
movq 0x7815(%rip), %rax      # 0xdf90
movq (%rax), %rdi
leaq 0x41b4(%rip), %rsi      # 0xa939
jmp 0x6798
movq 0x784a(%rip), %rax      # 0xdfd8
movq (%rax), %rdi
leaq 0x40c4(%rip), %rsi      # 0xa85c
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 0x67d5
movq 0x77d2(%rip), %rax      # 0xdf90
movq (%rax), %rdi
leaq 0x4181(%rip), %rsi      # 0xa949
jmp 0x6798
testb $-0x80, 0x20(%r15)
je 0x686c
movq 0x10(%rsp), %r12
cmpq $-0x1, %r12
jne 0x67e4
movq 0x10(%r15), %r12
movq 0x18(%rsp), %r13
leaq 0x80b8(%rip), %rdi      # 0xe8a8
callq 0x32b0
testq %rax, %rax
je 0x679d
movq %rax, %rbx
movq %r14, 0x10(%rax)
movl 0x30(%r14), %eax
movl %eax, 0x18(%rbx)
movq 0x28(%r14), %rax
andq $0x0, 0x48(%rbx)
andq $0x0, 0x58(%rbx)
cmpl $0x1, %ebp
movq %rax, 0x40(%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 0x346d
testb %al, %al
je 0x685f
leal -0x1(%r13), %eax
cmpq $-0x1, %r13
cltq
cmoveq %r13, %rax
movq %rax, 0x50(%rbx)
movslq %r12d, %rax
movq %rax, 0x60(%rbx)
jmp 0x679f
movq %rbx, %rdi
callq 0x37d5
jmp 0x679d
leaq 0x40ab(%rip), %rdi      # 0xa91e
leaq 0x3ea8(%rip), %rsi      # 0xa722
leaq 0x4060(%rip), %rcx      # 0xa8e1
movl $0x38c, %edx            # imm = 0x38C
callq 0x3130