	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pci_endpoint_test_set_irq
_pci_endpoint_test_set_irq:             ## @pci_endpoint_test_set_irq
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	_IRQ_TYPE_LEGACY@GOTPCREL(%rip), %rax
	cmpl	%esi, (%rax)
	jg	LBB0_2
## %bb.1:
	movl	%esi, %ebx
	movq	_IRQ_TYPE_MSIX@GOTPCREL(%rip), %rax
	cmpl	%esi, (%rax)
	jl	LBB0_2
## %bb.3:
	movq	_irq_type@GOTPCREL(%rip), %r12
	movl	$1, %r15d
	cmpl	%ebx, (%r12)
	je	LBB0_9
## %bb.4:
	movq	%r14, %rdi
	callq	_pci_endpoint_test_release_irq
	movq	%r14, %rdi
	callq	_pci_endpoint_test_free_irq_vectors
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_pci_endpoint_test_alloc_irq_vectors
	testl	%eax, %eax
	je	LBB0_7
## %bb.5:
	movq	%r14, %rdi
	callq	_pci_endpoint_test_request_irq
	testl	%eax, %eax
	je	LBB0_7
## %bb.6:
	movl	%ebx, (%r12)
	jmp	LBB0_9
LBB0_2:
	movq	(%r14), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	jmp	LBB0_8
LBB0_7:
	movq	%r14, %rdi
	callq	_pci_endpoint_test_free_irq_vectors
	movq	_IRQ_TYPE_UNDEFINED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r12)
LBB0_8:
	xorl	%r15d, %r15d
LBB0_9:
	movl	%r15d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IRQ_TYPE_LEGACY,4,2            ## @IRQ_TYPE_LEGACY
	.comm	_IRQ_TYPE_MSIX,4,2              ## @IRQ_TYPE_MSIX
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Invalid IRQ type option\n"

	.comm	_irq_type,4,2                   ## @irq_type
	.comm	_IRQ_TYPE_UNDEFINED,4,2         ## @IRQ_TYPE_UNDEFINED
	.no_dead_strip	_pci_endpoint_test_set_irq
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pci_endpoint_test_set_irq
_pci_endpoint_test_set_irq:             ; @pci_endpoint_test_set_irq
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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, _IRQ_TYPE_LEGACY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IRQ_TYPE_LEGACY@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _IRQ_TYPE_MSIX@GOTPAGE
Lloh4:
	ldr	x9, [x9, _IRQ_TYPE_MSIX@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	cmp	w8, w1
	ccmp	w9, w1, #8, le
	b.ge	LBB0_2
; %bb.1:
	ldr	x0, [x19]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	mov	w0, #0
	b	LBB0_8
LBB0_2:
	mov	x20, x1
Lloh8:
	adrp	x21, _irq_type@GOTPAGE
Lloh9:
	ldr	x21, [x21, _irq_type@GOTPAGEOFF]
	ldr	w8, [x21]
	cmp	w8, w1
	b.ne	LBB0_4
; %bb.3:
	mov	w0, #1
	b	LBB0_8
LBB0_4:
	mov	x0, x19
	bl	_pci_endpoint_test_release_irq
	mov	x0, x19
	bl	_pci_endpoint_test_free_irq_vectors
	mov	x0, x19
	mov	x1, x20
	bl	_pci_endpoint_test_alloc_irq_vectors
	cbz	w0, LBB0_7
; %bb.5:
	mov	x0, x19
	bl	_pci_endpoint_test_request_irq
	cbz	w0, LBB0_7
; %bb.6:
	str	w20, [x21]
	mov	w0, #1
	b	LBB0_8
LBB0_7:
	mov	x0, x19
	bl	_pci_endpoint_test_free_irq_vectors
	mov	w0, #0
Lloh10:
	adrp	x8, _IRQ_TYPE_UNDEFINED@GOTPAGE
Lloh11:
	ldr	x8, [x8, _IRQ_TYPE_UNDEFINED@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	str	w8, [x21]
LBB0_8:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_IRQ_TYPE_LEGACY,4,2            ; @IRQ_TYPE_LEGACY
	.comm	_IRQ_TYPE_MSIX,4,2              ; @IRQ_TYPE_MSIX
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Invalid IRQ type option\n"

	.comm	_irq_type,4,2                   ; @irq_type
	.comm	_IRQ_TYPE_UNDEFINED,4,2         ; @IRQ_TYPE_UNDEFINED
	.no_dead_strip	_pci_endpoint_test_set_irq
.subsections_via_symbols
