	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hyperbus_register_device       ## -- Begin function hyperbus_register_device
	.p2align	4, 0x90
_hyperbus_register_device:              ## @hyperbus_register_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	%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
	testq	%rdi, %rdi
	je	LBB0_4
## %bb.1:
	movq	%rdi, %r13
	movq	72(%rdi), %r14
	testq	%r14, %r14
	je	LBB0_4
## %bb.2:
	movq	64(%r13), %r12
	testq	%r12, %r12
	je	LBB0_4
## %bb.3:
	cmpq	$0, 16(%r12)
	je	LBB0_4
## %bb.5:
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	callq	_of_device_is_compatible
	testl	%eax, %eax
	je	LBB0_6
## %bb.8:
	movq	_HYPERFLASH@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 56(%r13)
	leaq	-48(%rbp), %rdx
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_of_address_to_resource
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_30
## %bb.9:
	movq	16(%r12), %r15
	leaq	-48(%rbp), %rbx
	movq	%rbx, %rdi
	callq	_resource_size
	movl	%eax, 48(%r13)
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_devm_ioremap_resource
	movl	%eax, 44(%r13)
	movl	%eax, %edi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_11
## %bb.10:
	movl	44(%r13), %edi
	callq	_PTR_ERR
	movl	%eax, %ebx
	jmp	LBB0_30
LBB0_4:
	leaq	L_.str(%rip), %rdi
	callq	_pr_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_7:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_30:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	leaq	8(%r13), %rbx
	movq	%r15, %rdi
	callq	_dev_name
	movl	%eax, 40(%r13)
	movl	$2, 8(%r13)
	movq	%r14, 32(%r13)
	movq	%rbx, %rdi
	callq	_simple_map_init
	movq	8(%r12), %rax
	testq	%rax, %rax
	je	LBB0_26
## %bb.12:
	cmpq	$0, 32(%rax)
	je	LBB0_14
## %bb.13:
	movq	_hyperbus_read16@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 24(%r13)
LBB0_14:
	cmpq	$0, 24(%rax)
	je	LBB0_16
## %bb.15:
	movq	_hyperbus_write16@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 20(%r13)
LBB0_16:
	cmpq	$0, 16(%rax)
	je	LBB0_18
## %bb.17:
	movq	_hyperbus_copy_to@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 16(%r13)
LBB0_18:
	cmpq	$0, 8(%rax)
	je	LBB0_20
## %bb.19:
	movq	_hyperbus_copy_from@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 12(%r13)
LBB0_20:
	movq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_26
## %bb.21:
	cmpl	$0, (%r12)
	jne	LBB0_26
## %bb.22:
	movq	%r13, %rdi
	callq	*%rax
	testl	%eax, %eax
	je	LBB0_23
## %bb.25:
	movl	$1, (%r12)
LBB0_26:
	leaq	L_.str.3(%rip), %rdi
	movq	%rbx, %rsi
	callq	_do_map_probe
	movq	%rax, (%r13)
	testq	%rax, %rax
	je	LBB0_27
## %bb.28:
	movq	%r15, (%rax)
	movq	%rax, %rdi
	movq	%r14, %rsi
	callq	_mtd_set_of_node
	movq	(%r13), %rdi
	xorl	%ebx, %ebx
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_mtd_device_register
	testl	%eax, %eax
	je	LBB0_30
## %bb.29:
	movl	%eax, %r14d
	leaq	L_.str.5(%rip), %rsi
	movq	%r15, %rdi
	callq	_dev_err
	movq	(%r13), %rdi
	callq	_map_destroy
	movl	%r14d, %ebx
	jmp	LBB0_30
LBB0_27:
	leaq	L_.str.4(%rip), %rsi
LBB0_24:
	movq	%r15, %rdi
	callq	_dev_err
LBB0_6:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_23:
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_24
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"hyperbus: please fill all the necessary fields!\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"cypress,hyperflash"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_HYPERFLASH,4,2                 ## @HYPERFLASH
	.comm	_hyperbus_read16,4,2            ## @hyperbus_read16
	.comm	_hyperbus_write16,4,2           ## @hyperbus_write16
	.comm	_hyperbus_copy_to,4,2           ## @hyperbus_copy_to
	.comm	_hyperbus_copy_from,4,2         ## @hyperbus_copy_from
L_.str.2:                               ## @.str.2
	.asciz	"Calibration failed\n"

L_.str.3:                               ## @.str.3
	.asciz	"cfi_probe"

L_.str.4:                               ## @.str.4
	.asciz	"probing of hyperbus device failed\n"

L_.str.5:                               ## @.str.5
	.asciz	"failed to register mtd device\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hyperbus_register_device       ; -- Begin function hyperbus_register_device
	.p2align	2
_hyperbus_register_device:              ; @hyperbus_register_device
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	cbz	x0, LBB0_8
; %bb.1:
	mov	x19, x0
	ldr	x20, [x0, #72]
	cbz	x20, LBB0_8
; %bb.2:
	ldr	x23, [x19, #64]
	cbz	x23, LBB0_8
; %bb.3:
	ldr	x8, [x23, #16]
	cbz	x8, LBB0_8
; %bb.4:
Lloh0:
	adrp	x1, l_.str.1@PAGE
Lloh1:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_of_device_is_compatible
	cbz	w0, LBB0_29
; %bb.5:
Lloh2:
	adrp	x8, _HYPERFLASH@GOTPAGE
Lloh3:
	ldr	x8, [x8, _HYPERFLASH@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	str	w8, [x19, #56]
	add	x2, sp, #8
	mov	x0, x20
	mov	w1, #0
	bl	_of_address_to_resource
	mov	x22, x0
	cbnz	w0, LBB0_10
; %bb.6:
	ldr	x21, [x23, #16]
	add	x0, sp, #8
	bl	_resource_size
	str	w0, [x19, #48]
	add	x1, sp, #8
	mov	x0, x21
	bl	_devm_ioremap_resource
	str	w0, [x19, #44]
	bl	_IS_ERR
	cbz	x0, LBB0_11
; %bb.7:
	ldr	w0, [x19, #44]
	bl	_PTR_ERR
	mov	x22, x0
	b	LBB0_10
LBB0_8:
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_err
Lloh7:
	adrp	x8, _EINVAL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_9:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_10:
	mov	x0, x22
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_11:
	add	x22, x19, #8
	mov	x0, x21
	bl	_dev_name
	str	w0, [x19, #40]
	mov	w8, #2
	str	w8, [x19, #8]
	str	x20, [x19, #32]
	mov	x0, x22
	bl	_simple_map_init
	ldr	x8, [x23, #8]
	cbz	x8, LBB0_24
; %bb.12:
	ldr	x9, [x8, #32]
	cbz	x9, LBB0_14
; %bb.13:
Lloh9:
	adrp	x9, _hyperbus_read16@GOTPAGE
Lloh10:
	ldr	x9, [x9, _hyperbus_read16@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	str	w9, [x19, #24]
LBB0_14:
	ldr	x9, [x8, #24]
	cbz	x9, LBB0_16
; %bb.15:
Lloh12:
	adrp	x9, _hyperbus_write16@GOTPAGE
Lloh13:
	ldr	x9, [x9, _hyperbus_write16@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	str	w9, [x19, #20]
LBB0_16:
	ldr	x9, [x8, #16]
	cbz	x9, LBB0_18
; %bb.17:
Lloh15:
	adrp	x9, _hyperbus_copy_to@GOTPAGE
Lloh16:
	ldr	x9, [x9, _hyperbus_copy_to@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	str	w9, [x19, #16]
LBB0_18:
	ldr	x9, [x8, #8]
	cbz	x9, LBB0_20
; %bb.19:
Lloh18:
	adrp	x9, _hyperbus_copy_from@GOTPAGE
Lloh19:
	ldr	x9, [x9, _hyperbus_copy_from@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	str	w9, [x19, #12]
LBB0_20:
	ldr	x8, [x8]
	cbz	x8, LBB0_24
; %bb.21:
	ldr	w9, [x23]
	cbnz	w9, LBB0_24
; %bb.22:
	mov	x0, x19
	blr	x8
	cbz	w0, LBB0_30
; %bb.23:
	mov	w8, #1
	str	w8, [x23]
LBB0_24:
Lloh21:
	adrp	x0, l_.str.3@PAGE
Lloh22:
	add	x0, x0, l_.str.3@PAGEOFF
	mov	x1, x22
	bl	_do_map_probe
	str	x0, [x19]
	cbz	x0, LBB0_27
; %bb.25:
	str	x21, [x0]
	mov	x1, x20
	bl	_mtd_set_of_node
	ldr	x0, [x19]
	mov	x1, #0
	mov	w2, #0
	bl	_mtd_device_register
	mov	x22, x0
	cbz	w0, LBB0_10
; %bb.26:
Lloh23:
	adrp	x1, l_.str.5@PAGE
Lloh24:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x0, x21
	bl	_dev_err
	ldr	x0, [x19]
	bl	_map_destroy
	b	LBB0_10
LBB0_27:
Lloh25:
	adrp	x1, l_.str.4@PAGE
Lloh26:
	add	x1, x1, l_.str.4@PAGEOFF
LBB0_28:
	mov	x0, x21
	bl	_dev_err
LBB0_29:
Lloh27:
	adrp	x8, _ENODEV@GOTPAGE
Lloh28:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	b	LBB0_9
LBB0_30:
Lloh29:
	adrp	x1, l_.str.2@PAGE
Lloh30:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_28
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpAdd	Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"hyperbus: please fill all the necessary fields!\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"cypress,hyperflash"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_HYPERFLASH,4,2                 ; @HYPERFLASH
	.comm	_hyperbus_read16,4,2            ; @hyperbus_read16
	.comm	_hyperbus_write16,4,2           ; @hyperbus_write16
	.comm	_hyperbus_copy_to,4,2           ; @hyperbus_copy_to
	.comm	_hyperbus_copy_from,4,2         ; @hyperbus_copy_from
l_.str.2:                               ; @.str.2
	.asciz	"Calibration failed\n"

l_.str.3:                               ; @.str.3
	.asciz	"cfi_probe"

l_.str.4:                               ; @.str.4
	.asciz	"probing of hyperbus device failed\n"

l_.str.5:                               ; @.str.5
	.asciz	"failed to register mtd device\n"

.subsections_via_symbols
