// File: /workspace/github_c_makefile_star2_O0/niuyuling[P]CProxy/httpdns.c
// Function: handle_httpDNS_rsp
static void handle_httpDNS_rsp(dns_t * dns, char *rsp, int rsp_len)
{
    char *ip_ptr, *p, ip[4];
    int i;

    p = strstr(rsp, "\n\r");
    if (p) {
        p += 3;
        rsp_len -= p - rsp;
        //部分代理服务器使用长连接，第二次读取数据才读到域名的IP
        if (rsp_len <= 0)
            return;
        rsp = p;
    }
    if (httpdns.encodeCode)
        dataEncode(rsp, rsp_len, httpdns.encodeCode);
    do {
        if (*rsp == '\n')
            rsp++;
        /* 匹配IP */
        while ((*rsp > 57 || *rsp < 49) && *rsp != '\0')
            rsp++;
        for (i = 0, ip_ptr = rsp, rsp = strchr(ip_ptr, '.');; ip_ptr = rsp + 1, rsp = strchr(ip_ptr, '.')) {
            if (i < 3) {
                if (rsp == NULL) {
                    httpDNS_respond_client(dns, NULL);
                    return;
                }
                //查找下一行
                if (rsp - ip_ptr > 3)
                    break;
                ip[i++] = atoi(ip_ptr);
            } else {
                ip[3] = atoi(ip_ptr);
                httpDNS_respond_client(dns, ip);
                return;
            }
        }
    } while ((rsp = strchr(rsp, '\n')) != NULL);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x38cd(%rip), %rsi      # 0xc3ab
callq 0x2570
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x8b22
movq -0x28(%rbp), %rax
addq $0x3, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rcx
movq -0x10(%rbp), %rax
subq %rax, %rcx
movslq -0x14(%rbp), %rax
subq %rcx, %rax
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jg 0x8b1a
jmp 0x8c6c
movq -0x28(%rbp), %rax
movq %rax, -0x10(%rbp)
cmpl $0x0, 0x13bff(%rip)     # 0x1c728
je 0x8b3d
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movl 0x13bf0(%rip), %edx     # 0x1c728
callq 0x3e20
jmp 0x8b3f
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0xa, %eax
jne 0x8b57
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x8b59
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x39, %eax
jg 0x8b76
movq -0x10(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x31, %ecx
movb %al, -0x31(%rbp)
jge 0x8b86
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
setne %al
movb %al, -0x31(%rbp)
movb -0x31(%rbp), %al
testb $0x1, %al
jne 0x8b8f
jmp 0x8b9d
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x8b59
movl $0x0, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
movl $0x2e, %esi
callq 0x2170
movq %rax, -0x10(%rbp)
cmpl $0x3, -0x30(%rbp)
jge 0x8c0e
cmpq $0x0, -0x10(%rbp)
jne 0x8bdd
movq -0x8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x84e0
jmp 0x8c6c
movq -0x10(%rbp), %rax
movq -0x20(%rbp), %rcx
subq %rcx, %rax
cmpq $0x3, %rax
jle 0x8bf0
jmp 0x8c4e
movq -0x20(%rbp), %rdi
callq 0x24a0
movb %al, %cl
movl -0x30(%rbp), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, -0x30(%rbp)
cltq
movb %cl, -0x2c(%rbp,%rax)
jmp 0x8c29
movq -0x20(%rbp), %rdi
callq 0x24a0
movb %al, -0x29(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x2c(%rbp), %rsi
callq 0x84e0
jmp 0x8c6c
jmp 0x8c2b
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
movl $0x2e, %esi
callq 0x2170
movq %rax, -0x10(%rbp)
jmp 0x8bbe
jmp 0x8c50
movq -0x10(%rbp), %rdi
movl $0xa, %esi
callq 0x2170
movq %rax, -0x10(%rbp)
cmpq $0x0, %rax
jne 0x8b3f
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)