// File: /workspace/github_c_makefile_star2_O2/WojciechMula[P]pyahocorasick/src/custompickle/pyhelpers.c
// Function: automaton_save_load_parse_args
bool 
automaton_save_load_parse_args(KeysStore store, PyObject* args, SaveLoadParameters* result) {

    PyObject* string;

    if (store == STORE_ANY) {
        if (PyTuple_GET_SIZE(args) != 2) {
            PyErr_SetString(PyExc_ValueError, "expected exactly two arguments");
            return false;
        }
    } else {
        if (PyTuple_GET_SIZE(args) != 1) {
            PyErr_SetString(PyExc_ValueError, "expected exactly one argument");
            return false;
        }
    }

    string = F(PyTuple_GetItem)(args, 0);
    if (UNLIKELY(string == NULL)) {
        return false;
    }

#if defined(PY3K)
    if (UNLIKELY(!F(PyUnicode_Check)(string))) {
        PyErr_SetString(PyExc_TypeError, "the first argument must be a string");
        return false;
    }
#else
    if (UNLIKELY(!F(PyString_Check)(string))) {
        PyErr_SetString(PyExc_TypeError, "the first argument must be a string");
        return false;
    }
#endif

    if (store == STORE_ANY) {
        result->callback = F(PyTuple_GetItem)(args, 1);
        if (UNLIKELY(result->callback == NULL)) {
            return false;
        }

        if (UNLIKELY(!F(PyCallable_Check)(result->callback))) {
            PyErr_SetString(PyExc_TypeError, "the second argument must be a callable object");
            return false;
        }
    }

#if defined(PY3K)
    result->path = F(PyUnicode_AsUTF8String)(string);
#else
    result->path = string;
    Py_INCREF(string);
#endif
    if (UNLIKELY(result->path == NULL)) {
        return false;
    }

    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movl %edi, %ebp
movq 0x8(%rsi), %rax
movq 0xa8(%rax), %rax
cmpl $0x1e, %edi
jne 0x3be0
btl $0x1a, %eax
jae 0x3c97
cmpq $0x2, 0x10(%r14)
je 0x3bf1
movq 0xa3b4(%rip), %rax      # 0xdf88
movq (%rax), %rdi
leaq 0x45bd(%rip), %rsi      # 0x819b
jmp 0x3c5d
btl $0x1a, %eax
jae 0x3cb0
cmpq $0x1, 0x10(%r14)
jne 0x3c4c
xorl %r15d, %r15d
movq %r14, %rdi
xorl %esi, %esi
callq 0x3140
testq %rax, %rax
je 0x3c65
movq %rax, %r12
movq 0x8(%rax), %rax
testb $0x10, 0xab(%rax)
je 0x3c71
cmpl $0x1e, %ebp
jne 0x3c38
pushq $0x1
popq %rsi
movq %r14, %rdi
callq 0x3140
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0x3c62
movq %rax, %rdi
callq 0x32a0
testl %eax, %eax
je 0x3c84
movq %r12, %rdi
callq 0x30b0
movq %rax, (%rbx)
testq %rax, %rax
setne %r15b
jmp 0x3c65
movq 0xa335(%rip), %rax      # 0xdf88
movq (%rax), %rdi
leaq 0x455d(%rip), %rsi      # 0x81ba
callq 0x3120
xorl %r15d, %r15d
movl %r15d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0xa318(%rip), %rax      # 0xdf90
movq (%rax), %rdi
leaq 0x4556(%rip), %rsi      # 0x81d8
jmp 0x3c5d
movq 0xa305(%rip), %rax      # 0xdf90
movq (%rax), %rdi
leaq 0x4567(%rip), %rsi      # 0x81fc
jmp 0x3c5d
leaq 0x447a(%rip), %rdi      # 0x8118
leaq 0x4487(%rip), %rsi      # 0x812c
leaq 0x449d(%rip), %rcx      # 0x8149
pushq $0x9
jmp 0x3cc7
leaq 0x4461(%rip), %rdi      # 0x8118
leaq 0x446e(%rip), %rsi      # 0x812c
leaq 0x4484(%rip), %rcx      # 0x8149
pushq $0xe
popq %rdx
callq 0x3130