	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bcm2835_send_command
_bcm2835_send_command:                  ## @bcm2835_send_command
	.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	%rsi, %r14
	movq	%rdi, %r12
	movq	16(%rdi), %rdi
	movq	32(%r12), %r15
	callq	_WARN_ON
	movq	%r12, %rdi
	movl	$100, %esi
	callq	_bcm2835_read_wait_sdcmd
	movq	_SDCMD_NEW_FLAG@GOTPCREL(%rip), %r13
	testl	%eax, (%r13)
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	callq	_dev_err
	movq	%r12, %rdi
	callq	_bcm2835_dumpregs
	movq	_EILSEQ@GOTPCREL(%rip), %rax
LBB0_11:
	xorl	%ebx, %ebx
	xorl	%ecx, %ecx
	subl	(%rax), %ecx
	movl	%ecx, 24(%r14)
	movq	%r12, %rdi
	callq	_bcm2835_finish_request
	jmp	LBB0_24
LBB0_2:
	cmpq	$0, 16(%r14)
	jne	LBB0_5
## %bb.3:
	movl	(%r14), %edi
	cmpl	$9001, %edi                     ## imm = 0x2329
	jl	LBB0_5
## %bb.4:
	movl	$1000, %esi                     ## imm = 0x3E8
	callq	_DIV_ROUND_UP
	movq	_HZ@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	imull	%ecx, %eax
	addl	%ecx, %eax
	jmp	LBB0_6
LBB0_5:
	movq	_HZ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%eax, %eax
	leal	(%rax,%rax,4), %eax
LBB0_6:
	movslq	%eax, %rsi
	leaq	24(%r12), %rdi
	callq	_schedule_delayed_work
	movq	%r14, 16(%r12)
	movq	_SDHSTS@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdi
	addq	8(%r12), %rdi
	callq	_readl
	movq	_SDHSTS_ERROR_MASK@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_8
## %bb.7:
	movq	(%rbx), %rsi
	addq	8(%r12), %rsi
	movl	%eax, %edi
	callq	_writel
LBB0_8:
	movl	4(%r14), %eax
	movq	_MMC_RSP_136@GOTPCREL(%rip), %rbx
	testl	%eax, (%rbx)
	je	LBB0_12
## %bb.9:
	movq	_MMC_RSP_BUSY@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_12
## %bb.10:
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_12:
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_bcm2835_prepare_data
	movl	8(%r14), %edi
	movq	_SDARG@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%r12), %rsi
	callq	_writel
	movq	_SDCMD_CMD_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	12(%r14), %eax
	movl	$0, (%r12)
	movl	4(%r14), %ecx
	movq	_MMC_RSP_PRESENT@GOTPCREL(%rip), %rdx
	testl	%ecx, (%rdx)
	je	LBB0_13
## %bb.14:
	movl	(%rbx), %edi
	andl	%ecx, %edi
	je	LBB0_16
## %bb.15:
	movq	_SDCMD_LONG_RESPONSE@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edi
LBB0_16:
	orl	%eax, %edi
	movq	_MMC_RSP_BUSY@GOTPCREL(%rip), %rax
	testl	%ecx, (%rax)
	je	LBB0_18
## %bb.17:
	movq	_SDCMD_BUSYWAIT@GOTPCREL(%rip), %rax
	orl	(%rax), %edi
	movl	$1, (%r12)
	jmp	LBB0_18
LBB0_13:
	movq	_SDCMD_NO_RESPONSE@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%eax, %edi
LBB0_18:
	movq	16(%r14), %rax
	testq	%rax, %rax
	je	LBB0_23
## %bb.19:
	movl	(%rax), %eax
	movq	_MMC_DATA_WRITE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	%eax, %ecx
	je	LBB0_21
## %bb.20:
	movq	_SDCMD_WRITE_CMD@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
LBB0_21:
	orl	%ecx, %edi
	movq	_MMC_DATA_READ@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_23
## %bb.22:
	movq	_SDCMD_READ_CMD@GOTPCREL(%rip), %rax
	orl	(%rax), %edi
LBB0_23:
	orl	(%r13), %edi
	movq	_SDCMD@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%r12), %rsi
	callq	_writel
	movl	$1, %ebx
LBB0_24:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SDCMD_NEW_FLAG,4,2             ## @SDCMD_NEW_FLAG
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"previous command never completed.\n"

	.comm	_EILSEQ,4,2                     ## @EILSEQ
	.comm	_HZ,4,2                         ## @HZ
	.comm	_SDHSTS,8,3                     ## @SDHSTS
	.comm	_SDHSTS_ERROR_MASK,4,2          ## @SDHSTS_ERROR_MASK
	.comm	_MMC_RSP_136,4,2                ## @MMC_RSP_136
	.comm	_MMC_RSP_BUSY,4,2               ## @MMC_RSP_BUSY
L_.str.1:                               ## @.str.1
	.asciz	"unsupported response type!\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_SDARG,8,3                      ## @SDARG
	.comm	_SDCMD_CMD_MASK,4,2             ## @SDCMD_CMD_MASK
	.comm	_MMC_RSP_PRESENT,4,2            ## @MMC_RSP_PRESENT
	.comm	_SDCMD_NO_RESPONSE,4,2          ## @SDCMD_NO_RESPONSE
	.comm	_SDCMD_LONG_RESPONSE,4,2        ## @SDCMD_LONG_RESPONSE
	.comm	_SDCMD_BUSYWAIT,4,2             ## @SDCMD_BUSYWAIT
	.comm	_MMC_DATA_WRITE,4,2             ## @MMC_DATA_WRITE
	.comm	_SDCMD_WRITE_CMD,4,2            ## @SDCMD_WRITE_CMD
	.comm	_MMC_DATA_READ,4,2              ## @MMC_DATA_READ
	.comm	_SDCMD_READ_CMD,4,2             ## @SDCMD_READ_CMD
	.comm	_SDCMD,8,3                      ## @SDCMD
	.no_dead_strip	_bcm2835_send_command
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bcm2835_send_command
_bcm2835_send_command:                  ; @bcm2835_send_command
	.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	x20, x1
	mov	x19, x0
	ldr	x21, [x0, #32]
	ldr	x0, [x0, #16]
	bl	_WARN_ON
	mov	x0, x19
	mov	w1, #100
	bl	_bcm2835_read_wait_sdcmd
Lloh0:
	adrp	x22, _SDCMD_NEW_FLAG@GOTPAGE
Lloh1:
	ldr	x22, [x22, _SDCMD_NEW_FLAG@GOTPAGEOFF]
	ldr	w8, [x22]
	tst	w8, w0
	b.eq	LBB0_3
; %bb.1:
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	bl	_dev_err
	mov	x0, x19
	bl	_bcm2835_dumpregs
Lloh4:
	adrp	x8, _EILSEQ@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EILSEQ@GOTPAGEOFF]
LBB0_2:
	ldr	w8, [x8]
	neg	w8, w8
	str	w8, [x20, #24]
	mov	x0, x19
	bl	_bcm2835_finish_request
	mov	w0, #0
	b	LBB0_20
LBB0_3:
	ldr	x8, [x20, #16]
	cbnz	x8, LBB0_6
; %bb.4:
	ldr	w0, [x20]
	mov	w8, #9001
	cmp	w0, w8
	b.lt	LBB0_6
; %bb.5:
	mov	w1, #1000
	bl	_DIV_ROUND_UP
Lloh6:
	adrp	x8, _HZ@GOTPAGE
Lloh7:
	ldr	x8, [x8, _HZ@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	madd	w8, w8, w0, w8
	b	LBB0_7
LBB0_6:
Lloh9:
	adrp	x8, _HZ@GOTPAGE
Lloh10:
	ldr	x8, [x8, _HZ@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	add	w8, w8, w8, lsl #2
	lsl	w8, w8, #1
LBB0_7:
	sxtw	x1, w8
	add	x0, x19, #24
	bl	_schedule_delayed_work
	str	x20, [x19, #16]
	ldr	x8, [x19, #8]
Lloh12:
	adrp	x23, _SDHSTS@GOTPAGE
Lloh13:
	ldr	x23, [x23, _SDHSTS@GOTPAGEOFF]
	ldr	x9, [x23]
	add	x0, x9, x8
	bl	_readl
Lloh14:
	adrp	x8, _SDHSTS_ERROR_MASK@GOTPAGE
Lloh15:
	ldr	x8, [x8, _SDHSTS_ERROR_MASK@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_9
; %bb.8:
	ldr	x8, [x19, #8]
	ldr	x9, [x23]
	add	x1, x9, x8
	bl	_writel
LBB0_9:
	ldr	w8, [x20, #4]
Lloh17:
	adrp	x24, _MMC_RSP_136@GOTPAGE
Lloh18:
	ldr	x24, [x24, _MMC_RSP_136@GOTPAGEOFF]
	ldr	w9, [x24]
Lloh19:
	adrp	x23, _MMC_RSP_BUSY@GOTPAGE
Lloh20:
	ldr	x23, [x23, _MMC_RSP_BUSY@GOTPAGEOFF]
	tst	w9, w8
	b.eq	LBB0_12
; %bb.10:
	ldr	w9, [x23]
	tst	w9, w8
	b.eq	LBB0_12
; %bb.11:
Lloh21:
	adrp	x1, l_.str.1@PAGE
Lloh22:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x21
	bl	_dev_err
Lloh23:
	adrp	x8, _EINVAL@GOTPAGE
Lloh24:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_2
LBB0_12:
	mov	x0, x19
	mov	x1, x20
	bl	_bcm2835_prepare_data
	ldr	w0, [x20, #8]
	ldr	x8, [x19, #8]
Lloh25:
	adrp	x9, _SDARG@GOTPAGE
Lloh26:
	ldr	x9, [x9, _SDARG@GOTPAGEOFF]
Lloh27:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel
	ldr	w8, [x20, #12]
Lloh28:
	adrp	x9, _SDCMD_CMD_MASK@GOTPAGE
Lloh29:
	ldr	x9, [x9, _SDCMD_CMD_MASK@GOTPAGEOFF]
Lloh30:
	ldr	w9, [x9]
	and	w8, w9, w8
	str	wzr, [x19]
	ldr	w9, [x20, #4]
Lloh31:
	adrp	x10, _MMC_RSP_PRESENT@GOTPAGE
Lloh32:
	ldr	x10, [x10, _MMC_RSP_PRESENT@GOTPAGEOFF]
Lloh33:
	ldr	w10, [x10]
	tst	w10, w9
	b.eq	LBB0_16
; %bb.13:
	ldr	w10, [x24]
Lloh34:
	adrp	x11, _SDCMD_LONG_RESPONSE@GOTPAGE
Lloh35:
	ldr	x11, [x11, _SDCMD_LONG_RESPONSE@GOTPAGEOFF]
Lloh36:
	ldr	w11, [x11]
	tst	w10, w9
	csel	w10, wzr, w11, eq
	orr	w8, w10, w8
	ldr	w10, [x23]
	tst	w10, w9
	b.eq	LBB0_15
; %bb.14:
Lloh37:
	adrp	x9, _SDCMD_BUSYWAIT@GOTPAGE
Lloh38:
	ldr	x9, [x9, _SDCMD_BUSYWAIT@GOTPAGEOFF]
Lloh39:
	ldr	w9, [x9]
	orr	w8, w9, w8
	mov	w9, #1
	str	w9, [x19]
LBB0_15:
	ldr	x9, [x20, #16]
	cbnz	x9, LBB0_17
	b	LBB0_19
LBB0_16:
Lloh40:
	adrp	x9, _SDCMD_NO_RESPONSE@GOTPAGE
Lloh41:
	ldr	x9, [x9, _SDCMD_NO_RESPONSE@GOTPAGEOFF]
Lloh42:
	ldr	w9, [x9]
	orr	w8, w9, w8
	ldr	x9, [x20, #16]
	cbz	x9, LBB0_19
LBB0_17:
Lloh43:
	adrp	x10, _MMC_DATA_WRITE@GOTPAGE
Lloh44:
	ldr	x10, [x10, _MMC_DATA_WRITE@GOTPAGEOFF]
	ldr	w9, [x9]
Lloh45:
	ldr	w10, [x10]
Lloh46:
	adrp	x11, _SDCMD_WRITE_CMD@GOTPAGE
Lloh47:
	ldr	x11, [x11, _SDCMD_WRITE_CMD@GOTPAGEOFF]
Lloh48:
	ldr	w11, [x11]
	tst	w10, w9
	csel	w10, wzr, w11, eq
	orr	w8, w10, w8
Lloh49:
	adrp	x10, _MMC_DATA_READ@GOTPAGE
Lloh50:
	ldr	x10, [x10, _MMC_DATA_READ@GOTPAGEOFF]
Lloh51:
	ldr	w10, [x10]
	tst	w10, w9
	b.eq	LBB0_19
; %bb.18:
Lloh52:
	adrp	x9, _SDCMD_READ_CMD@GOTPAGE
Lloh53:
	ldr	x9, [x9, _SDCMD_READ_CMD@GOTPAGEOFF]
Lloh54:
	ldr	w9, [x9]
	orr	w8, w9, w8
LBB0_19:
	ldr	w9, [x22]
	orr	w0, w9, w8
	ldr	x8, [x19, #8]
Lloh55:
	adrp	x9, _SDCMD@GOTPAGE
Lloh56:
	ldr	x9, [x9, _SDCMD@GOTPAGEOFF]
Lloh57:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel
	mov	w0, #1
LBB0_20:
	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	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh49, Lloh50, Lloh51
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh48
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh52, Lloh53, Lloh54
	.loh AdrpLdrGotLdr	Lloh55, Lloh56, Lloh57
	.cfi_endproc
                                        ; -- End function
	.comm	_SDCMD_NEW_FLAG,4,2             ; @SDCMD_NEW_FLAG
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"previous command never completed.\n"

	.comm	_EILSEQ,4,2                     ; @EILSEQ
	.comm	_HZ,4,2                         ; @HZ
	.comm	_SDHSTS,8,3                     ; @SDHSTS
	.comm	_SDHSTS_ERROR_MASK,4,2          ; @SDHSTS_ERROR_MASK
	.comm	_MMC_RSP_136,4,2                ; @MMC_RSP_136
	.comm	_MMC_RSP_BUSY,4,2               ; @MMC_RSP_BUSY
l_.str.1:                               ; @.str.1
	.asciz	"unsupported response type!\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_SDARG,8,3                      ; @SDARG
	.comm	_SDCMD_CMD_MASK,4,2             ; @SDCMD_CMD_MASK
	.comm	_MMC_RSP_PRESENT,4,2            ; @MMC_RSP_PRESENT
	.comm	_SDCMD_NO_RESPONSE,4,2          ; @SDCMD_NO_RESPONSE
	.comm	_SDCMD_LONG_RESPONSE,4,2        ; @SDCMD_LONG_RESPONSE
	.comm	_SDCMD_BUSYWAIT,4,2             ; @SDCMD_BUSYWAIT
	.comm	_MMC_DATA_WRITE,4,2             ; @MMC_DATA_WRITE
	.comm	_SDCMD_WRITE_CMD,4,2            ; @SDCMD_WRITE_CMD
	.comm	_MMC_DATA_READ,4,2              ; @MMC_DATA_READ
	.comm	_SDCMD_READ_CMD,4,2             ; @SDCMD_READ_CMD
	.comm	_SDCMD,8,3                      ; @SDCMD
	.no_dead_strip	_bcm2835_send_command
.subsections_via_symbols
