	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pg_be_scram_exchange           ## -- Begin function pg_be_scram_exchange
	.p2align	4, 0x90
_pg_be_scram_exchange:                  ## @pg_be_scram_exchange
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, %r14
	movq	%rcx, %r12
	movq	%rdi, %r13
	movq	$0, (%rcx)
	testq	%rsi, %rsi
	je	LBB0_1
## %bb.2:
	movl	%edx, %r15d
	movq	%rsi, %rbx
	movq	%r9, -56(%rbp)                  ## 8-byte Spill
	testl	%edx, %edx
	jne	LBB0_4
## %bb.3:
	movq	_ERROR@GOTPCREL(%rip), %rax
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	movl	(%rax), %r14d
	movq	_ERRCODE_PROTOCOL_VIOLATION@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_errcode
	leaq	L_.str.1(%rip), %rdi
	callq	_errmsg
	leaq	L_.str.2(%rip), %rdi
	callq	_errdetail
	movl	%r14d, %edi
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movl	%eax, %esi
	callq	_ereport
LBB0_4:
	movq	%rbx, %rdi
	callq	_strlen
	cmpl	%r15d, %eax
	je	LBB0_6
## %bb.5:
	movq	_ERROR@GOTPCREL(%rip), %rax
	movq	%r14, %r15
	movl	(%rax), %r14d
	movq	_ERRCODE_PROTOCOL_VIOLATION@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_errcode
	leaq	L_.str.1(%rip), %rdi
	callq	_errmsg
	leaq	L_.str.3(%rip), %rdi
	callq	_errdetail
	movl	%r14d, %edi
	movq	%r15, %r14
	movl	%eax, %esi
	callq	_ereport
LBB0_6:
	movl	(%r13), %eax
	cmpl	$128, %eax
	je	LBB0_9
## %bb.7:
	cmpl	$129, %eax
	jne	LBB0_14
## %bb.8:
	movq	%r13, %rdi
	movq	%rbx, %rsi
	callq	_read_client_first_message
	movq	%r13, %rdi
	callq	_build_server_first_message
	movq	%rax, (%r12)
	movl	$128, (%r13)
	movq	_SASL_EXCHANGE_CONTINUE@GOTPCREL(%rip), %rax
	jmp	LBB0_16
LBB0_1:
	xorl	%edi, %edi
	cmpl	$129, (%r13)
	sete	%dil
	callq	_Assert
	leaq	L_.str(%rip), %rdi
	callq	_pstrdup
	movq	%rax, (%r12)
	movl	$0, (%r14)
	movq	_SASL_EXCHANGE_CONTINUE@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_23
LBB0_9:
	movq	%r13, %rdi
	movq	%rbx, %rsi
	callq	_read_client_final_message
	movq	%r13, %rdi
	callq	_verify_final_nonce
	testl	%eax, %eax
	jne	LBB0_11
## %bb.10:
	movq	_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_ERRCODE_PROTOCOL_VIOLATION@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_errcode
	leaq	L_.str.4(%rip), %rdi
	callq	_errmsg
	leaq	L_.str.5(%rip), %rdi
	callq	_errdetail
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_ereport
LBB0_11:
	movq	%r13, %rdi
	callq	_verify_client_proof
	testl	%eax, %eax
	je	LBB0_15
## %bb.12:
	cmpl	$0, 16(%r13)
	jne	LBB0_15
## %bb.13:
	movq	%r13, %rdi
	callq	_build_server_final_message
	movq	%rax, (%r12)
	movq	_SASL_EXCHANGE_SUCCESS@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_SCRAM_AUTH_FINISHED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r13)
	jmp	LBB0_17
LBB0_14:
	movq	_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.6(%rip), %rsi
	callq	_elog
LBB0_15:
	movq	_SASL_EXCHANGE_FAILURE@GOTPCREL(%rip), %rax
LBB0_16:
	movl	(%rax), %ebx
LBB0_17:
	movq	_SASL_EXCHANGE_FAILURE@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	jne	LBB0_21
## %bb.18:
	testq	%rcx, %rcx
	je	LBB0_21
## %bb.19:
	movq	8(%r13), %rax
	testq	%rax, %rax
	je	LBB0_21
## %bb.20:
	movq	%rax, (%rcx)
LBB0_21:
	movq	(%r12), %rdi
	testq	%rdi, %rdi
	je	LBB0_23
## %bb.22:
	callq	_strlen
	movl	%eax, (%r14)
LBB0_23:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.space	1

	.comm	_SASL_EXCHANGE_CONTINUE,4,2     ## @SASL_EXCHANGE_CONTINUE
	.comm	_ERROR,4,2                      ## @ERROR
	.comm	_ERRCODE_PROTOCOL_VIOLATION,4,2 ## @ERRCODE_PROTOCOL_VIOLATION
L_.str.1:                               ## @.str.1
	.asciz	"malformed SCRAM message"

L_.str.2:                               ## @.str.2
	.asciz	"The message is empty."

L_.str.3:                               ## @.str.3
	.asciz	"Message length does not match input length."

L_.str.4:                               ## @.str.4
	.asciz	"invalid SCRAM response"

L_.str.5:                               ## @.str.5
	.asciz	"Nonce does not match."

	.comm	_SASL_EXCHANGE_FAILURE,4,2      ## @SASL_EXCHANGE_FAILURE
	.comm	_SASL_EXCHANGE_SUCCESS,4,2      ## @SASL_EXCHANGE_SUCCESS
	.comm	_SCRAM_AUTH_FINISHED,4,2        ## @SCRAM_AUTH_FINISHED
L_.str.6:                               ## @.str.6
	.asciz	"invalid SCRAM exchange state"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pg_be_scram_exchange           ; -- Begin function pg_be_scram_exchange
	.p2align	2
_pg_be_scram_exchange:                  ; @pg_be_scram_exchange
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x4
	mov	x20, x3
	mov	x22, x0
	str	xzr, [x3]
	cbz	x1, LBB0_8
; %bb.1:
	mov	x21, x5
	mov	x24, x2
	mov	x23, x1
	cbnz	w2, LBB0_3
; %bb.2:
Lloh0:
	adrp	x8, _ERROR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ERROR@GOTPAGEOFF]
Lloh2:
	ldr	w25, [x8]
Lloh3:
	adrp	x8, _ERRCODE_PROTOCOL_VIOLATION@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ERRCODE_PROTOCOL_VIOLATION@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	bl	_errcode
Lloh6:
	adrp	x0, l_.str.1@PAGE
Lloh7:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_errmsg
Lloh8:
	adrp	x0, l_.str.2@PAGE
Lloh9:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_errdetail
	mov	x1, x0
	mov	x0, x25
	bl	_ereport
LBB0_3:
	mov	x0, x23
	bl	_strlen
	cmp	w0, w24
	b.eq	LBB0_5
; %bb.4:
Lloh10:
	adrp	x8, _ERROR@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ERROR@GOTPAGEOFF]
Lloh12:
	ldr	w24, [x8]
Lloh13:
	adrp	x8, _ERRCODE_PROTOCOL_VIOLATION@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ERRCODE_PROTOCOL_VIOLATION@GOTPAGEOFF]
Lloh15:
	ldr	w0, [x8]
	bl	_errcode
Lloh16:
	adrp	x0, l_.str.1@PAGE
Lloh17:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_errmsg
Lloh18:
	adrp	x0, l_.str.3@PAGE
Lloh19:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_errdetail
	mov	x1, x0
	mov	x0, x24
	bl	_ereport
LBB0_5:
	ldr	w8, [x22]
Lloh20:
	adrp	x24, _SASL_EXCHANGE_FAILURE@GOTPAGE
Lloh21:
	ldr	x24, [x24, _SASL_EXCHANGE_FAILURE@GOTPAGEOFF]
	cmp	w8, #128
	b.eq	LBB0_9
; %bb.6:
	cmp	w8, #129
	b.ne	LBB0_14
; %bb.7:
	mov	x0, x22
	mov	x1, x23
	bl	_read_client_first_message
	mov	x0, x22
	bl	_build_server_first_message
	str	x0, [x20]
	mov	w8, #128
	str	w8, [x22]
Lloh22:
	adrp	x8, _SASL_EXCHANGE_CONTINUE@GOTPAGE
Lloh23:
	ldr	x8, [x8, _SASL_EXCHANGE_CONTINUE@GOTPAGEOFF]
Lloh24:
	ldr	w23, [x8]
	b	LBB0_16
LBB0_8:
	ldr	w8, [x22]
	cmp	w8, #129
	cset	w0, eq
	bl	_Assert
Lloh25:
	adrp	x0, l_.str@PAGE
Lloh26:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pstrdup
	str	x0, [x20]
	str	wzr, [x19]
Lloh27:
	adrp	x8, _SASL_EXCHANGE_CONTINUE@GOTPAGE
Lloh28:
	ldr	x8, [x8, _SASL_EXCHANGE_CONTINUE@GOTPAGEOFF]
Lloh29:
	ldr	w23, [x8]
	b	LBB0_22
LBB0_9:
	mov	x0, x22
	mov	x1, x23
	bl	_read_client_final_message
	mov	x0, x22
	bl	_verify_final_nonce
	cbnz	w0, LBB0_11
; %bb.10:
Lloh30:
	adrp	x8, _ERROR@GOTPAGE
Lloh31:
	ldr	x8, [x8, _ERROR@GOTPAGEOFF]
Lloh32:
	ldr	w23, [x8]
Lloh33:
	adrp	x8, _ERRCODE_PROTOCOL_VIOLATION@GOTPAGE
Lloh34:
	ldr	x8, [x8, _ERRCODE_PROTOCOL_VIOLATION@GOTPAGEOFF]
Lloh35:
	ldr	w0, [x8]
	bl	_errcode
Lloh36:
	adrp	x0, l_.str.4@PAGE
Lloh37:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_errmsg
Lloh38:
	adrp	x0, l_.str.5@PAGE
Lloh39:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_errdetail
	mov	x1, x0
	mov	x0, x23
	bl	_ereport
LBB0_11:
	mov	x0, x22
	bl	_verify_client_proof
	cbz	w0, LBB0_15
; %bb.12:
	ldr	w8, [x22, #16]
	cbnz	w8, LBB0_15
; %bb.13:
	mov	x0, x22
	bl	_build_server_final_message
Lloh40:
	adrp	x8, _SASL_EXCHANGE_SUCCESS@GOTPAGE
Lloh41:
	ldr	x8, [x8, _SASL_EXCHANGE_SUCCESS@GOTPAGEOFF]
	str	x0, [x20]
Lloh42:
	ldr	w23, [x8]
Lloh43:
	adrp	x8, _SCRAM_AUTH_FINISHED@GOTPAGE
Lloh44:
	ldr	x8, [x8, _SCRAM_AUTH_FINISHED@GOTPAGEOFF]
Lloh45:
	ldr	w8, [x8]
	str	w8, [x22]
	b	LBB0_16
LBB0_14:
Lloh46:
	adrp	x8, _ERROR@GOTPAGE
Lloh47:
	ldr	x8, [x8, _ERROR@GOTPAGEOFF]
Lloh48:
	ldr	w0, [x8]
Lloh49:
	adrp	x1, l_.str.6@PAGE
Lloh50:
	add	x1, x1, l_.str.6@PAGEOFF
	bl	_elog
LBB0_15:
	ldr	w23, [x24]
LBB0_16:
	ldr	w8, [x24]
	cmp	w23, w8
	b.ne	LBB0_20
; %bb.17:
	cbz	x21, LBB0_20
; %bb.18:
	ldr	x8, [x22, #8]
	cbz	x8, LBB0_20
; %bb.19:
	str	x8, [x21]
LBB0_20:
	ldr	x0, [x20]
	cbz	x0, LBB0_22
; %bb.21:
	bl	_strlen
	str	w0, [x19]
LBB0_22:
	mov	x0, x23
	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
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpAdd	Lloh49, Lloh50
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh48
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.space	1

	.comm	_SASL_EXCHANGE_CONTINUE,4,2     ; @SASL_EXCHANGE_CONTINUE
	.comm	_ERROR,4,2                      ; @ERROR
	.comm	_ERRCODE_PROTOCOL_VIOLATION,4,2 ; @ERRCODE_PROTOCOL_VIOLATION
l_.str.1:                               ; @.str.1
	.asciz	"malformed SCRAM message"

l_.str.2:                               ; @.str.2
	.asciz	"The message is empty."

l_.str.3:                               ; @.str.3
	.asciz	"Message length does not match input length."

l_.str.4:                               ; @.str.4
	.asciz	"invalid SCRAM response"

l_.str.5:                               ; @.str.5
	.asciz	"Nonce does not match."

	.comm	_SASL_EXCHANGE_FAILURE,4,2      ; @SASL_EXCHANGE_FAILURE
	.comm	_SASL_EXCHANGE_SUCCESS,4,2      ; @SASL_EXCHANGE_SUCCESS
	.comm	_SCRAM_AUTH_FINISHED,4,2        ; @SCRAM_AUTH_FINISHED
l_.str.6:                               ; @.str.6
	.asciz	"invalid SCRAM exchange state"

.subsections_via_symbols
