@pcprogrammer, are you doing the analysis in ASM??!?
Why don't you do the analysis in pseudo-C?
int sub_800167A0()
{
sub_8001764C(0x1C20890, 0, 0);
sub_8001764C(0x1C20890, 1u, 0);
sub_8001764C(0x1C20890, 2u, 0);
sub_8001764C(0x1C20890, 3u, 0);
sub_8001764C(0x1C20890, 4u, 0);
sub_8001764C(0x1C20890, 5u, 0);
sub_8001764C(0x1C20890, 6u, 0);
return sub_8001764C(0x1C20890, 7u, 0);
}
int __fastcall sub_800168FC(unsigned __int8 a1)
{
unsigned __int8 v1; // r4@1
v1 = a1;
sub_8001764C(0x1C20890, 0, 1);
sub_8001764C(0x1C20890, 1u, 1);
sub_8001764C(0x1C20890, 2u, 1);
sub_8001764C(0x1C20890, 3u, 1);
sub_8001764C(0x1C20890, 4u, 1);
sub_8001764C(0x1C20890, 5u, 1);
sub_8001764C(0x1C20890, 6u, 1);
sub_8001764C(0x1C20890, 7u, 1);
sub_8001774C(0x1C20890, 9);
sub_80017738(0x1C20890, 10);
v1C208A0 = v1 | v1C208A0 & 0xFFFFFF00;
sub_80017738(0x1C20890, 8);
return sub_8001774C(0x1C20890, 8);
}