	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gcr_compute                    ## -- Begin function gcr_compute
	.p2align	4, 0x90
_gcr_compute:                           ## @gcr_compute
	.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
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	_v_5v@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_V5_CAT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jge	LBB0_2
## %bb.1:
	xorl	%edi, %edi
	callq	_I2C3733_Control_Set
	movq	_v_5v_cat_hit@GOTPCREL(%rip), %rax
	movl	$20, (%rax)
	movq	_gcr_actual@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	movq	_usb_gcr_auto@GOTPCREL(%rip), %rax
	movl	$1, (%rax)
	jmp	LBB0_27
LBB0_2:
	movq	_v_5v_cat_hit@GOTPCREL(%rip), %rbx
	movl	(%rbx), %eax
	cmpl	$2, %eax
	jl	LBB0_4
## %bb.3:
	decl	%eax
	movl	%eax, (%rbx)
	jmp	LBB0_27
LBB0_4:
	cmpl	$1, %eax
	jne	LBB0_6
## %bb.5:
	movl	$1, %edi
	callq	_I2C3733_Control_Set
	leaq	L_.str(%rip), %rdi
	callq	_CDC_print
	movl	$0, (%rbx)
	jmp	LBB0_27
LBB0_6:
	movq	_ACT_GCR_NONE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_gcr_desired@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdx
	movq	_usb_gcr_auto@GOTPCREL(%rip), %rcx
	cmpl	$0, (%rcx)
	je	LBB0_12
## %bb.7:
	movq	_v_5v_avg@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	_V5_LOW@GOTPCREL(%rip), %rsi
	cmpq	(%rsi), %rcx
	jl	LBB0_14
## %bb.8:
	movq	_V5_HIGH@GOTPCREL(%rip), %rdi
	movq	_gcr_actual@GOTPCREL(%rip), %rsi
	movq	(%rsi), %rsi
	cmpq	(%rdi), %rcx
	jle	LBB0_11
## %bb.9:
	cmpq	%rdx, %rsi
	jl	LBB0_10
LBB0_11:
	movq	%rax, %rcx
	cmpq	%rdx, %rsi
	jg	LBB0_14
	jmp	LBB0_16
LBB0_12:
	movq	_gcr_actual@GOTPCREL(%rip), %rcx
	cmpq	%rdx, (%rcx)
	jge	LBB0_13
LBB0_10:
	movq	_ACT_GCR_INC@GOTPCREL(%rip), %rcx
	jmp	LBB0_15
LBB0_13:
	movq	%rax, %rcx
	jle	LBB0_16
LBB0_14:
	movq	_ACT_GCR_DEC@GOTPCREL(%rip), %rcx
LBB0_15:
	movq	(%rcx), %rcx
LBB0_16:
	cmpq	%rax, %rcx
	je	LBB0_26
## %bb.17:
	movq	_ACT_GCR_INC@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rcx
	jne	LBB0_19
## %bb.18:
	movq	_LED_GCR_STEP_AUTO@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_LED_GCR_MAX@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	_gcr_actual@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rsi
	movq	%rcx, %rdi
	subq	%rsi, %rdi
	addq	%rax, %rsi
	cmpq	%rdi, %rax
	cmovgq	%rcx, %rsi
	movq	%rsi, (%rdx)
	jmp	LBB0_26
LBB0_19:
	movq	_ACT_GCR_DEC@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rcx
	jne	LBB0_27
## %bb.20:
	movq	_LED_GCR_STEP_AUTO@GOTPCREL(%rip), %rdx
	movq	_gcr_actual@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	subq	(%rdx), %rcx
	jge	LBB0_25
## %bb.21:
	movq	$0, (%rax)
	movq	_usb_extra_state@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_USB_EXTRA_STATE_DISABLED_UNTIL_REPLUG@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdi
	cmpq	%rdi, %rax
	je	LBB0_27
## %bb.22:
	movq	_USB_EXTRA_STATE_ENABLED@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_27
## %bb.23:
	movq	_gcr_min_counter@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leal	1(%rcx), %edx
	movl	%edx, (%rax)
	cmpl	$200, %ecx
	jl	LBB0_27
## %bb.24:
	callq	_USB_ExtraSetState
	movq	_usb_extra_manual@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	leaq	L_.str.2(%rip), %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	jmp	_CDC_print                      ## TAILCALL
LBB0_25:
	movq	%rcx, (%rax)
LBB0_26:
	movq	_gcr_min_counter@GOTPCREL(%rip), %rax
	movl	$0, (%rax)
LBB0_27:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ACT_GCR_NONE,8,3               ## @ACT_GCR_NONE
	.comm	_gcr_desired,8,3                ## @gcr_desired
	.comm	_v_5v,8,3                       ## @v_5v
	.comm	_V5_CAT,8,3                     ## @V5_CAT
	.comm	_v_5v_cat_hit,4,2               ## @v_5v_cat_hit
	.comm	_gcr_actual,8,3                 ## @gcr_actual
	.comm	_usb_gcr_auto,4,2               ## @usb_gcr_auto
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"USB: WARNING: Re-enabling LED drivers\r\n"

	.comm	_v_5v_avg,8,3                   ## @v_5v_avg
	.comm	_V5_LOW,8,3                     ## @V5_LOW
	.comm	_ACT_GCR_DEC,8,3                ## @ACT_GCR_DEC
	.comm	_V5_HIGH,8,3                    ## @V5_HIGH
	.comm	_ACT_GCR_INC,8,3                ## @ACT_GCR_INC
	.comm	_gcr_min_counter,4,2            ## @gcr_min_counter
	.comm	_LED_GCR_STEP_AUTO,8,3          ## @LED_GCR_STEP_AUTO
	.comm	_LED_GCR_MAX,8,3                ## @LED_GCR_MAX
	.comm	_usb_extra_state,8,3            ## @usb_extra_state
	.comm	_USB_EXTRA_STATE_DISABLED_UNTIL_REPLUG,8,3 ## @USB_EXTRA_STATE_DISABLED_UNTIL_REPLUG
	.comm	_USB_EXTRA_STATE_ENABLED,8,3    ## @USB_EXTRA_STATE_ENABLED
	.comm	_usb_extra_manual,8,3           ## @usb_extra_manual
L_.str.2:                               ## @.str.2
	.asciz	"USB: Disabling extra port until replug!\r\n"

	.comm	_gcr_breathe,8,3                ## @gcr_breathe
	.comm	_led_animation_breathing,4,2    ## @led_animation_breathing
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gcr_compute                    ; -- Begin function gcr_compute
	.p2align	2
_gcr_compute:                           ; @gcr_compute
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
Lloh0:
	adrp	x8, _v_5v@GOTPAGE
Lloh1:
	ldr	x8, [x8, _v_5v@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _V5_CAT@GOTPAGE
Lloh4:
	ldr	x9, [x9, _V5_CAT@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ge	LBB0_2
; %bb.1:
	mov	w0, #0
	bl	_I2C3733_Control_Set
Lloh6:
	adrp	x8, _v_5v_cat_hit@GOTPAGE
Lloh7:
	ldr	x8, [x8, _v_5v_cat_hit@GOTPAGEOFF]
	mov	w9, #20
Lloh8:
	adrp	x10, _gcr_actual@GOTPAGE
Lloh9:
	ldr	x10, [x10, _gcr_actual@GOTPAGEOFF]
Lloh10:
	str	w9, [x8]
Lloh11:
	str	xzr, [x10]
Lloh12:
	adrp	x8, _usb_gcr_auto@GOTPAGE
Lloh13:
	ldr	x8, [x8, _usb_gcr_auto@GOTPAGEOFF]
	mov	w9, #1
Lloh14:
	str	w9, [x8]
	b	LBB0_26
LBB0_2:
Lloh15:
	adrp	x19, _v_5v_cat_hit@GOTPAGE
Lloh16:
	ldr	x19, [x19, _v_5v_cat_hit@GOTPAGEOFF]
	ldr	w8, [x19]
	cmp	w8, #2
	b.lt	LBB0_4
; %bb.3:
	sub	w8, w8, #1
	str	w8, [x19]
	b	LBB0_26
LBB0_4:
	cmp	w8, #1
	b.ne	LBB0_6
; %bb.5:
	mov	w0, #1
	bl	_I2C3733_Control_Set
Lloh17:
	adrp	x0, l_.str@PAGE
Lloh18:
	add	x0, x0, l_.str@PAGEOFF
	bl	_CDC_print
	str	wzr, [x19]
	b	LBB0_26
LBB0_6:
Lloh19:
	adrp	x8, _ACT_GCR_NONE@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ACT_GCR_NONE@GOTPAGEOFF]
Lloh21:
	ldr	x8, [x8]
Lloh22:
	adrp	x9, _gcr_desired@GOTPAGE
Lloh23:
	ldr	x9, [x9, _gcr_desired@GOTPAGEOFF]
Lloh24:
	ldr	x9, [x9]
Lloh25:
	adrp	x10, _usb_gcr_auto@GOTPAGE
Lloh26:
	ldr	x10, [x10, _usb_gcr_auto@GOTPAGEOFF]
Lloh27:
	ldr	w10, [x10]
	cbz	w10, LBB0_9
; %bb.7:
Lloh28:
	adrp	x10, _v_5v_avg@GOTPAGE
Lloh29:
	ldr	x10, [x10, _v_5v_avg@GOTPAGEOFF]
Lloh30:
	ldr	x10, [x10]
Lloh31:
	adrp	x11, _V5_LOW@GOTPAGE
Lloh32:
	ldr	x11, [x11, _V5_LOW@GOTPAGEOFF]
Lloh33:
	ldr	x11, [x11]
	cmp	x10, x11
	b.ge	LBB0_11
; %bb.8:
Lloh34:
	adrp	x9, _ACT_GCR_DEC@GOTPAGE
Lloh35:
	ldr	x9, [x9, _ACT_GCR_DEC@GOTPAGEOFF]
	b	LBB0_14
LBB0_9:
Lloh36:
	adrp	x10, _gcr_actual@GOTPAGE
Lloh37:
	ldr	x10, [x10, _gcr_actual@GOTPAGEOFF]
Lloh38:
	ldr	x10, [x10]
	cmp	x10, x9
	b.lt	LBB0_13
; %bb.10:
Lloh39:
	adrp	x9, _ACT_GCR_DEC@GOTPAGE
Lloh40:
	ldr	x9, [x9, _ACT_GCR_DEC@GOTPAGEOFF]
Lloh41:
	ldr	x9, [x9]
	csel	x9, x9, x8, gt
	b	LBB0_15
LBB0_11:
Lloh42:
	adrp	x11, _V5_HIGH@GOTPAGE
Lloh43:
	ldr	x11, [x11, _V5_HIGH@GOTPAGEOFF]
Lloh44:
	ldr	x12, [x11]
Lloh45:
	adrp	x11, _gcr_actual@GOTPAGE
Lloh46:
	ldr	x11, [x11, _gcr_actual@GOTPAGEOFF]
Lloh47:
	ldr	x11, [x11]
	cmp	x10, x12
	ccmp	x11, x9, #0, gt
	b.lt	LBB0_13
; %bb.12:
Lloh48:
	adrp	x10, _ACT_GCR_DEC@GOTPAGE
Lloh49:
	ldr	x10, [x10, _ACT_GCR_DEC@GOTPAGEOFF]
Lloh50:
	ldr	x10, [x10]
	cmp	x11, x9
	csel	x9, x10, x8, gt
	b	LBB0_15
LBB0_13:
Lloh51:
	adrp	x9, _ACT_GCR_INC@GOTPAGE
Lloh52:
	ldr	x9, [x9, _ACT_GCR_INC@GOTPAGEOFF]
LBB0_14:
	ldr	x9, [x9]
LBB0_15:
	cmp	x9, x8
	b.eq	LBB0_25
; %bb.16:
Lloh53:
	adrp	x8, _ACT_GCR_INC@GOTPAGE
Lloh54:
	ldr	x8, [x8, _ACT_GCR_INC@GOTPAGEOFF]
Lloh55:
	ldr	x8, [x8]
	cmp	x9, x8
	b.ne	LBB0_18
; %bb.17:
Lloh56:
	adrp	x8, _LED_GCR_STEP_AUTO@GOTPAGE
Lloh57:
	ldr	x8, [x8, _LED_GCR_STEP_AUTO@GOTPAGEOFF]
Lloh58:
	ldr	x8, [x8]
Lloh59:
	adrp	x9, _LED_GCR_MAX@GOTPAGE
Lloh60:
	ldr	x9, [x9, _LED_GCR_MAX@GOTPAGEOFF]
Lloh61:
	ldr	x9, [x9]
Lloh62:
	adrp	x10, _gcr_actual@GOTPAGE
Lloh63:
	ldr	x10, [x10, _gcr_actual@GOTPAGEOFF]
	ldr	x11, [x10]
	add	x12, x11, x8
	sub	x11, x9, x11
	cmp	x8, x11
	csel	x8, x9, x12, gt
	str	x8, [x10]
	b	LBB0_25
LBB0_18:
Lloh64:
	adrp	x8, _ACT_GCR_DEC@GOTPAGE
Lloh65:
	ldr	x8, [x8, _ACT_GCR_DEC@GOTPAGEOFF]
Lloh66:
	ldr	x8, [x8]
	cmp	x9, x8
	b.ne	LBB0_26
; %bb.19:
Lloh67:
	adrp	x8, _LED_GCR_STEP_AUTO@GOTPAGE
Lloh68:
	ldr	x8, [x8, _LED_GCR_STEP_AUTO@GOTPAGEOFF]
Lloh69:
	ldr	x9, [x8]
Lloh70:
	adrp	x8, _gcr_actual@GOTPAGE
Lloh71:
	ldr	x8, [x8, _gcr_actual@GOTPAGEOFF]
	ldr	x10, [x8]
	subs	x9, x10, x9
	b.ge	LBB0_24
; %bb.20:
Lloh72:
	adrp	x9, _usb_extra_state@GOTPAGE
Lloh73:
	ldr	x9, [x9, _usb_extra_state@GOTPAGEOFF]
	str	xzr, [x8]
Lloh74:
	ldr	x8, [x9]
Lloh75:
	adrp	x9, _USB_EXTRA_STATE_DISABLED_UNTIL_REPLUG@GOTPAGE
Lloh76:
	ldr	x9, [x9, _USB_EXTRA_STATE_DISABLED_UNTIL_REPLUG@GOTPAGEOFF]
Lloh77:
	ldr	x0, [x9]
	cmp	x8, x0
	b.eq	LBB0_26
; %bb.21:
Lloh78:
	adrp	x9, _USB_EXTRA_STATE_ENABLED@GOTPAGE
Lloh79:
	ldr	x9, [x9, _USB_EXTRA_STATE_ENABLED@GOTPAGEOFF]
Lloh80:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_26
; %bb.22:
Lloh81:
	adrp	x8, _gcr_min_counter@GOTPAGE
Lloh82:
	ldr	x8, [x8, _gcr_min_counter@GOTPAGEOFF]
	ldr	w9, [x8]
	add	w10, w9, #1
	str	w10, [x8]
	cmp	w9, #200
	b.lt	LBB0_26
; %bb.23:
	bl	_USB_ExtraSetState
Lloh83:
	adrp	x8, _usb_extra_manual@GOTPAGE
Lloh84:
	ldr	x8, [x8, _usb_extra_manual@GOTPAGEOFF]
Lloh85:
	str	xzr, [x8]
Lloh86:
	adrp	x0, l_.str.2@PAGE
Lloh87:
	add	x0, x0, l_.str.2@PAGEOFF
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_CDC_print
LBB0_24:
	str	x9, [x8]
LBB0_25:
Lloh88:
	adrp	x8, _gcr_min_counter@GOTPAGE
Lloh89:
	ldr	x8, [x8, _gcr_min_counter@GOTPAGEOFF]
Lloh90:
	str	wzr, [x8]
LBB0_26:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotStr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotStr	Lloh8, Lloh9, Lloh11
	.loh AdrpLdrGotStr	Lloh6, Lloh7, Lloh10
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh48, Lloh49, Lloh50
	.loh AdrpLdrGot	Lloh51, Lloh52
	.loh AdrpLdrGotLdr	Lloh53, Lloh54, Lloh55
	.loh AdrpLdrGot	Lloh62, Lloh63
	.loh AdrpLdrGotLdr	Lloh59, Lloh60, Lloh61
	.loh AdrpLdrGotLdr	Lloh56, Lloh57, Lloh58
	.loh AdrpLdrGotLdr	Lloh64, Lloh65, Lloh66
	.loh AdrpLdrGot	Lloh70, Lloh71
	.loh AdrpLdrGotLdr	Lloh67, Lloh68, Lloh69
	.loh AdrpLdrGotLdr	Lloh75, Lloh76, Lloh77
	.loh AdrpLdrGotLdr	Lloh72, Lloh73, Lloh74
	.loh AdrpLdrGotLdr	Lloh78, Lloh79, Lloh80
	.loh AdrpLdrGot	Lloh81, Lloh82
	.loh AdrpAdd	Lloh86, Lloh87
	.loh AdrpLdrGotStr	Lloh83, Lloh84, Lloh85
	.loh AdrpLdrGotStr	Lloh88, Lloh89, Lloh90
	.cfi_endproc
                                        ; -- End function
	.comm	_ACT_GCR_NONE,8,3               ; @ACT_GCR_NONE
	.comm	_gcr_desired,8,3                ; @gcr_desired
	.comm	_v_5v,8,3                       ; @v_5v
	.comm	_V5_CAT,8,3                     ; @V5_CAT
	.comm	_v_5v_cat_hit,4,2               ; @v_5v_cat_hit
	.comm	_gcr_actual,8,3                 ; @gcr_actual
	.comm	_usb_gcr_auto,4,2               ; @usb_gcr_auto
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"USB: WARNING: Re-enabling LED drivers\r\n"

	.comm	_v_5v_avg,8,3                   ; @v_5v_avg
	.comm	_V5_LOW,8,3                     ; @V5_LOW
	.comm	_ACT_GCR_DEC,8,3                ; @ACT_GCR_DEC
	.comm	_V5_HIGH,8,3                    ; @V5_HIGH
	.comm	_ACT_GCR_INC,8,3                ; @ACT_GCR_INC
	.comm	_gcr_min_counter,4,2            ; @gcr_min_counter
	.comm	_LED_GCR_STEP_AUTO,8,3          ; @LED_GCR_STEP_AUTO
	.comm	_LED_GCR_MAX,8,3                ; @LED_GCR_MAX
	.comm	_usb_extra_state,8,3            ; @usb_extra_state
	.comm	_USB_EXTRA_STATE_DISABLED_UNTIL_REPLUG,8,3 ; @USB_EXTRA_STATE_DISABLED_UNTIL_REPLUG
	.comm	_USB_EXTRA_STATE_ENABLED,8,3    ; @USB_EXTRA_STATE_ENABLED
	.comm	_usb_extra_manual,8,3           ; @usb_extra_manual
l_.str.2:                               ; @.str.2
	.asciz	"USB: Disabling extra port until replug!\r\n"

	.comm	_gcr_breathe,8,3                ; @gcr_breathe
	.comm	_led_animation_breathing,4,2    ; @led_animation_breathing
.subsections_via_symbols
