	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pbuf_take                      ## -- Begin function pbuf_take
	.p2align	4, 0x90
_pbuf_take:                             ## @pbuf_take
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r13
	xorl	%esi, %esi
	testq	%rdi, %rdi
	setne	%sil
	leaq	L_.str(%rip), %rdi
	callq	_LWIP_ASSERT
	movq	_PBUF_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_DBG_TRACE@GOTPCREL(%rip), %r15
	orl	(%r15), %edi
	orl	$3, %edi
	movq	%r13, %rsi
	callq	_LWIP_DEBUGF
	xorl	%r12d, %r12d
	movq	_PBUF_FLAG_REF@GOTPCREL(%rip), %r14
	movq	%r13, -48(%rbp)                 ## 8-byte Spill
	jmp	LBB0_1
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_1 Depth=1
	orl	%eax, %edi
	orl	$1, %edi
	leaq	L_.str.9(%rip), %rsi
	callq	_LWIP_DEBUGF
	movq	%r13, %rbx
LBB0_10:                                ##   in Loop: Header=BB0_1 Depth=1
	movq	16(%rbx), %r13
	movq	%rbx, %r12
	testq	%r13, %r13
	je	LBB0_11
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r13), %rcx
	movq	_PBUF_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	(%r15), %eax
	cmpq	(%r14), %rcx
	jne	LBB0_9
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	orl	%edi, %eax
	movl	%eax, %edi
	movq	%r13, %rsi
	callq	_LWIP_DEBUGF
	movq	8(%r13), %rax
	leaq	L_.str.4(%rip), %rsi
	movq	_PBUF_POOL_BUFSIZE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jg	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	_PBUF_RAW@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	movq	_PBUF_POOL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	%rax, %rsi
	callq	_pbuf_alloc
	movq	%rax, %rbx
	leaq	L_.str.3(%rip), %rsi
	testq	%rax, %rax
	jne	LBB0_5
LBB0_4:                                 ##   in Loop: Header=BB0_1 Depth=1
	movq	_PBUF_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	orl	(%r15), %edi
	orl	$2, %edi
	callq	_LWIP_DEBUGF
	movq	_PBUF_RAW@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	8(%r13), %rsi
	movq	_PBUF_RAM@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_pbuf_alloc
	movq	%rax, %rbx
	testq	%rax, %rax
	je	LBB0_8
LBB0_5:                                 ##   in Loop: Header=BB0_1 Depth=1
	movq	%r15, %r14
	movq	16(%r13), %rax
	movq	%rax, 16(%rbx)
	movq	$0, 16(%r13)
	movq	%rbx, %r15
	testq	%r12, %r12
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_1 Depth=1
	xorl	%esi, %esi
	cmpq	%r13, 16(%r12)
	sete	%sil
	leaq	L_.str.6(%rip), %rdi
	callq	_LWIP_ASSERT
	movq	%rbx, 16(%r12)
	movq	-48(%rbp), %r15                 ## 8-byte Reload
LBB0_7:                                 ##   in Loop: Header=BB0_1 Depth=1
	movl	28(%rbx), %edi
	movl	28(%r13), %esi
	movq	8(%r13), %rdx
	callq	_memcpy
	movl	24(%r13), %eax
	movl	%eax, 24(%rbx)
	movq	8(%r13), %rax
	movq	%rax, 8(%rbx)
	movq	%r13, %rdi
	callq	_pbuf_free
	movq	_PBUF_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	callq	_LWIP_DEBUGF
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	movq	%r14, %r15
	movq	_PBUF_FLAG_REF@GOTPCREL(%rip), %r14
	jmp	LBB0_10
LBB0_11:
	movq	_PBUF_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	orl	(%r15), %edi
	orl	$1, %edi
	leaq	L_.str.10(%rip), %rsi
	callq	_LWIP_DEBUGF
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	jmp	LBB0_12
LBB0_8:
	movq	_PBUF_DEBUG@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	orl	(%r15), %edi
	orl	$2, %edi
	leaq	L_.str.5(%rip), %rsi
	callq	_LWIP_DEBUGF
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_pbuf_free
	movl	(%rbx), %edi
	orl	$2, %edi
	movq	%r13, %rsi
	callq	_LWIP_DEBUGF
	xorl	%eax, %eax
LBB0_12:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"pbuf_take: p != NULL\n"

	.comm	_PBUF_DEBUG,4,2                 ## @PBUF_DEBUG
	.comm	_DBG_TRACE,4,2                  ## @DBG_TRACE
	.comm	_PBUF_FLAG_REF,8,3              ## @PBUF_FLAG_REF
	.comm	_PBUF_POOL_BUFSIZE,8,3          ## @PBUF_POOL_BUFSIZE
	.comm	_PBUF_RAW,4,2                   ## @PBUF_RAW
	.comm	_PBUF_POOL,4,2                  ## @PBUF_POOL
L_.str.3:                               ## @.str.3
	.asciz	"pbuf_take: Could not allocate PBUF_POOL\n"

L_.str.4:                               ## @.str.4
	.asciz	"pbuf_take: PBUF_POOL too small to replace PBUF_REF\n"

	.comm	_PBUF_RAM,4,2                   ## @PBUF_RAM
L_.str.5:                               ## @.str.5
	.asciz	"pbuf_take: Could not allocate PBUF_RAM\n"

L_.str.6:                               ## @.str.6
	.asciz	"prev->next == p"

L_.str.9:                               ## @.str.9
	.asciz	"pbuf_take: skipping pbuf not of type PBUF_REF\n"

L_.str.10:                              ## @.str.10
	.asciz	"pbuf_take: end of chain reached.\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pbuf_take                      ; -- Begin function pbuf_take
	.p2align	2
_pbuf_take:                             ; @pbuf_take
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x0
	cmp	x0, #0
	cset	w1, ne
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_LWIP_ASSERT
Lloh2:
	adrp	x24, _PBUF_DEBUG@GOTPAGE
Lloh3:
	ldr	x24, [x24, _PBUF_DEBUG@GOTPAGEOFF]
	ldr	w8, [x24]
Lloh4:
	adrp	x25, _DBG_TRACE@GOTPAGE
Lloh5:
	ldr	x25, [x25, _DBG_TRACE@GOTPAGEOFF]
	ldr	w9, [x25]
	orr	w8, w8, w9
	orr	w0, w8, #0x3
	mov	x1, x19
	bl	_LWIP_DEBUGF
	mov	x27, #0
Lloh6:
	adrp	x26, _PBUF_FLAG_REF@GOTPAGE
Lloh7:
	ldr	x26, [x26, _PBUF_FLAG_REF@GOTPAGEOFF]
Lloh8:
	adrp	x20, _PBUF_RAW@GOTPAGE
Lloh9:
	ldr	x20, [x20, _PBUF_RAW@GOTPAGEOFF]
	mov	x28, x19
Lloh10:
	adrp	x22, l_.str.9@PAGE
Lloh11:
	add	x22, x22, l_.str.9@PAGEOFF
	b	LBB0_3
LBB0_1:                                 ;   in Loop: Header=BB0_3 Depth=1
	orr	w8, w8, w9
	orr	w0, w8, #0x1
	mov	x1, x22
	bl	_LWIP_DEBUGF
	mov	x23, x19
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	x19, [x23, #16]
	mov	x27, x23
	cbz	x19, LBB0_11
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x10, [x19]
	ldr	x11, [x26]
	ldr	w8, [x24]
	ldr	w9, [x25]
	cmp	x10, x11
	b.ne	LBB0_1
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	orr	w0, w9, w8
	mov	x1, x19
	bl	_LWIP_DEBUGF
	ldr	x1, [x19, #8]
Lloh12:
	adrp	x8, _PBUF_POOL_BUFSIZE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _PBUF_POOL_BUFSIZE@GOTPAGEOFF]
Lloh14:
	ldr	x8, [x8]
Lloh15:
	adrp	x2, l_.str.4@PAGE
Lloh16:
	add	x2, x2, l_.str.4@PAGEOFF
	cmp	x1, x8
	b.gt	LBB0_7
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w0, [x20]
Lloh17:
	adrp	x8, _PBUF_POOL@GOTPAGE
Lloh18:
	ldr	x8, [x8, _PBUF_POOL@GOTPAGEOFF]
Lloh19:
	ldr	w2, [x8]
	bl	_pbuf_alloc
	mov	x23, x0
	cbnz	x0, LBB0_8
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=1
Lloh20:
	adrp	x2, l_.str.3@PAGE
Lloh21:
	add	x2, x2, l_.str.3@PAGEOFF
LBB0_7:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [x24]
	ldr	w9, [x25]
	orr	w8, w8, w9
	orr	w0, w8, #0x2
	mov	x1, x2
	bl	_LWIP_DEBUGF
	ldr	w0, [x20]
	ldr	x1, [x19, #8]
Lloh22:
	adrp	x8, _PBUF_RAM@GOTPAGE
Lloh23:
	ldr	x8, [x8, _PBUF_RAM@GOTPAGEOFF]
Lloh24:
	ldr	w2, [x8]
	bl	_pbuf_alloc
	mov	x23, x0
	cbz	x0, LBB0_12
LBB0_8:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x19, #16]
	str	x8, [x23, #16]
	str	xzr, [x19, #16]
	mov	x21, x23
	cbz	x27, LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x27, #16]
	cmp	x8, x19
	cset	w1, eq
Lloh25:
	adrp	x0, l_.str.6@PAGE
Lloh26:
	add	x0, x0, l_.str.6@PAGEOFF
	bl	_LWIP_ASSERT
	str	x23, [x27, #16]
	mov	x21, x28
LBB0_10:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w0, [x23, #28]
	ldr	w1, [x19, #28]
	ldr	x2, [x19, #8]
	bl	_memcpy
	ldr	w8, [x19, #24]
	str	w8, [x23, #24]
	ldr	x8, [x19, #8]
	str	x8, [x23, #8]
	mov	x0, x19
	bl	_pbuf_free
	ldr	w0, [x24]
	mov	x1, x23
	bl	_LWIP_DEBUGF
	mov	x28, x21
	b	LBB0_2
LBB0_11:
	ldr	w8, [x24]
	ldr	w9, [x25]
	orr	w8, w8, w9
	orr	w0, w8, #0x1
Lloh27:
	adrp	x1, l_.str.10@PAGE
Lloh28:
	add	x1, x1, l_.str.10@PAGEOFF
	bl	_LWIP_DEBUGF
	b	LBB0_13
LBB0_12:
	ldr	w8, [x24]
	ldr	w9, [x25]
	orr	w8, w8, w9
	orr	w0, w8, #0x2
Lloh29:
	adrp	x1, l_.str.5@PAGE
Lloh30:
	add	x1, x1, l_.str.5@PAGEOFF
	bl	_LWIP_DEBUGF
	mov	x0, x28
	bl	_pbuf_free
	ldr	w8, [x24]
	orr	w0, w8, #0x2
	mov	x1, x19
	bl	_LWIP_DEBUGF
	mov	x28, #0
LBB0_13:
	mov	x0, x28
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpAdd	Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"pbuf_take: p != NULL\n"

	.comm	_PBUF_DEBUG,4,2                 ; @PBUF_DEBUG
	.comm	_DBG_TRACE,4,2                  ; @DBG_TRACE
	.comm	_PBUF_FLAG_REF,8,3              ; @PBUF_FLAG_REF
	.comm	_PBUF_POOL_BUFSIZE,8,3          ; @PBUF_POOL_BUFSIZE
	.comm	_PBUF_RAW,4,2                   ; @PBUF_RAW
	.comm	_PBUF_POOL,4,2                  ; @PBUF_POOL
l_.str.3:                               ; @.str.3
	.asciz	"pbuf_take: Could not allocate PBUF_POOL\n"

l_.str.4:                               ; @.str.4
	.asciz	"pbuf_take: PBUF_POOL too small to replace PBUF_REF\n"

	.comm	_PBUF_RAM,4,2                   ; @PBUF_RAM
l_.str.5:                               ; @.str.5
	.asciz	"pbuf_take: Could not allocate PBUF_RAM\n"

l_.str.6:                               ; @.str.6
	.asciz	"prev->next == p"

l_.str.9:                               ; @.str.9
	.asciz	"pbuf_take: skipping pbuf not of type PBUF_REF\n"

l_.str.10:                              ; @.str.10
	.asciz	"pbuf_take: end of chain reached.\n"

.subsections_via_symbols
