	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function spear_smi_probe
_spear_smi_probe:                       ## @spear_smi_probe
	.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, %r12
	movq	8(%rdi), %rbx
	testq	%rbx, %rbx
	je	LBB0_5
## %bb.1:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	movl	$24, %esi
	callq	_devm_kzalloc
	testq	%rax, %rax
	je	LBB0_2
## %bb.3:
	movq	%rax, %r14
	movq	%rax, (%r12)
	movq	%r12, %rdi
	movq	%rbx, %rsi
	callq	_spear_smi_probe_config_dt
	testl	%eax, %eax
	je	LBB0_6
LBB0_4:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_8
LBB0_5:
	movq	%r12, %rdi
	callq	_dev_get_platdata
	movq	%rax, %r14
	testq	%rax, %rax
	je	LBB0_4
LBB0_6:
	xorl	%ebx, %ebx
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_platform_get_irq
	testl	%eax, %eax
	js	LBB0_7
## %bb.9:
	movl	%eax, %r13d
	movq	_GFP_ATOMIC@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	movl	$40, %esi
	callq	_devm_kzalloc
	testq	%rax, %rax
	je	LBB0_2
## %bb.10:
	movq	%rax, %r15
	movq	_IORESOURCE_MEM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	xorl	%edx, %edx
	callq	_platform_get_resource
	movq	%r12, %rdi
	movq	%rax, %rsi
	callq	_devm_ioremap_resource
	movl	%eax, 32(%r15)
	movl	%eax, %edi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_13
## %bb.11:
	movl	32(%r15), %edi
	jmp	LBB0_12
LBB0_2:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_25
LBB0_7:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	leaq	L_.str.1(%rip), %rsi
LBB0_8:
	movq	%r12, %rdi
	callq	_dev_err
LBB0_25:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	movq	%r12, 16(%r15)
	movq	(%r14), %rax
	movq	%rax, (%r15)
	movq	_SMI_MAX_CLOCK_FREQ@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	%rcx, %rax
	cmovlq	%rax, %rcx
	movq	%rcx, (%r15)
	movl	8(%r14), %eax
	movl	%eax, 8(%r15)
	movq	_MAX_NUM_FLASH_CHIP@GOTPCREL(%rip), %rbx
	cmpl	(%rbx), %eax
	jle	LBB0_15
## %bb.14:
	leaq	L_.str.2(%rip), %rsi
	movq	%r12, %rdi
	callq	_dev_err
	movl	(%rbx), %eax
	movl	%eax, 8(%r15)
LBB0_15:
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_devm_clk_get
	movl	%eax, 12(%r15)
	movl	%eax, %edi
	callq	_IS_ERR
	movl	12(%r15), %edi
	testq	%rax, %rax
	je	LBB0_16
LBB0_12:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_PTR_ERR                        ## TAILCALL
LBB0_16:
	callq	_clk_prepare_enable
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_25
## %bb.17:
	movq	_spear_smi_int_handler@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	16(%r12), %r8d
	xorl	%ebx, %ebx
	movq	%r12, %rdi
	movl	%r13d, %esi
	xorl	%ecx, %ecx
	movq	%r15, %r9
	callq	_devm_request_irq
	testl	%eax, %eax
	je	LBB0_19
## %bb.18:
	leaq	L_.str.3(%rip), %rsi
	movl	%eax, %ebx
LBB0_24:
	movq	16(%r15), %rdi
	callq	_dev_err
	movl	12(%r15), %edi
	callq	_clk_disable_unprepare
	jmp	LBB0_25
LBB0_19:
	leaq	28(%r15), %rdi
	callq	_mutex_init
	movq	%r15, %rdi
	addq	$24, %rdi
	callq	_init_waitqueue_head
	movq	%r15, %rdi
	callq	_spear_smi_hw_init
	movq	%r12, %rdi
	movq	%r15, %rsi
	callq	_platform_set_drvdata
	cmpl	$0, 8(%r15)
	jle	LBB0_25
## %bb.20:
	xorl	%r13d, %r13d
LBB0_22:                                ## =>This Inner Loop Header: Depth=1
	movq	16(%r14), %rax
	movl	(%rax,%r13,4), %edx
	movq	%r12, %rdi
	movl	%r13d, %esi
	callq	_spear_smi_setup_banks
	testl	%eax, %eax
	jne	LBB0_23
## %bb.21:                              ##   in Loop: Header=BB0_22 Depth=1
	incq	%r13
	movslq	8(%r15), %rax
	xorl	%ebx, %ebx
	cmpq	%rax, %r13
	jl	LBB0_22
	jmp	LBB0_25
LBB0_23:
	movl	%eax, %ebx
	leaq	L_.str.4(%rip), %rsi
	jmp	LBB0_24
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_ENODEV,4,2                     ## @ENODEV
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"no platform data\n"

L_.str.1:                               ## @.str.1
	.asciz	"invalid smi irq\n"

	.comm	_GFP_ATOMIC,4,2                 ## @GFP_ATOMIC
	.comm	_IORESOURCE_MEM,4,2             ## @IORESOURCE_MEM
	.comm	_SMI_MAX_CLOCK_FREQ,8,3         ## @SMI_MAX_CLOCK_FREQ
	.comm	_MAX_NUM_FLASH_CHIP,4,2         ## @MAX_NUM_FLASH_CHIP
L_.str.2:                               ## @.str.2
	.asciz	"exceeding max number of flashes\n"

	.comm	_spear_smi_int_handler,4,2      ## @spear_smi_int_handler
L_.str.3:                               ## @.str.3
	.asciz	"SMI IRQ allocation failed\n"

L_.str.4:                               ## @.str.4
	.asciz	"bank setup failed\n"

	.no_dead_strip	_spear_smi_probe
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function spear_smi_probe
_spear_smi_probe:                       ; @spear_smi_probe
	.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	x19, x0
	ldr	x21, [x0, #8]
	cbz	x21, LBB0_4
; %bb.1:
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w1, #24
	bl	_devm_kzalloc
	cbz	x0, LBB0_9
; %bb.2:
	mov	x20, x0
	str	x0, [x19]
	mov	x0, x19
	mov	x1, x21
	bl	_spear_smi_probe_config_dt
	cbz	w0, LBB0_5
LBB0_3:
Lloh3:
	adrp	x8, _ENODEV@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w23, w8
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_11
LBB0_4:
	mov	x0, x19
	bl	_dev_get_platdata
	mov	x20, x0
	cbz	x0, LBB0_3
LBB0_5:
	mov	x0, x19
	mov	w1, #0
	bl	_platform_get_irq
	tbnz	w0, #31, LBB0_10
; %bb.6:
	mov	x22, x0
Lloh8:
	adrp	x8, _GFP_ATOMIC@GOTPAGE
Lloh9:
	ldr	x8, [x8, _GFP_ATOMIC@GOTPAGEOFF]
Lloh10:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w1, #40
	bl	_devm_kzalloc
	cbz	x0, LBB0_9
; %bb.7:
	mov	x21, x0
Lloh11:
	adrp	x8, _IORESOURCE_MEM@GOTPAGE
Lloh12:
	ldr	x8, [x8, _IORESOURCE_MEM@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_platform_get_resource
	mov	x1, x0
	mov	x0, x19
	bl	_devm_ioremap_resource
	str	w0, [x21, #32]
	bl	_IS_ERR
	cbz	x0, LBB0_13
; %bb.8:
	ldr	w0, [x21, #32]
	b	LBB0_16
LBB0_9:
Lloh14:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_12
LBB0_10:
Lloh17:
	adrp	x8, _ENODEV@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	neg	w23, w8
Lloh20:
	adrp	x1, l_.str.1@PAGE
Lloh21:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_11:
	mov	x0, x19
	bl	_dev_err
LBB0_12:
	mov	x0, x23
	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_13:
	str	x19, [x21, #16]
	ldr	x8, [x20]
	str	x8, [x21]
Lloh22:
	adrp	x9, _SMI_MAX_CLOCK_FREQ@GOTPAGE
Lloh23:
	ldr	x9, [x9, _SMI_MAX_CLOCK_FREQ@GOTPAGEOFF]
Lloh24:
	ldr	x9, [x9]
	cmp	x8, x9
	csel	x8, x8, x9, lt
	str	x8, [x21]
	ldr	w8, [x20, #8]
	str	w8, [x21, #8]
Lloh25:
	adrp	x23, _MAX_NUM_FLASH_CHIP@GOTPAGE
Lloh26:
	ldr	x23, [x23, _MAX_NUM_FLASH_CHIP@GOTPAGEOFF]
	ldr	w9, [x23]
	cmp	w8, w9
	b.le	LBB0_15
; %bb.14:
Lloh27:
	adrp	x1, l_.str.2@PAGE
Lloh28:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_dev_err
	ldr	w8, [x23]
	str	w8, [x21, #8]
LBB0_15:
	mov	x0, x19
	mov	x1, #0
	bl	_devm_clk_get
	str	w0, [x21, #12]
	bl	_IS_ERR
	mov	x8, x0
	ldr	w0, [x21, #12]
	cbz	x8, LBB0_17
LBB0_16:
	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_17:
	bl	_clk_prepare_enable
	mov	x23, x0
	cbnz	w0, LBB0_12
; %bb.18:
Lloh29:
	adrp	x8, _spear_smi_int_handler@GOTPAGE
Lloh30:
	ldr	x8, [x8, _spear_smi_int_handler@GOTPAGEOFF]
Lloh31:
	ldr	w2, [x8]
	ldr	w4, [x19, #16]
	mov	x0, x19
	mov	x1, x22
	mov	w3, #0
	mov	x5, x21
	bl	_devm_request_irq
	cbz	w0, LBB0_21
; %bb.19:
	mov	x23, x0
Lloh32:
	adrp	x22, l_.str.3@PAGE
Lloh33:
	add	x22, x22, l_.str.3@PAGEOFF
LBB0_20:
	ldr	x0, [x21, #16]
	mov	x1, x22
	bl	_dev_err
	ldr	w0, [x21, #12]
	bl	_clk_disable_unprepare
	b	LBB0_12
LBB0_21:
	add	x0, x21, #28
	bl	_mutex_init
	add	x0, x21, #24
	bl	_init_waitqueue_head
	mov	x0, x21
	bl	_spear_smi_hw_init
	mov	x0, x19
	mov	x1, x21
	bl	_platform_set_drvdata
	ldr	w8, [x21, #8]
	cmp	w8, #1
	b.lt	LBB0_25
; %bb.22:
	mov	x24, #0
Lloh34:
	adrp	x22, l_.str.4@PAGE
Lloh35:
	add	x22, x22, l_.str.4@PAGEOFF
LBB0_23:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20, #16]
	ldr	w2, [x8, x24, lsl #2]
	mov	x0, x19
	mov	x1, x24
	bl	_spear_smi_setup_banks
	mov	x23, x0
	cbnz	w0, LBB0_20
; %bb.24:                               ;   in Loop: Header=BB0_23 Depth=1
	add	x24, x24, #1
	ldrsw	x8, [x21, #8]
	cmp	x24, x8
	b.lt	LBB0_23
	b	LBB0_12
LBB0_25:
	mov	w23, #0
	b	LBB0_12
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpAdd	Lloh34, Lloh35
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_ENODEV,4,2                     ; @ENODEV
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"no platform data\n"

l_.str.1:                               ; @.str.1
	.asciz	"invalid smi irq\n"

	.comm	_GFP_ATOMIC,4,2                 ; @GFP_ATOMIC
	.comm	_IORESOURCE_MEM,4,2             ; @IORESOURCE_MEM
	.comm	_SMI_MAX_CLOCK_FREQ,8,3         ; @SMI_MAX_CLOCK_FREQ
	.comm	_MAX_NUM_FLASH_CHIP,4,2         ; @MAX_NUM_FLASH_CHIP
l_.str.2:                               ; @.str.2
	.asciz	"exceeding max number of flashes\n"

	.comm	_spear_smi_int_handler,4,2      ; @spear_smi_int_handler
l_.str.3:                               ; @.str.3
	.asciz	"SMI IRQ allocation failed\n"

l_.str.4:                               ; @.str.4
	.asciz	"bank setup failed\n"

	.no_dead_strip	_spear_smi_probe
.subsections_via_symbols
