	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pg_wcsformat                   ## -- Begin function pg_wcsformat
	.p2align	4, 0x90
_pg_wcsformat:                          ## @pg_wcsformat
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, -72(%rbp)                 ## 8-byte Spill
	movq	(%rcx), %r12
	xorl	%eax, %eax
	cmpb	$0, (%rdi)
	je	LBB0_44
## %bb.1:
	movq	%rsi, %r13
	testq	%rsi, %rsi
	je	LBB0_44
## %bb.2:
	movl	%edx, %ebx
	movq	%rdi, %r14
	xorl	%eax, %eax
	movl	%edx, -48(%rbp)                 ## 4-byte Spill
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_38:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	addl	%eax, %ecx
	movq	%rcx, %rax
LBB0_39:                                ##   in Loop: Header=BB0_3 Depth=1
	movl	-44(%rbp), %r8d                 ## 4-byte Reload
LBB0_40:                                ##   in Loop: Header=BB0_3 Depth=1
	movl	-48(%rbp), %ebx                 ## 4-byte Reload
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	cmpb	$0, (%r14,%rcx)
	je	LBB0_44
LBB0_41:                                ##   in Loop: Header=BB0_3 Depth=1
	addq	%rcx, %r14
	testq	%r13, %r13
	je	LBB0_44
LBB0_3:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_27 Depth 2
                                        ##     Child Loop BB0_30 Depth 2
                                        ##     Child Loop BB0_33 Depth 2
                                        ##     Child Loop BB0_36 Depth 2
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movl	%r8d, -44(%rbp)                 ## 4-byte Spill
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_PQmblen
	movl	%eax, %r15d
	cltq
	subq	%rax, %r13
	jb	LBB0_43
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_PQdsplen
	cmpl	$1, %r15d
	jne	LBB0_9
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movzbl	(%r14), %edx
	cmpl	$13, %edx
	je	LBB0_17
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	cmpb	$10, %dl
	je	LBB0_18
## %bb.7:                               ##   in Loop: Header=BB0_3 Depth=1
	cmpb	$9, %dl
	jne	LBB0_20
## %bb.8:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movl	%ebx, %eax
	xorb	$7, %al
	movzbl	%al, %r15d
	movq	%r15, -80(%rbp)                 ## 8-byte Spill
                                        ## kill: def $r15d killed $r15d killed $r15 def $r15
	andl	$7, %r15d
	leaq	1(%r15), %rdx
	movq	%r12, %rdi
	movl	$32, %esi
	callq	_memset
	movq	%rbx, %rax
	addq	%r15, %r12
	incq	%r12
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
	andl	$7, %ecx
	leal	(%rbx,%rcx), %eax
	incl	%eax
	jmp	LBB0_39
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_3 Depth=1
	testl	%eax, %eax
	js	LBB0_15
## %bb.10:                              ##   in Loop: Header=BB0_3 Depth=1
	testl	%r15d, %r15d
	jle	LBB0_38
## %bb.11:                              ##   in Loop: Header=BB0_3 Depth=1
	movl	%r15d, %r8d
	cmpl	$32, %r15d
	jb	LBB0_25
## %bb.12:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	%r12, %rcx
	subq	%r14, %rcx
	cmpq	$32, %rcx
	jb	LBB0_25
## %bb.13:                              ##   in Loop: Header=BB0_3 Depth=1
	movl	%r8d, %edx
	andl	$-32, %edx
	leaq	-32(%rdx), %rcx
	movq	%rcx, %rdi
	shrq	$5, %rdi
	incq	%rdi
	movl	%edi, %r9d
	andl	$3, %r9d
	cmpq	$96, %rcx
	jae	LBB0_26
## %bb.14:                              ##   in Loop: Header=BB0_3 Depth=1
	xorl	%ecx, %ecx
	jmp	LBB0_28
LBB0_15:                                ##   in Loop: Header=BB0_3 Depth=1
	movl	-48(%rbp), %ebx                 ## 4-byte Reload
	movq	_PG_UTF8@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	jne	LBB0_22
## %bb.16:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	%r14, %rdi
	callq	_utf8_to_unicode
	movq	%r12, %rdi
	leaq	L_.str.2(%rip), %rsi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_sprintf
	movl	-48(%rbp), %ebx                 ## 4-byte Reload
	jmp	LBB0_23
LBB0_17:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	%r12, %rdi
	leaq	L_.str(%rip), %rsi
	callq	_strcpy
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	addl	$2, %eax
	addq	$2, %r12
	jmp	LBB0_39
LBB0_18:                                ##   in Loop: Header=BB0_3 Depth=1
	movb	$0, (%r12)
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, 8(%rcx)
	movl	-44(%rbp), %r8d                 ## 4-byte Reload
	cmpl	$1, %r8d
	jle	LBB0_46
## %bb.19:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	%rcx, %rax
	decl	%r8d
	incq	%r12
	movq	%r12, 16(%rcx)
	addq	$16, %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	xorl	%eax, %eax
	jmp	LBB0_40
LBB0_20:                                ##   in Loop: Header=BB0_3 Depth=1
	testl	%eax, %eax
	js	LBB0_42
## %bb.21:                              ##   in Loop: Header=BB0_3 Depth=1
	addl	-56(%rbp), %eax                 ## 4-byte Folded Reload
	movb	%dl, (%r12)
	incq	%r12
                                        ## kill: def $eax killed $eax def $rax
	jmp	LBB0_39
LBB0_25:                                ##   in Loop: Header=BB0_3 Depth=1
	xorl	%edx, %edx
	jmp	LBB0_32
LBB0_22:                                ##   in Loop: Header=BB0_3 Depth=1
	movl	$4144959, 3(%r12)               ## imm = 0x3F3F3F
	movl	$1061123420, (%r12)             ## imm = 0x3F3F755C
LBB0_23:                                ##   in Loop: Header=BB0_3 Depth=1
	movl	-44(%rbp), %r8d                 ## 4-byte Reload
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	addq	$6, %r12
	addl	$6, %eax
	cmpb	$0, (%r14,%rcx)
	jne	LBB0_41
	jmp	LBB0_44
LBB0_26:                                ##   in Loop: Header=BB0_3 Depth=1
	andq	$-4, %rdi
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_27:                                ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movups	(%r14,%rcx), %xmm0
	movups	16(%r14,%rcx), %xmm1
	movups	%xmm0, (%r12,%rcx)
	movups	%xmm1, 16(%r12,%rcx)
	movups	32(%r14,%rcx), %xmm0
	movups	48(%r14,%rcx), %xmm1
	movups	%xmm0, 32(%r12,%rcx)
	movups	%xmm1, 48(%r12,%rcx)
	movups	64(%r14,%rcx), %xmm0
	movups	80(%r14,%rcx), %xmm1
	movups	%xmm0, 64(%r12,%rcx)
	movups	%xmm1, 80(%r12,%rcx)
	movups	96(%r14,%rcx), %xmm0
	movups	112(%r14,%rcx), %xmm1
	movups	%xmm0, 96(%r12,%rcx)
	movups	%xmm1, 112(%r12,%rcx)
	subq	$-128, %rcx
	addq	$-4, %rdi
	jne	LBB0_27
LBB0_28:                                ##   in Loop: Header=BB0_3 Depth=1
	testq	%r9, %r9
	je	LBB0_31
## %bb.29:                              ##   in Loop: Header=BB0_3 Depth=1
	leaq	(%r14,%rcx), %rdi
	addq	$16, %rdi
	addq	%r12, %rcx
	addq	$16, %rcx
	shlq	$5, %r9
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_30:                                ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movups	-16(%rdi,%rsi), %xmm0
	movups	(%rdi,%rsi), %xmm1
	movups	%xmm0, -16(%rcx,%rsi)
	movups	%xmm1, (%rcx,%rsi)
	addq	$32, %rsi
	cmpq	%rsi, %r9
	jne	LBB0_30
LBB0_31:                                ##   in Loop: Header=BB0_3 Depth=1
	addq	%rdx, %r12
	cmpq	%r8, %rdx
	je	LBB0_38
LBB0_32:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	%rdx, %rsi
	notq	%rsi
	addq	%r8, %rsi
	movq	%r8, %rcx
	andq	$7, %rcx
	je	LBB0_34
	.p2align	4, 0x90
LBB0_33:                                ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movzbl	(%r14,%rdx), %ebx
	movb	%bl, (%r12)
	incq	%r12
	incq	%rdx
	decq	%rcx
	jne	LBB0_33
LBB0_34:                                ##   in Loop: Header=BB0_3 Depth=1
	cmpq	$7, %rsi
	jb	LBB0_38
## %bb.35:                              ##   in Loop: Header=BB0_3 Depth=1
	subq	%rdx, %r8
	addq	%r14, %rdx
	addq	$7, %rdx
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_36:                                ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movzbl	-7(%rdx,%rcx), %ebx
	movb	%bl, (%r12,%rcx)
	movzbl	-6(%rdx,%rcx), %ebx
	movb	%bl, 1(%r12,%rcx)
	movzbl	-5(%rdx,%rcx), %ebx
	movb	%bl, 2(%r12,%rcx)
	movzbl	-4(%rdx,%rcx), %ebx
	movb	%bl, 3(%r12,%rcx)
	movzbl	-3(%rdx,%rcx), %ebx
	movb	%bl, 4(%r12,%rcx)
	movzbl	-2(%rdx,%rcx), %ebx
	movb	%bl, 5(%r12,%rcx)
	movzbl	-1(%rdx,%rcx), %ebx
	movb	%bl, 6(%r12,%rcx)
	movzbl	(%rdx,%rcx), %ebx
	movb	%bl, 7(%r12,%rcx)
	addq	$8, %rcx
	cmpq	%rcx, %r8
	jne	LBB0_36
## %bb.37:                              ##   in Loop: Header=BB0_3 Depth=1
	addq	%rcx, %r12
	jmp	LBB0_38
LBB0_42:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	%r12, %rdi
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	callq	_sprintf
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	addl	$4, %eax
	addq	$4, %r12
	jmp	LBB0_39
LBB0_43:
	movl	-44(%rbp), %r8d                 ## 4-byte Reload
	movq	-56(%rbp), %rax                 ## 8-byte Reload
LBB0_44:
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, 8(%rcx)
	movb	$0, (%r12)
	testl	%r8d, %r8d
	jle	LBB0_46
## %bb.45:
	movq	$0, 16(%rcx)
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_46:
	movl	$1, %edi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"\\r"

L_.str.1:                               ## @.str.1
	.asciz	"\\x%02X"

	.comm	_PG_UTF8,4,2                    ## @PG_UTF8
L_.str.2:                               ## @.str.2
	.asciz	"\\u%04X"

L_.str.3:                               ## @.str.3
	.asciz	"\\u????"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pg_wcsformat                   ; -- Begin function pg_wcsformat
	.p2align	2
_pg_wcsformat:                          ; @pg_wcsformat
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x20, x4
	mov	x19, x3
	ldr	x27, [x3]
	ldrb	w8, [x0]
	cmp	w8, #0
	ccmp	x1, #0, #4, ne
	b.ne	LBB0_4
; %bb.1:
	mov	w28, #0
LBB0_2:
	str	w28, [x19, #8]
	strb	wzr, [x27]
	cmp	w20, #0
	b.le	LBB0_34
; %bb.3:
	str	xzr, [x19, #16]
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_4:
	mov	x21, x2
	mov	x22, x1
	mov	x23, x0
	mov	w28, #0
Lloh0:
	adrp	x24, _PG_UTF8@GOTPAGE
Lloh1:
	ldr	x24, [x24, _PG_UTF8@GOTPAGEOFF]
	b	LBB0_8
LBB0_5:                                 ;   in Loop: Header=BB0_8 Depth=1
	mov	x8, x27
LBB0_6:                                 ;   in Loop: Header=BB0_8 Depth=1
	add	w28, w0, w28
	mov	x27, x8
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=1
	add	x23, x23, x26
	ldrb	w8, [x23]
	cmp	w8, #0
	ccmp	x22, #0, #4, ne
	b.eq	LBB0_2
LBB0_8:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_19 Depth 2
                                        ;     Child Loop BB0_30 Depth 2
	mov	x0, x23
	mov	x1, x21
	bl	_PQmblen
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x26, w0
	subs	x22, x22, x26
	b.lo	LBB0_2
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	mov	x0, x23
	mov	x1, x21
	bl	_PQdsplen
	cmp	w26, #1
	b.ne	LBB0_14
; %bb.10:                               ;   in Loop: Header=BB0_8 Depth=1
	ldrb	w8, [x23]
	cmp	w8, #13
	b.eq	LBB0_23
; %bb.11:                               ;   in Loop: Header=BB0_8 Depth=1
	cmp	w8, #10
	b.eq	LBB0_24
; %bb.12:                               ;   in Loop: Header=BB0_8 Depth=1
	cmp	w8, #9
	b.ne	LBB0_26
; %bb.13:                               ;   in Loop: Header=BB0_8 Depth=1
	str	w20, [sp, #12]                  ; 4-byte Folded Spill
	mov	x20, x19
	mov	x19, x24
	eor	w24, w28, #0x7
	and	x25, x24, #0x7
	add	x2, x25, #1
	mov	x0, x27
	mov	w1, #32
	bl	_memset
	add	x8, x27, x25
	add	x27, x8, #1
	and	w8, w24, #0x7
	mov	x24, x19
	mov	x19, x20
	ldr	w20, [sp, #12]                  ; 4-byte Folded Reload
	add	w8, w28, w8
	add	w28, w8, #1
	b	LBB0_7
LBB0_14:                                ;   in Loop: Header=BB0_8 Depth=1
	tbnz	w0, #31, LBB0_21
; %bb.15:                               ;   in Loop: Header=BB0_8 Depth=1
	cmp	w26, #1
	b.lt	LBB0_5
; %bb.16:                               ;   in Loop: Header=BB0_8 Depth=1
	mov	x9, #0
	and	x10, x26, #0xffffffff
	cmp	w26, #64
	b.lo	LBB0_28
; %bb.17:                               ;   in Loop: Header=BB0_8 Depth=1
	sub	x8, x27, x23
	cmp	x8, #64
	b.lo	LBB0_28
; %bb.18:                               ;   in Loop: Header=BB0_8 Depth=1
	and	x9, x10, #0xffffffc0
	add	x8, x27, x9
	add	x11, x27, #32
	add	x12, x23, #32
	mov	x13, x9
LBB0_19:                                ;   Parent Loop BB0_8 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldp	q0, q1, [x12, #-32]
	ldp	q2, q3, [x12], #64
	stp	q0, q1, [x11, #-32]
	stp	q2, q3, [x11], #64
	subs	x13, x13, #64
	b.ne	LBB0_19
; %bb.20:                               ;   in Loop: Header=BB0_8 Depth=1
	cmp	x9, x10
	b.eq	LBB0_6
	b	LBB0_29
LBB0_21:                                ;   in Loop: Header=BB0_8 Depth=1
	ldr	w8, [x24]
	cmp	w8, w21
	b.ne	LBB0_31
; %bb.22:                               ;   in Loop: Header=BB0_8 Depth=1
	mov	x0, x23
	bl	_utf8_to_unicode
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp]
	mov	x0, x27
Lloh2:
	adrp	x1, l_.str.2@PAGE
Lloh3:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_sprintf
	b	LBB0_32
LBB0_23:                                ;   in Loop: Header=BB0_8 Depth=1
	mov	x0, x27
Lloh4:
	adrp	x1, l_.str@PAGE
Lloh5:
	add	x1, x1, l_.str@PAGEOFF
	bl	_strcpy
	add	w28, w28, #2
	add	x27, x27, #2
	b	LBB0_7
LBB0_24:                                ;   in Loop: Header=BB0_8 Depth=1
	strb	wzr, [x27]
	str	w28, [x19, #8]
	subs	w20, w20, #1
	b.le	LBB0_34
; %bb.25:                               ;   in Loop: Header=BB0_8 Depth=1
	mov	w28, #0
	add	x27, x27, #1
	str	x27, [x19, #16]!
	b	LBB0_7
LBB0_26:                                ;   in Loop: Header=BB0_8 Depth=1
	tbnz	w0, #31, LBB0_33
; %bb.27:                               ;   in Loop: Header=BB0_8 Depth=1
	add	w28, w0, w28
	strb	w8, [x27], #1
	b	LBB0_7
LBB0_28:                                ;   in Loop: Header=BB0_8 Depth=1
	mov	x8, x27
LBB0_29:                                ;   in Loop: Header=BB0_8 Depth=1
	add	x11, x23, x9
	sub	x9, x10, x9
LBB0_30:                                ;   Parent Loop BB0_8 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldrb	w10, [x11], #1
	strb	w10, [x8], #1
	subs	x9, x9, #1
	b.ne	LBB0_30
	b	LBB0_6
LBB0_31:                                ;   in Loop: Header=BB0_8 Depth=1
	mov	w8, #16191
	movk	w8, #63, lsl #16
	stur	w8, [x27, #3]
	mov	w8, #30044
	movk	w8, #16191, lsl #16
	str	w8, [x27]
LBB0_32:                                ;   in Loop: Header=BB0_8 Depth=1
	add	x27, x27, #6
	add	w28, w28, #6
	b	LBB0_7
LBB0_33:                                ;   in Loop: Header=BB0_8 Depth=1
	str	x8, [sp]
	mov	x0, x27
Lloh6:
	adrp	x1, l_.str.1@PAGE
Lloh7:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_sprintf
	add	w28, w28, #4
	add	x27, x27, #4
	b	LBB0_7
LBB0_34:
	mov	w0, #1
	bl	_exit
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"\\r"

l_.str.1:                               ; @.str.1
	.asciz	"\\x%02X"

	.comm	_PG_UTF8,4,2                    ; @PG_UTF8
l_.str.2:                               ; @.str.2
	.asciz	"\\u%04X"

l_.str.3:                               ; @.str.3
	.asciz	"\\u????"

.subsections_via_symbols
