Here is an illustration:

```
#include <stdio.h>

void loop(int *a)
{
    int b = *a;

    for (int i = 0; i < b; ++i)
    {
        ;
    }
}

void loop_pointer(int *a)
{
    for (int i = 0; i < *a; ++i)
    {
        ;
    }
}

int main(void)
{
    // Nothing to see here

    return 0;
} 

```

In the `loop` function, the memory is first stored on the stack and then accessed on every iteration. The memory would be cached.

**My question is the following:**
Could the indirection in the `loop_pointer` function result in cache misses? And if so, would a cache miss only occur when the memory is modified(written to) and then accessed(read from) or would it happen on every read?