	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_PQsetClientEncoding            ## -- Begin function PQsetClientEncoding
	.p2align	4, 0x90
_PQsetClientEncoding:                   ## @PQsetClientEncoding
	.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	%r12
	pushq	%rbx
	subq	$144, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	movl	$-1, %r14d
	testq	%rdi, %rdi
	je	LBB0_11
## %bb.1:
	movq	%rsi, %rbx
	testq	%rsi, %rsi
	je	LBB0_11
## %bb.2:
	movq	%rdi, %r15
	movq	_CONNECTION_OK@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	%rax, (%rdi)
	jne	LBB0_11
## %bb.3:
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	callq	_strcmp
	testq	%rax, %rax
	jne	LBB0_5
## %bb.4:
	xorl	%edi, %edi
	movl	$1, %esi
	callq	_pg_get_encoding_from_locale
	movl	%eax, %edi
	callq	_pg_encoding_to_char
	movq	%rax, %rbx
LBB0_5:
	movq	%rbx, %rdi
	callq	_strlen
	cltq
	addq	$-101, %rax
	cmpq	$-129, %rax
	jb	LBB0_11
## %bb.6:
	leaq	_PQsetClientEncoding.query(%rip), %rsi
	leaq	-176(%rbp), %r12
	movq	%r12, %rdi
	movq	%rbx, %rdx
	callq	_sprintf
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	_PQexec
	testq	%rax, %rax
	je	LBB0_11
## %bb.7:
	movq	%rax, %r12
	movq	(%rax), %rax
	movq	_PGRES_COMMAND_OK@GOTPCREL(%rip), %rcx
	movl	$-1, %r14d
	cmpq	(%rcx), %rax
	jne	LBB0_10
## %bb.8:
	movl	8(%r15), %edi
	callq	_PG_PROTOCOL_MAJOR
	xorl	%r14d, %r14d
	cmpl	$2, %eax
	jg	LBB0_10
## %bb.9:
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	movq	%rbx, %rdx
	callq	_pqSaveParameterStatus
LBB0_10:
	movq	%r12, %rdi
	callq	_PQclear
LBB0_11:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-40(%rbp), %rax
	jne	LBB0_13
## %bb.12:
	movl	%r14d, %eax
	addq	$144, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__const
	.p2align	4                               ## @PQsetClientEncoding.query
_PQsetClientEncoding.query:
	.asciz	"set client_encoding to '%s'"

	.comm	_CONNECTION_OK,8,3              ## @CONNECTION_OK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"auto"

	.comm	_PGRES_COMMAND_OK,8,3           ## @PGRES_COMMAND_OK
L_.str.1:                               ## @.str.1
	.asciz	"client_encoding"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_PQsetClientEncoding            ; -- Begin function PQsetClientEncoding
	.p2align	2
_PQsetClientEncoding:                   ; @PQsetClientEncoding
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #192
	.cfi_def_cfa_offset 192
	stp	x22, x21, [sp, #144]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #160]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #176]            ; 16-byte Folded Spill
	add	x29, sp, #176
	.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
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-40]
	cbz	x0, LBB0_11
; %bb.1:
	mov	x20, x1
	mov	w21, #-1
	cbz	x1, LBB0_12
; %bb.2:
	mov	x19, x0
	ldr	x8, [x0]
Lloh3:
	adrp	x9, _CONNECTION_OK@GOTPAGE
Lloh4:
	ldr	x9, [x9, _CONNECTION_OK@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_12
; %bb.3:
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_strcmp
	cbnz	x0, LBB0_5
; %bb.4:
	mov	w1, #1
	bl	_pg_get_encoding_from_locale
	bl	_pg_encoding_to_char
	mov	x20, x0
LBB0_5:
	mov	x0, x20
	bl	_strlen
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x8, w0
	sub	x8, x8, #101
	cmn	x8, #129
	b.lo	LBB0_11
; %bb.6:
Lloh8:
	adrp	x1, _PQsetClientEncoding.query@PAGE
Lloh9:
	add	x1, x1, _PQsetClientEncoding.query@PAGEOFF
	add	x0, sp, #8
	mov	x2, x20
	bl	_sprintf
	add	x1, sp, #8
	mov	x0, x19
	bl	_PQexec
	cbz	x0, LBB0_11
; %bb.7:
	mov	x22, x0
	ldr	x8, [x0]
Lloh10:
	adrp	x9, _PGRES_COMMAND_OK@GOTPAGE
Lloh11:
	ldr	x9, [x9, _PGRES_COMMAND_OK@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_14
; %bb.8:
	ldr	w0, [x19, #8]
	bl	_PG_PROTOCOL_MAJOR
	cmp	w0, #2
	b.gt	LBB0_10
; %bb.9:
Lloh13:
	adrp	x1, l_.str.1@PAGE
Lloh14:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	mov	x2, x20
	bl	_pqSaveParameterStatus
LBB0_10:
	mov	w21, #0
	b	LBB0_15
LBB0_11:
	mov	w21, #-1
LBB0_12:
	ldur	x8, [x29, #-40]
Lloh15:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh16:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_16
; %bb.13:
	mov	x0, x21
	ldp	x29, x30, [sp, #176]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #160]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #144]            ; 16-byte Folded Reload
	add	sp, sp, #192
	ret
LBB0_14:
	mov	w21, #-1
LBB0_15:
	mov	x0, x22
	bl	_PQclear
	b	LBB0_12
LBB0_16:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__const
_PQsetClientEncoding.query:             ; @PQsetClientEncoding.query
	.asciz	"set client_encoding to '%s'"

	.comm	_CONNECTION_OK,8,3              ; @CONNECTION_OK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"auto"

	.comm	_PGRES_COMMAND_OK,8,3           ; @PGRES_COMMAND_OK
l_.str.1:                               ; @.str.1
	.asciz	"client_encoding"

.subsections_via_symbols
