	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vatpic_write
_vatpic_write:                          ## @vatpic_write
	.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	%ecx, %ebx
	movq	%rsi, %r14
	movq	%rdi, %r12
	movl	(%r9), %r15d
	callq	_VATPIC_LOCK
	movq	_ICU_IMR_OFFSET@GOTPCREL(%rip), %rax
	testl	%ebx, (%rax)
	je	LBB0_8
## %bb.1:
	movl	(%r14), %eax
	movq	%r12, %rdi
	movq	%r14, %rsi
	movl	%r15d, %edx
	cmpl	$4, %eax
	je	LBB0_6
## %bb.2:
	cmpl	$3, %eax
	je	LBB0_5
## %bb.3:
	cmpl	$2, %eax
	jne	LBB0_7
## %bb.4:
	callq	_vatpic_icw2
	jmp	LBB0_14
LBB0_8:
	xorl	%ebx, %ebx
	testb	$16, %r15b
	je	LBB0_10
## %bb.9:
	movq	%r12, %rdi
	movq	%r14, %rsi
	movl	%r15d, %edx
	callq	_vatpic_icw1
	movl	%eax, %ebx
LBB0_10:
	cmpq	$0, 8(%r14)
	je	LBB0_15
## %bb.11:
	movq	%r12, %rdi
	movq	%r14, %rsi
	movl	%r15d, %edx
	testb	$8, %r15b
	jne	LBB0_12
## %bb.13:
	callq	_vatpic_ocw2
	jmp	LBB0_14
LBB0_6:
	callq	_vatpic_icw4
	jmp	LBB0_14
LBB0_5:
	callq	_vatpic_icw3
	jmp	LBB0_14
LBB0_7:
	callq	_vatpic_ocw1
	jmp	LBB0_14
LBB0_12:
	callq	_vatpic_ocw3
LBB0_14:
	movl	%eax, %ebx
LBB0_15:
	cmpq	$0, 8(%r14)
	je	LBB0_17
## %bb.16:
	movq	%r12, %rdi
	callq	_vatpic_notify_intr
LBB0_17:
	movq	%r12, %rdi
	callq	_VATPIC_UNLOCK
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ICU_IMR_OFFSET,4,2             ## @ICU_IMR_OFFSET
	.no_dead_strip	_vatpic_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vatpic_write
_vatpic_write:                          ; @vatpic_write
	.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	x22, x3
	mov	x20, x1
	mov	x19, x0
	ldr	w21, [x5]
	bl	_VATPIC_LOCK
Lloh0:
	adrp	x8, _ICU_IMR_OFFSET@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ICU_IMR_OFFSET@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	tst	w8, w22
	b.eq	LBB0_5
; %bb.1:
	ldr	w8, [x20]
	mov	x0, x19
	mov	x1, x20
	mov	x2, x21
	cmp	w8, #4
	b.eq	LBB0_10
; %bb.2:
	cmp	w8, #3
	b.eq	LBB0_11
; %bb.3:
	cmp	w8, #2
	b.ne	LBB0_12
; %bb.4:
	bl	_vatpic_icw2
	b	LBB0_14
LBB0_5:
	tbnz	w21, #4, LBB0_7
; %bb.6:
	mov	w22, #0
	ldr	x8, [x20, #8]
	cbnz	x8, LBB0_8
	b	LBB0_15
LBB0_7:
	mov	x0, x19
	mov	x1, x20
	mov	x2, x21
	bl	_vatpic_icw1
	mov	x22, x0
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_15
LBB0_8:
	mov	x0, x19
	mov	x1, x20
	mov	x2, x21
	tbnz	w21, #3, LBB0_13
; %bb.9:
	bl	_vatpic_ocw2
	b	LBB0_14
LBB0_10:
	bl	_vatpic_icw4
	b	LBB0_14
LBB0_11:
	bl	_vatpic_icw3
	b	LBB0_14
LBB0_12:
	bl	_vatpic_ocw1
	b	LBB0_14
LBB0_13:
	bl	_vatpic_ocw3
LBB0_14:
	mov	x22, x0
LBB0_15:
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_17
; %bb.16:
	mov	x0, x19
	bl	_vatpic_notify_intr
LBB0_17:
	mov	x0, x19
	bl	_VATPIC_UNLOCK
	mov	x0, 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
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_ICU_IMR_OFFSET,4,2             ; @ICU_IMR_OFFSET
	.no_dead_strip	_vatpic_write
.subsections_via_symbols
