// File: /workspace/github_cpp_makefile_star2_O3/DoubleString[P]RtConverter/src/Rtklib/rtcm3e.cpp
// Function: bamboo::encode_type1033(bamboo::rtcm_t*, int)
static int encode_type1033(rtcm_t *rtcm, int sync)
{
    int i=24,j,antsetup=rtcm->sta.antsetup;
    int n=MIN(strlen(rtcm->sta.antdes ),31);
    int m=MIN(strlen(rtcm->sta.antsno ),31);
    int I=MIN(strlen(rtcm->sta.rectype),31);
    int J=MIN(strlen(rtcm->sta.recver ),31);
    int K=MIN(strlen(rtcm->sta.recsno ),31);
    
    trace(3,"encode_type1033: sync=%d\n",sync);
    
    setbitu(rtcm->buff,i,12,1033       ); i+=12;
    setbitu(rtcm->buff,i,12,rtcm->staid); i+=12;
    
    setbitu(rtcm->buff,i,8,n); i+= 8;
    for (j=0;j<n;j++) {
        setbitu(rtcm->buff,i,8,rtcm->sta.antdes[j]); i+=8;
    }
    setbitu(rtcm->buff,i,8,antsetup); i+= 8;
    
    setbitu(rtcm->buff,i,8,m); i+= 8;
    for (j=0;j<m;j++) {
        setbitu(rtcm->buff,i,8,rtcm->sta.antsno[j]); i+=8;
    }
    setbitu(rtcm->buff,i,8,I); i+= 8;
    for (j=0;j<I;j++) {
        setbitu(rtcm->buff,i,8,rtcm->sta.rectype[j]); i+=8;
    }
    setbitu(rtcm->buff,i,8,J); i+= 8;
    for (j=0;j<J;j++) {
        setbitu(rtcm->buff,i,8,rtcm->sta.recver[j]); i+=8;
    }
    setbitu(rtcm->buff,i,8,K); i+= 8;
    for (j=0;j<K;j++) {
        setbitu(rtcm->buff,i,8,rtcm->sta.recsno[j]); i+=8;
    }
    rtcm->nbit=i;
    return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movl %esi, -0x30(%rbp)
movq %rdi, %r13
movl 0x6f0f8(%rdi), %eax
movl %eax, -0x34(%rbp)
leaq 0x6efb8(%rdi), %r14
movq %r14, %rdi
callq 0x8290
movq %rax, %r15
movl $0x1f, %r12d
cmpq %r12, %rax
movl $0x1f, %ebx
cmovbq %rax, %rbx
leaq 0x6eff8(%r13), %rdi
movq %rdi, -0x40(%rbp)
callq 0x8290
cmpq %r12, %rax
movl $0x1f, %ecx
movq %rax, -0x60(%rbp)
cmovbq %rax, %rcx
movq %rcx, -0x68(%rbp)
leaq 0x6f038(%r13), %rdi
movq %rdi, -0x48(%rbp)
callq 0x8290
cmpq %r12, %rax
movl $0x1f, %ecx
movq %rax, -0x70(%rbp)
cmovbq %rax, %rcx
movq %rcx, -0x78(%rbp)
leaq 0x6f078(%r13), %rdi
movq %rdi, -0x50(%rbp)
callq 0x8290
cmpq %r12, %rax
movl $0x1f, %ecx
movq %rax, -0x80(%rbp)
cmovbq %rax, %rcx
movq %rcx, -0x88(%rbp)
leaq 0x6f0b8(%r13), %rdi
movq %rdi, -0x58(%rbp)
callq 0x8290
cmpq $0x1f, %rax
movq %rax, -0x90(%rbp)
cmovbq %rax, %r12
movq %r12, -0x98(%rbp)
leaq 0x29cf9(%rip), %rsi     # 0x7045c
movl $0x3, %edi
movl -0x30(%rbp), %edx
xorl %eax, %eax
callq 0x4d55d
leaq 0x9f0c4(%r13), %r12
movq %r12, %rdi
movl $0x18, %esi
movl $0xc, %edx
movl $0x409, %ecx            # imm = 0x409
callq 0x4da98
movq %r13, -0x30(%rbp)
movl (%r13), %ecx
movq %r12, %rdi
movl $0x24, %esi
movl $0xc, %edx
callq 0x4da98
movq %r12, %rdi
movl $0x30, %esi
movl $0x8, %edx
movl %ebx, %ecx
callq 0x4da98
testq %r15, %r15
je 0x467ef
movl $0x38, %r15d
xorl %r13d, %r13d
movsbl (%r14,%r13), %ecx
movq %r12, %rdi
movl %r15d, %esi
movl $0x8, %edx
callq 0x4da98
addl $0x8, %r15d
incq %r13
cmpq %r13, %rbx
jne 0x467cc
jmp 0x467f5
movl $0x38, %r15d
movq %r12, %rdi
movl %r15d, %esi
movl $0x8, %edx
movl -0x34(%rbp), %ecx
callq 0x4da98
leal 0x8(%r15), %esi
movq %r12, %rdi
movl $0x8, %edx
movq -0x68(%rbp), %r13
movl %r13d, %ecx
callq 0x4da98
addl $0x10, %r15d
cmpq $0x0, -0x60(%rbp)
je 0x46852
xorl %ebx, %ebx
movq -0x40(%rbp), %r14
movsbl (%r14,%rbx), %ecx
movq %r12, %rdi
movl %r15d, %esi
movl $0x8, %edx
callq 0x4da98
addl $0x8, %r15d
incq %rbx
cmpq %rbx, %r13
jne 0x46831
movq %r12, %rdi
movl %r15d, %esi
movl $0x8, %edx
movq -0x78(%rbp), %r13
movl %r13d, %ecx
callq 0x4da98
cmpq $0x0, -0x70(%rbp)
je 0x46897
xorl %ebx, %ebx
movq -0x48(%rbp), %r14
addl $0x8, %r15d
movsbl (%r14,%rbx), %ecx
movq %r12, %rdi
movl %r15d, %esi
movl $0x8, %edx
callq 0x4da98
incq %rbx
cmpq %rbx, %r13
jne 0x46876
leal 0x8(%r15), %esi
movq %r12, %rdi
movl $0x8, %edx
movq -0x88(%rbp), %r14
movl %r14d, %ecx
callq 0x4da98
addl $0x10, %r15d
cmpq $0x0, -0x80(%rbp)
je 0x468e5
xorl %ebx, %ebx
movq -0x50(%rbp), %r13
movsbl (%r13,%rbx), %ecx
movq %r12, %rdi
movl %r15d, %esi
movl $0x8, %edx
callq 0x4da98
addl $0x8, %r15d
incq %rbx
cmpq %rbx, %r14
jne 0x468c3
movq %r12, %rdi
movl %r15d, %esi
movl $0x8, %edx
movq -0x98(%rbp), %r14
movl %r14d, %ecx
callq 0x4da98
addl $0x8, %r15d
cmpq $0x0, -0x90(%rbp)
je 0x46935
xorl %ebx, %ebx
movq -0x58(%rbp), %r13
movsbl (%r13,%rbx), %ecx
movq %r12, %rdi
movl %r15d, %esi
movl $0x8, %edx
callq 0x4da98
incq %rbx
addl $0x8, %r15d
cmpq %rbx, %r14
jne 0x46913
movq -0x30(%rbp), %rax
movl %r15d, 0x9f0bc(%rax)
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq