	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_xen_register_pirq              ## -- Begin function xen_register_pirq
	.p2align	4, 0x90
_xen_register_pirq:                     ## @xen_register_pirq
	.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
	testl	%edi, %edi
	je	LBB0_1
## %bb.2:
	movl	%edx, %r15d
	movl	%esi, %r14d
	movl	%edi, %r13d
	movq	_bootverbose@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_4
## %bb.3:
	leaq	L_.str(%rip), %rdi
	movl	%r13d, %esi
	callq	_printf
LBB0_4:
	movq	_DOMID_SELF@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)
	movq	_MAP_PIRQ_TYPE_GSI@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)
	movl	%r13d, -56(%rbp)
	movl	%r13d, -52(%rbp)
	movq	_PHYSDEVOP_map_pirq@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	-56(%rbp), %rsi
	callq	_HYPERVISOR_physdev_op
	testl	%eax, %eax
	je	LBB0_6
## %bb.5:
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rdi
	movl	%r13d, %esi
	callq	_printf
	jmp	LBB0_7
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_7
LBB0_6:
	movq	_xen_intr_isrc_lock@GOTPCREL(%rip), %rbx
	movq	%rbx, %rdi
	callq	_mtx_lock
	movq	_EVTCHN_TYPE_PIRQ@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%r13d, %esi
	callq	_xen_intr_alloc_isrc
	movq	%rax, %r12
	movq	%rbx, %rdi
	callq	_mtx_unlock
	xorl	%edi, %edi
	testq	%r12, %r12
	setne	%dil
	leaq	L_.str.2(%rip), %rsi
	callq	_KASSERT
	movl	%r13d, (%r12)
	movq	_INTR_POLARITY_HIGH@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	cmpl	%r15d, (%rax)
	sete	%cl
	movl	%ecx, 4(%r12)
	movq	_INTR_TRIGGER_EDGE@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	cmpl	%r14d, (%rax)
	sete	%cl
	movl	%ecx, 8(%r12)
	xorl	%ebx, %ebx
LBB0_7:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_bootverbose,8,3                ## @bootverbose
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"xen: register IRQ#%d\n"

	.comm	_DOMID_SELF,4,2                 ## @DOMID_SELF
	.comm	_MAP_PIRQ_TYPE_GSI,4,2          ## @MAP_PIRQ_TYPE_GSI
	.comm	_PHYSDEVOP_map_pirq,4,2         ## @PHYSDEVOP_map_pirq
L_.str.1:                               ## @.str.1
	.asciz	"xen: unable to map IRQ#%d\n"

	.comm	_xen_intr_isrc_lock,4,2         ## @xen_intr_isrc_lock
	.comm	_EVTCHN_TYPE_PIRQ,4,2           ## @EVTCHN_TYPE_PIRQ
L_.str.2:                               ## @.str.2
	.asciz	"xen: unable to allocate isrc for interrupt"

	.comm	_INTR_POLARITY_HIGH,4,2         ## @INTR_POLARITY_HIGH
	.comm	_INTR_TRIGGER_EDGE,4,2          ## @INTR_TRIGGER_EDGE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_xen_register_pirq              ; -- Begin function xen_register_pirq
	.p2align	2
_xen_register_pirq:                     ; @xen_register_pirq
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	cbz	w0, LBB0_5
; %bb.1:
	mov	x21, x2
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _bootverbose@GOTPAGE
Lloh1:
	ldr	x8, [x8, _bootverbose@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cbz	x8, LBB0_3
; %bb.2:
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x20
	bl	_printf
LBB0_3:
Lloh5:
	adrp	x8, _DOMID_SELF@GOTPAGE
Lloh6:
	ldr	x8, [x8, _DOMID_SELF@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
Lloh8:
	adrp	x9, _MAP_PIRQ_TYPE_GSI@GOTPAGE
Lloh9:
	ldr	x9, [x9, _MAP_PIRQ_TYPE_GSI@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	stp	w9, w8, [sp, #8]
	stp	w20, w20, [sp]
Lloh11:
	adrp	x8, _PHYSDEVOP_map_pirq@GOTPAGE
Lloh12:
	ldr	x8, [x8, _PHYSDEVOP_map_pirq@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
	mov	x1, sp
	bl	_HYPERVISOR_physdev_op
	cbz	w0, LBB0_6
; %bb.4:
	mov	x22, x0
Lloh14:
	adrp	x0, l_.str.1@PAGE
Lloh15:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x20
	bl	_printf
	b	LBB0_7
LBB0_5:
Lloh16:
	adrp	x8, _EINVAL@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh18:
	ldr	w22, [x8]
	b	LBB0_7
LBB0_6:
Lloh19:
	adrp	x22, _xen_intr_isrc_lock@GOTPAGE
Lloh20:
	ldr	x22, [x22, _xen_intr_isrc_lock@GOTPAGEOFF]
	mov	x0, x22
	bl	_mtx_lock
Lloh21:
	adrp	x8, _EVTCHN_TYPE_PIRQ@GOTPAGE
Lloh22:
	ldr	x8, [x8, _EVTCHN_TYPE_PIRQ@GOTPAGEOFF]
Lloh23:
	ldr	w0, [x8]
	mov	x1, x20
	bl	_xen_intr_alloc_isrc
	mov	x23, x0
	mov	x0, x22
	bl	_mtx_unlock
	cmp	x23, #0
	cset	w0, ne
Lloh24:
	adrp	x1, l_.str.2@PAGE
Lloh25:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_KASSERT
	mov	w22, #0
	str	w20, [x23]
Lloh26:
	adrp	x8, _INTR_POLARITY_HIGH@GOTPAGE
Lloh27:
	ldr	x8, [x8, _INTR_POLARITY_HIGH@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	cmp	w8, w21
Lloh29:
	adrp	x8, _INTR_TRIGGER_EDGE@GOTPAGE
Lloh30:
	ldr	x8, [x8, _INTR_TRIGGER_EDGE@GOTPAGEOFF]
	cset	w9, eq
Lloh31:
	ldr	w8, [x8]
	cmp	w8, w19
	cset	w8, eq
	stp	w9, w8, [x23, #4]
LBB0_7:
	mov	x0, x22
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_bootverbose,8,3                ; @bootverbose
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"xen: register IRQ#%d\n"

	.comm	_DOMID_SELF,4,2                 ; @DOMID_SELF
	.comm	_MAP_PIRQ_TYPE_GSI,4,2          ; @MAP_PIRQ_TYPE_GSI
	.comm	_PHYSDEVOP_map_pirq,4,2         ; @PHYSDEVOP_map_pirq
l_.str.1:                               ; @.str.1
	.asciz	"xen: unable to map IRQ#%d\n"

	.comm	_xen_intr_isrc_lock,4,2         ; @xen_intr_isrc_lock
	.comm	_EVTCHN_TYPE_PIRQ,4,2           ; @EVTCHN_TYPE_PIRQ
l_.str.2:                               ; @.str.2
	.asciz	"xen: unable to allocate isrc for interrupt"

	.comm	_INTR_POLARITY_HIGH,4,2         ; @INTR_POLARITY_HIGH
	.comm	_INTR_TRIGGER_EDGE,4,2          ; @INTR_TRIGGER_EDGE
.subsections_via_symbols
