	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_lowerstr_with_len              ## -- Begin function lowerstr_with_len
	.p2align	4, 0x90
_lowerstr_with_len:                     ## @lowerstr_with_len
	.cfi_startproc
## %bb.0:
	testl	%esi, %esi
	je	LBB0_17
## %bb.1:
	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	%esi, %r12d
	movq	%rdi, %r13
	movq	_DEFAULT_COLLATION_OID@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	xorl	%eax, %eax
	callq	_pg_database_encoding_max_length
	cmpl	$2, %eax
	jl	LBB0_9
## %bb.2:
	movl	%r14d, %edi
	callq	_lc_ctype_is_c
	testl	%eax, %eax
	je	LBB0_3
LBB0_9:
	leal	1(%r12), %edi
	callq	_palloc
	movq	%rax, %r14
	testl	%r12d, %r12d
	jle	LBB0_10
## %bb.11:
	movslq	%r12d, %r15
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	cmpb	$0, (%r13,%rbx)
	je	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_12 Depth=1
	leaq	(%rbx,%r13), %rdi
	callq	_TOUCHAR
	movl	%eax, %edi
	callq	_tolower
	movb	%al, (%r14,%rbx)
	incq	%rbx
	cmpq	%r15, %rbx
	jl	LBB0_12
LBB0_14:
	movq	%r14, %rax
	addq	%rbx, %rax
	jmp	LBB0_15
LBB0_17:
	leaq	L_.str(%rip), %rdi
	jmp	_pstrdup                        ## TAILCALL
LBB0_10:
	movq	%r14, %rax
LBB0_15:
	movb	$0, (%rax)
LBB0_16:
	movq	%r14, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	leal	1(%r12), %r14d
	leal	8(,%r12,8), %edi
	callq	_palloc
	movq	%rax, %r15
	movq	%rax, %rdi
	movl	%r14d, %esi
	movq	%r13, %rdx
	movl	%r12d, %ecx
	xorl	%r8d, %r8d
	callq	_char2wchar
	movl	%eax, %r14d
	xorl	%edi, %edi
	cmpl	%r12d, %eax
	setle	%dil
	callq	_Assert
	movq	(%r15), %rdi
	testq	%rdi, %rdi
	je	LBB0_6
## %bb.4:
	movq	%r15, %rbx
	addq	$8, %rbx
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_towlower
	movq	%rax, -8(%rbx)
	movq	(%rbx), %rdi
	addq	$8, %rbx
	testq	%rdi, %rdi
	jne	LBB0_5
LBB0_6:
	xorl	%eax, %eax
	callq	_pg_database_encoding_max_length
	movl	%eax, %r13d
	imull	%r14d, %r13d
	leal	1(%r13), %ebx
	movl	%ebx, %edi
	callq	_palloc
	movq	%rax, %r14
	movq	%rax, %rdi
	movq	%r15, %rsi
	movl	%ebx, %edx
	xorl	%ecx, %ecx
	callq	_wchar2char
	movl	%eax, %r12d
	movq	%r15, %rdi
	callq	_pfree
	testl	%r12d, %r12d
	jns	LBB0_8
## %bb.7:
	movq	_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_ERRCODE_CHARACTER_NOT_IN_REPERTOIRE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_errcode
	leaq	L_.str.1(%rip), %rdi
	callq	_errmsg
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_ereport
LBB0_8:
	xorl	%edi, %edi
	cmpl	%r13d, %r12d
	setle	%dil
	callq	_Assert
	jmp	LBB0_16
	.cfi_endproc
                                        ## -- End function
	.comm	_DEFAULT_COLLATION_OID,4,2      ## @DEFAULT_COLLATION_OID
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.space	1

	.comm	_ERROR,4,2                      ## @ERROR
	.comm	_ERRCODE_CHARACTER_NOT_IN_REPERTOIRE,4,2 ## @ERRCODE_CHARACTER_NOT_IN_REPERTOIRE
L_.str.1:                               ## @.str.1
	.asciz	"conversion from wchar_t to server encoding failed: %m"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_lowerstr_with_len              ; -- Begin function lowerstr_with_len
	.p2align	2
_lowerstr_with_len:                     ; @lowerstr_with_len
	.cfi_startproc
; %bb.0:
	cbz	w1, LBB0_8
; %bb.1:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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_remember_state
	mov	x22, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _DEFAULT_COLLATION_OID@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DEFAULT_COLLATION_OID@GOTPAGEOFF]
Lloh2:
	ldr	w19, [x8]
	bl	_pg_database_encoding_max_length
	cmp	w0, #1
	b.le	LBB0_3
; %bb.2:
	mov	x0, x19
	bl	_lc_ctype_is_c
	cbz	w0, LBB0_12
LBB0_3:
	add	w0, w22, #1
	bl	_palloc
	mov	x19, x0
	cmp	w22, #1
	b.lt	LBB0_9
; %bb.4:
	mov	x21, #0
	sxtw	x22, w22
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	add	x0, x20, x21
	ldrb	w8, [x0]
	cbz	w8, LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	bl	_TOUCHAR
	bl	_tolower
	strb	w0, [x19, x21]
	add	x21, x21, #1
	cmp	x21, x22
	b.lt	LBB0_5
LBB0_7:
	add	x8, x19, x21
	b	LBB0_10
LBB0_8:
	.cfi_def_cfa wsp, 0
	.cfi_same_value w30
	.cfi_same_value w29
	.cfi_same_value w19
	.cfi_same_value w20
	.cfi_same_value w21
	.cfi_same_value w22
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	b	_pstrdup
LBB0_9:
	.cfi_restore_state
	mov	x8, x19
LBB0_10:
	strb	wzr, [x8]
LBB0_11:
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_12:
	add	w19, w22, #1
	lsl	w0, w19, #3
	bl	_palloc
	mov	x21, x0
	mov	x1, x19
	mov	x2, x20
	mov	x3, x22
	mov	w4, #0
	bl	_char2wchar
	mov	x19, x0
	cmp	w0, w22
	cset	w0, le
	bl	_Assert
	ldr	x0, [x21]
	cbz	x0, LBB0_15
; %bb.13:
	add	x20, x21, #8
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
                                        ; kill: def $w0 killed $w0 killed $x0
	bl	_towlower
	stur	x0, [x20, #-8]
	ldr	x0, [x20], #8
	cbnz	x0, LBB0_14
LBB0_15:
	bl	_pg_database_encoding_max_length
	mul	w22, w0, w19
	add	w20, w22, #1
	mov	x0, x20
	bl	_palloc
	mov	x19, x0
	mov	x1, x21
	mov	x2, x20
	mov	w3, #0
	bl	_wchar2char
	mov	x20, x0
	mov	x0, x21
	bl	_pfree
	tbz	w20, #31, LBB0_17
; %bb.16:
Lloh5:
	adrp	x8, _ERROR@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ERROR@GOTPAGEOFF]
Lloh7:
	ldr	w21, [x8]
Lloh8:
	adrp	x8, _ERRCODE_CHARACTER_NOT_IN_REPERTOIRE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ERRCODE_CHARACTER_NOT_IN_REPERTOIRE@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	bl	_errcode
Lloh11:
	adrp	x0, l_.str.1@PAGE
Lloh12:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_errmsg
	mov	x1, x0
	mov	x0, x21
	bl	_ereport
LBB0_17:
	cmp	w20, w22
	cset	w0, le
	bl	_Assert
	b	LBB0_11
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_DEFAULT_COLLATION_OID,4,2      ; @DEFAULT_COLLATION_OID
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.space	1

	.comm	_ERROR,4,2                      ; @ERROR
	.comm	_ERRCODE_CHARACTER_NOT_IN_REPERTOIRE,4,2 ; @ERRCODE_CHARACTER_NOT_IN_REPERTOIRE
l_.str.1:                               ; @.str.1
	.asciz	"conversion from wchar_t to server encoding failed: %m"

.subsections_via_symbols
