	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function lego_ev3_battery_probe
_lego_ev3_battery_probe:                ## @lego_ev3_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, -32(%rbp)
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$48, %esi
	callq	_devm_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r15
	movq	%r14, %rdi
	movq	%rax, %rsi
	callq	_platform_set_drvdata
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_devm_iio_channel_get
	movq	%rax, 40(%r15)
	movq	%rax, %rdi
	callq	_PTR_ERR_OR_ZERO
	testl	%eax, %eax
	je	LBB0_5
## %bb.3:
	movl	%eax, %ebx
	movq	_EPROBE_DEFER@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%ebx, %eax
	je	LBB0_15
## %bb.4:
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_14
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_15
LBB0_5:
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdi
	callq	_devm_iio_channel_get
	movq	%rax, 32(%r15)
	movq	%rax, %rdi
	callq	_PTR_ERR_OR_ZERO
	testl	%eax, %eax
	je	LBB0_8
## %bb.6:
	movl	%eax, %ebx
	movq	_EPROBE_DEFER@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%ebx, %eax
	je	LBB0_15
## %bb.7:
	leaq	L_.str.3(%rip), %rsi
	jmp	LBB0_14
LBB0_8:
	movq	_GPIOD_IN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	L_.str.4(%rip), %rsi
	movq	%r14, %rdi
	callq	_devm_gpiod_get
	movq	%rax, 24(%r15)
	movq	%rax, %rdi
	callq	_PTR_ERR_OR_ZERO
	testl	%eax, %eax
	je	LBB0_11
## %bb.9:
	movl	%eax, %ebx
	movq	_EPROBE_DEFER@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%ebx, %eax
	je	LBB0_15
## %bb.10:
	leaq	L_.str.5(%rip), %rsi
	jmp	LBB0_14
LBB0_11:
	movq	24(%r15), %rdi
	callq	_gpiod_get_value
	testq	%rax, %rax
	movl	$90000000, %eax                 ## imm = 0x55D4A80
	movl	$84000000, %ecx                 ## imm = 0x501BD00
	cmovel	%eax, %ecx
	movl	$48000000, %eax                 ## imm = 0x2DC6C00
	movl	$60000000, %edx                 ## imm = 0x3938700
	cmovel	%eax, %edx
	movq	_POWER_SUPPLY_TECHNOLOGY_LION@GOTPCREL(%rip), %rax
	cmoveq	_POWER_SUPPLY_TECHNOLOGY_UNKNOWN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%r15)
	movl	%ecx, (%r15)
	movl	%edx, 4(%r15)
	movl	(%r14), %eax
	movl	%eax, -32(%rbp)
	movq	%r15, -40(%rbp)
	movq	_lego_ev3_battery_desc@GOTPCREL(%rip), %rsi
	leaq	-40(%rbp), %rdx
	movq	%r14, %rdi
	callq	_devm_power_supply_register
	movq	%rax, 8(%r15)
	movq	%rax, %rdi
	callq	_PTR_ERR_OR_ZERO
	testl	%eax, %eax
	je	LBB0_12
## %bb.13:
	movl	%eax, %ebx
	leaq	L_.str.6(%rip), %rsi
LBB0_14:
	movq	%r14, %rdi
	callq	_dev_err
LBB0_15:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	xorl	%ebx, %ebx
	jmp	LBB0_15
	.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	"voltage"

	.comm	_EPROBE_DEFER,4,2               ## @EPROBE_DEFER
L_.str.1:                               ## @.str.1
	.asciz	"Failed to get voltage iio channel\n"

L_.str.2:                               ## @.str.2
	.asciz	"current"

L_.str.3:                               ## @.str.3
	.asciz	"Failed to get current iio channel\n"

L_.str.4:                               ## @.str.4
	.asciz	"rechargeable"

	.comm	_GPIOD_IN,4,2                   ## @GPIOD_IN
L_.str.5:                               ## @.str.5
	.asciz	"Failed to get rechargeable gpio\n"

	.comm	_POWER_SUPPLY_TECHNOLOGY_LION,4,2 ## @POWER_SUPPLY_TECHNOLOGY_LION
	.comm	_POWER_SUPPLY_TECHNOLOGY_UNKNOWN,4,2 ## @POWER_SUPPLY_TECHNOLOGY_UNKNOWN
	.comm	_lego_ev3_battery_desc,4,2      ## @lego_ev3_battery_desc
L_.str.6:                               ## @.str.6
	.asciz	"failed to register power supply\n"

	.no_dead_strip	_lego_ev3_battery_probe
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function lego_ev3_battery_probe
lCPI0_0:
	.long	84000000                        ; 0x501bd00
	.long	60000000                        ; 0x3938700
lCPI0_1:
	.long	90000000                        ; 0x55d4a80
	.long	48000000                        ; 0x2dc6c00
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_lego_ev3_battery_probe:                ; @lego_ev3_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, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	w1, #48
	bl	_devm_kzalloc
	cbz	x0, LBB0_4
; %bb.1:
	mov	x20, x0
	mov	x0, x19
	mov	x1, x20
	bl	_platform_set_drvdata
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_devm_iio_channel_get
	str	x0, [x20, #40]
	bl	_PTR_ERR_OR_ZERO
	cbz	w0, LBB0_5
; %bb.2:
	mov	x21, x0
Lloh5:
	adrp	x8, _EPROBE_DEFER@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EPROBE_DEFER@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	cmn	w0, w8
	b.eq	LBB0_14
; %bb.3:
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_13
LBB0_4:
Lloh10:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_14
LBB0_5:
Lloh13:
	adrp	x1, l_.str.2@PAGE
Lloh14:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_devm_iio_channel_get
	str	x0, [x20, #32]
	bl	_PTR_ERR_OR_ZERO
	cbz	w0, LBB0_8
; %bb.6:
	mov	x21, x0
Lloh15:
	adrp	x8, _EPROBE_DEFER@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EPROBE_DEFER@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	cmn	w0, w8
	b.eq	LBB0_14
; %bb.7:
Lloh18:
	adrp	x1, l_.str.3@PAGE
Lloh19:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_13
LBB0_8:
Lloh20:
	adrp	x8, _GPIOD_IN@GOTPAGE
Lloh21:
	ldr	x8, [x8, _GPIOD_IN@GOTPAGEOFF]
Lloh22:
	ldr	w2, [x8]
Lloh23:
	adrp	x1, l_.str.4@PAGE
Lloh24:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x19
	bl	_devm_gpiod_get
	str	x0, [x20, #24]
	bl	_PTR_ERR_OR_ZERO
	cbz	w0, LBB0_11
; %bb.9:
	mov	x21, x0
Lloh25:
	adrp	x8, _EPROBE_DEFER@GOTPAGE
Lloh26:
	ldr	x8, [x8, _EPROBE_DEFER@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
	cmn	w0, w8
	b.eq	LBB0_14
; %bb.10:
Lloh28:
	adrp	x1, l_.str.5@PAGE
Lloh29:
	add	x1, x1, l_.str.5@PAGEOFF
	b	LBB0_13
LBB0_11:
	ldr	x0, [x20, #24]
	bl	_gpiod_get_value
Lloh30:
	adrp	x8, _POWER_SUPPLY_TECHNOLOGY_UNKNOWN@GOTPAGE
Lloh31:
	ldr	x8, [x8, _POWER_SUPPLY_TECHNOLOGY_UNKNOWN@GOTPAGEOFF]
Lloh32:
	adrp	x9, _POWER_SUPPLY_TECHNOLOGY_LION@GOTPAGE
Lloh33:
	ldr	x9, [x9, _POWER_SUPPLY_TECHNOLOGY_LION@GOTPAGEOFF]
	cmp	x0, #0
	csel	x8, x8, x9, eq
	cset	w9, eq
	ldr	w8, [x8]
	dup.2s	v0, w9
	str	w8, [x20, #16]
	shl.2s	v0, v0, #31
	cmlt.2s	v0, v0, #0
Lloh34:
	adrp	x8, lCPI0_0@PAGE
Lloh35:
	ldr	d1, [x8, lCPI0_0@PAGEOFF]
Lloh36:
	adrp	x8, lCPI0_1@PAGE
Lloh37:
	ldr	d2, [x8, lCPI0_1@PAGEOFF]
	bsl.8b	v0, v2, v1
	str	d0, [x20]
	ldr	w8, [x19]
	str	w8, [sp, #8]
	str	x20, [sp]
Lloh38:
	adrp	x1, _lego_ev3_battery_desc@GOTPAGE
Lloh39:
	ldr	x1, [x1, _lego_ev3_battery_desc@GOTPAGEOFF]
	mov	x2, sp
	mov	x0, x19
	bl	_devm_power_supply_register
	str	x0, [x20, #8]
	bl	_PTR_ERR_OR_ZERO
	mov	x21, x0
	cbz	w0, LBB0_14
; %bb.12:
Lloh40:
	adrp	x1, l_.str.6@PAGE
Lloh41:
	add	x1, x1, l_.str.6@PAGEOFF
LBB0_13:
	mov	x0, x19
	bl	_dev_err
LBB0_14:
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh38, Lloh39
	.loh AdrpLdr	Lloh36, Lloh37
	.loh AdrpAdrp	Lloh34, Lloh36
	.loh AdrpLdr	Lloh34, Lloh35
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpAdd	Lloh40, Lloh41
	.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	"voltage"

	.comm	_EPROBE_DEFER,4,2               ; @EPROBE_DEFER
l_.str.1:                               ; @.str.1
	.asciz	"Failed to get voltage iio channel\n"

l_.str.2:                               ; @.str.2
	.asciz	"current"

l_.str.3:                               ; @.str.3
	.asciz	"Failed to get current iio channel\n"

l_.str.4:                               ; @.str.4
	.asciz	"rechargeable"

	.comm	_GPIOD_IN,4,2                   ; @GPIOD_IN
l_.str.5:                               ; @.str.5
	.asciz	"Failed to get rechargeable gpio\n"

	.comm	_POWER_SUPPLY_TECHNOLOGY_LION,4,2 ; @POWER_SUPPLY_TECHNOLOGY_LION
	.comm	_POWER_SUPPLY_TECHNOLOGY_UNKNOWN,4,2 ; @POWER_SUPPLY_TECHNOLOGY_UNKNOWN
	.comm	_lego_ev3_battery_desc,4,2      ; @lego_ev3_battery_desc
l_.str.6:                               ; @.str.6
	.asciz	"failed to register power supply\n"

	.no_dead_strip	_lego_ev3_battery_probe
.subsections_via_symbols
