	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tts_buffer_heap_materialize
_tts_buffer_heap_materialize:           ## @tts_buffer_heap_materialize
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	callq	_TTS_EMPTY
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	callq	_Assert
	movq	%rbx, %rdi
	callq	_TTS_SHOULDFREE
	testq	%rax, %rax
	je	LBB0_1
## %bb.7:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_1:
	movl	24(%rbx), %edi
	callq	_MemoryContextSwitchTo
	movl	%eax, %r14d
	movq	$0, 16(%rbx)
	movq	8(%rbx), %rsi
	testq	%rsi, %rsi
	je	LBB0_2
## %bb.3:
	movq	%rsi, %rdi
	callq	_heap_copytuple
	movq	%rax, 8(%rbx)
	movl	(%rbx), %edi
	callq	_BufferIsValid
	movl	%eax, %edi
	callq	_likely
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movl	(%rbx), %edi
	callq	_ReleaseBuffer
LBB0_5:
	movq	_InvalidBuffer@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rbx)
	jmp	LBB0_6
LBB0_2:
	movq	%rsi, %rdi
	shrq	$32, %rdi
	movl	4(%rbx), %edx
                                        ## kill: def $edi killed $edi killed $rdi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_heap_form_tuple
	movq	%rax, 8(%rbx)
	movl	(%rbx), %eax
LBB0_6:
	movq	_TTS_FLAG_SHOULDFREE@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%eax, (%rbx)
	movl	%r14d, %edi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_MemoryContextSwitchTo          ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_InvalidBuffer,4,2              ## @InvalidBuffer
	.comm	_TTS_FLAG_SHOULDFREE,4,2        ## @TTS_FLAG_SHOULDFREE
	.no_dead_strip	_tts_buffer_heap_materialize
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tts_buffer_heap_materialize
_tts_buffer_heap_materialize:           ; @tts_buffer_heap_materialize
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	bl	_TTS_EMPTY
	cmp	w0, #0
	cset	w0, eq
	bl	_Assert
	mov	x0, x19
	bl	_TTS_SHOULDFREE
	cbz	x0, LBB0_2
; %bb.1:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_2:
	ldr	w0, [x19, #24]
	bl	_MemoryContextSwitchTo
	mov	x20, x0
	str	xzr, [x19, #16]
	ldr	x1, [x19, #8]
	cbz	x1, LBB0_6
; %bb.3:
	mov	x0, x1
	bl	_heap_copytuple
	str	x0, [x19, #8]
	ldr	w0, [x19]
	bl	_BufferIsValid
	bl	_likely
	cbz	x0, LBB0_5
; %bb.4:
	ldr	w0, [x19]
	bl	_ReleaseBuffer
LBB0_5:
Lloh0:
	adrp	x8, _InvalidBuffer@GOTPAGE
Lloh1:
	ldr	x8, [x8, _InvalidBuffer@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [x19]
	b	LBB0_7
LBB0_6:
	lsr	x0, x1, #32
	ldr	w2, [x19, #4]
                                        ; kill: def $w0 killed $w0 killed $x0
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_heap_form_tuple
	str	x0, [x19, #8]
	ldr	w8, [x19]
LBB0_7:
Lloh3:
	adrp	x9, _TTS_FLAG_SHOULDFREE@GOTPAGE
Lloh4:
	ldr	x9, [x9, _TTS_FLAG_SHOULDFREE@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	orr	w8, w8, w9
	str	w8, [x19]
	mov	x0, x20
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_MemoryContextSwitchTo
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_InvalidBuffer,4,2              ; @InvalidBuffer
	.comm	_TTS_FLAG_SHOULDFREE,4,2        ; @TTS_FLAG_SHOULDFREE
	.no_dead_strip	_tts_buffer_heap_materialize
.subsections_via_symbols
