	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function smu_run_cmd
_smu_run_cmd:                           ## @smu_run_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	%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
	movl	%edx, %r13d
	movq	%rsi, %r14
	movl	%edi, %r12d
	callq	_device_get_softc
	movq	%rax, %rbx
	movl	(%r14), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	leaq	8(%rbx), %r15
	movq	%r15, %rdi
	callq	_mtx_lock
	cmpq	$0, 16(%rbx)
	je	LBB0_2
## %bb.1:
	leaq	12(%rbx), %rdi
	movq	_cmd_q@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rsi
	callq	_STAILQ_INSERT_TAIL
	jmp	LBB0_3
LBB0_2:
	movl	%r12d, %edi
	movq	%r14, %rsi
	callq	_smu_send_cmd
LBB0_3:
	movq	%r15, %rdi
	callq	_mtx_unlock
	testl	%r13d, %r13d
	je	LBB0_4
## %bb.5:
	cmpq	$0, (%rbx)
	js	LBB0_6
## %bb.7:
	movq	_hz@GOTPCREL(%rip), %rax
	imull	$800, (%rax), %eax              ## imm = 0x320
	cltq
	imulq	$274877907, %rax, %rcx          ## imm = 0x10624DD3
	movq	%rcx, %rax
	shrq	$63, %rax
	sarq	$38, %rcx
	addl	%eax, %ecx
	leaq	L_.str(%rip), %rdx
	movq	%r14, %rdi
	xorl	%esi, %esi
                                        ## kill: def $ecx killed $ecx killed $rcx
	callq	_tsleep
	testl	%eax, %eax
	je	LBB0_14
## %bb.8:
	movl	%eax, %r13d
	movl	%r12d, %edi
	callq	_smu_doorbell_intr
	movq	%r15, %rdi
	callq	_mtx_lock
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	cmpl	%eax, (%r14)
	jne	LBB0_13
## %bb.9:
	cmpq	%r14, 16(%rbx)
	je	LBB0_10
## %bb.11:
	addq	$12, %rbx
	movq	_smu_cmd@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_cmd_q@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_STAILQ_REMOVE
	jmp	LBB0_12
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movl	$50, %edi
	callq	_DELAY
	movl	%r12d, %edi
	callq	_smu_doorbell_intr
	cmpq	$0, 16(%rbx)
	jne	LBB0_6
	jmp	LBB0_14
LBB0_4:
	xorl	%r13d, %r13d
	jmp	LBB0_16
LBB0_13:
	movq	%r15, %rdi
	callq	_mtx_unlock
LBB0_14:
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	notl	%eax
	movzbl	%al, %eax
	xorl	%r13d, %r13d
	cmpl	%eax, (%r14)
	je	LBB0_16
## %bb.15:
	movq	_EIO@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	jmp	LBB0_16
LBB0_10:
	movq	$0, 16(%rbx)
LBB0_12:
	movq	%r15, %rdi
	callq	_mtx_unlock
LBB0_16:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_cmd_q,4,2                      ## @cmd_q
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"smu"

	.comm	_hz,4,2                         ## @hz
	.comm	_smu_cmd,4,2                    ## @smu_cmd
	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_smu_run_cmd
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function smu_run_cmd
_smu_run_cmd:                           ; @smu_run_cmd
	.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
	mov	x23, x2
	mov	x19, x1
	mov	x22, x0
	bl	_device_get_softc
	mov	x21, x0
	ldr	w24, [x19]
	add	x20, x0, #8
	mov	x0, x20
	bl	_mtx_lock
	ldr	x8, [x21, #16]
	cbz	x8, LBB0_2
; %bb.1:
	add	x0, x21, #12
Lloh0:
	adrp	x8, _cmd_q@GOTPAGE
Lloh1:
	ldr	x8, [x8, _cmd_q@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	x1, x19
	bl	_STAILQ_INSERT_TAIL
	b	LBB0_3
LBB0_2:
	mov	x0, x22
	mov	x1, x19
	bl	_smu_send_cmd
LBB0_3:
	mov	x0, x20
	bl	_mtx_unlock
	cbz	w23, LBB0_12
; %bb.4:
	ldr	x8, [x21]
	tbnz	x8, #63, LBB0_9
; %bb.5:
Lloh3:
	adrp	x8, _hz@GOTPAGE
Lloh4:
	ldr	x8, [x8, _hz@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	mov	w9, #800
	mul	w8, w8, w9
	mov	w9, #19923
	movk	w9, #4194, lsl #16
	smull	x8, w8, w9
	lsr	x9, x8, #63
	asr	x8, x8, #38
	add	w3, w8, w9
Lloh6:
	adrp	x2, l_.str@PAGE
Lloh7:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	mov	w1, #0
	bl	_tsleep
	cbz	w0, LBB0_11
; %bb.6:
	mov	x23, x0
	mov	x0, x22
	bl	_smu_doorbell_intr
	mov	x0, x20
	bl	_mtx_lock
	ldr	w8, [x19]
	cmp	w8, w24
	b.ne	LBB0_10
; %bb.7:
	ldr	x8, [x21, #16]
	cmp	x8, x19
	b.eq	LBB0_13
; %bb.8:
	add	x0, x21, #12
Lloh8:
	adrp	x8, _smu_cmd@GOTPAGE
Lloh9:
	ldr	x8, [x8, _smu_cmd@GOTPAGEOFF]
Lloh10:
	ldr	w2, [x8]
Lloh11:
	adrp	x8, _cmd_q@GOTPAGE
Lloh12:
	ldr	x8, [x8, _cmd_q@GOTPAGEOFF]
Lloh13:
	ldr	w3, [x8]
	mov	x1, x19
	bl	_STAILQ_REMOVE
	b	LBB0_14
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	mov	w0, #50
	bl	_DELAY
	mov	x0, x22
	bl	_smu_doorbell_intr
	ldr	x8, [x21, #16]
	cbnz	x8, LBB0_9
	b	LBB0_11
LBB0_10:
	mov	x0, x20
	bl	_mtx_unlock
LBB0_11:
	ldr	w8, [x19]
	mvn	w9, w24
Lloh14:
	adrp	x10, _EIO@GOTPAGE
Lloh15:
	ldr	x10, [x10, _EIO@GOTPAGEOFF]
Lloh16:
	ldr	w10, [x10]
	cmp	w8, w9, uxtb
	csel	w23, wzr, w10, eq
LBB0_12:
	mov	x0, x23
	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
LBB0_13:
	str	xzr, [x21, #16]
LBB0_14:
	mov	x0, x20
	bl	_mtx_unlock
	b	LBB0_12
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_cmd_q,4,2                      ; @cmd_q
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"smu"

	.comm	_hz,4,2                         ; @hz
	.comm	_smu_cmd,4,2                    ; @smu_cmd
	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_smu_run_cmd
.subsections_via_symbols
