// File: /workspace/github_cpp_makefile_star2_O1/DoubleString[P]RtConverter/src/Rtklib/rtkcmn.cpp
// Function: bamboo::reppaths(char const*, char**, int, bamboo::gtime_t, bamboo::gtime_t, char const*, char const*)
extern int reppaths(const char *path, char *rpath[], int nmax, gtime_t ts,
                    gtime_t te, const char *rov, const char *base)
{
    gtime_t time;
    double tow,tint=86400.0;
    int i,n=0,week;
    
    trace(3,"reppaths: path =%s nmax=%d rov=%s base=%s\n",path,nmax,rov,base);
    
    if (ts.time==0||te.time==0||timediff(ts,te)>0.0) return 0;
    
    if (strstr(path,"%S")||strstr(path,"%M")||strstr(path,"%t")) tint=900.0;
    else if (strstr(path,"%h")||strstr(path,"%H")) tint=3600.0;
    
    tow=time2gpst(ts,&week);
    time=gpst2time(week,floor(tow/tint)*tint);
    
    while (timediff(time,te)<=0.0&&n<nmax) {
        reppath(path,rpath[n],time,rov,base);
        if (n==0||strcmp(rpath[n],rpath[n-1])) n++;
        time=timeadd(time,tint);
    }
    for (i=0;i<n;i++) trace(3,"reppaths: rpath=%s\n",rpath[i]);
    return n;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %r9, -0x70(%rbp)
movq %rcx, %r12
movl %edx, -0x34(%rbp)
testq %rcx, %rcx
sete %al
testq %r8, %r8
sete %cl
xorl %r15d, %r15d
orb %al, %cl
jne 0x54b96
movq %r8, %r14
movq %rsi, %r13
movq %rdi, %rbx
movq %r12, %rdi
movq %r8, %rsi
movsd %xmm1, -0x58(%rbp)
movsd %xmm0, -0x50(%rbp)
callq 0x8330
addsd -0x50(%rbp), %xmm0
ucomisd -0x58(%rbp), %xmm0
ja 0x54b96
leaq 0x20a13(%rip), %rsi     # 0x753ba
movq %rbx, %rdi
callq 0x8160
movsd 0x16101(%rip), %xmm0    # 0x6aab8
movsd %xmm0, -0x30(%rbp)
testq %rax, %rax
jne 0x54a22
leaq 0x209ef(%rip), %rsi     # 0x753b7
movq %rbx, %rdi
callq 0x8160
testq %rax, %rax
jne 0x54a22
leaq 0x209f2(%rip), %rsi     # 0x753ce
movq %rbx, %rdi
callq 0x8160
testq %rax, %rax
jne 0x54a22
leaq 0x209c4(%rip), %rsi     # 0x753b4
movq %rbx, %rdi
callq 0x8160
testq %rax, %rax
jne 0x54a15
leaq 0x209c7(%rip), %rsi     # 0x753cb
movq %rbx, %rdi
callq 0x8160
testq %rax, %rax
je 0x54ba8
movsd 0x15ea3(%rip), %xmm0    # 0x6a8c0
movsd %xmm0, -0x30(%rbp)
movq %rbx, -0x68(%rbp)
leaq 0x1dc93(%rip), %rdi     # 0x726c0
callq 0x4f9a4
movq %rax, -0x60(%rbp)
subq %rax, %r12
movabsq $0x377aef2669de1559, %rcx # imm = 0x377AEF2669DE1559
movq %r12, %rax
imulq %rcx
movq %rdx, %rbx
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0x11, %rbx
addq %rax, %rbx
xorps %xmm1, %xmm1
cvtsi2sd %r12, %xmm1
xorps %xmm0, %xmm0
cvtsi2sd %ebx, %xmm0
mulsd 0x1738f(%rip), %xmm0    # 0x6be00
mulsd 0x15e67(%rip), %xmm0    # 0x6a8e0
addsd %xmm1, %xmm0
addsd -0x50(%rbp), %xmm0
divsd -0x30(%rbp), %xmm0
callq 0x8ad0
mulsd -0x30(%rbp), %xmm0
movapd 0x14e97(%rip), %xmm1    # 0x69930
andpd %xmm0, %xmm1
movsd 0x2010b(%rip), %xmm2    # 0x74bb0
cmpltsd %xmm1, %xmm2
andnpd %xmm0, %xmm2
movslq %ebx, %rax
imulq $0x93a80, %rax, %r12    # imm = 0x93A80
cvttsd2si %xmm2, %eax
cltq
addq -0x60(%rbp), %r12
cvttpd2dq %xmm2, %xmm0
addq %rax, %r12
cvtdq2pd %xmm0, %xmm0
subsd %xmm0, %xmm2
movapd %xmm2, -0x50(%rbp)
movq %r12, %rdi
movq %r14, %rsi
callq 0x8330
addsd -0x50(%rbp), %xmm0
subsd -0x58(%rbp), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
setb %al
cmpl $0x0, -0x34(%rbp)
setle %cl
orb %al, %cl
jne 0x54b96
xorl %r15d, %r15d
movslq %r15d, %rbx
movq (%r13,%rbx,8), %rsi
movq -0x68(%rbp), %rdi
movq %r12, %rdx
movaps -0x50(%rbp), %xmm0
movq -0x70(%rbp), %rcx
movq 0x10(%rbp), %r8
callq 0x5422a
testl %ebx, %ebx
je 0x54b3f
movq -0x8(%r13,%rbx,8), %rsi
movq (%r13,%rbx,8), %rdi
callq 0x8890
testl %eax, %eax
je 0x54b42
incl %r15d
movapd -0x50(%rbp), %xmm0
addsd -0x30(%rbp), %xmm0
movapd %xmm0, -0x50(%rbp)
callq 0x8ad0
cvttsd2si %xmm0, %eax
cltq
addq %rax, %r12
movapd -0x50(%rbp), %xmm1
subsd %xmm0, %xmm1
movapd %xmm1, -0x50(%rbp)
movq %r12, %rdi
movq %r14, %rsi
callq 0x8330
addsd -0x50(%rbp), %xmm0
subsd -0x58(%rbp), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
jb 0x54b96
cmpl -0x34(%rbp), %r15d
jl 0x54b08
movl %r15d, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movsd 0x15d20(%rip), %xmm0    # 0x6a8d0
jmp 0x54a1d