	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function debiwrite
_debiwrite:                             ## @debiwrite
	.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	%r8d, %ebx
	leal	-32765(%rbx), %eax
	movl	$-1, %r14d
	cmpl	$-32764, %eax                   ## imm = 0x8004
	jb	LBB0_5
## %bb.1:
	movl	%ecx, %r15d
	movl	%esi, %r13d
	movq	%rdi, %r12
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	callq	_wait_for_debi_done
	testq	%rax, %rax
	js	LBB0_5
## %bb.2:
	movq	_SAA7146_DEBI_CONFIG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r13d, %edi
	callq	_saawrite
	cmpl	$5, %ebx
	jb	LBB0_4
## %bb.3:
	movl	(%r12), %edi
	callq	_virt_to_bus
	movl	%eax, %r15d
LBB0_4:
	movq	_SAA7146_DEBI_AD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r15d, %edi
	callq	_saawrite
	shll	$17, %ebx
	movzwl	-44(%rbp), %edi                 ## 2-byte Folded Reload
	orl	%ebx, %edi
	movq	_SAA7146_DEBI_COMMAND@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_saawrite
	movq	_SAA7146_MC2_UPLD_DEBI@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, %edi
	shll	$16, %edi
	orl	%eax, %edi
	movq	_SAA7146_MC2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_saawrite
	xorl	%r14d, %r14d
LBB0_5:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SAA7146_DEBI_CONFIG,4,2        ## @SAA7146_DEBI_CONFIG
	.comm	_SAA7146_DEBI_AD,4,2            ## @SAA7146_DEBI_AD
	.comm	_SAA7146_DEBI_COMMAND,4,2       ## @SAA7146_DEBI_COMMAND
	.comm	_SAA7146_MC2_UPLD_DEBI,4,2      ## @SAA7146_MC2_UPLD_DEBI
	.comm	_SAA7146_MC2,4,2                ## @SAA7146_MC2
	.no_dead_strip	_debiwrite
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function debiwrite
_debiwrite:                             ; @debiwrite
	.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	w8, #-32765
	mov	w9, #-32764
	add	w8, w4, w8
	cmp	w8, w9
	b.lo	LBB0_5
; %bb.1:
	mov	x19, x4
	mov	x21, x3
	mov	x20, x2
	mov	x23, x1
	mov	x22, x0
	bl	_wait_for_debi_done
	tbnz	x0, #63, LBB0_5
; %bb.2:
Lloh0:
	adrp	x8, _SAA7146_DEBI_CONFIG@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SAA7146_DEBI_CONFIG@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x23
	bl	_saawrite
	cmp	w19, #5
	b.lo	LBB0_4
; %bb.3:
	ldr	w0, [x22]
	bl	_virt_to_bus
	mov	x21, x0
LBB0_4:
Lloh3:
	adrp	x8, _SAA7146_DEBI_AD@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SAA7146_DEBI_AD@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_saawrite
	and	w0, w20, #0xffff
	bfi	w0, w19, #17, #15
Lloh6:
	adrp	x8, _SAA7146_DEBI_COMMAND@GOTPAGE
Lloh7:
	ldr	x8, [x8, _SAA7146_DEBI_COMMAND@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	bl	_saawrite
Lloh9:
	adrp	x8, _SAA7146_MC2_UPLD_DEBI@GOTPAGE
Lloh10:
	ldr	x8, [x8, _SAA7146_MC2_UPLD_DEBI@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	orr	w0, w8, w8, lsl #16
Lloh12:
	adrp	x8, _SAA7146_MC2@GOTPAGE
Lloh13:
	ldr	x8, [x8, _SAA7146_MC2@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	bl	_saawrite
	mov	w0, #0
	b	LBB0_6
LBB0_5:
	mov	w0, #-1
LBB0_6:
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_SAA7146_DEBI_CONFIG,4,2        ; @SAA7146_DEBI_CONFIG
	.comm	_SAA7146_DEBI_AD,4,2            ; @SAA7146_DEBI_AD
	.comm	_SAA7146_DEBI_COMMAND,4,2       ; @SAA7146_DEBI_COMMAND
	.comm	_SAA7146_MC2_UPLD_DEBI,4,2      ; @SAA7146_MC2_UPLD_DEBI
	.comm	_SAA7146_MC2,4,2                ; @SAA7146_MC2
	.no_dead_strip	_debiwrite
.subsections_via_symbols
