	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_CLImain                        ## -- Begin function CLImain
	.p2align	4, 0x90
_CLImain:                               ## @CLImain
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movl	%edi, %r15d
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_FCEUI_Initialize
	testl	%eax, %eax
	je	LBB0_10
## %bb.1:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_GetBaseDirectory
	movq	_DrBaseDirectory@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movl	%eax, %edi
	callq	_FCEUI_SetBaseDirectory
	xorl	%eax, %eax
	callq	_CreateDirs
	cmpl	$1, %r15d
	jg	LBB0_3
## %bb.2:
	movq	(%r14), %rdi
	callq	_ShowUsage
	jmp	LBB0_10
LBB0_3:
	xorl	%eax, %eax
	callq	_LoadConfig
	leal	-2(%r15), %edi
	leaq	8(%r14), %rsi
	callq	_DoArgs
	movq	_ntsccol@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_ntsctint@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_ntschue@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_FCEUI_SetNTSCTH
	movq	_cpalette@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_5
## %bb.4:
	xorl	%eax, %eax
	callq	_LoadCPalette
LBB0_5:
	decl	%r15d
	movq	(%r14,%r15,8), %rdi
	callq	_LoadGame
	testl	%eax, %eax
	je	LBB0_11
## %bb.6:
	movq	_CurGame@GOTPCREL(%rip), %rbx
	cmpq	$0, (%rbx)
	je	LBB0_9
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	xorl	%eax, %eax
	callq	_DoFun
	cmpq	$0, (%rbx)
	jne	LBB0_7
LBB0_9:
	xorl	%eax, %eax
	callq	_CloseGame
	xorl	%eax, %eax
	callq	_SaveConfig
	xorl	%eax, %eax
	callq	_FCEUI_Kill
	movl	$1, %ebx
	jmp	LBB0_10
LBB0_11:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_DriverKill
LBB0_10:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DrBaseDirectory,4,2            ## @DrBaseDirectory
	.comm	_ntsccol,4,2                    ## @ntsccol
	.comm	_ntsctint,4,2                   ## @ntsctint
	.comm	_ntschue,4,2                    ## @ntschue
	.comm	_cpalette,8,3                   ## @cpalette
	.comm	_CurGame,8,3                    ## @CurGame
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_CLImain                        ; -- Begin function CLImain
	.p2align	2
_CLImain:                               ; @CLImain
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x1
	mov	x20, x0
	bl	_FCEUI_Initialize
	cbz	w0, LBB0_11
; %bb.1:
	bl	_GetBaseDirectory
Lloh0:
	adrp	x8, _DrBaseDirectory@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DrBaseDirectory@GOTPAGEOFF]
Lloh2:
	str	w0, [x8]
	bl	_FCEUI_SetBaseDirectory
	bl	_CreateDirs
	subs	w21, w20, #1
	b.gt	LBB0_3
; %bb.2:
	ldr	x0, [x19]
	bl	_ShowUsage
	b	LBB0_10
LBB0_3:
	bl	_LoadConfig
	sub	w0, w20, #2
	add	x1, x19, #8
	bl	_DoArgs
Lloh3:
	adrp	x8, _ntsccol@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ntsccol@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
Lloh6:
	adrp	x8, _ntsctint@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ntsctint@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
Lloh9:
	adrp	x8, _ntschue@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ntschue@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
	bl	_FCEUI_SetNTSCTH
Lloh12:
	adrp	x8, _cpalette@GOTPAGE
Lloh13:
	ldr	x8, [x8, _cpalette@GOTPAGEOFF]
Lloh14:
	ldr	x8, [x8]
	cbz	x8, LBB0_5
; %bb.4:
	bl	_LoadCPalette
LBB0_5:
	ldr	x0, [x19, w21, uxtw #3]
	bl	_LoadGame
	cbz	w0, LBB0_9
; %bb.6:
Lloh15:
	adrp	x19, _CurGame@GOTPAGE
Lloh16:
	ldr	x19, [x19, _CurGame@GOTPAGEOFF]
	ldr	x8, [x19]
	cbz	x8, LBB0_8
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	bl	_DoFun
	ldr	x8, [x19]
	cbnz	x8, LBB0_7
LBB0_8:
	bl	_CloseGame
	bl	_SaveConfig
	bl	_FCEUI_Kill
	mov	w0, #1
	b	LBB0_11
LBB0_9:
	bl	_DriverKill
LBB0_10:
	mov	w0, #0
LBB0_11:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotStr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_DrBaseDirectory,4,2            ; @DrBaseDirectory
	.comm	_ntsccol,4,2                    ; @ntsccol
	.comm	_ntsctint,4,2                   ; @ntsctint
	.comm	_ntschue,4,2                    ; @ntschue
	.comm	_cpalette,8,3                   ; @cpalette
	.comm	_CurGame,8,3                    ; @CurGame
.subsections_via_symbols
