	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_fwohci_reset                   ## -- Begin function fwohci_reset
	.p2align	4, 0x90
_fwohci_reset:                          ## @fwohci_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	%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
	movl	%esi, %r12d
	movq	%rdi, %r13
	movq	_FWOHCI_INTMASKCLR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$-1, %edx
	callq	_OWRITE
	movq	_OHCI_HCCCTL@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	_OHCI_HCC_RESET@GOTPCREL(%rip), %r14
	movl	(%r14), %edx
	movq	%r13, %rdi
	callq	_OWRITE
	movq	_firewire_debug@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rsi
	movl	%r12d, %edi
	xorl	%eax, %eax
	callq	_device_printf
LBB0_2:
	movl	(%r15), %esi
	movq	%r13, %rdi
	callq	_OREAD
	testl	%eax, (%r14)
	je	LBB0_3
## %bb.4:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	$101, %ebx
	je	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	incl	%ebx
	movl	$1000, %edi                     ## imm = 0x3E8
	callq	_DELAY
	movl	(%r15), %esi
	movq	%r13, %rdi
	callq	_OREAD
	testl	%eax, (%r14)
	jne	LBB0_5
	jmp	LBB0_8
LBB0_3:
	xorl	%ebx, %ebx
	jmp	LBB0_8
LBB0_6:
	movl	$102, %ebx
LBB0_8:
	movq	_firewire_debug@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_10
## %bb.9:
	leaq	L_.str.1(%rip), %rdi
	movl	%ebx, %esi
	callq	_printf
LBB0_10:
	movq	%r13, %rdi
	movl	%r12d, %esi
	callq	_fwohci_probe_phy
	movq	_OHCI_BUS_OPT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_OREAD
	movq	_OHCI_BUSFNC@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r15d
	orl	%eax, %r15d
	movl	%eax, %ebx
	shrl	$12, %ebx
	andl	$15, %ebx
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
                                        ## kill: def $eax killed $eax def $rax
	andl	$7, %eax
	movq	_linkspeed@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	(%rcx,%rax,4), %r14d
	movl	%ebx, %edi
	callq	_MAXREC
	leaq	L_.str.2(%rip), %rsi
	movl	%r12d, -44(%rbp)                ## 4-byte Spill
	movl	%r12d, %edi
	movl	%r14d, %edx
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_device_printf
	movl	4(%r13), %eax
	addl	$8, %eax
	movl	%eax, (%r13)
	cmpl	%eax, %ebx
	jne	LBB0_12
## %bb.11:
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	jmp	LBB0_13
LBB0_12:
	andl	$-61441, %r15d                  ## imm = 0xFFFF0FFF
	shll	$12, %eax
	orl	%eax, %r15d
	movl	%ebx, %edi
	callq	_MAXREC
	movl	%eax, %ebx
	movl	(%r13), %edi
	callq	_MAXREC
	leaq	L_.str.3(%rip), %rsi
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movl	%edi, %r14d
	movl	%ebx, %edx
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_device_printf
LBB0_13:
	movq	_OHCI_BUS_OPT@GOTPCREL(%rip), %rbx
	movq	_firewire_debug@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_15
## %bb.14:
	leaq	L_.str.4(%rip), %rsi
	movl	%r14d, %edi
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	movl	%r15d, %ecx
	xorl	%eax, %eax
	callq	_device_printf
LBB0_15:
	movl	(%rbx), %esi
	movq	%r13, %rdi
	movl	%r15d, %edx
	callq	_OWRITE
	movq	_OHCI_CROMHDR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	8(%r13), %rax
	movl	(%rax), %edx
	movq	%r13, %rdi
	callq	_OWRITE
	movq	_OHCI_CROMPTR@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	8(%r13), %rdi
	callq	_VTOP
	movq	%r13, %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_OWRITE
	movq	_OHCI_HCCCTLCLR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_OHCI_HCC_BIGEND@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r13, %rdi
	callq	_OWRITE
	movq	_OHCI_HCCCTL@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	_OHCI_HCC_POSTWR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r13, %rdi
	callq	_OWRITE
	movl	(%rbx), %esi
	movq	_OHCI_HCC_LINKEN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r13, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_OWRITE                         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_FWOHCI_INTMASKCLR,4,2          ## @FWOHCI_INTMASKCLR
	.comm	_OHCI_HCCCTL,4,2                ## @OHCI_HCCCTL
	.comm	_OHCI_HCC_RESET,4,2             ## @OHCI_HCC_RESET
	.comm	_firewire_debug,8,3             ## @firewire_debug
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"resetting OHCI..."

L_.str.1:                               ## @.str.1
	.asciz	"done (loop=%d)\n"

	.comm	_OHCI_BUS_OPT,4,2               ## @OHCI_BUS_OPT
	.comm	_OHCI_BUSFNC,4,2                ## @OHCI_BUSFNC
L_.str.2:                               ## @.str.2
	.asciz	"Link %s, max_rec %d bytes.\n"

	.comm	_linkspeed,8,3                  ## @linkspeed
L_.str.3:                               ## @.str.3
	.asciz	"max_rec %d -> %d\n"

L_.str.4:                               ## @.str.4
	.asciz	"BUS_OPT 0x%x -> 0x%x\n"

	.comm	_OHCI_CROMHDR,4,2               ## @OHCI_CROMHDR
	.comm	_OHCI_CROMPTR,4,2               ## @OHCI_CROMPTR
	.comm	_OHCI_HCCCTLCLR,4,2             ## @OHCI_HCCCTLCLR
	.comm	_OHCI_HCC_BIGEND,4,2            ## @OHCI_HCC_BIGEND
	.comm	_OHCI_HCC_POSTWR,4,2            ## @OHCI_HCC_POSTWR
	.comm	_OHCI_HCC_LINKEN,4,2            ## @OHCI_HCC_LINKEN
	.comm	_OHCI_CNTL_SID,4,2              ## @OHCI_CNTL_SID
	.comm	_OHCI_LNKCTL,4,2                ## @OHCI_LNKCTL
	.comm	_OHCI_SID_BUF,4,2               ## @OHCI_SID_BUF
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_fwohci_reset                   ; -- Begin function fwohci_reset
	.p2align	2
_fwohci_reset:                          ; @fwohci_reset
	.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
Lloh0:
	adrp	x8, _FWOHCI_INTMASKCLR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _FWOHCI_INTMASKCLR@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w2, #-1
	bl	_OWRITE
Lloh3:
	adrp	x24, _OHCI_HCCCTL@GOTPAGE
Lloh4:
	ldr	x24, [x24, _OHCI_HCCCTL@GOTPAGEOFF]
	ldr	w1, [x24]
Lloh5:
	adrp	x22, _OHCI_HCC_RESET@GOTPAGE
Lloh6:
	ldr	x22, [x22, _OHCI_HCC_RESET@GOTPAGEOFF]
	ldr	w2, [x22]
	mov	x0, x19
	bl	_OWRITE
Lloh7:
	adrp	x25, _firewire_debug@GOTPAGE
Lloh8:
	ldr	x25, [x25, _firewire_debug@GOTPAGEOFF]
	ldr	x8, [x25]
	cbz	x8, LBB0_2
; %bb.1:
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_device_printf
LBB0_2:
	ldr	w1, [x24]
	mov	x0, x19
	bl	_OREAD
	ldr	w8, [x22]
	tst	w8, w0
	b.eq	LBB0_6
; %bb.3:
	mov	w21, #0
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	cmp	w21, #101
	b.eq	LBB0_14
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	add	w21, w21, #1
	mov	w0, #1000
	bl	_DELAY
	ldr	w1, [x24]
	mov	x0, x19
	bl	_OREAD
	ldr	w8, [x22]
	tst	w8, w0
	b.ne	LBB0_4
	b	LBB0_7
LBB0_6:
	mov	w21, #0
LBB0_7:
	ldr	x8, [x25]
	cbz	x8, LBB0_9
LBB0_8:
Lloh11:
	adrp	x0, l_.str.1@PAGE
Lloh12:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x21
	bl	_printf
LBB0_9:
	mov	x0, x19
	mov	x1, x20
	bl	_fwohci_probe_phy
Lloh13:
	adrp	x26, _OHCI_BUS_OPT@GOTPAGE
Lloh14:
	ldr	x26, [x26, _OHCI_BUS_OPT@GOTPAGEOFF]
	ldr	w1, [x26]
	mov	x0, x19
	bl	_OREAD
	mov	x22, x0
Lloh15:
	adrp	x8, _OHCI_BUSFNC@GOTPAGE
Lloh16:
	ldr	x8, [x8, _OHCI_BUSFNC@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	orr	w21, w8, w0
	ubfx	w23, w0, #12, #4
	and	w8, w0, #0x7
Lloh18:
	adrp	x9, _linkspeed@GOTPAGE
Lloh19:
	ldr	x9, [x9, _linkspeed@GOTPAGEOFF]
Lloh20:
	ldr	x9, [x9]
	ldr	w27, [x9, w8, uxtw #2]
	mov	x0, x23
	bl	_MAXREC
                                        ; kill: def $w0 killed $w0 def $x0
	stp	x27, x0, [sp]
Lloh21:
	adrp	x1, l_.str.2@PAGE
Lloh22:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x20
	bl	_device_printf
	ldr	w8, [x19, #4]
	add	w8, w8, #8
	str	w8, [x19]
	cmp	w23, w8
	b.eq	LBB0_11
; %bb.10:
	and	w9, w21, #0xffff0fff
	orr	w21, w9, w8, lsl #12
	mov	x0, x23
	bl	_MAXREC
	mov	x23, x0
	ldr	w0, [x19]
	bl	_MAXREC
                                        ; kill: def $w0 killed $w0 def $x0
	stp	x23, x0, [sp]
Lloh23:
	adrp	x1, l_.str.3@PAGE
Lloh24:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x20
	bl	_device_printf
LBB0_11:
	ldr	x8, [x25]
	cbz	x8, LBB0_13
; %bb.12:
	stp	x22, x21, [sp]
Lloh25:
	adrp	x1, l_.str.4@PAGE
Lloh26:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x20
	bl	_device_printf
LBB0_13:
	ldr	w1, [x26]
	mov	x0, x19
	mov	x2, x21
	bl	_OWRITE
Lloh27:
	adrp	x8, _OHCI_CROMHDR@GOTPAGE
Lloh28:
	ldr	x8, [x8, _OHCI_CROMHDR@GOTPAGEOFF]
Lloh29:
	ldr	w1, [x8]
	ldr	x8, [x19, #8]
	ldr	w2, [x8]
	mov	x0, x19
	bl	_OWRITE
Lloh30:
	adrp	x8, _OHCI_CROMPTR@GOTPAGE
Lloh31:
	ldr	x8, [x8, _OHCI_CROMPTR@GOTPAGEOFF]
Lloh32:
	ldr	w20, [x8]
	ldr	x0, [x19, #8]
	bl	_VTOP
	mov	x2, x0
	mov	x0, x19
	mov	x1, x20
	bl	_OWRITE
Lloh33:
	adrp	x8, _OHCI_HCCCTLCLR@GOTPAGE
Lloh34:
	ldr	x8, [x8, _OHCI_HCCCTLCLR@GOTPAGEOFF]
Lloh35:
	ldr	w1, [x8]
Lloh36:
	adrp	x8, _OHCI_HCC_BIGEND@GOTPAGE
Lloh37:
	ldr	x8, [x8, _OHCI_HCC_BIGEND@GOTPAGEOFF]
Lloh38:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_OWRITE
	ldr	w1, [x24]
Lloh39:
	adrp	x8, _OHCI_HCC_POSTWR@GOTPAGE
Lloh40:
	ldr	x8, [x8, _OHCI_HCC_POSTWR@GOTPAGEOFF]
Lloh41:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_OWRITE
	ldr	w1, [x24]
Lloh42:
	adrp	x8, _OHCI_HCC_LINKEN@GOTPAGE
Lloh43:
	ldr	x8, [x8, _OHCI_HCC_LINKEN@GOTPAGEOFF]
Lloh44:
	ldr	w2, [x8]
	mov	x0, x19
	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
	b	_OWRITE
LBB0_14:
	mov	w21, #102
	ldr	x8, [x25]
	cbnz	x8, LBB0_8
	b	LBB0_9
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.comm	_FWOHCI_INTMASKCLR,4,2          ; @FWOHCI_INTMASKCLR
	.comm	_OHCI_HCCCTL,4,2                ; @OHCI_HCCCTL
	.comm	_OHCI_HCC_RESET,4,2             ; @OHCI_HCC_RESET
	.comm	_firewire_debug,8,3             ; @firewire_debug
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"resetting OHCI..."

l_.str.1:                               ; @.str.1
	.asciz	"done (loop=%d)\n"

	.comm	_OHCI_BUS_OPT,4,2               ; @OHCI_BUS_OPT
	.comm	_OHCI_BUSFNC,4,2                ; @OHCI_BUSFNC
l_.str.2:                               ; @.str.2
	.asciz	"Link %s, max_rec %d bytes.\n"

	.comm	_linkspeed,8,3                  ; @linkspeed
l_.str.3:                               ; @.str.3
	.asciz	"max_rec %d -> %d\n"

l_.str.4:                               ; @.str.4
	.asciz	"BUS_OPT 0x%x -> 0x%x\n"

	.comm	_OHCI_CROMHDR,4,2               ; @OHCI_CROMHDR
	.comm	_OHCI_CROMPTR,4,2               ; @OHCI_CROMPTR
	.comm	_OHCI_HCCCTLCLR,4,2             ; @OHCI_HCCCTLCLR
	.comm	_OHCI_HCC_BIGEND,4,2            ; @OHCI_HCC_BIGEND
	.comm	_OHCI_HCC_POSTWR,4,2            ; @OHCI_HCC_POSTWR
	.comm	_OHCI_HCC_LINKEN,4,2            ; @OHCI_HCC_LINKEN
	.comm	_OHCI_CNTL_SID,4,2              ; @OHCI_CNTL_SID
	.comm	_OHCI_LNKCTL,4,2                ; @OHCI_LNKCTL
	.comm	_OHCI_SID_BUF,4,2               ; @OHCI_SID_BUF
.subsections_via_symbols
