	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function flctl_select_chip
_flctl_select_chip:                     ## @flctl_select_chip
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movl	%esi, %ebx
	callq	_nand_to_mtd
	movl	%eax, %edi
	callq	_mtd_to_flctl
	movq	%rax, %r14
	testl	%ebx, %ebx
	je	LBB0_5
## %bb.1:
	cmpl	$-1, %ebx
	jne	LBB0_11
## %bb.2:
	movq	_CE0_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%eax, 24(%r14)
	movq	8(%r14), %rdi
	callq	_pm_runtime_get_sync
	movl	24(%r14), %ebx
	movq	%r14, %rdi
	callq	_FLCMNCR
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_writel
	cmpl	$0, (%r14)
	je	LBB0_4
## %bb.3:
	movq	%r14, %rdi
	addq	$20, %rdi
	callq	_dev_pm_qos_remove_request
	movl	$0, (%r14)
	jmp	LBB0_4
LBB0_5:
	movq	_CE0_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 24(%r14)
	cmpl	$0, (%r14)
	je	LBB0_6
## %bb.9:
	cmpl	$0, 16(%r14)
	je	LBB0_12
LBB0_10:
	movq	8(%r14), %rdi
	callq	_pm_runtime_get_sync
	movq	_HOLDEN@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	%r14, %rdi
	callq	_FLHOLDCR
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_writel
LBB0_4:
	movq	8(%r14), %rdi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_pm_runtime_put_sync            ## TAILCALL
LBB0_11:
	xorl	%eax, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_BUG                            ## TAILCALL
LBB0_6:
	movq	8(%r14), %rdi
	movq	%r14, %rsi
	addq	$20, %rsi
	movq	_DEV_PM_QOS_RESUME_LATENCY@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$100, %ecx
	callq	_dev_pm_qos_add_request
	testl	%eax, %eax
	jns	LBB0_8
## %bb.7:
	movq	8(%r14), %rdi
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edx
	callq	_dev_err
LBB0_8:
	movl	$1, (%r14)
	cmpl	$0, 16(%r14)
	jne	LBB0_10
LBB0_12:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CE0_ENABLE,4,2                 ## @CE0_ENABLE
	.comm	_DEV_PM_QOS_RESUME_LATENCY,4,2  ## @DEV_PM_QOS_RESUME_LATENCY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"PM QoS request failed: %d\n"

	.comm	_HOLDEN,4,2                     ## @HOLDEN
	.no_dead_strip	_flctl_select_chip
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function flctl_select_chip
_flctl_select_chip:                     ; @flctl_select_chip
	.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
	mov	x20, x1
	bl	_nand_to_mtd
	bl	_mtd_to_flctl
	mov	x19, x0
	cbz	w20, LBB0_4
; %bb.1:
	cmn	w20, #1
	b.ne	LBB0_8
; %bb.2:
Lloh0:
	adrp	x8, _CE0_ENABLE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CE0_ENABLE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ldr	w9, [x19, #24]
	bic	w8, w9, w8
	str	w8, [x19, #24]
	ldr	x0, [x19, #8]
	bl	_pm_runtime_get_sync
	ldr	w20, [x19, #24]
	mov	x0, x19
	bl	_FLCMNCR
	mov	x1, x0
	mov	x0, x20
	bl	_writel
	ldr	w8, [x19]
	cbz	w8, LBB0_7
; %bb.3:
	add	x0, x19, #20
	bl	_dev_pm_qos_remove_request
	str	wzr, [x19]
	b	LBB0_7
LBB0_4:
Lloh3:
	adrp	x8, _CE0_ENABLE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CE0_ENABLE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	ldr	w9, [x19, #24]
	orr	w8, w9, w8
	str	w8, [x19, #24]
	ldr	w8, [x19]
	cbz	w8, LBB0_9
; %bb.5:
	ldr	w8, [x19, #16]
	cbz	w8, LBB0_12
LBB0_6:
	ldr	x0, [x19, #8]
	bl	_pm_runtime_get_sync
Lloh6:
	adrp	x8, _HOLDEN@GOTPAGE
Lloh7:
	ldr	x8, [x8, _HOLDEN@GOTPAGEOFF]
Lloh8:
	ldr	w20, [x8]
	mov	x0, x19
	bl	_FLHOLDCR
	mov	x1, x0
	mov	x0, x20
	bl	_writel
LBB0_7:
	ldr	x0, [x19, #8]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_pm_runtime_put_sync
LBB0_8:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_BUG
LBB0_9:
	ldr	x0, [x19, #8]
	add	x1, x19, #20
Lloh9:
	adrp	x8, _DEV_PM_QOS_RESUME_LATENCY@GOTPAGE
Lloh10:
	ldr	x8, [x8, _DEV_PM_QOS_RESUME_LATENCY@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
	mov	w3, #100
	bl	_dev_pm_qos_add_request
	tbz	w0, #31, LBB0_11
; %bb.10:
	mov	x2, x0
	ldr	x0, [x19, #8]
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
LBB0_11:
	mov	w8, #1
	str	w8, [x19]
	ldr	w8, [x19, #16]
	cbnz	w8, LBB0_6
LBB0_12:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_CE0_ENABLE,4,2                 ; @CE0_ENABLE
	.comm	_DEV_PM_QOS_RESUME_LATENCY,4,2  ; @DEV_PM_QOS_RESUME_LATENCY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"PM QoS request failed: %d\n"

	.comm	_HOLDEN,4,2                     ; @HOLDEN
	.no_dead_strip	_flctl_select_chip
.subsections_via_symbols
