	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function netconn_write
_netconn_write:                         ## @netconn_write
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r15d
	movq	%rdx, %r13
	movq	%rsi, %r12
	movq	%rdi, %rbx
	movq	$0, -80(%rbp)
	movq	_API_LIB_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	(%rbx), %rsi
	callq	_LWIP_DEBUGF
	movq	(%rbx), %rax
	movq	_ERR_OK@GOTPCREL(%rip), %r14
	cmpq	(%r14), %rax
	jne	LBB0_17
## %bb.1:
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	movq	%r13, -48(%rbp)                 ## 8-byte Spill
	movq	_MEMP_API_MSG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_memp_malloc
	testq	%rax, %rax
	je	LBB0_2
## %bb.3:
	movq	%rax, %r13
	movl	%r15d, -52(%rbp)                ## 4-byte Spill
	movq	_APIMSG_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 32(%r13)
	movq	%rbx, 24(%r13)
	movq	_NETCONN_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%rbx)
	movq	(%rbx), %rax
	cmpq	(%r14), %rax
	jne	LBB0_16
## %bb.4:
	cmpq	$0, -48(%rbp)                   ## 8-byte Folded Reload
	jle	LBB0_16
## %bb.5:
	movslq	-52(%rbp), %rax                 ## 4-byte Folded Reload
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
LBB0_6:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_7 Depth 2
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, 16(%r13)
	movl	-52(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, 8(%r13)
	movq	8(%rbx), %rax
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	movq	_NETCONN_TCP@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_10
	.p2align	4, 0x90
LBB0_7:                                 ##   Parent Loop BB0_6 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	28(%rbx), %edi
	callq	_tcp_sndbuf
	testq	%rax, %rax
	jne	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=2
	movq	_API_LIB_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	(%rbx), %rsi
	callq	_LWIP_DEBUGF
	movl	20(%rbx), %edi
	callq	_LWP_SemWait
	movq	(%rbx), %rax
	cmpq	(%r14), %rax
	je	LBB0_7
	jmp	LBB0_16
LBB0_9:                                 ##   in Loop: Header=BB0_6 Depth=1
	movq	%rax, %r15
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	cmpq	%r15, %rax
	cmovlq	%rax, %r15
LBB0_10:                                ##   in Loop: Header=BB0_6 Depth=1
	movq	_API_LIB_DEBUG@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	callq	_LWIP_DEBUGF
	movq	%r15, (%r13)
	movq	%r13, %rdi
	callq	_apimsg_post
	movl	24(%rbx), %edi
	movq	_MQ_MSG_BLOCK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-80(%rbp), %rsi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_MQ_Receive
	movq	(%rbx), %rsi
	cmpq	(%r14), %rsi
	jne	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_6 Depth=1
	movl	(%r12), %edi
	movq	%r15, %rsi
	callq	_LWIP_DEBUGF
	addq	%r15, -64(%rbp)                 ## 8-byte Folded Spill
	subq	%r15, -48(%rbp)                 ## 8-byte Folded Spill
	jmp	LBB0_14
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_6 Depth=1
	movl	(%r12), %edi
	movq	_ERR_MEM@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rsi
	jne	LBB0_18
## %bb.13:                              ##   in Loop: Header=BB0_6 Depth=1
	leaq	L_.str.4(%rip), %rsi
	callq	_LWIP_DEBUGF
	movq	(%r14), %rax
	movq	%rax, (%rbx)
	movl	20(%rbx), %edi
	callq	_LWP_SemWait
LBB0_14:                                ##   in Loop: Header=BB0_6 Depth=1
	movq	(%rbx), %rax
	cmpq	(%r14), %rax
	jne	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_6 Depth=1
	cmpq	$0, -48(%rbp)                   ## 8-byte Folded Reload
	jg	LBB0_6
	jmp	LBB0_16
LBB0_2:
	movq	_ERR_MEM@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%rbx)
	jmp	LBB0_17
LBB0_18:
	callq	_LWIP_DEBUGF
LBB0_16:
	movq	_MEMP_API_MSG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r13, %rsi
	callq	_memp_free
	movq	_NETCONN_NONE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%rbx)
	movq	(%rbx), %rax
LBB0_17:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_API_LIB_DEBUG,4,2              ## @API_LIB_DEBUG
	.comm	_ERR_VAL,8,3                    ## @ERR_VAL
	.comm	_ERR_OK,8,3                     ## @ERR_OK
	.comm	_MEMP_API_MSG,4,2               ## @MEMP_API_MSG
	.comm	_ERR_MEM,8,3                    ## @ERR_MEM
	.comm	_APIMSG_WRITE,4,2               ## @APIMSG_WRITE
	.comm	_NETCONN_WRITE,4,2              ## @NETCONN_WRITE
	.comm	_NETCONN_TCP,8,3                ## @NETCONN_TCP
	.comm	_MQ_MSG_BLOCK,4,2               ## @MQ_MSG_BLOCK
	.section	__TEXT,__cstring,cstring_literals
L_.str.4:                               ## @.str.4
	.asciz	"netconn_write: mem err\n"

	.comm	_NETCONN_NONE,4,2               ## @NETCONN_NONE
	.no_dead_strip	_netconn_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function netconn_write
_netconn_write:                         ; @netconn_write
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x20, x3
	mov	x21, x2
	mov	x22, x1
	mov	x19, x0
	str	xzr, [sp, #8]
Lloh0:
	adrp	x27, _API_LIB_DEBUG@GOTPAGE
Lloh1:
	ldr	x27, [x27, _API_LIB_DEBUG@GOTPAGEOFF]
	ldr	w0, [x27]
	ldr	x1, [x19]
	bl	_LWIP_DEBUGF
	ldr	x0, [x19]
Lloh2:
	adrp	x25, _ERR_OK@GOTPAGE
Lloh3:
	ldr	x25, [x25, _ERR_OK@GOTPAGEOFF]
	ldr	x8, [x25]
	cmp	x0, x8
	b.ne	LBB0_5
; %bb.1:
Lloh4:
	adrp	x28, _MEMP_API_MSG@GOTPAGE
Lloh5:
	ldr	x28, [x28, _MEMP_API_MSG@GOTPAGEOFF]
	ldr	w0, [x28]
	bl	_memp_malloc
	cbz	x0, LBB0_4
; %bb.2:
	mov	x23, x0
Lloh6:
	adrp	x8, _APIMSG_WRITE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _APIMSG_WRITE@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	str	w8, [x0, #32]
	str	x19, [x0, #24]
Lloh9:
	adrp	x8, _NETCONN_WRITE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _NETCONN_WRITE@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	str	w8, [x19, #16]
	ldr	x8, [x19]
	ldr	x9, [x25]
	cmp	x8, x9
	ccmp	x21, #1, #8, eq
	b.ge	LBB0_6
LBB0_3:
	ldr	w0, [x28]
	mov	x1, x23
	bl	_memp_free
Lloh12:
	adrp	x8, _NETCONN_NONE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _NETCONN_NONE@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	str	w8, [x19, #16]
	ldr	x0, [x19]
	b	LBB0_5
LBB0_4:
Lloh15:
	adrp	x8, _ERR_MEM@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ERR_MEM@GOTPAGEOFF]
Lloh17:
	ldr	x0, [x8]
	str	x0, [x19]
LBB0_5:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_6:
	sxtw	x24, w20
	b	LBB0_9
LBB0_7:                                 ;   in Loop: Header=BB0_9 Depth=1
	ldr	w0, [x27]
	mov	x1, x26
	bl	_LWIP_DEBUGF
	add	x22, x22, x26
	sub	x21, x21, x26
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=1
	ldr	x8, [x19]
	ldr	x9, [x25]
	cmp	x8, x9
	ccmp	x21, #0, #4, eq
	b.le	LBB0_3
LBB0_9:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_10 Depth 2
	str	x22, [x23, #16]
	str	w20, [x23, #8]
	ldr	x8, [x19, #8]
Lloh18:
	adrp	x9, _NETCONN_TCP@GOTPAGE
Lloh19:
	ldr	x9, [x9, _NETCONN_TCP@GOTPAGEOFF]
Lloh20:
	ldr	x9, [x9]
	mov	x26, x21
	cmp	x8, x9
	b.ne	LBB0_13
LBB0_10:                                ;   Parent Loop BB0_9 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w0, [x19, #28]
	bl	_tcp_sndbuf
	cbnz	x0, LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=2
	ldr	w0, [x27]
	ldr	x1, [x19]
	bl	_LWIP_DEBUGF
	ldr	w0, [x19, #20]
	bl	_LWP_SemWait
	ldr	x8, [x19]
	ldr	x9, [x25]
	cmp	x8, x9
	b.eq	LBB0_10
	b	LBB0_3
LBB0_12:                                ;   in Loop: Header=BB0_9 Depth=1
	cmp	x21, x0
	csel	x26, x21, x0, lt
LBB0_13:                                ;   in Loop: Header=BB0_9 Depth=1
	ldr	w0, [x27]
	mov	x1, x24
	bl	_LWIP_DEBUGF
	str	x26, [x23]
	mov	x0, x23
	bl	_apimsg_post
	ldr	w0, [x19, #24]
Lloh21:
	adrp	x8, _MQ_MSG_BLOCK@GOTPAGE
Lloh22:
	ldr	x8, [x8, _MQ_MSG_BLOCK@GOTPAGEOFF]
Lloh23:
	ldr	w2, [x8]
	add	x1, sp, #8
	bl	_MQ_Receive
	ldr	x1, [x19]
	ldr	x8, [x25]
	cmp	x1, x8
	b.eq	LBB0_7
; %bb.14:                               ;   in Loop: Header=BB0_9 Depth=1
Lloh24:
	adrp	x8, _ERR_MEM@GOTPAGE
Lloh25:
	ldr	x8, [x8, _ERR_MEM@GOTPAGEOFF]
Lloh26:
	ldr	x8, [x8]
	ldr	w0, [x27]
	cmp	x1, x8
	b.ne	LBB0_16
; %bb.15:                               ;   in Loop: Header=BB0_9 Depth=1
Lloh27:
	adrp	x1, l_.str.4@PAGE
Lloh28:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_LWIP_DEBUGF
	ldr	x8, [x25]
	str	x8, [x19]
	ldr	w0, [x19, #20]
	bl	_LWP_SemWait
	b	LBB0_8
LBB0_16:
	bl	_LWIP_DEBUGF
	b	LBB0_3
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_API_LIB_DEBUG,4,2              ; @API_LIB_DEBUG
	.comm	_ERR_VAL,8,3                    ; @ERR_VAL
	.comm	_ERR_OK,8,3                     ; @ERR_OK
	.comm	_MEMP_API_MSG,4,2               ; @MEMP_API_MSG
	.comm	_ERR_MEM,8,3                    ; @ERR_MEM
	.comm	_APIMSG_WRITE,4,2               ; @APIMSG_WRITE
	.comm	_NETCONN_WRITE,4,2              ; @NETCONN_WRITE
	.comm	_NETCONN_TCP,8,3                ; @NETCONN_TCP
	.comm	_MQ_MSG_BLOCK,4,2               ; @MQ_MSG_BLOCK
	.section	__TEXT,__cstring,cstring_literals
l_.str.4:                               ; @.str.4
	.asciz	"netconn_write: mem err\n"

	.comm	_NETCONN_NONE,4,2               ; @NETCONN_NONE
	.no_dead_strip	_netconn_write
.subsections_via_symbols
