	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function emu_make_rom_id
_emu_make_rom_id:                       ## @emu_make_rom_id
	.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
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	movq	_PicoAHW@GOTPCREL(%rip), %r13
	movl	(%r13), %ebx
	movq	_PAHW_MCD@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movq	_PAHW_SMS@GOTPCREL(%rip), %r14
	movl	(%r14), %eax
	andl	%ebx, %eax
	leaq	L_.str.2(%rip), %rax
	leaq	L_.str.1(%rip), %rcx
	cmoveq	%rax, %rcx
	testl	%ebx, %r12d
	leaq	L_.str(%rip), %rsi
	cmoveq	%rcx, %rsi
	leaq	_emu_make_rom_id.id_string(%rip), %r15
	movq	%r15, %rdi
	callq	_strcpy
	movl	(%r14), %eax
	testl	%eax, (%r13)
	jne	LBB0_2
## %bb.1:
	xorl	%r13d, %r13d
	testl	%ebx, %r12d
	sete	%r13b
	movq	_media_id_header@GOTPCREL(%rip), %r12
	movq	(%r12), %rsi
	subq	$-128, %rsi
	leaq	_emu_make_rom_id.id_string+3(%rip), %rdi
	movl	$14, %edx
	movl	%r13d, %ecx
	callq	_extract_text
	shlq	$32, %rax
	movabsq	$12884901888, %rcx              ## imm = 0x300000000
	addq	%rax, %rcx
	sarq	$32, %rcx
	movb	$124, (%rcx,%r15)
	movabsq	$17179869184, %rbx              ## imm = 0x400000000
	addq	%rax, %rbx
	sarq	$32, %rbx
	leaq	(%r15,%rbx), %rdi
	movl	$240, %esi
	addq	(%r12), %rsi
	movl	$3, %edx
	movl	%r13d, %ecx
	callq	_extract_text
	addq	%rbx, %rax
	cltq
	movb	$124, (%rax,%r15)
	incl	%eax
	movslq	%eax, %rbx
	leaq	(%r15,%rbx), %rdi
	movq	(%r12), %rsi
	addq	$80, %rsi
	movl	$48, %edx
	movl	%r13d, %ecx
	callq	_extract_text
	addq	%rbx, %rax
	cltq
	movb	$0, (%rax,%r15)
	cmpl	$5, %eax
	jg	LBB0_3
LBB0_2:
	leaq	_emu_make_rom_id.id_string+3(%rip), %rdi
	movl	$198, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	movq	-48(%rbp), %r8                  ## 8-byte Reload
	callq	_fname_ext
LBB0_3:
	leaq	_emu_make_rom_id.id_string(%rip), %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.zerofill __DATA,__bss,_emu_make_rom_id.id_string,201,4 ## @emu_make_rom_id.id_string
	.comm	_PicoAHW,4,2                    ## @PicoAHW
	.comm	_PAHW_MCD,4,2                   ## @PAHW_MCD
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"CD|"

	.comm	_PAHW_SMS,4,2                   ## @PAHW_SMS
L_.str.1:                               ## @.str.1
	.asciz	"MS|"

L_.str.2:                               ## @.str.2
	.asciz	"MD|"

	.comm	_media_id_header,8,3            ## @media_id_header
	.no_dead_strip	_emu_make_rom_id
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function emu_make_rom_id
_emu_make_rom_id:                       ; @emu_make_rom_id
	.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
	mov	x19, x0
Lloh0:
	adrp	x22, _PicoAHW@GOTPAGE
Lloh1:
	ldr	x22, [x22, _PicoAHW@GOTPAGEOFF]
	ldr	w8, [x22]
Lloh2:
	adrp	x9, _PAHW_MCD@GOTPAGE
Lloh3:
	ldr	x9, [x9, _PAHW_MCD@GOTPAGEOFF]
Lloh4:
	adrp	x23, _PAHW_SMS@GOTPAGE
Lloh5:
	ldr	x23, [x23, _PAHW_SMS@GOTPAGEOFF]
Lloh6:
	ldr	w9, [x9]
	ldr	w10, [x23]
Lloh7:
	adrp	x11, l_.str.1@PAGE
Lloh8:
	add	x11, x11, l_.str.1@PAGEOFF
Lloh9:
	adrp	x12, l_.str.2@PAGE
Lloh10:
	add	x12, x12, l_.str.2@PAGEOFF
	tst	w10, w8
	csel	x10, x12, x11, eq
	ands	w21, w9, w8
Lloh11:
	adrp	x8, l_.str@PAGE
Lloh12:
	add	x8, x8, l_.str@PAGEOFF
	csel	x1, x10, x8, eq
Lloh13:
	adrp	x20, _emu_make_rom_id.id_string@PAGE
Lloh14:
	add	x20, x20, _emu_make_rom_id.id_string@PAGEOFF
	mov	x0, x20
	bl	_strcpy
	ldr	w8, [x22]
	ldr	w9, [x23]
	tst	w9, w8
	b.ne	LBB0_2
; %bb.1:
	cmp	w21, #0
	cset	w21, eq
Lloh15:
	adrp	x22, _media_id_header@GOTPAGE
Lloh16:
	ldr	x22, [x22, _media_id_header@GOTPAGEOFF]
	ldr	x8, [x22]
	add	x1, x8, #128
	add	x0, x20, #3
	mov	w2, #14
	mov	x3, x21
	bl	_extract_text
	lsl	x8, x0, #32
	mov	x9, #12884901888
	add	x9, x8, x9
	asr	x9, x9, #32
	mov	w23, #124
	strb	w23, [x20, x9]
	mov	x9, #17179869184
	add	x8, x8, x9
	asr	x24, x8, #32
	add	x0, x20, x24
	ldr	x8, [x22]
	add	x1, x8, #240
	mov	w2, #3
	mov	x3, x21
	bl	_extract_text
	add	x8, x24, x0
	strb	w23, [x20, w8, sxtw]
	add	w8, w8, #1
	sxtw	x23, w8
	add	x0, x20, x23
	ldr	x8, [x22]
	add	x1, x8, #80
	mov	w2, #48
	mov	x3, x21
	bl	_extract_text
	add	x8, x23, x0
	strb	wzr, [x20, w8, sxtw]
	cmp	w8, #5
	b.gt	LBB0_3
LBB0_2:
Lloh17:
	adrp	x0, _emu_make_rom_id.id_string@PAGE+3
Lloh18:
	add	x0, x0, _emu_make_rom_id.id_string@PAGEOFF+3
	mov	w1, #198
	mov	x2, #0
	mov	x3, #0
	mov	x4, x19
	bl	_fname_ext
LBB0_3:
Lloh19:
	adrp	x0, _emu_make_rom_id.id_string@PAGE
Lloh20:
	add	x0, x0, _emu_make_rom_id.id_string@PAGEOFF
	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
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh6
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
.zerofill __DATA,__bss,_emu_make_rom_id.id_string,201,0 ; @emu_make_rom_id.id_string
	.comm	_PicoAHW,4,2                    ; @PicoAHW
	.comm	_PAHW_MCD,4,2                   ; @PAHW_MCD
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"CD|"

	.comm	_PAHW_SMS,4,2                   ; @PAHW_SMS
l_.str.1:                               ; @.str.1
	.asciz	"MS|"

l_.str.2:                               ; @.str.2
	.asciz	"MD|"

	.comm	_media_id_header,8,3            ; @media_id_header
	.no_dead_strip	_emu_make_rom_id
.subsections_via_symbols
