	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sdp_detach
_sdp_detach:                            ## @sdp_detach
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	callq	_sdp_sk
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_SDP_WLOCK
	xorl	%edi, %edi
	cmpq	$0, 16(%rbx)
	setne	%dil
	leaq	L_.str(%rip), %rsi
	callq	_KASSERT
	movq	16(%rbx), %rax
	movq	$0, (%rax)
	movq	$0, 16(%rbx)
	movl	(%rbx), %eax
	movq	_SDP_TIMEWAIT@GOTPCREL(%rip), %rcx
	movq	_SDP_DREQWAIT@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rcx), %edx
	testl	%eax, %edx
	je	LBB0_1
## %bb.4:
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	jmp	_SDP_WUNLOCK                    ## TAILCALL
LBB0_1:
	movq	_SDP_DROPPED@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	jne	LBB0_5
## %bb.2:
	movq	8(%rbx), %rax
	movq	_TCPS_SYN_SENT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jge	LBB0_3
LBB0_5:
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	jmp	_sdp_pcbfree                    ## TAILCALL
LBB0_3:
	leaq	L_.str.1(%rip), %rdi
	movq	%rbx, %rsi
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	jmp	_panic                          ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"sdp_detach: socket is NULL"

	.comm	_SDP_TIMEWAIT,4,2               ## @SDP_TIMEWAIT
	.comm	_SDP_DREQWAIT,4,2               ## @SDP_DREQWAIT
	.comm	_SDP_DROPPED,4,2                ## @SDP_DROPPED
	.comm	_TCPS_SYN_SENT,8,3              ## @TCPS_SYN_SENT
L_.str.1:                               ## @.str.1
	.asciz	"sdp_detach: Unexpected state, ssk %p.\n"

	.no_dead_strip	_sdp_detach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sdp_detach
_sdp_detach:                            ; @sdp_detach
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	bl	_sdp_sk
	mov	x19, x0
	bl	_SDP_WLOCK
	ldr	x8, [x19, #16]
	cmp	x8, #0
	cset	w0, ne
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_KASSERT
	ldr	x8, [x19, #16]
	str	xzr, [x8]
	str	xzr, [x19, #16]
	ldr	w8, [x19]
Lloh2:
	adrp	x9, _SDP_TIMEWAIT@GOTPAGE
Lloh3:
	ldr	x9, [x9, _SDP_TIMEWAIT@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
Lloh5:
	adrp	x10, _SDP_DREQWAIT@GOTPAGE
Lloh6:
	ldr	x10, [x10, _SDP_DREQWAIT@GOTPAGEOFF]
Lloh7:
	ldr	w10, [x10]
	orr	w9, w10, w9
	tst	w9, w8
	b.eq	LBB0_2
; %bb.1:
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_SDP_WUNLOCK
LBB0_2:
Lloh8:
	adrp	x9, _SDP_DROPPED@GOTPAGE
Lloh9:
	ldr	x9, [x9, _SDP_DROPPED@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_4
; %bb.3:
	ldr	x8, [x19, #8]
Lloh11:
	adrp	x9, _TCPS_SYN_SENT@GOTPAGE
Lloh12:
	ldr	x9, [x9, _TCPS_SYN_SENT@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ge	LBB0_5
LBB0_4:
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_sdp_pcbfree
LBB0_5:
Lloh14:
	adrp	x0, l_.str.1@PAGE
Lloh15:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_panic
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"sdp_detach: socket is NULL"

	.comm	_SDP_TIMEWAIT,4,2               ; @SDP_TIMEWAIT
	.comm	_SDP_DREQWAIT,4,2               ; @SDP_DREQWAIT
	.comm	_SDP_DROPPED,4,2                ; @SDP_DROPPED
	.comm	_TCPS_SYN_SENT,8,3              ; @TCPS_SYN_SENT
l_.str.1:                               ; @.str.1
	.asciz	"sdp_detach: Unexpected state, ssk %p.\n"

	.no_dead_strip	_sdp_detach
.subsections_via_symbols
