extern cKF_Skeleton_R_c cKF_bs_r_int_hnw001;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw002;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw003;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw004;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw005;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw006;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw007;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw008;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw009;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw010;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw011;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw012;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw013;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw014;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw015;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw016;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw017;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw018;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw019;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw020;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw021;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw022;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw023;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw024;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw025;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw026;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw027;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw028;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw029;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw030;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw031;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw032;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw033;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw034;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw035;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw036;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw037;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw038;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw039;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw040;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw041;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw042;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw043;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw044;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw045;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw046;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw047;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw048;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw049;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw050;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw051;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw052;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw053;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw054;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw055;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw056;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw057;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw058;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw059;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw060;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw061;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw062;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw063;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw064;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw065;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw066;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw067;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw068;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw069;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw070;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw071;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw072;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw073;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw074;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw075;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw076;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw077;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw078;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw079;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw080;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw081;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw082;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw083;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw084;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw085;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw086;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw087;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw088;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw089;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw090;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw091;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw092;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw093;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw094;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw095;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw096;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw097;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw098;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw099;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw100;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw101;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw102;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw103;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw104;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw105;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw106;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw107;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw108;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw109;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw110;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw111;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw112;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw113;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw114;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw115;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw116;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw117;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw118;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw119;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw120;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw121;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw122;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw123;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw124;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw125;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw126;
extern cKF_Skeleton_R_c cKF_bs_r_int_hnw127;

extern cKF_Animation_R_c cKF_ba_r_int_hnw001;
extern cKF_Animation_R_c cKF_ba_r_int_hnw002;
extern cKF_Animation_R_c cKF_ba_r_int_hnw003;
extern cKF_Animation_R_c cKF_ba_r_int_hnw004;
extern cKF_Animation_R_c cKF_ba_r_int_hnw005;
extern cKF_Animation_R_c cKF_ba_r_int_hnw006;
extern cKF_Animation_R_c cKF_ba_r_int_hnw007;
extern cKF_Animation_R_c cKF_ba_r_int_hnw008;
extern cKF_Animation_R_c cKF_ba_r_int_hnw009;
extern cKF_Animation_R_c cKF_ba_r_int_hnw010;
extern cKF_Animation_R_c cKF_ba_r_int_hnw011;
extern cKF_Animation_R_c cKF_ba_r_int_hnw012;
extern cKF_Animation_R_c cKF_ba_r_int_hnw013;
extern cKF_Animation_R_c cKF_ba_r_int_hnw014;
extern cKF_Animation_R_c cKF_ba_r_int_hnw015;
extern cKF_Animation_R_c cKF_ba_r_int_hnw016;
extern cKF_Animation_R_c cKF_ba_r_int_hnw017;
extern cKF_Animation_R_c cKF_ba_r_int_hnw018;
extern cKF_Animation_R_c cKF_ba_r_int_hnw019;
extern cKF_Animation_R_c cKF_ba_r_int_hnw020;
extern cKF_Animation_R_c cKF_ba_r_int_hnw021;
extern cKF_Animation_R_c cKF_ba_r_int_hnw022;
extern cKF_Animation_R_c cKF_ba_r_int_hnw023;
extern cKF_Animation_R_c cKF_ba_r_int_hnw024;
extern cKF_Animation_R_c cKF_ba_r_int_hnw025;
extern cKF_Animation_R_c cKF_ba_r_int_hnw026;
extern cKF_Animation_R_c cKF_ba_r_int_hnw027;
extern cKF_Animation_R_c cKF_ba_r_int_hnw028;
extern cKF_Animation_R_c cKF_ba_r_int_hnw029;
extern cKF_Animation_R_c cKF_ba_r_int_hnw030;
extern cKF_Animation_R_c cKF_ba_r_int_hnw031;
extern cKF_Animation_R_c cKF_ba_r_int_hnw032;
extern cKF_Animation_R_c cKF_ba_r_int_hnw033;
extern cKF_Animation_R_c cKF_ba_r_int_hnw034;
extern cKF_Animation_R_c cKF_ba_r_int_hnw035;
extern cKF_Animation_R_c cKF_ba_r_int_hnw036;
extern cKF_Animation_R_c cKF_ba_r_int_hnw037;
extern cKF_Animation_R_c cKF_ba_r_int_hnw038;
extern cKF_Animation_R_c cKF_ba_r_int_hnw039;
extern cKF_Animation_R_c cKF_ba_r_int_hnw040;
extern cKF_Animation_R_c cKF_ba_r_int_hnw041;
extern cKF_Animation_R_c cKF_ba_r_int_hnw042;
extern cKF_Animation_R_c cKF_ba_r_int_hnw043;
extern cKF_Animation_R_c cKF_ba_r_int_hnw044;
extern cKF_Animation_R_c cKF_ba_r_int_hnw045;
extern cKF_Animation_R_c cKF_ba_r_int_hnw046;
extern cKF_Animation_R_c cKF_ba_r_int_hnw047;
extern cKF_Animation_R_c cKF_ba_r_int_hnw048;
extern cKF_Animation_R_c cKF_ba_r_int_hnw049;
extern cKF_Animation_R_c cKF_ba_r_int_hnw050;
extern cKF_Animation_R_c cKF_ba_r_int_hnw051;
extern cKF_Animation_R_c cKF_ba_r_int_hnw052;
extern cKF_Animation_R_c cKF_ba_r_int_hnw053;
extern cKF_Animation_R_c cKF_ba_r_int_hnw054;
extern cKF_Animation_R_c cKF_ba_r_int_hnw055;
extern cKF_Animation_R_c cKF_ba_r_int_hnw056;
extern cKF_Animation_R_c cKF_ba_r_int_hnw057;
extern cKF_Animation_R_c cKF_ba_r_int_hnw058;
extern cKF_Animation_R_c cKF_ba_r_int_hnw059;
extern cKF_Animation_R_c cKF_ba_r_int_hnw060;
extern cKF_Animation_R_c cKF_ba_r_int_hnw061;
extern cKF_Animation_R_c cKF_ba_r_int_hnw062;
extern cKF_Animation_R_c cKF_ba_r_int_hnw063;
extern cKF_Animation_R_c cKF_ba_r_int_hnw064;
extern cKF_Animation_R_c cKF_ba_r_int_hnw065;
extern cKF_Animation_R_c cKF_ba_r_int_hnw066;
extern cKF_Animation_R_c cKF_ba_r_int_hnw067;
extern cKF_Animation_R_c cKF_ba_r_int_hnw068;
extern cKF_Animation_R_c cKF_ba_r_int_hnw069;
extern cKF_Animation_R_c cKF_ba_r_int_hnw070;
extern cKF_Animation_R_c cKF_ba_r_int_hnw071;
extern cKF_Animation_R_c cKF_ba_r_int_hnw072;
extern cKF_Animation_R_c cKF_ba_r_int_hnw073;
extern cKF_Animation_R_c cKF_ba_r_int_hnw074;
extern cKF_Animation_R_c cKF_ba_r_int_hnw075;
extern cKF_Animation_R_c cKF_ba_r_int_hnw076;
extern cKF_Animation_R_c cKF_ba_r_int_hnw077;
extern cKF_Animation_R_c cKF_ba_r_int_hnw078;
extern cKF_Animation_R_c cKF_ba_r_int_hnw079;
extern cKF_Animation_R_c cKF_ba_r_int_hnw080;
extern cKF_Animation_R_c cKF_ba_r_int_hnw081;
extern cKF_Animation_R_c cKF_ba_r_int_hnw082;
extern cKF_Animation_R_c cKF_ba_r_int_hnw083;
extern cKF_Animation_R_c cKF_ba_r_int_hnw084;
extern cKF_Animation_R_c cKF_ba_r_int_hnw085;
extern cKF_Animation_R_c cKF_ba_r_int_hnw086;
extern cKF_Animation_R_c cKF_ba_r_int_hnw087;
extern cKF_Animation_R_c cKF_ba_r_int_hnw088;
extern cKF_Animation_R_c cKF_ba_r_int_hnw089;
extern cKF_Animation_R_c cKF_ba_r_int_hnw090;
extern cKF_Animation_R_c cKF_ba_r_int_hnw091;
extern cKF_Animation_R_c cKF_ba_r_int_hnw092;
extern cKF_Animation_R_c cKF_ba_r_int_hnw093;
extern cKF_Animation_R_c cKF_ba_r_int_hnw094;
extern cKF_Animation_R_c cKF_ba_r_int_hnw095;
extern cKF_Animation_R_c cKF_ba_r_int_hnw096;
extern cKF_Animation_R_c cKF_ba_r_int_hnw097;
extern cKF_Animation_R_c cKF_ba_r_int_hnw098;
extern cKF_Animation_R_c cKF_ba_r_int_hnw099;
extern cKF_Animation_R_c cKF_ba_r_int_hnw100;
extern cKF_Animation_R_c cKF_ba_r_int_hnw101;
extern cKF_Animation_R_c cKF_ba_r_int_hnw102;
extern cKF_Animation_R_c cKF_ba_r_int_hnw103;
extern cKF_Animation_R_c cKF_ba_r_int_hnw104;
extern cKF_Animation_R_c cKF_ba_r_int_hnw105;
extern cKF_Animation_R_c cKF_ba_r_int_hnw106;
extern cKF_Animation_R_c cKF_ba_r_int_hnw107;
extern cKF_Animation_R_c cKF_ba_r_int_hnw108;
extern cKF_Animation_R_c cKF_ba_r_int_hnw109;
extern cKF_Animation_R_c cKF_ba_r_int_hnw110;
extern cKF_Animation_R_c cKF_ba_r_int_hnw111;
extern cKF_Animation_R_c cKF_ba_r_int_hnw112;
extern cKF_Animation_R_c cKF_ba_r_int_hnw113;
extern cKF_Animation_R_c cKF_ba_r_int_hnw114;
extern cKF_Animation_R_c cKF_ba_r_int_hnw115;
extern cKF_Animation_R_c cKF_ba_r_int_hnw116;
extern cKF_Animation_R_c cKF_ba_r_int_hnw117;
extern cKF_Animation_R_c cKF_ba_r_int_hnw118;
extern cKF_Animation_R_c cKF_ba_r_int_hnw119;
extern cKF_Animation_R_c cKF_ba_r_int_hnw120;
extern cKF_Animation_R_c cKF_ba_r_int_hnw121;
extern cKF_Animation_R_c cKF_ba_r_int_hnw122;
extern cKF_Animation_R_c cKF_ba_r_int_hnw123;
extern cKF_Animation_R_c cKF_ba_r_int_hnw124;
extern cKF_Animation_R_c cKF_ba_r_int_hnw125;
extern cKF_Animation_R_c cKF_ba_r_int_hnw126;
extern cKF_Animation_R_c cKF_ba_r_int_hnw127;

static cKF_Skeleton_R_c* hnw_cKF_bs_r_table[] = {
    &cKF_bs_r_int_hnw001, &cKF_bs_r_int_hnw002, &cKF_bs_r_int_hnw003, &cKF_bs_r_int_hnw004, &cKF_bs_r_int_hnw005,
    &cKF_bs_r_int_hnw006, &cKF_bs_r_int_hnw007, &cKF_bs_r_int_hnw008, &cKF_bs_r_int_hnw009, &cKF_bs_r_int_hnw010,
    &cKF_bs_r_int_hnw011, &cKF_bs_r_int_hnw012, &cKF_bs_r_int_hnw013, &cKF_bs_r_int_hnw014, &cKF_bs_r_int_hnw015,
    &cKF_bs_r_int_hnw016, &cKF_bs_r_int_hnw017, &cKF_bs_r_int_hnw018, &cKF_bs_r_int_hnw019, &cKF_bs_r_int_hnw020,
    &cKF_bs_r_int_hnw021, &cKF_bs_r_int_hnw022, &cKF_bs_r_int_hnw023, &cKF_bs_r_int_hnw024, &cKF_bs_r_int_hnw025,
    &cKF_bs_r_int_hnw026, &cKF_bs_r_int_hnw027, &cKF_bs_r_int_hnw028, &cKF_bs_r_int_hnw029, &cKF_bs_r_int_hnw030,
    &cKF_bs_r_int_hnw031, &cKF_bs_r_int_hnw032, &cKF_bs_r_int_hnw033, &cKF_bs_r_int_hnw034, &cKF_bs_r_int_hnw035,
    &cKF_bs_r_int_hnw036, &cKF_bs_r_int_hnw037, &cKF_bs_r_int_hnw038, &cKF_bs_r_int_hnw039, &cKF_bs_r_int_hnw040,
    &cKF_bs_r_int_hnw041, &cKF_bs_r_int_hnw042, &cKF_bs_r_int_hnw043, &cKF_bs_r_int_hnw044, &cKF_bs_r_int_hnw045,
    &cKF_bs_r_int_hnw046, &cKF_bs_r_int_hnw047, &cKF_bs_r_int_hnw048, &cKF_bs_r_int_hnw049, &cKF_bs_r_int_hnw050,
    &cKF_bs_r_int_hnw051, &cKF_bs_r_int_hnw052, &cKF_bs_r_int_hnw053, &cKF_bs_r_int_hnw054, &cKF_bs_r_int_hnw055,
    &cKF_bs_r_int_hnw056, &cKF_bs_r_int_hnw057, &cKF_bs_r_int_hnw058, &cKF_bs_r_int_hnw059, &cKF_bs_r_int_hnw060,
    &cKF_bs_r_int_hnw061, &cKF_bs_r_int_hnw062, &cKF_bs_r_int_hnw063, &cKF_bs_r_int_hnw064, &cKF_bs_r_int_hnw065,
    &cKF_bs_r_int_hnw066, &cKF_bs_r_int_hnw067, &cKF_bs_r_int_hnw068, &cKF_bs_r_int_hnw069, &cKF_bs_r_int_hnw070,
    &cKF_bs_r_int_hnw071, &cKF_bs_r_int_hnw072, &cKF_bs_r_int_hnw073, &cKF_bs_r_int_hnw074, &cKF_bs_r_int_hnw075,
    &cKF_bs_r_int_hnw076, &cKF_bs_r_int_hnw077, &cKF_bs_r_int_hnw078, &cKF_bs_r_int_hnw079, &cKF_bs_r_int_hnw080,
    &cKF_bs_r_int_hnw081, &cKF_bs_r_int_hnw082, &cKF_bs_r_int_hnw083, &cKF_bs_r_int_hnw084, &cKF_bs_r_int_hnw085,
    &cKF_bs_r_int_hnw086, &cKF_bs_r_int_hnw087, &cKF_bs_r_int_hnw088, &cKF_bs_r_int_hnw089, &cKF_bs_r_int_hnw090,
    &cKF_bs_r_int_hnw091, &cKF_bs_r_int_hnw092, &cKF_bs_r_int_hnw093, &cKF_bs_r_int_hnw094, &cKF_bs_r_int_hnw095,
    &cKF_bs_r_int_hnw096, &cKF_bs_r_int_hnw097, &cKF_bs_r_int_hnw098, &cKF_bs_r_int_hnw099, &cKF_bs_r_int_hnw100,
    &cKF_bs_r_int_hnw101, &cKF_bs_r_int_hnw102, &cKF_bs_r_int_hnw103, &cKF_bs_r_int_hnw104, &cKF_bs_r_int_hnw105,
    &cKF_bs_r_int_hnw106, &cKF_bs_r_int_hnw107, &cKF_bs_r_int_hnw108, &cKF_bs_r_int_hnw109, &cKF_bs_r_int_hnw110,
    &cKF_bs_r_int_hnw111, &cKF_bs_r_int_hnw112, &cKF_bs_r_int_hnw113, &cKF_bs_r_int_hnw114, &cKF_bs_r_int_hnw115,
    &cKF_bs_r_int_hnw116, &cKF_bs_r_int_hnw117, &cKF_bs_r_int_hnw118, &cKF_bs_r_int_hnw119, &cKF_bs_r_int_hnw120,
    &cKF_bs_r_int_hnw121, &cKF_bs_r_int_hnw122, &cKF_bs_r_int_hnw123, &cKF_bs_r_int_hnw124, &cKF_bs_r_int_hnw125,
    &cKF_bs_r_int_hnw126, &cKF_bs_r_int_hnw127, &cKF_bs_r_int_hnw001
};

static cKF_Animation_R_c* hnw_cKF_ba_r_table[] = {
    &cKF_ba_r_int_hnw001, &cKF_ba_r_int_hnw002, &cKF_ba_r_int_hnw003, &cKF_ba_r_int_hnw004, &cKF_ba_r_int_hnw005,
    &cKF_ba_r_int_hnw006, &cKF_ba_r_int_hnw007, &cKF_ba_r_int_hnw008, &cKF_ba_r_int_hnw009, &cKF_ba_r_int_hnw010,
    &cKF_ba_r_int_hnw011, &cKF_ba_r_int_hnw012, &cKF_ba_r_int_hnw013, &cKF_ba_r_int_hnw014, &cKF_ba_r_int_hnw015,
    &cKF_ba_r_int_hnw016, &cKF_ba_r_int_hnw017, &cKF_ba_r_int_hnw018, &cKF_ba_r_int_hnw019, &cKF_ba_r_int_hnw020,
    &cKF_ba_r_int_hnw021, &cKF_ba_r_int_hnw022, &cKF_ba_r_int_hnw023, &cKF_ba_r_int_hnw024, &cKF_ba_r_int_hnw025,
    &cKF_ba_r_int_hnw026, &cKF_ba_r_int_hnw027, &cKF_ba_r_int_hnw028, &cKF_ba_r_int_hnw029, &cKF_ba_r_int_hnw030,
    &cKF_ba_r_int_hnw031, &cKF_ba_r_int_hnw032, &cKF_ba_r_int_hnw033, &cKF_ba_r_int_hnw034, &cKF_ba_r_int_hnw035,
    &cKF_ba_r_int_hnw036, &cKF_ba_r_int_hnw037, &cKF_ba_r_int_hnw038, &cKF_ba_r_int_hnw039, &cKF_ba_r_int_hnw040,
    &cKF_ba_r_int_hnw041, &cKF_ba_r_int_hnw042, &cKF_ba_r_int_hnw043, &cKF_ba_r_int_hnw044, &cKF_ba_r_int_hnw045,
    &cKF_ba_r_int_hnw046, &cKF_ba_r_int_hnw047, &cKF_ba_r_int_hnw048, &cKF_ba_r_int_hnw049, &cKF_ba_r_int_hnw050,
    &cKF_ba_r_int_hnw051, &cKF_ba_r_int_hnw052, &cKF_ba_r_int_hnw053, &cKF_ba_r_int_hnw054, &cKF_ba_r_int_hnw055,
    &cKF_ba_r_int_hnw056, &cKF_ba_r_int_hnw057, &cKF_ba_r_int_hnw058, &cKF_ba_r_int_hnw059, &cKF_ba_r_int_hnw060,
    &cKF_ba_r_int_hnw061, &cKF_ba_r_int_hnw062, &cKF_ba_r_int_hnw063, &cKF_ba_r_int_hnw064, &cKF_ba_r_int_hnw065,
    &cKF_ba_r_int_hnw066, &cKF_ba_r_int_hnw067, &cKF_ba_r_int_hnw068, &cKF_ba_r_int_hnw069, &cKF_ba_r_int_hnw070,
    &cKF_ba_r_int_hnw071, &cKF_ba_r_int_hnw072, &cKF_ba_r_int_hnw073, &cKF_ba_r_int_hnw074, &cKF_ba_r_int_hnw075,
    &cKF_ba_r_int_hnw076, &cKF_ba_r_int_hnw077, &cKF_ba_r_int_hnw078, &cKF_ba_r_int_hnw079, &cKF_ba_r_int_hnw080,
    &cKF_ba_r_int_hnw081, &cKF_ba_r_int_hnw082, &cKF_ba_r_int_hnw083, &cKF_ba_r_int_hnw084, &cKF_ba_r_int_hnw085,
    &cKF_ba_r_int_hnw086, &cKF_ba_r_int_hnw087, &cKF_ba_r_int_hnw088, &cKF_ba_r_int_hnw089, &cKF_ba_r_int_hnw090,
    &cKF_ba_r_int_hnw091, &cKF_ba_r_int_hnw092, &cKF_ba_r_int_hnw093, &cKF_ba_r_int_hnw094, &cKF_ba_r_int_hnw095,
    &cKF_ba_r_int_hnw096, &cKF_ba_r_int_hnw097, &cKF_ba_r_int_hnw098, &cKF_ba_r_int_hnw099, &cKF_ba_r_int_hnw100,
    &cKF_ba_r_int_hnw101, &cKF_ba_r_int_hnw102, &cKF_ba_r_int_hnw103, &cKF_ba_r_int_hnw104, &cKF_ba_r_int_hnw105,
    &cKF_ba_r_int_hnw106, &cKF_ba_r_int_hnw107, &cKF_ba_r_int_hnw108, &cKF_ba_r_int_hnw109, &cKF_ba_r_int_hnw110,
    &cKF_ba_r_int_hnw111, &cKF_ba_r_int_hnw112, &cKF_ba_r_int_hnw113, &cKF_ba_r_int_hnw114, &cKF_ba_r_int_hnw115,
    &cKF_ba_r_int_hnw116, &cKF_ba_r_int_hnw117, &cKF_ba_r_int_hnw118, &cKF_ba_r_int_hnw119, &cKF_ba_r_int_hnw120,
    &cKF_ba_r_int_hnw121, &cKF_ba_r_int_hnw122, &cKF_ba_r_int_hnw123, &cKF_ba_r_int_hnw124, &cKF_ba_r_int_hnw125,
    &cKF_ba_r_int_hnw126, &cKF_ba_r_int_hnw127, &cKF_ba_r_int_hnw001
};

static u8 cKF_ckcb_r_int_hnw_off_tbl[] = {
    // clang-format off
    cKF_ANIMITION_BIT_NONE,
	cKF_ANIMITION_BIT_NONE,
	cKF_ANIMITION_BIT_NONE,
	cKF_ANIMITION_BIT_NONE,
    cKF_ANIMITION_BIT_NONE,
	cKF_ANIMITION_BIT_NONE,
	cKF_ANIMITION_BIT_NONE
    // clang-format on
};

static s16 cKF_c_int_hnw_off_tbl[] = {
    // clang-format off
	0, 0,     0,
	0, 0,   900,
	0, 0,     0,
	0, 0,     0,
	0, 0,  -900,
	0, 0,     0,
	0, 0, -2700,
	0, 0,     0
    // clang-format on
};

static cKF_Animation_R_c cKF_ba_r_int_hnw_off = {
    cKF_ckcb_r_int_hnw_off_tbl, NULL, NULL, cKF_c_int_hnw_off_tbl, -1, 9
};

static void aHnwCommon_RhythmStart(FTR_ACTOR* ftr_actor, int state, s8 delay) {
    sAdo_RhythmStart((u32)ftr_actor, state + 1, delay);
    ftr_actor->dynamic_work_s[0] = 0;
    ftr_actor->dynamic_work_f[1] = 0.0f;
}

static void aHnwCommon_ct(FTR_ACTOR* ftr_actor, u8* data) {
    int haniwa_idx = ftr_actor->name - 0x16C;
    cKF_SkeletonInfo_R_c* keyframe = &ftr_actor->keyframe;
    s_xyz* work = ftr_actor->joint;
    s_xyz* morph = ftr_actor->morph;

    cKF_SkeletonInfo_R_ct(keyframe, hnw_cKF_bs_r_table[haniwa_idx], hnw_cKF_ba_r_table[haniwa_idx], work, morph);
    cKF_SkeletonInfo_R_init_standard_repeat(keyframe, hnw_cKF_ba_r_table[haniwa_idx], NULL);
    keyframe->frame_control.speed = 0.0f;
    cKF_SkeletonInfo_R_play(keyframe);
    keyframe->frame_control.start_frame = 1.0f;
    keyframe->frame_control.end_frame = hnw_cKF_ba_r_table[haniwa_idx]->frames;
    keyframe->frame_control.speed = 0.5f;

    /* Disable animation if turned off */
    if (ftr_actor->switch_bit == FALSE) {
        ftr_actor->haniwa_state = aFTR_HNW_STATE_OFF;
        cKF_SkeletonInfo_R_init(keyframe, keyframe->skeleton, &cKF_ba_r_int_hnw_off, 1.0f, cKF_ba_r_int_hnw_off.frames,
                                0.0f, 0.0f, 10.0f, cKF_FRAMECONTROL_STOP, NULL);
    }

    if (ftr_actor->dynamic_work_s[3] == 0) {
        ftr_actor->dynamic_work_s[2] = 5;
    } else {
        ftr_actor->dynamic_work_s[2] = 0;
    }
}

static void aHnwCommon_mv(FTR_ACTOR* ftr_actor, ACTOR* my_room_actor, GAME* game, u8* data) {
    int haniwa_idx = ftr_actor->name - 0x16C;
    cKF_SkeletonInfo_R_c* keyframe = &ftr_actor->keyframe;

    if (ftr_actor->dynamic_work_s[2] > 0) {
        ftr_actor->dynamic_work_s[2]--;
    }

    switch (ftr_actor->haniwa_state) {
        case aFTR_HNW_STATE_WAIT_TURN_ON: {
            ftr_actor->haniwa_state++;
            break;
        }

        case aFTR_HNW_STATE_TURN_ON: {
            if (ftr_actor->dynamic_work_s[2] <= 0) {
                aHnwCommon_RhythmStart(ftr_actor, (int)haniwa_idx, (int)ftr_actor->haniwa_step);
                ftr_actor->haniwa_state++;
            }
            break;
        }

        case aFTR_HNW_STATE_ON: {
            f32 counter;
            f32 last_frame;
            s8 delay;

            if (ftr_actor->dynamic_work_s[2] > 0) {
                return;
            }

            delay = sAdo_GetRhythmDelay((u32)ftr_actor);
            if (delay != -1) {
                ftr_actor->haniwa_step = delay;
            }

            sAdo_RhythmPos((u32)ftr_actor, haniwa_idx + 1, &ftr_actor->position);
            counter = sAdo_GetRhythmAnimCounter((u32)ftr_actor);

            if (counter >= 0.0f) {
                if (counter < ftr_actor->dynamic_work_f[1]) {
                    ftr_actor->dynamic_work_s[0] ^= 1;
                }

                ftr_actor->dynamic_work_f[1] = counter;

                if (haniwa_idx == 7 ||  /* tall oombloid */
                    haniwa_idx == 12 || /* sputnoid */
                    haniwa_idx == 38 || /* mini bowtoid */
                    haniwa_idx == 39 || /* bowtoid */
                    haniwa_idx == 48 || /* mega timpanoid */
                    haniwa_idx == 89    /* mini puffoid */
                ) {
                    if (counter >= 0.5f) {
                        counter = (counter - 0.5f) * 2.0f;
                    } else {
                        counter = counter * 2.0f;
                    }
                } else if (haniwa_idx == 121 || /* mega plinkoid */
                           haniwa_idx == 122 || /* plinkoid */
                           haniwa_idx == 123    /* mini plinkoid */
                ) {
                    if (ftr_actor->dynamic_work_s[0] == 0) {
                        counter = counter * 0.5f;
                    } else {
                        counter = (counter * 0.5f) + 0.5f;
                    }
                }

                last_frame = (f32)hnw_cKF_ba_r_table[haniwa_idx]->frames;
                add_calc(&ftr_actor->dynamic_work_f[0], 0.0f, 0.5f, 1.0f, 0.1f);
                if (ftr_actor->dynamic_work_f[0] < 1.0f) {
                    ftr_actor->dynamic_work_f[0] = 0.0f;
                }

                cKF_SkeletonInfo_R_init(keyframe, keyframe->skeleton, hnw_cKF_ba_r_table[haniwa_idx], 1.0f, last_frame,
                                        counter * (last_frame - 1.0f) + 1.0f, 0.0f, ftr_actor->dynamic_work_f[0],
                                        cKF_FRAMECONTROL_STOP, NULL);
            } else if (counter == -2.0f) {
                cKF_SkeletonInfo_R_init(keyframe, keyframe->skeleton, &cKF_ba_r_int_hnw_off, 1.0f,
                                        cKF_ba_r_int_hnw_off.frames, 0.0f, 0.0f, 0.0f, cKF_FRAMECONTROL_STOP, NULL);
                ftr_actor->dynamic_work_f[0] = 4.0f;
            } else {
                last_frame = (f32)hnw_cKF_ba_r_table[haniwa_idx]->frames;

                cKF_SkeletonInfo_R_init(keyframe, keyframe->skeleton, hnw_cKF_ba_r_table[haniwa_idx], 1.0f, last_frame,
                                        0.0f, 0.0f, 2.0f, cKF_FRAMECONTROL_STOP, NULL);
                ftr_actor->dynamic_work_f[0] = 2.0f;
            }

            if (ftr_actor->switch_changed_flag && ftr_actor->switch_bit == FALSE) {
                sAdo_RhythmStop((u32)ftr_actor);
                ftr_actor->haniwa_state = aFTR_HNW_STATE_OFF;
                cKF_SkeletonInfo_R_init(keyframe, keyframe->skeleton, &cKF_ba_r_int_hnw_off, 1.0f,
                                        cKF_ba_r_int_hnw_off.frames, 0.0f, 0.0f, 10.0f, cKF_FRAMECONTROL_STOP, NULL);
            }
            break;
        }

        case aFTR_HNW_STATE_OFF: {
            if (ftr_actor->switch_changed_flag && ftr_actor->switch_bit == TRUE) {
                ftr_actor->haniwa_step = -1;
                ftr_actor->dynamic_work_f[0] = 10.0f;
                ftr_actor->haniwa_state = aFTR_HNW_STATE_TURN_ON;
            }
            break;
        }
    }

    cKF_SkeletonInfo_R_play(keyframe);
}

static void aHnwCommon_dw(FTR_ACTOR* ftr_actor, ACTOR* my_room_actor, GAME* game, u8* data) {
    cKF_SkeletonInfo_R_c* keyframe = &ftr_actor->keyframe;
    Mtx* mtx = ftr_actor->skeleton_mtx[game->frame_counter & 1];

    OPEN_DISP(game->graph);

    gSPMatrix(NEXT_POLY_OPA_DISP, _Matrix_to_Mtx_new(game->graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);

    CLOSE_DISP(game->graph);

    cKF_Si3_draw_R_SV(game, keyframe, mtx, NULL, NULL, NULL);
}

static void aHnwCommon_dt(FTR_ACTOR* ftr_actor, u8* data) {
    sAdo_RhythmStop((u32)ftr_actor);
}

static void aHnwCommon_dma(mActor_name_t ftr_name, u8* data) {
    // nothing
}

static aFTR_vtable_c aHnwCommon_func = {
    &aHnwCommon_ct, &aHnwCommon_mv, &aHnwCommon_dw, &aHnwCommon_dt, &aHnwCommon_dma,
};

aFTR_PROFILE iam_hnw_common = {
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    27.0f,
    0.01f,
    aFTR_SHAPE_TYPEA,
    mCoBG_FTR_TYPEA,
    0,
    0,
    0,
    aFTR_INTERACTION_HANIWA,
    &aHnwCommon_func,
};
