	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function zx_vga_irq_handler
_zx_vga_irq_handler:                    ## @zx_vga_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	_VGA_I2C_STATUS@GOTPCREL(%rip), %r15
	movq	(%r15), %rdi
	addq	8(%rsi), %rdi
	callq	_zx_readl
	movl	%eax, %r14d
	movq	(%r15), %rdi
	addq	8(%rbx), %rdi
	movq	_VGA_CLEAR_IRQ@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%edx, %esi
	callq	_zx_writel_mask
	movq	_VGA_DEVICE_CONNECTED@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	je	LBB0_2
## %bb.1:
	movl	$1, (%rbx)
	movq	_IRQ_WAKE_THREAD@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_2:
	movq	_VGA_DEVICE_DISCONNECTED@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	je	LBB0_4
## %bb.3:
	movq	_VGA_AUTO_DETECT_SEL@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	8(%rbx), %rdi
	movq	_VGA_DETECT_SEL_NO_DEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_zx_writel
	movl	$0, (%rbx)
	movq	_IRQ_WAKE_THREAD@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_4:
	movq	_VGA_TRANS_DONE@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	je	LBB0_5
## %bb.6:
	addq	$4, %rbx
	movq	%rbx, %rdi
	callq	_complete
	movq	_IRQ_HANDLED@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_5:
	movq	_IRQ_NONE@GOTPCREL(%rip), %rax
LBB0_7:
	movl	(%rax), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_VGA_I2C_STATUS,8,3             ## @VGA_I2C_STATUS
	.comm	_VGA_CLEAR_IRQ,4,2              ## @VGA_CLEAR_IRQ
	.comm	_VGA_DEVICE_CONNECTED,4,2       ## @VGA_DEVICE_CONNECTED
	.comm	_IRQ_WAKE_THREAD,4,2            ## @IRQ_WAKE_THREAD
	.comm	_VGA_DEVICE_DISCONNECTED,4,2    ## @VGA_DEVICE_DISCONNECTED
	.comm	_VGA_AUTO_DETECT_SEL,8,3        ## @VGA_AUTO_DETECT_SEL
	.comm	_VGA_DETECT_SEL_NO_DEVICE,4,2   ## @VGA_DETECT_SEL_NO_DEVICE
	.comm	_VGA_TRANS_DONE,4,2             ## @VGA_TRANS_DONE
	.comm	_IRQ_HANDLED,4,2                ## @IRQ_HANDLED
	.comm	_IRQ_NONE,4,2                   ## @IRQ_NONE
	.no_dead_strip	_zx_vga_irq_handler
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function zx_vga_irq_handler
_zx_vga_irq_handler:                    ; @zx_vga_irq_handler
	.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	x19, x1
	ldr	x8, [x1, #8]
Lloh0:
	adrp	x21, _VGA_I2C_STATUS@GOTPAGE
Lloh1:
	ldr	x21, [x21, _VGA_I2C_STATUS@GOTPAGEOFF]
	ldr	x9, [x21]
	add	x0, x9, x8
	bl	_zx_readl
	mov	x20, x0
	ldr	x8, [x19, #8]
	ldr	x9, [x21]
	add	x0, x9, x8
Lloh2:
	adrp	x8, _VGA_CLEAR_IRQ@GOTPAGE
Lloh3:
	ldr	x8, [x8, _VGA_CLEAR_IRQ@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	x2, x1
	bl	_zx_writel_mask
Lloh5:
	adrp	x8, _VGA_DEVICE_CONNECTED@GOTPAGE
Lloh6:
	ldr	x8, [x8, _VGA_DEVICE_CONNECTED@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	tst	w8, w20
	b.eq	LBB0_2
; %bb.1:
	mov	w8, #1
	str	w8, [x19]
	b	LBB0_4
LBB0_2:
Lloh8:
	adrp	x8, _VGA_DEVICE_DISCONNECTED@GOTPAGE
Lloh9:
	ldr	x8, [x8, _VGA_DEVICE_DISCONNECTED@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	tst	w8, w20
	b.eq	LBB0_6
; %bb.3:
Lloh11:
	adrp	x8, _VGA_AUTO_DETECT_SEL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _VGA_AUTO_DETECT_SEL@GOTPAGEOFF]
	ldr	x9, [x19, #8]
Lloh13:
	ldr	x8, [x8]
	add	x0, x8, x9
Lloh14:
	adrp	x8, _VGA_DETECT_SEL_NO_DEVICE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _VGA_DETECT_SEL_NO_DEVICE@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	bl	_zx_writel
	str	wzr, [x19]
LBB0_4:
Lloh17:
	adrp	x8, _IRQ_WAKE_THREAD@GOTPAGE
Lloh18:
	ldr	x8, [x8, _IRQ_WAKE_THREAD@GOTPAGEOFF]
LBB0_5:
	ldr	w0, [x8]
	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
LBB0_6:
Lloh19:
	adrp	x8, _VGA_TRANS_DONE@GOTPAGE
Lloh20:
	ldr	x8, [x8, _VGA_TRANS_DONE@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	tst	w8, w20
	b.eq	LBB0_8
; %bb.7:
	add	x0, x19, #4
	bl	_complete
Lloh22:
	adrp	x8, _IRQ_HANDLED@GOTPAGE
Lloh23:
	ldr	x8, [x8, _IRQ_HANDLED@GOTPAGEOFF]
	b	LBB0_5
LBB0_8:
Lloh24:
	adrp	x8, _IRQ_NONE@GOTPAGE
Lloh25:
	ldr	x8, [x8, _IRQ_NONE@GOTPAGEOFF]
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_VGA_I2C_STATUS,8,3             ; @VGA_I2C_STATUS
	.comm	_VGA_CLEAR_IRQ,4,2              ; @VGA_CLEAR_IRQ
	.comm	_VGA_DEVICE_CONNECTED,4,2       ; @VGA_DEVICE_CONNECTED
	.comm	_IRQ_WAKE_THREAD,4,2            ; @IRQ_WAKE_THREAD
	.comm	_VGA_DEVICE_DISCONNECTED,4,2    ; @VGA_DEVICE_DISCONNECTED
	.comm	_VGA_AUTO_DETECT_SEL,8,3        ; @VGA_AUTO_DETECT_SEL
	.comm	_VGA_DETECT_SEL_NO_DEVICE,4,2   ; @VGA_DETECT_SEL_NO_DEVICE
	.comm	_VGA_TRANS_DONE,4,2             ; @VGA_TRANS_DONE
	.comm	_IRQ_HANDLED,4,2                ; @IRQ_HANDLED
	.comm	_IRQ_NONE,4,2                   ; @IRQ_NONE
	.no_dead_strip	_zx_vga_irq_handler
.subsections_via_symbols
