	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vatpic_set_pinstate
_vatpic_set_pinstate:                   ## @vatpic_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
	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, %r14d
	movq	%rdi, %rbx
	xorl	%edi, %edi
	cmpl	$16, %esi
	setb	%dil
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	movslq	%esi, %r13
	movq	%r13, %rsi
	callq	_KASSERT
	movq	%rbx, %rdi
	callq	_VATPIC_LOCKED
	leaq	L_.str.1(%rip), %rsi
	movl	%eax, %edi
	callq	_KASSERT
	movq	%rbx, %rdi
	movq	8(%rbx), %rcx
	movl	%r13d, %eax
	sarl	$3, %eax
	movslq	%eax, %r15
	movq	%r15, %rax
	shlq	$4, %rax
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	(%rcx,%rax), %rax
	andl	$7, %r13d
	xorl	%ebx, %ebx
	movl	%r14d, -48(%rbp)                ## 4-byte Spill
	cmpl	$1, %r14d
	sbbl	%ebx, %ebx
	movl	(%rax,%r13,4), %r12d
	orl	$1, %ebx
	addl	%r12d, %ebx
	movl	%ebx, (%rax,%r13,4)
	jns	LBB0_2
## %bb.1:
	leaq	L_.str.2(%rip), %rsi
	movq	%rdi, %r14
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movl	%ebx, %ecx
	callq	_VATPIC_CTR2
	movq	%r14, %rdi
LBB0_2:
	movl	$1, %r14d
	movl	%r13d, %ecx
	shll	%cl, %r14d
	movq	(%rdi), %rax
	movl	(%rax,%r15,4), %r15d
	btl	%r13d, %r15d
	setb	%al
	movl	%ebx, %edx
	xorl	$1, %edx
	testl	%ebx, %ebx
	setg	%cl
	orl	%r12d, %edx
	je	LBB0_4
## %bb.3:
	andb	%al, %cl
	jne	LBB0_4
## %bb.5:
	cmpl	$1, %r12d
	jne	LBB0_9
## %bb.6:
	testl	%ebx, %ebx
	jne	LBB0_9
## %bb.7:
	leaq	L_.str.4(%rip), %rsi
	movq	%rdi, %rbx
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	callq	_VATPIC_CTR1
	movq	%rbx, %rdi
	testl	%r14d, %r15d
	je	LBB0_10
## %bb.8:
	notl	%r14d
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	andl	%r14d, 8(%rax,%rcx)
	jmp	LBB0_10
LBB0_4:
	leaq	L_.str.3(%rip), %rsi
	movq	%rdi, %rbx
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	callq	_VATPIC_CTR1
	movq	%rbx, %rdi
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	orl	%r14d, 8(%rax,%rcx)
	jmp	LBB0_10
LBB0_9:
	cmpl	$0, -48(%rbp)                   ## 4-byte Folded Reload
	leaq	L_.str.7(%rip), %rax
	leaq	L_.str.6(%rip), %rcx
	cmoveq	%rax, %rcx
	leaq	L_.str.5(%rip), %rsi
	movq	%rdi, %r14
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movl	%ebx, %r8d
	callq	_VATPIC_CTR3
	movq	%r14, %rdi
LBB0_10:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_vatpic_notify_intr             ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str.1:                               ## @.str.1
	.asciz	"vatpic_set_pinstate: vatpic is not locked"

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

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

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

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

L_.str.6:                               ## @.str.6
	.asciz	"asserted"

L_.str.7:                               ## @.str.7
	.asciz	"deasserted"

	.no_dead_strip	_vatpic_set_pinstate
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vatpic_set_pinstate
_vatpic_set_pinstate:                   ; @vatpic_set_pinstate
	.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	x21, x2
	mov	x20, x1
	mov	x19, x0
	cmp	w1, #16
	cset	w0, lo
	sxtw	x1, w20
	bl	_KASSERT
	mov	x0, x19
	bl	_VATPIC_LOCKED
Lloh0:
	adrp	x1, l_.str.1@PAGE
Lloh1:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_KASSERT
	ldr	x23, [x19, #8]
	asr	w8, w20, #3
	sbfiz	x8, x8, #4, #32
	ldr	x8, [x23, x8]
	and	w25, w20, #0x7
	lsl	x9, x25, #2
	ldr	w26, [x8, x9]
	sbfx	x24, x20, #3, #29
	sub	w10, w26, #1
	cmp	w21, #0
	csinc	w22, w10, w26, eq
	str	w22, [x8, x9]
	tbz	w22, #31, LBB0_2
; %bb.1:
Lloh2:
	adrp	x1, l_.str.2@PAGE
Lloh3:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	mov	x2, x20
	mov	x3, x22
	bl	_VATPIC_CTR2
LBB0_2:
	ldr	x8, [x19]
	ldr	w8, [x8, x24, lsl #2]
	mov	w9, #1
	lsl	w25, w9, w25
	ands	w27, w8, w25
	cset	w8, ne
	cmp	w22, #0
	cset	w9, gt
	cmp	w22, #1
	ccmp	w26, #0, #0, eq
	and	w8, w9, w8
	ccmp	w8, #0, #0, ne
	b.eq	LBB0_4
; %bb.3:
Lloh4:
	adrp	x1, l_.str.3@PAGE
Lloh5:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x19
	mov	x2, x20
	bl	_VATPIC_CTR1
	add	x8, x23, x24, lsl #4
	ldr	w9, [x8, #8]
	orr	w9, w9, w25
	b	LBB0_8
LBB0_4:
	cmp	w26, #1
	ccmp	w22, #0, #0, eq
	b.eq	LBB0_6
; %bb.5:
Lloh6:
	adrp	x8, l_.str.6@PAGE
Lloh7:
	add	x8, x8, l_.str.6@PAGEOFF
Lloh8:
	adrp	x9, l_.str.7@PAGE
Lloh9:
	add	x9, x9, l_.str.7@PAGEOFF
	cmp	w21, #0
	csel	x3, x9, x8, eq
Lloh10:
	adrp	x1, l_.str.5@PAGE
Lloh11:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x0, x19
	mov	x2, x20
	mov	x4, x22
	bl	_VATPIC_CTR3
	b	LBB0_9
LBB0_6:
Lloh12:
	adrp	x1, l_.str.4@PAGE
Lloh13:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x19
	mov	x2, x20
	bl	_VATPIC_CTR1
	cbz	w27, LBB0_9
; %bb.7:
	add	x8, x23, x24, lsl #4
	ldr	w9, [x8, #8]
	bic	w9, w9, w25
LBB0_8:
	str	w9, [x8, #8]
LBB0_9:
	mov	x0, x19
	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
	b	_vatpic_notify_intr
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str.1:                               ; @.str.1
	.asciz	"vatpic_set_pinstate: vatpic is not locked"

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

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

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

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

l_.str.6:                               ; @.str.6
	.asciz	"asserted"

l_.str.7:                               ; @.str.7
	.asciz	"deasserted"

	.no_dead_strip	_vatpic_set_pinstate
.subsections_via_symbols
