	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cdv_init_pm
_cdv_init_pm:                           ## @cdv_init_pm
	.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
	movq	8(%rdi), %rax
	movq	16(%rdi), %r15
	movl	(%rax), %edi
	callq	_pci_domain_nr
	movl	%eax, %ebx
	movq	_PSB_PUNIT_PORT@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	_PSB_APMBA@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%ebx, %edi
	callq	_CDV_MSG_READ32
	movzwl	%ax, %eax
	movl	%eax, (%r15)
	movl	(%r12), %esi
	movq	_PSB_OSPMBA@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%ebx, %edi
	callq	_CDV_MSG_READ32
	movzwl	%ax, %eax
	movl	%eax, 4(%r15)
	movslq	(%r15), %rdi
	movq	_PSB_APM_CMD@GOTPCREL(%rip), %rbx
	addq	(%rbx), %rdi
	callq	_inl
	movq	_PSB_PWRGT_GFX_MASK@GOTPCREL(%rip), %r13
	movl	(%r13), %edi
	notl	%edi
	andl	%eax, %edi
	movq	_PSB_PWRGT_GFX_ON@GOTPCREL(%rip), %rax
	orl	(%rax), %edi
	movslq	(%r15), %rsi
	addq	(%rbx), %rsi
	callq	_outl
	movslq	(%r15), %rdi
	movq	_PSB_APM_STS@GOTPCREL(%rip), %r12
	addq	(%r12), %rdi
	callq	_inl
	testl	%eax, (%r13)
	je	LBB0_5
## %bb.1:
	movl	$10, %edi
	callq	_udelay
	movslq	(%r15), %rdi
	addq	(%r12), %rdi
	callq	_inl
	testl	%eax, (%r13)
	je	LBB0_5
## %bb.2:
	movl	$10, %edi
	callq	_udelay
	movslq	(%r15), %rdi
	addq	(%r12), %rdi
	callq	_inl
	testl	%eax, (%r13)
	je	LBB0_5
## %bb.3:
	movl	$10, %edi
	callq	_udelay
	movslq	(%r15), %rdi
	addq	(%r12), %rdi
	callq	_inl
	testl	%eax, (%r13)
	je	LBB0_5
## %bb.4:
	movl	$10, %edi
	callq	_udelay
	movslq	(%r15), %rdi
	addq	(%r12), %rdi
	callq	_inl
	testl	%eax, (%r13)
	je	LBB0_5
## %bb.6:
	movl	$10, %edi
	callq	_udelay
	movl	(%r14), %edi
	leaq	L_.str(%rip), %rsi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_dev_err                        ## TAILCALL
LBB0_5:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PSB_PUNIT_PORT,4,2             ## @PSB_PUNIT_PORT
	.comm	_PSB_APMBA,4,2                  ## @PSB_APMBA
	.comm	_PSB_OSPMBA,4,2                 ## @PSB_OSPMBA
	.comm	_PSB_APM_CMD,8,3                ## @PSB_APM_CMD
	.comm	_PSB_PWRGT_GFX_MASK,4,2         ## @PSB_PWRGT_GFX_MASK
	.comm	_PSB_PWRGT_GFX_ON,4,2           ## @PSB_PWRGT_GFX_ON
	.comm	_PSB_APM_STS,8,3                ## @PSB_APM_STS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"GPU: power management timed out.\n"

	.no_dead_strip	_cdv_init_pm
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cdv_init_pm
_cdv_init_pm:                           ; @cdv_init_pm
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x0
	ldp	x8, x21, [x0, #8]
	ldr	w0, [x8]
	bl	_pci_domain_nr
	mov	x20, x0
Lloh0:
	adrp	x22, _PSB_PUNIT_PORT@GOTPAGE
Lloh1:
	ldr	x22, [x22, _PSB_PUNIT_PORT@GOTPAGEOFF]
	ldr	w1, [x22]
Lloh2:
	adrp	x8, _PSB_APMBA@GOTPAGE
Lloh3:
	ldr	x8, [x8, _PSB_APMBA@GOTPAGEOFF]
Lloh4:
	ldr	w2, [x8]
	bl	_CDV_MSG_READ32
	and	w8, w0, #0xffff
	str	w8, [x21]
	ldr	w1, [x22]
Lloh5:
	adrp	x8, _PSB_OSPMBA@GOTPAGE
Lloh6:
	ldr	x8, [x8, _PSB_OSPMBA@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_CDV_MSG_READ32
	and	w8, w0, #0xffff
	str	w8, [x21, #4]
	ldrsw	x8, [x21]
Lloh8:
	adrp	x22, _PSB_APM_CMD@GOTPAGE
Lloh9:
	ldr	x22, [x22, _PSB_APM_CMD@GOTPAGEOFF]
	ldr	x9, [x22]
	add	x0, x9, x8
	bl	_inl
Lloh10:
	adrp	x20, _PSB_PWRGT_GFX_MASK@GOTPAGE
Lloh11:
	ldr	x20, [x20, _PSB_PWRGT_GFX_MASK@GOTPAGEOFF]
	ldr	w8, [x20]
Lloh12:
	adrp	x9, _PSB_PWRGT_GFX_ON@GOTPAGE
Lloh13:
	ldr	x9, [x9, _PSB_PWRGT_GFX_ON@GOTPAGEOFF]
	bic	w8, w0, w8
Lloh14:
	ldr	w9, [x9]
	orr	w0, w8, w9
	ldrsw	x8, [x21]
	ldr	x9, [x22]
	add	x1, x9, x8
	bl	_outl
	ldrsw	x8, [x21]
Lloh15:
	adrp	x22, _PSB_APM_STS@GOTPAGE
Lloh16:
	ldr	x22, [x22, _PSB_APM_STS@GOTPAGEOFF]
	ldr	x9, [x22]
	add	x0, x9, x8
	bl	_inl
	ldr	w8, [x20]
	tst	w8, w0
	b.eq	LBB0_6
; %bb.1:
	mov	w0, #10
	bl	_udelay
	ldrsw	x8, [x21]
	ldr	x9, [x22]
	add	x0, x9, x8
	bl	_inl
	ldr	w8, [x20]
	tst	w8, w0
	b.eq	LBB0_6
; %bb.2:
	mov	w0, #10
	bl	_udelay
	ldrsw	x8, [x21]
	ldr	x9, [x22]
	add	x0, x9, x8
	bl	_inl
	ldr	w8, [x20]
	tst	w8, w0
	b.eq	LBB0_6
; %bb.3:
	mov	w0, #10
	bl	_udelay
	ldrsw	x8, [x21]
	ldr	x9, [x22]
	add	x0, x9, x8
	bl	_inl
	ldr	w8, [x20]
	tst	w8, w0
	b.eq	LBB0_6
; %bb.4:
	mov	w0, #10
	bl	_udelay
	ldrsw	x8, [x21]
	ldr	x9, [x22]
	add	x0, x9, x8
	bl	_inl
	ldr	w8, [x20]
	tst	w8, w0
	b.eq	LBB0_6
; %bb.5:
	mov	w0, #10
	bl	_udelay
	ldr	w0, [x19]
Lloh17:
	adrp	x1, l_.str@PAGE
Lloh18:
	add	x1, x1, l_.str@PAGEOFF
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_dev_err
LBB0_6:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_PSB_PUNIT_PORT,4,2             ; @PSB_PUNIT_PORT
	.comm	_PSB_APMBA,4,2                  ; @PSB_APMBA
	.comm	_PSB_OSPMBA,4,2                 ; @PSB_OSPMBA
	.comm	_PSB_APM_CMD,8,3                ; @PSB_APM_CMD
	.comm	_PSB_PWRGT_GFX_MASK,4,2         ; @PSB_PWRGT_GFX_MASK
	.comm	_PSB_PWRGT_GFX_ON,4,2           ; @PSB_PWRGT_GFX_ON
	.comm	_PSB_APM_STS,8,3                ; @PSB_APM_STS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"GPU: power management timed out.\n"

	.no_dead_strip	_cdv_init_pm
.subsections_via_symbols
