	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mv_gpio_debounce
_mv_gpio_debounce:                      ## @mv_gpio_debounce
	.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
	movl	(%rdi), %r12d
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	movl	4(%rdi), %r15d
	movl	%r15d, %edi
	callq	_device_get_softc
	movq	%rax, %rbx
	xorl	%eax, %eax
	callq	_MV_GPIO_LOCK
	movl	%r15d, %edi
	movl	%r12d, %esi
	movl	$1, %edx
	callq	_mv_gpio_value_get
	movq	%rax, %r13
	testq	%rax, %rax
	setne	%r14b
	movl	%r15d, %edi
	movl	%r12d, %esi
	callq	_mv_gpio_debounced_state_get
	movq	%rbx, %rcx
	movq	%rax, %rbx
	testq	%rax, %rax
	sete	%al
	movq	(%rcx), %rdi
	movslq	%r12d, %rsi
	cmpb	%al, %r14b
	je	LBB0_5
## %bb.1:
	testq	%rbx, %rbx
	jne	LBB0_2
## %bb.3:
	movq	_DEBOUNCE_LO_HI_MS@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_5:
	movl	%r15d, -48(%rbp)                ## 4-byte Spill
	decl	(%rdi,%rsi,4)
	jne	LBB0_6
## %bb.7:
	movq	%rdi, %r15
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	xorl	%edx, %edx
	movb	%r14b, %dl
	testq	%r13, %r13
	sete	%r14b
	setne	-41(%rbp)                       ## 1-byte Folded Spill
	movl	-48(%rbp), %edi                 ## 4-byte Reload
	movl	%r12d, %esi
	callq	_mv_gpio_debounced_state_set
	testq	%rbx, %rbx
	jne	LBB0_8
## %bb.9:
	movq	_DEBOUNCE_LO_HI_MS@GOTPCREL(%rip), %rax
	jmp	LBB0_10
LBB0_2:
	movq	_DEBOUNCE_HI_LO_MS@GOTPCREL(%rip), %rax
LBB0_4:
	movl	(%rax), %eax
	movq	_DEBOUNCE_CHECK_MS@GOTPCREL(%rip), %rbx
	cltd
	idivl	(%rbx)
	movl	%eax, (%rdi,%rsi,4)
LBB0_6:
	movq	8(%rcx), %rax
	movl	(%rax,%rsi,4), %edi
	movq	_DEBOUNCE_CHECK_TICKS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	_mv_gpio_debounce(%rip), %rdx
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	callq	_callout_reset
LBB0_15:
	xorl	%eax, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_MV_GPIO_UNLOCK                 ## TAILCALL
LBB0_8:
	movq	_DEBOUNCE_HI_LO_MS@GOTPCREL(%rip), %rax
LBB0_10:
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movl	(%rax), %eax
	movq	_DEBOUNCE_CHECK_MS@GOTPCREL(%rip), %rcx
	cltd
	idivl	(%rcx)
	movl	%eax, (%r15,%rdi,4)
	movq	16(%rsi), %rax
	movl	(%rax,%rdi,4), %eax
	movq	_MV_GPIO_IN_POL_LOW@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	setne	%dl
	sete	%cl
	testb	%r14b, %dl
	movl	-48(%rbp), %r14d                ## 4-byte Reload
	jne	LBB0_13
## %bb.11:
	andb	-41(%rbp), %cl                  ## 1-byte Folded Reload
	jne	LBB0_13
## %bb.12:
	movq	_MV_GPIO_IN_IRQ_DOUBLE_EDGE@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_14
LBB0_13:
	movl	%r14d, %edi
	movl	%r12d, %esi
	callq	_mv_gpio_intr_handler
LBB0_14:
	movl	%r14d, %edi
	movl	%r12d, %esi
	xorl	%edx, %edx
	movl	$1, %ecx
	callq	_mv_gpio_polarity
	movq	_M_DEVBUF@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	callq	_free
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rax
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movl	(%rax,%rcx,4), %edi
	callq	_callout_deactivate
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.comm	_DEBOUNCE_HI_LO_MS,4,2          ## @DEBOUNCE_HI_LO_MS
	.comm	_DEBOUNCE_CHECK_MS,4,2          ## @DEBOUNCE_CHECK_MS
	.comm	_DEBOUNCE_LO_HI_MS,4,2          ## @DEBOUNCE_LO_HI_MS
	.comm	_DEBOUNCE_CHECK_TICKS,4,2       ## @DEBOUNCE_CHECK_TICKS
	.comm	_MV_GPIO_IN_POL_LOW,4,2         ## @MV_GPIO_IN_POL_LOW
	.comm	_MV_GPIO_IN_IRQ_DOUBLE_EDGE,4,2 ## @MV_GPIO_IN_IRQ_DOUBLE_EDGE
	.comm	_M_DEVBUF,4,2                   ## @M_DEVBUF
	.no_dead_strip	_mv_gpio_debounce
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mv_gpio_debounce
_mv_gpio_debounce:                      ; @mv_gpio_debounce
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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, x0
	ldp	w22, w21, [x0]
	mov	x0, x21
	bl	_device_get_softc
	mov	x20, x0
	bl	_MV_GPIO_LOCK
	mov	x0, x21
	mov	x1, x22
	mov	w2, #1
	bl	_mv_gpio_value_get
	mov	x23, x0
	cmp	x0, #0
	cset	w25, ne
	mov	x0, x21
	mov	x1, x22
	bl	_mv_gpio_debounced_state_get
	mov	x24, x0
	cmp	x0, #0
	cset	w8, eq
	ldr	x26, [x20]
	sxtw	x22, w22
	cmp	w25, w8
	b.eq	LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _DEBOUNCE_LO_HI_MS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DEBOUNCE_LO_HI_MS@GOTPAGEOFF]
Lloh2:
	adrp	x9, _DEBOUNCE_HI_LO_MS@GOTPAGE
Lloh3:
	ldr	x9, [x9, _DEBOUNCE_HI_LO_MS@GOTPAGEOFF]
	cmp	x24, #0
	csel	x8, x8, x9, eq
Lloh4:
	adrp	x9, _DEBOUNCE_CHECK_MS@GOTPAGE
Lloh5:
	ldr	x9, [x9, _DEBOUNCE_CHECK_MS@GOTPAGEOFF]
	ldr	w8, [x8]
Lloh6:
	ldr	w9, [x9]
	sdiv	w8, w8, w9
	lsl	x9, x22, #2
	str	w8, [x26, x9]
	ldr	x8, [x20, #8]
	ldr	w0, [x8, x9]
	b	LBB0_4
LBB0_2:
	lsl	x27, x22, #2
	ldr	w8, [x26, x27]
	subs	w8, w8, #1
	str	w8, [x26, x27]
	b.eq	LBB0_6
; %bb.3:
	ldr	x8, [x20, #8]
	ldr	w0, [x8, x22, lsl #2]
LBB0_4:
Lloh7:
	adrp	x8, _DEBOUNCE_CHECK_TICKS@GOTPAGE
Lloh8:
	ldr	x8, [x8, _DEBOUNCE_CHECK_TICKS@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
Lloh10:
	adrp	x2, _mv_gpio_debounce@PAGE
Lloh11:
	add	x2, x2, _mv_gpio_debounce@PAGEOFF
	mov	x3, x19
	bl	_callout_reset
LBB0_5:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_MV_GPIO_UNLOCK
LBB0_6:
	mov	x0, x21
	mov	x1, x22
	mov	x2, x25
	bl	_mv_gpio_debounced_state_set
Lloh12:
	adrp	x8, _DEBOUNCE_LO_HI_MS@GOTPAGE
Lloh13:
	ldr	x8, [x8, _DEBOUNCE_LO_HI_MS@GOTPAGEOFF]
Lloh14:
	adrp	x9, _DEBOUNCE_HI_LO_MS@GOTPAGE
Lloh15:
	ldr	x9, [x9, _DEBOUNCE_HI_LO_MS@GOTPAGEOFF]
	cmp	x24, #0
	csel	x8, x8, x9, eq
	ldr	w8, [x8]
Lloh16:
	adrp	x9, _DEBOUNCE_CHECK_MS@GOTPAGE
Lloh17:
	ldr	x9, [x9, _DEBOUNCE_CHECK_MS@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
	sdiv	w8, w8, w9
	str	w8, [x26, x27]
	ldr	x8, [x20, #16]
	ldr	w8, [x8, x27]
Lloh19:
	adrp	x9, _MV_GPIO_IN_POL_LOW@GOTPAGE
Lloh20:
	ldr	x9, [x9, _MV_GPIO_IN_POL_LOW@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x9]
	ands	w11, w9, w8
	cset	w9, eq
	cmp	x23, #0
	cset	w10, ne
	ccmp	w11, #0, #4, eq
	b.ne	LBB0_9
; %bb.7:
	and	w9, w9, w10
	tbnz	w9, #0, LBB0_9
; %bb.8:
Lloh22:
	adrp	x9, _MV_GPIO_IN_IRQ_DOUBLE_EDGE@GOTPAGE
Lloh23:
	ldr	x9, [x9, _MV_GPIO_IN_IRQ_DOUBLE_EDGE@GOTPAGEOFF]
Lloh24:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_10
LBB0_9:
	mov	x0, x21
	mov	x1, x22
	bl	_mv_gpio_intr_handler
LBB0_10:
	mov	x0, x21
	mov	x1, x22
	mov	w2, #0
	mov	w3, #1
	bl	_mv_gpio_polarity
Lloh25:
	adrp	x8, _M_DEVBUF@GOTPAGE
Lloh26:
	ldr	x8, [x8, _M_DEVBUF@GOTPAGEOFF]
Lloh27:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_free
	ldr	x8, [x20, #8]
	ldr	w0, [x8, x22, lsl #2]
	bl	_callout_deactivate
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_DEBOUNCE_HI_LO_MS,4,2          ; @DEBOUNCE_HI_LO_MS
	.comm	_DEBOUNCE_CHECK_MS,4,2          ; @DEBOUNCE_CHECK_MS
	.comm	_DEBOUNCE_LO_HI_MS,4,2          ; @DEBOUNCE_LO_HI_MS
	.comm	_DEBOUNCE_CHECK_TICKS,4,2       ; @DEBOUNCE_CHECK_TICKS
	.comm	_MV_GPIO_IN_POL_LOW,4,2         ; @MV_GPIO_IN_POL_LOW
	.comm	_MV_GPIO_IN_IRQ_DOUBLE_EDGE,4,2 ; @MV_GPIO_IN_IRQ_DOUBLE_EDGE
	.comm	_M_DEVBUF,4,2                   ; @M_DEVBUF
	.no_dead_strip	_mv_gpio_debounce
.subsections_via_symbols
