	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pqReadData                     ## -- Begin function pqReadData
	.p2align	4, 0x90
_pqReadData:                            ## @pqReadData
	.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
	movq	%rdi, %rbx
	movq	(%rdi), %rax
	movq	_PGINVALID_SOCKET@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.1:
	addq	$36, %rbx
	leaq	L_.str(%rip), %rdi
	callq	_libpq_gettext
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_printfPQExpBuffer
LBB0_24:
	movl	$-1, %eax
LBB0_25:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movl	8(%rbx), %ecx
	movl	12(%rbx), %eax
	cmpl	%ecx, %eax
	jle	LBB0_5
## %bb.3:
	testl	%ecx, %ecx
	jle	LBB0_7
## %bb.4:
	movq	16(%rbx), %rdi
	movq	%rcx, %rsi
	addq	%rdi, %rsi
	subl	%ecx, %eax
	movslq	%eax, %rdx
	callq	_memmove
	movl	8(%rbx), %ecx
	movl	12(%rbx), %eax
	subl	%ecx, %eax
	movl	%eax, 12(%rbx)
	subl	%ecx, 24(%rbx)
	jmp	LBB0_6
LBB0_5:
	movl	$0, 12(%rbx)
	movl	$0, 24(%rbx)
	xorl	%eax, %eax
LBB0_6:
	movl	$0, 8(%rbx)
LBB0_7:
	movl	28(%rbx), %ecx
	subl	%eax, %ecx
	cmpl	$8191, %ecx                     ## imm = 0x1FFF
	jg	LBB0_10
## %bb.8:
	movslq	%eax, %rdi
	addq	$8192, %rdi                     ## imm = 0x2000
	movq	%rbx, %rsi
	callq	_pqCheckInBufferSpace
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:
	movl	28(%rbx), %ecx
	subl	12(%rbx), %ecx
	movl	$-1, %eax
	cmpl	$100, %ecx
	jl	LBB0_25
LBB0_10:
	movb	$1, %r12b
	movq	_SOCK_ERRNO@GOTPCREL(%rip), %r14
	movq	_EINTR@GOTPCREL(%rip), %r15
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movslq	12(%rbx), %rsi
	movl	28(%rbx), %edx
	subl	%esi, %edx
	addq	16(%rbx), %rsi
	movq	%rbx, %rdi
	callq	_pqsecure_read
	testl	%eax, %eax
	jns	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=1
	movq	(%r14), %rax
	cmpq	(%r15), %rax
	je	LBB0_11
	jmp	LBB0_24
LBB0_13:                                ##   in Loop: Header=BB0_11 Depth=1
	je	LBB0_16
## %bb.14:                              ##   in Loop: Header=BB0_11 Depth=1
	movl	%eax, %ecx
	addl	12(%rbx), %ecx
	movl	%ecx, 12(%rbx)
	movl	$1, %eax
	cmpl	$32769, %ecx                    ## imm = 0x8001
	jl	LBB0_25
## %bb.15:                              ##   in Loop: Header=BB0_11 Depth=1
	movl	28(%rbx), %edx
	subl	%ecx, %edx
	xorl	%r12d, %r12d
	cmpl	$8191, %edx                     ## imm = 0x1FFF
	jg	LBB0_11
	jmp	LBB0_25
LBB0_16:
	movl	$1, %eax
	testb	$1, %r12b
	je	LBB0_25
## %bb.17:
	movq	%rbx, %rdi
	callq	_pqReadReady
	testl	%eax, %eax
	je	LBB0_25
## %bb.18:
	cmpl	$1, %eax
	jne	LBB0_23
LBB0_19:                                ## =>This Inner Loop Header: Depth=1
	movslq	12(%rbx), %rsi
	movl	28(%rbx), %edx
	subl	%esi, %edx
	addq	16(%rbx), %rsi
	movq	%rbx, %rdi
	callq	_pqsecure_read
	testl	%eax, %eax
	jns	LBB0_21
## %bb.20:                              ##   in Loop: Header=BB0_19 Depth=1
	movq	(%r14), %rcx
	movl	$-1, %eax
	cmpq	(%r15), %rcx
	je	LBB0_19
	jmp	LBB0_25
LBB0_21:
	je	LBB0_23
## %bb.22:
	addl	%eax, 12(%rbx)
	movl	$1, %eax
	jmp	LBB0_25
LBB0_23:
	leaq	36(%rbx), %r14
	leaq	L_.str.1(%rip), %rdi
	callq	_libpq_gettext
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_printfPQExpBuffer
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_pqDropConnection
	movq	_CONNECTION_BAD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 32(%rbx)
	jmp	LBB0_24
	.cfi_endproc
                                        ## -- End function
	.comm	_PGINVALID_SOCKET,8,3           ## @PGINVALID_SOCKET
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"connection not open\n"

	.comm	_SOCK_ERRNO,8,3                 ## @SOCK_ERRNO
	.comm	_EINTR,8,3                      ## @EINTR
L_.str.1:                               ## @.str.1
	.asciz	"server closed the connection unexpectedly\n\tThis probably means the server terminated abnormally\n\tbefore or while processing the request.\n"

	.comm	_CONNECTION_BAD,4,2             ## @CONNECTION_BAD
	.comm	_EAGAIN,8,3                     ## @EAGAIN
	.comm	_ECONNRESET,8,3                 ## @ECONNRESET
	.comm	_EWOULDBLOCK,8,3                ## @EWOULDBLOCK
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pqReadData                     ; -- Begin function pqReadData
	.p2align	2
_pqReadData:                            ; @pqReadData
	.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
	mov	x19, x0
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _PGINVALID_SOCKET@GOTPAGE
Lloh1:
	ldr	x9, [x9, _PGINVALID_SOCKET@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.1:
	add	x19, x19, #36
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_libpq_gettext
	mov	x1, x0
	mov	x0, x19
	bl	_printfPQExpBuffer
LBB0_2:
	mov	w0, #-1
LBB0_3:
	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_4:
	ldp	w9, w8, [x19, #8]
	cmp	w8, w9
	b.le	LBB0_7
; %bb.5:
	cmp	w9, #1
	b.lt	LBB0_9
; %bb.6:
	ldr	x0, [x19, #16]
	add	x1, x0, x9
	sub	w8, w8, w9
	sxtw	x2, w8
	bl	_memmove
	ldp	w9, w8, [x19, #8]
	sub	w8, w8, w9
	str	w8, [x19, #12]
	ldr	w10, [x19, #24]
	sub	w9, w10, w9
	str	w9, [x19, #24]
	b	LBB0_8
LBB0_7:
	mov	w8, #0
	str	wzr, [x19, #12]
	str	wzr, [x19, #24]
LBB0_8:
	str	wzr, [x19, #8]
LBB0_9:
	ldr	w9, [x19, #28]
	sub	w9, w9, w8
	cmp	w9, #2, lsl #12                 ; =8192
	b.ge	LBB0_12
; %bb.10:
	sxtw	x8, w8
	add	x0, x8, #2, lsl #12             ; =8192
	mov	x1, x19
	bl	_pqCheckInBufferSpace
	cbz	x0, LBB0_12
; %bb.11:
	ldr	w8, [x19, #28]
	ldr	w9, [x19, #12]
	sub	w8, w8, w9
	cmp	w8, #100
	b.lt	LBB0_2
LBB0_12:
	mov	w22, #1
Lloh5:
	adrp	x20, _SOCK_ERRNO@GOTPAGE
Lloh6:
	ldr	x20, [x20, _SOCK_ERRNO@GOTPAGEOFF]
Lloh7:
	adrp	x21, _EINTR@GOTPAGE
Lloh8:
	ldr	x21, [x21, _EINTR@GOTPAGEOFF]
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #16]
	ldrsw	x9, [x19, #12]
	add	x1, x8, x9
	ldr	w8, [x19, #28]
	sub	w2, w8, w9
	mov	x0, x19
	bl	_pqsecure_read
	tbz	w0, #31, LBB0_15
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=1
	ldr	x8, [x20]
	ldr	x9, [x21]
	cmp	x8, x9
	b.eq	LBB0_13
	b	LBB0_2
LBB0_15:                                ;   in Loop: Header=BB0_13 Depth=1
	cbz	w0, LBB0_18
; %bb.16:                               ;   in Loop: Header=BB0_13 Depth=1
	ldr	w8, [x19, #12]
	add	w8, w8, w0
	str	w8, [x19, #12]
	cmp	w8, #8, lsl #12                 ; =32768
	b.le	LBB0_23
; %bb.17:                               ;   in Loop: Header=BB0_13 Depth=1
	mov	w22, #0
	ldr	w9, [x19, #28]
	sub	w8, w9, w8
	mov	w0, #1
	cmp	w8, #2, lsl #12                 ; =8192
	b.ge	LBB0_13
	b	LBB0_3
LBB0_18:
	tbz	w22, #0, LBB0_23
; %bb.19:
	mov	x0, x19
	bl	_pqReadReady
	cbz	w0, LBB0_3
; %bb.20:
	cmp	w0, #1
	b.ne	LBB0_26
LBB0_21:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #16]
	ldrsw	x9, [x19, #12]
	add	x1, x8, x9
	ldr	w8, [x19, #28]
	sub	w2, w8, w9
	mov	x0, x19
	bl	_pqsecure_read
	tbz	w0, #31, LBB0_24
; %bb.22:                               ;   in Loop: Header=BB0_21 Depth=1
	ldr	x8, [x20]
	ldr	x9, [x21]
	mov	w0, #-1
	cmp	x8, x9
	b.eq	LBB0_21
	b	LBB0_3
LBB0_23:
	mov	w0, #1
	b	LBB0_3
LBB0_24:
	cbz	w0, LBB0_26
; %bb.25:
	ldr	w8, [x19, #12]
	add	w8, w8, w0
	str	w8, [x19, #12]
	mov	w0, #1
	b	LBB0_3
LBB0_26:
	add	x20, x19, #36
Lloh9:
	adrp	x0, l_.str.1@PAGE
Lloh10:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_libpq_gettext
	mov	x1, x0
	mov	x0, x20
	bl	_printfPQExpBuffer
	mov	x0, x19
	mov	w1, #0
	bl	_pqDropConnection
Lloh11:
	adrp	x8, _CONNECTION_BAD@GOTPAGE
Lloh12:
	ldr	x8, [x8, _CONNECTION_BAD@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	str	w8, [x19, #32]
	b	LBB0_2
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_PGINVALID_SOCKET,8,3           ; @PGINVALID_SOCKET
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"connection not open\n"

	.comm	_SOCK_ERRNO,8,3                 ; @SOCK_ERRNO
	.comm	_EINTR,8,3                      ; @EINTR
l_.str.1:                               ; @.str.1
	.asciz	"server closed the connection unexpectedly\n\tThis probably means the server terminated abnormally\n\tbefore or while processing the request.\n"

	.comm	_CONNECTION_BAD,4,2             ; @CONNECTION_BAD
	.comm	_EAGAIN,8,3                     ; @EAGAIN
	.comm	_ECONNRESET,8,3                 ; @ECONNRESET
	.comm	_EWOULDBLOCK,8,3                ; @EWOULDBLOCK
.subsections_via_symbols
