// File: /workspace/github_c_makefile_star2_O0/jech[P]dht/dht.c
// Function: send_announce_peer
int
send_announce_peer(const struct sockaddr *sa, int salen,
                   unsigned char *tid, int tid_len,
                   unsigned char *infohash, unsigned short port,
                   unsigned char *token, int token_len, int confirm)
{
    char buf[512];
    int i = 0, rc;

    rc = snprintf(buf + i, 512 - i, "d1:ad2:id20:"); INC(i, rc, 512);
    COPY(buf, i, myid, 20, 512);
    rc = snprintf(buf + i, 512 - i, "9:info_hash20:"); INC(i, rc, 512);
    COPY(buf, i, infohash, 20, 512);
    rc = snprintf(buf + i, 512 - i, "4:porti%ue5:token%d:", (unsigned)port,
                  token_len);
    INC(i, rc, 512);
    COPY(buf, i, token, token_len, 512);
    rc = snprintf(buf + i, 512 - i, "e1:q13:announce_peer1:t%d:", tid_len);
    INC(i, rc, 512);
    COPY(buf, i, tid, tid_len, 512);
    ADD_V(buf, i, 512);
    rc = snprintf(buf + i, 512 - i, "1:y1:qe"); INC(i, rc, 512);

    return dht_send(buf, i, confirm ? 0 : MSG_CONFIRM, sa, salen);

 fail:
    errno = ENOSPC;
    return -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x250, %rsp            # imm = 0x250
movw %r9w, %ax
movl 0x20(%rbp), %r9d
movl 0x18(%rbp), %r9d
movq 0x10(%rbp), %r9
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movq %r8, -0x30(%rbp)
movw %ax, -0x32(%rbp)
movl $0x0, -0x244(%rbp)
leaq -0x240(%rbp), %rdi
movslq -0x244(%rbp), %rax
addq %rax, %rdi
movl $0x200, %eax            # imm = 0x200
subl -0x244(%rbp), %eax
movslq %eax, %rsi
leaq 0x29bd(%rip), %rdx      # 0xc68e
movb $0x0, %al
callq 0x2120
movl %eax, -0x248(%rbp)
cmpl $0x0, -0x248(%rbp)
jl 0x9cfa
movl -0x244(%rbp), %eax
addl -0x248(%rbp), %eax
cmpl $0x200, %eax            # imm = 0x200
jle 0x9cff
jmp 0xa06c
movl -0x248(%rbp), %eax
addl -0x244(%rbp), %eax
movl %eax, -0x244(%rbp)
movl -0x244(%rbp), %eax
addl $0x14, %eax
cmpl $0x200, %eax            # imm = 0x200
jle 0x9d26
jmp 0xa06c
movslq -0x244(%rbp), %rax
movq 0x6efc(%rip), %rcx      # 0x10c30
movq %rcx, -0x240(%rbp,%rax)
movq 0x6ef5(%rip), %rcx      # 0x10c38
movq %rcx, -0x238(%rbp,%rax)
movl 0x6eef(%rip), %ecx      # 0x10c40
movl %ecx, -0x230(%rbp,%rax)
movl -0x244(%rbp), %eax
addl $0x14, %eax
movl %eax, -0x244(%rbp)
leaq -0x240(%rbp), %rdi
movslq -0x244(%rbp), %rax
addq %rax, %rdi
movl $0x200, %eax            # imm = 0x200
subl -0x244(%rbp), %eax
movslq %eax, %rsi
leaq 0x290e(%rip), %rdx      # 0xc69b
movb $0x0, %al
callq 0x2120
movl %eax, -0x248(%rbp)
cmpl $0x0, -0x248(%rbp)
jl 0x9db6
movl -0x244(%rbp), %eax
addl -0x248(%rbp), %eax
cmpl $0x200, %eax            # imm = 0x200
jle 0x9dbb
jmp 0xa06c
movl -0x248(%rbp), %eax
addl -0x244(%rbp), %eax
movl %eax, -0x244(%rbp)
movl -0x244(%rbp), %eax
addl $0x14, %eax
cmpl $0x200, %eax            # imm = 0x200
jle 0x9de2
jmp 0xa06c
movslq -0x244(%rbp), %rax
movq -0x30(%rbp), %rcx
movq (%rcx), %rdx
movq %rdx, -0x240(%rbp,%rax)
movq 0x8(%rcx), %rdx
movq %rdx, -0x238(%rbp,%rax)
movl 0x10(%rcx), %ecx
movl %ecx, -0x230(%rbp,%rax)
movl -0x244(%rbp), %eax
addl $0x14, %eax
movl %eax, -0x244(%rbp)
leaq -0x240(%rbp), %rdi
movslq -0x244(%rbp), %rax
addq %rax, %rdi
movl $0x200, %eax            # imm = 0x200
subl -0x244(%rbp), %eax
movslq %eax, %rsi
movzwl -0x32(%rbp), %ecx
movl 0x18(%rbp), %r8d
leaq 0x285f(%rip), %rdx      # 0xc6aa
movb $0x0, %al
callq 0x2120
movl %eax, -0x248(%rbp)
cmpl $0x0, -0x248(%rbp)
jl 0x9e74
movl -0x244(%rbp), %eax
addl -0x248(%rbp), %eax
cmpl $0x200, %eax            # imm = 0x200
jle 0x9e79
jmp 0xa06c
movl -0x248(%rbp), %eax
addl -0x244(%rbp), %eax
movl %eax, -0x244(%rbp)
cmpl $0x0, 0x18(%rbp)
jl 0x9ea1
movl -0x244(%rbp), %eax
addl 0x18(%rbp), %eax
cmpl $0x200, %eax            # imm = 0x200
jle 0x9ea6
jmp 0xa06c
leaq -0x240(%rbp), %rdi
movslq -0x244(%rbp), %rax
addq %rax, %rdi
movq 0x10(%rbp), %rsi
movslq 0x18(%rbp), %rdx
callq 0x2200
movl 0x18(%rbp), %eax
addl -0x244(%rbp), %eax
movl %eax, -0x244(%rbp)
leaq -0x240(%rbp), %rdi
movslq -0x244(%rbp), %rax
addq %rax, %rdi
movl $0x200, %eax            # imm = 0x200
subl -0x244(%rbp), %eax
movslq %eax, %rsi
movl -0x24(%rbp), %ecx
leaq 0x27c3(%rip), %rdx      # 0xc6bf
movb $0x0, %al
callq 0x2120
movl %eax, -0x248(%rbp)
cmpl $0x0, -0x248(%rbp)
jl 0x9f25
movl -0x244(%rbp), %eax
addl -0x248(%rbp), %eax
cmpl $0x200, %eax            # imm = 0x200
jle 0x9f2a
jmp 0xa06c
movl -0x248(%rbp), %eax
addl -0x244(%rbp), %eax
movl %eax, -0x244(%rbp)
cmpl $0x0, -0x24(%rbp)
jl 0x9f52
movl -0x244(%rbp), %eax
addl -0x24(%rbp), %eax
cmpl $0x200, %eax            # imm = 0x200
jle 0x9f57
jmp 0xa06c
leaq -0x240(%rbp), %rdi
movslq -0x244(%rbp), %rax
addq %rax, %rdi
movq -0x20(%rbp), %rsi
movslq -0x24(%rbp), %rdx
callq 0x2200
movl -0x24(%rbp), %eax
addl -0x244(%rbp), %eax
movl %eax, -0x244(%rbp)
cmpl $0x0, 0x6cf1(%rip)      # 0x10c7c
je 0x9fd9
movslq -0x244(%rbp), %rax
addq $0x9, %rax
cmpq $0x200, %rax            # imm = 0x200
jbe 0x9fa5
jmp 0xa06c
movslq -0x244(%rbp), %rax
movq 0x6cbd(%rip), %rcx      # 0x10c70
movq %rcx, -0x240(%rbp,%rax)
movb 0x6cb7(%rip), %cl       # 0x10c78
movb %cl, -0x238(%rbp,%rax)
movslq -0x244(%rbp), %rax
addq $0x9, %rax
movl %eax, -0x244(%rbp)
leaq -0x240(%rbp), %rdi
movslq -0x244(%rbp), %rax
addq %rax, %rdi
movl $0x200, %eax            # imm = 0x200
subl -0x244(%rbp), %eax
movslq %eax, %rsi
leaq 0x26db(%rip), %rdx      # 0xc6da
movb $0x0, %al
callq 0x2120
movl %eax, -0x248(%rbp)
cmpl $0x0, -0x248(%rbp)
jl 0xa028
movl -0x244(%rbp), %eax
addl -0x248(%rbp), %eax
cmpl $0x200, %eax            # imm = 0x200
jle 0xa02a
jmp 0xa06c
movl -0x248(%rbp), %eax
addl -0x244(%rbp), %eax
movl %eax, -0x244(%rbp)
leaq -0x240(%rbp), %rdi
movslq -0x244(%rbp), %rsi
movl 0x20(%rbp), %ecx
movl $0x800, %edx            # imm = 0x800
xorl %eax, %eax
cmpl $0x0, %ecx
cmovnel %eax, %edx
movq -0x10(%rbp), %rcx
movl -0x14(%rbp), %r8d
callq 0xa110
movl %eax, -0x4(%rbp)
jmp 0xa07e
callq 0x2060
movl $0x1c, (%rax)
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x250, %rsp            # imm = 0x250
popq %rbp
retq
nopw (%rax,%rax)