// File: /workspace/github_c_makefile_star2_O0/cogbee[P]vmir-latest/tlsf/tlsf.c
// Function: integrity_walker
static void integrity_walker(void* ptr, size_t size, int used, void* user)
{
	block_header_t* block = block_from_ptr(ptr);
	integrity_t* integ = tlsf_cast(integrity_t*, user);
	const int this_prev_status = block_is_prev_free(block) ? 1 : 0;
	const int this_status = block_is_free(block) ? 1 : 0;
	const size_t this_block_size = block_size(block);

	int status = 0;

	if(integ->prev_status != this_prev_status) {
		fprintf(stderr, "%p ps %d != %d\n", ptr,
		    integ->prev_status, this_prev_status);
		fail(ptr);
	}

	if(size != this_block_size) {
		fprintf(stderr, "%p size %d != %d\n", ptr,
		    integ->prev_status, this_prev_status);
		fail(ptr);
	}

	tlsf_insist(integ->prev_status == this_prev_status && "prev status incorrect");
	tlsf_insist(size == this_block_size && "block size incorrect");

	integ->prev_status = this_status;
	integ->status += status;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rdi
callq 0x39df0
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rdi
callq 0x39ba0
movl %eax, %edx
xorl %eax, %eax
movl $0x1, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movl %eax, -0x34(%rbp)
movq -0x28(%rbp), %rdi
callq 0x39b80
movl %eax, %edx
xorl %eax, %eax
movl $0x1, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movl %eax, -0x38(%rbp)
movq -0x28(%rbp), %rdi
callq 0x39c30
movq %rax, -0x40(%rbp)
movl $0x0, -0x44(%rbp)
movq -0x30(%rbp), %rax
movl (%rax), %eax
cmpl -0x34(%rbp), %eax
je 0x39a80
movq 0x10598(%rip), %rax     # 0x49ff0
movq (%rax), %rdi
movq -0x8(%rbp), %rdx
movq -0x30(%rbp), %rax
movl (%rax), %ecx
movl -0x34(%rbp), %r8d
leaq 0x7e30(%rip), %rsi      # 0x418a0
movb $0x0, %al
callq 0x32f0
movq -0x8(%rbp), %rdi
callq 0x3aa90
movq -0x10(%rbp), %rax
cmpq -0x40(%rbp), %rax
je 0x39ab9
movq 0x1055f(%rip), %rax     # 0x49ff0
movq (%rax), %rdi
movq -0x8(%rbp), %rdx
movq -0x30(%rbp), %rax
movl (%rax), %ecx
movl -0x34(%rbp), %r8d
leaq 0x7e07(%rip), %rsi      # 0x418b0
movb $0x0, %al
callq 0x32f0
movq -0x8(%rbp), %rdi
callq 0x3aa90
movq -0x30(%rbp), %rax
movl (%rax), %eax
cmpl -0x34(%rbp), %eax
jne 0x39ace
movb $0x1, %al
testb $0x1, %al
jne 0x39acc
jmp 0x39ace
jmp 0x39aed
leaq 0x7e03(%rip), %rdi      # 0x418d8
leaq 0x7a2f(%rip), %rsi      # 0x4150b
movl $0x287, %edx            # imm = 0x287
leaq 0x7e32(%rip), %rcx      # 0x4191a
callq 0x31c0
movq -0x30(%rbp), %rax
movl (%rax), %eax
cmpl -0x34(%rbp), %eax
jne 0x39b00
movb $0x1, %al
testb $0x1, %al
jne 0x39b09
jmp 0x39b00
movl -0x44(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x44(%rbp)
movq -0x10(%rbp), %rax
cmpq -0x40(%rbp), %rax
jne 0x39b1d
movb $0x1, %al
testb $0x1, %al
jne 0x39b1b
jmp 0x39b1d
jmp 0x39b3c
leaq 0x7e3e(%rip), %rdi      # 0x41962
leaq 0x79e0(%rip), %rsi      # 0x4150b
movl $0x288, %edx            # imm = 0x288
leaq 0x7de3(%rip), %rcx      # 0x4191a
callq 0x31c0
movq -0x10(%rbp), %rax
cmpq -0x40(%rbp), %rax
jne 0x39b4e
movb $0x1, %al
testb $0x1, %al
jne 0x39b57
jmp 0x39b4e
movl -0x44(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x44(%rbp)
movl -0x38(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, (%rax)
movl -0x44(%rbp), %ecx
movq -0x30(%rbp), %rax
addl 0x4(%rax), %ecx
movl %ecx, 0x4(%rax)
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)