	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rts_attach
_rts_attach:                            ## @rts_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r15
	movl	%esi, %r14d
	movq	%rdi, %rbx
	xorl	%edi, %edi
	cmpq	$0, 8(%rbx)
	sete	%dil
	leaq	L_.str(%rip), %rsi
	callq	_KASSERT
	movq	_M_PCB@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	_M_WAITOK@GOTPCREL(%rip), %rax
	movq	_M_ZERO@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movl	$4, %edi
	callq	_malloc
	movq	%rax, 8(%rbx)
	movq	(%r15), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%rbx)
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_raw_attach
	movl	%eax, %r14d
	movq	%rbx, %rdi
	callq	_sotorawcb
	movq	%rax, %r15
	testl	%r14d, %r14d
	je	LBB0_2
## %bb.1:
	movq	$0, 8(%rbx)
	movl	(%r12), %esi
	movq	%r15, %rdi
	callq	_free
	jmp	LBB0_8
LBB0_2:
	xorl	%eax, %eax
	callq	_RTSOCK_LOCK
	movq	_V_route_cb@GOTPCREL(%rip), %rax
	movl	(%r15), %ecx
	cmpl	$129, %ecx
	je	LBB0_3
## %bb.4:
	cmpl	$128, %ecx
	jne	LBB0_7
## %bb.5:
	leaq	4(%rax), %rcx
	jmp	LBB0_6
LBB0_3:
	leaq	8(%rax), %rcx
LBB0_6:
	incl	(%rcx)
LBB0_7:
	incl	(%rax)
	xorl	%eax, %eax
	callq	_RTSOCK_UNLOCK
	movq	%rbx, %rdi
	callq	_soisconnected
	movq	_SO_USELOOPBACK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, (%rbx)
LBB0_8:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"rts_attach: so_pcb != NULL"

	.comm	_M_PCB,4,2                      ## @M_PCB
	.comm	_M_WAITOK,4,2                   ## @M_WAITOK
	.comm	_M_ZERO,4,2                     ## @M_ZERO
	.comm	_V_route_cb,12,2                ## @V_route_cb
	.comm	_SO_USELOOPBACK,4,2             ## @SO_USELOOPBACK
	.no_dead_strip	_rts_attach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rts_attach
_rts_attach:                            ; @rts_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, x2
	mov	x21, x1
	mov	x19, x0
	ldr	x8, [x0, #8]
	cmp	x8, #0
	cset	w0, eq
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_KASSERT
Lloh2:
	adrp	x22, _M_PCB@GOTPAGE
Lloh3:
	ldr	x22, [x22, _M_PCB@GOTPAGEOFF]
Lloh4:
	adrp	x8, _M_WAITOK@GOTPAGE
Lloh5:
	ldr	x8, [x8, _M_WAITOK@GOTPAGEOFF]
	ldr	w1, [x22]
Lloh6:
	ldr	w8, [x8]
Lloh7:
	adrp	x9, _M_ZERO@GOTPAGE
Lloh8:
	ldr	x9, [x9, _M_ZERO@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	orr	w2, w9, w8
	mov	w0, #4
	bl	_malloc
	str	x0, [x19, #8]
	ldr	x8, [x20]
	ldr	w8, [x8]
	str	w8, [x19, #16]
	mov	x0, x19
	mov	x1, x21
	bl	_raw_attach
	mov	x20, x0
	mov	x0, x19
	bl	_sotorawcb
	mov	x21, x0
	cbz	w20, LBB0_2
; %bb.1:
	str	xzr, [x19, #8]
	ldr	w1, [x22]
	mov	x0, x21
	bl	_free
	b	LBB0_8
LBB0_2:
	bl	_RTSOCK_LOCK
Lloh10:
	adrp	x8, _V_route_cb@GOTPAGE
Lloh11:
	ldr	x8, [x8, _V_route_cb@GOTPAGEOFF]
	ldr	w9, [x21]
	cmp	w9, #129
	b.eq	LBB0_5
; %bb.3:
	cmp	w9, #128
	b.ne	LBB0_7
; %bb.4:
	add	x9, x8, #4
	b	LBB0_6
LBB0_5:
	add	x9, x8, #8
LBB0_6:
	ldr	w10, [x9]
	add	w10, w10, #1
	str	w10, [x9]
LBB0_7:
	ldr	w9, [x8]
	add	w9, w9, #1
	str	w9, [x8]
	bl	_RTSOCK_UNLOCK
	mov	x0, x19
	bl	_soisconnected
Lloh12:
	adrp	x8, _SO_USELOOPBACK@GOTPAGE
Lloh13:
	ldr	x8, [x8, _SO_USELOOPBACK@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	ldr	w9, [x19]
	orr	w8, w9, w8
	str	w8, [x19]
LBB0_8:
	mov	x0, 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
	ret
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"rts_attach: so_pcb != NULL"

	.comm	_M_PCB,4,2                      ; @M_PCB
	.comm	_M_WAITOK,4,2                   ; @M_WAITOK
	.comm	_M_ZERO,4,2                     ; @M_ZERO
	.comm	_V_route_cb,12,2                ; @V_route_cb
	.comm	_SO_USELOOPBACK,4,2             ; @SO_USELOOPBACK
	.no_dead_strip	_rts_attach
.subsections_via_symbols
