	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_plat_target_init               ## -- Begin function plat_target_init
	.p2align	4, 0x90
_plat_target_init:                      ## @plat_target_init
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	xorl	%eax, %eax
	callq	_soc_detect
	cmpl	$128, %eax
	je	LBB0_3
## %bb.1:
	cmpl	$129, %eax
	jne	LBB0_7
## %bb.2:
	xorl	%eax, %eax
	callq	_mmsp2_init
	movq	_default_cpu_clock@GOTPCREL(%rip), %rax
	movl	$200, (%rax)
	movq	_GP2X_DEV_GP2X@GOTPCREL(%rip), %rax
	jmp	LBB0_6
LBB0_3:
	xorl	%eax, %eax
	callq	_pollux_init
	movq	_default_cpu_clock@GOTPCREL(%rip), %rax
	movl	$533, (%rax)                    ## imm = 0x215
	leaq	L_.str(%rip), %rdi
	leaq	L_.str.1(%rip), %rsi
	callq	_fopen
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movq	%rax, %rbx
	leaq	L_str.5(%rip), %rdi
	callq	_puts
	movq	_GP2X_DEV_CAANOO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_gp2x_dev_id@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movq	%rbx, %rdi
	callq	_fclose
	jmp	LBB0_8
LBB0_7:
	leaq	L_str.6(%rip), %rdi
	callq	_puts
	jmp	LBB0_8
LBB0_5:
	leaq	L_str(%rip), %rdi
	callq	_puts
	movq	_GP2X_DEV_WIZ@GOTPCREL(%rip), %rax
LBB0_6:
	movl	(%rax), %eax
	movq	_gp2x_dev_id@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
LBB0_8:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_default_cpu_clock,4,2          ## @default_cpu_clock
	.comm	_GP2X_DEV_GP2X,4,2              ## @GP2X_DEV_GP2X
	.comm	_gp2x_dev_id,4,2                ## @gp2x_dev_id
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"/dev/accel"

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

	.comm	_GP2X_DEV_CAANOO,4,2            ## @GP2X_DEV_CAANOO
	.comm	_GP2X_DEV_WIZ,4,2               ## @GP2X_DEV_WIZ
L_str:                                  ## @str
	.asciz	"detected Wiz"

L_str.5:                                ## @str.5
	.asciz	"detected Caanoo"

L_str.6:                                ## @str.6
	.asciz	"could not recognize SoC."

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_plat_target_init               ; -- Begin function plat_target_init
	.p2align	2
_plat_target_init:                      ; @plat_target_init
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	bl	_soc_detect
	cmp	w0, #128
	b.eq	LBB0_3
; %bb.1:
	cmp	w0, #129
	b.ne	LBB0_5
; %bb.2:
	bl	_mmsp2_init
Lloh0:
	adrp	x8, _default_cpu_clock@GOTPAGE
Lloh1:
	ldr	x8, [x8, _default_cpu_clock@GOTPAGEOFF]
	mov	w9, #200
Lloh2:
	str	w9, [x8]
Lloh3:
	adrp	x8, _GP2X_DEV_GP2X@GOTPAGE
Lloh4:
	ldr	x8, [x8, _GP2X_DEV_GP2X@GOTPAGEOFF]
	b	LBB0_7
LBB0_3:
	bl	_pollux_init
Lloh5:
	adrp	x8, _default_cpu_clock@GOTPAGE
Lloh6:
	ldr	x8, [x8, _default_cpu_clock@GOTPAGEOFF]
	mov	w9, #533
Lloh7:
	str	w9, [x8]
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_fopen
	cbz	x0, LBB0_6
; %bb.4:
	mov	x19, x0
Lloh12:
	adrp	x0, l_str.5@PAGE
Lloh13:
	add	x0, x0, l_str.5@PAGEOFF
	bl	_puts
Lloh14:
	adrp	x8, _GP2X_DEV_CAANOO@GOTPAGE
Lloh15:
	ldr	x8, [x8, _GP2X_DEV_CAANOO@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
Lloh17:
	adrp	x9, _gp2x_dev_id@GOTPAGE
Lloh18:
	ldr	x9, [x9, _gp2x_dev_id@GOTPAGEOFF]
Lloh19:
	str	w8, [x9]
	mov	x0, x19
	bl	_fclose
	b	LBB0_8
LBB0_5:
Lloh20:
	adrp	x0, l_str.6@PAGE
Lloh21:
	add	x0, x0, l_str.6@PAGEOFF
	bl	_puts
	b	LBB0_8
LBB0_6:
Lloh22:
	adrp	x0, l_str@PAGE
Lloh23:
	add	x0, x0, l_str@PAGEOFF
	bl	_puts
Lloh24:
	adrp	x8, _GP2X_DEV_WIZ@GOTPAGE
Lloh25:
	ldr	x8, [x8, _GP2X_DEV_WIZ@GOTPAGEOFF]
LBB0_7:
	ldr	w8, [x8]
Lloh26:
	adrp	x9, _gp2x_dev_id@GOTPAGE
Lloh27:
	ldr	x9, [x9, _gp2x_dev_id@GOTPAGEOFF]
Lloh28:
	str	w8, [x9]
LBB0_8:
	mov	w0, #0
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotStr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotStr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotStr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotStr	Lloh26, Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_default_cpu_clock,4,2          ; @default_cpu_clock
	.comm	_GP2X_DEV_GP2X,4,2              ; @GP2X_DEV_GP2X
	.comm	_gp2x_dev_id,4,2                ; @gp2x_dev_id
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"/dev/accel"

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

	.comm	_GP2X_DEV_CAANOO,4,2            ; @GP2X_DEV_CAANOO
	.comm	_GP2X_DEV_WIZ,4,2               ; @GP2X_DEV_WIZ
l_str:                                  ; @str
	.asciz	"detected Wiz"

l_str.5:                                ; @str.5
	.asciz	"detected Caanoo"

l_str.6:                                ; @str.6
	.asciz	"could not recognize SoC."

.subsections_via_symbols
