	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function quote_postgres
_quote_postgres:                        ## @quote_postgres
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	testl	%esi, %esi
	je	LBB0_7
## %bb.1:
	movl	%edx, %r15d
	movq	%r14, %rdi
	callq	_strlen
	movq	%rax, %rbx
	leaq	(%rax,%rax), %rdi
	addq	$4, %rdi
	movl	%r15d, %esi
	callq	_ecpg_alloc
	testq	%rax, %rax
	je	LBB0_2
## %bb.3:
	movq	%rax, %r15
	leaq	(%rbx,%rbx), %rdx
	orq	$1, %rdx
	leaq	1(%rax), %r13
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_PQescapeString
	cmpq	%rax, %rbx
	jne	LBB0_5
## %bb.4:
	movb	$39, 1(%rbx,%r15)
	movb	$39, (%r15)
	addq	$2, %rbx
	jmp	LBB0_6
LBB0_2:
	xorl	%r14d, %r14d
	jmp	LBB0_7
LBB0_5:
	movq	%rax, %r12
	movq	%r15, %rdi
	addq	$2, %rdi
	movq	%r13, %rsi
	movq	%rax, %rdx
	callq	_memmove
	movq	_ESCAPE_STRING_SYNTAX@GOTPCREL(%rip), %rax
	movb	(%rax), %al
	movb	%al, (%r15)
	movb	$39, 2(%r12,%r15)
	movb	$39, 1(%r15)
	addq	$3, %r12
	movq	%r12, %rbx
LBB0_6:
	movb	$0, (%r15,%rbx)
	movq	%r14, %rdi
	callq	_ecpg_free
	movq	%r15, %r14
LBB0_7:
	movq	%r14, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ESCAPE_STRING_SYNTAX,1,0       ## @ESCAPE_STRING_SYNTAX
	.no_dead_strip	_quote_postgres
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function quote_postgres
_quote_postgres:                        ; @quote_postgres
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x0
	cbz	w1, LBB0_7
; %bb.1:
	mov	x20, x2
	mov	x0, x19
	bl	_strlen
	mov	x21, x0
	lsl	x22, x0, #1
	add	x0, x22, #4
	mov	x1, x20
	bl	_ecpg_alloc
	cbz	x0, LBB0_4
; %bb.2:
	mov	x20, x0
	orr	x2, x22, #0x1
	add	x23, x0, #1
	mov	x0, x23
	mov	x1, x19
	bl	_PQescapeString
	cmp	x21, x0
	b.ne	LBB0_5
; %bb.3:
	add	x8, x21, x20
	mov	w9, #39
	strb	w9, [x8, #1]
	strb	w9, [x20]
	add	x8, x21, #2
	b	LBB0_6
LBB0_4:
	mov	x19, #0
	b	LBB0_7
LBB0_5:
	mov	x22, x0
	add	x0, x20, #2
	mov	x1, x23
	mov	x2, x22
	bl	_memmove
Lloh0:
	adrp	x8, _ESCAPE_STRING_SYNTAX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ESCAPE_STRING_SYNTAX@GOTPAGEOFF]
	ldrb	w8, [x8]
	strb	w8, [x20]
	add	x8, x22, x20
	mov	w9, #39
	strb	w9, [x8, #2]
	strb	w9, [x20, #1]
	add	x8, x22, #3
LBB0_6:
	strb	wzr, [x20, x8]
	mov	x0, x19
	bl	_ecpg_free
	mov	x19, x20
LBB0_7:
	mov	x0, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_ESCAPE_STRING_SYNTAX,1,0       ; @ESCAPE_STRING_SYNTAX
	.no_dead_strip	_quote_postgres
.subsections_via_symbols
