	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function msb_reset
_msb_reset:                             ## @msb_reset
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	_MEMSTICK_SYS_PAM@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	andl	4(%rdi), %r12d
	movq	8(%rdi), %rax
	movq	(%rax), %r14
	movq	_MEMSTICK_SYS_BAMD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%rdi)
	testl	%esi, %esi
	je	LBB0_6
## %bb.1:
	movq	_MEMSTICK_POWER@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	_MEMSTICK_POWER_OFF@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	*(%r14)
	testl	%eax, %eax
	jne	LBB0_4
## %bb.2:
	movq	%r15, %rdi
	callq	_msb_invalidate_reg_window
	movl	(%rbx), %esi
	movq	_MEMSTICK_POWER_ON@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	*(%r14)
	testl	%eax, %eax
	jne	LBB0_4
## %bb.3:
	movq	_MEMSTICK_INTERFACE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_MEMSTICK_SERIAL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	*(%r14)
	testl	%eax, %eax
	je	LBB0_6
LBB0_4:
	leaq	L_.str(%rip), %rdi
	callq	_dbg
	movl	$1, (%r15)
	movq	_EFAULT@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_6:
	movq	_h_msb_reset@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_msb_run_state_machine
	testl	%eax, %eax
	je	LBB0_8
## %bb.7:
	leaq	L_.str.1(%rip), %rdi
	callq	_dbg
	movl	$1, (%r15)
	movq	_ENODEV@GOTPCREL(%rip), %rax
LBB0_5:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_10:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	xorl	%ebx, %ebx
	testl	%r12d, %r12d
	je	LBB0_10
## %bb.9:
	movq	%r15, %rdi
	callq	_msb_switch_to_parallel
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_MEMSTICK_SYS_PAM,4,2           ## @MEMSTICK_SYS_PAM
	.comm	_MEMSTICK_SYS_BAMD,4,2          ## @MEMSTICK_SYS_BAMD
	.comm	_MEMSTICK_POWER,4,2             ## @MEMSTICK_POWER
	.comm	_MEMSTICK_POWER_OFF,4,2         ## @MEMSTICK_POWER_OFF
	.comm	_MEMSTICK_POWER_ON,4,2          ## @MEMSTICK_POWER_ON
	.comm	_MEMSTICK_INTERFACE,4,2         ## @MEMSTICK_INTERFACE
	.comm	_MEMSTICK_SERIAL,4,2            ## @MEMSTICK_SERIAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to reset the host controller"

	.comm	_EFAULT,4,2                     ## @EFAULT
	.comm	_h_msb_reset,4,2                ## @h_msb_reset
L_.str.1:                               ## @.str.1
	.asciz	"Failed to reset the card"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.no_dead_strip	_msb_reset
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function msb_reset
_msb_reset:                             ; @msb_reset
	.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	x19, x0
	ldr	w21, [x0, #4]
Lloh0:
	adrp	x8, _MEMSTICK_SYS_PAM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MEMSTICK_SYS_PAM@GOTPAGEOFF]
Lloh2:
	ldr	w22, [x8]
	ldr	x8, [x0, #8]
	ldr	x20, [x8]
Lloh3:
	adrp	x8, _MEMSTICK_SYS_BAMD@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MEMSTICK_SYS_BAMD@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	str	w8, [x0, #4]
	cbz	w1, LBB0_5
; %bb.1:
	ldr	x8, [x20]
Lloh6:
	adrp	x23, _MEMSTICK_POWER@GOTPAGE
Lloh7:
	ldr	x23, [x23, _MEMSTICK_POWER@GOTPAGEOFF]
	ldr	w1, [x23]
Lloh8:
	adrp	x9, _MEMSTICK_POWER_OFF@GOTPAGE
Lloh9:
	ldr	x9, [x9, _MEMSTICK_POWER_OFF@GOTPAGEOFF]
Lloh10:
	ldr	w2, [x9]
	mov	x0, x20
	blr	x8
	cbnz	w0, LBB0_4
; %bb.2:
	mov	x0, x19
	bl	_msb_invalidate_reg_window
	ldr	x8, [x20]
	ldr	w1, [x23]
Lloh11:
	adrp	x9, _MEMSTICK_POWER_ON@GOTPAGE
Lloh12:
	ldr	x9, [x9, _MEMSTICK_POWER_ON@GOTPAGEOFF]
Lloh13:
	ldr	w2, [x9]
	mov	x0, x20
	blr	x8
	cbnz	w0, LBB0_4
; %bb.3:
	ldr	x8, [x20]
Lloh14:
	adrp	x9, _MEMSTICK_INTERFACE@GOTPAGE
Lloh15:
	ldr	x9, [x9, _MEMSTICK_INTERFACE@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x9]
Lloh17:
	adrp	x9, _MEMSTICK_SERIAL@GOTPAGE
Lloh18:
	ldr	x9, [x9, _MEMSTICK_SERIAL@GOTPAGEOFF]
Lloh19:
	ldr	w2, [x9]
	mov	x0, x20
	blr	x8
	cbz	w0, LBB0_5
LBB0_4:
Lloh20:
	adrp	x0, l_.str@PAGE
Lloh21:
	add	x0, x0, l_.str@PAGEOFF
	bl	_dbg
	mov	w8, #1
	str	w8, [x19]
Lloh22:
	adrp	x8, _EFAULT@GOTPAGE
Lloh23:
	ldr	x8, [x8, _EFAULT@GOTPAGEOFF]
	b	LBB0_7
LBB0_5:
Lloh24:
	adrp	x8, _h_msb_reset@GOTPAGE
Lloh25:
	ldr	x8, [x8, _h_msb_reset@GOTPAGEOFF]
Lloh26:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_msb_run_state_machine
	cbz	w0, LBB0_9
; %bb.6:
Lloh27:
	adrp	x0, l_.str.1@PAGE
Lloh28:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_dbg
	mov	w8, #1
	str	w8, [x19]
Lloh29:
	adrp	x8, _ENODEV@GOTPAGE
Lloh30:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
LBB0_7:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_8:
	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
LBB0_9:
	and	w8, w22, w21
	cbz	w8, LBB0_11
; %bb.10:
	mov	x0, x19
	bl	_msb_switch_to_parallel
LBB0_11:
	mov	w0, #0
	b	LBB0_8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpAdd	Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_MEMSTICK_SYS_PAM,4,2           ; @MEMSTICK_SYS_PAM
	.comm	_MEMSTICK_SYS_BAMD,4,2          ; @MEMSTICK_SYS_BAMD
	.comm	_MEMSTICK_POWER,4,2             ; @MEMSTICK_POWER
	.comm	_MEMSTICK_POWER_OFF,4,2         ; @MEMSTICK_POWER_OFF
	.comm	_MEMSTICK_POWER_ON,4,2          ; @MEMSTICK_POWER_ON
	.comm	_MEMSTICK_INTERFACE,4,2         ; @MEMSTICK_INTERFACE
	.comm	_MEMSTICK_SERIAL,4,2            ; @MEMSTICK_SERIAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to reset the host controller"

	.comm	_EFAULT,4,2                     ; @EFAULT
	.comm	_h_msb_reset,4,2                ; @h_msb_reset
l_.str.1:                               ; @.str.1
	.asciz	"Failed to reset the card"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.no_dead_strip	_msb_reset
.subsections_via_symbols
