	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_toast_compress_datum           ## -- Begin function toast_compress_datum
	.p2align	4, 0x90
_toast_compress_datum:                  ## @toast_compress_datum
	.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
	movl	%edi, %ebx
	callq	_DatumGetPointer
	movl	%eax, %edi
	callq	_VARSIZE_ANY_EXHDR
	movq	%rax, %r14
	movl	%ebx, %edi
	callq	_DatumGetPointer
	movl	%eax, %edi
	callq	_VARATT_IS_EXTERNAL
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	callq	_Assert
	movl	%ebx, %edi
	callq	_DatumGetPointer
	movl	%eax, %edi
	callq	_VARATT_IS_COMPRESSED
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	callq	_Assert
	movq	_PGLZ_strategy_default@GOTPCREL(%rip), %r13
	movq	(%r13), %rax
	cmpq	(%rax), %r14
	jl	LBB0_6
## %bb.1:
	cmpq	8(%rax), %r14
	jg	LBB0_6
## %bb.2:
	movq	%r14, %rdi
	callq	_PGLZ_MAX_OUTPUT
	movq	_TOAST_COMPRESS_HDRSZ@GOTPCREL(%rip), %r12
	addq	(%r12), %rax
	movq	%rax, %rdi
	callq	_palloc
	movq	%rax, %r15
	movl	%ebx, %edi
	callq	_DatumGetPointer
	movl	%eax, %edi
	callq	_VARDATA_ANY
	movl	%eax, %ebx
	movq	%r15, %rdi
	callq	_TOAST_COMPRESS_RAWDATA
	movq	(%r13), %rcx
	movl	%ebx, %edi
	movq	%r14, %rsi
	movl	%eax, %edx
	callq	_pglz_compress
	testq	%rax, %rax
	js	LBB0_5
## %bb.3:
	movq	%rax, %rbx
	movq	(%r12), %rax
	addq	%rbx, %rax
	movq	%r14, %rcx
	addq	$-2, %rcx
	cmpq	%rcx, %rax
	jge	LBB0_5
## %bb.4:
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_TOAST_COMPRESS_SET_RAWSIZE
	addq	(%r12), %rbx
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_SET_VARSIZE_COMPRESSED
	jmp	LBB0_7
LBB0_5:
	movq	%r15, %rdi
	callq	_pfree
LBB0_6:
	xorl	%r15d, %r15d
LBB0_7:
	movq	%r15, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_PointerGetDatum                ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_PGLZ_strategy_default,8,3      ## @PGLZ_strategy_default
	.comm	_TOAST_COMPRESS_HDRSZ,8,3       ## @TOAST_COMPRESS_HDRSZ
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_toast_compress_datum           ; -- Begin function toast_compress_datum
	.p2align	2
_toast_compress_datum:                  ; @toast_compress_datum
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x20, x0
	bl	_DatumGetPointer
	bl	_VARSIZE_ANY_EXHDR
	mov	x19, x0
	mov	x0, x20
	bl	_DatumGetPointer
	bl	_VARATT_IS_EXTERNAL
	cmp	w0, #0
	cset	w0, eq
	bl	_Assert
	mov	x0, x20
	bl	_DatumGetPointer
	bl	_VARATT_IS_COMPRESSED
	cmp	w0, #0
	cset	w0, eq
	bl	_Assert
Lloh0:
	adrp	x23, _PGLZ_strategy_default@GOTPAGE
Lloh1:
	ldr	x23, [x23, _PGLZ_strategy_default@GOTPAGEOFF]
	ldr	x8, [x23]
	ldr	x9, [x8]
	cmp	x19, x9
	b.lt	LBB0_6
; %bb.1:
	ldr	x8, [x8, #8]
	cmp	x19, x8
	b.gt	LBB0_6
; %bb.2:
	mov	x0, x19
	bl	_PGLZ_MAX_OUTPUT
Lloh2:
	adrp	x22, _TOAST_COMPRESS_HDRSZ@GOTPAGE
Lloh3:
	ldr	x22, [x22, _TOAST_COMPRESS_HDRSZ@GOTPAGEOFF]
	ldr	x8, [x22]
	add	x0, x8, x0
	bl	_palloc
	mov	x21, x0
	mov	x0, x20
	bl	_DatumGetPointer
	bl	_VARDATA_ANY
	mov	x20, x0
	mov	x0, x21
	bl	_TOAST_COMPRESS_RAWDATA
	mov	x2, x0
	ldr	x3, [x23]
	mov	x0, x20
	mov	x1, x19
	bl	_pglz_compress
	tbnz	x0, #63, LBB0_5
; %bb.3:
	mov	x20, x0
	ldr	x8, [x22]
	sub	x9, x19, #2
	add	x8, x8, x0
	cmp	x8, x9
	b.ge	LBB0_5
; %bb.4:
	mov	x0, x21
	mov	x1, x19
	bl	_TOAST_COMPRESS_SET_RAWSIZE
	ldr	x8, [x22]
	add	x1, x8, x20
	mov	x0, x21
	bl	_SET_VARSIZE_COMPRESSED
	b	LBB0_7
LBB0_5:
	mov	x0, x21
	bl	_pfree
LBB0_6:
	mov	x21, #0
LBB0_7:
	mov	x0, x21
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_PointerGetDatum
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.comm	_PGLZ_strategy_default,8,3      ; @PGLZ_strategy_default
	.comm	_TOAST_COMPRESS_HDRSZ,8,3       ; @TOAST_COMPRESS_HDRSZ
.subsections_via_symbols
