	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function unix_shutdown
_unix_shutdown:                         ## @unix_shutdown
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	incl	%esi
	movq	_RCV_SHUTDOWN@GOTPCREL(%rip), %rax
	movq	_SEND_SHUTDOWN@GOTPCREL(%rip), %r12
	movl	(%r12), %r13d
	orl	(%rax), %r13d
	andl	%esi, %r13d
	je	LBB0_11
## %bb.1:
	movq	(%rdi), %rbx
	movq	%rbx, %rdi
	callq	_unix_state_lock
	orl	%r13d, (%rbx)
	movq	%rbx, %rdi
	callq	_unix_peer
	testq	%rax, %rax
	je	LBB0_12
## %bb.2:
	movq	%rax, %r15
	movq	%rax, %r14
	movq	%r15, %rdi
	callq	_sock_hold
	movq	%rbx, %rdi
	callq	_unix_state_unlock
	movq	%rbx, %rdi
	callq	*24(%rbx)
	movq	8(%rbx), %rax
	movq	_SOCK_STREAM@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_4
## %bb.3:
	movq	_SOCK_SEQPACKET@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_10
LBB0_4:
	movq	_RCV_SHUTDOWN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, %ecx
	andl	%r13d, %ecx
	movl	(%r12), %ebx
	cmovnel	%ebx, %ecx
	andl	%r13d, %ebx
	cmovnel	%eax, %ebx
	orl	%ecx, %ebx
	movq	%r14, %rdi
	callq	_unix_state_lock
	orl	%ebx, (%r14)
	movq	%r14, %rdi
	callq	_unix_state_unlock
	movq	%r14, %rdi
	callq	*24(%r14)
	addq	$16, %r15
	movq	%r15, %rdi
	callq	_read_lock
	movq	_SHUTDOWN_MASK@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jne	LBB0_6
## %bb.5:
	movq	_POLL_HUP@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_12:
	movq	%rbx, %rdi
	callq	_unix_state_unlock
	movq	%rbx, %rdi
	callq	*24(%rbx)
	jmp	LBB0_11
LBB0_6:
	movq	_RCV_SHUTDOWN@GOTPCREL(%rip), %rax
	testl	%ebx, (%rax)
	je	LBB0_9
## %bb.7:
	movq	_POLL_IN@GOTPCREL(%rip), %rax
LBB0_8:
	movq	_SOCK_WAKE_WAITD@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	_sk_wake_async
LBB0_9:
	movq	%r15, %rdi
	callq	_read_unlock
LBB0_10:
	movq	%r14, %rdi
	callq	_sock_put
LBB0_11:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RCV_SHUTDOWN,4,2               ## @RCV_SHUTDOWN
	.comm	_SEND_SHUTDOWN,4,2              ## @SEND_SHUTDOWN
	.comm	_SOCK_STREAM,8,3                ## @SOCK_STREAM
	.comm	_SOCK_SEQPACKET,8,3             ## @SOCK_SEQPACKET
	.comm	_SHUTDOWN_MASK,4,2              ## @SHUTDOWN_MASK
	.comm	_SOCK_WAKE_WAITD,4,2            ## @SOCK_WAKE_WAITD
	.comm	_POLL_HUP,4,2                   ## @POLL_HUP
	.comm	_POLL_IN,4,2                    ## @POLL_IN
	.no_dead_strip	_unix_shutdown
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function unix_shutdown
_unix_shutdown:                         ; @unix_shutdown
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	add	w8, w1, #1
Lloh0:
	adrp	x21, _RCV_SHUTDOWN@GOTPAGE
Lloh1:
	ldr	x21, [x21, _RCV_SHUTDOWN@GOTPAGEOFF]
	ldr	w9, [x21]
Lloh2:
	adrp	x23, _SEND_SHUTDOWN@GOTPAGE
Lloh3:
	ldr	x23, [x23, _SEND_SHUTDOWN@GOTPAGEOFF]
	ldr	w10, [x23]
	orr	w9, w10, w9
	ands	w22, w9, w8
	b.eq	LBB0_11
; %bb.1:
	ldr	x20, [x0]
	mov	x0, x20
	bl	_unix_state_lock
	ldr	w8, [x20]
	orr	w8, w8, w22
	str	w8, [x20]
	mov	x0, x20
	bl	_unix_peer
	cbz	x0, LBB0_5
; %bb.2:
	mov	x19, x0
	bl	_sock_hold
	mov	x0, x20
	bl	_unix_state_unlock
	ldr	x8, [x20, #24]
	mov	x0, x20
	blr	x8
	ldr	x8, [x20, #8]
Lloh4:
	adrp	x9, _SOCK_STREAM@GOTPAGE
Lloh5:
	ldr	x9, [x9, _SOCK_STREAM@GOTPAGEOFF]
Lloh6:
	ldr	x9, [x9]
Lloh7:
	adrp	x10, _SOCK_SEQPACKET@GOTPAGE
Lloh8:
	ldr	x10, [x10, _SOCK_SEQPACKET@GOTPAGEOFF]
Lloh9:
	ldr	x10, [x10]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	b.ne	LBB0_10
; %bb.3:
	ldr	w8, [x21]
	ldr	w9, [x23]
	tst	w8, w22
	csel	w10, wzr, w9, eq
	tst	w9, w22
	csel	w8, wzr, w8, eq
	orr	w22, w8, w10
	mov	x0, x19
	bl	_unix_state_lock
	ldr	w8, [x19]
	orr	w8, w22, w8
	str	w8, [x19]
	mov	x0, x19
	bl	_unix_state_unlock
	ldr	x8, [x19, #24]
	mov	x0, x19
	blr	x8
	add	x20, x19, #16
	mov	x0, x20
	bl	_read_lock
Lloh10:
	adrp	x8, _SHUTDOWN_MASK@GOTPAGE
Lloh11:
	ldr	x8, [x8, _SHUTDOWN_MASK@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	cmp	w22, w8
	b.ne	LBB0_6
; %bb.4:
Lloh13:
	adrp	x8, _POLL_HUP@GOTPAGE
Lloh14:
	ldr	x8, [x8, _POLL_HUP@GOTPAGEOFF]
	b	LBB0_8
LBB0_5:
	mov	x0, x20
	bl	_unix_state_unlock
	ldr	x8, [x20, #24]
	mov	x0, x20
	blr	x8
	b	LBB0_11
LBB0_6:
	ldr	w8, [x21]
	tst	w8, w22
	b.eq	LBB0_9
; %bb.7:
Lloh15:
	adrp	x8, _POLL_IN@GOTPAGE
Lloh16:
	ldr	x8, [x8, _POLL_IN@GOTPAGEOFF]
LBB0_8:
Lloh17:
	adrp	x9, _SOCK_WAKE_WAITD@GOTPAGE
Lloh18:
	ldr	x9, [x9, _SOCK_WAKE_WAITD@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x9]
	ldr	w2, [x8]
	mov	x0, x19
	bl	_sk_wake_async
LBB0_9:
	mov	x0, x20
	bl	_read_unlock
LBB0_10:
	mov	x0, x19
	bl	_sock_put
LBB0_11:
	mov	w0, #0
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_RCV_SHUTDOWN,4,2               ; @RCV_SHUTDOWN
	.comm	_SEND_SHUTDOWN,4,2              ; @SEND_SHUTDOWN
	.comm	_SOCK_STREAM,8,3                ; @SOCK_STREAM
	.comm	_SOCK_SEQPACKET,8,3             ; @SOCK_SEQPACKET
	.comm	_SHUTDOWN_MASK,4,2              ; @SHUTDOWN_MASK
	.comm	_SOCK_WAKE_WAITD,4,2            ; @SOCK_WAKE_WAITD
	.comm	_POLL_HUP,4,2                   ; @POLL_HUP
	.comm	_POLL_IN,4,2                    ; @POLL_IN
	.no_dead_strip	_unix_shutdown
.subsections_via_symbols
