	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mga_driver_load                ## -- Begin function mga_driver_load
	.p2align	4, 0x90
_mga_driver_load:                       ## @mga_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r14
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$24, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %rbx
	movq	%rax, 24(%r14)
	movq	_MGA_DEFAULT_USEC_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%rbx)
	movq	%r15, (%rbx)
	movl	16(%r14), %edi
	callq	_pci_set_master
	movl	16(%r14), %edi
	movl	$1, %esi
	callq	_pci_resource_start
	movl	%eax, 12(%rbx)
	movl	16(%r14), %edi
	movl	$1, %esi
	callq	_pci_resource_len
	movl	%eax, 8(%rbx)
	addl	$3, (%r14)
	movq	__DRM_STAT_IRQ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	8(%r14), %rcx
	movl	%eax, 24(%rcx)
	movq	__DRM_STAT_PRIMARY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 28(%rcx)
	movq	__DRM_STAT_SECONDARY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 32(%rcx)
	movq	%r14, %rdi
	movl	$1, %esi
	callq	_drm_vblank_init
	testl	%eax, %eax
	je	LBB0_3
## %bb.4:
	movl	%eax, %ebx
	movq	%r14, %rdi
	callq	_mga_driver_unload
	jmp	LBB0_5
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_5
LBB0_3:
	xorl	%ebx, %ebx
LBB0_5:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_MGA_DEFAULT_USEC_TIMEOUT,4,2   ## @MGA_DEFAULT_USEC_TIMEOUT
	.comm	__DRM_STAT_IRQ,4,2              ## @_DRM_STAT_IRQ
	.comm	__DRM_STAT_PRIMARY,4,2          ## @_DRM_STAT_PRIMARY
	.comm	__DRM_STAT_SECONDARY,4,2        ## @_DRM_STAT_SECONDARY
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mga_driver_load                ; -- Begin function mga_driver_load
	.p2align	2
_mga_driver_load:                       ; @mga_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
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #24
	bl	_kzalloc
	cbz	x0, LBB0_3
; %bb.1:
	mov	x20, x0
	str	x0, [x19, #24]
Lloh3:
	adrp	x8, _MGA_DEFAULT_USEC_TIMEOUT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MGA_DEFAULT_USEC_TIMEOUT@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	str	w8, [x0, #16]
	str	x21, [x0]
	ldr	w0, [x19, #16]
	bl	_pci_set_master
	ldr	w0, [x19, #16]
	mov	w1, #1
	bl	_pci_resource_start
	str	w0, [x20, #12]
	ldr	w0, [x19, #16]
	mov	w1, #1
	bl	_pci_resource_len
	str	w0, [x20, #8]
	ldr	w8, [x19]
	add	w8, w8, #3
Lloh6:
	adrp	x9, __DRM_STAT_IRQ@GOTPAGE
Lloh7:
	ldr	x9, [x9, __DRM_STAT_IRQ@GOTPAGEOFF]
	str	w8, [x19]
Lloh8:
	ldr	w8, [x9]
	ldr	x9, [x19, #8]
Lloh9:
	adrp	x10, __DRM_STAT_PRIMARY@GOTPAGE
Lloh10:
	ldr	x10, [x10, __DRM_STAT_PRIMARY@GOTPAGEOFF]
Lloh11:
	ldr	w10, [x10]
	stp	w8, w10, [x9, #24]
Lloh12:
	adrp	x8, __DRM_STAT_SECONDARY@GOTPAGE
Lloh13:
	ldr	x8, [x8, __DRM_STAT_SECONDARY@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	str	w8, [x9, #32]
	mov	x0, x19
	mov	w1, #1
	bl	_drm_vblank_init
	mov	x20, x0
	cbz	w0, LBB0_4
; %bb.2:
	mov	x0, x19
	bl	_mga_driver_unload
	b	LBB0_4
LBB0_3:
Lloh15:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_4:
	mov	x0, 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
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_MGA_DEFAULT_USEC_TIMEOUT,4,2   ; @MGA_DEFAULT_USEC_TIMEOUT
	.comm	__DRM_STAT_IRQ,4,2              ; @_DRM_STAT_IRQ
	.comm	__DRM_STAT_PRIMARY,4,2          ; @_DRM_STAT_PRIMARY
	.comm	__DRM_STAT_SECONDARY,4,2        ; @_DRM_STAT_SECONDARY
.subsections_via_symbols
