// File: /workspace/github_c_makefile_star2_O1/SequentMicrosystems[P]wdt-rpi/src/wdt.c
// Function: doHelp
void doHelp(int argc, char *argv[])
{
	if (argc == 3)
	{
		if (strcasecmp(argv[2], "-warranty") == 0)
		{
			printf("\t-warranty:   Display the warranty\n");
			printf("\tUsage:       wdt -warranty\n");
			printf("\tExample:     wdt -warranty\n");
		}
		else if (strcasecmp(argv[2], "-r") == 0
			|| strcasecmp(argv[2], "-reload") == 0)
		{
			printf(
				"\t-r/-reload:  Reload the timer, prevent Raspberry Pi to be repowered\n");
			printf("\tUsage:       wdt -r\n");
			printf("\tExample:     wdt -r\n");
		}
		else if (strcasecmp(argv[2], "-d") == 0
			|| strcasecmp(argv[2], "-default") == 0)
		{
			printf(
				"\t-d/-default: Set the default period (sec); The watchdog will reload this period after reset\n");
			printf("\tUsage:       wdt -d <value>\n");
			printf("\tUsage:       wdt -default <value>\n");
			printf("\tExample:     Set the default period to 270 seconds:\n");
			printf("\t             wdt -d 270\n");
		}
		else if (strcasecmp(argv[2], "-p") == 0
			|| strcasecmp(argv[2], "-period") == 0)
		{
			printf("\t-p/-period:  Set the current period and reload the timer\n");
			printf("\tUsage:       wdt -p <value>\n");
			printf(
				"\tExample:     Set the wdt period to 20 sec and reload the timer:\n");
			printf("\t             wdt -p 20\n");
			printf("\tExample:     Disable the watchdog:\n");
			printf("\t             wdt -p 0\n");
		}
		else if (strcasecmp(argv[2], "-c") == 0
			|| strcasecmp(argv[2], "-clear") == 0)
		{
			printf("\t-c/-clear:   Clear the reset counter  \n");
			printf("\tUsage:       wdt -c\n");
			printf("\tExample:     wdt -c\n");
		}
		else if (strcasecmp(argv[2], "-off") == 0
			|| strcasecmp(argv[2], "-offinterval") == 0)
		{
			printf(
				"\t-off/-offinterval:   Set the off interval (seconds), The Raspberry will keept off this amount of time when the repower operation is performed\n");
			printf("\tUsage:       wdt -off <value>\n");
			printf("\tExample:     Set the wdt off period to 1 hour:\n");
			printf("\t             wdt -off 3600\n");
		}
		else if (strcasecmp(argv[2], "-g") == 0
			|| strcasecmp(argv[2], "-get") == 0)
		{
			printf("\t-g/-get:     Get watchdog parameters\n");
			printf("\tUsage:       wdt -g <option>\n");
			printf("\t<option>:    d/default = default period(sec)\n");
			printf("\t             p/period = period(sec)\n");
			printf(
				"\t             r/resets = total number of resets performed \n");
			printf("\t             v/vin = input voltage(mV)\n");
			printf(
				"\t             off/offinterval = how mutch wdt keep raspberry powered off (sec) \n");
			printf("\t             vr/vrasp = Raspberry voltage(mV)\n");
			printf("\t             vb/vbat = Battery voltage(mV)\n");
			printf(
				"\t             c/charge = charge status (0 - off, 1 - charge complete, 2 - charging, 3 - fault)\n");
			printf(
				"\t             rob/repoweronbattery = if the watchdog power off the Raspberry, will repower on battery only if this is 1\n");
			printf(
				"\t             pbe/powerbuttonenable = power button enabled/disabled (1/0)\n");
			printf(
				"\t             pbs/powerbuttonstatus = 1 - power button has been pushed; 0 - not  \n");
			printf(
				"\t             bint = power button interrupt generation enabled/disabled (1/0)\n");
			printf("\t             rtc (return RTC \"mm:dd:yyyy hh:mm:ss\"  \n");
			printf("\t             t/temp = cpu temperature(degC)\n");
			printf("\t             fv = firmware version\n");
			printf("\t             ecv - end charge voltage (mV)\n");
			printf("\t             buv = battery under voltage thereshold \n");			
			printf("\tExample:     wdt -g d get the wdt default period \n");
		}
		else if (strcasecmp(argv[2], "-rob") == 0
			|| strcasecmp(argv[2], "-repoweronbattery") == 0)
		{
			printf(
				"\t-rob/-repoweronbattery:   Set the \"repower on battery\" flag, 1-power back on Raspberry if the main power i missing, 0 - wait for main power \n");
			printf("\tUsage:       wdt -rob <value>\n");
			printf(
				"\tExample:     Do not power back on Raspberry if on battery\n");
			printf("\t             wdt -rob 0\n");
		}
		else if (strcasecmp(argv[2], "-pbe") == 0
			|| strcasecmp(argv[2], "-powerbuttonenable") == 0)
		{
			printf(
				"\t-pbe/-powerbuttonenable:   Enable / disable the power button, you can read his status and it can power back on raspberry if is pushed \n");
			printf("\tUsage:       wdt -pbe <value>\n");
			printf("\tExample:     Enable power button\n");
			printf("\t             wdt -pbe 1\n");
		}
		else if (strcasecmp(argv[2], "-rtc") == 0)
		{
			printf("\t-rtc:		  Set the RTC time and date\n");
			printf(
				"\tUsage:       wdt -rtc <mon> <day> <year> <hour> <min> <sec>\n");
			printf("\tExample:     Set time and date to 02/14/2023 12:54:32\n");
			printf("\t             wdt -rtc 2 14 2023 12 54 32\n");

		}
		else if (strcasecmp(argv[2], "-bint") == 0)
		{
			printf(
				"\t-bint:		  Enable / Disable interrupt generation on button push event\n");
			printf("\tUsage:       wdt -bint <0/1>\n");
			printf("\tExample:     Enable interrupt generation\n");
			printf("\t             wdt -bint 1\n");
		}
		else if (strcasecmp(argv[2], "-bc") == 0)
		{
			printf(
				"\t-bc:		  Prevent charging\n");
			printf("\tUsage:       wdt -bc <0/1>\n");
			printf("\tExample:     Disable charging\n");
			printf("\t             wdt -bc 1\n");
		}
		else if (strcasecmp(argv[2], "-buv") == 0)
		{
			printf(
				"\t-buv:		  Set battery undervoltage threshold in mV\n");
			printf("\tUsage:       wdt -buv [800,40000]\n");
			printf("\tExample:     Set the undervoltage threshold at 2.8V \n");
			printf("\t             wdt -buv 2800\n");
		}
		else if (strcasecmp(argv[2], "-chsel") == 0)
		{
			printf(
				"\t-chsel:		  Select charger chemestry (for multichemestry version only), check end charge voltage (wdt -g ecv)\n");
			printf("\tUsage:       wdt -chsel [0..7]\n");
			printf("\tExample:     Set the liIon with 4.2V end of charge voltage \n");
			printf("\t             wdt -chsel 5\n");
		}
		else
		{
			printf("Invalid command!\n");
			printf("%s: %s\n", argv[0], usage);
		}
	}
	else
	{
		printf("%s: %s\n", argv[0], usage);
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
cmpl $0x3, %edi
jne 0x13d6
movq 0x10(%rbx), %r14
leaq 0x3258(%rip), %rsi      # 0x442f
movq %r14, %rdi
callq 0x1030
testl %eax, %eax
je 0x1419
leaq 0x31f4(%rip), %rsi      # 0x43e2
movq %r14, %rdi
callq 0x1030
testl %eax, %eax
je 0x13f5
leaq 0x2343(%rip), %rsi      # 0x3548
movq %r14, %rdi
callq 0x1030
testl %eax, %eax
je 0x13f5
leaq 0x2334(%rip), %rsi      # 0x3550
movq %r14, %rdi
callq 0x1030
testl %eax, %eax
je 0x143d
leaq 0x2320(%rip), %rsi      # 0x3553
movq %r14, %rdi
callq 0x1030
testl %eax, %eax
je 0x143d
leaq 0x2312(%rip), %rsi      # 0x355c
movq %r14, %rdi
callq 0x1030
testl %eax, %eax
je 0x1479
leaq 0x22fe(%rip), %rsi      # 0x355f
movq %r14, %rdi
callq 0x1030
testl %eax, %eax
je 0x1479
leaq 0x2f25(%rip), %rsi      # 0x419d
movq %r14, %rdi
callq 0x1030
testl %eax, %eax
je 0x14c1
leaq 0x22d8(%rip), %rsi      # 0x3567
movq %r14, %rdi
callq 0x1030
testl %eax, %eax
je 0x14c1
leaq 0x22c8(%rip), %rsi      # 0x356e
movq %r14, %rdi
callq 0x1030
testl %eax, %eax
je 0x14e5
leaq 0x22b6(%rip), %rsi      # 0x3573
movq %r14, %rdi
callq 0x1030
testl %eax, %eax
je 0x14e5
leaq 0x22ac(%rip), %rsi      # 0x3580
movq %r14, %rdi
callq 0x1030
testl %eax, %eax
je 0x1515
leaq 0x2298(%rip), %rsi      # 0x3583
movq %r14, %rdi
callq 0x1030
testl %eax, %eax
je 0x1515
leaq 0x2286(%rip), %rsi      # 0x3588
movq %r14, %rdi
callq 0x1030
testl %eax, %eax
je 0x1602
leaq 0x2274(%rip), %rsi      # 0x358d
movq %r14, %rdi
callq 0x1030
testl %eax, %eax
je 0x1602
leaq 0x226f(%rip), %rsi      # 0x359f
movq %r14, %rdi
callq 0x1030
testl %eax, %eax
je 0x162f
leaq 0x225d(%rip), %rsi      # 0x35a4
movq %r14, %rdi
callq 0x1030
testl %eax, %eax
je 0x162f
leaq 0x2259(%rip), %rsi      # 0x35b7
movq %r14, %rdi
callq 0x1030
testl %eax, %eax
je 0x1666
leaq 0x2247(%rip), %rsi      # 0x35bc
movq %r14, %rdi
callq 0x1030
testl %eax, %eax
je 0x1693
leaq 0x2236(%rip), %rsi      # 0x35c2
movq %r14, %rdi
callq 0x1030
testl %eax, %eax
je 0x16c0
leaq 0x2223(%rip), %rsi      # 0x35c6
movq %r14, %rdi
callq 0x1030
testl %eax, %eax
je 0x16f0
leaq 0x2211(%rip), %rsi      # 0x35cb
movq %r14, %rdi
callq 0x1030
testl %eax, %eax
je 0x1720
leaq 0x22bd(%rip), %rdi      # 0x368e
callq 0x1040
movq (%rbx), %rsi
movq 0x5c90(%rip), %rdx      # 0x7070
leaq 0x21eb(%rip), %rdi      # 0x35d2
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1060
leaq 0x2f8f(%rip), %rdi      # 0x438b
callq 0x1040
leaq 0x2fc8(%rip), %rdi      # 0x43d0
callq 0x1040
leaq 0x2fd1(%rip), %rdi      # 0x43e5
jmp 0x165a
leaq 0x2fda(%rip), %rdi      # 0x43fa
callq 0x1040
leaq 0x2ff1(%rip), %rdi      # 0x441d
callq 0x1040
leaq 0x3001(%rip), %rdi      # 0x4439
jmp 0x165a
leaq 0x2e5c(%rip), %rdi      # 0x42a0
callq 0x1040
leaq 0x2ead(%rip), %rdi      # 0x42fd
callq 0x1040
leaq 0x2ebe(%rip), %rdi      # 0x431a
callq 0x1040
leaq 0x2ed5(%rip), %rdi      # 0x433d
callq 0x1040
leaq 0x2efe(%rip), %rdi      # 0x4372
jmp 0x165a
leaq 0x2d35(%rip), %rdi      # 0x41b5
callq 0x1040
leaq 0x2d63(%rip), %rdi      # 0x41ef
callq 0x1040
leaq 0x2d74(%rip), %rdi      # 0x420c
callq 0x1040
leaq 0x2da9(%rip), %rdi      # 0x424d
callq 0x1040
leaq 0x2db5(%rip), %rdi      # 0x4265
callq 0x1040
leaq 0x2dcd(%rip), %rdi      # 0x4289
jmp 0x165a
leaq 0x2c9b(%rip), %rdi      # 0x4163
callq 0x1040
leaq 0x2cb7(%rip), %rdi      # 0x418b
callq 0x1040
leaq 0x2cc0(%rip), %rdi      # 0x41a0
jmp 0x165a
leaq 0x2b7d(%rip), %rdi      # 0x4069
callq 0x1040
leaq 0x2c00(%rip), %rdi      # 0x40f8
callq 0x1040
leaq 0x2c13(%rip), %rdi      # 0x4117
callq 0x1040
leaq 0x2c37(%rip), %rdi      # 0x4147
jmp 0x165a
leaq 0x26cb(%rip), %rdi      # 0x3be7
callq 0x1040
leaq 0x26e5(%rip), %rdi      # 0x3c0d
callq 0x1040
leaq 0x26f7(%rip), %rdi      # 0x3c2b
callq 0x1040
leaq 0x2719(%rip), %rdi      # 0x3c59
callq 0x1040
leaq 0x2732(%rip), %rdi      # 0x3c7e
callq 0x1040
leaq 0x2761(%rip), %rdi      # 0x3cb9
callq 0x1040
leaq 0x277d(%rip), %rdi      # 0x3ce1
callq 0x1040
leaq 0x27c1(%rip), %rdi      # 0x3d31
callq 0x1040
leaq 0x27e4(%rip), %rdi      # 0x3d60
callq 0x1040
leaq 0x2804(%rip), %rdi      # 0x3d8c
callq 0x1040
leaq 0x2857(%rip), %rdi      # 0x3deb
callq 0x1040
leaq 0x28c3(%rip), %rdi      # 0x3e63
callq 0x1040
leaq 0x2901(%rip), %rdi      # 0x3ead
callq 0x1040
leaq 0x2947(%rip), %rdi      # 0x3eff
callq 0x1040
leaq 0x2989(%rip), %rdi      # 0x3f4d
callq 0x1040
leaq 0x29b3(%rip), %rdi      # 0x3f83
callq 0x1040
leaq 0x29d4(%rip), %rdi      # 0x3fb0
callq 0x1040
leaq 0x29ec(%rip), %rdi      # 0x3fd4
callq 0x1040
leaq 0x2a0c(%rip), %rdi      # 0x4000
callq 0x1040
leaq 0x2a36(%rip), %rdi      # 0x4036
jmp 0x165a
leaq 0x24dd(%rip), %rdi      # 0x3ae6
callq 0x1040
leaq 0x255f(%rip), %rdi      # 0x3b74
callq 0x1040
leaq 0x2572(%rip), %rdi      # 0x3b93
callq 0x1040
leaq 0x25a1(%rip), %rdi      # 0x3bce
jmp 0x165a
leaq 0x23ce(%rip), %rdi      # 0x3a04
callq 0x1040
leaq 0x244a(%rip), %rdi      # 0x3a8c
callq 0x1040
leaq 0x245d(%rip), %rdi      # 0x3aab
callq 0x1040
leaq 0x2473(%rip), %rdi      # 0x3acd
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1040
leaq 0x22d5(%rip), %rdi      # 0x3942
callq 0x1040
leaq 0x22ed(%rip), %rdi      # 0x3966
callq 0x1040
leaq 0x231e(%rip), %rdi      # 0x39a3
callq 0x1040
leaq 0x2349(%rip), %rdi      # 0x39da
jmp 0x165a
leaq 0x2200(%rip), %rdi      # 0x389a
callq 0x1040
leaq 0x223a(%rip), %rdi      # 0x38e0
callq 0x1040
leaq 0x224c(%rip), %rdi      # 0x38fe
callq 0x1040
leaq 0x226a(%rip), %rdi      # 0x3928
jmp 0x165a
leaq 0x2166(%rip), %rdi      # 0x382d
callq 0x1040
leaq 0x2174(%rip), %rdi      # 0x3847
callq 0x1040
leaq 0x2184(%rip), %rdi      # 0x3863
callq 0x1040
leaq 0x2197(%rip), %rdi      # 0x3882
jmp 0x165a
leaq 0x208e(%rip), %rdi      # 0x3785
callq 0x1040
leaq 0x20b5(%rip), %rdi      # 0x37b8
callq 0x1040
leaq 0x20cc(%rip), %rdi      # 0x37db
callq 0x1040
leaq 0x20f6(%rip), %rdi      # 0x3811
jmp 0x165a
leaq 0x1f78(%rip), %rdi      # 0x369f
callq 0x1040
leaq 0x1fda(%rip), %rdi      # 0x370d
callq 0x1040
leaq 0x1fee(%rip), %rdi      # 0x372d
callq 0x1040
leaq 0x201f(%rip), %rdi      # 0x376a
jmp 0x165a