Quantifying In-Context Reasoning Effects and Memorization Effects in LLMs