	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hidpp20_battery_event
_hidpp20_battery_event:                 ## @hidpp20_battery_event
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -24
	movq	(%rsi), %rax
	cmpq	(%rdi), %rax
	jne	LBB0_7
## %bb.1:
	movq	8(%rsi), %rax
	movq	_EVENT_BATTERY_LEVEL_STATUS_BROADCAST@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_7
## %bb.2:
	movq	%rdi, %rbx
	movl	16(%rsi), %edi
	leaq	-16(%rbp), %rsi
	leaq	-20(%rbp), %rdx
	leaq	-12(%rbp), %rcx
	callq	_hidpp20_batterylevel_map_status_capacity
	movq	_POWER_SUPPLY_STATUS_DISCHARGING@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	sete	%cl
	movq	_POWER_SUPPLY_STATUS_FULL@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %eax
	sete	%dl
	orb	%cl, %dl
	movzbl	%dl, %ecx
	movl	%ecx, 8(%rbx)
	movl	-16(%rbp), %ecx
	movl	-12(%rbp), %edx
	cmpl	12(%rbx), %ecx
	jne	LBB0_5
## %bb.3:
	cmpl	16(%rbx), %edx
	jne	LBB0_5
## %bb.4:
	cmpl	20(%rbx), %eax
	je	LBB0_7
LBB0_5:
	movl	%edx, 16(%rbx)
	movl	%ecx, 12(%rbx)
	movl	%eax, 20(%rbx)
	movq	24(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_7
## %bb.6:
	callq	_power_supply_changed
LBB0_7:
	xorl	%eax, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EVENT_BATTERY_LEVEL_STATUS_BROADCAST,8,3 ## @EVENT_BATTERY_LEVEL_STATUS_BROADCAST
	.comm	_POWER_SUPPLY_STATUS_DISCHARGING,4,2 ## @POWER_SUPPLY_STATUS_DISCHARGING
	.comm	_POWER_SUPPLY_STATUS_FULL,4,2   ## @POWER_SUPPLY_STATUS_FULL
	.no_dead_strip	_hidpp20_battery_event
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hidpp20_battery_event
_hidpp20_battery_event:                 ; @hidpp20_battery_event
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	ldr	x8, [x1]
	ldr	x9, [x0]
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.1:
	ldr	x8, [x1, #8]
Lloh0:
	adrp	x9, _EVENT_BATTERY_LEVEL_STATUS_BROADCAST@GOTPAGE
Lloh1:
	ldr	x9, [x9, _EVENT_BATTERY_LEVEL_STATUS_BROADCAST@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.2:
	mov	x19, x0
	ldr	w0, [x1, #16]
	add	x1, sp, #12
	add	x2, sp, #8
	add	x3, sp, #4
	bl	_hidpp20_batterylevel_map_status_capacity
Lloh3:
	adrp	x8, _POWER_SUPPLY_STATUS_DISCHARGING@GOTPAGE
Lloh4:
	ldr	x8, [x8, _POWER_SUPPLY_STATUS_DISCHARGING@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w0, w8
Lloh6:
	adrp	x8, _POWER_SUPPLY_STATUS_FULL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _POWER_SUPPLY_STATUS_FULL@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	ccmp	w0, w8, #4, ne
	cset	w8, eq
	str	w8, [x19, #8]
	ldr	w8, [sp, #12]
	ldr	w10, [x19, #12]
	ldr	w9, [sp, #4]
	cmp	w8, w10
	b.ne	LBB0_5
; %bb.3:
	ldr	w10, [x19, #16]
	cmp	w9, w10
	b.ne	LBB0_5
; %bb.4:
	ldr	w10, [x19, #20]
	cmp	w0, w10
	b.eq	LBB0_7
LBB0_5:
	stp	w8, w9, [x19, #12]
	str	w0, [x19, #20]
	ldr	x0, [x19, #24]
	cbz	x0, LBB0_7
; %bb.6:
	bl	_power_supply_changed
LBB0_7:
	mov	w0, #0
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_EVENT_BATTERY_LEVEL_STATUS_BROADCAST,8,3 ; @EVENT_BATTERY_LEVEL_STATUS_BROADCAST
	.comm	_POWER_SUPPLY_STATUS_DISCHARGING,4,2 ; @POWER_SUPPLY_STATUS_DISCHARGING
	.comm	_POWER_SUPPLY_STATUS_FULL,4,2   ; @POWER_SUPPLY_STATUS_FULL
	.no_dead_strip	_hidpp20_battery_event
.subsections_via_symbols
