	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mv_gpio_setup_intrhandler      ## -- Begin function mv_gpio_setup_intrhandler
	.p2align	4, 0x90
_mv_gpio_setup_intrhandler:             ## @mv_gpio_setup_intrhandler
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, %r14d
	movq	%r8, %rbx
	movq	%rcx, -88(%rbp)                 ## 8-byte Spill
	movq	%rdx, -80(%rbp)                 ## 8-byte Spill
	movq	%rsi, -72(%rbp)                 ## 8-byte Spill
	movl	%edi, %r12d
	callq	_device_get_softc
	movq	%rax, %r13
	movq	_M_DEVBUF@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_M_NOWAIT@GOTPCREL(%rip), %rax
	movq	_M_ZERO@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movl	$4, %edi
	callq	_malloc
	testl	%r14d, %r14d
	js	LBB0_2
## %bb.1:
	cmpl	%r14d, (%r13)
	jle	LBB0_2
## %bb.3:
	movq	%rax, %r15
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movq	8(%r13), %rax
	movl	%r14d, %ecx
	movq	(%rax,%rcx,8), %rbx
	movq	%rbx, -48(%rbp)
	testq	%rbx, %rbx
	je	LBB0_4
LBB0_11:
	movq	24(%rbp), %r15
	movl	16(%rbp), %r14d
	movl	%r14d, %edi
	callq	_intr_priority
	movq	%rbx, %rdi
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	movq	-80(%rbp), %rdx                 ## 8-byte Reload
	movq	-88(%rbp), %rcx                 ## 8-byte Reload
	movq	-64(%rbp), %r8                  ## 8-byte Reload
	movl	%eax, %r9d
	pushq	%r15
	pushq	%r14
	callq	_intr_event_add_handler
	addq	$16, %rsp
	xorl	%ebx, %ebx
	jmp	LBB0_12
LBB0_2:
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_12:
	movl	%ebx, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	xorl	%eax, %eax
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	callq	_MV_GPIO_LOCK
	movq	16(%r13), %rax
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movl	(%rax,%rcx,4), %eax
	movq	_MV_GPIO_IN_DEBOUNCE@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_7
## %bb.5:
	movl	%r12d, %edi
	movl	%r14d, %esi
	callq	_mv_gpio_debounce_init
	testl	%eax, %eax
	je	LBB0_9
## %bb.6:
	movl	%eax, %ebx
	xorl	%eax, %eax
	callq	_MV_GPIO_UNLOCK
	jmp	LBB0_12
LBB0_7:
	movq	_MV_GPIO_IN_IRQ_DOUBLE_EDGE@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_9
## %bb.8:
	movl	%r12d, %edi
	movl	%r14d, %esi
	callq	_mv_gpio_double_edge_init
LBB0_9:
	xorl	%eax, %eax
	callq	_MV_GPIO_UNLOCK
	movq	_mv_gpio_intr_mask@GOTPCREL(%rip), %rax
	movq	(%rax), %r8
	movq	_mv_gpio_intr_unmask@GOTPCREL(%rip), %rax
	movq	(%rax), %r9
	movq	_mv_gpio_int_ack@GOTPCREL(%rip), %rax
	leaq	L_.str(%rip), %rbx
	leaq	-48(%rbp), %rdi
	movq	%r15, %rsi
	xorl	%edx, %edx
	movl	%r14d, %ecx
	pushq	%r14
	pushq	%rbx
	pushq	$0
	pushq	(%rax)
	callq	_intr_event_create
	addq	$32, %rsp
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_12
## %bb.10:
	movq	-48(%rbp), %rax
	movq	8(%r13), %rcx
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movq	%rax, (%rcx,%rdx,8)
	movq	-48(%rbp), %rbx
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_M_DEVBUF,4,2                   ## @M_DEVBUF
	.comm	_M_NOWAIT,4,2                   ## @M_NOWAIT
	.comm	_M_ZERO,4,2                     ## @M_ZERO
	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_MV_GPIO_IN_DEBOUNCE,4,2        ## @MV_GPIO_IN_DEBOUNCE
	.comm	_MV_GPIO_IN_IRQ_DOUBLE_EDGE,4,2 ## @MV_GPIO_IN_IRQ_DOUBLE_EDGE
	.comm	_mv_gpio_intr_mask,8,3          ## @mv_gpio_intr_mask
	.comm	_mv_gpio_intr_unmask,8,3        ## @mv_gpio_intr_unmask
	.comm	_mv_gpio_int_ack,8,3            ## @mv_gpio_int_ack
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"gpio%d:"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mv_gpio_setup_intrhandler      ; -- Begin function mv_gpio_setup_intrhandler
	.p2align	2
_mv_gpio_setup_intrhandler:             ; @mv_gpio_setup_intrhandler
	.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, x7
	mov	x20, x6
	mov	x26, x5
	mov	x21, x4
	mov	x22, x3
	mov	x23, x2
	mov	x24, x1
	mov	x28, x0
	bl	_device_get_softc
	mov	x25, x0
Lloh0:
	adrp	x8, _M_DEVBUF@GOTPAGE
Lloh1:
	ldr	x8, [x8, _M_DEVBUF@GOTPAGEOFF]
Lloh2:
	adrp	x9, _M_NOWAIT@GOTPAGE
Lloh3:
	ldr	x9, [x9, _M_NOWAIT@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
Lloh5:
	ldr	w8, [x9]
Lloh6:
	adrp	x9, _M_ZERO@GOTPAGE
Lloh7:
	ldr	x9, [x9, _M_ZERO@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	orr	w2, w9, w8
	mov	w0, #4
	bl	_malloc
	tbnz	w26, #31, LBB0_4
; %bb.1:
	ldr	w8, [x25]
	cmp	w8, w26
	b.le	LBB0_4
; %bb.2:
	str	x19, [sp, #16]                  ; 8-byte Folded Spill
	ldr	x8, [x25, #8]
	ldr	x19, [x8, w26, uxtw #3]
	str	x19, [sp, #24]
	cbz	x19, LBB0_6
LBB0_3:
	mov	x0, x20
	bl	_intr_priority
	mov	x5, x0
	mov	x0, x19
	mov	x1, x24
	mov	x2, x23
	mov	x3, x22
	mov	x4, x21
	mov	x6, x20
	ldr	x7, [sp, #16]                   ; 8-byte Folded Reload
	bl	_intr_event_add_handler
	mov	w28, #0
	b	LBB0_5
LBB0_4:
Lloh9:
	adrp	x8, _ENXIO@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh11:
	ldr	w28, [x8]
LBB0_5:
	mov	x0, x28
	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_6:
	mov	x27, x0
	mov	w19, w26
	bl	_MV_GPIO_LOCK
	ldr	x8, [x25, #16]
	ldr	w8, [x8, x19, lsl #2]
Lloh12:
	adrp	x9, _MV_GPIO_IN_DEBOUNCE@GOTPAGE
Lloh13:
	ldr	x9, [x9, _MV_GPIO_IN_DEBOUNCE@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_9
; %bb.7:
	mov	x0, x28
	mov	x1, x26
	bl	_mv_gpio_debounce_init
	cbz	w0, LBB0_11
; %bb.8:
	mov	x28, x0
	bl	_MV_GPIO_UNLOCK
	b	LBB0_5
LBB0_9:
Lloh15:
	adrp	x9, _MV_GPIO_IN_IRQ_DOUBLE_EDGE@GOTPAGE
Lloh16:
	ldr	x9, [x9, _MV_GPIO_IN_IRQ_DOUBLE_EDGE@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_11
; %bb.10:
	mov	x0, x28
	mov	x1, x26
	bl	_mv_gpio_double_edge_init
LBB0_11:
	bl	_MV_GPIO_UNLOCK
Lloh18:
	adrp	x8, _mv_gpio_intr_mask@GOTPAGE
Lloh19:
	ldr	x8, [x8, _mv_gpio_intr_mask@GOTPAGEOFF]
Lloh20:
	ldr	x4, [x8]
Lloh21:
	adrp	x8, _mv_gpio_intr_unmask@GOTPAGE
Lloh22:
	ldr	x8, [x8, _mv_gpio_intr_unmask@GOTPAGEOFF]
Lloh23:
	ldr	x5, [x8]
Lloh24:
	adrp	x8, _mv_gpio_int_ack@GOTPAGE
Lloh25:
	ldr	x8, [x8, _mv_gpio_int_ack@GOTPAGEOFF]
Lloh26:
	ldr	x6, [x8]
	str	w26, [sp, #8]
Lloh27:
	adrp	x8, l_.str@PAGE
Lloh28:
	add	x8, x8, l_.str@PAGEOFF
	str	x8, [sp]
	add	x0, sp, #24
	mov	x1, x27
	mov	w2, #0
	mov	x3, x26
	mov	x7, #0
	bl	_intr_event_create
	mov	x28, x0
	cbnz	w0, LBB0_5
; %bb.12:
	ldr	x8, [sp, #24]
	ldr	x9, [x25, #8]
	str	x8, [x9, x19, lsl #3]
	ldr	x19, [sp, #24]
	b	LBB0_3
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh4
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_M_DEVBUF,4,2                   ; @M_DEVBUF
	.comm	_M_NOWAIT,4,2                   ; @M_NOWAIT
	.comm	_M_ZERO,4,2                     ; @M_ZERO
	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_MV_GPIO_IN_DEBOUNCE,4,2        ; @MV_GPIO_IN_DEBOUNCE
	.comm	_MV_GPIO_IN_IRQ_DOUBLE_EDGE,4,2 ; @MV_GPIO_IN_IRQ_DOUBLE_EDGE
	.comm	_mv_gpio_intr_mask,8,3          ; @mv_gpio_intr_mask
	.comm	_mv_gpio_intr_unmask,8,3        ; @mv_gpio_intr_unmask
	.comm	_mv_gpio_int_ack,8,3            ; @mv_gpio_int_ack
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"gpio%d:"

.subsections_via_symbols
