def METHOD_NAME(stitch_dir, stitch_cfg_file, btg_profile, tpm):
    output_dir  = os.path.join(stitch_dir, "Temp")
    sbl_file    = os.path.join (output_dir, 'SlimBootloader.bin')
    out_file    = os.path.join(output_dir, "BiosRegion.bin")
    bpm_gen2dir = os.path.join (stitch_dir, 'BpmGen2')
    bmpgen_params = os.path.join(output_dir, "bpmgen2.params")
    bpm_key_dir = os.path.join (bpm_gen2dir, 'keys')
    key_size    = '3072'
    hash_type   = 'sha384'
    key_manifest_hash_file = os.path.join(output_dir, "kmsigpubkey.hash")
    print ("Generating BPM GEN2 params file")
    gen_bpmgen2_params(stitch_cfg_file, os.path.join(bpm_gen2dir, "bpmgen2.params"), os.path.join(output_dir, "bpmgen2.params"))
    print("Sign partitions....")
    sign_slimboot_binary(sbl_file, bpm_gen2dir, bmpgen_params, bpm_key_dir, key_size, hash_type, out_file, output_dir, key_manifest_hash_file)
    # Generate OemKeyManifest bin if not available in inputs
    print("Generate Oem Key Manifest....")
    if os.name == 'nt':
        meu_path = os.path.join (stitch_dir, 'Meu', 'meu.exe')
    else:
        meu_path = os.path.join (stitch_dir, 'Meu', 'meu')
    oem_bin_input  = os.path.join (stitch_dir, 'Input', 'OemExtInputFile.bin')
    oem_bin_output = os.path.join (stitch_dir, 'Temp', 'OemExtInputFile.bin')
    gen_sign_oem_key_manifest(meu_path, oem_bin_input, bpm_key_dir, key_size, output_dir, oem_bin_output)
    # Update xml for Btg
    updated_xml_file = os.path.join (stitch_dir, 'Temp', 'updated.xml')
    tree = ET.parse(updated_xml_file)
    update_btGuard_xml(btg_profile, stitch_dir, tree)
    update_tpm_type(tpm, tree)
    tree.write(updated_xml_file)