// File: 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
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl $0x18, -0x10(%rbp)
movq -0x8(%rbp), %rax
movl 0x6f0f8(%rax), %eax
movl %eax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
addq $0x6ef38, %rdi          # imm = 0x6EF38
addq $0x80, %rdi
callq 0x92e0
cmpq $0x1f, %rax
jae 0x8123d
movq -0x8(%rbp), %rdi
addq $0x6ef38, %rdi          # imm = 0x6EF38
addq $0x80, %rdi
callq 0x92e0
movq %rax, -0x38(%rbp)
jmp 0x81248
movl $0x1f, %eax
movq %rax, -0x38(%rbp)
jmp 0x81248
movq -0x38(%rbp), %rax
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rdi
addq $0x6ef38, %rdi          # imm = 0x6EF38
addq $0xc0, %rdi
callq 0x92e0
cmpq $0x1f, %rax
jae 0x81289
movq -0x8(%rbp), %rdi
addq $0x6ef38, %rdi          # imm = 0x6EF38
addq $0xc0, %rdi
callq 0x92e0
movq %rax, -0x40(%rbp)
jmp 0x81294
movl $0x1f, %eax
movq %rax, -0x40(%rbp)
jmp 0x81294
movq -0x40(%rbp), %rax
movl %eax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
addq $0x6ef38, %rdi          # imm = 0x6EF38
addq $0x100, %rdi            # imm = 0x100
callq 0x92e0
cmpq $0x1f, %rax
jae 0x812d5
movq -0x8(%rbp), %rdi
addq $0x6ef38, %rdi          # imm = 0x6EF38
addq $0x100, %rdi            # imm = 0x100
callq 0x92e0
movq %rax, -0x48(%rbp)
jmp 0x812e0
movl $0x1f, %eax
movq %rax, -0x48(%rbp)
jmp 0x812e0
movq -0x48(%rbp), %rax
movl %eax, -0x24(%rbp)
movq -0x8(%rbp), %rdi
addq $0x6ef38, %rdi          # imm = 0x6EF38
addq $0x140, %rdi            # imm = 0x140
callq 0x92e0
cmpq $0x1f, %rax
jae 0x81321
movq -0x8(%rbp), %rdi
addq $0x6ef38, %rdi          # imm = 0x6EF38
addq $0x140, %rdi            # imm = 0x140
callq 0x92e0
movq %rax, -0x50(%rbp)
jmp 0x8132c
movl $0x1f, %eax
movq %rax, -0x50(%rbp)
jmp 0x8132c
movq -0x50(%rbp), %rax
movl %eax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
addq $0x6ef38, %rdi          # imm = 0x6EF38
addq $0x180, %rdi            # imm = 0x180
callq 0x92e0
cmpq $0x1f, %rax
jae 0x8136d
movq -0x8(%rbp), %rdi
addq $0x6ef38, %rdi          # imm = 0x6EF38
addq $0x180, %rdi            # imm = 0x180
callq 0x92e0
movq %rax, -0x58(%rbp)
jmp 0x81378
movl $0x1f, %eax
movq %rax, -0x58(%rbp)
jmp 0x81378
movq -0x58(%rbp), %rax
movl %eax, -0x2c(%rbp)
movl -0xc(%rbp), %edx
movl $0x3, %edi
leaq 0x413be(%rip), %rsi     # 0xc274c
movb $0x0, %al
callq 0x8b980
movq -0x8(%rbp), %rdi
addq $0x9f0c4, %rdi          # imm = 0x9F0C4
movl -0x10(%rbp), %esi
movl $0xc, %edx
movl $0x409, %ecx            # imm = 0x409
callq 0x8c0d0
movl -0x10(%rbp), %eax
addl $0xc, %eax
movl %eax, -0x10(%rbp)
movq -0x8(%rbp), %rdi
addq $0x9f0c4, %rdi          # imm = 0x9F0C4
movl -0x10(%rbp), %esi
movq -0x8(%rbp), %rax
movl (%rax), %ecx
movl $0xc, %edx
callq 0x8c0d0
movl -0x10(%rbp), %eax
addl $0xc, %eax
movl %eax, -0x10(%rbp)
movq -0x8(%rbp), %rdi
addq $0x9f0c4, %rdi          # imm = 0x9F0C4
movl -0x10(%rbp), %esi
movl -0x1c(%rbp), %ecx
movl $0x8, %edx
callq 0x8c0d0
movl -0x10(%rbp), %eax
addl $0x8, %eax
movl %eax, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x81451
movq -0x8(%rbp), %rdi
addq $0x9f0c4, %rdi          # imm = 0x9F0C4
movl -0x10(%rbp), %esi
movq -0x8(%rbp), %rax
movslq -0x14(%rbp), %rcx
movsbl 0x6efb8(%rax,%rcx), %ecx
movl $0x8, %edx
callq 0x8c0d0
movl -0x10(%rbp), %eax
addl $0x8, %eax
movl %eax, -0x10(%rbp)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x8140d
movq -0x8(%rbp), %rdi
addq $0x9f0c4, %rdi          # imm = 0x9F0C4
movl -0x10(%rbp), %esi
movl -0x18(%rbp), %ecx
movl $0x8, %edx
callq 0x8c0d0
movl -0x10(%rbp), %eax
addl $0x8, %eax
movl %eax, -0x10(%rbp)
movq -0x8(%rbp), %rdi
addq $0x9f0c4, %rdi          # imm = 0x9F0C4
movl -0x10(%rbp), %esi
movl -0x20(%rbp), %ecx
movl $0x8, %edx
callq 0x8c0d0
movl -0x10(%rbp), %eax
addl $0x8, %eax
movl %eax, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x20(%rbp), %eax
jge 0x814e4
movq -0x8(%rbp), %rdi
addq $0x9f0c4, %rdi          # imm = 0x9F0C4
movl -0x10(%rbp), %esi
movq -0x8(%rbp), %rax
movslq -0x14(%rbp), %rcx
movsbl 0x6eff8(%rax,%rcx), %ecx
movl $0x8, %edx
callq 0x8c0d0
movl -0x10(%rbp), %eax
addl $0x8, %eax
movl %eax, -0x10(%rbp)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x814a0
movq -0x8(%rbp), %rdi
addq $0x9f0c4, %rdi          # imm = 0x9F0C4
movl -0x10(%rbp), %esi
movl -0x24(%rbp), %ecx
movl $0x8, %edx
callq 0x8c0d0
movl -0x10(%rbp), %eax
addl $0x8, %eax
movl %eax, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x81553
movq -0x8(%rbp), %rdi
addq $0x9f0c4, %rdi          # imm = 0x9F0C4
movl -0x10(%rbp), %esi
movq -0x8(%rbp), %rax
movslq -0x14(%rbp), %rcx
movsbl 0x6f038(%rax,%rcx), %ecx
movl $0x8, %edx
callq 0x8c0d0
movl -0x10(%rbp), %eax
addl $0x8, %eax
movl %eax, -0x10(%rbp)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x8150f
movq -0x8(%rbp), %rdi
addq $0x9f0c4, %rdi          # imm = 0x9F0C4
movl -0x10(%rbp), %esi
movl -0x28(%rbp), %ecx
movl $0x8, %edx
callq 0x8c0d0
movl -0x10(%rbp), %eax
addl $0x8, %eax
movl %eax, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x28(%rbp), %eax
jge 0x815c2
movq -0x8(%rbp), %rdi
addq $0x9f0c4, %rdi          # imm = 0x9F0C4
movl -0x10(%rbp), %esi
movq -0x8(%rbp), %rax
movslq -0x14(%rbp), %rcx
movsbl 0x6f078(%rax,%rcx), %ecx
movl $0x8, %edx
callq 0x8c0d0
movl -0x10(%rbp), %eax
addl $0x8, %eax
movl %eax, -0x10(%rbp)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x8157e
movq -0x8(%rbp), %rdi
addq $0x9f0c4, %rdi          # imm = 0x9F0C4
movl -0x10(%rbp), %esi
movl -0x2c(%rbp), %ecx
movl $0x8, %edx
callq 0x8c0d0
movl -0x10(%rbp), %eax
addl $0x8, %eax
movl %eax, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jge 0x81631
movq -0x8(%rbp), %rdi
addq $0x9f0c4, %rdi          # imm = 0x9F0C4
movl -0x10(%rbp), %esi
movq -0x8(%rbp), %rax
movslq -0x14(%rbp), %rcx
movsbl 0x6f0b8(%rax,%rcx), %ecx
movl $0x8, %edx
callq 0x8c0d0
movl -0x10(%rbp), %eax
addl $0x8, %eax
movl %eax, -0x10(%rbp)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x815ed
movl -0x10(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x9f0bc(%rax)
movl $0x1, %eax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)