	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mwifiex_sdio_rdwr_firmware
_mwifiex_sdio_rdwr_firmware:            ## @mwifiex_sdio_rdwr_firmware
	.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, %r13
	movq	%rdi, %r14
	movq	(%rdi), %r12
	movl	8(%r12), %edi
	movq	(%r12), %rax
	movq	(%rax), %rsi
	movl	8(%rax), %edx
	leaq	-44(%rbp), %rcx
	callq	_sdio_writeb
	cmpl	$0, -44(%rbp)
	je	LBB0_1
## %bb.3:
	movq	_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
LBB0_17:
	movq	%r14, %rdi
	callq	_mwifiex_dbg
	movq	_RDWR_STATUS_FAILURE@GOTPCREL(%rip), %rax
LBB0_18:
	movl	(%rax), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	_MAX_POLL_TRIES@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	cmpl	$0, (%rax)
	jg	LBB0_4
## %bb.2:
	xorl	%ebx, %ebx
LBB0_14:
	movq	(%r12), %rax
	cmpq	(%rax), %rbx
	jne	LBB0_15
## %bb.16:
	movq	_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.4(%rip), %rdx
	jmp	LBB0_17
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_4 Depth=1
	movl	$100, %edi
	movl	$200, %esi
	callq	_usleep_range
	incl	%r15d
	movq	_MAX_POLL_TRIES@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r15d
	jge	LBB0_14
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	8(%r12), %edi
	movq	(%r12), %rax
	movl	8(%rax), %esi
	leaq	-44(%rbp), %rdx
	callq	_sdio_readb
	cmpl	$0, -44(%rbp)
	jne	LBB0_5
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%rax, %rbx
	movq	_FW_DUMP_DONE@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rbx
	je	LBB0_14
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	testq	%r13, %r13
	je	LBB0_10
## %bb.8:                               ##   in Loop: Header=BB0_4 Depth=1
	cmpq	%r13, %rbx
	je	LBB0_9
LBB0_10:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	(%r12), %rax
	cmpq	(%rax), %rbx
	je	LBB0_13
## %bb.11:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	_WARN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	leaq	L_.str.2(%rip), %rdx
	callq	_mwifiex_dbg
	movl	8(%r12), %edi
	movq	(%r12), %rax
	movq	(%rax), %rsi
	movl	8(%rax), %edx
	leaq	-44(%rbp), %rcx
	callq	_sdio_writeb
	cmpl	$0, -44(%rbp)
	je	LBB0_13
## %bb.12:
	movq	_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.3(%rip), %rdx
	jmp	LBB0_17
LBB0_15:
	movq	_RDWR_STATUS_SUCCESS@GOTPCREL(%rip), %rax
	jmp	LBB0_18
LBB0_5:
	movq	_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
	jmp	LBB0_17
LBB0_9:
	movq	_RDWR_STATUS_DONE@GOTPCREL(%rip), %rax
	jmp	LBB0_18
	.cfi_endproc
                                        ## -- End function
	.comm	_ERROR,4,2                      ## @ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"SDIO Write ERR\n"

	.comm	_RDWR_STATUS_FAILURE,4,2        ## @RDWR_STATUS_FAILURE
	.comm	_MAX_POLL_TRIES,4,2             ## @MAX_POLL_TRIES
L_.str.1:                               ## @.str.1
	.asciz	"SDIO read err\n"

	.comm	_FW_DUMP_DONE,8,3               ## @FW_DUMP_DONE
	.comm	_RDWR_STATUS_DONE,4,2           ## @RDWR_STATUS_DONE
	.comm	_WARN,4,2                       ## @WARN
L_.str.2:                               ## @.str.2
	.asciz	"The ctrl reg was changed, re-try again\n"

L_.str.3:                               ## @.str.3
	.asciz	"SDIO write err\n"

L_.str.4:                               ## @.str.4
	.asciz	"Fail to pull ctrl_data\n"

	.comm	_RDWR_STATUS_SUCCESS,4,2        ## @RDWR_STATUS_SUCCESS
	.no_dead_strip	_mwifiex_sdio_rdwr_firmware
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mwifiex_sdio_rdwr_firmware
_mwifiex_sdio_rdwr_firmware:            ; @mwifiex_sdio_rdwr_firmware
	.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	x23, [x0]
	ldr	w0, [x23, #8]
	ldr	x8, [x23]
	ldr	x1, [x8]
	ldr	w2, [x8, #8]
	add	x3, sp, #12
	bl	_sdio_writeb
	ldr	w8, [sp, #12]
	cbz	w8, LBB0_4
; %bb.1:
Lloh0:
	adrp	x8, _ERROR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ERROR@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x2, l_.str@PAGE
Lloh4:
	add	x2, x2, l_.str@PAGEOFF
LBB0_2:
	mov	x0, x19
	bl	_mwifiex_dbg
Lloh5:
	adrp	x24, _RDWR_STATUS_FAILURE@GOTPAGE
Lloh6:
	ldr	x24, [x24, _RDWR_STATUS_FAILURE@GOTPAGEOFF]
LBB0_3:
	ldr	w0, [x24]
	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_4:
Lloh7:
	adrp	x25, _MAX_POLL_TRIES@GOTPAGE
Lloh8:
	ldr	x25, [x25, _MAX_POLL_TRIES@GOTPAGEOFF]
	ldr	w8, [x25]
	cmp	w8, #1
	b.lt	LBB0_14
; %bb.5:
	mov	w26, #0
Lloh9:
	adrp	x27, _FW_DUMP_DONE@GOTPAGE
Lloh10:
	ldr	x27, [x27, _FW_DUMP_DONE@GOTPAGEOFF]
Lloh11:
	adrp	x24, _RDWR_STATUS_DONE@GOTPAGE
Lloh12:
	ldr	x24, [x24, _RDWR_STATUS_DONE@GOTPAGEOFF]
Lloh13:
	adrp	x28, _WARN@GOTPAGE
Lloh14:
	ldr	x28, [x28, _WARN@GOTPAGEOFF]
Lloh15:
	adrp	x21, l_.str.2@PAGE
Lloh16:
	add	x21, x21, l_.str.2@PAGEOFF
	b	LBB0_7
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	mov	w0, #100
	mov	w1, #200
	bl	_usleep_range
	add	w26, w26, #1
	ldr	w8, [x25]
	cmp	w26, w8
	b.ge	LBB0_15
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x23, #8]
	ldr	x8, [x23]
	ldr	w1, [x8, #8]
	add	x2, sp, #12
	bl	_sdio_readb
	ldr	w8, [sp, #12]
	cbnz	w8, LBB0_18
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	mov	x22, x0
	ldr	x8, [x27]
	cmp	x0, x8
	b.eq	LBB0_15
; %bb.9:                                ;   in Loop: Header=BB0_7 Depth=1
	cbz	x20, LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_7 Depth=1
	cmp	x22, x20
	b.eq	LBB0_3
LBB0_11:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	x8, [x23]
	ldr	x8, [x8]
	cmp	x22, x8
	b.eq	LBB0_6
; %bb.12:                               ;   in Loop: Header=BB0_7 Depth=1
	ldr	w1, [x28]
	mov	x0, x19
	mov	x2, x21
	bl	_mwifiex_dbg
	ldr	w0, [x23, #8]
	ldr	x8, [x23]
	ldr	x1, [x8]
	ldr	w2, [x8, #8]
	add	x3, sp, #12
	bl	_sdio_writeb
	ldr	w8, [sp, #12]
	cbz	w8, LBB0_6
; %bb.13:
Lloh17:
	adrp	x8, _ERROR@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ERROR@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
Lloh20:
	adrp	x2, l_.str.3@PAGE
Lloh21:
	add	x2, x2, l_.str.3@PAGEOFF
	b	LBB0_2
LBB0_14:
	mov	x22, #0
LBB0_15:
	ldr	x8, [x23]
	ldr	x8, [x8]
	cmp	x22, x8
	b.ne	LBB0_17
; %bb.16:
Lloh22:
	adrp	x8, _ERROR@GOTPAGE
Lloh23:
	ldr	x8, [x8, _ERROR@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
Lloh25:
	adrp	x2, l_.str.4@PAGE
Lloh26:
	add	x2, x2, l_.str.4@PAGEOFF
	b	LBB0_2
LBB0_17:
Lloh27:
	adrp	x24, _RDWR_STATUS_SUCCESS@GOTPAGE
Lloh28:
	ldr	x24, [x24, _RDWR_STATUS_SUCCESS@GOTPAGEOFF]
	b	LBB0_3
LBB0_18:
Lloh29:
	adrp	x8, _ERROR@GOTPAGE
Lloh30:
	ldr	x8, [x8, _ERROR@GOTPAGEOFF]
Lloh31:
	ldr	w1, [x8]
Lloh32:
	adrp	x2, l_.str.1@PAGE
Lloh33:
	add	x2, x2, l_.str.1@PAGEOFF
	b	LBB0_2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_ERROR,4,2                      ; @ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"SDIO Write ERR\n"

	.comm	_RDWR_STATUS_FAILURE,4,2        ; @RDWR_STATUS_FAILURE
	.comm	_MAX_POLL_TRIES,4,2             ; @MAX_POLL_TRIES
l_.str.1:                               ; @.str.1
	.asciz	"SDIO read err\n"

	.comm	_FW_DUMP_DONE,8,3               ; @FW_DUMP_DONE
	.comm	_RDWR_STATUS_DONE,4,2           ; @RDWR_STATUS_DONE
	.comm	_WARN,4,2                       ; @WARN
l_.str.2:                               ; @.str.2
	.asciz	"The ctrl reg was changed, re-try again\n"

l_.str.3:                               ; @.str.3
	.asciz	"SDIO write err\n"

l_.str.4:                               ; @.str.4
	.asciz	"Fail to pull ctrl_data\n"

	.comm	_RDWR_STATUS_SUCCESS,4,2        ; @RDWR_STATUS_SUCCESS
	.no_dead_strip	_mwifiex_sdio_rdwr_firmware
.subsections_via_symbols
