	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ci_load_smc_ucode              ## -- Begin function ci_load_smc_ucode
	.p2align	4, 0x90
_ci_load_smc_ucode:                     ## @ci_load_smc_ucode
	.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	8(%rdi), %rax
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rdi, %r14
	cmpq	$0, 16(%rdi)
	je	LBB0_4
## %bb.3:
	movslq	(%rax), %r12
	movq	%r12, %rdi
	callq	_radeon_ucode_print_smc_hdr
	movl	8(%r12), %edi
	callq	_le32_to_cpu
	movl	%eax, %r15d
	movl	4(%r12), %edi
	callq	_le32_to_cpu
	movl	%eax, %r13d
	movq	8(%r14), %rax
	movl	(%rax), %ebx
	movl	(%r12), %edi
	callq	_le32_to_cpu
	movl	%eax, %r12d
	addl	%ebx, %r12d
	testb	$3, %r13b
	je	LBB0_11
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_15
LBB0_4:
	movl	(%r14), %ecx
	cmpl	$128, %ecx
	je	LBB0_7
## %bb.5:
	cmpl	$129, %ecx
	jne	LBB0_8
## %bb.6:
	movq	_BONAIRE_SMC_UCODE_START@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r15d
	movq	_BONAIRE_SMC_UCODE_SIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r13d
	jmp	LBB0_9
LBB0_7:
	movq	_HAWAII_SMC_UCODE_START@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r15d
	movq	_HAWAII_SMC_UCODE_SIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r13d
	jmp	LBB0_9
LBB0_8:
	leaq	L_.str(%rip), %rdi
	callq	_DRM_ERROR
	xorl	%eax, %eax
	callq	_BUG
	movq	8(%r14), %rax
                                        ## implicit-def: $r15d
                                        ## implicit-def: $r13d
LBB0_9:
	movl	(%rax), %r12d
	testb	$3, %r13b
	jne	LBB0_1
LBB0_11:
	addq	$4, %r14
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	movq	_SMC_IND_INDEX_0@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%r15d, %esi
	callq	_WREG32
	movq	_SMC_IND_ACCESS_CNTL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_AUTO_INCREMENT_IND_0@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movl	%esi, %edx
	notl	%edx
	callq	_WREG32_P
	cmpl	$4, %r13d
	jl	LBB0_14
## %bb.12:
	movslq	%r12d, %rbx
	addl	$4, %r13d
	movq	_SMC_IND_DATA_0@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rbx), %eax
	movl	4(%rbx), %ecx
	shll	$24, %eax
	shll	$16, %ecx
	orl	%eax, %ecx
	movl	8(%rbx), %esi
	shll	$8, %esi
	orl	%ecx, %esi
	orl	12(%rbx), %esi
	movl	(%r12), %edi
	callq	_WREG32
	addl	$-4, %r13d
	addq	$16, %rbx
	cmpl	$7, %r13d
	ja	LBB0_13
LBB0_14:
	movq	_SMC_IND_ACCESS_CNTL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	(%r15), %edx
	notl	%edx
	xorl	%ebx, %ebx
	xorl	%esi, %esi
	callq	_WREG32_P
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
LBB0_15:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_BONAIRE_SMC_UCODE_START,4,2    ## @BONAIRE_SMC_UCODE_START
	.comm	_BONAIRE_SMC_UCODE_SIZE,4,2     ## @BONAIRE_SMC_UCODE_SIZE
	.comm	_HAWAII_SMC_UCODE_START,4,2     ## @HAWAII_SMC_UCODE_START
	.comm	_HAWAII_SMC_UCODE_SIZE,4,2      ## @HAWAII_SMC_UCODE_SIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"unknown asic in smc ucode loader\n"

	.comm	_SMC_IND_INDEX_0,4,2            ## @SMC_IND_INDEX_0
	.comm	_SMC_IND_ACCESS_CNTL,4,2        ## @SMC_IND_ACCESS_CNTL
	.comm	_AUTO_INCREMENT_IND_0,4,2       ## @AUTO_INCREMENT_IND_0
	.comm	_SMC_IND_DATA_0,4,2             ## @SMC_IND_DATA_0
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ci_load_smc_ucode              ; -- Begin function ci_load_smc_ucode
	.p2align	2
_ci_load_smc_ucode:                     ; @ci_load_smc_ucode
	.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
	ldr	x8, [x0, #8]
	cbz	x8, LBB0_3
; %bb.1:
	mov	x19, x0
	ldr	x9, [x0, #16]
	cbz	x9, LBB0_4
; %bb.2:
	ldrsw	x22, [x8]
	mov	x0, x22
	bl	_radeon_ucode_print_smc_hdr
	ldr	w0, [x22, #8]
	bl	_le32_to_cpu
	mov	x21, x0
	ldr	w0, [x22, #4]
	bl	_le32_to_cpu
	mov	x20, x0
	ldr	x8, [x19, #8]
	ldr	w23, [x8]
	ldr	w0, [x22]
	bl	_le32_to_cpu
	add	w23, w0, w23
	tst	w20, #0x3
	b.eq	LBB0_10
LBB0_3:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_14
LBB0_4:
	ldr	w9, [x19]
	cmp	w9, #128
	b.eq	LBB0_7
; %bb.5:
	cmp	w9, #129
	b.ne	LBB0_8
; %bb.6:
Lloh3:
	adrp	x9, _BONAIRE_SMC_UCODE_START@GOTPAGE
Lloh4:
	ldr	x9, [x9, _BONAIRE_SMC_UCODE_START@GOTPAGEOFF]
Lloh5:
	ldr	w21, [x9]
Lloh6:
	adrp	x9, _BONAIRE_SMC_UCODE_SIZE@GOTPAGE
Lloh7:
	ldr	x9, [x9, _BONAIRE_SMC_UCODE_SIZE@GOTPAGEOFF]
Lloh8:
	ldr	w20, [x9]
	b	LBB0_9
LBB0_7:
Lloh9:
	adrp	x9, _HAWAII_SMC_UCODE_START@GOTPAGE
Lloh10:
	ldr	x9, [x9, _HAWAII_SMC_UCODE_START@GOTPAGEOFF]
Lloh11:
	ldr	w21, [x9]
Lloh12:
	adrp	x9, _HAWAII_SMC_UCODE_SIZE@GOTPAGE
Lloh13:
	ldr	x9, [x9, _HAWAII_SMC_UCODE_SIZE@GOTPAGEOFF]
Lloh14:
	ldr	w20, [x9]
	b	LBB0_9
LBB0_8:
Lloh15:
	adrp	x0, l_.str@PAGE
Lloh16:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
	bl	_BUG
	ldr	x8, [x19, #8]
                                        ; implicit-def: $w21
                                        ; implicit-def: $w20
LBB0_9:
	ldr	w23, [x8]
	tst	w20, #0x3
	b.ne	LBB0_3
LBB0_10:
	add	x19, x19, #4
	mov	x0, x19
	bl	_spin_lock_irqsave
Lloh17:
	adrp	x8, _SMC_IND_INDEX_0@GOTPAGE
Lloh18:
	ldr	x8, [x8, _SMC_IND_INDEX_0@GOTPAGEOFF]
Lloh19:
	ldr	w0, [x8]
	mov	x1, x21
	bl	_WREG32
Lloh20:
	adrp	x21, _SMC_IND_ACCESS_CNTL@GOTPAGE
Lloh21:
	ldr	x21, [x21, _SMC_IND_ACCESS_CNTL@GOTPAGEOFF]
	ldr	w0, [x21]
Lloh22:
	adrp	x22, _AUTO_INCREMENT_IND_0@GOTPAGE
Lloh23:
	ldr	x22, [x22, _AUTO_INCREMENT_IND_0@GOTPAGEOFF]
	ldr	w1, [x22]
	mvn	w2, w1
	bl	_WREG32_P
	cmp	w20, #4
	b.lt	LBB0_13
; %bb.11:
	sxtw	x23, w23
	add	w20, w20, #4
Lloh24:
	adrp	x24, _SMC_IND_DATA_0@GOTPAGE
Lloh25:
	ldr	x24, [x24, _SMC_IND_DATA_0@GOTPAGEOFF]
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	ldp	w8, w9, [x23]
	lsl	w9, w9, #16
	orr	w8, w9, w8, lsl #24
	ldp	w9, w10, [x23, #8]
	orr	w8, w8, w9, lsl #8
	orr	w1, w8, w10
	ldr	w0, [x24]
	bl	_WREG32
	sub	w20, w20, #4
	add	x23, x23, #16
	cmp	w20, #7
	b.hi	LBB0_12
LBB0_13:
	ldr	w0, [x21]
	ldr	w8, [x22]
	mvn	w2, w8
	mov	w1, #0
	bl	_WREG32_P
	mov	x0, x19
	bl	_spin_unlock_irqrestore
	mov	w0, #0
LBB0_14:
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_BONAIRE_SMC_UCODE_START,4,2    ; @BONAIRE_SMC_UCODE_START
	.comm	_BONAIRE_SMC_UCODE_SIZE,4,2     ; @BONAIRE_SMC_UCODE_SIZE
	.comm	_HAWAII_SMC_UCODE_START,4,2     ; @HAWAII_SMC_UCODE_START
	.comm	_HAWAII_SMC_UCODE_SIZE,4,2      ; @HAWAII_SMC_UCODE_SIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"unknown asic in smc ucode loader\n"

	.comm	_SMC_IND_INDEX_0,4,2            ; @SMC_IND_INDEX_0
	.comm	_SMC_IND_ACCESS_CNTL,4,2        ; @SMC_IND_ACCESS_CNTL
	.comm	_AUTO_INCREMENT_IND_0,4,2       ; @AUTO_INCREMENT_IND_0
	.comm	_SMC_IND_DATA_0,4,2             ; @SMC_IND_DATA_0
.subsections_via_symbols
