	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function goya_enable_msix
_goya_enable_msix:                      ## @goya_enable_msix
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	32(%rdi), %r12
	movq	_HW_CAP_MSIX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	%ebx, %ebx
	testl	%eax, (%r12)
	jne	LBB0_14
## %bb.1:
	movq	%rdi, %r14
	movl	24(%rdi), %r13d
	movl	(%rdi), %edi
	movq	_GOYA_MSIX_ENTRIES@GOTPCREL(%rip), %r15
	movl	(%r15), %edx
	movq	_PCI_IRQ_MSIX@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	%edx, %esi
	callq	_pci_alloc_irq_vectors
	testl	%eax, %eax
	js	LBB0_4
## %bb.2:
	testl	%r13d, %r13d
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	jle	LBB0_3
## %bb.5:
	movq	%r13, %r15
	leaq	(,%r13,4), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	xorl	%ebx, %ebx
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r14), %edi
	movl	%r13d, %esi
	callq	_pci_irq_vector
	movl	%eax, %r12d
	movq	_hl_irq_handler_cq@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_goya_irq_name@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rax,%rbx), %ecx
	movq	8(%r14), %r8
	addq	%rbx, %r8
	movl	%r12d, %edi
	xorl	%edx, %edx
	callq	_request_irq
	testl	%eax, %eax
	jne	LBB0_10
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	incl	%r13d
	addq	$4, %rbx
	cmpq	%rbx, -48(%rbp)                 ## 8-byte Folded Reload
	jne	LBB0_6
## %bb.8:
	movl	%r15d, %r13d
	jmp	LBB0_9
LBB0_4:
	movl	%eax, %ebx
	movl	16(%r14), %edi
	movl	(%r15), %edx
	leaq	L_.str(%rip), %rsi
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_14
LBB0_3:
	xorl	%r13d, %r13d
LBB0_9:
	movl	(%r14), %edi
	movq	_GOYA_EVENT_QUEUE_MSIX_IDX@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	callq	_pci_irq_vector
	movl	%eax, %r12d
	movq	_hl_irq_handler_eq@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_goya_irq_name@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rbx), %rcx
	movl	(%rax,%rcx,4), %ecx
	leaq	20(%r14), %r8
	xorl	%ebx, %ebx
	movl	%r12d, %edi
	xorl	%edx, %edx
	callq	_request_irq
	testl	%eax, %eax
	je	LBB0_15
LBB0_10:
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movl	16(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %r15
	xorl	%r14d, %r14d
	movl	%r12d, %edx
	xorl	%eax, %eax
	callq	_dev_err
	testl	%r13d, %r13d
	je	LBB0_13
## %bb.11:
	movl	%r13d, %r12d
	shlq	$2, %r12
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %edi
	movl	%r14d, %esi
	callq	_pci_irq_vector
	movq	8(%r15), %rsi
	addq	%rbx, %rsi
	movl	%eax, %edi
	callq	_free_irq
	incl	%r14d
	addq	$4, %rbx
	cmpq	%rbx, %r12
	jne	LBB0_12
LBB0_13:
	movl	(%r15), %edi
	callq	_pci_free_irq_vectors
	movl	-48(%rbp), %ebx                 ## 4-byte Reload
	jmp	LBB0_14
LBB0_15:
	movq	_HW_CAP_MSIX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	orl	%eax, (%rcx)
LBB0_14:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HW_CAP_MSIX,4,2                ## @HW_CAP_MSIX
	.comm	_GOYA_MSIX_ENTRIES,4,2          ## @GOYA_MSIX_ENTRIES
	.comm	_PCI_IRQ_MSIX,4,2               ## @PCI_IRQ_MSIX
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"MSI-X: Failed to enable support -- %d/%d\n"

	.comm	_hl_irq_handler_cq,4,2          ## @hl_irq_handler_cq
	.comm	_goya_irq_name,8,3              ## @goya_irq_name
L_.str.1:                               ## @.str.1
	.asciz	"Failed to request IRQ %d"

	.comm	_GOYA_EVENT_QUEUE_MSIX_IDX,8,3  ## @GOYA_EVENT_QUEUE_MSIX_IDX
	.comm	_hl_irq_handler_eq,4,2          ## @hl_irq_handler_eq
	.no_dead_strip	_goya_enable_msix
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function goya_enable_msix
_goya_enable_msix:                      ; @goya_enable_msix
	.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
	ldr	x23, [x0, #32]
	ldr	w8, [x23]
Lloh0:
	adrp	x27, _HW_CAP_MSIX@GOTPAGE
Lloh1:
	ldr	x27, [x27, _HW_CAP_MSIX@GOTPAGEOFF]
	ldr	w9, [x27]
	tst	w9, w8
	b.eq	LBB0_2
; %bb.1:
	mov	w20, #0
	b	LBB0_17
LBB0_2:
	mov	x19, x0
	ldr	w26, [x0, #24]
	ldr	w0, [x0]
Lloh2:
	adrp	x21, _GOYA_MSIX_ENTRIES@GOTPAGE
Lloh3:
	ldr	x21, [x21, _GOYA_MSIX_ENTRIES@GOTPAGEOFF]
	ldr	w1, [x21]
Lloh4:
	adrp	x8, _PCI_IRQ_MSIX@GOTPAGE
Lloh5:
	ldr	x8, [x8, _PCI_IRQ_MSIX@GOTPAGEOFF]
Lloh6:
	ldr	w3, [x8]
	mov	x2, x1
	bl	_pci_alloc_irq_vectors
	tbnz	w0, #31, LBB0_8
; %bb.3:
Lloh7:
	adrp	x25, _goya_irq_name@GOTPAGE
Lloh8:
	ldr	x25, [x25, _goya_irq_name@GOTPAGEOFF]
	cmp	w26, #1
	b.lt	LBB0_9
; %bb.4:
	mov	x27, #0
	mov	w21, #0
	lsl	x28, x26, #2
Lloh9:
	adrp	x24, _hl_irq_handler_cq@GOTPAGE
Lloh10:
	ldr	x24, [x24, _hl_irq_handler_cq@GOTPAGEOFF]
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x19]
	mov	x1, x21
	bl	_pci_irq_vector
	mov	x22, x0
	ldr	w1, [x24]
	ldr	x8, [x25]
	ldr	w3, [x8, x27]
	ldr	x8, [x19, #8]
	add	x4, x8, x27
	mov	w2, #0
	bl	_request_irq
	cbnz	w0, LBB0_12
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	add	w21, w21, #1
	add	x27, x27, #4
	cmp	x28, x27
	b.ne	LBB0_5
; %bb.7:
	mov	x21, x26
Lloh11:
	adrp	x27, _HW_CAP_MSIX@GOTPAGE
Lloh12:
	ldr	x27, [x27, _HW_CAP_MSIX@GOTPAGEOFF]
	b	LBB0_10
LBB0_8:
	mov	x20, x0
	ldr	w0, [x19, #16]
	ldr	w2, [x21]
	str	x20, [sp]
Lloh13:
	adrp	x1, l_.str@PAGE
Lloh14:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	b	LBB0_17
LBB0_9:
	mov	w21, #0
LBB0_10:
	mov	x20, x19
	ldr	w0, [x20], #20
Lloh15:
	adrp	x24, _GOYA_EVENT_QUEUE_MSIX_IDX@GOTPAGE
Lloh16:
	ldr	x24, [x24, _GOYA_EVENT_QUEUE_MSIX_IDX@GOTPAGEOFF]
	ldr	w1, [x24]
	bl	_pci_irq_vector
	mov	x22, x0
Lloh17:
	adrp	x8, _hl_irq_handler_eq@GOTPAGE
Lloh18:
	ldr	x8, [x8, _hl_irq_handler_eq@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	ldr	x8, [x25]
	ldr	x9, [x24]
	ldr	w3, [x8, x9, lsl #2]
	mov	w2, #0
	mov	x4, x20
	bl	_request_irq
	mov	x20, x0
	cbnz	w0, LBB0_13
; %bb.11:
	ldr	w8, [x27]
	ldr	w9, [x23]
	orr	w8, w9, w8
	str	w8, [x23]
	b	LBB0_17
LBB0_12:
	mov	x20, x0
LBB0_13:
	ldr	w0, [x19, #16]
Lloh20:
	adrp	x1, l_.str.1@PAGE
Lloh21:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x22
	bl	_dev_err
	cbz	w21, LBB0_16
; %bb.14:
	mov	x23, #0
	mov	w22, #0
	mov	w8, w21
	lsl	x21, x8, #2
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x19]
	mov	x1, x22
	bl	_pci_irq_vector
	ldr	x8, [x19, #8]
	add	x1, x8, x23
	bl	_free_irq
	add	w22, w22, #1
	add	x23, x23, #4
	cmp	x21, x23
	b.ne	LBB0_15
LBB0_16:
	ldr	w0, [x19]
	bl	_pci_free_irq_vectors
LBB0_17:
	mov	x0, x20
	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
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpAdd	Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_HW_CAP_MSIX,4,2                ; @HW_CAP_MSIX
	.comm	_GOYA_MSIX_ENTRIES,4,2          ; @GOYA_MSIX_ENTRIES
	.comm	_PCI_IRQ_MSIX,4,2               ; @PCI_IRQ_MSIX
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"MSI-X: Failed to enable support -- %d/%d\n"

	.comm	_hl_irq_handler_cq,4,2          ; @hl_irq_handler_cq
	.comm	_goya_irq_name,8,3              ; @goya_irq_name
l_.str.1:                               ; @.str.1
	.asciz	"Failed to request IRQ %d"

	.comm	_GOYA_EVENT_QUEUE_MSIX_IDX,8,3  ; @GOYA_EVENT_QUEUE_MSIX_IDX
	.comm	_hl_irq_handler_eq,4,2          ; @hl_irq_handler_eq
	.no_dead_strip	_goya_enable_msix
.subsections_via_symbols
