	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function BackgroundWorkerStateChange
LCPI0_0:
	.space	16
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_BackgroundWorkerStateChange
	.p2align	4, 0x90
_BackgroundWorkerStateChange:           ## @BackgroundWorkerStateChange
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_max_worker_processes@GOTPCREL(%rip), %rax
	movslq	(%rax), %rdx
	movq	_BackgroundWorkerData@GOTPCREL(%rip), %r12
	movq	(%r12), %rax
	movl	(%rax), %ecx
	cmpl	%ecx, %edx
	jne	LBB0_23
## %bb.1:
	testl	%edx, %edx
	jle	LBB0_22
## %bb.2:
	xorl	%r15d, %r15d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%rax), %r14
	cmpl	$0, (%r14,%r15)
	je	LBB0_20
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	xorl	%eax, %eax
	callq	_pg_read_barrier
	movl	%ebx, %edi
	callq	_FindRegisteredWorkerBySlotNumber
	movq	56(%r14,%r15), %rcx
	testq	%rax, %rax
	je	LBB0_9
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	testq	%rcx, %rcx
	je	LBB0_20
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	cmpl	$0, (%rax)
	jne	LBB0_20
## %bb.7:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	$1, (%rax)
	movq	8(%rax), %rdi
	testq	%rdi, %rdi
	je	LBB0_19
## %bb.8:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	_SIGTERM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_kill
	jmp	LBB0_20
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_3 Depth=1
	testq	%rcx, %rcx
	je	LBB0_14
## %bb.10:                              ##   in Loop: Header=BB0_3 Depth=1
	movl	4(%r14,%r15), %r13d
	movq	_BGWORKER_CLASS_PARALLEL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 8(%r14,%r15)
	je	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	(%r12), %rax
	incl	4(%rax)
LBB0_12:                                ##   in Loop: Header=BB0_3 Depth=1
	xorl	%eax, %eax
	callq	_pg_memory_barrier
	movq	$0, 48(%r14,%r15)
	movl	$0, (%r14,%r15)
	testl	%r13d, %r13d
	je	LBB0_20
## %bb.13:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	_SIGUSR1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r13d, %edi
	callq	_kill
	jmp	LBB0_20
LBB0_14:                                ##   in Loop: Header=BB0_3 Depth=1
	movl	$88, %edi
	callq	_malloc
	testq	%rax, %rax
	je	LBB0_18
## %bb.15:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	%rax, %r13
	movl	32(%rax), %edi
	movl	40(%r14,%r15), %esi
	movq	_BGW_MAXLEN@GOTPCREL(%rip), %r12
	movl	(%r12), %edx
	callq	_ascii_safe_strlcpy
	movl	60(%r13), %edi
	movl	36(%r14,%r15), %esi
	movl	(%r12), %edx
	callq	_ascii_safe_strlcpy
	movl	56(%r13), %edi
	movl	32(%r14,%r15), %esi
	movl	(%r12), %edx
	callq	_ascii_safe_strlcpy
	movl	52(%r13), %edi
	movl	28(%r14,%r15), %esi
	movl	(%r12), %edx
	callq	_ascii_safe_strlcpy
	movl	8(%r14,%r15), %eax
	movl	%eax, 24(%r13)
	movl	24(%r14,%r15), %eax
	movl	%eax, 48(%r13)
	movl	20(%r14,%r15), %eax
	movl	%eax, 44(%r13)
	movl	16(%r14,%r15), %eax
	movl	%eax, 40(%r13)
	movl	36(%r13), %edi
	movl	12(%r14,%r15), %esi
	movq	_BGW_EXTRALEN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_memcpy
	movl	4(%r14,%r15), %edi
	movl	%edi, 28(%r13)
	callq	_PostmasterMarkPIDForWorkerNotify
	testl	%eax, %eax
	jne	LBB0_17
## %bb.16:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	_DEBUG1@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movslq	28(%r13), %rdx
	leaq	L_.str.2(%rip), %rsi
	xorl	%eax, %eax
	callq	_elog
	movl	$0, 28(%r13)
LBB0_17:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	$0, 8(%r13)
	xorps	%xmm0, %xmm0
	movups	%xmm0, 64(%r13)
	movq	$0, 80(%r13)
	movl	%ebx, 16(%r13)
	movl	$0, (%r13)
	movq	_DEBUG1@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movl	32(%r13), %esi
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_errmsg
	movl	%r14d, %edi
	movl	%eax, %esi
	callq	_ereport
	addq	$20, %r13
	movq	_BackgroundWorkerList@GOTPCREL(%rip), %rdi
	movq	%r13, %rsi
	callq	_slist_push_head
	movq	_BackgroundWorkerData@GOTPCREL(%rip), %r12
	jmp	LBB0_20
LBB0_19:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	%rax, %rdi
	callq	_ReportBackgroundWorkerPID
	.p2align	4, 0x90
LBB0_20:                                ##   in Loop: Header=BB0_3 Depth=1
	incq	%rbx
	movq	_max_worker_processes@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	cmpq	%rax, %rbx
	jge	LBB0_22
## %bb.21:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	(%r12), %rax
	addq	$64, %r15
	jmp	LBB0_3
LBB0_23:
	movq	_LOG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_elog                           ## TAILCALL
LBB0_22:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_18:
	movq	_LOG@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_ERRCODE_OUT_OF_MEMORY@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
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ereport                        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_max_worker_processes,4,2       ## @max_worker_processes
	.comm	_BackgroundWorkerData,8,3       ## @BackgroundWorkerData
	.comm	_LOG,4,2                        ## @LOG
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"inconsistent background worker state (max_worker_processes=%d, total_slots=%d"

	.comm	_SIGTERM,4,2                    ## @SIGTERM
	.comm	_BGWORKER_CLASS_PARALLEL,4,2    ## @BGWORKER_CLASS_PARALLEL
	.comm	_SIGUSR1,4,2                    ## @SIGUSR1
	.comm	_ERRCODE_OUT_OF_MEMORY,4,2      ## @ERRCODE_OUT_OF_MEMORY
L_.str.1:                               ## @.str.1
	.asciz	"out of memory"

	.comm	_BGW_MAXLEN,4,2                 ## @BGW_MAXLEN
	.comm	_BGW_EXTRALEN,4,2               ## @BGW_EXTRALEN
	.comm	_DEBUG1,4,2                     ## @DEBUG1
L_.str.2:                               ## @.str.2
	.asciz	"worker notification PID %lu is not valid"

L_.str.3:                               ## @.str.3
	.asciz	"registering background worker \"%s\""

	.comm	_BackgroundWorkerList,4,2       ## @BackgroundWorkerList
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_BackgroundWorkerStateChange    ; -- Begin function BackgroundWorkerStateChange
	.p2align	2
_BackgroundWorkerStateChange:           ; @BackgroundWorkerStateChange
	.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
Lloh0:
	adrp	x25, _max_worker_processes@GOTPAGE
Lloh1:
	ldr	x25, [x25, _max_worker_processes@GOTPAGEOFF]
	ldrsw	x2, [x25]
Lloh2:
	adrp	x26, _BackgroundWorkerData@GOTPAGE
Lloh3:
	ldr	x26, [x26, _BackgroundWorkerData@GOTPAGEOFF]
	ldr	x8, [x26]
	ldr	w9, [x8]
	cmp	w2, w9
	b.ne	LBB0_21
; %bb.1:
	cmp	w2, #1
	b.lt	LBB0_22
; %bb.2:
	mov	x19, #0
Lloh4:
	adrp	x27, _BGW_MAXLEN@GOTPAGE
Lloh5:
	ldr	x27, [x27, _BGW_MAXLEN@GOTPAGEOFF]
Lloh6:
	adrp	x20, _DEBUG1@GOTPAGE
Lloh7:
	ldr	x20, [x20, _DEBUG1@GOTPAGEOFF]
	mov	w28, #56
Lloh8:
	adrp	x21, _BGWORKER_CLASS_PARALLEL@GOTPAGE
Lloh9:
	ldr	x21, [x21, _BGWORKER_CLASS_PARALLEL@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x22, [x8, #8]
	add	x24, x22, x28
	ldur	w8, [x24, #-56]
	cbz	w8, LBB0_19
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	bl	_pg_read_barrier
	mov	x0, x19
	bl	_FindRegisteredWorkerBySlotNumber
	ldr	x8, [x22, x28]
	cbz	x0, LBB0_9
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	cbz	x8, LBB0_19
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [x0]
	cbnz	w8, LBB0_19
; %bb.7:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	w8, #1
	str	w8, [x0]
	ldr	x8, [x0, #8]
	cbz	x8, LBB0_18
; %bb.8:                                ;   in Loop: Header=BB0_3 Depth=1
Lloh10:
	adrp	x9, _SIGTERM@GOTPAGE
Lloh11:
	ldr	x9, [x9, _SIGTERM@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x9]
	mov	x0, x8
	bl	_kill
	b	LBB0_19
LBB0_9:                                 ;   in Loop: Header=BB0_3 Depth=1
	cbz	x8, LBB0_14
; %bb.10:                               ;   in Loop: Header=BB0_3 Depth=1
	add	x22, x22, x28
	ldp	w23, w8, [x22, #-52]
	ldr	w9, [x21]
	tst	w9, w8
	b.eq	LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x26]
	ldr	w9, [x8, #4]
	add	w9, w9, #1
	str	w9, [x8, #4]
LBB0_12:                                ;   in Loop: Header=BB0_3 Depth=1
	bl	_pg_memory_barrier
	stur	xzr, [x22, #-8]
	stur	wzr, [x24, #-56]
	cbz	w23, LBB0_19
; %bb.13:                               ;   in Loop: Header=BB0_3 Depth=1
Lloh13:
	adrp	x8, _SIGUSR1@GOTPAGE
Lloh14:
	ldr	x8, [x8, _SIGUSR1@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	mov	x0, x23
	bl	_kill
	b	LBB0_19
LBB0_14:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	w0, #88
	bl	_malloc
	cbz	x0, LBB0_23
; %bb.15:                               ;   in Loop: Header=BB0_3 Depth=1
	mov	x23, x0
	ldr	w0, [x0, #32]
	add	x22, x22, x28
	ldur	w1, [x22, #-16]
	ldr	w2, [x27]
	bl	_ascii_safe_strlcpy
	ldr	w0, [x23, #60]
	ldur	w1, [x22, #-20]
	ldr	w2, [x27]
	bl	_ascii_safe_strlcpy
	ldr	w0, [x23, #56]
	ldur	w1, [x22, #-24]
	ldr	w2, [x27]
	bl	_ascii_safe_strlcpy
	ldr	w0, [x23, #52]
	ldur	w1, [x22, #-28]
	ldr	w2, [x27]
	bl	_ascii_safe_strlcpy
	ldur	w8, [x22, #-48]
	str	w8, [x23, #24]
	ldur	w8, [x22, #-32]
	str	w8, [x23, #48]
	ldur	d0, [x22, #-40]
	str	d0, [x23, #40]
	ldr	w0, [x23, #36]
	ldur	w1, [x22, #-44]
Lloh16:
	adrp	x8, _BGW_EXTRALEN@GOTPAGE
Lloh17:
	ldr	x8, [x8, _BGW_EXTRALEN@GOTPAGEOFF]
Lloh18:
	ldr	w2, [x8]
	bl	_memcpy
	ldur	w0, [x22, #-52]
	str	w0, [x23, #28]
	bl	_PostmasterMarkPIDForWorkerNotify
	cbnz	w0, LBB0_17
; %bb.16:                               ;   in Loop: Header=BB0_3 Depth=1
	ldr	w0, [x20]
	ldrsw	x2, [x23, #28]
Lloh19:
	adrp	x1, l_.str.2@PAGE
Lloh20:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_elog
	str	wzr, [x23, #28]
LBB0_17:                                ;   in Loop: Header=BB0_3 Depth=1
	str	xzr, [x23, #8]
	stp	xzr, xzr, [x23, #72]
	str	xzr, [x23, #64]
	str	w19, [x23, #16]
	str	wzr, [x23]
	ldr	w24, [x20]
	ldr	w8, [x23, #32]
	str	x8, [sp]
Lloh21:
	adrp	x0, l_.str.3@PAGE
Lloh22:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_errmsg
	mov	x1, x0
	mov	x0, x24
	bl	_ereport
	add	x1, x23, #20
Lloh23:
	adrp	x0, _BackgroundWorkerList@GOTPAGE
Lloh24:
	ldr	x0, [x0, _BackgroundWorkerList@GOTPAGEOFF]
	bl	_slist_push_head
	b	LBB0_19
LBB0_18:                                ;   in Loop: Header=BB0_3 Depth=1
	bl	_ReportBackgroundWorkerPID
LBB0_19:                                ;   in Loop: Header=BB0_3 Depth=1
	add	x19, x19, #1
	ldrsw	x8, [x25]
	cmp	x19, x8
	b.ge	LBB0_22
; %bb.20:                               ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x26]
	add	x28, x28, #64
	b	LBB0_3
LBB0_21:
Lloh25:
	adrp	x8, _LOG@GOTPAGE
Lloh26:
	ldr	x8, [x8, _LOG@GOTPAGEOFF]
Lloh27:
	ldr	w0, [x8]
	str	x9, [sp]
Lloh28:
	adrp	x1, l_.str@PAGE
Lloh29:
	add	x1, x1, l_.str@PAGEOFF
	bl	_elog
LBB0_22:
	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_23:
Lloh30:
	adrp	x8, _LOG@GOTPAGE
Lloh31:
	ldr	x8, [x8, _LOG@GOTPAGEOFF]
Lloh32:
	ldr	w19, [x8]
Lloh33:
	adrp	x8, _ERRCODE_OUT_OF_MEMORY@GOTPAGE
Lloh34:
	ldr	x8, [x8, _ERRCODE_OUT_OF_MEMORY@GOTPAGEOFF]
Lloh35:
	ldr	w0, [x8]
	bl	_errcode
Lloh36:
	adrp	x0, l_.str.1@PAGE
Lloh37:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_errmsg
	mov	x1, x0
	mov	x0, x19
	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
	b	_ereport
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.comm	_max_worker_processes,4,2       ; @max_worker_processes
	.comm	_BackgroundWorkerData,8,3       ; @BackgroundWorkerData
	.comm	_LOG,4,2                        ; @LOG
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"inconsistent background worker state (max_worker_processes=%d, total_slots=%d"

	.comm	_SIGTERM,4,2                    ; @SIGTERM
	.comm	_BGWORKER_CLASS_PARALLEL,4,2    ; @BGWORKER_CLASS_PARALLEL
	.comm	_SIGUSR1,4,2                    ; @SIGUSR1
	.comm	_ERRCODE_OUT_OF_MEMORY,4,2      ; @ERRCODE_OUT_OF_MEMORY
l_.str.1:                               ; @.str.1
	.asciz	"out of memory"

	.comm	_BGW_MAXLEN,4,2                 ; @BGW_MAXLEN
	.comm	_BGW_EXTRALEN,4,2               ; @BGW_EXTRALEN
	.comm	_DEBUG1,4,2                     ; @DEBUG1
l_.str.2:                               ; @.str.2
	.asciz	"worker notification PID %lu is not valid"

l_.str.3:                               ; @.str.3
	.asciz	"registering background worker \"%s\""

	.comm	_BackgroundWorkerList,4,2       ; @BackgroundWorkerList
.subsections_via_symbols
