	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function shpc_wait_cmd
_shpc_wait_cmd:                         ## @shpc_wait_cmd
	.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, %r14
	movl	$1000, %edi                     ## imm = 0x3E8
	callq	_msecs_to_jiffies
	movq	%rax, %rbx
	movq	_shpchp_poll_mode@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_2
## %bb.1:
	movq	%r14, %rdi
	callq	_shpc_poll_ctrl_busy
	testl	%eax, %eax
	je	LBB0_4
LBB0_7:
	xorl	%ebx, %ebx
	testl	%eax, %eax
	jns	LBB0_9
## %bb.8:
	movq	_EINTR@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	callq	_ctrl_info
	jmp	LBB0_9
LBB0_2:
	movl	(%r14), %r15d
	movq	%r14, %rdi
	callq	_is_ctrl_busy
	xorl	%esi, %esi
	testq	%rax, %rax
	sete	%sil
	movl	%r15d, %edi
	movq	%rbx, %rdx
	callq	_wait_event_interruptible_timeout
	testl	%eax, %eax
	jne	LBB0_7
LBB0_4:
	movq	%r14, %rdi
	callq	_is_ctrl_busy
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_ctrl_err
	jmp	LBB0_9
LBB0_5:
	xorl	%ebx, %ebx
LBB0_9:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_shpchp_poll_mode,8,3           ## @shpchp_poll_mode
	.comm	_EIO,4,2                        ## @EIO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Command not completed in 1000 msec\n"

	.comm	_EINTR,4,2                      ## @EINTR
L_.str.1:                               ## @.str.1
	.asciz	"Command was interrupted by a signal\n"

	.no_dead_strip	_shpc_wait_cmd
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function shpc_wait_cmd
_shpc_wait_cmd:                         ; @shpc_wait_cmd
	.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	x19, x0
	mov	w0, #1000
	bl	_msecs_to_jiffies
Lloh0:
	adrp	x8, _shpchp_poll_mode@GOTPAGE
Lloh1:
	ldr	x8, [x8, _shpchp_poll_mode@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cbz	x8, LBB0_4
; %bb.1:
	mov	x0, x19
	bl	_shpc_poll_ctrl_busy
	cbz	w0, LBB0_5
LBB0_2:
	tbz	w0, #31, LBB0_7
; %bb.3:
Lloh3:
	adrp	x8, _EINTR@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINTR@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w20, w8
Lloh6:
	adrp	x1, l_.str.1@PAGE
Lloh7:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_ctrl_info
	b	LBB0_8
LBB0_4:
	mov	x20, x0
	ldr	w21, [x19]
	mov	x0, x19
	bl	_is_ctrl_busy
	cmp	x0, #0
	cset	w1, eq
	mov	x0, x21
	mov	x2, x20
	bl	_wait_event_interruptible_timeout
	cbnz	w0, LBB0_2
LBB0_5:
	mov	x0, x19
	bl	_is_ctrl_busy
	cbz	x0, LBB0_7
; %bb.6:
Lloh8:
	adrp	x8, _EIO@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w20, w8
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_ctrl_err
	b	LBB0_8
LBB0_7:
	mov	w20, #0
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	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_shpchp_poll_mode,8,3           ; @shpchp_poll_mode
	.comm	_EIO,4,2                        ; @EIO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Command not completed in 1000 msec\n"

	.comm	_EINTR,4,2                      ; @EINTR
l_.str.1:                               ; @.str.1
	.asciz	"Command was interrupted by a signal\n"

	.no_dead_strip	_shpc_wait_cmd
.subsections_via_symbols
