	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_RenameDatabase                 ## -- Begin function RenameDatabase
	.p2align	4, 0x90
_RenameDatabase:                        ## @RenameDatabase
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r12
	movq	_DatabaseRelationId@GOTPCREL(%rip), %r13
	movl	(%r13), %edi
	movq	_RowExclusiveLock@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_table_open
	movl	%eax, %r14d
	movq	_AccessExclusiveLock@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorps	%xmm0, %xmm0
	movups	%xmm0, 32(%rsp)
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movq	$0, 48(%rsp)
	leaq	-48(%rbp), %rdx
	movq	%r12, %rdi
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_get_db_info
	testl	%eax, %eax
	jne	LBB0_2
## %bb.1:
	movq	_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_ERRCODE_UNDEFINED_DATABASE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_errcode
	leaq	L_.str(%rip), %rdi
	movq	%r12, %rsi
	xorl	%eax, %eax
	callq	_errmsg
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_ereport
LBB0_2:
	movq	-48(%rbp), %rbx
	xorl	%eax, %eax
	callq	_GetUserId
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_pg_database_ownercheck
	testl	%eax, %eax
	jne	LBB0_4
## %bb.3:
	movq	_ACLCHECK_NOT_OWNER@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_OBJECT_DATABASE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdx
	callq	_aclcheck_error
LBB0_4:
	xorl	%eax, %eax
	callq	_have_createdb_privilege
	testl	%eax, %eax
	jne	LBB0_6
## %bb.5:
	movq	_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_ERRCODE_INSUFFICIENT_PRIVILEGE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_errcode
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_errmsg
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_ereport
LBB0_6:
	movq	%r15, %rdi
	movl	$1, %esi
	callq	_get_database_oid
	movl	%eax, %edi
	callq	_OidIsValid
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	movq	_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_ERRCODE_DUPLICATE_DATABASE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_errcode
	leaq	L_.str.2(%rip), %rdi
	movq	%r15, %rsi
	xorl	%eax, %eax
	callq	_errmsg
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_ereport
LBB0_8:
	movq	-48(%rbp), %rdi
	movq	_MyDatabaseId@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rdi
	jne	LBB0_10
## %bb.9:
	movq	_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_ERRCODE_FEATURE_NOT_SUPPORTED@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_errcode
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_errmsg
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_ereport
	movq	-48(%rbp), %rdi
LBB0_10:
	leaq	-56(%rbp), %rsi
	leaq	-52(%rbp), %rdx
	callq	_CountOtherDBBackends
	testq	%rax, %rax
	je	LBB0_12
## %bb.11:
	movq	_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_ERRCODE_OBJECT_IN_USE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_errcode
	leaq	L_.str.4(%rip), %rdi
	movq	%r12, %rsi
	xorl	%eax, %eax
	callq	_errmsg
	movl	-56(%rbp), %edi
	movl	-52(%rbp), %esi
	callq	_errdetail_busy_db
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_ereport
LBB0_12:
	movq	_DATABASEOID@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	-48(%rbp), %rdi
	callq	_ObjectIdGetDatum
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_SearchSysCacheCopy1
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_HeapTupleIsValid
	testl	%eax, %eax
	jne	LBB0_14
## %bb.13:
	movq	_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	-48(%rbp), %rdx
	leaq	L_.str.5(%rip), %rsi
	xorl	%eax, %eax
	callq	_elog
LBB0_14:
	movq	%rbx, %rdi
	callq	_GETSTRUCT
	movq	%rax, %rdi
	movq	%r15, %rsi
	callq	_namestrcpy
	movl	%r14d, %edi
	movq	%rbx, %rsi
	movq	%rbx, %rdx
	callq	_CatalogTupleUpdate
	movl	(%r13), %edi
	movq	-48(%rbp), %rsi
	xorl	%edx, %edx
	callq	_InvokeObjectPostAlterHook
	movl	(%r13), %esi
	movq	-48(%rbp), %rdx
	callq	_ObjectAddressSet
	movq	_NoLock@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r14d, %edi
	callq	_table_close
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DatabaseRelationId,4,2         ## @DatabaseRelationId
	.comm	_RowExclusiveLock,4,2           ## @RowExclusiveLock
	.comm	_AccessExclusiveLock,4,2        ## @AccessExclusiveLock
	.comm	_ERROR,4,2                      ## @ERROR
	.comm	_ERRCODE_UNDEFINED_DATABASE,4,2 ## @ERRCODE_UNDEFINED_DATABASE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"database \"%s\" does not exist"

	.comm	_ACLCHECK_NOT_OWNER,4,2         ## @ACLCHECK_NOT_OWNER
	.comm	_OBJECT_DATABASE,4,2            ## @OBJECT_DATABASE
	.comm	_ERRCODE_INSUFFICIENT_PRIVILEGE,4,2 ## @ERRCODE_INSUFFICIENT_PRIVILEGE
L_.str.1:                               ## @.str.1
	.asciz	"permission denied to rename database"

	.comm	_ERRCODE_DUPLICATE_DATABASE,4,2 ## @ERRCODE_DUPLICATE_DATABASE
L_.str.2:                               ## @.str.2
	.asciz	"database \"%s\" already exists"

	.comm	_MyDatabaseId,8,3               ## @MyDatabaseId
	.comm	_ERRCODE_FEATURE_NOT_SUPPORTED,4,2 ## @ERRCODE_FEATURE_NOT_SUPPORTED
L_.str.3:                               ## @.str.3
	.asciz	"current database cannot be renamed"

	.comm	_ERRCODE_OBJECT_IN_USE,4,2      ## @ERRCODE_OBJECT_IN_USE
L_.str.4:                               ## @.str.4
	.asciz	"database \"%s\" is being accessed by other users"

	.comm	_DATABASEOID,4,2                ## @DATABASEOID
L_.str.5:                               ## @.str.5
	.asciz	"cache lookup failed for database %u"

	.comm	_NoLock,4,2                     ## @NoLock
	.comm	_WARNING,4,2                    ## @WARNING
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_RenameDatabase                 ; -- Begin function RenameDatabase
	.p2align	2
_RenameDatabase:                        ; @RenameDatabase
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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	x20, x1
	mov	x21, x0
Lloh0:
	adrp	x23, _DatabaseRelationId@GOTPAGE
Lloh1:
	ldr	x23, [x23, _DatabaseRelationId@GOTPAGEOFF]
	ldr	w0, [x23]
Lloh2:
	adrp	x8, _RowExclusiveLock@GOTPAGE
Lloh3:
	ldr	x8, [x8, _RowExclusiveLock@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	bl	_table_open
	mov	x19, x0
Lloh5:
	adrp	x8, _AccessExclusiveLock@GOTPAGE
Lloh6:
	ldr	x8, [x8, _AccessExclusiveLock@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	str	xzr, [sp, #32]
	movi.2d	v0, #0000000000000000
	stp	q0, q0, [sp]
	add	x2, sp, #56
	mov	x0, x21
	mov	x3, #0
	mov	x4, #0
	mov	x5, #0
	mov	x6, #0
	mov	x7, #0
	bl	_get_db_info
Lloh8:
	adrp	x24, _ERROR@GOTPAGE
Lloh9:
	ldr	x24, [x24, _ERROR@GOTPAGEOFF]
	cbnz	w0, LBB0_2
; %bb.1:
	ldr	w22, [x24]
Lloh10:
	adrp	x8, _ERRCODE_UNDEFINED_DATABASE@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ERRCODE_UNDEFINED_DATABASE@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x8]
	bl	_errcode
	str	x21, [sp]
Lloh13:
	adrp	x0, l_.str@PAGE
Lloh14:
	add	x0, x0, l_.str@PAGEOFF
	bl	_errmsg
	mov	x1, x0
	mov	x0, x22
	bl	_ereport
LBB0_2:
	ldr	x22, [sp, #56]
	bl	_GetUserId
	mov	x1, x0
	mov	x0, x22
	bl	_pg_database_ownercheck
	cbz	w0, LBB0_13
; %bb.3:
	bl	_have_createdb_privilege
	cbz	w0, LBB0_14
LBB0_4:
	mov	x0, x20
	mov	w1, #1
	bl	_get_database_oid
	bl	_OidIsValid
	cbz	x0, LBB0_6
; %bb.5:
	ldr	w22, [x24]
Lloh15:
	adrp	x8, _ERRCODE_DUPLICATE_DATABASE@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ERRCODE_DUPLICATE_DATABASE@GOTPAGEOFF]
Lloh17:
	ldr	w0, [x8]
	bl	_errcode
	str	x20, [sp]
Lloh18:
	adrp	x0, l_.str.2@PAGE
Lloh19:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_errmsg
	mov	x1, x0
	mov	x0, x22
	bl	_ereport
LBB0_6:
	ldr	x0, [sp, #56]
Lloh20:
	adrp	x8, _MyDatabaseId@GOTPAGE
Lloh21:
	ldr	x8, [x8, _MyDatabaseId@GOTPAGEOFF]
Lloh22:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_8
; %bb.7:
	ldr	w22, [x24]
Lloh23:
	adrp	x8, _ERRCODE_FEATURE_NOT_SUPPORTED@GOTPAGE
Lloh24:
	ldr	x8, [x8, _ERRCODE_FEATURE_NOT_SUPPORTED@GOTPAGEOFF]
Lloh25:
	ldr	w0, [x8]
	bl	_errcode
Lloh26:
	adrp	x0, l_.str.3@PAGE
Lloh27:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_errmsg
	mov	x1, x0
	mov	x0, x22
	bl	_ereport
	ldr	x0, [sp, #56]
LBB0_8:
	add	x1, sp, #52
	add	x2, sp, #48
	bl	_CountOtherDBBackends
	cbz	x0, LBB0_10
; %bb.9:
	ldr	w22, [x24]
Lloh28:
	adrp	x8, _ERRCODE_OBJECT_IN_USE@GOTPAGE
Lloh29:
	ldr	x8, [x8, _ERRCODE_OBJECT_IN_USE@GOTPAGEOFF]
Lloh30:
	ldr	w0, [x8]
	bl	_errcode
	str	x21, [sp]
Lloh31:
	adrp	x0, l_.str.4@PAGE
Lloh32:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_errmsg
	ldp	w1, w0, [sp, #48]
	bl	_errdetail_busy_db
	mov	x1, x0
	mov	x0, x22
	bl	_ereport
LBB0_10:
Lloh33:
	adrp	x8, _DATABASEOID@GOTPAGE
Lloh34:
	ldr	x8, [x8, _DATABASEOID@GOTPAGEOFF]
Lloh35:
	ldr	w21, [x8]
	ldr	x0, [sp, #56]
	bl	_ObjectIdGetDatum
	mov	x1, x0
	mov	x0, x21
	bl	_SearchSysCacheCopy1
	mov	x21, x0
	bl	_HeapTupleIsValid
	cbnz	w0, LBB0_12
; %bb.11:
	ldr	w0, [x24]
	ldr	x8, [sp, #56]
	str	x8, [sp]
Lloh36:
	adrp	x1, l_.str.5@PAGE
Lloh37:
	add	x1, x1, l_.str.5@PAGEOFF
	bl	_elog
LBB0_12:
	mov	x0, x21
	bl	_GETSTRUCT
	mov	x1, x20
	bl	_namestrcpy
	mov	x0, x19
	mov	x1, x21
	mov	x2, x21
	bl	_CatalogTupleUpdate
	ldr	w0, [x23]
	ldr	x1, [sp, #56]
	mov	w2, #0
	bl	_InvokeObjectPostAlterHook
	ldr	w1, [x23]
	ldr	x2, [sp, #56]
	bl	_ObjectAddressSet
Lloh38:
	adrp	x8, _NoLock@GOTPAGE
Lloh39:
	ldr	x8, [x8, _NoLock@GOTPAGEOFF]
Lloh40:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_table_close
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_13:
Lloh41:
	adrp	x8, _ACLCHECK_NOT_OWNER@GOTPAGE
Lloh42:
	ldr	x8, [x8, _ACLCHECK_NOT_OWNER@GOTPAGEOFF]
Lloh43:
	ldr	w0, [x8]
Lloh44:
	adrp	x8, _OBJECT_DATABASE@GOTPAGE
Lloh45:
	ldr	x8, [x8, _OBJECT_DATABASE@GOTPAGEOFF]
Lloh46:
	ldr	w1, [x8]
	mov	x2, x21
	bl	_aclcheck_error
	bl	_have_createdb_privilege
	cbnz	w0, LBB0_4
LBB0_14:
	ldr	w22, [x24]
Lloh47:
	adrp	x8, _ERRCODE_INSUFFICIENT_PRIVILEGE@GOTPAGE
Lloh48:
	ldr	x8, [x8, _ERRCODE_INSUFFICIENT_PRIVILEGE@GOTPAGEOFF]
Lloh49:
	ldr	w0, [x8]
	bl	_errcode
Lloh50:
	adrp	x0, l_.str.1@PAGE
Lloh51:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_errmsg
	mov	x1, x0
	mov	x0, x22
	bl	_ereport
	b	LBB0_4
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpAdd	Lloh50, Lloh51
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.cfi_endproc
                                        ; -- End function
	.comm	_DatabaseRelationId,4,2         ; @DatabaseRelationId
	.comm	_RowExclusiveLock,4,2           ; @RowExclusiveLock
	.comm	_AccessExclusiveLock,4,2        ; @AccessExclusiveLock
	.comm	_ERROR,4,2                      ; @ERROR
	.comm	_ERRCODE_UNDEFINED_DATABASE,4,2 ; @ERRCODE_UNDEFINED_DATABASE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"database \"%s\" does not exist"

	.comm	_ACLCHECK_NOT_OWNER,4,2         ; @ACLCHECK_NOT_OWNER
	.comm	_OBJECT_DATABASE,4,2            ; @OBJECT_DATABASE
	.comm	_ERRCODE_INSUFFICIENT_PRIVILEGE,4,2 ; @ERRCODE_INSUFFICIENT_PRIVILEGE
l_.str.1:                               ; @.str.1
	.asciz	"permission denied to rename database"

	.comm	_ERRCODE_DUPLICATE_DATABASE,4,2 ; @ERRCODE_DUPLICATE_DATABASE
l_.str.2:                               ; @.str.2
	.asciz	"database \"%s\" already exists"

	.comm	_MyDatabaseId,8,3               ; @MyDatabaseId
	.comm	_ERRCODE_FEATURE_NOT_SUPPORTED,4,2 ; @ERRCODE_FEATURE_NOT_SUPPORTED
l_.str.3:                               ; @.str.3
	.asciz	"current database cannot be renamed"

	.comm	_ERRCODE_OBJECT_IN_USE,4,2      ; @ERRCODE_OBJECT_IN_USE
l_.str.4:                               ; @.str.4
	.asciz	"database \"%s\" is being accessed by other users"

	.comm	_DATABASEOID,4,2                ; @DATABASEOID
l_.str.5:                               ; @.str.5
	.asciz	"cache lookup failed for database %u"

	.comm	_NoLock,4,2                     ; @NoLock
	.comm	_WARNING,4,2                    ; @WARNING
.subsections_via_symbols
