	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function aspeed_sgpio_setup_irqs
_aspeed_sgpio_setup_irqs:               ## @aspeed_sgpio_setup_irqs
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	%rsi, %rdi
	xorl	%esi, %esi
	callq	_platform_get_irq
                                        ## kill: def $eax killed $eax def $rax
	testl	%eax, %eax
	js	LBB0_8
## %bb.1:
	movl	%eax, (%r15)
	movq	_aspeed_sgpio_banks@GOTPCREL(%rip), %r12
	movq	(%r12), %rdi
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	jle	LBB0_4
## %bb.2:
	xorl	%r14d, %r14d
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r12), %rbx
	addq	%r14, %rbx
	movq	_reg_irq_enable@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_bank_reg
	xorl	%edi, %edi
	movl	%eax, %esi
	callq	_iowrite32
	movq	_reg_irq_status@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_bank_reg
	movl	$-1, %edi
	movl	%eax, %esi
	callq	_iowrite32
	incq	%r13
	movq	(%r12), %rdi
	callq	_ARRAY_SIZE
	cltq
	addq	$4, %r14
	cmpq	%rax, %r13
	jl	LBB0_3
LBB0_4:
	movq	_aspeed_sgpio_irqchip@GOTPCREL(%rip), %rax
	movq	%rax, 48(%r15)
	movq	_handle_bad_irq@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 40(%r15)
	movq	_IRQ_TYPE_NONE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 36(%r15)
	movq	_aspeed_sgpio_irq_handler@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 32(%r15)
	movq	%r15, 24(%r15)
	movq	%r15, 8(%r15)
	movl	$1, 16(%r15)
	movq	(%r12), %rdi
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	jle	LBB0_7
## %bb.5:
	xorl	%r13d, %r13d
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r12), %rbx
	addq	%r13, %rbx
	movq	_reg_irq_type0@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_bank_reg
	xorl	%edi, %edi
	movl	%eax, %esi
	callq	_iowrite32
	movq	_reg_irq_type1@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_bank_reg
	xorl	%edi, %edi
	movl	%eax, %esi
	callq	_iowrite32
	movq	_reg_irq_type2@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_bank_reg
	movl	$-1, %edi
	movl	%eax, %esi
	callq	_iowrite32
	movq	_reg_irq_enable@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_bank_reg
	movl	$-1, %edi
	movl	%eax, %esi
	callq	_iowrite32
	incq	%r14
	movq	(%r12), %rdi
	callq	_ARRAY_SIZE
	cltq
	addq	$4, %r13
	cmpq	%rax, %r14
	jl	LBB0_6
LBB0_7:
	xorl	%eax, %eax
LBB0_8:
                                        ## kill: def $eax killed $eax killed $rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_aspeed_sgpio_banks,8,3         ## @aspeed_sgpio_banks
	.comm	_reg_irq_enable,4,2             ## @reg_irq_enable
	.comm	_reg_irq_status,4,2             ## @reg_irq_status
	.comm	_aspeed_sgpio_irqchip,4,2       ## @aspeed_sgpio_irqchip
	.comm	_handle_bad_irq,4,2             ## @handle_bad_irq
	.comm	_IRQ_TYPE_NONE,4,2              ## @IRQ_TYPE_NONE
	.comm	_aspeed_sgpio_irq_handler,4,2   ## @aspeed_sgpio_irq_handler
	.comm	_reg_irq_type0,4,2              ## @reg_irq_type0
	.comm	_reg_irq_type1,4,2              ## @reg_irq_type1
	.comm	_reg_irq_type2,4,2              ## @reg_irq_type2
	.no_dead_strip	_aspeed_sgpio_setup_irqs
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function aspeed_sgpio_setup_irqs
_aspeed_sgpio_setup_irqs:               ; @aspeed_sgpio_setup_irqs
	.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
	mov	x0, x1
	mov	w1, #0
	bl	_platform_get_irq
	tbnz	w0, #31, LBB0_8
; %bb.1:
	str	w0, [x19]
Lloh0:
	adrp	x21, _aspeed_sgpio_banks@GOTPAGE
Lloh1:
	ldr	x21, [x21, _aspeed_sgpio_banks@GOTPAGEOFF]
	ldr	x0, [x21]
	bl	_ARRAY_SIZE
Lloh2:
	adrp	x22, _reg_irq_enable@GOTPAGE
Lloh3:
	ldr	x22, [x22, _reg_irq_enable@GOTPAGEOFF]
	cmp	w0, #1
	b.lt	LBB0_4
; %bb.2:
	mov	x23, #0
	mov	x24, #0
Lloh4:
	adrp	x25, _reg_irq_status@GOTPAGE
Lloh5:
	ldr	x25, [x25, _reg_irq_status@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x21]
	add	x20, x8, x23
	ldr	w2, [x22]
	mov	x0, x19
	mov	x1, x20
	bl	_bank_reg
	mov	x1, x0
	mov	w0, #0
	bl	_iowrite32
	ldr	w2, [x25]
	mov	x0, x19
	mov	x1, x20
	bl	_bank_reg
	mov	x1, x0
	mov	w0, #-1
	bl	_iowrite32
	add	x24, x24, #1
	ldr	x0, [x21]
	bl	_ARRAY_SIZE
	add	x23, x23, #4
	cmp	x24, w0, sxtw
	b.lt	LBB0_3
LBB0_4:
Lloh6:
	adrp	x8, _aspeed_sgpio_irqchip@GOTPAGE
Lloh7:
	ldr	x8, [x8, _aspeed_sgpio_irqchip@GOTPAGEOFF]
	str	x8, [x19, #48]
Lloh8:
	adrp	x8, _handle_bad_irq@GOTPAGE
Lloh9:
	ldr	x8, [x8, _handle_bad_irq@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
Lloh11:
	adrp	x9, _IRQ_TYPE_NONE@GOTPAGE
Lloh12:
	ldr	x9, [x9, _IRQ_TYPE_NONE@GOTPAGEOFF]
	str	w8, [x19, #40]
Lloh13:
	ldr	w8, [x9]
Lloh14:
	adrp	x9, _aspeed_sgpio_irq_handler@GOTPAGE
Lloh15:
	ldr	x9, [x9, _aspeed_sgpio_irq_handler@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	stp	w9, w8, [x19, #32]
	str	x19, [x19, #24]
	str	x19, [x19, #8]
	mov	w8, #1
	str	w8, [x19, #16]
	ldr	x0, [x21]
	bl	_ARRAY_SIZE
	cmp	w0, #1
	b.lt	LBB0_7
; %bb.5:
	mov	x23, #0
	mov	x24, #0
Lloh17:
	adrp	x25, _reg_irq_type0@GOTPAGE
Lloh18:
	ldr	x25, [x25, _reg_irq_type0@GOTPAGEOFF]
Lloh19:
	adrp	x26, _reg_irq_type1@GOTPAGE
Lloh20:
	ldr	x26, [x26, _reg_irq_type1@GOTPAGEOFF]
Lloh21:
	adrp	x27, _reg_irq_type2@GOTPAGE
Lloh22:
	ldr	x27, [x27, _reg_irq_type2@GOTPAGEOFF]
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x21]
	add	x20, x8, x23
	ldr	w2, [x25]
	mov	x0, x19
	mov	x1, x20
	bl	_bank_reg
	mov	x1, x0
	mov	w0, #0
	bl	_iowrite32
	ldr	w2, [x26]
	mov	x0, x19
	mov	x1, x20
	bl	_bank_reg
	mov	x1, x0
	mov	w0, #0
	bl	_iowrite32
	ldr	w2, [x27]
	mov	x0, x19
	mov	x1, x20
	bl	_bank_reg
	mov	x1, x0
	mov	w0, #-1
	bl	_iowrite32
	ldr	w2, [x22]
	mov	x0, x19
	mov	x1, x20
	bl	_bank_reg
	mov	x1, x0
	mov	w0, #-1
	bl	_iowrite32
	add	x24, x24, #1
	ldr	x0, [x21]
	bl	_ARRAY_SIZE
	add	x23, x23, #4
	cmp	x24, w0, sxtw
	b.lt	LBB0_6
LBB0_7:
	mov	w0, #0
LBB0_8:
	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 AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_aspeed_sgpio_banks,8,3         ; @aspeed_sgpio_banks
	.comm	_reg_irq_enable,4,2             ; @reg_irq_enable
	.comm	_reg_irq_status,4,2             ; @reg_irq_status
	.comm	_aspeed_sgpio_irqchip,4,2       ; @aspeed_sgpio_irqchip
	.comm	_handle_bad_irq,4,2             ; @handle_bad_irq
	.comm	_IRQ_TYPE_NONE,4,2              ; @IRQ_TYPE_NONE
	.comm	_aspeed_sgpio_irq_handler,4,2   ; @aspeed_sgpio_irq_handler
	.comm	_reg_irq_type0,4,2              ; @reg_irq_type0
	.comm	_reg_irq_type1,4,2              ; @reg_irq_type1
	.comm	_reg_irq_type2,4,2              ; @reg_irq_type2
	.no_dead_strip	_aspeed_sgpio_setup_irqs
.subsections_via_symbols
