// File: /workspace/github_cpp_makefile_star2_O3/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 0x540f3
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 0x540f3
leaq 0x21496(%rip), %rsi     # 0x7539a
movq %rbx, %rdi
callq 0x8160
movsd 0x16ba4(%rip), %xmm0    # 0x6aab8
movsd %xmm0, -0x30(%rbp)
testq %rax, %rax
jne 0x53f7f
leaq 0x21472(%rip), %rsi     # 0x75397
movq %rbx, %rdi
callq 0x8160
testq %rax, %rax
jne 0x53f7f
leaq 0x21475(%rip), %rsi     # 0x753ae
movq %rbx, %rdi
callq 0x8160
testq %rax, %rax
jne 0x53f7f
leaq 0x21447(%rip), %rsi     # 0x75394
movq %rbx, %rdi
callq 0x8160
testq %rax, %rax
jne 0x53f72
leaq 0x2144a(%rip), %rsi     # 0x753ab
movq %rbx, %rdi
callq 0x8160
testq %rax, %rax
je 0x54105
movsd 0x16946(%rip), %xmm0    # 0x6a8c0
movsd %xmm0, -0x30(%rbp)
movq %rbx, -0x68(%rbp)
leaq 0x1e716(%rip), %rdi     # 0x726a0
callq 0x4f027
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 0x17e32(%rip), %xmm0    # 0x6be00
mulsd 0x1690a(%rip), %xmm0    # 0x6a8e0
addsd %xmm1, %xmm0
addsd -0x50(%rbp), %xmm0
divsd -0x30(%rbp), %xmm0
callq 0x8ac0
mulsd -0x30(%rbp), %xmm0
movapd 0x1593a(%rip), %xmm1    # 0x69930
andpd %xmm0, %xmm1
movsd 0x20b8e(%rip), %xmm2    # 0x74b90
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 0x540f3
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 0x5379e
testl %ebx, %ebx
je 0x5409c
movq -0x8(%r13,%rbx,8), %rsi
movq (%r13,%rbx,8), %rdi
callq 0x8880
testl %eax, %eax
je 0x5409f
incl %r15d
movapd -0x50(%rbp), %xmm0
addsd -0x30(%rbp), %xmm0
movapd %xmm0, -0x50(%rbp)
callq 0x8ac0
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 0x540f3
cmpl -0x34(%rbp), %r15d
jl 0x54065
movl %r15d, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movsd 0x167c3(%rip), %xmm0    # 0x6a8d0
jmp 0x53f7a