	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sql_conn                       ## -- Begin function sql_conn
	.p2align	4, 0x90
_sql_conn:                              ## @sql_conn
	.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	$248, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	xorl	%r13d, %r13d
	leaq	-160(%rbp), %r15
	movq	_CONNECTION_BAD@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	leaq	L_.str(%rip), %rax
	movq	%rax, -224(%rbp)
	leaq	L_.str.1(%rip), %rax
	movq	%rax, -216(%rbp)
	movups	(%r14), %xmm0
	movaps	%xmm0, -288(%rbp)
	leaq	L_.str.2(%rip), %rax
	movq	%rax, -208(%rbp)
	movq	16(%r14), %rax
	movq	%rax, -272(%rbp)
	testb	$1, %r13b
	movl	$0, %eax
	cmovneq	%r15, %rax
	leaq	L_.str.3(%rip), %rcx
	movq	%rcx, -200(%rbp)
	movq	%rax, -264(%rbp)
	leaq	L_.str.4(%rip), %rax
	movq	%rax, -192(%rbp)
	leaq	L_.str.5(%rip), %rax
	movq	%rax, -184(%rbp)
	movups	24(%r14), %xmm0
	movaps	%xmm0, -256(%rbp)
	movq	$0, -176(%rbp)
	movq	$0, -240(%rbp)
	leaq	-224(%rbp), %rdi
	leaq	-288(%rbp), %rsi
	movl	$1, %edx
	callq	_PQconnectdbParams
	testq	%rax, %rax
	je	LBB0_9
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_PQstatus
	cmpq	(%r12), %rax
	jne	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	%rbx, %rdi
	callq	_PQconnectionNeedsPassword
	testq	%rax, %rax
	sete	%al
	orb	%al, %r13b
	testb	$1, %r13b
	jne	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	%rbx, %rdi
	callq	_PQfinish
	leaq	L_.str.7(%rip), %rdi
	movq	%r15, %rsi
	movl	$100, %edx
	xorl	%ecx, %ecx
	callq	_simple_prompt
	movb	$1, %r13b
	jmp	LBB0_1
LBB0_5:
	movq	%rbx, %rdi
	callq	_PQstatus
	cmpq	(%r12), %rax
	je	LBB0_10
## %bb.6:
	movq	_ALWAYS_SECURE_SEARCH_PATH_SQL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_PQexec
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_PQresultStatus
	movq	_PGRES_TUPLES_OK@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_11
## %bb.7:
	movq	%r14, %rdi
	callq	_PQclear
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_12
## %bb.8:
	movq	%rbx, %rax
	addq	$248, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movq	24(%r14), %rsi
	leaq	L_.str.6(%rip), %rdi
	xorl	%eax, %eax
	callq	_pg_log_error
	movl	$1, %edi
	callq	_exit
LBB0_10:
	movq	24(%r14), %r14
	movq	%rbx, %rdi
	callq	_PQerrorMessage
	leaq	L_.str.8(%rip), %rdi
	movq	%r14, %rsi
	movq	%rax, %rdx
	xorl	%eax, %eax
	callq	_pg_log_error
	movq	%rbx, %rdi
	callq	_PQfinish
	movl	$1, %edi
	callq	_exit
LBB0_11:
	movq	%rbx, %rdi
	callq	_PQerrorMessage
	leaq	L_.str.9(%rip), %rdi
	movq	%rax, %rsi
	xorl	%eax, %eax
	callq	_pg_log_error
	movq	%r14, %rdi
	callq	_PQclear
	movq	%rbx, %rdi
	callq	_PQfinish
	movl	$-1, %edi
	callq	_exit
LBB0_12:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"host"

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

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

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

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

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

L_.str.6:                               ## @.str.6
	.asciz	"could not connect to database %s"

	.comm	_CONNECTION_BAD,8,3             ## @CONNECTION_BAD
L_.str.7:                               ## @.str.7
	.asciz	"Password: "

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
	.comm	_PGRES_TUPLES_OK,8,3            ## @PGRES_TUPLES_OK
L_.str.9:                               ## @.str.9
	.asciz	"could not clear search_path: %s"

	.comm	_PARAMS_ARRAY_SIZE,4,2          ## @PARAMS_ARRAY_SIZE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sql_conn                       ; -- Begin function sql_conn
	.p2align	2
_sql_conn:                              ; @sql_conn
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #336
	.cfi_def_cfa_offset 336
	stp	x28, x27, [sp, #240]            ; 16-byte Folded Spill
	stp	x26, x25, [sp, #256]            ; 16-byte Folded Spill
	stp	x24, x23, [sp, #272]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #288]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #304]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #320]            ; 16-byte Folded Spill
	add	x29, sp, #320
	.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	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-88]
	ldr	q0, [x0]
Lloh3:
	adrp	x22, l_.str@PAGE
Lloh4:
	add	x22, x22, l_.str@PAGEOFF
Lloh5:
	adrp	x23, l_.str.1@PAGE
Lloh6:
	add	x23, x23, l_.str.1@PAGEOFF
	str	q0, [sp, #16]
Lloh7:
	adrp	x24, l_.str.2@PAGE
Lloh8:
	add	x24, x24, l_.str.2@PAGEOFF
Lloh9:
	adrp	x25, l_.str.3@PAGE
Lloh10:
	add	x25, x25, l_.str.3@PAGEOFF
	stp	x22, x23, [sp, #72]
	stp	x24, x25, [sp, #88]
	ldp	x8, x9, [x0, #16]
	stp	x8, xzr, [sp, #32]
Lloh11:
	adrp	x26, l_.str.4@PAGE
Lloh12:
	add	x26, x26, l_.str.4@PAGEOFF
Lloh13:
	adrp	x27, l_.str.5@PAGE
Lloh14:
	add	x27, x27, l_.str.5@PAGEOFF
	stp	x26, x27, [sp, #104]
	ldr	x8, [x0, #32]
	stp	x9, x8, [sp, #48]
	str	xzr, [sp, #120]
	str	xzr, [sp, #64]
	add	x0, sp, #72
	add	x1, sp, #16
	mov	w2, #1
	bl	_PQconnectdbParams
	cbz	x0, LBB0_10
; %bb.1:
	mov	x20, x0
	bl	_PQstatus
Lloh15:
	adrp	x21, _CONNECTION_BAD@GOTPAGE
Lloh16:
	ldr	x21, [x21, _CONNECTION_BAD@GOTPAGEOFF]
	ldr	x8, [x21]
	cmp	x0, x8
	b.ne	LBB0_6
; %bb.2:
	mov	x0, x20
	bl	_PQconnectionNeedsPassword
	cbz	x0, LBB0_6
; %bb.3:
	mov	x0, x20
	bl	_PQfinish
Lloh17:
	adrp	x0, l_.str.7@PAGE
Lloh18:
	add	x0, x0, l_.str.7@PAGEOFF
	add	x20, sp, #132
	add	x1, sp, #132
	mov	w2, #100
	mov	w3, #0
	bl	_simple_prompt
	ldr	q0, [x19]
	str	q0, [sp, #16]
	stp	x22, x23, [sp, #72]
	stp	x24, x25, [sp, #88]
	ldp	x8, x9, [x19, #16]
	stp	x8, x20, [sp, #32]
	stp	x26, x27, [sp, #104]
	ldr	x8, [x19, #32]
	stp	x9, x8, [sp, #48]
	str	xzr, [sp, #120]
	str	xzr, [sp, #64]
	add	x0, sp, #72
	add	x1, sp, #16
	mov	w2, #1
	bl	_PQconnectdbParams
	cbz	x0, LBB0_10
; %bb.4:
	mov	x20, x0
	bl	_PQstatus
	ldr	x8, [x21]
	cmp	x0, x8
	b.ne	LBB0_6
; %bb.5:
	mov	x0, x20
	bl	_PQconnectionNeedsPassword
LBB0_6:
	mov	x0, x20
	bl	_PQstatus
	ldr	x8, [x21]
	cmp	x0, x8
	b.eq	LBB0_11
; %bb.7:
Lloh19:
	adrp	x8, _ALWAYS_SECURE_SEARCH_PATH_SQL@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ALWAYS_SECURE_SEARCH_PATH_SQL@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_PQexec
	mov	x19, x0
	bl	_PQresultStatus
Lloh22:
	adrp	x8, _PGRES_TUPLES_OK@GOTPAGE
Lloh23:
	ldr	x8, [x8, _PGRES_TUPLES_OK@GOTPAGEOFF]
Lloh24:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_12
; %bb.8:
	mov	x0, x19
	bl	_PQclear
	ldur	x8, [x29, #-88]
Lloh25:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh26:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh27:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_13
; %bb.9:
	mov	x0, x20
	ldp	x29, x30, [sp, #320]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #304]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #288]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #272]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #256]            ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #240]            ; 16-byte Folded Reload
	add	sp, sp, #336
	ret
LBB0_10:
	ldr	x1, [x19, #24]
Lloh28:
	adrp	x0, l_.str.6@PAGE
Lloh29:
	add	x0, x0, l_.str.6@PAGEOFF
	bl	_pg_log_error
	mov	w0, #1
	bl	_exit
LBB0_11:
	ldr	x19, [x19, #24]
	mov	x0, x20
	bl	_PQerrorMessage
	str	x0, [sp]
Lloh30:
	adrp	x0, l_.str.8@PAGE
Lloh31:
	add	x0, x0, l_.str.8@PAGEOFF
	mov	x1, x19
	bl	_pg_log_error
	mov	x0, x20
	bl	_PQfinish
	mov	w0, #1
	bl	_exit
LBB0_12:
	mov	x0, x20
	bl	_PQerrorMessage
	mov	x1, x0
Lloh32:
	adrp	x0, l_.str.9@PAGE
Lloh33:
	add	x0, x0, l_.str.9@PAGEOFF
	bl	_pg_log_error
	mov	x0, x19
	bl	_PQclear
	mov	x0, x20
	bl	_PQfinish
	mov	w0, #-1
	bl	_exit
LBB0_13:
	bl	___stack_chk_fail
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpAdd	Lloh32, Lloh33
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"host"

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

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

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

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

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

l_.str.6:                               ; @.str.6
	.asciz	"could not connect to database %s"

	.comm	_CONNECTION_BAD,8,3             ; @CONNECTION_BAD
l_.str.7:                               ; @.str.7
	.asciz	"Password: "

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
	.comm	_PGRES_TUPLES_OK,8,3            ; @PGRES_TUPLES_OK
l_.str.9:                               ; @.str.9
	.asciz	"could not clear search_path: %s"

	.comm	_PARAMS_ARRAY_SIZE,4,2          ; @PARAMS_ARRAY_SIZE
.subsections_via_symbols
