	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function amdgpu_device_ip_init
_amdgpu_device_ip_init:                 ## @amdgpu_device_ip_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	%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	%rdi, %r14
	callq	_amdgpu_ras_init
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_33
## %bb.1:
	cmpl	$0, (%r14)
	jle	LBB0_20
## %bb.2:
	leaq	12(%r14), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	xorl	%ebx, %ebx
	movq	_AMD_IP_BLOCK_TYPE_GMC@GOTPCREL(%rip), %r12
	xorl	%r13d, %r13d
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	_AMDGPU_GEM_DOMAIN_VRAM@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_AMDGPU_CSA_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r14, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	callq	_amdgpu_allocate_static_csa
	testl	%eax, %eax
	jne	LBB0_18
LBB0_19:                                ##   in Loop: Header=BB0_3 Depth=1
	incq	%r13
	movslq	(%r14), %rax
	addq	$24, %rbx
	cmpq	%rax, %r13
	jge	LBB0_20
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	16(%r14), %rax
	cmpl	$0, 8(%rax,%rbx)
	je	LBB0_19
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	16(%rax,%rbx), %rax
	movq	8(%rax), %rax
	movq	%r14, %rdi
	callq	*(%rax)
	testl	%eax, %eax
	jne	LBB0_5
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	16(%r14), %rax
	movl	$1, (%rax,%rbx)
	movq	16(%rax,%rbx), %rax
	movq	(%rax), %rax
	cmpq	(%r12), %rax
	jne	LBB0_19
## %bb.7:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%r14, %rdi
	callq	_amdgpu_device_vram_scratch_init
	testl	%eax, %eax
	jne	LBB0_8
## %bb.10:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	16(%r14), %rax
	movq	16(%rax,%rbx), %rax
	movq	8(%rax), %rax
	movq	%r14, %rdi
	callq	*8(%rax)
	testl	%eax, %eax
	jne	LBB0_11
## %bb.13:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	%r14, %rdi
	callq	_amdgpu_device_wb_init
	testl	%eax, %eax
	jne	LBB0_14
## %bb.15:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	16(%r14), %rax
	movl	$1, 4(%rax,%rbx)
	movq	_amdgpu_mcbp@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	jne	LBB0_17
## %bb.16:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	%r14, %rdi
	callq	_amdgpu_sriov_vf
	testq	%rax, %rax
	jne	LBB0_17
	jmp	LBB0_19
LBB0_20:
	movq	%r14, %rdi
	callq	_amdgpu_ib_pool_init
	testl	%eax, %eax
	je	LBB0_23
## %bb.21:
	movl	%eax, %r15d
	movl	8(%r14), %edi
	leaq	L_.str.5(%rip), %rsi
	movl	%eax, %edx
	callq	_dev_err
	movq	_AMDGIM_ERROR_VF_IB_INIT_FAIL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	xorl	%edx, %edx
	movl	%r15d, %ecx
	callq	_amdgpu_vf_error_put
	jmp	LBB0_22
LBB0_23:
	movq	%r14, %rdi
	callq	_amdgpu_ucode_create_bo
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_22
## %bb.24:
	movq	%r14, %rdi
	callq	_amdgpu_device_ip_hw_init_phase1
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_22
## %bb.25:
	movq	%r14, %rdi
	callq	_amdgpu_device_fw_loading
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_22
## %bb.26:
	movq	%r14, %rdi
	callq	_amdgpu_device_ip_hw_init_phase2
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_22
## %bb.27:
	cmpl	$2, 4(%r14)
	jl	LBB0_29
## %bb.28:
	movq	%r14, %rdi
	callq	_amdgpu_xgmi_add_device
LBB0_29:
	movq	%r14, %rdi
	callq	_amdgpu_amdkfd_device_init
	movq	%r14, %rdi
	callq	_amdgpu_sriov_vf
	testq	%rax, %rax
	je	LBB0_30
## %bb.31:
	movq	%r14, %rdi
	callq	_amdgpu_virt_init_data_exchange
	xorl	%r15d, %r15d
	jmp	LBB0_32
LBB0_5:
	movl	%eax, %r15d
	movq	16(%r14), %rax
	movq	16(%rax,%rbx), %rax
	movq	8(%rax), %rax
	movl	16(%rax), %esi
	leaq	L_.str(%rip), %rdi
	jmp	LBB0_12
LBB0_8:
	movl	%eax, %r15d
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_9
LBB0_11:
	movl	%eax, %r15d
	leaq	L_.str.2(%rip), %rdi
	movl	%r13d, %esi
LBB0_12:
	movl	%r15d, %edx
	xorl	%eax, %eax
	callq	_DRM_ERROR
	jmp	LBB0_22
LBB0_14:
	movl	%eax, %r15d
	leaq	L_.str.3(%rip), %rdi
	jmp	LBB0_9
LBB0_18:
	movl	%eax, %r15d
	leaq	L_.str.4(%rip), %rdi
LBB0_9:
	movl	%r15d, %esi
	xorl	%eax, %eax
	callq	_DRM_ERROR
LBB0_22:
	movq	%r14, %rdi
	callq	_amdgpu_sriov_vf
	testq	%rax, %rax
	je	LBB0_33
LBB0_32:
	movq	%r14, %rdi
	movl	$1, %esi
	callq	_amdgpu_virt_release_full_gpu
LBB0_33:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_30:
	xorl	%r15d, %r15d
	jmp	LBB0_33
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"sw_init of IP block <%s> failed %d\n"

	.comm	_AMD_IP_BLOCK_TYPE_GMC,8,3      ## @AMD_IP_BLOCK_TYPE_GMC
L_.str.1:                               ## @.str.1
	.asciz	"amdgpu_vram_scratch_init failed %d\n"

L_.str.2:                               ## @.str.2
	.asciz	"hw_init %d failed %d\n"

L_.str.3:                               ## @.str.3
	.asciz	"amdgpu_device_wb_init failed %d\n"

	.comm	_amdgpu_mcbp,8,3                ## @amdgpu_mcbp
	.comm	_AMDGPU_GEM_DOMAIN_VRAM,4,2     ## @AMDGPU_GEM_DOMAIN_VRAM
	.comm	_AMDGPU_CSA_SIZE,4,2            ## @AMDGPU_CSA_SIZE
L_.str.4:                               ## @.str.4
	.asciz	"allocate CSA failed %d\n"

L_.str.5:                               ## @.str.5
	.asciz	"IB initialization failed (%d).\n"

	.comm	_AMDGIM_ERROR_VF_IB_INIT_FAIL,4,2 ## @AMDGIM_ERROR_VF_IB_INIT_FAIL
	.no_dead_strip	_amdgpu_device_ip_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function amdgpu_device_ip_init
_amdgpu_device_ip_init:                 ; @amdgpu_device_ip_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	bl	_amdgpu_ras_init
	mov	x20, x0
	cbnz	w0, LBB0_32
; %bb.1:
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_13
; %bb.2:
	mov	x23, #0
	mov	x21, #0
	add	x22, x19, #12
	mov	w24, #1
Lloh0:
	adrp	x25, _AMD_IP_BLOCK_TYPE_GMC@GOTPAGE
Lloh1:
	ldr	x25, [x25, _AMD_IP_BLOCK_TYPE_GMC@GOTPAGEOFF]
Lloh2:
	adrp	x26, _amdgpu_mcbp@GOTPAGE
Lloh3:
	ldr	x26, [x26, _amdgpu_mcbp@GOTPAGEOFF]
Lloh4:
	adrp	x27, _AMDGPU_GEM_DOMAIN_VRAM@GOTPAGE
Lloh5:
	ldr	x27, [x27, _AMDGPU_GEM_DOMAIN_VRAM@GOTPAGEOFF]
Lloh6:
	adrp	x28, _AMDGPU_CSA_SIZE@GOTPAGE
Lloh7:
	ldr	x28, [x28, _AMDGPU_CSA_SIZE@GOTPAGEOFF]
	b	LBB0_5
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	w2, [x27]
	ldr	w3, [x28]
	mov	x0, x19
	mov	x1, x22
	bl	_amdgpu_allocate_static_csa
	cbnz	w0, LBB0_27
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x21, x21, #1
	ldrsw	x8, [x19]
	add	x23, x23, #24
	cmp	x21, x8
	b.ge	LBB0_13
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #16]
	add	x8, x8, x23
	ldr	w9, [x8, #8]
	cbz	w9, LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x8, #16]
	ldr	x8, [x8, #8]
	ldr	x8, [x8]
	mov	x0, x19
	blr	x8
	cbnz	w0, LBB0_23
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x19, #16]
	add	x8, x8, x23
	str	w24, [x8]
	ldr	x8, [x8, #16]
	ldr	x8, [x8]
	ldr	x9, [x25]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x19
	bl	_amdgpu_device_vram_scratch_init
	cbnz	w0, LBB0_24
; %bb.9:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x19, #16]
	add	x8, x8, x23
	ldr	x8, [x8, #16]
	ldr	x8, [x8, #8]
	ldr	x8, [x8, #8]
	mov	x0, x19
	blr	x8
	cbnz	w0, LBB0_25
; %bb.10:                               ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x19
	bl	_amdgpu_device_wb_init
	cbnz	w0, LBB0_26
; %bb.11:                               ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x19, #16]
	add	x8, x8, x23
	str	w24, [x8, #4]
	ldr	x8, [x26]
	cbnz	x8, LBB0_3
; %bb.12:                               ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x19
	bl	_amdgpu_sriov_vf
	cbnz	x0, LBB0_3
	b	LBB0_4
LBB0_13:
	mov	x0, x19
	bl	_amdgpu_ib_pool_init
	cbz	w0, LBB0_15
; %bb.14:
	mov	x20, x0
	ldr	w0, [x19, #8]
Lloh8:
	adrp	x1, l_.str.5@PAGE
Lloh9:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x2, x20
	bl	_dev_err
Lloh10:
	adrp	x8, _AMDGIM_ERROR_VF_IB_INIT_FAIL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _AMDGIM_ERROR_VF_IB_INIT_FAIL@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	mov	x3, x20
	bl	_amdgpu_vf_error_put
	b	LBB0_30
LBB0_15:
	mov	x0, x19
	bl	_amdgpu_ucode_create_bo
	mov	x20, x0
	cbnz	w0, LBB0_30
; %bb.16:
	mov	x0, x19
	bl	_amdgpu_device_ip_hw_init_phase1
	mov	x20, x0
	cbnz	w0, LBB0_30
; %bb.17:
	mov	x0, x19
	bl	_amdgpu_device_fw_loading
	mov	x20, x0
	cbnz	w0, LBB0_30
; %bb.18:
	mov	x0, x19
	bl	_amdgpu_device_ip_hw_init_phase2
	mov	x20, x0
	cbnz	w0, LBB0_30
; %bb.19:
	ldr	w8, [x19, #4]
	cmp	w8, #2
	b.lt	LBB0_21
; %bb.20:
	mov	x0, x19
	bl	_amdgpu_xgmi_add_device
LBB0_21:
	mov	x0, x19
	bl	_amdgpu_amdkfd_device_init
	mov	x0, x19
	bl	_amdgpu_sriov_vf
	cbz	x0, LBB0_33
; %bb.22:
	mov	x0, x19
	bl	_amdgpu_virt_init_data_exchange
	mov	w20, #0
	b	LBB0_31
LBB0_23:
	mov	x20, x0
	ldr	x8, [x19, #16]
	add	x8, x8, x23
	ldr	x8, [x8, #16]
	ldr	x8, [x8, #8]
	ldr	w1, [x8, #16]
	str	x20, [sp]
Lloh13:
	adrp	x0, l_.str@PAGE
Lloh14:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_29
LBB0_24:
	mov	x20, x0
Lloh15:
	adrp	x0, l_.str.1@PAGE
Lloh16:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_28
LBB0_25:
	mov	x20, x0
	str	x20, [sp]
Lloh17:
	adrp	x0, l_.str.2@PAGE
Lloh18:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x21
	bl	_DRM_ERROR
                                        ; kill: def $w20 killed $w20 killed $x20 def $x20
	b	LBB0_30
LBB0_26:
	mov	x20, x0
Lloh19:
	adrp	x0, l_.str.3@PAGE
Lloh20:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_28
LBB0_27:
	mov	x20, x0
Lloh21:
	adrp	x0, l_.str.4@PAGE
Lloh22:
	add	x0, x0, l_.str.4@PAGEOFF
LBB0_28:
	mov	x1, x20
LBB0_29:
	bl	_DRM_ERROR
LBB0_30:
	mov	x0, x19
	bl	_amdgpu_sriov_vf
	cbz	x0, LBB0_32
LBB0_31:
	mov	x0, x19
	mov	w1, #1
	bl	_amdgpu_virt_release_full_gpu
LBB0_32:
	mov	x0, x20
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_33:
	mov	w20, #0
	b	LBB0_32
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"sw_init of IP block <%s> failed %d\n"

	.comm	_AMD_IP_BLOCK_TYPE_GMC,8,3      ; @AMD_IP_BLOCK_TYPE_GMC
l_.str.1:                               ; @.str.1
	.asciz	"amdgpu_vram_scratch_init failed %d\n"

l_.str.2:                               ; @.str.2
	.asciz	"hw_init %d failed %d\n"

l_.str.3:                               ; @.str.3
	.asciz	"amdgpu_device_wb_init failed %d\n"

	.comm	_amdgpu_mcbp,8,3                ; @amdgpu_mcbp
	.comm	_AMDGPU_GEM_DOMAIN_VRAM,4,2     ; @AMDGPU_GEM_DOMAIN_VRAM
	.comm	_AMDGPU_CSA_SIZE,4,2            ; @AMDGPU_CSA_SIZE
l_.str.4:                               ; @.str.4
	.asciz	"allocate CSA failed %d\n"

l_.str.5:                               ; @.str.5
	.asciz	"IB initialization failed (%d).\n"

	.comm	_AMDGIM_ERROR_VF_IB_INIT_FAIL,4,2 ; @AMDGIM_ERROR_VF_IB_INIT_FAIL
	.no_dead_strip	_amdgpu_device_ip_init
.subsections_via_symbols
