	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vioapic_set_irqstate
_vioapic_set_irqstate:                  ## @vioapic_set_irqstate
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testl	%esi, %esi
	js	LBB0_2
## %bb.1:
	movl	%esi, %ebx
	movq	_REDIR_ENTRIES@GOTPCREL(%rip), %rax
	cmpl	%esi, (%rax)
	jle	LBB0_2
## %bb.3:
	movl	%edx, %r15d
	callq	_vm_ioapic
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_VIOAPIC_LOCK
	cmpl	$128, %r15d
	je	LBB0_7
## %bb.4:
	cmpl	$129, %r15d
	je	LBB0_8
## %bb.5:
	cmpl	$130, %r15d
	jne	LBB0_9
## %bb.6:
	movq	%r14, %rdi
	movl	%ebx, %esi
	movl	$1, %edx
	callq	_vioapic_set_pinstate
	jmp	LBB0_10
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_11
LBB0_7:
	movq	%r14, %rdi
	movl	%ebx, %esi
	movl	$1, %edx
	callq	_vioapic_set_pinstate
LBB0_8:
	movq	%r14, %rdi
	movl	%ebx, %esi
	xorl	%edx, %edx
	callq	_vioapic_set_pinstate
	jmp	LBB0_10
LBB0_9:
	leaq	L_.str(%rip), %rdi
	movl	%r15d, %esi
	callq	_panic
LBB0_10:
	movq	%r14, %rdi
	callq	_VIOAPIC_UNLOCK
	xorl	%eax, %eax
LBB0_11:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_REDIR_ENTRIES,4,2              ## @REDIR_ENTRIES
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"vioapic_set_irqstate: invalid irqstate %d"

	.no_dead_strip	_vioapic_set_irqstate
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vioapic_set_irqstate
_vioapic_set_irqstate:                  ; @vioapic_set_irqstate
	.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
	tbnz	w1, #31, LBB0_6
; %bb.1:
	mov	x20, x1
Lloh0:
	adrp	x8, _REDIR_ENTRIES@GOTPAGE
Lloh1:
	ldr	x8, [x8, _REDIR_ENTRIES@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w1
	b.le	LBB0_6
; %bb.2:
	mov	x21, x2
	bl	_vm_ioapic
	mov	x19, x0
	bl	_VIOAPIC_LOCK
	cmp	w21, #128
	b.eq	LBB0_7
; %bb.3:
	cmp	w21, #129
	b.eq	LBB0_8
; %bb.4:
	cmp	w21, #130
	b.ne	LBB0_9
; %bb.5:
	mov	x0, x19
	mov	x1, x20
	mov	w2, #1
	bl	_vioapic_set_pinstate
	b	LBB0_10
LBB0_6:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	b	LBB0_11
LBB0_7:
	mov	x0, x19
	mov	x1, x20
	mov	w2, #1
	bl	_vioapic_set_pinstate
LBB0_8:
	mov	x0, x19
	mov	x1, x20
	mov	w2, #0
	bl	_vioapic_set_pinstate
	b	LBB0_10
LBB0_9:
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x21
	bl	_panic
LBB0_10:
	mov	x0, x19
	bl	_VIOAPIC_UNLOCK
	mov	w0, #0
LBB0_11:
	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
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_REDIR_ENTRIES,4,2              ; @REDIR_ENTRIES
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"vioapic_set_irqstate: invalid irqstate %d"

	.no_dead_strip	_vioapic_set_irqstate
.subsections_via_symbols
