	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nouveau_mxm_create_            ## -- Begin function nouveau_mxm_create_
	.p2align	4, 0x90
_nouveau_mxm_create_:                   ## @nouveau_mxm_create_
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, %r12
                                        ## kill: def $ecx killed $ecx def $rcx
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movq	%rdx, %rbx
	movq	%rsi, %r14
	movq	%rdi, %r13
	callq	_nv_device
	movq	%rax, %r15
	movq	%rax, %rdi
	callq	_nouveau_bios
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	leaq	L_.str(%rip), %r8
	leaq	L_.str.1(%rip), %r9
	movq	%r13, %rdi
	movq	%r14, %rsi
	movq	%rbx, %rdx
	movq	%r12, %rbx
	xorl	%ecx, %ecx
	pushq	%r12
	pushq	-64(%rbp)                       ## 8-byte Folded Reload
	callq	_nouveau_subdev_create_
	addq	$16, %rsp
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_8
## %bb.1:
	movq	%r15, %r14
	movq	(%rbx), %r15
	leaq	-44(%rbp), %rsi
	leaq	-68(%rbp), %rdx
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_mxm_table
	testl	%eax, %eax
	je	LBB0_3
## %bb.2:
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_nv_ro08
	movl	%eax, -44(%rbp)
	testl	%eax, %eax
	je	LBB0_3
## %bb.4:
	movl	%eax, %edx
	sarl	$4, %edx
	andl	$15, %eax
	leaq	L_.str.3(%rip), %rsi
	movq	%r15, %rdi
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_nv_info
	movl	-44(%rbp), %esi
	movq	%r15, %rdi
	callq	_mxm_shadow
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	leaq	L_.str.4(%rip), %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_nv_info
	jmp	LBB0_8
LBB0_3:
	leaq	L_.str.2(%rip), %rsi
	movq	%r15, %rdi
	callq	_nv_debug
LBB0_8:
	movl	%r12d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	%r15, %rdi
	callq	_mxms_version
	movl	%eax, %ebx
	sarl	$8, %ebx
	movq	%r15, %rdi
	callq	_mxms_version
	movzbl	%al, %ecx
	leaq	L_.str.5(%rip), %rsi
	movq	%r15, %rdi
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_nv_info
	movq	%r15, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_mxms_foreach
	movl	(%r14), %edi
	leaq	L_.str.6(%rip), %rsi
	movl	$1, %edx
	callq	_nouveau_boolopt
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	movq	_MXM_SANITISE_DCB@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, (%r15)
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"MXM"

L_.str.1:                               ## @.str.1
	.asciz	"mxm"

L_.str.2:                               ## @.str.2
	.asciz	"no VBIOS data, nothing to do\n"

L_.str.3:                               ## @.str.3
	.asciz	"BIOS version %d.%d\n"

L_.str.4:                               ## @.str.4
	.asciz	"failed to locate valid SIS\n"

L_.str.5:                               ## @.str.5
	.asciz	"MXMS Version %d.%d\n"

L_.str.6:                               ## @.str.6
	.asciz	"NvMXMDCB"

	.comm	_MXM_SANITISE_DCB,4,2           ## @MXM_SANITISE_DCB
	.comm	_EINVAL,4,2                     ## @EINVAL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nouveau_mxm_create_            ; -- Begin function nouveau_mxm_create_
	.p2align	2
_nouveau_mxm_create_:                   ; @nouveau_mxm_create_
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	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
	mov	x21, x4
	mov	x19, x3
	mov	x23, x2
	mov	x24, x1
	mov	x25, x0
	bl	_nv_device
	mov	x20, x0
	bl	_nouveau_bios
	mov	x22, x0
Lloh0:
	adrp	x4, l_.str@PAGE
Lloh1:
	add	x4, x4, l_.str@PAGEOFF
Lloh2:
	adrp	x5, l_.str.1@PAGE
Lloh3:
	add	x5, x5, l_.str.1@PAGEOFF
	mov	x0, x25
	mov	x1, x24
	mov	x2, x23
	mov	w3, #0
	mov	x6, x19
	mov	x7, x21
	bl	_nouveau_subdev_create_
	mov	x19, x0
	cbnz	w0, LBB0_6
; %bb.1:
	ldr	x21, [x21]
	add	x1, sp, #28
	add	x2, sp, #24
	mov	x0, x22
	bl	_mxm_table
	cbz	w0, LBB0_5
; %bb.2:
	mov	x1, x0
	mov	x0, x22
	bl	_nv_ro08
	str	w0, [sp, #28]
	cbz	w0, LBB0_5
; %bb.3:
	asr	w8, w0, #4
	and	w9, w0, #0xf
	stp	x8, x9, [sp]
Lloh4:
	adrp	x1, l_.str.3@PAGE
Lloh5:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x21
	bl	_nv_info
	ldr	w1, [sp, #28]
	mov	x0, x21
	bl	_mxm_shadow
	cbz	x0, LBB0_7
; %bb.4:
Lloh6:
	adrp	x1, l_.str.4@PAGE
Lloh7:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x21
	bl	_nv_info
	b	LBB0_6
LBB0_5:
Lloh8:
	adrp	x1, l_.str.2@PAGE
Lloh9:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x21
	bl	_nv_debug
LBB0_6:
	mov	x0, x19
	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
	add	sp, sp, #112
	ret
LBB0_7:
	mov	x0, x21
	bl	_mxms_version
	asr	w22, w0, #8
	mov	x0, x21
	bl	_mxms_version
	and	w8, w0, #0xff
	stp	x22, x8, [sp]
Lloh10:
	adrp	x1, l_.str.5@PAGE
Lloh11:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x0, x21
	bl	_nv_info
	mov	x0, x21
	mov	w1, #0
	mov	x2, #0
	mov	x3, #0
	bl	_mxms_foreach
	ldr	w0, [x20]
Lloh12:
	adrp	x1, l_.str.6@PAGE
Lloh13:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	w2, #1
	bl	_nouveau_boolopt
	cbz	x0, LBB0_6
; %bb.8:
Lloh14:
	adrp	x8, _MXM_SANITISE_DCB@GOTPAGE
Lloh15:
	ldr	x8, [x8, _MXM_SANITISE_DCB@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	ldr	w9, [x21]
	orr	w8, w9, w8
	str	w8, [x21]
	b	LBB0_6
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"MXM"

l_.str.1:                               ; @.str.1
	.asciz	"mxm"

l_.str.2:                               ; @.str.2
	.asciz	"no VBIOS data, nothing to do\n"

l_.str.3:                               ; @.str.3
	.asciz	"BIOS version %d.%d\n"

l_.str.4:                               ; @.str.4
	.asciz	"failed to locate valid SIS\n"

l_.str.5:                               ; @.str.5
	.asciz	"MXMS Version %d.%d\n"

l_.str.6:                               ; @.str.6
	.asciz	"NvMXMDCB"

	.comm	_MXM_SANITISE_DCB,4,2           ; @MXM_SANITISE_DCB
	.comm	_EINVAL,4,2                     ; @EINVAL
.subsections_via_symbols
