	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pvr2_hdw_device_reset          ## -- Begin function pvr2_hdw_device_reset
	.p2align	4, 0x90
_pvr2_hdw_device_reset:                 ## @pvr2_hdw_device_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	movq	_PVR2_TRACE_INIT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	xorl	%eax, %eax
	callq	_pvr2_trace
	movl	(%rbx), %edi
	xorl	%esi, %esi
	callq	_usb_lock_device_for_reset
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movq	_PVR2_TRACE_ERROR_LEGS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_pvr2_trace
	jmp	LBB0_3
LBB0_1:
	movl	(%rbx), %edi
	callq	_usb_reset_device
	movl	(%rbx), %edi
	callq	_usb_unlock_device
LBB0_3:
	movq	_init_pause_msec@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edx
	testl	%edx, %edx
	je	LBB0_4
## %bb.5:
	movq	_PVR2_TRACE_INFO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.2(%rip), %rsi
	xorl	%eax, %eax
	callq	_pvr2_trace
	movl	(%rbx), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	jmp	_msleep                         ## TAILCALL
LBB0_4:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PVR2_TRACE_INIT,4,2            ## @PVR2_TRACE_INIT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Performing a device reset..."

	.comm	_PVR2_TRACE_ERROR_LEGS,4,2      ## @PVR2_TRACE_ERROR_LEGS
L_.str.1:                               ## @.str.1
	.asciz	"Failed to lock USB device ret=%d"

	.comm	_init_pause_msec,4,2            ## @init_pause_msec
	.comm	_PVR2_TRACE_INFO,4,2            ## @PVR2_TRACE_INFO
L_.str.2:                               ## @.str.2
	.asciz	"Waiting %u msec for hardware to settle"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pvr2_hdw_device_reset          ; -- Begin function pvr2_hdw_device_reset
	.p2align	2
_pvr2_hdw_device_reset:                 ; @pvr2_hdw_device_reset
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
Lloh0:
	adrp	x8, _PVR2_TRACE_INIT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PVR2_TRACE_INIT@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_pvr2_trace
	ldr	w0, [x19]
	mov	x1, #0
	bl	_usb_lock_device_for_reset
                                        ; kill: def $w0 killed $w0 def $x0
	cbz	w0, LBB0_2
; %bb.1:
Lloh5:
	adrp	x8, _PVR2_TRACE_ERROR_LEGS@GOTPAGE
Lloh6:
	ldr	x8, [x8, _PVR2_TRACE_ERROR_LEGS@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	str	x0, [sp]
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x8
	bl	_pvr2_trace
	b	LBB0_3
LBB0_2:
	ldr	w0, [x19]
	bl	_usb_reset_device
	ldr	w0, [x19]
	bl	_usb_unlock_device
LBB0_3:
Lloh10:
	adrp	x19, _init_pause_msec@GOTPAGE
Lloh11:
	ldr	x19, [x19, _init_pause_msec@GOTPAGEOFF]
	ldr	w8, [x19]
	cbz	w8, LBB0_5
; %bb.4:
Lloh12:
	adrp	x9, _PVR2_TRACE_INFO@GOTPAGE
Lloh13:
	ldr	x9, [x9, _PVR2_TRACE_INFO@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x9]
	str	x8, [sp]
Lloh15:
	adrp	x1, l_.str.2@PAGE
Lloh16:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_pvr2_trace
	ldr	w0, [x19]
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	b	_msleep
LBB0_5:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_PVR2_TRACE_INIT,4,2            ; @PVR2_TRACE_INIT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Performing a device reset..."

	.comm	_PVR2_TRACE_ERROR_LEGS,4,2      ; @PVR2_TRACE_ERROR_LEGS
l_.str.1:                               ; @.str.1
	.asciz	"Failed to lock USB device ret=%d"

	.comm	_init_pause_msec,4,2            ; @init_pause_msec
	.comm	_PVR2_TRACE_INFO,4,2            ; @PVR2_TRACE_INFO
l_.str.2:                               ; @.str.2
	.asciz	"Waiting %u msec for hardware to settle"

.subsections_via_symbols
