	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function _connectDB
__connectDB:                            ## @_connectDB
	.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	$264, %rsp                      ## imm = 0x108
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rdi, %r12
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	%rsi, -296(%rbp)                ## 8-byte Spill
	testq	%rsi, %rsi
	je	LBB0_1
## %bb.2:
	testq	%r14, %r14
	jne	LBB0_3
	jmp	LBB0_4
LBB0_1:
	movl	16(%r12), %edi
	callq	_PQdb
	movq	%rax, -296(%rbp)                ## 8-byte Spill
	testq	%r14, %r14
	je	LBB0_4
LBB0_3:
	cmpb	$0, (%r14)
	jne	LBB0_5
LBB0_4:
	movl	16(%r12), %edi
	callq	_PQuser
	movq	%rax, %r14
LBB0_5:
	leaq	L_.str(%rip), %rdi
	movq	-296(%rbp), %rsi                ## 8-byte Reload
	movq	%r14, %rdx
	callq	_pg_log_info
	movq	(%r12), %rbx
	movq	8(%r12), %rax
	movq	_TRI_YES@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_8
## %bb.6:
	testq	%rbx, %rbx
	jne	LBB0_8
## %bb.7:
	leaq	-160(%rbp), %rbx
	leaq	L_.str.1(%rip), %rdi
	movq	%rbx, %rsi
	movl	$100, %edx
	xorl	%ecx, %ecx
	callq	_simple_prompt
LBB0_8:
	leaq	-304(%rbp), %r13
	movq	%r13, %rdi
	callq	_initPQExpBuffer
	leaq	L_.str.2(%rip), %rsi
	movq	%r13, %rdi
	callq	_appendPQExpBufferStr
	movq	%r13, %rdi
	movq	-296(%rbp), %rsi                ## 8-byte Reload
	callq	_appendConnStrVal
	movq	_stderr@GOTPCREL(%rip), %r15
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_9 Depth=1
	leaq	L_.str.1(%rip), %rdi
	leaq	-160(%rbp), %rbx
	movq	%rbx, %rsi
	movl	$100, %edx
	xorl	%ecx, %ecx
	callq	_simple_prompt
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	leaq	L_.str.3(%rip), %rax
	movq	%rax, -224(%rbp)
	movl	16(%r12), %edi
	callq	_PQhost
	movq	%rax, -288(%rbp)
	leaq	L_.str.4(%rip), %rax
	movq	%rax, -216(%rbp)
	movl	16(%r12), %edi
	callq	_PQport
	movq	%rax, -280(%rbp)
	leaq	L_.str.5(%rip), %rax
	movq	%rax, -208(%rbp)
	movq	%r14, -272(%rbp)
	leaq	L_.str.6(%rip), %rax
	movq	%rax, -200(%rbp)
	movq	%rbx, -264(%rbp)
	leaq	L_.str.7(%rip), %rax
	movq	%rax, -192(%rbp)
	movq	-304(%rbp), %rax
	movq	%rax, -256(%rbp)
	leaq	L_.str.8(%rip), %rax
	movq	%rax, -184(%rbp)
	movq	_progname@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -248(%rbp)
	movq	$0, -176(%rbp)
	movq	$0, -240(%rbp)
	leaq	-224(%rbp), %rdi
	leaq	-288(%rbp), %rsi
	movl	$1, %edx
	callq	_PQconnectdbParams
	movq	%rax, %r13
	testq	%rax, %rax
	jne	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	leaq	L_.str.9(%rip), %rdi
	xorl	%eax, %eax
	callq	_fatal
LBB0_11:                                ##   in Loop: Header=BB0_9 Depth=1
	movq	%r13, %rdi
	callq	_PQstatus
	movq	_CONNECTION_BAD@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_19
## %bb.12:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	%r13, %rdi
	callq	_PQconnectionNeedsPassword
	testl	%eax, %eax
	jne	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	%r13, %rdi
	callq	_PQerrorMessage
	leaq	L_.str.10(%rip), %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_fatal
LBB0_14:                                ##   in Loop: Header=BB0_9 Depth=1
	movq	%r13, %rdi
	callq	_PQfinish
	testq	%rbx, %rbx
	je	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_9 Depth=1
	movl	(%r15), %edi
	leaq	L_.str.11(%rip), %rsi
	xorl	%eax, %eax
	callq	_fprintf
LBB0_16:                                ##   in Loop: Header=BB0_9 Depth=1
	movl	(%r15), %edi
	leaq	L_.str.12(%rip), %rsi
	movq	-296(%rbp), %rdx                ## 8-byte Reload
	movq	%r14, %rcx
	xorl	%eax, %eax
	callq	_fprintf
	movq	8(%r12), %rax
	movq	_TRI_NO@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_17
## %bb.18:                              ##   in Loop: Header=BB0_9 Depth=1
	leaq	L_.str.13(%rip), %rdi
	xorl	%eax, %eax
	callq	_fatal
	jmp	LBB0_9
LBB0_19:
	movq	%r13, %rdi
	callq	_PQconnectionUsedPassword
	testq	%rax, %rax
	je	LBB0_23
## %bb.20:
	movq	(%r12), %rdi
	testq	%rdi, %rdi
	je	LBB0_22
## %bb.21:
	callq	_free
LBB0_22:
	movq	%r13, %rdi
	callq	_PQpass
	movl	%eax, %edi
	callq	_pg_strdup
	movq	%rax, (%r12)
LBB0_23:
	leaq	-304(%rbp), %rdi
	callq	_termPQExpBuffer
	movq	%r12, %rdi
	callq	__check_database_version
	movq	_notice_processor@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	xorl	%edx, %edx
	callq	_PQsetNoticeProcessor
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_25
## %bb.24:
	movq	%r13, %rax
	addq	$264, %rsp                      ## imm = 0x108
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_25:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"connecting to database \"%s\" as user \"%s\""

	.comm	_TRI_YES,8,3                    ## @TRI_YES
L_.str.1:                               ## @.str.1
	.asciz	"Password: "

L_.str.2:                               ## @.str.2
	.asciz	"dbname="

L_.str.3:                               ## @.str.3
	.asciz	"host"

L_.str.4:                               ## @.str.4
	.asciz	"port"

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

L_.str.6:                               ## @.str.6
	.asciz	"password"

L_.str.7:                               ## @.str.7
	.asciz	"dbname"

L_.str.8:                               ## @.str.8
	.asciz	"fallback_application_name"

	.comm	_progname,8,3                   ## @progname
L_.str.9:                               ## @.str.9
	.asciz	"could not reconnect to database"

	.comm	_CONNECTION_BAD,8,3             ## @CONNECTION_BAD
L_.str.10:                              ## @.str.10
	.asciz	"could not reconnect to database: %s"

	.comm	_stderr,4,2                     ## @stderr
L_.str.11:                              ## @.str.11
	.asciz	"Password incorrect\n"

L_.str.12:                              ## @.str.12
	.asciz	"Connecting to %s as %s\n"

	.comm	_TRI_NO,8,3                     ## @TRI_NO
L_.str.13:                              ## @.str.13
	.asciz	"connection needs password"

	.comm	_notice_processor,4,2           ## @notice_processor
	.no_dead_strip	__connectDB
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function _connectDB
__connectDB:                            ; @_connectDB
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #352
	.cfi_def_cfa_offset 352
	stp	x28, x27, [sp, #256]            ; 16-byte Folded Spill
	stp	x26, x25, [sp, #272]            ; 16-byte Folded Spill
	stp	x24, x23, [sp, #288]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #304]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #320]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #336]            ; 16-byte Folded Spill
	add	x29, sp, #336
	.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
	mov	x20, x2
	mov	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-96]
	cbz	x1, LBB0_2
; %bb.1:
	cbnz	x20, LBB0_3
	b	LBB0_4
LBB0_2:
	ldr	w0, [x19, #16]
	bl	_PQdb
	mov	x21, x0
	cbz	x20, LBB0_4
LBB0_3:
	ldrb	w8, [x20]
	cbnz	w8, LBB0_5
LBB0_4:
	ldr	w0, [x19, #16]
	bl	_PQuser
	mov	x20, x0
LBB0_5:
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x21
	mov	x2, x20
	bl	_pg_log_info
	ldp	x23, x8, [x19]
Lloh5:
	adrp	x9, _TRI_YES@GOTPAGE
Lloh6:
	ldr	x9, [x9, _TRI_YES@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	cmp	x8, x9
	ccmp	x23, #0, #0, eq
	b.ne	LBB0_7
; %bb.6:
	add	x23, sp, #140
Lloh8:
	adrp	x0, l_.str.1@PAGE
Lloh9:
	add	x0, x0, l_.str.1@PAGEOFF
	add	x1, sp, #140
	mov	w2, #100
	mov	w3, #0
	bl	_simple_prompt
LBB0_7:
	add	x0, sp, #16
	bl	_initPQExpBuffer
Lloh10:
	adrp	x1, l_.str.2@PAGE
Lloh11:
	add	x1, x1, l_.str.2@PAGEOFF
	add	x0, sp, #16
	bl	_appendPQExpBufferStr
	add	x0, sp, #16
	mov	x1, x21
	bl	_appendConnStrVal
Lloh12:
	adrp	x26, _progname@GOTPAGE
Lloh13:
	ldr	x26, [x26, _progname@GOTPAGEOFF]
Lloh14:
	adrp	x27, _CONNECTION_BAD@GOTPAGE
Lloh15:
	ldr	x27, [x27, _CONNECTION_BAD@GOTPAGEOFF]
Lloh16:
	adrp	x22, _stderr@GOTPAGE
Lloh17:
	ldr	x22, [x22, _stderr@GOTPAGEOFF]
Lloh18:
	adrp	x24, l_.str.12@PAGE
Lloh19:
	add	x24, x24, l_.str.12@PAGEOFF
Lloh20:
	adrp	x25, _TRI_NO@GOTPAGE
Lloh21:
	ldr	x25, [x25, _TRI_NO@GOTPAGEOFF]
	b	LBB0_9
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=1
	add	x23, sp, #140
	add	x1, sp, #140
Lloh22:
	adrp	x0, l_.str.1@PAGE
Lloh23:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	w2, #100
	mov	w3, #0
	bl	_simple_prompt
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
Lloh24:
	adrp	x8, l_.str.3@PAGE
Lloh25:
	add	x8, x8, l_.str.3@PAGEOFF
	str	x8, [sp, #80]
	ldr	w0, [x19, #16]
	bl	_PQhost
	str	x0, [sp, #24]
Lloh26:
	adrp	x8, l_.str.4@PAGE
Lloh27:
	add	x8, x8, l_.str.4@PAGEOFF
	str	x8, [sp, #88]
	ldr	w0, [x19, #16]
	bl	_PQport
	stp	x0, x20, [sp, #32]
Lloh28:
	adrp	x8, l_.str.5@PAGE
Lloh29:
	add	x9, x8, l_.str.5@PAGEOFF
Lloh30:
	adrp	x8, l_.str.6@PAGE
Lloh31:
	add	x8, x8, l_.str.6@PAGEOFF
	stp	x9, x8, [sp, #96]
	ldr	x8, [sp, #16]
	stp	x23, x8, [sp, #48]
Lloh32:
	adrp	x8, l_.str.7@PAGE
Lloh33:
	add	x9, x8, l_.str.7@PAGEOFF
Lloh34:
	adrp	x8, l_.str.8@PAGE
Lloh35:
	add	x8, x8, l_.str.8@PAGEOFF
	stp	x9, x8, [sp, #112]
	ldr	x8, [x26]
	str	xzr, [sp, #128]
	stp	x8, xzr, [sp, #64]
	add	x0, sp, #80
	add	x1, sp, #24
	mov	w2, #1
	bl	_PQconnectdbParams
	mov	x28, x0
	cbnz	x0, LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
Lloh36:
	adrp	x0, l_.str.9@PAGE
Lloh37:
	add	x0, x0, l_.str.9@PAGEOFF
	bl	_fatal
LBB0_11:                                ;   in Loop: Header=BB0_9 Depth=1
	mov	x0, x28
	bl	_PQstatus
	ldr	x8, [x27]
	cmp	x0, x8
	b.ne	LBB0_18
; %bb.12:                               ;   in Loop: Header=BB0_9 Depth=1
	mov	x0, x28
	bl	_PQconnectionNeedsPassword
	cbnz	w0, LBB0_14
; %bb.13:                               ;   in Loop: Header=BB0_9 Depth=1
	mov	x0, x28
	bl	_PQerrorMessage
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp]
Lloh38:
	adrp	x0, l_.str.10@PAGE
Lloh39:
	add	x0, x0, l_.str.10@PAGEOFF
	bl	_fatal
LBB0_14:                                ;   in Loop: Header=BB0_9 Depth=1
	mov	x0, x28
	bl	_PQfinish
	cbz	x23, LBB0_16
; %bb.15:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	w0, [x22]
Lloh40:
	adrp	x1, l_.str.11@PAGE
Lloh41:
	add	x1, x1, l_.str.11@PAGEOFF
	bl	_fprintf
LBB0_16:                                ;   in Loop: Header=BB0_9 Depth=1
	ldr	w0, [x22]
	stp	x21, x20, [sp]
	mov	x1, x24
	bl	_fprintf
	ldr	x8, [x19, #8]
	ldr	x9, [x25]
	cmp	x8, x9
	b.ne	LBB0_8
; %bb.17:                               ;   in Loop: Header=BB0_9 Depth=1
Lloh42:
	adrp	x0, l_.str.13@PAGE
Lloh43:
	add	x0, x0, l_.str.13@PAGEOFF
	bl	_fatal
	b	LBB0_9
LBB0_18:
	mov	x0, x28
	bl	_PQconnectionUsedPassword
	cbz	x0, LBB0_22
; %bb.19:
	ldr	x0, [x19]
	cbz	x0, LBB0_21
; %bb.20:
	bl	_free
LBB0_21:
	mov	x0, x28
	bl	_PQpass
	bl	_pg_strdup
	str	x0, [x19]
LBB0_22:
	add	x0, sp, #16
	bl	_termPQExpBuffer
	mov	x0, x19
	bl	__check_database_version
Lloh44:
	adrp	x8, _notice_processor@GOTPAGE
Lloh45:
	ldr	x8, [x8, _notice_processor@GOTPAGEOFF]
Lloh46:
	ldr	w1, [x8]
	mov	x0, x28
	mov	x2, #0
	bl	_PQsetNoticeProcessor
	ldur	x8, [x29, #-96]
Lloh47:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh48:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh49:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_24
; %bb.23:
	mov	x0, x28
	ldp	x29, x30, [sp, #336]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #320]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #304]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #288]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #272]            ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #256]            ; 16-byte Folded Reload
	add	sp, sp, #352
	ret
LBB0_24:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpAdrp	Lloh32, Lloh34
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpAdrp	Lloh28, Lloh30
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpAdd	Lloh40, Lloh41
	.loh AdrpAdd	Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"connecting to database \"%s\" as user \"%s\""

	.comm	_TRI_YES,8,3                    ; @TRI_YES
l_.str.1:                               ; @.str.1
	.asciz	"Password: "

l_.str.2:                               ; @.str.2
	.asciz	"dbname="

l_.str.3:                               ; @.str.3
	.asciz	"host"

l_.str.4:                               ; @.str.4
	.asciz	"port"

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

l_.str.6:                               ; @.str.6
	.asciz	"password"

l_.str.7:                               ; @.str.7
	.asciz	"dbname"

l_.str.8:                               ; @.str.8
	.asciz	"fallback_application_name"

	.comm	_progname,8,3                   ; @progname
l_.str.9:                               ; @.str.9
	.asciz	"could not reconnect to database"

	.comm	_CONNECTION_BAD,8,3             ; @CONNECTION_BAD
l_.str.10:                              ; @.str.10
	.asciz	"could not reconnect to database: %s"

	.comm	_stderr,4,2                     ; @stderr
l_.str.11:                              ; @.str.11
	.asciz	"Password incorrect\n"

l_.str.12:                              ; @.str.12
	.asciz	"Connecting to %s as %s\n"

	.comm	_TRI_NO,8,3                     ; @TRI_NO
l_.str.13:                              ; @.str.13
	.asciz	"connection needs password"

	.comm	_notice_processor,4,2           ; @notice_processor
	.no_dead_strip	__connectDB
.subsections_via_symbols
