	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function if_cs_prog_real
_if_cs_prog_real:                       ## @if_cs_prog_real
	.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, %rbx
	movq	%rdi, %r15
	movl	(%rsi), %esi
	leaq	L_.str(%rip), %rdi
	callq	_lbs_deb_cs
	movq	_IF_CS_SQ_READ_LOW@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_IF_CS_SQ_HELPER_OK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	callq	_if_cs_poll_while_fw_download
	testl	%eax, %eax
	js	LBB0_16
## %bb.1:
	cmpl	$0, (%rbx)
	jle	LBB0_12
## %bb.2:
	movq	%rbx, %r12
	xorl	%ebx, %ebx
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	_IF_CS_SQ_READ_LOW@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_if_cs_read16
	movl	%eax, %r13d
	testb	$1, %r13b
	je	LBB0_8
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	leaq	L_.str.2(%rip), %rdi
	callq	_pr_info
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	cmpl	$20, %eax
	jge	LBB0_5
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	incl	%eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	jne	LBB0_7
LBB0_8:                                 ##   in Loop: Header=BB0_3 Depth=1
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_3 Depth=1
	subl	%r13d, %ebx
LBB0_9:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	_IF_CS_CMD_LEN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	%r13d, %edx
	callq	_if_cs_write16
	movq	_IF_CS_CMD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movslq	%ebx, %rdx
	shlq	$2, %rdx
	addq	8(%r12), %rdx
	leal	1(%r13), %ecx
	sarl	%ecx
	movq	%r15, %rdi
	callq	_if_cs_write16_rep
	movq	_IF_CS_HOST_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_IF_CS_BIT_COMMAND@GOTPCREL(%rip), %r14
	movl	(%r14), %edx
	movq	%r15, %rdi
	callq	_if_cs_write8
	movq	_IF_CS_HOST_INT_CAUSE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r14), %edx
	movq	%r15, %rdi
	callq	_if_cs_write16
	movq	_IF_CS_CARD_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r14), %edx
	movq	%r15, %rdi
	callq	_if_cs_poll_while_fw_download
	testl	%eax, %eax
	js	LBB0_10
## %bb.11:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	%r12, %rcx
	addl	%r13d, %ebx
	cmpl	(%r12), %ebx
	jl	LBB0_3
LBB0_12:
	movq	_IF_CS_SCRATCH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	$90, %edx
	callq	_if_cs_poll_while_fw_download
	movl	%eax, %r12d
	testl	%eax, %eax
	jns	LBB0_15
## %bb.13:
	leaq	L_.str.5(%rip), %rdi
	jmp	LBB0_14
LBB0_16:
	movl	%eax, %r12d
	leaq	L_.str.1(%rip), %rdi
LBB0_14:
	xorl	%eax, %eax
	callq	_pr_err
	jmp	LBB0_15
LBB0_10:
	movl	%eax, %r12d
	leaq	L_.str.4(%rip), %rdi
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	_pr_err
	jmp	LBB0_15
LBB0_5:
	leaq	L_.str.3(%rip), %rdi
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	callq	_pr_err
	movq	_ENODEV@GOTPCREL(%rip), %rax
	subl	(%rax), %r12d
LBB0_15:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"fw size %td\n"

	.comm	_IF_CS_SQ_READ_LOW,4,2          ## @IF_CS_SQ_READ_LOW
	.comm	_IF_CS_SQ_HELPER_OK,4,2         ## @IF_CS_SQ_HELPER_OK
L_.str.1:                               ## @.str.1
	.asciz	"helper firmware doesn't answer\n"

L_.str.2:                               ## @.str.2
	.asciz	"odd, need to retry this firmware block\n"

L_.str.3:                               ## @.str.3
	.asciz	"could not download firmware\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_IF_CS_CMD_LEN,4,2              ## @IF_CS_CMD_LEN
	.comm	_IF_CS_CMD,4,2                  ## @IF_CS_CMD
	.comm	_IF_CS_HOST_STATUS,4,2          ## @IF_CS_HOST_STATUS
	.comm	_IF_CS_BIT_COMMAND,4,2          ## @IF_CS_BIT_COMMAND
	.comm	_IF_CS_HOST_INT_CAUSE,4,2       ## @IF_CS_HOST_INT_CAUSE
	.comm	_IF_CS_CARD_STATUS,4,2          ## @IF_CS_CARD_STATUS
L_.str.4:                               ## @.str.4
	.asciz	"can't download firmware at 0x%x\n"

	.comm	_IF_CS_SCRATCH,4,2              ## @IF_CS_SCRATCH
L_.str.5:                               ## @.str.5
	.asciz	"firmware download failed\n"

	.no_dead_strip	_if_cs_prog_real
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function if_cs_prog_real
_if_cs_prog_real:                       ; @if_cs_prog_real
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x1
	mov	x19, x0
	ldr	w1, [x1]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_lbs_deb_cs
Lloh2:
	adrp	x24, _IF_CS_SQ_READ_LOW@GOTPAGE
Lloh3:
	ldr	x24, [x24, _IF_CS_SQ_READ_LOW@GOTPAGEOFF]
	ldr	w1, [x24]
Lloh4:
	adrp	x8, _IF_CS_SQ_HELPER_OK@GOTPAGE
Lloh5:
	ldr	x8, [x8, _IF_CS_SQ_HELPER_OK@GOTPAGEOFF]
Lloh6:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_if_cs_poll_while_fw_download
	tbnz	w0, #31, LBB0_12
; %bb.1:
	ldr	w8, [x20]
	cmp	w8, #1
	b.lt	LBB0_10
; %bb.2:
	mov	w25, #0
	mov	w27, #0
Lloh7:
	adrp	x26, _IF_CS_BIT_COMMAND@GOTPAGE
Lloh8:
	ldr	x26, [x26, _IF_CS_BIT_COMMAND@GOTPAGEOFF]
Lloh9:
	adrp	x28, _IF_CS_HOST_INT_CAUSE@GOTPAGE
Lloh10:
	ldr	x28, [x28, _IF_CS_HOST_INT_CAUSE@GOTPAGEOFF]
Lloh11:
	adrp	x21, _IF_CS_CARD_STATUS@GOTPAGE
Lloh12:
	ldr	x21, [x21, _IF_CS_CARD_STATUS@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x24]
	mov	x0, x19
	bl	_if_cs_read16
	mov	x22, x0
	tbz	w0, #0, LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
Lloh13:
	adrp	x0, l_.str.2@PAGE
Lloh14:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_pr_info
	cmp	w27, #20
	b.ge	LBB0_16
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	adds	w27, w27, #1
	b.lo	LBB0_7
LBB0_6:                                 ;   in Loop: Header=BB0_3 Depth=1
	mov	w27, #0
	b	LBB0_8
LBB0_7:                                 ;   in Loop: Header=BB0_3 Depth=1
	sub	w25, w25, w22
LBB0_8:                                 ;   in Loop: Header=BB0_3 Depth=1
Lloh15:
	adrp	x8, _IF_CS_CMD_LEN@GOTPAGE
Lloh16:
	ldr	x8, [x8, _IF_CS_CMD_LEN@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x22
	bl	_if_cs_write16
Lloh18:
	adrp	x8, _IF_CS_CMD@GOTPAGE
Lloh19:
	ldr	x8, [x8, _IF_CS_CMD@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	ldr	x8, [x20, #8]
	add	x2, x8, w25, sxtw #2
	add	w8, w22, #1
	asr	w3, w8, #1
	mov	x0, x19
	bl	_if_cs_write16_rep
Lloh21:
	adrp	x8, _IF_CS_HOST_STATUS@GOTPAGE
Lloh22:
	ldr	x8, [x8, _IF_CS_HOST_STATUS@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	ldr	w2, [x26]
	mov	x0, x19
	bl	_if_cs_write8
	ldr	w1, [x28]
	ldr	w2, [x26]
	mov	x0, x19
	bl	_if_cs_write16
	ldr	w1, [x21]
	ldr	w2, [x26]
	mov	x0, x19
	bl	_if_cs_poll_while_fw_download
	tbnz	w0, #31, LBB0_13
; %bb.9:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [x20]
	add	w25, w25, w22
	cmp	w25, w8
	b.lt	LBB0_3
LBB0_10:
Lloh24:
	adrp	x8, _IF_CS_SCRATCH@GOTPAGE
Lloh25:
	ldr	x8, [x8, _IF_CS_SCRATCH@GOTPAGEOFF]
Lloh26:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #90
	bl	_if_cs_poll_while_fw_download
	mov	x23, x0
	tbz	w0, #31, LBB0_15
; %bb.11:
Lloh27:
	adrp	x0, l_.str.5@PAGE
Lloh28:
	add	x0, x0, l_.str.5@PAGEOFF
	b	LBB0_14
LBB0_12:
	mov	x23, x0
Lloh29:
	adrp	x0, l_.str.1@PAGE
Lloh30:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_14
LBB0_13:
	mov	x23, x0
	str	x25, [sp]
Lloh31:
	adrp	x0, l_.str.4@PAGE
Lloh32:
	add	x0, x0, l_.str.4@PAGEOFF
LBB0_14:
	bl	_pr_err
LBB0_15:
	mov	x0, x23
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_16:
Lloh33:
	adrp	x0, l_.str.3@PAGE
Lloh34:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_pr_err
Lloh35:
	adrp	x8, _ENODEV@GOTPAGE
Lloh36:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh37:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_15
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpAdd	Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"fw size %td\n"

	.comm	_IF_CS_SQ_READ_LOW,4,2          ; @IF_CS_SQ_READ_LOW
	.comm	_IF_CS_SQ_HELPER_OK,4,2         ; @IF_CS_SQ_HELPER_OK
l_.str.1:                               ; @.str.1
	.asciz	"helper firmware doesn't answer\n"

l_.str.2:                               ; @.str.2
	.asciz	"odd, need to retry this firmware block\n"

l_.str.3:                               ; @.str.3
	.asciz	"could not download firmware\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_IF_CS_CMD_LEN,4,2              ; @IF_CS_CMD_LEN
	.comm	_IF_CS_CMD,4,2                  ; @IF_CS_CMD
	.comm	_IF_CS_HOST_STATUS,4,2          ; @IF_CS_HOST_STATUS
	.comm	_IF_CS_BIT_COMMAND,4,2          ; @IF_CS_BIT_COMMAND
	.comm	_IF_CS_HOST_INT_CAUSE,4,2       ; @IF_CS_HOST_INT_CAUSE
	.comm	_IF_CS_CARD_STATUS,4,2          ; @IF_CS_CARD_STATUS
l_.str.4:                               ; @.str.4
	.asciz	"can't download firmware at 0x%x\n"

	.comm	_IF_CS_SCRATCH,4,2              ; @IF_CS_SCRATCH
l_.str.5:                               ; @.str.5
	.asciz	"firmware download failed\n"

	.no_dead_strip	_if_cs_prog_real
.subsections_via_symbols
