	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bcm2835_wait_transfer_complete
_bcm2835_wait_transfer_complete:        ## @bcm2835_wait_transfer_complete
	.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, %rbx
	movq	(%rdi), %rax
	movq	(%rax), %rax
	movq	_MMC_DATA_READ@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	(%rax), %ecx
	jne	LBB0_1
## %bb.2:
	movq	_SDEDM_FSM_WRITESTART1@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_1:
	movq	_SDEDM_FSM_READWAIT@GOTPCREL(%rip), %rax
LBB0_3:
	movl	(%rax), %r15d
	movq	_SDEDM@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	16(%rbx), %rdi
	callq	_readl
	movq	_SDEDM_FSM_MASK@GOTPCREL(%rip), %r12
	movl	(%r12), %ecx
	andl	%eax, %ecx
	movq	_SDEDM_FSM_IDENTMODE@GOTPCREL(%rip), %r13
	cmpl	(%r13), %ecx
	je	LBB0_12
## %bb.4:
	movq	_SDEDM_FSM_DATAMODE@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %ecx
	je	LBB0_12
## %bb.5:
	cmpl	%r15d, %ecx
	je	LBB0_13
## %bb.6:
	movl	$100000, %r14d                  ## imm = 0x186A0
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	decl	%r14d
	je	LBB0_9
## %bb.10:                              ##   in Loop: Header=BB0_8 Depth=1
	xorl	%eax, %eax
	callq	_cpu_relax
	movq	_SDEDM@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	16(%rbx), %rdi
	callq	_readl
	movl	(%r12), %ecx
	andl	%eax, %ecx
	cmpl	(%r13), %ecx
	je	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_8 Depth=1
	movq	_SDEDM_FSM_DATAMODE@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %ecx
	je	LBB0_12
## %bb.7:                               ##   in Loop: Header=BB0_8 Depth=1
	cmpl	%r15d, %ecx
	jne	LBB0_8
LBB0_13:
	movq	_SDEDM_FORCE_DATA_MODE@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	_SDEDM@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rsi
	addq	16(%rbx), %rsi
	movl	%eax, %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_writel                         ## TAILCALL
LBB0_9:
	movq	8(%rbx), %rdi
	leaq	L_.str(%rip), %rsi
	movl	$100000, %edx                   ## imm = 0x186A0
	callq	_dev_err
	movq	%rbx, %rdi
	callq	_bcm2835_dumpregs
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	subl	(%rax), %ecx
	movq	(%rbx), %rax
	movq	(%rax), %rax
	movl	%ecx, 4(%rax)
LBB0_12:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MMC_DATA_READ,4,2              ## @MMC_DATA_READ
	.comm	_SDEDM_FSM_READWAIT,4,2         ## @SDEDM_FSM_READWAIT
	.comm	_SDEDM_FSM_WRITESTART1,4,2      ## @SDEDM_FSM_WRITESTART1
	.comm	_SDEDM,8,3                      ## @SDEDM
	.comm	_SDEDM_FSM_MASK,4,2             ## @SDEDM_FSM_MASK
	.comm	_SDEDM_FSM_IDENTMODE,4,2        ## @SDEDM_FSM_IDENTMODE
	.comm	_SDEDM_FSM_DATAMODE,4,2         ## @SDEDM_FSM_DATAMODE
	.comm	_SDEDM_FORCE_DATA_MODE,4,2      ## @SDEDM_FORCE_DATA_MODE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"wait_transfer_complete - still waiting after %d retries\n"

	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.no_dead_strip	_bcm2835_wait_transfer_complete
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bcm2835_wait_transfer_complete
_bcm2835_wait_transfer_complete:        ; @bcm2835_wait_transfer_complete
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x0
	ldr	x8, [x0]
	ldr	x8, [x8]
	ldr	w8, [x8]
Lloh0:
	adrp	x9, _MMC_DATA_READ@GOTPAGE
Lloh1:
	ldr	x9, [x9, _MMC_DATA_READ@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
Lloh3:
	adrp	x10, _SDEDM_FSM_READWAIT@GOTPAGE
Lloh4:
	ldr	x10, [x10, _SDEDM_FSM_READWAIT@GOTPAGEOFF]
Lloh5:
	adrp	x11, _SDEDM_FSM_WRITESTART1@GOTPAGE
Lloh6:
	ldr	x11, [x11, _SDEDM_FSM_WRITESTART1@GOTPAGEOFF]
	tst	w9, w8
	csel	x8, x11, x10, eq
	ldr	w21, [x8]
	ldr	x8, [x0, #16]
Lloh7:
	adrp	x20, _SDEDM@GOTPAGE
Lloh8:
	ldr	x20, [x20, _SDEDM@GOTPAGEOFF]
	ldr	x9, [x20]
	add	x0, x9, x8
	bl	_readl
Lloh9:
	adrp	x22, _SDEDM_FSM_MASK@GOTPAGE
Lloh10:
	ldr	x22, [x22, _SDEDM_FSM_MASK@GOTPAGEOFF]
	ldr	w8, [x22]
	and	w8, w8, w0
Lloh11:
	adrp	x23, _SDEDM_FSM_IDENTMODE@GOTPAGE
Lloh12:
	ldr	x23, [x23, _SDEDM_FSM_IDENTMODE@GOTPAGEOFF]
	ldr	w9, [x23]
Lloh13:
	adrp	x24, _SDEDM_FSM_DATAMODE@GOTPAGE
Lloh14:
	ldr	x24, [x24, _SDEDM_FSM_DATAMODE@GOTPAGEOFF]
	ldr	w10, [x24]
	cmp	w8, w9
	ccmp	w8, w10, #4, ne
	b.ne	LBB0_2
LBB0_1:
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_2:
	cmp	w8, w21
	b.eq	LBB0_7
; %bb.3:
	mov	w25, #34464
	movk	w25, #1, lsl #16
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	subs	w25, w25, #1
	b.eq	LBB0_8
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	bl	_cpu_relax
	ldr	x8, [x19, #16]
	ldr	x9, [x20]
	add	x0, x9, x8
	bl	_readl
	ldr	w8, [x22]
	and	w8, w8, w0
	ldr	w9, [x23]
	ldr	w10, [x24]
	cmp	w8, w9
	ccmp	w8, w10, #4, ne
	b.eq	LBB0_1
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	cmp	w8, w21
	b.ne	LBB0_4
LBB0_7:
Lloh15:
	adrp	x8, _SDEDM_FORCE_DATA_MODE@GOTPAGE
Lloh16:
	ldr	x8, [x8, _SDEDM_FORCE_DATA_MODE@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	orr	w0, w8, w0
	ldr	x8, [x19, #16]
	ldr	x9, [x20]
	add	x1, x9, x8
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_writel
LBB0_8:
	ldr	x0, [x19, #8]
Lloh18:
	adrp	x1, l_.str@PAGE
Lloh19:
	add	x1, x1, l_.str@PAGEOFF
	mov	w2, #34464
	movk	w2, #1, lsl #16
	bl	_dev_err
	mov	x0, x19
	bl	_bcm2835_dumpregs
Lloh20:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh21:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	neg	w8, w8
	ldr	x9, [x19]
	ldr	x9, [x9]
	str	w8, [x9, #4]
	b	LBB0_1
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_MMC_DATA_READ,4,2              ; @MMC_DATA_READ
	.comm	_SDEDM_FSM_READWAIT,4,2         ; @SDEDM_FSM_READWAIT
	.comm	_SDEDM_FSM_WRITESTART1,4,2      ; @SDEDM_FSM_WRITESTART1
	.comm	_SDEDM,8,3                      ; @SDEDM
	.comm	_SDEDM_FSM_MASK,4,2             ; @SDEDM_FSM_MASK
	.comm	_SDEDM_FSM_IDENTMODE,4,2        ; @SDEDM_FSM_IDENTMODE
	.comm	_SDEDM_FSM_DATAMODE,4,2         ; @SDEDM_FSM_DATAMODE
	.comm	_SDEDM_FORCE_DATA_MODE,4,2      ; @SDEDM_FORCE_DATA_MODE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"wait_transfer_complete - still waiting after %d retries\n"

	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.no_dead_strip	_bcm2835_wait_transfer_complete
.subsections_via_symbols
