	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function HandleEndOfCopyStream
_HandleEndOfCopyStream:                 ## @HandleEndOfCopyStream
	.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
	movq	%r8, -48(%rbp)                  ## 8-byte Spill
	movl	%ecx, %r15d
	movq	%rdx, %r12
	movq	%rsi, %r14
	movq	%rdi, %rbx
	callq	_PQgetResult
	movq	%rax, %r13
	movq	_still_sending@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	je	LBB0_9
## %bb.1:
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_close_walfile
	testl	%eax, %eax
	je	LBB0_2
## %bb.3:
	movq	%r13, %rdi
	callq	_PQresultStatus
	movq	_PGRES_COPY_IN@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_8
## %bb.4:
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_PQputCopyEnd
	testq	%rax, %rax
	jle	LBB0_6
## %bb.5:
	movq	%rbx, %rdi
	callq	_PQflush
	testq	%rax, %rax
	je	LBB0_7
LBB0_6:
	movq	%rbx, %rdi
	callq	_PQerrorMessage
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	callq	_pg_log_error
LBB0_2:
	movq	%r13, %rdi
	callq	_PQclear
	xorl	%r13d, %r13d
	jmp	LBB0_12
LBB0_7:
	movq	%rbx, %rdi
	callq	_PQgetResult
	movq	%rax, %r13
LBB0_8:
	movq	_still_sending@GOTPCREL(%rip), %rax
	movl	$0, (%rax)
LBB0_9:
	testq	%r12, %r12
	je	LBB0_11
## %bb.10:
	movq	%r12, %rdi
	callq	_PQfreemem
LBB0_11:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	%r15d, (%rax)
LBB0_12:
	movq	%r13, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_still_sending,4,2              ## @still_sending
	.comm	_PGRES_COPY_IN,8,3              ## @PGRES_COPY_IN
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"could not send copy-end packet: %s"

	.no_dead_strip	_HandleEndOfCopyStream
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function HandleEndOfCopyStream
_HandleEndOfCopyStream:                 ; @HandleEndOfCopyStream
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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, x4
	mov	x21, x3
	mov	x22, x2
	mov	x24, x1
	mov	x23, x0
	bl	_PQgetResult
	mov	x19, x0
Lloh0:
	adrp	x25, _still_sending@GOTPAGE
Lloh1:
	ldr	x25, [x25, _still_sending@GOTPAGEOFF]
	ldr	w8, [x25]
	cbz	w8, LBB0_9
; %bb.1:
	mov	x0, x24
	mov	x1, x21
	bl	_close_walfile
	cbz	w0, LBB0_6
; %bb.2:
	mov	x0, x19
	bl	_PQresultStatus
Lloh2:
	adrp	x8, _PGRES_COPY_IN@GOTPAGE
Lloh3:
	ldr	x8, [x8, _PGRES_COPY_IN@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_8
; %bb.3:
	mov	x0, x23
	mov	x1, #0
	bl	_PQputCopyEnd
	cmp	x0, #1
	b.lt	LBB0_5
; %bb.4:
	mov	x0, x23
	bl	_PQflush
	cbz	x0, LBB0_7
LBB0_5:
	mov	x0, x23
	bl	_PQerrorMessage
	mov	x1, x0
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pg_log_error
LBB0_6:
	mov	x0, x19
	bl	_PQclear
	mov	x19, #0
	b	LBB0_12
LBB0_7:
	mov	x0, x23
	bl	_PQgetResult
	mov	x19, x0
LBB0_8:
	str	wzr, [x25]
LBB0_9:
	cbz	x22, LBB0_11
; %bb.10:
	mov	x0, x22
	bl	_PQfreemem
LBB0_11:
	str	w21, [x20]
LBB0_12:
	mov	x0, x19
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_still_sending,4,2              ; @still_sending
	.comm	_PGRES_COPY_IN,8,3              ; @PGRES_COPY_IN
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"could not send copy-end packet: %s"

	.no_dead_strip	_HandleEndOfCopyStream
.subsections_via_symbols
