// File: 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
subq $0x110, %rsp            # imm = 0x110
movq 0x10(%rbp), %rax
movq %rcx, -0x18(%rbp)
movsd %xmm0, -0x10(%rbp)
movq %r8, -0x28(%rbp)
movsd %xmm1, -0x20(%rbp)
movq %rdi, -0x30(%rbp)
movq %rsi, -0x38(%rbp)
movl %edx, -0x3c(%rbp)
movq %r9, -0x48(%rbp)
movsd 0x266f8(%rip), %xmm0    # 0xbce20
movsd %xmm0, -0x68(%rbp)
movl $0x0, -0x70(%rbp)
movq -0x30(%rbp), %rdx
movl -0x3c(%rbp), %ecx
movq -0x48(%rbp), %r8
movq 0x10(%rbp), %r9
movl $0x3, %edi
leaq 0x31795(%rip), %rsi     # 0xc7ee4
movb $0x0, %al
callq 0x8b980
cmpq $0x0, -0x18(%rbp)
je 0x967b6
cmpq $0x0, -0x28(%rbp)
je 0x967b6
movq -0x18(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x88(%rbp), %rdi
movsd -0x80(%rbp), %xmm0
movq -0x98(%rbp), %rsi
movsd -0x90(%rbp), %xmm1
callq 0x8e8e0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x967c2
movl $0x0, -0x4(%rbp)
jmp 0x96a5f
movq -0x30(%rbp), %rdi
leaq 0x31700(%rip), %rsi     # 0xc7ecd
callq 0x91b0
cmpq $0x0, %rax
jne 0x96804
movq -0x30(%rbp), %rdi
leaq 0x316e7(%rip), %rsi     # 0xc7eca
callq 0x91b0
cmpq $0x0, %rax
jne 0x96804
movq -0x30(%rbp), %rdi
leaq 0x316e8(%rip), %rsi     # 0xc7ee1
callq 0x91b0
cmpq $0x0, %rax
je 0x96813
movsd 0x267dc(%rip), %xmm0    # 0xbcfe8
movsd %xmm0, -0x68(%rbp)
jmp 0x9684e
movq -0x30(%rbp), %rdi
leaq 0x316a9(%rip), %rsi     # 0xc7ec7
callq 0x91b0
cmpq $0x0, %rax
jne 0x9683f
movq -0x30(%rbp), %rdi
leaq 0x316aa(%rip), %rsi     # 0xc7ede
callq 0x91b0
cmpq $0x0, %rax
je 0x9684c
movsd 0x265c9(%rip), %xmm0    # 0xbce10
movsd %xmm0, -0x68(%rbp)
jmp 0x9684e
movq -0x18(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0xa8(%rbp), %rdi
movsd -0xa0(%rbp), %xmm0
leaq -0x74(%rbp), %rsi
callq 0x8e540
movsd %xmm0, -0x60(%rbp)
movl -0x74(%rbp), %eax
movl %eax, -0x10c(%rbp)
movsd -0x60(%rbp), %xmm0
divsd -0x68(%rbp), %xmm0
callq 0x9c90
movl -0x10c(%rbp), %edi
mulsd -0x68(%rbp), %xmm0
callq 0x8e4a0
movq %rax, -0xb8(%rbp)
movsd %xmm0, -0xb0(%rbp)
movq -0xb8(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0xb0(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0xd8(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq -0xc8(%rbp), %rdi
movsd -0xc0(%rbp), %xmm0
movq -0xd8(%rbp), %rsi
movsd -0xd0(%rbp), %xmm1
callq 0x8e8e0
movaps %xmm0, %xmm1
xorl %eax, %eax
xorps %xmm0, %xmm0
ucomisd %xmm1, %xmm0
movb %al, -0x10d(%rbp)
jb 0x96940
movl -0x70(%rbp), %eax
cmpl -0x3c(%rbp), %eax
setl %al
movb %al, -0x10d(%rbp)
movb -0x10d(%rbp), %al
testb $0x1, %al
jne 0x9694f
jmp 0x96a20
movq -0x30(%rbp), %rdi
movq -0x38(%rbp), %rax
movslq -0x70(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
movq -0x58(%rbp), %rax
movq %rax, -0xe8(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0xe0(%rbp)
movq -0x48(%rbp), %rcx
movq 0x10(%rbp), %r8
movq -0xe8(%rbp), %rdx
movsd -0xe0(%rbp), %xmm0
callq 0x95e20
cmpl $0x0, -0x70(%rbp)
je 0x969be
movq -0x38(%rbp), %rax
movslq -0x70(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movq -0x38(%rbp), %rax
movl -0x70(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rsi
callq 0x9a60
cmpl $0x0, %eax
je 0x969c7
movl -0x70(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x70(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x108(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x100(%rbp)
movsd -0x68(%rbp), %xmm1
movq -0x108(%rbp), %rdi
movsd -0x100(%rbp), %xmm0
callq 0x8e860
movq %rax, -0xf8(%rbp)
movsd %xmm0, -0xf0(%rbp)
movq -0xf8(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0xf0(%rbp), %rax
movq %rax, -0x50(%rbp)
jmp 0x968ce
movl $0x0, -0x6c(%rbp)
movl -0x6c(%rbp), %eax
cmpl -0x70(%rbp), %eax
jge 0x96a59
movq -0x38(%rbp), %rax
movslq -0x6c(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
movl $0x3, %edi
leaq 0x314c8(%rip), %rsi     # 0xc7f0f
movb $0x0, %al
callq 0x8b980
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
jmp 0x96a27
movl -0x70(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
nopl (%rax,%rax)