	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sh_dmae_rst
_sh_dmae_rst:                           ## @sh_dmae_rst
	.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, %r13
	movq	_sh_dmae_lock@GOTPCREL(%rip), %rdi
	callq	_spin_lock_irqsave
	movq	%r13, %rdi
	callq	_dmaor_read
                                        ## kill: def $ax killed $ax def $eax
	movq	_DMAOR_NMIF@GOTPCREL(%rip), %r12
	movq	_DMAOR_AE@GOTPCREL(%rip), %r15
	movzwl	(%r15), %r14d
	orw	(%r12), %r14w
	movq	_DMAOR_DME@GOTPCREL(%rip), %rcx
	orw	(%rcx), %r14w
	notl	%r14d
	andl	%eax, %r14d
	movq	(%r13), %rax
	cmpq	$0, 8(%rax)
	je	LBB0_6
## %bb.1:
	cmpl	$0, (%rax)
	jle	LBB0_6
## %bb.2:
	xorl	%ebx, %ebx
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_3 Depth=1
	incq	%rbx
	movslq	(%rax), %rcx
	cmpq	%rcx, %rbx
	jge	LBB0_6
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	16(%r13), %rcx
	movq	(%rcx,%rbx,8), %rdi
	testq	%rdi, %rdi
	je	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	callq	_channel_clear
	movq	(%r13), %rax
	jmp	LBB0_5
LBB0_6:
	orw	4(%rax), %r14w
	movzwl	%r14w, %esi
	movq	%r13, %rdi
	callq	_dmaor_write
	movq	%r13, %rdi
	callq	_dmaor_read
	movl	%eax, %r14d
	movq	_sh_dmae_lock@GOTPCREL(%rip), %rdi
	callq	_spin_unlock_irqrestore
	movzwl	(%r12), %eax
	orw	(%r15), %ax
	testw	%r14w, %ax
	je	LBB0_8
## %bb.7:
	movl	8(%r13), %edi
	leaq	L_.str(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_dev_warn
	movq	_EIO@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_11
LBB0_8:
	movzwl	%r14w, %edx
	movq	(%r13), %rax
	movzwl	4(%rax), %ecx
	movl	%edx, %eax
	notl	%eax
	testl	%eax, %ecx
	je	LBB0_9
## %bb.10:
	movl	8(%r13), %edi
	leaq	L_.str.1(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_dev_warn
	jmp	LBB0_11
LBB0_9:
	xorl	%ebx, %ebx
LBB0_11:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_sh_dmae_lock,4,2               ## @sh_dmae_lock
	.comm	_DMAOR_NMIF,2,1                 ## @DMAOR_NMIF
	.comm	_DMAOR_AE,2,1                   ## @DMAOR_AE
	.comm	_DMAOR_DME,2,1                  ## @DMAOR_DME
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Can't initialize DMAOR.\n"

	.comm	_EIO,4,2                        ## @EIO
L_.str.1:                               ## @.str.1
	.asciz	"DMAOR=0x%x hasn't latched the initial value 0x%x.\n"

	.no_dead_strip	_sh_dmae_rst
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sh_dmae_rst
_sh_dmae_rst:                           ; @sh_dmae_rst
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x19, x0
Lloh0:
	adrp	x0, _sh_dmae_lock@GOTPAGE
Lloh1:
	ldr	x0, [x0, _sh_dmae_lock@GOTPAGEOFF]
	bl	_spin_lock_irqsave
	mov	x0, x19
	bl	_dmaor_read
Lloh2:
	adrp	x21, _DMAOR_NMIF@GOTPAGE
Lloh3:
	ldr	x21, [x21, _DMAOR_NMIF@GOTPAGEOFF]
	ldrh	w8, [x21]
Lloh4:
	adrp	x22, _DMAOR_AE@GOTPAGE
Lloh5:
	ldr	x22, [x22, _DMAOR_AE@GOTPAGEOFF]
	ldrh	w9, [x22]
Lloh6:
	adrp	x10, _DMAOR_DME@GOTPAGE
Lloh7:
	ldr	x10, [x10, _DMAOR_DME@GOTPAGEOFF]
	orr	w8, w9, w8
	ldrh	w9, [x10]
	orr	w8, w8, w9
	bic	w20, w0, w8
	ldr	x8, [x19]
	ldr	x9, [x8, #8]
	cbz	x9, LBB0_6
; %bb.1:
	ldr	w9, [x8]
	cmp	w9, #1
	b.lt	LBB0_6
; %bb.2:
	mov	x23, #0
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x23, x23, #1
	ldrsw	x9, [x8]
	cmp	x23, x9
	b.ge	LBB0_6
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x19, #16]
	ldr	x0, [x9, x23, lsl #3]
	cbz	x0, LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	bl	_channel_clear
	ldr	x8, [x19]
	b	LBB0_3
LBB0_6:
	ldrh	w8, [x8, #4]
	orr	w1, w8, w20
	mov	x0, x19
	bl	_dmaor_write
	mov	x0, x19
	bl	_dmaor_read
	mov	x20, x0
Lloh8:
	adrp	x0, _sh_dmae_lock@GOTPAGE
Lloh9:
	ldr	x0, [x0, _sh_dmae_lock@GOTPAGEOFF]
	bl	_spin_unlock_irqrestore
	ldrh	w8, [x22]
	ldrh	w9, [x21]
	orr	w8, w9, w8
	tst	w8, w20
	b.eq	LBB0_8
; %bb.7:
	ldr	w0, [x19, #8]
Lloh10:
	adrp	x1, l_.str@PAGE
Lloh11:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_warn
Lloh12:
	adrp	x8, _EIO@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_11
LBB0_8:
	ldr	x8, [x19]
	ldrh	w8, [x8, #4]
	bics	wzr, w8, w20
	b.eq	LBB0_10
; %bb.9:
	ldr	w0, [x19, #8]
	stp	x20, x8, [sp]
Lloh15:
	adrp	x1, l_.str.1@PAGE
Lloh16:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_warn
LBB0_10:
	mov	w0, #0
LBB0_11:
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_sh_dmae_lock,4,2               ; @sh_dmae_lock
	.comm	_DMAOR_NMIF,2,1                 ; @DMAOR_NMIF
	.comm	_DMAOR_AE,2,1                   ; @DMAOR_AE
	.comm	_DMAOR_DME,2,1                  ; @DMAOR_DME
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Can't initialize DMAOR.\n"

	.comm	_EIO,4,2                        ; @EIO
l_.str.1:                               ; @.str.1
	.asciz	"DMAOR=0x%x hasn't latched the initial value 0x%x.\n"

	.no_dead_strip	_sh_dmae_rst
.subsections_via_symbols
