	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_XLogReadBufferForRedoExtended  ## -- Begin function XLogReadBufferForRedoExtended
	.p2align	4, 0x90
_XLogReadBufferForRedoExtended:         ## @XLogReadBufferForRedoExtended
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, -88(%rbp)                  ## 8-byte Spill
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movl	%edx, %ebx
	movq	%rsi, %r13
	movq	%rdi, %r15
	movq	(%rdi), %rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	leaq	-52(%rbp), %rdx
	leaq	-64(%rbp), %rcx
	leaq	-48(%rbp), %r8
	callq	_XLogRecGetBlockTag
	testl	%eax, %eax
	jne	LBB0_2
## %bb.1:
	movq	_PANIC@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	movq	%r13, %rdx
	xorl	%eax, %eax
	callq	_elog
LBB0_2:
	movq	_RBM_ZERO_AND_LOCK@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	sete	%al
	movq	_RBM_ZERO_AND_CLEANUP_LOCK@GOTPCREL(%rip), %rcx
	movl	%ebx, -68(%rbp)                 ## 4-byte Spill
	cmpl	%ebx, (%rcx)
	sete	%r12b
	orb	%al, %r12b
	movq	8(%r15), %rax
	movq	_BKPBLOCK_WILL_INIT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r14d
	andl	(%rax,%r13,4), %r14d
	je	LBB0_5
## %bb.3:
	testb	%r12b, %r12b
	jne	LBB0_5
## %bb.4:
	movq	_PANIC@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	callq	_elog
LBB0_5:
	testl	%r14d, %r14d
	sete	%al
	andb	%r12b, %al
	cmpb	$1, %al
	jne	LBB0_7
## %bb.6:
	movq	_PANIC@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.2(%rip), %rsi
	xorl	%eax, %eax
	callq	_elog
LBB0_7:
	movq	%r15, %rdi
	movq	%r13, %rsi
	callq	_XLogRecBlockImageApply
	testq	%rax, %rax
	movl	-68(%rbp), %ebx                 ## 4-byte Reload
	je	LBB0_16
## %bb.8:
	movq	%r15, %rdi
	movq	%r13, %rsi
	callq	_XLogRecHasBlockImage
	movl	%eax, %edi
	callq	_Assert
	movl	-52(%rbp), %edi
	movq	-64(%rbp), %rsi
	movl	-48(%rbp), %edx
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	movq	_RBM_ZERO_AND_CLEANUP_LOCK@GOTPCREL(%rip), %rax
	jne	LBB0_10
## %bb.9:
	movq	_RBM_ZERO_AND_LOCK@GOTPCREL(%rip), %rax
LBB0_10:
	movl	(%rax), %ecx
	callq	_XLogReadBufferExtended
	movq	-88(%rbp), %r12                 ## 8-byte Reload
	movl	%eax, (%r12)
	movl	%eax, %edi
	callq	_BufferGetPage
	movl	%eax, %r14d
	movq	%r15, %rdi
	movq	%r13, %rsi
	movl	%eax, %edx
	callq	_RestoreBlockImage
	testl	%eax, %eax
	jne	LBB0_12
## %bb.11:
	movq	_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.3(%rip), %rsi
	xorl	%eax, %eax
	callq	_elog
LBB0_12:
	movl	%r14d, %edi
	callq	_PageIsNew
	testl	%eax, %eax
	jne	LBB0_14
## %bb.13:
	movl	%r14d, %edi
	movq	-80(%rbp), %rsi                 ## 8-byte Reload
	callq	_PageSetLSN
LBB0_14:
	movl	(%r12), %edi
	callq	_MarkBufferDirty
	movq	-64(%rbp), %rax
	movq	_INIT_FORKNUM@GOTPCREL(%rip), %rcx
	movq	_BLK_RESTORED@GOTPCREL(%rip), %rbx
	cmpq	(%rcx), %rax
	jne	LBB0_26
## %bb.15:
	movl	(%r12), %edi
	callq	_FlushOneBuffer
	jmp	LBB0_26
LBB0_16:
	movl	-52(%rbp), %edi
	movq	-64(%rbp), %rsi
	movl	-48(%rbp), %edx
	movl	%ebx, %ecx
	callq	_XLogReadBufferExtended
	movq	-88(%rbp), %r14                 ## 8-byte Reload
	movl	%eax, (%r14)
	movl	%eax, %edi
	callq	_BufferIsValid
	testq	%rax, %rax
	je	LBB0_17
## %bb.18:
	movq	_RBM_ZERO_AND_LOCK@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	je	LBB0_23
## %bb.19:
	movq	_RBM_ZERO_AND_CLEANUP_LOCK@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	je	LBB0_23
## %bb.20:
	movl	(%r14), %edi
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_22
## %bb.21:
	callq	_LockBufferForCleanup
	jmp	LBB0_23
LBB0_17:
	movq	_BLK_NOTFOUND@GOTPCREL(%rip), %rbx
	jmp	LBB0_26
LBB0_22:
	movq	_BUFFER_LOCK_EXCLUSIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_LockBuffer
LBB0_23:
	movl	(%r14), %edi
	callq	_BufferGetPage
	movl	%eax, %edi
	callq	_PageGetLSN
	cmpq	%rax, -80(%rbp)                 ## 8-byte Folded Reload
	jle	LBB0_24
## %bb.25:
	movq	_BLK_NEEDS_REDO@GOTPCREL(%rip), %rbx
	jmp	LBB0_26
LBB0_24:
	movq	_BLK_DONE@GOTPCREL(%rip), %rbx
LBB0_26:
	movl	(%rbx), %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PANIC,4,2                      ## @PANIC
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to locate backup block with ID %d"

	.comm	_RBM_ZERO_AND_LOCK,4,2          ## @RBM_ZERO_AND_LOCK
	.comm	_RBM_ZERO_AND_CLEANUP_LOCK,4,2  ## @RBM_ZERO_AND_CLEANUP_LOCK
	.comm	_BKPBLOCK_WILL_INIT,4,2         ## @BKPBLOCK_WILL_INIT
L_.str.1:                               ## @.str.1
	.asciz	"block with WILL_INIT flag in WAL record must be zeroed by redo routine"

L_.str.2:                               ## @.str.2
	.asciz	"block to be initialized in redo routine must be marked with WILL_INIT flag in the WAL record"

	.comm	_ERROR,4,2                      ## @ERROR
L_.str.3:                               ## @.str.3
	.asciz	"failed to restore block image"

	.comm	_INIT_FORKNUM,8,3               ## @INIT_FORKNUM
	.comm	_BLK_RESTORED,4,2               ## @BLK_RESTORED
	.comm	_BUFFER_LOCK_EXCLUSIVE,4,2      ## @BUFFER_LOCK_EXCLUSIVE
	.comm	_BLK_DONE,4,2                   ## @BLK_DONE
	.comm	_BLK_NEEDS_REDO,4,2             ## @BLK_NEEDS_REDO
	.comm	_BLK_NOTFOUND,4,2               ## @BLK_NOTFOUND
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_XLogReadBufferForRedoExtended  ; -- Begin function XLogReadBufferForRedoExtended
	.p2align	2
_XLogReadBufferForRedoExtended:         ; @XLogReadBufferForRedoExtended
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	mov	x19, x4
	mov	x21, x3
	mov	x24, x2
	mov	x22, x1
	mov	x23, x0
	ldr	x8, [x0]
	str	x8, [sp, #16]                   ; 8-byte Folded Spill
	add	x2, sp, #44
	add	x3, sp, #32
	add	x4, sp, #28
	bl	_XLogRecGetBlockTag
Lloh0:
	adrp	x27, _PANIC@GOTPAGE
Lloh1:
	ldr	x27, [x27, _PANIC@GOTPAGEOFF]
	cbnz	w0, LBB0_2
; %bb.1:
	ldr	w0, [x27]
	str	x22, [sp]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	bl	_elog
LBB0_2:
Lloh4:
	adrp	x25, _RBM_ZERO_AND_LOCK@GOTPAGE
Lloh5:
	ldr	x25, [x25, _RBM_ZERO_AND_LOCK@GOTPAGEOFF]
	ldr	w8, [x25]
	cmp	w8, w24
Lloh6:
	adrp	x26, _RBM_ZERO_AND_CLEANUP_LOCK@GOTPAGE
Lloh7:
	ldr	x26, [x26, _RBM_ZERO_AND_CLEANUP_LOCK@GOTPAGEOFF]
	ldr	w8, [x26]
	ccmp	w8, w24, #4, ne
	cset	w28, eq
	ldr	x8, [x23, #8]
	ldr	w8, [x8, x22, lsl #2]
Lloh8:
	adrp	x9, _BKPBLOCK_WILL_INIT@GOTPAGE
Lloh9:
	ldr	x9, [x9, _BKPBLOCK_WILL_INIT@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	ands	w20, w9, w8
	b.eq	LBB0_5
; %bb.3:
	tbnz	w28, #0, LBB0_5
; %bb.4:
	ldr	w0, [x27]
Lloh11:
	adrp	x1, l_.str.1@PAGE
Lloh12:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_elog
LBB0_5:
	cmp	w20, #0
	cset	w8, eq
	and	w8, w8, w28
	cmp	w8, #1
	b.ne	LBB0_7
; %bb.6:
	ldr	w0, [x27]
Lloh13:
	adrp	x1, l_.str.2@PAGE
Lloh14:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_elog
LBB0_7:
	mov	x0, x23
	mov	x1, x22
	bl	_XLogRecBlockImageApply
	cbz	x0, LBB0_15
; %bb.8:
	mov	x0, x23
	mov	x1, x22
	bl	_XLogRecHasBlockImage
	bl	_Assert
	ldr	w0, [sp, #44]
	ldr	x1, [sp, #32]
	ldr	w2, [sp, #28]
	cmp	w21, #0
	csel	x8, x25, x26, eq
	ldr	w3, [x8]
	bl	_XLogReadBufferExtended
	str	w0, [x19]
	bl	_BufferGetPage
	mov	x21, x0
	mov	x0, x23
	mov	x1, x22
	mov	x2, x21
	bl	_RestoreBlockImage
	cbnz	w0, LBB0_10
; %bb.9:
Lloh15:
	adrp	x8, _ERROR@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ERROR@GOTPAGEOFF]
Lloh17:
	ldr	w0, [x8]
Lloh18:
	adrp	x1, l_.str.3@PAGE
Lloh19:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_elog
LBB0_10:
	mov	x0, x21
	bl	_PageIsNew
	cbnz	w0, LBB0_12
; %bb.11:
	mov	x0, x21
	ldr	x1, [sp, #16]                   ; 8-byte Folded Reload
	bl	_PageSetLSN
LBB0_12:
	ldr	w0, [x19]
	bl	_MarkBufferDirty
	ldr	x8, [sp, #32]
Lloh20:
	adrp	x9, _INIT_FORKNUM@GOTPAGE
Lloh21:
	ldr	x9, [x9, _INIT_FORKNUM@GOTPAGEOFF]
Lloh22:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_14
; %bb.13:
	ldr	w0, [x19]
	bl	_FlushOneBuffer
LBB0_14:
Lloh23:
	adrp	x8, _BLK_RESTORED@GOTPAGE
Lloh24:
	ldr	x8, [x8, _BLK_RESTORED@GOTPAGEOFF]
	b	LBB0_22
LBB0_15:
	ldr	w0, [sp, #44]
	ldr	x1, [sp, #32]
	ldr	w2, [sp, #28]
	mov	x3, x24
	bl	_XLogReadBufferExtended
	str	w0, [x19]
	bl	_BufferIsValid
	cbz	x0, LBB0_19
; %bb.16:
	ldr	w8, [x25]
	ldr	w9, [x26]
	cmp	w8, w24
	ccmp	w9, w24, #4, ne
	b.eq	LBB0_21
; %bb.17:
	ldr	w0, [x19]
	cbz	w21, LBB0_20
; %bb.18:
	bl	_LockBufferForCleanup
	b	LBB0_21
LBB0_19:
Lloh25:
	adrp	x8, _BLK_NOTFOUND@GOTPAGE
Lloh26:
	ldr	x8, [x8, _BLK_NOTFOUND@GOTPAGEOFF]
	b	LBB0_22
LBB0_20:
Lloh27:
	adrp	x8, _BUFFER_LOCK_EXCLUSIVE@GOTPAGE
Lloh28:
	ldr	x8, [x8, _BUFFER_LOCK_EXCLUSIVE@GOTPAGEOFF]
Lloh29:
	ldr	w1, [x8]
	bl	_LockBuffer
LBB0_21:
	ldr	w0, [x19]
	bl	_BufferGetPage
	bl	_PageGetLSN
Lloh30:
	adrp	x8, _BLK_DONE@GOTPAGE
Lloh31:
	ldr	x8, [x8, _BLK_DONE@GOTPAGEOFF]
Lloh32:
	adrp	x9, _BLK_NEEDS_REDO@GOTPAGE
Lloh33:
	ldr	x9, [x9, _BLK_NEEDS_REDO@GOTPAGEOFF]
	ldr	x10, [sp, #16]                  ; 8-byte Folded Reload
	cmp	x10, x0
	csel	x8, x9, x8, gt
LBB0_22:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpLdrGot	Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_PANIC,4,2                      ; @PANIC
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to locate backup block with ID %d"

	.comm	_RBM_ZERO_AND_LOCK,4,2          ; @RBM_ZERO_AND_LOCK
	.comm	_RBM_ZERO_AND_CLEANUP_LOCK,4,2  ; @RBM_ZERO_AND_CLEANUP_LOCK
	.comm	_BKPBLOCK_WILL_INIT,4,2         ; @BKPBLOCK_WILL_INIT
l_.str.1:                               ; @.str.1
	.asciz	"block with WILL_INIT flag in WAL record must be zeroed by redo routine"

l_.str.2:                               ; @.str.2
	.asciz	"block to be initialized in redo routine must be marked with WILL_INIT flag in the WAL record"

	.comm	_ERROR,4,2                      ; @ERROR
l_.str.3:                               ; @.str.3
	.asciz	"failed to restore block image"

	.comm	_INIT_FORKNUM,8,3               ; @INIT_FORKNUM
	.comm	_BLK_RESTORED,4,2               ; @BLK_RESTORED
	.comm	_BUFFER_LOCK_EXCLUSIVE,4,2      ; @BUFFER_LOCK_EXCLUSIVE
	.comm	_BLK_DONE,4,2                   ; @BLK_DONE
	.comm	_BLK_NEEDS_REDO,4,2             ; @BLK_NEEDS_REDO
	.comm	_BLK_NOTFOUND,4,2               ; @BLK_NOTFOUND
.subsections_via_symbols
