	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function str_unpack
_str_unpack:                            ## @str_unpack
	.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, %r15
	movl	$1, %esi
	callq	_luaL_checkstring
	movq	%rax, %r12
	movq	%rax, -80(%rbp)
	leaq	-72(%rbp), %rdx
	movq	%r15, %rdi
	movl	$2, %esi
	callq	_luaL_checklstring
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	%r15, %rdi
	movl	$3, %esi
	movl	$1, %edx
	callq	_luaL_optinteger
	movq	-72(%rbp), %rsi
	movl	%eax, %edi
	callq	_posrelat
	movq	%rax, %r14
	decq	%r14
	xorl	%esi, %esi
	cmpq	-72(%rbp), %r14
	setbe	%sil
	leaq	L_.str(%rip), %rcx
	movq	%r15, %rdi
	movl	$3, %edx
	callq	_luaL_argcheck
	leaq	-48(%rbp), %rsi
	movq	%r15, %rdi
	callq	_initheader
	cmpb	$0, (%r12)
	je	LBB0_1
## %bb.2:
	xorl	%ebx, %ebx
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_3 Depth=1
	movl	%ebx, %r13d
LBB0_14:                                ##   in Loop: Header=BB0_3 Depth=1
	movslq	-44(%rbp), %rax
	addq	%rax, %r14
	movq	-80(%rbp), %rax
	cmpb	$0, (%rax)
	movl	%r13d, %ebx
	je	LBB0_15
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	leaq	-48(%rbp), %rdi
	movq	%r14, %rsi
	leaq	-80(%rbp), %rdx
	leaq	-44(%rbp), %rcx
	leaq	-60(%rbp), %r8
	callq	_getdetails
	movl	%eax, %r12d
	movslq	-60(%rbp), %rax
	movslq	-44(%rbp), %rcx
	addq	%rax, %rcx
	addq	%r14, %rcx
	jb	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	cmpq	-72(%rbp), %rcx
	jbe	LBB0_6
LBB0_5:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	%r15, %rdi
	movl	$2, %esi
	leaq	L_.str.1(%rip), %rdx
	callq	_luaL_argerror
	movslq	-60(%rbp), %rax
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=1
	addq	%rax, %r14
	movq	%r15, %rdi
	movl	$2, %esi
	leaq	L_.str.2(%rip), %rdx
	callq	_luaL_checkstack
	leal	1(%rbx), %r13d
	leal	-128(%r12), %eax
	cmpl	$8, %eax
	ja	LBB0_14
## %bb.7:                               ##   in Loop: Header=BB0_3 Depth=1
	leaq	LJTI0_0(%rip), %rcx
	movslq	(%rcx,%rax,4), %rax
	addq	%rcx, %rax
	jmpq	*%rax
LBB0_8:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	leaq	(%rax,%r14), %rsi
	movl	-48(%rbp), %edx
	movl	-44(%rbp), %ecx
	xorl	%r8d, %r8d
	cmpl	$134, %r12d
	sete	%r8b
	movq	%r15, %rdi
	callq	_unpackint
	movq	%r15, %rdi
	movq	%rax, %rsi
	callq	_lua_pushinteger
	jmp	LBB0_14
LBB0_12:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	leaq	(%rax,%r14), %rbx
	movq	%rbx, %rdi
	callq	_strlen
	movslq	%eax, %r12
	movq	%r15, %rdi
	movq	%rbx, %rsi
	movq	%r12, %rdx
	callq	_lua_pushlstring
	addq	%r12, %r14
	incq	%r14
	jmp	LBB0_14
LBB0_11:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	leaq	(%rax,%r14), %r12
	movl	-48(%rbp), %edx
	movl	-44(%rbp), %ecx
	movq	%r15, %rdi
	movq	%r12, %rsi
	xorl	%r8d, %r8d
	callq	_unpackint
	movq	%rax, %rbx
	addq	%rax, %r14
	movslq	-44(%rbp), %rax
	addq	%r14, %rax
	xorl	%esi, %esi
	cmpq	-72(%rbp), %rax
	setbe	%sil
	movq	%r15, %rdi
	movl	$2, %edx
	leaq	L_.str.1(%rip), %rcx
	callq	_luaL_argcheck
	movslq	-44(%rbp), %rsi
	addq	%r12, %rsi
	movq	%r15, %rdi
	movq	%rbx, %rdx
	callq	_lua_pushlstring
	jmp	LBB0_14
LBB0_9:                                 ##   in Loop: Header=BB0_3 Depth=1
	movl	-84(%rbp), %edi
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	leaq	(%rax,%r14), %rsi
	movl	-44(%rbp), %edx
	movl	-48(%rbp), %ecx
	callq	_copywithendian
	movl	-88(%rbp), %esi
	movq	%r15, %rdi
	callq	_lua_pushnumber
	jmp	LBB0_14
LBB0_10:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	leaq	(%rax,%r14), %rsi
	movslq	-44(%rbp), %rdx
	movq	%r15, %rdi
	callq	_lua_pushlstring
	jmp	LBB0_14
LBB0_1:
	xorl	%r13d, %r13d
LBB0_15:
	incq	%r14
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_lua_pushinteger
	incl	%r13d
	movl	%r13d, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_12, LBB0_12-LJTI0_0
.set L0_0_set_8, LBB0_8-LJTI0_0
.set L0_0_set_11, LBB0_11-LJTI0_0
.set L0_0_set_13, LBB0_13-LJTI0_0
.set L0_0_set_9, LBB0_9-LJTI0_0
.set L0_0_set_10, LBB0_10-LJTI0_0
LJTI0_0:
	.long	L0_0_set_12
	.long	L0_0_set_8
	.long	L0_0_set_11
	.long	L0_0_set_13
	.long	L0_0_set_13
	.long	L0_0_set_13
	.long	L0_0_set_8
	.long	L0_0_set_9
	.long	L0_0_set_10
	.end_data_region
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"initial position out of string"

L_.str.1:                               ## @.str.1
	.asciz	"data string too short"

L_.str.2:                               ## @.str.2
	.asciz	"too many results"

	.no_dead_strip	_str_unpack
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function str_unpack
_str_unpack:                            ; @str_unpack
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x0
	mov	w1, #1
	bl	_luaL_checkstring
	mov	x21, x0
	str	x0, [sp, #32]
	add	x2, sp, #24
	mov	x0, x19
	mov	w1, #2
	bl	_luaL_checklstring
	mov	x20, x0
	mov	x0, x19
	mov	w1, #3
	mov	w2, #1
	bl	_luaL_optinteger
	ldr	x1, [sp, #24]
	bl	_posrelat
	sub	x23, x0, #1
	ldr	x8, [sp, #24]
	cmp	x23, x8
	cset	w1, ls
Lloh0:
	adrp	x3, l_.str@PAGE
Lloh1:
	add	x3, x3, l_.str@PAGEOFF
	mov	x0, x19
	mov	w2, #3
	bl	_luaL_argcheck
	add	x1, sp, #40
	mov	x0, x19
	bl	_initheader
	ldrb	w8, [x21]
	cbz	w8, LBB0_14
; %bb.1:
	mov	w28, #0
Lloh2:
	adrp	x21, l_.str.1@PAGE
Lloh3:
	add	x21, x21, l_.str.1@PAGEOFF
Lloh4:
	adrp	x22, l_.str.2@PAGE
Lloh5:
	add	x22, x22, l_.str.2@PAGEOFF
Lloh6:
	adrp	x25, lJTI0_0@PAGE
Lloh7:
	add	x25, x25, lJTI0_0@PAGEOFF
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	x26, x28
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldrsw	x8, [sp, #20]
	add	x23, x27, x8
	ldr	x8, [sp, #32]
	ldrb	w8, [x8]
	mov	x28, x26
	cbz	w8, LBB0_15
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	add	x0, sp, #40
	add	x2, sp, #32
	add	x3, sp, #20
	add	x4, sp, #16
	mov	x1, x23
	bl	_getdetails
	mov	x24, x0
	ldpsw	x8, x9, [sp, #16]
	add	x9, x9, x8
	cmn	x23, x9
	b.hs	LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x10, [sp, #24]
	add	x9, x9, x23
	cmp	x9, x10
	b.ls	LBB0_7
LBB0_6:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x19
	mov	w1, #2
	mov	x2, x21
	bl	_luaL_argerror
	ldrsw	x8, [sp, #16]
LBB0_7:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x27, x23, x8
	mov	x0, x19
	mov	w1, #2
	mov	x2, x22
	bl	_luaL_checkstack
	add	w26, w28, #1
	sub	w8, w24, #128
	cmp	w8, #8
	b.hi	LBB0_3
; %bb.8:                                ;   in Loop: Header=BB0_4 Depth=1
	adr	x9, LBB0_2
	ldrb	w10, [x25, x8]
	add	x9, x9, x10, lsl #2
	br	x9
LBB0_9:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x1, x20, x27
	ldr	w2, [sp, #40]
	ldr	w3, [sp, #20]
	cmp	w24, #134
	cset	w4, eq
	mov	x0, x19
	bl	_unpackint
	mov	x1, x0
	mov	x0, x19
	bl	_lua_pushinteger
	b	LBB0_3
LBB0_10:                                ;   in Loop: Header=BB0_4 Depth=1
	add	x23, x20, x27
	mov	x0, x23
	bl	_strlen
	sxtw	x24, w0
	mov	x0, x19
	mov	x1, x23
	mov	x2, x24
	bl	_lua_pushlstring
	add	x8, x27, x24
	add	x27, x8, #1
	b	LBB0_3
LBB0_11:                                ;   in Loop: Header=BB0_4 Depth=1
	add	x23, x20, x27
	ldr	w2, [sp, #40]
	ldr	w3, [sp, #20]
	mov	x0, x19
	mov	x1, x23
	mov	w4, #0
	bl	_unpackint
	mov	x24, x0
	ldrsw	x8, [sp, #20]
	add	x27, x0, x27
	add	x8, x27, x8
	ldr	x9, [sp, #24]
	cmp	x8, x9
	cset	w1, ls
	mov	x0, x19
	mov	w2, #2
	mov	x3, x21
	bl	_luaL_argcheck
	ldrsw	x8, [sp, #20]
	add	x1, x23, x8
	mov	x0, x19
	mov	x2, x24
	bl	_lua_pushlstring
	b	LBB0_3
LBB0_12:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w0, [sp, #8]
	add	x1, x20, x27
	ldr	w2, [sp, #20]
	ldr	w3, [sp, #40]
	bl	_copywithendian
	ldr	w1, [sp, #12]
	mov	x0, x19
	bl	_lua_pushnumber
	b	LBB0_3
LBB0_13:                                ;   in Loop: Header=BB0_4 Depth=1
	add	x1, x20, x27
	ldrsw	x2, [sp, #20]
	mov	x0, x19
	bl	_lua_pushlstring
	b	LBB0_3
LBB0_14:
	mov	w26, #0
LBB0_15:
	add	x1, x23, #1
	mov	x0, x19
	bl	_lua_pushinteger
	add	w0, w26, #1
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_10-LBB0_2)>>2
	.byte	(LBB0_9-LBB0_2)>>2
	.byte	(LBB0_11-LBB0_2)>>2
	.byte	(LBB0_2-LBB0_2)>>2
	.byte	(LBB0_2-LBB0_2)>>2
	.byte	(LBB0_2-LBB0_2)>>2
	.byte	(LBB0_9-LBB0_2)>>2
	.byte	(LBB0_12-LBB0_2)>>2
	.byte	(LBB0_13-LBB0_2)>>2
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"initial position out of string"

l_.str.1:                               ; @.str.1
	.asciz	"data string too short"

l_.str.2:                               ; @.str.2
	.asciz	"too many results"

	.no_dead_strip	_str_unpack
.subsections_via_symbols
