	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cx18_irq_handler               ## -- Begin function cx18_irq_handler
	.p2align	4, 0x90
_cx18_irq_handler:                      ## @cx18_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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r12
	movq	_SW1_INT_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_cx18_read_reg
	movl	%eax, %r13d
	movq	_SW2_INT_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r12), %r15d
	movq	%r12, %rdi
	callq	_cx18_read_reg
	movl	%eax, %r14d
	andl	4(%r12), %r14d
	movq	_HW2_INT_CLR_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_cx18_read_reg
	movl	%eax, %ebx
	andl	8(%r12), %ebx
	andl	%r13d, %r15d
	je	LBB0_2
## %bb.1:
	movq	_SW1_INT_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%r15d, %ecx
	notl	%ecx
	movq	%r12, %rdi
	movl	%r15d, %esi
	movl	%r15d, %r8d
	callq	_cx18_write_reg_expect
LBB0_2:
	testl	%r14d, %r14d
	je	LBB0_4
## %bb.3:
	movq	_SW2_INT_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%r14d, %ecx
	notl	%ecx
	movq	%r12, %rdi
	movl	%r14d, %esi
	movl	%r14d, %r8d
	callq	_cx18_write_reg_expect
LBB0_4:
	testl	%ebx, %ebx
	je	LBB0_7
## %bb.5:
	movq	_HW2_INT_CLR_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%ebx, %ecx
	notl	%ecx
	movq	%r12, %rdi
	movl	%ebx, %esi
	movl	%ebx, %r8d
	callq	_cx18_write_reg_expect
	jmp	LBB0_6
LBB0_7:
	movl	%r15d, %eax
	orl	%r14d, %eax
	je	LBB0_8
LBB0_6:
	leaq	L_.str(%rip), %rdi
	movl	%r15d, %esi
	movl	%r14d, %edx
	movl	%ebx, %ecx
	callq	_CX18_DEBUG_HI_IRQ
	movb	$1, %bl
	testl	%r15d, %r15d
	je	LBB0_11
LBB0_10:
	movq	%r12, %rdi
	movl	%r15d, %esi
	callq	_epu_cmd
LBB0_11:
	testl	%r14d, %r14d
	je	LBB0_13
## %bb.12:
	movq	%r12, %rdi
	movl	%r14d, %esi
	callq	_xpu_ack
LBB0_13:
	testb	%bl, %bl
	je	LBB0_14
## %bb.15:
	movq	_IRQ_HANDLED@GOTPCREL(%rip), %rax
	jmp	LBB0_16
LBB0_14:
	movq	_IRQ_NONE@GOTPCREL(%rip), %rax
LBB0_16:
	movl	(%rax), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	xorl	%ebx, %ebx
	testl	%r15d, %r15d
	jne	LBB0_10
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_SW1_INT_STATUS,4,2             ## @SW1_INT_STATUS
	.comm	_SW2_INT_STATUS,4,2             ## @SW2_INT_STATUS
	.comm	_HW2_INT_CLR_STATUS,4,2         ## @HW2_INT_CLR_STATUS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"received interrupts SW1: %x\tSW2: %x  HW2: %x\n"

	.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	_cx18_irq_handler               ; -- Begin function cx18_irq_handler
	.p2align	2
_cx18_irq_handler:                      ; @cx18_irq_handler
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x1
Lloh0:
	adrp	x25, _SW1_INT_STATUS@GOTPAGE
Lloh1:
	ldr	x25, [x25, _SW1_INT_STATUS@GOTPAGEOFF]
	ldr	w1, [x25]
	mov	x0, x19
	bl	_cx18_read_reg
	ldr	w8, [x19]
	and	w20, w8, w0
Lloh2:
	adrp	x24, _SW2_INT_STATUS@GOTPAGE
Lloh3:
	ldr	x24, [x24, _SW2_INT_STATUS@GOTPAGEOFF]
	ldr	w1, [x24]
	mov	x0, x19
	bl	_cx18_read_reg
	ldr	w8, [x19, #4]
	and	w21, w8, w0
Lloh4:
	adrp	x23, _HW2_INT_CLR_STATUS@GOTPAGE
Lloh5:
	ldr	x23, [x23, _HW2_INT_CLR_STATUS@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	x0, x19
	bl	_cx18_read_reg
	ldr	w8, [x19, #8]
	and	w22, w8, w0
	cbz	w20, LBB0_2
; %bb.1:
	ldr	w2, [x25]
	mvn	w3, w20
	mov	x0, x19
	mov	x1, x20
	mov	x4, x20
	bl	_cx18_write_reg_expect
LBB0_2:
	cbz	w21, LBB0_4
; %bb.3:
	ldr	w2, [x24]
	mvn	w3, w21
	mov	x0, x19
	mov	x1, x21
	mov	x4, x21
	bl	_cx18_write_reg_expect
LBB0_4:
	cbz	w22, LBB0_6
; %bb.5:
	ldr	w2, [x23]
	mvn	w3, w22
	mov	x0, x19
	mov	x1, x22
	mov	x4, x22
	bl	_cx18_write_reg_expect
	b	LBB0_7
LBB0_6:
	orr	w8, w20, w21
	cbz	w8, LBB0_12
LBB0_7:
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x20
	mov	x2, x21
	mov	x3, x22
	bl	_CX18_DEBUG_HI_IRQ
	mov	w22, #1
	cbz	w20, LBB0_9
LBB0_8:
	mov	x0, x19
	mov	x1, x20
	bl	_epu_cmd
LBB0_9:
	cbz	w21, LBB0_11
; %bb.10:
	mov	x0, x19
	mov	x1, x21
	bl	_xpu_ack
LBB0_11:
Lloh8:
	adrp	x8, _IRQ_HANDLED@GOTPAGE
Lloh9:
	ldr	x8, [x8, _IRQ_HANDLED@GOTPAGEOFF]
Lloh10:
	adrp	x9, _IRQ_NONE@GOTPAGE
Lloh11:
	ldr	x9, [x9, _IRQ_NONE@GOTPAGEOFF]
	cmp	w22, #0
	csel	x8, x8, x9, ne
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_12:
	mov	w22, #0
	cbnz	w20, LBB0_8
	b	LBB0_9
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_SW1_INT_STATUS,4,2             ; @SW1_INT_STATUS
	.comm	_SW2_INT_STATUS,4,2             ; @SW2_INT_STATUS
	.comm	_HW2_INT_CLR_STATUS,4,2         ; @HW2_INT_CLR_STATUS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"received interrupts SW1: %x\tSW2: %x  HW2: %x\n"

	.comm	_IRQ_HANDLED,4,2                ; @IRQ_HANDLED
	.comm	_IRQ_NONE,4,2                   ; @IRQ_NONE
.subsections_via_symbols
