	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gigadevice_spinand_detect
_gigadevice_spinand_detect:             ## @gigadevice_spinand_detect
	.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	%rdi, %r14
	movq	(%rdi), %rcx
	movl	(%rcx), %esi
	movq	_SPINAND_MFR_GIGADEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	cmpl	%edx, %esi
	jne	LBB0_2
## %bb.1:
	movl	4(%rcx), %ebx
	shll	$8, %ebx
	addl	8(%rcx), %ebx
LBB0_5:
	movq	_gigadevice_spinand_table@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movl	%r15d, %edi
	callq	_ARRAY_SIZE
	movq	%r14, %rdi
	movl	%r15d, %esi
	movl	%eax, %edx
	movl	%ebx, %ecx
	callq	_spinand_match_and_init
	movl	%eax, %ecx
	testl	%eax, %eax
	movl	$1, %eax
	cmovnel	%ecx, %eax
	jmp	LBB0_6
LBB0_2:
	xorl	%eax, %eax
	testl	%esi, %esi
	jne	LBB0_6
## %bb.3:
	cmpl	%edx, 4(%rcx)
	jne	LBB0_6
## %bb.4:
	movl	8(%rcx), %ebx
	jmp	LBB0_5
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SPINAND_MFR_GIGADEVICE,4,2     ## @SPINAND_MFR_GIGADEVICE
	.comm	_gigadevice_spinand_table,4,2   ## @gigadevice_spinand_table
	.no_dead_strip	_gigadevice_spinand_detect
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gigadevice_spinand_detect
_gigadevice_spinand_detect:             ; @gigadevice_spinand_detect
	.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, x0
	ldr	x8, [x0]
	ldr	w10, [x8]
Lloh0:
	adrp	x9, _SPINAND_MFR_GIGADEVICE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _SPINAND_MFR_GIGADEVICE@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	cmp	w10, w9
	b.ne	LBB0_3
; %bb.1:
	ldp	w9, w8, [x8, #4]
	add	w20, w8, w9, lsl #8
LBB0_2:
Lloh3:
	adrp	x8, _gigadevice_spinand_table@GOTPAGE
Lloh4:
	ldr	x8, [x8, _gigadevice_spinand_table@GOTPAGEOFF]
Lloh5:
	ldr	w21, [x8]
	mov	x0, x21
	bl	_ARRAY_SIZE
	mov	x2, x0
	mov	x0, x19
	mov	x1, x21
	mov	x3, x20
	bl	_spinand_match_and_init
	cmp	w0, #0
	csinc	w0, w0, wzr, ne
	b	LBB0_7
LBB0_3:
	cbnz	w10, LBB0_6
; %bb.4:
	ldr	w10, [x8, #4]
	cmp	w10, w9
	b.ne	LBB0_6
; %bb.5:
	ldr	w20, [x8, #8]
	b	LBB0_2
LBB0_6:
	mov	w0, #0
LBB0_7:
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_SPINAND_MFR_GIGADEVICE,4,2     ; @SPINAND_MFR_GIGADEVICE
	.comm	_gigadevice_spinand_table,4,2   ; @gigadevice_spinand_table
	.no_dead_strip	_gigadevice_spinand_detect
.subsections_via_symbols
