	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function CheckForStandbyTrigger
_CheckForStandbyTrigger:                ## @CheckForStandbyTrigger
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	$1, %r14d
	cmpb	$0, _CheckForStandbyTrigger.triggered(%rip)
	jne	LBB0_13
## %bb.1:
	xorl	%eax, %eax
	callq	_IsPromoteTriggered
	testq	%rax, %rax
	je	LBB0_5
## %bb.2:
	movq	_PROMOTE_SIGNAL_FILE@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdi
	leaq	-32(%rbp), %rsi
	callq	_stat
	testq	%rax, %rax
	je	LBB0_10
## %bb.3:
	movq	_FALLBACK_PROMOTE_SIGNAL_FILE@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	leaq	-32(%rbp), %rsi
	callq	_stat
	testq	%rax, %rax
	jne	LBB0_12
## %bb.4:
	xorl	%ebx, %ebx
	jmp	LBB0_11
LBB0_5:
	movq	_PromoteTriggerFile@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_15
## %bb.6:
	leaq	L_.str.1(%rip), %rsi
	callq	_strcmp
	testq	%rax, %rax
	je	LBB0_15
## %bb.7:
	movq	(%rbx), %rdi
	leaq	-32(%rbp), %rsi
	callq	_stat
	testq	%rax, %rax
	je	LBB0_16
## %bb.8:
	movq	_errno@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_ENOENT@GOTPCREL(%rip), %rcx
	movl	$0, %r14d
	cmpq	(%rcx), %rax
	je	LBB0_13
## %bb.9:
	movq	_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_errcode_for_file_access
	movq	(%rbx), %rsi
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_errmsg
	movl	%r15d, %edi
	movl	%eax, %esi
	callq	_ereport
	jmp	LBB0_13
LBB0_10:
	movq	(%rbx), %rdi
	callq	_unlink
	movl	$1, %ebx
LBB0_11:
	movq	_FALLBACK_PROMOTE_SIGNAL_FILE@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	_unlink
	movq	_fast_promote@GOTPCREL(%rip), %rax
	movl	%ebx, (%rax)
LBB0_12:
	movq	_LOG@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_errmsg
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_ereport
	xorl	%eax, %eax
	callq	_ResetPromoteTriggered
	movb	$1, _CheckForStandbyTrigger.triggered(%rip)
	jmp	LBB0_13
LBB0_15:
	xorl	%r14d, %r14d
	jmp	LBB0_13
LBB0_16:
	movq	_LOG@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	(%rbx), %rsi
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_errmsg
	movl	%r15d, %edi
	movl	%eax, %esi
	callq	_ereport
	movq	(%rbx), %rdi
	callq	_unlink
	movb	$1, _CheckForStandbyTrigger.triggered(%rip)
	movq	_fast_promote@GOTPCREL(%rip), %rax
	movl	$1, (%rax)
LBB0_13:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.zerofill __DATA,__bss,_CheckForStandbyTrigger.triggered,1,2 ## @CheckForStandbyTrigger.triggered
	.comm	_PROMOTE_SIGNAL_FILE,8,3        ## @PROMOTE_SIGNAL_FILE
	.comm	_FALLBACK_PROMOTE_SIGNAL_FILE,8,3 ## @FALLBACK_PROMOTE_SIGNAL_FILE
	.comm	_fast_promote,4,2               ## @fast_promote
	.comm	_LOG,4,2                        ## @LOG
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"received promote request"

	.comm	_PromoteTriggerFile,8,3         ## @PromoteTriggerFile
L_.str.1:                               ## @.str.1
	.space	1

L_.str.2:                               ## @.str.2
	.asciz	"promote trigger file found: %s"

	.comm	_errno,8,3                      ## @errno
	.comm	_ENOENT,8,3                     ## @ENOENT
	.comm	_ERROR,4,2                      ## @ERROR
L_.str.3:                               ## @.str.3
	.asciz	"could not stat promote trigger file \"%s\": %m"

	.no_dead_strip	_CheckForStandbyTrigger
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function CheckForStandbyTrigger
_CheckForStandbyTrigger:                ; @CheckForStandbyTrigger
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	adrp	x20, _CheckForStandbyTrigger.triggered@PAGE
	ldrb	w8, [x20, _CheckForStandbyTrigger.triggered@PAGEOFF]
	tbz	w8, #0, LBB0_2
; %bb.1:
	mov	w0, #1
	b	LBB0_15
LBB0_2:
	bl	_IsPromoteTriggered
	cbz	x0, LBB0_6
; %bb.3:
Lloh0:
	adrp	x21, _PROMOTE_SIGNAL_FILE@GOTPAGE
Lloh1:
	ldr	x21, [x21, _PROMOTE_SIGNAL_FILE@GOTPAGEOFF]
	ldr	x0, [x21]
	add	x1, sp, #8
	bl	_stat
Lloh2:
	adrp	x19, _FALLBACK_PROMOTE_SIGNAL_FILE@GOTPAGE
Lloh3:
	ldr	x19, [x19, _FALLBACK_PROMOTE_SIGNAL_FILE@GOTPAGEOFF]
	cbz	x0, LBB0_12
; %bb.4:
	ldr	x0, [x19]
	add	x1, sp, #8
	bl	_stat
	cbnz	x0, LBB0_14
; %bb.5:
	mov	w21, #0
	b	LBB0_13
LBB0_6:
Lloh4:
	adrp	x21, _PromoteTriggerFile@GOTPAGE
Lloh5:
	ldr	x21, [x21, _PromoteTriggerFile@GOTPAGEOFF]
	ldr	x0, [x21]
	cbz	x0, LBB0_15
; %bb.7:
Lloh6:
	adrp	x1, l_.str.1@PAGE
Lloh7:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_strcmp
	cbz	x0, LBB0_15
; %bb.8:
	ldr	x0, [x21]
	add	x1, sp, #8
	bl	_stat
	cbz	x0, LBB0_16
; %bb.9:
Lloh8:
	adrp	x8, _errno@GOTPAGE
Lloh9:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
Lloh11:
	adrp	x9, _ENOENT@GOTPAGE
Lloh12:
	ldr	x9, [x9, _ENOENT@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_11
; %bb.10:
Lloh14:
	adrp	x8, _ERROR@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ERROR@GOTPAGEOFF]
Lloh16:
	ldr	w19, [x8]
	bl	_errcode_for_file_access
	ldr	x8, [x21]
	str	x8, [sp]
Lloh17:
	adrp	x0, l_.str.3@PAGE
Lloh18:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_errmsg
	mov	x1, x0
	mov	x0, x19
	bl	_ereport
LBB0_11:
	mov	w0, #0
	b	LBB0_15
LBB0_12:
	ldr	x0, [x21]
	bl	_unlink
	mov	w21, #1
LBB0_13:
	ldr	x0, [x19]
	bl	_unlink
Lloh19:
	adrp	x8, _fast_promote@GOTPAGE
Lloh20:
	ldr	x8, [x8, _fast_promote@GOTPAGEOFF]
Lloh21:
	str	w21, [x8]
LBB0_14:
Lloh22:
	adrp	x8, _LOG@GOTPAGE
Lloh23:
	ldr	x8, [x8, _LOG@GOTPAGEOFF]
Lloh24:
	ldr	w19, [x8]
Lloh25:
	adrp	x0, l_.str@PAGE
Lloh26:
	add	x0, x0, l_.str@PAGEOFF
	bl	_errmsg
	mov	x1, x0
	mov	x0, x19
	bl	_ereport
	bl	_ResetPromoteTriggered
	mov	w0, #1
	strb	w0, [x20, _CheckForStandbyTrigger.triggered@PAGEOFF]
LBB0_15:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_16:
Lloh27:
	adrp	x8, _LOG@GOTPAGE
Lloh28:
	ldr	x8, [x8, _LOG@GOTPAGEOFF]
Lloh29:
	ldr	w19, [x8]
	ldr	x8, [x21]
	str	x8, [sp]
Lloh30:
	adrp	x0, l_.str.2@PAGE
Lloh31:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_errmsg
	mov	x1, x0
	mov	x0, x19
	bl	_ereport
	ldr	x0, [x21]
	bl	_unlink
	mov	w0, #1
	strb	w0, [x20, _CheckForStandbyTrigger.triggered@PAGEOFF]
Lloh32:
	adrp	x8, _fast_promote@GOTPAGE
Lloh33:
	ldr	x8, [x8, _fast_promote@GOTPAGEOFF]
Lloh34:
	str	w0, [x8]
	b	LBB0_15
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotStr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotStr	Lloh32, Lloh33, Lloh34
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
.zerofill __DATA,__bss,_CheckForStandbyTrigger.triggered,1,2 ; @CheckForStandbyTrigger.triggered
	.comm	_PROMOTE_SIGNAL_FILE,8,3        ; @PROMOTE_SIGNAL_FILE
	.comm	_FALLBACK_PROMOTE_SIGNAL_FILE,8,3 ; @FALLBACK_PROMOTE_SIGNAL_FILE
	.comm	_fast_promote,4,2               ; @fast_promote
	.comm	_LOG,4,2                        ; @LOG
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"received promote request"

	.comm	_PromoteTriggerFile,8,3         ; @PromoteTriggerFile
l_.str.1:                               ; @.str.1
	.space	1

l_.str.2:                               ; @.str.2
	.asciz	"promote trigger file found: %s"

	.comm	_errno,8,3                      ; @errno
	.comm	_ENOENT,8,3                     ; @ENOENT
	.comm	_ERROR,4,2                      ; @ERROR
l_.str.3:                               ; @.str.3
	.asciz	"could not stat promote trigger file \"%s\": %m"

	.no_dead_strip	_CheckForStandbyTrigger
.subsections_via_symbols
