	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hidpp20_query_battery_info
_hidpp20_query_battery_info:            ## @hidpp20_query_battery_info
	.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	%rdi, %rbx
	movl	(%rdi), %esi
	cmpl	$255, %esi
	jne	LBB0_3
## %bb.1:
	movq	_HIDPP_PAGE_BATTERY_LEVEL_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-28(%rbp), %rcx
	movq	%rbx, %rdi
	movq	%rbx, %rdx
	callq	_hidpp_root_get_feature
	testl	%eax, %eax
	jne	LBB0_6
## %bb.2:
	movl	(%rbx), %esi
LBB0_3:
	leaq	-20(%rbp), %rdx
	leaq	-16(%rbp), %rcx
	leaq	-24(%rbp), %r8
	leaq	-12(%rbp), %r9
	movq	%rbx, %rdi
	callq	_hidpp20_batterylevel_get_battery_capacity
	testl	%eax, %eax
	jne	LBB0_6
## %bb.4:
	movl	(%rbx), %esi
	movq	%rbx, %rdi
	callq	_hidpp20_batterylevel_get_battery_info
	testl	%eax, %eax
	jne	LBB0_6
## %bb.5:
	movl	-20(%rbp), %eax
	movl	%eax, 4(%rbx)
	movl	-16(%rbp), %ecx
	movl	%ecx, 8(%rbx)
	movl	-12(%rbp), %ecx
	movl	%ecx, 12(%rbx)
	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	%al
	orb	%cl, %al
	movzbl	%al, %eax
	movl	%eax, 16(%rbx)
	xorl	%eax, %eax
LBB0_6:
	addq	$24, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HIDPP_PAGE_BATTERY_LEVEL_STATUS,4,2 ## @HIDPP_PAGE_BATTERY_LEVEL_STATUS
	.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_query_battery_info
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hidpp20_query_battery_info
_hidpp20_query_battery_info:            ; @hidpp20_query_battery_info
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	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
	mov	x19, x0
	ldr	w1, [x0]
	cmp	w1, #255
	b.ne	LBB0_3
; %bb.1:
Lloh0:
	adrp	x8, _HIDPP_PAGE_BATTERY_LEVEL_STATUS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _HIDPP_PAGE_BATTERY_LEVEL_STATUS@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	sub	x3, x29, #20
	mov	x0, x19
	mov	x2, x19
	bl	_hidpp_root_get_feature
	cbnz	w0, LBB0_6
; %bb.2:
	ldr	w1, [x19]
LBB0_3:
	add	x2, sp, #24
	add	x3, sp, #20
	add	x4, sp, #16
	add	x5, sp, #12
	mov	x0, x19
	bl	_hidpp20_batterylevel_get_battery_capacity
	cbnz	w0, LBB0_6
; %bb.4:
	ldr	w1, [x19]
	mov	x0, x19
	bl	_hidpp20_batterylevel_get_battery_info
	cbnz	w0, LBB0_6
; %bb.5:
	ldp	w9, w8, [sp, #20]
	stp	w8, w9, [x19, #4]
Lloh3:
	adrp	x9, _POWER_SUPPLY_STATUS_DISCHARGING@GOTPAGE
Lloh4:
	ldr	x9, [x9, _POWER_SUPPLY_STATUS_DISCHARGING@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	cmp	w8, w9
Lloh6:
	adrp	x9, _POWER_SUPPLY_STATUS_FULL@GOTPAGE
Lloh7:
	ldr	x9, [x9, _POWER_SUPPLY_STATUS_FULL@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	ccmp	w8, w9, #4, ne
	ldr	w8, [sp, #12]
	cset	w9, eq
	stp	w8, w9, [x19, #12]
LBB0_6:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_HIDPP_PAGE_BATTERY_LEVEL_STATUS,4,2 ; @HIDPP_PAGE_BATTERY_LEVEL_STATUS
	.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_query_battery_info
.subsections_via_symbols
