	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_file_apprentice                ## -- Begin function file_apprentice
	.p2align	4, 0x90
_file_apprentice:                       ## @file_apprentice
	.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	%edx, %r13d
	movq	%rsi, %rbx
	movq	%rdi, %r12
	xorl	%esi, %esi
	callq	_file_reset
	xorl	%eax, %eax
	callq	_init_file_tables
	testq	%rbx, %rbx
	jne	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	_getenv
	movq	%rax, %rbx
	testq	%rax, %rax
	je	LBB0_19
LBB0_2:
	movq	%rbx, %rdi
	callq	_estrdup
	testq	%rax, %rax
	je	LBB0_15
## %bb.3:
	movq	%rax, %r14
	movq	_MAGIC_SETS@GOTPCREL(%rip), %r15
	cmpq	$0, (%r15)
	je	LBB0_7
## %bb.4:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r12), %rax
	movq	(%rax,%rbx,8), %rdi
	callq	_mlist_free
	xorl	%eax, %eax
	callq	_mlist_alloc
	movq	(%r12), %rcx
	movq	%rax, (%rcx,%rbx,8)
	testq	%rax, %rax
	je	LBB0_16
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	incq	%rbx
	cmpq	(%r15), %rbx
	jb	LBB0_5
LBB0_7:
	movl	%r13d, %r15d
	movl	$-1, %r13d
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	movq	%r14, %rbx
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_8 Depth=1
	xorl	%r14d, %r14d
	cmpb	$0, (%rbx)
	je	LBB0_12
LBB0_11:                                ##   in Loop: Header=BB0_8 Depth=1
	movq	%r12, %rdi
	movq	%rbx, %rsi
	movl	%r15d, %edx
	callq	_apprentice_1
	movl	%r13d, %edi
	movl	%eax, %esi
	callq	_MAX
	movl	%eax, %r13d
	movq	%r14, %rbx
	testq	%r14, %r14
	je	LBB0_12
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	_PATHSEP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_strchr
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	movq	%rax, %r14
	incq	%r14
	movb	$0, (%rax)
	cmpb	$0, (%rbx)
	jne	LBB0_11
LBB0_12:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_efree
	cmpl	$-1, %r13d
	je	LBB0_24
## %bb.13:
	movl	%r15d, %ecx
	andl	$-4, %ecx
	xorl	%eax, %eax
	cmpl	$128, %ecx
	je	LBB0_31
## %bb.14:
	leaq	L_.str.2(%rip), %rdx
	movq	%r12, %rdi
	xorl	%esi, %esi
	movl	%r15d, %ecx
	xorl	%eax, %eax
	callq	_file_error
	jmp	LBB0_30
LBB0_15:
	movq	%rbx, %rdi
	callq	_strlen
	movq	%r12, %rdi
	movl	%eax, %esi
LBB0_29:
	callq	_file_oomem
	jmp	LBB0_30
LBB0_16:
	movq	%r12, %rdi
	movl	$4, %esi
	callq	_file_oomem
	testq	%rbx, %rbx
	je	LBB0_18
	.p2align	4, 0x90
LBB0_17:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r12), %rax
	movq	-8(%rax,%rbx,8), %rdi
	callq	_mlist_free
	movq	(%r12), %rax
	movq	$0, -8(%rax,%rbx,8)
	decq	%rbx
	jne	LBB0_17
LBB0_18:
	movq	%r14, %rdi
	callq	_efree
	jmp	LBB0_30
LBB0_19:
	movq	_MAGIC_SETS@GOTPCREL(%rip), %r14
	cmpq	$0, (%r14)
	je	LBB0_23
## %bb.20:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_21:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r12), %rax
	movq	(%rax,%rbx,8), %rdi
	callq	_mlist_free
	xorl	%eax, %eax
	callq	_mlist_alloc
	movq	(%r12), %rcx
	movq	%rax, (%rcx,%rbx,8)
	testq	%rax, %rax
	je	LBB0_28
## %bb.22:                              ##   in Loop: Header=BB0_21 Depth=1
	incq	%rbx
	cmpq	(%r14), %rbx
	jb	LBB0_21
LBB0_23:
	movq	%r12, %rdi
	xorl	%esi, %esi
	movl	%r13d, %edx
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_apprentice_1                   ## TAILCALL
LBB0_24:
	movq	_MAGIC_SETS@GOTPCREL(%rip), %r14
	cmpq	$0, (%r14)
	je	LBB0_27
## %bb.25:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_26:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r12), %rax
	movq	(%rax,%rbx,8), %rdi
	callq	_mlist_free
	movq	(%r12), %rax
	movq	$0, (%rax,%rbx,8)
	incq	%rbx
	cmpq	(%r14), %rbx
	jb	LBB0_26
LBB0_27:
	leaq	L_.str.1(%rip), %rdx
	movq	%r12, %rdi
	xorl	%esi, %esi
	xorl	%eax, %eax
	callq	_file_error
LBB0_30:
	movl	$-1, %eax
LBB0_31:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_28:
	movq	%r12, %rdi
	movl	$4, %esi
	jmp	LBB0_29
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"MAGIC"

	.comm	_MAGIC_SETS,8,3                 ## @MAGIC_SETS
	.comm	_PATHSEP,4,2                    ## @PATHSEP
L_.str.1:                               ## @.str.1
	.asciz	"could not find any valid magic files!"

L_.str.2:                               ## @.str.2
	.asciz	"Invalid action %d"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_file_apprentice                ; -- Begin function file_apprentice
	.p2align	2
_file_apprentice:                       ; @file_apprentice
	.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	x20, x2
	mov	x22, x1
	mov	x19, x0
	mov	w1, #0
	bl	_file_reset
	bl	_init_file_tables
	cbnz	x22, LBB0_2
; %bb.1:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_getenv
	mov	x22, x0
	cbz	x0, LBB0_20
LBB0_2:
	mov	x0, x22
	bl	_estrdup
	cbz	x0, LBB0_15
; %bb.3:
	mov	x21, x0
Lloh2:
	adrp	x25, _MAGIC_SETS@GOTPAGE
Lloh3:
	ldr	x25, [x25, _MAGIC_SETS@GOTPAGEOFF]
	ldr	x8, [x25]
	cbz	x8, LBB0_7
; %bb.4:
	mov	x22, #0
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19]
	lsl	x23, x22, #3
	ldr	x0, [x8, x23]
	bl	_mlist_free
	bl	_mlist_alloc
	ldr	x8, [x19]
	str	x0, [x8, x23]
	cbz	x0, LBB0_16
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	add	x22, x22, #1
	ldr	x8, [x25]
	cmp	x22, x8
	b.lo	LBB0_5
LBB0_7:
	mov	w22, #-1
Lloh4:
	adrp	x26, _PATHSEP@GOTPAGE
Lloh5:
	ldr	x26, [x26, _PATHSEP@GOTPAGEOFF]
	mov	x23, x21
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x26]
	mov	x0, x23
	bl	_strchr
	mov	x24, x0
	cbz	x0, LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	strb	wzr, [x24], #1
LBB0_10:                                ;   in Loop: Header=BB0_8 Depth=1
	ldrb	w8, [x23]
	cbz	w8, LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_8 Depth=1
	mov	x0, x19
	mov	x1, x23
	mov	x2, x20
	bl	_apprentice_1
	mov	x1, x0
	mov	x0, x22
	bl	_MAX
	mov	x22, x0
	mov	x23, x24
	cbnz	x24, LBB0_8
LBB0_12:
	mov	x0, x21
	bl	_efree
	cmn	w22, #1
	b.eq	LBB0_25
; %bb.13:
	and	w8, w20, #0xfffffffc
	cmp	w8, #128
	b.ne	LBB0_29
; %bb.14:
	mov	w0, #0
	b	LBB0_32
LBB0_15:
	mov	x0, x22
	bl	_strlen
	mov	x1, x0
	mov	x0, x19
	bl	_file_oomem
	b	LBB0_31
LBB0_16:
	mov	x0, x19
	mov	w1, #4
	bl	_file_oomem
	cbz	x22, LBB0_19
; %bb.17:
	sub	x20, x22, #1
LBB0_18:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19]
	lsl	x22, x20, #3
	ldr	x0, [x8, x22]
	bl	_mlist_free
	ldr	x8, [x19]
	str	xzr, [x8, x22]
	sub	x20, x20, #1
	cmn	x20, #1
	b.ne	LBB0_18
LBB0_19:
	mov	x0, x21
	bl	_efree
	b	LBB0_31
LBB0_20:
Lloh6:
	adrp	x21, _MAGIC_SETS@GOTPAGE
Lloh7:
	ldr	x21, [x21, _MAGIC_SETS@GOTPAGEOFF]
	ldr	x8, [x21]
	cbz	x8, LBB0_24
; %bb.21:
	mov	x22, #0
LBB0_22:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19]
	lsl	x23, x22, #3
	ldr	x0, [x8, x23]
	bl	_mlist_free
	bl	_mlist_alloc
	ldr	x8, [x19]
	str	x0, [x8, x23]
	cbz	x0, LBB0_33
; %bb.23:                               ;   in Loop: Header=BB0_22 Depth=1
	add	x22, x22, #1
	ldr	x8, [x21]
	cmp	x22, x8
	b.lo	LBB0_22
LBB0_24:
	mov	x0, x19
	mov	x1, #0
	mov	x2, x20
	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
	b	_apprentice_1
LBB0_25:
	ldr	x8, [x25]
	cbz	x8, LBB0_28
; %bb.26:
	mov	x20, #0
LBB0_27:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19]
	lsl	x21, x20, #3
	ldr	x0, [x8, x21]
	bl	_mlist_free
	ldr	x8, [x19]
	str	xzr, [x8, x21]
	add	x20, x20, #1
	ldr	x8, [x25]
	cmp	x20, x8
	b.lo	LBB0_27
LBB0_28:
Lloh8:
	adrp	x2, l_.str.1@PAGE
Lloh9:
	add	x2, x2, l_.str.1@PAGEOFF
	b	LBB0_30
LBB0_29:
	str	x20, [sp]
Lloh10:
	adrp	x2, l_.str.2@PAGE
Lloh11:
	add	x2, x2, l_.str.2@PAGEOFF
LBB0_30:
	mov	x0, x19
	mov	w1, #0
	bl	_file_error
LBB0_31:
	mov	w0, #-1
LBB0_32:
	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
LBB0_33:
	mov	x0, x19
	mov	w1, #4
	bl	_file_oomem
	b	LBB0_31
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"MAGIC"

	.comm	_MAGIC_SETS,8,3                 ; @MAGIC_SETS
	.comm	_PATHSEP,4,2                    ; @PATHSEP
l_.str.1:                               ; @.str.1
	.asciz	"could not find any valid magic files!"

l_.str.2:                               ; @.str.2
	.asciz	"Invalid action %d"

.subsections_via_symbols
