	.file	"extr_master_create_shards.c_CreateShardsWithRoundRobinPolicy.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"table \"%s\" has already had shards created for it"
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"shard_count must be positive"
	.section	.rodata.str1.8
	.align 8
.LC2:
	.string	"replication_factor must be positive"
	.align 8
.LC3:
	.string	"using replication factor %d with the streaming replication model is not supported"
	.align 8
.LC4:
	.string	"The table %s is marked as streaming replicated and the shard replication factor of streaming replicated tables must be 1."
	.section	.rodata.str1.1
.LC5:
	.string	"Use replication factor 1."
	.section	.rodata.str1.8
	.align 8
.LC6:
	.string	"replication_factor (%d) exceeds number of worker nodes (%d)"
	.align 8
.LC7:
	.string	"Add more worker nodes or try again with a lower replication factor."
	.text
	.p2align 4
	.globl	CreateShardsWithRoundRobinPolicy
	.type	CreateShardsWithRoundRobinPolicy, @function
CreateShardsWithRoundRobinPolicy:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13d, edx
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12d, edi
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 72
	.cfi_def_cfa_offset 128
	mov	DWORD PTR 60[rsp], ecx
	mov	DWORD PTR 24[rsp], esi
	call	DistributedTableCacheEntry@PLT
	mov	edi, r12d
	mov	rbp, QWORD PTR NIL[rip]
	mov	rbx, rax
	call	CheckHashPartitionedTable@PLT
	mov	edi, r12d
	call	EnsureTableOwner@PLT
	mov	esi, DWORD PTR ExclusiveLock[rip]
	mov	edi, r12d
	call	LockRelationOid@PLT
	mov	edi, r12d
	call	LoadShardList@PLT
	cmp	QWORD PTR NIL[rip], rax
	je	.L2
	mov	edi, r12d
	call	get_rel_name@PLT
	mov	edi, DWORD PTR ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE[rip]
	mov	r14, rax
	call	errcode@PLT
	mov	rsi, r14
	lea	rdi, .LC0[rip]
	xor	eax, eax
	call	errmsg@PLT
	mov	edi, DWORD PTR ERROR[rip]
	mov	esi, eax
	call	ereport@PLT
.L2:
	mov	eax, DWORD PTR 24[rsp]
	test	eax, eax
	jle	.L20
.L3:
	test	r13d, r13d
	jle	.L21
	mov	rax, QWORD PTR REPLICATION_MODEL_STREAMING[rip]
	cmp	QWORD PTR [rbx], rax
	jne	.L5
	cmp	r13d, 1
	jg	.L22
.L5:
	mov	eax, DWORD PTR HASH_TOKEN_COUNT[rip]
	mov	r14d, DWORD PTR RowShareLock[rip]
	cdq
	idiv	DWORD PTR 24[rsp]
	mov	DWORD PTR 28[rsp], eax
	xor	eax, eax
	call	DistNodeRelationId@PLT
	mov	esi, r14d
	mov	edi, eax
	call	LockRelationOid@PLT
	mov	edi, DWORD PTR NoLock[rip]
	call	DistributedTablePlacementNodeList@PLT
	mov	esi, DWORD PTR CompareWorkerNodes[rip]
	mov	rdi, rax
	call	SortList@PLT
	mov	rdi, rax
	mov	QWORD PTR 32[rsp], rax
	call	list_length@PLT
	mov	DWORD PTR 40[rsp], eax
	cmp	r13d, eax
	jg	.L23
.L6:
	mov	edi, r12d
	call	ShardStorageType@PLT
	mov	ebx, DWORD PTR 24[rsp]
	test	ebx, ebx
	jle	.L7
	mov	edx, DWORD PTR 28[rsp]
	movsx	eax, al
	mov	DWORD PTR 56[rsp], r13d
	xor	r14d, r14d
	mov	DWORD PTR 44[rsp], eax
	mov	r13, rbp
	sub	edx, 1
	mov	DWORD PTR 48[rsp], edx
	lea	edx, -1[rbx]
	xor	ebx, ebx
	mov	DWORD PTR 52[rsp], edx
	.p2align 4,,10
	.p2align 3
.L10:
	mov	eax, ebx
	mov	edi, DWORD PTR INT32_MIN[rip]
	cdq
	idiv	DWORD PTR 40[rsp]
	add	edi, r14d
	xor	eax, eax
	mov	DWORD PTR [rsp], edi
	mov	DWORD PTR 20[rsp], edx
	call	GetNextShardId@PLT
	mov	edi, DWORD PTR [rsp]
	cmp	DWORD PTR 52[rsp], ebx
	mov	r15d, eax
	mov	eax, DWORD PTR 48[rsp]
	lea	r8d, [rdi+rax]
	cmove	r8d, DWORD PTR INT32_MAX[rip]
	add	ebx, 1
	mov	ebp, r8d
	call	IntegerToText@PLT
	mov	edi, ebp
	mov	QWORD PTR 8[rsp], rax
	call	IntegerToText@PLT
	mov	esi, DWORD PTR ExclusiveLock[rip]
	mov	edi, r15d
	mov	QWORD PTR [rsp], rax
	call	LockShardDistributionMetadata@PLT
	mov	r8, QWORD PTR [rsp]
	mov	edx, DWORD PTR 44[rsp]
	mov	esi, r15d
	mov	rcx, QWORD PTR 8[rsp]
	mov	edi, r12d
	call	InsertShardRow@PLT
	mov	r11d, DWORD PTR 20[rsp]
	mov	esi, r15d
	mov	edi, r12d
	mov	r8d, DWORD PTR 56[rsp]
	mov	rdx, QWORD PTR 32[rsp]
	mov	ecx, r11d
	call	InsertShardPlacementRows@PLT
	mov	rdi, r13
	mov	rsi, rax
	call	list_concat@PLT
	add	r14d, DWORD PTR 28[rsp]
	mov	r13, rax
	cmp	DWORD PTR 24[rsp], ebx
	jne	.L10
	mov	rbp, rax
.L7:
	mov	edx, DWORD PTR 60[rsp]
	add	rsp, 72
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	rsi, rbp
	mov	edi, r12d
	pop	rbx
	.cfi_def_cfa_offset 48
	xor	ecx, ecx
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	jmp	CreateShardsOnWorkers@PLT
	.p2align 4,,10
	.p2align 3
.L23:
	.cfi_restore_state
	mov	edi, DWORD PTR ERRCODE_INVALID_PARAMETER_VALUE[rip]
	call	errcode@PLT
	mov	edx, DWORD PTR 40[rsp]
	mov	esi, r13d
	xor	eax, eax
	lea	rdi, .LC6[rip]
	call	errmsg@PLT
	lea	rdi, .LC7[rip]
	call	errhint@PLT
	mov	edi, DWORD PTR ERROR[rip]
	mov	esi, eax
	call	ereport@PLT
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L21:
	mov	edi, DWORD PTR ERRCODE_INVALID_PARAMETER_VALUE[rip]
	call	errcode@PLT
	lea	rdi, .LC2[rip]
	xor	eax, eax
	call	errmsg@PLT
	mov	edi, DWORD PTR ERROR[rip]
	mov	esi, eax
	call	ereport@PLT
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L20:
	mov	edi, DWORD PTR ERRCODE_INVALID_PARAMETER_VALUE[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
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L22:
	mov	edi, DWORD PTR 8[rbx]
	call	get_rel_name@PLT
	mov	edi, DWORD PTR ERRCODE_INVALID_PARAMETER_VALUE[rip]
	mov	r14, rax
	call	errcode@PLT
	mov	esi, r13d
	lea	rdi, .LC3[rip]
	xor	eax, eax
	call	errmsg@PLT
	mov	rsi, r14
	lea	rdi, .LC4[rip]
	call	errdetail@PLT
	lea	rdi, .LC5[rip]
	call	errhint@PLT
	mov	edi, DWORD PTR ERROR[rip]
	mov	esi, eax
	call	ereport@PLT
	jmp	.L5
	.cfi_endproc
.LFE0:
	.size	CreateShardsWithRoundRobinPolicy, .-CreateShardsWithRoundRobinPolicy
	.comm	RowShareLock,4,4
	.comm	REPLICATION_MODEL_STREAMING,8,8
	.comm	NoLock,4,4
	.comm	NIL,8,8
	.comm	INT32_MIN,4,4
	.comm	INT32_MAX,4,4
	.comm	HASH_TOKEN_COUNT,4,4
	.comm	ExclusiveLock,4,4
	.comm	ERROR,4,4
	.comm	ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE,4,4
	.comm	ERRCODE_INVALID_PARAMETER_VALUE,4,4
	.comm	CompareWorkerNodes,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_master_create_shards.c_CreateShardsWithRoundRobinPolicy.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"table \"%s\" has already had shards created for it\000"
	.align	2
.LC1:
	.ascii	"shard_count must be positive\000"
	.align	2
.LC2:
	.ascii	"replication_factor must be positive\000"
	.align	2
.LC3:
	.ascii	"using replication factor %d with the streaming repl"
	.ascii	"ication model is not supported\000"
	.align	2
.LC4:
	.ascii	"The table %s is marked as streaming replicated and "
	.ascii	"the shard replication factor of streaming replicate"
	.ascii	"d tables must be 1.\000"
	.align	2
.LC5:
	.ascii	"Use replication factor 1.\000"
	.global	__aeabi_idiv
	.align	2
.LC6:
	.ascii	"replication_factor (%d) exceeds number of worker no"
	.ascii	"des (%d)\000"
	.align	2
.LC7:
	.ascii	"Add more worker nodes or try again with a lower rep"
	.ascii	"lication factor.\000"
	.global	__aeabi_idivmod
	.text
	.align	2
	.global	CreateShardsWithRoundRobinPolicy
	.syntax unified
	.arm
	.fpu softvfp
	.type	CreateShardsWithRoundRobinPolicy, %function
CreateShardsWithRoundRobinPolicy:
	@ args = 0, pretend = 0, frame = 40
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	sub	sp, sp, #52
	mov	r9, r0
	str	r2, [sp, #12]
	str	r1, [sp, #16]
	str	r3, [sp, #44]
	bl	DistributedTableCacheEntry
	ldr	r5, .L21
	mov	r4, r0
	mov	r0, r9
	ldr	r6, [r5]
	bl	CheckHashPartitionedTable
	mov	r0, r9
	bl	EnsureTableOwner
	ldr	r3, .L21+4
	mov	r0, r9
	ldr	r1, [r3]
	bl	LockRelationOid
	mov	r0, r9
	bl	LoadShardList
	ldr	r3, [r5]
	cmp	r3, r0
	beq	.L2
	mov	r0, r9
	bl	get_rel_name
	mov	r5, r0
	ldr	r2, .L21+8
	ldr	r3, .L21+12
	ldr	r0, [r2]
	ldr	r7, [r3]
	bl	errcode
	mov	r1, r5
	ldr	r0, .L21+16
	bl	errmsg
	mov	r1, r0
	mov	r0, r7
	bl	ereport
.L2:
	ldr	r3, [sp, #16]
	cmp	r3, #0
	ble	.L17
.L3:
	ldr	r3, [sp, #12]
	cmp	r3, #0
	ble	.L18
	ldr	r2, .L21+20
	ldr	r3, [r4]
	ldr	r2, [r2]
	ldr	r1, [sp, #12]
	sub	r3, r3, r2
	clz	r3, r3
	cmp	r1, #1
	lsr	r3, r3, #5
	movle	r3, #0
	cmp	r3, #0
	bne	.L19
.L5:
	ldr	r3, .L21+24
	ldr	r1, [sp, #16]
	ldr	r0, [r3]
	bl	__aeabi_idiv
	str	r0, [sp, #20]
	bl	DistNodeRelationId
	ldr	r3, .L21+28
	ldr	r1, [r3]
	bl	LockRelationOid
	ldr	r3, .L21+32
	ldr	r0, [r3]
	bl	DistributedTablePlacementNodeList
	ldr	r3, .L21+36
	ldr	r1, [r3]
	bl	SortList
	str	r0, [sp, #24]
	bl	list_length
	ldr	r3, [sp, #12]
	mov	r10, r0
	cmp	r3, r0
	bgt	.L20
.L6:
	mov	r0, r9
	bl	ShardStorageType
	ldr	r3, [sp, #16]
	str	r0, [sp, #28]
	cmp	r3, #0
	ble	.L7
	mov	r8, #0
	mov	r5, r8
	ldr	r2, [sp, #20]
	sub	r3, r3, #1
	sub	r2, r2, #1
	ldr	fp, .L21+40
	str	r2, [sp, #40]
	str	r3, [sp, #32]
	str	r10, [sp, #36]
.L10:
	mov	r0, r5
	ldr	r1, [sp, #36]
	bl	__aeabi_idivmod
	ldr	r3, [fp]
	mov	r7, r1
	add	r3, r8, r3
	str	r3, [sp, #8]
	bl	GetNextShardId
	ldr	r3, [sp, #32]
	mov	r4, r0
	cmp	r3, r5
	ldr	r3, [sp, #8]
	ldrne	r2, [sp, #40]
	ldreq	r2, .L21+44
	mov	r0, r3
	addne	r10, r3, r2
	ldreq	r10, [r2]
	bl	IntegerToText
	mov	r3, r0
	mov	r0, r10
	str	r3, [sp, #8]
	bl	IntegerToText
	mov	r10, r0
	ldr	r3, .L21+4
	mov	r0, r4
	ldr	r1, [r3]
	bl	LockShardDistributionMetadata
	mov	r1, r4
	ldr	r3, [sp, #8]
	ldr	r2, [sp, #28]
	mov	r0, r9
	str	r10, [sp]
	bl	InsertShardRow
	ldr	r3, [sp, #12]
	mov	r1, r4
	ldr	r2, [sp, #24]
	str	r3, [sp]
	mov	r0, r9
	mov	r3, r7
	bl	InsertShardPlacementRows
	mov	r1, r0
	mov	r0, r6
	bl	list_concat
	ldr	r3, [sp, #16]
	add	r5, r5, #1
	cmp	r3, r5
	ldr	r3, [sp, #20]
	mov	r6, r0
	add	r8, r8, r3
	bne	.L10
.L7:
	mov	r1, r6
	mov	r0, r9
	mov	r3, #0
	ldr	r2, [sp, #44]
	add	sp, sp, #52
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	b	CreateShardsOnWorkers
.L20:
	ldr	r2, .L21+48
	ldr	r3, .L21+12
	ldr	r0, [r2]
	ldr	r4, [r3]
	bl	errcode
	ldr	r1, [sp, #12]
	mov	r2, r10
	ldr	r0, .L21+52
	bl	errmsg
	ldr	r0, .L21+56
	bl	errhint
	mov	r1, r0
	mov	r0, r4
	bl	ereport
	b	.L6
.L18:
	ldr	r2, .L21+48
	ldr	r3, .L21+12
	ldr	r0, [r2]
	ldr	r4, [r3]
	bl	errcode
	ldr	r0, .L21+60
	bl	errmsg
	mov	r1, r0
	mov	r0, r4
	bl	ereport
	b	.L5
.L17:
	ldr	r2, .L21+48
	ldr	r3, .L21+12
	ldr	r0, [r2]
	ldr	r5, [r3]
	bl	errcode
	ldr	r0, .L21+64
	bl	errmsg
	mov	r1, r0
	mov	r0, r5
	bl	ereport
	b	.L3
.L19:
	ldr	r0, [r4, #4]
	bl	get_rel_name
	mov	r4, r0
	ldr	r2, .L21+48
	ldr	r3, .L21+12
	ldr	r0, [r2]
	ldr	r5, [r3]
	bl	errcode
	ldr	r1, [sp, #12]
	ldr	r0, .L21+68
	bl	errmsg
	mov	r1, r4
	ldr	r0, .L21+72
	bl	errdetail
	ldr	r0, .L21+76
	bl	errhint
	mov	r1, r0
	mov	r0, r5
	bl	ereport
	b	.L5
.L22:
	.align	2
.L21:
	.word	NIL
	.word	ExclusiveLock
	.word	ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE
	.word	ERROR
	.word	.LC0
	.word	REPLICATION_MODEL_STREAMING
	.word	HASH_TOKEN_COUNT
	.word	RowShareLock
	.word	NoLock
	.word	CompareWorkerNodes
	.word	INT32_MIN
	.word	INT32_MAX
	.word	ERRCODE_INVALID_PARAMETER_VALUE
	.word	.LC6
	.word	.LC7
	.word	.LC2
	.word	.LC1
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.size	CreateShardsWithRoundRobinPolicy, .-CreateShardsWithRoundRobinPolicy
	.comm	RowShareLock,4,4
	.comm	REPLICATION_MODEL_STREAMING,4,4
	.comm	NoLock,4,4
	.comm	NIL,4,4
	.comm	INT32_MIN,4,4
	.comm	INT32_MAX,4,4
	.comm	HASH_TOKEN_COUNT,4,4
	.comm	ExclusiveLock,4,4
	.comm	ERROR,4,4
	.comm	ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE,4,4
	.comm	ERRCODE_INVALID_PARAMETER_VALUE,4,4
	.comm	CompareWorkerNodes,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
