	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function socket_shutdown
_socket_shutdown:                       ## @socket_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
	movq	%rdi, %rbx
	leaq	4(%rdi), %r14
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_dbg
	movq	56(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	%rbx, %rdi
	callq	*(%rax)
LBB0_2:
	leaq	16(%rbx), %r15
	movq	%r15, %rdi
	callq	_mutex_lock
	movq	_SOCKET_INUSE@GOTPCREL(%rip), %r13
	movq	_SOCKET_PRESENT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	(%r13), %eax
	andl	%eax, (%rbx)
	movq	_shutdown_delay@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%eax, %eax
	leal	(%rax,%rax,4), %edi
	callq	_msleep
	movl	(%r13), %eax
	andl	%eax, (%rbx)
	movq	_dead_socket@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	leaq	48(%rbx), %r12
	movl	%eax, 48(%rbx)
	movq	8(%rbx), %rax
	movq	%rbx, %rdi
	callq	*16(%rax)
	movq	8(%rbx), %rax
	movq	%rbx, %rdi
	movq	%r12, %rsi
	callq	*8(%rax)
	movq	$0, 40(%rbx)
	movq	32(%rbx), %rdi
	callq	_kfree
	xorps	%xmm0, %xmm0
	movups	%xmm0, 24(%rbx)
	movq	%r15, %rdi
	callq	_mutex_unlock
	movl	$100, %edi
	callq	_msleep
	movq	8(%rbx), %rax
	leaq	-44(%rbp), %rsi
	movq	%rbx, %rdi
	callq	*(%rax)
	movq	_SS_POWERON@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, -44(%rbp)
	je	LBB0_4
## %bb.3:
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_err
LBB0_4:
	movl	(%r13), %eax
	notl	%eax
	andl	%eax, (%rbx)
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"shutdown\n"

	.comm	_SOCKET_INUSE,4,2               ## @SOCKET_INUSE
	.comm	_SOCKET_PRESENT,4,2             ## @SOCKET_PRESENT
	.comm	_shutdown_delay,4,2             ## @shutdown_delay
	.comm	_dead_socket,4,2                ## @dead_socket
	.comm	_SS_POWERON,4,2                 ## @SS_POWERON
L_.str.1:                               ## @.str.1
	.asciz	"*** DANGER *** unable to remove socket power\n"

	.no_dead_strip	_socket_shutdown
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function socket_shutdown
_socket_shutdown:                       ; @socket_shutdown
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x0
	add	x20, x0, #4
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_dev_dbg
	ldr	x8, [x19, #56]
	cbz	x8, LBB0_2
; %bb.1:
	ldr	x8, [x8]
	mov	x0, x19
	blr	x8
LBB0_2:
	add	x21, x19, #16
	mov	x0, x21
	bl	_mutex_lock
Lloh2:
	adrp	x23, _SOCKET_INUSE@GOTPAGE
Lloh3:
	ldr	x23, [x23, _SOCKET_INUSE@GOTPAGEOFF]
	ldr	w8, [x23]
Lloh4:
	adrp	x9, _SOCKET_PRESENT@GOTPAGE
Lloh5:
	ldr	x9, [x9, _SOCKET_PRESENT@GOTPAGEOFF]
Lloh6:
	ldr	w9, [x9]
	orr	w8, w9, w8
	ldr	w9, [x19]
	and	w8, w9, w8
	str	w8, [x19]
Lloh7:
	adrp	x8, _shutdown_delay@GOTPAGE
Lloh8:
	ldr	x8, [x8, _shutdown_delay@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	add	w8, w8, w8, lsl #2
	lsl	w0, w8, #1
	bl	_msleep
	ldr	w8, [x23]
	ldr	w9, [x19]
	and	w8, w9, w8
	str	w8, [x19]
Lloh10:
	adrp	x8, _dead_socket@GOTPAGE
Lloh11:
	ldr	x8, [x8, _dead_socket@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	mov	x22, x19
	str	w8, [x22, #48]!
	ldr	x8, [x19, #8]
	ldr	x8, [x8, #16]
	mov	x0, x19
	blr	x8
	ldr	x8, [x19, #8]
	ldr	x8, [x8, #8]
	mov	x0, x19
	mov	x1, x22
	blr	x8
	str	xzr, [x19, #40]
	ldr	x0, [x19, #32]
	bl	_kfree
	stp	xzr, xzr, [x19, #24]
	mov	x0, x21
	bl	_mutex_unlock
	mov	w0, #100
	bl	_msleep
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
	add	x1, sp, #12
	mov	x0, x19
	blr	x8
	ldr	w8, [sp, #12]
Lloh13:
	adrp	x9, _SS_POWERON@GOTPAGE
Lloh14:
	ldr	x9, [x9, _SS_POWERON@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.3:
Lloh16:
	adrp	x1, l_.str.1@PAGE
Lloh17:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_dev_err
LBB0_4:
	ldr	w8, [x23]
	ldr	w9, [x19]
	bic	w8, w9, w8
	str	w8, [x19]
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"shutdown\n"

	.comm	_SOCKET_INUSE,4,2               ; @SOCKET_INUSE
	.comm	_SOCKET_PRESENT,4,2             ; @SOCKET_PRESENT
	.comm	_shutdown_delay,4,2             ; @shutdown_delay
	.comm	_dead_socket,4,2                ; @dead_socket
	.comm	_SS_POWERON,4,2                 ; @SS_POWERON
l_.str.1:                               ; @.str.1
	.asciz	"*** DANGER *** unable to remove socket power\n"

	.no_dead_strip	_socket_shutdown
.subsections_via_symbols
