	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function CopyStreamReceive
_CopyStreamReceive:                     ## @CopyStreamReceive
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %rbx
	movl	%edx, %r15d
	movq	%rsi, %r12
	movq	%rdi, %r14
	movq	$0, -40(%rbp)
	movq	(%rcx), %rdi
	testq	%rdi, %rdi
	je	LBB0_2
## %bb.1:
	callq	_PQfreemem
LBB0_2:
	movq	$0, (%rbx)
	leaq	-40(%rbp), %rsi
	movq	%r14, %rdi
	movl	$1, %edx
	callq	_PQgetCopyData
	testl	%eax, %eax
	je	LBB0_3
LBB0_9:
	cmpl	$-1, %eax
	je	LBB0_10
## %bb.11:
	cmpl	$-2, %eax
	jne	LBB0_13
## %bb.12:
	movq	%r14, %rdi
	callq	_PQerrorMessage
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_6
LBB0_3:
	movq	%r14, %rdi
	movq	%r12, %rsi
	movl	%r15d, %edx
	callq	_CopyStreamPoll
	testl	%eax, %eax
	jle	LBB0_14
## %bb.4:
	movq	%r14, %rdi
	callq	_PQconsumeInput
	testq	%rax, %rax
	je	LBB0_5
## %bb.7:
	leaq	-40(%rbp), %rsi
	movq	%r14, %rdi
	movl	$1, %edx
	callq	_PQgetCopyData
	testl	%eax, %eax
	jne	LBB0_9
## %bb.8:
	xorl	%eax, %eax
	jmp	LBB0_14
LBB0_10:
	movl	$-2, %eax
	jmp	LBB0_14
LBB0_13:
	movq	-40(%rbp), %rcx
	movq	%rcx, (%rbx)
	jmp	LBB0_14
LBB0_5:
	movq	%r14, %rdi
	callq	_PQerrorMessage
	leaq	L_.str(%rip), %rdi
LBB0_6:
	movl	%eax, %esi
	callq	_pg_log_error
	movl	$-1, %eax
LBB0_14:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"could not receive data from WAL stream: %s"

L_.str.1:                               ## @.str.1
	.asciz	"could not read COPY data: %s"

	.no_dead_strip	_CopyStreamReceive
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function CopyStreamReceive
_CopyStreamReceive:                     ; @CopyStreamReceive
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x3
	mov	x21, x2
	mov	x22, x1
	mov	x20, x0
	str	xzr, [sp, #8]
	ldr	x0, [x3]
	cbz	x0, LBB0_2
; %bb.1:
	bl	_PQfreemem
LBB0_2:
	str	xzr, [x19]
	add	x1, sp, #8
	mov	x0, x20
	mov	w2, #1
	bl	_PQgetCopyData
	cbz	w0, LBB0_6
LBB0_3:
	cmn	w0, #1
	b.eq	LBB0_9
; %bb.4:
	cmn	w0, #2
	b.ne	LBB0_10
; %bb.5:
	mov	x0, x20
	bl	_PQerrorMessage
	mov	x1, x0
Lloh0:
	adrp	x0, l_.str.1@PAGE
Lloh1:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_12
LBB0_6:
	mov	x0, x20
	mov	x1, x22
	mov	x2, x21
	bl	_CopyStreamPoll
	cmp	w0, #1
	b.lt	LBB0_13
; %bb.7:
	mov	x0, x20
	bl	_PQconsumeInput
	cbz	x0, LBB0_11
; %bb.8:
	add	x1, sp, #8
	mov	x0, x20
	mov	w2, #1
	bl	_PQgetCopyData
	cbnz	w0, LBB0_3
	b	LBB0_13
LBB0_9:
	mov	w0, #-2
	b	LBB0_13
LBB0_10:
	ldr	x8, [sp, #8]
	str	x8, [x19]
	b	LBB0_13
LBB0_11:
	mov	x0, x20
	bl	_PQerrorMessage
	mov	x1, x0
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
LBB0_12:
	bl	_pg_log_error
	mov	w0, #-1
LBB0_13:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"could not receive data from WAL stream: %s"

l_.str.1:                               ; @.str.1
	.asciz	"could not read COPY data: %s"

	.no_dead_strip	_CopyStreamReceive
.subsections_via_symbols
