1/* { dg-options "-O3 -floop-interchange" } */
2
3typedef unsigned char uint8_t;
4
5void border_mirror(uint8_t *outer_img, int w, int h, int rb, int border)
6{
7  uint8_t *img = outer_img + border * rb + border;
8  int x, y;
9
10  for (y = -border; y < 0; y++) {
11    for (x = -border; x < 0; x++)
12      img[y*rb + x] = img[(-y)*rb + (-x)];
13
14    for (x = 0; x < w; x++)
15      img[y*rb + x] = img[(-y)*rb + x];
16  }
17}
18
19void border_mirror_480(uint8_t *outer_img)
20{
21  border_mirror(outer_img, 640, 480, 640 + 16*2, 16);
22}
23