	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ls_scfg_msi_setup_hwirq
_ls_scfg_msi_setup_hwirq:               ## @ls_scfg_msi_setup_hwirq
	.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
	movl	%esi, %ebx
	movq	%rdi, %r15
	movl	32(%rdi), %edi
	callq	_platform_get_irq
	testl	%eax, %eax
	jle	LBB0_1
## %bb.2:
	movq	24(%r15), %r13
	movslq	%ebx, %rcx
	leaq	(%rcx,%rcx,4), %r12
	leaq	(,%r12,8), %r14
	addq	%r13, %r14
	movl	%ebx, (%r13,%r12,8)
	movq	%r15, 32(%r13,%r12,8)
	movl	%eax, 4(%r13,%r12,8)
	leal	(,%rbx,4), %ecx
	movslq	%ecx, %rcx
	addq	16(%r15), %rcx
	movq	8(%r15), %rdx
	addq	8(%rdx), %rcx
	movq	%rcx, 24(%r13,%r12,8)
	movl	(%rdx), %ecx
	movq	_MSI_LS1043V1_1_IRQS_PER_MSIR@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %ecx
	jne	LBB0_4
## %bb.3:
	movl	%ebx, %esi
	notl	%esi
	imull	%esi, %ecx
	leal	32(%rcx), %esi
	movl	%esi, 8(%r13,%r12,8)
	movl	(%rdx), %edx
	addl	%edx, %ecx
	addl	$31, %ecx
	jmp	LBB0_5
LBB0_1:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	jmp	LBB0_13
LBB0_4:
	movl	$0, 8(%r13,%r12,8)
	decl	%ecx
LBB0_5:
	movl	%ecx, 12(%r13,%r12,8)
	movq	_ls_scfg_msi_irq_handler@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%eax, %edi
	movq	%r14, %rdx
	callq	_irq_set_chained_handler_and_data
	movq	_msi_affinity_flag@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_6
## %bb.7:
	leaq	4(,%r12,8), %rax
	addq	%r13, %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	%ebx, %edi
	callq	_get_cpu_mask
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movl	%eax, %esi
	callq	_irq_set_affinity
	movl	$0, 16(%r13,%r12,8)
	movq	_msi_affinity_flag@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_9
## %bb.8:
	xorl	%r12d, %r12d
	cmpl	$0, (%r14)
	jne	LBB0_13
	jmp	LBB0_9
LBB0_6:
	movl	%ebx, 16(%r13,%r12,8)
LBB0_9:
	movq	8(%r15), %rax
	cmpl	$0, (%rax)
	jle	LBB0_10
## %bb.11:
	xorl	%r12d, %r12d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movzbl	4(%rax), %ecx
	movl	%ebx, %esi
	shll	%cl, %esi
	orl	(%r14), %esi
	movl	(%r15), %edi
	movl	$1, %edx
	callq	_bitmap_clear
	incl	%ebx
	movq	8(%r15), %rax
	cmpl	(%rax), %ebx
	jl	LBB0_12
	jmp	LBB0_13
LBB0_10:
	xorl	%r12d, %r12d
LBB0_13:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_MSI_LS1043V1_1_IRQS_PER_MSIR,4,2 ## @MSI_LS1043V1_1_IRQS_PER_MSIR
	.comm	_ls_scfg_msi_irq_handler,4,2    ## @ls_scfg_msi_irq_handler
	.comm	_msi_affinity_flag,8,3          ## @msi_affinity_flag
	.no_dead_strip	_ls_scfg_msi_setup_hwirq
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ls_scfg_msi_setup_hwirq
_ls_scfg_msi_setup_hwirq:               ; @ls_scfg_msi_setup_hwirq
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x21, x1
	mov	x19, x0
	ldr	w0, [x0, #32]
	bl	_platform_get_irq
	cmp	w0, #0
	b.le	LBB0_3
; %bb.1:
	ldr	x23, [x19, #24]
	sxtw	x24, w21
	mov	w8, #40
	smaddl	x20, w21, w8, x23
	str	w21, [x20]
	mov	x22, x20
	str	w0, [x22, #4]!
	ldp	x9, x8, [x19, #8]
	ldr	x10, [x9, #8]
	lsl	w11, w21, #2
	add	x8, x8, w11, sxtw
	add	x8, x8, x10
	stp	x8, x19, [x20, #24]
	ldr	w8, [x9]
Lloh0:
	adrp	x9, _MSI_LS1043V1_1_IRQS_PER_MSIR@GOTPAGE
Lloh1:
	ldr	x9, [x9, _MSI_LS1043V1_1_IRQS_PER_MSIR@GOTPAGEOFF]
	ldr	w10, [x9]
	cmp	w8, w10
	b.ne	LBB0_4
; %bb.2:
	mvn	w10, w21
	mul	w8, w8, w10
	add	w10, w8, #32
	mov	w11, #40
	madd	x11, x24, x11, x23
	str	w10, [x11, #8]
	ldr	w9, [x9]
	add	w8, w8, w9
	add	w8, w8, #31
	b	LBB0_5
LBB0_3:
Lloh2:
	adrp	x8, _ENODEV@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_13
LBB0_4:
	mov	w9, #40
	madd	x9, x24, x9, x23
	str	wzr, [x9, #8]
	sub	w8, w8, #1
LBB0_5:
	mov	w9, #40
	madd	x9, x24, x9, x23
	str	w8, [x9, #12]
Lloh5:
	adrp	x8, _ls_scfg_msi_irq_handler@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ls_scfg_msi_irq_handler@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x2, x20
	bl	_irq_set_chained_handler_and_data
Lloh8:
	adrp	x25, _msi_affinity_flag@GOTPAGE
Lloh9:
	ldr	x25, [x25, _msi_affinity_flag@GOTPAGEOFF]
	ldr	x8, [x25]
	cbz	x8, LBB0_8
; %bb.6:
	ldr	w22, [x22]
	mov	x0, x21
	bl	_get_cpu_mask
	mov	x1, x0
	mov	x0, x22
	bl	_irq_set_affinity
	mov	w8, #40
	madd	x8, x24, x8, x23
	str	wzr, [x8, #16]
	ldr	x8, [x25]
	cbz	x8, LBB0_9
; %bb.7:
	ldr	w8, [x20]
	cbnz	w8, LBB0_12
	b	LBB0_9
LBB0_8:
	mov	w8, #40
	madd	x8, x24, x8, x23
	str	w21, [x8, #16]
LBB0_9:
	ldr	x8, [x19, #8]
	ldr	w9, [x8]
	cmp	w9, #1
	b.lt	LBB0_12
; %bb.10:
	mov	w21, #0
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x8, #4]
	lsl	w8, w21, w8
	ldr	w9, [x20]
	orr	w1, w8, w9
	ldr	w0, [x19]
	mov	w2, #1
	bl	_bitmap_clear
	add	w21, w21, #1
	ldr	x8, [x19, #8]
	ldr	w9, [x8]
	cmp	w21, w9
	b.lt	LBB0_11
LBB0_12:
	mov	w0, #0
LBB0_13:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_MSI_LS1043V1_1_IRQS_PER_MSIR,4,2 ; @MSI_LS1043V1_1_IRQS_PER_MSIR
	.comm	_ls_scfg_msi_irq_handler,4,2    ; @ls_scfg_msi_irq_handler
	.comm	_msi_affinity_flag,8,3          ; @msi_affinity_flag
	.no_dead_strip	_ls_scfg_msi_setup_hwirq
.subsections_via_symbols
