// File: 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:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movl %esi, 0x3c(%rsp)
movq %rdx, 0x30(%rsp)
cmpq $0xb40, 0x30(%rsp)      # imm = 0xB40
jge 0x44047
leaq 0x28(%rsp), %rdi
callq 0x2280
leaq 0x28(%rsp), %rdi
callq 0x2250
movq %rax, 0x20(%rsp)
movq 0x30(%rsp), %rax
movl $0x3c, %ecx
cqto
idivq %rcx
movl %eax, %ecx
movq 0x20(%rsp), %rax
movl %ecx, 0x8(%rax)
movq 0x20(%rsp), %rax
cmpl $0x18, 0x8(%rax)
jle 0x44011
movq 0x20(%rsp), %rax
movl 0x8(%rax), %ecx
subl $0x18, %ecx
movq 0x20(%rsp), %rax
movl %ecx, 0x8(%rax)
movq 0x20(%rsp), %rdi
callq 0x21c0
movq %rax, 0x28(%rsp)
movq 0x30(%rsp), %rax
movl $0x3c, %ecx
cqto
idivq %rcx
cmpq $0x18, %rax
jle 0x44045
movq 0x28(%rsp), %rax
addq $0x15180, %rax          # imm = 0x15180
movq %rax, 0x28(%rsp)
jmp 0x44051
movq 0x30(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x40(%rsp), %rdi
movslq 0x3c(%rsp), %rsi
callq 0x1ce20
movq (%rax), %rcx
movq %rcx, 0x36106(%rip)     # 0x7a170
movq 0x8(%rax), %rcx
movq %rcx, 0x36103(%rip)     # 0x7a178
movq 0x10(%rax), %rax
movq %rax, 0x36100(%rip)     # 0x7a180
movq 0x40(%rsp), %rdi
movslq 0x3c(%rsp), %rsi
callq 0x1ce20
movq (%rax), %rcx
movq %rcx, 0x360ef(%rip)     # 0x7a188
movq 0x8(%rax), %rcx
movq %rcx, 0x360ec(%rip)     # 0x7a190
movq 0x10(%rax), %rax
movq %rax, 0x360e9(%rip)     # 0x7a198
movl 0x3c(%rsp), %eax
movl %eax, 0x360e7(%rip)     # 0x7a1a0
movl 0x3c(%rsp), %eax
movl %eax, 0x360e1(%rip)     # 0x7a1a4
movl 0x3c(%rsp), %eax
movl %eax, 0x10(%rsp)
movslq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq 0x40(%rsp), %rdi
callq 0x1ce80
movq (%rsp), %rcx
movq %rax, %rdx
xorl %eax, %eax
cmpq %rdx, %rcx
movb %al, 0xf(%rsp)
jae 0x4410e
movq 0x40(%rsp), %rdi
movslq 0x10(%rsp), %rsi
callq 0x1ce20
movq (%rax), %rax
cmpq 0x28(%rsp), %rax
setle %al
movb %al, 0xf(%rsp)
movb 0xf(%rsp), %al
testb $0x1, %al
jne 0x4411b
jmp 0x4420e
movq 0x40(%rsp), %rdi
movslq 0x10(%rsp), %rsi
callq 0x1ce20
movq (%rax), %rax
movl $0x15180, %ecx          # imm = 0x15180
cqto
idivq %rcx
movq %rdx, %rax
movl $0x3c, %ecx
cqto
idivq %rcx
movl %eax, 0x14(%rsp)
movq 0x40(%rsp), %rdi
movslq 0x10(%rsp), %rsi
callq 0x1ce20
movss 0x8(%rax), %xmm0
ucomiss 0x36015(%rip), %xmm0    # 0x7a178
jbe 0x441a0
movq 0x40(%rsp), %rdi
movslq 0x10(%rsp), %rsi
callq 0x1ce20
movq (%rax), %rcx
movq %rcx, 0x35ff2(%rip)     # 0x7a170
movq 0x8(%rax), %rcx
movq %rcx, 0x35fef(%rip)     # 0x7a178
movq 0x10(%rax), %rax
movq %rax, 0x35fec(%rip)     # 0x7a180
movl 0x10(%rsp), %eax
movl %eax, 0x36002(%rip)     # 0x7a1a0
jmp 0x441fc
movq 0x40(%rsp), %rdi
movslq 0x10(%rsp), %rsi
callq 0x1ce20
movss 0x8(%rax), %xmm1
movss 0x35fd4(%rip), %xmm0    # 0x7a190
ucomiss %xmm1, %xmm0
jbe 0x441fa
movq 0x40(%rsp), %rdi
movslq 0x10(%rsp), %rsi
callq 0x1ce20
movq (%rax), %rcx
movq %rcx, 0x35fae(%rip)     # 0x7a188
movq 0x8(%rax), %rcx
movq %rcx, 0x35fab(%rip)     # 0x7a190
movq 0x10(%rax), %rax
movq %rax, 0x35fa8(%rip)     # 0x7a198
movl 0x10(%rsp), %eax
movl %eax, 0x35faa(%rip)     # 0x7a1a4
jmp 0x441fc
jmp 0x441fe
movl 0x10(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x10(%rsp)
jmp 0x440cb
leaq 0x28(%rsp), %rdi
callq 0x2280
leaq 0x28(%rsp), %rdi
callq 0x2250
movq %rax, 0x20(%rsp)
addq $0x48, %rsp
retq
nopl (%rax)