// File: /workspace/github_cpp_makefile_star2_O3/Eba-M[P]E3DC-Control/awattar.cpp
// Function: SucheHT(std::vector<watt_s, std::allocator<watt_s>>&, int, long)
void SucheHT(std::vector<watt_s> &w,int ab,long bis)  // ab = Index bis zeitangabe in Minuten oder Sekunden seit 1970
{
    time_t  rawtime;
    struct tm * ptm;
    if (bis < 48*60) {// bis kann entweder Tagesminutensumme oder Sekunden set 1970 sein
    time(&rawtime);
    ptm = gmtime (&rawtime);
    ptm->tm_hour = bis/60;
    if (ptm->tm_hour>24) ptm->tm_hour = ptm->tm_hour-24;
    rawtime = mktime(ptm);
    if (bis/60 > 24)
    rawtime = rawtime + 24*3600;
//    ptm = gmtime (&rawtime);
    } else rawtime = bis;
    high = w[ab];
    low = w[ab];
    h1 = ab;
    l1 = ab;
    time_t  tm_dt;
    int zeit;
    for (int j = ab; ((j < w.size())&&(w[j].hh<=rawtime)); j++ )
    {
// Suchen nach Hoch und Tiefs
        zeit = w[j].hh%(24*3600)/60;
        if (w[j].pp > high.pp) {
            high = w[j];
            h1 = j;
        } else
          if  (w[j].pp < low.pp) {
              low = w[j];
              l1 = j;
          }
    }
    time(&rawtime);
    ptm = gmtime (&rawtime);

    return;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
cmpq $0xb3f, %rdx            # imm = 0xB3F
jg 0x24ee2
movq %rsp, %r15
movq %r15, %rdi
callq 0x2250
movq %r15, %rdi
callq 0x2220
movq %rax, %rdi
movabsq $-0x7777777777777777, %rcx # imm = 0x8888888888888889
movq %rbx, %rax
imulq %rcx
addq %rbx, %rdx
movq %rdx, %rax
shrq $0x3f, %rax
shrq $0x5, %rdx
leal (%rdx,%rax), %ecx
cmpl $0x19, %ecx
leal -0x18(%rdx,%rax), %eax
cmovll %ecx, %eax
movl %eax, 0x8(%rdi)
callq 0x2180
movq %rax, (%r15)
cmpq $0x5dc, %rbx            # imm = 0x5DC
movq %rax, %rbx
jl 0x24ee6
addq $0x15180, %rax          # imm = 0x15180
movq %rax, (%rsp)
movq %rax, %rbx
jmp 0x24ee6
movq %rbx, (%rsp)
movslq %ebp, %rax
movq (%r14), %rdx
leaq (%rax,%rax,2), %rsi
movq 0x10(%rdx,%rsi,8), %rcx
movq %rcx, 0x20224(%rip)     # 0x45120
movups (%rdx,%rsi,8), %xmm0
movups %xmm0, 0x20209(%rip)    # 0x45110
movq 0x10(%rdx,%rsi,8), %rcx
movq %rcx, 0x20225(%rip)     # 0x45138
movups (%rdx,%rsi,8), %xmm0
movups %xmm0, 0x2020a(%rip)    # 0x45128
movl %eax, 0x2021c(%rip)     # 0x45140
movl %eax, 0x2021a(%rip)     # 0x45144
movq 0x8(%r14), %rdi
subq %rdx, %rdi
sarq $0x3, %rdi
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rdi, %rcx
cmpq %rax, %rcx
jbe 0x24fbb
leaq (%rdx,%rsi,8), %rdx
leaq 0x201ed(%rip), %rsi     # 0x45140
leaq 0x201ea(%rip), %rdi     # 0x45144
cmpq %rbx, (%rdx)
jg 0x24fbb
movss 0x8(%rdx), %xmm0
ucomiss 0x201ad(%rip), %xmm0    # 0x45118
jbe 0x24f87
movq 0x10(%rdx), %r8
movq %r8, 0x201a8(%rip)      # 0x45120
movups (%rdx), %xmm0
movups %xmm0, 0x2018e(%rip)    # 0x45110
movq %rsi, %r8
jmp 0x24fac
movss 0x201a1(%rip), %xmm1    # 0x45130
ucomiss %xmm0, %xmm1
jbe 0x24faf
movq 0x10(%rdx), %r8
movq %r8, 0x20199(%rip)      # 0x45138
movups (%rdx), %xmm0
movups %xmm0, 0x2017f(%rip)    # 0x45128
movq %rdi, %r8
movl %eax, (%r8)
incq %rax
addq $0x18, %rdx
cmpq %rax, %rcx
ja 0x24f5a
movq %rsp, %rbx
movq %rbx, %rdi
callq 0x2250
movq %rbx, %rdi
callq 0x2220
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq