	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function str_packsize
_str_packsize:                          ## @str_packsize
	.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
	movq	%rdi, %r14
	movl	$1, %esi
	callq	_luaL_checkstring
	movq	%rax, %rbx
	movq	%rax, -64(%rbp)
	leaq	-52(%rbp), %rsi
	movq	%r14, %rdi
	callq	_initheader
	cmpb	$0, (%rbx)
	je	LBB0_1
## %bb.2:
	xorl	%ebx, %ebx
	leaq	L_.str(%rip), %r12
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_3 Depth=1
	addq	%r15, %rbx
	movq	-64(%rbp), %rax
	cmpb	$0, (%rax)
	je	LBB0_6
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	leaq	-52(%rbp), %rdi
	movq	%rbx, %rsi
	leaq	-64(%rbp), %rdx
	leaq	-44(%rbp), %rcx
	leaq	-48(%rbp), %r8
	callq	_getdetails
	movl	%eax, %r13d
	movslq	-48(%rbp), %rax
	movslq	-44(%rbp), %rcx
	addq	%rax, %rcx
	movl	%ecx, -44(%rbp)
	movq	_MAXSIZE@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	subq	%rcx, %rax
	xorl	%esi, %esi
	cmpq	%rax, %rbx
	setbe	%sil
	movq	%r14, %rdi
	movl	$1, %edx
	movq	%r12, %rcx
	callq	_luaL_argcheck
	movslq	-44(%rbp), %r15
	andl	$-2, %r13d
	cmpl	$128, %r13d
	jne	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%r14, %rdi
	movl	$1, %esi
	leaq	L_.str.1(%rip), %rdx
	callq	_luaL_argerror
	jmp	LBB0_5
LBB0_1:
	xorl	%ebx, %ebx
LBB0_6:
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_lua_pushinteger
	movl	$1, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MAXSIZE,4,2                    ## @MAXSIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"format result too large"

L_.str.1:                               ## @.str.1
	.asciz	"variable-length format"

	.no_dead_strip	_str_packsize
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function str_packsize
_str_packsize:                          ; @str_packsize
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	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
	mov	x19, x0
	mov	w1, #1
	bl	_luaL_checkstring
	mov	x20, x0
	str	x0, [sp, #16]
	add	x1, sp, #28
	mov	x0, x19
	bl	_initheader
	ldrb	w8, [x20]
	cbz	w8, LBB0_5
; %bb.1:
	mov	x20, #0
Lloh0:
	adrp	x24, _MAXSIZE@GOTPAGE
Lloh1:
	ldr	x24, [x24, _MAXSIZE@GOTPAGEOFF]
Lloh2:
	adrp	x21, l_.str@PAGE
Lloh3:
	add	x21, x21, l_.str@PAGEOFF
Lloh4:
	adrp	x22, l_.str.1@PAGE
Lloh5:
	add	x22, x22, l_.str.1@PAGEOFF
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x20, x20, x25
	ldr	x8, [sp, #16]
	ldrb	w8, [x8]
	cbz	w8, LBB0_6
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	add	x0, sp, #28
	add	x2, sp, #16
	add	x3, sp, #12
	add	x4, sp, #8
	mov	x1, x20
	bl	_getdetails
	mov	x23, x0
	ldpsw	x8, x9, [sp, #8]
	ldrsw	x10, [x24]
	add	x8, x9, x8
	sub	x9, x10, x8
	str	w8, [sp, #12]
	cmp	x20, x9
	cset	w1, ls
	mov	x0, x19
	mov	w2, #1
	mov	x3, x21
	bl	_luaL_argcheck
	ldrsw	x25, [sp, #12]
	and	w8, w23, #0xfffffffe
	cmp	w8, #128
	b.ne	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x19
	mov	w1, #1
	mov	x2, x22
	bl	_luaL_argerror
	b	LBB0_2
LBB0_5:
	mov	w20, #0
LBB0_6:
	mov	x0, x19
	mov	x1, x20
	bl	_lua_pushinteger
	mov	w0, #1
	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
	add	sp, sp, #112
	ret
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_MAXSIZE,4,2                    ; @MAXSIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"format result too large"

l_.str.1:                               ; @.str.1
	.asciz	"variable-length format"

	.no_dead_strip	_str_packsize
.subsections_via_symbols
