	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mcp23s08_irq
_mcp23s08_irq:                          ## @mcp23s08_irq
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r13
	leaq	12(%rsi), %rbx
	movq	%rbx, %rdi
	callq	_mutex_lock
	movq	_MCP_INTF@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-56(%rbp), %rdx
	movq	%r13, %rdi
	callq	_mcp_read
	testq	%rax, %rax
	jne	LBB0_21
## %bb.1:
	movq	_MCP_INTCAP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-60(%rbp), %rdx
	movq	%r13, %rdi
	callq	_mcp_read
	testq	%rax, %rax
	jne	LBB0_21
## %bb.2:
	movq	_MCP_INTCON@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-72(%rbp), %rdx
	movq	%r13, %rdi
	callq	_mcp_read
	testq	%rax, %rax
	jne	LBB0_21
## %bb.3:
	movq	_MCP_DEFVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-68(%rbp), %rdx
	movq	%r13, %rdi
	callq	_mcp_read
	testq	%rax, %rax
	jne	LBB0_21
## %bb.4:
	movq	_MCP_GPIO@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-44(%rbp), %rdx
	movq	%r13, %rdi
	callq	_mcp_read
	testq	%rax, %rax
	je	LBB0_5
LBB0_21:
	movq	%rbx, %rdi
	callq	_mutex_unlock
LBB0_22:
	movq	_IRQ_HANDLED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movl	(%r13), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movl	-44(%rbp), %eax
	movl	%eax, (%r13)
	movq	%rbx, %rdi
	callq	_mutex_unlock
	movl	-56(%rbp), %ecx
	testl	%ecx, %ecx
	je	LBB0_22
## %bb.6:
	movl	24(%r13), %edi
	movl	-60(%rbp), %edx
	movl	-44(%rbp), %r9d
	leaq	L_.str(%rip), %rsi
	movl	-48(%rbp), %r8d                 ## 4-byte Reload
	callq	_dev_dbg
	cmpl	$0, 16(%r13)
	jle	LBB0_22
## %bb.7:
	xorl	%r15d, %r15d
	jmp	LBB0_8
LBB0_19:                                ##   in Loop: Header=BB0_8 Depth=1
	movl	20(%r13), %edi
	movl	%r15d, %esi
	callq	_irq_find_mapping
	movl	%eax, %edi
	callq	_handle_nested_irq
LBB0_20:                                ##   in Loop: Header=BB0_8 Depth=1
	incl	%r15d
	cmpl	16(%r13), %r15d
	jge	LBB0_22
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movl	-56(%rbp), %ebx
	movl	%r15d, %edi
	callq	_BIT
	andl	%ebx, %eax
	movl	$65280, %ecx                    ## imm = 0xFF00
	cmovel	%eax, %ecx
	cmpl	$8, %r15d
	movl	$0, %edx
	cmovbl	%edx, %ecx
	testl	%eax, %eax
	movl	%ecx, %ebx
	movl	$255, %eax
	cmovnel	%eax, %ebx
	cmpl	$8, %r15d
	cmovael	%ecx, %ebx
	movl	-60(%rbp), %r14d
	movl	%r15d, %edi
	callq	_BIT
	movl	%eax, %r12d
	andl	%r14d, %r12d
	movl	%r15d, %edi
	callq	_BIT
	movl	%eax, %r14d
	andl	-48(%rbp), %r14d                ## 4-byte Folded Reload
	xorl	%r12d, %r14d
	andl	%ebx, %r14d
	movl	%r15d, %edi
	callq	_BIT
	andl	-44(%rbp), %eax
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movl	%r15d, %edi
	callq	_BIT
	movl	%eax, %ebx
	andl	-48(%rbp), %ebx                 ## 4-byte Folded Reload
	movl	%r15d, %edi
	callq	_BIT
	movl	%eax, %r12d
	andl	-44(%rbp), %r12d
	movl	%r15d, %edi
	callq	_BIT
	testl	%eax, -72(%rbp)
	je	LBB0_11
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	movl	%r15d, %edi
	callq	_BIT
	movl	%ebx, -64(%rbp)                 ## 4-byte Spill
	movl	%eax, %ebx
	andl	-44(%rbp), %ebx
	movl	%r15d, %edi
	callq	_BIT
	andl	-68(%rbp), %eax
	cmpl	%eax, %ebx
	setne	%cl
	cmpl	%r12d, -64(%rbp)                ## 4-byte Folded Reload
	jne	LBB0_10
## %bb.17:                              ##   in Loop: Header=BB0_8 Depth=1
	movl	%ebx, %edx
	movl	%ecx, %ebx
	testl	%r14d, %r14d
	jne	LBB0_14
## %bb.18:                              ##   in Loop: Header=BB0_8 Depth=1
	cmpl	%eax, %edx
	jne	LBB0_19
	jmp	LBB0_20
LBB0_11:                                ##   in Loop: Header=BB0_8 Depth=1
	cmpl	%r12d, %ebx
	jne	LBB0_12
## %bb.13:                              ##   in Loop: Header=BB0_8 Depth=1
	xorl	%ebx, %ebx
	testl	%r14d, %r14d
	je	LBB0_20
	jmp	LBB0_14
LBB0_10:                                ##   in Loop: Header=BB0_8 Depth=1
	movl	%ecx, %ebx
	jmp	LBB0_14
LBB0_12:                                ##   in Loop: Header=BB0_8 Depth=1
	xorl	%ebx, %ebx
LBB0_14:                                ##   in Loop: Header=BB0_8 Depth=1
	movl	%r15d, %edi
	callq	_BIT
	testl	%eax, 4(%r13)
	je	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_8 Depth=1
	cmpl	$0, -52(%rbp)                   ## 4-byte Folded Reload
	jne	LBB0_19
LBB0_16:                                ##   in Loop: Header=BB0_8 Depth=1
	movl	%r15d, %edi
	callq	_BIT
	testl	%eax, 8(%r13)
	setne	%al
	cmpl	$0, -52(%rbp)                   ## 4-byte Folded Reload
	sete	%cl
	andb	%al, %cl
	orb	%bl, %cl
	jne	LBB0_19
	jmp	LBB0_20
	.cfi_endproc
                                        ## -- End function
	.comm	_MCP_INTF,4,2                   ## @MCP_INTF
	.comm	_MCP_INTCAP,4,2                 ## @MCP_INTCAP
	.comm	_MCP_INTCON,4,2                 ## @MCP_INTCON
	.comm	_MCP_DEFVAL,4,2                 ## @MCP_DEFVAL
	.comm	_MCP_GPIO,4,2                   ## @MCP_GPIO
	.comm	_IRQ_HANDLED,4,2                ## @IRQ_HANDLED
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"intcap 0x%04X intf 0x%04X gpio_orig 0x%04X gpio 0x%04X\n"

	.no_dead_strip	_mcp23s08_irq
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mcp23s08_irq
_mcp23s08_irq:                          ; @mcp23s08_irq
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x1
	add	x21, x1, #12
	mov	x0, x21
	bl	_mutex_lock
Lloh0:
	adrp	x8, _MCP_INTF@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MCP_INTF@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	add	x2, sp, #20
	mov	x0, x19
	bl	_mcp_read
	cbnz	x0, LBB0_5
; %bb.1:
Lloh3:
	adrp	x8, _MCP_INTCAP@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MCP_INTCAP@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	add	x2, sp, #28
	mov	x0, x19
	bl	_mcp_read
	cbnz	x0, LBB0_5
; %bb.2:
Lloh6:
	adrp	x8, _MCP_INTCON@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MCP_INTCON@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	add	x2, sp, #24
	mov	x0, x19
	bl	_mcp_read
	cbnz	x0, LBB0_5
; %bb.3:
Lloh9:
	adrp	x8, _MCP_DEFVAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MCP_DEFVAL@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	add	x2, sp, #12
	mov	x0, x19
	bl	_mcp_read
	cbnz	x0, LBB0_5
; %bb.4:
Lloh12:
	adrp	x8, _MCP_GPIO@GOTPAGE
Lloh13:
	ldr	x8, [x8, _MCP_GPIO@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	add	x2, sp, #16
	mov	x0, x19
	bl	_mcp_read
	cbz	x0, LBB0_7
LBB0_5:
	mov	x0, x21
	bl	_mutex_unlock
LBB0_6:
Lloh15:
	adrp	x8, _IRQ_HANDLED@GOTPAGE
Lloh16:
	ldr	x8, [x8, _IRQ_HANDLED@GOTPAGEOFF]
Lloh17:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_7:
	ldr	w20, [x19]
	ldr	w8, [sp, #16]
	str	w8, [x19]
	mov	x0, x21
	bl	_mutex_unlock
	ldr	w3, [sp, #20]
	cbz	w3, LBB0_6
; %bb.8:
	ldr	w0, [x19, #24]
	ldr	w2, [sp, #28]
	ldr	w5, [sp, #16]
Lloh18:
	adrp	x1, l_.str@PAGE
Lloh19:
	add	x1, x1, l_.str@PAGEOFF
	mov	x4, x20
	bl	_dev_dbg
	ldr	w8, [x19, #16]
	cmp	w8, #1
	b.lt	LBB0_6
; %bb.9:
	mov	w21, #0
	b	LBB0_12
LBB0_10:                                ;   in Loop: Header=BB0_12 Depth=1
	ldr	w0, [x19, #20]
	mov	x1, x21
	bl	_irq_find_mapping
	bl	_handle_nested_irq
LBB0_11:                                ;   in Loop: Header=BB0_12 Depth=1
	add	w21, w21, #1
	ldr	w8, [x19, #16]
	cmp	w21, w8
	b.ge	LBB0_6
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	ldr	w22, [sp, #20]
	mov	x0, x21
	bl	_BIT
	cmp	w21, #8
	cset	w8, lo
	tst	w0, w22
	cset	w9, ne
	cmp	w21, #7
	cset	w10, hi
	tst	w10, w9
	mov	w10, #65280
	csel	w10, w10, wzr, ne
	tst	w8, w9
	mov	w8, #255
	csel	w22, w8, w10, ne
	ldr	w23, [sp, #28]
	mov	x0, x21
	bl	_BIT
	and	w23, w0, w23
	mov	x0, x21
	bl	_BIT
	and	w8, w0, w20
	eor	w8, w8, w23
	and	w26, w8, w22
	mov	x0, x21
	bl	_BIT
	mov	x22, x0
	ldr	w25, [sp, #16]
	mov	x0, x21
	bl	_BIT
	and	w28, w0, w20
	mov	x0, x21
	bl	_BIT
	ldr	w8, [sp, #16]
	and	w23, w8, w0
	mov	x0, x21
	bl	_BIT
	ldr	w8, [sp, #24]
	tst	w8, w0
	b.eq	LBB0_16
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=1
	mov	x0, x21
	bl	_BIT
	ldr	w8, [sp, #16]
	and	w24, w8, w0
	mov	x0, x21
	bl	_BIT
	ldr	w8, [sp, #12]
	and	w8, w8, w0
	cmp	w24, w8
	cset	w27, ne
	cmp	w28, w23
	b.ne	LBB0_18
; %bb.14:                               ;   in Loop: Header=BB0_12 Depth=1
	cbnz	w26, LBB0_18
; %bb.15:                               ;   in Loop: Header=BB0_12 Depth=1
	cmp	w24, w8
	b.ne	LBB0_10
	b	LBB0_11
LBB0_16:                                ;   in Loop: Header=BB0_12 Depth=1
	mov	w27, #0
	cmp	w28, w23
	b.ne	LBB0_18
; %bb.17:                               ;   in Loop: Header=BB0_12 Depth=1
	cbz	w26, LBB0_11
LBB0_18:                                ;   in Loop: Header=BB0_12 Depth=1
	and	w22, w25, w22
	mov	x0, x21
	bl	_BIT
	ldr	w8, [x19, #4]
	tst	w8, w0
	b.eq	LBB0_20
; %bb.19:                               ;   in Loop: Header=BB0_12 Depth=1
	cbnz	w22, LBB0_10
LBB0_20:                                ;   in Loop: Header=BB0_12 Depth=1
	mov	x0, x21
	bl	_BIT
	ldr	w8, [x19, #8]
	tst	w8, w0
	ccmp	w22, #0, #0, ne
	cset	w8, eq
	orr	w8, w8, w27
	tbnz	w8, #0, LBB0_10
	b	LBB0_11
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_MCP_INTF,4,2                   ; @MCP_INTF
	.comm	_MCP_INTCAP,4,2                 ; @MCP_INTCAP
	.comm	_MCP_INTCON,4,2                 ; @MCP_INTCON
	.comm	_MCP_DEFVAL,4,2                 ; @MCP_DEFVAL
	.comm	_MCP_GPIO,4,2                   ; @MCP_GPIO
	.comm	_IRQ_HANDLED,4,2                ; @IRQ_HANDLED
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"intcap 0x%04X intf 0x%04X gpio_orig 0x%04X gpio 0x%04X\n"

	.no_dead_strip	_mcp23s08_irq
.subsections_via_symbols
