	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wiimod_battery_get_property
_wiimod_battery_get_property:           ## @wiimod_battery_get_property
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movl	%esi, %ebx
	callq	_power_supply_get_drvdata
	movq	%rax, %r15
	movq	_POWER_SUPPLY_PROP_SCOPE@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	jne	LBB0_2
## %bb.1:
	movq	_POWER_SUPPLY_SCOPE_DEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r14)
	xorl	%ebx, %ebx
	jmp	LBB0_6
LBB0_2:
	movq	_POWER_SUPPLY_PROP_CAPACITY@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	jne	LBB0_3
## %bb.4:
	movq	%r15, %rdi
	callq	_wiimote_cmd_acquire
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_6
## %bb.5:
	movq	%r15, %r12
	addq	$4, %r12
	movq	%r12, %rdi
	callq	_spin_lock_irqsave
	movq	_WIIPROTO_REQ_SREQ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%ebx, %ebx
	movq	%r15, %rdi
	xorl	%edx, %edx
	callq	_wiimote_cmd_set
	movq	%r15, %rdi
	callq	_wiiproto_req_status
	movq	%r12, %rdi
	callq	_spin_unlock_irqrestore
	movq	%r15, %rdi
	callq	_wiimote_cmd_wait
	movq	%r15, %rdi
	callq	_wiimote_cmd_release
	movq	%r12, %rdi
	callq	_spin_lock_irqsave
	imull	$100, (%r15), %r15d
	movq	%r12, %rdi
	callq	_spin_unlock_irqrestore
	movslq	%r15d, %rax
	imulq	$-2139062143, %rax, %rcx        ## imm = 0x80808081
	shrq	$32, %rcx
	addl	%ecx, %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	sarl	$7, %eax
	addl	%ecx, %eax
	movl	%eax, (%r14)
	jmp	LBB0_6
LBB0_3:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_6:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_POWER_SUPPLY_PROP_SCOPE,4,2    ## @POWER_SUPPLY_PROP_SCOPE
	.comm	_POWER_SUPPLY_SCOPE_DEVICE,4,2  ## @POWER_SUPPLY_SCOPE_DEVICE
	.comm	_POWER_SUPPLY_PROP_CAPACITY,4,2 ## @POWER_SUPPLY_PROP_CAPACITY
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_WIIPROTO_REQ_SREQ,4,2          ## @WIIPROTO_REQ_SREQ
	.no_dead_strip	_wiimod_battery_get_property
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wiimod_battery_get_property
_wiimod_battery_get_property:           ; @wiimod_battery_get_property
	.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	x19, x2
	mov	x21, x1
	bl	_power_supply_get_drvdata
Lloh0:
	adrp	x8, _POWER_SUPPLY_PROP_SCOPE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _POWER_SUPPLY_PROP_SCOPE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w21
	b.ne	LBB0_3
; %bb.1:
	mov	w0, #0
Lloh3:
	adrp	x8, _POWER_SUPPLY_SCOPE_DEVICE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _POWER_SUPPLY_SCOPE_DEVICE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
LBB0_2:
	str	w8, [x19]
	b	LBB0_7
LBB0_3:
Lloh6:
	adrp	x8, _POWER_SUPPLY_PROP_CAPACITY@GOTPAGE
Lloh7:
	ldr	x8, [x8, _POWER_SUPPLY_PROP_CAPACITY@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	cmp	w8, w21
	b.ne	LBB0_6
; %bb.4:
	mov	x20, x0
	bl	_wiimote_cmd_acquire
	cbnz	w0, LBB0_7
; %bb.5:
	add	x21, x20, #4
	mov	x0, x21
	bl	_spin_lock_irqsave
Lloh9:
	adrp	x8, _WIIPROTO_REQ_SREQ@GOTPAGE
Lloh10:
	ldr	x8, [x8, _WIIPROTO_REQ_SREQ@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #0
	bl	_wiimote_cmd_set
	mov	x0, x20
	bl	_wiiproto_req_status
	mov	x0, x21
	bl	_spin_unlock_irqrestore
	mov	x0, x20
	bl	_wiimote_cmd_wait
	mov	x0, x20
	bl	_wiimote_cmd_release
	mov	x0, x21
	bl	_spin_lock_irqsave
	ldr	w20, [x20]
	mov	x0, x21
	bl	_spin_unlock_irqrestore
	mov	w0, #0
	mov	w8, #100
	mul	w8, w20, w8
	mov	w9, #32897
	movk	w9, #32896, lsl #16
	smull	x9, w8, w9
	lsr	x9, x9, #32
	add	w8, w9, w8
	asr	w9, w8, #7
	add	w8, w9, w8, lsr #31
	b	LBB0_2
LBB0_6:
Lloh12:
	adrp	x8, _EINVAL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_7:
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_POWER_SUPPLY_PROP_SCOPE,4,2    ; @POWER_SUPPLY_PROP_SCOPE
	.comm	_POWER_SUPPLY_SCOPE_DEVICE,4,2  ; @POWER_SUPPLY_SCOPE_DEVICE
	.comm	_POWER_SUPPLY_PROP_CAPACITY,4,2 ; @POWER_SUPPLY_PROP_CAPACITY
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_WIIPROTO_REQ_SREQ,4,2          ; @WIIPROTO_REQ_SREQ
	.no_dead_strip	_wiimod_battery_get_property
.subsections_via_symbols
