	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function text_substring
_text_substring:                        ## @text_substring
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r12d
	movl	%edx, %r15d
	movl	%esi, %r14d
	movl	%edi, %r13d
	xorl	%eax, %eax
	callq	_pg_database_encoding_max_length
	cmpl	$1, %eax
	jne	LBB0_7
## %bb.1:
	movl	%r14d, %edi
	movl	$1, %esi
	callq	_Max
	movl	%eax, %ebx
	movl	$-1, %edx
	testl	%r12d, %r12d
	jne	LBB0_6
## %bb.2:
	addl	%r15d, %r14d
	testl	%r15d, %r15d
	js	LBB0_3
## %bb.4:
	testl	%r14d, %r14d
	jg	LBB0_5
	jmp	LBB0_20
LBB0_7:
	jle	LBB0_34
## %bb.8:
	movl	%eax, %ebx
	movl	%r13d, -44(%rbp)                ## 4-byte Spill
	movl	%r14d, %edi
	movl	$1, %esi
	callq	_Max
                                        ## kill: def $eax killed $eax def $rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movl	$-1, %r13d
	movl	$-1, %eax
	testl	%r12d, %r12d
	jne	LBB0_13
## %bb.9:
	addl	%r15d, %r14d
	testl	%r15d, %r15d
	jns	LBB0_11
## %bb.10:
	movq	_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	_ERRCODE_SUBSTRING_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_errcode
	leaq	L_.str(%rip), %rdi
	callq	_errmsg
	movl	%r15d, %edi
	movl	%eax, %esi
	callq	_ereport
LBB0_11:
	testl	%r14d, %r14d
	jle	LBB0_20
## %bb.12:
	imull	%r14d, %ebx
	subl	-56(%rbp), %r14d                ## 4-byte Folded Reload
	movl	%ebx, %r13d
	movl	%r14d, %eax
LBB0_13:
	movl	%eax, %r12d
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, %edi
	callq	_DatumGetPointer
	movq	%rax, %rdi
	callq	_VARATT_IS_COMPRESSED
	testq	%rax, %rax
	jne	LBB0_15
## %bb.14:
	movl	%ebx, %edi
	callq	_DatumGetPointer
	movq	%rax, %rdi
	callq	_VARATT_IS_EXTERNAL
	testq	%rax, %rax
	je	LBB0_16
LBB0_15:
	movl	%ebx, %edi
	xorl	%esi, %esi
	movl	%r13d, %edx
	callq	_DatumGetTextPSlice
LBB0_17:
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_VARSIZE_ANY_EXHDR
	testq	%rax, %rax
	je	LBB0_18
## %bb.21:
	movq	%r14, %rdi
	callq	_VARDATA_ANY
	movq	%rax, %rbx
	movq	%r14, %rdi
	callq	_VARSIZE_ANY_EXHDR
	movq	%rbx, %rdi
	movq	%rax, %rsi
	callq	_pg_mbstrlen_with_len
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	cmpl	%eax, %ebx
	jle	LBB0_22
LBB0_18:
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_DatumGetPointer
	cmpq	%rax, %r14
	je	LBB0_20
## %bb.19:
	movq	%r14, %rdi
	callq	_pfree
	jmp	LBB0_20
LBB0_34:
	movq	_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.2(%rip), %rsi
	callq	_elog
	xorl	%r15d, %r15d
LBB0_35:
	movq	%r15, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	_ERRCODE_SUBSTRING_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_errcode
	leaq	L_.str(%rip), %rdi
	callq	_errmsg
	movl	%r15d, %edi
	movl	%eax, %esi
	callq	_ereport
	testl	%r14d, %r14d
	jle	LBB0_20
LBB0_5:
	subl	%ebx, %r14d
	movl	%r14d, %edx
LBB0_6:
	decl	%ebx
	movl	%r13d, %edi
	movl	%ebx, %esi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_DatumGetTextPSlice             ## TAILCALL
LBB0_20:
	leaq	L_.str.1(%rip), %rdi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_cstring_to_text                ## TAILCALL
LBB0_22:
	movl	%eax, %r15d
	testl	%r12d, %r12d
	js	LBB0_24
## %bb.23:
	movl	%r12d, %edi
	addl	%ebx, %edi
	incl	%r15d
	movl	%r15d, %esi
	callq	_Min
	movl	%eax, %r15d
	jmp	LBB0_25
LBB0_16:
	movl	%ebx, %edi
	callq	_DatumGetPointer
	jmp	LBB0_17
LBB0_24:
	incl	%r15d
LBB0_25:
	movq	%r14, %rdi
	callq	_VARDATA_ANY
	movq	%rax, %r13
	cmpl	$2, %ebx
	jl	LBB0_26
## %bb.32:
	decl	%ebx
	.p2align	4, 0x90
LBB0_33:                                ## =>This Inner Loop Header: Depth=1
	movq	%r13, %rdi
	callq	_pg_mblen
	movslq	%eax, %r12
	addq	%r13, %r12
	movq	%r12, %r13
	decl	%ebx
	jne	LBB0_33
	jmp	LBB0_27
LBB0_26:
	movq	%r13, %r12
LBB0_27:
	movq	%r12, %r13
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	cmpl	%r15d, %eax
	jge	LBB0_30
## %bb.28:
	subl	%eax, %r15d
	movq	%r12, %r13
	.p2align	4, 0x90
LBB0_29:                                ## =>This Inner Loop Header: Depth=1
	movq	%r13, %rdi
	callq	_pg_mblen
	cltq
	addq	%rax, %r13
	decl	%r15d
	jne	LBB0_29
LBB0_30:
	movq	_VARHDRSZ@GOTPCREL(%rip), %rbx
	subq	%r12, %r13
	movq	(%rbx), %rdi
	addq	%r13, %rdi
	callq	_palloc
	movq	%rax, %r15
	movq	(%rbx), %rsi
	addq	%r13, %rsi
	movq	%rax, %rdi
	callq	_SET_VARSIZE
	movq	%r15, %rdi
	callq	_VARDATA
	movl	%eax, %edi
	movq	%r12, %rsi
	movl	%r13d, %edx
	callq	_memcpy
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_DatumGetPointer
	cmpq	%rax, %r14
	je	LBB0_35
## %bb.31:
	movq	%r14, %rdi
	callq	_pfree
	jmp	LBB0_35
	.cfi_endproc
                                        ## -- End function
	.comm	_ERROR,4,2                      ## @ERROR
	.comm	_ERRCODE_SUBSTRING_ERROR,4,2    ## @ERRCODE_SUBSTRING_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"negative substring length not allowed"

L_.str.1:                               ## @.str.1
	.space	1

	.comm	_VARHDRSZ,8,3                   ## @VARHDRSZ
L_.str.2:                               ## @.str.2
	.asciz	"invalid backend encoding: encoding max length < 1"

	.no_dead_strip	_text_substring
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function text_substring
_text_substring:                        ; @text_substring
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x24, x3
	mov	x22, x2
	mov	x23, x1
	mov	x19, x0
	bl	_pg_database_encoding_max_length
	cmp	w0, #1
	b.ne	LBB0_3
; %bb.1:
	mov	x0, x23
	mov	w1, #1
	bl	_Max
	mov	x20, x0
	cbz	w24, LBB0_8
; %bb.2:
	mov	w2, #-1
	b	LBB0_23
LBB0_3:
	mov	x20, x0
	cmp	w0, #2
	b.lt	LBB0_6
; %bb.4:
	mov	x0, x23
	mov	w1, #1
	bl	_Max
	mov	x21, x0
	cbz	w24, LBB0_10
; %bb.5:
	mov	w20, #-1
	mov	w23, #-1
	b	LBB0_14
LBB0_6:
Lloh0:
	adrp	x8, _ERROR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ERROR@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x1, l_.str.2@PAGE
Lloh4:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_elog
	mov	x21, #0
LBB0_7:
	mov	x0, x21
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_8:
	add	w23, w22, w23
	tbnz	w22, #31, LBB0_21
; %bb.9:
	cmp	w23, #0
	b.gt	LBB0_22
	b	LBB0_24
LBB0_10:
	add	w24, w22, w23
	tbz	w22, #31, LBB0_12
; %bb.11:
Lloh5:
	adrp	x8, _ERROR@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ERROR@GOTPAGEOFF]
Lloh7:
	ldr	w22, [x8]
Lloh8:
	adrp	x8, _ERRCODE_SUBSTRING_ERROR@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ERRCODE_SUBSTRING_ERROR@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	bl	_errcode
Lloh11:
	adrp	x0, l_.str@PAGE
Lloh12:
	add	x0, x0, l_.str@PAGEOFF
	bl	_errmsg
	mov	x1, x0
	mov	x0, x22
	bl	_ereport
LBB0_12:
	cmp	w24, #0
	b.le	LBB0_24
; %bb.13:
	sub	w23, w24, w21
	mul	w20, w20, w24
LBB0_14:
	mov	x0, x19
	bl	_DatumGetPointer
	bl	_VARATT_IS_COMPRESSED
	cbnz	x0, LBB0_16
; %bb.15:
	mov	x0, x19
	bl	_DatumGetPointer
	bl	_VARATT_IS_EXTERNAL
	cbz	x0, LBB0_27
LBB0_16:
	mov	x0, x19
	mov	w1, #0
	mov	x2, x20
	bl	_DatumGetTextPSlice
LBB0_17:
	mov	x20, x0
	bl	_VARSIZE_ANY_EXHDR
	cbz	x0, LBB0_19
; %bb.18:
	mov	x0, x20
	bl	_VARDATA_ANY
	mov	x22, x0
	mov	x0, x20
	bl	_VARSIZE_ANY_EXHDR
	mov	x1, x0
	mov	x0, x22
	bl	_pg_mbstrlen_with_len
	cmp	w21, w0
	b.le	LBB0_25
LBB0_19:
	mov	x0, x19
	bl	_DatumGetPointer
	cmp	x20, x0
	b.eq	LBB0_24
; %bb.20:
	mov	x0, x20
	bl	_pfree
	b	LBB0_24
LBB0_21:
Lloh13:
	adrp	x8, _ERROR@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ERROR@GOTPAGEOFF]
Lloh15:
	ldr	w21, [x8]
Lloh16:
	adrp	x8, _ERRCODE_SUBSTRING_ERROR@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ERRCODE_SUBSTRING_ERROR@GOTPAGEOFF]
Lloh18:
	ldr	w0, [x8]
	bl	_errcode
Lloh19:
	adrp	x0, l_.str@PAGE
Lloh20:
	add	x0, x0, l_.str@PAGEOFF
	bl	_errmsg
	mov	x1, x0
	mov	x0, x21
	bl	_ereport
	cmp	w23, #0
	b.le	LBB0_24
LBB0_22:
	sub	w2, w23, w20
LBB0_23:
	sub	w1, w20, #1
	mov	x0, x19
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_DatumGetTextPSlice
LBB0_24:
Lloh21:
	adrp	x0, l_.str.1@PAGE
Lloh22:
	add	x0, x0, l_.str.1@PAGEOFF
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_cstring_to_text
LBB0_25:
	tbnz	w23, #31, LBB0_28
; %bb.26:
	add	w8, w23, w21
	add	w1, w0, #1
	mov	x0, x8
	bl	_Min
	mov	x23, x0
	b	LBB0_29
LBB0_27:
	mov	x0, x19
	bl	_DatumGetPointer
	b	LBB0_17
LBB0_28:
	add	w23, w0, #1
LBB0_29:
	mov	x0, x20
	bl	_VARDATA_ANY
	mov	x22, x0
	cmp	w21, #2
	b.lt	LBB0_32
; %bb.30:
	sub	w24, w21, #1
LBB0_31:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x22
	bl	_pg_mblen
	add	x22, x22, w0, sxtw
	subs	w24, w24, #1
	b.ne	LBB0_31
LBB0_32:
	mov	x24, x22
	cmp	w21, w23
	b.ge	LBB0_35
; %bb.33:
	sub	w21, w23, w21
	mov	x24, x22
LBB0_34:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x24
	bl	_pg_mblen
	add	x24, x24, w0, sxtw
	subs	w21, w21, #1
	b.ne	LBB0_34
LBB0_35:
Lloh23:
	adrp	x25, _VARHDRSZ@GOTPAGE
Lloh24:
	ldr	x25, [x25, _VARHDRSZ@GOTPAGEOFF]
	ldr	x8, [x25]
	sub	x23, x24, x22
	add	x0, x8, x23
	bl	_palloc
	mov	x21, x0
	ldr	x8, [x25]
	add	x1, x8, x23
	bl	_SET_VARSIZE
	mov	x0, x21
	bl	_VARDATA
	mov	x1, x22
	mov	x2, x23
	bl	_memcpy
	mov	x0, x19
	bl	_DatumGetPointer
	cmp	x20, x0
	b.eq	LBB0_7
; %bb.36:
	mov	x0, x20
	bl	_pfree
	b	LBB0_7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_ERROR,4,2                      ; @ERROR
	.comm	_ERRCODE_SUBSTRING_ERROR,4,2    ; @ERRCODE_SUBSTRING_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"negative substring length not allowed"

l_.str.1:                               ; @.str.1
	.space	1

	.comm	_VARHDRSZ,8,3                   ; @VARHDRSZ
l_.str.2:                               ; @.str.2
	.asciz	"invalid backend encoding: encoding max length < 1"

	.no_dead_strip	_text_substring
.subsections_via_symbols
