	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mgsl_irq_test
_mgsl_irq_test:                         ## @mgsl_irq_test
	.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
	movq	%rdi, %r12
	leaq	4(%rdi), %r14
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	movq	%r12, %rdi
	callq	_usc_reset
	movl	$0, (%r12)
	movq	_PCR@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	%r12, %rdi
	movl	%r15d, %esi
	callq	_usc_InReg
	movq	_BIT13@GOTPCREL(%rip), %rcx
	movzwl	(%rcx), %ecx
	orl	%eax, %ecx
	movq	_BIT12@GOTPCREL(%rip), %rax
	movzwl	(%rax), %edx
	xorl	$65535, %edx                    ## imm = 0xFFFF
	andl	%ecx, %edx
	movq	%r12, %rdi
	movl	%r15d, %esi
	callq	_usc_OutReg
	movq	%r12, %rdi
	callq	_usc_EnableMasterIrqBit
	movq	_IO_PIN@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r12, %rdi
	callq	_usc_EnableInterrupts
	movl	(%rbx), %esi
	movq	%r12, %rdi
	callq	_usc_ClearIrqPendingBits
	movq	_MISCSTATUS_TXC_LATCHED@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_usc_UnlatchIostatusBits
	movq	_SICR_TXC_ACTIVE@GOTPCREL(%rip), %rax
	movq	_SICR_TXC_INACTIVE@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rsi
	addq	(%rax), %rsi
	movq	%r12, %rdi
	callq	_usc_EnableStatusIrqs
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	movq	$-100, %rbx
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	$0, (%r12)
	jne	LBB0_3
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	$10, %edi
	callq	_msleep_interruptible
	incq	%rbx
	jne	LBB0_1
LBB0_3:
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	movq	%r12, %rdi
	callq	_usc_reset
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	movl	(%r12), %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PCR,4,2                        ## @PCR
	.comm	_BIT13,4,2                      ## @BIT13
	.comm	_BIT12,4,2                      ## @BIT12
	.comm	_IO_PIN,4,2                     ## @IO_PIN
	.comm	_MISCSTATUS_TXC_LATCHED,4,2     ## @MISCSTATUS_TXC_LATCHED
	.comm	_SICR_TXC_ACTIVE,8,3            ## @SICR_TXC_ACTIVE
	.comm	_SICR_TXC_INACTIVE,8,3          ## @SICR_TXC_INACTIVE
	.no_dead_strip	_mgsl_irq_test
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mgsl_irq_test
_mgsl_irq_test:                         ; @mgsl_irq_test
	.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	x19, x0
	add	x20, x0, #4
	mov	x0, x20
	bl	_spin_lock_irqsave
	mov	x0, x19
	bl	_usc_reset
	str	wzr, [x19]
Lloh0:
	adrp	x8, _PCR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PCR@GOTPAGEOFF]
Lloh2:
	ldr	w21, [x8]
	mov	x0, x19
	mov	x1, x21
	bl	_usc_InReg
Lloh3:
	adrp	x8, _BIT13@GOTPAGE
Lloh4:
	ldr	x8, [x8, _BIT13@GOTPAGEOFF]
	ldrh	w8, [x8]
	orr	w8, w8, w0
Lloh5:
	adrp	x9, _BIT12@GOTPAGE
Lloh6:
	ldr	x9, [x9, _BIT12@GOTPAGEOFF]
	ldrh	w9, [x9]
	eor	w9, w9, #0xffff
	and	w2, w8, w9
	mov	x0, x19
	mov	x1, x21
	bl	_usc_OutReg
	mov	x0, x19
	bl	_usc_EnableMasterIrqBit
Lloh7:
	adrp	x21, _IO_PIN@GOTPAGE
Lloh8:
	ldr	x21, [x21, _IO_PIN@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x19
	bl	_usc_EnableInterrupts
	ldr	w1, [x21]
	mov	x0, x19
	bl	_usc_ClearIrqPendingBits
Lloh9:
	adrp	x8, _MISCSTATUS_TXC_LATCHED@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MISCSTATUS_TXC_LATCHED@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_usc_UnlatchIostatusBits
Lloh12:
	adrp	x8, _SICR_TXC_ACTIVE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _SICR_TXC_ACTIVE@GOTPAGEOFF]
Lloh14:
	ldr	x8, [x8]
Lloh15:
	adrp	x9, _SICR_TXC_INACTIVE@GOTPAGE
Lloh16:
	ldr	x9, [x9, _SICR_TXC_INACTIVE@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	add	x1, x9, x8
	mov	x0, x19
	bl	_usc_EnableStatusIrqs
	mov	x0, x20
	bl	_spin_unlock_irqrestore
	mov	x21, #-100
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x19]
	cbnz	w8, LBB0_3
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	w0, #10
	bl	_msleep_interruptible
	adds	x21, x21, #1
	b.lo	LBB0_1
LBB0_3:
	mov	x0, x20
	bl	_spin_lock_irqsave
	mov	x0, x19
	bl	_usc_reset
	mov	x0, x20
	bl	_spin_unlock_irqrestore
	ldr	w0, [x19]
	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	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_PCR,4,2                        ; @PCR
	.comm	_BIT13,4,2                      ; @BIT13
	.comm	_BIT12,4,2                      ; @BIT12
	.comm	_IO_PIN,4,2                     ; @IO_PIN
	.comm	_MISCSTATUS_TXC_LATCHED,4,2     ; @MISCSTATUS_TXC_LATCHED
	.comm	_SICR_TXC_ACTIVE,8,3            ; @SICR_TXC_ACTIVE
	.comm	_SICR_TXC_INACTIVE,8,3          ; @SICR_TXC_INACTIVE
	.no_dead_strip	_mgsl_irq_test
.subsections_via_symbols
