	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mga_driver_irq_handler         ## -- Begin function mga_driver_irq_handler
	.p2align	4, 0x90
_mga_driver_irq_handler:                ## @mga_driver_irq_handler
	.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, %r15
	movq	(%rsi), %r14
	movq	_MGA_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_MGA_READ
	movq	%rax, %rbx
	movq	_MGA_VLINEPEN@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	testl	%ebx, %r12d
	je	LBB0_2
## %bb.1:
	movq	_MGA_ICLEAR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_MGA_VLINEICLR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_MGA_WRITE
	leaq	8(%r14), %rdi
	callq	_atomic_inc
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_drm_handle_vblank
LBB0_2:
	movq	_MGA_SOFTRAPEN@GOTPCREL(%rip), %rax
	testl	%ebx, (%rax)
	je	LBB0_6
## %bb.3:
	movq	_MGA_PRIMADDRESS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_MGA_READ
	movq	%rax, %rbx
	movq	_MGA_PRIMEND@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	callq	_MGA_READ
	movq	%rax, %r15
	movq	_MGA_ICLEAR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_MGA_SOFTRAPICLR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_MGA_WRITE
	xorl	%r15d, %ebx
	testl	$-4, %ebx
	je	LBB0_5
## %bb.4:
	movl	(%r12), %edi
	movl	%r15d, %esi
	callq	_MGA_WRITE
LBB0_5:
	leaq	4(%r14), %rdi
	callq	_atomic_inc
	movq	%r14, %rdi
	callq	_wake_up
	jmp	LBB0_8
LBB0_6:
	testl	%ebx, %r12d
	jne	LBB0_8
## %bb.7:
	movq	_IRQ_NONE@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_8:
	movq	_IRQ_HANDLED@GOTPCREL(%rip), %rax
LBB0_9:
	movl	(%rax), %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MGA_STATUS,4,2                 ## @MGA_STATUS
	.comm	_MGA_VLINEPEN,4,2               ## @MGA_VLINEPEN
	.comm	_MGA_ICLEAR,4,2                 ## @MGA_ICLEAR
	.comm	_MGA_VLINEICLR,4,2              ## @MGA_VLINEICLR
	.comm	_MGA_SOFTRAPEN,4,2              ## @MGA_SOFTRAPEN
	.comm	_MGA_PRIMADDRESS,4,2            ## @MGA_PRIMADDRESS
	.comm	_MGA_PRIMEND,4,2                ## @MGA_PRIMEND
	.comm	_MGA_SOFTRAPICLR,4,2            ## @MGA_SOFTRAPICLR
	.comm	_IRQ_HANDLED,4,2                ## @IRQ_HANDLED
	.comm	_IRQ_NONE,4,2                   ## @IRQ_NONE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mga_driver_irq_handler         ; -- Begin function mga_driver_irq_handler
	.p2align	2
_mga_driver_irq_handler:                ; @mga_driver_irq_handler
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x20, x1
	ldr	x19, [x1]
Lloh0:
	adrp	x8, _MGA_STATUS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MGA_STATUS@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_MGA_READ
	mov	x21, x0
Lloh3:
	adrp	x8, _MGA_VLINEPEN@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MGA_VLINEPEN@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x22, _MGA_ICLEAR@GOTPAGE
Lloh7:
	ldr	x22, [x22, _MGA_ICLEAR@GOTPAGEOFF]
	ands	w23, w8, w21
	b.eq	LBB0_2
; %bb.1:
	ldr	w0, [x22]
Lloh8:
	adrp	x8, _MGA_VLINEICLR@GOTPAGE
Lloh9:
	ldr	x8, [x8, _MGA_VLINEICLR@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	bl	_MGA_WRITE
	add	x0, x19, #8
	bl	_atomic_inc
	mov	x0, x20
	mov	w1, #0
	bl	_drm_handle_vblank
LBB0_2:
Lloh11:
	adrp	x8, _MGA_SOFTRAPEN@GOTPAGE
Lloh12:
	ldr	x8, [x8, _MGA_SOFTRAPEN@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	tst	w8, w21
	b.eq	LBB0_6
; %bb.3:
Lloh14:
	adrp	x8, _MGA_PRIMADDRESS@GOTPAGE
Lloh15:
	ldr	x8, [x8, _MGA_PRIMADDRESS@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
	bl	_MGA_READ
	mov	x21, x0
Lloh17:
	adrp	x23, _MGA_PRIMEND@GOTPAGE
Lloh18:
	ldr	x23, [x23, _MGA_PRIMEND@GOTPAGEOFF]
	ldr	w0, [x23]
	bl	_MGA_READ
	mov	x20, x0
	ldr	w0, [x22]
Lloh19:
	adrp	x8, _MGA_SOFTRAPICLR@GOTPAGE
Lloh20:
	ldr	x8, [x8, _MGA_SOFTRAPICLR@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
	bl	_MGA_WRITE
	eor	w8, w20, w21
	tst	x8, #0xfffffffc
	b.eq	LBB0_5
; %bb.4:
	ldr	w0, [x23]
	mov	x1, x20
	bl	_MGA_WRITE
LBB0_5:
	add	x0, x19, #4
	bl	_atomic_inc
	mov	x0, x19
	bl	_wake_up
Lloh22:
	adrp	x8, _IRQ_HANDLED@GOTPAGE
Lloh23:
	ldr	x8, [x8, _IRQ_HANDLED@GOTPAGEOFF]
	b	LBB0_7
LBB0_6:
Lloh24:
	adrp	x8, _IRQ_HANDLED@GOTPAGE
Lloh25:
	ldr	x8, [x8, _IRQ_HANDLED@GOTPAGEOFF]
Lloh26:
	adrp	x9, _IRQ_NONE@GOTPAGE
Lloh27:
	ldr	x9, [x9, _IRQ_NONE@GOTPAGEOFF]
	cmp	w23, #0
	csel	x8, x9, x8, eq
LBB0_7:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_MGA_STATUS,4,2                 ; @MGA_STATUS
	.comm	_MGA_VLINEPEN,4,2               ; @MGA_VLINEPEN
	.comm	_MGA_ICLEAR,4,2                 ; @MGA_ICLEAR
	.comm	_MGA_VLINEICLR,4,2              ; @MGA_VLINEICLR
	.comm	_MGA_SOFTRAPEN,4,2              ; @MGA_SOFTRAPEN
	.comm	_MGA_PRIMADDRESS,4,2            ; @MGA_PRIMADDRESS
	.comm	_MGA_PRIMEND,4,2                ; @MGA_PRIMEND
	.comm	_MGA_SOFTRAPICLR,4,2            ; @MGA_SOFTRAPICLR
	.comm	_IRQ_HANDLED,4,2                ; @IRQ_HANDLED
	.comm	_IRQ_NONE,4,2                   ; @IRQ_NONE
.subsections_via_symbols
