	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sdma_v4_0_early_init
_sdma_v4_0_early_init:                  ## @sdma_v4_0_early_init
	.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	(%rdi), %rax
	movq	_CHIP_RAVEN@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_2
## %bb.1:
	movq	_CHIP_RENOIR@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_2
## %bb.3:
	movq	_CHIP_ARCTURUS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_5
## %bb.4:
	movl	$8, 8(%rbx)
	jmp	LBB0_6
LBB0_2:
	movl	$1, 8(%rbx)
	jmp	LBB0_6
LBB0_5:
	movl	$2, 8(%rbx)
LBB0_6:
	movq	%rbx, %rdi
	callq	_sdma_v4_0_init_microcode
	movl	%eax, %r14d
	testl	%eax, %eax
	je	LBB0_8
## %bb.7:
	leaq	L_.str(%rip), %rdi
	callq	_DRM_ERROR
	jmp	LBB0_13
LBB0_8:
	movq	(%rbx), %rax
	movq	_CHIP_VEGA10@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_10
## %bb.9:
	movq	%rbx, %rdi
	callq	_amdgpu_sriov_vf
	xorl	%ecx, %ecx
	testq	%rax, %rax
	jne	LBB0_11
LBB0_10:
	movq	%rbx, %rdi
	callq	_sdma_v4_0_fw_support_paging_queue
	movl	$1, %ecx
	testq	%rax, %rax
	je	LBB0_12
LBB0_11:
	movl	%ecx, 12(%rbx)
LBB0_12:
	movq	%rbx, %rdi
	callq	_sdma_v4_0_set_ring_funcs
	movq	%rbx, %rdi
	callq	_sdma_v4_0_set_buffer_funcs
	movq	%rbx, %rdi
	callq	_sdma_v4_0_set_vm_pte_funcs
	movq	%rbx, %rdi
	callq	_sdma_v4_0_set_irq_funcs
LBB0_13:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CHIP_RAVEN,8,3                 ## @CHIP_RAVEN
	.comm	_CHIP_RENOIR,8,3                ## @CHIP_RENOIR
	.comm	_CHIP_ARCTURUS,8,3              ## @CHIP_ARCTURUS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to load sdma firmware!\n"

	.comm	_CHIP_VEGA10,8,3                ## @CHIP_VEGA10
	.no_dead_strip	_sdma_v4_0_early_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sdma_v4_0_early_init
_sdma_v4_0_early_init:                  ; @sdma_v4_0_early_init
	.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
	mov	x19, x0
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _CHIP_RAVEN@GOTPAGE
Lloh1:
	ldr	x9, [x9, _CHIP_RAVEN@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
Lloh3:
	adrp	x10, _CHIP_RENOIR@GOTPAGE
Lloh4:
	ldr	x10, [x10, _CHIP_RENOIR@GOTPAGEOFF]
Lloh5:
	ldr	x10, [x10]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	b.ne	LBB0_2
; %bb.1:
	mov	w8, #1
	b	LBB0_5
LBB0_2:
Lloh6:
	adrp	x9, _CHIP_ARCTURUS@GOTPAGE
Lloh7:
	ldr	x9, [x9, _CHIP_ARCTURUS@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.3:
	mov	w8, #8
	b	LBB0_5
LBB0_4:
	mov	w8, #2
LBB0_5:
	str	w8, [x19, #8]
	mov	x0, x19
	bl	_sdma_v4_0_init_microcode
	mov	x20, x0
	cbz	w0, LBB0_7
; %bb.6:
Lloh9:
	adrp	x0, l_.str@PAGE
Lloh10:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
	b	LBB0_14
LBB0_7:
	ldr	x8, [x19]
Lloh11:
	adrp	x9, _CHIP_VEGA10@GOTPAGE
Lloh12:
	ldr	x9, [x9, _CHIP_VEGA10@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_10
; %bb.8:
	mov	x0, x19
	bl	_amdgpu_sriov_vf
	cbz	x0, LBB0_10
; %bb.9:
	mov	w8, #0
	b	LBB0_12
LBB0_10:
	mov	x0, x19
	bl	_sdma_v4_0_fw_support_paging_queue
	cbz	x0, LBB0_13
; %bb.11:
	mov	w8, #1
LBB0_12:
	str	w8, [x19, #12]
LBB0_13:
	mov	x0, x19
	bl	_sdma_v4_0_set_ring_funcs
	mov	x0, x19
	bl	_sdma_v4_0_set_buffer_funcs
	mov	x0, x19
	bl	_sdma_v4_0_set_vm_pte_funcs
	mov	x0, x19
	bl	_sdma_v4_0_set_irq_funcs
LBB0_14:
	mov	x0, x20
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_CHIP_RAVEN,8,3                 ; @CHIP_RAVEN
	.comm	_CHIP_RENOIR,8,3                ; @CHIP_RENOIR
	.comm	_CHIP_ARCTURUS,8,3              ; @CHIP_ARCTURUS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to load sdma firmware!\n"

	.comm	_CHIP_VEGA10,8,3                ; @CHIP_VEGA10
	.no_dead_strip	_sdma_v4_0_early_init
.subsections_via_symbols
