	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tosa_bat_probe
_tosa_bat_probe:                        ## @tosa_bat_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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	$0, -56(%rbp)
	movq	$0, -48(%rbp)
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_machine_is_tosa
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movq	_tosa_bat_gpios@GOTPCREL(%rip), %r15
	movl	(%r15), %ebx
	movl	%ebx, %edi
	callq	_ARRAY_SIZE
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_gpio_request_array
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_19
## %bb.3:
	movq	_tosa_bat_main@GOTPCREL(%rip), %r12
	leaq	8(%r12), %rdi
	callq	_mutex_init
	movq	_tosa_bat_jacket@GOTPCREL(%rip), %r13
	leaq	8(%r13), %rdi
	callq	_mutex_init
	movq	_tosa_bat_work@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_bat_work@GOTPCREL(%rip), %rdi
	callq	_INIT_WORK
	movq	%r12, -64(%rbp)
	movq	_tosa_bat_main_desc@GOTPCREL(%rip), %rsi
	leaq	-64(%rbp), %rdx
	movq	%r14, %rdi
	callq	_power_supply_register
	movq	%rax, (%r12)
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movq	(%r12), %rdi
	callq	_PTR_ERR
	movl	%eax, %ebx
	jmp	LBB0_18
LBB0_1:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_19
LBB0_5:
	movq	%r13, -56(%rbp)
	movq	_tosa_bat_jacket_desc@GOTPCREL(%rip), %rsi
	leaq	-56(%rbp), %rdx
	movq	%r14, %rdi
	callq	_power_supply_register
	movq	%rax, (%r13)
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movq	(%r13), %rdi
	callq	_PTR_ERR
	movl	%eax, %ebx
	jmp	LBB0_17
LBB0_7:
	movq	_tosa_bat_bu@GOTPCREL(%rip), %rbx
	movq	%rbx, -48(%rbp)
	movq	_tosa_bat_bu_desc@GOTPCREL(%rip), %rsi
	leaq	-48(%rbp), %rdx
	movq	%r14, %rdi
	callq	_power_supply_register
	movq	%rax, (%rbx)
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	movq	(%rbx), %rdi
	callq	_PTR_ERR
	movl	%eax, %ebx
	jmp	LBB0_16
LBB0_9:
	movq	_TOSA_GPIO_BAT0_CRG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_gpio_to_irq
	movq	_tosa_bat_gpio_isr@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	_IRQF_TRIGGER_RISING@GOTPCREL(%rip), %rcx
	movq	_IRQF_TRIGGER_FALLING@GOTPCREL(%rip), %r14
	movl	(%r14), %edx
	orl	(%rcx), %edx
	leaq	L_.str(%rip), %rcx
	movq	_tosa_bat_main@GOTPCREL(%rip), %r8
	movl	%eax, %edi
	callq	_request_irq
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_15
## %bb.10:
	movq	_TOSA_GPIO_BAT1_CRG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_gpio_to_irq
	movq	_tosa_bat_gpio_isr@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	(%r14), %edx
	movq	_IRQF_TRIGGER_RISING@GOTPCREL(%rip), %rcx
	orl	(%rcx), %edx
	leaq	L_.str.1(%rip), %rcx
	movq	_tosa_bat_jacket@GOTPCREL(%rip), %r8
	movl	%eax, %edi
	callq	_request_irq
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_14
## %bb.11:
	movq	_TOSA_GPIO_JACKET_DETECT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_gpio_to_irq
	movq	_tosa_bat_gpio_isr@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	(%r14), %edx
	movq	_IRQF_TRIGGER_RISING@GOTPCREL(%rip), %rcx
	orl	(%rcx), %edx
	leaq	L_.str.2(%rip), %rcx
	movq	_tosa_bat_jacket@GOTPCREL(%rip), %r8
	movl	%eax, %edi
	callq	_request_irq
	testl	%eax, %eax
	je	LBB0_12
## %bb.13:
	movl	%eax, %ebx
	movq	_TOSA_GPIO_BAT1_CRG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_gpio_to_irq
	movq	_tosa_bat_jacket@GOTPCREL(%rip), %rsi
	movl	%eax, %edi
	callq	_free_irq
LBB0_14:
	movq	_TOSA_GPIO_BAT0_CRG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_gpio_to_irq
	movq	_tosa_bat_main@GOTPCREL(%rip), %rsi
	movl	%eax, %edi
	callq	_free_irq
LBB0_15:
	movq	_tosa_bat_bu@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	_power_supply_unregister
LBB0_16:
	movq	(%r13), %rdi
	callq	_power_supply_unregister
LBB0_17:
	movq	(%r12), %rdi
	callq	_power_supply_unregister
LBB0_18:
	movq	_bat_work@GOTPCREL(%rip), %rdi
	callq	_cancel_work_sync
	movl	(%r15), %r14d
	movl	%r14d, %edi
	callq	_ARRAY_SIZE
	movl	%r14d, %edi
	movl	%eax, %esi
	callq	_gpio_free_array
LBB0_19:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	movq	_bat_work@GOTPCREL(%rip), %rdi
	callq	_schedule_work
	xorl	%ebx, %ebx
	jmp	LBB0_19
	.cfi_endproc
                                        ## -- End function
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_tosa_bat_gpios,4,2             ## @tosa_bat_gpios
	.comm	_tosa_bat_main,16,3             ## @tosa_bat_main
	.comm	_tosa_bat_jacket,16,3           ## @tosa_bat_jacket
	.comm	_bat_work,4,2                   ## @bat_work
	.comm	_tosa_bat_work,4,2              ## @tosa_bat_work
	.comm	_tosa_bat_main_desc,4,2         ## @tosa_bat_main_desc
	.comm	_tosa_bat_jacket_desc,4,2       ## @tosa_bat_jacket_desc
	.comm	_tosa_bat_bu,16,3               ## @tosa_bat_bu
	.comm	_tosa_bat_bu_desc,4,2           ## @tosa_bat_bu_desc
	.comm	_TOSA_GPIO_BAT0_CRG,4,2         ## @TOSA_GPIO_BAT0_CRG
	.comm	_tosa_bat_gpio_isr,4,2          ## @tosa_bat_gpio_isr
	.comm	_IRQF_TRIGGER_RISING,4,2        ## @IRQF_TRIGGER_RISING
	.comm	_IRQF_TRIGGER_FALLING,4,2       ## @IRQF_TRIGGER_FALLING
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"main full"

	.comm	_TOSA_GPIO_BAT1_CRG,4,2         ## @TOSA_GPIO_BAT1_CRG
L_.str.1:                               ## @.str.1
	.asciz	"jacket full"

	.comm	_TOSA_GPIO_JACKET_DETECT,4,2    ## @TOSA_GPIO_JACKET_DETECT
L_.str.2:                               ## @.str.2
	.asciz	"jacket detect"

	.no_dead_strip	_tosa_bat_probe
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tosa_bat_probe
_tosa_bat_probe:                        ; @tosa_bat_probe
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x0
	stp	xzr, xzr, [sp, #8]
	bl	_machine_is_tosa
	cbz	w0, LBB0_4
; %bb.1:
Lloh0:
	adrp	x21, _tosa_bat_gpios@GOTPAGE
Lloh1:
	ldr	x21, [x21, _tosa_bat_gpios@GOTPAGEOFF]
	ldr	w19, [x21]
	mov	x0, x19
	bl	_ARRAY_SIZE
	mov	x1, x0
	mov	x0, x19
	bl	_gpio_request_array
	mov	x19, x0
	cbnz	w0, LBB0_18
; %bb.2:
Lloh2:
	adrp	x22, _tosa_bat_main@GOTPAGE
Lloh3:
	ldr	x22, [x22, _tosa_bat_main@GOTPAGEOFF]
	add	x0, x22, #8
	bl	_mutex_init
Lloh4:
	adrp	x23, _tosa_bat_jacket@GOTPAGE
Lloh5:
	ldr	x23, [x23, _tosa_bat_jacket@GOTPAGEOFF]
	add	x0, x23, #8
	bl	_mutex_init
Lloh6:
	adrp	x8, _tosa_bat_work@GOTPAGE
Lloh7:
	ldr	x8, [x8, _tosa_bat_work@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
Lloh9:
	adrp	x0, _bat_work@GOTPAGE
Lloh10:
	ldr	x0, [x0, _bat_work@GOTPAGEOFF]
	bl	_INIT_WORK
	str	x22, [sp, #24]
Lloh11:
	adrp	x1, _tosa_bat_main_desc@GOTPAGE
Lloh12:
	ldr	x1, [x1, _tosa_bat_main_desc@GOTPAGEOFF]
	add	x2, sp, #24
	mov	x0, x20
	bl	_power_supply_register
	str	x0, [x22]
	bl	_IS_ERR
	cbz	x0, LBB0_5
; %bb.3:
	ldr	x0, [x22]
	bl	_PTR_ERR
	mov	x19, x0
	b	LBB0_17
LBB0_4:
Lloh13:
	adrp	x8, _ENODEV@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	neg	w19, w8
	b	LBB0_18
LBB0_5:
	str	x23, [sp, #16]
Lloh16:
	adrp	x1, _tosa_bat_jacket_desc@GOTPAGE
Lloh17:
	ldr	x1, [x1, _tosa_bat_jacket_desc@GOTPAGEOFF]
	add	x2, sp, #16
	mov	x0, x20
	bl	_power_supply_register
	str	x0, [x23]
	bl	_IS_ERR
	cbz	x0, LBB0_7
; %bb.6:
	ldr	x0, [x23]
	bl	_PTR_ERR
	mov	x19, x0
	b	LBB0_16
LBB0_7:
Lloh18:
	adrp	x24, _tosa_bat_bu@GOTPAGE
Lloh19:
	ldr	x24, [x24, _tosa_bat_bu@GOTPAGEOFF]
	str	x24, [sp, #8]
Lloh20:
	adrp	x1, _tosa_bat_bu_desc@GOTPAGE
Lloh21:
	ldr	x1, [x1, _tosa_bat_bu_desc@GOTPAGEOFF]
	add	x2, sp, #8
	mov	x0, x20
	bl	_power_supply_register
	str	x0, [x24]
	bl	_IS_ERR
	cbz	x0, LBB0_9
; %bb.8:
	ldr	x0, [x24]
	bl	_PTR_ERR
	mov	x19, x0
	b	LBB0_15
LBB0_9:
Lloh22:
	adrp	x20, _TOSA_GPIO_BAT0_CRG@GOTPAGE
Lloh23:
	ldr	x20, [x20, _TOSA_GPIO_BAT0_CRG@GOTPAGEOFF]
	ldr	w0, [x20]
	bl	_gpio_to_irq
Lloh24:
	adrp	x25, _tosa_bat_gpio_isr@GOTPAGE
Lloh25:
	ldr	x25, [x25, _tosa_bat_gpio_isr@GOTPAGEOFF]
Lloh26:
	adrp	x26, _IRQF_TRIGGER_RISING@GOTPAGE
Lloh27:
	ldr	x26, [x26, _IRQF_TRIGGER_RISING@GOTPAGEOFF]
	ldr	w1, [x25]
	ldr	w8, [x26]
Lloh28:
	adrp	x27, _IRQF_TRIGGER_FALLING@GOTPAGE
Lloh29:
	ldr	x27, [x27, _IRQF_TRIGGER_FALLING@GOTPAGEOFF]
	ldr	w9, [x27]
	orr	w2, w9, w8
Lloh30:
	adrp	x3, l_.str@PAGE
Lloh31:
	add	x3, x3, l_.str@PAGEOFF
Lloh32:
	adrp	x4, _tosa_bat_main@GOTPAGE
Lloh33:
	ldr	x4, [x4, _tosa_bat_main@GOTPAGEOFF]
	bl	_request_irq
	mov	x19, x0
	cbnz	w0, LBB0_14
; %bb.10:
Lloh34:
	adrp	x28, _TOSA_GPIO_BAT1_CRG@GOTPAGE
Lloh35:
	ldr	x28, [x28, _TOSA_GPIO_BAT1_CRG@GOTPAGEOFF]
	ldr	w0, [x28]
	bl	_gpio_to_irq
	ldr	w1, [x25]
	ldr	w8, [x26]
	ldr	w9, [x27]
	orr	w2, w9, w8
Lloh36:
	adrp	x3, l_.str.1@PAGE
Lloh37:
	add	x3, x3, l_.str.1@PAGEOFF
Lloh38:
	adrp	x4, _tosa_bat_jacket@GOTPAGE
Lloh39:
	ldr	x4, [x4, _tosa_bat_jacket@GOTPAGEOFF]
	bl	_request_irq
	mov	x19, x0
	cbnz	w0, LBB0_13
; %bb.11:
Lloh40:
	adrp	x8, _TOSA_GPIO_JACKET_DETECT@GOTPAGE
Lloh41:
	ldr	x8, [x8, _TOSA_GPIO_JACKET_DETECT@GOTPAGEOFF]
Lloh42:
	ldr	w0, [x8]
	bl	_gpio_to_irq
	ldr	w1, [x25]
	ldr	w8, [x26]
	ldr	w9, [x27]
	orr	w2, w9, w8
Lloh43:
	adrp	x3, l_.str.2@PAGE
Lloh44:
	add	x3, x3, l_.str.2@PAGEOFF
Lloh45:
	adrp	x4, _tosa_bat_jacket@GOTPAGE
Lloh46:
	ldr	x4, [x4, _tosa_bat_jacket@GOTPAGEOFF]
	bl	_request_irq
	mov	x19, x0
	cbz	w0, LBB0_19
; %bb.12:
	ldr	w0, [x28]
	bl	_gpio_to_irq
Lloh47:
	adrp	x1, _tosa_bat_jacket@GOTPAGE
Lloh48:
	ldr	x1, [x1, _tosa_bat_jacket@GOTPAGEOFF]
	bl	_free_irq
LBB0_13:
	ldr	w0, [x20]
	bl	_gpio_to_irq
Lloh49:
	adrp	x1, _tosa_bat_main@GOTPAGE
Lloh50:
	ldr	x1, [x1, _tosa_bat_main@GOTPAGEOFF]
	bl	_free_irq
LBB0_14:
	ldr	x0, [x24]
	bl	_power_supply_unregister
LBB0_15:
	ldr	x0, [x23]
	bl	_power_supply_unregister
LBB0_16:
	ldr	x0, [x22]
	bl	_power_supply_unregister
LBB0_17:
Lloh51:
	adrp	x0, _bat_work@GOTPAGE
Lloh52:
	ldr	x0, [x0, _bat_work@GOTPAGEOFF]
	bl	_cancel_work_sync
	ldr	w20, [x21]
	mov	x0, x20
	bl	_ARRAY_SIZE
	mov	x1, x0
	mov	x0, x20
	bl	_gpio_free_array
LBB0_18:
	mov	x0, x19
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_19:
Lloh53:
	adrp	x0, _bat_work@GOTPAGE
Lloh54:
	ldr	x0, [x0, _bat_work@GOTPAGEOFF]
	bl	_schedule_work
	b	LBB0_18
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh38, Lloh39
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpLdrGot	Lloh34, Lloh35
	.loh AdrpLdrGot	Lloh45, Lloh46
	.loh AdrpAdd	Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGot	Lloh47, Lloh48
	.loh AdrpLdrGot	Lloh49, Lloh50
	.loh AdrpLdrGot	Lloh51, Lloh52
	.loh AdrpLdrGot	Lloh53, Lloh54
	.cfi_endproc
                                        ; -- End function
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_tosa_bat_gpios,4,2             ; @tosa_bat_gpios
	.comm	_tosa_bat_main,16,3             ; @tosa_bat_main
	.comm	_tosa_bat_jacket,16,3           ; @tosa_bat_jacket
	.comm	_bat_work,4,2                   ; @bat_work
	.comm	_tosa_bat_work,4,2              ; @tosa_bat_work
	.comm	_tosa_bat_main_desc,4,2         ; @tosa_bat_main_desc
	.comm	_tosa_bat_jacket_desc,4,2       ; @tosa_bat_jacket_desc
	.comm	_tosa_bat_bu,16,3               ; @tosa_bat_bu
	.comm	_tosa_bat_bu_desc,4,2           ; @tosa_bat_bu_desc
	.comm	_TOSA_GPIO_BAT0_CRG,4,2         ; @TOSA_GPIO_BAT0_CRG
	.comm	_tosa_bat_gpio_isr,4,2          ; @tosa_bat_gpio_isr
	.comm	_IRQF_TRIGGER_RISING,4,2        ; @IRQF_TRIGGER_RISING
	.comm	_IRQF_TRIGGER_FALLING,4,2       ; @IRQF_TRIGGER_FALLING
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"main full"

	.comm	_TOSA_GPIO_BAT1_CRG,4,2         ; @TOSA_GPIO_BAT1_CRG
l_.str.1:                               ; @.str.1
	.asciz	"jacket full"

	.comm	_TOSA_GPIO_JACKET_DETECT,4,2    ; @TOSA_GPIO_JACKET_DETECT
l_.str.2:                               ; @.str.2
	.asciz	"jacket detect"

	.no_dead_strip	_tosa_bat_probe
.subsections_via_symbols
