	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mem_free                       ## -- Begin function mem_free
	.p2align	4, 0x90
_mem_free:                              ## @mem_free
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testq	%rdi, %rdi
	je	LBB0_8
## %bb.1:
	movq	%rdi, %rbx
	movq	_mem_sem@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	callq	_LWP_SemWait
	movq	_ram@GOTPCREL(%rip), %r12
	cmpq	%rbx, (%r12)
	setbe	%al
	movq	_ram_end@GOTPCREL(%rip), %r15
	cmpq	(%r15), %rbx
	setb	%cl
	andb	%al, %cl
	movzbl	%cl, %esi
	leaq	L_.str.1(%rip), %rdi
	callq	_LWIP_ASSERT
	cmpq	%rbx, (%r12)
	ja	LBB0_3
## %bb.2:
	cmpq	(%r15), %rbx
	jae	LBB0_3
## %bb.4:
	movq	_SIZEOF_STRUCT_MEM@GOTPCREL(%rip), %rax
	subq	(%rax), %rbx
	sarq	$2, %rbx
	movl	(%rbx), %esi
	leaq	L_.str.3(%rip), %rdi
	callq	_LWIP_ASSERT
	movl	$0, (%rbx)
	movq	_lfree@GOTPCREL(%rip), %rax
	cmpq	%rbx, (%rax)
	jbe	LBB0_6
## %bb.5:
	movq	%rbx, (%rax)
LBB0_6:
	movq	%rbx, %rdi
	callq	_plug_holes
	jmp	LBB0_7
LBB0_8:
	movq	_MEM_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_DBG_TRACE@GOTPCREL(%rip), %rax
	orl	(%rax), %edi
	orl	$2, %edi
	leaq	L_.str(%rip), %rsi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_LWIP_DEBUGF                    ## TAILCALL
LBB0_3:
	movq	_MEM_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	orl	$3, %edi
	leaq	L_.str.2(%rip), %rsi
	callq	_LWIP_DEBUGF
LBB0_7:
	movl	(%r14), %edi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_LWP_SemPost                    ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_MEM_DEBUG,4,2                  ## @MEM_DEBUG
	.comm	_DBG_TRACE,4,2                  ## @DBG_TRACE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"mem_free(p == NULL) was called.\n"

	.comm	_mem_sem,4,2                    ## @mem_sem
L_.str.1:                               ## @.str.1
	.asciz	"mem_free: legal memory"

	.comm	_ram,8,3                        ## @ram
	.comm	_ram_end,8,3                    ## @ram_end
L_.str.2:                               ## @.str.2
	.asciz	"mem_free: illegal memory\n"

	.comm	_SIZEOF_STRUCT_MEM,8,3          ## @SIZEOF_STRUCT_MEM
L_.str.3:                               ## @.str.3
	.asciz	"mem_free: mem->used"

	.comm	_lfree,8,3                      ## @lfree
	.comm	_lwip_stats,8,2                 ## @lwip_stats
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mem_free                       ; -- Begin function mem_free
	.p2align	2
_mem_free:                              ; @mem_free
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	cbz	x0, LBB0_3
; %bb.1:
	mov	x19, x0
Lloh0:
	adrp	x20, _mem_sem@GOTPAGE
Lloh1:
	ldr	x20, [x20, _mem_sem@GOTPAGEOFF]
	ldr	w0, [x20]
	bl	_LWP_SemWait
Lloh2:
	adrp	x21, _ram@GOTPAGE
Lloh3:
	ldr	x21, [x21, _ram@GOTPAGEOFF]
	ldr	x8, [x21]
	cmp	x8, x19
Lloh4:
	adrp	x22, _ram_end@GOTPAGE
Lloh5:
	ldr	x22, [x22, _ram_end@GOTPAGEOFF]
	ldr	x8, [x22]
	ccmp	x19, x8, #2, ls
	cset	w1, lo
Lloh6:
	adrp	x0, l_.str.1@PAGE
Lloh7:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_LWIP_ASSERT
	ldr	x8, [x21]
	ldr	x9, [x22]
	cmp	x8, x19
	ccmp	x19, x9, #2, ls
	b.lo	LBB0_4
; %bb.2:
Lloh8:
	adrp	x8, _MEM_DEBUG@GOTPAGE
Lloh9:
	ldr	x8, [x8, _MEM_DEBUG@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	orr	w0, w8, #0x3
Lloh11:
	adrp	x1, l_.str.2@PAGE
Lloh12:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_LWIP_DEBUGF
	b	LBB0_7
LBB0_3:
Lloh13:
	adrp	x8, _MEM_DEBUG@GOTPAGE
Lloh14:
	ldr	x8, [x8, _MEM_DEBUG@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
Lloh16:
	adrp	x9, _DBG_TRACE@GOTPAGE
Lloh17:
	ldr	x9, [x9, _DBG_TRACE@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
	orr	w8, w8, w9
	orr	w0, w8, #0x2
Lloh19:
	adrp	x1, l_.str@PAGE
Lloh20:
	add	x1, x1, l_.str@PAGEOFF
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_LWIP_DEBUGF
LBB0_4:
Lloh21:
	adrp	x8, _SIZEOF_STRUCT_MEM@GOTPAGE
Lloh22:
	ldr	x8, [x8, _SIZEOF_STRUCT_MEM@GOTPAGEOFF]
Lloh23:
	ldr	x8, [x8]
	sub	x8, x19, x8
	asr	x19, x8, #2
	ldr	w1, [x19]
Lloh24:
	adrp	x0, l_.str.3@PAGE
Lloh25:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_LWIP_ASSERT
	str	wzr, [x19]
Lloh26:
	adrp	x8, _lfree@GOTPAGE
Lloh27:
	ldr	x8, [x8, _lfree@GOTPAGEOFF]
	ldr	x9, [x8]
	cmp	x9, x19
	b.ls	LBB0_6
; %bb.5:
	str	x19, [x8]
LBB0_6:
	mov	x0, x19
	bl	_plug_holes
LBB0_7:
	ldr	w0, [x20]
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_LWP_SemPost
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_MEM_DEBUG,4,2                  ; @MEM_DEBUG
	.comm	_DBG_TRACE,4,2                  ; @DBG_TRACE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"mem_free(p == NULL) was called.\n"

	.comm	_mem_sem,4,2                    ; @mem_sem
l_.str.1:                               ; @.str.1
	.asciz	"mem_free: legal memory"

	.comm	_ram,8,3                        ; @ram
	.comm	_ram_end,8,3                    ; @ram_end
l_.str.2:                               ; @.str.2
	.asciz	"mem_free: illegal memory\n"

	.comm	_SIZEOF_STRUCT_MEM,8,3          ; @SIZEOF_STRUCT_MEM
l_.str.3:                               ; @.str.3
	.asciz	"mem_free: mem->used"

	.comm	_lfree,8,3                      ; @lfree
	.comm	_lwip_stats,8,2                 ; @lwip_stats
.subsections_via_symbols
