	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_AddWaitEventToSet              ## -- Begin function AddWaitEventToSet
	.p2align	4, 0x90
_AddWaitEventToSet:                     ## @AddWaitEventToSet
	.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	%r8, %r12
	movq	%rcx, %r14
	movq	%rdx, %r13
	movl	%esi, %r15d
	movq	%rdi, %rbx
	movq	(%rdi), %rax
	xorl	%edi, %edi
	cmpq	8(%rbx), %rax
	setb	%dil
	callq	_Assert
	movq	_WL_EXIT_ON_PM_DEATH@GOTPCREL(%rip), %rax
	cmpl	%r15d, (%rax)
	jne	LBB0_2
## %bb.1:
	movq	_WL_POSTMASTER_DEATH@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movl	$1, 16(%rbx)
LBB0_2:
	testq	%r14, %r14
	je	LBB0_9
## %bb.3:
	movq	(%r14), %rax
	movq	_MyProcPid@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_5
## %bb.4:
	movq	_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_elog
LBB0_5:
	cmpq	$0, 24(%rbx)
	je	LBB0_7
## %bb.6:
	movq	_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_elog
LBB0_7:
	movq	_WL_LATCH_SET@GOTPCREL(%rip), %rax
	movl	%r15d, %ecx
	notl	%ecx
	testl	%ecx, (%rax)
	je	LBB0_12
## %bb.8:
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_11
LBB0_9:
	movq	_WL_LATCH_SET@GOTPCREL(%rip), %rax
	testl	%r15d, (%rax)
	je	LBB0_12
## %bb.10:
	leaq	L_.str.3(%rip), %rsi
LBB0_11:
	movq	_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_elog
LBB0_12:
	movq	_PGINVALID_SOCKET@GOTPCREL(%rip), %rax
	cmpq	%r13, (%rax)
	jne	LBB0_15
## %bb.13:
	movq	_WL_SOCKET_MASK@GOTPCREL(%rip), %rax
	testl	%r15d, (%rax)
	je	LBB0_15
## %bb.14:
	movq	_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.4(%rip), %rsi
	callq	_elog
LBB0_15:
	movq	(%rbx), %rax
	movq	32(%rbx), %rcx
	leaq	1(%rax), %rdx
	movq	%rdx, (%rbx)
	movq	%rax, %rdx
	shlq	$5, %rdx
	movl	%eax, (%rcx,%rdx)
	movq	%r13, 16(%rcx,%rdx)
	movl	%r15d, 4(%rcx,%rdx)
	movq	%r12, 24(%rcx,%rdx)
	movq	_WL_LATCH_SET@GOTPCREL(%rip), %rsi
	cmpl	(%rsi), %r15d
	jne	LBB0_17
## %bb.16:
	movq	%r14, 24(%rbx)
	movl	%eax, 20(%rbx)
	movq	_selfpipe_readfd@GOTPCREL(%rip), %rsi
	jmp	LBB0_19
LBB0_17:
	movq	_WL_POSTMASTER_DEATH@GOTPCREL(%rip), %rsi
	cmpl	(%rsi), %r15d
	jne	LBB0_20
## %bb.18:
	movq	_postmaster_alive_fds@GOTPCREL(%rip), %rdi
	movq	_POSTMASTER_FD_WATCH@GOTPCREL(%rip), %rsi
	movq	(%rsi), %rsi
	shlq	$3, %rsi
	addq	(%rdi), %rsi
LBB0_19:
	addq	%rdx, %rcx
	addq	$16, %rcx
	movq	(%rsi), %rdx
	movq	%rdx, (%rcx)
LBB0_20:
                                        ## kill: def $eax killed $eax killed $rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_WL_EXIT_ON_PM_DEATH,4,2        ## @WL_EXIT_ON_PM_DEATH
	.comm	_WL_POSTMASTER_DEATH,4,2        ## @WL_POSTMASTER_DEATH
	.comm	_MyProcPid,8,3                  ## @MyProcPid
	.comm	_ERROR,4,2                      ## @ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"cannot wait on a latch owned by another process"

L_.str.1:                               ## @.str.1
	.asciz	"cannot wait on more than one latch"

	.comm	_WL_LATCH_SET,4,2               ## @WL_LATCH_SET
L_.str.2:                               ## @.str.2
	.asciz	"latch events only support being set"

L_.str.3:                               ## @.str.3
	.asciz	"cannot wait on latch without a specified latch"

	.comm	_PGINVALID_SOCKET,8,3           ## @PGINVALID_SOCKET
	.comm	_WL_SOCKET_MASK,4,2             ## @WL_SOCKET_MASK
L_.str.4:                               ## @.str.4
	.asciz	"cannot wait on socket event without a socket"

	.comm	_selfpipe_readfd,8,3            ## @selfpipe_readfd
	.comm	_postmaster_alive_fds,8,3       ## @postmaster_alive_fds
	.comm	_POSTMASTER_FD_WATCH,8,3        ## @POSTMASTER_FD_WATCH
	.comm	_EPOLL_CTL_ADD,4,2              ## @EPOLL_CTL_ADD
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_AddWaitEventToSet              ; -- Begin function AddWaitEventToSet
	.p2align	2
_AddWaitEventToSet:                     ; @AddWaitEventToSet
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x22, x4
	mov	x19, x3
	mov	x23, x2
	mov	x21, x1
	mov	x20, x0
	ldp	x8, x9, [x0]
	cmp	x8, x9
	cset	w0, lo
	bl	_Assert
Lloh0:
	adrp	x8, _WL_EXIT_ON_PM_DEATH@GOTPAGE
Lloh1:
	ldr	x8, [x8, _WL_EXIT_ON_PM_DEATH@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x24, _WL_POSTMASTER_DEATH@GOTPAGE
Lloh4:
	ldr	x24, [x24, _WL_POSTMASTER_DEATH@GOTPAGEOFF]
	cmp	w8, w21
	b.ne	LBB0_2
; %bb.1:
	ldr	w21, [x24]
	mov	w8, #1
	str	w8, [x20, #16]
LBB0_2:
Lloh5:
	adrp	x26, _ERROR@GOTPAGE
Lloh6:
	ldr	x26, [x26, _ERROR@GOTPAGEOFF]
Lloh7:
	adrp	x25, _WL_LATCH_SET@GOTPAGE
Lloh8:
	ldr	x25, [x25, _WL_LATCH_SET@GOTPAGEOFF]
	cbz	x19, LBB0_9
; %bb.3:
	ldr	x8, [x19]
Lloh9:
	adrp	x9, _MyProcPid@GOTPAGE
Lloh10:
	ldr	x9, [x9, _MyProcPid@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_5
; %bb.4:
	ldr	w0, [x26]
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	bl	_elog
LBB0_5:
	ldr	x8, [x20, #24]
	cbz	x8, LBB0_7
; %bb.6:
	ldr	w0, [x26]
Lloh14:
	adrp	x1, l_.str.1@PAGE
Lloh15:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_elog
LBB0_7:
	ldr	w8, [x25]
	bics	wzr, w8, w21
	b.eq	LBB0_12
; %bb.8:
Lloh16:
	adrp	x1, l_.str.2@PAGE
Lloh17:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_11
LBB0_9:
	ldr	w8, [x25]
	tst	w8, w21
	b.eq	LBB0_12
; %bb.10:
Lloh18:
	adrp	x1, l_.str.3@PAGE
Lloh19:
	add	x1, x1, l_.str.3@PAGEOFF
LBB0_11:
	ldr	w0, [x26]
	bl	_elog
LBB0_12:
Lloh20:
	adrp	x8, _PGINVALID_SOCKET@GOTPAGE
Lloh21:
	ldr	x8, [x8, _PGINVALID_SOCKET@GOTPAGEOFF]
Lloh22:
	ldr	x8, [x8]
	cmp	x8, x23
	b.ne	LBB0_15
; %bb.13:
Lloh23:
	adrp	x8, _WL_SOCKET_MASK@GOTPAGE
Lloh24:
	ldr	x8, [x8, _WL_SOCKET_MASK@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	tst	w8, w21
	b.eq	LBB0_15
; %bb.14:
	ldr	w0, [x26]
Lloh26:
	adrp	x1, l_.str.4@PAGE
Lloh27:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_elog
LBB0_15:
	ldr	x8, [x20, #32]
	ldr	x0, [x20]
	add	x9, x0, #1
	str	x9, [x20]
	add	x8, x8, x0, lsl #5
	stp	w0, w21, [x8]
	str	x22, [x8, #24]
	str	x23, [x8, #16]!
	ldr	w9, [x25]
	cmp	w21, w9
	b.ne	LBB0_17
; %bb.16:
	str	x19, [x20, #24]
	str	w0, [x20, #20]
Lloh28:
	adrp	x9, _selfpipe_readfd@GOTPAGE
Lloh29:
	ldr	x9, [x9, _selfpipe_readfd@GOTPAGEOFF]
	b	LBB0_19
LBB0_17:
	ldr	w9, [x24]
	cmp	w21, w9
	b.ne	LBB0_20
; %bb.18:
Lloh30:
	adrp	x9, _postmaster_alive_fds@GOTPAGE
Lloh31:
	ldr	x9, [x9, _postmaster_alive_fds@GOTPAGEOFF]
Lloh32:
	ldr	x9, [x9]
Lloh33:
	adrp	x10, _POSTMASTER_FD_WATCH@GOTPAGE
Lloh34:
	ldr	x10, [x10, _POSTMASTER_FD_WATCH@GOTPAGEOFF]
Lloh35:
	ldr	x10, [x10]
	add	x9, x9, x10, lsl #3
LBB0_19:
	ldr	x9, [x9]
	str	x9, [x8]
LBB0_20:
                                        ; kill: def $w0 killed $w0 killed $x0
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.comm	_WL_EXIT_ON_PM_DEATH,4,2        ; @WL_EXIT_ON_PM_DEATH
	.comm	_WL_POSTMASTER_DEATH,4,2        ; @WL_POSTMASTER_DEATH
	.comm	_MyProcPid,8,3                  ; @MyProcPid
	.comm	_ERROR,4,2                      ; @ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"cannot wait on a latch owned by another process"

l_.str.1:                               ; @.str.1
	.asciz	"cannot wait on more than one latch"

	.comm	_WL_LATCH_SET,4,2               ; @WL_LATCH_SET
l_.str.2:                               ; @.str.2
	.asciz	"latch events only support being set"

l_.str.3:                               ; @.str.3
	.asciz	"cannot wait on latch without a specified latch"

	.comm	_PGINVALID_SOCKET,8,3           ; @PGINVALID_SOCKET
	.comm	_WL_SOCKET_MASK,4,2             ; @WL_SOCKET_MASK
l_.str.4:                               ; @.str.4
	.asciz	"cannot wait on socket event without a socket"

	.comm	_selfpipe_readfd,8,3            ; @selfpipe_readfd
	.comm	_postmaster_alive_fds,8,3       ; @postmaster_alive_fds
	.comm	_POSTMASTER_FD_WATCH,8,3        ; @POSTMASTER_FD_WATCH
	.comm	_EPOLL_CTL_ADD,4,2              ; @EPOLL_CTL_ADD
.subsections_via_symbols
