	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function detect_ps1_game_sub
_detect_ps1_game_sub:                   ## @detect_ps1_game_sub
	.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
	movl	$16424, %eax                    ## imm = 0x4028
	callq	____chkstk_darwin
	subq	%rax, %rsp
	popq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r15d
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movl	$0, -16432(%rbp)
	movq	_SEEK_END@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%r12d, %r12d
	xorl	%esi, %esi
	callq	_intfstream_seek
	cmpl	$-1, %eax
	je	LBB0_38
## %bb.1:
	testl	%r15d, %r15d
	jne	LBB0_3
## %bb.2:
	movq	%rbx, %rdi
	callq	_intfstream_tell
	testl	$2047, %eax                     ## imm = 0x7FF
	je	LBB0_11
LBB0_3:
	movl	$24, %r13d
	movl	$2352, %eax                     ## imm = 0x930
LBB0_4:
	movq	%r14, -16464(%rbp)              ## 8-byte Spill
	testl	%r15d, %r15d
	movl	$2448, %r15d                    ## imm = 0x990
	cmovel	%eax, %r15d
	leal	156(%r13), %eax
	movl	%r15d, %esi
	shll	$4, %esi
	orl	%eax, %esi
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_intfstream_seek
	cmpl	$-1, %eax
	je	LBB0_38
## %bb.5:
	movq	%r13, %r14
	movq	%rbx, %r13
	xorl	%r12d, %r12d
	leaq	-16432(%rbp), %rbx
	movq	%r13, %rdi
	movq	%rbx, %rsi
	movl	$6, %edx
	xorl	%eax, %eax
	callq	_intfstream_read
	movl	-16420(%rbp), %eax
	movl	-16416(%rbp), %esi
	shll	$8, %eax
	orl	-16424(%rbp), %eax
	shll	$16, %esi
	orl	%eax, %esi
	imull	%r15d, %esi
	addl	%r14d, %esi
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r13, %rdi
	callq	_intfstream_seek
	cmpl	$-1, %eax
	je	LBB0_38
## %bb.6:
	movq	%r14, -16448(%rbp)              ## 8-byte Spill
	movq	%r13, -16456(%rbp)              ## 8-byte Spill
	movq	%r13, %rdi
	movq	%rbx, %rsi
	movl	$4096, %edx                     ## imm = 0x1000
	xorl	%eax, %eax
	callq	_intfstream_read
	leaq	-48(%rbp), %r14
	leaq	L_.str(%rip), %r13
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movslq	(%rbx), %r12
	testq	%r12, %r12
	je	LBB0_37
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	leaq	132(%rbx), %rdi
	movq	%r13, %rsi
	movl	$12, %edx
	callq	_strncasecmp
	testq	%rax, %rax
	je	LBB0_14
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=1
	leaq	(%rbx,%r12,4), %rbx
	cmpq	%r14, %rbx
	jb	LBB0_7
	jmp	LBB0_37
LBB0_11:
	movl	$0, -16436(%rbp)
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%r13d, %r13d
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_intfstream_seek
	cmpl	$-1, %eax
	je	LBB0_37
## %bb.12:
	leaq	-16436(%rbp), %rsi
	movq	%rbx, %rdi
	movl	$4, %edx
	xorl	%eax, %eax
	callq	_intfstream_read
	movl	-16436(%rbp), %ecx
	movq	_MODETEST_VAL@GOTPCREL(%rip), %rdx
	movl	$2048, %eax                     ## imm = 0x800
	cmpl	(%rdx), %ecx
	je	LBB0_3
	jmp	LBB0_4
LBB0_14:
	movl	12(%rbx), %eax
	movl	16(%rbx), %esi
	shll	$8, %eax
	orl	8(%rbx), %eax
	shll	$16, %esi
	orl	%eax, %esi
	imull	%r15d, %esi
	addl	-16448(%rbp), %esi              ## 4-byte Folded Reload
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	-16456(%rbp), %rbx              ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_intfstream_seek
	cmpl	$-1, %eax
	movq	-16464(%rbp), %r13              ## 8-byte Reload
	movl	$0, %r12d
	je	LBB0_38
## %bb.15:
	xorl	%r12d, %r12d
	leaq	-16432(%rbp), %r14
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movl	$256, %edx                      ## imm = 0x100
	xorl	%eax, %eax
	callq	_intfstream_read
	movl	$0, -15408(%rbp)
	movl	-16432(%rbp), %ebx
	testl	%ebx, %ebx
	je	LBB0_38
## %bb.16:
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	movl	$4, %edx
	callq	_strncasecmp
	testq	%rax, %rax
	je	LBB0_21
## %bb.17:
	leaq	-16428(%rbp), %r14
	leaq	L_.str.1(%rip), %r12
	.p2align	4, 0x90
LBB0_18:                                ## =>This Inner Loop Header: Depth=1
	movl	(%r14), %ebx
	testl	%ebx, %ebx
	je	LBB0_37
## %bb.19:                              ##   in Loop: Header=BB0_18 Depth=1
	movq	%r14, %rdi
	movq	%r12, %rsi
	movl	$4, %edx
	callq	_strncasecmp
	addq	$4, %r14
	testq	%rax, %rax
	jne	LBB0_18
## %bb.20:
	addq	$-4, %r14
LBB0_21:
	leaq	4(%r14), %rax
	jmp	LBB0_25
	.p2align	4, 0x90
LBB0_22:                                ##   in Loop: Header=BB0_25 Depth=1
	cmpl	$92, %ebx
	jne	LBB0_24
LBB0_23:                                ##   in Loop: Header=BB0_25 Depth=1
	movq	%rax, %r14
LBB0_24:                                ##   in Loop: Header=BB0_25 Depth=1
	movl	(%rax), %ebx
	addq	$4, %rax
LBB0_25:                                ## =>This Inner Loop Header: Depth=1
	cmpl	$91, %ebx
	jg	LBB0_22
## %bb.26:                              ##   in Loop: Header=BB0_25 Depth=1
	cmpl	$58, %ebx
	je	LBB0_23
## %bb.27:                              ##   in Loop: Header=BB0_25 Depth=1
	testl	%ebx, %ebx
	je	LBB0_29
## %bb.28:                              ##   in Loop: Header=BB0_25 Depth=1
	cmpl	$10, %ebx
	jne	LBB0_24
LBB0_29:
	movl	(%r14), %edi
	callq	_toupper
	movb	%al, (%r13)
	movl	4(%r14), %edi
	callq	_toupper
	movb	%al, 1(%r13)
	movl	8(%r14), %edi
	callq	_toupper
	movb	%al, 2(%r13)
	leaq	16(%r14), %r15
	movl	12(%r14), %edi
	callq	_toupper
	movb	%al, 3(%r13)
	movb	$45, 4(%r13)
	addq	$5, %r13
	movl	16(%r14), %edi
	callq	_isalnum
	leaq	20(%r14), %rbx
	xorl	%ecx, %ecx
	testq	%rax, %rax
	sete	%cl
	cmovneq	%r15, %rbx
	movl	16(%r14,%rcx,4), %edi
	callq	_isalnum
	testq	%rax, %rax
	je	LBB0_36
## %bb.30:
	leaq	8(%rbx), %r14
	jmp	LBB0_33
	.p2align	4, 0x90
LBB0_31:                                ##   in Loop: Header=BB0_33 Depth=1
	leaq	4(%rbx), %r14
	addq	$12, %rbx
	movq	%rbx, %r15
LBB0_32:                                ##   in Loop: Header=BB0_33 Depth=1
	incq	%r13
	movl	(%r14), %edi
	callq	_isalnum
	movq	%r14, %rbx
	movq	%r15, %r14
	testq	%rax, %rax
	je	LBB0_36
LBB0_33:                                ## =>This Inner Loop Header: Depth=1
	movzbl	(%rbx), %eax
	movb	%al, (%r13)
	cmpl	$46, 4(%rbx)
	jne	LBB0_31
## %bb.34:                              ##   in Loop: Header=BB0_33 Depth=1
	leaq	8(%r14), %r15
	jmp	LBB0_32
LBB0_37:
	xorl	%r12d, %r12d
LBB0_38:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_40
## %bb.39:
	movl	%r12d, %eax
	addq	$16424, %rsp                    ## imm = 0x4028
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_36:
	movb	$0, (%r13)
	movl	$1, %r12d
	jmp	LBB0_38
LBB0_40:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_SEEK_END,4,2                   ## @SEEK_END
	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
	.comm	_MODETEST_VAL,4,2               ## @MODETEST_VAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"SYSTEM.CNF;1"

L_.str.1:                               ## @.str.1
	.asciz	"boot"

	.no_dead_strip	_detect_ps1_game_sub
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function detect_ps1_game_sub
_detect_ps1_game_sub:                   ; @detect_ps1_game_sub
	.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	w9, #16416
Lloh0:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh1:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	sub	sp, sp, #4, lsl #12             ; =16384
	sub	sp, sp, #32
	mov	x21, x2
	mov	x19, x1
	mov	x20, x0
Lloh2:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh3:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	stur	x8, [x29, #-88]
	str	wzr, [sp, #24]
Lloh5:
	adrp	x8, _SEEK_END@GOTPAGE
Lloh6:
	ldr	x8, [x8, _SEEK_END@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
	mov	w1, #0
	bl	_intfstream_seek
	cmn	w0, #1
	b.eq	LBB0_21
; %bb.1:
Lloh8:
	adrp	x22, _SEEK_SET@GOTPAGE
Lloh9:
	ldr	x22, [x22, _SEEK_SET@GOTPAGEOFF]
	cbnz	w21, LBB0_3
; %bb.2:
	mov	x0, x20
	bl	_intfstream_tell
	tst	w0, #0x7ff
	b.eq	LBB0_10
LBB0_3:
	mov	w23, #24
	mov	w8, #2352
LBB0_4:
	mov	w9, #2448
	cmp	w21, #0
	csel	w24, w8, w9, eq
	add	w8, w23, #156
	orr	w1, w8, w24, lsl #4
	ldr	w2, [x22]
	mov	x0, x20
	bl	_intfstream_seek
	cmn	w0, #1
	b.eq	LBB0_21
; %bb.5:
	mov	w8, #6
	add	x25, sp, #24
	stp	x25, x8, [sp]
	mov	x0, x20
	bl	_intfstream_read
	ldp	w8, w9, [sp, #32]
	orr	w8, w8, w9, lsl #8
	ldr	w9, [sp, #40]
	orr	w8, w8, w9, lsl #16
	madd	w1, w8, w24, w23
	ldr	w2, [x22]
	mov	x0, x20
	bl	_intfstream_seek
	cmn	w0, #1
	b.eq	LBB0_21
; %bb.6:
	mov	w8, #4096
	stp	x25, x8, [sp]
	mov	x0, x20
	bl	_intfstream_read
	add	x26, x25, #4, lsl #12           ; =16384
Lloh10:
	adrp	x21, l_.str@PAGE
Lloh11:
	add	x21, x21, l_.str@PAGEOFF
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldrsw	x27, [x25]
	cbz	w27, LBB0_21
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	add	x0, x25, #132
	mov	x1, x21
	mov	w2, #12
	bl	_strncasecmp
	cbz	x0, LBB0_13
; %bb.9:                                ;   in Loop: Header=BB0_7 Depth=1
	add	x25, x25, x27, lsl #2
	cmp	x25, x26
	b.lo	LBB0_7
	b	LBB0_21
LBB0_10:
	str	wzr, [sp, #20]
	ldr	w2, [x22]
	mov	x0, x20
	mov	w1, #0
	bl	_intfstream_seek
	cmn	w0, #1
	b.eq	LBB0_21
; %bb.11:
	mov	w8, #4
	add	x9, sp, #20
	stp	x9, x8, [sp]
	mov	x0, x20
	bl	_intfstream_read
	ldr	w8, [sp, #20]
Lloh12:
	adrp	x9, _MODETEST_VAL@GOTPAGE
Lloh13:
	ldr	x9, [x9, _MODETEST_VAL@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	cmp	w8, w9
	b.eq	LBB0_3
; %bb.12:
	mov	w23, #0
	mov	w8, #2048
	b	LBB0_4
LBB0_13:
	ldp	w8, w9, [x25, #8]
	orr	w8, w8, w9, lsl #8
	ldr	w9, [x25, #16]
	orr	w8, w8, w9, lsl #16
	madd	w1, w8, w24, w23
	ldr	w2, [x22]
	mov	x0, x20
	bl	_intfstream_seek
	cmn	w0, #1
	b.eq	LBB0_21
; %bb.14:
	mov	w8, #256
	add	x9, sp, #24
	stp	x9, x8, [sp]
	mov	x0, x20
	bl	_intfstream_read
	str	wzr, [sp, #1048]
	ldr	w22, [sp, #24]
	cbz	w22, LBB0_21
; %bb.15:
	add	x20, sp, #24
Lloh15:
	adrp	x1, l_.str.1@PAGE
Lloh16:
	add	x1, x1, l_.str.1@PAGEOFF
	add	x0, sp, #24
	mov	w2, #4
	bl	_strncasecmp
	cbz	x0, LBB0_20
; %bb.16:
	add	x20, x20, #4
Lloh17:
	adrp	x21, l_.str.1@PAGE
Lloh18:
	add	x21, x21, l_.str.1@PAGEOFF
LBB0_17:                                ; =>This Inner Loop Header: Depth=1
	ldr	w22, [x20]
	cbz	w22, LBB0_21
; %bb.18:                               ;   in Loop: Header=BB0_17 Depth=1
	mov	x0, x20
	mov	x1, x21
	mov	w2, #4
	bl	_strncasecmp
	add	x20, x20, #4
	cbnz	x0, LBB0_17
; %bb.19:
	sub	x20, x20, #4
LBB0_20:
	add	x8, x20, #4
	b	LBB0_27
LBB0_21:
	mov	w0, #0
LBB0_22:
	ldur	x8, [x29, #-88]
Lloh19:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh20:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh21:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_35
; %bb.23:
	add	sp, sp, #4, lsl #12             ; =16384
	add	sp, sp, #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
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_24:                                ;   in Loop: Header=BB0_27 Depth=1
	cmp	w22, #92
	b.ne	LBB0_26
LBB0_25:                                ;   in Loop: Header=BB0_27 Depth=1
	mov	x20, x8
LBB0_26:                                ;   in Loop: Header=BB0_27 Depth=1
	ldr	w22, [x8], #4
LBB0_27:                                ; =>This Inner Loop Header: Depth=1
	cmp	w22, #91
	b.gt	LBB0_24
; %bb.28:                               ;   in Loop: Header=BB0_27 Depth=1
	cmp	w22, #58
	b.eq	LBB0_25
; %bb.29:                               ;   in Loop: Header=BB0_27 Depth=1
	cbz	w22, LBB0_31
; %bb.30:                               ;   in Loop: Header=BB0_27 Depth=1
	cmp	w22, #10
	b.ne	LBB0_26
LBB0_31:
	ldr	w0, [x20]
	bl	_toupper
	strb	w0, [x19]
	ldr	w0, [x20, #4]
	bl	_toupper
	strb	w0, [x19, #1]
	ldr	w0, [x20, #8]
	bl	_toupper
	strb	w0, [x19, #2]
	ldr	w0, [x20, #12]
	bl	_toupper
	strb	w0, [x19, #3]
	add	x21, x19, #5
	mov	w8, #45
	strb	w8, [x19, #4]
	mov	x19, x20
	ldr	w0, [x19, #16]!
	bl	_isalnum
	add	x8, x20, #20
	mov	w9, #16
	mov	w10, #20
	cmp	x0, #0
	csel	x9, x10, x9, eq
	csel	x19, x8, x19, eq
	ldr	w0, [x20, x9]
	bl	_isalnum
	cbz	x0, LBB0_34
; %bb.32:
	add	x20, x19, #8
LBB0_33:                                ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x19]
	strb	w8, [x21], #1
	ldr	w8, [x19, #4]!
	cmp	w8, #46
	csel	x22, x20, x19, eq
	add	x8, x20, #8
	add	x9, x19, #8
	csel	x20, x8, x9, eq
	ldr	w0, [x22]
	bl	_isalnum
	mov	x19, x22
	cbnz	x0, LBB0_33
LBB0_34:
	strb	wzr, [x21]
	mov	w0, #1
	b	LBB0_22
LBB0_35:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_SEEK_END,4,2                   ; @SEEK_END
	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
	.comm	_MODETEST_VAL,4,2               ; @MODETEST_VAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"SYSTEM.CNF;1"

l_.str.1:                               ; @.str.1
	.asciz	"boot"

	.no_dead_strip	_detect_ps1_game_sub
.subsections_via_symbols
