	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function r852_register_nand_device
_r852_register_nand_device:             ## @r852_register_nand_device
	.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
	movq	%rdi, %rbx
	movq	16(%rdi), %rdi
	callq	_nand_to_mtd
	movq	%rax, %r14
	movl	(%rbx), %edi
	callq	_WARN_ON
	movq	40(%rbx), %rax
	movq	%rax, (%r14)
	cmpq	$0, 32(%rbx)
	je	LBB0_2
## %bb.1:
	movq	_NAND_ROM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	16(%rbx), %rcx
	orl	%eax, (%rcx)
LBB0_2:
	movq	%rbx, %rdi
	callq	_r852_engine_enable
	movl	24(%rbx), %esi
	movq	%r14, %rdi
	callq	_sm_register_device
	testq	%rax, %rax
	jne	LBB0_5
## %bb.3:
	movq	_dev_attr_media_type@GOTPCREL(%rip), %rsi
	movq	%r14, %rdi
	callq	_device_create_file
	testq	%rax, %rax
	je	LBB0_7
## %bb.4:
	leaq	L_.str(%rip), %rdi
	callq	_message
	movq	16(%rbx), %rdi
	callq	_nand_release
LBB0_5:
	movq	$0, 8(%rbx)
	movl	$-1, %eax
LBB0_6:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_7:
	movl	$1, (%rbx)
	xorl	%eax, %eax
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.comm	_NAND_ROM,4,2                   ## @NAND_ROM
	.comm	_dev_attr_media_type,4,2        ## @dev_attr_media_type
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"can't create media type sysfs attribute"

	.no_dead_strip	_r852_register_nand_device
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function r852_register_nand_device
_r852_register_nand_device:             ; @r852_register_nand_device
	.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	x19, x0
	ldr	x0, [x0, #16]
	bl	_nand_to_mtd
	mov	x20, x0
	ldr	w0, [x19]
	bl	_WARN_ON
	ldp	x9, x8, [x19, #32]
	str	x8, [x20]
	cbz	x9, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _NAND_ROM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NAND_ROM@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ldr	x9, [x19, #16]
	ldr	w10, [x9]
	orr	w8, w10, w8
	str	w8, [x9]
LBB0_2:
	mov	x0, x19
	bl	_r852_engine_enable
	ldr	w1, [x19, #24]
	mov	x0, x20
	bl	_sm_register_device
	cbnz	x0, LBB0_5
; %bb.3:
Lloh3:
	adrp	x1, _dev_attr_media_type@GOTPAGE
Lloh4:
	ldr	x1, [x1, _dev_attr_media_type@GOTPAGEOFF]
	mov	x0, x20
	bl	_device_create_file
	cbz	x0, LBB0_7
; %bb.4:
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	bl	_message
	ldr	x0, [x19, #16]
	bl	_nand_release
LBB0_5:
	str	xzr, [x19, #8]
	mov	w0, #-1
LBB0_6:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_7:
	mov	w8, #1
	str	w8, [x19]
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_NAND_ROM,4,2                   ; @NAND_ROM
	.comm	_dev_attr_media_type,4,2        ; @dev_attr_media_type
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"can't create media type sysfs attribute"

	.no_dead_strip	_r852_register_nand_device
.subsections_via_symbols
