	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_NVSetOwner                     ## -- Begin function NVSetOwner
	.p2align	4, 0x90
_NVSetOwner:                            ## @NVSetOwner
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	movq	%rdi, %r14
	callq	_nouveau_drm
	movq	%rax, %r15
	cmpl	$1, %ebx
	movl	$3, %r12d
	cmovnel	%ebx, %r12d
	movl	(%rax), %edi
	callq	_nv_device
	cmpl	$17, (%rax)
	jne	LBB0_2
## %bb.1:
	movq	_NV_CIO_SR_LOCK_INDEX@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edx
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_NVReadVgaCrtc
	movl	(%rbx), %edx
	movq	%r14, %rdi
	movl	$1, %esi
	callq	_NVReadVgaCrtc
LBB0_2:
	movq	_NV_CIO_CRE_44@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	xorl	%esi, %esi
	movl	%r12d, %ecx
	callq	_NVWriteVgaCrtc
	movl	(%r15), %edi
	callq	_nv_device
	cmpl	$17, (%rax)
	jne	LBB0_3
## %bb.4:
	movq	_NV_CIO_CRE_2E@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edx
	movq	%r14, %rdi
	xorl	%esi, %esi
	movl	%r12d, %ecx
	callq	_NVWriteVgaCrtc
	movl	(%rbx), %edx
	movq	%r14, %rdi
	xorl	%esi, %esi
	movl	%r12d, %ecx
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_NVWriteVgaCrtc                 ## TAILCALL
LBB0_3:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NV_CIO_SR_LOCK_INDEX,4,2       ## @NV_CIO_SR_LOCK_INDEX
	.comm	_NV_CIO_CRE_44,4,2              ## @NV_CIO_CRE_44
	.comm	_NV_CIO_CRE_2E,4,2              ## @NV_CIO_CRE_2E
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_NVSetOwner                     ; -- Begin function NVSetOwner
	.p2align	2
_NVSetOwner:                            ; @NVSetOwner
	.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	x20, x1
	mov	x19, x0
	bl	_nouveau_drm
	mov	x21, x0
	mov	w8, #3
	cmp	w20, #1
	csel	w20, w8, w20, eq
	ldr	w0, [x0]
	bl	_nv_device
	ldr	w8, [x0]
	cmp	w8, #17
	b.ne	LBB0_2
; %bb.1:
Lloh0:
	adrp	x22, _NV_CIO_SR_LOCK_INDEX@GOTPAGE
Lloh1:
	ldr	x22, [x22, _NV_CIO_SR_LOCK_INDEX@GOTPAGEOFF]
	ldr	w2, [x22]
	mov	x0, x19
	mov	w1, #0
	bl	_NVReadVgaCrtc
	ldr	w2, [x22]
	mov	x0, x19
	mov	w1, #1
	bl	_NVReadVgaCrtc
LBB0_2:
Lloh2:
	adrp	x8, _NV_CIO_CRE_44@GOTPAGE
Lloh3:
	ldr	x8, [x8, _NV_CIO_CRE_44@GOTPAGEOFF]
Lloh4:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w1, #0
	mov	x3, x20
	bl	_NVWriteVgaCrtc
	ldr	w0, [x21]
	bl	_nv_device
	ldr	w8, [x0]
	cmp	w8, #17
	b.ne	LBB0_4
; %bb.3:
Lloh5:
	adrp	x21, _NV_CIO_CRE_2E@GOTPAGE
Lloh6:
	ldr	x21, [x21, _NV_CIO_CRE_2E@GOTPAGEOFF]
	ldr	w2, [x21]
	mov	x0, x19
	mov	w1, #0
	mov	x3, x20
	bl	_NVWriteVgaCrtc
	ldr	w2, [x21]
	mov	x0, x19
	mov	w1, #0
	mov	x3, x20
	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	_NVWriteVgaCrtc
LBB0_4:
	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	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_NV_CIO_SR_LOCK_INDEX,4,2       ; @NV_CIO_SR_LOCK_INDEX
	.comm	_NV_CIO_CRE_44,4,2              ; @NV_CIO_CRE_44
	.comm	_NV_CIO_CRE_2E,4,2              ; @NV_CIO_CRE_2E
.subsections_via_symbols
