	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function brcmf_sdiod_regrw_helper
_brcmf_sdiod_regrw_helper:              ## @brcmf_sdiod_regrw_helper
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r13
	movq	(%rdi), %rax
	movq	_BRCMF_SDIOD_NOMEDIUM@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.1:
	movq	_ENOMEDIUM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_19
LBB0_2:
	movl	%r8d, %ebx
	movl	%edx, %r14d
	movq	_REG_F0_REG_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	testl	%esi, %eax
	movl	%esi, -48(%rbp)                 ## 4-byte Spill
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	jne	LBB0_3
## %bb.4:
	movq	_SDIO_FUNC_0@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_3:
	movq	_SDIO_FUNC_1@GOTPCREL(%rip), %rax
LBB0_5:
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	$-1, %r15
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	testl	%ebx, %ebx
	je	LBB0_7
## %bb.8:                               ##   in Loop: Header=BB0_6 Depth=1
	cmpq	$-1, %r15
	je	LBB0_10
LBB0_9:                                 ##   in Loop: Header=BB0_6 Depth=1
	movl	$1000, %edi                     ## imm = 0x3E8
	movl	$2000, %esi                     ## imm = 0x7D0
	callq	_usleep_range
LBB0_10:                                ##   in Loop: Header=BB0_6 Depth=1
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	movl	%r14d, %ecx
	movq	%r13, %r8
	movl	%ebx, %r9d
	callq	_brcmf_sdiod_request_data
	movl	%eax, %r12d
	movq	_ENOMEDIUM@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	testl	%r12d, %r12d
	je	LBB0_15
## %bb.11:                              ##   in Loop: Header=BB0_6 Depth=1
	movl	%r12d, %eax
	addl	%ecx, %eax
	je	LBB0_16
## %bb.12:                              ##   in Loop: Header=BB0_6 Depth=1
	incq	%r15
	movq	_SDIOH_API_ACCESS_RETRY_LIMIT@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r15
	jl	LBB0_6
	jmp	LBB0_13
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_6 Depth=1
	movq	%r13, %rdi
	xorl	%esi, %esi
	movl	%r14d, %edx
	callq	_memset
	cmpq	$-1, %r15
	jne	LBB0_9
	jmp	LBB0_10
LBB0_15:
	xorl	%eax, %eax
	testl	%ecx, %ecx
	jne	LBB0_19
LBB0_16:
	movq	_BRCMF_SDIOD_NOMEDIUM@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_brcmf_sdiod_change_state
	jmp	LBB0_18
LBB0_13:
	movq	_SBSDIO_FUNC1_SLEEPCSR@GOTPCREL(%rip), %rax
	movl	-48(%rbp), %r8d                 ## 4-byte Reload
	cmpl	%r8d, (%rax)
	jne	LBB0_14
## %bb.17:
	testl	%ebx, %ebx
	movq	_SDIO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.2(%rip), %rax
	leaq	L_.str.1(%rip), %rdx
	cmoveq	%rax, %rdx
	leaq	L_.str(%rip), %rsi
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	movl	%r12d, %r9d
	callq	_brcmf_dbg
	jmp	LBB0_18
LBB0_14:
	testl	%ebx, %ebx
	leaq	L_.str.2(%rip), %rax
	leaq	L_.str.1(%rip), %rsi
	cmoveq	%rax, %rsi
	leaq	L_.str(%rip), %rdi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movl	%r8d, %ecx
	movl	%r12d, %r8d
	callq	_brcmf_err
LBB0_18:
	movl	%r12d, %eax
LBB0_19:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BRCMF_SDIOD_NOMEDIUM,8,3       ## @BRCMF_SDIOD_NOMEDIUM
	.comm	_ENOMEDIUM,4,2                  ## @ENOMEDIUM
	.comm	_REG_F0_REG_MASK,4,2            ## @REG_F0_REG_MASK
	.comm	_SDIO_FUNC_0,4,2                ## @SDIO_FUNC_0
	.comm	_SDIO_FUNC_1,4,2                ## @SDIO_FUNC_1
	.comm	_SDIOH_API_ACCESS_RETRY_LIMIT,8,3 ## @SDIOH_API_ACCESS_RETRY_LIMIT
	.comm	_SBSDIO_FUNC1_SLEEPCSR,4,2      ## @SBSDIO_FUNC1_SLEEPCSR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to %s data F%d@0x%05x, err: %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"write"

L_.str.2:                               ## @.str.2
	.asciz	"read"

	.comm	_SDIO,4,2                       ## @SDIO
	.no_dead_strip	_brcmf_sdiod_regrw_helper
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function brcmf_sdiod_regrw_helper
_brcmf_sdiod_regrw_helper:              ; @brcmf_sdiod_regrw_helper
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _BRCMF_SDIOD_NOMEDIUM@GOTPAGE
Lloh1:
	ldr	x9, [x9, _BRCMF_SDIOD_NOMEDIUM@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _ENOMEDIUM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ENOMEDIUM@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_16
LBB0_2:
	mov	x20, x4
	mov	x24, x3
	mov	x25, x2
	mov	x19, x1
	mov	x22, x0
Lloh6:
	adrp	x8, _REG_F0_REG_MASK@GOTPAGE
Lloh7:
	ldr	x8, [x8, _REG_F0_REG_MASK@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
Lloh9:
	adrp	x9, _SDIO_FUNC_0@GOTPAGE
Lloh10:
	ldr	x9, [x9, _SDIO_FUNC_0@GOTPAGEOFF]
Lloh11:
	adrp	x10, _SDIO_FUNC_1@GOTPAGE
Lloh12:
	ldr	x10, [x10, _SDIO_FUNC_1@GOTPAGEOFF]
	bics	wzr, w1, w8
	csel	x8, x9, x10, eq
	ldr	w21, [x8]
	mov	x27, #-1
Lloh13:
	adrp	x28, _ENOMEDIUM@GOTPAGE
Lloh14:
	ldr	x28, [x28, _ENOMEDIUM@GOTPAGEOFF]
Lloh15:
	adrp	x26, _SDIOH_API_ACCESS_RETRY_LIMIT@GOTPAGE
Lloh16:
	ldr	x26, [x26, _SDIOH_API_ACCESS_RETRY_LIMIT@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	cbz	w20, LBB0_9
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	cmn	x27, #1
	b.eq	LBB0_6
LBB0_5:                                 ;   in Loop: Header=BB0_3 Depth=1
	mov	w0, #1000
	mov	w1, #2000
	bl	_usleep_range
LBB0_6:                                 ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x22
	mov	x1, x21
	mov	x2, x19
	mov	x3, x25
	mov	x4, x24
	mov	x5, x20
	bl	_brcmf_sdiod_request_data
	mov	x23, x0
	ldr	w8, [x28]
	cbz	w0, LBB0_10
; %bb.7:                                ;   in Loop: Header=BB0_3 Depth=1
	cmn	w23, w8
	b.eq	LBB0_12
; %bb.8:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x26]
	add	x27, x27, #1
	cmp	x27, x8
	b.lt	LBB0_3
	b	LBB0_13
LBB0_9:                                 ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x24
	mov	w1, #0
	mov	x2, x25
	bl	_memset
	cmn	x27, #1
	b.ne	LBB0_5
	b	LBB0_6
LBB0_10:
	cbz	w8, LBB0_12
; %bb.11:
	mov	w23, #0
	b	LBB0_16
LBB0_12:
Lloh17:
	adrp	x8, _BRCMF_SDIOD_NOMEDIUM@GOTPAGE
Lloh18:
	ldr	x8, [x8, _BRCMF_SDIOD_NOMEDIUM@GOTPAGEOFF]
Lloh19:
	ldr	x1, [x8]
	mov	x0, x22
	bl	_brcmf_sdiod_change_state
	b	LBB0_16
LBB0_13:
Lloh20:
	adrp	x8, _SBSDIO_FUNC1_SLEEPCSR@GOTPAGE
Lloh21:
	ldr	x8, [x8, _SBSDIO_FUNC1_SLEEPCSR@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	cmp	w8, w19
	b.ne	LBB0_15
; %bb.14:
Lloh23:
	adrp	x8, _SDIO@GOTPAGE
Lloh24:
	ldr	x8, [x8, _SDIO@GOTPAGEOFF]
Lloh25:
	ldr	w0, [x8]
Lloh26:
	adrp	x8, l_.str.1@PAGE
Lloh27:
	add	x8, x8, l_.str.1@PAGEOFF
Lloh28:
	adrp	x9, l_.str.2@PAGE
Lloh29:
	add	x9, x9, l_.str.2@PAGEOFF
	cmp	w20, #0
	csel	x2, x9, x8, eq
Lloh30:
	adrp	x1, l_.str@PAGE
Lloh31:
	add	x1, x1, l_.str@PAGEOFF
	mov	x3, x21
	mov	x4, x19
	mov	x5, x23
	bl	_brcmf_dbg
	b	LBB0_16
LBB0_15:
Lloh32:
	adrp	x8, l_.str.1@PAGE
Lloh33:
	add	x8, x8, l_.str.1@PAGEOFF
Lloh34:
	adrp	x9, l_.str.2@PAGE
Lloh35:
	add	x9, x9, l_.str.2@PAGEOFF
	cmp	w20, #0
	csel	x1, x9, x8, eq
Lloh36:
	adrp	x0, l_.str@PAGE
Lloh37:
	add	x0, x0, l_.str@PAGEOFF
	mov	x2, x21
	mov	x3, x19
	mov	x4, x23
	bl	_brcmf_err
LBB0_16:
	mov	x0, x23
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpAdd	Lloh32, Lloh33
	.cfi_endproc
                                        ; -- End function
	.comm	_BRCMF_SDIOD_NOMEDIUM,8,3       ; @BRCMF_SDIOD_NOMEDIUM
	.comm	_ENOMEDIUM,4,2                  ; @ENOMEDIUM
	.comm	_REG_F0_REG_MASK,4,2            ; @REG_F0_REG_MASK
	.comm	_SDIO_FUNC_0,4,2                ; @SDIO_FUNC_0
	.comm	_SDIO_FUNC_1,4,2                ; @SDIO_FUNC_1
	.comm	_SDIOH_API_ACCESS_RETRY_LIMIT,8,3 ; @SDIOH_API_ACCESS_RETRY_LIMIT
	.comm	_SBSDIO_FUNC1_SLEEPCSR,4,2      ; @SBSDIO_FUNC1_SLEEPCSR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to %s data F%d@0x%05x, err: %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"write"

l_.str.2:                               ; @.str.2
	.asciz	"read"

	.comm	_SDIO,4,2                       ; @SDIO
	.no_dead_strip	_brcmf_sdiod_regrw_helper
.subsections_via_symbols
