	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mgag200_driver_load            ## -- Begin function mgag200_driver_load
	.p2align	4, 0x90
_mgag200_driver_load:                   ## @mgag200_driver_load
	.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
	movq	%rsi, %rbx
	movq	%rdi, %r12
	movl	40(%rdi), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$40, %esi
	callq	_devm_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r14
	movq	%rax, (%r12)
	movq	%r12, (%rax)
	movq	%r12, %rdi
	movq	%rbx, %rsi
	callq	_mgag200_device_init
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	%eax, %ebx
	movq	8(%r12), %rdi
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edx
	callq	_dev_err
	jmp	LBB0_16
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_16
LBB0_4:
	movq	%r14, %rdi
	callq	_mgag200_mm_init
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_15
## %bb.5:
	movq	%r12, %rdi
	callq	_drm_mode_config_init
	movq	_mga_mode_funcs@GOTPCREL(%rip), %rax
	movq	%rax, 32(%r12)
	movq	%r14, %rdi
	callq	_IS_G200_SE
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movl	$16, %eax
	cmpl	$2097152, 32(%r14)              ## imm = 0x200000
	jl	LBB0_8
LBB0_7:
	movl	$32, %eax
LBB0_8:
	movl	%eax, 24(%r12)
	movl	$1, 28(%r12)
	movq	%r14, %rdi
	callq	_mgag200_modeset_init
	testl	%eax, %eax
	je	LBB0_10
## %bb.9:
	movl	%eax, %r15d
	movq	8(%r12), %rdi
	leaq	L_.str.1(%rip), %rsi
	movl	%eax, %edx
	callq	_dev_err
	jmp	LBB0_14
LBB0_10:
	movq	16(%r12), %rbx
	movq	_PAGE_SIZE@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movl	$3072, %edi                     ## imm = 0xC00
	callq	_roundup
	movq	%r12, %rdi
	movq	%rbx, %rsi
	movl	%eax, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_drm_gem_vram_create
	movq	%rax, 24(%r14)
	movq	16(%r12), %rbx
	movl	(%r15), %esi
	movl	$3072, %edi                     ## imm = 0xC00
	callq	_roundup
	movq	%r12, %rdi
	movq	%rbx, %rsi
	movl	%eax, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_drm_gem_vram_create
	movq	%rax, 16(%r14)
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	jne	LBB0_12
## %bb.11:
	movq	24(%r14), %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_13
LBB0_12:
	movq	%r14, %rax
	addq	$16, %rax
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%rax)
	movq	8(%r12), %rdi
	leaq	L_.str.2(%rip), %rsi
	callq	_dev_warn
LBB0_13:
	movq	$0, 8(%r14)
	movq	(%r14), %rdi
	xorl	%ebx, %ebx
	xorl	%esi, %esi
	callq	_drm_fbdev_generic_setup
	movl	%eax, %r15d
	testl	%eax, %eax
	je	LBB0_16
LBB0_14:
	movq	%r12, %rdi
	callq	_drm_mode_config_cleanup
	movq	%r14, %rdi
	callq	_mgag200_mm_fini
LBB0_15:
	movq	$0, (%r12)
	movl	%r15d, %ebx
LBB0_16:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Fatal error during GPU init: %d\n"

	.comm	_mga_mode_funcs,4,2             ## @mga_mode_funcs
L_.str.1:                               ## @.str.1
	.asciz	"Fatal error during modeset init: %d\n"

	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
L_.str.2:                               ## @.str.2
	.asciz	"Could not allocate space for cursors. Not doing hardware cursors.\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mgag200_driver_load            ; -- Begin function mgag200_driver_load
	.p2align	2
_mgag200_driver_load:                   ; @mgag200_driver_load
	.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	x21, x1
	mov	x19, x0
	ldr	w0, [x0, #40]
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	w1, #40
	bl	_devm_kzalloc
	cbz	x0, LBB0_3
; %bb.1:
	mov	x20, x0
	str	x0, [x19]
	str	x19, [x0]
	mov	x0, x19
	mov	x1, x21
	bl	_mgag200_device_init
	cbz	w0, LBB0_4
; %bb.2:
	mov	x21, x0
	ldr	x0, [x19, #8]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x21
	bl	_dev_err
	b	LBB0_17
LBB0_3:
Lloh5:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_17
LBB0_4:
	mov	x0, x20
	bl	_mgag200_mm_init
	mov	x21, x0
	cbnz	w0, LBB0_16
; %bb.5:
	mov	x0, x19
	bl	_drm_mode_config_init
Lloh8:
	adrp	x8, _mga_mode_funcs@GOTPAGE
Lloh9:
	ldr	x8, [x8, _mga_mode_funcs@GOTPAGEOFF]
	str	x8, [x19, #32]
	mov	x0, x20
	bl	_IS_G200_SE
	cbz	x0, LBB0_8
; %bb.6:
	ldr	w8, [x20, #32]
	cmp	w8, #512, lsl #12               ; =2097152
	b.ge	LBB0_8
; %bb.7:
	mov	w8, #16
	b	LBB0_9
LBB0_8:
	mov	w8, #32
LBB0_9:
	mov	w9, #1
	stp	w8, w9, [x19, #24]
	mov	x0, x20
	bl	_mgag200_modeset_init
	cbz	w0, LBB0_11
; %bb.10:
	mov	x21, x0
	ldr	x0, [x19, #8]
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x21
	bl	_dev_err
	b	LBB0_15
LBB0_11:
	ldr	x21, [x19, #16]
Lloh12:
	adrp	x22, _PAGE_SIZE@GOTPAGE
Lloh13:
	ldr	x22, [x22, _PAGE_SIZE@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	w0, #3072
	bl	_roundup
	mov	x2, x0
	mov	x0, x19
	mov	x1, x21
	mov	w3, #0
	mov	w4, #0
	bl	_drm_gem_vram_create
	str	x0, [x20, #24]
	ldr	x21, [x19, #16]
	ldr	w1, [x22]
	mov	w0, #3072
	bl	_roundup
	mov	x2, x0
	mov	x0, x19
	mov	x1, x21
	mov	w3, #0
	mov	w4, #0
	bl	_drm_gem_vram_create
	mov	x21, x20
	str	x0, [x21, #16]!
	bl	_IS_ERR
	cbnz	x0, LBB0_13
; %bb.12:
	ldr	x0, [x20, #24]
	bl	_IS_ERR
	cbz	x0, LBB0_14
LBB0_13:
	stp	xzr, xzr, [x21]
	ldr	x0, [x19, #8]
Lloh14:
	adrp	x1, l_.str.2@PAGE
Lloh15:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_warn
LBB0_14:
	str	xzr, [x20, #8]
	ldr	x0, [x20]
	mov	w1, #0
	bl	_drm_fbdev_generic_setup
	mov	x21, x0
	cbz	w0, LBB0_17
LBB0_15:
	mov	x0, x19
	bl	_drm_mode_config_cleanup
	mov	x0, x20
	bl	_mgag200_mm_fini
LBB0_16:
	str	xzr, [x19]
LBB0_17:
	mov	x0, x21
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Fatal error during GPU init: %d\n"

	.comm	_mga_mode_funcs,4,2             ; @mga_mode_funcs
l_.str.1:                               ; @.str.1
	.asciz	"Fatal error during modeset init: %d\n"

	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
l_.str.2:                               ; @.str.2
	.asciz	"Could not allocate space for cursors. Not doing hardware cursors.\n"

.subsections_via_symbols
