	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vioapic_set_pinstate
_vioapic_set_pinstate:                  ## @vioapic_set_pinstate
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r15d
	movl	%esi, %r12d
	movq	%rdi, %r14
	testl	%esi, %esi
	setns	%al
	movq	_REDIR_ENTRIES@GOTPCREL(%rip), %rcx
	cmpl	%esi, (%rcx)
	setg	%cl
	andb	%al, %cl
	movzbl	%cl, %edi
	movslq	%esi, %r13
	movq	%r13, %rsi
	callq	_KASSERT
	movq	%r14, %rdi
	callq	_VIOAPIC_LOCKED
	leaq	L_.str.1(%rip), %rsi
	movl	%eax, %edi
	callq	_KASSERT
	movq	(%r14), %rcx
	xorl	%ebx, %ebx
	cmpl	$1, %r15d
	sbbl	%ebx, %ebx
	movl	(%rcx,%r13,4), %eax
	orl	$1, %ebx
	addl	%eax, %ebx
	movl	%ebx, (%rcx,%r13,4)
	js	LBB0_1
## %bb.2:
	testl	%eax, %eax
	jne	LBB0_4
## %bb.3:
	cmpl	$1, %ebx
	jne	LBB0_4
## %bb.7:
	leaq	L_.str.3(%rip), %rsi
	movq	%r14, %rdi
	movl	%r12d, %edx
	callq	_VIOAPIC_CTR1
	movq	%r14, %rdi
	movl	%r12d, %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_vioapic_send_intr              ## TAILCALL
LBB0_1:
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdi
	movl	%r12d, %edx
	movl	%ebx, %ecx
	callq	_VIOAPIC_CTR2
	jmp	LBB0_6
LBB0_4:
	cmpl	$1, %eax
	jne	LBB0_6
## %bb.5:
	testl	%ebx, %ebx
	jne	LBB0_6
## %bb.8:
	leaq	L_.str.4(%rip), %rsi
	movq	%r14, %rdi
	movl	%r12d, %edx
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_VIOAPIC_CTR1                   ## TAILCALL
LBB0_6:
	movl	%r15d, %edi
	callq	_pinstate_str
	leaq	L_.str.5(%rip), %rsi
	movq	%r14, %rdi
	movl	%r12d, %edx
	movl	%eax, %ecx
	movl	%ebx, %r8d
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_VIOAPIC_CTR3                   ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_REDIR_ENTRIES,4,2              ## @REDIR_ENTRIES
	.section	__TEXT,__cstring,cstring_literals
L_.str.1:                               ## @.str.1
	.asciz	"vioapic_set_pinstate: vioapic is not locked"

L_.str.2:                               ## @.str.2
	.asciz	"ioapic pin%d: bad acnt %d"

L_.str.3:                               ## @.str.3
	.asciz	"ioapic pin%d: asserted"

L_.str.4:                               ## @.str.4
	.asciz	"ioapic pin%d: deasserted"

L_.str.5:                               ## @.str.5
	.asciz	"ioapic pin%d: %s, ignored, acnt %d"

	.no_dead_strip	_vioapic_set_pinstate
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vioapic_set_pinstate
_vioapic_set_pinstate:                  ; @vioapic_set_pinstate
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x1
	mov	x20, x0
	cmp	w1, #0
Lloh0:
	adrp	x8, _REDIR_ENTRIES@GOTPAGE
Lloh1:
	ldr	x8, [x8, _REDIR_ENTRIES@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ccmp	w8, w1, #4, ge
	cset	w0, gt
	sxtw	x1, w19
	bl	_KASSERT
	mov	x0, x20
	bl	_VIOAPIC_LOCKED
Lloh3:
	adrp	x1, l_.str.1@PAGE
Lloh4:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_KASSERT
	ldr	x9, [x20]
	sbfiz	x10, x19, #2, #32
	ldr	w8, [x9, x10]
	sub	w11, w8, #1
	cmp	w21, #0
	csinc	w22, w11, w8, eq
	str	w22, [x9, x10]
	tbnz	w22, #31, LBB0_4
; %bb.1:
	cmp	w8, #0
	ccmp	w22, #1, #0, eq
	b.eq	LBB0_6
; %bb.2:
	cmp	w8, #1
	ccmp	w22, #0, #0, eq
	b.ne	LBB0_5
; %bb.3:
Lloh5:
	adrp	x1, l_.str.4@PAGE
Lloh6:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x20
	mov	x2, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_VIOAPIC_CTR1
LBB0_4:
Lloh7:
	adrp	x1, l_.str.2@PAGE
Lloh8:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x20
	mov	x2, x19
	mov	x3, x22
	bl	_VIOAPIC_CTR2
LBB0_5:
	mov	x0, x21
	bl	_pinstate_str
Lloh9:
	adrp	x1, l_.str.5@PAGE
Lloh10:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x3, x0
	mov	x0, x20
	mov	x2, x19
	mov	x4, x22
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_VIOAPIC_CTR3
LBB0_6:
Lloh11:
	adrp	x1, l_.str.3@PAGE
Lloh12:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x20
	mov	x2, x19
	bl	_VIOAPIC_CTR1
	mov	x0, x20
	mov	x1, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_vioapic_send_intr
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_REDIR_ENTRIES,4,2              ; @REDIR_ENTRIES
	.section	__TEXT,__cstring,cstring_literals
l_.str.1:                               ; @.str.1
	.asciz	"vioapic_set_pinstate: vioapic is not locked"

l_.str.2:                               ; @.str.2
	.asciz	"ioapic pin%d: bad acnt %d"

l_.str.3:                               ; @.str.3
	.asciz	"ioapic pin%d: asserted"

l_.str.4:                               ; @.str.4
	.asciz	"ioapic pin%d: deasserted"

l_.str.5:                               ; @.str.5
	.asciz	"ioapic pin%d: %s, ignored, acnt %d"

	.no_dead_strip	_vioapic_set_pinstate
.subsections_via_symbols
