	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pg_GSS_read                    ## -- Begin function pg_GSS_read
	.p2align	4, 0x90
_pg_GSS_read:                           ## @pg_GSS_read
	.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
	subq	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, -120(%rbp)                ## 8-byte Spill
	movq	_GSS_C_EMPTY_BUFFER@GOTPCREL(%rip), %rax
	movups	(%rax), %xmm0
	movaps	%xmm0, -96(%rbp)
	movaps	%xmm0, -64(%rbp)
	testq	%rdx, %rdx
	je	LBB0_15
## %bb.1:
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	xorl	%r14d, %r14d
	movq	_PqGSSResultPointer@GOTPCREL(%rip), %r15
	movq	_PqGSSResultLength@GOTPCREL(%rip), %r13
	movq	%rdx, %rax
	movq	%rdx, -104(%rbp)                ## 8-byte Spill
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_2:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	-104(%rbp), %rdx                ## 8-byte Reload
LBB0_3:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	%r12, %r14
	testq	%rax, %rax
	je	LBB0_20
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rax, -112(%rbp)                ## 8-byte Spill
	movl	$0, -48(%rbp)
	movslq	(%r15), %rsi
	movl	(%r13), %eax
	cmpl	%esi, %eax
	jle	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	subl	%esi, %eax
	cltq
	movq	%rdx, %rbx
	subq	%r14, %rbx
	cmpq	%rax, %rbx
	cmovaeq	%rax, %rbx
	movq	-120(%rbp), %rax                ## 8-byte Reload
	leaq	(%rax,%r14), %rdi
	movq	_PqGSSResultBuffer@GOTPCREL(%rip), %rax
	addq	(%rax), %rsi
	movl	%ebx, %edx
	callq	_memcpy
	movslq	%ebx, %r12
	addl	(%r15), %ebx
	movl	%ebx, (%r15)
	movq	-112(%rbp), %rax                ## 8-byte Reload
	subq	%r12, %rax
	addq	%r14, %r12
	cmpl	(%r13), %ebx
	jne	LBB0_2
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	$0, (%r13)
	movl	$0, (%r15)
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	%rdx, %r13
	movq	_PqGSSRecvLength@GOTPCREL(%rip), %r15
	movl	(%r15), %ebx
	cmpq	$3, %rbx
	ja	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%rbx, %rsi
	movq	_PqGSSRecvBuffer@GOTPCREL(%rip), %r12
	addq	(%r12), %rsi
	movl	$4, %edx
	subl	%ebx, %edx
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	callq	_pqsecure_raw_read
	movq	%rax, %rbx
	addl	(%r15), %ebx
	movl	%ebx, (%r15)
	cmpl	$4, %ebx
	jae	LBB0_10
	jmp	LBB0_18
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	_PqGSSRecvBuffer@GOTPCREL(%rip), %r12
LBB0_10:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	(%r12), %r12
	movl	(%r12), %edi
	callq	_ntohl
	movl	%eax, -96(%rbp)
	movslq	%eax, %rcx
	movq	_PQ_GSS_RECV_BUFFER_SIZE@GOTPCREL(%rip), %rdx
	movslq	(%rdx), %rdx
	addq	$-4, %rdx
	cmpq	%rcx, %rdx
	jb	LBB0_16
## %bb.11:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	%r13, %r15
	movslq	%ebx, %rcx
	addq	%rcx, %r12
	subl	%ecx, %eax
	addl	$4, %eax
	movq	-72(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %rdi
	movq	%r12, %rsi
	movl	%eax, %edx
	callq	_pqsecure_raw_read
	movq	_PqGSSRecvLength@GOTPCREL(%rip), %r12
	addl	(%r12), %eax
	movl	%eax, (%r12)
	cltq
	addq	$-4, %rax
	movslq	-96(%rbp), %rcx
	cmpq	%rcx, %rax
	jb	LBB0_17
## %bb.12:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	$0, -56(%rbp)
	movl	$0, -64(%rbp)
	movq	_PqGSSRecvBuffer@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	addq	$4, %rax
	movq	%rax, -88(%rbp)
	movl	4(%r13), %esi
	leaq	-44(%rbp), %rdi
	leaq	-96(%rbp), %rdx
	leaq	-64(%rbp), %rcx
	leaq	-48(%rbp), %r8
	xorl	%r9d, %r9d
	callq	_gss_unwrap
	movl	%eax, %ebx
	movq	_GSS_S_COMPLETE@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jne	LBB0_19
## %bb.13:                              ##   in Loop: Header=BB0_4 Depth=1
	cmpl	$0, -48(%rbp)
	je	LBB0_23
## %bb.14:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	_PqGSSResultBuffer@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	-56(%rbp), %rsi
	movl	-64(%rbp), %edx
	callq	_memcpy
	movl	-64(%rbp), %eax
	movq	_PqGSSResultLength@GOTPCREL(%rip), %r13
	movl	%eax, (%r13)
	movl	$0, (%r12)
	movq	_PqGSSRecvPointer@GOTPCREL(%rip), %rax
	movl	$0, (%rax)
	leaq	-44(%rbp), %rdi
	leaq	-64(%rbp), %rsi
	callq	_gss_release_buffer
	movq	%r14, %r12
	movq	%r15, %rdx
	movq	_PqGSSResultPointer@GOTPCREL(%rip), %r15
	movq	-112(%rbp), %rax                ## 8-byte Reload
	jmp	LBB0_3
LBB0_15:
	xorl	%r12d, %r12d
	cmpq	$0, -56(%rbp)
	jne	LBB0_21
	jmp	LBB0_22
LBB0_16:
	leaq	L_.str(%rip), %rdi
	callq	_libpq_gettext
	movslq	-96(%rbp), %rdx
	movq	_PQ_GSS_RECV_BUFFER_SIZE@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rcx
	addq	$-4, %rcx
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_printfPQExpBuffer
	jmp	LBB0_24
LBB0_17:
	xorl	%eax, %eax
	cmpq	$1, %r14
	sbbq	%rax, %rax
	orq	%rax, %r14
LBB0_18:
	movq	%r14, %r12
	jmp	LBB0_22
LBB0_19:
	leaq	L_.str.1(%rip), %rdi
	callq	_libpq_gettext
	movl	-44(%rbp), %ecx
	movl	%eax, %edi
	movq	%r13, %rsi
	movl	%ebx, %edx
	callq	_pg_GSS_error
	movq	$-1, %r12
LBB0_20:
	cmpq	$0, -56(%rbp)
	je	LBB0_22
LBB0_21:
	leaq	-44(%rbp), %rdi
	leaq	-64(%rbp), %rsi
	callq	_gss_release_buffer
LBB0_22:
	movq	%r12, %rax
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_23:
	leaq	L_.str.2(%rip), %rdi
	callq	_libpq_gettext
	movq	%r13, %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_printfPQExpBuffer
LBB0_24:
	movq	$-1, %r12
	cmpq	$0, -56(%rbp)
	jne	LBB0_21
	jmp	LBB0_22
	.cfi_endproc
                                        ## -- End function
	.comm	_GSS_C_EMPTY_BUFFER,16,3        ## @GSS_C_EMPTY_BUFFER
	.comm	_PqGSSResultPointer,4,2         ## @PqGSSResultPointer
	.comm	_PqGSSResultLength,4,2          ## @PqGSSResultLength
	.comm	_PqGSSResultBuffer,8,3          ## @PqGSSResultBuffer
	.comm	_PqGSSRecvLength,4,2            ## @PqGSSRecvLength
	.comm	_PqGSSRecvBuffer,8,3            ## @PqGSSRecvBuffer
	.comm	_PQ_GSS_RECV_BUFFER_SIZE,4,2    ## @PQ_GSS_RECV_BUFFER_SIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"oversize GSSAPI packet sent by the server (%zu > %zu)\n"

	.comm	_GSS_S_COMPLETE,4,2             ## @GSS_S_COMPLETE
L_.str.1:                               ## @.str.1
	.asciz	"GSSAPI unwrap error"

L_.str.2:                               ## @.str.2
	.asciz	"incoming GSSAPI message did not use confidentiality\n"

	.comm	_PqGSSRecvPointer,4,2           ## @PqGSSRecvPointer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pg_GSS_read                    ; -- Begin function pg_GSS_read
	.p2align	2
_pg_GSS_read:                           ; @pg_GSS_read
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #176
	.cfi_def_cfa_offset 176
	stp	x28, x27, [sp, #80]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #96]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #112]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #128]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #144]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #160]            ; 16-byte Folded Spill
	add	x29, sp, #160
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	str	x1, [sp, #16]                   ; 8-byte Folded Spill
Lloh0:
	adrp	x8, _GSS_C_EMPTY_BUFFER@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GSS_C_EMPTY_BUFFER@GOTPAGEOFF]
Lloh2:
	ldr	q0, [x8]
	stp	q0, q0, [sp, #32]
	cbz	x2, LBB0_13
; %bb.1:
	mov	x27, x2
	mov	x19, x0
	mov	x20, #0
Lloh3:
	adrp	x25, _PqGSSResultPointer@GOTPAGE
Lloh4:
	ldr	x25, [x25, _PqGSSResultPointer@GOTPAGEOFF]
Lloh5:
	adrp	x26, _PqGSSResultLength@GOTPAGE
Lloh6:
	ldr	x26, [x26, _PqGSSResultLength@GOTPAGEOFF]
Lloh7:
	adrp	x24, _PqGSSResultBuffer@GOTPAGE
Lloh8:
	ldr	x24, [x24, _PqGSSResultBuffer@GOTPAGEOFF]
Lloh9:
	adrp	x28, _PqGSSRecvLength@GOTPAGE
Lloh10:
	ldr	x28, [x28, _PqGSSRecvLength@GOTPAGEOFF]
	mov	x21, x2
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	cbz	x21, LBB0_14
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	str	wzr, [sp, #28]
	ldrsw	x8, [x25]
	ldr	w9, [x26]
	cmp	w9, w8
	b.le	LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	sub	w9, w9, w8
	sxtw	x9, w9
	sub	x10, x27, x20
	cmp	x10, x9
	csel	x23, x10, x9, lo
	ldr	x9, [sp, #16]                   ; 8-byte Folded Reload
	add	x0, x9, x20
	ldr	x9, [x24]
	add	x1, x9, x8
	mov	x2, x23
	bl	_memcpy
	ldr	w8, [x25]
	ldr	w9, [x26]
	add	w8, w8, w23
	cmp	w8, w9
	str	w8, [x25]
	sxtw	x8, w23
	sub	x21, x21, x8
	add	x20, x8, x20
	b.ne	LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	str	wzr, [x26]
	str	wzr, [x25]
	b	LBB0_2
LBB0_6:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	w23, [x28]
	cmp	w23, #3
	b.hi	LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_3 Depth=1
Lloh11:
	adrp	x8, _PqGSSRecvBuffer@GOTPAGE
Lloh12:
	ldr	x8, [x8, _PqGSSRecvBuffer@GOTPAGEOFF]
Lloh13:
	ldr	x8, [x8]
	add	x1, x8, x23
	mov	w8, #4
	sub	w2, w8, w23
	mov	x0, x19
	bl	_pqsecure_raw_read
	ldr	w8, [x28]
	add	w23, w8, w0
	str	w23, [x28]
	cmp	w23, #4
	b.lo	LBB0_22
LBB0_8:                                 ;   in Loop: Header=BB0_3 Depth=1
Lloh14:
	adrp	x8, _PqGSSRecvBuffer@GOTPAGE
Lloh15:
	ldr	x8, [x8, _PqGSSRecvBuffer@GOTPAGEOFF]
Lloh16:
	ldr	x22, [x8]
	ldr	w0, [x22]
	bl	_ntohl
	str	w0, [sp, #48]
Lloh17:
	adrp	x8, _PQ_GSS_RECV_BUFFER_SIZE@GOTPAGE
Lloh18:
	ldr	x8, [x8, _PQ_GSS_RECV_BUFFER_SIZE@GOTPAGEOFF]
Lloh19:
	ldrsw	x8, [x8]
	sub	x8, x8, #4
	cmp	x8, w0, sxtw
	b.lo	LBB0_15
; %bb.9:                                ;   in Loop: Header=BB0_3 Depth=1
	add	x1, x22, w23, sxtw
	sub	w8, w0, w23
	add	w2, w8, #4
	mov	x0, x19
	bl	_pqsecure_raw_read
	ldr	w8, [x28]
	add	w8, w8, w0
	str	w8, [x28]
	sxtw	x8, w8
	sub	x8, x8, #4
	ldrsw	x9, [sp, #48]
	cmp	x8, x9
	b.lo	LBB0_16
; %bb.10:                               ;   in Loop: Header=BB0_3 Depth=1
	str	xzr, [sp, #40]
	str	wzr, [sp, #32]
Lloh20:
	adrp	x8, _PqGSSRecvBuffer@GOTPAGE
Lloh21:
	ldr	x8, [x8, _PqGSSRecvBuffer@GOTPAGEOFF]
Lloh22:
	ldr	x8, [x8]
	add	x8, x8, #4
	str	x8, [sp, #56]
	ldr	w1, [x19, #4]
	add	x0, sp, #76
	add	x2, sp, #48
	add	x3, sp, #32
	add	x4, sp, #28
	mov	x5, #0
	bl	_gss_unwrap
Lloh23:
	adrp	x8, _GSS_S_COMPLETE@GOTPAGE
Lloh24:
	ldr	x8, [x8, _GSS_S_COMPLETE@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ne	LBB0_17
; %bb.11:                               ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [sp, #28]
	cbz	w8, LBB0_18
; %bb.12:                               ;   in Loop: Header=BB0_3 Depth=1
	ldr	x0, [x24]
	ldr	x1, [sp, #40]
	ldr	w2, [sp, #32]
	bl	_memcpy
	ldr	w8, [sp, #32]
	str	w8, [x26]
	str	wzr, [x28]
Lloh26:
	adrp	x8, _PqGSSRecvPointer@GOTPAGE
Lloh27:
	ldr	x8, [x8, _PqGSSRecvPointer@GOTPAGEOFF]
Lloh28:
	str	wzr, [x8]
	add	x0, sp, #76
	add	x1, sp, #32
	bl	_gss_release_buffer
	b	LBB0_2
LBB0_13:
	mov	x20, #0
LBB0_14:
	ldr	x8, [sp, #40]
	cbnz	x8, LBB0_21
	b	LBB0_22
LBB0_15:
Lloh29:
	adrp	x0, l_.str@PAGE
Lloh30:
	add	x0, x0, l_.str@PAGEOFF
	bl	_libpq_gettext
	mov	x1, x0
	ldrsw	x8, [sp, #48]
Lloh31:
	adrp	x9, _PQ_GSS_RECV_BUFFER_SIZE@GOTPAGE
Lloh32:
	ldr	x9, [x9, _PQ_GSS_RECV_BUFFER_SIZE@GOTPAGEOFF]
Lloh33:
	ldrsw	x9, [x9]
	sub	x9, x9, #4
	stp	x8, x9, [sp]
	b	LBB0_19
LBB0_16:
	cmp	x20, #0
	csinv	x20, x20, xzr, ne
	b	LBB0_22
LBB0_17:
	mov	x23, x0
Lloh34:
	adrp	x0, l_.str.1@PAGE
Lloh35:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_libpq_gettext
	ldr	w3, [sp, #76]
	mov	x1, x19
	mov	x2, x23
	bl	_pg_GSS_error
	b	LBB0_20
LBB0_18:
Lloh36:
	adrp	x0, l_.str.2@PAGE
Lloh37:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_libpq_gettext
	mov	x1, x0
LBB0_19:
	mov	x0, x19
	bl	_printfPQExpBuffer
LBB0_20:
	mov	x20, #-1
	ldr	x8, [sp, #40]
	cbz	x8, LBB0_22
LBB0_21:
	add	x0, sp, #76
	add	x1, sp, #32
	bl	_gss_release_buffer
LBB0_22:
	mov	x0, x20
	ldp	x29, x30, [sp, #160]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #144]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #128]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #112]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #96]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #80]             ; 16-byte Folded Reload
	add	sp, sp, #176
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotStr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpAdd	Lloh36, Lloh37
	.cfi_endproc
                                        ; -- End function
	.comm	_GSS_C_EMPTY_BUFFER,16,3        ; @GSS_C_EMPTY_BUFFER
	.comm	_PqGSSResultPointer,4,2         ; @PqGSSResultPointer
	.comm	_PqGSSResultLength,4,2          ; @PqGSSResultLength
	.comm	_PqGSSResultBuffer,8,3          ; @PqGSSResultBuffer
	.comm	_PqGSSRecvLength,4,2            ; @PqGSSRecvLength
	.comm	_PqGSSRecvBuffer,8,3            ; @PqGSSRecvBuffer
	.comm	_PQ_GSS_RECV_BUFFER_SIZE,4,2    ; @PQ_GSS_RECV_BUFFER_SIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"oversize GSSAPI packet sent by the server (%zu > %zu)\n"

	.comm	_GSS_S_COMPLETE,4,2             ; @GSS_S_COMPLETE
l_.str.1:                               ; @.str.1
	.asciz	"GSSAPI unwrap error"

l_.str.2:                               ; @.str.2
	.asciz	"incoming GSSAPI message did not use confidentiality\n"

	.comm	_PqGSSRecvPointer,4,2           ; @PqGSSRecvPointer
.subsections_via_symbols
