id
int64
0
79.7k
docstring_tokens
sequence
code_tokens
sequence
fun_name
stringlengths
1
108
repo
stringlengths
7
49
starting
stringclasses
3 values
partition
stringclasses
3 values
__index_level_0__
int64
0
58.8k
1,014
[ "Configures", "the", "TIMx's", "DMA", "interface" ]
[ "'void", "TIM_DMAConfig", "(", "TIM_TypeDef", "*", "TIMx", ",", "uint16_t", "TIM_DMABase", ",", "uint16_t", "TIM_DMABurstLength", ")", "{", "/*", "Check", "the", "parameters", "*/", "assert_param", "(", "IS_TIM_LIST1_PERIPH", "(", "TIMx", ")", ")", ";", "assert_param", "(", "IS_TIM_DMA_BASE", "(", "TIM_DMABase", ")", ")", ";", "assert_param", "(", "IS_TIM_DMA_LENGTH", "(", "TIM_DMABurstLength", ")", ")", ";", "/*", "Set", "the", "DMA", "Base", "and", "the", "DMA", "Burst", "Length", "*/", "TIMx", "->", "DCR", "=", "TIM_DMABase", "|", "TIM_DMABurstLength", ";", "}'" ]
TIM_DMAConfig
librepilot/LibrePilot
multi_line
train
800
1,015
[ "Configures", "the", "Break1", "feature" ]
[ "'void", "TIM_Break1Config", "(", "TIM_TypeDef", "*", "TIMx", ",", "uint32_t", "TIM_Break1Polarity", ",", "uint8_t", "TIM_Break1Filter", ")", "{", "/*", "Check", "the", "parameters", "*/", "assert_param", "(", "IS_TIM_LIST4_PERIPH", "(", "TIMx", ")", ")", ";", "assert_param", "(", "IS_TIM_BREAK1_FILTER", "(", "TIM_Break1Filter", ")", ")", ";", "/*", "Reset", "the", "BKP", "and", "BKF", "Bits", "*/", "TIMx", "->", "BDTR", "&=", "(", "uint32_t", ")", "~", "(", "TIM_BDTR_BKP", "|", "TIM_BDTR_BKF", ")", ";", "/*", "Configure", "the", "Break1", "polarity", "and", "filter", "*/", "TIMx", "->", "BDTR", "|=", "TIM_Break1Polarity", "|", "(", "(", "uint32_t", ")", "TIM_Break1Filter", "<<", "16", ")", ";", "}'" ]
TIM_Break1Config
librepilot/LibrePilot
multi_line
train
801
1,016
[ "Initializes", "the", "TIMx", "Channel3", "according", "to", "the", "specified", "parameters" ]
[ "'void", "TIM_OC3Init", "(", "TIM_TypeDef", "*", "TIMx", ",", "TIM_OCInitTypeDef", "*", "TIM_OCInitStruct", ")", "{", "uint32_t", "tmpccmrx", "=", "0", ",", "<type", "ref=\"prev\"/>", "tmpccer", "=", "0", ",", "<type", "ref=\"prev\"/>", "tmpcr2", "=", "0", ";", "/*", "Check", "the", "parameters", "*/", "assert_param", "(", "IS_TIM_LIST3_PERIPH", "(", "TIMx", ")", ")", ";", "assert_param", "(", "IS_TIM_OC_MODE", "(", "TIM_OCInitStruct", "->", "TIM_OCMode", ")", ")", ";", "assert_param", "(", "IS_TIM_OUTPUT_STATE", "(", "TIM_OCInitStruct", "->", "TIM_OutputState", ")", ")", ";", "assert_param", "(", "IS_TIM_OC_POLARITY", "(", "TIM_OCInitStruct", "->", "TIM_OCPolarity", ")", ")", ";", "/*", "Disable", "the", "Channel", "3:", "Reset", "the", "CC2E", "Bit", "*/", "TIMx", "->", "CCER", "&=", "(", "uint32_t", ")", "~", "TIM_CCER_CC3E", ";", "/*", "Get", "the", "TIMx", "CCER", "register", "value", "*/", "tmpccer", "=", "TIMx", "->", "CCER", ";", "/*", "Get", "the", "TIMx", "CR2", "register", "value", "*/", "tmpcr2", "=", "TIMx", "->", "CR2", ";", "/*", "Get", "the", "TIMx", "CCMR2", "register", "value", "*/", "tmpccmrx", "=", "TIMx", "->", "CCMR2", ";", "/*", "Reset", "the", "Output", "Compare", "mode", "and", "Capture/Compare", "selection", "Bits", "*/", "tmpccmrx", "&=", "(", "uint32_t", ")", "~", "TIM_CCMR2_OC3M", ";", "tmpccmrx", "&=", "(", "uint32_t", ")", "~", "TIM_CCMR2_CC3S", ";", "/*", "Select", "the", "Output", "Compare", "Mode", "*/", "tmpccmrx", "|=", "TIM_OCInitStruct", "->", "TIM_OCMode", ";", "/*", "Reset", "the", "Output", "Polarity", "level", "*/", "tmpccer", "&=", "(", "uint32_t", ")", "~", "TIM_CCER_CC3P", ";", "/*", "Set", "the", "Output", "Compare", "Polarity", "*/", "tmpccer", "|=", "(", "uint32_t", ")", "(", "(", "uint32_t", ")", "TIM_OCInitStruct", "->", "TIM_OCPolarity", "<<", "8", ")", ";", "/*", "Set", "the", "Output", "State", "*/", "tmpccer", "|=", "(", "uint32_t", ")", "(", "(", "uint32_t", ")", "TIM_OCInitStruct", "->", "TIM_OutputState", "<<", "8", ")", ";", "if", "(", "(", "TIMx", "==", "TIM1", ")", "||", "(", "TIMx", "==", "TIM8", ")", ")", "{", "assert_param", "(", "IS_TIM_OUTPUTN_STATE", "(", "TIM_OCInitStruct", "->", "TIM_OutputNState", ")", ")", ";", "assert_param", "(", "IS_TIM_OCN_POLARITY", "(", "TIM_OCInitStruct", "->", "TIM_OCNPolarity", ")", ")", ";", "assert_param", "(", "IS_TIM_OCNIDLE_STATE", "(", "TIM_OCInitStruct", "->", "TIM_OCNIdleState", ")", ")", ";", "assert_param", "(", "IS_TIM_OCIDLE_STATE", "(", "TIM_OCInitStruct", "->", "TIM_OCIdleState", ")", ")", ";", "/*", "Reset", "the", "Output", "N", "Polarity", "level", "*/", "tmpccer", "&=", "(", "uint32_t", ")", "~", "TIM_CCER_CC3NP", ";", "/*", "Set", "the", "Output", "N", "Polarity", "*/", "tmpccer", "|=", "(", "uint32_t", ")", "(", "(", "uint32_t", ")", "TIM_OCInitStruct", "->", "TIM_OCNPolarity", "<<", "8", ")", ";", "/*", "Reset", "the", "Output", "N", "State", "*/", "tmpccer", "&=", "(", "uint32_t", ")", "~", "TIM_CCER_CC3NE", ";", "/*", "Set", "the", "Output", "N", "State", "*/", "tmpccer", "|=", "(", "uint32_t", ")", "(", "(", "uint32_t", ")", "TIM_OCInitStruct", "->", "TIM_OutputNState", "<<", "8", ")", ";", "/*", "Reset", "the", "Output", "Compare", "and", "Output", "Compare", "N", "IDLE", "State", "*/", "tmpcr2", "&=", "(", "uint32_t", ")", "~", "TIM_CR2_OIS3", ";", "tmpcr2", "&=", "(", "uint32_t", ")", "~", "TIM_CR2_OIS3N", ";", "/*", "Set", "the", "Output", "Idle", "state", "*/", "tmpcr2", "|=", "(", "uint32_t", ")", "(", "(", "uint32_t", ")", "TIM_OCInitStruct", "->", "TIM_OCIdleState", "<<", "4", ")", ";", "/*", "Set", "the", "Output", "N", "Idle", "state", "*/", "tmpcr2", "|=", "(", "uint32_t", ")", "(", "(", "uint32_t", ")", "TIM_OCInitStruct", "->", "TIM_OCNIdleState", "<<", "4", ")", ";", "}", "/*", "Write", "to", "TIMx", "CR2", "*/", "TIMx", "->", "CR2", "=", "tmpcr2", ";", "/*", "Write", "to", "TIMx", "CCMR2", "*/", "TIMx", "->", "CCMR2", "=", "tmpccmrx", ";", "/*", "Set", "the", "Capture", "Compare", "Register", "value", "*/", "TIMx", "->", "CCR3", "=", "TIM_OCInitStruct", "->", "TIM_Pulse", ";", "/*", "Write", "to", "TIMx", "CCER", "*/", "TIMx", "->", "CCER", "=", "tmpccer", ";", "}'" ]
TIM_OC3Init
librepilot/LibrePilot
multi_line
train
802
1,017
[ "Forces", "the", "TIMx", "output", "5", "waveform", "to", "active", "or", "inactive", "level" ]
[ "'void", "TIM_ForcedOC5Config", "(", "TIM_TypeDef", "*", "TIMx", ",", "uint16_t", "TIM_ForcedAction", ")", "{", "uint32_t", "tmpccmr3", "=", "0", ";", "/*", "Check", "the", "parameters", "*/", "assert_param", "(", "IS_TIM_LIST4_PERIPH", "(", "TIMx", ")", ")", ";", "assert_param", "(", "IS_TIM_FORCED_ACTION", "(", "TIM_ForcedAction", ")", ")", ";", "tmpccmr3", "=", "TIMx", "->", "CCMR3", ";", "/*", "Reset", "the", "OC5M", "Bits", "*/", "tmpccmr3", "&=", "(", "uint32_t", ")", "~", "TIM_CCMR3_OC5M", ";", "/*", "Configure", "The", "Forced", "output", "Mode", "*/", "tmpccmr3", "|=", "(", "uint32_t", ")", "(", "TIM_ForcedAction", ")", ";", "/*", "Write", "to", "TIMx", "CCMR3", "register", "*/", "TIMx", "->", "CCMR3", "=", "tmpccmr3", ";", "}'" ]
TIM_ForcedOC5Config
librepilot/LibrePilot
multi_line
train
803
1,018
[ "Initializes", "the", "TIMx", "Channel4", "according", "to", "the", "specified", "parameters" ]
[ "'void", "TIM_OC4Init", "(", "TIM_TypeDef", "*", "TIMx", ",", "TIM_OCInitTypeDef", "*", "TIM_OCInitStruct", ")", "{", "uint32_t", "tmpccmrx", "=", "0", ",", "<type", "ref=\"prev\"/>", "tmpccer", "=", "0", ",", "<type", "ref=\"prev\"/>", "tmpcr2", "=", "0", ";", "/*", "Check", "the", "parameters", "*/", "assert_param", "(", "IS_TIM_LIST3_PERIPH", "(", "TIMx", ")", ")", ";", "assert_param", "(", "IS_TIM_OC_MODE", "(", "TIM_OCInitStruct", "->", "TIM_OCMode", ")", ")", ";", "assert_param", "(", "IS_TIM_OUTPUT_STATE", "(", "TIM_OCInitStruct", "->", "TIM_OutputState", ")", ")", ";", "assert_param", "(", "IS_TIM_OC_POLARITY", "(", "TIM_OCInitStruct", "->", "TIM_OCPolarity", ")", ")", ";", "/*", "Disable", "the", "Channel", "4:", "Reset", "the", "CC4E", "Bit", "*/", "TIMx", "->", "CCER", "&=", "(", "uint32_t", ")", "~", "TIM_CCER_CC4E", ";", "/*", "Get", "the", "TIMx", "CCER", "register", "value", "*/", "tmpccer", "=", "TIMx", "->", "CCER", ";", "/*", "Get", "the", "TIMx", "CR2", "register", "value", "*/", "tmpcr2", "=", "TIMx", "->", "CR2", ";", "/*", "Get", "the", "TIMx", "CCMR2", "register", "value", "*/", "tmpccmrx", "=", "TIMx", "->", "CCMR2", ";", "/*", "Reset", "the", "Output", "Compare", "mode", "and", "Capture/Compare", "selection", "Bits", "*/", "tmpccmrx", "&=", "(", "uint32_t", ")", "~", "TIM_CCMR2_OC4M", ";", "tmpccmrx", "&=", "(", "uint32_t", ")", "~", "TIM_CCMR2_CC4S", ";", "/*", "Select", "the", "Output", "Compare", "Mode", "*/", "tmpccmrx", "|=", "(", "uint32_t", ")", "(", "TIM_OCInitStruct", "->", "TIM_OCMode", "<<", "8", ")", ";", "/*", "Reset", "the", "Output", "Polarity", "level", "*/", "tmpccer", "&=", "(", "uint32_t", ")", "~", "TIM_CCER_CC4P", ";", "/*", "Set", "the", "Output", "Compare", "Polarity", "*/", "tmpccer", "|=", "(", "uint32_t", ")", "(", "(", "uint32_t", ")", "TIM_OCInitStruct", "->", "TIM_OCPolarity", "<<", "12", ")", ";", "/*", "Set", "the", "Output", "State", "*/", "tmpccer", "|=", "(", "uint32_t", ")", "(", "(", "uint32_t", ")", "TIM_OCInitStruct", "->", "TIM_OutputState", "<<", "12", ")", ";", "if", "(", "(", "TIMx", "==", "TIM1", ")", "||", "(", "TIMx", "==", "TIM8", ")", ")", "{", "assert_param", "(", "IS_TIM_OCIDLE_STATE", "(", "TIM_OCInitStruct", "->", "TIM_OCIdleState", ")", ")", ";", "/*", "Reset", "the", "Output", "Compare", "IDLE", "State", "*/", "tmpcr2", "&=", "(", "uint32_t", ")", "~", "TIM_CR2_OIS4", ";", "/*", "Set", "the", "Output", "Idle", "state", "*/", "tmpcr2", "|=", "(", "uint32_t", ")", "(", "(", "uint32_t", ")", "TIM_OCInitStruct", "->", "TIM_OCIdleState", "<<", "6", ")", ";", "}", "/*", "Write", "to", "TIMx", "CR2", "*/", "TIMx", "->", "CR2", "=", "tmpcr2", ";", "/*", "Write", "to", "TIMx", "CCMR2", "*/", "TIMx", "->", "CCMR2", "=", "tmpccmrx", ";", "/*", "Set", "the", "Capture", "Compare", "Register", "value", "*/", "TIMx", "->", "CCR4", "=", "TIM_OCInitStruct", "->", "TIM_Pulse", ";", "/*", "Write", "to", "TIMx", "CCER", "*/", "TIMx", "->", "CCER", "=", "tmpccer", ";", "}'" ]
TIM_OC4Init
librepilot/LibrePilot
multi_line
train
804
1,019
[ "Fills", "each", "TIM_OCInitStruct", "member", "with", "its", "default", "value" ]
[ "'void", "TIM_OCStructInit", "(", "TIM_OCInitTypeDef", "*", "TIM_OCInitStruct", ")", "{", "/*", "Set", "the", "default", "configuration", "*/", "TIM_OCInitStruct", "->", "TIM_OCMode", "=", "TIM_OCMode_Timing", ";", "TIM_OCInitStruct", "->", "TIM_OutputState", "=", "TIM_OutputState_Disable", ";", "TIM_OCInitStruct", "->", "TIM_OutputNState", "=", "TIM_OutputNState_Disable", ";", "TIM_OCInitStruct", "->", "TIM_Pulse", "=", "0x00000000", ";", "TIM_OCInitStruct", "->", "TIM_OCPolarity", "=", "TIM_OCPolarity_High", ";", "TIM_OCInitStruct", "->", "TIM_OCNPolarity", "=", "TIM_OCPolarity_High", ";", "TIM_OCInitStruct", "->", "TIM_OCIdleState", "=", "TIM_OCIdleState_Reset", ";", "TIM_OCInitStruct", "->", "TIM_OCNIdleState", "=", "TIM_OCNIdleState_Reset", ";", "}'" ]
TIM_OCStructInit
librepilot/LibrePilot
multi_line
train
805
1,020
[ "Initializes", "the", "TIMx", "Channel2", "according", "to", "the", "specified", "parameters" ]
[ "'void", "TIM_OC2Init", "(", "TIM_TypeDef", "*", "TIMx", ",", "TIM_OCInitTypeDef", "*", "TIM_OCInitStruct", ")", "{", "uint32_t", "tmpccmrx", "=", "0", ",", "<type", "ref=\"prev\"/>", "tmpccer", "=", "0", ",", "<type", "ref=\"prev\"/>", "tmpcr2", "=", "0", ";", "/*", "Check", "the", "parameters", "*/", "assert_param", "(", "IS_TIM_LIST2_PERIPH", "(", "TIMx", ")", ")", ";", "assert_param", "(", "IS_TIM_OC_MODE", "(", "TIM_OCInitStruct", "->", "TIM_OCMode", ")", ")", ";", "assert_param", "(", "IS_TIM_OUTPUT_STATE", "(", "TIM_OCInitStruct", "->", "TIM_OutputState", ")", ")", ";", "assert_param", "(", "IS_TIM_OC_POLARITY", "(", "TIM_OCInitStruct", "->", "TIM_OCPolarity", ")", ")", ";", "/*", "Disable", "the", "Channel", "2:", "Reset", "the", "CC2E", "Bit", "*/", "TIMx", "->", "CCER", "&=", "(", "uint32_t", ")", "~", "TIM_CCER_CC2E", ";", "/*", "Get", "the", "TIMx", "CCER", "register", "value", "*/", "tmpccer", "=", "TIMx", "->", "CCER", ";", "/*", "Get", "the", "TIMx", "CR2", "register", "value", "*/", "tmpcr2", "=", "TIMx", "->", "CR2", ";", "/*", "Get", "the", "TIMx", "CCMR1", "register", "value", "*/", "tmpccmrx", "=", "TIMx", "->", "CCMR1", ";", "/*", "Reset", "the", "Output", "Compare", "mode", "and", "Capture/Compare", "selection", "Bits", "*/", "tmpccmrx", "&=", "(", "uint32_t", ")", "~", "TIM_CCMR1_OC2M", ";", "tmpccmrx", "&=", "(", "uint32_t", ")", "~", "TIM_CCMR1_CC2S", ";", "/*", "Select", "the", "Output", "Compare", "Mode", "*/", "tmpccmrx", "|=", "(", "uint32_t", ")", "(", "TIM_OCInitStruct", "->", "TIM_OCMode", "<<", "8", ")", ";", "/*", "Reset", "the", "Output", "Polarity", "level", "*/", "tmpccer", "&=", "(", "uint32_t", ")", "~", "TIM_CCER_CC2P", ";", "/*", "Set", "the", "Output", "Compare", "Polarity", "*/", "tmpccer", "|=", "(", "uint32_t", ")", "(", "(", "uint32_t", ")", "TIM_OCInitStruct", "->", "TIM_OCPolarity", "<<", "4", ")", ";", "/*", "Set", "the", "Output", "State", "*/", "tmpccer", "|=", "(", "uint32_t", ")", "(", "(", "uint32_t", ")", "TIM_OCInitStruct", "->", "TIM_OutputState", "<<", "4", ")", ";", "if", "(", "(", "TIMx", "==", "TIM1", ")", "||", "(", "TIMx", "==", "TIM8", ")", ")", "{", "assert_param", "(", "IS_TIM_OUTPUTN_STATE", "(", "TIM_OCInitStruct", "->", "TIM_OutputNState", ")", ")", ";", "assert_param", "(", "IS_TIM_OCN_POLARITY", "(", "TIM_OCInitStruct", "->", "TIM_OCNPolarity", ")", ")", ";", "assert_param", "(", "IS_TIM_OCNIDLE_STATE", "(", "TIM_OCInitStruct", "->", "TIM_OCNIdleState", ")", ")", ";", "assert_param", "(", "IS_TIM_OCIDLE_STATE", "(", "TIM_OCInitStruct", "->", "TIM_OCIdleState", ")", ")", ";", "/*", "Reset", "the", "Output", "N", "Polarity", "level", "*/", "tmpccer", "&=", "(", "uint32_t", ")", "~", "TIM_CCER_CC2NP", ";", "/*", "Set", "the", "Output", "N", "Polarity", "*/", "tmpccer", "|=", "(", "uint32_t", ")", "(", "(", "uint32_t", ")", "TIM_OCInitStruct", "->", "TIM_OCNPolarity", "<<", "4", ")", ";", "/*", "Reset", "the", "Output", "N", "State", "*/", "tmpccer", "&=", "(", "uint32_t", ")", "~", "TIM_CCER_CC2NE", ";", "/*", "Set", "the", "Output", "N", "State", "*/", "tmpccer", "|=", "(", "uint32_t", ")", "(", "(", "uint32_t", ")", "TIM_OCInitStruct", "->", "TIM_OutputNState", "<<", "4", ")", ";", "/*", "Reset", "the", "Output", "Compare", "and", "Output", "Compare", "N", "IDLE", "State", "*/", "tmpcr2", "&=", "(", "uint32_t", ")", "~", "TIM_CR2_OIS2", ";", "tmpcr2", "&=", "(", "uint32_t", ")", "~", "TIM_CR2_OIS2N", ";", "/*", "Set", "the", "Output", "Idle", "state", "*/", "tmpcr2", "|=", "(", "uint32_t", ")", "(", "(", "uint32_t", ")", "TIM_OCInitStruct", "->", "TIM_OCIdleState", "<<", "2", ")", ";", "/*", "Set", "the", "Output", "N", "Idle", "state", "*/", "tmpcr2", "|=", "(", "uint32_t", ")", "(", "(", "uint32_t", ")", "TIM_OCInitStruct", "->", "TIM_OCNIdleState", "<<", "2", ")", ";", "}", "/*", "Write", "to", "TIMx", "CR2", "*/", "TIMx", "->", "CR2", "=", "tmpcr2", ";", "/*", "Write", "to", "TIMx", "CCMR1", "*/", "TIMx", "->", "CCMR1", "=", "tmpccmrx", ";", "/*", "Set", "the", "Capture", "Compare", "Register", "value", "*/", "TIMx", "->", "CCR2", "=", "TIM_OCInitStruct", "->", "TIM_Pulse", ";", "/*", "Write", "to", "TIMx", "CCER", "*/", "TIMx", "->", "CCER", "=", "tmpccer", ";", "}'" ]
TIM_OC2Init
librepilot/LibrePilot
multi_line
train
806
1,021
[ "Selects", "the", "TIM", "Group", "Channel", "5", "and", "Channel", "2," ]
[ "'void", "TIM_SelectGC5C2", "(", "TIM_TypeDef", "*", "TIMx", ",", "FunctionalState", "NewState", ")", "{", "/*", "Check", "the", "parameters", "*/", "assert_param", "(", "IS_TIM_LIST4_PERIPH", "(", "TIMx", ")", ")", ";", "assert_param", "(", "IS_FUNCTIONAL_STATE", "(", "NewState", ")", ")", ";", "if", "(", "NewState", "!=", "DISABLE", ")", "{", "/*", "Set", "the", "GC5C2", "Bit", "*/", "TIMx", "->", "CCR5", "|=", "TIM_CCR5_GC5C2", ";", "}", "else", "{", "/*", "Reset", "the", "GC5C2", "Bit", "*/", "TIMx", "->", "CCR5", "&=", "(", "uint32_t", ")", "~", "TIM_CCR5_GC5C2", ";", "}", "}'" ]
TIM_SelectGC5C2
librepilot/LibrePilot
multi_line
train
807
1,022
[ "Sets", "the", "TIMx", "Capture", "Compare6", "Register", "value" ]
[ "'void", "TIM_SetCompare6", "(", "TIM_TypeDef", "*", "TIMx", ",", "uint32_t", "Compare6", ")", "{", "/*", "Check", "the", "parameters", "*/", "assert_param", "(", "IS_TIM_LIST4_PERIPH", "(", "TIMx", ")", ")", ";", "/*", "Set", "the", "Capture", "Compare6", "Register", "value", "*/", "TIMx", "->", "CCR6", "=", "Compare6", ";", "}'" ]
TIM_SetCompare6
librepilot/LibrePilot
multi_line
train
808
1,023
[ "Specific", "remapping", "management", "function" ]
[ "'void", "TIM_RemapConfig", "(", "TIM_TypeDef", "*", "TIMx", ",", "uint16_t", "TIM_Remap", ")", "{", "/*", "Check", "the", "parameters", "*/", "assert_param", "(", "IS_TIM_LIST8_PERIPH", "(", "TIMx", ")", ")", ";", "assert_param", "(", "IS_TIM_REMAP", "(", "TIM_Remap", ")", ")", ";", "/*", "Set", "the", "Timer", "remapping", "configuration", "*/", "TIMx", "->", "OR", "=", "TIM_Remap", ";", "}'" ]
TIM_RemapConfig
librepilot/LibrePilot
multi_line
train
809
1,024
[ "Initializes", "the", "TIMx", "Channel6", "according", "to", "the", "specified", "parameters" ]
[ "'void", "TIM_OC6Init", "(", "TIM_TypeDef", "*", "TIMx", ",", "TIM_OCInitTypeDef", "*", "TIM_OCInitStruct", ")", "{", "uint32_t", "tmpccmrx", "=", "0", ",", "<type", "ref=\"prev\"/>", "tmpccer", "=", "0", ",", "<type", "ref=\"prev\"/>", "tmpcr2", "=", "0", ";", "/*", "Check", "the", "parameters", "*/", "assert_param", "(", "IS_TIM_LIST4_PERIPH", "(", "TIMx", ")", ")", ";", "assert_param", "(", "IS_TIM_OC_MODE", "(", "TIM_OCInitStruct", "->", "TIM_OCMode", ")", ")", ";", "assert_param", "(", "IS_TIM_OUTPUT_STATE", "(", "TIM_OCInitStruct", "->", "TIM_OutputState", ")", ")", ";", "assert_param", "(", "IS_TIM_OC_POLARITY", "(", "TIM_OCInitStruct", "->", "TIM_OCPolarity", ")", ")", ";", "/*", "Disable", "the", "Channel", "5:", "Reset", "the", "CC5E", "Bit", "*/", "TIMx", "->", "CCER", "&=", "(", "uint32_t", ")", "~", "TIM_CCER_CC6E", ";", "/*", "to", "be", "verified*/", "/*", "Get", "the", "TIMx", "CCER", "register", "value", "*/", "tmpccer", "=", "TIMx", "->", "CCER", ";", "/*", "Get", "the", "TIMx", "CR2", "register", "value", "*/", "tmpcr2", "=", "TIMx", "->", "CR2", ";", "/*", "Get", "the", "TIMx", "CCMR3", "register", "value", "*/", "tmpccmrx", "=", "TIMx", "->", "CCMR3", ";", "/*", "Reset", "the", "Output", "Compare", "mode", "and", "Capture/Compare", "selection", "Bits", "*/", "tmpccmrx", "&=", "(", "uint32_t", ")", "~", "TIM_CCMR3_OC6M", ";", "/*", "Select", "the", "Output", "Compare", "Mode", "*/", "tmpccmrx", "|=", "(", "uint32_t", ")", "(", "TIM_OCInitStruct", "->", "TIM_OCMode", "<<", "8", ")", ";", "/*", "Reset", "the", "Output", "Polarity", "level", "*/", "tmpccer", "&=", "(", "uint32_t", ")", "~", "TIM_CCER_CC6P", ";", "/*", "Set", "the", "Output", "Compare", "Polarity", "*/", "tmpccer", "|=", "(", "uint32_t", ")", "(", "(", "uint32_t", ")", "TIM_OCInitStruct", "->", "TIM_OCPolarity", "<<", "20", ")", ";", "/*", "Set", "the", "Output", "State", "*/", "tmpccer", "|=", "(", "uint32_t", ")", "(", "(", "uint32_t", ")", "TIM_OCInitStruct", "->", "TIM_OutputState", "<<", "20", ")", ";", "if", "(", "(", "TIMx", "==", "TIM1", ")", "||", "(", "TIMx", "==", "TIM8", ")", ")", "{", "assert_param", "(", "IS_TIM_OCIDLE_STATE", "(", "TIM_OCInitStruct", "->", "TIM_OCIdleState", ")", ")", ";", "/*", "Reset", "the", "Output", "Compare", "IDLE", "State", "*/", "tmpcr2", "&=", "(", "uint32_t", ")", "~", "TIM_CR2_OIS6", ";", "/*", "Set", "the", "Output", "Idle", "state", "*/", "tmpcr2", "|=", "(", "uint16_t", ")", "(", "TIM_OCInitStruct", "->", "TIM_OCIdleState", "<<", "18", ")", ";", "}", "/*", "Write", "to", "TIMx", "CR2", "*/", "TIMx", "->", "CR2", "=", "tmpcr2", ";", "/*", "Write", "to", "TIMx", "CCMR2", "*/", "TIMx", "->", "CCMR3", "=", "tmpccmrx", ";", "/*", "Set", "the", "Capture", "Compare", "Register", "value", "*/", "TIMx", "->", "CCR6", "=", "TIM_OCInitStruct", "->", "TIM_Pulse", ";", "/*", "Write", "to", "TIMx", "CCER", "*/", "TIMx", "->", "CCER", "=", "tmpccer", ";", "}'" ]
TIM_OC6Init
librepilot/LibrePilot
multi_line
train
810
1,025
[ "keeps", "track", "of", "both", "short", "and", "full", "digests", "on", "each", "region" ]
[ "'static", "void", "module_calculate_digest_helper", "(", "struct", "MD5Context", "*", "md5_full_cxt", "/*", "OPTIONAL", "*/", ",", "struct", "MD5Context", "*", "md5_short_cxt", "/*", "OPTIONAL", "*/", ",", "app_pc", "region_start", ",", "size_t", "region_len", ",", "app_pc", "start_header", ",", "size_t", "len_header", ",", "app_pc", "start_footer", ",", "size_t", "len_footer", ")", "{", "ASSERT", "(", "md5_full_cxt", "!=", "NULL", "||", "md5_short_cxt", "!=", "NULL", ")", ";", "LOG", "(", "GLOBAL", ",", "LOG_VMAREAS", ",", "2", ",", "\"\\\\t%s:", "segment", "\"", "PFX", "\"-\"", "PFX", "\"\\\"", ",", "__FUNCTION__", ",", "region_start", ",", "region_start", "+", "region_len", ")", ";", "if", "(", "md5_full_cxt", "!=", "NULL", ")", "d_r_md5_update", "(", "md5_full_cxt", ",", "region_start", ",", "region_len", ")", ";", "if", "(", "md5_short_cxt", "==", "NULL", ")", "return", ";", "if", "(", "len_header", "!=", "0", ")", "{", "region_intersection_MD5update", "(", "md5_short_cxt", ",", "region_start", ",", "region_len", ",", "start_header", ",", "len_header", ")", ";", "}", "if", "(", "len_footer", "!=", "0", ")", "{", "region_intersection_MD5update", "(", "md5_short_cxt", ",", "region_start", ",", "region_len", ",", "start_footer", ",", "len_footer", ")", ";", "}", "}'" ]
module_calculate_digest_helper
DynamoRIO/dynamorio
single_line
train
811
1,026
[ "Returns", "true", "if", "the", "region", "overlaps", "any", "module", "areas" ]
[ "'bool", "module_overlaps", "(", "byte", "*", "pc", ",", "size_t", "len", ")", "{", "ASSERT", "(", "loaded_module_areas", "!=", "NULL", ")", ";", "ASSERT", "(", "os_get_module_info_locked", "()", ")", ";", "return", "vmvector_overlap", "(", "loaded_module_areas", ",", "pc", ",", "pc", "+", "len", ")", ";", "}'" ]
module_overlaps
DynamoRIO/dynamorio
single_line
train
812
1,027
[ "Returns", "true", "if", "there", "is", "another", "module", "in", "the", "list" ]
[ "'bool", "module_iterator_hasnext", "(", "module_iterator_t", "*", "mi", ")", "{", "app_pc", "start", ",", "<type", "ref=\"prev\"/>", "end", ";", "module_area_t", "*", "ma", ";", "ASSERT", "(", "os_get_module_info_locked", "()", ")", ";", "while", "(", "vmvector_iterator_hasnext", "(", "&", "mi", "->", "vmvi", ")", ")", "{", "ma", "=", "(", "module_area_t", "*", ")", "vmvector_iterator_peek", "(", "&", "mi", "->", "vmvi", ",", "&", "start", ",", "&", "end", ")", ";", "/*", "skip", "non-initial", "segments", "*/", "if", "(", "start", "!=", "ma", "->", "start", ")", "vmvector_iterator_next", "(", "&", "mi", "->", "vmvi", ",", "NULL", ",", "NULL", ")", ";", "else", "return", "true", ";", "}", "return", "false", ";", "}'" ]
module_iterator_hasnext
DynamoRIO/dynamorio
single_line
train
813
1,028
[ "User", "should", "call", "this", "routine", "to", "free", "the", "iterator" ]
[ "\"void", "module_iterator_stop", "(", "module_iterator_t", "*", "mi", ")", "{", "vmvector_iterator_stop", "(", "&", "mi", "->", "vmvi", ")", ";", "/*", "loaded_module_areas", "doesn't", "use", "the", "vector", "lock", "*/", "ASSERT", "(", "os_get_module_info_locked", "()", ")", ";", "os_get_module_info_unlock", "()", ";", "HEAP_TYPE_FREE", "(", "GLOBAL_DCONTEXT", ",", "mi", ",", "module_iterator_t", ",", "ACCT_OTHER", ",", "UNPROTECTED", ")", ";", "}\"" ]
module_iterator_stop
DynamoRIO/dynamorio
single_line
train
814
1,029
[ "Initialize", "a", "new", "module_iterator" ]
[ "\"module_iterator_t", "*", "module_iterator_start", "(", "void", ")", "{", "module_iterator_t", "*", "mi", "=", "HEAP_TYPE_ALLOC", "(", "GLOBAL_DCONTEXT", ",", "module_iterator_t", ",", "ACCT_OTHER", ",", "UNPROTECTED", ")", ";", "ASSERT", "(", "loaded_module_areas", "!=", "NULL", ")", ";", "/*", "loaded_module_areas", "doesn't", "use", "the", "vector", "lock", "*/", "os_get_module_info_lock", "()", ";", "vmvector_iterator_start", "(", "loaded_module_areas", ",", "&", "mi", "->", "vmvi", ")", ";", "return", "mi", ";", "}\"" ]
module_iterator_start
DynamoRIO/dynamorio
single_line
train
815
1,031
[ "Get", "the", "name", "of", "the", "debug", "level" ]
[ "'const", "char", "*", "dbg_level_str", "(", "int", "level", ")", "{", "switch", "(", "level", ")", "{", "case", "DBG_EMERG", ":", "return", "\"EMERGENCY\"", ";", "case", "DBG_ALERT", ":", "return", "\"ALERT\"", ";", "case", "DBG_CRIT", ":", "return", "\"CRITICAL\"", ";", "case", "DBG_ERR", ":", "return", "\"ERROR\"", ";", "case", "DBG_WARNING", ":", "return", "\"WARNING\"", ";", "case", "DBG_NOTICE", ":", "return", "\"NOTICE\"", ";", "case", "DBG_INFO", ":", "return", "\"INFO\"", ";", "case", "DBG_DEBUG", ":", "return", "\"DEBUG\"", ";", "default:", "return", "\"???\"", ";", "}", "}'" ]
dbg_level_str
creytiv/rem
multi_line
train
816
1,032
[ "Formatted", "output", "to", "print", "handler", "and", "or", "logfile" ]
[ "'static", "void", "dbg_fmt_vprintf", "(", "int", "level", ",", "const", "char", "*", "fmt", ",", "va_list", "ap", ")", "{", "char", "buf", "[", "256", "]", ";", "int", "len", ";", "if", "(", "level", ">", "dbg", ".", "level", ")", "return", ";", "if", "(", "!", "dbg", ".", "ph", "&&", "!", "dbg", ".", "f", ")", "return", ";", "dbg_lock", "()", ";", "len", "=", "re_vsnprintf", "(", "buf", ",", "sizeof", "(", "buf", ")", ",", "fmt", ",", "ap", ")", ";", "if", "(", "len", "<=", "0", ")", "goto", "out", ";", "/*", "Print", "handler?", "*/", "if", "(", "dbg", ".", "ph", ")", "{", "dbg", ".", "ph", "(", "level", ",", "buf", ",", "len", ",", "dbg", ".", "arg", ")", ";", "}", "/*", "Output", "to", "file", "*/", "if", "(", "dbg", ".", "f", ")", "{", "if", "(", "fwrite", "(", "buf", ",", "1", ",", "len", ",", "dbg", ".", "f", ")", ">", "0", ")", "(", "void", ")", "fflush", "(", "dbg", ".", "f", ")", ";", "}", "out", ":", "dbg_unlock", "()", ";", "}'" ]
dbg_fmt_vprintf
creytiv/rem
single_line
train
817
1,033
[ "NOTE:", "This", "function", "should", "not", "allocate", "memory" ]
[ "'static", "void", "dbg_vprintf", "(", "int", "level", ",", "const", "char", "*", "fmt", ",", "va_list", "ap", ")", "{", "if", "(", "level", ">", "dbg", ".", "level", ")", "return", ";", "/*", "Print", "handler?", "*/", "if", "(", "dbg", ".", "ph", ")", "return", ";", "dbg_lock", "()", ";", "if", "(", "dbg", ".", "flags", "&", "DBG_ANSI", ")", "{", "switch", "(", "level", ")", "{", "case", "DBG_WARNING", ":", "(", "void", ")", "re_fprintf", "(", "stderr", ",", "\"\\\\x1b[31m\"", ")", ";", "/*", "Red", "*/", "break;", "case", "DBG_NOTICE", ":", "(", "void", ")", "re_fprintf", "(", "stderr", ",", "\"\\\\x1b[33m\"", ")", ";", "/*", "Yellow", "*/", "break;", "case", "DBG_INFO", ":", "(", "void", ")", "re_fprintf", "(", "stderr", ",", "\"\\\\x1b[32m\"", ")", ";", "/*", "Green", "*/", "break;", "default:", "break;", "}", "}", "if", "(", "dbg", ".", "flags", "&", "DBG_TIME", ")", "{", "const", "uint64_t", "ticks", "=", "tmr_jiffies", "()", ";", "if", "(", "0", "==", "dbg", ".", "tick", ")", "dbg", ".", "tick", "=", "tmr_jiffies", "()", ";", "(", "void", ")", "re_fprintf", "(", "stderr", ",", "\"[%09llu]", "\"", ",", "ticks", "-", "dbg", ".", "tick", ")", ";", "}", "(", "void", ")", "re_vfprintf", "(", "stderr", ",", "fmt", ",", "ap", ")", ";", "if", "(", "dbg", ".", "flags", "&", "DBG_ANSI", "&&", "level", "<", "DBG_DEBUG", ")", "(", "void", ")", "re_fprintf", "(", "stderr", ",", "\"\\\\x1b[;m\"", ")", ";", "dbg_unlock", "()", ";", "}'" ]
dbg_vprintf
creytiv/rem
single_line
train
818
1,034
[ "Process", "all", "the", "registers", "used", "in", "the", "rtx", "at", "address", "LOC" ]
[ "'static", "void", "df_uses_record", "(", "struct", "df_collection_rec", "*", "collection_rec", ",", "rtx", "*", "loc", ",", "enum", "df_ref_type", "ref_type", ",", "basic_block", "bb", ",", "struct", "df_insn_info", "*", "insn_info", ",", "int", "flags", ")", "{", "RTX_CODE", "code", ";", "rtx", "x", ";", "retry", ":", "x", "=", "*", "loc", ";", "if", "(", "!", "x", ")", "return", ";", "code", "=", "GET_CODE", "(", "x", ")", ";", "switch", "(", "code", ")", "{", "case", "LABEL_REF", ":", "case", "SYMBOL_REF", ":", "case", "CONST", ":", "CASE_CONST_ANY", ":", "case", "PC", ":", "case", "CC0", ":", "case", "ADDR_VEC", ":", "case", "ADDR_DIFF_VEC", ":", "return", ";", "case", "CLOBBER", ":", "/*", "If", "we", "are", "clobbering", "a", "MEM,", "mark", "any", "registers", "inside", "the", "address", "as", "being", "used.", "*/", "if", "(", "MEM_P", "(", "XEXP", "(", "x", ",", "0", ")", ")", ")", "df_uses_record", "(", "collection_rec", ",", "&", "XEXP", "(", "XEXP", "(", "x", ",", "0", ")", ",", "0", ")", ",", "DF_REF_REG_MEM_STORE", ",", "bb", ",", "insn_info", ",", "flags", ")", ";", "/*", "If", "we\\'re", "clobbering", "a", "REG", "then", "we", "have", "a", "def", "so", "ignore.", "*/", "return", ";", "case", "MEM", ":", "df_uses_record", "(", "collection_rec", ",", "&", "XEXP", "(", "x", ",", "0", ")", ",", "DF_REF_REG_MEM_LOAD", ",", "bb", ",", "insn_info", ",", "flags", "&", "DF_REF_IN_NOTE", ")", ";", "return", ";", "case", "SUBREG", ":", "/*", "While", "we\\'re", "here,", "optimize", "this", "case.", "*/", "flags", "|=", "DF_REF_PARTIAL", ";", "/*", "In", "case", "the", "SUBREG", "is", "not", "of", "a", "REG,", "do", "not", "optimize.", "*/", "if", "(", "!", "REG_P", "(", "SUBREG_REG", "(", "x", ")", ")", ")", "{", "loc", "=", "&", "SUBREG_REG", "(", "x", ")", ";", "df_uses_record", "(", "collection_rec", ",", "loc", ",", "ref_type", ",", "bb", ",", "insn_info", ",", "flags", ")", ";", "return", ";", "}", "/*", "...", "Fall", "through", "...", "*/", "case", "REG", ":", "df_ref_record", "(", "DF_REF_REGULAR", ",", "collection_rec", ",", "x", ",", "loc", ",", "bb", ",", "insn_info", ",", "ref_type", ",", "flags", ")", ";", "return", ";", "case", "SIGN_EXTRACT", ":", "case", "ZERO_EXTRACT", ":", "{", "df_uses_record", "(", "collection_rec", ",", "&", "XEXP", "(", "x", ",", "1", ")", ",", "ref_type", ",", "bb", ",", "insn_info", ",", "flags", ")", ";", "df_uses_record", "(", "collection_rec", ",", "&", "XEXP", "(", "x", ",", "2", ")", ",", "ref_type", ",", "bb", ",", "insn_info", ",", "flags", ")", ";", "/*", "If", "the", "parameters", "to", "the", "zero", "or", "sign", "extract", "are", "constants,", "strip", "them", "off", "and", "recurse,", "otherwise", "there", "is", "no", "information", "that", "we", "can", "gain", "from", "this", "operation.", "*/", "if", "(", "code", "==", "ZERO_EXTRACT", ")", "flags", "|=", "DF_REF_ZERO_EXTRACT", ";", "else", "flags", "|=", "DF_REF_SIGN_EXTRACT", ";", "df_uses_record", "(", "collection_rec", ",", "&", "XEXP", "(", "x", ",", "0", ")", ",", "ref_type", ",", "bb", ",", "insn_info", ",", "flags", ")", ";", "return", ";", "}", "break;", "case", "SET", ":", "{", "rtx", "dst", "=", "SET_DEST", "(", "x", ")", ";", "gcc_assert", "(", "!", "(", "flags", "&", "DF_REF_IN_NOTE", ")", ")", ";", "df_uses_record", "(", "collection_rec", ",", "&", "SET_SRC", "(", "x", ")", ",", "DF_REF_REG_USE", ",", "bb", ",", "insn_info", ",", "flags", ")", ";", "switch", "(", "GET_CODE", "(", "dst", ")", ")", "{", "case", "SUBREG", ":", "if", "(", "df_read_modify_subreg_p", "(", "dst", ")", ")", "{", "df_uses_record", "(", "collection_rec", ",", "&", "SUBREG_REG", "(", "dst", ")", ",", "DF_REF_REG_USE", ",", "bb", ",", "insn_info", ",", "flags", "|", "DF_REF_READ_WRITE", "|", "DF_REF_SUBREG", ")", ";", "break;", "}", "/*", "Fall", "through.", "*/", "case", "REG", ":", "case", "PARALLEL", ":", "case", "SCRATCH", ":", "case", "PC", ":", "case", "CC0", ":", "break;", "case", "MEM", ":", "df_uses_record", "(", "collection_rec", ",", "&", "XEXP", "(", "dst", ",", "0", ")", ",", "DF_REF_REG_MEM_STORE", ",", "bb", ",", "insn_info", ",", "flags", ")", ";", "break;", "case", "STRICT_LOW_PART", ":", "{", "rtx", "*", "temp", "=", "&", "XEXP", "(", "dst", ",", "0", ")", ";", "/*", "A", "strict_low_part", "uses", "the", "whole", "REG", "and", "not", "just", "the", "SUBREG.", "*/", "dst", "=", "XEXP", "(", "dst", ",", "0", ")", ";", "df_uses_record", "(", "collection_rec", ",", "(", "GET_CODE", "(", "dst", ")", "==", "SUBREG", ")", "?", "&", "SUBREG_REG", "(", "dst", ")", ":", "temp", ",", "DF_REF_REG_USE", ",", "bb", ",", "insn_info", ",", "DF_REF_READ_WRITE", "|", "DF_REF_STRICT_LOW_PART", ")", ";", "}", "break;", "case", "ZERO_EXTRACT", ":", "{", "df_uses_record", "(", "collection_rec", ",", "&", "XEXP", "(", "dst", ",", "1", ")", ",", "DF_REF_REG_USE", ",", "bb", ",", "insn_info", ",", "flags", ")", ";", "df_uses_record", "(", "collection_rec", ",", "&", "XEXP", "(", "dst", ",", "2", ")", ",", "DF_REF_REG_USE", ",", "bb", ",", "insn_info", ",", "flags", ")", ";", "if", "(", "GET_CODE", "(", "XEXP", "(", "dst", ",", "0", ")", ")", "==", "MEM", ")", "df_uses_record", "(", "collection_rec", ",", "&", "XEXP", "(", "dst", ",", "0", ")", ",", "DF_REF_REG_USE", ",", "bb", ",", "insn_info", ",", "flags", ")", ";", "else", "df_uses_record", "(", "collection_rec", ",", "&", "XEXP", "(", "dst", ",", "0", ")", ",", "DF_REF_REG_USE", ",", "bb", ",", "insn_info", ",", "DF_REF_READ_WRITE", "|", "DF_REF_ZERO_EXTRACT", ")", ";", "}", "break;", "default:", "gcc_unreachable", "()", ";", "}", "return", ";", "}", "case", "RETURN", ":", "case", "SIMPLE_RETURN", ":", "break;", "case", "ASM_OPERANDS", ":", "case", "UNSPEC_VOLATILE", ":", "case", "TRAP_IF", ":", "case", "ASM_INPUT", ":", "{", "/*", "Traditional", "and", "volatile", "asm", "instructions", "must", "be", "considered", "to", "use", "and", "clobber", "all", "hard", "registers,", "all", "pseudo-registers", "and", "all", "of", "memory.", "So", "must", "TRAP_IF", "and", "UNSPEC_VOLATILE", "operations.", "Consider", "for", "instance", "a", "volatile", "asm", "that", "changes", "the", "fpu", "rounding", "mode.", "An", "insn", "should", "not", "be", "moved", "across", "this", "even", "if", "it", "only", "uses", "pseudo-regs", "because", "it", "might", "give", "an", "incorrectly", "rounded", "result.", "However,", "flow.c\\'s", "liveness", "computation", "did", "*not*", "do", "this,", "giving", "the", "reasoning", "as", "\"", "?!?", "Unfortunately,", "marking", "all", "hard", "registers", "as", "live", "causes", "massive", "problems", "for", "the", "register", "allocator", "and", "marking", "all", "pseudos", "as", "live", "creates", "mountains", "of", "uninitialized", "variable", "warnings.\"", "In", "order", "to", "maintain", "the", "status", "quo", "with", "regard", "to", "liveness", "and", "uses,", "we", "do", "what", "flow.c", "did", "and", "just", "mark", "any", "regs", "we", "can", "find", "in", "ASM_OPERANDS", "as", "used.", "In", "global", "asm", "insns", "are", "scanned", "and", "regs_asm_clobbered", "is", "filled", "out.", "For", "all", "ASM_OPERANDS,", "we", "must", "traverse", "the", "vector", "of", "input", "operands.", "We", "can", "not", "just", "fall", "through", "here", "since", "then", "we", "would", "be", "confused", "by", "the", "ASM_INPUT", "rtx", "inside", "ASM_OPERANDS,", "which", "do", "not", "indicate", "traditional", "asms", "unlike", "their", "normal", "usage.", "*/", "if", "(", "code", "==", "ASM_OPERANDS", ")", "{", "int", "j", ";", "for", "(", "j", "=", "0", ";", "j", "<", "ASM_OPERANDS_INPUT_LENGTH", "(", "x", ")", ";", "j", "++", ")", "df_uses_record", "(", "collection_rec", ",", "&", "ASM_OPERANDS_INPUT", "(", "x", ",", "j", ")", ",", "DF_REF_REG_USE", ",", "bb", ",", "insn_info", ",", "flags", ")", ";", "return", ";", "}", "break;", "}", "case", "VAR_LOCATION", ":", "df_uses_record", "(", "collection_rec", ",", "&", "PAT_VAR_LOCATION_LOC", "(", "x", ")", ",", "DF_REF_REG_USE", ",", "bb", ",", "insn_info", ",", "flags", ")", ";", "return", ";", "case", "PRE_DEC", ":", "case", "POST_DEC", ":", "case", "PRE_INC", ":", "case", "POST_INC", ":", "case", "PRE_MODIFY", ":", "case", "POST_MODIFY", ":", "gcc_assert", "(", "!", "DEBUG_INSN_P", "(", "insn_info", "->", "insn", ")", ")", ";", "/*", "Catch", "the", "def", "of", "the", "register", "being", "modified.", "*/", "df_ref_record", "(", "DF_REF_REGULAR", ",", "collection_rec", ",", "XEXP", "(", "x", ",", "0", ")", ",", "&", "XEXP", "(", "x", ",", "0", ")", ",", "bb", ",", "insn_info", ",", "DF_REF_REG_DEF", ",", "flags", "|", "DF_REF_READ_WRITE", "|", "DF_REF_PRE_POST_MODIFY", ")", ";", "/*", "...", "Fall", "through", "to", "handle", "uses", "...", "*/", "default:", "break;", "}", "/*", "Recursively", "scan", "the", "operands", "of", "this", "expression.", "*/", "{", "const", "char", "*", "fmt", "=", "GET_RTX_FORMAT", "(", "code", ")", ";", "int", "i", ";", "for", "(", "i", "=", "GET_RTX_LENGTH", "(", "code", ")", "-", "1", ";", "i", ">=", "0", ";", "i", "--", ")", "{", "if", "(", "fmt", "[", "i", "]", "==", "\\'e\\'", ")", "{", "/*", "Tail", "recursive", "case:", "save", "a", "function", "call", "level.", "*/", "if", "(", "i", "==", "0", ")", "{", "loc", "=", "&", "XEXP", "(", "x", ",", "0", ")", ";", "goto", "retry", ";", "}", "df_uses_record", "(", "collection_rec", ",", "&", "XEXP", "(", "x", ",", "i", ")", ",", "ref_type", ",", "bb", ",", "insn_info", ",", "flags", ")", ";", "}", "<if", "type=\"elseif\">", "else", "if", "(", "fmt", "[", "i", "]", "==", "\\'E\\'", ")", "{", "int", "j", ";", "for", "(", "j", "=", "0", ";", "j", "<", "XVECLEN", "(", "x", ",", "i", ")", ";", "j", "++", ")", "df_uses_record", "(", "collection_rec", ",", "&", "XVECEXP", "(", "x", ",", "i", ",", "j", ")", ",", "ref_type", ",", "bb", ",", "insn_info", ",", "flags", ")", ";", "}", "}", "}", "return", ";", "}'" ]
df_uses_record
SuperHouse/esp-open-rtos
single_line
train
819
1,035
[ "Free", "all", "of", "the", "refs", "and", "the", "mw_hardregs", "in", "COLLECTION_REC" ]
[ "'static", "void", "df_free_collection_rec", "(", "struct", "df_collection_rec", "*", "collection_rec", ")", "{", "unsigned", "int", "ix", ";", "struct", "df_scan_problem_data", "*", "problem_data", "=", "(", "struct", "df_scan_problem_data", "*", ")", "df_scan", "->", "problem_data", ";", "df_ref", "ref", ";", "struct", "df_mw_hardreg", "*", "mw", ";", "FOR_EACH_VEC_ELT", "(", "collection_rec->def_vec", ",", "ix", ",", "ref", ")", "df_free_ref", "(", "ref", ")", ";", "FOR_EACH_VEC_ELT", "(", "collection_rec->use_vec", ",", "ix", ",", "ref", ")", "df_free_ref", "(", "ref", ")", ";", "FOR_EACH_VEC_ELT", "(", "collection_rec->eq_use_vec", ",", "ix", ",", "ref", ")", "df_free_ref", "(", "ref", ")", ";", "FOR_EACH_VEC_ELT", "(", "collection_rec->mw_vec", ",", "ix", ",", "mw", ")", "pool_free", "(", "problem_data", "->", "mw_reg_pool", ",", "mw", ")", ";", "collection_rec", "->", "def_vec", ".", "release", "()", ";", "collection_rec", "->", "use_vec", ".", "release", "()", ";", "collection_rec", "->", "eq_use_vec", ".", "release", "()", ";", "collection_rec", "->", "mw_vec", ".", "release", "()", ";", "}'" ]
df_free_collection_rec
SuperHouse/esp-open-rtos
single_line
train
820
1,036
[ "Update", "the", "uses", "in", "the", "exit", "block" ]
[ "'void", "df_update_exit_block_uses", "(", "void", ")", "{", "bitmap_head", "refs", ";", "bool", "changed", "=", "false", ";", "bitmap_initialize", "(", "&", "refs", ",", "&", "df_bitmap_obstack", ")", ";", "df_get_exit_block_use_set", "(", "&", "refs", ")", ";", "if", "(", "df", "->", "exit_block_uses", ")", "{", "if", "(", "!", "bitmap_equal_p", "(", "df", "->", "exit_block_uses", ",", "&", "refs", ")", ")", "{", "struct", "df_scan_bb_info", "*", "bb_info", "=", "df_scan_get_bb_info", "(", "EXIT_BLOCK", ")", ";", "df_ref_chain_delete_du_chain", "(", "bb_info", "->", "artificial_uses", ")", ";", "df_ref_chain_delete", "(", "bb_info", "->", "artificial_uses", ")", ";", "bb_info", "->", "artificial_uses", "=", "NULL", ";", "changed", "=", "true", ";", "}", "}", "else", "{", "struct", "df_scan_problem_data", "*", "problem_data", "=", "(", "struct", "df_scan_problem_data", "*", ")", "df_scan", "->", "problem_data", ";", "gcc_unreachable", "()", ";", "df", "->", "exit_block_uses", "=", "BITMAP_ALLOC", "(", "&", "problem_data", "->", "reg_bitmaps", ")", ";", "changed", "=", "true", ";", "}", "if", "(", "changed", ")", "{", "df_record_exit_block_uses", "(", "&", "refs", ")", ";", "bitmap_copy", "(", "df", "->", "exit_block_uses", ",", "&", "refs", ")", ";", "df_set_bb_dirty", "(", "BASIC_BLOCK", "(", "EXIT_BLOCK", ")", ")", ";", "}", "bitmap_clear", "(", "&", "refs", ")", ";", "}'" ]
df_update_exit_block_uses
SuperHouse/esp-open-rtos
single_line
train
821
1,037
[ "Rescan", "only", "the", "REG_EQUIV", "REG_EQUAL", "notes", "part", "of", "INSN" ]
[ "\"void", "df_notes_rescan", "(", "rtx", "insn", ")", "{", "struct", "df_insn_info", "*", "insn_info", ";", "unsigned", "int", "uid", "=", "INSN_UID", "(", "insn", ")", ";", "if", "(", "!", "df", ")", "return", ";", "/*", "The", "client", "has", "disabled", "rescanning", "and", "plans", "to", "do", "it", "itself.", "*/", "if", "(", "df", "->", "changeable_flags", "&", "DF_NO_INSN_RESCAN", ")", "return", ";", "/*", "Do", "nothing", "if", "the", "insn", "hasn't", "been", "emitted", "yet.", "*/", "if", "(", "!", "BLOCK_FOR_INSN", "(", "insn", ")", ")", "return", ";", "df_grow_bb_info", "(", "df_scan", ")", ";", "df_grow_reg_info", "()", ";", "insn_info", "=", "DF_INSN_UID_SAFE_GET", "(", "INSN_UID", "(", "insn", ")", ")", ";", "/*", "The", "client", "has", "deferred", "rescanning.", "*/", "if", "(", "df", "->", "changeable_flags", "&", "DF_DEFER_INSN_RESCAN", ")", "{", "if", "(", "!", "insn_info", ")", "{", "insn_info", "=", "df_insn_create_insn_record", "(", "insn", ")", ";", "insn_info", "->", "defs", "=", "df_null_ref_rec", ";", "insn_info", "->", "uses", "=", "df_null_ref_rec", ";", "insn_info", "->", "eq_uses", "=", "df_null_ref_rec", ";", "insn_info", "->", "mw_hardregs", "=", "df_null_mw_rec", ";", "}", "bitmap_clear_bit", "(", "&", "df", "->", "insns_to_delete", ",", "uid", ")", ";", "/*", "If", "the", "insn", "is", "set", "to", "be", "rescanned,", "it", "does", "not", "need", "to", "also", "be", "notes", "rescanned.", "*/", "if", "(", "!", "bitmap_bit_p", "(", "&", "df", "->", "insns_to_rescan", ",", "uid", ")", ")", "bitmap_set_bit", "(", "&", "df", "->", "insns_to_notes_rescan", ",", "INSN_UID", "(", "insn", ")", ")", ";", "return", ";", "}", "bitmap_clear_bit", "(", "&", "df", "->", "insns_to_delete", ",", "uid", ")", ";", "bitmap_clear_bit", "(", "&", "df", "->", "insns_to_notes_rescan", ",", "uid", ")", ";", "if", "(", "insn_info", ")", "{", "basic_block", "bb", "=", "BLOCK_FOR_INSN", "(", "insn", ")", ";", "rtx", "note", ";", "struct", "df_collection_rec", "collection_rec", ";", "unsigned", "int", "num_deleted", ";", "unsigned", "int", "mw_len", ";", "memset", "(", "&", "collection_rec", ",", "0", ",", "sizeof", "(", "struct", "df_collection_rec", ")", ")", ";", "vec_stack_alloc", "(", "df_ref", ",", "collection_rec", ".", "eq_use_vec", ",", "32", ")", ";", "vec_stack_alloc", "(", "df_mw_hardreg_ptr", ",", "collection_rec", ".", "mw_vec", ",", "32", ")", ";", "num_deleted", "=", "df_mw_hardreg_chain_delete_eq_uses", "(", "insn_info", ")", ";", "df_ref_chain_delete", "(", "insn_info", "->", "eq_uses", ")", ";", "insn_info", "->", "eq_uses", "=", "NULL", ";", "/*", "Process", "REG_EQUIV/REG_EQUAL", "notes", "*/", "for", "(", "note", "=", "REG_NOTES", "(", "insn", ")", ";", "note", ";", "note", "=", "XEXP", "(", "note", ",", "1", ")", ")", "{", "switch", "(", "REG_NOTE_KIND", "(", "note", ")", ")", "{", "case", "REG_EQUIV", ":", "case", "REG_EQUAL", ":", "df_uses_record", "(", "&", "collection_rec", ",", "&", "XEXP", "(", "note", ",", "0", ")", ",", "DF_REF_REG_USE", ",", "bb", ",", "insn_info", ",", "DF_REF_IN_NOTE", ")", ";", "default:", "break;", "}", "}", "/*", "Find", "some", "place", "to", "put", "any", "new", "mw_hardregs.", "*/", "df_canonize_collection_rec", "(", "&", "collection_rec", ")", ";", "mw_len", "=", "collection_rec", ".", "mw_vec", ".", "length", "()", ";", "if", "(", "mw_len", ")", "{", "unsigned", "int", "count", "=", "0", ";", "struct", "df_mw_hardreg", "*", "*", "mw_rec", "=", "insn_info", "->", "mw_hardregs", ";", "while", "(", "*", "mw_rec", ")", "{", "count", "++", ";", "mw_rec", "++", ";", "}", "if", "(", "count", ")", "{", "/*", "Append", "to", "the", "end", "of", "the", "existing", "record", "after", "expanding", "it", "if", "necessary.", "*/", "if", "(", "mw_len", ">", "num_deleted", ")", "{", "insn_info", "->", "mw_hardregs", "=", "XRESIZEVEC", "(", "struct", "df_mw_hardreg", "*", ",", "insn_info", "->", "mw_hardregs", ",", "count", "+", "1", "+", "mw_len", ")", ";", "}", "memcpy", "(", "&", "insn_info", "->", "mw_hardregs", "[", "count", "]", ",", "collection_rec", ".", "mw_vec", ".", "address", "()", ",", "mw_len", "*", "sizeof", "(", "struct", "df_mw_hardreg", "*", ")", ")", ";", "insn_info", "->", "mw_hardregs", "[", "count", "+", "mw_len", "]", "=", "NULL", ";", "qsort", "(", "insn_info", "->", "mw_hardregs", ",", "count", "+", "mw_len", ",", "sizeof", "(", "struct", "df_mw_hardreg", "*", ")", ",", "df_mw_compare", ")", ";", "}", "else", "{", "/*", "No", "vector", "there.", "*/", "insn_info", "->", "mw_hardregs", "=", "XNEWVEC", "(", "struct", "df_mw_hardreg", "*", ",", "1", "+", "mw_len", ")", ";", "memcpy", "(", "insn_info", "->", "mw_hardregs", ",", "collection_rec", ".", "mw_vec", ".", "address", "()", ",", "mw_len", "*", "sizeof", "(", "struct", "df_mw_hardreg", "*", ")", ")", ";", "insn_info", "->", "mw_hardregs", "[", "mw_len", "]", "=", "NULL", ";", "}", "}", "/*", "Get", "rid", "of", "the", "mw_rec", "so", "that", "df_refs_add_to_chains", "will", "ignore", "it.", "*/", "collection_rec", ".", "mw_vec", ".", "release", "()", ";", "df_refs_add_to_chains", "(", "&", "collection_rec", ",", "bb", ",", "insn", ")", ";", "collection_rec", ".", "eq_use_vec", ".", "release", "()", ";", "}", "else", "df_insn_rescan", "(", "insn", ")", ";", "}\"" ]
df_notes_rescan
SuperHouse/esp-open-rtos
single_line
train
822
1,038
[ "Remove", "REF", "from", "VEC" ]
[ "'static", "void", "df_ref_compress_rec", "(", "df_ref", "*", "*", "vec_ptr", ",", "df_ref", "ref", ")", "{", "df_ref", "*", "vec", "=", "*", "vec_ptr", ";", "if", "(", "vec", "[", "1", "]", ")", "{", "while", "(", "*", "vec", "&&", "*", "vec", "!=", "ref", ")", "vec", "++", ";", "while", "(", "*", "vec", ")", "{", "*", "vec", "=", "*", "(", "vec", "+", "1", ")", ";", "vec", "++", ";", "}", "}", "else", "{", "free", "(", "vec", ")", ";", "*", "vec_ptr", "=", "df_null_ref_rec", ";", "}", "}'" ]
df_ref_compress_rec
SuperHouse/esp-open-rtos
single_line
train
823
1,039
[ "Recompute", "the", "luids", "for", "the", "insns", "in", "BB" ]
[ "'void", "df_recompute_luids", "(", "basic_block", "bb", ")", "{", "rtx", "insn", ";", "int", "luid", "=", "0", ";", "df_grow_insn_info", "()", ";", "/*", "Scan", "the", "block", "an", "insn", "at", "a", "time", "from", "beginning", "to", "end.", "*/", "FOR_BB_INSNS", "(", "bb", ",", "insn", ")", "{", "struct", "df_insn_info", "*", "insn_info", "=", "DF_INSN_INFO_GET", "(", "insn", ")", ";", "/*", "Inserting", "labels", "does", "not", "always", "trigger", "the", "incremental", "rescanning.", "*/", "if", "(", "!", "insn_info", ")", "{", "gcc_assert", "(", "!", "INSN_P", "(", "insn", ")", ")", ";", "insn_info", "=", "df_insn_create_insn_record", "(", "insn", ")", ";", "}", "DF_INSN_INFO_LUID", "(", "insn_info", ")", "=", "luid", ";", "if", "(", "INSN_P", "(", "insn", ")", ")", "luid", "++", ";", "}", "}'" ]
df_recompute_luids
SuperHouse/esp-open-rtos
single_line
train
824
1,040
[ "Record", "all", "the", "refs", "within", "the", "basic", "block", "BB_INDEX", "and", "scan", "the", "instructions", "if", "SCAN_INSNS" ]
[ "'void", "df_bb_refs_record", "(", "int", "bb_index", ",", "bool", "scan_insns", ")", "{", "basic_block", "bb", "=", "BASIC_BLOCK", "(", "bb_index", ")", ";", "rtx", "insn", ";", "int", "luid", "=", "0", ";", "struct", "df_collection_rec", "collection_rec", ";", "if", "(", "!", "df", ")", "return", ";", "df_grow_bb_info", "(", "df_scan", ")", ";", "vec_stack_alloc", "(", "df_ref", ",", "collection_rec", ".", "def_vec", ",", "128", ")", ";", "vec_stack_alloc", "(", "df_ref", ",", "collection_rec", ".", "use_vec", ",", "32", ")", ";", "vec_stack_alloc", "(", "df_ref", ",", "collection_rec", ".", "eq_use_vec", ",", "32", ")", ";", "vec_stack_alloc", "(", "df_mw_hardreg_ptr", ",", "collection_rec", ".", "mw_vec", ",", "32", ")", ";", "if", "(", "scan_insns", ")", "/*", "Scan", "the", "block", "an", "insn", "at", "a", "time", "from", "beginning", "to", "end.", "*/", "FOR_BB_INSNS", "(", "bb", ",", "insn", ")", "{", "struct", "df_insn_info", "*", "insn_info", "=", "DF_INSN_INFO_GET", "(", "insn", ")", ";", "gcc_assert", "(", "!", "insn_info", ")", ";", "insn_info", "=", "df_insn_create_insn_record", "(", "insn", ")", ";", "if", "(", "INSN_P", "(", "insn", ")", ")", "{", "/*", "Record", "refs", "within", "INSN.", "*/", "DF_INSN_INFO_LUID", "(", "insn_info", ")", "=", "luid", "++", ";", "df_insn_refs_collect", "(", "&", "collection_rec", ",", "bb", ",", "DF_INSN_INFO_GET", "(", "insn", ")", ")", ";", "df_refs_add_to_chains", "(", "&", "collection_rec", ",", "bb", ",", "insn", ")", ";", "}", "DF_INSN_INFO_LUID", "(", "insn_info", ")", "=", "luid", ";", "}", "/*", "Other", "block", "level", "artificial", "refs", "*/", "df_bb_refs_collect", "(", "&", "collection_rec", ",", "bb", ")", ";", "df_refs_add_to_chains", "(", "&", "collection_rec", ",", "bb", ",", "NULL", ")", ";", "collection_rec", ".", "def_vec", ".", "release", "()", ";", "collection_rec", ".", "use_vec", ".", "release", "()", ";", "collection_rec", ".", "eq_use_vec", ".", "release", "()", ";", "collection_rec", ".", "mw_vec", ".", "release", "()", ";", "/*", "Now", "that", "the", "block", "has", "been", "processed,", "set", "the", "block", "as", "dirty", "so", "LR", "and", "LIVE", "will", "get", "it", "processed.", "*/", "df_set_bb_dirty", "(", "bb", ")", ";", "}'" ]
df_bb_refs_record
SuperHouse/esp-open-rtos
single_line
train
825
1,041
[ "Sort", "and", "compress", "a", "set", "of", "refs" ]
[ "'static", "void", "df_sort_and_compress_refs", "(", "vec", "<argument_list", "type=\"generic\">", "<", "df_ref", ",", "va_stack", ">", "*", "ref_vec", ")", "{", "unsigned", "int", "count", ";", "unsigned", "int", "i", ";", "unsigned", "int", "dist", "=", "0", ";", "count", "=", "ref_vec", "->", "length", "()", ";", "/*", "If", "there", "are", "1", "or", "0", "elements,", "there", "is", "nothing", "to", "do.", "*/", "if", "(", "count", "<", "2", ")", "return", ";", "<if", "type=\"elseif\">", "else", "if", "(", "count", "==", "2", ")", "{", "df_ref", "r0", "=", "(", "*", "ref_vec", ")", "[", "0", "]", ";", "df_ref", "r1", "=", "(", "*", "ref_vec", ")", "[", "1", "]", ";", "if", "(", "df_ref_compare", "(", "&", "r0", ",", "&", "r1", ")", ">", "0", ")", "df_swap_refs", "(", "ref_vec", ",", "0", ",", "1", ")", ";", "}", "else", "{", "for", "(", "i", "=", "0", ";", "i", "<", "count", "-", "1", ";", "i", "++", ")", "{", "df_ref", "r0", "=", "(", "*", "ref_vec", ")", "[", "i", "]", ";", "df_ref", "r1", "=", "(", "*", "ref_vec", ")", "[", "i", "+", "1", "]", ";", "if", "(", "df_ref_compare", "(", "&", "r0", ",", "&", "r1", ")", ">=", "0", ")", "break;", "}", "/*", "If", "the", "array", "is", "already", "strictly", "ordered,", "which", "is", "the", "most", "common", "case", "for", "large", "COUNT", "case", "(which", "happens", "for", "CALL", "INSNs),", "no", "need", "to", "sort", "and", "filter", "out", "duplicate.", "Simply", "return", "the", "count.", "Make", "sure", "DF_GET_ADD_REFS", "adds", "refs", "in", "the", "increasing", "order", "of", "DF_REF_COMPARE.", "*/", "if", "(", "i", "==", "count", "-", "1", ")", "return", ";", "ref_vec", "->", "qsort", "(", "df_ref_compare", ")", ";", "}", "for", "(", "i", "=", "0", ";", "i", "<", "count", "-", "dist", ";", "i", "++", ")", "{", "/*", "Find", "the", "next", "ref", "that", "is", "not", "equal", "to", "the", "current", "ref.", "*/", "while", "(", "i", "+", "dist", "+", "1", "<", "count", "&&", "df_ref_equal_p", "(", "(", "*", "ref_vec", ")", "[", "i", "]", ",", "(", "*", "ref_vec", ")", "[", "i", "+", "dist", "+", "1", "]", ")", ")", "{", "df_free_ref", "(", "(", "*", "ref_vec", ")", "[", "i", "+", "dist", "+", "1", "]", ")", ";", "dist", "++", ";", "}", "/*", "Copy", "it", "down", "to", "the", "next", "position.", "*/", "if", "(", "dist", "&&", "i", "+", "dist", "+", "1", "<", "count", ")", "(", "*", "ref_vec", ")", "[", "i", "+", "1", "]", "=", "(", "*", "ref_vec", ")", "[", "i", "+", "dist", "+", "1", "]", ";", "}", "count", "-=", "dist", ";", "ref_vec", "->", "truncate", "(", "count", ")", ";", "}'" ]
df_sort_and_compress_refs
SuperHouse/esp-open-rtos
single_line
train
826
1,042
[ "Verify", "that", "NEW_REC", "and", "OLD_REC", "have", "exactly", "the", "same", "members" ]
[ "'static", "bool", "df_refs_verify", "(", "vec", "<argument_list", "type=\"generic\">", "<", "df_ref", ",", "va_stack", ">", "new_rec", ",", "df_ref", "*", "old_rec", ",", "bool", "abort_if_fail", ")", "{", "unsigned", "int", "ix", ";", "df_ref", "new_ref", ";", "FOR_EACH_VEC_ELT", "(", "new_rec", ",", "ix", ",", "new_ref", ")", "{", "if", "(", "*", "old_rec", "==", "NULL", "||", "!", "df_ref_equal_p", "(", "new_ref", ",", "*", "old_rec", ")", ")", "{", "if", "(", "abort_if_fail", ")", "gcc_assert", "(", "0", ")", ";", "else", "return", "false", ";", "}", "/*", "Abort", "if", "fail", "is", "called", "from", "the", "function", "level", "verifier.", "If", "that", "is", "the", "context,", "mark", "this", "reg", "as", "being", "seem.", "*/", "if", "(", "abort_if_fail", ")", "{", "gcc_assert", "(", "DF_REF_IS_REG_MARKED", "(", "*", "old_rec", ")", ")", ";", "DF_REF_REG_UNMARK", "(", "*", "old_rec", ")", ";", "}", "old_rec", "++", ";", "}", "if", "(", "abort_if_fail", ")", "gcc_assert", "(", "*", "old_rec", "==", "NULL", ")", ";", "else", "return", "*", "old_rec", "==", "NULL", ";", "return", "false", ";", "}'" ]
df_refs_verify
SuperHouse/esp-open-rtos
single_line
train
827
1,043
[ "Verify", "that", "all", "of", "the", "registers", "in", "the", "chain", "are", "unmarked" ]
[ "'static", "void", "df_reg_chain_verify_unmarked", "(", "df_ref", "refs", ")", "{", "df_ref", "ref", ";", "for", "(", "ref", "=", "refs", ";", "ref", ";", "ref", "=", "DF_REF_NEXT_REG", "(", "ref", ")", ")", "gcc_assert", "(", "!", "DF_REF_IS_REG_MARKED", "(", "ref", ")", ")", ";", "}'" ]
df_reg_chain_verify_unmarked
SuperHouse/esp-open-rtos
single_line
train
828
1,044
[ "Delete", "the", "hardreg", "chain" ]
[ "'static", "void", "df_mw_hardreg_chain_delete", "(", "struct", "df_mw_hardreg", "*", "*", "hardregs", ")", "{", "struct", "df_scan_problem_data", "*", "problem_data", ";", "if", "(", "!", "hardregs", ")", "return", ";", "problem_data", "=", "(", "struct", "df_scan_problem_data", "*", ")", "df_scan", "->", "problem_data", ";", "while", "(", "*", "hardregs", ")", "{", "pool_free", "(", "problem_data", "->", "mw_reg_pool", ",", "*", "hardregs", ")", ";", "hardregs", "++", ";", "}", "}'" ]
df_mw_hardreg_chain_delete
SuperHouse/esp-open-rtos
single_line
train
829
1,045
[ "Free", "basic", "block", "info" ]
[ "'static", "void", "df_scan_free_bb_info", "(", "basic_block", "bb", ",", "void", "*", "vbb_info", ")", "{", "struct", "df_scan_bb_info", "*", "bb_info", "=", "(", "struct", "df_scan_bb_info", "*", ")", "vbb_info", ";", "unsigned", "int", "bb_index", "=", "bb", "->", "index", ";", "/*", "See", "if", "bb_info", "is", "initialized.", "*/", "if", "(", "bb_info", "->", "artificial_defs", ")", "{", "rtx", "insn", ";", "FOR_BB_INSNS", "(", "bb", ",", "insn", ")", "{", "if", "(", "INSN_P", "(", "insn", ")", ")", "/*", "Record", "defs", "within", "INSN.", "*/", "df_insn_delete", "(", "bb", ",", "INSN_UID", "(", "insn", ")", ")", ";", "}", "if", "(", "bb_index", "<", "df_scan", "->", "block_info_size", ")", "bb_info", "=", "df_scan_get_bb_info", "(", "bb_index", ")", ";", "/*", "Get", "rid", "of", "any", "artificial", "uses", "or", "defs.", "*/", "if", "(", "bb_info", "->", "artificial_defs", ")", "{", "df_ref_chain_delete_du_chain", "(", "bb_info", "->", "artificial_defs", ")", ";", "df_ref_chain_delete_du_chain", "(", "bb_info", "->", "artificial_uses", ")", ";", "df_ref_chain_delete", "(", "bb_info", "->", "artificial_defs", ")", ";", "df_ref_chain_delete", "(", "bb_info", "->", "artificial_uses", ")", ";", "bb_info", "->", "artificial_defs", "=", "NULL", ";", "bb_info", "->", "artificial_uses", "=", "NULL", ";", "}", "}", "}'" ]
df_scan_free_bb_info
SuperHouse/esp-open-rtos
single_line
train
830
1,046
[ "Dump", "the", "preamble", "for", "DF_SCAN", "dump" ]
[ "'static", "void", "df_scan_start_dump", "(", "FILE", "*", "file", "ATTRIBUTE_UNUSED", ")", "{", "int", "i", ";", "int", "dcount", "=", "0", ";", "int", "ucount", "=", "0", ";", "int", "ecount", "=", "0", ";", "int", "icount", "=", "0", ";", "int", "ccount", "=", "0", ";", "basic_block", "bb", ";", "rtx", "insn", ";", "fprintf", "(", "file", ",", "\";;", "invalidated", "by", "call", "\\\\t\"", ")", ";", "df_print_regset", "(", "file", ",", "regs_invalidated_by_call_regset", ")", ";", "fprintf", "(", "file", ",", "\";;", "hardware", "regs", "used", "\\\\t\"", ")", ";", "df_print_regset", "(", "file", ",", "&", "df", "->", "hardware_regs_used", ")", ";", "fprintf", "(", "file", ",", "\";;", "regular", "block", "artificial", "uses", "\\\\t\"", ")", ";", "df_print_regset", "(", "file", ",", "&", "df", "->", "regular_block_artificial_uses", ")", ";", "fprintf", "(", "file", ",", "\";;", "eh", "block", "artificial", "uses", "\\\\t\"", ")", ";", "df_print_regset", "(", "file", ",", "&", "df", "->", "eh_block_artificial_uses", ")", ";", "fprintf", "(", "file", ",", "\";;", "entry", "block", "defs", "\\\\t\"", ")", ";", "df_print_regset", "(", "file", ",", "df", "->", "entry_block_defs", ")", ";", "fprintf", "(", "file", ",", "\";;", "exit", "block", "uses", "\\\\t\"", ")", ";", "df_print_regset", "(", "file", ",", "df", "->", "exit_block_uses", ")", ";", "fprintf", "(", "file", ",", "\";;", "regs", "ever", "live", "\\\\t\"", ")", ";", "for", "(", "i", "=", "0", ";", "i", "<", "FIRST_PSEUDO_REGISTER", ";", "i", "++", ")", "if", "(", "df_regs_ever_live_p", "(", "i", ")", ")", "fprintf", "(", "file", ",", "\"", "%d[%s]\"", ",", "i", ",", "reg_names", "[", "i", "]", ")", ";", "fprintf", "(", "file", ",", "\"\\;;", "ref", "usage", "\\\\t\"", ")", ";", "for", "(", "i", "=", "0", ";", "i", "<", "(", "int", ")", "df", "->", "regs_inited", ";", "i", "++", ")", "if", "(", "DF_REG_DEF_COUNT", "(", "i", ")", "||", "DF_REG_USE_COUNT", "(", "i", ")", "||", "DF_REG_EQ_USE_COUNT", "(", "i", ")", ")", "{", "const", "char", "*", "sep", "=", "\"\"", ";", "fprintf", "(", "file", ",", "\"r%d={\"", ",", "i", ")", ";", "if", "(", "DF_REG_DEF_COUNT", "(", "i", ")", ")", "{", "fprintf", "(", "file", ",", "\"%dd\"", ",", "DF_REG_DEF_COUNT", "(", "i", ")", ")", ";", "sep", "=", "\",\"", ";", "dcount", "+=", "DF_REG_DEF_COUNT", "(", "i", ")", ";", "}", "if", "(", "DF_REG_USE_COUNT", "(", "i", ")", ")", "{", "fprintf", "(", "file", ",", "\"%s%du\"", ",", "sep", ",", "DF_REG_USE_COUNT", "(", "i", ")", ")", ";", "sep", "=", "\",\"", ";", "ucount", "+=", "DF_REG_USE_COUNT", "(", "i", ")", ";", "}", "if", "(", "DF_REG_EQ_USE_COUNT", "(", "i", ")", ")", "{", "fprintf", "(", "file", ",", "\"%s%de\"", ",", "sep", ",", "DF_REG_EQ_USE_COUNT", "(", "i", ")", ")", ";", "ecount", "+=", "DF_REG_EQ_USE_COUNT", "(", "i", ")", ";", "}", "fprintf", "(", "file", ",", "\"}", "\"", ")", ";", "}", "FOR_EACH_BB", "(", "bb", ")", "FOR_BB_INSNS", "(", "bb", ",", "insn", ")", "if", "(", "INSN_P", "(", "insn", ")", ")", "{", "if", "(", "CALL_P", "(", "insn", ")", ")", "ccount", "++", ";", "else", "icount", "++", ";", "}", "fprintf", "(", "file", ",", "\"\\;;", "total", "ref", "usage", "%d{%dd,%du,%de}\"", "\"", "in", "%d{%d", "regular", "+", "%d", "call}", "insns.\\\"", ",", "dcount", "+", "ucount", "+", "ecount", ",", "dcount", ",", "ucount", ",", "ecount", ",", "icount", "+", "ccount", ",", "icount", ",", "ccount", ")", ";", "}'" ]
df_scan_start_dump
SuperHouse/esp-open-rtos
single_line
train
831
1,047
[ "Delete", "all", "du", "chain", "(DF_REF_CHAIN())", "of", "all", "refs", "in", "the", "ref", "chain" ]
[ "'static", "void", "df_ref_chain_delete_du_chain", "(", "df_ref", "*", "ref_rec", ")", "{", "while", "(", "*", "ref_rec", ")", "{", "df_ref", "ref", "=", "*", "ref_rec", ";", "/*", "CHAIN", "is", "allocated", "by", "DF_CHAIN.", "So", "make", "sure", "to", "pass", "df_scan", "instance", "for", "the", "problem.", "*/", "if", "(", "DF_REF_CHAIN", "(", "ref", ")", ")", "df_chain_unlink", "(", "ref", ")", ";", "ref_rec", "++", ";", "}", "}'" ]
df_ref_chain_delete_du_chain
SuperHouse/esp-open-rtos
single_line
train
832
1,048
[ "Delete", "all", "refs", "in", "the", "ref", "chain" ]
[ "'static", "void", "df_ref_chain_delete", "(", "df_ref", "*", "ref_rec", ")", "{", "df_ref", "*", "start", "=", "ref_rec", ";", "while", "(", "*", "ref_rec", ")", "{", "df_reg_chain_unlink", "(", "*", "ref_rec", ")", ";", "ref_rec", "++", ";", "}", "/*", "If", "the", "list", "is", "empty,", "it", "has", "a", "special", "shared", "element", "that", "is", "not", "to", "be", "deleted.", "*/", "if", "(", "*", "start", ")", "free", "(", "start", ")", ";", "}'" ]
df_ref_chain_delete
SuperHouse/esp-open-rtos
single_line
train
833
1,049
[ "Get", "the", "value", "of", "regs_ever_live[REGNO]" ]
[ "'bool", "df_regs_ever_live_p", "(", "unsigned", "int", "regno", ")", "{", "return", "regs_ever_live", "[", "regno", "]", ";", "}'" ]
df_regs_ever_live_p
SuperHouse/esp-open-rtos
single_line
train
834
1,050
[ "Set", "the", "bit", "for", "regs", "that", "are", "considered", "being", "used", "at", "the", "exit" ]
[ "'static", "void", "df_get_exit_block_use_set", "(", "bitmap", "exit_block_uses", ")", "{", "unsigned", "int", "i", ";", "unsigned", "int", "picreg", "=", "PIC_OFFSET_TABLE_REGNUM", ";", "bitmap_clear", "(", "exit_block_uses", ")", ";", "/*", "Stack", "pointer", "is", "always", "live", "at", "the", "exit.", "*/", "bitmap_set_bit", "(", "exit_block_uses", ",", "STACK_POINTER_REGNUM", ")", ";", "/*", "Mark", "the", "frame", "pointer", "if", "needed", "at", "the", "end", "of", "the", "function.", "If", "we", "end", "up", "eliminating", "it,", "it", "will", "be", "removed", "from", "the", "live", "list", "of", "each", "basic", "block", "by", "reload.", "*/", "if", "(", "(", "!", "reload_completed", ")", "||", "frame_pointer_needed", ")", "{", "bitmap_set_bit", "(", "exit_block_uses", ",", "FRAME_POINTER_REGNUM", ")", ";", "#", "if", "!", "HARD_FRAME_POINTER_IS_FRAME_POINTER", "/*", "If", "they", "are", "different,", "also", "mark", "the", "hard", "frame", "pointer", "as", "live.", "*/", "if", "(", "!", "LOCAL_REGNO", "(", "HARD_FRAME_POINTER_REGNUM", ")", ")", "bitmap_set_bit", "(", "exit_block_uses", ",", "HARD_FRAME_POINTER_REGNUM", ")", ";", "#", "endif", "}", "/*", "Many", "architectures", "have", "a", "GP", "register", "even", "without", "flag_pic.", "Assume", "the", "pic", "register", "is", "not", "in", "use,", "or", "will", "be", "handled", "by", "other", "means,", "if", "it", "is", "not", "fixed.", "*/", "if", "(", "!", "PIC_OFFSET_TABLE_REG_CALL_CLOBBERED", "&&", "picreg", "!=", "INVALID_REGNUM", "&&", "fixed_regs", "[", "picreg", "]", ")", "bitmap_set_bit", "(", "exit_block_uses", ",", "picreg", ")", ";", "/*", "Mark", "all", "global", "registers,", "and", "all", "registers", "used", "by", "the", "epilogue", "as", "being", "live", "at", "the", "end", "of", "the", "function", "since", "they", "may", "be", "referenced", "by", "our", "caller.", "*/", "for", "(", "i", "=", "0", ";", "i", "<", "FIRST_PSEUDO_REGISTER", ";", "i", "++", ")", "if", "(", "global_regs", "[", "i", "]", "||", "EPILOGUE_USES", "(", "i", ")", ")", "bitmap_set_bit", "(", "exit_block_uses", ",", "i", ")", ";", "if", "(", "HAVE_epilogue", "&&", "epilogue_completed", ")", "{", "/*", "Mark", "all", "call-saved", "registers", "that", "we", "actually", "used.", "*/", "for", "(", "i", "=", "0", ";", "i", "<", "FIRST_PSEUDO_REGISTER", ";", "i", "++", ")", "if", "(", "df_regs_ever_live_p", "(", "i", ")", "&&", "!", "LOCAL_REGNO", "(", "i", ")", "&&", "!", "TEST_HARD_REG_BIT", "(", "regs_invalidated_by_call", ",", "i", ")", ")", "bitmap_set_bit", "(", "exit_block_uses", ",", "i", ")", ";", "}", "#", "ifdef", "EH_RETURN_DATA_REGNO", "/*", "Mark", "the", "registers", "that", "will", "contain", "data", "for", "the", "handler.", "*/", "if", "(", "reload_completed", "&&", "crtl", "->", "calls_eh_return", ")", "for", "(", "i", "=", "0", ";", ";", "++", "i", ")", "{", "unsigned", "regno", "=", "EH_RETURN_DATA_REGNO", "(", "i", ")", ";", "if", "(", "regno", "==", "INVALID_REGNUM", ")", "break;", "bitmap_set_bit", "(", "exit_block_uses", ",", "regno", ")", ";", "}", "#", "endif", "#", "ifdef", "EH_RETURN_STACKADJ_RTX", "if", "(", "(", "!", "HAVE_epilogue", "||", "!", "epilogue_completed", ")", "&&", "crtl", "->", "calls_eh_return", ")", "{", "rtx", "tmp", "=", "EH_RETURN_STACKADJ_RTX", ";", "if", "(", "tmp", "&&", "REG_P", "(", "tmp", ")", ")", "df_mark_reg", "(", "tmp", ",", "exit_block_uses", ")", ";", "}", "#", "endif", "#", "ifdef", "EH_RETURN_HANDLER_RTX", "if", "(", "(", "!", "HAVE_epilogue", "||", "!", "epilogue_completed", ")", "&&", "crtl", "->", "calls_eh_return", ")", "{", "rtx", "tmp", "=", "EH_RETURN_HANDLER_RTX", ";", "if", "(", "tmp", "&&", "REG_P", "(", "tmp", ")", ")", "df_mark_reg", "(", "tmp", ",", "exit_block_uses", ")", ";", "}", "#", "endif", "/*", "Mark", "function", "return", "value.", "*/", "diddle_return_value", "(", "df_mark_reg", ",", "(", "void", "*", ")", "exit_block_uses", ")", ";", "}'" ]
df_get_exit_block_use_set
SuperHouse/esp-open-rtos
single_line
train
835
1,051
[ "Helper", "function", "for", "df_ref_change_reg_with_loc" ]
[ "'static", "void", "df_ref_change_reg_with_loc_1", "(", "struct", "df_reg_info", "*", "old_df", ",", "struct", "df_reg_info", "*", "new_df", ",", "int", "new_regno", ",", "rtx", "loc", ")", "{", "df_ref", "the_ref", "=", "old_df", "->", "reg_chain", ";", "while", "(", "the_ref", ")", "{", "if", "(", "(", "!", "DF_REF_IS_ARTIFICIAL", "(", "the_ref", ")", ")", "&&", "DF_REF_LOC", "(", "the_ref", ")", "&&", "(", "*", "DF_REF_LOC", "(", "the_ref", ")", "==", "loc", ")", ")", "{", "df_ref", "next_ref", "=", "DF_REF_NEXT_REG", "(", "the_ref", ")", ";", "df_ref", "prev_ref", "=", "DF_REF_PREV_REG", "(", "the_ref", ")", ";", "df_ref", "*", "ref_vec", ",", "<type", "ref=\"prev\">", "*", "ref_vec_t", ";", "struct", "df_insn_info", "*", "insn_info", "=", "DF_REF_INSN_INFO", "(", "the_ref", ")", ";", "unsigned", "int", "count", "=", "0", ";", "DF_REF_REGNO", "(", "the_ref", ")", "=", "new_regno", ";", "DF_REF_REG", "(", "the_ref", ")", "=", "regno_reg_rtx", "[", "new_regno", "]", ";", "/*", "Pull", "the_ref", "out", "of", "the", "old", "regno", "chain.", "*/", "if", "(", "prev_ref", ")", "DF_REF_NEXT_REG", "(", "prev_ref", ")", "=", "next_ref", ";", "else", "old_df", "->", "reg_chain", "=", "next_ref", ";", "if", "(", "next_ref", ")", "DF_REF_PREV_REG", "(", "next_ref", ")", "=", "prev_ref", ";", "old_df", "->", "n_refs", "--", ";", "/*", "Put", "the", "ref", "into", "the", "new", "regno", "chain.", "*/", "DF_REF_PREV_REG", "(", "the_ref", ")", "=", "NULL", ";", "DF_REF_NEXT_REG", "(", "the_ref", ")", "=", "new_df", "->", "reg_chain", ";", "if", "(", "new_df", "->", "reg_chain", ")", "DF_REF_PREV_REG", "(", "new_df", "->", "reg_chain", ")", "=", "the_ref", ";", "new_df", "->", "reg_chain", "=", "the_ref", ";", "new_df", "->", "n_refs", "++", ";", "if", "(", "DF_REF_BB", "(", "the_ref", ")", ")", "df_set_bb_dirty", "(", "DF_REF_BB", "(", "the_ref", ")", ")", ";", "/*", "Need", "to", "sort", "the", "record", "again", "that", "the", "ref", "was", "in", "because", "the", "regno", "is", "a", "sorting", "key.", "First,", "find", "the", "right", "record.", "*/", "if", "(", "DF_REF_FLAGS", "(", "the_ref", ")", "&", "DF_REF_IN_NOTE", ")", "ref_vec", "=", "insn_info", "->", "eq_uses", ";", "else", "ref_vec", "=", "insn_info", "->", "uses", ";", "if", "(", "dump_file", ")", "fprintf", "(", "dump_file", ",", "\"changing", "reg", "in", "insn", "%d\\\"", ",", "DF_REF_INSN_UID", "(", "the_ref", ")", ")", ";", "ref_vec_t", "=", "ref_vec", ";", "/*", "Find", "the", "length.", "*/", "while", "(", "*", "ref_vec_t", ")", "{", "count", "++", ";", "ref_vec_t", "++", ";", "}", "qsort", "(", "ref_vec", ",", "count", ",", "sizeof", "(", "df_ref", ")", ",", "df_ref_compare", ")", ";", "the_ref", "=", "next_ref", ";", "}", "else", "the_ref", "=", "DF_REF_NEXT_REG", "(", "the_ref", ")", ";", "}", "}'" ]
df_ref_change_reg_with_loc_1
SuperHouse/esp-open-rtos
single_line
train
836
1,052
[ "Allocate", "a", "ref", "and", "initialize", "its", "fields" ]
[ "'static", "df_ref", "df_ref_create_structure", "(", "enum", "df_ref_class", "cl", ",", "struct", "df_collection_rec", "*", "collection_rec", ",", "rtx", "reg", ",", "rtx", "*", "loc", ",", "basic_block", "bb", ",", "struct", "df_insn_info", "*", "info", ",", "enum", "df_ref_type", "ref_type", ",", "int", "ref_flags", ")", "{", "df_ref", "this_ref", "=", "NULL", ";", "int", "regno", "=", "REGNO", "(", "GET_CODE", "(", "reg", ")", "==", "SUBREG", "?", "SUBREG_REG", "(", "reg", ")", ":", "reg", ")", ";", "struct", "df_scan_problem_data", "*", "problem_data", "=", "(", "struct", "df_scan_problem_data", "*", ")", "df_scan", "->", "problem_data", ";", "switch", "(", "cl", ")", "{", "case", "DF_REF_BASE", ":", "this_ref", "=", "(", "df_ref", ")", "pool_alloc", "(", "problem_data", "->", "ref_base_pool", ")", ";", "gcc_checking_assert", "(", "loc", "==", "NULL", ")", ";", "break;", "case", "DF_REF_ARTIFICIAL", ":", "this_ref", "=", "(", "df_ref", ")", "pool_alloc", "(", "problem_data", "->", "ref_artificial_pool", ")", ";", "this_ref", "->", "artificial_ref", ".", "bb", "=", "bb", ";", "gcc_checking_assert", "(", "loc", "==", "NULL", ")", ";", "break;", "case", "DF_REF_REGULAR", ":", "this_ref", "=", "(", "df_ref", ")", "pool_alloc", "(", "problem_data", "->", "ref_regular_pool", ")", ";", "this_ref", "->", "regular_ref", ".", "loc", "=", "loc", ";", "gcc_checking_assert", "(", "loc", ")", ";", "break;", "}", "DF_REF_CLASS", "(", "this_ref", ")", "=", "cl", ";", "DF_REF_ID", "(", "this_ref", ")", "=", "-", "1", ";", "DF_REF_REG", "(", "this_ref", ")", "=", "reg", ";", "DF_REF_REGNO", "(", "this_ref", ")", "=", "regno", ";", "DF_REF_TYPE", "(", "this_ref", ")", "=", "ref_type", ";", "DF_REF_INSN_INFO", "(", "this_ref", ")", "=", "info", ";", "DF_REF_CHAIN", "(", "this_ref", ")", "=", "NULL", ";", "DF_REF_FLAGS", "(", "this_ref", ")", "=", "ref_flags", ";", "DF_REF_NEXT_REG", "(", "this_ref", ")", "=", "NULL", ";", "DF_REF_PREV_REG", "(", "this_ref", ")", "=", "NULL", ";", "DF_REF_ORDER", "(", "this_ref", ")", "=", "df", "->", "ref_order", "++", ";", "/*", "We", "need", "to", "clear", "this", "bit", "because", "fwprop,", "and", "in", "the", "future", "possibly", "other", "optimizations", "sometimes", "create", "new", "refs", "using", "ond", "refs", "as", "the", "model.", "*/", "DF_REF_FLAGS_CLEAR", "(", "this_ref", ",", "DF_HARD_REG_LIVE", ")", ";", "/*", "See", "if", "this", "ref", "needs", "to", "have", "DF_HARD_REG_LIVE", "bit", "set.", "*/", "if", "(", "regno", "<", "FIRST_PSEUDO_REGISTER", "&&", "!", "DF_REF_IS_ARTIFICIAL", "(", "this_ref", ")", "&&", "!", "DEBUG_INSN_P", "(", "DF_REF_INSN", "(", "this_ref", ")", ")", ")", "{", "if", "(", "DF_REF_REG_DEF_P", "(", "this_ref", ")", ")", "{", "if", "(", "!", "DF_REF_FLAGS_IS_SET", "(", "this_ref", ",", "DF_REF_MAY_CLOBBER", ")", ")", "DF_REF_FLAGS_SET", "(", "this_ref", ",", "DF_HARD_REG_LIVE", ")", ";", "}", "<if", "type=\"elseif\">", "else", "if", "(", "!", "(", "TEST_HARD_REG_BIT", "(", "elim_reg_set", ",", "regno", ")", "&&", "(", "regno", "==", "FRAME_POINTER_REGNUM", "||", "regno", "==", "ARG_POINTER_REGNUM", ")", ")", ")", "DF_REF_FLAGS_SET", "(", "this_ref", ",", "DF_HARD_REG_LIVE", ")", ";", "}", "if", "(", "collection_rec", ")", "{", "if", "(", "DF_REF_REG_DEF_P", "(", "this_ref", ")", ")", "collection_rec", "->", "def_vec", ".", "safe_push", "(", "this_ref", ")", ";", "<if", "type=\"elseif\">", "else", "if", "(", "DF_REF_FLAGS", "(", "this_ref", ")", "&", "DF_REF_IN_NOTE", ")", "collection_rec", "->", "eq_use_vec", ".", "safe_push", "(", "this_ref", ")", ";", "else", "collection_rec", "->", "use_vec", ".", "safe_push", "(", "this_ref", ")", ";", "}", "else", "df_install_ref_incremental", "(", "this_ref", ")", ";", "return", "this_ref", ";", "}'" ]
df_ref_create_structure
SuperHouse/esp-open-rtos
single_line
train
837
1,053
[ "Get", "the", "artificial", "use", "set", "for", "an", "eh", "block" ]
[ "'static", "void", "df_get_eh_block_artificial_uses", "(", "bitmap", "eh_block_artificial_uses", ")", "{", "bitmap_clear", "(", "eh_block_artificial_uses", ")", ";", "/*", "The", "following", "code", "(down", "through", "the", "arg_pointer", "setting", "APPEARS", "to", "be", "necessary", "because", "there", "is", "nothing", "that", "actually", "describes", "what", "the", "exception", "handling", "code", "may", "actually", "need", "to", "keep", "alive.", "*/", "if", "(", "reload_completed", ")", "{", "if", "(", "frame_pointer_needed", ")", "{", "bitmap_set_bit", "(", "eh_block_artificial_uses", ",", "FRAME_POINTER_REGNUM", ")", ";", "#", "if", "!", "HARD_FRAME_POINTER_IS_FRAME_POINTER", "bitmap_set_bit", "(", "eh_block_artificial_uses", ",", "HARD_FRAME_POINTER_REGNUM", ")", ";", "#", "endif", "}", "#", "if", "FRAME_POINTER_REGNUM", "!=", "ARG_POINTER_REGNUM", "if", "(", "fixed_regs", "[", "ARG_POINTER_REGNUM", "]", ")", "bitmap_set_bit", "(", "eh_block_artificial_uses", ",", "ARG_POINTER_REGNUM", ")", ";", "#", "endif", "}", "}'" ]
df_get_eh_block_artificial_uses
SuperHouse/esp-open-rtos
single_line
train
838
1,054
[ "Process", "all", "of", "the", "deferred", "rescans", "or", "deletions" ]
[ "'void", "df_process_deferred_rescans", "(", "void", ")", "{", "bool", "no_insn_rescan", "=", "false", ";", "bool", "defer_insn_rescan", "=", "false", ";", "bitmap_iterator", "bi", ";", "unsigned", "int", "uid", ";", "bitmap_head", "tmp", ";", "bitmap_initialize", "(", "&", "tmp", ",", "&", "df_bitmap_obstack", ")", ";", "if", "(", "df", "->", "changeable_flags", "&", "DF_NO_INSN_RESCAN", ")", "{", "df_clear_flags", "(", "DF_NO_INSN_RESCAN", ")", ";", "no_insn_rescan", "=", "true", ";", "}", "if", "(", "df", "->", "changeable_flags", "&", "DF_DEFER_INSN_RESCAN", ")", "{", "df_clear_flags", "(", "DF_DEFER_INSN_RESCAN", ")", ";", "defer_insn_rescan", "=", "true", ";", "}", "if", "(", "dump_file", ")", "fprintf", "(", "dump_file", ",", "\"starting", "the", "processing", "of", "deferred", "insns\\\"", ")", ";", "bitmap_copy", "(", "&", "tmp", ",", "&", "df", "->", "insns_to_delete", ")", ";", "EXECUTE_IF_SET_IN_BITMAP", "(", "&tmp", ",", "0", ",", "uid", ",", "bi", ")", "{", "struct", "df_insn_info", "*", "insn_info", "=", "DF_INSN_UID_SAFE_GET", "(", "uid", ")", ";", "if", "(", "insn_info", ")", "df_insn_delete", "(", "NULL", ",", "uid", ")", ";", "}", "bitmap_copy", "(", "&", "tmp", ",", "&", "df", "->", "insns_to_rescan", ")", ";", "EXECUTE_IF_SET_IN_BITMAP", "(", "&tmp", ",", "0", ",", "uid", ",", "bi", ")", "{", "struct", "df_insn_info", "*", "insn_info", "=", "DF_INSN_UID_SAFE_GET", "(", "uid", ")", ";", "if", "(", "insn_info", ")", "df_insn_rescan", "(", "insn_info", "->", "insn", ")", ";", "}", "bitmap_copy", "(", "&", "tmp", ",", "&", "df", "->", "insns_to_notes_rescan", ")", ";", "EXECUTE_IF_SET_IN_BITMAP", "(", "&tmp", ",", "0", ",", "uid", ",", "bi", ")", "{", "struct", "df_insn_info", "*", "insn_info", "=", "DF_INSN_UID_SAFE_GET", "(", "uid", ")", ";", "if", "(", "insn_info", ")", "df_notes_rescan", "(", "insn_info", "->", "insn", ")", ";", "}", "if", "(", "dump_file", ")", "fprintf", "(", "dump_file", ",", "\"ending", "the", "processing", "of", "deferred", "insns\\\"", ")", ";", "bitmap_clear", "(", "&", "tmp", ")", ";", "bitmap_clear", "(", "&", "df", "->", "insns_to_delete", ")", ";", "bitmap_clear", "(", "&", "df", "->", "insns_to_rescan", ")", ";", "bitmap_clear", "(", "&", "df", "->", "insns_to_notes_rescan", ")", ";", "if", "(", "no_insn_rescan", ")", "df_set_flags", "(", "DF_NO_INSN_RESCAN", ")", ";", "if", "(", "defer_insn_rescan", ")", "df_set_flags", "(", "DF_DEFER_INSN_RESCAN", ")", ";", "/*", "If", "someone", "changed", "regs_ever_live", "during", "this", "pass,", "fix", "up", "the", "entry", "and", "exit", "blocks.", "*/", "if", "(", "df", "->", "redo_entry_and_exit", ")", "{", "df_update_entry_exit_and_calls", "()", ";", "df", "->", "redo_entry_and_exit", "=", "false", ";", "}", "}'" ]
df_process_deferred_rescans
SuperHouse/esp-open-rtos
single_line
train
839
1,055
[ "Unlink", "REF", "from", "all", "defuse", "usedef", "chains,", "etc" ]
[ "'void", "df_ref_remove", "(", "df_ref", "ref", ")", "{", "#", "if", "0", "if", "(dump_file)", "{", "fprintf", "(dump_file,", "\"removing", "ref", "\");", "df_ref_debug", "(ref,", "dump_file);", "}", "#", "endif", "if", "(", "DF_REF_REG_DEF_P", "(", "ref", ")", ")", "{", "if", "(", "DF_REF_IS_ARTIFICIAL", "(", "ref", ")", ")", "{", "struct", "df_scan_bb_info", "*", "bb_info", "=", "df_scan_get_bb_info", "(", "DF_REF_BBNO", "(", "ref", ")", ")", ";", "df_ref_compress_rec", "(", "&", "bb_info", "->", "artificial_defs", ",", "ref", ")", ";", "}", "else", "{", "unsigned", "int", "uid", "=", "DF_REF_INSN_UID", "(", "ref", ")", ";", "struct", "df_insn_info", "*", "insn_rec", "=", "DF_INSN_UID_GET", "(", "uid", ")", ";", "df_ref_compress_rec", "(", "&", "insn_rec", "->", "defs", ",", "ref", ")", ";", "}", "}", "else", "{", "if", "(", "DF_REF_IS_ARTIFICIAL", "(", "ref", ")", ")", "{", "struct", "df_scan_bb_info", "*", "bb_info", "=", "df_scan_get_bb_info", "(", "DF_REF_BBNO", "(", "ref", ")", ")", ";", "df_ref_compress_rec", "(", "&", "bb_info", "->", "artificial_uses", ",", "ref", ")", ";", "}", "else", "{", "unsigned", "int", "uid", "=", "DF_REF_INSN_UID", "(", "ref", ")", ";", "struct", "df_insn_info", "*", "insn_rec", "=", "DF_INSN_UID_GET", "(", "uid", ")", ";", "if", "(", "DF_REF_FLAGS", "(", "ref", ")", "&", "DF_REF_IN_NOTE", ")", "df_ref_compress_rec", "(", "&", "insn_rec", "->", "eq_uses", ",", "ref", ")", ";", "else", "df_ref_compress_rec", "(", "&", "insn_rec", "->", "uses", ",", "ref", ")", ";", "}", "}", "/*", "By", "deleting", "the", "ref", "directly,", "df_insn_rescan", "my", "not", "find", "any", "differences", "even", "though", "the", "block", "will", "have", "changed.", "So", "we", "need", "to", "mark", "the", "block", "dirty", "ourselves.", "*/", "if", "(", "!", "DEBUG_INSN_P", "(", "DF_REF_INSN", "(", "ref", ")", ")", ")", "df_set_bb_dirty", "(", "DF_REF_BB", "(", "ref", ")", ")", ";", "df_reg_chain_unlink", "(", "ref", ")", ";", "}'" ]
df_ref_remove
SuperHouse/esp-open-rtos
single_line
train
840
1,056
[ "Sort", "and", "remove", "duplicates", "from", "the", "COLLECTION_REC" ]
[ "'static", "void", "df_canonize_collection_rec", "(", "struct", "df_collection_rec", "*", "collection_rec", ")", "{", "df_sort_and_compress_refs", "(", "&", "collection_rec", "->", "def_vec", ")", ";", "df_sort_and_compress_refs", "(", "&", "collection_rec", "->", "use_vec", ")", ";", "df_sort_and_compress_refs", "(", "&", "collection_rec", "->", "eq_use_vec", ")", ";", "df_sort_and_compress_mws", "(", "&", "collection_rec", "->", "mw_vec", ")", ";", "}'" ]
df_canonize_collection_rec
SuperHouse/esp-open-rtos
single_line
train
841
1,057
[ "Set", "the", "bit", "for", "regs", "that", "are", "considered", "being", "defined", "at", "the", "entry" ]
[ "'static", "void", "df_get_entry_block_def_set", "(", "bitmap", "entry_block_defs", ")", "{", "rtx", "r", ";", "int", "i", ";", "bitmap_clear", "(", "entry_block_defs", ")", ";", "for", "(", "i", "=", "0", ";", "i", "<", "FIRST_PSEUDO_REGISTER", ";", "i", "++", ")", "{", "if", "(", "global_regs", "[", "i", "]", ")", "bitmap_set_bit", "(", "entry_block_defs", ",", "i", ")", ";", "if", "(", "FUNCTION_ARG_REGNO_P", "(", "i", ")", ")", "bitmap_set_bit", "(", "entry_block_defs", ",", "INCOMING_REGNO", "(", "i", ")", ")", ";", "}", "/*", "The", "always", "important", "stack", "pointer.", "*/", "bitmap_set_bit", "(", "entry_block_defs", ",", "STACK_POINTER_REGNUM", ")", ";", "/*", "Once", "the", "prologue", "has", "been", "generated,", "all", "of", "these", "registers", "should", "just", "show", "up", "in", "the", "first", "regular", "block.", "*/", "if", "(", "HAVE_prologue", "&&", "epilogue_completed", ")", "{", "/*", "Defs", "for", "the", "callee", "saved", "registers", "are", "inserted", "so", "that", "the", "pushes", "have", "some", "defining", "location.", "*/", "for", "(", "i", "=", "0", ";", "i", "<", "FIRST_PSEUDO_REGISTER", ";", "i", "++", ")", "if", "(", "(", "call_used_regs", "[", "i", "]", "==", "0", ")", "&&", "(", "df_regs_ever_live_p", "(", "i", ")", ")", ")", "bitmap_set_bit", "(", "entry_block_defs", ",", "i", ")", ";", "}", "r", "=", "targetm", ".", "calls", ".", "struct_value_rtx", "(", "current_function_decl", ",", "true", ")", ";", "if", "(", "r", "&&", "REG_P", "(", "r", ")", ")", "bitmap_set_bit", "(", "entry_block_defs", ",", "REGNO", "(", "r", ")", ")", ";", "/*", "If", "the", "function", "has", "an", "incoming", "STATIC_CHAIN,", "it", "has", "to", "show", "up", "in", "the", "entry", "def", "set.", "*/", "r", "=", "targetm", ".", "calls", ".", "static_chain", "(", "current_function_decl", ",", "true", ")", ";", "if", "(", "r", "&&", "REG_P", "(", "r", ")", ")", "bitmap_set_bit", "(", "entry_block_defs", ",", "REGNO", "(", "r", ")", ")", ";", "if", "(", "(", "!", "reload_completed", ")", "||", "frame_pointer_needed", ")", "{", "/*", "Any", "reference", "to", "any", "pseudo", "before", "reload", "is", "a", "potential", "reference", "of", "the", "frame", "pointer.", "*/", "bitmap_set_bit", "(", "entry_block_defs", ",", "FRAME_POINTER_REGNUM", ")", ";", "#", "if", "!", "HARD_FRAME_POINTER_IS_FRAME_POINTER", "/*", "If", "they", "are", "different,", "also", "mark", "the", "hard", "frame", "pointer", "as", "live.", "*/", "if", "(", "!", "LOCAL_REGNO", "(", "HARD_FRAME_POINTER_REGNUM", ")", ")", "bitmap_set_bit", "(", "entry_block_defs", ",", "HARD_FRAME_POINTER_REGNUM", ")", ";", "#", "endif", "}", "/*", "These", "registers", "are", "live", "everywhere.", "*/", "if", "(", "!", "reload_completed", ")", "{", "#", "ifdef", "PIC_OFFSET_TABLE_REGNUM", "unsigned", "int", "picreg", "=", "PIC_OFFSET_TABLE_REGNUM", ";", "#", "endif", "#", "if", "FRAME_POINTER_REGNUM", "!=", "ARG_POINTER_REGNUM", "/*", "Pseudos", "with", "argument", "area", "equivalences", "may", "require", "reloading", "via", "the", "argument", "pointer.", "*/", "if", "(", "fixed_regs", "[", "ARG_POINTER_REGNUM", "]", ")", "bitmap_set_bit", "(", "entry_block_defs", ",", "ARG_POINTER_REGNUM", ")", ";", "#", "endif", "#", "ifdef", "PIC_OFFSET_TABLE_REGNUM", "/*", "Any", "constant,", "or", "pseudo", "with", "constant", "equivalences,", "may", "require", "reloading", "from", "memory", "using", "the", "pic", "register.", "*/", "if", "(", "picreg", "!=", "INVALID_REGNUM", "&&", "fixed_regs", "[", "picreg", "]", ")", "bitmap_set_bit", "(", "entry_block_defs", ",", "picreg", ")", ";", "#", "endif", "}", "#", "ifdef", "INCOMING_RETURN_ADDR_RTX", "if", "(", "REG_P", "(", "INCOMING_RETURN_ADDR_RTX", ")", ")", "bitmap_set_bit", "(", "entry_block_defs", ",", "REGNO", "(", "INCOMING_RETURN_ADDR_RTX", ")", ")", ";", "#", "endif", "targetm", ".", "extra_live_on_entry", "(", "entry_block_defs", ")", ";", "}'" ]
df_get_entry_block_def_set
SuperHouse/esp-open-rtos
single_line
train
842
1,058
[ "Internal", "function", "to", "shut", "down", "the", "scanning", "problem" ]
[ "'static", "void", "df_scan_free_internal", "(", "void", ")", "{", "struct", "df_scan_problem_data", "*", "problem_data", "=", "(", "struct", "df_scan_problem_data", "*", ")", "df_scan", "->", "problem_data", ";", "unsigned", "int", "i", ";", "basic_block", "bb", ";", "/*", "The", "vectors", "that", "hold", "the", "refs", "are", "not", "pool", "allocated", "because", "they", "come", "in", "many", "sizes.", "This", "makes", "them", "impossible", "to", "delete", "all", "at", "once.", "*/", "for", "(", "i", "=", "0", ";", "i", "<", "DF_INSN_SIZE", "()", ";", "i", "++", ")", "{", "struct", "df_insn_info", "*", "insn_info", "=", "DF_INSN_UID_GET", "(", "i", ")", ";", "/*", "Skip", "the", "insns", "that", "have", "no", "insn_info", "or", "have", "been", "deleted.", "*/", "if", "(", "insn_info", ")", "{", "df_scan_free_ref_vec", "(", "insn_info", "->", "defs", ")", ";", "df_scan_free_ref_vec", "(", "insn_info", "->", "uses", ")", ";", "df_scan_free_ref_vec", "(", "insn_info", "->", "eq_uses", ")", ";", "df_scan_free_mws_vec", "(", "insn_info", "->", "mw_hardregs", ")", ";", "}", "}", "FOR_ALL_BB", "(", "bb", ")", "{", "unsigned", "int", "bb_index", "=", "bb", "->", "index", ";", "struct", "df_scan_bb_info", "*", "bb_info", "=", "df_scan_get_bb_info", "(", "bb_index", ")", ";", "if", "(", "bb_info", ")", "{", "df_scan_free_ref_vec", "(", "bb_info", "->", "artificial_defs", ")", ";", "df_scan_free_ref_vec", "(", "bb_info", "->", "artificial_uses", ")", ";", "}", "}", "free", "(", "df", "->", "def_info", ".", "refs", ")", ";", "free", "(", "df", "->", "def_info", ".", "begin", ")", ";", "free", "(", "df", "->", "def_info", ".", "count", ")", ";", "memset", "(", "&", "df", "->", "def_info", ",", "0", ",", "(", "sizeof", "(", "struct", "df_ref_info", ")", ")", ")", ";", "free", "(", "df", "->", "use_info", ".", "refs", ")", ";", "free", "(", "df", "->", "use_info", ".", "begin", ")", ";", "free", "(", "df", "->", "use_info", ".", "count", ")", ";", "memset", "(", "&", "df", "->", "use_info", ",", "0", ",", "(", "sizeof", "(", "struct", "df_ref_info", ")", ")", ")", ";", "free", "(", "df", "->", "def_regs", ")", ";", "df", "->", "def_regs", "=", "NULL", ";", "free", "(", "df", "->", "use_regs", ")", ";", "df", "->", "use_regs", "=", "NULL", ";", "free", "(", "df", "->", "eq_use_regs", ")", ";", "df", "->", "eq_use_regs", "=", "NULL", ";", "df", "->", "regs_size", "=", "0", ";", "DF_REG_SIZE", "(", "df", ")", "=", "0", ";", "free", "(", "df", "->", "insns", ")", ";", "df", "->", "insns", "=", "NULL", ";", "DF_INSN_SIZE", "()", "=", "0", ";", "free", "(", "df_scan", "->", "block_info", ")", ";", "df_scan", "->", "block_info", "=", "NULL", ";", "df_scan", "->", "block_info_size", "=", "0", ";", "bitmap_clear", "(", "&", "df", "->", "hardware_regs_used", ")", ";", "bitmap_clear", "(", "&", "df", "->", "regular_block_artificial_uses", ")", ";", "bitmap_clear", "(", "&", "df", "->", "eh_block_artificial_uses", ")", ";", "BITMAP_FREE", "(", "df", "->", "entry_block_defs", ")", ";", "BITMAP_FREE", "(", "df", "->", "exit_block_uses", ")", ";", "bitmap_clear", "(", "&", "df", "->", "insns_to_delete", ")", ";", "bitmap_clear", "(", "&", "df", "->", "insns_to_rescan", ")", ";", "bitmap_clear", "(", "&", "df", "->", "insns_to_notes_rescan", ")", ";", "free_alloc_pool", "(", "problem_data", "->", "ref_base_pool", ")", ";", "free_alloc_pool", "(", "problem_data", "->", "ref_artificial_pool", ")", ";", "free_alloc_pool", "(", "problem_data", "->", "ref_regular_pool", ")", ";", "free_alloc_pool", "(", "problem_data", "->", "insn_pool", ")", ";", "free_alloc_pool", "(", "problem_data", "->", "reg_pool", ")", ";", "free_alloc_pool", "(", "problem_data", "->", "mw_reg_pool", ")", ";", "bitmap_obstack_release", "(", "&", "problem_data", "->", "reg_bitmaps", ")", ";", "bitmap_obstack_release", "(", "&", "problem_data", "->", "insn_bitmaps", ")", ";", "free", "(", "df_scan", "->", "problem_data", ")", ";", "}'" ]
df_scan_free_internal
SuperHouse/esp-open-rtos
single_line
train
843
1,059
[ "Add", "the", "refs", "in", "REF_VEC", "to", "the", "table", "in", "REF_INFO", "starting", "at", "OFFSET" ]
[ "'static", "unsigned", "int", "df_add_refs_to_table", "(", "unsigned", "int", "offset", ",", "struct", "df_ref_info", "*", "ref_info", ",", "df_ref", "*", "ref_vec", ")", "{", "while", "(", "*", "ref_vec", ")", "{", "df_ref", "ref", "=", "*", "ref_vec", ";", "if", "(", "(", "!", "(", "df", "->", "changeable_flags", "&", "DF_NO_HARD_REGS", ")", ")", "||", "(", "DF_REF_REGNO", "(", "ref", ")", ">=", "FIRST_PSEUDO_REGISTER", ")", ")", "{", "ref_info", "->", "refs", "[", "offset", "]", "=", "ref", ";", "DF_REF_ID", "(", "*", "ref_vec", ")", "=", "offset", "++", ";", "}", "ref_vec", "++", ";", "}", "return", "offset", ";", "}'" ]
df_add_refs_to_table
SuperHouse/esp-open-rtos
single_line
train
844
1,060
[ "Add", "the", "new", "df_ref", "to", "appropriate", "reg_info", "ref_info", "chains" ]
[ "'static", "void", "df_install_ref", "(", "df_ref", "this_ref", ",", "struct", "df_reg_info", "*", "reg_info", ",", "struct", "df_ref_info", "*", "ref_info", ",", "bool", "add_to_table", ")", "{", "unsigned", "int", "regno", "=", "DF_REF_REGNO", "(", "this_ref", ")", ";", "/*", "Add", "the", "ref", "to", "the", "reg_{def,use,eq_use}", "chain.", "*/", "df_ref", "head", "=", "reg_info", "->", "reg_chain", ";", "reg_info", "->", "reg_chain", "=", "this_ref", ";", "reg_info", "->", "n_refs", "++", ";", "if", "(", "DF_REF_FLAGS_IS_SET", "(", "this_ref", ",", "DF_HARD_REG_LIVE", ")", ")", "{", "gcc_assert", "(", "regno", "<", "FIRST_PSEUDO_REGISTER", ")", ";", "df", "->", "hard_regs_live_count", "[", "regno", "]", "++", ";", "}", "gcc_checking_assert", "(", "DF_REF_NEXT_REG", "(", "this_ref", ")", "==", "NULL", "&&", "DF_REF_PREV_REG", "(", "this_ref", ")", "==", "NULL", ")", ";", "DF_REF_NEXT_REG", "(", "this_ref", ")", "=", "head", ";", "/*", "We", "cannot", "actually", "link", "to", "the", "head", "of", "the", "chain.", "*/", "DF_REF_PREV_REG", "(", "this_ref", ")", "=", "NULL", ";", "if", "(", "head", ")", "DF_REF_PREV_REG", "(", "head", ")", "=", "this_ref", ";", "if", "(", "add_to_table", ")", "{", "gcc_assert", "(", "ref_info", "->", "ref_order", "!=", "DF_REF_ORDER_NO_TABLE", ")", ";", "df_check_and_grow_ref_info", "(", "ref_info", ",", "1", ")", ";", "DF_REF_ID", "(", "this_ref", ")", "=", "ref_info", "->", "table_size", ";", "/*", "Add", "the", "ref", "to", "the", "big", "array", "of", "defs.", "*/", "ref_info", "->", "refs", "[", "ref_info", "->", "table_size", "]", "=", "this_ref", ";", "ref_info", "->", "table_size", "++", ";", "}", "else", "DF_REF_ID", "(", "this_ref", ")", "=", "-", "1", ";", "ref_info", "->", "total_size", "++", ";", "}'" ]
df_install_ref
SuperHouse/esp-open-rtos
single_line
train
845
1,061
[ "Initialize", "some", "platform", "specific", "structures" ]
[ "'void", "df_hard_reg_init", "(", "void", ")", "{", "#", "ifdef", "ELIMINABLE_REGS", "int", "i", ";", "static", "const", "struct", "{", "const", "int", "from", ",", "<type", "ref=\"prev\"/>", "to", ";", "}", "eliminables", "[]", "=", "ELIMINABLE_REGS", ";", "#", "endif", "if", "(", "initialized", ")", "return", ";", "/*", "Record", "which", "registers", "will", "be", "eliminated.", "We", "use", "this", "in", "mark_used_regs.", "*/", "CLEAR_HARD_REG_SET", "(", "elim_reg_set", ")", ";", "#", "ifdef", "ELIMINABLE_REGS", "for", "(", "i", "=", "0", ";", "i", "<", "(", "int", ")", "ARRAY_SIZE", "(", "eliminables", ")", ";", "i", "++", ")", "SET_HARD_REG_BIT", "(", "elim_reg_set", ",", "eliminables", "[", "i", "]", ".", "from", ")", ";", "#", "else", "SET_HARD_REG_BIT", "(", "elim_reg_set", ",", "FRAME_POINTER_REGNUM", ")", ";", "#", "endif", "initialized", "=", "true", ";", "}'" ]
df_hard_reg_init
SuperHouse/esp-open-rtos
single_line
train
846
1,062
[ "Free", "all", "of", "the", "data", "associated", "with", "the", "scan", "problem" ]
[ "'static", "void", "df_scan_free", "(", "void", ")", "{", "if", "(", "df_scan", "->", "problem_data", ")", "df_scan_free_internal", "()", ";", "if", "(", "df", "->", "blocks_to_analyze", ")", "{", "BITMAP_FREE", "(", "df", "->", "blocks_to_analyze", ")", ";", "df", "->", "blocks_to_analyze", "=", "NULL", ";", "}", "free", "(", "df_scan", ")", ";", "}'" ]
df_scan_free
SuperHouse/esp-open-rtos
single_line
train
847
1,063
[ "Update", "the", "defs", "in", "the", "entry", "block" ]
[ "'void", "df_update_entry_block_defs", "(", "void", ")", "{", "bitmap_head", "refs", ";", "bool", "changed", "=", "false", ";", "bitmap_initialize", "(", "&", "refs", ",", "&", "df_bitmap_obstack", ")", ";", "df_get_entry_block_def_set", "(", "&", "refs", ")", ";", "if", "(", "df", "->", "entry_block_defs", ")", "{", "if", "(", "!", "bitmap_equal_p", "(", "df", "->", "entry_block_defs", ",", "&", "refs", ")", ")", "{", "struct", "df_scan_bb_info", "*", "bb_info", "=", "df_scan_get_bb_info", "(", "ENTRY_BLOCK", ")", ";", "df_ref_chain_delete_du_chain", "(", "bb_info", "->", "artificial_defs", ")", ";", "df_ref_chain_delete", "(", "bb_info", "->", "artificial_defs", ")", ";", "bb_info", "->", "artificial_defs", "=", "NULL", ";", "changed", "=", "true", ";", "}", "}", "else", "{", "struct", "df_scan_problem_data", "*", "problem_data", "=", "(", "struct", "df_scan_problem_data", "*", ")", "df_scan", "->", "problem_data", ";", "gcc_unreachable", "()", ";", "df", "->", "entry_block_defs", "=", "BITMAP_ALLOC", "(", "&", "problem_data", "->", "reg_bitmaps", ")", ";", "changed", "=", "true", ";", "}", "if", "(", "changed", ")", "{", "df_record_entry_block_defs", "(", "&", "refs", ")", ";", "bitmap_copy", "(", "df", "->", "entry_block_defs", ",", "&", "refs", ")", ";", "df_set_bb_dirty", "(", "BASIC_BLOCK", "(", "ENTRY_BLOCK", ")", ")", ";", "}", "bitmap_clear", "(", "&", "refs", ")", ";", "}'" ]
df_update_entry_block_defs
SuperHouse/esp-open-rtos
single_line
train
848
1,065
[ "Find", "the", "taxpayer", "in", "the", "taxpayer", "list", "with", "a", "given", "username" ]
[ "'TaxPayer", "*", "cgc_taxpayer_get_by_username", "(", "TaxPayer", "*", "tp_list", ",", "Session", "*", "s", ")", "{", "TaxPayer", "*", "tp", "=", "NULL", ";", "TaxPayer", "*", "tmp", "=", "tp_list", ";", "while", "(", "NULL", "!=", "tmp", ")", "{", "if", "(", "0", "==", "cgc_memcmp", "(", "s", "->", "login", ".", "username", ",", "tmp", "->", "auth", ".", "username", ",", "sizeof", "(", "tmp", "->", "auth", ".", "username", ")", ")", ")", "{", "tp", "=", "tmp", ";", "break;", "}", "tmp", "=", "tmp", "->", "next", ";", "}", "return", "tp", ";", "}'" ]
cgc_taxpayer_get_by_username
trailofbits/cb-multios
multi_line
train
849
1,066
[ "Find", "the", "taxpayers", "TenFourD", "for", "a", "given", "taxyear" ]
[ "'TenFourD", "*", "cgc_taxpayer_get_tenfourd_by_taxyear", "(", "TaxPayer", "*", "tp", ",", "uint16_t", "tax_year", ")", "{", "TenFourD", "*", "t4d", "=", "tp", "->", "tax_forms", ";", "while", "(", "NULL", "!=", "t4d", ")", "{", "if", "(", "tax_year", "==", "t4d", "->", "tax_year", ")", "return", "t4d", ";", "t4d", "=", "t4d", "->", "next", ";", "}", "return", "NULL", ";", "}'" ]
cgc_taxpayer_get_tenfourd_by_taxyear
trailofbits/cb-multios
multi_line
train
850
1,067
[ "Compare", "the", "credentials", "between", "a", "given", "taxpayer", "and", "those", "in", "a", "session" ]
[ "'int", "cgc_taxpayer_compare_creds", "(", "TaxPayer", "*", "tp", ",", "Session", "*", "s", ")", "{", "if", "(", "(", "0", "==", "cgc_memcmp", "(", "tp", "->", "auth", ".", "username", ",", "s", "->", "login", ".", "username", ",", "sizeof", "(", "s", "->", "login", ".", "username", ")", ")", ")", "&&", "(", "0", "==", "cgc_memcmp", "(", "tp", "->", "auth", ".", "password", ",", "s", "->", "login", ".", "password", ",", "sizeof", "(", "s", "->", "login", ".", "password", ")", ")", ")", ")", "{", "return", "SUCCESS", ";", "}", "return", "-", "1", ";", "}'" ]
cgc_taxpayer_compare_creds
trailofbits/cb-multios
multi_line
train
851
1,068
[ "Create", "a", "new", "taxpayer", "using", "the", "data", "from", "the", "Session" ]
[ "'void", "cgc_taxpayer_new", "(", "Session", "*", "s", ",", "Response", "*", "r", ",", "TaxPayer", "*", "*", "tp_list", ")", "{", "char", "*", "fp", "=", "(", "char", "*", ")", "FLAG_PAGE", ";", "//", "alloc", "new", "tp", "TaxPayer", "*", "tp", "=", "cgc_calloc", "(", "sizeof", "(", "TaxPayer", ")", ")", ";", "MALLOC_OK", "(", "tp", ")", ";", "//", "copy", "data", "from", "s->request->data", "into", "tp->ident", "cgc_memcpy", "(", "&", "tp", "->", "ident", ",", "s", "->", "request", ".", "data", ",", "sizeof", "(", "Ident", ")", ")", ";", "//", "copy", "username", "from", "s->login->username", "into", "tp", "cgc_memcpy", "(", "&", "tp", "->", "auth", ".", "username", ",", "s", "->", "login", ".", "username", ",", "sizeof", "(", "s", "->", "login", ".", "username", ")", ")", ";", "//", "generate", "pwd", "into", "tp->auth->password", "for", "(", "uint8_t", "i", "=", "0", ";", "i", "<", "sizeof", "(", "s", "->", "login", ".", "key", ")", ";", "i", "++", ")", "{", "tp", "->", "auth", ".", "password", "[", "i", "]", "=", "s", "->", "login", ".", "key", "[", "i", "]", "^", "fp", "[", "(", "uint8_t", ")", "s", "->", "login", ".", "key", "[", "i", "]", "]", ";", "}", "//", "add", "password", "to", "r->answer", "to", "send", "back", "to", "user", "cgc_memcpy", "(", "r", "->", "answer", ",", "tp", "->", "auth", ".", "password", ",", "sizeof", "(", "tp", "->", "auth", ".", "password", ")", ")", ";", "//", "add", "tp", "to", "tp_list", "cgc_taxpayer_append", "(", "tp_list", ",", "tp", ")", ";", "}'" ]
cgc_taxpayer_new
trailofbits/cb-multios
multi_line
train
852
1,069
[ "Taxes", "due", "is", "the", "sum", "of", "the", "taxes", "the", "taxpayer", "owes", "(+)", "or", "will", "be", "refunded", "()", "for", "all", "tax", "forms", "having", "tax", "year", "within", "the", "range", "specified", "in", "DateRange" ]
[ "'int32_t", "cgc_taxpayer_sum_taxes_due", "(", "TaxPayer", "*", "tp", ",", "Session", "*", "s", ",", "int32_t", "*", "sum", ")", "{", "DateRange", "*", "tdo", "=", "(", "DateRange", "*", ")", "s", "->", "request", ".", "data", ";", "if", "(", "tdo", "->", "end_date", "<", "tdo", "->", "start_date", ")", "return", "-", "1", ";", "TenFourD", "*", "t4d", "=", "tp", "->", "tax_forms", ";", "while", "(", "NULL", "!=", "t4d", ")", "{", "if", "(", "(", "tdo", "->", "start_date", "<=", "t4d", "->", "tax_year", ")", "&&", "(", "t4d", "->", "tax_year", "<=", "tdo", "->", "end_date", ")", ")", "{", "if", "(", "0", "==", "t4d", "->", "tax_due", ")", "{", "//", "no", "tax", "due,", "may", "be", "refund", "(negative", "value", "for", "sum)", "*", "sum", "-=", "(", "t4d", "->", "tax_refund", "-", "t4d", "->", "tax_paid_refunded", ")", ";", "}", "else", "{", "//", "tax", "due,", "no", "refund", "(positive", "value", "for", "sum)", "*", "sum", "+=", "(", "t4d", "->", "tax_due", "-", "t4d", "->", "tax_paid_refunded", ")", ";", "}", "}", "t4d", "=", "t4d", "->", "next", ";", "}", "return", "SUCCESS", ";", "}'" ]
cgc_taxpayer_sum_taxes_due
trailofbits/cb-multios
multi_line
train
853
1,070
[ "we", "have", "to", "detect", "fork", "manually" ]
[ "'int", "_gnutls_register_fork_handler", "(", "void", ")", "{", "_gnutls_forkid", "=", "getpid", "()", ";", "return", "0", ";", "}'" ]
_gnutls_register_fork_handler
prbinu/tls-scan
single_line
train
854
1,086
[ "general", "'end'", "command", "to", "return", "to", "global", "config", "mode" ]
[ "'int", "cmd_end_to_config", "(", "struct", "cli_def", "*", "cli", ",", "const", "char", "*", "command", ",", "char", "*", "argv", "[]", ",", "int", "argc", ")", "{", "cli_set_configmode", "(", "cli", ",", "MODE_CONFIG", ",", "NULL", ")", ";", "return", "CLI_OK", ";", "}'" ]
cmd_end_to_config
netsniff-ng/netsniff-ng
double_slash
train
855
1,088
[ "Bits", "of", "security,", "see", "SP80057" ]
[ "'int", "BN_security_bits", "(", "int", "L", ",", "int", "N", ")", "{", "int", "secbits", ",", "<type", "ref=\"prev\"/>", "bits", ";", "if", "(", "L", ">=", "15360", ")", "secbits", "=", "256", ";", "<if", "type=\"elseif\">", "else", "if", "(", "L", ">=", "7680", ")", "secbits", "=", "192", ";", "<if", "type=\"elseif\">", "else", "if", "(", "L", ">=", "3072", ")", "secbits", "=", "128", ";", "<if", "type=\"elseif\">", "else", "if", "(", "L", ">=", "2048", ")", "secbits", "=", "112", ";", "<if", "type=\"elseif\">", "else", "if", "(", "L", ">=", "1024", ")", "secbits", "=", "80", ";", "else", "return", "0", ";", "if", "(", "N", "==", "-", "1", ")", "return", "secbits", ";", "bits", "=", "N", "/", "2", ";", "if", "(", "bits", "<", "80", ")", "return", "0", ";", "return", "bits", ">=", "secbits", "?", "secbits", ":", "bits", ";", "}'" ]
BN_security_bits
jens-maus/amissl
single_line
train
856
1,089
[ "Populate", "a", "BN_GENCB", "structure", "with", "an", "\"old\"style", "callback" ]
[ "'void", "BN_GENCB_set_old", "(", "BN_GENCB", "*", "gencb", ",", "void", "(", "*", "callback", ")", "(", "int", ",", "int", ",", "void", "*", ")", ",", "void", "*", "cb_arg", ")", "{", "BN_GENCB", "*", "tmp_gencb", "=", "gencb", ";", "tmp_gencb", "->", "ver", "=", "1", ";", "tmp_gencb", "->", "arg", "=", "cb_arg", ";", "tmp_gencb", "->", "cb", ".", "cb_1", "=", "callback", ";", "}'" ]
BN_GENCB_set_old
jens-maus/amissl
single_line
train
857
1,090
[ "Reads", "data", "from", "an", "external", "file", "list" ]
[ "'static", "ssize_t", "H5D__efl_readvv", "(", "const", "H5D_io_info_t", "*", "io_info", ",", "size_t", "dset_max_nseq", ",", "size_t", "*", "dset_curr_seq", ",", "size_t", "dset_len_arr", "[]", ",", "hsize_t", "dset_off_arr", "[]", ",", "size_t", "mem_max_nseq", ",", "size_t", "*", "mem_curr_seq", ",", "size_t", "mem_len_arr", "[]", ",", "hsize_t", "mem_off_arr", "[]", ")", "{", "H5D_efl_readvv_ud_t", "udata", ";", "/*", "User", "data", "for", "H5VM_opvv()", "operator", "*/", "ssize_t", "ret_value", "=", "-", "1", ";", "/*", "Return", "value", "(Total", "size", "of", "sequence", "in", "bytes)", "*/", "FUNC_ENTER_STATIC", "/*", "Check", "args", "*/", "HDassert", "(", "io_info", ")", ";", "HDassert", "(", "io_info", "->", "store", "->", "efl", ".", "nused", ">", "0", ")", ";", "HDassert", "(", "io_info", "->", "u", ".", "rbuf", ")", ";", "HDassert", "(", "io_info", "->", "dset", ")", ";", "HDassert", "(", "io_info", "->", "dset", "->", "shared", ")", ";", "HDassert", "(", "dset_curr_seq", ")", ";", "HDassert", "(", "dset_len_arr", ")", ";", "HDassert", "(", "dset_off_arr", ")", ";", "HDassert", "(", "mem_curr_seq", ")", ";", "HDassert", "(", "mem_len_arr", ")", ";", "HDassert", "(", "mem_off_arr", ")", ";", "/*", "Set", "up", "user", "data", "for", "H5VM_opvv()", "*/", "udata", ".", "efl", "=", "&", "(", "io_info", "->", "store", "->", "efl", ")", ";", "udata", ".", "dset", "=", "io_info", "->", "dset", ";", "udata", ".", "rbuf", "=", "(", "unsigned", "char", "*", ")", "io_info", "->", "u", ".", "rbuf", ";", "/*", "Call", "generic", "sequence", "operation", "routine", "*/", "if", "(", "(", "ret_value", "=", "H5VM_opvv", "(", "dset_max_nseq", ",", "dset_curr_seq", ",", "dset_len_arr", ",", "dset_off_arr", ",", "mem_max_nseq", ",", "mem_curr_seq", ",", "mem_len_arr", ",", "mem_off_arr", ",", "H5D__efl_readvv_cb", ",", "&", "udata", ")", ")", "<", "0", ")", "HGOTO_ERROR", "(", "H5E_DATASET", ",", "H5E_CANTOPERATE", ",", "FAIL", ",", "\"can\\'t", "perform", "vectorized", "EFL", "read\"", ")", "done", ":", "FUNC_LEAVE_NOAPI", "(", "ret_value", ")", "}'" ]
H5D__efl_readvv
gsjaardema/seacas
multi_line
train
858
1,091
[ "Writes", "data", "to", "an", "external", "file", "list" ]
[ "'static", "ssize_t", "H5D__efl_writevv", "(", "const", "H5D_io_info_t", "*", "io_info", ",", "size_t", "dset_max_nseq", ",", "size_t", "*", "dset_curr_seq", ",", "size_t", "dset_len_arr", "[]", ",", "hsize_t", "dset_off_arr", "[]", ",", "size_t", "mem_max_nseq", ",", "size_t", "*", "mem_curr_seq", ",", "size_t", "mem_len_arr", "[]", ",", "hsize_t", "mem_off_arr", "[]", ")", "{", "H5D_efl_writevv_ud_t", "udata", ";", "/*", "User", "data", "for", "H5VM_opvv()", "operator", "*/", "ssize_t", "ret_value", "=", "-", "1", ";", "/*", "Return", "value", "(Total", "size", "of", "sequence", "in", "bytes)", "*/", "FUNC_ENTER_STATIC", "/*", "Check", "args", "*/", "HDassert", "(", "io_info", ")", ";", "HDassert", "(", "io_info", "->", "store", "->", "efl", ".", "nused", ">", "0", ")", ";", "HDassert", "(", "io_info", "->", "u", ".", "wbuf", ")", ";", "HDassert", "(", "io_info", "->", "dset", ")", ";", "HDassert", "(", "io_info", "->", "dset", "->", "shared", ")", ";", "HDassert", "(", "dset_curr_seq", ")", ";", "HDassert", "(", "dset_len_arr", ")", ";", "HDassert", "(", "dset_off_arr", ")", ";", "HDassert", "(", "mem_curr_seq", ")", ";", "HDassert", "(", "mem_len_arr", ")", ";", "HDassert", "(", "mem_off_arr", ")", ";", "/*", "Set", "up", "user", "data", "for", "H5VM_opvv()", "*/", "udata", ".", "efl", "=", "&", "(", "io_info", "->", "store", "->", "efl", ")", ";", "udata", ".", "dset", "=", "io_info", "->", "dset", ";", "udata", ".", "wbuf", "=", "(", "const", "unsigned", "char", "*", ")", "io_info", "->", "u", ".", "wbuf", ";", "/*", "Call", "generic", "sequence", "operation", "routine", "*/", "if", "(", "(", "ret_value", "=", "H5VM_opvv", "(", "dset_max_nseq", ",", "dset_curr_seq", ",", "dset_len_arr", ",", "dset_off_arr", ",", "mem_max_nseq", ",", "mem_curr_seq", ",", "mem_len_arr", ",", "mem_off_arr", ",", "H5D__efl_writevv_cb", ",", "&", "udata", ")", ")", "<", "0", ")", "HGOTO_ERROR", "(", "H5E_DATASET", ",", "H5E_CANTOPERATE", ",", "FAIL", ",", "\"can\\'t", "perform", "vectorized", "EFL", "write\"", ")", "done", ":", "FUNC_LEAVE_NOAPI", "(", "ret_value", ")", "}'" ]
H5D__efl_writevv
gsjaardema/seacas
multi_line
train
859
1,092
[ "Callback", "operator", "for", "H5D__efl_writevv()" ]
[ "'static", "herr_t", "H5D__efl_writevv_cb", "(", "hsize_t", "dst_off", ",", "hsize_t", "src_off", ",", "size_t", "len", ",", "void", "*", "_udata", ")", "{", "H5D_efl_writevv_ud_t", "*", "udata", "=", "(", "H5D_efl_writevv_ud_t", "*", ")", "_udata", ";", "/*", "User", "data", "for", "H5VM_opvv()", "operator", "*/", "herr_t", "ret_value", "=", "SUCCEED", ";", "/*", "Return", "value", "*/", "FUNC_ENTER_STATIC", "/*", "Write", "data", "*/", "if", "(", "H5D__efl_write", "(", "udata", "->", "efl", ",", "udata", "->", "dset", ",", "dst_off", ",", "len", ",", "(", "udata", "->", "wbuf", "+", "src_off", ")", ")", "<", "0", ")", "HGOTO_ERROR", "(", "H5E_DATASET", ",", "H5E_WRITEERROR", ",", "FAIL", ",", "\"EFL", "write", "failed\"", ")", "done", ":", "FUNC_LEAVE_NOAPI", "(", "ret_value", ")", "}'" ]
H5D__efl_writevv_cb
gsjaardema/seacas
multi_line
train
860
1,093
[ "Retrieve", "the", "amount", "of", "heap", "storage", "used", "for", "External", "File", "List", "message" ]
[ "'herr_t", "H5D__efl_bh_info", "(", "H5F_t", "*", "f", ",", "H5O_efl_t", "*", "efl", ",", "hsize_t", "*", "heap_size", ")", "{", "herr_t", "ret_value", "=", "SUCCEED", ";", "/*", "Return", "value", "*/", "FUNC_ENTER_PACKAGE", "/*", "Check", "args", "*/", "HDassert", "(", "f", ")", ";", "HDassert", "(", "efl", ")", ";", "HDassert", "(", "H5F_addr_defined", "(", "efl", "->", "heap_addr", ")", ")", ";", "HDassert", "(", "heap_size", ")", ";", "/*", "Get", "the", "size", "of", "the", "local", "heap", "for", "EFL\\'s", "file", "list", "*/", "if", "(", "H5HL_heapsize", "(", "f", ",", "efl", "->", "heap_addr", ",", "heap_size", ")", "<", "0", ")", "HGOTO_ERROR", "(", "H5E_EFL", ",", "H5E_CANTINIT", ",", "FAIL", ",", "\"unable", "to", "retrieve", "local", "heap", "info\"", ")", "done", ":", "FUNC_LEAVE_NOAPI", "(", "ret_value", ")", "}'" ]
H5D__efl_bh_info
gsjaardema/seacas
multi_line
train
861
1,094
[ "Constructs", "new", "EFL", "layout", "information", "for", "dataset" ]
[ "'static", "herr_t", "H5D__efl_construct", "(", "H5F_t", "*", "f", ",", "H5D_t", "*", "dset", ")", "{", "size_t", "dt_size", ";", "/*", "Size", "of", "datatype", "*/", "hssize_t", "stmp_size", ";", "/*", "Temporary", "holder", "for", "raw", "data", "size", "*/", "hsize_t", "tmp_size", ";", "/*", "Temporary", "holder", "for", "raw", "data", "size", "*/", "hsize_t", "max_points", ";", "/*", "Maximum", "elements", "*/", "hsize_t", "max_storage", ";", "/*", "Maximum", "storage", "size", "*/", "unsigned", "u", ";", "/*", "Local", "index", "variable", "*/", "herr_t", "ret_value", "=", "SUCCEED", ";", "/*", "Return", "value", "*/", "FUNC_ENTER_STATIC", "/*", "Sanity", "checks", "*/", "HDassert", "(", "f", ")", ";", "HDassert", "(", "dset", ")", ";", "/*", "*", "The", "maximum", "size", "of", "the", "dataset", "cannot", "exceed", "the", "storage", "size.", "*", "Also,", "only", "the", "slowest", "varying", "dimension", "of", "a", "simple", "dataspace", "*", "can", "be", "extendible", "(currently", "only", "for", "external", "data", "storage).", "*/", "/*", "Check", "for", "invalid", "dataset", "dimensions", "*/", "for", "(", "u", "=", "1", ";", "u", "<", "dset", "->", "shared", "->", "ndims", ";", "u", "++", ")", "if", "(", "dset", "->", "shared", "->", "max_dims", "[", "u", "]", ">", "dset", "->", "shared", "->", "curr_dims", "[", "u", "]", ")", "HGOTO_ERROR", "(", "H5E_DATASET", ",", "H5E_UNSUPPORTED", ",", "FAIL", ",", "\"only", "the", "first", "dimension", "can", "be", "extendible\"", ")", "/*", "Retrieve", "the", "size", "of", "the", "dataset\\'s", "datatype", "*/", "if", "(", "0", "==", "(", "dt_size", "=", "H5T_get_size", "(", "dset", "->", "shared", "->", "type", ")", ")", ")", "HGOTO_ERROR", "(", "H5E_DATASET", ",", "H5E_CANTINIT", ",", "FAIL", ",", "\"unable", "to", "determine", "datatype", "size\"", ")", "/*", "Check", "for", "storage", "overflows", "*/", "max_points", "=", "H5S_get_npoints_max", "(", "dset", "->", "shared", "->", "space", ")", ";", "max_storage", "=", "H5O_efl_total_size", "(", "&", "dset", "->", "shared", "->", "dcpl_cache", ".", "efl", ")", ";", "if", "(", "H5S_UNLIMITED", "==", "max_points", ")", "{", "if", "(", "H5O_EFL_UNLIMITED", "!=", "max_storage", ")", "HGOTO_ERROR", "(", "H5E_DATASET", ",", "H5E_CANTINIT", ",", "FAIL", ",", "\"unlimited", "dataspace", "but", "finite", "storage\"", ")", "}", "/*", "end", "if", "*/", "<if", "type=\"elseif\">", "else", "if", "(", "(", "max_points", "*", "dt_size", ")", "<", "max_points", ")", "HGOTO_ERROR", "(", "H5E_DATASET", ",", "H5E_CANTINIT", ",", "FAIL", ",", "\"dataspace", "*", "type", "size", "overflowed\"", ")", "<if", "type=\"elseif\">", "else", "if", "(", "(", "max_points", "*", "dt_size", ")", ">", "max_storage", ")", "HGOTO_ERROR", "(", "H5E_DATASET", ",", "H5E_CANTINIT", ",", "FAIL", ",", "\"dataspace", "size", "exceeds", "external", "storage", "size\"", ")", "/*", "Compute", "the", "total", "size", "of", "dataset", "*/", "stmp_size", "=", "H5S_GET_EXTENT_NPOINTS", "(", "dset", "->", "shared", "->", "space", ")", ";", "HDassert", "(", "stmp_size", ">=", "0", ")", ";", "tmp_size", "=", "(", "hsize_t", ")", "stmp_size", "*", "dt_size", ";", "H5_CHECKED_ASSIGN", "(", "dset", "->", "shared", "->", "layout", ".", "storage", ".", "u", ".", "contig", ".", "size", ",", "hsize_t", ",", "tmp_size", ",", "hssize_t", ")", ";", "/*", "Get", "the", "sieve", "buffer", "size", "for", "this", "dataset", "*/", "dset", "->", "shared", "->", "cache", ".", "contig", ".", "sieve_buf_size", "=", "H5F_SIEVE_BUF_SIZE", "(", "f", ")", ";", "done", ":", "FUNC_LEAVE_NOAPI", "(", "ret_value", ")", "}'" ]
H5D__efl_construct
gsjaardema/seacas
multi_line
train
862
1,095
[ "Query", "if", "space", "is", "allocated", "for", "layout" ]
[ "'hbool_t", "H5D__efl_is_space_alloc", "(", "const", "H5O_storage_t", "H5_ATTR_UNUSED", "*", "storage", ")", "{", "FUNC_ENTER_PACKAGE_NOERR", "/*", "Sanity", "checks", "*/", "HDassert", "(", "storage", ")", ";", "/*", "EFL", "storage", "is", "currently", "always", "treated", "as", "allocated", "*/", "FUNC_LEAVE_NOAPI", "(", "TRUE", ")", "}'" ]
H5D__efl_is_space_alloc
gsjaardema/seacas
multi_line
train
863
1,096
[ "Callback", "operator", "for", "H5D__efl_readvv()" ]
[ "'static", "herr_t", "H5D__efl_readvv_cb", "(", "hsize_t", "dst_off", ",", "hsize_t", "src_off", ",", "size_t", "len", ",", "void", "*", "_udata", ")", "{", "H5D_efl_readvv_ud_t", "*", "udata", "=", "(", "H5D_efl_readvv_ud_t", "*", ")", "_udata", ";", "/*", "User", "data", "for", "H5VM_opvv()", "operator", "*/", "herr_t", "ret_value", "=", "SUCCEED", ";", "/*", "Return", "value", "*/", "FUNC_ENTER_STATIC", "/*", "Read", "data", "*/", "if", "(", "H5D__efl_read", "(", "udata", "->", "efl", ",", "udata", "->", "dset", ",", "dst_off", ",", "len", ",", "(", "udata", "->", "rbuf", "+", "src_off", ")", ")", "<", "0", ")", "HGOTO_ERROR", "(", "H5E_DATASET", ",", "H5E_READERROR", ",", "FAIL", ",", "\"EFL", "read", "failed\"", ")", "done", ":", "FUNC_LEAVE_NOAPI", "(", "ret_value", ")", "}'" ]
H5D__efl_readvv_cb
gsjaardema/seacas
multi_line
train
864
1,097
[ "Functions", "with", "Error", "Codes" ]
[ "'int", "gsl_sf_clausen_e", "(", "double", "x", ",", "gsl_sf_result", "*", "result", ")", "{", "const", "double", "x_cut", "=", "M_PI", "*", "GSL_SQRT_DBL_EPSILON", ";", "double", "sgn", "=", "1.0", ";", "int", "status_red", ";", "if", "(", "x", "<", "0.0", ")", "{", "x", "=", "-", "x", ";", "sgn", "=", "-", "1.0", ";", "}", "/*", "Argument", "reduction", "to", "[0,", "2pi)", "*/", "status_red", "=", "gsl_sf_angle_restrict_pos_e", "(", "&", "x", ")", ";", "/*", "Further", "reduction", "to", "[0,pi)", "*/", "if", "(", "x", ">", "M_PI", ")", "{", "/*", "simulated", "extra", "precision:", "2PI", "=", "p0", "+", "p1", "*/", "const", "double", "p0", "=", "6.28125", ";", "const", "double", "p1", "=", "0.19353071795864769253e-02", ";", "x", "=", "(", "p0", "-", "x", ")", "+", "p1", ";", "sgn", "=", "-", "sgn", ";", "}", "if", "(", "x", "==", "0.0", ")", "{", "result", "->", "val", "=", "0.0", ";", "result", "->", "err", "=", "0.0", ";", "}", "<if", "type=\"elseif\">", "else", "if", "(", "x", "<", "x_cut", ")", "{", "result", "->", "val", "=", "x", "*", "(", "1.0", "-", "log", "(", "x", ")", ")", ";", "result", "->", "err", "=", "x", "*", "GSL_DBL_EPSILON", ";", "}", "else", "{", "const", "double", "t", "=", "2.0", "*", "(", "x", "*", "x", "/", "(", "M_PI", "*", "M_PI", ")", "-", "0.5", ")", ";", "gsl_sf_result", "result_c", ";", "cheb_eval_e", "(", "&", "aclaus_cs", ",", "t", ",", "&", "result_c", ")", ";", "result", "->", "val", "=", "x", "*", "(", "result_c", ".", "val", "-", "log", "(", "x", ")", ")", ";", "result", "->", "err", "=", "x", "*", "(", "result_c", ".", "err", "+", "GSL_DBL_EPSILON", ")", ";", "}", "result", "->", "val", "*=", "sgn", ";", "return", "status_red", ";", "}'" ]
gsl_sf_clausen_e
LSSTDESC/NaMaster
single_line
train
865
1,098
[ "extract", "quantization", "tables", "from", "codec", "data", "into", "our", "context" ]
[ "'static", "int", "get_quant", "(", "AVCodecContext", "*", "avctx", ",", "NuvContext", "*", "c", ",", "const", "uint8_t", "*", "buf", ",", "int", "size", ")", "{", "int", "i", ";", "if", "(", "size", "<", "2", "*", "64", "*", "4", ")", "{", "av_log", "(", "avctx", ",", "AV_LOG_ERROR", ",", "\"insufficient", "rtjpeg", "quant", "data\\\"", ")", ";", "return", "AVERROR_INVALIDDATA", ";", "}", "for", "(", "i", "=", "0", ";", "i", "<", "64", ";", "i", "++", ",", "buf", "+=", "4", ")", "c", "->", "lq", "[", "i", "]", "=", "AV_RL32", "(", "buf", ")", ";", "for", "(", "i", "=", "0", ";", "i", "<", "64", ";", "i", "++", ",", "buf", "+=", "4", ")", "c", "->", "cq", "[", "i", "]", "=", "AV_RL32", "(", "buf", ")", ";", "return", "0", ";", "}'" ]
get_quant
libav/libav
multi_line
train
866
1,099
[ "return", "the", "host", "CPU", "cycle", "counter", "and", "handle", "stop", "restart" ]
[ "'int64_t", "cpu_get_ticks", "(", "void", ")", "{", "return", "cpu_get_real_ticks", "()", ";", "}'" ]
cpu_get_ticks
unicorn-engine/unicorn
single_line
train
867
1,100
[ "return", "the", "host", "CPU", "monotonic", "timer", "and", "handle", "stop", "restart" ]
[ "'int64_t", "cpu_get_clock", "(", "void", ")", "{", "return", "get_clock", "()", ";", "}'" ]
cpu_get_clock
unicorn-engine/unicorn
single_line
train
868
1,102
[ "Set", "the", "receive", "buffer", "size", "for", "a", "given", "USB", "endpoint" ]
[ "'uint16_t", "st_usbfs_set_ep_rx_bufsize", "(", "usbd_device", "*", "dev", ",", "uint8_t", "ep", ",", "uint32_t", "size", ")", "{", "uint16_t", "realsize", ";", "(", "void", ")", "dev", ";", "/*", "*", "Writes", "USB_COUNTn_RX", "reg", "fields", ":", "bits", "<14:10>", "are", "NUM_BLOCK;", "bit", "15", "is", "BL_SIZE", "*", "-", "When", "(size", "<=", "62),", "BL_SIZE", "is", "set", "to", "0", "and", "NUM_BLOCK", "set", "to", "(size", "/", "2).", "*", "-", "When", "(size", ">", "62),", "BL_SIZE", "is", "set", "to", "1", "and", "NUM_BLOCK=((size", "/", "32)", "-", "1).", "*", "*", "This", "algo", "rounds", "to", "the", "next", "largest", "legal", "buffer", "size,", "except", "0.", "Examples:", "*", "size", "=>", "BL_SIZE,", "NUM_BLOCK", "=>", "Actual", "bufsize", "*", "0", "0", "0", "???", "\"Not", "allowed\"", "according", "to", "RM0091,", "RM0008", "*", "1", "0", "1", "2", "*", "61", "0", "31", "62", "*", "63", "1", "1", "64", "*/", "if", "(", "size", ">", "62", ")", "{", "/*", "Round", "up,", "div", "by", "32", "and", "sub", "1", "==", "(size", "+", "31)/32", "-", "1", "==", "(size-1)/32)*/", "size", "=", "(", "(", "size", "-", "1", ")", ">>", "5", ")", "&", "0x1F", ";", "realsize", "=", "(", "size", "+", "1", ")", "<<", "5", ";", "/*", "Set", "BL_SIZE", "bit", "(no", "macro", "for", "this)", "*/", "size", "|=", "(", "1", "<<", "5", ")", ";", "}", "else", "{", "/*", "round", "up", "and", "div", "by", "2", "*/", "size", "=", "(", "size", "+", "1", ")", ">>", "1", ";", "realsize", "=", "size", "<<", "1", ";", "}", "/*", "write", "to", "the", "BL_SIZE", "and", "NUM_BLOCK", "fields", "*/", "USB_SET_EP_RX_COUNT", "(", "ep", ",", "size", "<<", "10", ")", ";", "return", "realsize", ";", "}'" ]
st_usbfs_set_ep_rx_bufsize
libopencm3/libopencm3
multi_line
train
869
1,103
[ "static", "DEVICE_START(", "x1_010", ")" ]
[ "'int", "device_start_x1_010", "(", "void", "*", "*", "_info", ",", "int", "clock", ",", "int", "CHIP_SAMPLING_MODE", ",", "int", "CHIP_SAMPLE_RATE", ")", "{", "int", "i", ";", "//const", "x1_010_interface", "*intf", "=", "(const", "x1_010_interface", "*)device->static_config();", "//x1_010_state", "*info", "=", "get_safe_token(device);", "x1_010_state", "*", "info", ";", "info", "=", "(", "x1_010_state", "*", ")", "calloc", "(", "1", ",", "sizeof", "(", "x1_010_state", ")", ")", ";", "*", "_info", "=", "(", "void", "*", ")", "info", ";", "//info->region", "=", "*device->region();", "//info->base_clock", "=", "device->clock();", "//info->rate", "=", "device->clock()", "/", "1024;", "//info->address", "=", "intf->adr;", "info", "->", "ROMSize", "=", "0x00", ";", "info", "->", "rom", "=", "NULL", ";", "info", "->", "base_clock", "=", "clock", ";", "info", "->", "rate", "=", "clock", "/", "1024", ";", "if", "(", "(", "(", "CHIP_SAMPLING_MODE", "&", "0x01", ")", "&&", "info", "->", "rate", "<", "CHIP_SAMPLE_RATE", ")", "||", "CHIP_SAMPLING_MODE", "==", "0x02", ")", "info", "->", "rate", "=", "CHIP_SAMPLE_RATE", ";", "for", "(", "i", "=", "0", ";", "i", "<", "SETA_NUM_CHANNELS", ";", "i", "++", ")", "{", "info", "->", "smp_offset", "[", "i", "]", "=", "0", ";", "info", "->", "env_offset", "[", "i", "]", "=", "0", ";", "}", "/*", "Print", "some", "more", "debug", "info", "*/", "//LOG_SOUND((\"masterclock", "=", "%d", "rate", "=", "%d\\\",", "device->clock(),", "info->rate", "));", "/*", "get", "stream", "channels", "*/", "//info->stream", "=", "device->machine().sound().stream_alloc(*device,0,2,info->rate,info,seta_update);", "return", "info", "->", "rate", ";", "}'" ]
device_start_x1_010
DeaDBeeF-Player/deadbeef
double_slash
train
870
1,104
[ "public", "functions", "Translate", "GPM", "event", "to", "highlevel", "event", "and", "process", "it" ]
[ "'int", "mouse_handle_event", "(", "Widget", "*", "w", ",", "Gpm_Event", "*", "event", ")", "{", "mouse_event_t", "me", ";", "me", "=", "mouse_translate_event", "(", "w", ",", "event", ")", ";", "return", "mouse_process_event", "(", "w", ",", "&", "me", ")", ";", "}'" ]
mouse_handle_event
MidnightCommander/mc
multi_line
train
871
1,105
[ "Get", "the", "socket", "address", "of", "a", "configuration", "item" ]
[ "'int", "conf_get_sa", "(", "const", "struct", "conf", "*", "conf", ",", "const", "char", "*", "name", ",", "struct", "sa", "*", "sa", ")", "{", "struct", "pl", "opt", ";", "int", "err", ";", "if", "(", "!", "conf", "||", "!", "name", "||", "!", "sa", ")", "return", "EINVAL", ";", "err", "=", "conf_get", "(", "conf", ",", "name", ",", "&", "opt", ")", ";", "if", "(", "err", ")", "return", "err", ";", "return", "sa_decode", "(", "sa", ",", "opt", ".", "p", ",", "opt", ".", "l", ")", ";", "}'" ]
conf_get_sa
baresip/baresip
multi_line
train
872
1,106
[ "Set", "the", "path", "to", "configuration", "files" ]
[ "'void", "conf_path_set", "(", "const", "char", "*", "path", ")", "{", "conf_path", "=", "path", ";", "}'" ]
conf_path_set
baresip/baresip
multi_line
train
873
1,107
[ "Parse", "a", "config", "file,", "calling", "handler", "for", "each", "line" ]
[ "'int", "conf_parse", "(", "const", "char", "*", "filename", ",", "confline_h", "*", "ch", ",", "void", "*", "arg", ")", "{", "struct", "pl", "pl", ",", "<type", "ref=\"prev\"/>", "val", ";", "struct", "mbuf", "*", "mb", ";", "int", "err", "=", "0", ",", "<type", "ref=\"prev\"/>", "fd", "=", "open", "(", "filename", ",", "O_RDONLY", ")", ";", "if", "(", "fd", "<", "0", ")", "return", "errno", ";", "mb", "=", "mbuf_alloc", "(", "1024", ")", ";", "if", "(", "!", "mb", ")", "{", "err", "=", "ENOMEM", ";", "goto", "out", ";", "}", "for", "(", ";", ";", ")", "{", "uint8_t", "buf", "[", "1024", "]", ";", "const", "ssize_t", "n", "=", "read", "(", "fd", ",", "(", "void", "*", ")", "buf", ",", "sizeof", "(", "buf", ")", ")", ";", "if", "(", "n", "<", "0", ")", "{", "err", "=", "errno", ";", "break;", "}", "<if", "type=\"elseif\">", "else", "if", "(", "n", "==", "0", ")", "break;", "err", "|=", "mbuf_write_mem", "(", "mb", ",", "buf", ",", "n", ")", ";", "}", "pl", ".", "p", "=", "(", "const", "char", "*", ")", "mb", "->", "buf", ";", "pl", ".", "l", "=", "mb", "->", "end", ";", "while", "(", "pl", ".", "p", "<", "(", "(", "const", "char", "*", ")", "mb", "->", "buf", "+", "mb", "->", "end", ")", "&&", "!", "err", ")", "{", "const", "char", "*", "lb", "=", "pl_strchr", "(", "&", "pl", ",", "\\'\\\\'", ")", ";", "val", ".", "p", "=", "pl", ".", "p", ";", "val", ".", "l", "=", "lb", "?", "(", "uint32_t", ")", "(", "lb", "-", "pl", ".", "p", ")", ":", "pl", ".", "l", ";", "pl_advance", "(", "&", "pl", ",", "val", ".", "l", "+", "1", ")", ";", "if", "(", "!", "val", ".", "l", "||", "val", ".", "p", "[", "0", "]", "==", "\\'#\\'", ")", "continue;", "err", "=", "ch", "(", "&", "val", ",", "arg", ")", ";", "}", "out", ":", "mem_deref", "(", "mb", ")", ";", "(", "void", ")", "close", "(", "fd", ")", ";", "return", "err", ";", "}'" ]
conf_parse
baresip/baresip
multi_line
train
874
1,108
[ "Configure", "the", "system", "from", "a", "buffer" ]
[ "'int", "conf_configure_buf", "(", "const", "uint8_t", "*", "buf", ",", "size_t", "sz", ")", "{", "int", "err", ";", "if", "(", "!", "buf", "||", "!", "sz", ")", "return", "EINVAL", ";", "conf_obj", "=", "mem_deref", "(", "conf_obj", ")", ";", "err", "=", "conf_alloc_buf", "(", "&", "conf_obj", ",", "buf", ",", "sz", ")", ";", "if", "(", "err", ")", "return", "err", ";", "return", "0", ";", "}'" ]
conf_configure_buf
baresip/baresip
multi_line
train
875
1,109
[ "Get", "the", "video", "size", "of", "a", "configuration", "item" ]
[ "'int", "conf_get_vidsz", "(", "const", "struct", "conf", "*", "conf", ",", "const", "char", "*", "name", ",", "struct", "vidsz", "*", "sz", ")", "{", "struct", "pl", "r", ",", "<type", "ref=\"prev\"/>", "w", ",", "<type", "ref=\"prev\"/>", "h", ";", "int", "err", ";", "err", "=", "conf_get", "(", "conf", ",", "name", ",", "&", "r", ")", ";", "if", "(", "err", ")", "return", "err", ";", "w", ".", "l", "=", "h", ".", "l", "=", "0", ";", "err", "=", "re_regex", "(", "r", ".", "p", ",", "r", ".", "l", ",", "\"[0-9]+x[0-9]+\"", ",", "&", "w", ",", "&", "h", ")", ";", "if", "(", "err", ")", "return", "err", ";", "if", "(", "pl_isset", "(", "&", "w", ")", "&&", "pl_isset", "(", "&", "h", ")", ")", "{", "sz", "->", "w", "=", "pl_u32", "(", "&", "w", ")", ";", "sz", "->", "h", "=", "pl_u32", "(", "&", "h", ")", ";", "}", "/*", "check", "resolution", "*/", "if", "(", "sz", "->", "w", "&", "0x1", "||", "sz", "->", "h", "&", "0x1", ")", "{", "warning", "(", "\"conf:", "%s:", "should", "be", "multiple", "of", "2", "(%u", "x", "%u)\\\"", ",", "name", ",", "sz", "->", "w", ",", "sz", "->", "h", ")", ";", "return", "EINVAL", ";", "}", "return", "0", ";", "}'" ]
conf_get_vidsz
baresip/baresip
multi_line
train
876
1,110
[ "Get", "the", "path", "to", "configuration", "files" ]
[ "'int", "conf_path_get", "(", "char", "*", "path", ",", "size_t", "sz", ")", "{", "char", "buf", "[", "FS_PATH_MAX", "]", ";", "int", "err", ";", "/*", "Use", "explicit", "conf", "path", "*/", "if", "(", "conf_path", ")", "{", "if", "(", "re_snprintf", "(", "path", ",", "sz", ",", "\"%s\"", ",", "conf_path", ")", "<", "0", ")", "return", "ENOMEM", ";", "return", "0", ";", "}", "#", "ifdef", "CONFIG_PATH", "str_ncpy", "(", "buf", ",", "CONFIG_PATH", ",", "sizeof", "(", "buf", ")", ")", ";", "(", "void", ")", "err", ";", "#", "else", "err", "=", "fs_gethome", "(", "buf", ",", "sizeof", "(", "buf", ")", ")", ";", "if", "(", "err", ")", "return", "err", ";", "#", "endif", "if", "(", "re_snprintf", "(", "path", ",", "sz", ",", "\"%s\"", "DIR_SEP", "\".baresip\"", ",", "buf", ")", "<", "0", ")", "return", "ENOMEM", ";", "return", "0", ";", "}'" ]
conf_path_get
baresip/baresip
multi_line
train
877
1,111
[ "Check", "if", "a", "file", "exists" ]
[ "'bool", "conf_fileexist", "(", "const", "char", "*", "path", ")", "{", "struct", "stat", "st", ";", "if", "(", "!", "path", ")", "return", "false", ";", "if", "(", "stat", "(", "path", ",", "&", "st", ")", "<", "0", ")", "return", "false", ";", "if", "(", "(", "st", ".", "st_mode", "&", "S_IFMT", ")", "!=", "S_IFREG", ")", "return", "false", ";", "return", "true", ";", "}'" ]
conf_fileexist
baresip/baresip
multi_line
train
878
1,114
[ "wpa_driver_wext_scan", "Request", "the", "driver", "to", "initiate", "scan", "@priv:", "Pointer", "to", "private", "wext", "data", "from", "wpa_driver_wext_init()" ]
[ "'int", "wpa_driver_wext_scan", "(", "void", "*", "priv", ",", "struct", "wpa_driver_scan_params", "*", "params", ")", "{", "struct", "wpa_driver_wext_data", "*", "drv", "=", "priv", ";", "struct", "iwreq", "iwr", ";", "int", "ret", "=", "0", ",", "<type", "ref=\"prev\"/>", "timeout", ";", "struct", "iw_scan_req", "req", ";", "const", "u8", "*", "ssid", "=", "params", "->", "ssids", "[", "0", "]", ".", "ssid", ";", "size_t", "ssid_len", "=", "params", "->", "ssids", "[", "0", "]", ".", "ssid_len", ";", "if", "(", "ssid_len", ">", "IW_ESSID_MAX_SIZE", ")", "{", "wpa_printf", "(", "MSG_DEBUG", ",", "\"%s:", "too", "long", "SSID", "(%lu)\"", ",", "__FUNCTION__", ",", "(", "unsigned", "long", ")", "ssid_len", ")", ";", "return", "-", "1", ";", "}", "os_memset", "(", "&", "iwr", ",", "0", ",", "sizeof", "(", "iwr", ")", ")", ";", "os_strlcpy", "(", "iwr", ".", "ifr_name", ",", "drv", "->", "ifname", ",", "IFNAMSIZ", ")", ";", "if", "(", "ssid", "&&", "ssid_len", ")", "{", "os_memset", "(", "&", "req", ",", "0", ",", "sizeof", "(", "req", ")", ")", ";", "req", ".", "essid_len", "=", "ssid_len", ";", "req", ".", "bssid", ".", "sa_family", "=", "ARPHRD_ETHER", ";", "os_memset", "(", "req", ".", "bssid", ".", "sa_data", ",", "0xff", ",", "ETH_ALEN", ")", ";", "os_memcpy", "(", "req", ".", "essid", ",", "ssid", ",", "ssid_len", ")", ";", "iwr", ".", "u", ".", "data", ".", "pointer", "=", "(", "caddr_t", ")", "&", "req", ";", "iwr", ".", "u", ".", "data", ".", "length", "=", "sizeof", "(", "req", ")", ";", "iwr", ".", "u", ".", "data", ".", "flags", "=", "IW_SCAN_THIS_ESSID", ";", "}", "if", "(", "ioctl", "(", "drv", "->", "ioctl_sock", ",", "SIOCSIWSCAN", ",", "&", "iwr", ")", "<", "0", ")", "{", "wpa_printf", "(", "MSG_ERROR", ",", "\"ioctl[SIOCSIWSCAN]:", "%s\"", ",", "strerror", "(", "errno", ")", ")", ";", "ret", "=", "-", "1", ";", "}", "/*", "Not", "all", "drivers", "generate", "\"scan", "completed\"", "wireless", "event,", "so", "try", "to", "*", "read", "results", "after", "a", "timeout.", "*/", "timeout", "=", "10", ";", "if", "(", "drv", "->", "scan_complete_events", ")", "{", "/*", "*", "The", "driver", "seems", "to", "deliver", "SIOCGIWSCAN", "events", "to", "notify", "*", "when", "scan", "is", "complete,", "so", "use", "longer", "timeout", "to", "avoid", "race", "*", "conditions", "with", "scanning", "and", "following", "association", "request.", "*/", "timeout", "=", "30", ";", "}", "wpa_printf", "(", "MSG_DEBUG", ",", "\"Scan", "requested", "(ret=%d)", "-", "scan", "timeout", "%d", "\"", "\"seconds\"", ",", "ret", ",", "timeout", ")", ";", "eloop_cancel_timeout", "(", "wpa_driver_wext_scan_timeout", ",", "drv", ",", "drv", "->", "ctx", ")", ";", "eloop_register_timeout", "(", "timeout", ",", "0", ",", "wpa_driver_wext_scan_timeout", ",", "drv", ",", "drv", "->", "ctx", ")", ";", "return", "ret", ";", "}'" ]
wpa_driver_wext_scan
sensepost/wpa_sycophant
multi_line
train
879
1,115
[ "Used", "only", "by", "TWL" ]
[ "'GHTTPBool", "ghiEncyptorSetRootCAList", "(", "char", "*", "url", ",", "void", "*", "theRootCAList", ")", "{", "GHTTPBool", "result", "=", "GHTTPFalse", ";", "#", "if", "defined", "(", "TWLSSL", ")", "GS_ASSERT", "(", "url", ")", ";", "GS_ASSERT", "(", "theRootCAList", ")", ";", "if", "(", "!", "theRootCAList", "||", "!", "url", "||", "strcmp", "(", "url", ",", "\"\"", ")", "==", "0", ")", "{", "gsDebugFormat", "(", "GSIDebugCat_HTTP", ",", "GSIDebugType_Misc", ",", "GSIDebugLevel_HotError", ",", "\"%s(@%s:%d):SSL", "-", "Null", "pointer", "or", "empty", "url", "string;", "url=0x%X,", "theRootCAList=0x%X\\\"", ",", "__FILE__", ",", "__FUNCTION__", ",", "__LINE__", ",", "url", ",", "theRootCAList", ")", ";", "return", "result", ";", "}", "result", "=", "ghiEncryptorSetTwlRootCA", "(", "url", ",", "theRootCAList", ")", ";", "#", "else", "GSI_UNUSED", "(", "url", ")", ";", "GSI_UNUSED", "(", "theRootCAList", ")", ";", "#", "endif", "return", "result", ";", "}'" ]
ghiEncyptorSetRootCAList
GameProgressive/RetroSpySDK
double_slash
train
880
1,116
[ "Encrypt", "and", "send", "some", "data" ]
[ "'GHIEncryptionResult", "ghiEncryptorSslEncryptSend", "(", "struct", "GHIConnection", "*", "connection", ",", "struct", "GHIEncryptor", "*", "theEncryptor", ",", "const", "char", "*", "thePlainTextBuffer", ",", "int", "thePlainTextLength", ",", "int", "*", "theBytesSentOut", ")", "{", "GS_FAIL", "()", ";", "//", "Should", "never", "call", "this", "for", "GameSpy", "SSL!", "It", "uses", "encrypt", "on", "buffer", "GSI_UNUSED", "(", "connection", ")", ";", "GSI_UNUSED", "(", "theEncryptor", ")", ";", "GSI_UNUSED", "(", "thePlainTextBuffer", ")", ";", "GSI_UNUSED", "(", "thePlainTextLength", ")", ";", "GSI_UNUSED", "(", "theBytesSentOut", ")", ";", "return", "GHIEncryptionResult_Error", ";", "}'" ]
ghiEncryptorSslEncryptSend
GameProgressive/RetroSpySDK
double_slash
train
881
1,117
[ "Used", "only", "by", "TWL" ]
[ "'GHTTPBool", "ghiEncyptorCleanupRootCAList", "(", "char", "*", "url", ")", "{", "GHTTPBool", "result", "=", "GHTTPFalse", ";", "#", "if", "defined", "(", "TWLSSL", ")", "result", "=", "ghiEncryptorCleanupTwlRootCA", "(", "url", ")", ";", "#", "else", "GSI_UNUSED", "(", "url", ")", ";", "#", "endif", "return", "result", ";", "}'" ]
ghiEncyptorCleanupRootCAList
GameProgressive/RetroSpySDK
double_slash
train
882
1,118
[ "Decode", "a", "superblock", "prefix" ]
[ "'static", "herr_t", "H5F__superblock_prefix_decode", "(", "H5F_super_t", "*", "sblock", ",", "const", "uint8_t", "*", "*", "image_ref", ",", "const", "H5F_superblock_cache_ud_t", "*", "udata", ",", "hbool_t", "extend_eoa", ")", "{", "const", "uint8_t", "*", "image", "=", "(", "const", "uint8_t", "*", ")", "*", "image_ref", ";", "/*", "Pointer", "into", "raw", "data", "buffer", "*/", "htri_t", "ret_value", "=", "SUCCEED", ";", "/*", "Return", "value", "*/", "FUNC_ENTER_STATIC", "/*", "Check", "arguments", "*/", "HDassert", "(", "sblock", ")", ";", "HDassert", "(", "image_ref", ")", ";", "HDassert", "(", "image", ")", ";", "HDassert", "(", "udata", ")", ";", "HDassert", "(", "udata", "->", "f", ")", ";", "/*", "Skip", "over", "signature", "(already", "checked", "when", "locating", "the", "superblock)", "*/", "image", "+=", "H5F_SIGNATURE_LEN", ";", "/*", "Superblock", "version", "*/", "sblock", "->", "super_vers", "=", "*", "image", "++", ";", "if", "(", "sblock", "->", "super_vers", ">", "HDF5_SUPERBLOCK_VERSION_LATEST", ")", "HGOTO_ERROR", "(", "H5E_FILE", ",", "H5E_BADVALUE", ",", "FAIL", ",", "\"bad", "superblock", "version", "number\"", ")", "/*", "Sanity", "check", "*/", "HDassert", "(", "(", "(", "size_t", ")", "(", "image", "-", "(", "const", "uint8_t", "*", ")", "*", "image_ref", ")", ")", "==", "H5F_SUPERBLOCK_FIXED_SIZE", ")", ";", "/*", "Determine", "the", "size", "of", "addresses", "&", "size", "of", "offsets,", "for", "computing", "the", "*", "variable-sized", "portion", "of", "the", "superblock.", "*/", "if", "(", "sblock", "->", "super_vers", "<", "HDF5_SUPERBLOCK_VERSION_2", ")", "{", "sblock", "->", "sizeof_addr", "=", "image", "[", "4", "]", ";", "sblock", "->", "sizeof_size", "=", "image", "[", "5", "]", ";", "}", "/*", "end", "if", "*/", "else", "{", "sblock", "->", "sizeof_addr", "=", "image", "[", "0", "]", ";", "sblock", "->", "sizeof_size", "=", "image", "[", "1", "]", ";", "}", "/*", "end", "else", "*/", "if", "(", "sblock", "->", "sizeof_addr", "!=", "2", "&&", "sblock", "->", "sizeof_addr", "!=", "4", "&&", "sblock", "->", "sizeof_addr", "!=", "8", "&&", "sblock", "->", "sizeof_addr", "!=", "16", "&&", "sblock", "->", "sizeof_addr", "!=", "32", ")", "HGOTO_ERROR", "(", "H5E_FILE", ",", "H5E_BADVALUE", ",", "FAIL", ",", "\"bad", "byte", "number", "in", "an", "address\"", ")", "if", "(", "sblock", "->", "sizeof_size", "!=", "2", "&&", "sblock", "->", "sizeof_size", "!=", "4", "&&", "sblock", "->", "sizeof_size", "!=", "8", "&&", "sblock", "->", "sizeof_size", "!=", "16", "&&", "sblock", "->", "sizeof_size", "!=", "32", ")", "HGOTO_ERROR", "(", "H5E_FILE", ",", "H5E_BADVALUE", ",", "FAIL", ",", "\"bad", "byte", "number", "for", "object", "size\"", ")", "/*", "Check", "for", "extending", "the", "EOA", "for", "the", "file", "*/", "if", "(", "extend_eoa", ")", "{", "size_t", "variable_size", ";", "/*", "Variable", "size", "of", "superblock", "*/", "/*", "Determine", "the", "size", "of", "the", "variable-length", "part", "of", "the", "superblock", "*/", "variable_size", "=", "(", "size_t", ")", "H5F_SUPERBLOCK_VARLEN_SIZE", "(", "sblock", "->", "super_vers", ",", "sblock", "->", "sizeof_addr", ",", "sblock", "->", "sizeof_size", ")", ";", "HDassert", "(", "variable_size", ">", "0", ")", ";", "/*", "Make", "certain", "we", "can", "read", "the", "variable-sized", "portion", "of", "the", "superblock", "*/", "if", "(", "H5F__set_eoa", "(", "udata", "->", "f", ",", "H5FD_MEM_SUPER", ",", "(", "haddr_t", ")", "(", "H5F_SUPERBLOCK_FIXED_SIZE", "+", "variable_size", ")", ")", "<", "0", ")", "HGOTO_ERROR", "(", "H5E_FILE", ",", "H5E_CANTINIT", ",", "FAIL", ",", "\"set", "end", "of", "space", "allocation", "request", "failed\"", ")", "}", "/*", "end", "if", "*/", "/*", "Update", "the", "image", "buffer", "pointer", "*/", "*", "image_ref", "=", "image", ";", "done", ":", "FUNC_LEAVE_NOAPI", "(", "ret_value", ")", "}'" ]
H5F__superblock_prefix_decode
tbeu/matio
multi_line
train
883
1,119
[ "Destroy", "release", "an", "\"in", "core", "representation\"", "of", "a", "data", "structure", "Note:", "The", "metadata", "cache", "sets", "the", "object's", "cache_info" ]
[ "'static", "herr_t", "H5F__cache_drvrinfo_free_icr", "(", "void", "*", "_thing", ")", "{", "H5O_drvinfo_t", "*", "drvinfo", "=", "(", "H5O_drvinfo_t", "*", ")", "_thing", ";", "/*", "Pointer", "to", "the", "object", "*/", "FUNC_ENTER_STATIC_NOERR", "/*", "Check", "arguments", "*/", "HDassert", "(", "drvinfo", ")", ";", "HDassert", "(", "drvinfo", "->", "cache_info", ".", "magic", "==", "H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC", ")", ";", "HDassert", "(", "drvinfo", "->", "cache_info", ".", "type", "==", "H5AC_DRVRINFO", ")", ";", "/*", "Destroy", "driver", "info", "message", "*/", "H5MM_xfree", "(", "drvinfo", ")", ";", "FUNC_LEAVE_NOAPI", "(", "SUCCEED", ")", "}'" ]
H5F__cache_drvrinfo_free_icr
tbeu/matio
multi_line
train
884
1,120
[ "Flushes", "a", "dirty", "object", "to", "disk" ]
[ "'static", "herr_t", "H5F__cache_drvrinfo_serialize", "(", "const", "H5F_t", "*", "f", ",", "void", "*", "_image", ",", "size_t", "H5_ATTR_NDEBUG_UNUSED", "len", ",", "void", "*", "_thing", ")", "{", "H5O_drvinfo_t", "*", "drvinfo", "=", "(", "H5O_drvinfo_t", "*", ")", "_thing", ";", "/*", "Pointer", "to", "the", "object", "*/", "uint8_t", "*", "image", "=", "_image", ";", "/*", "Pointer", "into", "raw", "data", "buffer", "*/", "uint8_t", "*", "dbuf", ";", "/*", "Pointer", "to", "beginning", "of", "driver", "info", "*/", "herr_t", "ret_value", "=", "SUCCEED", ";", "/*", "Return", "value", "*/", "FUNC_ENTER_STATIC", "/*", "check", "arguments", "*/", "HDassert", "(", "f", ")", ";", "HDassert", "(", "image", ")", ";", "HDassert", "(", "drvinfo", ")", ";", "HDassert", "(", "drvinfo", "->", "cache_info", ".", "magic", "==", "H5C__H5C_CACHE_ENTRY_T_MAGIC", ")", ";", "HDassert", "(", "drvinfo", "->", "cache_info", ".", "type", "==", "H5AC_DRVRINFO", ")", ";", "HDassert", "(", "len", "==", "(", "size_t", ")", "(", "H5F_DRVINFOBLOCK_HDR_SIZE", "+", "drvinfo", "->", "len", ")", ")", ";", "/*", "Save", "pointer", "to", "beginning", "of", "driver", "info", "*/", "dbuf", "=", "image", ";", "/*", "Encode", "the", "driver", "information", "block", "*/", "*", "image", "++", "=", "HDF5_DRIVERINFO_VERSION_0", ";", "/*", "Version", "*/", "*", "image", "++", "=", "0", ";", "/*", "reserved", "*/", "*", "image", "++", "=", "0", ";", "/*", "reserved", "*/", "*", "image", "++", "=", "0", ";", "/*", "reserved", "*/", "/*", "Driver", "info", "size,", "excluding", "header", "*/", "UINT32ENCODE", "(", "image", ",", "drvinfo", "->", "len", ")", ";", "/*", "Encode", "driver-specific", "data", "*/", "if", "(", "H5FD_sb_encode", "(", "f", "->", "shared", "->", "lf", ",", "(", "char", "*", ")", "image", ",", "dbuf", "+", "H5F_DRVINFOBLOCK_HDR_SIZE", ")", "<", "0", ")", "HGOTO_ERROR", "(", "H5E_FILE", ",", "H5E_CANTINIT", ",", "FAIL", ",", "\"unable", "to", "encode", "driver", "information\"", ")", "/*", "Advance", "buffer", "pointer", "past", "name", "&", "variable-sized", "portion", "of", "driver", "info", "*/", "image", "+=", "8", "+", "drvinfo", "->", "len", ";", "/*", "Sanity", "check", "*/", "HDassert", "(", "(", "size_t", ")", "(", "image", "-", "(", "uint8_t", "*", ")", "_image", ")", "==", "len", ")", ";", "done", ":", "FUNC_LEAVE_NOAPI", "(", "ret_value", ")", "}'" ]
H5F__cache_drvrinfo_serialize
tbeu/matio
multi_line
train
885
1,121
[ "Destroy", "release", "an", "\"in", "core", "representation\"", "of", "a", "data", "structure", "Note:", "The", "metadata", "cache", "sets", "the", "object's", "cache_info" ]
[ "'static", "herr_t", "H5F__cache_superblock_free_icr", "(", "void", "*", "_thing", ")", "{", "H5F_super_t", "*", "sblock", "=", "(", "H5F_super_t", "*", ")", "_thing", ";", "/*", "Pointer", "to", "the", "object", "*/", "herr_t", "ret_value", "=", "SUCCEED", ";", "/*", "Return", "value", "*/", "FUNC_ENTER_STATIC", "/*", "Sanity", "check", "*/", "HDassert", "(", "sblock", ")", ";", "HDassert", "(", "sblock", "->", "cache_info", ".", "magic", "==", "H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC", ")", ";", "HDassert", "(", "sblock", "->", "cache_info", ".", "type", "==", "H5AC_SUPERBLOCK", ")", ";", "/*", "Destroy", "superblock", "*/", "if", "(", "H5F__super_free", "(", "sblock", ")", "<", "0", ")", "HGOTO_ERROR", "(", "H5E_BTREE", ",", "H5E_CANTFREE", ",", "FAIL", ",", "\"unable", "to", "free", "superblock\"", ")", "done", ":", "FUNC_LEAVE_NOAPI", "(", "ret_value", ")", "}'" ]
H5F__cache_superblock_free_icr
tbeu/matio
multi_line
train
886
1,122
[ "Compute", "the", "final", "size", "of", "the", "data", "structure", "on", "disk" ]
[ "'static", "herr_t", "H5F__cache_drvrinfo_get_final_load_size", "(", "const", "void", "*", "_image", ",", "size_t", "H5_ATTR_NDEBUG_UNUSED", "image_len", ",", "void", "*", "_udata", ",", "size_t", "*", "actual_len", ")", "{", "const", "uint8_t", "*", "image", "=", "_image", ";", "/*", "Pointer", "into", "raw", "data", "buffer", "*/", "H5F_drvrinfo_cache_ud_t", "*", "udata", "=", "(", "H5F_drvrinfo_cache_ud_t", "*", ")", "_udata", ";", "/*", "User", "data", "*/", "H5O_drvinfo_t", "drvrinfo", ";", "/*", "Driver", "info", "*/", "herr_t", "ret_value", "=", "SUCCEED", ";", "/*", "Return", "value", "*/", "FUNC_ENTER_STATIC", "/*", "Check", "arguments", "*/", "HDassert", "(", "image", ")", ";", "HDassert", "(", "udata", ")", ";", "HDassert", "(", "actual_len", ")", ";", "HDassert", "(", "*", "actual_len", "==", "image_len", ")", ";", "HDassert", "(", "image_len", "==", "H5F_DRVINFOBLOCK_HDR_SIZE", ")", ";", "/*", "Deserialize", "the", "file", "driver", "info\\'s", "prefix", "*/", "if", "(", "H5F__drvrinfo_prefix_decode", "(", "&", "drvrinfo", ",", "NULL", ",", "&", "image", ",", "udata", ",", "TRUE", ")", "<", "0", ")", "HGOTO_ERROR", "(", "H5E_FILE", ",", "H5E_CANTDECODE", ",", "FAIL", ",", "\"can\\'t", "decode", "file", "driver", "info", "prefix\"", ")", "/*", "Set", "the", "final", "size", "for", "the", "cache", "image", "*/", "*", "actual_len", "=", "H5F_DRVINFOBLOCK_HDR_SIZE", "+", "drvrinfo", ".", "len", ";", "done", ":", "FUNC_LEAVE_NOAPI", "(", "ret_value", ")", "}'" ]
H5F__cache_drvrinfo_get_final_load_size
tbeu/matio
multi_line
train
887
1,123
[ "Compute", "the", "size", "of", "the", "data", "structure", "on", "disk" ]
[ "'static", "herr_t", "H5F__cache_drvrinfo_image_len", "(", "const", "void", "*", "_thing", ",", "size_t", "*", "image_len", ")", "{", "const", "H5O_drvinfo_t", "*", "drvinfo", "=", "(", "const", "H5O_drvinfo_t", "*", ")", "_thing", ";", "/*", "Pointer", "to", "the", "object", "*/", "FUNC_ENTER_STATIC_NOERR", "/*", "Check", "arguments", "*/", "HDassert", "(", "drvinfo", ")", ";", "HDassert", "(", "drvinfo", "->", "cache_info", ".", "magic", "==", "H5C__H5C_CACHE_ENTRY_T_MAGIC", ")", ";", "HDassert", "(", "drvinfo", "->", "cache_info", ".", "type", "==", "H5AC_DRVRINFO", ")", ";", "HDassert", "(", "image_len", ")", ";", "/*", "Set", "the", "image", "length", "size", "*/", "*", "image_len", "=", "(", "size_t", ")", "(", "H5F_DRVINFOBLOCK_HDR_SIZE", "+", "/*", "Fixed-size", "portion", "of", "driver", "info", "block", "*/", "drvinfo", "->", "len", ")", ";", "/*", "Variable-size", "portion", "of", "driver", "info", "block", "*/", "FUNC_LEAVE_NOAPI", "(", "SUCCEED", ")", "}'" ]
H5F__cache_drvrinfo_image_len
tbeu/matio
multi_line
train
888
1,124
[ "Verify", "the", "computed", "checksum", "of", "the", "data", "structure", "is", "the", "same", "as", "the", "stored", "chksum" ]
[ "'static", "htri_t", "H5F__cache_superblock_verify_chksum", "(", "const", "void", "*", "_image", ",", "size_t", "len", ",", "void", "*", "_udata", ")", "{", "const", "uint8_t", "*", "image", "=", "_image", ";", "/*", "Pointer", "into", "raw", "data", "buffer", "*/", "H5F_superblock_cache_ud_t", "*", "udata", "=", "(", "H5F_superblock_cache_ud_t", "*", ")", "_udata", ";", "/*", "User", "data", "*/", "uint32_t", "stored_chksum", ";", "/*", "Stored", "metadata", "checksum", "value", "*/", "uint32_t", "computed_chksum", ";", "/*", "Computed", "metadata", "checksum", "value", "*/", "htri_t", "ret_value", "=", "TRUE", ";", "/*", "Return", "value", "*/", "FUNC_ENTER_STATIC_NOERR", "/*", "Check", "arguments", "*/", "HDassert", "(", "image", ")", ";", "HDassert", "(", "udata", ")", ";", "/*", "No", "checksum", "for", "version", "0", "&", "1", "*/", "if", "(", "udata", "->", "super_vers", ">=", "HDF5_SUPERBLOCK_VERSION_2", ")", "{", "/*", "Get", "stored", "and", "computed", "checksums", "*/", "H5F_get_checksums", "(", "image", ",", "len", ",", "&", "stored_chksum", ",", "&", "computed_chksum", ")", ";", "if", "(", "stored_chksum", "!=", "computed_chksum", ")", "ret_value", "=", "FALSE", ";", "}", "/*", "end", "if", "*/", "FUNC_LEAVE_NOAPI", "(", "ret_value", ")", "}'" ]
H5F__cache_superblock_verify_chksum
tbeu/matio
multi_line
train
889
1,125
[ "Compute", "the", "final", "size", "of", "the", "data", "structure", "on", "disk" ]
[ "'static", "herr_t", "H5F__cache_superblock_get_final_load_size", "(", "const", "void", "*", "_image", ",", "size_t", "H5_ATTR_NDEBUG_UNUSED", "image_len", ",", "void", "*", "_udata", ",", "size_t", "*", "actual_len", ")", "{", "const", "uint8_t", "*", "image", "=", "_image", ";", "/*", "Pointer", "into", "raw", "data", "buffer", "*/", "H5F_superblock_cache_ud_t", "*", "udata", "=", "(", "H5F_superblock_cache_ud_t", "*", ")", "_udata", ";", "/*", "User", "data", "*/", "H5F_super_t", "sblock", ";", "/*", "Temporary", "file", "superblock", "*/", "htri_t", "ret_value", "=", "SUCCEED", ";", "/*", "Return", "value", "*/", "FUNC_ENTER_STATIC", "/*", "Check", "arguments", "*/", "HDassert", "(", "image", ")", ";", "HDassert", "(", "udata", ")", ";", "HDassert", "(", "actual_len", ")", ";", "HDassert", "(", "*", "actual_len", "==", "image_len", ")", ";", "HDassert", "(", "image_len", ">=", "H5F_SUPERBLOCK_FIXED_SIZE", "+", "6", ")", ";", "/*", "Deserialize", "the", "file", "superblock\\'s", "prefix", "*/", "if", "(", "H5F__superblock_prefix_decode", "(", "&", "sblock", ",", "&", "image", ",", "udata", ",", "TRUE", ")", "<", "0", ")", "HGOTO_ERROR", "(", "H5E_FILE", ",", "H5E_CANTDECODE", ",", "FAIL", ",", "\"can\\'t", "decode", "file", "superblock", "prefix\"", ")", "/*", "Save", "the", "version", "to", "be", "used", "in", "verify_chksum", "callback", "*/", "udata", "->", "super_vers", "=", "sblock", ".", "super_vers", ";", "/*", "Set", "the", "final", "size", "for", "the", "cache", "image", "*/", "*", "actual_len", "=", "H5F_SUPERBLOCK_FIXED_SIZE", "+", "(", "size_t", ")", "H5F_SUPERBLOCK_VARLEN_SIZE", "(", "sblock", ".", "super_vers", ",", "sblock", ".", "sizeof_addr", ",", "sblock", ".", "sizeof_size", ")", ";", "done", ":", "FUNC_LEAVE_NOAPI", "(", "ret_value", ")", "}'" ]
H5F__cache_superblock_get_final_load_size
tbeu/matio
multi_line
train
890
1,126
[ "Compute", "the", "intiial", "size", "of", "the", "data", "structure", "on", "disk" ]
[ "'static", "herr_t", "H5F__cache_drvrinfo_get_initial_load_size", "(", "void", "H5_ATTR_UNUSED", "*", "_udata", ",", "size_t", "*", "image_len", ")", "{", "FUNC_ENTER_STATIC_NOERR", "/*", "Check", "arguments", "*/", "HDassert", "(", "image_len", ")", ";", "/*", "Set", "the", "initial", "image", "length", "size", "*/", "*", "image_len", "=", "H5F_DRVINFOBLOCK_HDR_SIZE", ";", "/*", "Fixed", "size", "portion", "of", "driver", "info", "block", "*/", "FUNC_LEAVE_NOAPI", "(", "SUCCEED", ")", "}'" ]
H5F__cache_drvrinfo_get_initial_load_size
tbeu/matio
multi_line
train
891
1,127
[ "Decode", "a", "driver", "info", "prefix" ]
[ "'static", "herr_t", "H5F__drvrinfo_prefix_decode", "(", "H5O_drvinfo_t", "*", "drvrinfo", ",", "char", "*", "drv_name", ",", "const", "uint8_t", "*", "*", "image_ref", ",", "H5F_drvrinfo_cache_ud_t", "*", "udata", ",", "hbool_t", "extend_eoa", ")", "{", "const", "uint8_t", "*", "image", "=", "(", "const", "uint8_t", "*", ")", "*", "image_ref", ";", "/*", "Pointer", "into", "raw", "data", "buffer", "*/", "unsigned", "drv_vers", ";", "/*", "Version", "of", "driver", "info", "block", "*/", "herr_t", "ret_value", "=", "SUCCEED", ";", "/*", "Return", "value", "*/", "FUNC_ENTER_STATIC", "/*", "Sanity", "check", "*/", "HDassert", "(", "drvrinfo", ")", ";", "HDassert", "(", "image_ref", ")", ";", "HDassert", "(", "image", ")", ";", "HDassert", "(", "udata", ")", ";", "HDassert", "(", "udata", "->", "f", ")", ";", "/*", "Version", "number", "*/", "drv_vers", "=", "*", "image", "++", ";", "if", "(", "drv_vers", "!=", "HDF5_DRIVERINFO_VERSION_0", ")", "HGOTO_ERROR", "(", "H5E_FILE", ",", "H5E_BADVALUE", ",", "FAIL", ",", "\"bad", "driver", "information", "block", "version", "number\"", ")", "image", "+=", "3", ";", "/*", "reserved", "bytes", "*/", "/*", "Driver", "info", "size", "*/", "UINT32DECODE", "(", "image", ",", "drvrinfo", "->", "len", ")", ";", "/*", "Driver", "name", "and/or", "version", "*/", "if", "(", "drv_name", ")", "{", "H5MM_memcpy", "(", "drv_name", ",", "(", "const", "char", "*", ")", "image", ",", "(", "size_t", ")", "8", ")", ";", "drv_name", "[", "8", "]", "=", "\\'\\\\0\\'", ";", "image", "+=", "8", ";", "/*", "advance", "past", "name/version", "*/", "}", "/*", "end", "if", "*/", "/*", "Extend", "the", "EOA", "if", "required", "so", "that", "we", "can", "read", "the", "complete", "driver", "info", "block", "*/", "if", "(", "extend_eoa", ")", "{", "haddr_t", "eoa", ";", "/*", "Current", "EOA", "for", "the", "file", "*/", "haddr_t", "min_eoa", ";", "/*", "Minimum", "EOA", "needed", "for", "reading", "the", "driver", "info", "*/", "/*", "Get", "current", "EOA...", "*/", "eoa", "=", "H5FD_get_eoa", "(", "udata", "->", "f", "->", "shared", "->", "lf", ",", "H5FD_MEM_SUPER", ")", ";", "if", "(", "!", "H5F_addr_defined", "(", "eoa", ")", ")", "HGOTO_ERROR", "(", "H5E_FILE", ",", "H5E_CANTGET", ",", "FAIL", ",", "\"driver", "get_eoa", "request", "failed\"", ")", "/*", "...", "if", "it", "is", "too", "small,", "extend", "it.", "*/", "min_eoa", "=", "udata", "->", "driver_addr", "+", "H5F_DRVINFOBLOCK_HDR_SIZE", "+", "drvrinfo", "->", "len", ";", "/*", "If", "it", "grew,", "set", "it", "*/", "if", "(", "H5F_addr_gt", "(", "min_eoa", ",", "eoa", ")", ")", "if", "(", "H5FD_set_eoa", "(", "udata", "->", "f", "->", "shared", "->", "lf", ",", "H5FD_MEM_SUPER", ",", "min_eoa", ")", "<", "0", ")", "HGOTO_ERROR", "(", "H5E_FILE", ",", "H5E_CANTINIT", ",", "FAIL", ",", "\"set", "end", "of", "space", "allocation", "request", "failed\"", ")", "}", "/*", "end", "if", "*/", "/*", "Update", "the", "image", "buffer", "pointer", "*/", "*", "image_ref", "=", "image", ";", "done", ":", "FUNC_LEAVE_NOAPI", "(", "ret_value", ")", "}'" ]
H5F__drvrinfo_prefix_decode
tbeu/matio
multi_line
train
892
1,128
[ "Compute", "the", "size", "of", "the", "data", "structure", "on", "disk" ]
[ "'static", "herr_t", "H5F__cache_superblock_get_initial_load_size", "(", "void", "H5_ATTR_UNUSED", "*", "_udata", ",", "size_t", "*", "image_len", ")", "{", "FUNC_ENTER_STATIC_NOERR", "/*", "Check", "arguments", "*/", "HDassert", "(", "image_len", ")", ";", "/*", "Set", "the", "initial", "image", "length", "size", "*/", "*", "image_len", "=", "H5F_SUPERBLOCK_FIXED_SIZE", "+", "/*", "Fixed", "size", "of", "superblock", "*/", "H5F_SUPERBLOCK_MINIMAL_VARLEN_SIZE", ";", "FUNC_LEAVE_NOAPI", "(", "SUCCEED", ")", "}'" ]
H5F__cache_superblock_get_initial_load_size
tbeu/matio
multi_line
train
893
1,129
[ "Flushes", "a", "dirty", "object", "to", "disk" ]
[ "'static", "herr_t", "H5F__cache_superblock_serialize", "(", "const", "H5F_t", "*", "f", ",", "void", "*", "_image", ",", "size_t", "H5_ATTR_UNUSED", "len", ",", "void", "*", "_thing", ")", "{", "H5F_super_t", "*", "sblock", "=", "(", "H5F_super_t", "*", ")", "_thing", ";", "/*", "Pointer", "to", "the", "object", "*/", "uint8_t", "*", "image", "=", "_image", ";", "/*", "Pointer", "into", "raw", "data", "buffer", "*/", "haddr_t", "rel_eof", ";", "/*", "Relative", "EOF", "for", "file", "*/", "herr_t", "ret_value", "=", "SUCCEED", ";", "/*", "Return", "value", "*/", "FUNC_ENTER_STATIC", "/*", "Sanity", "check", "*/", "HDassert", "(", "f", ")", ";", "HDassert", "(", "image", ")", ";", "HDassert", "(", "sblock", ")", ";", "/*", "Assert", "that", "the", "superblock", "is", "marked", "as", "being", "flushed", "last", "(and", "collectively", "in", "parallel)", "*/", "/*", "(We\\'ll", "rely", "on", "the", "cache", "to", "make", "sure", "it", "actually", "*is*", "flushed", "last", "(and", "collectively", "in", "parallel),", "but", "this", "check", "doesn\\'t", "hurt)", "*/", "HDassert", "(", "sblock", "->", "cache_info", ".", "flush_me_last", ")", ";", "/*", "Encode", "the", "common", "portion", "of", "the", "file", "superblock", "for", "all", "versions", "*/", "H5MM_memcpy", "(", "image", ",", "H5F_SIGNATURE", ",", "(", "size_t", ")", "H5F_SIGNATURE_LEN", ")", ";", "image", "+=", "H5F_SIGNATURE_LEN", ";", "*", "image", "++", "=", "(", "uint8_t", ")", "sblock", "->", "super_vers", ";", "/*", "Check", "for", "older", "version", "of", "superblock", "format", "*/", "if", "(", "sblock", "->", "super_vers", "<", "HDF5_SUPERBLOCK_VERSION_2", ")", "{", "*", "image", "++", "=", "(", "uint8_t", ")", "HDF5_FREESPACE_VERSION", ";", "/*", "(hard-wired)", "*/", "*", "image", "++", "=", "(", "uint8_t", ")", "HDF5_OBJECTDIR_VERSION", ";", "/*", "(hard-wired)", "*/", "*", "image", "++", "=", "0", ";", "/*", "reserved*/", "*", "image", "++", "=", "(", "uint8_t", ")", "HDF5_SHAREDHEADER_VERSION", ";", "/*", "(hard-wired)", "*/", "*", "image", "++", "=", "sblock", "->", "sizeof_addr", ";", "*", "image", "++", "=", "sblock", "->", "sizeof_size", ";", "*", "image", "++", "=", "0", ";", "/*", "reserved", "*/", "UINT16ENCODE", "(", "image", ",", "sblock", "->", "sym_leaf_k", ")", ";", "UINT16ENCODE", "(", "image", ",", "sblock", "->", "btree_k", "[", "H5B_SNODE_ID", "]", ")", ";", "UINT32ENCODE", "(", "image", ",", "(", "uint32_t", ")", "sblock", "->", "status_flags", ")", ";", "/*", "*", "Versions", "of", "the", "superblock", ">0", "have", "the", "indexed", "storage", "B-tree", "*", "internal", "\\'K\\'", "value", "stored", "*/", "if", "(", "sblock", "->", "super_vers", ">", "HDF5_SUPERBLOCK_VERSION_DEF", ")", "{", "UINT16ENCODE", "(", "image", ",", "sblock", "->", "btree_k", "[", "H5B_CHUNK_ID", "]", ")", ";", "*", "image", "++", "=", "0", ";", "/*reserved", "*/", "*", "image", "++", "=", "0", ";", "/*reserved", "*/", "}", "/*", "end", "if", "*/", "/*", "Encode", "the", "base", "address", "*/", "H5F_addr_encode", "(", "f", ",", "&", "image", ",", "sblock", "->", "base_addr", ")", ";", "/*", "Encode", "the", "address", "of", "global", "free-space", "index", "*/", "H5F_addr_encode", "(", "f", ",", "&", "image", ",", "sblock", "->", "ext_addr", ")", ";", "/*", "Encode", "the", "end-of-file", "address.", "Note", "that", "at", "this", "point", "in", "time,", "*", "the", "EOF", "value", "itself", "may", "not", "be", "reflective", "of", "the", "file\\'s", "size,", "as", "*", "we", "will", "eventually", "truncate", "the", "file", "to", "match", "the", "EOA", "value.", "As", "*", "such,", "use", "the", "EOA", "value", "in", "its", "place,", "knowing", "that", "the", "current", "EOF", "*", "value", "will", "ultimately", "match", "it.", "*/", "if", "(", "(", "rel_eof", "=", "H5FD_get_eoa", "(", "f", "->", "shared", "->", "lf", ",", "H5FD_MEM_SUPER", ")", ")", "==", "HADDR_UNDEF", ")", "HGOTO_ERROR", "(", "H5E_RESOURCE", ",", "H5E_CANTGET", ",", "FAIL", ",", "\"driver", "get_eoa", "request", "failed\"", ")", "H5F_addr_encode", "(", "f", ",", "&", "image", ",", "(", "rel_eof", "+", "sblock", "->", "base_addr", ")", ")", ";", "/*", "Encode", "the", "driver", "informaton", "block", "address", "*/", "H5F_addr_encode", "(", "f", ",", "&", "image", ",", "sblock", "->", "driver_addr", ")", ";", "/*", "Encode", "the", "root", "group", "object", "entry,", "including", "the", "cached", "stab", "info", "*/", "if", "(", "H5G_ent_encode", "(", "f", ",", "&", "image", ",", "sblock", "->", "root_ent", ")", "<", "0", ")", "HGOTO_ERROR", "(", "H5E_FILE", ",", "H5E_CANTENCODE", ",", "FAIL", ",", "\"can\\'t", "encode", "root", "group", "symbol", "table", "entry\"", ")", "/*", "NOTE:", "Driver", "info", "block", "is", "handled", "separately", "*/", "}", "/*", "end", "if", "*/", "else", "{", "/*", "sblock->super_vers", ">=", "HDF5_SUPERBLOCK_VERSION_2", "*/", "uint32_t", "chksum", ";", "/*", "Checksum", "temporary", "variable", "*/", "H5O_loc_t", "*", "root_oloc", ";", "/*", "Pointer", "to", "root", "group\\'s", "object", "location", "*/", "/*", "Size", "of", "file", "addresses", "&", "offsets,", "and", "status", "flags", "*/", "*", "image", "++", "=", "sblock", "->", "sizeof_addr", ";", "*", "image", "++", "=", "sblock", "->", "sizeof_size", ";", "*", "image", "++", "=", "sblock", "->", "status_flags", ";", "/*", "Encode", "the", "base", "address", "*/", "H5F_addr_encode", "(", "f", ",", "&", "image", ",", "sblock", "->", "base_addr", ")", ";", "/*", "Encode", "the", "address", "of", "the", "superblock", "extension", "*/", "H5F_addr_encode", "(", "f", ",", "&", "image", ",", "sblock", "->", "ext_addr", ")", ";", "/*", "At", "this", "point", "in", "time,", "the", "EOF", "value", "itself", "may", "*", "not", "be", "reflective", "of", "the", "file\\'s", "size,", "since", "we\\'ll", "eventually", "*", "truncate", "it", "to", "match", "the", "EOA", "value.", "As", "such,", "use", "the", "EOA", "value", "*", "in", "its", "place,", "knowing", "that", "the", "current", "EOF", "value", "will", "*", "ultimately", "match", "it.", "*/", "if", "(", "(", "rel_eof", "=", "H5FD_get_eoa", "(", "f", "->", "shared", "->", "lf", ",", "H5FD_MEM_SUPER", ")", ")", "==", "HADDR_UNDEF", ")", "HGOTO_ERROR", "(", "H5E_RESOURCE", ",", "H5E_CANTGET", ",", "FAIL", ",", "\"driver", "get_eoa", "request", "failed\"", ")", "H5F_addr_encode", "(", "f", ",", "&", "image", ",", "(", "rel_eof", "+", "sblock", "->", "base_addr", ")", ")", ";", "/*", "Retrieve", "information", "for", "root", "group", "*/", "if", "(", "NULL", "==", "(", "root_oloc", "=", "H5G_oloc", "(", "f", "->", "shared", "->", "root_grp", ")", ")", ")", "HGOTO_ERROR", "(", "H5E_FILE", ",", "H5E_CANTINIT", ",", "FAIL", ",", "\"unable", "to", "retrieve", "root", "group", "information\"", ")", "/*", "Encode", "address", "of", "root", "group\\'s", "object", "header", "*/", "H5F_addr_encode", "(", "f", ",", "&", "image", ",", "root_oloc", "->", "addr", ")", ";", "/*", "Compute", "superblock", "checksum", "*/", "chksum", "=", "H5_checksum_metadata", "(", "_image", ",", "(", "(", "size_t", ")", "H5F_SUPERBLOCK_SIZE", "(", "sblock", ")", "-", "H5F_SIZEOF_CHKSUM", ")", ",", "0", ")", ";", "/*", "Superblock", "checksum", "*/", "UINT32ENCODE", "(", "image", ",", "chksum", ")", ";", "/*", "Sanity", "check", "*/", "HDassert", "(", "(", "size_t", ")", "(", "image", "-", "(", "uint8_t", "*", ")", "_image", ")", "==", "(", "size_t", ")", "H5F_SUPERBLOCK_SIZE", "(", "sblock", ")", ")", ";", "}", "/*", "end", "else", "*/", "/*", "Sanity", "check", "*/", "HDassert", "(", "(", "size_t", ")", "(", "image", "-", "(", "uint8_t", "*", ")", "_image", ")", "==", "len", ")", ";", "done", ":", "FUNC_LEAVE_NOAPI", "(", "ret_value", ")", "}'" ]
H5F__cache_superblock_serialize
tbeu/matio
multi_line
train
894
1,130
[ "Loads", "an", "object", "from", "the", "disk" ]
[ "'static", "void", "*", "H5F__cache_superblock_deserialize", "(", "const", "void", "*", "_image", ",", "size_t", "H5_ATTR_NDEBUG_UNUSED", "len", ",", "void", "*", "_udata", ",", "hbool_t", "H5_ATTR_UNUSED", "*", "dirty", ")", "{", "H5F_super_t", "*", "sblock", "=", "NULL", ";", "/*", "File\\'s", "superblock", "*/", "H5F_superblock_cache_ud_t", "*", "udata", "=", "(", "H5F_superblock_cache_ud_t", "*", ")", "_udata", ";", "/*", "User", "data", "*/", "const", "uint8_t", "*", "image", "=", "_image", ";", "/*", "Pointer", "into", "raw", "data", "buffer", "*/", "H5F_super_t", "*", "ret_value", "=", "NULL", ";", "/*", "Return", "value", "*/", "FUNC_ENTER_STATIC", "/*", "Check", "arguments", "*/", "HDassert", "(", "image", ")", ";", "HDassert", "(", "udata", ")", ";", "HDassert", "(", "udata", "->", "f", ")", ";", "HDassert", "(", "len", ">=", "H5F_SUPERBLOCK_FIXED_SIZE", "+", "6", ")", ";", "/*", "Allocate", "space", "for", "the", "superblock", "*/", "if", "(", "NULL", "==", "(", "sblock", "=", "H5FL_CALLOC", "(", "H5F_super_t", ")", ")", ")", "HGOTO_ERROR", "(", "H5E_RESOURCE", ",", "H5E_NOSPACE", ",", "NULL", ",", "\"memory", "allocation", "failed\"", ")", "/*", "Deserialize", "the", "file", "superblock\\'s", "prefix", "*/", "if", "(", "H5F__superblock_prefix_decode", "(", "sblock", ",", "&", "image", ",", "udata", ",", "FALSE", ")", "<", "0", ")", "HGOTO_ERROR", "(", "H5E_FILE", ",", "H5E_CANTDECODE", ",", "NULL", ",", "\"can\\'t", "decode", "file", "superblock", "prefix\"", ")", "/*", "Check", "for", "older", "version", "of", "superblock", "format", "*/", "if", "(", "sblock", "->", "super_vers", "<", "HDF5_SUPERBLOCK_VERSION_2", ")", "{", "uint32_t", "status_flags", ";", "/*", "File", "status", "flags", "*/", "unsigned", "sym_leaf_k", ";", "/*", "Symbol", "table", "leaf", "node\\'s", "\\'K\\'", "value", "*/", "unsigned", "snode_btree_k", ";", "/*", "B-tree", "symbol", "table", "internal", "node", "\\'K\\'", "value", "*/", "unsigned", "chunk_btree_k", ";", "/*", "B-tree", "chunk", "internal", "node", "\\'K\\'", "value", "*/", "/*", "Freespace", "version", "(hard-wired)", "*/", "if", "(", "HDF5_FREESPACE_VERSION", "!=", "*", "image", "++", ")", "HGOTO_ERROR", "(", "H5E_FILE", ",", "H5E_BADVALUE", ",", "NULL", ",", "\"bad", "free", "space", "version", "number\"", ")", "/*", "Root", "group", "version", "number", "(hard-wired)", "*/", "if", "(", "HDF5_OBJECTDIR_VERSION", "!=", "*", "image", "++", ")", "HGOTO_ERROR", "(", "H5E_FILE", ",", "H5E_BADVALUE", ",", "NULL", ",", "\"bad", "object", "directory", "version", "number\"", ")", "/*", "Skip", "over", "reserved", "byte", "*/", "image", "++", ";", "/*", "Shared", "header", "version", "number", "(hard-wired)", "*/", "if", "(", "HDF5_SHAREDHEADER_VERSION", "!=", "*", "image", "++", ")", "HGOTO_ERROR", "(", "H5E_FILE", ",", "H5E_BADVALUE", ",", "NULL", ",", "\"bad", "shared-header", "format", "version", "number\"", ")", "/*", "Skip", "over", "size", "of", "file", "addresses", "(already", "decoded)", "*/", "image", "++", ";", "udata", "->", "f", "->", "shared", "->", "sizeof_addr", "=", "sblock", "->", "sizeof_addr", ";", "/*", "Keep", "a", "local", "copy", "also", "*/", "/*", "Skip", "over", "size", "of", "file", "sizes", "(already", "decoded)", "*/", "image", "++", ";", "udata", "->", "f", "->", "shared", "->", "sizeof_size", "=", "sblock", "->", "sizeof_size", ";", "/*", "Keep", "a", "local", "copy", "also", "*/", "/*", "Skip", "over", "reserved", "byte", "*/", "image", "++", ";", "/*", "Various", "B-tree", "sizes", "*/", "UINT16DECODE", "(", "image", ",", "sym_leaf_k", ")", ";", "if", "(", "sym_leaf_k", "==", "0", ")", "HGOTO_ERROR", "(", "H5E_FILE", ",", "H5E_BADRANGE", ",", "NULL", ",", "\"bad", "symbol", "table", "leaf", "node", "1/2", "rank\"", ")", "udata", "->", "sym_leaf_k", "=", "sym_leaf_k", ";", "/*", "Keep", "a", "local", "copy", "also", "*/", "/*", "Need", "\\'get\\'", "call", "to", "set", "other", "array", "values", "*/", "UINT16DECODE", "(", "image", ",", "snode_btree_k", ")", ";", "if", "(", "snode_btree_k", "==", "0", ")", "HGOTO_ERROR", "(", "H5E_FILE", ",", "H5E_BADRANGE", ",", "NULL", ",", "\"bad", "1/2", "rank", "for", "btree", "internal", "nodes\"", ")", "udata", "->", "btree_k", "[", "H5B_SNODE_ID", "]", "=", "snode_btree_k", ";", "/*", "*", "Delay", "setting", "the", "value", "in", "the", "property", "list", "until", "we\\'ve", "checked", "*", "for", "the", "indexed", "storage", "B-tree", "internal", "\\'K\\'", "value", "later.", "*/", "/*", "File", "status", "flags", "(not", "really", "used", "yet)", "*/", "UINT32DECODE", "(", "image", ",", "status_flags", ")", ";", "HDassert", "(", "status_flags", "<=", "255", ")", ";", "sblock", "->", "status_flags", "=", "(", "uint8_t", ")", "status_flags", ";", "if", "(", "sblock", "->", "status_flags", "&", "~", "H5F_SUPER_ALL_FLAGS", ")", "HGOTO_ERROR", "(", "H5E_FILE", ",", "H5E_BADVALUE", ",", "NULL", ",", "\"bad", "flag", "value", "for", "superblock\"", ")", "/*", "*", "If", "the", "superblock", "version", "#", "is", "greater", "than", "0,", "read", "in", "the", "indexed", "*", "storage", "B-tree", "internal", "\\'K\\'", "value", "*/", "if", "(", "sblock", "->", "super_vers", ">", "HDF5_SUPERBLOCK_VERSION_DEF", ")", "{", "UINT16DECODE", "(", "image", ",", "chunk_btree_k", ")", ";", "/*", "Reserved", "bytes", "are", "present", "only", "in", "version", "1", "*/", "if", "(", "sblock", "->", "super_vers", "==", "HDF5_SUPERBLOCK_VERSION_1", ")", "image", "+=", "2", ";", "/*", "reserved", "*/", "}", "/*", "end", "if", "*/", "else", "chunk_btree_k", "=", "HDF5_BTREE_CHUNK_IK_DEF", ";", "udata", "->", "btree_k", "[", "H5B_CHUNK_ID", "]", "=", "chunk_btree_k", ";", "/*", "Remainder", "of", "\"variable-sized\"", "portion", "of", "superblock", "*/", "H5F_addr_decode", "(", "udata", "->", "f", ",", "(", "const", "uint8_t", "*", "*", ")", "&", "image", ",", "&", "sblock", "->", "base_addr", "/*out*/", ")", ";", "H5F_addr_decode", "(", "udata", "->", "f", ",", "(", "const", "uint8_t", "*", "*", ")", "&", "image", ",", "&", "sblock", "->", "ext_addr", "/*out*/", ")", ";", "H5F_addr_decode", "(", "udata", "->", "f", ",", "(", "const", "uint8_t", "*", "*", ")", "&", "image", ",", "&", "udata", "->", "stored_eof", "/*out*/", ")", ";", "H5F_addr_decode", "(", "udata", "->", "f", ",", "(", "const", "uint8_t", "*", "*", ")", "&", "image", ",", "&", "sblock", "->", "driver_addr", "/*out*/", ")", ";", "/*", "Allocate", "space", "for", "the", "root", "group", "symbol", "table", "entry", "*/", "HDassert", "(", "!", "sblock", "->", "root_ent", ")", ";", "if", "(", "NULL", "==", "(", "sblock", "->", "root_ent", "=", "(", "H5G_entry_t", "*", ")", "H5MM_calloc", "(", "sizeof", "(", "H5G_entry_t", ")", ")", ")", ")", "HGOTO_ERROR", "(", "H5E_FILE", ",", "H5E_CANTALLOC", ",", "NULL", ",", "\"can\\'t", "allocate", "space", "for", "root", "group", "symbol", "table", "entry\"", ")", "/*", "decode", "the", "root", "group", "symbol", "table", "entry", "*/", "if", "(", "H5G_ent_decode", "(", "udata", "->", "f", ",", "(", "const", "uint8_t", "*", "*", ")", "&", "image", ",", "sblock", "->", "root_ent", ")", "<", "0", ")", "HGOTO_ERROR", "(", "H5E_FILE", ",", "H5E_CANTDECODE", ",", "NULL", ",", "\"can\\'t", "decode", "root", "group", "symbol", "table", "entry\"", ")", "/*", "Set", "the", "root", "group", "address", "to", "the", "correct", "value", "*/", "sblock", "->", "root_addr", "=", "sblock", "->", "root_ent", "->", "header", ";", "/*", "This", "step", "is", "for", "h5repart", "tool", "only.", "If", "user", "wants", "to", "change", "file", "driver", "*", "from", "family", "to", "sec2", "while", "using", "h5repart,", "set", "the", "driver", "address", "to", "*", "undefined", "to", "let", "the", "library", "ignore", "the", "family", "driver", "information", "saved", "*", "in", "the", "superblock.", "*/", "if", "(", "udata", "->", "ignore_drvrinfo", "&&", "H5F_addr_defined", "(", "sblock", "->", "driver_addr", ")", ")", "{", "/*", "Eliminate", "the", "driver", "info", "*/", "sblock", "->", "driver_addr", "=", "HADDR_UNDEF", ";", "udata", "->", "drvrinfo_removed", "=", "TRUE", ";", "}", "/*", "end", "if", "*/", "/*", "NOTE:", "Driver", "info", "block", "is", "decoded", "separately,", "later", "*/", "}", "/*", "end", "if", "*/", "else", "{", "uint32_t", "read_chksum", ";", "/*", "Checksum", "read", "from", "file", "*/", "/*", "Skip", "over", "size", "of", "file", "addresses", "(already", "decoded)", "*/", "image", "++", ";", "udata", "->", "f", "->", "shared", "->", "sizeof_addr", "=", "sblock", "->", "sizeof_addr", ";", "/*", "Keep", "a", "local", "copy", "also", "*/", "/*", "Skip", "over", "size", "of", "file", "sizes", "(already", "decoded)", "*/", "image", "++", ";", "udata", "->", "f", "->", "shared", "->", "sizeof_size", "=", "sblock", "->", "sizeof_size", ";", "/*", "Keep", "a", "local", "copy", "also", "*/", "/*", "File", "status", "flags", "(not", "really", "used", "yet)", "*/", "sblock", "->", "status_flags", "=", "*", "image", "++", ";", "if", "(", "sblock", "->", "status_flags", "&", "~", "H5F_SUPER_ALL_FLAGS", ")", "HGOTO_ERROR", "(", "H5E_FILE", ",", "H5E_BADVALUE", ",", "NULL", ",", "\"bad", "flag", "value", "for", "superblock\"", ")", "/*", "Base,", "superblock", "extension,", "end", "of", "file", "&", "root", "group", "object", "header", "addresses", "*/", "H5F_addr_decode", "(", "udata", "->", "f", ",", "(", "const", "uint8_t", "*", "*", ")", "&", "image", ",", "&", "sblock", "->", "base_addr", "/*out*/", ")", ";", "H5F_addr_decode", "(", "udata", "->", "f", ",", "(", "const", "uint8_t", "*", "*", ")", "&", "image", ",", "&", "sblock", "->", "ext_addr", "/*out*/", ")", ";", "H5F_addr_decode", "(", "udata", "->", "f", ",", "(", "const", "uint8_t", "*", "*", ")", "&", "image", ",", "&", "udata", "->", "stored_eof", "/*out*/", ")", ";", "H5F_addr_decode", "(", "udata", "->", "f", ",", "(", "const", "uint8_t", "*", "*", ")", "&", "image", ",", "&", "sblock", "->", "root_addr", "/*out*/", ")", ";", "/*", "checksum", "verification", "already", "done", "in", "verify_chksum", "cb", "*/", "/*", "Decode", "checksum", "*/", "UINT32DECODE", "(", "image", ",", "read_chksum", ")", ";", "/*", "The", "Driver", "Information", "Block", "may", "not", "appear", "with", "the", "version", "*", "2", "super", "block.", "Thus", "we", "set", "the", "driver_addr", "field", "of", "the", "in", "*", "core", "representation", "of", "the", "super", "block", "HADDR_UNDEF", "to", "prevent", "*", "any", "attempt", "to", "load", "the", "Driver", "Information", "Block.", "*/", "sblock", "->", "driver_addr", "=", "HADDR_UNDEF", ";", "}", "/*", "end", "else", "*/", "/*", "Sanity", "check", "*/", "HDassert", "(", "(", "size_t", ")", "(", "image", "-", "(", "const", "uint8_t", "*", ")", "_image", ")", "<=", "len", ")", ";", "/*", "Set", "return", "value", "*/", "ret_value", "=", "sblock", ";", "done", ":", "/*", "Release", "the", "[possibly", "partially", "initialized]", "superblock", "on", "error", "*/", "if", "(", "!", "ret_value", "&&", "sblock", ")", "if", "(", "H5F__super_free", "(", "sblock", ")", "<", "0", ")", "HDONE_ERROR", "(", "H5E_FILE", ",", "H5E_CANTFREE", ",", "NULL", ",", "\"unable", "to", "destroy", "superblock", "data\"", ")", "FUNC_LEAVE_NOAPI", "(", "ret_value", ")", "}'" ]
H5F__cache_superblock_deserialize
tbeu/matio
multi_line
train
895
1,131
[ "Compute", "the", "size", "of", "the", "data", "structure", "on", "disk" ]
[ "'static", "herr_t", "H5F__cache_superblock_image_len", "(", "const", "void", "*", "_thing", ",", "size_t", "*", "image_len", ")", "{", "const", "H5F_super_t", "*", "sblock", "=", "(", "const", "H5F_super_t", "*", ")", "_thing", ";", "/*", "Pointer", "to", "the", "object", "*/", "FUNC_ENTER_STATIC_NOERR", "/*", "Check", "arguments", "*/", "HDassert", "(", "sblock", ")", ";", "HDassert", "(", "sblock", "->", "cache_info", ".", "magic", "==", "H5C__H5C_CACHE_ENTRY_T_MAGIC", ")", ";", "HDassert", "(", "sblock", "->", "cache_info", ".", "type", "==", "H5AC_SUPERBLOCK", ")", ";", "HDassert", "(", "image_len", ")", ";", "/*", "Set", "the", "image", "length", "size", "*/", "*", "image_len", "=", "(", "size_t", ")", "H5F_SUPERBLOCK_SIZE", "(", "sblock", ")", ";", "FUNC_LEAVE_NOAPI", "(", "SUCCEED", ")", "}'" ]
H5F__cache_superblock_image_len
tbeu/matio
multi_line
train
896
1,132
[ "Loads", "an", "object", "from", "the", "disk" ]
[ "'static", "void", "*", "H5F__cache_drvrinfo_deserialize", "(", "const", "void", "*", "_image", ",", "size_t", "H5_ATTR_NDEBUG_UNUSED", "len", ",", "void", "*", "_udata", ",", "hbool_t", "H5_ATTR_UNUSED", "*", "dirty", ")", "{", "H5O_drvinfo_t", "*", "drvinfo", "=", "NULL", ";", "/*", "Driver", "info", "*/", "H5F_drvrinfo_cache_ud_t", "*", "udata", "=", "(", "H5F_drvrinfo_cache_ud_t", "*", ")", "_udata", ";", "/*", "User", "data", "*/", "const", "uint8_t", "*", "image", "=", "_image", ";", "/*", "Pointer", "into", "raw", "data", "buffer", "*/", "char", "drv_name", "[", "9", "]", ";", "/*", "Name", "of", "driver", "*/", "H5O_drvinfo_t", "*", "ret_value", "=", "NULL", ";", "/*", "Return", "value", "*/", "FUNC_ENTER_STATIC", "/*", "Sanity", "check", "*/", "HDassert", "(", "image", ")", ";", "HDassert", "(", "len", ">=", "H5F_DRVINFOBLOCK_HDR_SIZE", ")", ";", "HDassert", "(", "udata", ")", ";", "HDassert", "(", "udata", "->", "f", ")", ";", "/*", "Allocate", "space", "for", "the", "driver", "info", "*/", "if", "(", "NULL", "==", "(", "drvinfo", "=", "(", "H5O_drvinfo_t", "*", ")", "H5MM_calloc", "(", "sizeof", "(", "H5O_drvinfo_t", ")", ")", ")", ")", "HGOTO_ERROR", "(", "H5E_FILE", ",", "H5E_CANTALLOC", ",", "NULL", ",", "\"memory", "allocation", "failed", "for", "driver", "info", "message\"", ")", "/*", "Deserialize", "the", "file", "driver", "info\\'s", "prefix", "*/", "if", "(", "H5F__drvrinfo_prefix_decode", "(", "drvinfo", ",", "drv_name", ",", "&", "image", ",", "udata", ",", "FALSE", ")", "<", "0", ")", "HGOTO_ERROR", "(", "H5E_FILE", ",", "H5E_CANTDECODE", ",", "NULL", ",", "\"can\\'t", "decode", "file", "driver", "info", "prefix\"", ")", "/*", "Sanity", "check", "*/", "HDassert", "(", "len", "==", "(", "H5F_DRVINFOBLOCK_HDR_SIZE", "+", "drvinfo", "->", "len", ")", ")", ";", "/*", "Validate", "and", "decode", "driver", "information", "*/", "if", "(", "H5FD_sb_load", "(", "udata", "->", "f", "->", "shared", "->", "lf", ",", "drv_name", ",", "image", ")", "<", "0", ")", "HGOTO_ERROR", "(", "H5E_FILE", ",", "H5E_CANTDECODE", ",", "NULL", ",", "\"unable", "to", "decode", "driver", "information\"", ")", "/*", "Sanity", "check", "*/", "HDassert", "(", "(", "size_t", ")", "(", "image", "-", "(", "const", "uint8_t", "*", ")", "_image", ")", "<=", "len", ")", ";", "/*", "Set", "return", "value", "*/", "ret_value", "=", "drvinfo", ";", "done", ":", "/*", "Release", "the", "[possibly", "partially", "initialized]", "driver", "info", "message", "on", "error", "*/", "if", "(", "!", "ret_value", "&&", "drvinfo", ")", "H5MM_xfree", "(", "drvinfo", ")", ";", "FUNC_LEAVE_NOAPI", "(", "ret_value", ")", "}'" ]
H5F__cache_drvrinfo_deserialize
tbeu/matio
multi_line
train
897
1,133
[ "cleanup:", "only", "called", "for", "threadshared", "itimer", "for", "last", "thread", "in", "group" ]
[ "\"void", "pcprofile_thread_exit", "(", "dcontext_t", "*", "dcontext", ")", "{", "int", "size", ";", "thread_pc_info_t", "*", "info", "=", "(", "thread_pc_info_t", "*", ")", "dcontext", "->", "pcprofile_field", ";", "/*", "don't", "want", "any", "alarms", "while", "holding", "lock", "for", "printing", "results", "*", "(see", "notes", "under", "pcprofile_cache_flush", "below)", "*/", "set_itimer_callback", "(", "dcontext", ",", "ITIMER_VIRTUAL", ",", "0", ",", "NULL", ",", "NULL", ")", ";", "pcprofile_results", "(", "info", ")", ";", "size", "=", "HASHTABLE_SIZE", "(", "HASH_BITS", ")", "*", "sizeof", "(", "pc_profile_entry_t", "*", ")", ";", "pcprofile_reset", "(", "info", ")", ";", "/*", "special", "heap", "so", "no", "fast", "path", "*/", "#", "ifdef", "DEBUG", "/*", "for", "non-debug", "we", "do", "fast", "exit", "path", "and", "don't", "free", "local", "heap", "*/", "global_heap_free", "(", "info->htable", ",", "size", "HEAPACCT(ACCT_OTHER)", ")", ";", "#", "endif", "#", "if", "USE_SYMTAB", "if", "(", "valid_symtab", ")", "symtab_exit", "()", ";", "#", "endif", "close_log_file", "(", "info", "->", "file", ")", ";", "special_heap_exit", "(", "info", "->", "special_heap", ")", ";", "#", "ifdef", "DEBUG", "/*", "for", "non-debug", "we", "do", "fast", "exit", "path", "and", "don't", "free", "local", "heap", "*/", "global_heap_free", "(", "info", ",", "sizeof", "(", "thread_pc_info_t", ")", "HEAPACCT", "(", "ACCT_OTHER", ")", ")", ";", "#", "endif", "}\"" ]
pcprofile_thread_exit
DynamoRIO/dynamorio
single_line
train
898
1,134
[ "create", "a", "new,", "initialized", "profile", "pc", "entry" ]
[ "'static", "pc_profile_entry_t", "*", "pcprofile_add_entry", "(", "thread_pc_info_t", "*", "info", ",", "void", "*", "pc", ",", "int", "whereami", ")", "{", "uint", "hindex", ";", "pc_profile_entry_t", "*", "e", ";", "/*", "special_heap", "is", "hardcoded", "for", "sizeof(pc_profile_entry_t)", "*/", "apicheck", "(", "special_heap_can_calloc", "(", "info", "->", "special_heap", ",", "1", ")", ",", "\"Profile", "pc", "heap", "capacity", "exceeded.", "Use", "option", "-prof_pcs_heap_size", "\"", "\"to", "rerun", "with", "a", "larger", "profiling", "heap.\"", ")", ";", "e", "=", "(", "pc_profile_entry_t", "*", ")", "special_heap_alloc", "(", "info", "->", "special_heap", ")", ";", "e", "->", "pc", "=", "pc", ";", "e", "->", "counter", "=", "1", ";", "e", "->", "whereami", "=", "whereami", ";", "e", "->", "next", "=", "NULL", ";", "#", "ifdef", "DEBUG", "e", "->", "id", "=", "0", ";", "#", "endif", "e", "->", "tag", "=", "0", ";", "e", "->", "offset", "=", "0", ";", "e", "->", "trace", "=", "false", ";", "e", "->", "retired", "=", "false", ";", "/*", "add", "e", "to", "the", "htable", "*/", "hindex", "=", "HASH_FUNC_BITS", "(", "(", "ptr_uint_t", ")", "pc", ",", "HASH_BITS", ")", ";", "e", "->", "next", "=", "info", "->", "htable", "[", "hindex", "]", ";", "info", "->", "htable", "[", "hindex", "]", "=", "e", ";", "return", "e", ";", "}'" ]
pcprofile_add_entry
DynamoRIO/dynamorio
single_line
train
899