	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function s3c2410_nand_select_chip
_s3c2410_nand_select_chip:              ## @s3c2410_nand_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	%r15
	pushq	%r14
	pushq	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rdi), %rax
	movq	(%rax), %r12
	movq	8(%r12), %rbx
	cmpl	$-1, %esi
	je	LBB0_9
## %bb.1:
	movl	%esi, %r14d
	movq	%rbx, %rdi
	callq	_allow_clk_stop
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	movl	8(%rbx), %edi
	callq	_clk_enable
LBB0_3:
	movl	12(%rbx), %edi
	callq	_readl
	movq	%rax, %r15
	movq	(%r12), %rdi
	testq	%rdi, %rdi
	je	LBB0_5
## %bb.4:
	cmpl	%r14d, (%rdi)
	jge	LBB0_5
## %bb.11:
	movl	24(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	movl	%r14d, %edx
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_dev_err                        ## TAILCALL
LBB0_5:
	movq	16(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_8
## %bb.6:
	movq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	movl	%r14d, %esi
	callq	*%rax
LBB0_8:
	movq	(%rbx), %rax
	notq	%rax
	andq	%rax, %r15
	movl	12(%rbx), %esi
	movq	%r15, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_writel                         ## TAILCALL
LBB0_9:
	movl	12(%rbx), %edi
	callq	_readl
	orq	(%rbx), %rax
	movl	12(%rbx), %esi
	movq	%rax, %rdi
	callq	_writel
	movq	%rbx, %rdi
	callq	_allow_clk_stop
	testq	%rax, %rax
	je	LBB0_10
## %bb.12:
	movl	8(%rbx), %edi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_clk_disable                    ## TAILCALL
LBB0_10:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"invalid chip %d\n"

	.no_dead_strip	_s3c2410_nand_select_chip
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function s3c2410_nand_select_chip
_s3c2410_nand_select_chip:              ; @s3c2410_nand_select_chip
	.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
	ldr	x8, [x0]
	ldr	x22, [x8]
	ldr	x19, [x22, #8]
	cmn	w1, #1
	b.eq	LBB0_10
; %bb.1:
	mov	x20, x1
	mov	x0, x19
	bl	_allow_clk_stop
	cbz	x0, LBB0_3
; %bb.2:
	ldr	w0, [x19, #8]
	bl	_clk_enable
LBB0_3:
	ldr	w0, [x19, #12]
	bl	_readl
	mov	x21, x0
	ldr	x0, [x22]
	cbz	x0, LBB0_6
; %bb.4:
	ldr	w8, [x0]
	cmp	w8, w20
	b.ge	LBB0_6
; %bb.5:
	ldr	w0, [x19, #24]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x20
	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
	b	_dev_err
LBB0_6:
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_9
; %bb.7:
	ldr	x8, [x8]
	cbz	x8, LBB0_9
; %bb.8:
	mov	x1, x20
	blr	x8
LBB0_9:
	ldr	x8, [x19]
	bic	x0, x21, x8
	ldr	w1, [x19, #12]
	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
	b	_writel
LBB0_10:
	ldr	w0, [x19, #12]
	bl	_readl
	ldr	x8, [x19]
	orr	x0, x8, x0
	ldr	w1, [x19, #12]
	bl	_writel
	mov	x0, x19
	bl	_allow_clk_stop
	cbz	x0, LBB0_12
; %bb.11:
	ldr	w0, [x19, #8]
	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
	b	_clk_disable
LBB0_12:
	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 AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"invalid chip %d\n"

	.no_dead_strip	_s3c2410_nand_select_chip
.subsections_via_symbols
