	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_SetQdirFromPath                ## -- Begin function SetQdirFromPath
	.p2align	4, 0x90
_SetQdirFromPath:                       ## @SetQdirFromPath
	.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	$1080, %rsp                     ## imm = 0x438
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r13
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movb	(%rdi), %al
	cmpb	$47, %al
	je	LBB0_4
## %bb.1:
	cmpb	$92, %al
	je	LBB0_4
## %bb.2:
	cmpb	$58, 1(%r13)
	je	LBB0_4
## %bb.3:
	leaq	-1072(%rbp), %rbx
	movq	%rbx, %rdi
	callq	_Q_getwd
	movq	%rbx, %rdi
	movq	%r13, %rsi
	callq	_strcat
	movq	%rbx, %r13
LBB0_4:
	movq	_BASEDIRNAME@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	_strlen
	movq	%rax, %rbx
	movq	%r13, %rdi
	callq	_strlen
	movq	%rax, %r12
	addq	%r13, %r12
	movq	%rbx, -1120(%rbp)               ## 8-byte Spill
	movslq	%ebx, %rcx
	movl	%ecx, %eax
	subl	%r13d, %eax
	movq	%rax, -1096(%rbp)               ## 8-byte Spill
	movq	%rcx, %rax
	movq	%rcx, -1104(%rbp)               ## 8-byte Spill
	leal	1(%rcx), %eax
	movl	%eax, -1084(%rbp)               ## 4-byte Spill
	subl	%r13d, %eax
	movl	%eax, -1080(%rbp)               ## 4-byte Spill
	movq	%r13, -1112(%rbp)               ## 8-byte Spill
	jmp	LBB0_5
LBB0_33:                                ##   in Loop: Header=BB0_5 Depth=1
	leaq	L_.str.2(%rip), %rdi
	movq	%r13, %rsi
	xorl	%eax, %eax
	callq	_Error
LBB0_34:                                ##   in Loop: Header=BB0_5 Depth=1
	movl	-1076(%rbp), %eax               ## 4-byte Reload
LBB0_35:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	%r15, %r12
	testl	%eax, %eax
	je	LBB0_37
LBB0_5:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_8 Depth 2
                                        ##     Child Loop BB0_16 Depth 2
                                        ##     Child Loop BB0_19 Depth 2
                                        ##     Child Loop BB0_26 Depth 2
	leaq	-1(%r12), %r15
	movq	_BASEDIRNAME@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	cmpq	%r13, %r15
	je	LBB0_36
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	%r15, %rdi
	movq	-1120(%rbp), %rdx               ## 8-byte Reload
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_Q_strncasecmp
	testl	%eax, %eax
	jne	LBB0_35
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	%eax, -1076(%rbp)               ## 4-byte Spill
	movq	-1104(%rbp), %rax               ## 8-byte Reload
	addq	%r15, %rax
	movq	-1096(%rbp), %rcx               ## 8-byte Reload
	leal	(%rcx,%r12), %edx
	addl	-1080(%rbp), %r12d              ## 4-byte Folded Reload
	movl	-1084(%rbp), %r14d              ## 4-byte Reload
	.p2align	4, 0x90
LBB0_8:                                 ##   Parent Loop BB0_5 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movzbl	(%rax), %ecx
	testb	%cl, %cl
	je	LBB0_12
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=2
	cmpb	$47, %cl
	je	LBB0_12
## %bb.10:                              ##   in Loop: Header=BB0_8 Depth=2
	cmpb	$92, %cl
	je	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_8 Depth=2
	incq	%rax
	incl	%edx
	incl	%r14d
	incl	%r12d
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	_qdir@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdi
	movq	%r13, %rsi
	callq	_strncpy
	movq	(%rbx), %rsi
	leaq	L_.str(%rip), %rdi
	callq	_qprintf
	movq	(%rbx), %rbx
	movb	(%rbx), %al
	testb	%al, %al
	je	LBB0_18
## %bb.13:                              ##   in Loop: Header=BB0_5 Depth=1
	movl	$1, %r13d
	cmpb	$92, %al
	jne	LBB0_16
	.p2align	4, 0x90
LBB0_15:                                ##   in Loop: Header=BB0_5 Depth=1
	movb	$47, -1(%rbx,%r13)
	movq	_qdir@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
LBB0_16:                                ##   Parent Loop BB0_5 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%rbx, %rdi
	callq	_strlen
	cmpq	%r13, %rax
	jbe	LBB0_18
## %bb.17:                              ##   in Loop: Header=BB0_16 Depth=2
	movzbl	(%rbx,%r13), %eax
	incq	%r13
	cmpb	$92, %al
	je	LBB0_15
	jmp	LBB0_16
	.p2align	4, 0x90
LBB0_18:                                ##   in Loop: Header=BB0_5 Depth=1
	movslq	%r14d, %rax
	addq	%rax, %r15
	movq	-1112(%rbp), %r13               ## 8-byte Reload
	.p2align	4, 0x90
LBB0_19:                                ##   Parent Loop BB0_5 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movzbl	(%r15), %eax
	testb	%al, %al
	je	LBB0_33
## %bb.20:                              ##   in Loop: Header=BB0_19 Depth=2
	cmpb	$92, %al
	je	LBB0_22
## %bb.21:                              ##   in Loop: Header=BB0_19 Depth=2
	cmpb	$47, %al
	je	LBB0_22
## %bb.32:                              ##   in Loop: Header=BB0_19 Depth=2
	incq	%r15
	incl	%r12d
	jmp	LBB0_19
	.p2align	4, 0x90
LBB0_22:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	_gamedir@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	%r13, %rsi
	movl	%r12d, %edx
	movq	%rax, %r12
	callq	_strncpy
	movq	(%r12), %r14
	movb	(%r14), %al
	testb	%al, %al
	je	LBB0_28
## %bb.23:                              ##   in Loop: Header=BB0_5 Depth=1
	movl	$1, %ebx
	cmpb	$92, %al
	jne	LBB0_26
	.p2align	4, 0x90
LBB0_25:                                ##   in Loop: Header=BB0_5 Depth=1
	movb	$47, -1(%r14,%rbx)
	movq	(%r12), %r14
LBB0_26:                                ##   Parent Loop BB0_5 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%r14, %rdi
	callq	_strlen
	cmpq	%rbx, %rax
	jbe	LBB0_28
## %bb.27:                              ##   in Loop: Header=BB0_26 Depth=2
	movzbl	(%r14,%rbx), %eax
	incq	%rbx
	cmpb	$92, %al
	je	LBB0_25
	jmp	LBB0_26
	.p2align	4, 0x90
LBB0_28:                                ##   in Loop: Header=BB0_5 Depth=1
	leaq	L_.str.1(%rip), %rdi
	movq	%r14, %rsi
	callq	_qprintf
	movq	_writedir@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	cmpb	$0, (%rbx)
	je	LBB0_29
## %bb.30:                              ##   in Loop: Header=BB0_5 Depth=1
	movq	%rbx, %rdi
	callq	_strlen
	cmpb	$47, -1(%rax,%rbx)
	je	LBB0_34
## %bb.31:                              ##   in Loop: Header=BB0_5 Depth=1
	movb	$47, (%rbx,%rax)
	movq	_writedir@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movq	%rbx, %rdi
	callq	_strlen
	movb	$0, 1(%rax,%rbx)
	jmp	LBB0_34
LBB0_29:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	(%r12), %rsi
	movq	%rbx, %rdi
	callq	_strcpy
	jmp	LBB0_34
LBB0_36:
	leaq	L_.str.3(%rip), %rdi
	movq	%r13, %rdx
	xorl	%eax, %eax
	callq	_Error
LBB0_37:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_39
## %bb.38:
	addq	$1080, %rsp                     ## imm = 0x438
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_39:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_BASEDIRNAME,8,3                ## @BASEDIRNAME
	.comm	_qdir,8,3                       ## @qdir
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"qdir: %s\n"

	.comm	_gamedir,8,3                    ## @gamedir
L_.str.1:                               ## @.str.1
	.asciz	"gamedir: %s\n"

	.comm	_writedir,8,3                   ## @writedir
L_.str.2:                               ## @.str.2
	.asciz	"No gamedir in %s"

L_.str.3:                               ## @.str.3
	.asciz	"SetQdirFromPath: no '%s' in %s"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_SetQdirFromPath                ; -- Begin function SetQdirFromPath
	.p2align	2
_SetQdirFromPath:                       ; @SetQdirFromPath
	.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
	sub	sp, sp, #1072
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-96]
	ldrb	w8, [x0]
	cmp	w8, #47
	b.eq	LBB0_4
; %bb.1:
	cmp	w8, #92
	b.eq	LBB0_4
; %bb.2:
	ldrb	w8, [x19, #1]
	cmp	w8, #58
	b.eq	LBB0_4
; %bb.3:
	add	x0, sp, #32
	bl	_Q_getwd
	add	x0, sp, #32
	mov	x1, x19
	bl	_strcat
	add	x19, sp, #32
LBB0_4:
Lloh3:
	adrp	x20, _BASEDIRNAME@GOTPAGE
Lloh4:
	ldr	x20, [x20, _BASEDIRNAME@GOTPAGEOFF]
	ldr	x0, [x20]
	bl	_strlen
	mov	x28, x0
	mov	x0, x19
	bl	_strlen
	add	x27, x19, x0
	sxtw	x8, w28
	str	x8, [sp, #16]                   ; 8-byte Folded Spill
	neg	w8, w19
	str	w8, [sp, #12]                   ; 4-byte Folded Spill
	sub	w8, w28, w19
Lloh5:
	adrp	x21, _qdir@GOTPAGE
Lloh6:
	ldr	x21, [x21, _qdir@GOTPAGEOFF]
	add	w8, w8, #1
	str	w8, [sp, #8]                    ; 4-byte Folded Spill
	mov	w23, #47
	str	x28, [sp, #24]                  ; 8-byte Folded Spill
	b	LBB0_8
LBB0_5:                                 ;   in Loop: Header=BB0_8 Depth=1
Lloh7:
	adrp	x0, l_.str.2@PAGE
Lloh8:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x19
	bl	_Error
LBB0_6:                                 ;   in Loop: Header=BB0_8 Depth=1
Lloh9:
	adrp	x20, _BASEDIRNAME@GOTPAGE
Lloh10:
	ldr	x20, [x20, _BASEDIRNAME@GOTPAGEOFF]
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=1
	mov	x27, x24
	cbz	w25, LBB0_33
LBB0_8:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_11 Depth 2
                                        ;     Child Loop BB0_17 Depth 2
                                        ;     Child Loop BB0_20 Depth 2
                                        ;     Child Loop BB0_26 Depth 2
	sub	x24, x27, #1
	ldr	x1, [x20]
	cmp	x24, x19
	b.eq	LBB0_32
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	mov	x0, x24
	mov	x2, x28
	bl	_Q_strncasecmp
	mov	x25, x0
	cbnz	w0, LBB0_7
; %bb.10:                               ;   in Loop: Header=BB0_8 Depth=1
	ldr	x8, [sp, #16]                   ; 8-byte Folded Reload
	add	x8, x24, x8
	ldr	w9, [sp, #8]                    ; 4-byte Folded Reload
	add	w26, w9, w27
                                        ; kill: def $w28 killed $w28 killed $x28
	ldrb	w9, [x8]
	cbz	w9, LBB0_14
LBB0_11:                                ;   Parent Loop BB0_8 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	cmp	w9, #47
	b.eq	LBB0_14
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=2
	cmp	w9, #92
	b.eq	LBB0_14
; %bb.13:                               ;   in Loop: Header=BB0_11 Depth=2
	add	x8, x8, #1
	add	w28, w28, #1
	add	w26, w26, #1
	ldrb	w9, [x8]
	cbnz	w9, LBB0_11
LBB0_14:                                ;   in Loop: Header=BB0_8 Depth=1
	ldr	x0, [x21]
	ldr	w8, [sp, #12]                   ; 4-byte Folded Reload
	add	w8, w8, w27
	add	w2, w8, w28
	mov	x1, x19
	bl	_strncpy
	ldr	x1, [x21]
Lloh11:
	adrp	x0, l_.str@PAGE
Lloh12:
	add	x0, x0, l_.str@PAGEOFF
	bl	_qprintf
	ldr	x27, [x21]
	ldrb	w8, [x27]
	cbz	w8, LBB0_19
; %bb.15:                               ;   in Loop: Header=BB0_8 Depth=1
	mov	x22, #0
	cmp	w8, #92
	b.ne	LBB0_17
LBB0_16:                                ;   in Loop: Header=BB0_8 Depth=1
	strb	w23, [x27, x22]
	ldr	x27, [x21]
LBB0_17:                                ;   Parent Loop BB0_8 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	add	x20, x22, #1
	mov	x0, x27
	bl	_strlen
	cmp	x0, x20
	b.ls	LBB0_19
; %bb.18:                               ;   in Loop: Header=BB0_17 Depth=2
	add	x8, x27, x22
	ldrb	w8, [x8, #1]
	mov	x22, x20
	cmp	w8, #92
	b.eq	LBB0_16
	b	LBB0_17
LBB0_19:                                ;   in Loop: Header=BB0_8 Depth=1
	add	w8, w28, #1
	add	x24, x24, w8, sxtw
	ldr	x28, [sp, #24]                  ; 8-byte Folded Reload
Lloh13:
	adrp	x27, _gamedir@GOTPAGE
Lloh14:
	ldr	x27, [x27, _gamedir@GOTPAGEOFF]
	ldrb	w8, [x24]
	cbz	w8, LBB0_5
LBB0_20:                                ;   Parent Loop BB0_8 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	cmp	w8, #92
	b.eq	LBB0_23
; %bb.21:                               ;   in Loop: Header=BB0_20 Depth=2
	cmp	w8, #47
	b.eq	LBB0_23
; %bb.22:                               ;   in Loop: Header=BB0_20 Depth=2
	add	x24, x24, #1
	add	w26, w26, #1
	ldrb	w8, [x24]
	cbnz	w8, LBB0_20
	b	LBB0_5
LBB0_23:                                ;   in Loop: Header=BB0_8 Depth=1
	ldr	x0, [x27]
	mov	x1, x19
	mov	x2, x26
	bl	_strncpy
	ldr	x26, [x27]
	ldrb	w8, [x26]
	cbz	w8, LBB0_28
; %bb.24:                               ;   in Loop: Header=BB0_8 Depth=1
	mov	x20, #0
	cmp	w8, #92
	b.ne	LBB0_26
LBB0_25:                                ;   in Loop: Header=BB0_8 Depth=1
	strb	w23, [x26, x20]
	ldr	x26, [x27]
LBB0_26:                                ;   Parent Loop BB0_8 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	add	x22, x20, #1
	mov	x0, x26
	bl	_strlen
	cmp	x0, x22
	b.ls	LBB0_28
; %bb.27:                               ;   in Loop: Header=BB0_26 Depth=2
	add	x8, x26, x20
	ldrb	w8, [x8, #1]
	mov	x20, x22
	cmp	w8, #92
	b.eq	LBB0_25
	b	LBB0_26
LBB0_28:                                ;   in Loop: Header=BB0_8 Depth=1
Lloh15:
	adrp	x0, l_.str.1@PAGE
Lloh16:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x26
	bl	_qprintf
Lloh17:
	adrp	x8, _writedir@GOTPAGE
Lloh18:
	ldr	x8, [x8, _writedir@GOTPAGEOFF]
Lloh19:
	ldr	x26, [x8]
	ldrb	w8, [x26]
	cbz	w8, LBB0_31
; %bb.29:                               ;   in Loop: Header=BB0_8 Depth=1
	mov	x0, x26
	bl	_strlen
	add	x8, x0, x26
	ldurb	w8, [x8, #-1]
	cmp	w8, #47
	b.eq	LBB0_6
; %bb.30:                               ;   in Loop: Header=BB0_8 Depth=1
	strb	w23, [x26, x0]
Lloh20:
	adrp	x8, _writedir@GOTPAGE
Lloh21:
	ldr	x8, [x8, _writedir@GOTPAGEOFF]
Lloh22:
	ldr	x26, [x8]
	mov	x0, x26
	bl	_strlen
	add	x8, x0, x26
	strb	wzr, [x8, #1]
	b	LBB0_6
LBB0_31:                                ;   in Loop: Header=BB0_8 Depth=1
	ldr	x1, [x27]
	mov	x0, x26
	bl	_strcpy
	b	LBB0_6
LBB0_32:
	str	x19, [sp]
Lloh23:
	adrp	x0, l_.str.3@PAGE
Lloh24:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_Error
LBB0_33:
	ldur	x8, [x29, #-96]
Lloh25:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh26:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh27:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_35
; %bb.34:
	add	sp, sp, #1072
	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_35:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_BASEDIRNAME,8,3                ; @BASEDIRNAME
	.comm	_qdir,8,3                       ; @qdir
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"qdir: %s\n"

	.comm	_gamedir,8,3                    ; @gamedir
l_.str.1:                               ; @.str.1
	.asciz	"gamedir: %s\n"

	.comm	_writedir,8,3                   ; @writedir
l_.str.2:                               ; @.str.2
	.asciz	"No gamedir in %s"

l_.str.3:                               ; @.str.3
	.asciz	"SetQdirFromPath: no '%s' in %s"

.subsections_via_symbols
