	.file	"extr_fe-secure-gssapi.c_pg_GSS_read.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"oversize GSSAPI packet sent by the server (%zu > %zu)\n"
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"GSSAPI unwrap error"
	.section	.rodata.str1.8
	.align 8
.LC2:
	.string	"incoming GSSAPI message did not use confidentiality\n"
	.text
	.p2align 4
	.globl	pg_GSS_read
	.type	pg_GSS_read, @function
pg_GSS_read:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 88
	.cfi_def_cfa_offset 144
	movdqu	xmm0, XMMWORD PTR GSS_C_EMPTY_BUFFER[rip]
	mov	QWORD PTR [rsp], rsi
	mov	QWORD PTR 8[rsp], rdx
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 72[rsp], rax
	xor	eax, eax
	movaps	XMMWORD PTR 32[rsp], xmm0
	movaps	XMMWORD PTR 48[rsp], xmm0
	test	rdx, rdx
	je	.L16
	mov	rbp, rdi
	mov	r13, rdx
	xor	r12d, r12d
	mov	ebx, 4
	.p2align 4,,10
	.p2align 3
.L14:
	movsx	rsi, DWORD PTR PqGSSResultPointer[rip]
	mov	eax, DWORD PTR PqGSSResultLength[rip]
	mov	DWORD PTR 28[rsp], 0
	cmp	esi, eax
	jl	.L19
	movsx	rax, DWORD PTR PqGSSRecvLength[rip]
	mov	rsi, QWORD PTR PqGSSRecvBuffer[rip]
	cmp	eax, 3
	ja	.L6
	mov	edx, ebx
	add	rsi, rax
	mov	rdi, rbp
	sub	edx, eax
	call	pqsecure_raw_read@PLT
	add	eax, DWORD PTR PqGSSRecvLength[rip]
	mov	DWORD PTR PqGSSRecvLength[rip], eax
	cmp	eax, 3
	jbe	.L1
	mov	rsi, QWORD PTR PqGSSRecvBuffer[rip]
.L6:
	mov	edi, DWORD PTR [rsi]
	call	ntohl@PLT
	movsx	rcx, DWORD PTR PQ_GSS_RECV_BUFFER_SIZE[rip]
	movsx	rdx, eax
	mov	DWORD PTR 32[rsp], eax
	sub	rcx, 4
	cmp	rdx, rcx
	ja	.L20
	movsx	rsi, DWORD PTR PqGSSRecvLength[rip]
	mov	edx, ebx
	mov	rdi, rbp
	sub	edx, esi
	add	rsi, QWORD PTR PqGSSRecvBuffer[rip]
	add	edx, eax
	call	pqsecure_raw_read@PLT
	add	eax, DWORD PTR PqGSSRecvLength[rip]
	movsx	rdx, DWORD PTR 32[rsp]
	mov	DWORD PTR PqGSSRecvLength[rip], eax
	cdqe
	sub	rax, 4
	cmp	rax, rdx
	jb	.L21
	mov	esi, DWORD PTR 4[rbp]
	lea	r14, 48[rsp]
	lea	r15, 24[rsp]
	xor	r9d, r9d
	lea	rdx, 32[rsp]
	lea	r8, 28[rsp]
	mov	rcx, r14
	mov	rdi, r15
	mov	rax, QWORD PTR PqGSSRecvBuffer[rip]
	mov	DWORD PTR 48[rsp], 0
	mov	QWORD PTR 56[rsp], 0
	add	rax, 4
	mov	QWORD PTR 40[rsp], rax
	call	gss_unwrap@PLT
	cmp	DWORD PTR GSS_S_COMPLETE[rip], eax
	jne	.L22
	mov	eax, DWORD PTR 28[rsp]
	test	eax, eax
	je	.L23
	mov	rsi, QWORD PTR 56[rsp]
	mov	edx, DWORD PTR 48[rsp]
	mov	rdi, QWORD PTR PqGSSResultBuffer[rip]
	call	memcpy@PLT
	mov	eax, DWORD PTR 48[rsp]
	mov	rsi, r14
	mov	rdi, r15
	mov	DWORD PTR PqGSSRecvLength[rip], 0
	mov	DWORD PTR PqGSSResultLength[rip], eax
	mov	DWORD PTR PqGSSRecvPointer[rip], 0
	call	gss_release_buffer@PLT
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L19:
	mov	rcx, QWORD PTR 8[rsp]
	sub	eax, esi
	cdqe
	sub	rcx, r12
	cmp	rcx, rax
	cmovbe	rax, rcx
	add	rsi, QWORD PTR PqGSSResultBuffer[rip]
	mov	r14, rax
	mov	rax, QWORD PTR [rsp]
	mov	edx, r14d
	sub	r13, r14
	lea	rdi, [rax+r12]
	add	r12, r14
	call	memcpy@PLT
	mov	eax, DWORD PTR PqGSSResultPointer[rip]
	add	eax, r14d
	cmp	eax, DWORD PTR PqGSSResultLength[rip]
	mov	DWORD PTR PqGSSResultPointer[rip], eax
	jne	.L4
	mov	DWORD PTR PqGSSResultLength[rip], 0
	mov	DWORD PTR PqGSSResultPointer[rip], 0
.L4:
	test	r13, r13
	jne	.L14
.L2:
	cmp	QWORD PTR 56[rsp], 0
	je	.L1
.L25:
	lea	rsi, 48[rsp]
	lea	rdi, 24[rsp]
	call	gss_release_buffer@PLT
.L1:
	mov	rax, QWORD PTR 72[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L24
	add	rsp, 88
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	rax, r12
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L20:
	.cfi_restore_state
	lea	rdi, .LC0[rip]
	mov	QWORD PTR 8[rsp], rcx
	mov	QWORD PTR [rsp], rdx
	call	libpq_gettext@PLT
	mov	rcx, QWORD PTR 8[rsp]
	mov	rdx, QWORD PTR [rsp]
	mov	rdi, rbp
	mov	esi, eax
	xor	eax, eax
	call	printfPQExpBuffer@PLT
.L9:
	cmp	QWORD PTR 56[rsp], 0
	mov	r12, -1
	jne	.L25
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L21:
	test	r12, r12
	mov	rax, -1
	cmove	r12, rax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L22:
	mov	r12d, DWORD PTR 24[rsp]
	lea	rdi, .LC1[rip]
	mov	DWORD PTR [rsp], eax
	call	libpq_gettext@PLT
	mov	edx, DWORD PTR [rsp]
	mov	rsi, rbp
	mov	edi, eax
	mov	ecx, r12d
	call	pg_GSS_error@PLT
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L23:
	lea	rdi, .LC2[rip]
	call	libpq_gettext@PLT
	mov	rdi, rbp
	mov	esi, eax
	xor	eax, eax
	call	printfPQExpBuffer@PLT
	jmp	.L9
.L16:
	xor	r12d, r12d
	jmp	.L2
.L24:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	pg_GSS_read, .-pg_GSS_read
	.comm	PqGSSResultPointer,4,4
	.comm	PqGSSResultLength,4,4
	.comm	PqGSSResultBuffer,8,8
	.comm	PqGSSRecvPointer,4,4
	.comm	PqGSSRecvLength,4,4
	.comm	PqGSSRecvBuffer,8,8
	.comm	PQ_GSS_RECV_BUFFER_SIZE,4,4
	.comm	GSS_S_COMPLETE,4,4
	.comm	GSS_C_EMPTY_BUFFER,16,16
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_fe-secure-gssapi.c_pg_GSS_read.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"oversize GSSAPI packet sent by the server (%zu > %z"
	.ascii	"u)\012\000"
	.align	2
.LC1:
	.ascii	"GSSAPI unwrap error\000"
	.align	2
.LC2:
	.ascii	"incoming GSSAPI message did not use confidentiality"
	.ascii	"\012\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC3:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	pg_GSS_read
	.syntax unified
	.arm
	.fpu softvfp
	.type	pg_GSS_read, %function
pg_GSS_read:
	@ args = 0, pretend = 0, frame = 56
	@ frame_needed = 0, uses_anonymous_args = 0
	mov	ip, r1
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	sub	sp, sp, #68
	str	ip, [sp, #28]
	cmp	r2, #0
	ldr	ip, .L29
	ldr	r3, .L29+4
	str	r2, [sp, #24]
	ldr	ip, [ip]
	str	ip, [sp, #60]
	mov	ip,#0
	add	r9, sp, #52
	add	ip, sp, #44
	mov	r7, r0
	ldm	r3, {r0, r1}
	stm	ip, {r0, r1}
	stm	r9, {r0, r1}
	beq	.L16
	mov	r3, #0
	ldr	r10, .L29+8
	ldr	r8, .L29+12
	ldr	r4, .L29+16
	ldr	r6, .L29+20
	ldr	fp, .L29+24
	str	r2, [sp, #16]
	str	r3, [sp, #12]
.L14:
	mov	r5, #0
	ldr	r3, [r10]
	ldr	r2, [r8]
	str	r5, [sp, #40]
	cmp	r3, r2
	blt	.L22
	ldr	r2, [r4]
	ldr	r1, [r6]
	cmp	r2, #3
	bhi	.L6
	add	r1, r1, r2
	mov	r0, r7
	rsb	r2, r2, #4
	bl	pqsecure_raw_read
	ldr	r3, [r4]
	add	r0, r0, r3
	cmp	r0, #3
	str	r0, [r4]
	bls	.L1
	ldr	r1, [r6]
.L6:
	ldr	r0, [r1]
	bl	ntohl
	ldr	r3, [fp]
	str	r0, [sp, #44]
	sub	r3, r3, #4
	cmp	r0, r3
	bhi	.L23
	ldr	r3, [r4]
	ldr	r1, [r6]
	rsb	r2, r3, #4
	add	r2, r2, r0
	add	r1, r1, r3
	mov	r0, r7
	bl	pqsecure_raw_read
	ldr	r2, [r4]
	ldr	r3, [sp, #44]
	add	r0, r0, r2
	sub	r2, r0, #4
	cmp	r2, r3
	str	r0, [r4]
	bcc	.L24
	mov	r5, #0
	ldr	ip, [r6]
	add	r3, sp, #40
	str	r3, [sp]
	str	r5, [sp, #4]
	mov	r3, r9
	add	ip, ip, #4
	ldr	r1, [r7, #4]
	add	r0, sp, #36
	add	r2, sp, #44
	str	ip, [sp, #48]
	str	r5, [sp, #56]
	str	r5, [sp, #52]
	bl	gss_unwrap
	ldr	r3, .L29+28
	ldr	r3, [r3]
	cmp	r3, r0
	bne	.L25
	ldr	r3, [sp, #40]
	cmp	r3, #0
	beq	.L26
	ldr	r3, .L29+32
	ldr	r2, [sp, #52]
	ldr	r1, [sp, #56]
	ldr	r0, [r3]
	bl	memcpy
	ldr	r3, [sp, #52]
	ldr	r2, .L29+36
	mov	r1, r9
	add	r0, sp, #36
	str	r5, [r4]
	str	r5, [r2]
	str	r3, [r8]
	bl	gss_release_buffer
	b	.L14
.L22:
	ldr	r0, [sp, #12]
	ldr	r1, [sp, #24]
	sub	r2, r2, r3
	sub	r1, r1, r0
	cmp	r1, r2
	movcc	r2, r1
	ldr	r1, .L29+32
	str	r2, [sp, #20]
	ldr	r1, [r1]
	add	r1, r1, r3
	ldr	r3, [sp, #28]
	add	r0, r3, r0
	bl	memcpy
	ldr	r3, [r10]
	ldr	r2, [sp, #20]
	ldr	r1, [r8]
	add	r3, r2, r3
	cmp	r3, r1
	ldr	r1, [sp, #16]
	ldr	r0, [sp, #12]
	sub	r1, r1, r2
	str	r1, [sp, #16]
	str	r3, [r10]
	ldr	r3, [sp, #16]
	add	r2, r0, r2
	streq	r5, [r8]
	streq	r5, [r10]
	cmp	r3, #0
	str	r2, [sp, #12]
	bne	.L14
.L2:
	ldr	r3, [sp, #56]
	cmp	r3, #0
	beq	.L1
.L28:
	mov	r1, r9
	add	r0, sp, #36
	bl	gss_release_buffer
.L1:
	ldr	r3, .L29
	ldr	r2, [r3]
	ldr	r3, [sp, #60]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L27
	ldr	r0, [sp, #12]
	add	sp, sp, #68
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L23:
	ldr	r0, .L29+40
	bl	libpq_gettext
	ldr	r3, [fp]
	mov	r1, r0
	ldr	r2, [sp, #44]
	mov	r0, r7
	sub	r3, r3, #4
	bl	printfPQExpBuffer
.L9:
	mvn	r3, #0
	str	r3, [sp, #12]
	ldr	r3, [sp, #56]
	cmp	r3, #0
	bne	.L28
	b	.L1
.L24:
	ldr	r3, [sp, #12]
	cmp	r3, #0
	mvneq	r3, #0
	str	r3, [sp, #12]
	b	.L1
.L25:
	str	r0, [sp, #12]
	ldr	r0, .L29+44
	bl	libpq_gettext
	mov	r1, r7
	ldr	r2, [sp, #12]
	ldr	r3, [sp, #36]
	bl	pg_GSS_error
	b	.L9
.L26:
	ldr	r0, .L29+48
	bl	libpq_gettext
	mov	r1, r0
	mov	r0, r7
	bl	printfPQExpBuffer
	b	.L9
.L16:
	ldr	r3, [sp, #24]
	str	r3, [sp, #12]
	b	.L2
.L27:
	bl	__stack_chk_fail
.L30:
	.align	2
.L29:
	.word	.LC3
	.word	GSS_C_EMPTY_BUFFER
	.word	PqGSSResultPointer
	.word	PqGSSResultLength
	.word	PqGSSRecvLength
	.word	PqGSSRecvBuffer
	.word	PQ_GSS_RECV_BUFFER_SIZE
	.word	GSS_S_COMPLETE
	.word	PqGSSResultBuffer
	.word	PqGSSRecvPointer
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.size	pg_GSS_read, .-pg_GSS_read
	.comm	PqGSSResultPointer,4,4
	.comm	PqGSSResultLength,4,4
	.comm	PqGSSResultBuffer,4,4
	.comm	PqGSSRecvPointer,4,4
	.comm	PqGSSRecvLength,4,4
	.comm	PqGSSRecvBuffer,4,4
	.comm	PQ_GSS_RECV_BUFFER_SIZE,4,4
	.comm	GSS_S_COMPLETE,4,4
	.comm	GSS_C_EMPTY_BUFFER,8,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
