	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nv04_update_arb
_nv04_update_arb:                       ## @nv04_update_arb
	.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	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, -120(%rbp)                 ## 8-byte Spill
	movq	%rcx, -112(%rbp)                ## 8-byte Spill
	movl	%edx, -56(%rbp)                 ## 4-byte Spill
	movl	%esi, -52(%rbp)                 ## 4-byte Spill
	movq	%rdi, %r14
	callq	_nouveau_drm
	movq	%rax, -104(%rbp)                ## 8-byte Spill
	movq	%r14, %rdi
	callq	_nouveau_drm
	movq	%rax, %rbx
	addq	$8, %rbx
	movq	_PLL_MEMORY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_nouveau_hw_get_clock
	movl	%eax, %r15d
	movq	_PLL_CORE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_nouveau_hw_get_clock
	movl	%eax, %r12d
	movq	_NV04_PFB_CFG1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_nvif_rd32
	movl	%eax, %r13d
	movl	-52(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, -96(%rbp)
	movl	%r15d, -92(%rbp)
	movl	%r12d, -88(%rbp)
	movl	-56(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, -84(%rbp)
	movq	%r14, %rdi
	callq	_nv_two_heads
	movl	%eax, -64(%rbp)
	movq	(%r14), %rax
	movzwl	(%rax), %ecx
	cmpl	$496, %ecx                      ## imm = 0x1F0
	je	LBB0_2
## %bb.1:
	movzwl	%cx, %ecx
	cmpl	$416, %ecx                      ## imm = 0x1A0
	jne	LBB0_3
LBB0_2:
	movl	4(%rax), %edi
	callq	_pci_domain_nr
	movl	%eax, %edi
	xorl	%esi, %esi
	movl	$1, %edx
	callq	_pci_get_domain_bus_and_slot
	leaq	-48(%rbp), %rdx
	movl	%eax, %edi
	movl	$124, %esi
	callq	_pci_read_config_dword
	movl	-48(%rbp), %eax
	shrl	$12, %eax
	andl	$1, %eax
	movl	%eax, -80(%rbp)
	movabsq	$12884901952, %rax              ## imm = 0x300000040
	movq	%rax, -76(%rbp)
	movl	$10, -68(%rbp)
	jmp	LBB0_4
LBB0_3:
	movq	_NV04_PFB_CFG0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_nvif_rd32
	andl	$1, %eax
	movl	%eax, -80(%rbp)
	movq	_NV_PEXTDEV_BOOT_0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_nvif_rd32
                                        ## kill: def $eax killed $eax def $rax
	andl	$16, %eax
	leal	64(,%rax,4), %eax
	movl	%eax, -76(%rbp)
	movl	%r13d, %eax
	andl	$15, %eax
	movl	%eax, -72(%rbp)
	movl	%r13d, %eax
	shrl	$4, %eax
	andl	$15, %eax
	shrl	$31, %r13d
	addl	%eax, %r13d
	movl	%r13d, -68(%rbp)
LBB0_4:
	movq	-104(%rbp), %rax                ## 8-byte Reload
	movq	(%rax), %rax
	movq	_NV_DEVICE_INFO_V0_TNT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_6
## %bb.5:
	leaq	-48(%rbp), %rdi
	leaq	-96(%rbp), %rsi
	callq	_nv04_calc_arb
	jmp	LBB0_7
LBB0_6:
	leaq	-48(%rbp), %rdi
	leaq	-96(%rbp), %rsi
	callq	_nv10_calc_arb
LBB0_7:
	movl	-48(%rbp), %edi
	sarl	$4, %edi
	callq	_ilog2
	movq	-112(%rbp), %rcx                ## 8-byte Reload
	movl	%eax, (%rcx)
	movl	-44(%rbp), %eax
	sarl	$3, %eax
	movq	-120(%rbp), %rcx                ## 8-byte Reload
	movl	%eax, (%rcx)
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PLL_MEMORY,4,2                 ## @PLL_MEMORY
	.comm	_PLL_CORE,4,2                   ## @PLL_CORE
	.comm	_NV04_PFB_CFG1,4,2              ## @NV04_PFB_CFG1
	.comm	_NV04_PFB_CFG0,4,2              ## @NV04_PFB_CFG0
	.comm	_NV_PEXTDEV_BOOT_0,4,2          ## @NV_PEXTDEV_BOOT_0
	.comm	_NV_DEVICE_INFO_V0_TNT,8,3      ## @NV_DEVICE_INFO_V0_TNT
	.no_dead_strip	_nv04_update_arb
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function nv04_update_arb
lCPI0_0:
	.long	64                              ; 0x40
	.long	3                               ; 0x3
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_nv04_update_arb:                       ; @nv04_update_arb
	.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, x4
	mov	x20, x3
	mov	x24, x2
	mov	x25, x1
	mov	x26, x0
	bl	_nouveau_drm
	mov	x21, x0
	mov	x0, x26
	bl	_nouveau_drm
	add	x22, x0, #8
Lloh0:
	adrp	x8, _PLL_MEMORY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PLL_MEMORY@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x26
	bl	_nouveau_hw_get_clock
	mov	x27, x0
Lloh3:
	adrp	x8, _PLL_CORE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PLL_CORE@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x26
	bl	_nouveau_hw_get_clock
	mov	x28, x0
Lloh6:
	adrp	x8, _NV04_PFB_CFG1@GOTPAGE
Lloh7:
	ldr	x8, [x8, _NV04_PFB_CFG1@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x22
	bl	_nvif_rd32
	mov	x23, x0
	stp	w25, w27, [sp]
	stp	w28, w24, [sp, #8]
	mov	x0, x26
	bl	_nv_two_heads
	str	w0, [sp, #32]
	ldr	x8, [x26]
	ldrh	w9, [x8]
	cmp	w9, #496
	b.eq	LBB0_2
; %bb.1:
	cmp	w9, #416
	b.ne	LBB0_3
LBB0_2:
	ldr	w0, [x8, #4]
	bl	_pci_domain_nr
	mov	w1, #0
	mov	w2, #1
	bl	_pci_get_domain_bus_and_slot
	add	x2, sp, #40
	mov	w1, #124
	bl	_pci_read_config_dword
	ldr	w8, [sp, #40]
	ubfx	w8, w8, #12, #1
	str	w8, [sp, #16]
Lloh9:
	adrp	x8, lCPI0_0@PAGE
Lloh10:
	ldr	d0, [x8, lCPI0_0@PAGEOFF]
	stur	d0, [sp, #20]
	mov	w8, #10
	b	LBB0_4
LBB0_3:
Lloh11:
	adrp	x8, _NV04_PFB_CFG0@GOTPAGE
Lloh12:
	ldr	x8, [x8, _NV04_PFB_CFG0@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	mov	x0, x22
	bl	_nvif_rd32
	and	w8, w0, #0x1
	str	w8, [sp, #16]
Lloh14:
	adrp	x8, _NV_PEXTDEV_BOOT_0@GOTPAGE
Lloh15:
	ldr	x8, [x8, _NV_PEXTDEV_BOOT_0@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	mov	x0, x22
	bl	_nvif_rd32
	tst	w0, #0x10
	mov	w8, #128
	mov	w9, #64
	csel	w8, w9, w8, eq
	and	w9, w23, #0xf
	stp	w8, w9, [sp, #20]
	ubfx	w8, w23, #4, #4
	add	w8, w8, w23, lsr #31
LBB0_4:
	str	w8, [sp, #28]
	ldr	x8, [x21]
Lloh17:
	adrp	x9, _NV_DEVICE_INFO_V0_TNT@GOTPAGE
Lloh18:
	ldr	x9, [x9, _NV_DEVICE_INFO_V0_TNT@GOTPAGEOFF]
Lloh19:
	ldr	x9, [x9]
	add	x0, sp, #40
	mov	x1, sp
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.5:
	bl	_nv04_calc_arb
	b	LBB0_7
LBB0_6:
	bl	_nv10_calc_arb
LBB0_7:
	ldr	w8, [sp, #40]
	asr	w0, w8, #4
	bl	_ilog2
	str	w0, [x20]
	ldr	w8, [sp, #44]
	asr	w8, w8, #3
	str	w8, [x19]
	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
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdr	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_PLL_MEMORY,4,2                 ; @PLL_MEMORY
	.comm	_PLL_CORE,4,2                   ; @PLL_CORE
	.comm	_NV04_PFB_CFG1,4,2              ; @NV04_PFB_CFG1
	.comm	_NV04_PFB_CFG0,4,2              ; @NV04_PFB_CFG0
	.comm	_NV_PEXTDEV_BOOT_0,4,2          ; @NV_PEXTDEV_BOOT_0
	.comm	_NV_DEVICE_INFO_V0_TNT,8,3      ; @NV_DEVICE_INFO_V0_TNT
	.no_dead_strip	_nv04_update_arb
.subsections_via_symbols
