	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cs5535_mfgpt_set_irq           ## -- Begin function cs5535_mfgpt_set_irq
	.p2align	4, 0x90
_cs5535_mfgpt_set_irq:                  ## @cs5535_mfgpt_set_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	%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
	movl	%ecx, -48(%rbp)                 ## 4-byte Spill
	testq	%rdi, %rdi
	je	LBB0_1
## %bb.2:
	movq	%rdx, %r15
	movl	%esi, %r12d
	movq	%rdi, %rbx
	movq	_MSR_PIC_ZSEL_LOW@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_rdmsr
	movq	_MFGPT_CMP1@GOTPCREL(%rip), %rax
	cmpl	%r12d, (%rax)
	setne	%cl
	movl	(%rbx), %r13d
	leal	3(%r13), %r14d
	testl	%r13d, %r13d
	cmovnsl	%r13d, %r14d
	movl	(%r15), %eax
	testl	%eax, %eax
	je	LBB0_3
## %bb.4:
	cmpl	$2, %eax
	jne	LBB0_5
	jmp	LBB0_6
LBB0_1:
	movl	$1, %edi
	callq	_WARN_ON
	jmp	LBB0_6
LBB0_3:
	movl	$0, (%r15)
	movq	_CONFIG_CS5535_MFGPT_DEFAULT_IRQ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r15)
	cmpl	$2, %eax
	je	LBB0_6
LBB0_5:
	addl	$-16, %eax
	cmpl	$-16, %eax
	jbe	LBB0_6
## %bb.7:
	movb	%cl, -41(%rbp)                  ## 1-byte Spill
	movq	_MSR_PIC_IRQM_LPC@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_rdmsr
	movq	_MFGPT_EVENT_IRQ@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	movl	%r12d, %esi
	movl	-48(%rbp), %r12d                ## 4-byte Reload
	movl	%r12d, %ecx
	callq	_cs5535_mfgpt_toggle_event
	testq	%rax, %rax
	je	LBB0_8
LBB0_6:
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_10:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	xorl	%ebx, %ebx
	testl	%r12d, %r12d
	je	LBB0_10
## %bb.9:
	andl	$1073741820, %r14d              ## imm = 0x3FFFFFFC
	subl	%r14d, %r13d
	xorl	%eax, %eax
	movb	-41(%rbp), %cl                  ## 1-byte Reload
	movb	%cl, %al
	leal	(%r13,%rax,4), %ecx
	shll	$2, %ecx
	movl	(%r15), %esi
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %esi
	movq	_MSR_PIC_ZSEL_LOW@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_wrmsr
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_EIO,4,2                        ## @EIO
	.comm	_MSR_PIC_ZSEL_LOW,4,2           ## @MSR_PIC_ZSEL_LOW
	.comm	_MFGPT_CMP1,4,2                 ## @MFGPT_CMP1
	.comm	_CONFIG_CS5535_MFGPT_DEFAULT_IRQ,4,2 ## @CONFIG_CS5535_MFGPT_DEFAULT_IRQ
	.comm	_MSR_PIC_IRQM_LPC,4,2           ## @MSR_PIC_IRQM_LPC
	.comm	_MFGPT_EVENT_IRQ,4,2            ## @MFGPT_EVENT_IRQ
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cs5535_mfgpt_set_irq           ; -- Begin function cs5535_mfgpt_set_irq
	.p2align	2
_cs5535_mfgpt_set_irq:                  ; @cs5535_mfgpt_set_irq
	.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
	cbz	x0, LBB0_3
; %bb.1:
	mov	x20, x3
	mov	x19, x2
	mov	x21, x1
	mov	x22, x0
Lloh0:
	adrp	x23, _MSR_PIC_ZSEL_LOW@GOTPAGE
Lloh1:
	ldr	x23, [x23, _MSR_PIC_ZSEL_LOW@GOTPAGEOFF]
	ldr	w0, [x23]
	bl	_rdmsr
Lloh2:
	adrp	x8, _MFGPT_CMP1@GOTPAGE
Lloh3:
	ldr	x8, [x8, _MFGPT_CMP1@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	cmp	w8, w21
	cset	w24, ne
	ldr	w8, [x22]
	negs	w9, w8
	and	w9, w9, #0x3
	and	w8, w8, #0x3
	csneg	w25, w8, w9, mi
	ldr	w8, [x19]
	cbz	w8, LBB0_4
; %bb.2:
	cmp	w8, #2
	b.ne	LBB0_5
	b	LBB0_7
LBB0_3:
	mov	w0, #1
	bl	_WARN_ON
	b	LBB0_7
LBB0_4:
	str	wzr, [x19]
Lloh5:
	adrp	x8, _CONFIG_CS5535_MFGPT_DEFAULT_IRQ@GOTPAGE
Lloh6:
	ldr	x8, [x8, _CONFIG_CS5535_MFGPT_DEFAULT_IRQ@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	str	w8, [x19]
	cmp	w8, #2
	b.eq	LBB0_7
LBB0_5:
	sub	w8, w8, #16
	cmn	w8, #16
	b.ls	LBB0_7
; %bb.6:
Lloh8:
	adrp	x8, _MSR_PIC_IRQM_LPC@GOTPAGE
Lloh9:
	ldr	x8, [x8, _MSR_PIC_IRQM_LPC@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	bl	_rdmsr
Lloh11:
	adrp	x8, _MFGPT_EVENT_IRQ@GOTPAGE
Lloh12:
	ldr	x8, [x8, _MFGPT_EVENT_IRQ@GOTPAGEOFF]
Lloh13:
	ldr	w2, [x8]
	mov	x0, x22
	mov	x1, x21
	mov	x3, x20
	bl	_cs5535_mfgpt_toggle_event
	cbz	x0, LBB0_9
LBB0_7:
Lloh14:
	adrp	x8, _EIO@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_8:
	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
LBB0_9:
	cbz	w20, LBB0_11
; %bb.10:
	add	w8, w25, w24, lsl #2
	lsl	w8, w8, #2
	ldr	w9, [x19]
	lsl	w1, w9, w8
	ldr	w0, [x23]
	bl	_wrmsr
LBB0_11:
	mov	w0, #0
	b	LBB0_8
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_EIO,4,2                        ; @EIO
	.comm	_MSR_PIC_ZSEL_LOW,4,2           ; @MSR_PIC_ZSEL_LOW
	.comm	_MFGPT_CMP1,4,2                 ; @MFGPT_CMP1
	.comm	_CONFIG_CS5535_MFGPT_DEFAULT_IRQ,4,2 ; @CONFIG_CS5535_MFGPT_DEFAULT_IRQ
	.comm	_MSR_PIC_IRQM_LPC,4,2           ; @MSR_PIC_IRQM_LPC
	.comm	_MFGPT_EVENT_IRQ,4,2            ; @MFGPT_EVENT_IRQ
.subsections_via_symbols
