	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function armada_37xx_edge_both_irq_swap_pol
_armada_37xx_edge_both_irq_swap_pol:    ## @armada_37xx_edge_both_irq_swap_pol
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %eax
	movq	%rdi, %r14
	movq	_GPIO_PER_REG@GOTPCREL(%rip), %rcx
	cltd
	idivl	(%rcx)
	movl	%edx, %r15d
	movl	16(%rdi), %edi
	movq	_INPUT_VAL@GOTPCREL(%rip), %rcx
	shll	$2, %eax
	movslq	%eax, %rbx
	movq	(%rcx), %rsi
	addq	%rbx, %rsi
	leaq	-36(%rbp), %rdx
	callq	_regmap_read
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	movq	_IRQ_POL@GOTPCREL(%rip), %r12
	movq	8(%r14), %rdi
	addq	%rbx, %rdi
	addq	(%r12), %rdi
	callq	_readl
	movl	-36(%rbp), %esi
	xorl	%eax, %esi
	movl	$1, %edx
	movl	%r15d, %ecx
	shll	%cl, %edx
	btl	%r15d, %esi
	jae	LBB0_1
## %bb.2:
	xorl	%edx, %eax
	addq	8(%r14), %rbx
	addq	(%r12), %rbx
	movl	%eax, %edi
	movq	%rbx, %rsi
	callq	_writel
	xorl	%ebx, %ebx
	jmp	LBB0_3
LBB0_1:
	movl	$-1, %ebx
LBB0_3:
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GPIO_PER_REG,4,2               ## @GPIO_PER_REG
	.comm	_INPUT_VAL,8,3                  ## @INPUT_VAL
	.comm	_IRQ_POL,8,3                    ## @IRQ_POL
	.no_dead_strip	_armada_37xx_edge_both_irq_swap_pol
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function armada_37xx_edge_both_irq_swap_pol
_armada_37xx_edge_both_irq_swap_pol:    ; @armada_37xx_edge_both_irq_swap_pol
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x0
Lloh0:
	adrp	x8, _GPIO_PER_REG@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GPIO_PER_REG@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	sdiv	w9, w1, w8
	msub	w22, w9, w8, w1
	ldr	w0, [x0, #16]
Lloh3:
	adrp	x8, _INPUT_VAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _INPUT_VAL@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	lsl	w9, w9, #2
	sxtw	x20, w9
	add	x1, x8, x20
	add	x2, sp, #12
	bl	_regmap_read
	mov	x0, x19
	bl	_spin_lock_irqsave
	ldr	x8, [x19, #8]
Lloh6:
	adrp	x21, _IRQ_POL@GOTPAGE
Lloh7:
	ldr	x21, [x21, _IRQ_POL@GOTPAGEOFF]
	ldr	x9, [x21]
	add	x8, x8, x20
	add	x0, x8, x9
	bl	_readl
	ldr	w8, [sp, #12]
	eor	w9, w8, w0
	mov	w8, #1
	lsl	w8, w8, w22
	tst	w9, w8
	b.eq	LBB0_2
; %bb.1:
	eor	w0, w0, w8
	ldr	x8, [x19, #8]
	ldr	x9, [x21]
	add	x8, x8, x20
	add	x1, x8, x9
	bl	_writel
	mov	w20, #0
	b	LBB0_3
LBB0_2:
	mov	w20, #-1
LBB0_3:
	mov	x0, x19
	bl	_spin_unlock_irqrestore
	mov	x0, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_GPIO_PER_REG,4,2               ; @GPIO_PER_REG
	.comm	_INPUT_VAL,8,3                  ; @INPUT_VAL
	.comm	_IRQ_POL,8,3                    ; @IRQ_POL
	.no_dead_strip	_armada_37xx_edge_both_irq_swap_pol
.subsections_via_symbols
