	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function asus_battery_query
_asus_battery_query:                    ## @asus_battery_query
	.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, %rbx
	movq	_BATTERY_REPORT_SIZE@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r14
	movl	$1, (%rbx)
	movl	4(%rbx), %edi
	movq	_BATTERY_REPORT_ID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r15), %ecx
	movq	_HID_INPUT_REPORT@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	_HID_REQ_GET_REPORT@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	movq	%r14, %rdx
	callq	_hid_hw_raw_request
	movl	$0, (%rbx)
	cmpl	(%r15), %eax
	jne	LBB0_4
## %bb.3:
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movl	%eax, %edx
	callq	_asus_parse_battery
	movl	%eax, %ebx
	jmp	LBB0_5
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_6
LBB0_4:
	movq	_ENODATA@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_5:
	movq	%r14, %rdi
	callq	_kfree
LBB0_6:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BATTERY_REPORT_SIZE,4,2        ## @BATTERY_REPORT_SIZE
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_BATTERY_REPORT_ID,4,2          ## @BATTERY_REPORT_ID
	.comm	_HID_INPUT_REPORT,4,2           ## @HID_INPUT_REPORT
	.comm	_HID_REQ_GET_REPORT,4,2         ## @HID_REQ_GET_REPORT
	.comm	_ENODATA,4,2                    ## @ENODATA
	.no_dead_strip	_asus_battery_query
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function asus_battery_query
_asus_battery_query:                    ; @asus_battery_query
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x20, x0
Lloh0:
	adrp	x21, _BATTERY_REPORT_SIZE@GOTPAGE
Lloh1:
	ldr	x21, [x21, _BATTERY_REPORT_SIZE@GOTPAGEOFF]
	ldr	w0, [x21]
Lloh2:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	bl	_kmalloc
	cbz	x0, LBB0_3
; %bb.1:
	mov	x19, x0
	mov	w8, #1
	str	w8, [x20]
	ldr	w0, [x20, #4]
Lloh5:
	adrp	x8, _BATTERY_REPORT_ID@GOTPAGE
Lloh6:
	ldr	x8, [x8, _BATTERY_REPORT_ID@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	ldr	w3, [x21]
Lloh8:
	adrp	x8, _HID_INPUT_REPORT@GOTPAGE
Lloh9:
	ldr	x8, [x8, _HID_INPUT_REPORT@GOTPAGEOFF]
Lloh10:
	ldr	w4, [x8]
Lloh11:
	adrp	x8, _HID_REQ_GET_REPORT@GOTPAGE
Lloh12:
	ldr	x8, [x8, _HID_REQ_GET_REPORT@GOTPAGEOFF]
Lloh13:
	ldr	w5, [x8]
	mov	x2, x19
	bl	_hid_hw_raw_request
	str	wzr, [x20]
	ldr	w8, [x21]
	cmp	w0, w8
	b.ne	LBB0_4
; %bb.2:
	mov	x2, x0
	mov	x0, x20
	mov	x1, x19
	bl	_asus_parse_battery
	mov	x20, x0
	b	LBB0_5
LBB0_3:
Lloh14:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_6
LBB0_4:
Lloh17:
	adrp	x8, _ENODATA@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ENODATA@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_5:
	mov	x0, x19
	bl	_kfree
LBB0_6:
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_BATTERY_REPORT_SIZE,4,2        ; @BATTERY_REPORT_SIZE
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_BATTERY_REPORT_ID,4,2          ; @BATTERY_REPORT_ID
	.comm	_HID_INPUT_REPORT,4,2           ; @HID_INPUT_REPORT
	.comm	_HID_REQ_GET_REPORT,4,2         ; @HID_REQ_GET_REPORT
	.comm	_ENODATA,4,2                    ; @ENODATA
	.no_dead_strip	_asus_battery_query
.subsections_via_symbols
