	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_btpbuf_realloc                 ## -- Begin function btpbuf_realloc
	.p2align	4, 0x90
_btpbuf_realloc:                        ## @btpbuf_realloc
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	(%rdi), %rcx
	cmpq	%rsi, %rcx
	jle	LBB0_12
## %bb.1:
	movq	%rdi, %rbx
	movq	8(%rdi), %rax
	cmpq	%rsi, %rax
	jge	LBB0_2
## %bb.3:
	movq	%rsi, %r14
	subq	%rax, %r14
	movq	%rsi, (%rbx)
	movq	24(%rbx), %rbx
	movq	8(%rbx), %rax
	cmpq	%rax, %r14
	jle	LBB0_6
## %bb.4:
	subq	%rcx, %rsi
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	addq	%rsi, (%rbx)
	subq	%rax, %r14
	movq	24(%rbx), %rbx
	movq	8(%rbx), %rax
	cmpq	%rax, %r14
	jg	LBB0_5
	jmp	LBB0_6
LBB0_2:
	movq	%rsi, %r14
LBB0_6:
	movq	16(%rbx), %rcx
	movq	_PBUF_FLAG_RAM@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_9
## %bb.7:
	cmpq	%rax, %r14
	je	LBB0_9
## %bb.8:
	movq	32(%rbx), %rsi
	subq	%rbx, %rsi
	sarq	$2, %rsi
	addq	%r14, %rsi
	movq	%rbx, %rdi
	callq	_btmemr_realloc
LBB0_9:
	movq	%r14, 8(%rbx)
	movq	%r14, (%rbx)
	movq	24(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_11
## %bb.10:
	callq	_btpbuf_free
LBB0_11:
	movq	$0, 24(%rbx)
LBB0_12:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PBUF_FLAG_RAM,8,3              ## @PBUF_FLAG_RAM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_btpbuf_realloc                 ; -- Begin function btpbuf_realloc
	.p2align	2
_btpbuf_realloc:                        ; @btpbuf_realloc
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	ldr	x9, [x0]
	cmp	x9, x1
	b.le	LBB0_11
; %bb.1:
	mov	x19, x0
	ldr	x8, [x0, #8]
	cmp	x8, x1
	b.ge	LBB0_5
; %bb.2:
	str	x1, [x19]
	ldr	x19, [x19, #24]
	sub	x20, x1, x8
	ldr	x8, [x19, #8]
	cmp	x20, x8
	b.le	LBB0_6
; %bb.3:
	sub	x9, x1, x9
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x10, [x19]
	add	x10, x9, x10
	str	x10, [x19]
	ldr	x19, [x19, #24]
	sub	x20, x20, x8
	ldr	x8, [x19, #8]
	cmp	x20, x8
	b.gt	LBB0_4
	b	LBB0_6
LBB0_5:
	mov	x20, x1
LBB0_6:
	ldr	x9, [x19, #16]
Lloh0:
	adrp	x10, _PBUF_FLAG_RAM@GOTPAGE
Lloh1:
	ldr	x10, [x10, _PBUF_FLAG_RAM@GOTPAGEOFF]
Lloh2:
	ldr	x10, [x10]
	cmp	x9, x10
	ccmp	x20, x8, #4, eq
	b.eq	LBB0_8
; %bb.7:
	ldr	x8, [x19, #32]
	sub	x8, x8, x19
	add	x1, x20, x8, asr #2
	mov	x0, x19
	bl	_btmemr_realloc
LBB0_8:
	stp	x20, x20, [x19]
	ldr	x0, [x19, #24]
	cbz	x0, LBB0_10
; %bb.9:
	bl	_btpbuf_free
LBB0_10:
	str	xzr, [x19, #24]
LBB0_11:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_PBUF_FLAG_RAM,8,3              ; @PBUF_FLAG_RAM
.subsections_via_symbols
