	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_connectDatabase                ## -- Begin function connectDatabase
	.p2align	4, 0x90
_connectDatabase:                       ## @connectDatabase
	.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	$168, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, -200(%rbp)                 ## 8-byte Spill
	movl	%r8d, -180(%rbp)                ## 4-byte Spill
	movq	%rcx, %r13
	movq	%rdx, %rbx
	movq	%rsi, %r14
	movq	%rdi, -192(%rbp)                ## 8-byte Spill
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	cmpl	$0, 32(%rbp)
	je	LBB0_2
## %bb.1:
	movb	_connectDatabase.have_password(%rip), %al
	testb	$1, %al
	je	LBB0_4
	jmp	LBB0_6
LBB0_2:
	movb	$0, _connectDatabase.have_password(%rip)
	xorl	%eax, %eax
	testb	$1, %al
	jne	LBB0_6
LBB0_4:
	movq	_TRI_YES@GOTPCREL(%rip), %rcx
	movl	-180(%rbp), %edx                ## 4-byte Reload
	cmpl	%edx, (%rcx)
	jne	LBB0_6
## %bb.5:
	leaq	L_.str(%rip), %rdi
	leaq	_connectDatabase.password(%rip), %rsi
	movl	$100, %edx
	xorl	%ecx, %ecx
	callq	_simple_prompt
	movb	$1, _connectDatabase.have_password(%rip)
	movb	$1, %al
LBB0_6:
	leaq	_connectDatabase.password(%rip), %r15
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	leaq	L_.str.1(%rip), %rcx
	movq	%rcx, -112(%rbp)
	movq	%r14, -176(%rbp)
	leaq	L_.str.2(%rip), %rcx
	movq	%rcx, -104(%rbp)
	movq	%rbx, -168(%rbp)
	leaq	L_.str.3(%rip), %rcx
	movq	%rcx, -96(%rbp)
	movq	%r13, -160(%rbp)
	testb	$1, %al
	movl	$0, %eax
	cmovneq	%r15, %rax
	leaq	L_.str.4(%rip), %rcx
	movq	%rcx, -88(%rbp)
	movq	%rax, -152(%rbp)
	leaq	L_.str.5(%rip), %rax
	movq	%rax, -80(%rbp)
	movq	-192(%rbp), %rax                ## 8-byte Reload
	movq	%rax, -144(%rbp)
	leaq	L_.str.6(%rip), %rax
	movq	%rax, -72(%rbp)
	movq	-200(%rbp), %rax                ## 8-byte Reload
	movq	%rax, -136(%rbp)
	movq	$0, -64(%rbp)
	movq	$0, -128(%rbp)
	leaq	-112(%rbp), %rdi
	leaq	-176(%rbp), %rsi
	movl	$1, %edx
	callq	_PQconnectdbParams
	testq	%rax, %rax
	je	LBB0_19
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	movq	%rax, %r12
	movq	%rax, %rdi
	callq	_PQstatus
	movq	_CONNECTION_BAD@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_12
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=1
	movq	%r12, %rdi
	callq	_PQconnectionNeedsPassword
	testq	%rax, %rax
	je	LBB0_12
## %bb.10:                              ##   in Loop: Header=BB0_7 Depth=1
	movl	-180(%rbp), %eax                ## 4-byte Reload
	movq	_TRI_NO@GOTPCREL(%rip), %rcx
	cmpl	%eax, (%rcx)
	je	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	%r12, %rdi
	callq	_PQfinish
	leaq	L_.str(%rip), %rdi
	movq	%r15, %rsi
	movl	$100, %edx
	xorl	%ecx, %ecx
	callq	_simple_prompt
	movb	$1, _connectDatabase.have_password(%rip)
	movb	$1, %al
	jmp	LBB0_7
LBB0_12:
	movq	%r12, %rdi
	callq	_PQstatus
	movq	_CONNECTION_BAD@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_16
## %bb.13:
	movq	%r12, %rdi
	cmpl	$0, 24(%rbp)
	je	LBB0_15
## %bb.14:
	callq	_PQfinish
	xorl	%r12d, %r12d
	jmp	LBB0_17
LBB0_16:
	movq	_ALWAYS_SECURE_SEARCH_PATH_SQL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	movl	16(%rbp), %edx
	callq	_executeQuery
	movl	%eax, %edi
	callq	_PQclear
LBB0_17:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_20
## %bb.18:
	movq	%r12, %rax
	addq	$168, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_19:
	leaq	L_.str.7(%rip), %rdi
	movq	-192(%rbp), %rsi                ## 8-byte Reload
	xorl	%eax, %eax
	callq	_pg_log_error
	movl	$1, %edi
	callq	_exit
LBB0_20:
	callq	___stack_chk_fail
LBB0_15:
	callq	_PQerrorMessage
	leaq	L_.str.8(%rip), %rdi
	movq	-192(%rbp), %rsi                ## 8-byte Reload
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_pg_log_error
	movl	$1, %edi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
.zerofill __DATA,__bss,_connectDatabase.have_password,1,2 ## @connectDatabase.have_password
.zerofill __DATA,__bss,_connectDatabase.password,100,4 ## @connectDatabase.password
	.comm	_TRI_YES,4,2                    ## @TRI_YES
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Password: "

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

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

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

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

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

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

L_.str.7:                               ## @.str.7
	.asciz	"could not connect to database %s: out of memory"

	.comm	_CONNECTION_BAD,8,3             ## @CONNECTION_BAD
	.comm	_TRI_NO,4,2                     ## @TRI_NO
L_.str.8:                               ## @.str.8
	.asciz	"could not connect to database %s: %s"

	.comm	_ALWAYS_SECURE_SEARCH_PATH_SQL,4,2 ## @ALWAYS_SECURE_SEARCH_PATH_SQL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_connectDatabase                ; -- Begin function connectDatabase
	.p2align	2
_connectDatabase:                       ; @connectDatabase
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #240
	.cfi_def_cfa_offset 240
	stp	x28, x27, [sp, #144]            ; 16-byte Folded Spill
	stp	x26, x25, [sp, #160]            ; 16-byte Folded Spill
	stp	x24, x23, [sp, #176]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #192]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #208]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #224]            ; 16-byte Folded Spill
	add	x29, sp, #224
	.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	x22, x5
	mov	x23, x4
	mov	x24, x3
	mov	x25, x2
	mov	x26, x1
	mov	x19, x0
	ldr	w8, [x29, #16]
Lloh0:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	stur	x9, [x29, #-88]
	adrp	x20, _connectDatabase.have_password@PAGE
	stp	w7, w6, [sp, #16]               ; 8-byte Folded Spill
	cbz	w8, LBB0_2
; %bb.1:
	ldrb	w8, [x20, _connectDatabase.have_password@PAGEOFF]
	b	LBB0_3
LBB0_2:
	strb	wzr, [x20, _connectDatabase.have_password@PAGEOFF]
LBB0_3:
Lloh3:
	adrp	x9, _TRI_YES@GOTPAGE
Lloh4:
	ldr	x9, [x9, _TRI_YES@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	cmp	w8, #0
	ccmp	w9, w23, #0, eq
	b.ne	LBB0_5
; %bb.4:
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
Lloh8:
	adrp	x1, _connectDatabase.password@PAGE
Lloh9:
	add	x1, x1, _connectDatabase.password@PAGEOFF
	mov	w2, #100
	mov	w3, #0
	bl	_simple_prompt
	mov	w8, #1
	strb	w8, [x20, _connectDatabase.have_password@PAGEOFF]
LBB0_5:
Lloh10:
	adrp	x27, _connectDatabase.password@PAGE
Lloh11:
	add	x27, x27, _connectDatabase.password@PAGEOFF
Lloh12:
	adrp	x21, _CONNECTION_BAD@GOTPAGE
Lloh13:
	ldr	x21, [x21, _CONNECTION_BAD@GOTPAGEOFF]
Lloh14:
	adrp	x28, l_.str@PAGE
Lloh15:
	add	x28, x28, l_.str@PAGEOFF
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
Lloh16:
	adrp	x9, l_.str.1@PAGE
Lloh17:
	add	x10, x9, l_.str.1@PAGEOFF
Lloh18:
	adrp	x9, l_.str.2@PAGE
Lloh19:
	add	x9, x9, l_.str.2@PAGEOFF
	stp	x10, x9, [sp, #80]
	stp	x26, x25, [sp, #24]
Lloh20:
	adrp	x9, l_.str.3@PAGE
Lloh21:
	add	x10, x9, l_.str.3@PAGEOFF
Lloh22:
	adrp	x9, l_.str.4@PAGE
Lloh23:
	add	x9, x9, l_.str.4@PAGEOFF
	stp	x10, x9, [sp, #96]
	tst	w8, #0x1
	csel	x8, x27, xzr, ne
	stp	x24, x8, [sp, #40]
Lloh24:
	adrp	x8, l_.str.5@PAGE
Lloh25:
	add	x9, x8, l_.str.5@PAGEOFF
Lloh26:
	adrp	x8, l_.str.6@PAGE
Lloh27:
	add	x8, x8, l_.str.6@PAGEOFF
	stp	x9, x8, [sp, #112]
	stp	x19, x22, [sp, #56]
	str	xzr, [sp, #128]
	str	xzr, [sp, #72]
	add	x0, sp, #80
	add	x1, sp, #24
	mov	w2, #1
	bl	_PQconnectdbParams
	cbz	x0, LBB0_17
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x20, x0
	bl	_PQstatus
	ldr	x8, [x21]
	cmp	x0, x8
	b.ne	LBB0_11
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x20
	bl	_PQconnectionNeedsPassword
	cbz	x0, LBB0_11
; %bb.9:                                ;   in Loop: Header=BB0_6 Depth=1
Lloh28:
	adrp	x8, _TRI_NO@GOTPAGE
Lloh29:
	ldr	x8, [x8, _TRI_NO@GOTPAGEOFF]
Lloh30:
	ldr	w8, [x8]
	cmp	w8, w23
	b.eq	LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x20
	bl	_PQfinish
	mov	x0, x28
	mov	x1, x27
	mov	w2, #100
	mov	w3, #0
	bl	_simple_prompt
	mov	w8, #1
	adrp	x9, _connectDatabase.have_password@PAGE
	strb	w8, [x9, _connectDatabase.have_password@PAGEOFF]
	b	LBB0_6
LBB0_11:
	mov	x0, x20
	bl	_PQstatus
	ldr	x8, [x21]
	cmp	x0, x8
	b.ne	LBB0_14
; %bb.12:
	ldr	w8, [sp, #16]                   ; 4-byte Folded Reload
	cbz	w8, LBB0_20
; %bb.13:
	mov	x0, x20
	bl	_PQfinish
	mov	x20, #0
	b	LBB0_15
LBB0_14:
Lloh31:
	adrp	x8, _ALWAYS_SECURE_SEARCH_PATH_SQL@GOTPAGE
Lloh32:
	ldr	x8, [x8, _ALWAYS_SECURE_SEARCH_PATH_SQL@GOTPAGEOFF]
Lloh33:
	ldr	w1, [x8]
	mov	x0, x20
	ldr	w2, [sp, #20]                   ; 4-byte Folded Reload
	bl	_executeQuery
	bl	_PQclear
LBB0_15:
	ldur	x8, [x29, #-88]
Lloh34:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh35:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh36:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_19
; %bb.16:
	mov	x0, x20
	ldp	x29, x30, [sp, #224]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #208]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #192]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #176]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #160]            ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #144]            ; 16-byte Folded Reload
	add	sp, sp, #240
	ret
LBB0_17:
Lloh37:
	adrp	x0, l_.str.7@PAGE
Lloh38:
	add	x0, x0, l_.str.7@PAGEOFF
LBB0_18:
	mov	x1, x19
	bl	_pg_log_error
	mov	w0, #1
	bl	_exit
LBB0_19:
	bl	___stack_chk_fail
LBB0_20:
	mov	x0, x20
	bl	_PQerrorMessage
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp]
Lloh39:
	adrp	x0, l_.str.8@PAGE
Lloh40:
	add	x0, x0, l_.str.8@PAGEOFF
	b	LBB0_18
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdrp	Lloh24, Lloh26
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdrp	Lloh20, Lloh22
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdrp	Lloh16, Lloh18
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpAdd	Lloh37, Lloh38
	.loh AdrpAdd	Lloh39, Lloh40
	.cfi_endproc
                                        ; -- End function
.zerofill __DATA,__bss,_connectDatabase.have_password,1,2 ; @connectDatabase.have_password
.zerofill __DATA,__bss,_connectDatabase.password,100,0 ; @connectDatabase.password
	.comm	_TRI_YES,4,2                    ; @TRI_YES
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Password: "

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

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

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

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

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

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

l_.str.7:                               ; @.str.7
	.asciz	"could not connect to database %s: out of memory"

	.comm	_CONNECTION_BAD,8,3             ; @CONNECTION_BAD
	.comm	_TRI_NO,4,2                     ; @TRI_NO
l_.str.8:                               ; @.str.8
	.asciz	"could not connect to database %s: %s"

	.comm	_ALWAYS_SECURE_SEARCH_PATH_SQL,4,2 ; @ALWAYS_SECURE_SEARCH_PATH_SQL
.subsections_via_symbols
