	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function goldfish_battery_probe
_goldfish_battery_probe:                ## @goldfish_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
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$40, %esi
	callq	_devm_kzalloc
	testq	%rax, %rax
	je	LBB0_9
## %bb.1:
	movq	%rax, %r14
	leaq	32(%rax), %rdi
	callq	_spin_lock_init
	movq	_IORESOURCE_MEM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%ebx, %ebx
	movq	%r15, %rdi
	xorl	%edx, %edx
	callq	_platform_get_resource
	testq	%rax, %rax
	je	LBB0_7
## %bb.2:
	movl	(%rax), %ebx
	movq	%rax, %rdi
	callq	_resource_size
	movq	%r15, %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_devm_ioremap
	movq	%rax, 24(%r14)
	testq	%rax, %rax
	je	LBB0_8
## %bb.3:
	xorl	%ebx, %ebx
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_platform_get_irq
	movq	%rax, (%r14)
	testq	%rax, %rax
	js	LBB0_10
## %bb.4:
	movq	_goldfish_battery_interrupt@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	_IRQF_SHARED@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	4(%r15), %r8d
	movq	%r15, %rdi
	movq	%rax, %rsi
	movq	%r14, %r9
	callq	_devm_request_irq
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_13
## %bb.5:
	movq	%r14, -32(%rbp)
	movq	_ac_desc@GOTPCREL(%rip), %rsi
	leaq	-32(%rbp), %rdx
	movq	%r15, %rdi
	callq	_power_supply_register
	movq	%rax, 16(%r14)
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_14
## %bb.6:
	movq	16(%r14), %rdi
	jmp	LBB0_16
LBB0_7:
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_11
LBB0_8:
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	callq	_dev_err
LBB0_9:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	jmp	LBB0_12
LBB0_10:
	leaq	L_.str.2(%rip), %rsi
LBB0_11:
	movq	%r15, %rdi
	callq	_dev_err
	movq	_ENODEV@GOTPCREL(%rip), %rax
LBB0_12:
	subl	(%rax), %ebx
LBB0_13:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	movq	_battery_desc@GOTPCREL(%rip), %rsi
	leaq	-32(%rbp), %rdx
	movq	%r15, %rdi
	callq	_power_supply_register
	movq	%rax, 8(%r14)
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_17
## %bb.15:
	movq	16(%r14), %rdi
	callq	_power_supply_unregister
	movq	8(%r14), %rdi
LBB0_16:
	callq	_PTR_ERR
	movl	%eax, %ebx
	jmp	LBB0_13
LBB0_17:
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_platform_set_drvdata
	movq	_BATTERY_INT_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_BATTERY_INT_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	_GOLDFISH_BATTERY_WRITE
	xorl	%ebx, %ebx
	jmp	LBB0_13
	.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	"platform_get_resource failed\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
L_.str.1:                               ## @.str.1
	.asciz	"unable to remap MMIO\n"

L_.str.2:                               ## @.str.2
	.asciz	"platform_get_irq failed\n"

	.comm	_goldfish_battery_interrupt,4,2 ## @goldfish_battery_interrupt
	.comm	_IRQF_SHARED,4,2                ## @IRQF_SHARED
	.comm	_ac_desc,4,2                    ## @ac_desc
	.comm	_battery_desc,4,2               ## @battery_desc
	.comm	_BATTERY_INT_ENABLE,4,2         ## @BATTERY_INT_ENABLE
	.comm	_BATTERY_INT_MASK,4,2           ## @BATTERY_INT_MASK
	.no_dead_strip	_goldfish_battery_probe
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function goldfish_battery_probe
_goldfish_battery_probe:                ; @goldfish_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
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	w1, #40
	bl	_devm_kzalloc
	cbz	x0, LBB0_9
; %bb.1:
	mov	x20, x0
	add	x0, x0, #32
	bl	_spin_lock_init
Lloh3:
	adrp	x8, _IORESOURCE_MEM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _IORESOURCE_MEM@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_platform_get_resource
	cbz	x0, LBB0_7
; %bb.2:
	ldr	w21, [x0]
	bl	_resource_size
	mov	x2, x0
	mov	x0, x19
	mov	x1, x21
	bl	_devm_ioremap
	str	x0, [x20, #24]
	cbz	x0, LBB0_8
; %bb.3:
	mov	x0, x19
	mov	w1, #0
	bl	_platform_get_irq
	str	x0, [x20]
	tbnz	x0, #63, LBB0_10
; %bb.4:
	mov	x1, x0
Lloh6:
	adrp	x8, _goldfish_battery_interrupt@GOTPAGE
Lloh7:
	ldr	x8, [x8, _goldfish_battery_interrupt@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
Lloh9:
	adrp	x8, _IRQF_SHARED@GOTPAGE
Lloh10:
	ldr	x8, [x8, _IRQF_SHARED@GOTPAGEOFF]
Lloh11:
	ldr	w3, [x8]
	ldr	w4, [x19, #4]
	mov	x0, x19
	mov	x5, x20
	bl	_devm_request_irq
	cbnz	w0, LBB0_13
; %bb.5:
	str	x20, [sp, #8]
Lloh12:
	adrp	x1, _ac_desc@GOTPAGE
Lloh13:
	ldr	x1, [x1, _ac_desc@GOTPAGEOFF]
	add	x2, sp, #8
	mov	x0, x19
	bl	_power_supply_register
	str	x0, [x20, #16]
	bl	_IS_ERR
	cbz	x0, LBB0_14
; %bb.6:
	ldr	x0, [x20, #16]
	bl	_PTR_ERR
	b	LBB0_13
LBB0_7:
Lloh14:
	adrp	x1, l_.str@PAGE
Lloh15:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_11
LBB0_8:
Lloh16:
	adrp	x1, l_.str.1@PAGE
Lloh17:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_dev_err
LBB0_9:
Lloh18:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh19:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_12
LBB0_10:
Lloh20:
	adrp	x1, l_.str.2@PAGE
Lloh21:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_11:
	mov	x0, x19
	bl	_dev_err
Lloh22:
	adrp	x8, _ENODEV@GOTPAGE
Lloh23:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
LBB0_12:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_13:
	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_14:
Lloh24:
	adrp	x1, _battery_desc@GOTPAGE
Lloh25:
	ldr	x1, [x1, _battery_desc@GOTPAGEOFF]
	add	x2, sp, #8
	mov	x0, x19
	bl	_power_supply_register
	str	x0, [x20, #8]
	bl	_IS_ERR
	cbz	x0, LBB0_16
; %bb.15:
	ldr	x0, [x20, #16]
	bl	_power_supply_unregister
	ldr	x0, [x20, #8]
	bl	_PTR_ERR
	b	LBB0_13
LBB0_16:
	mov	x0, x19
	mov	x1, x20
	bl	_platform_set_drvdata
Lloh26:
	adrp	x8, _BATTERY_INT_ENABLE@GOTPAGE
Lloh27:
	ldr	x8, [x8, _BATTERY_INT_ENABLE@GOTPAGEOFF]
Lloh28:
	ldr	w1, [x8]
Lloh29:
	adrp	x8, _BATTERY_INT_MASK@GOTPAGE
Lloh30:
	ldr	x8, [x8, _BATTERY_INT_MASK@GOTPAGEOFF]
Lloh31:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_GOLDFISH_BATTERY_WRITE
	mov	w0, #0
	b	LBB0_13
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.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	"platform_get_resource failed\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
l_.str.1:                               ; @.str.1
	.asciz	"unable to remap MMIO\n"

l_.str.2:                               ; @.str.2
	.asciz	"platform_get_irq failed\n"

	.comm	_goldfish_battery_interrupt,4,2 ; @goldfish_battery_interrupt
	.comm	_IRQF_SHARED,4,2                ; @IRQF_SHARED
	.comm	_ac_desc,4,2                    ; @ac_desc
	.comm	_battery_desc,4,2               ; @battery_desc
	.comm	_BATTERY_INT_ENABLE,4,2         ; @BATTERY_INT_ENABLE
	.comm	_BATTERY_INT_MASK,4,2           ; @BATTERY_INT_MASK
	.no_dead_strip	_goldfish_battery_probe
.subsections_via_symbols
