	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sdma_v2_4_init_microcode
_sdma_v2_4_init_microcode:              ## @sdma_v2_4_init_microcode
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	leaq	L_.str(%rip), %rdi
	callq	_DRM_DEBUG
	cmpl	$128, (%r12)
	je	LBB0_2
## %bb.1:
	xorl	%eax, %eax
	callq	_BUG
LBB0_2:
	cmpl	$0, 8(%r12)
	jle	LBB0_14
## %bb.3:
	movl	$8, %r13d
	xorl	%r14d, %r14d
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_4 Depth=1
	incq	%r14
	movslq	8(%r12), %rax
	addq	$24, %r13
	cmpq	%rax, %r14
	jge	LBB0_14
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	testq	%r14, %r14
	leaq	L_.str.3(%rip), %rdx
	leaq	L_.str.2(%rip), %rax
	cmoveq	%rax, %rdx
	leaq	-80(%rbp), %rbx
	movq	%rbx, %rdi
	movl	$30, %esi
	leaq	L_.str.1(%rip), %rcx
	callq	_snprintf
	movq	16(%r12), %rdi
	addq	%r13, %rdi
	movl	48(%r12), %edx
	movq	%rbx, %rsi
	callq	_request_firmware
	testl	%eax, %eax
	jne	LBB0_5
## %bb.8:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	16(%r12), %rax
	movq	(%rax,%r13), %rdi
	callq	_amdgpu_ucode_validate
	testl	%eax, %eax
	jne	LBB0_5
## %bb.9:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	16(%r12), %rax
	movq	(%rax,%r13), %rax
	movq	(%rax), %rbx
	movl	4(%rbx), %edi
	callq	_le32_to_cpu
	movq	16(%r12), %rcx
	movq	%rax, 8(%rcx,%r13)
	movl	(%rbx), %edi
	callq	_le32_to_cpu
	movq	16(%r12), %rcx
	movl	%eax, -8(%rcx,%r13)
	cmpl	$20, %eax
	jl	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_4 Depth=1
	movl	$1, -4(%rcx,%r13)
LBB0_11:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	24(%r12), %rax
	movq	_AMDGPU_FW_LOAD_SMU@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rax
	jne	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	40(%r12), %rax
	movq	_AMDGPU_UCODE_ID_SDMA0@GOTPCREL(%rip), %rdx
	movslq	(%rdx), %rdx
	leal	(%r14,%rdx), %esi
	addq	%r14, %rdx
	shlq	$4, %rdx
	movl	%esi, (%rax,%rdx)
	movq	(%rcx,%r13), %rcx
	movq	%rcx, 8(%rax,%rdx)
	movq	(%rcx), %rax
	movl	(%rax), %edi
	callq	_le32_to_cpu
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	%rax, %rdi
	callq	_ALIGN
	addl	%eax, 32(%r12)
	jmp	LBB0_13
LBB0_14:
	xorl	%r15d, %r15d
	jmp	LBB0_15
LBB0_5:
	movl	%eax, %r15d
	leaq	L_.str.4(%rip), %rdi
	leaq	-80(%rbp), %rsi
	callq	_pr_err
	cmpl	$0, 8(%r12)
	jle	LBB0_15
## %bb.6:
	movq	16(%r12), %rax
	movl	$8, %ebx
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%rax,%rbx), %rdi
	callq	_release_firmware
	movq	16(%r12), %rax
	movq	$0, (%rax,%rbx)
	incq	%r14
	movslq	8(%r12), %rcx
	addq	$24, %rbx
	cmpq	%rcx, %r14
	jl	LBB0_7
LBB0_15:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_17
## %bb.16:
	movl	%r15d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_17:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"\n"

L_.str.1:                               ## @.str.1
	.asciz	"topaz"

L_.str.2:                               ## @.str.2
	.asciz	"amdgpu/%s_sdma.bin"

L_.str.3:                               ## @.str.3
	.asciz	"amdgpu/%s_sdma1.bin"

	.comm	_AMDGPU_FW_LOAD_SMU,8,3         ## @AMDGPU_FW_LOAD_SMU
	.comm	_AMDGPU_UCODE_ID_SDMA0,4,2      ## @AMDGPU_UCODE_ID_SDMA0
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
L_.str.4:                               ## @.str.4
	.asciz	"sdma_v2_4: Failed to load firmware \"%s\"\n"

	.no_dead_strip	_sdma_v2_4_init_microcode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sdma_v2_4_init_microcode
_sdma_v2_4_init_microcode:              ; @sdma_v2_4_init_microcode
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #40]
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_DEBUG
	ldr	w8, [x19]
	cmp	w8, #128
	b.eq	LBB0_2
; %bb.1:
	bl	_BUG
LBB0_2:
	ldr	w8, [x19, #8]
	cmp	w8, #1
	b.lt	LBB0_11
; %bb.3:
	mov	x22, #0
	mov	x23, #0
Lloh5:
	adrp	x24, l_.str.3@PAGE
Lloh6:
	add	x24, x24, l_.str.3@PAGEOFF
Lloh7:
	adrp	x26, l_.str.2@PAGE
Lloh8:
	add	x26, x26, l_.str.2@PAGEOFF
Lloh9:
	adrp	x27, _AMDGPU_FW_LOAD_SMU@GOTPAGE
Lloh10:
	ldr	x27, [x27, _AMDGPU_FW_LOAD_SMU@GOTPAGEOFF]
Lloh11:
	adrp	x28, _AMDGPU_UCODE_ID_SDMA0@GOTPAGE
Lloh12:
	ldr	x28, [x28, _AMDGPU_UCODE_ID_SDMA0@GOTPAGEOFF]
Lloh13:
	adrp	x25, _PAGE_SIZE@GOTPAGE
Lloh14:
	ldr	x25, [x25, _PAGE_SIZE@GOTPAGEOFF]
Lloh15:
	adrp	x20, l_.str.1@PAGE
Lloh16:
	add	x20, x20, l_.str.1@PAGEOFF
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x23, x23, #1
	ldrsw	x8, [x19, #8]
	add	x22, x22, #24
	cmp	x23, x8
	b.ge	LBB0_11
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	cmp	x23, #0
	csel	x2, x26, x24, eq
	add	x0, sp, #10
	mov	w1, #30
	mov	x3, x20
	bl	_snprintf
	ldr	x8, [x19, #16]
	add	x8, x8, x22
	add	x0, x8, #8
	ldr	w2, [x19, #48]
	add	x1, sp, #10
	bl	_request_firmware
	cbnz	w0, LBB0_12
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x19, #16]
	add	x8, x8, x22
	ldr	x0, [x8, #8]
	bl	_amdgpu_ucode_validate
	cbnz	w0, LBB0_12
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x19, #16]
	add	x8, x8, x22
	ldr	x8, [x8, #8]
	ldr	x21, [x8]
	ldr	w0, [x21, #4]
	bl	_le32_to_cpu
	ldr	x8, [x19, #16]
	add	x8, x8, x22
	str	x0, [x8, #16]
	ldr	w0, [x21]
	bl	_le32_to_cpu
	ldr	x8, [x19, #16]
	str	w0, [x8, x22]
	cmp	w0, #20
	b.lt	LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	add	x9, x8, x22
	mov	w10, #1
	str	w10, [x9, #4]
LBB0_9:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	x9, [x19, #24]
	ldr	x10, [x27]
	cmp	x9, x10
	b.ne	LBB0_4
; %bb.10:                               ;   in Loop: Header=BB0_5 Depth=1
	ldr	x9, [x19, #40]
	ldrsw	x10, [x28]
	add	w11, w23, w10
	add	x10, x23, x10
	add	x9, x9, x10, lsl #4
	str	w11, [x9]
	add	x8, x8, x22
	ldr	x8, [x8, #8]
	str	x8, [x9, #8]
	ldr	x8, [x8]
	ldr	w0, [x8]
	bl	_le32_to_cpu
	ldr	w1, [x25]
	bl	_ALIGN
	ldr	w8, [x19, #32]
	add	w8, w8, w0
	str	w8, [x19, #32]
	b	LBB0_4
LBB0_11:
	mov	w21, #0
	b	LBB0_15
LBB0_12:
	mov	x21, x0
Lloh17:
	adrp	x0, l_.str.4@PAGE
Lloh18:
	add	x0, x0, l_.str.4@PAGEOFF
	add	x1, sp, #10
	bl	_pr_err
	ldr	w8, [x19, #8]
	cmp	w8, #1
	b.lt	LBB0_15
; %bb.13:
	mov	x20, #0
	ldr	x8, [x19, #16]
	mov	w22, #8
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x8, x22]
	bl	_release_firmware
	ldr	x8, [x19, #16]
	str	xzr, [x8, x22]
	add	x20, x20, #1
	ldrsw	x9, [x19, #8]
	add	x22, x22, #24
	cmp	x20, x9
	b.lt	LBB0_14
LBB0_15:
	ldr	x8, [sp, #40]
Lloh19:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh20:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh21:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_17
; %bb.16:
	mov	x0, x21
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
LBB0_17:
	bl	___stack_chk_fail
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"\n"

l_.str.1:                               ; @.str.1
	.asciz	"topaz"

l_.str.2:                               ; @.str.2
	.asciz	"amdgpu/%s_sdma.bin"

l_.str.3:                               ; @.str.3
	.asciz	"amdgpu/%s_sdma1.bin"

	.comm	_AMDGPU_FW_LOAD_SMU,8,3         ; @AMDGPU_FW_LOAD_SMU
	.comm	_AMDGPU_UCODE_ID_SDMA0,4,2      ; @AMDGPU_UCODE_ID_SDMA0
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
l_.str.4:                               ; @.str.4
	.asciz	"sdma_v2_4: Failed to load firmware \"%s\"\n"

	.no_dead_strip	_sdma_v2_4_init_microcode
.subsections_via_symbols
