	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function writetup_heap
_writetup_heap:                         ## @writetup_heap
	.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	%rsi, %r14
	movq	%rdi, %r15
	movq	_MINIMAL_TUPLE_DATA_OFFSET@GOTPCREL(%rip), %rax
	movslq	(%rax), %r12
	movl	(%rsi), %ebx
	subl	%r12d, %ebx
	addq	%rsi, %r12
	movl	%ebx, %eax
	addl	$4, %eax
	movl	%eax, -44(%rbp)
	movl	(%rdi), %edi
	leaq	-44(%rbp), %rsi
	movl	$4, %edx
	callq	_BufFileWrite
	cmpl	$4, %eax
	je	LBB0_2
## %bb.1:
	movq	_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	xorl	%eax, %eax
	callq	_errcode_for_file_access
	leaq	L_.str(%rip), %rdi
	callq	_errmsg
	movl	%r13d, %edi
	movl	%eax, %esi
	callq	_ereport
LBB0_2:
	movl	(%r15), %edi
	movq	%r12, %rsi
	movl	%ebx, %edx
	callq	_BufFileWrite
	cltq
	cmpq	%rbx, %rax
	je	LBB0_4
## %bb.3:
	movq	_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	xorl	%eax, %eax
	callq	_errcode_for_file_access
	leaq	L_.str(%rip), %rdi
	callq	_errmsg
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_ereport
LBB0_4:
	cmpq	$0, 8(%r15)
	je	LBB0_7
## %bb.5:
	movl	(%r15), %edi
	leaq	-44(%rbp), %rsi
	movl	$4, %edx
	callq	_BufFileWrite
	cmpl	$4, %eax
	je	LBB0_7
## %bb.6:
	movq	_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	xorl	%eax, %eax
	callq	_errcode_for_file_access
	leaq	L_.str(%rip), %rdi
	callq	_errmsg
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_ereport
LBB0_7:
	movq	%r14, %rdi
	callq	_GetMemoryChunkSpace
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_FREEMEM
	movq	%r14, %rdi
	callq	_heap_free_minimal_tuple
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MINIMAL_TUPLE_DATA_OFFSET,4,2  ## @MINIMAL_TUPLE_DATA_OFFSET
	.comm	_ERROR,4,2                      ## @ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"could not write to tuplestore temporary file: %m"

	.no_dead_strip	_writetup_heap
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function writetup_heap
_writetup_heap:                         ; @writetup_heap
	.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, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _MINIMAL_TUPLE_DATA_OFFSET@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MINIMAL_TUPLE_DATA_OFFSET@GOTPAGEOFF]
Lloh2:
	ldrsw	x8, [x8]
	add	x22, x1, x8
	ldr	w9, [x1]
	sub	w21, w9, w8
	add	w8, w21, #4
	str	w8, [sp, #12]
	ldr	w0, [x0]
	add	x1, sp, #12
	mov	w2, #4
	bl	_BufFileWrite
	cmp	w0, #4
	b.eq	LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _ERROR@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ERROR@GOTPAGEOFF]
Lloh5:
	ldr	w23, [x8]
	bl	_errcode_for_file_access
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	bl	_errmsg
	mov	x1, x0
	mov	x0, x23
	bl	_ereport
LBB0_2:
	ldr	w0, [x20]
	mov	x1, x22
	mov	x2, x21
	bl	_BufFileWrite
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x8, w0
	cmp	x8, x21
	b.eq	LBB0_4
; %bb.3:
Lloh8:
	adrp	x8, _ERROR@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ERROR@GOTPAGEOFF]
Lloh10:
	ldr	w21, [x8]
	bl	_errcode_for_file_access
Lloh11:
	adrp	x0, l_.str@PAGE
Lloh12:
	add	x0, x0, l_.str@PAGEOFF
	bl	_errmsg
	mov	x1, x0
	mov	x0, x21
	bl	_ereport
LBB0_4:
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_7
; %bb.5:
	ldr	w0, [x20]
	add	x1, sp, #12
	mov	w2, #4
	bl	_BufFileWrite
	cmp	w0, #4
	b.eq	LBB0_7
; %bb.6:
Lloh13:
	adrp	x8, _ERROR@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ERROR@GOTPAGEOFF]
Lloh15:
	ldr	w21, [x8]
	bl	_errcode_for_file_access
Lloh16:
	adrp	x0, l_.str@PAGE
Lloh17:
	add	x0, x0, l_.str@PAGEOFF
	bl	_errmsg
	mov	x1, x0
	mov	x0, x21
	bl	_ereport
LBB0_7:
	mov	x0, x19
	bl	_GetMemoryChunkSpace
	mov	x1, x0
	mov	x0, x20
	bl	_FREEMEM
	mov	x0, x19
	bl	_heap_free_minimal_tuple
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_MINIMAL_TUPLE_DATA_OFFSET,4,2  ; @MINIMAL_TUPLE_DATA_OFFSET
	.comm	_ERROR,4,2                      ; @ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"could not write to tuplestore temporary file: %m"

	.no_dead_strip	_writetup_heap
.subsections_via_symbols
