	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function msgdma_reset
_msgdma_reset:                          ## @msgdma_reset
	.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, %rbx
	movq	_MSGDMA_CSR_STAT_MASK@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	movq	_MSGDMA_CSR_STATUS@GOTPCREL(%rip), %r12
	movq	(%r12), %rsi
	addq	8(%rbx), %rsi
	callq	_iowrite32
	movq	_MSGDMA_CSR_CTL_RESET@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_MSGDMA_CSR_CONTROL@GOTPCREL(%rip), %r14
	movq	(%r14), %rsi
	addq	8(%rbx), %rsi
	callq	_iowrite32
	movq	(%r12), %rdi
	addq	8(%rbx), %rdi
	movl	$1, %edx
	movl	$1, %ecx
	movl	$10000, %r8d                    ## imm = 0x2710
	callq	_readl_poll_timeout
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	16(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
LBB0_2:
	movl	(%r15), %edi
	movq	(%r12), %rsi
	addq	8(%rbx), %rsi
	callq	_iowrite32
	movq	_MSGDMA_CSR_CTL_STOP_ON_ERR@GOTPCREL(%rip), %rax
	movq	_MSGDMA_CSR_CTL_STOP_ON_EARLY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	orl	(%rax), %edi
	movq	_MSGDMA_CSR_CTL_GLOBAL_INTR@GOTPCREL(%rip), %rax
	orl	(%rax), %edi
	movq	(%r14), %rsi
	addq	8(%rbx), %rsi
	callq	_iowrite32
	movl	$1, (%rbx)
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MSGDMA_CSR_STAT_MASK,4,2       ## @MSGDMA_CSR_STAT_MASK
	.comm	_MSGDMA_CSR_STATUS,8,3          ## @MSGDMA_CSR_STATUS
	.comm	_MSGDMA_CSR_CTL_RESET,4,2       ## @MSGDMA_CSR_CTL_RESET
	.comm	_MSGDMA_CSR_CONTROL,8,3         ## @MSGDMA_CSR_CONTROL
	.comm	_MSGDMA_CSR_STAT_RESETTING,4,2  ## @MSGDMA_CSR_STAT_RESETTING
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"DMA channel did not reset\n"

	.comm	_MSGDMA_CSR_CTL_STOP_ON_ERR,4,2 ## @MSGDMA_CSR_CTL_STOP_ON_ERR
	.comm	_MSGDMA_CSR_CTL_STOP_ON_EARLY,4,2 ## @MSGDMA_CSR_CTL_STOP_ON_EARLY
	.comm	_MSGDMA_CSR_CTL_GLOBAL_INTR,4,2 ## @MSGDMA_CSR_CTL_GLOBAL_INTR
	.no_dead_strip	_msgdma_reset
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function msgdma_reset
_msgdma_reset:                          ; @msgdma_reset
	.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
Lloh0:
	adrp	x21, _MSGDMA_CSR_STAT_MASK@GOTPAGE
Lloh1:
	ldr	x21, [x21, _MSGDMA_CSR_STAT_MASK@GOTPAGEOFF]
	ldr	w0, [x21]
	ldr	x8, [x19, #8]
Lloh2:
	adrp	x22, _MSGDMA_CSR_STATUS@GOTPAGE
Lloh3:
	ldr	x22, [x22, _MSGDMA_CSR_STATUS@GOTPAGEOFF]
	ldr	x9, [x22]
	add	x1, x9, x8
	bl	_iowrite32
Lloh4:
	adrp	x8, _MSGDMA_CSR_CTL_RESET@GOTPAGE
Lloh5:
	ldr	x8, [x8, _MSGDMA_CSR_CTL_RESET@GOTPAGEOFF]
Lloh6:
	ldr	w0, [x8]
	ldr	x8, [x19, #8]
Lloh7:
	adrp	x20, _MSGDMA_CSR_CONTROL@GOTPAGE
Lloh8:
	ldr	x20, [x20, _MSGDMA_CSR_CONTROL@GOTPAGEOFF]
	ldr	x9, [x20]
	add	x1, x9, x8
	bl	_iowrite32
	ldr	x8, [x19, #8]
	ldr	x9, [x22]
	add	x0, x9, x8
	mov	w23, #1
	mov	w2, #1
	mov	w3, #1
	mov	w4, #10000
	bl	_readl_poll_timeout
	cbz	w0, LBB0_2
; %bb.1:
	ldr	w0, [x19, #16]
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
LBB0_2:
	ldr	w0, [x21]
	ldr	x8, [x19, #8]
	ldr	x9, [x22]
	add	x1, x9, x8
	bl	_iowrite32
Lloh11:
	adrp	x8, _MSGDMA_CSR_CTL_STOP_ON_ERR@GOTPAGE
Lloh12:
	ldr	x8, [x8, _MSGDMA_CSR_CTL_STOP_ON_ERR@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
Lloh14:
	adrp	x9, _MSGDMA_CSR_CTL_STOP_ON_EARLY@GOTPAGE
Lloh15:
	ldr	x9, [x9, _MSGDMA_CSR_CTL_STOP_ON_EARLY@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
Lloh17:
	adrp	x10, _MSGDMA_CSR_CTL_GLOBAL_INTR@GOTPAGE
Lloh18:
	ldr	x10, [x10, _MSGDMA_CSR_CTL_GLOBAL_INTR@GOTPAGEOFF]
	orr	w8, w9, w8
Lloh19:
	ldr	w9, [x10]
	orr	w0, w8, w9
	ldr	x8, [x19, #8]
	ldr	x9, [x20]
	add	x1, x9, x8
	bl	_iowrite32
	str	w23, [x19]
	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	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_MSGDMA_CSR_STAT_MASK,4,2       ; @MSGDMA_CSR_STAT_MASK
	.comm	_MSGDMA_CSR_STATUS,8,3          ; @MSGDMA_CSR_STATUS
	.comm	_MSGDMA_CSR_CTL_RESET,4,2       ; @MSGDMA_CSR_CTL_RESET
	.comm	_MSGDMA_CSR_CONTROL,8,3         ; @MSGDMA_CSR_CONTROL
	.comm	_MSGDMA_CSR_STAT_RESETTING,4,2  ; @MSGDMA_CSR_STAT_RESETTING
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"DMA channel did not reset\n"

	.comm	_MSGDMA_CSR_CTL_STOP_ON_ERR,4,2 ; @MSGDMA_CSR_CTL_STOP_ON_ERR
	.comm	_MSGDMA_CSR_CTL_STOP_ON_EARLY,4,2 ; @MSGDMA_CSR_CTL_STOP_ON_EARLY
	.comm	_MSGDMA_CSR_CTL_GLOBAL_INTR,4,2 ; @MSGDMA_CSR_CTL_GLOBAL_INTR
	.no_dead_strip	_msgdma_reset
.subsections_via_symbols
