	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mdwrite                        ## -- Begin function mdwrite
	.p2align	4, 0x90
_mdwrite:                               ## @mdwrite
	.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	%r8d, %ebx
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movl	%edx, %r13d
	movl	%esi, %r14d
	movq	%rdi, %r12
	movl	12(%rdi), %edx
	movl	8(%rdi), %ecx
	movl	(%rdi), %r9d
	movl	4(%rdi), %r8d
	movl	%esi, %edi
	movl	%r13d, %esi
	callq	_TRACE_POSTGRESQL_SMGR_MD_WRITE_START
	movq	_EXTENSION_FAIL@GOTPCREL(%rip), %rax
	movq	_EXTENSION_CREATE_RECOVERY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r8d
	orl	(%rax), %r8d
	movq	%r12, %rdi
	movl	%r14d, %esi
	movl	%r13d, %edx
	movl	%ebx, -60(%rbp)                 ## 4-byte Spill
	movl	%ebx, %ecx
	callq	__mdfd_getseg
	movq	%rax, %r15
	movq	_BLCKSZ@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_RELSEG_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r13d, %eax
	cltd
	idivl	%esi
	movl	%edx, %ebx
	imull	%ecx, %ebx
	imull	%ecx, %esi
	xorl	%edi, %edi
	cmpl	%esi, %ebx
	setl	%dil
	callq	_Assert
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	movl	(%r15), %edi
	movq	_BLCKSZ@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_WAIT_EVENT_DATA_FILE_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movl	%ebx, %ecx
	callq	_FileWrite
	movl	%eax, %r15d
	movl	12(%r12), %edx
	movl	8(%r12), %ecx
	movl	(%r12), %r9d
	movl	4(%r12), %r8d
	movq	_BLCKSZ@GOTPCREL(%rip), %rsi
	movl	(%rsi), %eax
	movl	%r14d, -56(%rbp)                ## 4-byte Spill
	movl	%r14d, %edi
	movq	%rsi, %r14
	movl	%r13d, %esi
	pushq	%rax
	pushq	%r15
	callq	_TRACE_POSTGRESQL_SMGR_MD_WRITE_DONE
	addq	$16, %rsp
	cmpl	(%r14), %r15d
	je	LBB0_4
## %bb.1:
	testl	%r15d, %r15d
	jns	LBB0_3
## %bb.2:
	movq	_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	xorl	%eax, %eax
	callq	_errcode_for_file_access
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	callq	_FilePathName
	leaq	L_.str(%rip), %rdi
	movl	%r13d, %esi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_errmsg
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_ereport
LBB0_3:
	movq	_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_ERRCODE_DISK_FULL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_errcode
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	callq	_FilePathName
	movl	(%r14), %r8d
	leaq	L_.str.1(%rip), %rdi
	movl	%r13d, %esi
	movl	%eax, %edx
	movl	%r15d, %ecx
	xorl	%eax, %eax
	callq	_errmsg
	leaq	L_.str.2(%rip), %rdi
	callq	_errhint
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_ereport
LBB0_4:
	cmpl	$0, -60(%rbp)                   ## 4-byte Folded Reload
	jne	LBB0_6
## %bb.5:
	movq	%r12, %rdi
	callq	_SmgrIsTemp
	testl	%eax, %eax
	je	LBB0_7
LBB0_6:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	%r12, %rdi
	movl	-56(%rbp), %esi                 ## 4-byte Reload
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_register_dirty_segment         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_EXTENSION_FAIL,4,2             ## @EXTENSION_FAIL
	.comm	_EXTENSION_CREATE_RECOVERY,4,2  ## @EXTENSION_CREATE_RECOVERY
	.comm	_BLCKSZ,4,2                     ## @BLCKSZ
	.comm	_RELSEG_SIZE,4,2                ## @RELSEG_SIZE
	.comm	_WAIT_EVENT_DATA_FILE_WRITE,4,2 ## @WAIT_EVENT_DATA_FILE_WRITE
	.comm	_ERROR,4,2                      ## @ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"could not write block %u in file \"%s\": %m"

	.comm	_ERRCODE_DISK_FULL,4,2          ## @ERRCODE_DISK_FULL
L_.str.1:                               ## @.str.1
	.asciz	"could not write block %u in file \"%s\": wrote only %d of %d bytes"

L_.str.2:                               ## @.str.2
	.asciz	"Check free disk space."

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mdwrite                        ; -- Begin function mdwrite
	.p2align	2
_mdwrite:                               ; @mdwrite
	.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
	mov	x21, x4
	mov	x24, x3
	mov	x23, x2
	mov	x19, x1
	mov	x20, x0
	ldp	w3, w2, [x0, #8]
	ldp	w5, w4, [x0]
	mov	x0, x1
	mov	x1, x23
	bl	_TRACE_POSTGRESQL_SMGR_MD_WRITE_START
Lloh0:
	adrp	x8, _EXTENSION_FAIL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EXTENSION_FAIL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _EXTENSION_CREATE_RECOVERY@GOTPAGE
Lloh4:
	ldr	x9, [x9, _EXTENSION_CREATE_RECOVERY@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	orr	w4, w9, w8
	mov	x0, x20
	mov	x1, x19
	mov	x2, x23
	mov	x3, x21
	bl	__mdfd_getseg
	mov	x22, x0
Lloh6:
	adrp	x26, _BLCKSZ@GOTPAGE
Lloh7:
	ldr	x26, [x26, _BLCKSZ@GOTPAGEOFF]
	ldr	w8, [x26]
Lloh8:
	adrp	x9, _RELSEG_SIZE@GOTPAGE
Lloh9:
	ldr	x9, [x9, _RELSEG_SIZE@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	sdiv	w10, w23, w9
	msub	w10, w10, w9, w23
	mul	w25, w10, w8
	mul	w8, w9, w8
	cmp	w25, w8
	cset	w0, lt
	bl	_Assert
	ldr	w0, [x22]
	ldr	w2, [x26]
Lloh11:
	adrp	x8, _WAIT_EVENT_DATA_FILE_WRITE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _WAIT_EVENT_DATA_FILE_WRITE@GOTPAGEOFF]
Lloh13:
	ldr	w4, [x8]
	mov	x1, x24
	mov	x3, x25
	bl	_FileWrite
	mov	x24, x0
	ldp	w3, w2, [x20, #8]
	ldp	w5, w4, [x20]
	ldr	w7, [x26]
	mov	x0, x19
	mov	x1, x23
	mov	x6, x24
	bl	_TRACE_POSTGRESQL_SMGR_MD_WRITE_DONE
	ldr	w8, [x26]
	cmp	w24, w8
	b.eq	LBB0_4
; %bb.1:
Lloh14:
	adrp	x27, _ERROR@GOTPAGE
Lloh15:
	ldr	x27, [x27, _ERROR@GOTPAGEOFF]
	tbz	w24, #31, LBB0_3
; %bb.2:
	ldr	w25, [x27]
	bl	_errcode_for_file_access
	ldr	w0, [x22]
	bl	_FilePathName
	mov	x2, x0
Lloh16:
	adrp	x0, l_.str@PAGE
Lloh17:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x23
	bl	_errmsg
	mov	x1, x0
	mov	x0, x25
	bl	_ereport
LBB0_3:
	ldr	w25, [x27]
Lloh18:
	adrp	x8, _ERRCODE_DISK_FULL@GOTPAGE
Lloh19:
	ldr	x8, [x8, _ERRCODE_DISK_FULL@GOTPAGEOFF]
Lloh20:
	ldr	w0, [x8]
	bl	_errcode
	ldr	w0, [x22]
	bl	_FilePathName
	mov	x2, x0
	ldr	w8, [x26]
	stp	x24, x8, [sp]
Lloh21:
	adrp	x0, l_.str.1@PAGE
Lloh22:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x23
	bl	_errmsg
Lloh23:
	adrp	x0, l_.str.2@PAGE
Lloh24:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_errhint
	mov	x1, x0
	mov	x0, x25
	bl	_ereport
LBB0_4:
	cbnz	w21, LBB0_6
; %bb.5:
	mov	x0, x20
	bl	_SmgrIsTemp
	cbz	w0, LBB0_7
LBB0_6:
	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_7:
	mov	x0, x20
	mov	x1, x19
	mov	x2, x22
	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	_register_dirty_segment
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_EXTENSION_FAIL,4,2             ; @EXTENSION_FAIL
	.comm	_EXTENSION_CREATE_RECOVERY,4,2  ; @EXTENSION_CREATE_RECOVERY
	.comm	_BLCKSZ,4,2                     ; @BLCKSZ
	.comm	_RELSEG_SIZE,4,2                ; @RELSEG_SIZE
	.comm	_WAIT_EVENT_DATA_FILE_WRITE,4,2 ; @WAIT_EVENT_DATA_FILE_WRITE
	.comm	_ERROR,4,2                      ; @ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"could not write block %u in file \"%s\": %m"

	.comm	_ERRCODE_DISK_FULL,4,2          ; @ERRCODE_DISK_FULL
l_.str.1:                               ; @.str.1
	.asciz	"could not write block %u in file \"%s\": wrote only %d of %d bytes"

l_.str.2:                               ; @.str.2
	.asciz	"Check free disk space."

.subsections_via_symbols
