	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function xgene_msi_hwirq_alloc
_xgene_msi_hwirq_alloc:                 ## @xgene_msi_hwirq_alloc
	.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	_NR_HW_IRQS@GOTPCREL(%rip), %r12
	movl	(%r12), %eax
	xorl	%r15d, %r15d
	cmpl	%edi, %eax
	jle	LBB0_14
## %bb.1:
	movq	_xgene_msi_ctrl@GOTPCREL(%rip), %r14
	movl	%edi, -48(%rbp)                 ## 4-byte Spill
	movl	%edi, %r13d
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_2 Depth=1
	addl	8(%r14), %r13d
	cmpl	%eax, %r13d
	jge	LBB0_13
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %rcx
	movslq	%r13d, %rdx
	movl	(%rcx,%rdx,4), %edi
	testl	%edi, %edi
	je	LBB0_12
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	leaq	(%rcx,%rdx,4), %rbx
	movq	_xgene_msi_isr@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_irq_set_chained_handler
	movl	(%rbx), %edi
	movq	%rbx, %rsi
	callq	_irq_set_handler_data
	testl	%eax, %eax
	jne	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-44(%rbp), %rdi
	callq	_alloc_cpumask_var
	testq	%rax, %rax
	je	LBB0_9
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	-44(%rbp), %edi
	callq	_cpumask_clear
	movl	-44(%rbp), %esi
	movl	-48(%rbp), %edi                 ## 4-byte Reload
	callq	_cpumask_set_cpu
	movl	(%rbx), %edi
	movl	-44(%rbp), %esi
	callq	_irq_set_affinity
	movl	%eax, %r15d
	testl	%eax, %eax
	je	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_2 Depth=1
	leaq	L_.str.1(%rip), %rdi
	callq	_pr_err
LBB0_8:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	-44(%rbp), %edi
	callq	_free_cpumask_var
	testl	%r15d, %r15d
	je	LBB0_11
	jmp	LBB0_15
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_2 Depth=1
	leaq	L_.str.2(%rip), %rdi
	callq	_pr_err
	xorl	%r15d, %r15d
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
	testl	%r15d, %r15d
	jne	LBB0_15
LBB0_11:                                ##   in Loop: Header=BB0_2 Depth=1
	movl	(%r12), %eax
	jmp	LBB0_12
LBB0_13:
	xorl	%r15d, %r15d
	jmp	LBB0_14
LBB0_4:
	leaq	L_.str(%rip), %rdi
	callq	_pr_err
	xorl	%r15d, %r15d
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
	jmp	LBB0_14
LBB0_15:
	movl	(%rbx), %edi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_irq_set_chained_handler_and_data
LBB0_14:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_xgene_msi_ctrl,16,3            ## @xgene_msi_ctrl
	.comm	_NR_HW_IRQS,4,2                 ## @NR_HW_IRQS
	.comm	_xgene_msi_isr,4,2              ## @xgene_msi_isr
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to register GIC IRQ handler\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
L_.str.1:                               ## @.str.1
	.asciz	"failed to set affinity for GIC IRQ"

L_.str.2:                               ## @.str.2
	.asciz	"failed to alloc CPU mask for affinity\n"

	.no_dead_strip	_xgene_msi_hwirq_alloc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function xgene_msi_hwirq_alloc
_xgene_msi_hwirq_alloc:                 ; @xgene_msi_hwirq_alloc
	.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
Lloh0:
	adrp	x24, _NR_HW_IRQS@GOTPAGE
Lloh1:
	ldr	x24, [x24, _NR_HW_IRQS@GOTPAGEOFF]
	ldr	w8, [x24]
	cmp	w8, w0
	b.le	LBB0_11
; %bb.1:
	mov	x20, x0
Lloh2:
	adrp	x25, _xgene_msi_ctrl@GOTPAGE
Lloh3:
	ldr	x25, [x25, _xgene_msi_ctrl@GOTPAGEOFF]
Lloh4:
	adrp	x26, _xgene_msi_isr@GOTPAGE
Lloh5:
	ldr	x26, [x26, _xgene_msi_isr@GOTPAGEOFF]
Lloh6:
	adrp	x28, _GFP_KERNEL@GOTPAGE
Lloh7:
	ldr	x28, [x28, _GFP_KERNEL@GOTPAGEOFF]
	mov	x19, x0
Lloh8:
	adrp	x27, _EINVAL@GOTPAGE
Lloh9:
	ldr	x27, [x27, _EINVAL@GOTPAGEOFF]
Lloh10:
	adrp	x21, l_.str.1@PAGE
Lloh11:
	add	x21, x21, l_.str.1@PAGEOFF
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	w9, [x25, #8]
	add	w19, w19, w9
	cmp	w19, w8
	b.ge	LBB0_11
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x25]
	add	x22, x9, w19, sxtw #2
	ldr	w0, [x22]
	cbz	w0, LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w1, [x26]
	bl	_irq_set_chained_handler
	ldr	w0, [x22]
	mov	x1, x22
	bl	_irq_set_handler_data
	cbnz	w0, LBB0_13
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w1, [x28]
	add	x0, sp, #12
	bl	_alloc_cpumask_var
	cbz	x0, LBB0_9
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w0, [sp, #12]
	bl	_cpumask_clear
	ldr	w1, [sp, #12]
	mov	x0, x20
	bl	_cpumask_set_cpu
	ldr	w0, [x22]
	ldr	w1, [sp, #12]
	bl	_irq_set_affinity
	mov	x23, x0
	cbz	w0, LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x21
	bl	_pr_err
LBB0_8:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	w0, [sp, #12]
	bl	_free_cpumask_var
	cbz	w23, LBB0_10
	b	LBB0_14
LBB0_9:                                 ;   in Loop: Header=BB0_3 Depth=1
Lloh12:
	adrp	x0, l_.str.2@PAGE
Lloh13:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_pr_err
	ldr	w8, [x27]
	neg	w23, w8
	cbnz	w23, LBB0_14
LBB0_10:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [x24]
	b	LBB0_2
LBB0_11:
	mov	w23, #0
LBB0_12:
	mov	x0, x23
	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
LBB0_13:
Lloh14:
	adrp	x0, l_.str@PAGE
Lloh15:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_err
	ldr	w8, [x27]
	neg	w23, w8
	b	LBB0_12
LBB0_14:
	ldr	w0, [x22]
	mov	x1, #0
	mov	x2, #0
	bl	_irq_set_chained_handler_and_data
	b	LBB0_12
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_xgene_msi_ctrl,16,3            ; @xgene_msi_ctrl
	.comm	_NR_HW_IRQS,4,2                 ; @NR_HW_IRQS
	.comm	_xgene_msi_isr,4,2              ; @xgene_msi_isr
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to register GIC IRQ handler\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
l_.str.1:                               ; @.str.1
	.asciz	"failed to set affinity for GIC IRQ"

l_.str.2:                               ; @.str.2
	.asciz	"failed to alloc CPU mask for affinity\n"

	.no_dead_strip	_xgene_msi_hwirq_alloc
.subsections_via_symbols
