	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function PQescapeByteaInternal
_PQescapeByteaInternal:                 ## @PQescapeByteaInternal
	.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
	movl	%r9d, %r15d
	movl	%r8d, %r14d
	movq	%rdx, %r13
	movq	%rsi, %r12
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	xorl	%r9d, %r9d
	cmpl	$1, %r8d
	adcq	$1, %r9
	testl	%r15d, %r15d
	je	LBB0_5
## %bb.1:
	leaq	(%r9,%r13,2), %rdi
	addq	$2, %rdi
	movq	%rdi, (%rcx)
	callq	_malloc
	testq	%rax, %rax
	je	LBB0_47
## %bb.2:
	movq	%rax, %rcx
	testl	%r14d, %r14d
	jne	LBB0_4
## %bb.3:
	movq	%rax, %rcx
	incq	%rcx
	movb	$92, (%rax)
LBB0_4:
	movw	$30812, (%rcx)                  ## imm = 0x785C
	addq	$2, %rcx
	testq	%r13, %r13
	jne	LBB0_30
	jmp	LBB0_46
LBB0_5:
	testq	%r13, %r13
	je	LBB0_13
## %bb.6:
	xorl	%eax, %eax
	testl	%r14d, %r14d
	sete	%al
	leaq	(%rax,%rax), %r8
	addq	$2, %r8
	addq	$3, %r9
	cmpq	$1, %r13
	jne	LBB0_14
## %bb.7:
	movl	$1, %edi
	movq	%r12, %rsi
LBB0_8:
	testb	$1, %r13b
	je	LBB0_28
## %bb.9:
	movb	(%rsi), %dl
	leal	-127(%rdx), %eax
	cmpb	$-95, %al
	jb	LBB0_27
## %bb.10:
	cmpb	$39, %dl
	je	LBB0_26
## %bb.11:
	movq	%r8, %r9
	cmpb	$92, %dl
	je	LBB0_27
## %bb.12:
	movl	$1, %r9d
	jmp	LBB0_27
LBB0_13:
	movl	$1, %edi
	jmp	LBB0_28
LBB0_14:
	movq	%r13, %r10
	andq	$-2, %r10
	movl	$1, %edi
	movq	%r12, %rsi
	jmp	LBB0_17
LBB0_15:                                ##   in Loop: Header=BB0_17 Depth=1
	movl	$2, %eax
	.p2align	4, 0x90
LBB0_16:                                ##   in Loop: Header=BB0_17 Depth=1
	addq	%rax, %rdi
	addq	$2, %rsi
	addq	$-2, %r10
	je	LBB0_8
LBB0_17:                                ## =>This Inner Loop Header: Depth=1
	movzbl	(%rsi), %edx
	leal	-127(%rdx), %ebx
	movq	%r9, %rax
	cmpb	$-95, %bl
	jb	LBB0_22
## %bb.18:                              ##   in Loop: Header=BB0_17 Depth=1
	cmpb	$39, %dl
	je	LBB0_21
## %bb.19:                              ##   in Loop: Header=BB0_17 Depth=1
	movq	%r8, %rax
	cmpb	$92, %dl
	je	LBB0_22
## %bb.20:                              ##   in Loop: Header=BB0_17 Depth=1
	movl	$1, %eax
	jmp	LBB0_22
LBB0_21:                                ##   in Loop: Header=BB0_17 Depth=1
	movl	$2, %eax
	.p2align	4, 0x90
LBB0_22:                                ##   in Loop: Header=BB0_17 Depth=1
	addq	%rax, %rdi
	movzbl	1(%rsi), %edx
	leal	-127(%rdx), %ebx
	movq	%r9, %rax
	cmpb	$-95, %bl
	jb	LBB0_16
## %bb.23:                              ##   in Loop: Header=BB0_17 Depth=1
	cmpb	$39, %dl
	je	LBB0_15
## %bb.24:                              ##   in Loop: Header=BB0_17 Depth=1
	movq	%r8, %rax
	cmpb	$92, %dl
	je	LBB0_16
## %bb.25:                              ##   in Loop: Header=BB0_17 Depth=1
	movl	$1, %eax
	jmp	LBB0_16
LBB0_26:
	movl	$2, %r9d
LBB0_27:
	addq	%r9, %rdi
LBB0_28:
	movq	%rdi, (%rcx)
	callq	_malloc
	testq	%rax, %rax
	je	LBB0_47
## %bb.29:
	movq	%rax, %rcx
	testq	%r13, %r13
	je	LBB0_46
LBB0_30:
	xorl	%edx, %edx
	movq	_hextbl@GOTPCREL(%rip), %r8
	jmp	LBB0_34
LBB0_36:                                ##   in Loop: Header=BB0_34 Depth=1
	testl	%r14d, %r14d
	je	LBB0_37
LBB0_38:                                ##   in Loop: Header=BB0_34 Depth=1
	movb	$92, (%rcx)
	movl	%edi, %ebx
	shrb	$6, %bl
	orb	$48, %bl
	movb	%bl, 1(%rcx)
	movl	%edi, %ebx
	shrb	$3, %bl
	andb	$7, %bl
	orb	$48, %bl
	movb	%bl, 2(%rcx)
	andb	$7, %dil
	orb	$48, %dil
	movb	%dil, 3(%rcx)
	addq	$4, %rcx
	.p2align	4, 0x90
LBB0_33:                                ##   in Loop: Header=BB0_34 Depth=1
	incq	%rdx
	cmpq	%rdx, %r13
	je	LBB0_46
LBB0_34:                                ## =>This Inner Loop Header: Depth=1
	movzbl	(%r12,%rdx), %edi
	testl	%r15d, %r15d
	je	LBB0_35
## %bb.31:                              ##   in Loop: Header=BB0_34 Depth=1
	movzbl	%dil, %esi
	movq	(%r8), %rbx
	movq	%rsi, %rdi
	shrq	$4, %rdi
	movzbl	(%rbx,%rdi,8), %ebx
	movb	%bl, (%rcx)
	movq	(%r8), %rdi
	andl	$15, %esi
	movzbl	(%rdi,%rsi,8), %ebx
	movb	%bl, 1(%rcx)
LBB0_32:                                ##   in Loop: Header=BB0_34 Depth=1
	addq	$2, %rcx
	jmp	LBB0_33
	.p2align	4, 0x90
LBB0_35:                                ##   in Loop: Header=BB0_34 Depth=1
	leal	-127(%rdi), %esi
	cmpb	$-96, %sil
	jbe	LBB0_36
## %bb.39:                              ##   in Loop: Header=BB0_34 Depth=1
	cmpb	$92, %dil
	je	LBB0_42
## %bb.40:                              ##   in Loop: Header=BB0_34 Depth=1
	cmpb	$39, %dil
	jne	LBB0_45
## %bb.41:                              ##   in Loop: Header=BB0_34 Depth=1
	movw	$10023, (%rcx)                  ## imm = 0x2727
	jmp	LBB0_32
LBB0_37:                                ##   in Loop: Header=BB0_34 Depth=1
	movb	$92, (%rcx)
	incq	%rcx
	jmp	LBB0_38
LBB0_42:                                ##   in Loop: Header=BB0_34 Depth=1
	testl	%r14d, %r14d
	jne	LBB0_44
## %bb.43:                              ##   in Loop: Header=BB0_34 Depth=1
	movw	$23644, (%rcx)                  ## imm = 0x5C5C
	addq	$2, %rcx
LBB0_44:                                ##   in Loop: Header=BB0_34 Depth=1
	movw	$23644, (%rcx)                  ## imm = 0x5C5C
	jmp	LBB0_32
LBB0_45:                                ##   in Loop: Header=BB0_34 Depth=1
	movb	%dil, (%rcx)
	incq	%rcx
	jmp	LBB0_33
LBB0_46:
	movb	$0, (%rcx)
	jmp	LBB0_50
LBB0_47:
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	testq	%rbx, %rbx
	je	LBB0_49
## %bb.48:
	leaq	L_.str(%rip), %rdi
	callq	_libpq_gettext
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_printfPQExpBuffer
LBB0_49:
	xorl	%eax, %eax
LBB0_50:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"out of memory\n"

	.comm	_hextbl,8,3                     ## @hextbl
	.no_dead_strip	_PQescapeByteaInternal
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function PQescapeByteaInternal
_PQescapeByteaInternal:                 ; @PQescapeByteaInternal
	.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, x5
	mov	x20, x4
	mov	x21, x2
	mov	x22, x1
	mov	x23, x0
	cmp	w4, #0
	mov	w8, #1
	cinc	x10, x8, eq
	cbz	w5, LBB0_5
; %bb.1:
	add	x8, x10, x21, lsl #1
	add	x0, x8, #2
	str	x0, [x3]
	bl	_malloc
	cbz	x0, LBB0_27
; %bb.2:
	mov	x8, x0
	cbnz	w20, LBB0_4
; %bb.3:
	mov	w9, #92
	mov	x8, x0
	strb	w9, [x8], #1
LBB0_4:
	mov	w9, #30812
	strh	w9, [x8], #2
	cbnz	x21, LBB0_11
	b	LBB0_26
LBB0_5:
	cbz	x21, LBB0_8
; %bb.6:
	cmp	w20, #0
	mov	w8, #2
	mov	w9, #4
	csel	x9, x9, x8, eq
	add	x10, x10, #3
	mov	w11, #1
	mov	x12, x22
	mov	w0, #1
	mov	x13, x21
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldrb	w14, [x12], #1
	sub	w15, w14, #127
	cmp	w14, #92
	csel	x16, x11, x9, ne
	cmp	w14, #39
	csel	x14, x8, x16, eq
	cmn	w15, #95
	csel	x14, x10, x14, lo
	add	x0, x14, x0
	subs	x13, x13, #1
	b.ne	LBB0_7
	b	LBB0_9
LBB0_8:
	mov	w0, #1
LBB0_9:
	str	x0, [x3]
	bl	_malloc
	cbz	x0, LBB0_27
; %bb.10:
	mov	x8, x0
	cbz	x21, LBB0_26
LBB0_11:
	mov	w9, #92
	mov	w10, #23644
	mov	w11, #10023
Lloh0:
	adrp	x12, _hextbl@GOTPAGE
Lloh1:
	ldr	x12, [x12, _hextbl@GOTPAGEOFF]
	b	LBB0_14
LBB0_12:                                ;   in Loop: Header=BB0_14 Depth=1
	ldr	x14, [x12]
	lsr	w15, w13, #1
	and	x15, x15, #0x78
	ldr	x14, [x14, x15]
	strb	w14, [x8]
	ldr	x14, [x12]
	and	w13, w13, #0xf
	ldr	x13, [x14, w13, uxtw #3]
	strb	w13, [x8, #1]
	add	x8, x8, #2
LBB0_13:                                ;   in Loop: Header=BB0_14 Depth=1
	add	x22, x22, #1
	subs	x21, x21, #1
	b.eq	LBB0_26
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	ldrb	w13, [x22]
	cbnz	w19, LBB0_12
; %bb.15:                               ;   in Loop: Header=BB0_14 Depth=1
	sub	w14, w13, #127
	cmn	w14, #96
	b.hi	LBB0_19
; %bb.16:                               ;   in Loop: Header=BB0_14 Depth=1
	cbnz	w20, LBB0_18
; %bb.17:                               ;   in Loop: Header=BB0_14 Depth=1
	strb	w9, [x8], #1
LBB0_18:                                ;   in Loop: Header=BB0_14 Depth=1
	strb	w9, [x8]
	lsr	w14, w13, #6
	orr	w14, w14, #0x30
	strb	w14, [x8, #1]
	mov	w14, #48
	bfxil	w14, w13, #3, #3
	strb	w14, [x8, #2]
	mov	w14, #48
	bfxil	w14, w13, #0, #3
	strb	w14, [x8, #3]
	add	x8, x8, #4
	b	LBB0_13
LBB0_19:                                ;   in Loop: Header=BB0_14 Depth=1
	cmp	w13, #92
	b.eq	LBB0_22
; %bb.20:                               ;   in Loop: Header=BB0_14 Depth=1
	cmp	w13, #39
	b.ne	LBB0_25
; %bb.21:                               ;   in Loop: Header=BB0_14 Depth=1
	strh	w11, [x8], #2
	b	LBB0_13
LBB0_22:                                ;   in Loop: Header=BB0_14 Depth=1
	cbnz	w20, LBB0_24
; %bb.23:                               ;   in Loop: Header=BB0_14 Depth=1
	strh	w10, [x8], #2
LBB0_24:                                ;   in Loop: Header=BB0_14 Depth=1
	strh	w10, [x8], #2
	b	LBB0_13
LBB0_25:                                ;   in Loop: Header=BB0_14 Depth=1
	strb	w13, [x8], #1
	b	LBB0_13
LBB0_26:
	strb	wzr, [x8]
	b	LBB0_30
LBB0_27:
	cbz	x23, LBB0_29
; %bb.28:
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	bl	_libpq_gettext
	mov	x1, x0
	mov	x0, x23
	bl	_printfPQExpBuffer
LBB0_29:
	mov	x0, #0
LBB0_30:
	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
	.loh AdrpAdd	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"out of memory\n"

	.comm	_hextbl,8,3                     ; @hextbl
	.no_dead_strip	_PQescapeByteaInternal
.subsections_via_symbols
