	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function act8945a_get_current_max
_act8945a_get_current_max:              ## @act8945a_get_current_max
	.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	%rdx, %r14
	movq	%rsi, %rbx
	movl	(%rdi), %edi
	callq	_gpiod_get_value
	movl	%eax, %r15d
	movq	_ACT8945A_APCH_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-32(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_regmap_read
	testl	%eax, %eax
	js	LBB0_18
## %bb.1:
	movq	_ACT8945A_APCH_STATE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-28(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_regmap_read
	testl	%eax, %eax
	js	LBB0_18
## %bb.2:
	movl	-28(%rbp), %esi
	movq	_APCH_STATE_ACINSTAT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	andl	%esi, %edx
	movq	_APCH_STATE_CSTATE@GOTPCREL(%rip), %rax
	andl	(%rax), %esi
	movq	_APCH_STATE_CSTATE_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shrl	%cl, %esi
	cmpl	$129, %esi
	je	LBB0_9
## %bb.3:
	xorl	%eax, %eax
	cmpl	$128, %esi
	jne	LBB0_17
## %bb.4:
	cmpl	$2, %edx
	jae	LBB0_5
## %bb.8:
	movq	_MAX_CURRENT_USB_PRE@GOTPCREL(%rip), %rax
	jmp	LBB0_16
LBB0_9:
	cmpl	$2, %edx
	jae	LBB0_10
## %bb.13:
	testl	%r15d, %r15d
	je	LBB0_15
## %bb.14:
	movq	_MAX_CURRENT_USB_HIGH@GOTPCREL(%rip), %rax
	jmp	LBB0_16
LBB0_5:
	testl	%r15d, %r15d
	je	LBB0_7
## %bb.6:
	movq	_MAX_CURRENT_AC_HIGH_PRE@GOTPCREL(%rip), %rax
	jmp	LBB0_16
LBB0_10:
	testl	%r15d, %r15d
	je	LBB0_12
## %bb.11:
	movq	_MAX_CURRENT_AC_HIGH@GOTPCREL(%rip), %rax
	jmp	LBB0_16
LBB0_15:
	movq	_MAX_CURRENT_USB_LOW@GOTPCREL(%rip), %rax
	jmp	LBB0_16
LBB0_7:
	movq	_MAX_CURRENT_AC_LOW_PRE@GOTPCREL(%rip), %rax
	jmp	LBB0_16
LBB0_12:
	movq	_MAX_CURRENT_AC_LOW@GOTPCREL(%rip), %rax
LBB0_16:
	movl	(%rax), %eax
LBB0_17:
	movl	%eax, (%r14)
	xorl	%eax, %eax
LBB0_18:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ACT8945A_APCH_STATUS,4,2       ## @ACT8945A_APCH_STATUS
	.comm	_ACT8945A_APCH_STATE,4,2        ## @ACT8945A_APCH_STATE
	.comm	_APCH_STATE_ACINSTAT,4,2        ## @APCH_STATE_ACINSTAT
	.comm	_APCH_STATE_CSTATE,4,2          ## @APCH_STATE_CSTATE
	.comm	_APCH_STATE_CSTATE_SHIFT,4,2    ## @APCH_STATE_CSTATE_SHIFT
	.comm	_MAX_CURRENT_AC_HIGH_PRE,4,2    ## @MAX_CURRENT_AC_HIGH_PRE
	.comm	_MAX_CURRENT_AC_LOW_PRE,4,2     ## @MAX_CURRENT_AC_LOW_PRE
	.comm	_MAX_CURRENT_USB_PRE,4,2        ## @MAX_CURRENT_USB_PRE
	.comm	_MAX_CURRENT_AC_HIGH,4,2        ## @MAX_CURRENT_AC_HIGH
	.comm	_MAX_CURRENT_AC_LOW,4,2         ## @MAX_CURRENT_AC_LOW
	.comm	_MAX_CURRENT_USB_HIGH,4,2       ## @MAX_CURRENT_USB_HIGH
	.comm	_MAX_CURRENT_USB_LOW,4,2        ## @MAX_CURRENT_USB_LOW
	.no_dead_strip	_act8945a_get_current_max
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function act8945a_get_current_max
_act8945a_get_current_max:              ; @act8945a_get_current_max
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x19, x2
	mov	x21, x1
	ldr	w0, [x0]
	bl	_gpiod_get_value
	mov	x20, x0
Lloh0:
	adrp	x8, _ACT8945A_APCH_STATUS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ACT8945A_APCH_STATUS@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	add	x2, sp, #12
	mov	x0, x21
	bl	_regmap_read
	tbnz	w0, #31, LBB0_19
; %bb.1:
Lloh3:
	adrp	x8, _ACT8945A_APCH_STATE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ACT8945A_APCH_STATE@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	add	x2, sp, #8
	mov	x0, x21
	bl	_regmap_read
	tbnz	w0, #31, LBB0_19
; %bb.2:
Lloh6:
	adrp	x8, _APCH_STATE_ACINSTAT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _APCH_STATE_ACINSTAT@GOTPAGEOFF]
	ldr	w9, [sp, #8]
Lloh8:
	ldr	w8, [x8]
	and	w8, w8, w9
Lloh9:
	adrp	x10, _APCH_STATE_CSTATE@GOTPAGE
Lloh10:
	ldr	x10, [x10, _APCH_STATE_CSTATE@GOTPAGEOFF]
Lloh11:
	ldr	w10, [x10]
	and	w9, w10, w9
Lloh12:
	adrp	x10, _APCH_STATE_CSTATE_SHIFT@GOTPAGE
Lloh13:
	ldr	x10, [x10, _APCH_STATE_CSTATE_SHIFT@GOTPAGEOFF]
Lloh14:
	ldr	w10, [x10]
	lsr	w9, w9, w10
	cmp	w9, #129
	b.eq	LBB0_6
; %bb.3:
	cmp	w9, #128
	b.ne	LBB0_9
; %bb.4:
	cmp	w8, #2
	b.hs	LBB0_10
; %bb.5:
Lloh15:
	adrp	x8, _MAX_CURRENT_USB_PRE@GOTPAGE
Lloh16:
	ldr	x8, [x8, _MAX_CURRENT_USB_PRE@GOTPAGEOFF]
	b	LBB0_17
LBB0_6:
	cmp	w8, #2
	b.hs	LBB0_12
; %bb.7:
	cbz	w20, LBB0_14
; %bb.8:
Lloh17:
	adrp	x8, _MAX_CURRENT_USB_HIGH@GOTPAGE
Lloh18:
	ldr	x8, [x8, _MAX_CURRENT_USB_HIGH@GOTPAGEOFF]
	b	LBB0_17
LBB0_9:
	mov	w8, #0
	b	LBB0_18
LBB0_10:
	cbz	w20, LBB0_15
; %bb.11:
Lloh19:
	adrp	x8, _MAX_CURRENT_AC_HIGH_PRE@GOTPAGE
Lloh20:
	ldr	x8, [x8, _MAX_CURRENT_AC_HIGH_PRE@GOTPAGEOFF]
	b	LBB0_17
LBB0_12:
	cbz	w20, LBB0_16
; %bb.13:
Lloh21:
	adrp	x8, _MAX_CURRENT_AC_HIGH@GOTPAGE
Lloh22:
	ldr	x8, [x8, _MAX_CURRENT_AC_HIGH@GOTPAGEOFF]
	b	LBB0_17
LBB0_14:
Lloh23:
	adrp	x8, _MAX_CURRENT_USB_LOW@GOTPAGE
Lloh24:
	ldr	x8, [x8, _MAX_CURRENT_USB_LOW@GOTPAGEOFF]
	b	LBB0_17
LBB0_15:
Lloh25:
	adrp	x8, _MAX_CURRENT_AC_LOW_PRE@GOTPAGE
Lloh26:
	ldr	x8, [x8, _MAX_CURRENT_AC_LOW_PRE@GOTPAGEOFF]
	b	LBB0_17
LBB0_16:
Lloh27:
	adrp	x8, _MAX_CURRENT_AC_LOW@GOTPAGE
Lloh28:
	ldr	x8, [x8, _MAX_CURRENT_AC_LOW@GOTPAGEOFF]
LBB0_17:
	ldr	w8, [x8]
LBB0_18:
	mov	w0, #0
	str	w8, [x19]
LBB0_19:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_ACT8945A_APCH_STATUS,4,2       ; @ACT8945A_APCH_STATUS
	.comm	_ACT8945A_APCH_STATE,4,2        ; @ACT8945A_APCH_STATE
	.comm	_APCH_STATE_ACINSTAT,4,2        ; @APCH_STATE_ACINSTAT
	.comm	_APCH_STATE_CSTATE,4,2          ; @APCH_STATE_CSTATE
	.comm	_APCH_STATE_CSTATE_SHIFT,4,2    ; @APCH_STATE_CSTATE_SHIFT
	.comm	_MAX_CURRENT_AC_HIGH_PRE,4,2    ; @MAX_CURRENT_AC_HIGH_PRE
	.comm	_MAX_CURRENT_AC_LOW_PRE,4,2     ; @MAX_CURRENT_AC_LOW_PRE
	.comm	_MAX_CURRENT_USB_PRE,4,2        ; @MAX_CURRENT_USB_PRE
	.comm	_MAX_CURRENT_AC_HIGH,4,2        ; @MAX_CURRENT_AC_HIGH
	.comm	_MAX_CURRENT_AC_LOW,4,2         ; @MAX_CURRENT_AC_LOW
	.comm	_MAX_CURRENT_USB_HIGH,4,2       ; @MAX_CURRENT_USB_HIGH
	.comm	_MAX_CURRENT_USB_LOW,4,2        ; @MAX_CURRENT_USB_LOW
	.no_dead_strip	_act8945a_get_current_max
.subsections_via_symbols
