// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq $-0x1, -0x38(%rbp)
movq $-0x1, -0x48(%rbp)
movl $0xffffffff, -0x4c(%rbp) # imm = 0xFFFFFFFF
movb $0x0, -0x4d(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x2, 0x10(%rax)
je 0x82dc
movq 0x9d18(%rip), %rax      # 0x11fd8
movq (%rax), %rdi
leaq 0x6608(%rip), %rsi      # 0xe8d2
callq 0x3120
movq $0x0, -0x8(%rbp)
jmp 0x84e2
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq 0x6666(%rip), %rdx      # 0xe951
leaq 0xa58e(%rip), %rcx      # 0x12880
leaq -0x28(%rbp), %r8
leaq -0x38(%rbp), %r9
leaq -0x48(%rbp), %r10
leaq -0x4c(%rbp), %rax
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
movb $0x0, %al
callq 0x3270
cmpl $0x0, %eax
jne 0x8324
movq $0x0, -0x8(%rbp)
jmp 0x84e2
cmpl $0x1, -0x4c(%rbp)
jne 0x832e
movb $0x1, -0x4d(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x8494
movq -0x10(%rbp), %rax
cmpl $0x64, 0x18(%rax)
jne 0x840b
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rdi
movl $0x10000000, %esi       # imm = 0x10000000
callq 0x4450
cmpl $0x0, %eax
je 0x83e3
movq $0x0, -0x30(%rbp)
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rdi
movl $0x10000000, %esi       # imm = 0x10000000
callq 0x4450
cmpl $0x0, %eax
je 0x8383
jmp 0x83a2
leaq 0x65cd(%rip), %rdi      # 0xe957
leaq 0x6407(%rip), %rsi      # 0xe798
movl $0x38c, %edx            # imm = 0x38C
leaq 0x65d2(%rip), %rcx      # 0xe96f
callq 0x3130
movq -0x28(%rbp), %rax
movl 0x20(%rax), %eax
shrl $0x7, %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x83b6
jmp 0x83d5
leaq 0x65ef(%rip), %rdi      # 0xe9ac
leaq 0x63d4(%rip), %rsi      # 0xe798
movl $0x38c, %edx            # imm = 0x38C
leaq 0x659f(%rip), %rcx      # 0xe96f
callq 0x3130
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x40(%rbp)
jmp 0x8406
movq 0x9ba6(%rip), %rax      # 0x11f90
movq (%rax), %rdi
leaq 0x65d3(%rip), %rsi      # 0xe9c7
callq 0x3120
movq $0x0, -0x8(%rbp)
jmp 0x84e2
jmp 0x8492
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rdi
movl $0x4000000, %esi        # imm = 0x4000000
callq 0x4450
cmpl $0x0, %eax
je 0x8470
movq $0x0, -0x30(%rbp)
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rdi
movl $0x4000000, %esi        # imm = 0x4000000
callq 0x4450
cmpl $0x0, %eax
je 0x8443
jmp 0x8462
leaq 0x658d(%rip), %rdi      # 0xe9d7
leaq 0x6347(%rip), %rsi      # 0xe798
movl $0x3ac, %edx            # imm = 0x3AC
leaq 0x6512(%rip), %rcx      # 0xe96f
callq 0x3130
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x40(%rbp)
jmp 0x8490
movq 0x9b19(%rip), %rax      # 0x11f90
movq (%rax), %rdi
leaq 0x656c(%rip), %rsi      # 0xe9ed
callq 0x3120
movq $0x0, -0x8(%rbp)
jmp 0x84e2
jmp 0x8492
jmp 0x849e
movq $0x0, -0x8(%rbp)
jmp 0x84e2
cmpq $-0x1, -0x38(%rbp)
je 0x84ad
movq -0x38(%rbp), %rax
movq %rax, -0x30(%rbp)
cmpq $-0x1, -0x48(%rbp)
je 0x84bc
movq -0x48(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x30(%rbp), %rax
movl %eax, %edx
movq -0x40(%rbp), %rax
movl %eax, %ecx
movb -0x4d(%rbp), %al
andb $0x1, %al
movzbl %al, %r8d
callq 0x9830
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)