	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function find_main_battery
_find_main_battery:                     ## @find_main_battery
	.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
	subq	$56, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	leaq	-72(%rbp), %rbx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	$48, %edx
	callq	_memset
	movq	_main_battery@GOTPCREL(%rip), %r14
	movq	$0, (%r14)
	movq	$0, -32(%rbp)
	movq	_power_supply_class@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	___find_main_battery@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	xorl	%esi, %esi
	movq	%rbx, %rdx
	callq	_class_for_each_device
	testl	%eax, %eax
	je	LBB0_3
## %bb.1:
	movq	-32(%rbp), %rax
LBB0_2:
	movq	%rax, (%r14)
	addq	$56, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	-56(%rbp), %rcx
	movq	-48(%rbp), %rdi
	testq	%rcx, %rcx
	je	LBB0_10
## %bb.4:
	testq	%rdi, %rdi
	je	LBB0_10
## %bb.5:
	cmpq	%rdi, %rcx
	je	LBB0_10
## %bb.6:
	movq	_VOLTAGE_MAX_DESIGN@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	leaq	-40(%rbp), %r15
	movq	%r15, %rdx
	callq	_PSY_PROP
	testl	%eax, %eax
	je	LBB0_13
## %bb.7:
	movq	-56(%rbp), %rdi
	movl	(%rbx), %esi
	movq	%r15, %rdx
	callq	_PSY_PROP
	testl	%eax, %eax
	jne	LBB0_14
## %bb.8:
	movl	-72(%rbp), %eax
	movl	-68(%rbp), %ecx
	cltd
	idivl	-40(%rbp)
	cmpl	%eax, %ecx
	jg	LBB0_15
LBB0_14:
	movq	-56(%rbp), %rax
	jmp	LBB0_2
LBB0_10:
	testq	%rdi, %rdi
	movq	%rdi, %rax
	cmoveq	%rcx, %rax
	orq	%rcx, %rdi
	jne	LBB0_2
## %bb.11:
	movq	-64(%rbp), %rax
	jmp	LBB0_2
LBB0_13:
	movl	-40(%rbp), %eax
	imull	-68(%rbp), %eax
	cmpl	%eax, -72(%rbp)
	jg	LBB0_14
LBB0_15:
	movq	-48(%rbp), %rax
	jmp	LBB0_2
	.cfi_endproc
                                        ## -- End function
	.comm	_main_battery,8,3               ## @main_battery
	.comm	_power_supply_class,4,2         ## @power_supply_class
	.comm	___find_main_battery,4,2        ## @__find_main_battery
	.comm	_VOLTAGE_MAX_DESIGN,4,2         ## @VOLTAGE_MAX_DESIGN
	.no_dead_strip	_find_main_battery
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function find_main_battery
_find_main_battery:                     ; @find_main_battery
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x0, sp
	mov	w1, #0
	mov	w2, #48
	bl	_memset
Lloh0:
	adrp	x20, _main_battery@GOTPAGE
Lloh1:
	ldr	x20, [x20, _main_battery@GOTPAGEOFF]
	str	xzr, [x20]
	str	xzr, [sp, #40]
Lloh2:
	adrp	x8, _power_supply_class@GOTPAGE
Lloh3:
	ldr	x8, [x8, _power_supply_class@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
Lloh5:
	adrp	x8, ___find_main_battery@GOTPAGE
Lloh6:
	ldr	x8, [x8, ___find_main_battery@GOTPAGEOFF]
Lloh7:
	ldr	w3, [x8]
	mov	x2, sp
	mov	x1, #0
	bl	_class_for_each_device
	cbz	w0, LBB0_3
; %bb.1:
	ldr	x8, [sp, #40]
LBB0_2:
	str	x8, [x20]
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_3:
	ldp	x9, x0, [sp, #16]
	cbz	x9, LBB0_10
; %bb.4:
	cbz	x0, LBB0_10
; %bb.5:
	cmp	x9, x0
	b.eq	LBB0_10
; %bb.6:
Lloh8:
	adrp	x21, _VOLTAGE_MAX_DESIGN@GOTPAGE
Lloh9:
	ldr	x21, [x21, _VOLTAGE_MAX_DESIGN@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x8, sp
	add	x19, x8, #32
	mov	x2, x19
	bl	_PSY_PROP
	cbz	w0, LBB0_12
; %bb.7:
	ldr	x0, [sp, #16]
	ldr	w1, [x21]
	mov	x2, x19
	bl	_PSY_PROP
	cbnz	w0, LBB0_9
; %bb.8:
	ldp	w9, w8, [sp]
	ldr	w10, [sp, #32]
	sdiv	w9, w9, w10
	cmp	w8, w9
	b.gt	LBB0_13
LBB0_9:
	ldr	x8, [sp, #16]
	b	LBB0_2
LBB0_10:
	cmp	x0, #0
	csel	x8, x9, x0, eq
	orr	x9, x0, x9
	cbnz	x9, LBB0_2
; %bb.11:
	ldr	x8, [sp, #8]
	b	LBB0_2
LBB0_12:
	ldp	w8, w9, [sp]
	ldr	w10, [sp, #32]
	mul	w9, w10, w9
	cmp	w8, w9
	b.gt	LBB0_9
LBB0_13:
	ldr	x8, [sp, #24]
	b	LBB0_2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_main_battery,8,3               ; @main_battery
	.comm	_power_supply_class,4,2         ; @power_supply_class
	.comm	___find_main_battery,4,2        ; @__find_main_battery
	.comm	_VOLTAGE_MAX_DESIGN,4,2         ; @VOLTAGE_MAX_DESIGN
	.no_dead_strip	_find_main_battery
.subsections_via_symbols
