	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function atmel_nand_controller_legacy_add_nands
_atmel_nand_controller_legacy_add_nands: ## @atmel_nand_controller_legacy_add_nands
	.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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	(%rdi), %r14
	movq	%r14, %rdi
	callq	_to_platform_device
	movq	%rax, %rbx
	movq	(%r15), %rdi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$72, %esi
	callq	_devm_kzalloc
	testq	%rax, %rax
	je	LBB0_14
## %bb.1:
	movq	%rax, %r13
	movl	$1, (%rax)
	movq	_IORESOURCE_MEM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_platform_get_resource
	movq	%rax, %rbx
	movq	%r14, %rdi
	movq	%rax, %rsi
	callq	_devm_ioremap_resource
	movq	16(%r13), %rcx
	movq	%rax, 40(%rcx)
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_4
## %bb.2:
	movq	16(%r13), %rax
	movq	40(%rax), %rdi
	jmp	LBB0_3
LBB0_14:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movl	(%rbx), %eax
	movq	16(%r13), %rcx
	movl	%eax, 32(%rcx)
	movl	$3, (%rcx)
	movq	_GPIOD_IN@GOTPCREL(%rip), %rbx
	movl	(%rbx), %ecx
	movq	%r14, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_devm_gpiod_get_index_optional
	movq	%rax, %r12
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_7
## %bb.5:
	movq	%r12, %rdi
	callq	_PTR_ERR
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_6
LBB0_7:
	testq	%r12, %r12
	je	LBB0_9
## %bb.8:
	movq	_ATMEL_NAND_GPIO_RB@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	16(%r13), %rcx
	movl	%eax, 24(%rcx)
	movq	%r12, 16(%rcx)
LBB0_9:
	movq	_GPIOD_OUT_HIGH@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r14, %rdi
	xorl	%esi, %esi
	movl	$1, %edx
	callq	_devm_gpiod_get_index_optional
	movq	%rax, %r12
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_11
## %bb.10:
	movq	%r12, %rdi
	callq	_PTR_ERR
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_6
LBB0_11:
	movq	16(%r13), %rax
	movq	%r12, 8(%rax)
	movq	(%r15), %rdi
	movl	(%rbx), %ecx
	xorl	%esi, %esi
	movl	$2, %edx
	callq	_devm_gpiod_get_index_optional
	movq	%rax, %r12
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_13
## %bb.12:
	movq	%r12, %rdi
	callq	_PTR_ERR
	leaq	L_.str.2(%rip), %rsi
LBB0_6:
	movq	%r14, %rdi
	movl	%eax, %edx
	callq	_dev_err
	movq	%r12, %rdi
LBB0_3:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_PTR_ERR                        ## TAILCALL
LBB0_13:
	movq	%r12, 8(%r13)
	movq	%r13, %rdi
	addq	$4, %rdi
	movq	(%r15), %rax
	movl	(%rax), %esi
	callq	_nand_set_flash_node
	movq	%r15, %rdi
	movq	%r13, %rsi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_atmel_nand_controller_add_nand ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_IORESOURCE_MEM,4,2             ## @IORESOURCE_MEM
	.comm	_GPIOD_IN,4,2                   ## @GPIOD_IN
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to get R/B gpio (err = %ld)\n"

	.comm	_ATMEL_NAND_GPIO_RB,4,2         ## @ATMEL_NAND_GPIO_RB
	.comm	_GPIOD_OUT_HIGH,4,2             ## @GPIOD_OUT_HIGH
L_.str.1:                               ## @.str.1
	.asciz	"Failed to get CS gpio (err = %ld)\n"

L_.str.2:                               ## @.str.2
	.asciz	"Failed to get detect gpio (err = %ld)\n"

	.no_dead_strip	_atmel_nand_controller_legacy_add_nands
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function atmel_nand_controller_legacy_add_nands
_atmel_nand_controller_legacy_add_nands: ; @atmel_nand_controller_legacy_add_nands
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x20, x0
	ldr	x19, [x0]
	mov	x0, x19
	bl	_to_platform_device
	mov	x22, x0
	ldr	x0, [x20]
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	w1, #72
	bl	_devm_kzalloc
	cbz	x0, LBB0_3
; %bb.1:
	mov	x21, x0
	mov	w8, #1
	str	w8, [x0]
Lloh3:
	adrp	x8, _IORESOURCE_MEM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _IORESOURCE_MEM@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x22
	mov	w2, #0
	bl	_platform_get_resource
	mov	x22, x0
	mov	x0, x19
	mov	x1, x22
	bl	_devm_ioremap_resource
	ldr	x8, [x21, #16]
	str	x0, [x8, #40]
	bl	_IS_ERR
	cbz	x0, LBB0_4
; %bb.2:
	ldr	x8, [x21, #16]
	ldr	x0, [x8, #40]
	b	LBB0_13
LBB0_3:
Lloh6:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w0, w8
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_4:
	ldr	w8, [x22]
	ldr	x9, [x21, #16]
	str	w8, [x9, #32]
	mov	w8, #3
	str	w8, [x9]
Lloh9:
	adrp	x23, _GPIOD_IN@GOTPAGE
Lloh10:
	ldr	x23, [x23, _GPIOD_IN@GOTPAGEOFF]
	ldr	w3, [x23]
	mov	x0, x19
	mov	x1, #0
	mov	w2, #0
	bl	_devm_gpiod_get_index_optional
	mov	x22, x0
	bl	_IS_ERR
	cbz	x0, LBB0_6
; %bb.5:
	mov	x0, x22
	bl	_PTR_ERR
	mov	x2, x0
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_12
LBB0_6:
	cbz	x22, LBB0_8
; %bb.7:
Lloh13:
	adrp	x8, _ATMEL_NAND_GPIO_RB@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ATMEL_NAND_GPIO_RB@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	ldr	x9, [x21, #16]
	str	w8, [x9, #24]
	str	x22, [x9, #16]
LBB0_8:
Lloh16:
	adrp	x8, _GPIOD_OUT_HIGH@GOTPAGE
Lloh17:
	ldr	x8, [x8, _GPIOD_OUT_HIGH@GOTPAGEOFF]
Lloh18:
	ldr	w3, [x8]
	mov	x0, x19
	mov	x1, #0
	mov	w2, #1
	bl	_devm_gpiod_get_index_optional
	mov	x22, x0
	bl	_IS_ERR
	cbz	x0, LBB0_10
; %bb.9:
	mov	x0, x22
	bl	_PTR_ERR
	mov	x2, x0
Lloh19:
	adrp	x1, l_.str.1@PAGE
Lloh20:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_12
LBB0_10:
	ldr	x8, [x21, #16]
	str	x22, [x8, #8]
	ldr	x0, [x20]
	ldr	w3, [x23]
	mov	x1, #0
	mov	w2, #2
	bl	_devm_gpiod_get_index_optional
	mov	x22, x0
	bl	_IS_ERR
	cbz	x0, LBB0_14
; %bb.11:
	mov	x0, x22
	bl	_PTR_ERR
	mov	x2, x0
Lloh21:
	adrp	x1, l_.str.2@PAGE
Lloh22:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_12:
	mov	x0, x19
	bl	_dev_err
	mov	x0, x22
LBB0_13:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_PTR_ERR
LBB0_14:
	str	x22, [x21, #8]
	add	x0, x21, #4
	ldr	x8, [x20]
	ldr	w1, [x8]
	bl	_nand_set_flash_node
	mov	x0, x20
	mov	x1, x21
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_atmel_nand_controller_add_nand
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_IORESOURCE_MEM,4,2             ; @IORESOURCE_MEM
	.comm	_GPIOD_IN,4,2                   ; @GPIOD_IN
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to get R/B gpio (err = %ld)\n"

	.comm	_ATMEL_NAND_GPIO_RB,4,2         ; @ATMEL_NAND_GPIO_RB
	.comm	_GPIOD_OUT_HIGH,4,2             ; @GPIOD_OUT_HIGH
l_.str.1:                               ; @.str.1
	.asciz	"Failed to get CS gpio (err = %ld)\n"

l_.str.2:                               ; @.str.2
	.asciz	"Failed to get detect gpio (err = %ld)\n"

	.no_dead_strip	_atmel_nand_controller_legacy_add_nands
.subsections_via_symbols
