	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function _check_database_version
__check_database_version:               ## @_check_database_version
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movl	24(%rdi), %edi
	leaq	L_.str(%rip), %rsi
	callq	_PQparameterStatus
	movq	%rax, %r15
	movl	24(%r14), %edi
	callq	_PQserverVersion
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	testq	%r15, %r15
	jne	LBB0_3
LBB0_2:
	leaq	L_.str.1(%rip), %rdi
	callq	_fatal
LBB0_3:
	movq	%r15, %rdi
	callq	_pg_strdup
	movl	%eax, 16(%r14)
	movl	%ebx, (%r14)
	cmpl	$0, 20(%r14)
	jne	LBB0_5
## %bb.4:
	movl	%eax, 20(%r14)
LBB0_5:
	movq	_PG_VERSION_NUM@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	je	LBB0_9
## %bb.6:
	cmpl	4(%r14), %ebx
	jl	LBB0_8
## %bb.7:
	cmpl	8(%r14), %ebx
	jle	LBB0_9
LBB0_8:
	movq	_progname@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_PG_VERSION@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	L_.str.2(%rip), %rdi
	movq	%r15, %rsi
	callq	_pg_log_error
	leaq	L_.str.3(%rip), %rdi
	callq	_fatal
LBB0_9:
	cmpl	$90000, %ebx                    ## imm = 0x15F90
	jl	LBB0_10
## %bb.11:
	leaq	L_.str.4(%rip), %rsi
	movq	%r14, %rdi
	callq	_ExecuteSqlQueryForSingleRow
	movq	%rax, %rbx
	movq	%rax, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_PQgetvalue
	leaq	L_.str.5(%rip), %rsi
	movl	%eax, %edi
	callq	_strcmp
	xorl	%ecx, %ecx
	testq	%rax, %rax
	sete	%cl
	movl	%ecx, 12(%r14)
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_PQclear                        ## TAILCALL
LBB0_10:
	movl	$0, 12(%r14)
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"server_version"

L_.str.1:                               ## @.str.1
	.asciz	"could not get server_version from libpq"

	.comm	_PG_VERSION_NUM,4,2             ## @PG_VERSION_NUM
L_.str.2:                               ## @.str.2
	.asciz	"server version: %s; %s version: %s"

	.comm	_progname,4,2                   ## @progname
	.comm	_PG_VERSION,4,2                 ## @PG_VERSION
L_.str.3:                               ## @.str.3
	.asciz	"aborting because of server version mismatch"

L_.str.4:                               ## @.str.4
	.asciz	"SELECT pg_catalog.pg_is_in_recovery()"

L_.str.5:                               ## @.str.5
	.asciz	"t"

	.no_dead_strip	__check_database_version
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function _check_database_version
__check_database_version:               ; @_check_database_version
	.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	w0, [x0, #24]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_PQparameterStatus
	mov	x21, x0
	ldr	w0, [x19, #24]
	bl	_PQserverVersion
	mov	x20, x0
	cmp	w0, #0
	ccmp	x21, #0, #4, ne
	b.ne	LBB0_2
; %bb.1:
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_fatal
LBB0_2:
	mov	x0, x21
	bl	_pg_strdup
	str	w0, [x19, #16]
	str	w20, [x19]
	ldr	w8, [x19, #20]
	cbnz	w8, LBB0_4
; %bb.3:
	str	w0, [x19, #20]
LBB0_4:
Lloh4:
	adrp	x8, _PG_VERSION_NUM@GOTPAGE
Lloh5:
	ldr	x8, [x8, _PG_VERSION_NUM@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	cmp	w20, w8
	b.eq	LBB0_8
; %bb.5:
	ldr	w8, [x19, #4]
	cmp	w20, w8
	b.lt	LBB0_7
; %bb.6:
	ldr	w8, [x19, #8]
	cmp	w20, w8
	b.le	LBB0_8
LBB0_7:
Lloh7:
	adrp	x8, _progname@GOTPAGE
Lloh8:
	ldr	x8, [x8, _progname@GOTPAGEOFF]
Lloh9:
	ldr	w2, [x8]
Lloh10:
	adrp	x8, _PG_VERSION@GOTPAGE
Lloh11:
	ldr	x8, [x8, _PG_VERSION@GOTPAGEOFF]
Lloh12:
	ldr	w3, [x8]
Lloh13:
	adrp	x0, l_.str.2@PAGE
Lloh14:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x21
	bl	_pg_log_error
Lloh15:
	adrp	x0, l_.str.3@PAGE
Lloh16:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_fatal
LBB0_8:
	mov	w8, #24464
	movk	w8, #1, lsl #16
	cmp	w20, w8
	b.lt	LBB0_10
; %bb.9:
Lloh17:
	adrp	x1, l_.str.4@PAGE
Lloh18:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x19
	bl	_ExecuteSqlQueryForSingleRow
	mov	x20, x0
	mov	w1, #0
	mov	w2, #0
	bl	_PQgetvalue
Lloh19:
	adrp	x1, l_.str.5@PAGE
Lloh20:
	add	x1, x1, l_.str.5@PAGEOFF
	bl	_strcmp
	cmp	x0, #0
	cset	w8, eq
	str	w8, [x19, #12]
	mov	x0, x20
	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
	b	_PQclear
LBB0_10:
	str	wzr, [x19, #12]
	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
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"server_version"

l_.str.1:                               ; @.str.1
	.asciz	"could not get server_version from libpq"

	.comm	_PG_VERSION_NUM,4,2             ; @PG_VERSION_NUM
l_.str.2:                               ; @.str.2
	.asciz	"server version: %s; %s version: %s"

	.comm	_progname,4,2                   ; @progname
	.comm	_PG_VERSION,4,2                 ; @PG_VERSION
l_.str.3:                               ; @.str.3
	.asciz	"aborting because of server version mismatch"

l_.str.4:                               ; @.str.4
	.asciz	"SELECT pg_catalog.pg_is_in_recovery()"

l_.str.5:                               ; @.str.5
	.asciz	"t"

	.no_dead_strip	__check_database_version
.subsections_via_symbols
