// File: /workspace/github_c_makefile_star2_O0/WojciechMula[P]pyahocorasick/src/Automaton_pickle.c
// Function: automaton_unpickle__validate_bytes_list
static bool
automaton_unpickle__validate_bytes_list(PyObject* bytes_list, size_t* result) {

    PyObject* bytes;
    Py_ssize_t k;
    Py_ssize_t nodes_count;
    const uint8_t* data;

    size_t count = 0;

    // calculate the total number of nodes (and do validate data at the same time)
    for (k=0; k < PyList_GET_SIZE(bytes_list); k++) {
        bytes = PyList_GET_ITEM(bytes_list, k);
        if (UNLIKELY(!F(PyBytes_CheckExact)(bytes))) {
            PyErr_Format(PyExc_ValueError,
                         "Item #%lu on the bytes list is not a bytes object",
                         k);
            return false;
        }

        data = (const uint8_t*)PyBytes_AS_STRING(bytes);

        nodes_count = *((Py_ssize_t*)data);
        if (UNLIKELY(nodes_count <= 0)) {
            PyErr_Format(PyExc_ValueError,
                         "Nodes count for item #%lu on the bytes list is not positive (%lu)",
                         k, nodes_count);
            return false;
        }

        count += nodes_count;
    }

    *result = count;
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq $0x0, -0x40(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movl $0x2000000, %esi        # imm = 0x2000000
callq 0x4450
cmpl $0x0, %eax
je 0xb9b1
jmp 0xb9d0
leaq 0x3704(%rip), %rdi      # 0xf0bc
leaq 0x33fb(%rip), %rsi      # 0xedba
movl $0x12b, %edx            # imm = 0x12B
leaq 0x38b4(%rip), %rcx      # 0xf27f
callq 0x3130
movq -0x48(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jge 0xbb1f
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movl $0x2000000, %esi        # imm = 0x2000000
callq 0x4450
cmpl $0x0, %eax
je 0xb9fb
jmp 0xba1a
leaq 0x36ba(%rip), %rdi      # 0xf0bc
leaq 0x33b1(%rip), %rsi      # 0xedba
movl $0x12c, %edx            # imm = 0x12C
leaq 0x386a(%rip), %rcx      # 0xf27f
callq 0x3130
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x28(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
movq 0x6547(%rip), %rsi      # 0x11f80
callq 0x5e50
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0xba78
movq 0x652e(%rip), %rax      # 0x11f88
movq (%rax), %rdi
movq -0x28(%rbp), %rdx
leaq 0x385b(%rip), %rsi      # 0xf2c3
movb $0x0, %al
callq 0x3300
movb $0x0, -0x1(%rbp)
jmp 0xbb2e
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdi
movl $0x8000000, %esi        # imm = 0x8000000
callq 0x4450
cmpl $0x0, %eax
je 0xba91
jmp 0xbab0
leaq 0xb9f(%rip), %rdi       # 0xc637
leaq 0x331b(%rip), %rsi      # 0xedba
movl $0x134, %edx            # imm = 0x134
leaq 0x37d4(%rip), %rcx      # 0xf27f
callq 0x3130
movq -0x20(%rbp), %rax
addq $0x20, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
setle %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0xbb02
movq 0x64a5(%rip), %rax      # 0x11f88
movq (%rax), %rdi
movq -0x28(%rbp), %rdx
movq -0x30(%rbp), %rcx
leaq 0x3800(%rip), %rsi      # 0xf2f5
movb $0x0, %al
callq 0x3300
movb $0x0, -0x1(%rbp)
jmp 0xbb2e
movq -0x30(%rbp), %rax
addq -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0xb990
movq -0x40(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x50, %rsp
popq %rbp
retq