	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_test_shm_mq_main               ## -- Begin function test_shm_mq_main
	.p2align	4, 0x90
_test_shm_mq_main:                      ## @test_shm_mq_main
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %ebx
	movq	_SIGTERM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_handle_sigterm@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_pqsignal
	xorl	%eax, %eax
	callq	_BackgroundWorkerUnblockSignals
	movl	%ebx, %edi
	callq	_DatumGetInt32
	movl	%eax, %edi
	callq	_dsm_attach
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_2
## %bb.1:
	movq	_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	_ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_errcode
	leaq	L_.str(%rip), %rdi
	callq	_errmsg
	movl	%r14d, %edi
	movl	%eax, %esi
	callq	_ereport
LBB0_2:
	movq	_PG_TEST_SHM_MQ_MAGIC@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_dsm_segment_address
	movl	%r14d, %edi
	movl	%eax, %esi
	callq	_shm_toc_attach
	movq	%rax, %r15
	testq	%rax, %rax
	jne	LBB0_4
## %bb.3:
	movq	_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_errcode
	leaq	L_.str.1(%rip), %rdi
	callq	_errmsg
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_ereport
LBB0_4:
	movq	%r15, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_shm_toc_lookup
	movq	%rax, %rbx
	leaq	8(%rax), %r12
	movq	%r12, %rdi
	callq	_SpinLockAcquire
	movl	(%rbx), %r14d
	leal	1(%r14), %r13d
	movl	%r13d, (%rbx)
	movq	%r12, %rdi
	callq	_SpinLockRelease
	cmpl	4(%rbx), %r14d
	jl	LBB0_6
## %bb.5:
	movq	_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	_ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_errcode
	leaq	L_.str.2(%rip), %rdi
	callq	_errmsg
	movl	%r14d, %edi
	movl	%eax, %esi
	callq	_ereport
LBB0_6:
	leaq	-64(%rbp), %rcx
	leaq	-56(%rbp), %r8
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	movq	%r15, %rsi
	movl	%r13d, %edx
	callq	_attach_to_queues
	movq	%r12, %rdi
	callq	_SpinLockAcquire
	incl	12(%rbx)
	movq	%r12, %rdi
	callq	_SpinLockRelease
	movq	_MyBgworkerEntry@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rax), %edi
	callq	_BackendPidGetProc
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_8
## %bb.7:
	movq	_DEBUG1@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.3(%rip), %rsi
	callq	_elog
	movl	$1, %edi
	callq	_proc_exit
LBB0_8:
	movq	%rbx, %rdi
	callq	_SetLatch
	movq	-64(%rbp), %rdi
	movq	-56(%rbp), %rsi
	callq	_copy_messages
	movq	%r14, %rdi
	callq	_dsm_detach
	movl	$1, %edi
	callq	_proc_exit
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SIGTERM,4,2                    ## @SIGTERM
	.comm	_handle_sigterm,4,2             ## @handle_sigterm
	.comm	_ERROR,4,2                      ## @ERROR
	.comm	_ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE,4,2 ## @ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"unable to map dynamic shared memory segment"

	.comm	_PG_TEST_SHM_MQ_MAGIC,4,2       ## @PG_TEST_SHM_MQ_MAGIC
L_.str.1:                               ## @.str.1
	.asciz	"bad magic number in dynamic shared memory segment"

L_.str.2:                               ## @.str.2
	.asciz	"too many message queue testing workers already"

	.comm	_MyBgworkerEntry,8,3            ## @MyBgworkerEntry
	.comm	_DEBUG1,4,2                     ## @DEBUG1
L_.str.3:                               ## @.str.3
	.asciz	"registrant backend has exited prematurely"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_test_shm_mq_main               ; -- Begin function test_shm_mq_main
	.p2align	2
_test_shm_mq_main:                      ; @test_shm_mq_main
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x19, x0
Lloh0:
	adrp	x8, _SIGTERM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SIGTERM@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x8, _handle_sigterm@GOTPAGE
Lloh4:
	ldr	x8, [x8, _handle_sigterm@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_pqsignal
	bl	_BackgroundWorkerUnblockSignals
	mov	x0, x19
	bl	_DatumGetInt32
	bl	_dsm_attach
	mov	x19, x0
	cbnz	x0, LBB0_2
; %bb.1:
Lloh6:
	adrp	x8, _ERROR@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ERROR@GOTPAGEOFF]
Lloh8:
	ldr	w20, [x8]
Lloh9:
	adrp	x8, _ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
	bl	_errcode
Lloh12:
	adrp	x0, l_.str@PAGE
Lloh13:
	add	x0, x0, l_.str@PAGEOFF
	bl	_errmsg
	mov	x1, x0
	mov	x0, x20
	bl	_ereport
LBB0_2:
Lloh14:
	adrp	x8, _PG_TEST_SHM_MQ_MAGIC@GOTPAGE
Lloh15:
	ldr	x8, [x8, _PG_TEST_SHM_MQ_MAGIC@GOTPAGEOFF]
Lloh16:
	ldr	w20, [x8]
	mov	x0, x19
	bl	_dsm_segment_address
	mov	x1, x0
	mov	x0, x20
	bl	_shm_toc_attach
	mov	x20, x0
	cbnz	x0, LBB0_4
; %bb.3:
Lloh17:
	adrp	x8, _ERROR@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ERROR@GOTPAGEOFF]
Lloh19:
	ldr	w21, [x8]
Lloh20:
	adrp	x8, _ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE@GOTPAGE
Lloh21:
	ldr	x8, [x8, _ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE@GOTPAGEOFF]
Lloh22:
	ldr	w0, [x8]
	bl	_errcode
Lloh23:
	adrp	x0, l_.str.1@PAGE
Lloh24:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_errmsg
	mov	x1, x0
	mov	x0, x21
	bl	_ereport
LBB0_4:
	mov	x0, x20
	mov	w1, #0
	mov	w2, #0
	bl	_shm_toc_lookup
	mov	x21, x0
	add	x22, x0, #8
	mov	x0, x22
	bl	_SpinLockAcquire
	ldr	w24, [x21]
	add	w23, w24, #1
	str	w23, [x21]
	mov	x0, x22
	bl	_SpinLockRelease
	ldr	w8, [x21, #4]
	cmp	w24, w8
	b.lt	LBB0_6
; %bb.5:
Lloh25:
	adrp	x8, _ERROR@GOTPAGE
Lloh26:
	ldr	x8, [x8, _ERROR@GOTPAGEOFF]
Lloh27:
	ldr	w24, [x8]
Lloh28:
	adrp	x8, _ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE@GOTPAGE
Lloh29:
	ldr	x8, [x8, _ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE@GOTPAGEOFF]
Lloh30:
	ldr	w0, [x8]
	bl	_errcode
Lloh31:
	adrp	x0, l_.str.2@PAGE
Lloh32:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_errmsg
	mov	x1, x0
	mov	x0, x24
	bl	_ereport
LBB0_6:
	add	x3, sp, #8
	mov	x4, sp
	mov	x0, x19
	mov	x1, x20
	mov	x2, x23
	bl	_attach_to_queues
	mov	x0, x22
	bl	_SpinLockAcquire
	ldr	w8, [x21, #12]
	add	w8, w8, #1
	str	w8, [x21, #12]
	mov	x0, x22
	bl	_SpinLockRelease
Lloh33:
	adrp	x8, _MyBgworkerEntry@GOTPAGE
Lloh34:
	ldr	x8, [x8, _MyBgworkerEntry@GOTPAGEOFF]
Lloh35:
	ldr	x8, [x8]
	ldr	w0, [x8]
	bl	_BackendPidGetProc
	mov	x20, x0
	cbnz	x0, LBB0_8
; %bb.7:
Lloh36:
	adrp	x8, _DEBUG1@GOTPAGE
Lloh37:
	ldr	x8, [x8, _DEBUG1@GOTPAGEOFF]
Lloh38:
	ldr	w0, [x8]
Lloh39:
	adrp	x1, l_.str.3@PAGE
Lloh40:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_elog
	mov	w0, #1
	bl	_proc_exit
LBB0_8:
	mov	x0, x20
	bl	_SetLatch
	ldp	x1, x0, [sp]
	bl	_copy_messages
	mov	x0, x19
	bl	_dsm_detach
	mov	w0, #1
	bl	_proc_exit
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpAdd	Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.cfi_endproc
                                        ; -- End function
	.comm	_SIGTERM,4,2                    ; @SIGTERM
	.comm	_handle_sigterm,4,2             ; @handle_sigterm
	.comm	_ERROR,4,2                      ; @ERROR
	.comm	_ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE,4,2 ; @ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"unable to map dynamic shared memory segment"

	.comm	_PG_TEST_SHM_MQ_MAGIC,4,2       ; @PG_TEST_SHM_MQ_MAGIC
l_.str.1:                               ; @.str.1
	.asciz	"bad magic number in dynamic shared memory segment"

l_.str.2:                               ; @.str.2
	.asciz	"too many message queue testing workers already"

	.comm	_MyBgworkerEntry,8,3            ; @MyBgworkerEntry
	.comm	_DEBUG1,4,2                     ; @DEBUG1
l_.str.3:                               ; @.str.3
	.asciz	"registrant backend has exited prematurely"

.subsections_via_symbols
