	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_filesys_lookup_file            ## -- Begin function filesys_lookup_file
	.p2align	4, 0x90
_filesys_lookup_file:                   ## @filesys_lookup_file
	.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
	movl	%esi, %ebx
	movq	%rdi, %r13
	leaq	L_.str(%rip), %rsi
	movl	$3, %edi
	movq	%r13, %rdx
	movl	%ebx, %ecx
	callq	_vkprintf
	cmpb	$47, (%r13)
	jne	LBB0_27
## %bb.1:
	incq	%r13
	movq	_Root@GOTPCREL(%rip), %r15
	movq	(%r15), %r14
	testq	%r14, %r14
	je	LBB0_21
## %bb.2:
	cmpb	$0, (%r13)
	je	LBB0_22
LBB0_3:
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	_MAX_FILENAME_LENGTH@GOTPCREL(%rip), %r15
	xorl	%r12d, %r12d
LBB0_4:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_10 Depth 2
	movq	%r13, %rdi
	movl	$47, %esi
	callq	_strchr
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%rax, %rbx
	subq	%r13, %rbx
	cmpl	%ebx, (%r15)
	jge	LBB0_7
	jmp	LBB0_23
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	%r13, %rdi
	callq	_strlen
	movl	%eax, %ebx
	cmpl	%ebx, (%r15)
	jl	LBB0_23
LBB0_7:                                 ##   in Loop: Header=BB0_4 Depth=1
	movl	$1, %edi
	callq	_assert
	movq	8(%r14), %r15
	testq	%r15, %r15
	je	LBB0_16
## %bb.8:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	addq	$8, %r14
	movslq	%ebx, %r12
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_10 Depth=2
	movq	%r15, %r14
	movq	16(%r15), %rax
	addq	$16, %r14
	movq	%rax, %r15
	testq	%rax, %rax
	je	LBB0_15
LBB0_10:                                ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	24(%r15), %rdi
	movq	%r13, %rsi
	movl	%ebx, %edx
	callq	_memcmp
	testl	%eax, %eax
	jne	LBB0_9
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=2
	movq	24(%r15), %rax
	cmpl	$0, (%rax,%r12,4)
	jne	LBB0_9
## %bb.12:                              ##   in Loop: Header=BB0_4 Depth=1
	cmpb	$0, (%r13,%r12)
	jne	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	addl	$-128, %eax
	cmpl	$3, %eax
	jbe	LBB0_24
LBB0_14:                                ##   in Loop: Header=BB0_4 Depth=1
	addq	%r12, %r13
	movq	16(%r15), %rax
	movq	%rax, (%r14)
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rcx), %rax
	movq	%rax, 16(%r15)
	movq	%r15, (%rcx)
	incq	%r13
	cmpl	$0, (%r15)
	movq	%r15, %r14
	movl	$0, %r12d
	movq	_MAX_FILENAME_LENGTH@GOTPCREL(%rip), %r15
	js	LBB0_4
	jmp	LBB0_23
LBB0_15:
	movq	-64(%rbp), %r14                 ## 8-byte Reload
LBB0_16:
	cmpl	$0, -56(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_27
## %bb.17:
	movslq	%ebx, %rax
	cmpb	$0, (%r13,%rax)
	jne	LBB0_27
## %bb.18:
	cmpl	$0, (%r14)
	jns	LBB0_27
## %bb.19:
	movq	%r14, %rdi
	movl	$2, %esi
	callq	_do_check_perm
	testq	%rax, %rax
	je	LBB0_20
LBB0_27:
	xorl	%r12d, %r12d
LBB0_23:
	movq	%r12, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_21:
	movq	_tot_directory_nodes@GOTPCREL(%rip), %rax
	incl	(%rax)
	movl	$48, %edi
	callq	_zmalloc0
	movq	%rax, (%r15)
	movl	$-1, (%rax)
	movq	_S_IFDIR@GOTPCREL(%rip), %rcx
	movl	$511, %edx                      ## imm = 0x1FF
	orl	(%rcx), %edx
	movl	%edx, 4(%rax)
	movl	$1, %edi
	callq	_zmalloc0
	movq	(%r15), %r14
	movq	%rax, 24(%r14)
	movq	_now@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 40(%r14)
	cmpb	$0, (%r13)
	jne	LBB0_3
LBB0_22:
	movq	%r14, %r12
	jmp	LBB0_23
LBB0_20:
	movq	_tot_directory_nodes@GOTPCREL(%rip), %rax
	incl	(%rax)
	movl	$48, %edi
	callq	_zmalloc
	movq	%rax, %r12
	movq	%r14, 32(%rax)
	incl	%ebx
	movl	%ebx, %edi
	callq	_zmalloc
	movq	%rax, 24(%r12)
	movq	%rax, %rdi
	movq	%r13, %rsi
	callq	_strcpy
	movq	$0, 8(%r12)
	movq	8(%r14), %rax
	movq	%rax, 16(%r12)
	movl	$-1, (%r12)
	movq	%r12, 8(%r14)
	movq	%r12, %rdi
	callq	_filesys_update_modification_time
	jmp	LBB0_23
LBB0_24:
	leaq	LJTI0_0(%rip), %rcx
	movslq	(%rcx,%rax,4), %rax
	addq	%rcx, %rax
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	xorl	%r12d, %r12d
	jmpq	*%rax
LBB0_25:
	cmpl	$0, (%r15)
	js	LBB0_27
LBB0_26:
	movq	32(%r15), %rdi
	movl	$2, %esi
	callq	_do_check_perm
	testq	%rax, %rax
	jne	LBB0_27
## %bb.31:
	movq	16(%r15), %rax
	movq	%rax, (%r14)
	movq	%rbx, %rdi
	callq	_filesys_update_modification_time
	movq	%r15, %r12
	jmp	LBB0_23
LBB0_28:
	cmpl	$0, (%r15)
	jns	LBB0_27
## %bb.29:
	cmpq	$0, 8(%r15)
	jne	LBB0_27
	jmp	LBB0_26
LBB0_32:
	movq	16(%r15), %rax
	movq	%rax, (%r14)
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rcx), %rax
	movq	%rax, 16(%r15)
	movq	%r15, (%rcx)
	movq	%r15, %r12
	jmp	LBB0_23
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_25, LBB0_25-LJTI0_0
.set L0_0_set_28, LBB0_28-LJTI0_0
.set L0_0_set_32, LBB0_32-LJTI0_0
.set L0_0_set_23, LBB0_23-LJTI0_0
LJTI0_0:
	.long	L0_0_set_25
	.long	L0_0_set_28
	.long	L0_0_set_32
	.long	L0_0_set_23
	.end_data_region
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"filesys_lookup_file (%s, %d)\n"

	.comm	_Root,8,3                       ## @Root
	.comm	_tot_directory_nodes,4,2        ## @tot_directory_nodes
	.comm	_S_IFDIR,4,2                    ## @S_IFDIR
	.comm	_now,4,2                        ## @now
	.comm	_MAX_FILENAME_LENGTH,4,2        ## @MAX_FILENAME_LENGTH
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_filesys_lookup_file            ; -- Begin function filesys_lookup_file
	.p2align	2
_filesys_lookup_file:                   ; @filesys_lookup_file
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #3
	mov	x2, x19
	mov	x3, x21
	bl	_vkprintf
	ldrb	w8, [x19]
	cmp	w8, #47
	b.ne	LBB0_20
; %bb.1:
	add	x20, x19, #1
Lloh2:
	adrp	x22, _Root@GOTPAGE
Lloh3:
	ldr	x22, [x22, _Root@GOTPAGEOFF]
	ldr	x19, [x22]
	cbz	x19, LBB0_22
; %bb.2:
	ldrb	w8, [x20]
	cbz	w8, LBB0_23
LBB0_3:
Lloh4:
	adrp	x26, _MAX_FILENAME_LENGTH@GOTPAGE
Lloh5:
	ldr	x26, [x26, _MAX_FILENAME_LENGTH@GOTPAGEOFF]
	sub	w25, w21, #128
LBB0_4:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_11 Depth 2
	mov	x0, x20
	mov	w1, #47
	bl	_strchr
	cbz	x0, LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	sub	x22, x0, x20
	b	LBB0_7
LBB0_6:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x20
	bl	_strlen
	mov	w22, w0
LBB0_7:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x26]
	cmp	w8, w22
	b.lt	LBB0_20
; %bb.8:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	w0, #1
	bl	_assert
	mov	x28, x19
	ldr	x24, [x28, #8]!
	cbz	x24, LBB0_16
; %bb.9:                                ;   in Loop: Header=BB0_4 Depth=1
	sxtw	x23, w22
	mov	x27, x28
	b	LBB0_11
LBB0_10:                                ;   in Loop: Header=BB0_11 Depth=2
	ldr	x8, [x24, #16]!
	mov	x27, x24
	mov	x24, x8
	cbz	x8, LBB0_16
LBB0_11:                                ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x0, [x24, #24]
	mov	x1, x20
	mov	x2, x22
	bl	_memcmp
	cbnz	w0, LBB0_10
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=2
	ldr	x8, [x24, #24]
	ldr	w8, [x8, x23, lsl #2]
	cbnz	w8, LBB0_10
; %bb.13:                               ;   in Loop: Header=BB0_4 Depth=1
	add	x8, x20, x23
	ldrb	w9, [x8]
	cbnz	w9, LBB0_15
; %bb.14:                               ;   in Loop: Header=BB0_4 Depth=1
	cmp	w25, #3
	b.ls	LBB0_25
LBB0_15:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x23, #0
	ldr	x9, [x24, #16]
	str	x9, [x27]
	ldr	x9, [x28]
	str	x9, [x24, #16]
	str	x24, [x28]
	ldr	w9, [x24]
	add	x20, x8, #1
	mov	x19, x24
	tbnz	w9, #31, LBB0_4
	b	LBB0_21
LBB0_16:
	cbz	w21, LBB0_20
; %bb.17:
	ldrb	w8, [x20, w22, sxtw]
	cbnz	w8, LBB0_20
; %bb.18:
	ldr	w8, [x19]
	tbz	w8, #31, LBB0_20
; %bb.19:
	mov	x0, x19
	mov	w1, #2
	bl	_do_check_perm
	cbz	x0, LBB0_24
LBB0_20:
	mov	x23, #0
LBB0_21:
	mov	x0, x23
	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
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_22:
Lloh6:
	adrp	x8, _tot_directory_nodes@GOTPAGE
Lloh7:
	ldr	x8, [x8, _tot_directory_nodes@GOTPAGEOFF]
	ldr	w9, [x8]
	add	w9, w9, #1
	str	w9, [x8]
	mov	w0, #48
	bl	_zmalloc0
	str	x0, [x22]
	mov	w8, #-1
	str	w8, [x0]
Lloh8:
	adrp	x8, _S_IFDIR@GOTPAGE
Lloh9:
	ldr	x8, [x8, _S_IFDIR@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	orr	w8, w8, #0x1ff
	str	w8, [x0, #4]
	mov	w0, #1
	bl	_zmalloc0
	ldr	x19, [x22]
	str	x0, [x19, #24]
Lloh11:
	adrp	x8, _now@GOTPAGE
Lloh12:
	ldr	x8, [x8, _now@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	str	w8, [x19, #40]
	ldrb	w8, [x20]
	cbnz	w8, LBB0_3
LBB0_23:
	mov	x23, x19
	b	LBB0_21
LBB0_24:
Lloh14:
	adrp	x8, _tot_directory_nodes@GOTPAGE
Lloh15:
	ldr	x8, [x8, _tot_directory_nodes@GOTPAGEOFF]
	ldr	w9, [x8]
	add	w9, w9, #1
	str	w9, [x8]
	mov	w0, #48
	bl	_zmalloc
	mov	x23, x0
	str	x19, [x0, #32]
	add	w0, w22, #1
	bl	_zmalloc
	str	x0, [x23, #24]
	mov	x1, x20
	bl	_strcpy
	str	xzr, [x23, #8]
	ldr	x8, [x19, #8]
	str	x8, [x23, #16]
	mov	w8, #-1
	str	w8, [x23]
	str	x23, [x19, #8]
	mov	x0, x23
	bl	_filesys_update_modification_time
	b	LBB0_21
LBB0_25:
	mov	x23, #0
Lloh16:
	adrp	x8, lJTI0_0@PAGE
Lloh17:
	add	x8, x8, lJTI0_0@PAGEOFF
	adr	x9, LBB0_21
	ldrb	w10, [x8, x25]
	add	x9, x9, x10, lsl #2
	br	x9
LBB0_26:
	ldr	w8, [x24]
	tbnz	w8, #31, LBB0_20
LBB0_27:
	ldr	x0, [x24, #32]
	mov	w1, #2
	bl	_do_check_perm
	cbnz	x0, LBB0_20
; %bb.28:
	ldr	x8, [x24, #16]
	str	x8, [x27]
	mov	x0, x19
	bl	_filesys_update_modification_time
	mov	x23, x24
	b	LBB0_21
LBB0_29:
	ldr	w8, [x24]
	tbz	w8, #31, LBB0_20
; %bb.30:
	ldr	x8, [x24, #8]
	cbnz	x8, LBB0_20
	b	LBB0_27
LBB0_31:
	ldr	x8, [x24, #16]
	str	x8, [x27]
	ldr	x8, [x28]
	str	x8, [x24, #16]
	str	x24, [x28]
	mov	x23, x24
	b	LBB0_21
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_26-LBB0_21)>>2
	.byte	(LBB0_29-LBB0_21)>>2
	.byte	(LBB0_31-LBB0_21)>>2
	.byte	(LBB0_21-LBB0_21)>>2
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"filesys_lookup_file (%s, %d)\n"

	.comm	_Root,8,3                       ; @Root
	.comm	_tot_directory_nodes,4,2        ; @tot_directory_nodes
	.comm	_S_IFDIR,4,2                    ; @S_IFDIR
	.comm	_now,4,2                        ; @now
	.comm	_MAX_FILENAME_LENGTH,4,2        ; @MAX_FILENAME_LENGTH
.subsections_via_symbols
