	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function CopyStreamPoll
_CopyStreamPoll:                        ## @CopyStreamPoll
	.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	$32, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r15d
	movq	%rsi, %r12
	movq	%rdi, %rbx
	callq	_PQsocket
	testl	%eax, %eax
	js	LBB0_5
## %bb.1:
	movl	%eax, %r14d
	leaq	-36(%rbp), %rbx
	movq	%rbx, %rdi
	callq	_FD_ZERO
	movl	%r14d, %edi
	movq	%rbx, %rsi
	callq	_FD_SET
	movq	_PGINVALID_SOCKET@GOTPCREL(%rip), %rax
	movl	%r14d, %edi
	cmpl	%r15d, (%rax)
	je	LBB0_3
## %bb.2:
	leaq	-36(%rbp), %rsi
	movl	%r15d, %edi
	callq	_FD_SET
	movl	%r14d, %edi
	movl	%r15d, %esi
	callq	_Max
	movl	%eax, %edi
LBB0_3:
	testq	%r12, %r12
	js	LBB0_6
## %bb.4:
	movq	%r12, %rax
	shrq	$3, %rax
	movabsq	$2361183241434822607, %rcx      ## imm = 0x20C49BA5E353F7CF
	mulq	%rcx
	shrq	$4, %rdx
	movq	%rdx, -56(%rbp)
	imulq	$1000, %rdx, %rax               ## imm = 0x3E8
	subq	%rax, %r12
	imulq	$1000, %r12, %rax               ## imm = 0x3E8
	movq	%rax, -48(%rbp)
	leaq	-56(%rbp), %r8
	jmp	LBB0_7
LBB0_5:
	movq	%rbx, %rdi
	callq	_PQerrorMessage
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_pg_log_error
	jmp	LBB0_13
LBB0_6:
	xorl	%r8d, %r8d
LBB0_7:
	incl	%edi
	xorl	%ebx, %ebx
	leaq	-36(%rbp), %rsi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_select
	testl	%eax, %eax
	js	LBB0_11
## %bb.8:
	je	LBB0_10
## %bb.9:
	leaq	-36(%rbp), %rsi
	movl	%r14d, %edi
	callq	_FD_ISSET
	movl	$1, %ebx
	testq	%rax, %rax
	jne	LBB0_14
LBB0_10:
	xorl	%ebx, %ebx
	jmp	LBB0_14
LBB0_11:
	movq	_errno@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_EINTR@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_14
## %bb.12:
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_pg_log_error
LBB0_13:
	movl	$-1, %ebx
LBB0_14:
	movl	%ebx, %eax
	addq	$32, %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	"invalid socket: %s"

	.comm	_PGINVALID_SOCKET,4,2           ## @PGINVALID_SOCKET
	.comm	_errno,8,3                      ## @errno
	.comm	_EINTR,8,3                      ## @EINTR
L_.str.1:                               ## @.str.1
	.asciz	"select() failed: %m"

	.no_dead_strip	_CopyStreamPoll
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function CopyStreamPoll
_CopyStreamPoll:                        ; @CopyStreamPoll
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	mov	x21, x2
	mov	x20, x1
	mov	x22, x0
	bl	_PQsocket
	tbnz	w0, #31, LBB0_5
; %bb.1:
	mov	x19, x0
	add	x0, sp, #28
	bl	_FD_ZERO
	add	x1, sp, #28
	mov	x0, x19
	bl	_FD_SET
Lloh0:
	adrp	x8, _PGINVALID_SOCKET@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PGINVALID_SOCKET@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	mov	x0, x19
	cmp	w8, w21
	b.eq	LBB0_3
; %bb.2:
	add	x1, sp, #28
	mov	x0, x21
	bl	_FD_SET
	mov	x0, x19
	mov	x1, x21
	bl	_Max
LBB0_3:
	tbnz	x20, #63, LBB0_6
; %bb.4:
	lsr	x8, x20, #3
	mov	x9, #63439
	movk	x9, #58195, lsl #16
	movk	x9, #39845, lsl #32
	movk	x9, #8388, lsl #48
	umulh	x8, x8, x9
	lsr	x8, x8, #4
	mov	w9, #1000
	msub	x10, x8, x9, x20
	mul	x9, x10, x9
	stp	x8, x9, [sp, #8]
	add	x4, sp, #8
	b	LBB0_7
LBB0_5:
	mov	x0, x22
	bl	_PQerrorMessage
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp]
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_14
LBB0_6:
	mov	x4, #0
LBB0_7:
	add	w0, w0, #1
	add	x1, sp, #28
	mov	x2, #0
	mov	x3, #0
	bl	_select
	tbnz	w0, #31, LBB0_11
; %bb.8:
	cbz	w0, LBB0_12
; %bb.9:
	add	x1, sp, #28
	mov	x0, x19
	bl	_FD_ISSET
	cbz	x0, LBB0_12
; %bb.10:
	mov	w0, #1
	b	LBB0_15
LBB0_11:
Lloh5:
	adrp	x8, _errno@GOTPAGE
Lloh6:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
Lloh8:
	adrp	x9, _EINTR@GOTPAGE
Lloh9:
	ldr	x9, [x9, _EINTR@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_13
LBB0_12:
	mov	w0, #0
	b	LBB0_15
LBB0_13:
Lloh11:
	adrp	x0, l_.str.1@PAGE
Lloh12:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_14:
	bl	_pg_log_error
	mov	w0, #-1
LBB0_15:
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"invalid socket: %s"

	.comm	_PGINVALID_SOCKET,4,2           ; @PGINVALID_SOCKET
	.comm	_errno,8,3                      ; @errno
	.comm	_EINTR,8,3                      ; @EINTR
l_.str.1:                               ; @.str.1
	.asciz	"select() failed: %m"

	.no_dead_strip	_CopyStreamPoll
.subsections_via_symbols
