	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_prepare_write_chain            ## -- Begin function prepare_write_chain
	.p2align	4, 0x90
_prepare_write_chain:                   ## @prepare_write_chain
	.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
	xorl	%r15d, %r15d
	testq	%rdi, %rdi
	je	LBB0_16
## %bb.1:
	testl	%esi, %esi
	jle	LBB0_16
## %bb.2:
	movq	%rdi, %r13
	movq	_udp_send_msgvec@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movl	%esi, %eax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	_udp_send_iovec@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	$32, %rbx
	xorl	%r12d, %r12d
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	leaq	16(%r13), %rdi
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movslq	%eax, %r14
	addq	%r14, %rsi
	movq	_MAX_UDP_SEND_BUFFERS@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	subq	%r14, %rdx
	movq	_MAX_UDP_SEND_DATAGRAM@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	callq	_rwm_prepare_iovec
	testl	%eax, %eax
	js	LBB0_16
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	%r15, -72(%rbp)                 ## 8-byte Spill
	movl	20(%r13), %edi
	callq	_is_4in6
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	_udp_send_addr@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	leaq	(%r15,%r12), %rax
	movq	%rax, (%rbx)
	movq	_AF_INET@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 32(%r15,%r12)
	movl	24(%r13), %edi
	callq	_htons
	movq	%rax, 24(%r15,%r12)
	movl	20(%r13), %edi
	callq	_extract_4in6
	movl	%eax, 20(%r15,%r12)
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	_udp_send_addr6@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	leaq	(%r15,%r12), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	%rax, (%rbx)
	movq	_AF_INET6@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%r15,%r12)
	movl	24(%r13), %edi
	callq	_htons
	movq	%rax, 8(%r15,%r12)
	movl	20(%r13), %esi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	$16, %edx
	callq	_memcpy
LBB0_7:                                 ##   in Loop: Header=BB0_3 Depth=1
	movl	$40, -32(%rbx)
	movq	_udp_send_iovec@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	%rsi, %r14
	movq	%r14, -8(%rbx)
	movl	-44(%rbp), %r8d                 ## 4-byte Reload
	movl	%r8d, -28(%rbx)
	movq	_MSG_DONTWAIT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -12(%rbx)
	movl	16(%r13), %eax
	movl	%eax, 8(%rbx)
	movl	(%r13), %ecx
	xorl	%eax, %eax
	testl	%ecx, %ecx
	movq	-72(%rbp), %r15                 ## 8-byte Reload
	jle	LBB0_13
## %bb.8:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	$0, %edx
	movq	_MAX_OUR_IPS@GOTPCREL(%rip), %rdi
	cmpl	(%rdi), %ecx
	jge	LBB0_14
## %bb.9:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	_outbound_src_ip_hdr@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	shlq	$4, %rcx
	movq	(%rax,%rcx), %rdx
	testq	%rdx, %rdx
	je	LBB0_12
## %bb.10:                              ##   in Loop: Header=BB0_3 Depth=1
	movl	8(%rax,%rcx), %eax
	jmp	LBB0_14
LBB0_12:                                ##   in Loop: Header=BB0_3 Depth=1
	xorl	%eax, %eax
LBB0_13:                                ##   in Loop: Header=BB0_3 Depth=1
	xorl	%edx, %edx
LBB0_14:                                ##   in Loop: Header=BB0_3 Depth=1
	movl	%eax, -16(%rbx)
	movq	%rdx, -24(%rbx)
	incq	%r15
	movq	8(%r13), %r13
	testq	%r13, %r13
	je	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_3 Depth=1
	movl	-48(%rbp), %eax                 ## 4-byte Reload
	addl	%r8d, %eax
	addq	$40, %r12
	addq	$48, %rbx
	cmpq	-64(%rbp), %r15                 ## 8-byte Folded Reload
	jb	LBB0_3
LBB0_16:
	movl	%r15d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_udp_send_msgvec,8,3            ## @udp_send_msgvec
	.comm	_udp_send_iovec,8,3             ## @udp_send_iovec
	.comm	_MAX_UDP_SEND_BUFFERS,8,3       ## @MAX_UDP_SEND_BUFFERS
	.comm	_MAX_UDP_SEND_DATAGRAM,4,2      ## @MAX_UDP_SEND_DATAGRAM
	.comm	_udp_send_addr,8,3              ## @udp_send_addr
	.comm	_AF_INET,4,2                    ## @AF_INET
	.comm	_udp_send_addr6,8,3             ## @udp_send_addr6
	.comm	_AF_INET6,4,2                   ## @AF_INET6
	.comm	_MSG_DONTWAIT,4,2               ## @MSG_DONTWAIT
	.comm	_MAX_OUR_IPS,4,2                ## @MAX_OUR_IPS
	.comm	_outbound_src_ip_hdr,8,3        ## @outbound_src_ip_hdr
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_prepare_write_chain            ; -- Begin function prepare_write_chain
	.p2align	2
_prepare_write_chain:                   ; @prepare_write_chain
	.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	w19, #0
	cbz	x0, LBB0_14
; %bb.1:
	cmp	w1, #1
	b.lt	LBB0_14
; %bb.2:
	mov	x20, x0
	mov	x19, #0
	mov	w9, #0
Lloh0:
	adrp	x8, _udp_send_msgvec@GOTPAGE
Lloh1:
	ldr	x8, [x8, _udp_send_msgvec@GOTPAGEOFF]
Lloh2:
	adrp	x23, _udp_send_iovec@GOTPAGE
Lloh3:
	ldr	x23, [x23, _udp_send_iovec@GOTPAGEOFF]
Lloh4:
	ldr	x10, [x8]
	mov	w24, w1
	ldr	x8, [x23]
	add	x25, x10, #32
Lloh5:
	adrp	x27, _MAX_UDP_SEND_BUFFERS@GOTPAGE
Lloh6:
	ldr	x27, [x27, _MAX_UDP_SEND_BUFFERS@GOTPAGEOFF]
	mov	w28, #32
	str	x24, [sp, #8]                   ; 8-byte Folded Spill
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	add	x0, x20, #16
	sxtw	x26, w9
	add	x1, x8, x26
	ldr	x8, [x27]
	sub	x2, x8, x26
Lloh7:
	adrp	x8, _MAX_UDP_SEND_DATAGRAM@GOTPAGE
Lloh8:
	ldr	x8, [x8, _MAX_UDP_SEND_DATAGRAM@GOTPAGEOFF]
Lloh9:
	ldr	w3, [x8]
	bl	_rwm_prepare_iovec
	tbnz	w0, #31, LBB0_14
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x21, x0
	ldr	w0, [x20, #20]
	bl	_is_4in6
	cbz	x0, LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
Lloh10:
	adrp	x8, _udp_send_addr@GOTPAGE
Lloh11:
	ldr	x8, [x8, _udp_send_addr@GOTPAGEOFF]
Lloh12:
	ldr	x8, [x8]
	add	x22, x8, x28
	sub	x8, x22, #32
	str	x8, [x25]
Lloh13:
	adrp	x8, _AF_INET@GOTPAGE
Lloh14:
	ldr	x8, [x8, _AF_INET@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	str	w8, [x22]
	ldr	w0, [x20, #24]
	bl	_htons
	stur	x0, [x22, #-8]
	ldr	w0, [x20, #20]
	bl	_extract_4in6
	stur	w0, [x22, #-12]
	b	LBB0_7
LBB0_6:                                 ;   in Loop: Header=BB0_3 Depth=1
Lloh16:
	adrp	x8, _udp_send_addr6@GOTPAGE
Lloh17:
	ldr	x8, [x8, _udp_send_addr6@GOTPAGEOFF]
Lloh18:
	ldr	x8, [x8]
	mov	x24, x27
	mov	x27, x23
	add	x23, x8, x28
	sub	x22, x23, #32
	str	x22, [x25]
Lloh19:
	adrp	x8, _AF_INET6@GOTPAGE
Lloh20:
	ldr	x8, [x8, _AF_INET6@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	stur	w8, [x23, #-16]
	ldr	w0, [x20, #24]
	bl	_htons
	stur	x0, [x23, #-24]
	mov	x23, x27
	mov	x27, x24
	ldr	x24, [sp, #8]                   ; 8-byte Folded Reload
	ldr	w1, [x20, #20]
	mov	x0, x22
	mov	w2, #16
	bl	_memcpy
LBB0_7:                                 ;   in Loop: Header=BB0_3 Depth=1
	mov	x9, #0
	mov	w10, #0
	mov	w8, #40
	stur	w8, [x25, #-32]
	ldr	x8, [x23]
	add	x11, x8, x26
	stur	x11, [x25, #-8]
	stur	w21, [x25, #-28]
Lloh22:
	adrp	x11, _MSG_DONTWAIT@GOTPAGE
Lloh23:
	ldr	x11, [x11, _MSG_DONTWAIT@GOTPAGEOFF]
Lloh24:
	ldr	w11, [x11]
	stur	w11, [x25, #-12]
	ldr	w11, [x20, #16]
	str	w11, [x25, #8]
	ldr	w11, [x20]
	cmp	w11, #1
	b.lt	LBB0_12
; %bb.8:                                ;   in Loop: Header=BB0_3 Depth=1
Lloh25:
	adrp	x12, _MAX_OUR_IPS@GOTPAGE
Lloh26:
	ldr	x12, [x12, _MAX_OUR_IPS@GOTPAGEOFF]
Lloh27:
	ldr	w12, [x12]
	cmp	w11, w12
	b.ge	LBB0_12
; %bb.9:                                ;   in Loop: Header=BB0_3 Depth=1
Lloh28:
	adrp	x9, _outbound_src_ip_hdr@GOTPAGE
Lloh29:
	ldr	x9, [x9, _outbound_src_ip_hdr@GOTPAGEOFF]
Lloh30:
	ldr	x10, [x9]
	lsl	x9, x11, #4
	ldr	x9, [x10, x9]
	cbz	x9, LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_3 Depth=1
	add	x10, x10, x11, lsl #4
	ldr	w10, [x10, #8]
	b	LBB0_12
LBB0_11:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	w10, #0
LBB0_12:                                ;   in Loop: Header=BB0_3 Depth=1
	stur	w10, [x25, #-16]
	stur	x9, [x25, #-24]
	add	x19, x19, #1
	ldr	x20, [x20, #8]
	cbz	x20, LBB0_14
; %bb.13:                               ;   in Loop: Header=BB0_3 Depth=1
	add	w9, w21, w26
	add	x28, x28, #40
	add	x25, x25, #48
	cmp	x19, x24
	b.lo	LBB0_3
LBB0_14:
	mov	x0, x19
	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
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh4
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_udp_send_msgvec,8,3            ; @udp_send_msgvec
	.comm	_udp_send_iovec,8,3             ; @udp_send_iovec
	.comm	_MAX_UDP_SEND_BUFFERS,8,3       ; @MAX_UDP_SEND_BUFFERS
	.comm	_MAX_UDP_SEND_DATAGRAM,4,2      ; @MAX_UDP_SEND_DATAGRAM
	.comm	_udp_send_addr,8,3              ; @udp_send_addr
	.comm	_AF_INET,4,2                    ; @AF_INET
	.comm	_udp_send_addr6,8,3             ; @udp_send_addr6
	.comm	_AF_INET6,4,2                   ; @AF_INET6
	.comm	_MSG_DONTWAIT,4,2               ; @MSG_DONTWAIT
	.comm	_MAX_OUR_IPS,4,2                ; @MAX_OUR_IPS
	.comm	_outbound_src_ip_hdr,8,3        ; @outbound_src_ip_hdr
.subsections_via_symbols
