	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function armada_37xx_irq_handler
_armada_37xx_irq_handler:               ## @armada_37xx_irq_handler
	.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	%rdi, %rbx
	callq	_irq_desc_get_handler_data
	movq	%rax, %r14
	movq	%rbx, %rdi
	callq	_irq_desc_get_chip
	movq	%rax, %r15
	movq	%r14, %rdi
	callq	_gpiochip_get_data
	movq	%rax, %r13
	movq	(%r14), %r14
	movq	%r15, -72(%rbp)                 ## 8-byte Spill
	movq	%r15, %rdi
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rsi
	callq	_chained_irq_enter
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	movl	(%r14), %eax
	movq	_GPIO_PER_REG@GOTPCREL(%rip), %rcx
	cltd
	idivl	(%rcx)
	testl	%eax, %eax
	js	LBB0_10
## %bb.1:
	xorl	%ebx, %ebx
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	leaq	1(%rdi), %rbx
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %eax
	cltd
	movq	_GPIO_PER_REG@GOTPCREL(%rip), %rsi
	idivl	(%rsi)
	cltq
	cmpq	%rax, %rdi
	jge	LBB0_10
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_3 Depth 2
	movq	%r13, %rdi
	callq	_spin_lock_irqsave
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	leal	(,%rbx,4), %ebx
	movq	8(%r13), %rdi
	addq	%rbx, %rdi
	movq	_IRQ_STATUS@GOTPCREL(%rip), %rax
	addq	(%rax), %rdi
	callq	_readl_relaxed
	movl	%eax, %r14d
	movq	8(%r13), %rdi
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_3 Depth=2
	movl	%r14d, %edi
	callq	_generic_handle_irq
LBB0_8:                                 ##   in Loop: Header=BB0_3 Depth=2
	movq	%r13, %rdi
	callq	_spin_lock_irqsave
	movq	8(%r13), %rdi
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	addq	%rbx, %rdi
	movq	_IRQ_STATUS@GOTPCREL(%rip), %rax
	addq	(%rax), %rdi
	callq	_readl_relaxed
	movl	%eax, %r14d
	movq	8(%r13), %rdi
LBB0_3:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	addq	%rbx, %rdi
	movq	_IRQ_EN@GOTPCREL(%rip), %rax
	addq	(%rax), %rdi
	callq	_readl_relaxed
	movl	%eax, %ebx
	movq	%r13, %rdi
	callq	_spin_unlock_irqrestore
	andl	%r14d, %ebx
	je	LBB0_9
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=2
	bsfl	%ebx, %ebx
	movq	_GPIO_PER_REG@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	imull	%r12d, %esi
	addl	%ebx, %esi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_irq_find_mapping
	movl	%eax, %r14d
	movl	%eax, %edi
	callq	_irq_get_trigger_type
	movq	_IRQ_TYPE_SENSE_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movq	_IRQ_TYPE_EDGE_BOTH@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=2
	movl	(%r15), %esi
	imull	%r12d, %esi
	addl	%ebx, %esi
	movq	%r13, %rdi
	callq	_armada_37xx_edge_both_irq_swap_pol
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=2
	movl	$1, %edi
	movl	%ebx, %ecx
	shll	%cl, %edi
	movq	8(%r13), %rsi
	addq	-64(%rbp), %rsi                 ## 8-byte Folded Reload
	movq	_IRQ_STATUS@GOTPCREL(%rip), %rax
	addq	(%rax), %rsi
	callq	_writel
	jmp	LBB0_8
LBB0_10:
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movq	-80(%rbp), %rsi                 ## 8-byte Reload
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_chained_irq_exit               ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_GPIO_PER_REG,4,2               ## @GPIO_PER_REG
	.comm	_IRQ_STATUS,8,3                 ## @IRQ_STATUS
	.comm	_IRQ_EN,8,3                     ## @IRQ_EN
	.comm	_IRQ_TYPE_SENSE_MASK,4,2        ## @IRQ_TYPE_SENSE_MASK
	.comm	_IRQ_TYPE_EDGE_BOTH,4,2         ## @IRQ_TYPE_EDGE_BOTH
	.no_dead_strip	_armada_37xx_irq_handler
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function armada_37xx_irq_handler
_armada_37xx_irq_handler:               ; @armada_37xx_irq_handler
	.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, x0
	bl	_irq_desc_get_handler_data
	mov	x22, x0
	mov	x0, x19
	bl	_irq_desc_get_chip
	mov	x20, x0
	mov	x0, x22
	bl	_gpiochip_get_data
	mov	x21, x0
	ldr	x22, [x22]
	stp	x20, x19, [sp]                  ; 16-byte Folded Spill
	mov	x0, x20
	mov	x1, x19
	bl	_chained_irq_enter
	ldr	w8, [x22]
Lloh0:
	adrp	x24, _GPIO_PER_REG@GOTPAGE
Lloh1:
	ldr	x24, [x24, _GPIO_PER_REG@GOTPAGEOFF]
	ldr	w9, [x24]
	sdiv	w8, w8, w9
	tbnz	w8, #31, LBB0_10
; %bb.1:
	mov	x25, #0
Lloh2:
	adrp	x26, _IRQ_STATUS@GOTPAGE
Lloh3:
	ldr	x26, [x26, _IRQ_STATUS@GOTPAGEOFF]
Lloh4:
	adrp	x27, _IRQ_EN@GOTPAGE
Lloh5:
	ldr	x27, [x27, _IRQ_EN@GOTPAGEOFF]
Lloh6:
	adrp	x19, _IRQ_TYPE_EDGE_BOTH@GOTPAGE
Lloh7:
	ldr	x19, [x19, _IRQ_TYPE_EDGE_BOTH@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [x22]
	ldr	w9, [x24]
	sdiv	w8, w8, w9
	cmp	x25, w8, sxtw
	add	x25, x25, #1
	b.ge	LBB0_10
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_6 Depth 2
	mov	x0, x21
	bl	_spin_lock_irqsave
	ldr	x8, [x21, #8]
	ldr	x9, [x26]
	lsl	w20, w25, #2
	b	LBB0_6
LBB0_4:                                 ;   in Loop: Header=BB0_6 Depth=2
	mov	x0, x23
	bl	_generic_handle_irq
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=2
	mov	x0, x21
	bl	_spin_lock_irqsave
	ldr	x8, [x21, #8]
	ldr	x9, [x26]
LBB0_6:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	add	x8, x8, x20
	add	x0, x8, x9
	bl	_readl_relaxed
	mov	x23, x0
	ldr	x8, [x21, #8]
	ldr	x9, [x27]
	add	x8, x8, x20
	add	x0, x8, x9
	bl	_readl_relaxed
	and	w23, w0, w23
	mov	x0, x21
	bl	_spin_unlock_irqrestore
	cbz	w23, LBB0_2
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=2
	rbit	w8, w23
	clz	w28, w8
	ldr	w8, [x24]
	madd	w1, w8, w25, w28
	mov	x0, x22
	bl	_irq_find_mapping
	mov	x23, x0
	bl	_irq_get_trigger_type
Lloh8:
	adrp	x8, _IRQ_TYPE_SENSE_MASK@GOTPAGE
Lloh9:
	ldr	x8, [x8, _IRQ_TYPE_SENSE_MASK@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	and	w8, w8, w0
	ldr	w9, [x19]
	cmp	w8, w9
	b.ne	LBB0_4
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=2
	ldr	w8, [x24]
	madd	w1, w8, w25, w28
	mov	x0, x21
	bl	_armada_37xx_edge_both_irq_swap_pol
	cbz	x0, LBB0_4
; %bb.9:                                ;   in Loop: Header=BB0_6 Depth=2
	mov	w8, #1
	lsl	w0, w8, w28
	ldr	x8, [x21, #8]
	ldr	x9, [x26]
	add	x8, x8, x20
	add	x1, x8, x9
	bl	_writel
	b	LBB0_5
LBB0_10:
	ldp	x0, x1, [sp]                    ; 16-byte Folded Reload
	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
	b	_chained_irq_exit
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_GPIO_PER_REG,4,2               ; @GPIO_PER_REG
	.comm	_IRQ_STATUS,8,3                 ; @IRQ_STATUS
	.comm	_IRQ_EN,8,3                     ; @IRQ_EN
	.comm	_IRQ_TYPE_SENSE_MASK,4,2        ; @IRQ_TYPE_SENSE_MASK
	.comm	_IRQ_TYPE_EDGE_BOTH,4,2         ; @IRQ_TYPE_EDGE_BOTH
	.no_dead_strip	_armada_37xx_irq_handler
.subsections_via_symbols
