	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tosh_emulate_fan
_tosh_emulate_fan:                      ## @tosh_emulate_fan
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movzbl	1(%rdi), %r12d
	shll	$8, %r12d
	movzwl	4(%rdi), %r15d
	movq	_tosh_id@GOTPCREL(%rip), %r13
	movl	(%r13), %eax
	cmpl	$64715, %eax                    ## imm = 0xFCCB
	jne	LBB0_11
## %bb.1:
	cmpl	$65024, %r12d                   ## imm = 0xFE00
	jne	LBB0_3
## %bb.2:
	callq	_local_irq_save
	movl	$190, %edi
	movl	$228, %esi
	callq	_outb
	movl	$229, %edi
	callq	_inb
	movl	%eax, %ebx
	callq	_local_irq_restore
	movl	$0, (%r14)
	andb	$1, %bl
	movzbl	%bl, %eax
	jmp	LBB0_9
LBB0_3:
	cmpl	$65280, %r12d                   ## imm = 0xFF00
	jne	LBB0_6
## %bb.4:
	testl	%r15d, %r15d
	jne	LBB0_6
## %bb.5:
	callq	_local_irq_save
	movl	$190, %edi
	movl	$228, %esi
	callq	_outb
	movl	$229, %edi
	callq	_inb
	movl	%eax, %ebx
	movl	$190, %edi
	movl	$228, %esi
	callq	_outb
	orb	$1, %bl
	movzbl	%bl, %edi
	movl	$229, %esi
	callq	_outb
	callq	_local_irq_restore
	movl	$0, (%r14)
	xorl	%eax, %eax
	jmp	LBB0_9
LBB0_6:
	cmpl	$65280, %r12d                   ## imm = 0xFF00
	jne	LBB0_10
## %bb.7:
	cmpl	$1, %r15d
	jne	LBB0_10
## %bb.8:
	callq	_local_irq_save
	movl	$190, %edi
	movl	$228, %esi
	callq	_outb
	movl	$229, %edi
	callq	_inb
	movl	%eax, %ebx
	movl	$190, %edi
	movl	$228, %esi
	callq	_outb
	andb	$-2, %bl
	movzbl	%bl, %edi
	movl	$229, %esi
	callq	_outb
	callq	_local_irq_restore
	movl	$0, (%r14)
	movl	$1, %eax
LBB0_9:
	movl	%eax, 4(%r14)
LBB0_10:
	movl	(%r13), %eax
LBB0_11:
	cmpl	$64716, %eax                    ## imm = 0xFCCC
	jne	LBB0_21
## %bb.12:
	cmpl	$65024, %r12d                   ## imm = 0xFE00
	jne	LBB0_14
## %bb.13:
	callq	_local_irq_save
	movl	$224, %edi
	movl	$228, %esi
	callq	_outb
	movl	$229, %edi
	callq	_inb
	movl	%eax, %ebx
	callq	_local_irq_restore
	movl	$0, (%r14)
	andb	$1, %bl
	movzbl	%bl, %eax
	jmp	LBB0_20
LBB0_14:
	cmpl	$65280, %r12d                   ## imm = 0xFF00
	jne	LBB0_17
## %bb.15:
	testl	%r15d, %r15d
	jne	LBB0_17
## %bb.16:
	callq	_local_irq_save
	movl	$224, %edi
	movl	$228, %esi
	callq	_outb
	movl	$229, %edi
	callq	_inb
	andb	$-2, %al
	movzbl	%al, %edi
	shll	$8, %edi
	orl	$224, %edi
	movl	$228, %esi
	callq	_outw
	callq	_local_irq_restore
	movl	$0, (%r14)
	xorl	%eax, %eax
	jmp	LBB0_20
LBB0_17:
	cmpl	$65280, %r12d                   ## imm = 0xFF00
	jne	LBB0_21
## %bb.18:
	cmpl	$1, %r15d
	jne	LBB0_21
## %bb.19:
	callq	_local_irq_save
	movl	$224, %edi
	movl	$228, %esi
	callq	_outb
	movl	$229, %edi
	callq	_inb
	orb	$1, %al
	movzbl	%al, %edi
	shll	$8, %edi
	orl	$224, %edi
	movl	$228, %esi
	callq	_outw
	callq	_local_irq_restore
	movl	$0, (%r14)
	movl	$1, %eax
LBB0_20:
	movl	%eax, 4(%r14)
LBB0_21:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_tosh_id,4,2                    ## @tosh_id
	.no_dead_strip	_tosh_emulate_fan
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tosh_emulate_fan
_tosh_emulate_fan:                      ; @tosh_emulate_fan
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x0
	ldrb	w8, [x0, #1]
	lsl	w22, w8, #8
	ldrh	w21, [x0, #4]
Lloh0:
	adrp	x23, _tosh_id@GOTPAGE
Lloh1:
	ldr	x23, [x23, _tosh_id@GOTPAGEOFF]
	ldr	w8, [x23]
	mov	w9, #64715
	cmp	w8, w9
	b.ne	LBB0_9
; %bb.1:
	mov	w8, #65024
	cmp	w22, w8
	b.ne	LBB0_3
; %bb.2:
	bl	_local_irq_save
	mov	w0, #190
	mov	w1, #228
	bl	_outb
	mov	w0, #229
	bl	_inb
	mov	x20, x0
	bl	_local_irq_restore
	str	wzr, [x19]
	and	w8, w20, #0x1
	b	LBB0_7
LBB0_3:
	mov	w8, #65280
	cmp	w22, w8
	ccmp	w21, #0, #0, eq
	b.eq	LBB0_6
; %bb.4:
	cmp	w22, w8
	ccmp	w21, #1, #0, eq
	b.ne	LBB0_8
; %bb.5:
	bl	_local_irq_save
	mov	w0, #190
	mov	w1, #228
	bl	_outb
	mov	w0, #229
	bl	_inb
	mov	x20, x0
	mov	w0, #190
	mov	w1, #228
	bl	_outb
	and	w0, w20, #0xfe
	mov	w1, #229
	bl	_outb
	bl	_local_irq_restore
	str	wzr, [x19]
	mov	w8, #1
	b	LBB0_7
LBB0_6:
	bl	_local_irq_save
	mov	w0, #190
	mov	w1, #228
	bl	_outb
	mov	w0, #229
	bl	_inb
	mov	x20, x0
	mov	w0, #190
	mov	w1, #228
	bl	_outb
	orr	w0, w20, #0x1
	mov	w1, #229
	bl	_outb
	bl	_local_irq_restore
	mov	w8, #0
	str	wzr, [x19]
LBB0_7:
	str	w8, [x19, #4]
LBB0_8:
	ldr	w8, [x23]
LBB0_9:
	mov	w9, #64716
	cmp	w8, w9
	b.ne	LBB0_18
; %bb.10:
	mov	w8, #65024
	cmp	w22, w8
	b.ne	LBB0_12
; %bb.11:
	bl	_local_irq_save
	mov	w0, #224
	mov	w1, #228
	bl	_outb
	mov	w0, #229
	bl	_inb
	mov	x20, x0
	bl	_local_irq_restore
	str	wzr, [x19]
	and	w8, w20, #0x1
	b	LBB0_17
LBB0_12:
	mov	w8, #65280
	cmp	w22, w8
	ccmp	w21, #0, #0, eq
	b.eq	LBB0_16
; %bb.13:
	cmp	w22, w8
	b.ne	LBB0_18
; %bb.14:
	cmp	w21, #1
	b.ne	LBB0_18
; %bb.15:
	bl	_local_irq_save
	mov	w0, #224
	mov	w1, #228
	bl	_outb
	mov	w0, #229
	bl	_inb
	lsl	w8, w0, #8
	orr	w0, w8, #0x1e0
	mov	w1, #228
	bl	_outw
	bl	_local_irq_restore
	str	wzr, [x19]
	mov	w8, #1
	b	LBB0_17
LBB0_16:
	bl	_local_irq_save
	mov	w20, #224
	mov	w0, #224
	mov	w1, #228
	bl	_outb
	mov	w0, #229
	bl	_inb
	and	w8, w0, #0xfe
	lsr	w8, w8, #1
	bfi	w20, w8, #9, #7
	mov	x0, x20
	mov	w1, #228
	bl	_outw
	bl	_local_irq_restore
	mov	w8, #0
	str	wzr, [x19]
LBB0_17:
	str	w8, [x19, #4]
LBB0_18:
	mov	w0, #0
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_tosh_id,4,2                    ; @tosh_id
	.no_dead_strip	_tosh_emulate_fan
.subsections_via_symbols
