// File: /workspace/github_c_makefile_star2_O0/WojciechMula[P]pyahocorasick/src/pickle/pickle_data.c
// Function: pickle_data__shrink_last_buffer
static bool
pickle_data__shrink_last_buffer(PickleData* data) {

	PyObject* bytes;
	PyObject* new;
	Py_ssize_t last_idx;

	ASSERT(data != NULL);

	if (data->top >= data->size) {
		return true;
	}

	ASSERT(data->bytes_list);

	last_idx = PyList_GET_SIZE(data->bytes_list) - 1;

	bytes = F(PyList_GetItem)(data->bytes_list, last_idx);
	if (UNLIKELY(bytes == NULL)) {
		return false;
	}

	new = F(PyBytes_FromStringAndSize)(PyBytes_AS_STRING(bytes), data->top);
	if (UNLIKELY(new == NULL)) {
		return false;
	}

	if (F(PyList_SetItem)(data->bytes_list, last_idx, new) < 0) {
		return false;
	}

	return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0xad7f
movq 0x72be(%rip), %rax      # 0x11ff8
movq (%rax), %rdi
leaq 0x12cc(%rip), %rsi      # 0xc010
leaq 0x4097(%rip), %rdx      # 0xede2
leaq 0x417d(%rip), %rcx      # 0xeecf
movl $0x42, %r8d
leaq 0x4104(%rip), %r9       # 0xee63
movb $0x0, %al
callq 0x31b0
movq 0x728b(%rip), %rax      # 0x11ff8
movq (%rax), %rdi
callq 0x3230
movl $0x1, %edi
callq 0x3310
jmp 0xad81
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x10(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jb 0xad9c
movb $0x1, -0x1(%rbp)
jmp 0xaf05
jmp 0xad9e
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
jne 0xadf4
movq 0x7249(%rip), %rax      # 0x11ff8
movq (%rax), %rdi
leaq 0x1257(%rip), %rsi      # 0xc010
leaq 0x4022(%rip), %rdx      # 0xede2
leaq 0x4108(%rip), %rcx      # 0xeecf
movl $0x48, %r8d
leaq 0x411b(%rip), %r9       # 0xeeef
movb $0x0, %al
callq 0x31b0
movq 0x7216(%rip), %rax      # 0x11ff8
movq (%rax), %rdi
callq 0x3230
movl $0x1, %edi
callq 0x3310
jmp 0xadf6
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rdi
movl $0x2000000, %esi        # imm = 0x2000000
callq 0x4450
cmpl $0x0, %eax
je 0xae12
jmp 0xae31
leaq 0x40e7(%rip), %rdi      # 0xef00
leaq 0x3fc2(%rip), %rsi      # 0xede2
movl $0x4a, %edx
leaq 0x40f3(%rip), %rcx      # 0xef1f
callq 0x3130
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
subq $0x1, %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x28(%rbp), %rsi
callq 0x3360
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
sete %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0xae76
movb $0x0, -0x1(%rbp)
jmp 0xaf05
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
movl $0x8000000, %esi        # imm = 0x8000000
callq 0x4450
cmpl $0x0, %eax
je 0xae8f
jmp 0xaeae
leaq 0x17a1(%rip), %rdi      # 0xc637
leaq 0x3f45(%rip), %rsi      # 0xede2
movl $0x51, %edx
leaq 0x4076(%rip), %rcx      # 0xef1f
callq 0x3130
movq -0x18(%rbp), %rdi
addq $0x20, %rdi
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rsi
callq 0x30c0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
sete %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0xaee2
movb $0x0, -0x1(%rbp)
jmp 0xaf05
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x28(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x3210
cmpl $0x0, %eax
jge 0xaf01
movb $0x0, -0x1(%rbp)
jmp 0xaf05
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x30, %rsp
popq %rbp
retq