// File: /workspace/github_c_makefile_star2_O0/WojciechMula[P]pyahocorasick/src/Automaton.c
// Function: automaton_get
static PyObject*
automaton_get(PyObject* self, PyObject* args) {
#define automaton ((Automaton*)self)
    struct Input input;
    PyObject* py_def;
    Py_ssize_t k;
    TrieNode* node;

    k = PyTuple_GET_SIZE(args);

    if (k < 1 || k > 2) {
        PyErr_Format(PyExc_TypeError, "get() takes one or two arguments (%ld given)", k);
        return NULL;
    }

    if (!prepare_input_from_tuple(self, args, 0, &input)) {
        return NULL;
    }

    node = trie_find(automaton->root, input.word, input.wordlen);

    destroy_input(&input);

    if (node and node->eow) {
        switch (automaton->store) {
            case STORE_INTS:
            case STORE_LENGTH:
                return F(Py_BuildValue)("i", node->output.integer);

            case STORE_ANY:
                Py_INCREF(node->output.object);
                return node->output.object;

            default:
                PyErr_SetNone(PyExc_ValueError);
                return NULL;
        }
    }
    else {
        py_def = F(PyTuple_GetItem)(args, 1);
        if (py_def) {
            Py_INCREF(py_def);
            return py_def;
        }
        else {
            PyErr_Clear();
            PyErr_SetNone(PyExc_KeyError);
            return NULL;
        }
    }
#undef automaton
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
movl $0x4000000, %esi        # imm = 0x4000000
callq 0x4450
cmpl $0x0, %eax
je 0x7a29
jmp 0x7a48
leaq 0x46c8(%rip), %rdi      # 0xc0f8
leaq 0x6d61(%rip), %rsi      # 0xe798
movl $0x1fd, %edx            # imm = 0x1FD
leaq 0x6d65(%rip), %rcx      # 0xe7a8
callq 0x3130
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x48(%rbp)
cmpq $0x1, -0x48(%rbp)
jl 0x7a62
cmpq $0x2, -0x48(%rbp)
jle 0x7a8b
movq 0xa527(%rip), %rax      # 0x11f90
movq (%rax), %rdi
movq -0x48(%rbp), %rdx
leaq 0x6d61(%rip), %rsi      # 0xe7d8
movb $0x0, %al
callq 0x3300
movq $0x0, -0x8(%rbp)
jmp 0x7b9f
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
xorl %edx, %edx
leaq -0x38(%rbp), %rcx
callq 0x39e0
testb $0x1, %al
jne 0x7aaf
movq $0x0, -0x8(%rbp)
jmp 0x7b9f
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rdi
movq -0x30(%rbp), %rsi
movq -0x38(%rbp), %rdx
callq 0x6480
movq %rax, -0x50(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x3a40
cmpq $0x0, -0x50(%rbp)
je 0x7b57
movq -0x50(%rbp), %rax
movzbl 0x14(%rax), %eax
cmpl $0x0, %eax
je 0x7b57
movq -0x10(%rbp), %rax
movl 0x14(%rax), %eax
movl %eax, -0x54(%rbp)
subl $0xa, %eax
je 0x7b0a
jmp 0x7af6
movl -0x54(%rbp), %eax
subl $0x14, %eax
je 0x7b0a
jmp 0x7b00
movl -0x54(%rbp), %eax
subl $0x1e, %eax
je 0x7b25
jmp 0x7b3e
movq -0x50(%rbp), %rax
movq (%rax), %rsi
leaq 0x7291(%rip), %rdi      # 0xeda9
movb $0x0, %al
callq 0x3330
movq %rax, -0x8(%rbp)
jmp 0x7b9f
movq -0x50(%rbp), %rax
movq (%rax), %rdi
callq 0x5820
movq -0x50(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x7b9f
movq 0xa443(%rip), %rax      # 0x11f88
movq (%rax), %rdi
callq 0x3160
movq $0x0, -0x8(%rbp)
jmp 0x7b9f
movq -0x18(%rbp), %rdi
movl $0x1, %esi
callq 0x3140
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
je 0x7b83
movq -0x40(%rbp), %rdi
callq 0x5820
movq -0x40(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x7b9f
callq 0x3190
movq 0xa409(%rip), %rax      # 0x11f98
movq (%rax), %rdi
callq 0x3160
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)