	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hrowpic_toggle_irq
_hrowpic_toggle_irq:                    ## @hrowpic_toggle_irq
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	testl	%esi, %esi
	setg	%al
	movq	_HROWPIC_IRQMAX@GOTPCREL(%rip), %r12
	cmpl	%esi, (%r12)
	movl	%edx, %r15d
	movq	%rdi, %r14
	setge	%cl
	andb	%al, %cl
	movzbl	%cl, %edi
	leaq	L_.str(%rip), %rsi
	callq	_KASSERT
	cmpl	%ebx, (%r12)
	jne	LBB0_1
## %bb.5:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movl	%ebx, %edi
	callq	_HPIC_INT_TO_BANK
	movq	%rax, %r12
	movl	%ebx, %edi
	callq	_HPIC_INT_TO_REGBIT
	movq	%rax, %rcx
	movl	$1, %eax
                                        ## kill: def $cl killed $cl killed $rcx
	shll	%cl, %eax
	testl	%r15d, %r15d
	je	LBB0_3
## %bb.2:
	movq	(%r14), %rcx
	orl	(%rcx,%r12,4), %eax
	jmp	LBB0_4
LBB0_3:
	notl	%eax
	movq	(%r14), %rcx
	andl	(%rcx,%r12,4), %eax
LBB0_4:
	movl	%eax, (%rcx,%r12,4)
	movq	_HPIC_ENABLE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	%r14, %rdi
	movq	%r12, %rdx
	movl	%eax, %ecx
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_hrowpic_write_reg              ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_HROWPIC_IRQMAX,4,2             ## @HROWPIC_IRQMAX
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"en irq out of range"

	.comm	_HPIC_ENABLE,4,2                ## @HPIC_ENABLE
	.no_dead_strip	_hrowpic_toggle_irq
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hrowpic_toggle_irq
_hrowpic_toggle_irq:                    ; @hrowpic_toggle_irq
	.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	x22, x1
	mov	x19, x0
	cmp	w1, #0
Lloh0:
	adrp	x20, _HROWPIC_IRQMAX@GOTPAGE
Lloh1:
	ldr	x20, [x20, _HROWPIC_IRQMAX@GOTPAGEOFF]
	ldr	w8, [x20]
	ccmp	w8, w1, #8, gt
	cset	w0, ge
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	bl	_KASSERT
	ldr	w8, [x20]
	cmp	w8, w22
	b.ne	LBB0_2
; %bb.1:
	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
LBB0_2:
	mov	x0, x22
	bl	_HPIC_INT_TO_BANK
	mov	x20, x0
	mov	x0, x22
	bl	_HPIC_INT_TO_REGBIT
	mov	w8, #1
	lsl	w8, w8, w0
	cbz	w21, LBB0_4
; %bb.3:
	ldr	x9, [x19]
	lsl	x10, x20, #2
	ldr	w11, [x9, x10]
	orr	w3, w11, w8
	b	LBB0_5
LBB0_4:
	ldr	x9, [x19]
	lsl	x10, x20, #2
	ldr	w11, [x9, x10]
	bic	w3, w11, w8
LBB0_5:
	str	w3, [x9, x10]
Lloh4:
	adrp	x8, _HPIC_ENABLE@GOTPAGE
Lloh5:
	ldr	x8, [x8, _HPIC_ENABLE@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x20
	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	_hrowpic_write_reg
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_HROWPIC_IRQMAX,4,2             ; @HROWPIC_IRQMAX
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"en irq out of range"

	.comm	_HPIC_ENABLE,4,2                ; @HPIC_ENABLE
	.no_dead_strip	_hrowpic_toggle_irq
.subsections_via_symbols
