	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function fw_busreset
_fw_busreset:                           ## @fw_busreset
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rdi), %rax
	movq	_FWOHCI_STATE_ENABLED@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jge	LBB0_2
## %bb.1:
	leaq	L_str.3(%rip), %rdi
	callq	_puts
	movq	_CMD_OK@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	jmp	LBB0_7
LBB0_2:
	movq	%rdi, %r14
	callq	_fw_crom
	movq	%r14, %rdi
	callq	_fwohci_ibr
	xorl	%ebx, %ebx
	movq	_FWOHCI_STATE_NORMAL@GOTPCREL(%rip), %r15
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %rax
	cmpq	(%r15), %rax
	jge	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%r14, %rdi
	callq	_fwohci_poll
	incl	%ebx
	cmpl	$1001, %ebx                     ## imm = 0x3E9
	jne	LBB0_3
## %bb.5:
	leaq	L_str(%rip), %rdi
	callq	_puts
	movl	$-1, %r14d
	jmp	LBB0_7
LBB0_6:
	leaq	L_.str.2(%rip), %rdi
	xorl	%r14d, %r14d
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	_printf
LBB0_7:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_FWOHCI_STATE_ENABLED,8,3       ## @FWOHCI_STATE_ENABLED
	.comm	_CMD_OK,4,2                     ## @CMD_OK
	.comm	_FWOHCI_STATE_NORMAL,8,3        ## @FWOHCI_STATE_NORMAL
	.section	__TEXT,__cstring,cstring_literals
L_.str.2:                               ## @.str.2
	.asciz	"poll count = %d\n"

L_str:                                  ## @str
	.asciz	"give up to wait bus initialize"

L_str.3:                                ## @str.3
	.asciz	"fwohci not enabled"

	.no_dead_strip	_fw_busreset
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function fw_busreset
_fw_busreset:                           ; @fw_busreset
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _FWOHCI_STATE_ENABLED@GOTPAGE
Lloh1:
	ldr	x9, [x9, _FWOHCI_STATE_ENABLED@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ge	LBB0_2
; %bb.1:
Lloh3:
	adrp	x0, l_str.3@PAGE
Lloh4:
	add	x0, x0, l_str.3@PAGEOFF
	bl	_puts
Lloh5:
	adrp	x8, _CMD_OK@GOTPAGE
Lloh6:
	ldr	x8, [x8, _CMD_OK@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	b	LBB0_7
LBB0_2:
	mov	x19, x0
	bl	_fw_crom
	mov	x0, x19
	bl	_fwohci_ibr
	mov	w20, #0
Lloh8:
	adrp	x21, _FWOHCI_STATE_NORMAL@GOTPAGE
Lloh9:
	ldr	x21, [x21, _FWOHCI_STATE_NORMAL@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19]
	ldr	x9, [x21]
	cmp	x8, x9
	b.ge	LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x19
	bl	_fwohci_poll
	add	w20, w20, #1
	cmp	w20, #1001
	b.ne	LBB0_3
; %bb.5:
Lloh10:
	adrp	x0, l_str@PAGE
Lloh11:
	add	x0, x0, l_str@PAGEOFF
	bl	_puts
	mov	w0, #-1
	b	LBB0_7
LBB0_6:
	str	x20, [sp]
Lloh12:
	adrp	x0, l_.str.2@PAGE
Lloh13:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_printf
	mov	w0, #0
LBB0_7:
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_FWOHCI_STATE_ENABLED,8,3       ; @FWOHCI_STATE_ENABLED
	.comm	_CMD_OK,4,2                     ; @CMD_OK
	.comm	_FWOHCI_STATE_NORMAL,8,3        ; @FWOHCI_STATE_NORMAL
	.section	__TEXT,__cstring,cstring_literals
l_.str.2:                               ; @.str.2
	.asciz	"poll count = %d\n"

l_str:                                  ; @str
	.asciz	"give up to wait bus initialize"

l_str.3:                                ; @str.3
	.asciz	"fwohci not enabled"

	.no_dead_strip	_fw_busreset
.subsections_via_symbols
