// File: /workspace/github_c_makefile_star2_O2/WojciechMula[P]pyahocorasick/src/Automaton.c
// Function: automaton_new
static PyObject*
automaton_new(PyTypeObject* self, PyObject* args, PyObject* kwargs) {
    Automaton* automaton;
    int key_type;
    int store;

    automaton = (Automaton*)automaton_create();
    if (UNLIKELY(automaton == NULL))
        return NULL;


    if (UNLIKELY(PyTuple_Size(args) == 7)) {

        int             word_count;
        int             longest_word;
        AutomatonKind   kind;
        KeysStore       store;
        KeyType         key_type;
        PyObject*       bytes_list = NULL;
        PyObject*       values = NULL;

        const char* fmt = "OiiiiiO";

        if (!F(PyArg_ParseTuple)(args, fmt, &bytes_list, &kind, &store, &key_type, &word_count, &longest_word, &values)) {
            PyErr_SetString(PyExc_ValueError, "Unable to load from pickle.");
            goto error;
        }

        if (!check_store(store) || !check_kind(kind) || !check_key_type(key_type)) {
            goto error;
        }

        if (!PyList_CheckExact(bytes_list)) {
            PyErr_SetString(PyExc_TypeError, "Expected list");
            goto error;
        }

        if (kind != EMPTY) {
            if (values == Py_None) {
                Py_XDECREF(values);
                values = NULL;
            }

            if (automaton_unpickle(automaton, bytes_list, values)) {
                automaton->kind     = kind;
                automaton->store    = store;
                automaton->key_type = key_type;
                automaton->count    = word_count;
                automaton->longest_word = longest_word;
            }
            else
                goto error;
        }
    }
    else {
        store    = STORE_ANY;
        key_type = KEY_STRING;

        // construct new object
        if (F(PyArg_ParseTuple)(args, "ii", &store, &key_type)) {
            if (not check_store(store)) {
                goto error;
            }

            if (not check_key_type(key_type)) {
                goto error;
            }
        }
        else if (F(PyArg_ParseTuple)(args, "i", &store)) {
            if (not check_store(store)) {
                goto error;
            }
        }

        PyErr_Clear();
        automaton->store    = store;
        automaton->key_type = key_type;
    }

//ok:
    return (PyObject*)automaton;

error:
    Py_XDECREF(automaton);
    return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rsi, %r14
callq 0x484e
testq %rax, %rax
je 0x4f58
movq %rax, %rbx
movq %r14, %rdi
callq 0x32f0
cmpq $0x7, %rax
je 0x4e9e
leaq 0x18(%rsp), %rdx
movl $0x1e, (%rdx)
leaq 0x30(%rsp), %rcx
movl $0x64, (%rcx)
leaq 0x5aad(%rip), %rsi      # 0xa8de
movq %r14, %rdi
xorl %eax, %eax
callq 0x3240
testl %eax, %eax
je 0x4e5b
movl 0x18(%rsp), %edi
callq 0x3afc
testb %al, %al
je 0x4f50
movl 0x30(%rsp), %edi
callq 0x3b52
jmp 0x4e7e
leaq 0x5ea3(%rip), %rsi      # 0xad05
leaq 0x18(%rsp), %rdx
movq %r14, %rdi
xorl %eax, %eax
callq 0x3240
testl %eax, %eax
je 0x4e86
movl 0x18(%rsp), %edi
callq 0x3afc
testb %al, %al
je 0x4f50
callq 0x3190
movl 0x18(%rsp), %eax
movl %eax, 0x14(%rbx)
movl 0x30(%rsp), %eax
movl %eax, 0x18(%rbx)
jmp 0x4f5a
leaq 0x30(%rsp), %rdx
andq $0x0, (%rdx)
leaq 0x18(%rsp), %r10
andq $0x0, (%r10)
subq $0x8, %rsp
leaq 0x68(%rsp), %r11
leaq 0x6c(%rsp), %r15
leaq 0x60c5(%rip), %rsi      # 0xaf8a
leaq 0x2c(%rsp), %rcx
leaq 0x44(%rsp), %r8
leaq 0x40(%rsp), %r9
movq %r14, %rdi
xorl %eax, %eax
pushq %r10
pushq %r11
pushq %r15
callq 0x3240
addq $0x20, %rsp
testl %eax, %eax
je 0x4f3a
movl 0x3c(%rsp), %edi
callq 0x3afc
testb %al, %al
je 0x4f50
movl 0x24(%rsp), %edi
callq 0x3b2c
testb %al, %al
je 0x4f50
movl 0x38(%rsp), %edi
callq 0x3b52
testb %al, %al
je 0x4f50
movq 0x30(%rsp), %rax
movq %rax, 0x58(%rsp)
movq 0x8(%rax), %rax
cmpq 0x90c8(%rip), %rax      # 0xdff0
je 0x4f6c
leaq 0x607d(%rip), %rsi      # 0xafae
movq 0x9058(%rip), %rax      # 0xdf90
jmp 0x4f48
leaq 0x6051(%rip), %rsi      # 0xaf92
movq 0x9040(%rip), %rax      # 0xdf88
movq (%rax), %rdi
callq 0x3120
movq %rbx, %rdi
callq 0x37d5
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x0, 0x24(%rsp)
je 0x4f5a
movq 0x18(%rsp), %rcx
movq %rcx, 0x40(%rsp)
cmpq 0x903c(%rip), %rcx      # 0xdfc0
je 0x4f8f
movq 0x9063(%rip), %rax      # 0xdff0
jmp 0x4fb8
movq 0x902a(%rip), %rdi      # 0xdfc0
callq 0x37d5
andq $0x0, 0x18(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x58(%rsp)
movq 0x8(%rax), %rax
movq $0x0, 0x40(%rsp)
testb $0x2, 0xab(%rax)
je 0x5489
movq 0x58(%rsp), %r8
movq 0x10(%r8), %r15
xorl %r14d, %r14d
testq %r15, %r15
movl $0x0, %eax
cmovgq %r15, %rax
movq 0x8f9c(%rip), %rdx      # 0xdf80
movq 0xa8(%rdx), %rsi
xorl %edi, %edi
cmpq %r14, %rax
je 0x5069
movq 0x18(%r8), %rcx
movq (%rcx,%r14,8), %rcx
cmpq %rdx, 0x8(%rcx)
jne 0x501b
btl $0x1b, %esi
jae 0x542c
movq 0x20(%rcx), %rcx
testq %rcx, %rcx
jle 0x503b
addq %rcx, %rdi
incq %r14
jmp 0x4fed
movq %rdi, %r12
movq 0x8f63(%rip), %rax      # 0xdf88
movq (%rax), %rdi
leaq 0x6194(%rip), %rsi      # 0xb1c3
movq %r14, %rdx
xorl %eax, %eax
callq 0x3300
jmp 0x5059
movq %rdi, %r12
movq 0x8f43(%rip), %rax      # 0xdf88
movq (%rax), %rdi
leaq 0x61a6(%rip), %rsi      # 0xb1f5
movq %r14, %rdx
xorl %eax, %eax
callq 0x3300
cmpq %r15, %r14
movq %r12, %rdi
jge 0x5069
xorl %r12d, %r12d
jmp 0x53cb
movq %rdi, 0x50(%rsp)
leaq 0x8(,%rdi,8), %rdi
callq 0x3370
movq %rax, 0x10(%rsp)
testq %rax, %rax
je 0x5427
pushq $0x1
popq %rax
movq %rax, 0x48(%rsp)
pushq $0x1
popq %rax
movq %rax, 0x8(%rsp)
movq $0x0, 0x28(%rsp)
movq 0x58(%rsp), %rcx
movq 0x8(%rcx), %rax
testb $0x2, 0xab(%rax)
je 0x544b
movq 0x28(%rsp), %rdx
movl %edx, %edx
cmpq %rdx, 0x10(%rcx)
jle 0x5200
movq 0x18(%rcx), %rax
movq %rdx, 0x28(%rsp)
movq (%rax,%rdx,8), %rcx
movq 0x8(%rcx), %rax
testb $0x8, 0xab(%rax)
je 0x546a
movq 0x10(%rcx), %rax
movq 0x20(%rcx), %rdx
leaq 0x28(%rcx), %r14
movq %rcx, 0x68(%rsp)
leaq (%rcx,%rax), %r15
addq $0x20, %r15
testq %rdx, %rdx
movl $0x0, %eax
cmovleq %rax, %rdx
movq %rdx, 0x70(%rsp)
xorl %r13d, %r13d
cmpq 0x70(%rsp), %r13
je 0x51ef
leaq 0x18(%r14), %rbp
cmpq %r15, %rbp
ja 0x52f1
pushq $0x20
popq %rdi
callq 0x3370
testq %rax, %rax
je 0x5360
movq %rax, %r12
movq (%r14), %rax
movq %rax, (%r12)
movq 0x8(%r14), %rax
movq %rax, 0x8(%r12)
movl 0x10(%r14), %eax
movl %eax, 0x10(%r12)
movb 0x14(%r14), %cl
andq $0x0, 0x18(%r12)
movq 0x8(%rsp), %rdx
leal 0x1(%rdx), %r14d
movb %cl, 0x14(%r12)
movl %edx, %ecx
movq 0x10(%rsp), %rdx
movq %r12, (%rdx,%rcx,8)
testq %rax, %rax
je 0x51dc
imulq $0xc, %rax, %r9
leaq (%r9,%rbp), %rax
cmpq %r15, %rax
ja 0x5323
movq %r9, %rdi
callq 0x3370
movq %rax, 0x18(%r12)
testq %rax, %rax
je 0x5358
xorl %eax, %eax
xorl %ecx, %ecx
movl 0x10(%r12), %edx
cmpq %rdx, %rcx
jae 0x51d5
movq 0x18(%r12), %rdx
movl 0x8(%rbp,%rax), %esi
movl %esi, 0x8(%rdx,%rax)
movq (%rbp,%rax), %rsi
movq %rsi, (%rdx,%rax)
incq %rcx
addq $0xc, %rax
jmp 0x51ac
imulq $0xc, %rdx, %rax
addq %rax, %rbp
incq %r13
movl %r14d, %eax
movq %rax, 0x8(%rsp)
movq %rbp, %r14
jmp 0x5114
movq 0x28(%rsp), %rax
incl %eax
movq %rax, 0x28(%rsp)
jmp 0x50a2
movl 0x8(%rsp), %r15d
movq 0x50(%rsp), %rax
leaq 0x1(%rax), %r14
xorl %r12d, %r12d
pushq $0x4
popq %r13
movq 0x48(%rsp), %rcx
cmpq %r15, %rcx
jae 0x52b7
movq 0x10(%rsp), %rax
movq (%rax,%rcx,8), %rbp
cmpq $0x0, 0x40(%rsp)
je 0x525a
cmpb $0x0, 0x14(%rbp)
je 0x525a
movl %r12d, %esi
movq 0x40(%rsp), %rdi
callq 0x3360
testq %rax, %rax
je 0x5397
incq (%rax)
movq %rax, (%rbp)
incl %r12d
movq 0x8(%rbp), %rcx
testq %rcx, %rcx
je 0x5279
cmpq %rcx, %r14
jbe 0x53fd
movq 0x10(%rsp), %rax
movq (%rax,%rcx,8), %rax
movq %rax, 0x8(%rbp)
movl 0x10(%rbp), %eax
movq %r13, %rdx
xorl %ecx, %ecx
cmpq %rcx, %rax
je 0x52ad
movq 0x18(%rbp), %rsi
movq (%rsi,%rdx), %r8
cmpq %r8, %r14
jbe 0x5372
movq 0x10(%rsp), %rdi
movq (%rdi,%r8,8), %rdi
movq %rdi, (%rsi,%rdx)
incq %rcx
addq $0xc, %rdx
jmp 0x5281
incq 0x48(%rsp)
jmp 0x5215
movq 0x10(%rsp), %rdi
movq 0x8(%rdi), %rax
movq %rax, 0x28(%rbx)
callq 0x3070
movl 0x24(%rsp), %eax
movl %eax, 0x10(%rbx)
movl 0x3c(%rsp), %eax
movl %eax, 0x14(%rbx)
movl 0x38(%rsp), %eax
movl %eax, 0x18(%rbx)
movl 0x64(%rsp), %eax
movl %eax, 0x1c(%rbx)
movl 0x60(%rsp), %eax
movl %eax, 0x20(%rbx)
jmp 0x4f5a
movq 0x8c90(%rip), %rax      # 0xdf88
movq (%rax), %rdi
subq 0x68(%rsp), %r14
addq $-0x20, %r14
leaq 0x5d08(%rip), %rsi      # 0xb013
pushq $0x18
popq %r9
movq %r13, %rdx
movq 0x28(%rsp), %rcx
movq %r14, %r8
xorl %eax, %eax
callq 0x3300
jmp 0x5365
movq 0x8c5e(%rip), %rax      # 0xdf88
movq (%rax), %rdi
movq %r13, %rax
subq 0x68(%rsp), %rax
leaq (%rax,%rbp), %r8
addq $-0x20, %r8
leaq 0x5d32(%rip), %rsi      # 0xb076
xorl %r12d, %r12d
movq %r13, %rdx
movq 0x28(%rsp), %rcx
xorl %eax, %eax
callq 0x3300
jmp 0x539f
movl %r14d, %eax
movq %rax, 0x8(%rsp)
callq 0x30e0
xorl %r12d, %r12d
cmpq $0x0, 0x10(%rsp)
jne 0x5397
jmp 0x53cb
movq 0x8c0f(%rip), %rax      # 0xdf88
movq (%rax), %rdi
movq 0x48(%rsp), %rdx
decq %rdx
leaq 0x5da1(%rip), %rsi      # 0xb12c
movq 0x50(%rsp), %r9
xorl %eax, %eax
callq 0x3300
movq 0x8(%rsp), %rax
movl %eax, %r14d
movl %r14d, %r14d
pushq $0x1
popq %r15
cmpq %r14, %r15
jae 0x53be
movq 0x10(%rsp), %rax
movq (%rax,%r15,8), %rdi
callq 0x43ed
incq %r15
jmp 0x53a6
movq 0x10(%rsp), %rdi
callq 0x3070
movl %r12d, %r12d
movq 0x40(%rsp), %r15
testq %r15, %r15
je 0x4f50
xorl %r14d, %r14d
cmpq %r14, %r12
je 0x4f50
movq %r15, %rdi
movq %r14, %rsi
callq 0x3360
movq %rax, %rdi
callq 0x7776
incq %r14
jmp 0x53dc
movq 0x8b84(%rip), %rax      # 0xdf88
movq (%rax), %rdi
movq 0x48(%rsp), %rdx
decq %rdx
leaq 0x5cc4(%rip), %rsi      # 0xb0da
movq 0x50(%rsp), %r8
xorl %eax, %eax
callq 0x3300
jmp 0x5397
jmp 0x535b
leaq 0x31c8(%rip), %rdi      # 0x85fb
leaq 0x58dc(%rip), %rsi      # 0xad16
leaq 0x5d3e(%rip), %rcx      # 0xb17f
movl $0x134, %edx            # imm = 0x134
callq 0x3130
leaq 0x5b6a(%rip), %rdi      # 0xafbc
leaq 0x58bd(%rip), %rsi      # 0xad16
leaq 0x5b75(%rip), %rcx      # 0xafd5
movl $0x16b, %edx            # imm = 0x16B
callq 0x3130
leaq 0x318a(%rip), %rdi      # 0x85fb
leaq 0x589e(%rip), %rsi      # 0xad16
leaq 0x5b56(%rip), %rcx      # 0xafd5
movl $0x16d, %edx            # imm = 0x16D
callq 0x3130
leaq 0x5b2c(%rip), %rdi      # 0xafbc
leaq 0x587f(%rip), %rsi      # 0xad16
leaq 0x5ce1(%rip), %rcx      # 0xb17f
movl $0x12b, %edx            # imm = 0x12B
callq 0x3130