	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pt_reset
_pt_reset:                              ## @pt_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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	8(%rdi), %r14
	movq	%r14, %rdi
	callq	_pi_connect
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_DRIVE
	movq	%r14, %rdi
	movl	$6, %esi
	movl	%eax, %edx
	callq	_write_reg
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	movq	%r14, %rdi
	movl	$7, %esi
	movl	$8, %edx
	callq	_write_reg
	movq	_HZ@GOTPCREL(%rip), %r14
	movslq	(%r14), %rax
	imulq	$1374389535, %rax, %rdi         ## imm = 0x51EB851F
	movq	%rdi, %rax
	shrq	$63, %rax
	sarq	$36, %rdi
	addl	%eax, %edi
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_pt_sleep
	movq	_PT_RESET_TMO@GOTPCREL(%rip), %r15
	cmpl	$0, (%r15)
	jle	LBB0_1
## %bb.2:
	movl	$1, %ebx
	movq	_STAT_BUSY@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_status_reg
	testl	%eax, (%r13)
	je	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movslq	(%r14), %rax
	imulq	$1717986919, %rax, %rdi         ## imm = 0x66666667
	movq	%rdi, %rax
	shrq	$63, %rax
	sarq	$34, %rdi
	addl	%eax, %edi
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_pt_sleep
	leal	1(%rbx), %r12d
	cmpl	(%r15), %ebx
	movl	%r12d, %ebx
	jl	LBB0_3
	jmp	LBB0_6
LBB0_1:
	movl	$1, %r12d
	jmp	LBB0_6
LBB0_4:
	movl	%ebx, %r12d
LBB0_6:
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_read_reg
	movl	%eax, %r15d
	xorl	$1, %r15d
	movq	%rbx, %rdi
	movl	$2, %esi
	callq	_read_reg
	movl	%eax, %r13d
	xorl	$1, %r13d
	orl	%r15d, %r13d
	movq	%rbx, %rdi
	movl	$3, %esi
	callq	_read_reg
	movl	%eax, %r15d
	xorl	$1, %r15d
	movq	%rbx, %rdi
	movl	$4, %esi
	callq	_read_reg
	movl	%eax, %r14d
	xorl	$20, %r14d
	orl	%r15d, %r14d
	orl	%r13d, %r14d
	movq	%rbx, %rdi
	movl	$5, %esi
	callq	_read_reg
	xorl	$235, %eax
	xorl	%r15d, %r15d
	orl	%r14d, %eax
	sete	%r14b
	movq	_verbose@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_10
## %bb.7:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdi
	movl	%r12d, %edx
	xorl	%eax, %eax
	callq	_printk
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_read_reg
	leaq	L_.str.1(%rip), %r12
	movq	%r12, %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_printk
	movq	%rbx, %rdi
	movl	$2, %esi
	callq	_read_reg
	movq	%r12, %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_printk
	movq	%rbx, %rdi
	movl	$3, %esi
	callq	_read_reg
	movq	%r12, %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_printk
	movq	%rbx, %rdi
	movl	$4, %esi
	callq	_read_reg
	movq	%r12, %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_printk
	movq	%rbx, %rdi
	movl	$5, %esi
	callq	_read_reg
	movq	%r12, %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_printk
	testb	%r14b, %r14b
	jne	LBB0_9
## %bb.8:
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_printk
LBB0_9:
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_printk
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
LBB0_10:
	movq	%rbx, %rdi
	callq	_pi_disconnect
	movb	%r14b, %r15b
	decl	%r15d
	movl	%r15d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HZ,4,2                         ## @HZ
	.comm	_PT_RESET_TMO,4,2               ## @PT_RESET_TMO
	.comm	_STAT_BUSY,4,2                  ## @STAT_BUSY
	.comm	_verbose,8,3                    ## @verbose
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s: Reset (%d) signature = "

L_.str.1:                               ## @.str.1
	.asciz	"%3x"

L_.str.2:                               ## @.str.2
	.asciz	" (incorrect)"

L_.str.3:                               ## @.str.3
	.asciz	"\n"

	.no_dead_strip	_pt_reset
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pt_reset
_pt_reset:                              ; @pt_reset
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	mov	x20, x0
	ldr	x19, [x0, #8]
	mov	x0, x19
	bl	_pi_connect
	mov	x0, x20
	bl	_DRIVE
	mov	x2, x0
	mov	x0, x19
	mov	w1, #6
	bl	_write_reg
	mov	x0, x19
	mov	w1, #7
	mov	w2, #8
	bl	_write_reg
Lloh0:
	adrp	x21, _HZ@GOTPAGE
Lloh1:
	ldr	x21, [x21, _HZ@GOTPAGEOFF]
	ldrsw	x8, [x21]
	mov	w9, #34079
	movk	w9, #20971, lsl #16
	mul	x8, x8, x9
	lsr	x9, x8, #63
	asr	x8, x8, #36
	add	w0, w8, w9
	bl	_pt_sleep
Lloh2:
	adrp	x22, _PT_RESET_TMO@GOTPAGE
Lloh3:
	ldr	x22, [x22, _PT_RESET_TMO@GOTPAGEOFF]
	ldr	w8, [x22]
	cmp	w8, #1
	b.lt	LBB0_4
; %bb.1:
	mov	w23, #1
Lloh4:
	adrp	x24, _STAT_BUSY@GOTPAGE
Lloh5:
	ldr	x24, [x24, _STAT_BUSY@GOTPAGEOFF]
	mov	w26, #26215
	movk	w26, #26214, lsl #16
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	bl	_status_reg
	ldr	w8, [x24]
	tst	w8, w0
	b.eq	LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldrsw	x8, [x21]
	mul	x8, x8, x26
	lsr	x9, x8, #63
	asr	x8, x8, #34
	add	w0, w8, w9
	bl	_pt_sleep
	add	w25, w23, #1
	ldr	w8, [x22]
	cmp	w23, w8
	mov	x23, x25
	b.lt	LBB0_2
	b	LBB0_6
LBB0_4:
	mov	w25, #1
	b	LBB0_6
LBB0_5:
	mov	x25, x23
LBB0_6:
	mov	x0, x19
	mov	w1, #1
	bl	_read_reg
	mov	x21, x0
	mov	x0, x19
	mov	w1, #2
	bl	_read_reg
	mov	x22, x0
	mov	x0, x19
	mov	w1, #3
	bl	_read_reg
	mov	x23, x0
	mov	x0, x19
	mov	w1, #4
	bl	_read_reg
	mov	x24, x0
	mov	x0, x19
	mov	w1, #5
	bl	_read_reg
	cmp	w21, #1
	ccmp	w22, #1, #0, eq
	ccmp	w23, #1, #0, eq
	ccmp	w24, #20, #0, eq
	mov	w8, #235
	ccmp	w0, w8, #0, eq
	cset	w21, eq
Lloh6:
	adrp	x8, _verbose@GOTPAGE
Lloh7:
	ldr	x8, [x8, _verbose@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	cbz	x8, LBB0_10
; %bb.7:
	ldr	w8, [x20]
	stp	x8, x25, [sp]
Lloh9:
	adrp	x0, l_.str@PAGE
Lloh10:
	add	x0, x0, l_.str@PAGEOFF
	bl	_printk
	mov	x0, x19
	mov	w1, #1
	bl	_read_reg
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp]
Lloh11:
	adrp	x20, l_.str.1@PAGE
Lloh12:
	add	x20, x20, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_printk
	mov	x0, x19
	mov	w1, #2
	bl	_read_reg
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp]
	mov	x0, x20
	bl	_printk
	mov	x0, x19
	mov	w1, #3
	bl	_read_reg
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp]
	mov	x0, x20
	bl	_printk
	mov	x0, x19
	mov	w1, #4
	bl	_read_reg
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp]
	mov	x0, x20
	bl	_printk
	mov	x0, x19
	mov	w1, #5
	bl	_read_reg
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp]
	mov	x0, x20
	bl	_printk
	tbnz	w21, #0, LBB0_9
; %bb.8:
Lloh13:
	adrp	x0, l_.str.2@PAGE
Lloh14:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_printk
LBB0_9:
Lloh15:
	adrp	x0, l_.str.3@PAGE
Lloh16:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_printk
LBB0_10:
	mov	x0, x19
	bl	_pi_disconnect
	sub	w0, w21, #1
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_HZ,4,2                         ; @HZ
	.comm	_PT_RESET_TMO,4,2               ; @PT_RESET_TMO
	.comm	_STAT_BUSY,4,2                  ; @STAT_BUSY
	.comm	_verbose,8,3                    ; @verbose
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s: Reset (%d) signature = "

l_.str.1:                               ; @.str.1
	.asciz	"%3x"

l_.str.2:                               ; @.str.2
	.asciz	" (incorrect)"

l_.str.3:                               ; @.str.3
	.asciz	"\n"

	.no_dead_strip	_pt_reset
.subsections_via_symbols
