	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wait_for_debi_done
_wait_for_debi_done:                    ## @wait_for_debi_done
	.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
	movl	$100000, %ebx                   ## imm = 0x186A0
	movq	_SAA7146_MC2@GOTPCREL(%rip), %r14
	movq	_SAA7146_MC2_UPLD_DEBI@GOTPCREL(%rip), %r15
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r14), %edi
	callq	_saaread
	testl	%eax, (%r15)
	jne	LBB0_3
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	(%r14), %edi
	callq	_saaread
	decl	%ebx
	jne	LBB0_1
LBB0_3:
	xorl	%ebx, %ebx
	movq	_SAA7146_PSR@GOTPCREL(%rip), %r15
	movq	_SAA7146_PSR_DEBI_S@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %edi
	callq	_saaread
	testl	%eax, (%r12)
	je	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	(%r14), %edi
	callq	_saaread
	incl	%ebx
	cmpl	$500000, %ebx                   ## imm = 0x7A120
	jne	LBB0_4
## %bb.6:
	movl	$500000, %ebx                   ## imm = 0x7A120
LBB0_7:
	movq	_debiwait_maxwait@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jle	LBB0_9
## %bb.8:
	movl	%ebx, (%rax)
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %esi
	callq	_printk
LBB0_9:
	xorl	%eax, %eax
	cmpl	$500000, %ebx                   ## imm = 0x7A120
	sete	%al
	negl	%eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SAA7146_MC2,4,2                ## @SAA7146_MC2
	.comm	_SAA7146_MC2_UPLD_DEBI,4,2      ## @SAA7146_MC2_UPLD_DEBI
	.comm	_SAA7146_PSR,4,2                ## @SAA7146_PSR
	.comm	_SAA7146_PSR_DEBI_S,4,2         ## @SAA7146_PSR_DEBI_S
	.comm	_debiwait_maxwait,4,2           ## @debiwait_maxwait
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"wait-for-debi-done maxwait: %d\n"

	.no_dead_strip	_wait_for_debi_done
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wait_for_debi_done
_wait_for_debi_done:                    ; @wait_for_debi_done
	.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	w19, #34464
	movk	w19, #1, lsl #16
Lloh0:
	adrp	x20, _SAA7146_MC2@GOTPAGE
Lloh1:
	ldr	x20, [x20, _SAA7146_MC2@GOTPAGEOFF]
Lloh2:
	adrp	x21, _SAA7146_MC2_UPLD_DEBI@GOTPAGE
Lloh3:
	ldr	x21, [x21, _SAA7146_MC2_UPLD_DEBI@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x20]
	bl	_saaread
	ldr	w8, [x21]
	tst	w8, w0
	b.ne	LBB0_3
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	w0, [x20]
	bl	_saaread
	subs	w19, w19, #1
	b.ne	LBB0_1
LBB0_3:
	mov	w19, #0
	mov	w21, #41248
	movk	w21, #7, lsl #16
Lloh4:
	adrp	x22, _SAA7146_PSR@GOTPAGE
Lloh5:
	ldr	x22, [x22, _SAA7146_PSR@GOTPAGEOFF]
Lloh6:
	adrp	x23, _SAA7146_PSR_DEBI_S@GOTPAGE
Lloh7:
	ldr	x23, [x23, _SAA7146_PSR_DEBI_S@GOTPAGEOFF]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x22]
	bl	_saaread
	ldr	w8, [x23]
	tst	w8, w0
	b.eq	LBB0_7
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w0, [x20]
	bl	_saaread
	add	w19, w19, #1
	cmp	w21, w19
	b.ne	LBB0_4
; %bb.6:
	mov	w19, #41248
	movk	w19, #7, lsl #16
LBB0_7:
Lloh8:
	adrp	x8, _debiwait_maxwait@GOTPAGE
Lloh9:
	ldr	x8, [x8, _debiwait_maxwait@GOTPAGEOFF]
	ldr	w9, [x8]
	cmp	w19, w9
	b.le	LBB0_9
; %bb.8:
	str	w19, [x8]
Lloh10:
	adrp	x0, l_.str@PAGE
Lloh11:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x19
	bl	_printk
LBB0_9:
	cmp	w19, w21
	csetm	w0, eq
	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	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_SAA7146_MC2,4,2                ; @SAA7146_MC2
	.comm	_SAA7146_MC2_UPLD_DEBI,4,2      ; @SAA7146_MC2_UPLD_DEBI
	.comm	_SAA7146_PSR,4,2                ; @SAA7146_PSR
	.comm	_SAA7146_PSR_DEBI_S,4,2         ; @SAA7146_PSR_DEBI_S
	.comm	_debiwait_maxwait,4,2           ; @debiwait_maxwait
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"wait-for-debi-done maxwait: %d\n"

	.no_dead_strip	_wait_for_debi_done
.subsections_via_symbols
