	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cpcap_battery_probe
_cpcap_battery_probe:                   ## @cpcap_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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	$0, -40(%rbp)
	movq	_cpcap_battery_id_table@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_of_match_ptr
	movl	%eax, %edi
	movq	%r15, %rsi
	callq	_of_match_device
	testq	%rax, %rax
	je	LBB0_11
## %bb.1:
	movq	%rax, %rbx
	cmpl	$0, (%rax)
	je	LBB0_12
## %bb.2:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %r12
	movl	(%r12), %edx
	movq	%r15, %rdi
	movl	$40, %esi
	callq	_devm_kzalloc
	testq	%rax, %rax
	je	LBB0_13
## %bb.3:
	movq	%rax, %r14
	leaq	32(%rax), %rdi
	callq	_INIT_LIST_HEAD
	movq	%r15, 8(%r14)
	leaq	20(%r14), %rdi
	movl	(%rbx), %esi
	movl	$4, %edx
	callq	_memcpy
	movq	8(%r14), %rax
	movl	4(%rax), %edi
	xorl	%ebx, %ebx
	xorl	%esi, %esi
	callq	_dev_get_regmap
	movl	%eax, 24(%r14)
	testl	%eax, %eax
	je	LBB0_17
## %bb.4:
	movq	8(%r14), %rdi
	movq	%r14, %rdx
	addq	$28, %rdx
	movl	%eax, %esi
	callq	_cpcap_get_vendor
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_16
## %bb.5:
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_platform_set_drvdata
	movl	20(%r14), %ecx
	movl	24(%r14), %edi
	movq	_CPCAP_REG_CCM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$65535, %edx                    ## imm = 0xFFFF
	callq	_regmap_update_bits
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_16
## %bb.6:
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_cpcap_battery_init_interrupts
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_16
## %bb.7:
	movq	%r14, %rdi
	callq	_cpcap_battery_init_iio
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_16
## %bb.8:
	movq	8(%r14), %rdi
	movl	(%r12), %edx
	movl	$24, %esi
	callq	_devm_kzalloc
	testq	%rax, %rax
	je	LBB0_13
## %bb.9:
	movq	%rax, %rbx
	leaq	L_.str.1(%rip), %rax
	movq	%rax, (%rbx)
	movq	_POWER_SUPPLY_TYPE_BATTERY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 20(%rbx)
	movq	_cpcap_battery_props@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%edi, 16(%rbx)
	callq	_ARRAY_SIZE
	movl	%eax, 12(%rbx)
	movq	_cpcap_battery_get_property@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%rbx)
	movl	(%r15), %eax
	movl	%eax, -40(%rbp)
	movq	%r14, -48(%rbp)
	movq	8(%r14), %rdi
	leaq	-48(%rbp), %rdx
	movq	%rbx, %rsi
	callq	_devm_power_supply_register
	movl	%eax, 16(%r14)
	movl	%eax, %edi
	callq	_PTR_ERR_OR_ZERO
	testl	%eax, %eax
	je	LBB0_18
## %bb.10:
	movl	%eax, %ebx
	movq	8(%r14), %rdi
	leaq	L_.str.2(%rip), %rsi
	callq	_dev_err
	jmp	LBB0_16
LBB0_11:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_14
LBB0_12:
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	callq	_dev_err
	movq	_ENODEV@GOTPCREL(%rip), %rax
	jmp	LBB0_14
LBB0_13:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_14:
	xorl	%ebx, %ebx
LBB0_15:
	subl	(%rax), %ebx
LBB0_16:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_17:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	jmp	LBB0_15
LBB0_18:
	movq	%r14, %rdi
	movl	$1, %esi
	callq	_atomic_set
	xorl	%ebx, %ebx
	jmp	LBB0_16
	.cfi_endproc
                                        ## -- End function
	.comm	_cpcap_battery_id_table,4,2     ## @cpcap_battery_id_table
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"no configuration data found\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_CPCAP_REG_CCM,4,2              ## @CPCAP_REG_CCM
L_.str.1:                               ## @.str.1
	.asciz	"battery"

	.comm	_POWER_SUPPLY_TYPE_BATTERY,4,2  ## @POWER_SUPPLY_TYPE_BATTERY
	.comm	_cpcap_battery_props,4,2        ## @cpcap_battery_props
	.comm	_cpcap_battery_get_property,4,2 ## @cpcap_battery_get_property
L_.str.2:                               ## @.str.2
	.asciz	"failed to register power supply\n"

	.no_dead_strip	_cpcap_battery_probe
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cpcap_battery_probe
_cpcap_battery_probe:                   ; @cpcap_battery_probe
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x0
	str	xzr, [sp, #8]
Lloh0:
	adrp	x8, _cpcap_battery_id_table@GOTPAGE
Lloh1:
	ldr	x8, [x8, _cpcap_battery_id_table@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_of_match_ptr
	mov	x1, x19
	bl	_of_match_device
	cbz	x0, LBB0_11
; %bb.1:
	mov	x21, x0
	ldr	w8, [x0]
	cbz	w8, LBB0_12
; %bb.2:
Lloh3:
	adrp	x22, _GFP_KERNEL@GOTPAGE
Lloh4:
	ldr	x22, [x22, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w2, [x22]
	mov	x0, x19
	mov	w1, #40
	bl	_devm_kzalloc
	cbz	x0, LBB0_14
; %bb.3:
	mov	x20, x0
	add	x0, x0, #32
	bl	_INIT_LIST_HEAD
	str	x19, [x20, #8]
	add	x0, x20, #20
	ldr	w1, [x21]
	mov	w2, #4
	bl	_memcpy
	ldr	x8, [x20, #8]
	ldr	w0, [x8, #4]
	mov	x1, #0
	bl	_dev_get_regmap
	str	w0, [x20, #24]
	cbz	w0, LBB0_13
; %bb.4:
	mov	x1, x0
	ldr	x0, [x20, #8]
	add	x2, x20, #28
	bl	_cpcap_get_vendor
	mov	x21, x0
	cbnz	w0, LBB0_16
; %bb.5:
	mov	x0, x19
	mov	x1, x20
	bl	_platform_set_drvdata
Lloh5:
	adrp	x8, _CPCAP_REG_CCM@GOTPAGE
Lloh6:
	ldr	x8, [x8, _CPCAP_REG_CCM@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	ldp	w3, w0, [x20, #20]
	mov	w2, #65535
	bl	_regmap_update_bits
	mov	x21, x0
	cbnz	w0, LBB0_16
; %bb.6:
	mov	x0, x19
	mov	x1, x20
	bl	_cpcap_battery_init_interrupts
	mov	x21, x0
	cbnz	w0, LBB0_16
; %bb.7:
	mov	x0, x20
	bl	_cpcap_battery_init_iio
	mov	x21, x0
	cbnz	w0, LBB0_16
; %bb.8:
	ldr	x0, [x20, #8]
	ldr	w2, [x22]
	mov	w1, #24
	bl	_devm_kzalloc
	cbz	x0, LBB0_14
; %bb.9:
	mov	x21, x0
Lloh8:
	adrp	x8, l_.str.1@PAGE
Lloh9:
	add	x8, x8, l_.str.1@PAGEOFF
	str	x8, [x0]
Lloh10:
	adrp	x8, _POWER_SUPPLY_TYPE_BATTERY@GOTPAGE
Lloh11:
	ldr	x8, [x8, _POWER_SUPPLY_TYPE_BATTERY@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
Lloh13:
	adrp	x9, _cpcap_battery_props@GOTPAGE
Lloh14:
	ldr	x9, [x9, _cpcap_battery_props@GOTPAGEOFF]
Lloh15:
	ldr	w0, [x9]
	stp	w0, w8, [x21, #16]
	bl	_ARRAY_SIZE
Lloh16:
	adrp	x8, _cpcap_battery_get_property@GOTPAGE
Lloh17:
	ldr	x8, [x8, _cpcap_battery_get_property@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	stp	w8, w0, [x21, #8]
	ldr	w8, [x19]
	str	w8, [sp, #8]
	str	x20, [sp]
	ldr	x0, [x20, #8]
	mov	x2, sp
	mov	x1, x21
	bl	_devm_power_supply_register
	str	w0, [x20, #16]
	bl	_PTR_ERR_OR_ZERO
	mov	x21, x0
	cbz	w0, LBB0_17
; %bb.10:
	ldr	x0, [x20, #8]
Lloh19:
	adrp	x1, l_.str.2@PAGE
Lloh20:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_err
	b	LBB0_16
LBB0_11:
Lloh21:
	adrp	x8, _EINVAL@GOTPAGE
Lloh22:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_15
LBB0_12:
Lloh23:
	adrp	x1, l_.str@PAGE
Lloh24:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_dev_err
LBB0_13:
Lloh25:
	adrp	x8, _ENODEV@GOTPAGE
Lloh26:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	b	LBB0_15
LBB0_14:
Lloh27:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh28:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_15:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_16:
	mov	x0, x21
	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
	add	sp, sp, #64
	ret
LBB0_17:
	mov	x0, x20
	mov	w1, #1
	bl	_atomic_set
	b	LBB0_16
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	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 AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_cpcap_battery_id_table,4,2     ; @cpcap_battery_id_table
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"no configuration data found\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_CPCAP_REG_CCM,4,2              ; @CPCAP_REG_CCM
l_.str.1:                               ; @.str.1
	.asciz	"battery"

	.comm	_POWER_SUPPLY_TYPE_BATTERY,4,2  ; @POWER_SUPPLY_TYPE_BATTERY
	.comm	_cpcap_battery_props,4,2        ; @cpcap_battery_props
	.comm	_cpcap_battery_get_property,4,2 ; @cpcap_battery_get_property
l_.str.2:                               ; @.str.2
	.asciz	"failed to register power supply\n"

	.no_dead_strip	_cpcap_battery_probe
.subsections_via_symbols
