	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sm501_plat_probe
_sm501_plat_probe:                      ## @sm501_plat_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$56, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r15
	movq	%r14, 48(%rax)
	movl	4(%r14), %eax
	movl	%eax, 44(%r15)
	movq	%r14, %rdi
	callq	_dev_get_platdata
	movl	%eax, 40(%r15)
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_platform_get_irq
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_10
## %bb.3:
	movl	%ebx, (%r15)
	movq	_IORESOURCE_MEM@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r14, %rdi
	movl	$1, %edx
	callq	_platform_get_resource
	movq	%rax, 24(%r15)
	movl	(%rbx), %esi
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_platform_get_resource
	movq	%rax, 32(%r15)
	movq	24(%r15), %rcx
	testq	%rcx, %rcx
	je	LBB0_5
## %bb.4:
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	movl	(%rcx), %edi
	leaq	L_.str.1(%rip), %rdx
	movl	$256, %esi                      ## imm = 0x100
	callq	_request_mem_region
	movq	%rax, 8(%r15)
	testq	%rax, %rax
	je	LBB0_7
## %bb.8:
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_platform_set_drvdata
	movq	24(%r15), %rdi
	movl	(%rdi), %ebx
	callq	_resource_size
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_ioremap
	movl	%eax, 16(%r15)
	testl	%eax, %eax
	je	LBB0_9
## %bb.12:
	movq	%r15, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_sm501_init_dev                 ## TAILCALL
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_11
LBB0_5:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_err
	movq	_ENOENT@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_10
LBB0_7:
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_err
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_10
LBB0_9:
	leaq	L_.str.3(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_err
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	movq	8(%r15), %rdi
	callq	_release_resource
	movq	8(%r15), %rdi
	callq	_kfree
LBB0_10:
	movq	%r15, %rdi
	callq	_kfree
LBB0_11:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_IORESOURCE_MEM,4,2             ## @IORESOURCE_MEM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to get IO resource\n"

	.comm	_ENOENT,4,2                     ## @ENOENT
L_.str.1:                               ## @.str.1
	.asciz	"sm501"

L_.str.2:                               ## @.str.2
	.asciz	"cannot claim registers\n"

	.comm	_EBUSY,4,2                      ## @EBUSY
L_.str.3:                               ## @.str.3
	.asciz	"cannot remap registers\n"

	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_sm501_plat_probe
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sm501_plat_probe
_sm501_plat_probe:                      ; @sm501_plat_probe
	.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
	mov	x20, x0
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #56
	bl	_kzalloc
	cbz	x0, LBB0_4
; %bb.1:
	mov	x19, x0
	str	x20, [x0, #48]
	ldr	w8, [x20, #4]
	str	w8, [x0, #44]
	mov	x0, x20
	bl	_dev_get_platdata
	str	w0, [x19, #40]
	mov	x0, x20
	mov	w1, #0
	bl	_platform_get_irq
	mov	x21, x0
	tbnz	w0, #31, LBB0_10
; %bb.2:
	str	w21, [x19]
Lloh3:
	adrp	x21, _IORESOURCE_MEM@GOTPAGE
Lloh4:
	ldr	x21, [x21, _IORESOURCE_MEM@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x20
	mov	w2, #1
	bl	_platform_get_resource
	str	x0, [x19, #24]
	ldr	w1, [x21]
	mov	x0, x20
	mov	w2, #0
	bl	_platform_get_resource
	str	x0, [x19, #32]
	ldr	x8, [x19, #24]
	cmp	x8, #0
	ccmp	x0, #0, #4, ne
	b.ne	LBB0_5
; %bb.3:
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_dev_err
Lloh7:
	adrp	x8, _ENOENT@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
	b	LBB0_9
LBB0_4:
Lloh9:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_11
LBB0_5:
	ldr	w0, [x8]
Lloh12:
	adrp	x2, l_.str.1@PAGE
Lloh13:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	w1, #256
	bl	_request_mem_region
	str	x0, [x19, #8]
	cbz	x0, LBB0_8
; %bb.6:
	mov	x0, x20
	mov	x1, x19
	bl	_platform_set_drvdata
	ldr	x0, [x19, #24]
	ldr	w21, [x0]
	bl	_resource_size
	mov	x1, x0
	mov	x0, x21
	bl	_ioremap
	str	w0, [x19, #16]
	cbz	w0, LBB0_12
; %bb.7:
	mov	x0, x19
	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	_sm501_init_dev
LBB0_8:
Lloh14:
	adrp	x1, l_.str.2@PAGE
Lloh15:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x20
	bl	_dev_err
Lloh16:
	adrp	x8, _EBUSY@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
LBB0_9:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_10:
	mov	x0, x19
	bl	_kfree
LBB0_11:
	mov	x0, x21
	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
LBB0_12:
Lloh18:
	adrp	x1, l_.str.3@PAGE
Lloh19:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x20
	bl	_dev_err
Lloh20:
	adrp	x8, _EIO@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	neg	w21, w8
	ldr	x0, [x19, #8]
	bl	_release_resource
	ldr	x0, [x19, #8]
	bl	_kfree
	b	LBB0_10
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_IORESOURCE_MEM,4,2             ; @IORESOURCE_MEM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to get IO resource\n"

	.comm	_ENOENT,4,2                     ; @ENOENT
l_.str.1:                               ; @.str.1
	.asciz	"sm501"

l_.str.2:                               ; @.str.2
	.asciz	"cannot claim registers\n"

	.comm	_EBUSY,4,2                      ; @EBUSY
l_.str.3:                               ; @.str.3
	.asciz	"cannot remap registers\n"

	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_sm501_plat_probe
.subsections_via_symbols
