// This file was created by the AIR team.

use crate::components::prelude::*;
use crate::components::subroutines::linear_combination_n_1_coefs_2::LinearCombinationN1Coefs2;
use crate::components::subroutines::linear_combination_n_6_coefs_4_2_3_1_m1_1::LinearCombinationN6Coefs4231M11;

#[derive(Copy, Clone, Serialize, Deserialize, CairoSerialize)]
pub struct PoseidonPartialRound {}

impl PoseidonPartialRound {
    #[allow(unused_parens)]
    #[allow(clippy::double_parens)]
    #[allow(non_snake_case)]
    #[allow(clippy::unused_unit)]
    #[allow(unused_variables)]
    #[allow(clippy::too_many_arguments)]
    pub fn evaluate<E: EvalAtRow>(
        [poseidon_partial_round_input_z0_3_limb_0, poseidon_partial_round_input_z0_3_limb_1, poseidon_partial_round_input_z0_3_limb_2, poseidon_partial_round_input_z0_3_limb_3, poseidon_partial_round_input_z0_3_limb_4, poseidon_partial_round_input_z0_3_limb_5, poseidon_partial_round_input_z0_3_limb_6, poseidon_partial_round_input_z0_3_limb_7, poseidon_partial_round_input_z0_3_limb_8, poseidon_partial_round_input_z0_3_limb_9, poseidon_partial_round_input_z1_limb_0, poseidon_partial_round_input_z1_limb_1, poseidon_partial_round_input_z1_limb_2, poseidon_partial_round_input_z1_limb_3, poseidon_partial_round_input_z1_limb_4, poseidon_partial_round_input_z1_limb_5, poseidon_partial_round_input_z1_limb_6, poseidon_partial_round_input_z1_limb_7, poseidon_partial_round_input_z1_limb_8, poseidon_partial_round_input_z1_limb_9, poseidon_partial_round_input_z1_3_limb_0, poseidon_partial_round_input_z1_3_limb_1, poseidon_partial_round_input_z1_3_limb_2, poseidon_partial_round_input_z1_3_limb_3, poseidon_partial_round_input_z1_3_limb_4, poseidon_partial_round_input_z1_3_limb_5, poseidon_partial_round_input_z1_3_limb_6, poseidon_partial_round_input_z1_3_limb_7, poseidon_partial_round_input_z1_3_limb_8, poseidon_partial_round_input_z1_3_limb_9, poseidon_partial_round_input_z2_limb_0, poseidon_partial_round_input_z2_limb_1, poseidon_partial_round_input_z2_limb_2, poseidon_partial_round_input_z2_limb_3, poseidon_partial_round_input_z2_limb_4, poseidon_partial_round_input_z2_limb_5, poseidon_partial_round_input_z2_limb_6, poseidon_partial_round_input_z2_limb_7, poseidon_partial_round_input_z2_limb_8, poseidon_partial_round_input_z2_limb_9, poseidon_partial_round_input_half_key_limb_0, poseidon_partial_round_input_half_key_limb_1, poseidon_partial_round_input_half_key_limb_2, poseidon_partial_round_input_half_key_limb_3, poseidon_partial_round_input_half_key_limb_4, poseidon_partial_round_input_half_key_limb_5, poseidon_partial_round_input_half_key_limb_6, poseidon_partial_round_input_half_key_limb_7, poseidon_partial_round_input_half_key_limb_8, poseidon_partial_round_input_half_key_limb_9]: [E::F; 50],
        cube_252_output_limb_0_col0: E::F,
        cube_252_output_limb_1_col1: E::F,
        cube_252_output_limb_2_col2: E::F,
        cube_252_output_limb_3_col3: E::F,
        cube_252_output_limb_4_col4: E::F,
        cube_252_output_limb_5_col5: E::F,
        cube_252_output_limb_6_col6: E::F,
        cube_252_output_limb_7_col7: E::F,
        cube_252_output_limb_8_col8: E::F,
        cube_252_output_limb_9_col9: E::F,
        combination_limb_0_col10: E::F,
        combination_limb_1_col11: E::F,
        combination_limb_2_col12: E::F,
        combination_limb_3_col13: E::F,
        combination_limb_4_col14: E::F,
        combination_limb_5_col15: E::F,
        combination_limb_6_col16: E::F,
        combination_limb_7_col17: E::F,
        combination_limb_8_col18: E::F,
        combination_limb_9_col19: E::F,
        p_coef_col20: E::F,
        combination_limb_0_col21: E::F,
        combination_limb_1_col22: E::F,
        combination_limb_2_col23: E::F,
        combination_limb_3_col24: E::F,
        combination_limb_4_col25: E::F,
        combination_limb_5_col26: E::F,
        combination_limb_6_col27: E::F,
        combination_limb_7_col28: E::F,
        combination_limb_8_col29: E::F,
        combination_limb_9_col30: E::F,
        p_coef_col31: E::F,
        common_lookup_elements: &relations::CommonLookupElements,
        eval: &mut E,
    ) -> [E::F; 0] {
        let M31_1 = E::F::from(M31::from(1));
        let M31_1090315331 = E::F::from(M31::from(1090315331));
        let M31_1987997202 = E::F::from(M31::from(1987997202));

        eval.add_to_relation(RelationEntry::new(
            common_lookup_elements,
            E::EF::from(M31_1.clone()),
            &[
                M31_1987997202.clone(),
                poseidon_partial_round_input_z2_limb_0.clone(),
                poseidon_partial_round_input_z2_limb_1.clone(),
                poseidon_partial_round_input_z2_limb_2.clone(),
                poseidon_partial_round_input_z2_limb_3.clone(),
                poseidon_partial_round_input_z2_limb_4.clone(),
                poseidon_partial_round_input_z2_limb_5.clone(),
                poseidon_partial_round_input_z2_limb_6.clone(),
                poseidon_partial_round_input_z2_limb_7.clone(),
                poseidon_partial_round_input_z2_limb_8.clone(),
                poseidon_partial_round_input_z2_limb_9.clone(),
                cube_252_output_limb_0_col0.clone(),
                cube_252_output_limb_1_col1.clone(),
                cube_252_output_limb_2_col2.clone(),
                cube_252_output_limb_3_col3.clone(),
                cube_252_output_limb_4_col4.clone(),
                cube_252_output_limb_5_col5.clone(),
                cube_252_output_limb_6_col6.clone(),
                cube_252_output_limb_7_col7.clone(),
                cube_252_output_limb_8_col8.clone(),
                cube_252_output_limb_9_col9.clone(),
            ],
        ));

        LinearCombinationN6Coefs4231M11::evaluate(
            [
                poseidon_partial_round_input_z0_3_limb_0.clone(),
                poseidon_partial_round_input_z0_3_limb_1.clone(),
                poseidon_partial_round_input_z0_3_limb_2.clone(),
                poseidon_partial_round_input_z0_3_limb_3.clone(),
                poseidon_partial_round_input_z0_3_limb_4.clone(),
                poseidon_partial_round_input_z0_3_limb_5.clone(),
                poseidon_partial_round_input_z0_3_limb_6.clone(),
                poseidon_partial_round_input_z0_3_limb_7.clone(),
                poseidon_partial_round_input_z0_3_limb_8.clone(),
                poseidon_partial_round_input_z0_3_limb_9.clone(),
                poseidon_partial_round_input_z1_limb_0.clone(),
                poseidon_partial_round_input_z1_limb_1.clone(),
                poseidon_partial_round_input_z1_limb_2.clone(),
                poseidon_partial_round_input_z1_limb_3.clone(),
                poseidon_partial_round_input_z1_limb_4.clone(),
                poseidon_partial_round_input_z1_limb_5.clone(),
                poseidon_partial_round_input_z1_limb_6.clone(),
                poseidon_partial_round_input_z1_limb_7.clone(),
                poseidon_partial_round_input_z1_limb_8.clone(),
                poseidon_partial_round_input_z1_limb_9.clone(),
                poseidon_partial_round_input_z1_3_limb_0.clone(),
                poseidon_partial_round_input_z1_3_limb_1.clone(),
                poseidon_partial_round_input_z1_3_limb_2.clone(),
                poseidon_partial_round_input_z1_3_limb_3.clone(),
                poseidon_partial_round_input_z1_3_limb_4.clone(),
                poseidon_partial_round_input_z1_3_limb_5.clone(),
                poseidon_partial_round_input_z1_3_limb_6.clone(),
                poseidon_partial_round_input_z1_3_limb_7.clone(),
                poseidon_partial_round_input_z1_3_limb_8.clone(),
                poseidon_partial_round_input_z1_3_limb_9.clone(),
                poseidon_partial_round_input_z2_limb_0.clone(),
                poseidon_partial_round_input_z2_limb_1.clone(),
                poseidon_partial_round_input_z2_limb_2.clone(),
                poseidon_partial_round_input_z2_limb_3.clone(),
                poseidon_partial_round_input_z2_limb_4.clone(),
                poseidon_partial_round_input_z2_limb_5.clone(),
                poseidon_partial_round_input_z2_limb_6.clone(),
                poseidon_partial_round_input_z2_limb_7.clone(),
                poseidon_partial_round_input_z2_limb_8.clone(),
                poseidon_partial_round_input_z2_limb_9.clone(),
                cube_252_output_limb_0_col0.clone(),
                cube_252_output_limb_1_col1.clone(),
                cube_252_output_limb_2_col2.clone(),
                cube_252_output_limb_3_col3.clone(),
                cube_252_output_limb_4_col4.clone(),
                cube_252_output_limb_5_col5.clone(),
                cube_252_output_limb_6_col6.clone(),
                cube_252_output_limb_7_col7.clone(),
                cube_252_output_limb_8_col8.clone(),
                cube_252_output_limb_9_col9.clone(),
                poseidon_partial_round_input_half_key_limb_0.clone(),
                poseidon_partial_round_input_half_key_limb_1.clone(),
                poseidon_partial_round_input_half_key_limb_2.clone(),
                poseidon_partial_round_input_half_key_limb_3.clone(),
                poseidon_partial_round_input_half_key_limb_4.clone(),
                poseidon_partial_round_input_half_key_limb_5.clone(),
                poseidon_partial_round_input_half_key_limb_6.clone(),
                poseidon_partial_round_input_half_key_limb_7.clone(),
                poseidon_partial_round_input_half_key_limb_8.clone(),
                poseidon_partial_round_input_half_key_limb_9.clone(),
            ],
            combination_limb_0_col10.clone(),
            combination_limb_1_col11.clone(),
            combination_limb_2_col12.clone(),
            combination_limb_3_col13.clone(),
            combination_limb_4_col14.clone(),
            combination_limb_5_col15.clone(),
            combination_limb_6_col16.clone(),
            combination_limb_7_col17.clone(),
            combination_limb_8_col18.clone(),
            combination_limb_9_col19.clone(),
            p_coef_col20.clone(),
            common_lookup_elements,
            eval,
        );
        eval.add_to_relation(RelationEntry::new(
            common_lookup_elements,
            E::EF::from(M31_1.clone()),
            &[
                M31_1090315331.clone(),
                combination_limb_0_col10.clone(),
                combination_limb_1_col11.clone(),
                combination_limb_2_col12.clone(),
                combination_limb_3_col13.clone(),
                combination_limb_4_col14.clone(),
                combination_limb_5_col15.clone(),
                combination_limb_6_col16.clone(),
                combination_limb_7_col17.clone(),
                combination_limb_8_col18.clone(),
                combination_limb_9_col19.clone(),
            ],
        ));

        LinearCombinationN1Coefs2::evaluate(
            [
                combination_limb_0_col10.clone(),
                combination_limb_1_col11.clone(),
                combination_limb_2_col12.clone(),
                combination_limb_3_col13.clone(),
                combination_limb_4_col14.clone(),
                combination_limb_5_col15.clone(),
                combination_limb_6_col16.clone(),
                combination_limb_7_col17.clone(),
                combination_limb_8_col18.clone(),
                combination_limb_9_col19.clone(),
            ],
            combination_limb_0_col21.clone(),
            combination_limb_1_col22.clone(),
            combination_limb_2_col23.clone(),
            combination_limb_3_col24.clone(),
            combination_limb_4_col25.clone(),
            combination_limb_5_col26.clone(),
            combination_limb_6_col27.clone(),
            combination_limb_7_col28.clone(),
            combination_limb_8_col29.clone(),
            combination_limb_9_col30.clone(),
            p_coef_col31.clone(),
            common_lookup_elements,
            eval,
        );
        []
    }
}
