	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ingenic_battery_probe
_ingenic_battery_probe:                 ## @ingenic_battery_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
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	$0, -40(%rbp)
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$64, %esi
	callq	_devm_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %rbx
	movq	%r14, 56(%rax)
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_devm_iio_channel_get
	movl	%eax, 48(%rbx)
	movl	%eax, %edi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_3
## %bb.14:
	movl	48(%rbx), %edi
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_PTR_ERR                        ## TAILCALL
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_13
LBB0_3:
	movq	%rbx, %r15
	addq	$24, %r15
	leaq	L_.str.1(%rip), %rax
	movq	%rax, 24(%rbx)
	movq	_POWER_SUPPLY_TYPE_BATTERY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 44(%rbx)
	movq	_ingenic_battery_properties@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%edi, 40(%rbx)
	callq	_ARRAY_SIZE
	movl	%eax, 36(%rbx)
	movq	_ingenic_battery_get_property@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 32(%rbx)
	movq	%rbx, -32(%rbp)
	movl	(%r14), %eax
	movl	%eax, -40(%rbp)
	leaq	-40(%rbp), %rdx
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_devm_power_supply_register
	movl	%eax, 16(%rbx)
	movl	%eax, %edi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	movl	16(%rbx), %edi
	callq	_PTR_ERR
LBB0_12:
	movl	%eax, %r15d
	jmp	LBB0_13
LBB0_5:
	movl	16(%rbx), %edi
	movq	%rbx, %rsi
	callq	_power_supply_get_battery_info
	testl	%eax, %eax
	je	LBB0_7
## %bb.6:
	movl	%eax, %r15d
	leaq	L_.str.3(%rip), %rsi
	movq	%r14, %rdi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_err
LBB0_13:
	movl	%r15d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	cmpq	$0, (%rbx)
	js	LBB0_8
## %bb.9:
	cmpq	$0, 8(%rbx)
	js	LBB0_10
## %bb.11:
	movq	%rbx, %rdi
	callq	_ingenic_battery_set_scale
	jmp	LBB0_12
LBB0_8:
	leaq	L_.str.4(%rip), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	movl	(%rbx), %r15d
	jmp	LBB0_13
LBB0_10:
	leaq	L_.str.5(%rip), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	movl	8(%rbx), %r15d
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"battery"

L_.str.1:                               ## @.str.1
	.asciz	"jz-battery"

	.comm	_POWER_SUPPLY_TYPE_BATTERY,4,2  ## @POWER_SUPPLY_TYPE_BATTERY
	.comm	_ingenic_battery_properties,4,2 ## @ingenic_battery_properties
	.comm	_ingenic_battery_get_property,4,2 ## @ingenic_battery_get_property
L_.str.2:                               ## @.str.2
	.asciz	"Unable to register battery\n"

L_.str.3:                               ## @.str.3
	.asciz	"Unable to get battery info: %d\n"

L_.str.4:                               ## @.str.4
	.asciz	"Unable to get voltage min design\n"

L_.str.5:                               ## @.str.5
	.asciz	"Unable to get voltage max design\n"

	.no_dead_strip	_ingenic_battery_probe
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ingenic_battery_probe
_ingenic_battery_probe:                 ; @ingenic_battery_probe
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	mov	x19, x0
	str	xzr, [sp, #16]
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	w1, #64
	bl	_devm_kzalloc
	cbz	x0, LBB0_3
; %bb.1:
	mov	x20, x0
	str	x19, [x0, #56]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_devm_iio_channel_get
	str	w0, [x20, #48]
	bl	_IS_ERR
	cbz	x0, LBB0_4
; %bb.2:
	ldr	w0, [x20, #48]
	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
	add	sp, sp, #80
	b	_PTR_ERR
LBB0_3:
Lloh5:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_9
LBB0_4:
Lloh8:
	adrp	x8, l_.str.1@PAGE
Lloh9:
	add	x8, x8, l_.str.1@PAGEOFF
	mov	x21, x20
	str	x8, [x21, #24]!
Lloh10:
	adrp	x8, _POWER_SUPPLY_TYPE_BATTERY@GOTPAGE
Lloh11:
	ldr	x8, [x8, _POWER_SUPPLY_TYPE_BATTERY@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
Lloh13:
	adrp	x9, _ingenic_battery_properties@GOTPAGE
Lloh14:
	ldr	x9, [x9, _ingenic_battery_properties@GOTPAGEOFF]
Lloh15:
	ldr	w0, [x9]
	stp	w0, w8, [x20, #40]
	bl	_ARRAY_SIZE
Lloh16:
	adrp	x8, _ingenic_battery_get_property@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ingenic_battery_get_property@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	stp	w8, w0, [x20, #32]
	str	x20, [sp, #24]
	ldr	w8, [x19]
	str	w8, [sp, #16]
	add	x2, sp, #16
	mov	x0, x19
	mov	x1, x21
	bl	_devm_power_supply_register
	str	w0, [x20, #16]
	bl	_IS_ERR
	cbz	x0, LBB0_7
; %bb.5:
Lloh19:
	adrp	x1, l_.str.2@PAGE
Lloh20:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_dev_err
	ldr	w0, [x20, #16]
	bl	_PTR_ERR
LBB0_6:
	mov	x21, x0
	b	LBB0_9
LBB0_7:
	ldr	w0, [x20, #16]
	mov	x1, x20
	bl	_power_supply_get_battery_info
	cbz	w0, LBB0_10
; %bb.8:
	mov	x21, x0
	str	x21, [sp]
Lloh21:
	adrp	x1, l_.str.3@PAGE
Lloh22:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x19
	bl	_dev_err
LBB0_9:
	mov	x0, x21
	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
	add	sp, sp, #80
	ret
LBB0_10:
	ldr	x8, [x20]
	tbnz	x8, #63, LBB0_13
; %bb.11:
	ldr	x8, [x20, #8]
	tbnz	x8, #63, LBB0_14
; %bb.12:
	mov	x0, x20
	bl	_ingenic_battery_set_scale
	b	LBB0_6
LBB0_13:
Lloh23:
	adrp	x1, l_.str.4@PAGE
Lloh24:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x19
	bl	_dev_err
	ldr	w21, [x20]
	b	LBB0_9
LBB0_14:
Lloh25:
	adrp	x1, l_.str.5@PAGE
Lloh26:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x0, x19
	bl	_dev_err
	ldr	w21, [x20, #8]
	b	LBB0_9
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpAdd	Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"battery"

l_.str.1:                               ; @.str.1
	.asciz	"jz-battery"

	.comm	_POWER_SUPPLY_TYPE_BATTERY,4,2  ; @POWER_SUPPLY_TYPE_BATTERY
	.comm	_ingenic_battery_properties,4,2 ; @ingenic_battery_properties
	.comm	_ingenic_battery_get_property,4,2 ; @ingenic_battery_get_property
l_.str.2:                               ; @.str.2
	.asciz	"Unable to register battery\n"

l_.str.3:                               ; @.str.3
	.asciz	"Unable to get battery info: %d\n"

l_.str.4:                               ; @.str.4
	.asciz	"Unable to get voltage min design\n"

l_.str.5:                               ; @.str.5
	.asciz	"Unable to get voltage max design\n"

	.no_dead_strip	_ingenic_battery_probe
.subsections_via_symbols
