	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function intel_irq_remapping_alloc
_intel_irq_remapping_alloc:             ## @intel_irq_remapping_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
	subq	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testq	%rcx, %rcx
	je	LBB0_2
## %bb.1:
	movq	%rdi, %r12
	movq	(%rdi), %r13
	testq	%r13, %r13
	je	LBB0_2
## %bb.3:
	movq	%rcx, %r14
	movl	%edx, %ebx
	movl	%esi, %r15d
	movq	(%rcx), %rax
	movq	_X86_IRQ_ALLOC_TYPE_MSI@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpl	$2, %edx
	jb	LBB0_6
## %bb.4:
	cmpq	%rcx, %rax
	je	LBB0_6
## %bb.5:
	movq	_X86_IRQ_ALLOC_TYPE_MSIX@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rax
	je	LBB0_6
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_26
LBB0_6:
	cmpq	%rcx, %rax
	jne	LBB0_8
## %bb.7:
	movq	_X86_IRQ_ALLOC_CONTIGUOUS_VECTORS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%eax, 8(%r14)
LBB0_8:
	movq	%r12, %rdi
	movl	%r15d, %esi
	movl	%ebx, %edx
	movq	%r14, %rcx
	callq	_irq_domain_alloc_irqs_parent
	testl	%eax, %eax
	js	LBB0_26
## %bb.9:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	subl	(%rax), %ecx
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$4, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_10
## %bb.11:
	movq	%r14, -88(%rbp)                 ## 8-byte Spill
	movq	_dmar_global_lock@GOTPCREL(%rip), %rdi
	movq	%rax, %r14
	callq	_down_read
	movq	%r13, %rdi
	movq	%r14, %rsi
	movl	%ebx, %edx
	callq	_alloc_irte
	movl	%eax, %r13d
	movq	_dmar_global_lock@GOTPCREL(%rip), %rdi
	callq	_up_read
	movl	%r13d, -48(%rbp)                ## 4-byte Spill
	testl	%r13d, %r13d
	js	LBB0_14
## %bb.12:
	testl	%ebx, %ebx
	je	LBB0_13
## %bb.15:
	movq	%r14, -80(%rbp)                 ## 8-byte Spill
	movl	-48(%rbp), %eax                 ## 4-byte Reload
                                        ## kill: def $eax killed $eax def $rax
	shll	$16, %eax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	xorl	%r13d, %r13d
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	jmp	LBB0_16
	.p2align	4, 0x90
LBB0_25:                                ##   in Loop: Header=BB0_16 Depth=1
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	addl	%r13d, %ecx
	movl	%ecx, (%r15)
	movq	%rax, 16(%r15)
	movq	_intel_ir_chip@GOTPCREL(%rip), %rcx
	movq	%rcx, 8(%r15)
	movq	%rax, %rdi
	movq	%r12, %rsi
	movq	-88(%rbp), %rdx                 ## 8-byte Reload
	movl	-48(%rbp), %ecx                 ## 4-byte Reload
	movl	%r13d, %r8d
	callq	_intel_irq_remapping_prepare_irte
	movq	_IRQ_MOVE_PCNTXT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r14d, %edi
	callq	_irq_set_status_flags
	incl	%r13d
	xorl	%eax, %eax
	cmpl	%r13d, %ebx
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	je	LBB0_26
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	leal	(%r15,%r13), %r14d
	movq	%r12, %rdi
	movl	%r14d, %esi
	callq	_irq_domain_get_irq_data
	movq	%rax, %r15
	movq	%rax, %rdi
	callq	_irqd_cfg
	testq	%r15, %r15
	je	LBB0_18
## %bb.17:                              ##   in Loop: Header=BB0_16 Depth=1
	movq	%rax, %r12
	testq	%rax, %rax
	je	LBB0_18
## %bb.21:                              ##   in Loop: Header=BB0_16 Depth=1
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	testl	%r13d, %r13d
	je	LBB0_25
## %bb.22:                              ##   in Loop: Header=BB0_16 Depth=1
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$4, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_23
## %bb.24:                              ##   in Loop: Header=BB0_16 Depth=1
	movl	%r13d, (%rax)
	jmp	LBB0_25
LBB0_10:
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	jmp	LBB0_20
LBB0_14:
	leaq	L_.str(%rip), %rdi
	callq	_pr_warn
	movq	%r14, %rdi
	callq	_kfree
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	jmp	LBB0_20
LBB0_13:
	xorl	%eax, %eax
	jmp	LBB0_26
LBB0_18:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_19
LBB0_23:
	movl	-44(%rbp), %r14d                ## 4-byte Reload
LBB0_19:
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	movq	%r12, %rdi
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	movl	%r15d, %esi
	movl	%r13d, %edx
	callq	_intel_free_irq_resources
LBB0_20:
	movq	%r12, %rdi
	movl	%r15d, %esi
	movl	%ebx, %edx
	callq	_irq_domain_free_irqs_common
	movl	%r14d, %eax
LBB0_26:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_X86_IRQ_ALLOC_TYPE_MSI,8,3     ## @X86_IRQ_ALLOC_TYPE_MSI
	.comm	_X86_IRQ_ALLOC_TYPE_MSIX,8,3    ## @X86_IRQ_ALLOC_TYPE_MSIX
	.comm	_X86_IRQ_ALLOC_CONTIGUOUS_VECTORS,4,2 ## @X86_IRQ_ALLOC_CONTIGUOUS_VECTORS
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_dmar_global_lock,4,2           ## @dmar_global_lock
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to allocate IRTE\n"

	.comm	_intel_ir_chip,4,2              ## @intel_ir_chip
	.comm	_IRQ_MOVE_PCNTXT,4,2            ## @IRQ_MOVE_PCNTXT
	.no_dead_strip	_intel_irq_remapping_alloc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function intel_irq_remapping_alloc
_intel_irq_remapping_alloc:             ; @intel_irq_remapping_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
	cbz	x3, LBB0_17
; %bb.1:
	mov	x21, x0
	ldr	x24, [x0]
	cbz	x24, LBB0_17
; %bb.2:
	mov	x22, x3
	mov	x19, x2
	mov	x20, x1
	ldr	x8, [x3]
Lloh0:
	adrp	x9, _X86_IRQ_ALLOC_TYPE_MSI@GOTPAGE
Lloh1:
	ldr	x9, [x9, _X86_IRQ_ALLOC_TYPE_MSI@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	w2, #2
	b.lo	LBB0_4
; %bb.3:
Lloh3:
	adrp	x10, _X86_IRQ_ALLOC_TYPE_MSIX@GOTPAGE
Lloh4:
	ldr	x10, [x10, _X86_IRQ_ALLOC_TYPE_MSIX@GOTPAGEOFF]
Lloh5:
	ldr	x10, [x10]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	b.ne	LBB0_17
LBB0_4:
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.5:
Lloh6:
	adrp	x8, _X86_IRQ_ALLOC_CONTIGUOUS_VECTORS@GOTPAGE
Lloh7:
	ldr	x8, [x8, _X86_IRQ_ALLOC_CONTIGUOUS_VECTORS@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	ldr	w9, [x22, #8]
	bic	w8, w9, w8
	str	w8, [x22, #8]
LBB0_6:
	mov	x0, x21
	mov	x1, x20
	mov	x2, x19
	mov	x3, x22
	bl	_irq_domain_alloc_irqs_parent
	tbnz	w0, #31, LBB0_24
; %bb.7:
Lloh9:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w27, w8
Lloh12:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	w0, #4
	bl	_kzalloc
	cbz	x0, LBB0_23
; %bb.8:
	mov	x23, x0
Lloh15:
	adrp	x26, _dmar_global_lock@GOTPAGE
Lloh16:
	ldr	x26, [x26, _dmar_global_lock@GOTPAGEOFF]
	mov	x0, x26
	bl	_down_read
	mov	x0, x24
	mov	x1, x23
	mov	x2, x19
	bl	_alloc_irte
	mov	x25, x0
	mov	x0, x26
	bl	_up_read
	tbnz	w25, #31, LBB0_18
; %bb.9:
	cbz	w19, LBB0_19
; %bb.10:
	mov	w24, #0
	lsl	w8, w25, #16
	stp	w27, w8, [sp, #8]               ; 8-byte Folded Spill
	b	LBB0_12
LBB0_11:                                ;   in Loop: Header=BB0_12 Depth=1
	ldr	w8, [sp, #12]                   ; 4-byte Folded Reload
	add	w8, w8, w24
	str	w8, [x27]
	str	x0, [x27, #16]
Lloh17:
	adrp	x8, _intel_ir_chip@GOTPAGE
Lloh18:
	ldr	x8, [x8, _intel_ir_chip@GOTPAGEOFF]
	str	x8, [x27, #8]
	mov	x1, x28
	mov	x2, x22
	mov	x3, x25
	mov	x4, x24
	bl	_intel_irq_remapping_prepare_irte
Lloh19:
	adrp	x8, _IRQ_MOVE_PCNTXT@GOTPAGE
Lloh20:
	ldr	x8, [x8, _IRQ_MOVE_PCNTXT@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
	mov	x0, x26
	bl	_irq_set_status_flags
	mov	w0, #0
	add	w24, w24, #1
	cmp	w19, w24
	b.eq	LBB0_24
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	add	w26, w20, w24
	mov	x0, x21
	mov	x1, x26
	bl	_irq_domain_get_irq_data
	mov	x27, x0
	bl	_irqd_cfg
	cbz	x27, LBB0_20
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=1
	mov	x28, x0
	cbz	x0, LBB0_20
; %bb.14:                               ;   in Loop: Header=BB0_12 Depth=1
	mov	x0, x23
	cbz	w24, LBB0_11
; %bb.15:                               ;   in Loop: Header=BB0_12 Depth=1
Lloh22:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh23:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
	mov	w0, #4
	bl	_kzalloc
	cbz	x0, LBB0_21
; %bb.16:                               ;   in Loop: Header=BB0_12 Depth=1
	str	w24, [x0]
	b	LBB0_11
LBB0_17:
Lloh25:
	adrp	x8, _EINVAL@GOTPAGE
Lloh26:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_24
LBB0_18:
Lloh28:
	adrp	x0, l_.str@PAGE
Lloh29:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_warn
	mov	x0, x23
	bl	_kfree
	b	LBB0_23
LBB0_19:
	mov	w0, #0
	b	LBB0_24
LBB0_20:
Lloh30:
	adrp	x8, _EINVAL@GOTPAGE
Lloh31:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh32:
	ldr	w8, [x8]
	neg	w27, w8
	b	LBB0_22
LBB0_21:
	ldr	w27, [sp, #8]                   ; 4-byte Folded Reload
LBB0_22:
	mov	x0, x21
	mov	x1, x20
	mov	x2, x24
	bl	_intel_free_irq_resources
LBB0_23:
	mov	x0, x21
	mov	x1, x20
	mov	x2, x19
	bl	_irq_domain_free_irqs_common
	mov	x0, x27
LBB0_24:
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_X86_IRQ_ALLOC_TYPE_MSI,8,3     ; @X86_IRQ_ALLOC_TYPE_MSI
	.comm	_X86_IRQ_ALLOC_TYPE_MSIX,8,3    ; @X86_IRQ_ALLOC_TYPE_MSIX
	.comm	_X86_IRQ_ALLOC_CONTIGUOUS_VECTORS,4,2 ; @X86_IRQ_ALLOC_CONTIGUOUS_VECTORS
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_dmar_global_lock,4,2           ; @dmar_global_lock
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to allocate IRTE\n"

	.comm	_intel_ir_chip,4,2              ; @intel_ir_chip
	.comm	_IRQ_MOVE_PCNTXT,4,2            ; @IRQ_MOVE_PCNTXT
	.no_dead_strip	_intel_irq_remapping_alloc
.subsections_via_symbols
