	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function xen_intr_bind_isrc
_xen_intr_bind_isrc:                    ## @xen_intr_bind_isrc
	.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
	movq	$0, (%rdi)
	cmpq	$0, 32(%rbp)
	je	LBB0_6
## %bb.1:
	movq	%r8, %r12
	movl	%edx, %r15d
	movq	%rsi, %r14
	movq	%rdi, %r13
	movq	%r9, -56(%rbp)                  ## 8-byte Spill
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	movq	_xen_intr_isrc_lock@GOTPCREL(%rip), %rdi
	callq	_mtx_lock
	movl	%r15d, %edi
	callq	_xen_intr_find_unused_isrc
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_3
## %bb.2:
	movq	_XEN_ALLOCATE_VECTOR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r15d, %edi
	callq	_xen_intr_alloc_isrc
	movq	%rax, %rbx
	testq	%rax, %rax
	je	LBB0_8
LBB0_3:
	movq	%r14, (%rbx)
	movq	_xen_intr_port_to_isrc@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rbx, (%rax,%r14,8)
	leaq	16(%rbx), %rdi
	movl	$1, %esi
	callq	_refcount_init
	movq	_xen_intr_isrc_lock@GOTPCREL(%rip), %rdi
	callq	_mtx_unlock
	leaq	12(%rbx), %r9
	movq	32(%rbp), %rax
	movq	%r9, (%rax)
	movq	%r12, %rax
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	orq	%rdx, %rax
	je	LBB0_7
## %bb.4:
	movl	24(%rbp), %r8d
	movq	16(%rbp), %rcx
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%r12, %rsi
	callq	_xen_intr_add_handler
	testl	%eax, %eax
	je	LBB0_7
## %bb.5:
	movl	%eax, %r14d
	movq	%rbx, %rdi
	callq	_xen_intr_release_isrc
	jmp	LBB0_10
LBB0_6:
	leaq	L_.str(%rip), %rdi
	movq	%rcx, %rsi
	callq	_printf
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_7:
	movq	%rbx, (%r13)
	xorl	%r14d, %r14d
	jmp	LBB0_10
LBB0_8:
	movq	_xen_intr_isrc_lock@GOTPCREL(%rip), %rdi
	callq	_mtx_unlock
	movq	_ENOSPC@GOTPCREL(%rip), %rax
LBB0_9:
	movl	(%rax), %r14d
LBB0_10:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s: xen_intr_bind_isrc: Bad event handle\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_xen_intr_isrc_lock,4,2         ## @xen_intr_isrc_lock
	.comm	_XEN_ALLOCATE_VECTOR,4,2        ## @XEN_ALLOCATE_VECTOR
	.comm	_ENOSPC,4,2                     ## @ENOSPC
	.comm	_xen_intr_port_to_isrc,8,3      ## @xen_intr_port_to_isrc
	.comm	_EVTCHN_TYPE_PORT,4,2           ## @EVTCHN_TYPE_PORT
	.no_dead_strip	_xen_intr_bind_isrc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function xen_intr_bind_isrc
_xen_intr_bind_isrc:                    ; @xen_intr_bind_isrc
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	mov	x22, x3
	ldr	x28, [x29, #16]
	str	xzr, [x0]
	cbz	x28, LBB0_5
; %bb.1:
	mov	x20, x7
	mov	x21, x6
	mov	x23, x5
	mov	x24, x4
	mov	x27, x2
	mov	x26, x1
	mov	x19, x0
Lloh0:
	adrp	x0, _xen_intr_isrc_lock@GOTPAGE
Lloh1:
	ldr	x0, [x0, _xen_intr_isrc_lock@GOTPAGEOFF]
	bl	_mtx_lock
	mov	x0, x27
	bl	_xen_intr_find_unused_isrc
	mov	x25, x0
	cbnz	x0, LBB0_3
; %bb.2:
Lloh2:
	adrp	x8, _XEN_ALLOCATE_VECTOR@GOTPAGE
Lloh3:
	ldr	x8, [x8, _XEN_ALLOCATE_VECTOR@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	x0, x27
	bl	_xen_intr_alloc_isrc
	mov	x25, x0
	cbz	x0, LBB0_9
LBB0_3:
	mov	x27, x25
	str	x26, [x27], #12
Lloh5:
	adrp	x8, _xen_intr_port_to_isrc@GOTPAGE
Lloh6:
	ldr	x8, [x8, _xen_intr_port_to_isrc@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	str	x25, [x8, x26, lsl #3]
	add	x0, x25, #16
	mov	w1, #1
	bl	_refcount_init
Lloh8:
	adrp	x0, _xen_intr_isrc_lock@GOTPAGE
Lloh9:
	ldr	x0, [x0, _xen_intr_isrc_lock@GOTPAGEOFF]
	bl	_mtx_unlock
	str	x27, [x28]
	orr	x8, x24, x23
	cbnz	x8, LBB0_6
; %bb.4:
	mov	w20, #0
	b	LBB0_8
LBB0_5:
Lloh10:
	adrp	x0, l_.str@PAGE
Lloh11:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x22
	bl	_printf
Lloh12:
	adrp	x8, _EINVAL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_10
LBB0_6:
	mov	x0, x22
	mov	x1, x24
	mov	x2, x23
	mov	x3, x21
	mov	x4, x20
	mov	x5, x27
	bl	_xen_intr_add_handler
	mov	x20, x0
	cbz	w0, LBB0_8
; %bb.7:
	mov	x0, x25
	bl	_xen_intr_release_isrc
	b	LBB0_11
LBB0_8:
	str	x25, [x19]
	b	LBB0_11
LBB0_9:
Lloh14:
	adrp	x0, _xen_intr_isrc_lock@GOTPAGE
Lloh15:
	ldr	x0, [x0, _xen_intr_isrc_lock@GOTPAGEOFF]
	bl	_mtx_unlock
Lloh16:
	adrp	x8, _ENOSPC@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ENOSPC@GOTPAGEOFF]
LBB0_10:
	ldr	w20, [x8]
LBB0_11:
	mov	x0, x20
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s: xen_intr_bind_isrc: Bad event handle\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_xen_intr_isrc_lock,4,2         ; @xen_intr_isrc_lock
	.comm	_XEN_ALLOCATE_VECTOR,4,2        ; @XEN_ALLOCATE_VECTOR
	.comm	_ENOSPC,4,2                     ; @ENOSPC
	.comm	_xen_intr_port_to_isrc,8,3      ; @xen_intr_port_to_isrc
	.comm	_EVTCHN_TYPE_PORT,4,2           ; @EVTCHN_TYPE_PORT
	.no_dead_strip	_xen_intr_bind_isrc
.subsections_via_symbols
