	.file	"extr_dbcommands.c_AlterDatabaseOwner.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"database \"%s\" does not exist"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC1:
	.string	"permission denied to change owner of database"
	.text
	.p2align 4
	.globl	AlterDatabaseOwner
	.type	AlterDatabaseOwner, @function
AlterDatabaseOwner:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r15
	push	r14
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	mov	r14d, esi
	push	r13
	push	r12
	push	rbx
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	mov	rbx, rdi
	sub	rsp, 88
	mov	QWORD PTR -80[rbp], rdi
	mov	esi, DWORD PTR RowExclusiveLock[rip]
	mov	edi, DWORD PTR DatabaseRelationId[rip]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -56[rbp], rax
	xor	eax, eax
	call	table_open@PLT
	mov	rdi, rbx
	lea	rbx, -64[rbp]
	mov	r12d, eax
	call	CStringGetDatum@PLT
	mov	ecx, DWORD PTR F_NAMEEQ[rip]
	mov	edx, DWORD PTR BTEqualStrategyNumber[rip]
	mov	rdi, rbx
	mov	esi, DWORD PTR Anum_pg_database_datname[rip]
	mov	r8d, eax
	call	ScanKeyInit@PLT
	mov	esi, DWORD PTR DatabaseNameIndexId[rip]
	xor	ecx, ecx
	mov	r9, rbx
	mov	r8d, 1
	mov	edx, 1
	mov	edi, r12d
	call	systable_beginscan@PLT
	mov	edi, eax
	mov	r15d, eax
	call	systable_getnext@PLT
	mov	rdi, rax
	mov	r13, rax
	call	HeapTupleIsValid@PLT
	test	eax, eax
	je	.L28
.L2:
	mov	rdi, r13
	call	GETSTRUCT@PLT
	mov	ebx, DWORD PTR 4[rax]
	mov	r8, rax
	cmp	DWORD PTR [rax], r14d
	jne	.L29
.L3:
	mov	edi, DWORD PTR DatabaseRelationId[rip]
	xor	edx, edx
	mov	esi, ebx
	call	InvokeObjectPostAlterHook@PLT
	mov	esi, DWORD PTR DatabaseRelationId[rip]
	mov	edx, ebx
	xor	edi, edi
	call	ObjectAddressSet@PLT
	mov	edi, r15d
	call	systable_endscan@PLT
	mov	esi, DWORD PTR NoLock[rip]
	mov	edi, r12d
	call	table_close@PLT
	mov	rax, QWORD PTR -56[rbp]
	xor	rax, QWORD PTR fs:40
	jne	.L30
	lea	rsp, -40[rbp]
	xor	edi, edi
	pop	rbx
	mov	eax, edi
	pop	r12
	pop	r13
	pop	r14
	pop	r15
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L29:
	.cfi_restore_state
	movsx	rax, DWORD PTR Natts_pg_database[rip]
	mov	rsi, rsp
	mov	QWORD PTR -104[rbp], rsp
	mov	DWORD PTR -108[rbp], eax
	lea	rax, 15[0+rax*4]
	mov	rcx, rax
	mov	rdx, rax
	and	rcx, -4096
	and	rdx, -16
	sub	rsi, rcx
	mov	rcx, rsi
	cmp	rsp, rcx
	je	.L5
.L31:
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	cmp	rsp, rcx
	jne	.L31
.L5:
	and	edx, 4095
	sub	rsp, rdx
	test	rdx, rdx
	je	.L6
	or	QWORD PTR -8[rsp+rdx], 0
.L6:
	mov	rcx, rax
	mov	rsi, rsp
	mov	rdx, rax
	mov	QWORD PTR -88[rbp], rsp
	and	rcx, -4096
	and	rdx, -16
	sub	rsi, rcx
	mov	rcx, rsi
	cmp	rsp, rcx
	je	.L8
.L32:
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	cmp	rsp, rcx
	jne	.L32
.L8:
	and	edx, 4095
	sub	rsp, rdx
	test	rdx, rdx
	je	.L9
	or	QWORD PTR -8[rsp+rdx], 0
.L9:
	mov	rdx, rax
	mov	rcx, rsp
	and	rax, -4096
	mov	QWORD PTR -96[rbp], rsp
	sub	rcx, rax
	and	rdx, -16
	mov	rax, rcx
	cmp	rsp, rax
	je	.L11
.L33:
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	cmp	rsp, rax
	jne	.L33
.L11:
	and	edx, 4095
	sub	rsp, rdx
	test	rdx, rdx
	je	.L12
	or	QWORD PTR -8[rsp+rdx], 0
.L12:
	xor	eax, eax
	mov	QWORD PTR -120[rbp], r8
	mov	QWORD PTR -72[rbp], rsp
	call	GetUserId@PLT
	mov	edi, ebx
	mov	esi, eax
	call	pg_database_ownercheck@PLT
	mov	r8, QWORD PTR -120[rbp]
	test	eax, eax
	jne	.L13
	mov	rdx, QWORD PTR -80[rbp]
	mov	esi, DWORD PTR OBJECT_DATABASE[rip]
	mov	edi, DWORD PTR ACLCHECK_NOT_OWNER[rip]
	call	aclcheck_error@PLT
	mov	r8, QWORD PTR -120[rbp]
.L13:
	xor	eax, eax
	mov	QWORD PTR -80[rbp], r8
	call	GetUserId@PLT
	mov	esi, r14d
	mov	edi, eax
	call	check_is_member_of_role@PLT
	xor	eax, eax
	call	have_createdb_privilege@PLT
	mov	r8, QWORD PTR -80[rbp]
	test	eax, eax
	je	.L34
.L14:
	mov	edx, DWORD PTR -108[rbp]
	mov	rdi, QWORD PTR -96[rbp]
	xor	esi, esi
	mov	QWORD PTR -120[rbp], r8
	sal	edx, 2
	mov	DWORD PTR -80[rbp], edx
	call	memset@PLT
	mov	edx, DWORD PTR -80[rbp]
	mov	rdi, QWORD PTR -72[rbp]
	xor	esi, esi
	call	memset@PLT
	mov	ecx, DWORD PTR Anum_pg_database_datdba[rip]
	mov	rax, QWORD PTR -72[rbp]
	mov	edi, r14d
	lea	edx, -1[rcx]
	movsx	rdx, edx
	mov	DWORD PTR [rax+rdx*4], 1
	mov	QWORD PTR -80[rbp], rdx
	call	ObjectIdGetDatum@PLT
	mov	rcx, QWORD PTR -88[rbp]
	mov	rdx, QWORD PTR -80[rbp]
	mov	edi, r12d
	mov	DWORD PTR [rcx+rdx*4], eax
	call	RelationGetDescr@PLT
	mov	esi, DWORD PTR Anum_pg_database_datacl[rip]
	lea	rcx, -60[rbp]
	mov	rdi, r13
	mov	edx, eax
	call	heap_getattr@PLT
	mov	edx, DWORD PTR -60[rbp]
	mov	r8, QWORD PTR -120[rbp]
	test	edx, edx
	je	.L35
.L15:
	mov	edi, r12d
	call	RelationGetDescr@PLT
	mov	r8, QWORD PTR -72[rbp]
	mov	rcx, QWORD PTR -96[rbp]
	mov	rdi, r13
	mov	rdx, QWORD PTR -88[rbp]
	mov	esi, eax
	call	heap_modify_tuple@PLT
	mov	edi, r12d
	mov	rdx, rax
	mov	rsi, rax
	mov	r13, rax
	call	CatalogTupleUpdate@PLT
	mov	rdi, r13
	call	heap_freetuple@PLT
	mov	edi, DWORD PTR DatabaseRelationId[rip]
	mov	edx, r14d
	mov	esi, ebx
	call	changeDependencyOnOwner@PLT
	mov	rsp, QWORD PTR -104[rbp]
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L28:
	mov	edi, DWORD PTR ERRCODE_UNDEFINED_DATABASE[rip]
	call	errcode@PLT
	mov	rsi, QWORD PTR -80[rbp]
	lea	rdi, .LC0[rip]
	xor	eax, eax
	call	errmsg@PLT
	mov	edi, DWORD PTR ERROR[rip]
	mov	esi, eax
	call	ereport@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L34:
	mov	edi, DWORD PTR ERRCODE_INSUFFICIENT_PRIVILEGE[rip]
	call	errcode@PLT
	lea	rdi, .LC1[rip]
	xor	eax, eax
	call	errmsg@PLT
	mov	edi, DWORD PTR ERROR[rip]
	mov	esi, eax
	call	ereport@PLT
	mov	r8, QWORD PTR -80[rbp]
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L35:
	mov	esi, DWORD PTR [r8]
	mov	edi, eax
	mov	DWORD PTR -80[rbp], esi
	call	DatumGetAclP@PLT
	mov	esi, DWORD PTR -80[rbp]
	mov	edx, r14d
	mov	edi, eax
	call	aclnewowner@PLT
	mov	rdi, rax
	mov	eax, DWORD PTR Anum_pg_database_datacl[rip]
	lea	edx, -1[rax]
	mov	rax, QWORD PTR -72[rbp]
	movsx	rdx, edx
	mov	DWORD PTR [rax+rdx*4], 1
	mov	QWORD PTR -80[rbp], rdx
	call	PointerGetDatum@PLT
	mov	rcx, QWORD PTR -88[rbp]
	mov	rdx, QWORD PTR -80[rbp]
	mov	DWORD PTR [rcx+rdx*4], eax
	jmp	.L15
.L30:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	AlterDatabaseOwner, .-AlterDatabaseOwner
	.comm	RowExclusiveLock,4,4
	.comm	OBJECT_DATABASE,4,4
	.comm	NoLock,4,4
	.comm	Natts_pg_database,4,4
	.comm	F_NAMEEQ,4,4
	.comm	ERROR,4,4
	.comm	ERRCODE_UNDEFINED_DATABASE,4,4
	.comm	ERRCODE_INSUFFICIENT_PRIVILEGE,4,4
	.comm	DatabaseRelationId,4,4
	.comm	DatabaseNameIndexId,4,4
	.comm	BTEqualStrategyNumber,4,4
	.comm	Anum_pg_database_datname,4,4
	.comm	Anum_pg_database_datdba,4,4
	.comm	Anum_pg_database_datacl,4,4
	.comm	ACLCHECK_NOT_OWNER,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_dbcommands.c_AlterDatabaseOwner.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"database \"%s\" does not exist\000"
	.align	2
.LC1:
	.ascii	"permission denied to change owner of database\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC2:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	AlterDatabaseOwner
	.syntax unified
	.arm
	.fpu softvfp
	.type	AlterDatabaseOwner, %function
AlterDatabaseOwner:
	@ args = 0, pretend = 0, frame = 40
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	add	fp, sp, #32
	sub	sp, sp, #52
	ldr	r3, .L16
	ldr	r8, .L16+4
	mov	r5, r1
	ldr	r1, [r3]
	ldr	r3, .L16+8
	mov	r7, r0
	ldr	r0, [r8]
	ldr	r3, [r3]
	str	r3, [fp, #-40]
	mov	r3,#0
	bl	table_open
	ldr	r3, .L16+12
	ldr	r1, .L16+16
	ldr	r2, .L16+20
	ldr	r3, [r3]
	mov	r4, r0
	mov	r0, r7
	ldr	r9, [r1]
	ldr	r10, [r2]
	str	r3, [fp, #-56]
	bl	CStringGetDatum
	sub	r6, fp, #48
	ldr	r3, [fp, #-56]
	mov	r2, r10
	mov	r1, r9
	str	r0, [sp]
	mov	r0, r6
	bl	ScanKeyInit
	mov	r2, #1
	ldr	r3, .L16+24
	mov	r0, r4
	ldr	r1, [r3]
	stm	sp, {r2, r6}
	mov	r3, #0
	bl	systable_beginscan
	str	r0, [fp, #-60]
	bl	systable_getnext
	mov	r6, r0
	bl	HeapTupleIsValid
	cmp	r0, #0
	beq	.L10
.L2:
	mov	r0, r6
	bl	GETSTRUCT
	ldm	r0, {r3, r9}
	cmp	r3, r5
	str	r0, [fp, #-72]
	bne	.L11
.L3:
	mov	r2, #0
	mov	r1, r9
	ldr	r0, [r8]
	bl	InvokeObjectPostAlterHook
	mov	r2, r9
	ldr	r1, [r8]
	mov	r0, #0
	bl	ObjectAddressSet
	ldr	r0, [fp, #-60]
	bl	systable_endscan
	ldr	r3, .L16+28
	mov	r0, r4
	ldr	r1, [r3]
	bl	table_close
	ldr	r3, .L16+8
	ldr	r2, [r3]
	ldr	r3, [fp, #-40]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L12
	mov	r0, #0
	sub	sp, fp, #32
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L11:
	ldr	r3, .L16+32
	str	sp, [fp, #-76]
	ldr	r10, [r3]
	lsl	r10, r10, #2
	add	r3, r10, #7
	bic	r3, r3, #7
	sub	sp, sp, r3
	add	r2, sp, #8
	sub	sp, sp, r3
	str	r2, [fp, #-64]
	add	r2, sp, #8
	sub	sp, sp, r3
	str	r2, [fp, #-68]
	bl	GetUserId
	mov	r1, r0
	mov	r0, r9
	bl	pg_database_ownercheck
	add	r3, sp, #8
	cmp	r0, #0
	str	r3, [fp, #-56]
	beq	.L13
.L4:
	bl	GetUserId
	mov	r1, r5
	bl	check_is_member_of_role
	bl	have_createdb_privilege
	cmp	r0, #0
	beq	.L14
.L5:
	mov	r2, r10
	mov	r1, #0
	ldr	r0, [fp, #-68]
	bl	memset
	mov	r1, #0
	mov	r2, r10
	ldr	r0, [fp, #-56]
	bl	memset
	mov	r2, #1
	ldr	r3, .L16+36
	mov	r0, r5
	ldr	r10, [r3]
	ldr	r3, [fp, #-56]
	sub	r10, r10, #1
	str	r2, [r3, r10, lsl #2]
	bl	ObjectIdGetDatum
	mov	r3, r0
	ldr	r2, [fp, #-64]
	ldr	r7, .L16+40
	str	r3, [r2, r10, lsl #2]
	mov	r0, r4
	ldr	r10, [r7]
	bl	RelationGetDescr
	sub	r3, fp, #44
	mov	r2, r0
	mov	r1, r10
	mov	r0, r6
	bl	heap_getattr
	ldr	r3, [fp, #-44]
	cmp	r3, #0
	beq	.L15
.L6:
	mov	r0, r4
	bl	RelationGetDescr
	ldr	r3, [fp, #-56]
	mov	r1, r0
	str	r3, [sp]
	ldr	r3, [fp, #-68]
	mov	r0, r6
	ldr	r2, [fp, #-64]
	bl	heap_modify_tuple
	mov	r6, r0
	mov	r0, r4
	mov	r2, r6
	mov	r1, r6
	bl	CatalogTupleUpdate
	mov	r0, r6
	bl	heap_freetuple
	mov	r2, r5
	mov	r1, r9
	ldr	r0, [r8]
	bl	changeDependencyOnOwner
	ldr	sp, [fp, #-76]
	b	.L3
.L10:
	ldr	r2, .L16+44
	ldr	r3, .L16+48
	ldr	r0, [r2]
	ldr	r9, [r3]
	bl	errcode
	mov	r1, r7
	ldr	r0, .L16+52
	bl	errmsg
	mov	r1, r0
	mov	r0, r9
	bl	ereport
	b	.L2
.L13:
	ldr	r3, .L16+56
	ldr	r1, .L16+60
	mov	r2, r7
	ldr	r1, [r1]
	ldr	r0, [r3]
	bl	aclcheck_error
	b	.L4
.L15:
	bl	DatumGetAclP
	ldr	r3, [fp, #-72]
	mov	r2, r5
	ldr	r1, [r3]
	bl	aclnewowner
	mov	r2, #1
	ldr	r7, [r7]
	ldr	r3, [fp, #-56]
	sub	r7, r7, #1
	str	r2, [r3, r7, lsl #2]
	bl	PointerGetDatum
	ldr	r3, [fp, #-64]
	str	r0, [r3, r7, lsl #2]
	b	.L6
.L14:
	ldr	r2, .L16+64
	ldr	r3, .L16+48
	ldr	r0, [r2]
	ldr	r7, [r3]
	bl	errcode
	ldr	r0, .L16+68
	bl	errmsg
	mov	r1, r0
	mov	r0, r7
	bl	ereport
	b	.L5
.L12:
	bl	__stack_chk_fail
.L17:
	.align	2
.L16:
	.word	RowExclusiveLock
	.word	DatabaseRelationId
	.word	.LC2
	.word	F_NAMEEQ
	.word	Anum_pg_database_datname
	.word	BTEqualStrategyNumber
	.word	DatabaseNameIndexId
	.word	NoLock
	.word	Natts_pg_database
	.word	Anum_pg_database_datdba
	.word	Anum_pg_database_datacl
	.word	ERRCODE_UNDEFINED_DATABASE
	.word	ERROR
	.word	.LC0
	.word	ACLCHECK_NOT_OWNER
	.word	OBJECT_DATABASE
	.word	ERRCODE_INSUFFICIENT_PRIVILEGE
	.word	.LC1
	.size	AlterDatabaseOwner, .-AlterDatabaseOwner
	.comm	RowExclusiveLock,4,4
	.comm	OBJECT_DATABASE,4,4
	.comm	NoLock,4,4
	.comm	Natts_pg_database,4,4
	.comm	F_NAMEEQ,4,4
	.comm	ERROR,4,4
	.comm	ERRCODE_UNDEFINED_DATABASE,4,4
	.comm	ERRCODE_INSUFFICIENT_PRIVILEGE,4,4
	.comm	DatabaseRelationId,4,4
	.comm	DatabaseNameIndexId,4,4
	.comm	BTEqualStrategyNumber,4,4
	.comm	Anum_pg_database_datname,4,4
	.comm	Anum_pg_database_datdba,4,4
	.comm	Anum_pg_database_datacl,4,4
	.comm	ACLCHECK_NOT_OWNER,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
