	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function collie_bat_probe
_collie_bat_probe:                      ## @collie_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, -48(%rbp)
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_machine_is_collie
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movq	(%r14), %rax
	movq	_ucb@GOTPCREL(%rip), %r12
	movq	%rax, (%r12)
	movq	_collie_batt_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_12
## %bb.3:
	movq	_collie_bat_main@GOTPCREL(%rip), %r13
	leaq	8(%r13), %rdi
	callq	_mutex_init
	movq	_collie_bat_work@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_bat_work@GOTPCREL(%rip), %rdi
	callq	_INIT_WORK
	movq	%r13, -56(%rbp)
	movq	(%r14), %rdi
	movq	_collie_bat_main_desc@GOTPCREL(%rip), %rsi
	leaq	-56(%rbp), %rdx
	callq	_power_supply_register
	movq	%rax, (%r13)
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movq	(%r13), %rdi
	callq	_PTR_ERR
	movl	%eax, %ebx
	jmp	LBB0_11
LBB0_1:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_12
LBB0_5:
	movq	_collie_bat_bu@GOTPCREL(%rip), %rbx
	movq	%rbx, -48(%rbp)
	movq	(%r14), %rdi
	movq	_collie_bat_bu_desc@GOTPCREL(%rip), %rsi
	leaq	-48(%rbp), %rdx
	callq	_power_supply_register
	movq	%rax, (%rbx)
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movq	(%rbx), %rdi
	callq	_PTR_ERR
	movl	%eax, %ebx
	jmp	LBB0_10
LBB0_7:
	movq	%rbx, %r14
	movq	_COLLIE_GPIO_CO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_gpio_to_irq
	movq	_collie_bat_gpio_isr@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	_IRQF_TRIGGER_RISING@GOTPCREL(%rip), %rcx
	movq	_IRQF_TRIGGER_FALLING@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rcx), %edx
	leaq	L_.str(%rip), %rcx
	movq	_collie_bat_main@GOTPCREL(%rip), %r8
	movl	%eax, %edi
	callq	_request_irq
	testl	%eax, %eax
	je	LBB0_8
## %bb.9:
	movl	%eax, %ebx
	movq	(%r14), %rdi
	callq	_power_supply_unregister
LBB0_10:
	movq	(%r13), %rdi
	callq	_power_supply_unregister
LBB0_11:
	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_12:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	(%r12), %rdi
	movl	$1, %esi
	callq	_device_init_wakeup
	movq	_bat_work@GOTPCREL(%rip), %rdi
	callq	_schedule_work
	xorl	%ebx, %ebx
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_ucb,8,3                        ## @ucb
	.comm	_collie_batt_gpios,4,2          ## @collie_batt_gpios
	.comm	_collie_bat_main,16,3           ## @collie_bat_main
	.comm	_bat_work,4,2                   ## @bat_work
	.comm	_collie_bat_work,4,2            ## @collie_bat_work
	.comm	_collie_bat_main_desc,4,2       ## @collie_bat_main_desc
	.comm	_collie_bat_bu,16,3             ## @collie_bat_bu
	.comm	_collie_bat_bu_desc,4,2         ## @collie_bat_bu_desc
	.comm	_COLLIE_GPIO_CO,4,2             ## @COLLIE_GPIO_CO
	.comm	_collie_bat_gpio_isr,4,2        ## @collie_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"

	.no_dead_strip	_collie_bat_probe
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function collie_bat_probe
_collie_bat_probe:                      ; @collie_bat_probe
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x0
	str	xzr, [sp]
	bl	_machine_is_collie
	cbz	w0, LBB0_4
; %bb.1:
	ldr	x8, [x19]
Lloh0:
	adrp	x22, _ucb@GOTPAGE
Lloh1:
	ldr	x22, [x22, _ucb@GOTPAGEOFF]
	str	x8, [x22]
Lloh2:
	adrp	x21, _collie_batt_gpios@GOTPAGE
Lloh3:
	ldr	x21, [x21, _collie_batt_gpios@GOTPAGEOFF]
	ldr	w20, [x21]
	mov	x0, x20
	bl	_ARRAY_SIZE
	mov	x1, x0
	mov	x0, x20
	bl	_gpio_request_array
	mov	x20, x0
	cbnz	w0, LBB0_11
; %bb.2:
Lloh4:
	adrp	x23, _collie_bat_main@GOTPAGE
Lloh5:
	ldr	x23, [x23, _collie_bat_main@GOTPAGEOFF]
	add	x0, x23, #8
	bl	_mutex_init
Lloh6:
	adrp	x8, _collie_bat_work@GOTPAGE
Lloh7:
	ldr	x8, [x8, _collie_bat_work@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
Lloh9:
	adrp	x0, _bat_work@GOTPAGE
Lloh10:
	ldr	x0, [x0, _bat_work@GOTPAGEOFF]
	bl	_INIT_WORK
	str	x23, [sp, #8]
	ldr	x0, [x19]
Lloh11:
	adrp	x1, _collie_bat_main_desc@GOTPAGE
Lloh12:
	ldr	x1, [x1, _collie_bat_main_desc@GOTPAGEOFF]
	add	x2, sp, #8
	bl	_power_supply_register
	str	x0, [x23]
	bl	_IS_ERR
	cbz	x0, LBB0_5
; %bb.3:
	ldr	x0, [x23]
	bl	_PTR_ERR
	mov	x20, x0
	b	LBB0_10
LBB0_4:
Lloh13:
	adrp	x8, _ENODEV@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_11
LBB0_5:
Lloh16:
	adrp	x24, _collie_bat_bu@GOTPAGE
Lloh17:
	ldr	x24, [x24, _collie_bat_bu@GOTPAGEOFF]
	str	x24, [sp]
	ldr	x0, [x19]
Lloh18:
	adrp	x1, _collie_bat_bu_desc@GOTPAGE
Lloh19:
	ldr	x1, [x1, _collie_bat_bu_desc@GOTPAGEOFF]
	mov	x2, sp
	bl	_power_supply_register
	str	x0, [x24]
	bl	_IS_ERR
	cbz	x0, LBB0_7
; %bb.6:
	ldr	x0, [x24]
	bl	_PTR_ERR
	mov	x20, x0
	b	LBB0_9
LBB0_7:
Lloh20:
	adrp	x8, _COLLIE_GPIO_CO@GOTPAGE
Lloh21:
	ldr	x8, [x8, _COLLIE_GPIO_CO@GOTPAGEOFF]
Lloh22:
	ldr	w0, [x8]
	bl	_gpio_to_irq
Lloh23:
	adrp	x8, _collie_bat_gpio_isr@GOTPAGE
Lloh24:
	ldr	x8, [x8, _collie_bat_gpio_isr@GOTPAGEOFF]
Lloh25:
	adrp	x9, _IRQF_TRIGGER_RISING@GOTPAGE
Lloh26:
	ldr	x9, [x9, _IRQF_TRIGGER_RISING@GOTPAGEOFF]
Lloh27:
	ldr	w1, [x8]
Lloh28:
	ldr	w8, [x9]
Lloh29:
	adrp	x9, _IRQF_TRIGGER_FALLING@GOTPAGE
Lloh30:
	ldr	x9, [x9, _IRQF_TRIGGER_FALLING@GOTPAGEOFF]
Lloh31:
	ldr	w9, [x9]
	orr	w2, w9, w8
Lloh32:
	adrp	x3, l_.str@PAGE
Lloh33:
	add	x3, x3, l_.str@PAGEOFF
Lloh34:
	adrp	x4, _collie_bat_main@GOTPAGE
Lloh35:
	ldr	x4, [x4, _collie_bat_main@GOTPAGEOFF]
	bl	_request_irq
	mov	x20, x0
	cbz	w0, LBB0_12
; %bb.8:
	ldr	x0, [x24]
	bl	_power_supply_unregister
LBB0_9:
	ldr	x0, [x23]
	bl	_power_supply_unregister
LBB0_10:
Lloh36:
	adrp	x0, _bat_work@GOTPAGE
Lloh37:
	ldr	x0, [x0, _bat_work@GOTPAGEOFF]
	bl	_cancel_work_sync
	ldr	w19, [x21]
	mov	x0, x19
	bl	_ARRAY_SIZE
	mov	x1, x0
	mov	x0, x19
	bl	_gpio_free_array
LBB0_11:
	mov	x0, x20
	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
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_12:
	ldr	x0, [x22]
	mov	w1, #1
	bl	_device_init_wakeup
Lloh38:
	adrp	x0, _bat_work@GOTPAGE
Lloh39:
	ldr	x0, [x0, _bat_work@GOTPAGEOFF]
	bl	_schedule_work
	b	LBB0_11
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh34, Lloh35
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh27
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh36, Lloh37
	.loh AdrpLdrGot	Lloh38, Lloh39
	.cfi_endproc
                                        ; -- End function
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_ucb,8,3                        ; @ucb
	.comm	_collie_batt_gpios,4,2          ; @collie_batt_gpios
	.comm	_collie_bat_main,16,3           ; @collie_bat_main
	.comm	_bat_work,4,2                   ; @bat_work
	.comm	_collie_bat_work,4,2            ; @collie_bat_work
	.comm	_collie_bat_main_desc,4,2       ; @collie_bat_main_desc
	.comm	_collie_bat_bu,16,3             ; @collie_bat_bu
	.comm	_collie_bat_bu_desc,4,2         ; @collie_bat_bu_desc
	.comm	_COLLIE_GPIO_CO,4,2             ; @COLLIE_GPIO_CO
	.comm	_collie_bat_gpio_isr,4,2        ; @collie_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"

	.no_dead_strip	_collie_bat_probe
.subsections_via_symbols
