	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mtk_eint_set_debounce          ## -- Begin function mtk_eint_set_debounce
	.p2align	4, 0x90
_mtk_eint_set_debounce:                 ## @mtk_eint_set_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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r14d
	movq	%rsi, %r13
	movq	%rdi, %r12
	movl	16(%rdi), %edi
	callq	_irq_find_mapping
	movl	%eax, %edi
	callq	_irq_get_irq_data
	movq	%rax, %r15
	movq	%r13, %rcx
	andq	$-4, %rcx
	movq	8(%r12), %rax
	movq	(%rax), %rbx
	addq	%rcx, %rbx
	addq	8(%rax), %rcx
	movq	%rcx, -80(%rbp)                 ## 8-byte Spill
	movq	%r12, %rdi
	movq	%r13, %rsi
	callq	_mtk_eint_can_en_debounce
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movq	%rbx, -88(%rbp)                 ## 8-byte Spill
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	leal	(,%r13,8), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	leaq	_mtk_eint_set_debounce.debounce_time(%rip), %rbx
	movq	%rbx, %rdi
	callq	_ARRAY_SIZE
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	%rbx, %rdi
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	je	LBB0_3
## %bb.4:
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	movq	%r15, -72(%rbp)                 ## 8-byte Spill
	xorl	%r15d, %r15d
	movq	%rbx, %r12
	movq	-80(%rbp), %r13                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	%r14d, (%r12)
	jae	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	incq	%r15
	movq	%rbx, %rdi
	callq	_ARRAY_SIZE
	movl	%eax, %eax
	addq	$4, %r12
	cmpq	%rax, %r15
	jb	LBB0_5
	jmp	LBB0_8
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_13
LBB0_3:
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movq	-80(%rbp), %r13                 ## 8-byte Reload
	jmp	LBB0_9
LBB0_7:
	movl	%r15d, %eax
	movl	%r15d, -48(%rbp)                ## 4-byte Spill
LBB0_8:
	movq	-72(%rbp), %r15                 ## 8-byte Reload
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
LBB0_9:
	andl	$24, %ebx
	movq	%r12, %rdi
	callq	_mtk_eint_get_mask
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_11
## %bb.10:
	movq	%r15, %rdi
	callq	_mtk_eint_mask
LBB0_11:
	movl	$255, %edi
	movl	%ebx, %ecx
	shll	%cl, %edi
	movl	%r13d, %esi
	addq	(%r12), %rsi
	callq	_writel
	movq	_MTK_EINT_DBNC_SET_DBNC_BITS@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movl	-48(%rbp), %edi                 ## 4-byte Reload
	shll	%cl, %edi
	movq	_MTK_EINT_DBNC_SET_EN@GOTPCREL(%rip), %rax
	orl	(%rax), %edi
	movq	_MTK_EINT_DBNC_RST_BIT@GOTPCREL(%rip), %rax
	orl	(%rax), %edi
	movl	%ebx, %ecx
	shll	%cl, %edi
	movl	-88(%rbp), %esi                 ## 4-byte Reload
	addq	(%r12), %rsi
	callq	_writel
	movl	$1, %edi
	callq	_udelay
	xorl	%ebx, %ebx
	testl	%r14d, %r14d
	jne	LBB0_13
## %bb.12:
	movq	%r15, %rdi
	callq	_mtk_eint_unmask
LBB0_13:
	movl	%ebx, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__const
	.p2align	4                               ## @mtk_eint_set_debounce.debounce_time
_mtk_eint_set_debounce.debounce_time:
	.long	500                             ## 0x1f4
	.long	1000                            ## 0x3e8
	.long	16000                           ## 0x3e80
	.long	32000                           ## 0x7d00
	.long	64000                           ## 0xfa00
	.long	128000                          ## 0x1f400
	.long	256000                          ## 0x3e800

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_MTK_EINT_DBNC_SET_DBNC_BITS,4,2 ## @MTK_EINT_DBNC_SET_DBNC_BITS
	.comm	_MTK_EINT_DBNC_SET_EN,4,2       ## @MTK_EINT_DBNC_SET_EN
	.comm	_MTK_EINT_DBNC_RST_BIT,4,2      ## @MTK_EINT_DBNC_RST_BIT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mtk_eint_set_debounce          ; -- Begin function mtk_eint_set_debounce
	.p2align	2
_mtk_eint_set_debounce:                 ; @mtk_eint_set_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	x23, x2
	mov	x21, x1
	mov	x20, x0
	ldr	w0, [x0, #16]
	bl	_irq_find_mapping
	bl	_irq_get_irq_data
	mov	x19, x0
	ldr	x8, [x20, #8]
	ldp	x22, x24, [x8]
	mov	x0, x20
	mov	x1, x21
	bl	_mtk_eint_can_en_debounce
	cbz	w0, LBB0_5
; %bb.1:
	and	x8, x21, #0xfffffffffffffffc
	add	x25, x22, x8
	add	x26, x24, x8
Lloh0:
	adrp	x24, _mtk_eint_set_debounce.debounce_time@PAGE
Lloh1:
	add	x24, x24, _mtk_eint_set_debounce.debounce_time@PAGEOFF
	mov	x0, x24
	bl	_ARRAY_SIZE
	mov	x22, x0
	mov	x0, x24
	bl	_ARRAY_SIZE
	cbz	w0, LBB0_7
; %bb.2:
	mov	x27, #0
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x24, x27, lsl #2]
	cmp	w8, w23
	b.hs	LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	add	x27, x27, #1
	mov	x0, x24
	bl	_ARRAY_SIZE
	cmp	x27, w0, uxtw
	b.lo	LBB0_3
	b	LBB0_7
LBB0_5:
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_12
LBB0_6:
	mov	x22, x27
LBB0_7:
	ubfiz	w23, w21, #3, #2
	mov	x0, x20
	mov	x1, x21
	bl	_mtk_eint_get_mask
	mov	x21, x0
	cbnz	w0, LBB0_9
; %bb.8:
	mov	x0, x19
	bl	_mtk_eint_mask
LBB0_9:
	mov	w8, #255
	lsl	w0, w8, w23
	ldr	x8, [x20]
	add	x1, x8, w26, uxtw
	bl	_writel
Lloh5:
	adrp	x8, _MTK_EINT_DBNC_SET_DBNC_BITS@GOTPAGE
Lloh6:
	ldr	x8, [x8, _MTK_EINT_DBNC_SET_DBNC_BITS@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	lsl	w8, w22, w8
Lloh8:
	adrp	x9, _MTK_EINT_DBNC_SET_EN@GOTPAGE
Lloh9:
	ldr	x9, [x9, _MTK_EINT_DBNC_SET_EN@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
Lloh11:
	adrp	x10, _MTK_EINT_DBNC_RST_BIT@GOTPAGE
Lloh12:
	ldr	x10, [x10, _MTK_EINT_DBNC_RST_BIT@GOTPAGEOFF]
	orr	w8, w8, w9
Lloh13:
	ldr	w9, [x10]
	orr	w8, w8, w9
	lsl	w0, w8, w23
	ldr	x8, [x20]
	add	x1, x8, w25, uxtw
	bl	_writel
	mov	w0, #1
	bl	_udelay
	cbnz	w21, LBB0_11
; %bb.10:
	mov	x0, x19
	bl	_mtk_eint_unmask
LBB0_11:
	mov	w0, #0
LBB0_12:
	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
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__const
	.p2align	2                               ; @mtk_eint_set_debounce.debounce_time
_mtk_eint_set_debounce.debounce_time:
	.long	500                             ; 0x1f4
	.long	1000                            ; 0x3e8
	.long	16000                           ; 0x3e80
	.long	32000                           ; 0x7d00
	.long	64000                           ; 0xfa00
	.long	128000                          ; 0x1f400
	.long	256000                          ; 0x3e800

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_MTK_EINT_DBNC_SET_DBNC_BITS,4,2 ; @MTK_EINT_DBNC_SET_DBNC_BITS
	.comm	_MTK_EINT_DBNC_SET_EN,4,2       ; @MTK_EINT_DBNC_SET_EN
	.comm	_MTK_EINT_DBNC_RST_BIT,4,2      ; @MTK_EINT_DBNC_RST_BIT
.subsections_via_symbols
