void shift(double *rpots_daily, const int hroz) {
  int i;
  int y;
  int row;
  if (720 == hroz) {
    return;
  }
  row = hroz - 720;
  if (row > 0) {
    for (i = 0; i < row; i++) {
      for (y = 1440 - 1; y > 0; y--) {
        rpots_daily[y] = rpots_daily[y - 1];
      }
      rpots_daily[y] = 0;
    }
  } else {
    row *= -1;
    for (i = 0; i < row; i++) {
      for (y = 1; y < 1440; y++) {
        rpots_daily[y - 1] = rpots_daily[y];
      }
      rpots_daily[y - 1] = 0;
    }
  }
}


x86 assembly (clang, -O0):
<shift>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x2d0,%eax
cmp    -0xc(%rbp),%eax
jne    111e <shift+0x1e>
jmp    122a <shift+0x12a>
mov    -0xc(%rbp),%eax
sub    $0x2d0,%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jle    11a7 <shift+0xa7>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    11a2 <shift+0xa2>
movl   $0x59f,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    1184 <shift+0x84>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    114d <shift+0x4d>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    113a <shift+0x3a>
jmp    122a <shift+0x12a>
imul   $0xffffffff,-0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1225 <shift+0x125>
movl   $0x1,-0x14(%rbp)
cmpl   $0x5a0,-0x14(%rbp)
jge    1202 <shift+0x102>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11c8 <shift+0xc8>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11b5 <shift+0xb5>
jmp    122a <shift+0x12a>
pop    %rbp
ret

x86 assembly (clang, -O2):
<shift>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
cmp    $0x2d0,%esi
je     13a0 <shift+0x290>
mov    %esi,%r14d
mov    %rdi,%rbx
jle    1251 <shift+0x141>
lea    0x8(%rbx),%r15
lea    -0x2d1(%r14),%eax
mov    %r14d,%ebp
and    $0x7,%ebp
cmp    $0x7,%eax
jb     1222 <shift+0x112>
add    $0xfffffd30,%r14d
and    $0xfffffff8,%r14d
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x2cf8,%edx
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <memmove@plt>
movq   $0x0,(%rbx)
mov    $0x2cf8,%edx
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <memmove@plt>
movq   $0x0,(%rbx)
mov    $0x2cf8,%edx
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <memmove@plt>
movq   $0x0,(%rbx)
mov    $0x2cf8,%edx
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <memmove@plt>
movq   $0x0,(%rbx)
mov    $0x2cf8,%edx
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <memmove@plt>
movq   $0x0,(%rbx)
mov    $0x2cf8,%edx
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <memmove@plt>
movq   $0x0,(%rbx)
mov    $0x2cf8,%edx
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <memmove@plt>
movq   $0x0,(%rbx)
mov    $0x2cf8,%edx
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <memmove@plt>
movq   $0x0,(%rbx)
add    $0xfffffff8,%r14d
jne    1160 <shift+0x50>
test   %ebp,%ebp
je     13a0 <shift+0x290>
nopw   0x0(%rax,%rax,1)
mov    $0x2cf8,%edx
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <memmove@plt>
movq   $0x0,(%rbx)
add    $0xffffffff,%ebp
jne    1230 <shift+0x120>
jmp    13a0 <shift+0x290>
mov    $0x2d0,%r12d
sub    %r14d,%r12d
test   %r12d,%r12d
jle    13a0 <shift+0x290>
lea    0x8(%rbx),%r15
mov    %r12d,%ebp
and    $0x7,%ebp
add    $0xfffffd37,%r14d
cmp    $0x7,%r14d
jb     1372 <shift+0x262>
and    $0xfffffff8,%r12d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x2cf8,%edx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <memmove@plt>
movq   $0x0,0x2cf8(%rbx)
mov    $0x2cf8,%edx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <memmove@plt>
movq   $0x0,0x2cf8(%rbx)
mov    $0x2cf8,%edx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <memmove@plt>
movq   $0x0,0x2cf8(%rbx)
mov    $0x2cf8,%edx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <memmove@plt>
movq   $0x0,0x2cf8(%rbx)
mov    $0x2cf8,%edx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <memmove@plt>
movq   $0x0,0x2cf8(%rbx)
mov    $0x2cf8,%edx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <memmove@plt>
movq   $0x0,0x2cf8(%rbx)
mov    $0x2cf8,%edx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <memmove@plt>
movq   $0x0,0x2cf8(%rbx)
mov    $0x2cf8,%edx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <memmove@plt>
movq   $0x0,0x2cf8(%rbx)
add    $0xfffffff8,%r12d
jne    1290 <shift+0x180>
test   %ebp,%ebp
je     13a0 <shift+0x290>
cs nopw 0x0(%rax,%rax,1)
mov    $0x2cf8,%edx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <memmove@plt>
movq   $0x0,0x2cf8(%rbx)
add    $0xffffffff,%ebp
jne    1380 <shift+0x270>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @shift(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
%8 = load i32, i32* %4
%9 = icmp eq i32 720, %8
br i1 %9, label %10, label %11
10: ; preds = %2
br label %83
11: ; preds = %2
%12 = load i32, i32* %4
%13 = sub nsw i32 %12, 720
store i32 %13, i32* %7
%14 = load i32, i32* %7
%15 = icmp sgt i32 %14, 0
br i1 %15, label %16, label %48
16: ; preds = %11
store i32 0, i32* %5
br label %17
17: ; preds = %44, %16
%18 = load i32, i32* %5
%19 = load i32, i32* %7
%20 = icmp slt i32 %18, %19
br i1 %20, label %21, label %47
21: ; preds = %17
store i32 1439, i32* %6
br label %22
22: ; preds = %36, %21
%23 = load i32, i32* %6
%24 = icmp sgt i32 %23, 0
br i1 %24, label %25, label %39
25: ; preds = %22
%26 = load double*, double** %3
%27 = load i32, i32* %6
%28 = sub nsw i32 %27, 1
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds double, double* %26, i64 %29
%31 = load double, double* %30
%32 = load double*, double** %3
%33 = load i32, i32* %6
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds double, double* %32, i64 %34
store double %31, double* %35
br label %36
36: ; preds = %25
%37 = load i32, i32* %6
%38 = add nsw i32 %37, -1
store i32 %38, i32* %6
br label %22
39: ; preds = %22
%40 = load double*, double** %3
%41 = load i32, i32* %6
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds double, double* %40, i64 %42
store double 0.000000e+00, double* %43
br label %44
44: ; preds = %39
%45 = load i32, i32* %5
%46 = add nsw i32 %45, 1
store i32 %46, i32* %5
br label %17
47: ; preds = %17
br label %83
48: ; preds = %11
%49 = load i32, i32* %7
%50 = mul nsw i32 %49, -1
store i32 %50, i32* %7
store i32 0, i32* %5
br label %51
51: ; preds = %79, %48
%52 = load i32, i32* %5
%53 = load i32, i32* %7
%54 = icmp slt i32 %52, %53
br i1 %54, label %55, label %82
55: ; preds = %51
store i32 1, i32* %6
br label %56
56: ; preds = %70, %55
%57 = load i32, i32* %6
%58 = icmp slt i32 %57, 1440
br i1 %58, label %59, label %73
59: ; preds = %56
%60 = load double*, double** %3
%61 = load i32, i32* %6
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds double, double* %60, i64 %62
%64 = load double, double* %63
%65 = load double*, double** %3
%66 = load i32, i32* %6
%67 = sub nsw i32 %66, 1
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds double, double* %65, i64 %68
store double %64, double* %69
br label %70
70: ; preds = %59
%71 = load i32, i32* %6
%72 = add nsw i32 %71, 1
store i32 %72, i32* %6
br label %56
73: ; preds = %56
%74 = load double*, double** %3
%75 = load i32, i32* %6
%76 = sub nsw i32 %75, 1
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds double, double* %74, i64 %77
store double 0.000000e+00, double* %78
br label %79
79: ; preds = %73
%80 = load i32, i32* %5
%81 = add nsw i32 %80, 1
store i32 %81, i32* %5
br label %51
82: ; preds = %51
br label %83
83: ; preds = %10, %82, %47
ret void
}

LLVM IR (-O2):
define void @shift(double* nocapture %0, i32 %1) {
%3 = bitcast double* %0 to i8*
%4 = icmp eq i32 %1, 720
br i1 %4, label %48, label %5
5: ; preds = %2
%6 = add i32 %1, -720
%7 = icmp sgt i32 %1, 720
br i1 %7, label %8, label %20
8: ; preds = %5
%9 = getelementptr double, double* %0, i64 1
%10 = bitcast double* %9 to i8*
%11 = add i32 %1, -721
%12 = and i32 %1, 7
%13 = icmp ult i32 %11, 7
br i1 %13, label %36, label %14
14: ; preds = %8
%15 = and i32 %6, -8
br label %16
16: ; preds = %16, %14
%17 = phi i32 [ 0, %14 ], [ %18, %16 ]
store double 0.000000e+00, double* %0
store double 0.000000e+00, double* %0
store double 0.000000e+00, double* %0
store double 0.000000e+00, double* %0
store double 0.000000e+00, double* %0
store double 0.000000e+00, double* %0
store double 0.000000e+00, double* %0
store double 0.000000e+00, double* %0
%18 = add i32 %17, 8
%19 = icmp eq i32 %18, %15
br i1 %19, label %36, label %16
20: ; preds = %5
%21 = sub i32 720, %1
%22 = icmp sgt i32 %21, 0
br i1 %22, label %23, label %48
23: ; preds = %20
%24 = getelementptr double, double* %0, i64 1
%25 = bitcast double* %24 to i8*
%26 = getelementptr inbounds double, double* %0, i64 1439
%27 = and i32 %21, 7
%28 = add i32 %1, -713
%29 = icmp ult i32 %28, 7
br i1 %29, label %42, label %30
30: ; preds = %23
%31 = and i32 %21, -8
br label %32
32: ; preds = %32, %30
%33 = phi i32 [ 0, %30 ], [ %34, %32 ]
store double 0.000000e+00, double* %26
store double 0.000000e+00, double* %26
store double 0.000000e+00, double* %26
store double 0.000000e+00, double* %26
store double 0.000000e+00, double* %26
store double 0.000000e+00, double* %26
store double 0.000000e+00, double* %26
store double 0.000000e+00, double* %26
%34 = add i32 %33, 8
%35 = icmp eq i32 %34, %31
br i1 %35, label %42, label %32
36: ; preds = %16, %8
%37 = icmp eq i32 %12, 0
br i1 %37, label %48, label %38
38: ; preds = %36, %38
%39 = phi i32 [ %40, %38 ], [ 0, %36 ]
store double 0.000000e+00, double* %0
%40 = add i32 %39, 1
%41 = icmp eq i32 %40, %12
br i1 %41, label %48, label %38
42: ; preds = %32, %23
%43 = icmp eq i32 %27, 0
br i1 %43, label %48, label %44
44: ; preds = %42, %44
%45 = phi i32 [ %46, %44 ], [ 0, %42 ]
store double 0.000000e+00, double* %26
%46 = add i32 %45, 1
%47 = icmp eq i32 %46, %27
br i1 %47, label %48, label %44
48: ; preds = %42, %44, %36, %38, %20, %2
ret void
}