	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_PQputCopyEnd                   ## -- Begin function PQputCopyEnd
	.p2align	4, 0x90
_PQputCopyEnd:                          ## @PQputCopyEnd
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	$-1, %r14d
	testq	%rdi, %rdi
	je	LBB0_24
## %bb.1:
	movq	%rsi, %r15
	movq	%rdi, %rbx
	movq	(%rdi), %rax
	movq	_PGASYNC_COPY_IN@GOTPCREL(%rip), %rcx
	movq	_PGASYNC_COPY_BOTH@GOTPCREL(%rip), %r12
	cmpq	(%rcx), %rax
	je	LBB0_5
## %bb.2:
	cmpq	(%r12), %rax
	je	LBB0_5
## %bb.3:
	addq	$16, %rbx
	leaq	L_.str(%rip), %rdi
	jmp	LBB0_4
LBB0_5:
	movl	20(%rbx), %edi
	callq	_PG_PROTOCOL_MAJOR
	cmpl	$3, %eax
	jl	LBB0_14
## %bb.6:
	testq	%r15, %r15
	je	LBB0_9
## %bb.7:
	movl	$102, %edi
	xorl	%esi, %esi
	movq	%rbx, %rdx
	callq	_pqPutMsgStart
	testq	%rax, %rax
	js	LBB0_24
## %bb.8:
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_pqPuts
	testq	%rax, %rax
	jns	LBB0_11
	jmp	LBB0_24
LBB0_14:
	testq	%r15, %r15
	je	LBB0_16
## %bb.15:
	addq	$16, %rbx
	leaq	L_.str.1(%rip), %rdi
LBB0_4:
	callq	_libpq_gettext
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_printfPQExpBuffer
LBB0_24:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movl	$99, %edi
	xorl	%esi, %esi
	movq	%rbx, %rdx
	callq	_pqPutMsgStart
	testq	%rax, %rax
	js	LBB0_24
LBB0_11:
	movq	%rbx, %rdi
	callq	_pqPutMsgEnd
	testq	%rax, %rax
	js	LBB0_24
## %bb.12:
	movq	8(%rbx), %rax
	movq	_PGQUERY_SIMPLE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_20
## %bb.13:
	movl	$83, %edi
	xorl	%esi, %esi
	movq	%rbx, %rdx
	callq	_pqPutMsgStart
	jmp	LBB0_18
LBB0_16:
	xorl	%edi, %edi
	xorl	%esi, %esi
	movq	%rbx, %rdx
	callq	_pqPutMsgStart
	testq	%rax, %rax
	js	LBB0_24
## %bb.17:
	leaq	L_.str.2(%rip), %rdi
	movl	$3, %esi
	movq	%rbx, %rdx
	callq	_pqPutnchar
LBB0_18:
	testq	%rax, %rax
	js	LBB0_24
## %bb.19:
	movq	%rbx, %rdi
	callq	_pqPutMsgEnd
	testq	%rax, %rax
	js	LBB0_24
LBB0_20:
	movq	(%rbx), %rax
	cmpq	(%r12), %rax
	jne	LBB0_21
## %bb.22:
	movq	_PGASYNC_COPY_OUT@GOTPCREL(%rip), %rax
	jmp	LBB0_23
LBB0_21:
	movq	_PGASYNC_BUSY@GOTPCREL(%rip), %rax
LBB0_23:
	movq	(%rax), %rax
	movq	%rax, (%rbx)
	leaq	16(%rbx), %rdi
	callq	_resetPQExpBuffer
	movq	%rbx, %rdi
	callq	_pqFlush
	xorl	%ecx, %ecx
	testq	%rax, %rax
	setns	%cl
	leal	(%rcx,%rcx), %r14d
	decl	%r14d
	jmp	LBB0_24
	.cfi_endproc
                                        ## -- End function
	.comm	_PGASYNC_COPY_IN,8,3            ## @PGASYNC_COPY_IN
	.comm	_PGASYNC_COPY_BOTH,8,3          ## @PGASYNC_COPY_BOTH
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"no COPY in progress\n"

	.comm	_PGQUERY_SIMPLE,8,3             ## @PGQUERY_SIMPLE
L_.str.1:                               ## @.str.1
	.asciz	"function requires at least protocol version 3.0\n"

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

	.comm	_PGASYNC_COPY_OUT,8,3           ## @PGASYNC_COPY_OUT
	.comm	_PGASYNC_BUSY,8,3               ## @PGASYNC_BUSY
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_PQputCopyEnd                   ; -- Begin function PQputCopyEnd
	.p2align	2
_PQputCopyEnd:                          ; @PQputCopyEnd
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	cbz	x0, LBB0_10
; %bb.1:
	mov	x19, x0
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _PGASYNC_COPY_IN@GOTPAGE
Lloh1:
	ldr	x9, [x9, _PGASYNC_COPY_IN@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
Lloh3:
	adrp	x21, _PGASYNC_COPY_BOTH@GOTPAGE
Lloh4:
	ldr	x21, [x21, _PGASYNC_COPY_BOTH@GOTPAGEOFF]
	ldr	x10, [x21]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	b.ne	LBB0_6
; %bb.2:
	mov	x20, x1
	ldr	w0, [x19, #20]
	bl	_PG_PROTOCOL_MAJOR
	cmp	w0, #3
	b.lt	LBB0_7
; %bb.3:
	cbz	x20, LBB0_12
; %bb.4:
	mov	w0, #102
	mov	w1, #0
	mov	x2, x19
	bl	_pqPutMsgStart
	tbnz	x0, #63, LBB0_10
; %bb.5:
	mov	x0, x20
	mov	x1, x19
	bl	_pqPuts
	tbz	x0, #63, LBB0_13
	b	LBB0_10
LBB0_6:
	add	x19, x19, #16
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_9
LBB0_7:
	cbz	x20, LBB0_16
; %bb.8:
	add	x19, x19, #16
Lloh7:
	adrp	x0, l_.str.1@PAGE
Lloh8:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_9:
	bl	_libpq_gettext
	mov	x1, x0
	mov	x0, x19
	bl	_printfPQExpBuffer
LBB0_10:
	mov	w0, #-1
LBB0_11:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_12:
	mov	w0, #99
	mov	w1, #0
	mov	x2, x19
	bl	_pqPutMsgStart
	tbnz	x0, #63, LBB0_10
LBB0_13:
	mov	x0, x19
	bl	_pqPutMsgEnd
	tbnz	x0, #63, LBB0_10
; %bb.14:
	ldr	x8, [x19, #8]
Lloh9:
	adrp	x9, _PGQUERY_SIMPLE@GOTPAGE
Lloh10:
	ldr	x9, [x9, _PGQUERY_SIMPLE@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_19
; %bb.15:
	mov	w0, #83
	mov	w1, #0
	mov	x2, x19
	bl	_pqPutMsgStart
	tbz	x0, #63, LBB0_18
	b	LBB0_10
LBB0_16:
	mov	w0, #0
	mov	w1, #0
	mov	x2, x19
	bl	_pqPutMsgStart
	tbnz	x0, #63, LBB0_10
; %bb.17:
Lloh12:
	adrp	x0, l_.str.2@PAGE
Lloh13:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	w1, #3
	mov	x2, x19
	bl	_pqPutnchar
	tbnz	x0, #63, LBB0_10
LBB0_18:
	mov	x0, x19
	bl	_pqPutMsgEnd
	tbnz	x0, #63, LBB0_10
LBB0_19:
	ldr	x8, [x19]
	ldr	x9, [x21]
Lloh14:
	adrp	x10, _PGASYNC_COPY_OUT@GOTPAGE
Lloh15:
	ldr	x10, [x10, _PGASYNC_COPY_OUT@GOTPAGEOFF]
Lloh16:
	adrp	x11, _PGASYNC_BUSY@GOTPAGE
Lloh17:
	ldr	x11, [x11, _PGASYNC_BUSY@GOTPAGEOFF]
	cmp	x8, x9
	csel	x8, x10, x11, eq
	ldr	x8, [x8]
	mov	x0, x19
	str	x8, [x0], #16
	bl	_resetPQExpBuffer
	mov	x0, x19
	bl	_pqFlush
	cmp	x0, #0
	mov	w8, #-1
	cneg	w0, w8, ge
	b	LBB0_11
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_PGASYNC_COPY_IN,8,3            ; @PGASYNC_COPY_IN
	.comm	_PGASYNC_COPY_BOTH,8,3          ; @PGASYNC_COPY_BOTH
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"no COPY in progress\n"

	.comm	_PGQUERY_SIMPLE,8,3             ; @PGQUERY_SIMPLE
l_.str.1:                               ; @.str.1
	.asciz	"function requires at least protocol version 3.0\n"

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

	.comm	_PGASYNC_COPY_OUT,8,3           ; @PGASYNC_COPY_OUT
	.comm	_PGASYNC_BUSY,8,3               ; @PGASYNC_BUSY
.subsections_via_symbols
