	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_statext_ndistinct_serialize    ## -- Begin function statext_ndistinct_serialize
	.p2align	4, 0x90
_statext_ndistinct_serialize:           ## @statext_ndistinct_serialize
	.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	%rdi, %r12
	movl	(%rdi), %eax
	movq	_STATS_NDISTINCT_MAGIC@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	cmpl	(%rcx), %eax
	sete	%dil
	callq	_Assert
	leaq	4(%r12), %r13
	movl	4(%r12), %eax
	movq	_STATS_NDISTINCT_TYPE_BASIC@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	cmpl	(%rcx), %eax
	sete	%dil
	callq	_Assert
	movq	_VARHDRSZ@GOTPCREL(%rip), %rax
	movq	_SizeOfHeader@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r15d
	leaq	8(%r12), %rcx
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	addl	(%rax), %r15d
	cmpl	$0, 8(%r12)
	jle	LBB0_3
## %bb.1:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	16(%r12), %rax
	movl	4(%rax,%rbx,8), %edi
	callq	_bms_num_members
	movl	%eax, %r14d
	xorl	%edi, %edi
	cmpl	$2, %eax
	setge	%dil
	callq	_Assert
	movl	%r14d, %edi
	callq	_SizeOfItem
	addl	%eax, %r15d
	incq	%rbx
	movslq	8(%r12), %rax
	cmpq	%rax, %rbx
	jl	LBB0_2
LBB0_3:
	movl	%r15d, %edi
	callq	_palloc
	movq	%rax, %r14
	movq	%rax, %rdi
	movl	%r15d, %esi
	callq	_SET_VARSIZE
	movq	%r14, %rdi
	callq	_VARDATA
	movq	%rax, %rbx
	movq	%rax, %rdi
	movq	%r12, %rsi
	movl	$4, %edx
	callq	_memcpy
	leaq	4(%rbx), %rdi
	movq	%r13, %rsi
	movl	$4, %edx
	callq	_memcpy
	leaq	8(%rbx), %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	movl	$4, %edx
	callq	_memcpy
	addq	$12, %rbx
	cmpl	$0, 8(%r12)
	jle	LBB0_4
## %bb.5:
	movslq	%r15d, %rax
	movq	%r14, -80(%rbp)                 ## 8-byte Spill
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	addq	%r14, %rax
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	xorl	%r14d, %r14d
	leaq	-52(%rbp), %r13
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_6 Depth=1
	xorl	%edi, %edi
	cmpq	-88(%rbp), %rbx                 ## 8-byte Folded Reload
	setbe	%dil
	callq	_Assert
	incq	%r14
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movslq	(%rax), %rax
	cmpq	%rax, %r14
	jge	LBB0_10
LBB0_6:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_8 Depth 2
	movq	16(%r12), %rax
	movq	(%rax,%r14,8), %rdi
	movq	%rdi, -48(%rbp)
	shrq	$32, %rdi
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_bms_num_members
	movl	%eax, -56(%rbp)
	movq	%rbx, %rdi
	leaq	-48(%rbp), %rsi
	movl	$8, %edx
	callq	_memcpy
	leaq	8(%rbx), %rdi
	leaq	-56(%rbp), %rsi
	movl	$4, %edx
	callq	_memcpy
	addq	$12, %rbx
	movl	-44(%rbp), %edi
	movl	$-1, %esi
	callq	_bms_next_member
	testl	%eax, %eax
	js	LBB0_9
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	movl	%eax, %r15d
	.p2align	4, 0x90
LBB0_8:                                 ##   Parent Loop BB0_6 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	%r15d, -52(%rbp)
	movq	%rbx, %rdi
	movq	%r13, %rsi
	movl	$4, %edx
	callq	_memcpy
	addq	$4, %rbx
	movl	-44(%rbp), %edi
	movl	%r15d, %esi
	callq	_bms_next_member
	movl	%eax, %r15d
	testl	%eax, %eax
	jns	LBB0_8
	jmp	LBB0_9
LBB0_10:
	movq	-80(%rbp), %r14                 ## 8-byte Reload
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	jmp	LBB0_11
LBB0_4:
	movslq	%r15d, %rcx
LBB0_11:
	movq	%r14, %rax
	addq	%rcx, %rax
	xorl	%edi, %edi
	cmpq	%rax, %rbx
	sete	%dil
	callq	_Assert
	movq	%r14, %rax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_STATS_NDISTINCT_MAGIC,4,2      ## @STATS_NDISTINCT_MAGIC
	.comm	_STATS_NDISTINCT_TYPE_BASIC,4,2 ## @STATS_NDISTINCT_TYPE_BASIC
	.comm	_VARHDRSZ,4,2                   ## @VARHDRSZ
	.comm	_SizeOfHeader,4,2               ## @SizeOfHeader
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_statext_ndistinct_serialize    ; -- Begin function statext_ndistinct_serialize
	.p2align	2
_statext_ndistinct_serialize:           ; @statext_ndistinct_serialize
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	mov	x19, x0
	ldr	w8, [x0]
Lloh0:
	adrp	x9, _STATS_NDISTINCT_MAGIC@GOTPAGE
Lloh1:
	ldr	x9, [x9, _STATS_NDISTINCT_MAGIC@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	cmp	w8, w9
	cset	w0, eq
	bl	_Assert
	mov	x22, x19
	ldr	w8, [x22, #4]!
Lloh3:
	adrp	x9, _STATS_NDISTINCT_TYPE_BASIC@GOTPAGE
Lloh4:
	ldr	x9, [x9, _STATS_NDISTINCT_TYPE_BASIC@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	cmp	w8, w9
	cset	w0, eq
	bl	_Assert
Lloh6:
	adrp	x8, _VARHDRSZ@GOTPAGE
Lloh7:
	ldr	x8, [x8, _VARHDRSZ@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
Lloh9:
	adrp	x9, _SizeOfHeader@GOTPAGE
Lloh10:
	ldr	x9, [x9, _SizeOfHeader@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	add	w23, w9, w8
	mov	x20, x19
	ldr	w8, [x20, #8]!
	cmp	w8, #1
	b.lt	LBB0_3
; %bb.1:
	mov	x24, #0
	mov	w25, #4
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #16]
	ldr	w0, [x8, x25]
	bl	_bms_num_members
	mov	x21, x0
	cmp	w0, #1
	cset	w0, gt
	bl	_Assert
	mov	x0, x21
	bl	_SizeOfItem
	add	w23, w0, w23
	add	x24, x24, #1
	ldrsw	x8, [x19, #8]
	add	x25, x25, #8
	cmp	x24, x8
	b.lt	LBB0_2
LBB0_3:
	mov	x0, x23
	bl	_palloc
	mov	x21, x0
	mov	x1, x23
	bl	_SET_VARSIZE
	mov	x0, x21
	bl	_VARDATA
	mov	x24, x0
	mov	x1, x19
	mov	w2, #4
	bl	_memcpy
	add	x0, x24, #4
	mov	x1, x22
	mov	w2, #4
	bl	_memcpy
	add	x0, x24, #8
	mov	x1, x20
	mov	w2, #4
	bl	_memcpy
	add	x22, x24, #12
	ldr	w8, [x19, #8]
	cmp	w8, #0
	b.le	LBB0_9
; %bb.4:
	mov	x25, #0
                                        ; kill: def $w23 killed $w23 killed $x23 def $x23
	sxtw	x24, w23
	add	x26, x21, x24
	b	LBB0_6
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	cmp	x22, x26
	cset	w0, ls
	bl	_Assert
	add	x25, x25, #1
	ldrsw	x8, [x20]
	cmp	x25, x8
	b.ge	LBB0_10
LBB0_6:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_8 Depth 2
	ldr	x8, [x19, #16]
	ldr	x8, [x8, x25, lsl #3]
	str	x8, [sp, #8]
	lsr	x0, x8, #32
                                        ; kill: def $w0 killed $w0 killed $x0
	bl	_bms_num_members
	str	w0, [sp, #4]
	add	x1, sp, #8
	mov	x0, x22
	mov	w2, #8
	bl	_memcpy
	add	x0, x22, #8
	add	x1, sp, #4
	mov	w2, #4
	bl	_memcpy
	add	x22, x22, #12
	ldr	w0, [sp, #12]
	mov	w1, #-1
	bl	_bms_next_member
	tbnz	w0, #31, LBB0_5
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x23, x0
LBB0_8:                                 ;   Parent Loop BB0_6 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	str	w23, [sp]
	mov	x1, sp
	mov	x0, x22
	mov	w2, #4
	bl	_memcpy
	add	x22, x22, #4
	ldr	w0, [sp, #12]
	mov	x1, x23
	bl	_bms_next_member
	mov	x23, x0
	tbz	w0, #31, LBB0_8
	b	LBB0_5
LBB0_9:
	sxtw	x24, w23
LBB0_10:
	add	x8, x21, x24
	cmp	x22, x8
	cset	w0, eq
	bl	_Assert
	mov	x0, x21
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_STATS_NDISTINCT_MAGIC,4,2      ; @STATS_NDISTINCT_MAGIC
	.comm	_STATS_NDISTINCT_TYPE_BASIC,4,2 ; @STATS_NDISTINCT_TYPE_BASIC
	.comm	_VARHDRSZ,4,2                   ; @VARHDRSZ
	.comm	_SizeOfHeader,4,2               ; @SizeOfHeader
.subsections_via_symbols
