	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nv_save_state_palette
_nv_save_state_palette:                 ## @nv_save_state_palette
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r12
	movl	%esi, %r14d
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	callq	_nouveau_dev
	movq	%rax, %r13
	movq	_NV_PRMDIO_SIZE@GOTPCREL(%rip), %rax
	movslq	(%rax), %rbx
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	movslq	%r14d, %r14
	imulq	%r14, %rbx
	movq	_NV_PRMDIO_PIXEL_MASK@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	%rbx, %rsi
	movq	_NV_PRMDIO_PIXEL_MASK_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r13, %rdi
	callq	_nv_wr08
	movq	_NV_PRMDIO_READ_MODE_ADDRESS@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	%rbx, %rsi
	xorl	%r15d, %r15d
	movq	%r13, %rdi
	xorl	%edx, %edx
	callq	_nv_wr08
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	_NV_PRMDIO_PALETTE_DATA@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	%rbx, %rsi
	movq	%r13, %rdi
	callq	_nv_rd08
	movq	(%r12), %rcx
	movq	(%rcx,%r14,8), %rcx
	movl	%eax, (%rcx,%r15,4)
	incq	%r15
	cmpq	$768, %r15                      ## imm = 0x300
	jne	LBB0_1
## %bb.2:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	xorl	%edx, %edx
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_NVSetEnablePalette             ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_NV_PRMDIO_SIZE,4,2             ## @NV_PRMDIO_SIZE
	.comm	_NV_PRMDIO_PIXEL_MASK,8,3       ## @NV_PRMDIO_PIXEL_MASK
	.comm	_NV_PRMDIO_PIXEL_MASK_MASK,4,2  ## @NV_PRMDIO_PIXEL_MASK_MASK
	.comm	_NV_PRMDIO_READ_MODE_ADDRESS,8,3 ## @NV_PRMDIO_READ_MODE_ADDRESS
	.comm	_NV_PRMDIO_PALETTE_DATA,8,3     ## @NV_PRMDIO_PALETTE_DATA
	.no_dead_strip	_nv_save_state_palette
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nv_save_state_palette
_nv_save_state_palette:                 ; @nv_save_state_palette
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x21, x2
	mov	x19, x1
	mov	x20, x0
	bl	_nouveau_dev
	mov	x22, x0
Lloh0:
	adrp	x8, _NV_PRMDIO_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NV_PRMDIO_SIZE@GOTPAGEOFF]
Lloh2:
	ldrsw	x8, [x8]
	sxtw	x23, w19
Lloh3:
	adrp	x9, _NV_PRMDIO_PIXEL_MASK@GOTPAGE
Lloh4:
	ldr	x9, [x9, _NV_PRMDIO_PIXEL_MASK@GOTPAGEOFF]
	mul	x24, x8, x23
Lloh5:
	ldr	x8, [x9]
	add	x1, x8, x24
Lloh6:
	adrp	x8, _NV_PRMDIO_PIXEL_MASK_MASK@GOTPAGE
Lloh7:
	ldr	x8, [x8, _NV_PRMDIO_PIXEL_MASK_MASK@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	bl	_nv_wr08
Lloh9:
	adrp	x8, _NV_PRMDIO_READ_MODE_ADDRESS@GOTPAGE
Lloh10:
	ldr	x8, [x8, _NV_PRMDIO_READ_MODE_ADDRESS@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
	add	x1, x8, x24
	mov	x0, x22
	mov	w2, #0
	bl	_nv_wr08
	mov	x25, #0
Lloh12:
	adrp	x26, _NV_PRMDIO_PALETTE_DATA@GOTPAGE
Lloh13:
	ldr	x26, [x26, _NV_PRMDIO_PALETTE_DATA@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x26]
	add	x1, x8, x24
	mov	x0, x22
	bl	_nv_rd08
	ldr	x8, [x21]
	ldr	x8, [x8, x23, lsl #3]
	str	w0, [x8, x25]
	add	x25, x25, #4
	cmp	x25, #3072
	b.ne	LBB0_1
; %bb.2:
	mov	x0, x20
	mov	x1, x19
	mov	w2, #0
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_NVSetEnablePalette
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_NV_PRMDIO_SIZE,4,2             ; @NV_PRMDIO_SIZE
	.comm	_NV_PRMDIO_PIXEL_MASK,8,3       ; @NV_PRMDIO_PIXEL_MASK
	.comm	_NV_PRMDIO_PIXEL_MASK_MASK,4,2  ; @NV_PRMDIO_PIXEL_MASK_MASK
	.comm	_NV_PRMDIO_READ_MODE_ADDRESS,8,3 ; @NV_PRMDIO_READ_MODE_ADDRESS
	.comm	_NV_PRMDIO_PALETTE_DATA,8,3     ; @NV_PRMDIO_PALETTE_DATA
	.no_dead_strip	_nv_save_state_palette
.subsections_via_symbols
