// File: /workspace/github_c_makefile_star2_O0/hkshenSmart[P]ONVIF-discovery_cs/stdsoap2.c
// Function: soap_gethex
SOAP_FMAC1
unsigned char*
SOAP_FMAC2
soap_gethex(struct soap *soap, int *n)
{
#ifdef WITH_DOM
  if ((soap->mode & SOAP_XML_DOM) && soap->dom)
  { soap->dom->data = soap_string_in(soap, 0, -1, -1);
    return (unsigned char*)soap_hex2s(soap, soap->dom->data, NULL, 0, n);
  }
#endif
#ifdef WITH_FAST
  soap->labidx = 0;
  for (;;)
  { register char *s;
    register size_t i, k;
    if (soap_append_lab(soap, NULL, 0))
      return NULL;
    s = soap->labbuf + soap->labidx;
    k = soap->lablen - soap->labidx;
    soap->labidx = soap->lablen;
    for (i = 0; i < k; i++)
    { register char d1, d2;
      register soap_wchar c;
      c = soap_get(soap);
      if (soap_isxdigit(c))
      { d1 = (char)c;
        c = soap_get(soap);
        if (soap_isxdigit(c))
          d2 = (char)c;
        else
        { soap->error = SOAP_TYPE;
          return NULL;
        }
      }
      else
      { unsigned char *p;
        soap_unget(soap, c);
        if (n)
          *n = (int)(soap->lablen + i - k);
        p = (unsigned char*)soap_malloc(soap, soap->lablen + i - k);
        if (p)
          memcpy(p, soap->labbuf, soap->lablen + i - k);
        return p;
      }
      *s++ = (char)(((d1 >= 'A' ? (d1 & 0x7) + 9 : d1 - '0') << 4) + (d2 >= 'A' ? (d2 & 0x7) + 9 : d2 - '0'));
    }
  }
#else
  if (soap_new_block(soap) == NULL)
    return NULL;
  for (;;)
  { register int i;
    register char *s = (char*)soap_push_block(soap, NULL, SOAP_BLKLEN);
    if (!s)
    { soap_end_block(soap, NULL);
      return NULL;
    }
    for (i = 0; i < SOAP_BLKLEN; i++)
    { register char d1, d2;
      register soap_wchar c = soap_get(soap);
      if (soap_isxdigit(c))
      { d1 = (char)c;
        c = soap_get(soap);
        if (soap_isxdigit(c))
          d2 = (char)c;
        else
        { soap_end_block(soap, NULL);
          soap->error = SOAP_TYPE;
          return NULL;
        }
      }
      else
      { unsigned char *p;
        soap_unget(soap, c);
        if (n)
          *n = (int)soap_size_block(soap, NULL, i);
        p = (unsigned char*)soap_save_block(soap, NULL, 0);
        return p;
      }
      *s++ = ((d1 >= 'A' ? (d1 & 0x7) + 9 : d1 - '0') << 4) + (d2 >= 'A' ? (d2 & 0x7) + 9 : d2 - '0');
    }
  }
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq $0x0, 0xc190(%rax)
movq -0x10(%rbp), %rdi
xorl %eax, %eax
movl %eax, %edx
movq %rdx, %rsi
callq 0x19620
cmpl $0x0, %eax
je 0x19451
movq $0x0, -0x8(%rbp)
jmp 0x19616
movq -0x10(%rbp), %rax
movq 0xc180(%rax), %rax
movq -0x10(%rbp), %rcx
addq 0xc190(%rcx), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0xc188(%rax), %rax
movq -0x10(%rbp), %rcx
subq 0xc190(%rcx), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq 0xc188(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0xc190(%rax)
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpq -0x30(%rbp), %rax
jae 0x19611
movq -0x10(%rbp), %rdi
callq 0x18260
movl %eax, -0x38(%rbp)
movl -0x38(%rbp), %edi
callq 0x17670
cmpl $0x0, %eax
je 0x19511
movl -0x38(%rbp), %eax
movb %al, -0x31(%rbp)
movq -0x10(%rbp), %rdi
callq 0x18260
movl %eax, -0x38(%rbp)
movl -0x38(%rbp), %edi
callq 0x17670
cmpl $0x0, %eax
je 0x194f1
movl -0x38(%rbp), %eax
movb %al, -0x32(%rbp)
jmp 0x1950c
movq -0x10(%rbp), %rax
movl $0x4, 0x1f274(%rax)
movq $0x0, -0x8(%rbp)
jmp 0x19616
jmp 0x19598
movl -0x38(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0xc160(%rax)
cmpq $0x0, -0x18(%rbp)
je 0x19540
movq -0x10(%rbp), %rax
movq 0xc188(%rax), %rax
addq -0x28(%rbp), %rax
subq -0x30(%rbp), %rax
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0xc188(%rax), %rsi
addq -0x28(%rbp), %rsi
subq -0x30(%rbp), %rsi
callq 0x19790
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
je 0x1958e
movq -0x40(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0xc180(%rax), %rsi
movq -0x10(%rbp), %rax
movq 0xc188(%rax), %rdx
addq -0x28(%rbp), %rdx
subq -0x30(%rbp), %rdx
callq 0x3230
movq -0x40(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x19616
movsbl -0x31(%rbp), %eax
cmpl $0x41, %eax
jl 0x195b0
movsbl -0x31(%rbp), %eax
andl $0x7, %eax
addl $0x9, %eax
movl %eax, -0x44(%rbp)
jmp 0x195ba
movsbl -0x31(%rbp), %eax
subl $0x30, %eax
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %eax
shll $0x4, %eax
movl %eax, -0x48(%rbp)
movsbl -0x32(%rbp), %eax
cmpl $0x41, %eax
jl 0x195db
movsbl -0x32(%rbp), %eax
andl $0x7, %eax
addl $0x9, %eax
movl %eax, -0x4c(%rbp)
jmp 0x195e5
movsbl -0x32(%rbp), %eax
subl $0x30, %eax
movl %eax, -0x4c(%rbp)
movl -0x48(%rbp), %eax
movl -0x4c(%rbp), %ecx
addl %ecx, %eax
movb %al, %cl
movq -0x20(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x20(%rbp)
movb %cl, (%rax)
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x194a3
jmp 0x1942f
movq -0x8(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq