// File: /workspace/github_cpp_makefile_star2_O1/DoubleString[P]RtConverter/src/Rtklib/rtkcmn.cpp
// Function: bamboo::read_leaps(char const*)
extern int read_leaps(const char *file)
{
    FILE *fp;
    int i,n;
    
    if (!(fp=fopen(file,"r"))) return 0;
    
    /* read leap seconds table by text or usno */
    if (!(n=read_leaps_text(fp))&&!(n=read_leaps_usno(fp))) {
        fclose(fp);
        return 0;
    }
    for (i=0;i<7;i++) leaps[n][i]=0.0;
    fclose(fp);
    return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x318, %rsp            # imm = 0x318
leaq 0x2538e(%rip), %rsi     # 0x7538c
callq 0x8780
testq %rax, %rax
je 0x50296
movq %rax, -0x40(%rbp)
movq %rax, %rdi
callq 0x80f0
leaq 0x3f041(%rip), %r12     # 0x8f060
leaq -0x340(%rbp), %r13
leaq 0x2542d(%rip), %rbx     # 0x7545a
leaq -0x180(%rbp), %r14
xorl %r15d, %r15d
movq %r13, %rdi
movl $0x100, %esi            # imm = 0x100
movq -0x40(%rbp), %rdx
callq 0x89f0
testq %rax, %rax
je 0x50100
cmpq $0x3f, %r15
ja 0x50100
movq %r13, %rdi
movl $0x23, %esi
callq 0x8250
testq %rax, %rax
je 0x50070
movb $0x0, (%rax)
subq $0x8, %rsp
movq %r13, %rdi
movq %rbx, %rsi
movq %r14, %rdx
leaq -0x17c(%rbp), %rcx
leaq -0x178(%rbp), %r8
leaq -0x174(%rbp), %r9
xorl %eax, %eax
leaq -0x80(%rbp), %r10
pushq %r10
leaq -0x16c(%rbp), %r10
pushq %r10
leaq -0x170(%rbp), %r10
pushq %r10
callq 0x8610
addq $0x20, %rsp
cmpl $0x7, %eax
jl 0x50037
xorl %eax, %eax
xorps %xmm0, %xmm0
cvtsi2sdl -0x180(%rbp,%rax,4), %xmm0
movsd %xmm0, (%r12,%rax,8)
incq %rax
cmpq $0x6, %rax
jne 0x500c0
xorps %xmm0, %xmm0
cvtsi2sdl -0x80(%rbp), %xmm0
imulq $0x38, %r15, %rax
incq %r15
leaq 0x3ef6f(%rip), %rcx     # 0x8f060
movsd %xmm0, 0x30(%rax,%rcx)
addq $0x38, %r12
jmp 0x50037
testq %r15, %r15
movq -0x40(%rbp), %r13
jne 0x502fd
leaq -0x340(%rbp), %rbx
xorl %r15d, %r15d
movl $0x1c0, %edx            # imm = 0x1C0
movq %rbx, %rdi
xorl %esi, %esi
callq 0x8390
movq %r13, %rdi
callq 0x80f0
leaq -0x180(%rbp), %rdi
movl $0x100, %esi            # imm = 0x100
movq %r13, %rdx
callq 0x89f0
testq %rax, %rax
je 0x502a8
movb $0x1, -0x29(%rbp)
leaq -0x180(%rbp), %r12
leaq -0x80(%rbp), %r14
leaq 0x2262f(%rip), %rbx     # 0x72790
movq $0x0, -0x38(%rbp)
subq $0x8, %rsp
movq %r12, %rdi
leaq 0x25328(%rip), %rsi     # 0x7549f
leaq -0x48(%rbp), %rdx
movq %r14, %rcx
leaq -0x44(%rbp), %r8
leaq -0x58(%rbp), %r9
xorl %eax, %eax
leaq -0x50(%rbp), %r10
pushq %r10
callq 0x8610
addq $0x10, %rsp
cmpl $0x5, %eax
setl %al
movl -0x48(%rbp), %r15d
cmpl $0x7bc, %r15d           # imm = 0x7BC
setl %cl
orb %al, %cl
jne 0x501e9
movl $0x1, %r12d
xorl %r13d, %r13d
movslq (%r13,%rbx), %rdi
addq %rbx, %rdi
movq %r14, %rsi
callq 0x8890
testl %eax, %eax
je 0x501df
incl %r12d
addq $0x4, %r13
cmpq $0x30, %r13
jne 0x501b8
movl $0xd, %r12d
cmpl $0xc, %r12d
movq -0x40(%rbp), %r13
jbe 0x50214
leaq -0x180(%rbp), %r12
movq %r12, %rdi
movl $0x100, %esi            # imm = 0x100
movq %r13, %rdx
callq 0x89f0
testq %rax, %rax
setne %al
testb %al, -0x29(%rbp)
jne 0x50169
jmp 0x5029d
movq -0x38(%rbp), %rcx
leaq (,%rcx,8), %rax
subq %rcx, %rax
movq %rcx, %rdx
movq %rcx, -0x38(%rbp)
movb %r15b, -0x340(%rbp,%rax)
movb %r12b, -0x33f(%rbp,%rax)
movb -0x44(%rbp), %cl
movb %cl, -0x33e(%rbp,%rax)
movsd 0x1a67c(%rip), %xmm0    # 0x6a8c8
subsd -0x50(%rbp), %xmm0
cvttsd2si %xmm0, %ecx
leaq 0x1(%rdx), %r15
movb %cl, -0x33a(%rbp,%rax)
leaq -0x180(%rbp), %r12
movq %r12, %rdi
movl $0x100, %esi            # imm = 0x100
movq %r13, %rdx
callq 0x89f0
cmpq $0x3f, -0x38(%rbp)
setb -0x29(%rbp)
testq %rax, %rax
je 0x502a1
cmpq $0x3f, -0x38(%rbp)
movq %r15, -0x38(%rbp)
jb 0x50169
jmp 0x502a1
xorl %ebx, %ebx
jmp 0x50336
movq -0x38(%rbp), %r15
leaq -0x340(%rbp), %rbx
testl %r15d, %r15d
jle 0x502f8
movl %r15d, %eax
leaq (,%rax,8), %rcx
subq %rax, %rcx
addq %rbx, %rcx
addq $-0x7, %rcx
leaq 0x3ed97(%rip), %rdx     # 0x8f060
xorl %esi, %esi
xorl %edi, %edi
movsbl (%rcx,%rdi), %r8d
xorps %xmm0, %xmm0
cvtsi2sd %r8d, %xmm0
movsd %xmm0, (%rdx,%rdi,8)
incq %rdi
cmpq $0x7, %rdi
jne 0x502cd
incq %rsi
addq $0x38, %rdx
addq $-0x7, %rcx
cmpq %rax, %rsi
jne 0x502cb
testl %r15d, %r15d
je 0x5034a
movslq %r15d, %rax
imulq $0x38, %rax, %rax
leaq 0x3ed55(%rip), %rcx     # 0x8f060
xorpd %xmm0, %xmm0
movupd %xmm0, 0x20(%rax,%rcx)
movupd %xmm0, 0x10(%rax,%rcx)
movupd %xmm0, (%rax,%rcx)
movq $0x0, 0x30(%rax,%rcx)
movl $0x1, %ebx
movq %r13, %rdi
callq 0x8630
movl %ebx, %eax
addq $0x318, %rsp            # imm = 0x318
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %ebx, %ebx
jmp 0x5032e