	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tegra_msi_setup_irq
_tegra_msi_setup_irq:                   ## @tegra_msi_setup_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
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r15
	callq	_to_tegra_msi
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_tegra_msi_alloc
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_4
## %bb.1:
	movl	4(%r14), %edi
	movl	%ebx, %esi
	callq	_irq_create_mapping
	testl	%eax, %eax
	je	LBB0_2
## %bb.3:
	movl	%eax, %r12d
	movl	%eax, %edi
	movq	%r15, %rsi
	callq	_irq_set_msi_desc
	movl	(%r14), %edi
	callq	_lower_32_bits
	movl	%eax, -40(%rbp)
	movl	(%r14), %edi
	callq	_upper_32_bits
	movl	%eax, -44(%rbp)
	movl	%ebx, -48(%rbp)
	leaq	-48(%rbp), %rsi
	movl	%r12d, %edi
	callq	_pci_write_msi_msg
	xorl	%ebx, %ebx
	jmp	LBB0_4
LBB0_2:
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_tegra_msi_free
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_4:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_tegra_msi_setup_irq
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tegra_msi_setup_irq
_tegra_msi_setup_irq:                   ; @tegra_msi_setup_irq
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x21, x2
	bl	_to_tegra_msi
	mov	x20, x0
	bl	_tegra_msi_alloc
	mov	x19, x0
	tbnz	w0, #31, LBB0_4
; %bb.1:
	ldr	w0, [x20, #4]
	mov	x1, x19
	bl	_irq_create_mapping
	cbz	w0, LBB0_3
; %bb.2:
	mov	x22, x0
	mov	x1, x21
	bl	_irq_set_msi_desc
	ldr	w0, [x20]
	bl	_lower_32_bits
	str	w0, [sp, #8]
	ldr	w0, [x20]
	bl	_upper_32_bits
	stp	w19, w0, [sp]
	mov	x1, sp
	mov	x0, x22
	bl	_pci_write_msi_msg
	mov	w19, #0
	b	LBB0_4
LBB0_3:
	mov	x0, x20
	mov	x1, x19
	bl	_tegra_msi_free
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w19, w8
LBB0_4:
	mov	x0, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_tegra_msi_setup_irq
.subsections_via_symbols
