	.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, %r14
	movq	%rdi, %r15
	movq	(%rdi), %rax
	cmpl	$1317, (%rax)                   ## imm = 0x525
	jne	LBB0_6
## %bb.1:
	movq	8(%rax), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_6
## %bb.2:
	cmpl	$13192, (%rax)                  ## imm = 0x3388
	jne	LBB0_6
## %bb.3:
	cmpl	$33, 4(%rax)
	jne	LBB0_6
## %bb.4:
	movq	16(%r15), %rax
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	movl	(%rax), %edi
	callq	_arch_phys_wc_del
	movq	16(%r15), %rdi
	callq	_kfree
	movq	$0, 16(%r15)
LBB0_6:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$24, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_7
## %bb.8:
	movq	%rax, %rbx
	movq	%rax, 8(%r15)
	movq	_MGA_DEFAULT_USEC_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%rbx)
	movq	%r14, (%rbx)
	movq	(%r15), %rdi
	callq	_pci_set_master
	movq	(%r15), %rdi
	movl	$1, %esi
	callq	_pci_resource_start
	movl	%eax, 12(%rbx)
	movq	(%r15), %rdi
	movl	$1, %esi
	callq	_pci_resource_len
	movl	%eax, 8(%rbx)
	movq	%r15, %rdi
	movl	$1, %esi
	callq	_drm_vblank_init
	testl	%eax, %eax
	je	LBB0_9
## %bb.10:
	movl	%eax, %ebx
	movq	%r15, %rdi
	callq	_mga_driver_unload
	jmp	LBB0_11
LBB0_7:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_11
LBB0_9:
	xorl	%ebx, %ebx
LBB0_11:
	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
.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	x20, x1
	mov	x19, x0
	ldr	x8, [x0]
	ldr	w9, [x8]
	cmp	w9, #1317
	b.ne	LBB0_6
; %bb.1:
	ldr	x8, [x8, #8]
	ldr	x8, [x8]
	cbz	x8, LBB0_6
; %bb.2:
	ldr	w9, [x8]
	mov	w10, #13192
	cmp	w9, w10
	b.ne	LBB0_6
; %bb.3:
	ldr	w8, [x8, #4]
	cmp	w8, #33
	b.ne	LBB0_6
; %bb.4:
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_6
; %bb.5:
	ldr	w0, [x8]
	bl	_arch_phys_wc_del
	ldr	x0, [x19, #16]
	bl	_kfree
	str	xzr, [x19, #16]
LBB0_6:
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_9
; %bb.7:
	mov	x21, x0
	str	x0, [x19, #8]
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	x20, [x0]
	ldr	x0, [x19]
	bl	_pci_set_master
	ldr	x0, [x19]
	mov	w1, #1
	bl	_pci_resource_start
	str	w0, [x21, #12]
	ldr	x0, [x19]
	mov	w1, #1
	bl	_pci_resource_len
	str	w0, [x21, #8]
	mov	x0, x19
	mov	w1, #1
	bl	_drm_vblank_init
	mov	x20, x0
	cbz	w0, LBB0_10
; %bb.8:
	mov	x0, x19
	bl	_mga_driver_unload
	b	LBB0_10
LBB0_9:
Lloh6:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_10:
	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	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.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
.subsections_via_symbols
