	.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	$1048, %rsp                     ## imm = 0x418
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	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(%rbx)
	je	LBB0_4
## %bb.3:
	leaq	-1072(%rbp), %r14
	movq	%r14, %rdi
	callq	_Q_getwd
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_strcat
	movq	%r14, %rbx
LBB0_4:
	movq	_BASEDIRNAME@GOTPCREL(%rip), %r13
	movq	(%r13), %rdi
	callq	_strlen
	movl	%eax, %r12d
	movq	%rbx, %rdi
	callq	_strlen
	cltq
	movq	%rbx, -1080(%rbp)               ## 8-byte Spill
	leaq	(%rbx,%rax), %r14
	movl	$1, %r15d
	movq	%rax, -1088(%rbp)               ## 8-byte Spill
	subq	%rax, %r15
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r13), %rsi
	cmpq	%rbx, %r15
	je	LBB0_14
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	leaq	(%r14,%rbx), %rdi
	decq	%rdi
	movl	%r12d, %edx
	callq	_Q_strncasecmp
	decq	%rbx
	testl	%eax, %eax
	jne	LBB0_5
## %bb.7:
	movq	_qdir@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	-1088(%rbp), %r14               ## 8-byte Reload
	leal	(%r14,%r12), %r15d
	leal	(%rbx,%r15), %edx
	incl	%edx
	movq	-1080(%rbp), %r13               ## 8-byte Reload
	movq	%r13, %rsi
	callq	_strncpy
	movq	_qdir@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdi
	callq	_qprintf
	movslq	%r12d, %rax
	addq	%r14, %rax
	addq	%r13, %rax
	addq	%rbx, %rax
	incq	%rax
	leal	(%rbx,%r15), %edx
	addl	$2, %edx
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movzbl	(%rax), %ecx
	testb	%cl, %cl
	je	LBB0_13
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	cmpb	$92, %cl
	je	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_8 Depth=1
	cmpb	$47, %cl
	je	LBB0_11
## %bb.12:                              ##   in Loop: Header=BB0_8 Depth=1
	incq	%rax
	incl	%edx
	jmp	LBB0_8
LBB0_14:
	leaq	L_.str.3(%rip), %rdi
	movq	-1080(%rbp), %rdx               ## 8-byte Reload
	xorl	%eax, %eax
	callq	_Error
	jmp	LBB0_15
LBB0_11:
	movq	_gamedir@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	movq	%r13, %rsi
	callq	_strncpy
	movl	(%rbx), %esi
	leaq	L_.str.1(%rip), %rdi
	callq	_qprintf
	jmp	LBB0_15
LBB0_13:
	leaq	L_.str.2(%rip), %rdi
	movq	%r13, %rsi
	xorl	%eax, %eax
	callq	_Error
LBB0_15:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_17
## %bb.16:
	addq	$1048, %rsp                     ## imm = 0x418
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_17:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_BASEDIRNAME,8,3                ## @BASEDIRNAME
	.comm	_qdir,4,2                       ## @qdir
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"qdir: %s\n"

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

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	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	sub	sp, sp, #1040
	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, #-56]
	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, #8
	bl	_Q_getwd
	add	x0, sp, #8
	mov	x1, x19
	bl	_strcat
	add	x19, sp, #8
LBB0_4:
Lloh3:
	adrp	x23, _BASEDIRNAME@GOTPAGE
Lloh4:
	ldr	x23, [x23, _BASEDIRNAME@GOTPAGEOFF]
	ldr	x0, [x23]
	bl	_strlen
	mov	x22, x0
	mov	x0, x19
	bl	_strlen
	add	x20, x19, w0, sxtw
	add	w8, w0, w22
	add	w8, w8, #1
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	sub	x20, x20, #1
	ldr	x1, [x23]
	cmp	x20, x19
	b.eq	LBB0_12
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x21, x8
	mov	x0, x20
	mov	x2, x22
	bl	_Q_strncasecmp
	sub	w8, w21, #1
	cbnz	w0, LBB0_5
; %bb.7:
Lloh5:
	adrp	x23, _qdir@GOTPAGE
Lloh6:
	ldr	x23, [x23, _qdir@GOTPAGEOFF]
	ldr	w0, [x23]
	add	w8, w20, w22
	sub	w8, w8, w19
	add	w2, w8, #1
	mov	x1, x19
	bl	_strncpy
	ldr	w1, [x23]
Lloh7:
	adrp	x0, l_.str@PAGE
Lloh8:
	add	x0, x0, l_.str@PAGEOFF
	bl	_qprintf
	add	w8, w22, #1
	sxtw	x8, w8
	ldrb	w9, [x20, x8]
	cbz	w9, LBB0_11
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	cmp	w9, #92
	b.eq	LBB0_14
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	cmp	w9, #47
	b.eq	LBB0_14
; %bb.10:                               ;   in Loop: Header=BB0_8 Depth=1
	add	w21, w21, #1
	add	x8, x8, #1
	ldrb	w9, [x20, x8]
	cbnz	w9, LBB0_8
LBB0_11:
Lloh9:
	adrp	x0, l_.str.2@PAGE
Lloh10:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x19
	b	LBB0_13
LBB0_12:
	str	x19, [sp]
Lloh11:
	adrp	x0, l_.str.3@PAGE
Lloh12:
	add	x0, x0, l_.str.3@PAGEOFF
LBB0_13:
	bl	_Error
	b	LBB0_15
LBB0_14:
Lloh13:
	adrp	x20, _gamedir@GOTPAGE
Lloh14:
	ldr	x20, [x20, _gamedir@GOTPAGEOFF]
	ldr	w0, [x20]
	mov	x1, x19
	mov	x2, x21
	bl	_strncpy
	ldr	w1, [x20]
Lloh15:
	adrp	x0, l_.str.1@PAGE
Lloh16:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_qprintf
LBB0_15:
	ldur	x8, [x29, #-56]
Lloh17:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh18:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh19:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_17
; %bb.16:
	add	sp, sp, #1040
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_17:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_BASEDIRNAME,8,3                ; @BASEDIRNAME
	.comm	_qdir,4,2                       ; @qdir
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"qdir: %s\n"

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

l_.str.2:                               ; @.str.2
	.asciz	"No gamedir in %s"

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

.subsections_via_symbols
