	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_kvm_set_irq_routing            ## -- Begin function kvm_set_irq_routing
	.p2align	4, 0x90
_kvm_set_irq_routing:                   ## @kvm_set_irq_routing
	.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
	movl	%edx, %ebx
	movq	%rsi, %r13
	testl	%edx, %edx
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	je	LBB0_5
## %bb.1:
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movl	%ebx, %r14d
	shlq	$4, %r14
	xorl	%ebx, %ebx
	movq	_KVM_MAX_IRQ_ROUTES@GOTPCREL(%rip), %r12
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r13,%rbx), %rsi
	cmpq	(%r12), %rsi
	jge	LBB0_22
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	%r15d, %edi
	callq	_max
	movl	%eax, %r15d
	addq	$16, %rbx
	cmpq	%rbx, %r14
	jne	LBB0_2
## %bb.4:
	incl	%r15d
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	jmp	LBB0_6
LBB0_5:
	movl	$1, %r15d
LBB0_6:
	leal	(%r15,%rbx), %eax
	leal	32(,%rax,4), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_23
## %bb.7:
	movq	%rax, %rdi
	movl	%r15d, %eax
	shlq	$2, %rax
	addq	24(%rdi), %rax
	movq	%rax, 16(%rdi)
	movl	%r15d, (%rdi)
	movq	_KVM_IOAPIC_NUM_PINS@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	je	LBB0_16
## %bb.8:
	movq	8(%rdi), %rcx
	movq	(%rcx), %rcx
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movl	$-1, (%rcx,%rdx,4)
	incq	%rdx
	movl	(%rax), %esi
	cmpq	%rsi, %rdx
	jb	LBB0_9
## %bb.10:
	testl	%esi, %esi
	je	LBB0_16
## %bb.11:
	movq	8(%rdi), %rcx
	movq	8(%rcx), %rcx
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movl	$-1, (%rcx,%rdx,4)
	incq	%rdx
	movl	(%rax), %esi
	cmpq	%rsi, %rdx
	jb	LBB0_12
## %bb.13:
	testl	%esi, %esi
	je	LBB0_16
## %bb.14:
	movq	8(%rdi), %rcx
	movq	16(%rcx), %rcx
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	movl	$-1, (%rcx,%rdx,4)
	incq	%rdx
	movl	(%rax), %esi
	cmpq	%rsi, %rdx
	jb	LBB0_15
LBB0_16:
	testl	%ebx, %ebx
	je	LBB0_21
## %bb.17:
	movl	%ebx, %eax
	shlq	$2, %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	xorl	%r15d, %r15d
	movq	%r13, %rbx
	.p2align	4, 0x90
LBB0_18:                                ## =>This Inner Loop Header: Depth=1
	cmpq	$0, 8(%r13,%r15,4)
	jne	LBB0_25
## %bb.19:                              ##   in Loop: Header=BB0_18 Depth=1
	movq	16(%rdi), %rsi
	addq	%r15, %rsi
	movq	%rdi, %r14
	movq	%rbx, %rdx
	callq	_setup_routing_entry
	testl	%eax, %eax
	jne	LBB0_26
## %bb.20:                              ##   in Loop: Header=BB0_18 Depth=1
	addq	$16, %rbx
	addq	$4, %r15
	cmpq	%r15, -48(%rbp)                 ## 8-byte Folded Reload
	movq	%r14, %rdi
	jne	LBB0_18
LBB0_21:
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	%rdi, %r15
	movq	%rbx, %rdi
	callq	_mutex_lock
	movq	8(%rbx), %r14
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_kvm_irq_routing_update
	movq	%rbx, %rdi
	callq	_mutex_unlock
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	callq	_synchronize_rcu
	jmp	LBB0_27
LBB0_22:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_24
LBB0_23:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_24:
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	jmp	LBB0_29
LBB0_25:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	jmp	LBB0_28
LBB0_26:
	movl	%eax, %r12d
LBB0_27:
	movq	%r14, %rdi
LBB0_28:
	callq	_kfree
LBB0_29:
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_KVM_MAX_IRQ_ROUTES,8,3         ## @KVM_MAX_IRQ_ROUTES
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_KVM_IOAPIC_NUM_PINS,4,2        ## @KVM_IOAPIC_NUM_PINS
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_kvm_set_irq_routing            ; -- Begin function kvm_set_irq_routing
	.p2align	2
_kvm_set_irq_routing:                   ; @kvm_set_irq_routing
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x22, x2
	mov	x20, x1
	mov	x19, x0
	cbz	w2, LBB0_5
; %bb.1:
	mov	w0, #0
Lloh0:
	adrp	x21, _KVM_MAX_IRQ_ROUTES@GOTPAGE
Lloh1:
	ldr	x21, [x21, _KVM_MAX_IRQ_ROUTES@GOTPAGEOFF]
	mov	x23, x20
	mov	w24, w22
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x1, [x23]
	ldr	x8, [x21]
	cmp	x1, x8
	b.ge	LBB0_22
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	bl	_max
	add	x23, x23, #16
	subs	x24, x24, #1
	b.ne	LBB0_2
; %bb.4:
	add	w23, w0, #1
	b	LBB0_6
LBB0_5:
	mov	w23, #1
LBB0_6:
	add	w8, w23, w22
	lsl	w8, w8, #2
	add	w0, w8, #32
Lloh2:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	bl	_kzalloc
	cbz	x0, LBB0_23
; %bb.7:
	mov	x21, x0
	ldr	x8, [x0, #24]
	add	x8, x8, w23, uxtw #2
	str	x8, [x0, #16]
	str	w23, [x0]
Lloh5:
	adrp	x8, _KVM_IOAPIC_NUM_PINS@GOTPAGE
Lloh6:
	ldr	x8, [x8, _KVM_IOAPIC_NUM_PINS@GOTPAGEOFF]
	ldr	w9, [x8]
	cbz	w9, LBB0_16
; %bb.8:
	mov	x9, #0
	ldr	x10, [x21, #8]
	ldr	x10, [x10]
	mov	w11, #-1
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	str	w11, [x10, x9, lsl #2]
	add	x9, x9, #1
	ldr	w12, [x8]
	cmp	x9, x12
	b.lo	LBB0_9
; %bb.10:
	cbz	w12, LBB0_16
; %bb.11:
	mov	x9, #0
	ldr	x10, [x21, #8]
	ldr	x10, [x10, #8]
	mov	w11, #-1
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	str	w11, [x10, x9, lsl #2]
	add	x9, x9, #1
	ldr	w12, [x8]
	cmp	x9, x12
	b.lo	LBB0_12
; %bb.13:
	cbz	w12, LBB0_16
; %bb.14:
	mov	x9, #0
	ldr	x10, [x21, #8]
	ldr	x10, [x10, #16]
	mov	w11, #-1
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	str	w11, [x10, x9, lsl #2]
	add	x9, x9, #1
	ldr	w12, [x8]
	cmp	x9, x12
	b.lo	LBB0_15
LBB0_16:
	cbz	w22, LBB0_21
; %bb.17:
	mov	x23, #0
	mov	w8, w22
	lsl	x24, x8, #2
LBB0_18:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20, #8]
	cbnz	x8, LBB0_25
; %bb.19:                               ;   in Loop: Header=BB0_18 Depth=1
	ldr	x8, [x21, #16]
	add	x1, x8, x23
	mov	x0, x21
	mov	x2, x20
	bl	_setup_routing_entry
	cbnz	w0, LBB0_26
; %bb.20:                               ;   in Loop: Header=BB0_18 Depth=1
	add	x20, x20, #16
	add	x23, x23, #4
	cmp	x24, x23
	b.ne	LBB0_18
LBB0_21:
	mov	x0, x19
	bl	_mutex_lock
	ldr	x20, [x19, #8]
	mov	x0, x19
	mov	x1, x21
	bl	_kvm_irq_routing_update
	mov	x0, x19
	bl	_mutex_unlock
	bl	_synchronize_rcu
	mov	w22, #0
	mov	x21, x20
	b	LBB0_27
LBB0_22:
Lloh7:
	adrp	x8, _EINVAL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_24
LBB0_23:
Lloh9:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_24:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_28
LBB0_25:
Lloh11:
	adrp	x8, _EINVAL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_27
LBB0_26:
	mov	x22, x0
LBB0_27:
	mov	x0, x21
	bl	_kfree
LBB0_28:
	mov	x0, x22
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_KVM_MAX_IRQ_ROUTES,8,3         ; @KVM_MAX_IRQ_ROUTES
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_KVM_IOAPIC_NUM_PINS,4,2        ; @KVM_IOAPIC_NUM_PINS
.subsections_via_symbols
