	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtk_iommu_isr
_mtk_iommu_isr:                         ## @mtk_iommu_isr
	.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, %r14
	movq	24(%rsi), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	_REG_MMU_FAULT_ST1@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	(%rsi), %rdi
	callq	_readl_relaxed
	movq	_F_REG_MMU0_FAULT_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	andl	%eax, %ecx
	movq	_REG_MMU0_INT_ID@GOTPCREL(%rip), %rax
	cmoveq	_REG_MMU1_INT_ID@GOTPCREL(%rip), %rax
	movq	_REG_MMU0_FAULT_VA@GOTPCREL(%rip), %rbx
	cmoveq	_REG_MMU1_FAULT_VA@GOTPCREL(%rip), %rbx
	movq	_REG_MMU0_INVLD_PA@GOTPCREL(%rip), %r13
	cmoveq	_REG_MMU1_INVLD_PA@GOTPCREL(%rip), %r13
	movq	(%rax), %rdi
	addq	(%r14), %rdi
	callq	_readl_relaxed
	movl	%eax, %r15d
	movq	(%rbx), %rdi
	addq	(%r14), %rdi
	callq	_readl_relaxed
	movl	%eax, %r12d
	movq	(%r13), %rdi
	addq	(%r14), %rdi
	callq	_readl_relaxed
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	_F_MMU_FAULT_VA_LAYER_BIT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	_F_MMU_FAULT_VA_WRITE_BIT@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	%r15d, %edi
	callq	_F_MMU_INT_ID_LARB_ID
	movl	%eax, %r13d
	movl	%r15d, %edi
	callq	_F_MMU_INT_ID_PORT_ID
                                        ## kill: def $eax killed $eax def $rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	16(%r14), %rax
	movq	(%rax), %rax
	movl	%r13d, %ecx
	movl	8(%r14), %esi
	testl	%r12d, %ebx
	jne	LBB0_1
## %bb.2:
	movq	_IOMMU_FAULT_READ@GOTPCREL(%rip), %rdx
	jmp	LBB0_3
LBB0_1:
	movq	_IOMMU_FAULT_WRITE@GOTPCREL(%rip), %rdx
LBB0_3:
	movl	(%rax,%rcx,4), %r15d
	movl	(%rdx), %ecx
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movl	%r12d, %edx
	callq	_report_iommu_fault
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	andl	%r12d, %eax
	testl	%r12d, %ebx
	movl	8(%r14), %edi
	leaq	L_.str.2(%rip), %rcx
	leaq	L_.str.1(%rip), %rbx
	cmoveq	%rcx, %rbx
	subq	$8, %rsp
	leaq	L_.str(%rip), %rsi
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	movl	%r12d, %ecx
	movl	-44(%rbp), %r8d                 ## 4-byte Reload
	movl	%r15d, %r9d
	pushq	%rbx
	pushq	%rax
	pushq	-56(%rbp)                       ## 8-byte Folded Reload
	callq	_dev_err_ratelimited
	addq	$32, %rsp
LBB0_5:
	movq	_REG_MMU_INT_CONTROL0@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdi
	addq	(%r14), %rdi
	callq	_readl_relaxed
	movq	_F_INT_CLR_BIT@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	(%rbx), %rsi
	addq	(%r14), %rsi
	movl	%eax, %edi
	callq	_writel_relaxed
	movq	%r14, %rdi
	callq	_mtk_iommu_tlb_flush_all
	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
	.cfi_endproc
                                        ## -- End function
	.comm	_REG_MMU_FAULT_ST1,8,3          ## @REG_MMU_FAULT_ST1
	.comm	_F_REG_MMU0_FAULT_MASK,4,2      ## @F_REG_MMU0_FAULT_MASK
	.comm	_REG_MMU0_INT_ID,8,3            ## @REG_MMU0_INT_ID
	.comm	_REG_MMU0_FAULT_VA,8,3          ## @REG_MMU0_FAULT_VA
	.comm	_REG_MMU0_INVLD_PA,8,3          ## @REG_MMU0_INVLD_PA
	.comm	_REG_MMU1_INT_ID,8,3            ## @REG_MMU1_INT_ID
	.comm	_REG_MMU1_FAULT_VA,8,3          ## @REG_MMU1_FAULT_VA
	.comm	_REG_MMU1_INVLD_PA,8,3          ## @REG_MMU1_INVLD_PA
	.comm	_F_MMU_FAULT_VA_LAYER_BIT,4,2   ## @F_MMU_FAULT_VA_LAYER_BIT
	.comm	_F_MMU_FAULT_VA_WRITE_BIT,4,2   ## @F_MMU_FAULT_VA_WRITE_BIT
	.comm	_IOMMU_FAULT_WRITE,4,2          ## @IOMMU_FAULT_WRITE
	.comm	_IOMMU_FAULT_READ,4,2           ## @IOMMU_FAULT_READ
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"fault type=0x%x iova=0x%x pa=0x%x larb=%d port=%d layer=%d %s\n"

L_.str.1:                               ## @.str.1
	.asciz	"write"

L_.str.2:                               ## @.str.2
	.asciz	"read"

	.comm	_REG_MMU_INT_CONTROL0,8,3       ## @REG_MMU_INT_CONTROL0
	.comm	_F_INT_CLR_BIT,4,2              ## @F_INT_CLR_BIT
	.comm	_IRQ_HANDLED,4,2                ## @IRQ_HANDLED
	.no_dead_strip	_mtk_iommu_isr
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mtk_iommu_isr
_mtk_iommu_isr:                         ; @mtk_iommu_isr
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	ldr	x21, [x1, #24]
	ldr	x8, [x1]
Lloh0:
	adrp	x9, _REG_MMU_FAULT_ST1@GOTPAGE
Lloh1:
	ldr	x9, [x9, _REG_MMU_FAULT_ST1@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_readl_relaxed
	mov	x20, x0
Lloh3:
	adrp	x8, _F_REG_MMU0_FAULT_MASK@GOTPAGE
Lloh4:
	ldr	x8, [x8, _F_REG_MMU0_FAULT_MASK@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	ldr	x9, [x19]
Lloh6:
	adrp	x10, _REG_MMU1_INT_ID@GOTPAGE
Lloh7:
	ldr	x10, [x10, _REG_MMU1_INT_ID@GOTPAGEOFF]
Lloh8:
	adrp	x11, _REG_MMU0_INT_ID@GOTPAGE
Lloh9:
	ldr	x11, [x11, _REG_MMU0_INT_ID@GOTPAGEOFF]
	tst	w8, w0
	csel	x8, x10, x11, eq
	ldr	x8, [x8]
	add	x0, x8, x9
Lloh10:
	adrp	x8, _REG_MMU1_FAULT_VA@GOTPAGE
Lloh11:
	ldr	x8, [x8, _REG_MMU1_FAULT_VA@GOTPAGEOFF]
Lloh12:
	adrp	x9, _REG_MMU0_FAULT_VA@GOTPAGE
Lloh13:
	ldr	x9, [x9, _REG_MMU0_FAULT_VA@GOTPAGEOFF]
	csel	x22, x8, x9, eq
Lloh14:
	adrp	x8, _REG_MMU1_INVLD_PA@GOTPAGE
Lloh15:
	ldr	x8, [x8, _REG_MMU1_INVLD_PA@GOTPAGEOFF]
Lloh16:
	adrp	x9, _REG_MMU0_INVLD_PA@GOTPAGE
Lloh17:
	ldr	x9, [x9, _REG_MMU0_INVLD_PA@GOTPAGEOFF]
	csel	x23, x8, x9, eq
	bl	_readl_relaxed
	mov	x24, x0
	ldr	x8, [x19]
	ldr	x9, [x22]
	add	x0, x9, x8
	bl	_readl_relaxed
	mov	x22, x0
	ldr	x8, [x19]
	ldr	x9, [x23]
	add	x0, x9, x8
	bl	_readl_relaxed
	mov	x23, x0
Lloh18:
	adrp	x8, _F_MMU_FAULT_VA_LAYER_BIT@GOTPAGE
Lloh19:
	ldr	x8, [x8, _F_MMU_FAULT_VA_LAYER_BIT@GOTPAGEOFF]
Lloh20:
	ldr	w26, [x8]
Lloh21:
	adrp	x8, _F_MMU_FAULT_VA_WRITE_BIT@GOTPAGE
Lloh22:
	ldr	x8, [x8, _F_MMU_FAULT_VA_WRITE_BIT@GOTPAGEOFF]
Lloh23:
	ldr	w27, [x8]
	mov	x0, x24
	bl	_F_MMU_INT_ID_LARB_ID
	mov	x25, x0
	mov	x0, x24
	bl	_F_MMU_INT_ID_PORT_ID
	mov	x24, x0
	ands	w27, w27, w22
	ldr	x8, [x19, #16]
	ldr	x8, [x8]
	ldr	w25, [x8, w25, uxtw #2]
	ldr	w1, [x19, #8]
Lloh24:
	adrp	x8, _IOMMU_FAULT_WRITE@GOTPAGE
Lloh25:
	ldr	x8, [x8, _IOMMU_FAULT_WRITE@GOTPAGEOFF]
Lloh26:
	adrp	x9, _IOMMU_FAULT_READ@GOTPAGE
Lloh27:
	ldr	x9, [x9, _IOMMU_FAULT_READ@GOTPAGEOFF]
	csel	x8, x9, x8, eq
	ldr	w3, [x8]
	mov	x0, x21
	mov	x2, x22
	bl	_report_iommu_fault
	cbz	x0, LBB0_2
; %bb.1:
	and	w7, w26, w22
	ldr	w0, [x19, #8]
Lloh28:
	adrp	x8, l_.str.1@PAGE
Lloh29:
	add	x8, x8, l_.str.1@PAGEOFF
Lloh30:
	adrp	x9, l_.str.2@PAGE
Lloh31:
	add	x9, x9, l_.str.2@PAGEOFF
	cmp	w27, #0
	csel	x8, x9, x8, eq
	str	x8, [sp]
Lloh32:
	adrp	x1, l_.str@PAGE
Lloh33:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x20
	mov	x3, x22
	mov	x4, x23
	mov	x5, x25
	mov	x6, x24
	bl	_dev_err_ratelimited
LBB0_2:
	ldr	x8, [x19]
Lloh34:
	adrp	x20, _REG_MMU_INT_CONTROL0@GOTPAGE
Lloh35:
	ldr	x20, [x20, _REG_MMU_INT_CONTROL0@GOTPAGEOFF]
	ldr	x9, [x20]
	add	x0, x9, x8
	bl	_readl_relaxed
Lloh36:
	adrp	x8, _F_INT_CLR_BIT@GOTPAGE
Lloh37:
	ldr	x8, [x8, _F_INT_CLR_BIT@GOTPAGEOFF]
Lloh38:
	ldr	w8, [x8]
	orr	w0, w8, w0
	ldr	x8, [x19]
	ldr	x9, [x20]
	add	x1, x9, x8
	bl	_writel_relaxed
	mov	x0, x19
	bl	_mtk_iommu_tlb_flush_all
Lloh39:
	adrp	x8, _IRQ_HANDLED@GOTPAGE
Lloh40:
	ldr	x8, [x8, _IRQ_HANDLED@GOTPAGEOFF]
Lloh41:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGot	Lloh34, Lloh35
	.cfi_endproc
                                        ; -- End function
	.comm	_REG_MMU_FAULT_ST1,8,3          ; @REG_MMU_FAULT_ST1
	.comm	_F_REG_MMU0_FAULT_MASK,4,2      ; @F_REG_MMU0_FAULT_MASK
	.comm	_REG_MMU0_INT_ID,8,3            ; @REG_MMU0_INT_ID
	.comm	_REG_MMU0_FAULT_VA,8,3          ; @REG_MMU0_FAULT_VA
	.comm	_REG_MMU0_INVLD_PA,8,3          ; @REG_MMU0_INVLD_PA
	.comm	_REG_MMU1_INT_ID,8,3            ; @REG_MMU1_INT_ID
	.comm	_REG_MMU1_FAULT_VA,8,3          ; @REG_MMU1_FAULT_VA
	.comm	_REG_MMU1_INVLD_PA,8,3          ; @REG_MMU1_INVLD_PA
	.comm	_F_MMU_FAULT_VA_LAYER_BIT,4,2   ; @F_MMU_FAULT_VA_LAYER_BIT
	.comm	_F_MMU_FAULT_VA_WRITE_BIT,4,2   ; @F_MMU_FAULT_VA_WRITE_BIT
	.comm	_IOMMU_FAULT_WRITE,4,2          ; @IOMMU_FAULT_WRITE
	.comm	_IOMMU_FAULT_READ,4,2           ; @IOMMU_FAULT_READ
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"fault type=0x%x iova=0x%x pa=0x%x larb=%d port=%d layer=%d %s\n"

l_.str.1:                               ; @.str.1
	.asciz	"write"

l_.str.2:                               ; @.str.2
	.asciz	"read"

	.comm	_REG_MMU_INT_CONTROL0,8,3       ; @REG_MMU_INT_CONTROL0
	.comm	_F_INT_CLR_BIT,4,2              ; @F_INT_CLR_BIT
	.comm	_IRQ_HANDLED,4,2                ; @IRQ_HANDLED
	.no_dead_strip	_mtk_iommu_isr
.subsections_via_symbols
