	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function brcmf_sdio_kso_control
_brcmf_sdio_kso_control:                ## @brcmf_sdio_kso_control
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	movq	%rdi, %r14
	movl	$0, -44(%rbp)
	movq	_TRACE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_brcmf_dbg
	movq	(%r14), %rax
	movl	(%rax), %edi
	callq	_sdio_retune_crc_disable
	testl	%ebx, %ebx
	je	LBB0_2
## %bb.1:
	movq	(%r14), %rax
	movl	(%rax), %edi
	callq	_sdio_retune_hold_now
LBB0_2:
	movq	_SBSDIO_FUNC1_SLEEPCSR_KSO_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movl	%ebx, %edx
	shll	%cl, %edx
	movq	(%r14), %rdi
	movq	_SBSDIO_FUNC1_SLEEPCSR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-44(%rbp), %rcx
	movl	%edx, -68(%rbp)                 ## 4-byte Spill
	callq	_brcmf_sdiod_writeb
	testl	%ebx, %ebx
	movq	%r14, -80(%rbp)                 ## 8-byte Spill
	je	LBB0_3
## %bb.21:
	movl	%ebx, -48(%rbp)                 ## 4-byte Spill
	movq	_SBSDIO_FUNC1_SLEEPCSR_KSO_MASK@GOTPCREL(%rip), %rax
	movq	_SBSDIO_FUNC1_SLEEPCSR_DEVON_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	orl	(%rax), %ebx
	movl	$2000, %edi                     ## imm = 0x7D0
	movl	$3000, %esi                     ## imm = 0xBB8
	callq	_usleep_range
	movl	%ebx, -56(%rbp)                 ## 4-byte Spill
	movl	%ebx, -52(%rbp)                 ## 4-byte Spill
	jmp	LBB0_5
LBB0_3:
	movq	8(%r14), %rax
	movq	(%rax), %rax
	movq	_CY_CC_43012_CHIP_ID@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_20
## %bb.4:
	movl	%ebx, -48(%rbp)                 ## 4-byte Spill
	movq	_SBSDIO_FUNC1_SLEEPCSR_KSO_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movl	$0, -56(%rbp)                   ## 4-byte Folded Spill
LBB0_5:
	movl	$0, -64(%rbp)                   ## 4-byte Folded Spill
	leaq	-44(%rbp), %r13
	xorl	%r12d, %r12d
	movq	-80(%rbp), %rbx                 ## 8-byte Reload
	movq	_SBSDIO_FUNC1_SLEEPCSR@GOTPCREL(%rip), %r14
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_6 Depth=1
	andl	-52(%rbp), %eax                 ## 4-byte Folded Reload
	xorl	%ecx, %ecx
	cmpl	-56(%rbp), %eax                 ## 4-byte Folded Reload
	je	LBB0_8
LBB0_12:                                ##   in Loop: Header=BB0_6 Depth=1
	movl	%ecx, -64(%rbp)                 ## 4-byte Spill
	movq	_KSO_WAIT_US@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_udelay
	movq	(%rbx), %rdi
	movl	(%r14), %esi
	movl	-68(%rbp), %edx                 ## 4-byte Reload
	movq	%r13, %rcx
	callq	_brcmf_sdiod_writeb
	leal	1(%r12), %r15d
	movq	_MAX_KSO_ATTEMPTS@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r12d
	movl	%r15d, %r12d
	jge	LBB0_13
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%rbx), %rdi
	movl	(%r14), %esi
	movq	%r13, %rdx
	callq	_brcmf_sdiod_readb
	cmpl	$0, -44(%rbp)
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	je	LBB0_7
## %bb.9:                               ##   in Loop: Header=BB0_6 Depth=1
	movl	-64(%rbp), %ecx                 ## 4-byte Reload
	movq	_BRCMF_SDIO_MAX_ACCESS_ERRORS@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ecx
	jg	LBB0_10
## %bb.11:                              ##   in Loop: Header=BB0_6 Depth=1
	incl	%ecx
	jmp	LBB0_12
LBB0_10:
	movl	%r12d, %r15d
LBB0_13:
	cmpl	$3, %r15d
	jl	LBB0_15
LBB0_14:
	movq	_SDIO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	-44(%rbp), %r8d
	leaq	L_.str.1(%rip), %rsi
	movl	%r15d, %edx
	movl	-60(%rbp), %ecx                 ## 4-byte Reload
	xorl	%eax, %eax
	callq	_brcmf_dbg
LBB0_15:
	movq	_MAX_KSO_ATTEMPTS@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r15d
	jle	LBB0_17
## %bb.16:
	movl	-44(%rbp), %edx
	leaq	L_.str.2(%rip), %rdi
	movl	-60(%rbp), %esi                 ## 4-byte Reload
	callq	_brcmf_err
LBB0_17:
	cmpl	$0, -48(%rbp)                   ## 4-byte Folded Reload
	movq	-80(%rbp), %rbx                 ## 8-byte Reload
	je	LBB0_19
## %bb.18:
	movq	(%rbx), %rax
	movl	(%rax), %edi
	callq	_sdio_retune_release
LBB0_19:
	movq	(%rbx), %rax
	movl	(%rax), %edi
	callq	_sdio_retune_crc_enable
LBB0_20:
	movl	-44(%rbp), %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movl	%r12d, %r15d
	cmpl	$3, %r15d
	jge	LBB0_14
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.comm	_TRACE,4,2                      ## @TRACE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Enter: on=%d\n"

	.comm	_SBSDIO_FUNC1_SLEEPCSR_KSO_SHIFT,4,2 ## @SBSDIO_FUNC1_SLEEPCSR_KSO_SHIFT
	.comm	_SBSDIO_FUNC1_SLEEPCSR,4,2      ## @SBSDIO_FUNC1_SLEEPCSR
	.comm	_CY_CC_43012_CHIP_ID,8,3        ## @CY_CC_43012_CHIP_ID
	.comm	_SBSDIO_FUNC1_SLEEPCSR_KSO_MASK,4,2 ## @SBSDIO_FUNC1_SLEEPCSR_KSO_MASK
	.comm	_SBSDIO_FUNC1_SLEEPCSR_DEVON_MASK,4,2 ## @SBSDIO_FUNC1_SLEEPCSR_DEVON_MASK
	.comm	_BRCMF_SDIO_MAX_ACCESS_ERRORS,4,2 ## @BRCMF_SDIO_MAX_ACCESS_ERRORS
	.comm	_KSO_WAIT_US,4,2                ## @KSO_WAIT_US
	.comm	_MAX_KSO_ATTEMPTS,4,2           ## @MAX_KSO_ATTEMPTS
	.comm	_SDIO,4,2                       ## @SDIO
L_.str.1:                               ## @.str.1
	.asciz	"try_cnt=%d rd_val=0x%x err=%d\n"

L_.str.2:                               ## @.str.2
	.asciz	"max tries: rd_val=0x%x err=%d\n"

	.no_dead_strip	_brcmf_sdio_kso_control
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function brcmf_sdio_kso_control
_brcmf_sdio_kso_control:                ; @brcmf_sdio_kso_control
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	str	wzr, [sp, #28]
Lloh0:
	adrp	x8, _TRACE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _TRACE@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x20
	bl	_brcmf_dbg
	ldr	x8, [x19]
	ldr	w0, [x8]
	bl	_sdio_retune_crc_disable
	cbz	w20, LBB0_2
; %bb.1:
	ldr	x8, [x19]
	ldr	w0, [x8]
	bl	_sdio_retune_hold_now
LBB0_2:
Lloh5:
	adrp	x8, _SBSDIO_FUNC1_SLEEPCSR_KSO_SHIFT@GOTPAGE
Lloh6:
	ldr	x8, [x8, _SBSDIO_FUNC1_SLEEPCSR_KSO_SHIFT@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	lsl	w21, w20, w8
	ldr	x0, [x19]
Lloh8:
	adrp	x24, _SBSDIO_FUNC1_SLEEPCSR@GOTPAGE
Lloh9:
	ldr	x24, [x24, _SBSDIO_FUNC1_SLEEPCSR@GOTPAGEOFF]
	ldr	w1, [x24]
	add	x3, sp, #28
	mov	x2, x21
	bl	_brcmf_sdiod_writeb
	cbz	w20, LBB0_4
; %bb.3:
	str	w20, [sp, #20]                  ; 4-byte Folded Spill
Lloh10:
	adrp	x8, _SBSDIO_FUNC1_SLEEPCSR_KSO_MASK@GOTPAGE
Lloh11:
	ldr	x8, [x8, _SBSDIO_FUNC1_SLEEPCSR_KSO_MASK@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
Lloh13:
	adrp	x9, _SBSDIO_FUNC1_SLEEPCSR_DEVON_MASK@GOTPAGE
Lloh14:
	ldr	x9, [x9, _SBSDIO_FUNC1_SLEEPCSR_DEVON_MASK@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	orr	w27, w9, w8
	mov	w0, #2000
	mov	w1, #3000
	bl	_usleep_range
	str	w27, [sp, #24]                  ; 4-byte Folded Spill
	b	LBB0_6
LBB0_4:
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
Lloh16:
	adrp	x9, _CY_CC_43012_CHIP_ID@GOTPAGE
Lloh17:
	ldr	x9, [x9, _CY_CC_43012_CHIP_ID@GOTPAGEOFF]
Lloh18:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_21
; %bb.5:
	stp	w20, wzr, [sp, #20]             ; 8-byte Folded Spill
Lloh19:
	adrp	x8, _SBSDIO_FUNC1_SLEEPCSR_KSO_MASK@GOTPAGE
Lloh20:
	ldr	x8, [x8, _SBSDIO_FUNC1_SLEEPCSR_KSO_MASK@GOTPAGEOFF]
Lloh21:
	ldr	w27, [x8]
LBB0_6:
	mov	w26, #0
	mov	w28, #0
Lloh22:
	adrp	x20, _KSO_WAIT_US@GOTPAGE
Lloh23:
	ldr	x20, [x20, _KSO_WAIT_US@GOTPAGEOFF]
Lloh24:
	adrp	x25, _MAX_KSO_ATTEMPTS@GOTPAGE
Lloh25:
	ldr	x25, [x25, _MAX_KSO_ATTEMPTS@GOTPAGEOFF]
	b	LBB0_10
LBB0_7:                                 ;   in Loop: Header=BB0_10 Depth=1
Lloh26:
	adrp	x8, _BRCMF_SDIO_MAX_ACCESS_ERRORS@GOTPAGE
Lloh27:
	ldr	x8, [x8, _BRCMF_SDIO_MAX_ACCESS_ERRORS@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	cmp	w26, w8
	b.gt	LBB0_13
; %bb.8:                                ;   in Loop: Header=BB0_10 Depth=1
	add	w26, w26, #1
LBB0_9:                                 ;   in Loop: Header=BB0_10 Depth=1
	ldr	w0, [x20]
	bl	_udelay
	ldr	x0, [x19]
	ldr	w1, [x24]
	add	x3, sp, #28
	mov	x2, x21
	bl	_brcmf_sdiod_writeb
	add	w23, w28, #1
	ldr	w8, [x25]
	cmp	w28, w8
	mov	x28, x23
	b.ge	LBB0_14
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x19]
	ldr	w1, [x24]
	add	x2, sp, #28
	bl	_brcmf_sdiod_readb
	mov	x22, x0
	ldr	w8, [sp, #28]
	cbnz	w8, LBB0_7
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	and	w8, w22, w27
	ldr	w9, [sp, #24]                   ; 4-byte Folded Reload
	cmp	w8, w9
	b.eq	LBB0_13
; %bb.12:                               ;   in Loop: Header=BB0_10 Depth=1
	mov	w26, #0
	b	LBB0_9
LBB0_13:
	mov	x23, x28
LBB0_14:
	cmp	w23, #3
	ldr	w20, [sp, #20]                  ; 4-byte Folded Reload
	b.lt	LBB0_16
; %bb.15:
Lloh29:
	adrp	x8, _SDIO@GOTPAGE
Lloh30:
	ldr	x8, [x8, _SDIO@GOTPAGEOFF]
Lloh31:
	ldr	w0, [x8]
	ldr	w8, [sp, #28]
	stp	x22, x8, [sp]
Lloh32:
	adrp	x1, l_.str.1@PAGE
Lloh33:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x23
	bl	_brcmf_dbg
LBB0_16:
	ldr	w8, [x25]
	cmp	w23, w8
	b.le	LBB0_18
; %bb.17:
	ldr	w2, [sp, #28]
Lloh34:
	adrp	x0, l_.str.2@PAGE
Lloh35:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x22
	bl	_brcmf_err
LBB0_18:
	cbz	w20, LBB0_20
; %bb.19:
	ldr	x8, [x19]
	ldr	w0, [x8]
	bl	_sdio_retune_release
LBB0_20:
	ldr	x8, [x19]
	ldr	w0, [x8]
	bl	_sdio_retune_crc_enable
LBB0_21:
	ldr	w0, [sp, #28]
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpAdd	Lloh34, Lloh35
	.cfi_endproc
                                        ; -- End function
	.comm	_TRACE,4,2                      ; @TRACE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Enter: on=%d\n"

	.comm	_SBSDIO_FUNC1_SLEEPCSR_KSO_SHIFT,4,2 ; @SBSDIO_FUNC1_SLEEPCSR_KSO_SHIFT
	.comm	_SBSDIO_FUNC1_SLEEPCSR,4,2      ; @SBSDIO_FUNC1_SLEEPCSR
	.comm	_CY_CC_43012_CHIP_ID,8,3        ; @CY_CC_43012_CHIP_ID
	.comm	_SBSDIO_FUNC1_SLEEPCSR_KSO_MASK,4,2 ; @SBSDIO_FUNC1_SLEEPCSR_KSO_MASK
	.comm	_SBSDIO_FUNC1_SLEEPCSR_DEVON_MASK,4,2 ; @SBSDIO_FUNC1_SLEEPCSR_DEVON_MASK
	.comm	_BRCMF_SDIO_MAX_ACCESS_ERRORS,4,2 ; @BRCMF_SDIO_MAX_ACCESS_ERRORS
	.comm	_KSO_WAIT_US,4,2                ; @KSO_WAIT_US
	.comm	_MAX_KSO_ATTEMPTS,4,2           ; @MAX_KSO_ATTEMPTS
	.comm	_SDIO,4,2                       ; @SDIO
l_.str.1:                               ; @.str.1
	.asciz	"try_cnt=%d rd_val=0x%x err=%d\n"

l_.str.2:                               ; @.str.2
	.asciz	"max tries: rd_val=0x%x err=%d\n"

	.no_dead_strip	_brcmf_sdio_kso_control
.subsections_via_symbols
