	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_smu_queue_cmd                  ## -- Begin function smu_queue_cmd
	.p2align	4, 0x90
_smu_queue_cmd:                         ## @smu_queue_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	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movq	_smu@GOTPCREL(%rip), %r14
	movq	(%r14), %rdi
	testq	%rdi, %rdi
	je	LBB0_1
## %bb.3:
	movq	_SMU_MAX_DATA@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	%rax, (%rbx)
	jg	LBB0_5
## %bb.4:
	cmpq	%rax, 8(%rbx)
	jle	LBB0_6
LBB0_5:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	jmp	LBB0_2
LBB0_1:
	movq	_ENODEV@GOTPCREL(%rip), %rcx
LBB0_2:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_11:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_6:
	movl	$1, 16(%rbx)
	addq	$4, %rdi
	callq	_spin_lock_irqsave
	leaq	20(%rbx), %rdi
	movq	(%r14), %rsi
	addq	$16, %rsi
	callq	_list_add_tail
	movq	(%r14), %rdi
	cmpq	$0, 8(%rdi)
	jne	LBB0_8
## %bb.7:
	xorl	%eax, %eax
	callq	_smu_start_cmd
	movq	(%r14), %rdi
LBB0_8:
	addq	$4, %rdi
	callq	_spin_unlock_irqrestore
	movq	_smu_irq_inited@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	je	LBB0_10
## %bb.9:
	movq	(%r14), %rcx
	xorl	%eax, %eax
	cmpl	$0, (%rcx)
	jne	LBB0_11
LBB0_10:
	movq	%rbx, %rdi
	callq	_smu_spinwait_cmd
	xorl	%eax, %eax
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_smu,8,3                        ## @smu
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_SMU_MAX_DATA,8,3               ## @SMU_MAX_DATA
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_smu_irq_inited,4,2             ## @smu_irq_inited
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_smu_queue_cmd                  ; -- Begin function smu_queue_cmd
	.p2align	2
_smu_queue_cmd:                         ; @smu_queue_cmd
	.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
Lloh0:
	adrp	x20, _smu@GOTPAGE
Lloh1:
	ldr	x20, [x20, _smu@GOTPAGEOFF]
	ldr	x8, [x20]
	cbz	x8, LBB0_4
; %bb.1:
	mov	x19, x0
	ldr	x10, [x0]
Lloh2:
	adrp	x9, _SMU_MAX_DATA@GOTPAGE
Lloh3:
	ldr	x9, [x9, _SMU_MAX_DATA@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	cmp	x10, x9
	b.gt	LBB0_3
; %bb.2:
	ldr	x10, [x19, #8]
	cmp	x10, x9
	b.le	LBB0_7
LBB0_3:
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_5
LBB0_4:
Lloh7:
	adrp	x8, _ENODEV@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
LBB0_5:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_6:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_7:
	mov	w9, #1
	str	w9, [x19, #16]
	add	x0, x8, #4
	bl	_spin_lock_irqsave
	add	x0, x19, #20
	ldr	x8, [x20]
	add	x1, x8, #16
	bl	_list_add_tail
	ldr	x8, [x20]
	ldr	x9, [x8, #8]
	cbnz	x9, LBB0_9
; %bb.8:
	bl	_smu_start_cmd
	ldr	x8, [x20]
LBB0_9:
	add	x0, x8, #4
	bl	_spin_unlock_irqrestore
Lloh9:
	adrp	x8, _smu_irq_inited@GOTPAGE
Lloh10:
	ldr	x8, [x8, _smu_irq_inited@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	cbz	w8, LBB0_11
; %bb.10:
	ldr	x8, [x20]
	ldr	w8, [x8]
	cbnz	w8, LBB0_12
LBB0_11:
	mov	x0, x19
	bl	_smu_spinwait_cmd
LBB0_12:
	mov	w0, #0
	b	LBB0_6
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_smu,8,3                        ; @smu
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_SMU_MAX_DATA,8,3               ; @SMU_MAX_DATA
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_smu_irq_inited,4,2             ; @smu_irq_inited
.subsections_via_symbols
