	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pt_completion
_pt_completion:                         ## @pt_completion
	.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	%rdx, %rcx
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r15
	movq	(%rdi), %r14
	movq	_STAT_BUSY@GOTPCREL(%rip), %rax
	movq	_STAT_DRQ@GOTPCREL(%rip), %rbx
	movq	_STAT_READY@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rbx), %edx
	movl	(%rax), %esi
	movq	_STAT_ERR@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	leaq	L_.str(%rip), %r8
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	callq	_pt_wait
	movl	%eax, %r12d
	movq	%r14, %rdi
	movl	$7, %esi
	callq	_read_reg
	testl	%eax, (%rbx)
	je	LBB0_5
## %bb.1:
	movq	%r14, %rdi
	movl	$4, %esi
	callq	_read_reg
	movl	%eax, %r13d
	movq	%r14, %rdi
	movl	$5, %esi
	callq	_read_reg
                                        ## kill: def $eax killed $eax def $rax
	shll	$8, %eax
	addl	%eax, %r13d
	addl	$3, %r13d
	andl	$65532, %r13d                   ## imm = 0xFFFC
	movq	%r14, %rdi
	movl	$2, %esi
	callq	_read_reg
	andl	$3, %eax
	cmpl	$2, %eax
	je	LBB0_4
## %bb.2:
	testl	%eax, %eax
	jne	LBB0_5
## %bb.3:
	movq	%r14, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	movl	%r13d, %edx
	callq	_pi_write_block
	jmp	LBB0_5
LBB0_4:
	movq	%r14, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	movl	%r13d, %edx
	callq	_pi_read_block
LBB0_5:
	movq	_STAT_BUSY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_STAT_ERR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_STAT_READY@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	leaq	L_.str.1(%rip), %r8
	movq	%r15, %rdi
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	callq	_pt_wait
	movl	%eax, %ebx
	movq	%r14, %rdi
	callq	_pi_disconnect
	testl	%r12d, %r12d
	cmovnel	%r12d, %ebx
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_STAT_BUSY,4,2                  ## @STAT_BUSY
	.comm	_STAT_DRQ,4,2                   ## @STAT_DRQ
	.comm	_STAT_READY,4,2                 ## @STAT_READY
	.comm	_STAT_ERR,4,2                   ## @STAT_ERR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"completion"

L_.str.1:                               ## @.str.1
	.asciz	"data done"

	.no_dead_strip	_pt_completion
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pt_completion
_pt_completion:                         ; @pt_completion
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x2
	mov	x23, x1
	mov	x21, x0
	ldr	x19, [x0]
Lloh0:
	adrp	x25, _STAT_BUSY@GOTPAGE
Lloh1:
	ldr	x25, [x25, _STAT_BUSY@GOTPAGEOFF]
	ldr	w1, [x25]
Lloh2:
	adrp	x24, _STAT_DRQ@GOTPAGE
Lloh3:
	ldr	x24, [x24, _STAT_DRQ@GOTPAGEOFF]
	ldr	w8, [x24]
Lloh4:
	adrp	x26, _STAT_READY@GOTPAGE
Lloh5:
	ldr	x26, [x26, _STAT_READY@GOTPAGEOFF]
	ldr	w9, [x26]
	orr	w8, w9, w8
Lloh6:
	adrp	x27, _STAT_ERR@GOTPAGE
Lloh7:
	ldr	x27, [x27, _STAT_ERR@GOTPAGEOFF]
	ldr	w9, [x27]
	orr	w2, w8, w9
Lloh8:
	adrp	x4, l_.str@PAGE
Lloh9:
	add	x4, x4, l_.str@PAGEOFF
	mov	x3, x20
	bl	_pt_wait
	mov	x22, x0
	mov	x0, x19
	mov	w1, #7
	bl	_read_reg
	ldr	w8, [x24]
	tst	w8, w0
	b.eq	LBB0_5
; %bb.1:
	mov	x0, x19
	mov	w1, #4
	bl	_read_reg
	mov	x24, x0
	mov	x0, x19
	mov	w1, #5
	bl	_read_reg
	add	w8, w24, w0, lsl #8
	add	w8, w8, #3
	and	w24, w8, #0xfffc
	mov	x0, x19
	mov	w1, #2
	bl	_read_reg
	and	w8, w0, #0x3
	cmp	w8, #2
	b.eq	LBB0_4
; %bb.2:
	cbnz	w8, LBB0_5
; %bb.3:
	mov	x0, x19
	mov	x1, x23
	mov	x2, x24
	bl	_pi_write_block
	b	LBB0_5
LBB0_4:
	mov	x0, x19
	mov	x1, x23
	mov	x2, x24
	bl	_pi_read_block
LBB0_5:
	ldr	w1, [x25]
	ldr	w8, [x26]
	ldr	w9, [x27]
	orr	w2, w9, w8
Lloh10:
	adrp	x4, l_.str.1@PAGE
Lloh11:
	add	x4, x4, l_.str.1@PAGEOFF
	mov	x0, x21
	mov	x3, x20
	bl	_pt_wait
	mov	x20, x0
	mov	x0, x19
	bl	_pi_disconnect
	cmp	w22, #0
	csel	w0, w20, w22, eq
	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
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_STAT_BUSY,4,2                  ; @STAT_BUSY
	.comm	_STAT_DRQ,4,2                   ; @STAT_DRQ
	.comm	_STAT_READY,4,2                 ; @STAT_READY
	.comm	_STAT_ERR,4,2                   ; @STAT_ERR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"completion"

l_.str.1:                               ; @.str.1
	.asciz	"data done"

	.no_dead_strip	_pt_completion
.subsections_via_symbols
