	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function udp6_attach
_udp6_attach:                           ## @udp6_attach
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	24(%rdi), %rax
	movl	(%rax), %edi
	callq	_udp_get_inpcbinfo
	movq	%rax, %r14
	movq	%rbx, %rdi
	callq	_sotoinpcb
	xorl	%edi, %edi
	testq	%rax, %rax
	sete	%dil
	leaq	L_.str(%rip), %rsi
	callq	_KASSERT
	cmpq	$0, 16(%rbx)
	je	LBB0_2
## %bb.1:
	cmpq	$0, 8(%rbx)
	jne	LBB0_3
LBB0_2:
	movq	_udp_sendspace@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_udp_recvspace@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_soreserve
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_10
LBB0_3:
	movq	%r14, %rdi
	callq	_INP_INFO_WLOCK
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_in_pcballoc
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_9
## %bb.4:
	movq	(%rbx), %rbx
	movq	_INP_IPV6@GOTPCREL(%rip), %rcx
	movl	16(%rbx), %eax
	orl	(%rcx), %eax
	movl	%eax, 16(%rbx)
	movq	_IN6P_IPV6_V6ONLY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rbx)
	jne	LBB0_6
## %bb.5:
	movq	_INP_IPV4@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%eax, 16(%rbx)
LBB0_6:
	movq	$-1, 4(%rbx)
	movq	_V_ip_defttl@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 12(%rbx)
	movq	%rbx, %rdi
	callq	_udp_newudpcb
	testl	%eax, %eax
	je	LBB0_8
## %bb.7:
	movl	%eax, %r15d
	movq	%rbx, %rdi
	callq	_in_pcbdetach
	movq	%rbx, %rdi
	callq	_in_pcbfree
	jmp	LBB0_9
LBB0_8:
	movq	%rbx, %rdi
	callq	_INP_WUNLOCK
	xorl	%r15d, %r15d
LBB0_9:
	movq	%r14, %rdi
	callq	_INP_INFO_WUNLOCK
LBB0_10:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"udp6_attach: inp != NULL"

	.comm	_udp_sendspace,4,2              ## @udp_sendspace
	.comm	_udp_recvspace,4,2              ## @udp_recvspace
	.comm	_INP_IPV6,4,2                   ## @INP_IPV6
	.comm	_IN6P_IPV6_V6ONLY,4,2           ## @IN6P_IPV6_V6ONLY
	.comm	_INP_IPV4,4,2                   ## @INP_IPV4
	.comm	_V_ip_defttl,4,2                ## @V_ip_defttl
	.no_dead_strip	_udp6_attach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function udp6_attach
_udp6_attach:                           ; @udp6_attach
	.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
	mov	x20, x0
	ldr	x8, [x0, #24]
	ldr	w0, [x8]
	bl	_udp_get_inpcbinfo
	mov	x19, x0
	mov	x0, x20
	bl	_sotoinpcb
	cmp	x0, #0
	cset	w0, eq
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_KASSERT
	ldr	x8, [x20, #16]
	cbz	x8, LBB0_2
; %bb.1:
	ldr	x8, [x20, #8]
	cbnz	x8, LBB0_3
LBB0_2:
Lloh2:
	adrp	x8, _udp_sendspace@GOTPAGE
Lloh3:
	ldr	x8, [x8, _udp_sendspace@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
Lloh5:
	adrp	x8, _udp_recvspace@GOTPAGE
Lloh6:
	ldr	x8, [x8, _udp_recvspace@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_soreserve
	mov	x21, x0
	cbnz	w0, LBB0_10
LBB0_3:
	mov	x0, x19
	bl	_INP_INFO_WLOCK
	mov	x0, x20
	mov	x1, x19
	bl	_in_pcballoc
	mov	x21, x0
	cbnz	w0, LBB0_9
; %bb.4:
	ldr	x20, [x20]
Lloh8:
	adrp	x8, _INP_IPV6@GOTPAGE
Lloh9:
	ldr	x8, [x8, _INP_IPV6@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	ldr	w9, [x20, #16]
	orr	w8, w9, w8
	str	w8, [x20, #16]
	ldr	w9, [x20]
Lloh11:
	adrp	x10, _IN6P_IPV6_V6ONLY@GOTPAGE
Lloh12:
	ldr	x10, [x10, _IN6P_IPV6_V6ONLY@GOTPAGEOFF]
Lloh13:
	ldr	w10, [x10]
	tst	w10, w9
	b.ne	LBB0_6
; %bb.5:
Lloh14:
	adrp	x9, _INP_IPV4@GOTPAGE
Lloh15:
	ldr	x9, [x9, _INP_IPV4@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	orr	w8, w9, w8
	str	w8, [x20, #16]
LBB0_6:
	movi.2d	v0, #0xffffffffffffffff
	stur	d0, [x20, #4]
Lloh17:
	adrp	x8, _V_ip_defttl@GOTPAGE
Lloh18:
	ldr	x8, [x8, _V_ip_defttl@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	str	w8, [x20, #12]
	mov	x0, x20
	bl	_udp_newudpcb
	mov	x21, x0
	cbz	w0, LBB0_8
; %bb.7:
	mov	x0, x20
	bl	_in_pcbdetach
	mov	x0, x20
	bl	_in_pcbfree
	b	LBB0_9
LBB0_8:
	mov	x0, x20
	bl	_INP_WUNLOCK
LBB0_9:
	mov	x0, x19
	bl	_INP_INFO_WUNLOCK
LBB0_10:
	mov	x0, x21
	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
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"udp6_attach: inp != NULL"

	.comm	_udp_sendspace,4,2              ; @udp_sendspace
	.comm	_udp_recvspace,4,2              ; @udp_recvspace
	.comm	_INP_IPV6,4,2                   ; @INP_IPV6
	.comm	_IN6P_IPV6_V6ONLY,4,2           ; @IN6P_IPV6_V6ONLY
	.comm	_INP_IPV4,4,2                   ; @INP_IPV4
	.comm	_V_ip_defttl,4,2                ; @V_ip_defttl
	.no_dead_strip	_udp6_attach
.subsections_via_symbols
