	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pit_ioport_write
_pit_ioport_write:                      ## @pit_ioport_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	%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
	movq	%rcx, %rbx
	movl	%edx, %r14d
	movl	%esi, %r15d
	callq	_dev_to_pit
	movq	%rax, %r13
	movq	(%rax), %r12
	movl	(%rbx), %ebx
	movl	%r15d, %edi
	callq	_pit_in_range
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	movzbl	%bl, %r12d
	movq	_KVM_PIT_CHANNEL_MASK@GOTPCREL(%rip), %rax
	andl	(%rax), %r15d
	leaq	8(%r13), %rdi
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	callq	_mutex_lock
	testq	%r12, %r12
	je	LBB0_4
## %bb.3:
	leaq	L_.str(%rip), %rdi
	movl	%r15d, %esi
	movl	%r14d, %edx
	movl	%r12d, %ecx
	callq	_pr_debug
LBB0_4:
	cmpl	$3, %r15d
	jne	LBB0_24
## %bb.5:
	movq	%r12, %rsi
	shrq	$6, %rsi
	cmpl	$3, %esi
	jne	LBB0_21
## %bb.6:
	testb	$2, %bl
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	je	LBB0_11
## %bb.7:
	testb	$32, %bl
	jne	LBB0_9
## %bb.8:
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_pit_latch_count
LBB0_9:
	testb	$16, %bl
	jne	LBB0_11
## %bb.10:
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_pit_latch_status
LBB0_11:
	testb	$4, %bl
	je	LBB0_16
## %bb.12:
	testb	$32, %bl
	jne	LBB0_14
## %bb.13:
	movq	%r15, %rdi
	movl	$1, %esi
	callq	_pit_latch_count
LBB0_14:
	testb	$16, %bl
	jne	LBB0_16
## %bb.15:
	movq	%r15, %rdi
	movl	$1, %esi
	callq	_pit_latch_status
LBB0_16:
	testb	$8, %bl
	je	LBB0_32
## %bb.17:
	testb	$32, %bl
	jne	LBB0_19
## %bb.18:
	movq	%r15, %rdi
	movl	$2, %esi
	callq	_pit_latch_count
LBB0_19:
	testb	$16, %bl
	jne	LBB0_32
## %bb.20:
	movq	%r15, %rdi
	movl	$2, %esi
	callq	_pit_latch_status
	jmp	LBB0_32
LBB0_1:
	movq	_EOPNOTSUPP@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_33
LBB0_24:
	movslq	%r15d, %rcx
	movq	16(%r13), %rax
	leaq	(%rcx,%rcx,2), %rcx
	leaq	(%rax,%rcx,8), %rbx
	addq	$8, %rbx
	movl	8(%rax,%rcx,8), %edx
	cmpl	$128, %edx
	je	LBB0_30
## %bb.25:
	cmpl	$129, %edx
	je	LBB0_29
## %bb.26:
	cmpl	$130, %edx
	jne	LBB0_27
## %bb.28:
	shll	$8, %r12d
LBB0_27:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%r15d, %esi
	movl	%r12d, %edx
	callq	_pit_load_count
	jmp	LBB0_31
LBB0_21:
	shrl	$4, %r12d
	movq	_KVM_PIT_CHANNEL_MASK@GOTPCREL(%rip), %rax
	andl	(%rax), %r12d
	je	LBB0_22
## %bb.23:
	movl	%ebx, %eax
	shrl	%eax
	andl	$7, %eax
	leal	-4(%rax), %ecx
	cmpl	$6, %eax
	cmovbl	%eax, %ecx
	movq	16(%r13), %rax
	leaq	(%rsi,%rsi,2), %rdx
	movl	%r12d, (%rax,%rdx,8)
	movl	%r12d, 4(%rax,%rdx,8)
	movl	%r12d, 8(%rax,%rdx,8)
	movl	%ecx, 12(%rax,%rdx,8)
	andl	$1, %ebx
	movl	%ebx, 16(%rax,%rdx,8)
	jmp	LBB0_31
LBB0_29:
	movl	%r12d, 20(%rax,%rcx,8)
	movl	$128, (%rbx)
	jmp	LBB0_31
LBB0_30:
	shll	$8, %r12d
	orl	20(%rax,%rcx,8), %r12d
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%r15d, %esi
	movl	%r12d, %edx
	callq	_pit_load_count
	movl	$129, (%rbx)
	jmp	LBB0_31
LBB0_22:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_pit_latch_count
LBB0_31:
	movq	-48(%rbp), %r14                 ## 8-byte Reload
LBB0_32:
	movq	%r14, %rdi
	callq	_mutex_unlock
	xorl	%eax, %eax
LBB0_33:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EOPNOTSUPP,4,2                 ## @EOPNOTSUPP
	.comm	_KVM_PIT_CHANNEL_MASK,4,2       ## @KVM_PIT_CHANNEL_MASK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"pit: write addr is 0x%x, len is %d, val is 0x%x\n"

	.no_dead_strip	_pit_ioport_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pit_ioport_write
_pit_ioport_write:                      ; @pit_ioport_write
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x21, x3
	mov	x24, x2
	mov	x19, x1
	bl	_dev_to_pit
	mov	x23, x0
	ldr	x20, [x0]
	ldr	w25, [x21]
	mov	x0, x19
	bl	_pit_in_range
	cbz	w0, LBB0_20
; %bb.1:
	and	x21, x25, #0xff
Lloh0:
	adrp	x26, _KVM_PIT_CHANNEL_MASK@GOTPAGE
Lloh1:
	ldr	x26, [x26, _KVM_PIT_CHANNEL_MASK@GOTPAGEOFF]
	ldr	w8, [x26]
	and	w22, w8, w19
	add	x19, x23, #8
	mov	x0, x19
	bl	_mutex_lock
	cbz	w21, LBB0_3
; %bb.2:
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x22
	mov	x2, x24
	mov	x3, x21
	bl	_pr_debug
LBB0_3:
	cmp	w22, #3
	b.ne	LBB0_21
; %bb.4:
	lsr	x1, x21, #6
	cmp	w1, #3
	b.ne	LBB0_25
; %bb.5:
	tbz	w25, #1, LBB0_10
; %bb.6:
	tbnz	w25, #5, LBB0_8
; %bb.7:
	mov	x0, x20
	mov	w1, #0
	bl	_pit_latch_count
LBB0_8:
	tbnz	w25, #4, LBB0_10
; %bb.9:
	mov	x0, x20
	mov	w1, #0
	bl	_pit_latch_status
LBB0_10:
	tbz	w25, #2, LBB0_15
; %bb.11:
	tbnz	w25, #5, LBB0_13
; %bb.12:
	mov	x0, x20
	mov	w1, #1
	bl	_pit_latch_count
LBB0_13:
	tbnz	w25, #4, LBB0_15
; %bb.14:
	mov	x0, x20
	mov	w1, #1
	bl	_pit_latch_status
LBB0_15:
	tbz	w25, #3, LBB0_32
; %bb.16:
	tbnz	w25, #5, LBB0_18
; %bb.17:
	mov	x0, x20
	mov	w1, #2
	bl	_pit_latch_count
LBB0_18:
	tbnz	w25, #4, LBB0_32
; %bb.19:
	mov	x0, x20
	mov	w1, #2
	bl	_pit_latch_status
	b	LBB0_32
LBB0_20:
Lloh4:
	adrp	x8, _EOPNOTSUPP@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EOPNOTSUPP@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_33
LBB0_21:
	ldr	x8, [x23, #16]
	sxtw	x9, w22
	mov	w10, #24
	smaddl	x23, w22, w10, x8
	ldr	w10, [x23, #8]!
	cmp	w10, #128
	b.eq	LBB0_28
; %bb.22:
	cmp	w10, #129
	b.eq	LBB0_27
; %bb.23:
	cmp	w10, #130
	b.ne	LBB0_30
; %bb.24:
	lsl	w2, w21, #8
	mov	x0, x20
	mov	x1, x22
	bl	_pit_load_count
	b	LBB0_32
LBB0_25:
	ldr	w8, [x26]
	ands	w8, w8, w21, lsr #4
	b.eq	LBB0_31
; %bb.26:
	ldr	x9, [x23, #16]
	mov	w10, #24
	madd	x9, x1, x10, x9
	stp	w8, w8, [x9]
	ubfx	w10, w25, #1, #3
	sub	w11, w10, #4
	cmp	w10, #5
	csel	w10, w11, w10, hi
	stp	w8, w10, [x9, #8]
	and	w8, w25, #0x1
	str	w8, [x9, #16]
	b	LBB0_32
LBB0_27:
	mov	w10, #24
	madd	x8, x9, x10, x8
	str	w21, [x8, #20]
	mov	w8, #128
	b	LBB0_29
LBB0_28:
	mov	w10, #24
	madd	x8, x9, x10, x8
	ldr	w8, [x8, #20]
	orr	w2, w8, w21, lsl #8
	mov	x0, x20
	mov	x1, x22
	bl	_pit_load_count
	mov	w8, #129
LBB0_29:
	str	w8, [x23]
	b	LBB0_32
LBB0_30:
	mov	x0, x20
	mov	x1, x22
	mov	x2, x21
	bl	_pit_load_count
	b	LBB0_32
LBB0_31:
	mov	x0, x20
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_pit_latch_count
LBB0_32:
	mov	x0, x19
	bl	_mutex_unlock
	mov	w0, #0
LBB0_33:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_EOPNOTSUPP,4,2                 ; @EOPNOTSUPP
	.comm	_KVM_PIT_CHANNEL_MASK,4,2       ; @KVM_PIT_CHANNEL_MASK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"pit: write addr is 0x%x, len is %d, val is 0x%x\n"

	.no_dead_strip	_pit_ioport_write
.subsections_via_symbols
