// File: /workspace/github_c_makefile_star2_O0/bhk[P]tooltree/monoglot/xpio_c_q.c
// Function: main
int main(int argc, char **argv)
{
   // test scanNum
   {
      const char *psz;
      unsigned n;

      psz = scanNum("123.", &n);
      eq_i(123, n);
      eq_i('.', *psz);

      psz = scanNum("123 ", &n);
      eq_i(123, n);
      eq_i(' ', *psz);

      psz = scanNum("2147483647", &n);
      eq_i(2147483647, n);
      eq_i('\0', *psz);
   }

   // test addrFromString
   {
      // Perversely, sockaddr_in keeps exposes integer values (sin_addr and
      // sin_port) as if they can be treated as numeric values, but stores
      // them in network byte order.
      struct sockaddr_in sin;
      struct sockaddr *psa = (struct sockaddr *) &sin;
      unsigned char *pby = (unsigned char *)&psa->sa_data;
      int e;

      e = addrFromString(&sin, "123.4.5.255:258");
      eq_i(0, e);
      eq_i(AF_INET, psa->sa_family);
      eq_i(1,   pby[0]);      // sin_port
      eq_i(2,   pby[1]);
      eq_i(123, pby[2]);      // sin_addr
      eq_i(4,   pby[3]);
      eq_i(5,   pby[4]);
      eq_i(255, pby[5]);

      e = addrFromString(&sin, ":123");
      eq_i(0, e);
      eq_i(AF_INET, psa->sa_family);
      eq_i(123, htons(sin.sin_port));
      eq_i(0, sin.sin_addr.s_addr);

      e = addrFromString(&sin, "1.2.3.4");
      eq_i(0, e);
      eq_i(AF_INET, psa->sa_family);
      eq_i(0, htons(sin.sin_port));
      eq_i(0x01020304, htonl(sin.sin_addr.s_addr));
   }

   return 0;
}

// Assembly:
subq $0xf8, %rsp
movl $0x0, 0xf4(%rsp)
movl %edi, 0xf0(%rsp)
movq %rsi, 0xe8(%rsp)
leaq 0x2469a(%rip), %rdi     # 0x28052
leaq 0xdc(%rsp), %rsi
callq 0x41f0
movq %rax, 0xe0(%rsp)
movl $0x7b, 0xd8(%rsp)
movl 0xdc(%rsp), %eax
movl %eax, 0xd4(%rsp)
movl 0xd8(%rsp), %eax
cmpl 0xd4(%rsp), %eax
je 0x3a29
movl 0xd8(%rsp), %ecx
movl 0xd4(%rsp), %r8d
leaq 0x2464b(%rip), %rdi     # 0x28057
leaq 0x2466a(%rip), %rsi     # 0x2807d
movl $0x24, %edx
movb $0x0, %al
callq 0x3180
movl $0x1, %edi
callq 0x33e0
jmp 0x3a2b
jmp 0x3a2d
movl $0x2e, 0xd0(%rsp)
movq 0xe0(%rsp), %rax
movsbl (%rax), %eax
movl %eax, 0xcc(%rsp)
movl 0xd0(%rsp), %eax
cmpl 0xcc(%rsp), %eax
je 0x3a8d
movl 0xd0(%rsp), %ecx
movl 0xcc(%rsp), %r8d
leaq 0x245e7(%rip), %rdi     # 0x28057
leaq 0x24606(%rip), %rsi     # 0x2807d
movl $0x25, %edx
movb $0x0, %al
callq 0x3180
movl $0x1, %edi
callq 0x33e0
jmp 0x3a8f
leaq 0x245f2(%rip), %rdi     # 0x28088
leaq 0xdc(%rsp), %rsi
callq 0x41f0
movq %rax, 0xe0(%rsp)
movl $0x7b, 0xc8(%rsp)
movl 0xdc(%rsp), %eax
movl %eax, 0xc4(%rsp)
movl 0xc8(%rsp), %eax
cmpl 0xc4(%rsp), %eax
je 0x3b07
movl 0xc8(%rsp), %ecx
movl 0xc4(%rsp), %r8d
leaq 0x2456d(%rip), %rdi     # 0x28057
leaq 0x2458c(%rip), %rsi     # 0x2807d
movl $0x28, %edx
movb $0x0, %al
callq 0x3180
movl $0x1, %edi
callq 0x33e0
jmp 0x3b09
jmp 0x3b0b
movl $0x20, 0xc0(%rsp)
movq 0xe0(%rsp), %rax
movsbl (%rax), %eax
movl %eax, 0xbc(%rsp)
movl 0xc0(%rsp), %eax
cmpl 0xbc(%rsp), %eax
je 0x3b6b
movl 0xc0(%rsp), %ecx
movl 0xbc(%rsp), %r8d
leaq 0x24509(%rip), %rdi     # 0x28057
leaq 0x24528(%rip), %rsi     # 0x2807d
movl $0x29, %edx
movb $0x0, %al
callq 0x3180
movl $0x1, %edi
callq 0x33e0
jmp 0x3b6d
leaq 0x24519(%rip), %rdi     # 0x2808d
leaq 0xdc(%rsp), %rsi
callq 0x41f0
movq %rax, 0xe0(%rsp)
movl $0x7fffffff, 0xb8(%rsp) # imm = 0x7FFFFFFF
movl 0xdc(%rsp), %eax
movl %eax, 0xb4(%rsp)
movl 0xb8(%rsp), %eax
cmpl 0xb4(%rsp), %eax
je 0x3be5
movl 0xb8(%rsp), %ecx
movl 0xb4(%rsp), %r8d
leaq 0x2448f(%rip), %rdi     # 0x28057
leaq 0x244ae(%rip), %rsi     # 0x2807d
movl $0x2c, %edx
movb $0x0, %al
callq 0x3180
movl $0x1, %edi
callq 0x33e0
jmp 0x3be7
jmp 0x3be9
movl $0x0, 0xb0(%rsp)
movq 0xe0(%rsp), %rax
movsbl (%rax), %eax
movl %eax, 0xac(%rsp)
movl 0xb0(%rsp), %eax
cmpl 0xac(%rsp), %eax
je 0x3c49
movl 0xb0(%rsp), %ecx
movl 0xac(%rsp), %r8d
leaq 0x2442b(%rip), %rdi     # 0x28057
leaq 0x2444a(%rip), %rsi     # 0x2807d
movl $0x2d, %edx
movb $0x0, %al
callq 0x3180
movl $0x1, %edi
callq 0x33e0
jmp 0x3c4b
leaq 0x9c(%rsp), %rax
movq %rax, 0x90(%rsp)
movq 0x90(%rsp), %rax
addq $0x2, %rax
movq %rax, 0x88(%rsp)
leaq 0x9c(%rsp), %rdi
leaq 0x2441a(%rip), %rsi     # 0x28098
callq 0x4260
movl %eax, 0x84(%rsp)
movl $0x0, 0x80(%rsp)
movl 0x84(%rsp), %eax
movl %eax, 0x7c(%rsp)
movl 0x80(%rsp), %eax
cmpl 0x7c(%rsp), %eax
je 0x3cdd
movl 0x80(%rsp), %ecx
movl 0x7c(%rsp), %r8d
leaq 0x24397(%rip), %rdi     # 0x28057
leaq 0x243b6(%rip), %rsi     # 0x2807d
movl $0x3b, %edx
movb $0x0, %al
callq 0x3180
movl $0x1, %edi
callq 0x33e0
jmp 0x3cdf
jmp 0x3ce1
movl $0x2, 0x78(%rsp)
movq 0x90(%rsp), %rax
movzwl (%rax), %eax
movl %eax, 0x74(%rsp)
movl 0x78(%rsp), %eax
cmpl 0x74(%rsp), %eax
je 0x3d2f
movl 0x78(%rsp), %ecx
movl 0x74(%rsp), %r8d
leaq 0x24345(%rip), %rdi     # 0x28057
leaq 0x24364(%rip), %rsi     # 0x2807d
movl $0x3c, %edx
movb $0x0, %al
callq 0x3180
movl $0x1, %edi
callq 0x33e0
jmp 0x3d31
jmp 0x3d33
movl $0x1, 0x70(%rsp)
movq 0x88(%rsp), %rax
movzbl (%rax), %eax
movl %eax, 0x6c(%rsp)
movl 0x70(%rsp), %eax
cmpl 0x6c(%rsp), %eax
je 0x3d81
movl 0x70(%rsp), %ecx
movl 0x6c(%rsp), %r8d
leaq 0x242f3(%rip), %rdi     # 0x28057
leaq 0x24312(%rip), %rsi     # 0x2807d
movl $0x3d, %edx
movb $0x0, %al
callq 0x3180
movl $0x1, %edi
callq 0x33e0
jmp 0x3d83
jmp 0x3d85
movl $0x2, 0x68(%rsp)
movq 0x88(%rsp), %rax
movzbl 0x1(%rax), %eax
movl %eax, 0x64(%rsp)
movl 0x68(%rsp), %eax
cmpl 0x64(%rsp), %eax
je 0x3dd4
movl 0x68(%rsp), %ecx
movl 0x64(%rsp), %r8d
leaq 0x242a0(%rip), %rdi     # 0x28057
leaq 0x242bf(%rip), %rsi     # 0x2807d
movl $0x3e, %edx
movb $0x0, %al
callq 0x3180
movl $0x1, %edi
callq 0x33e0
jmp 0x3dd6
jmp 0x3dd8
movl $0x7b, 0x60(%rsp)
movq 0x88(%rsp), %rax
movzbl 0x2(%rax), %eax
movl %eax, 0x5c(%rsp)
movl 0x60(%rsp), %eax
cmpl 0x5c(%rsp), %eax
je 0x3e27
movl 0x60(%rsp), %ecx
movl 0x5c(%rsp), %r8d
leaq 0x2424d(%rip), %rdi     # 0x28057
leaq 0x2426c(%rip), %rsi     # 0x2807d
movl $0x3f, %edx
movb $0x0, %al
callq 0x3180
movl $0x1, %edi
callq 0x33e0
jmp 0x3e29
jmp 0x3e2b
movl $0x4, 0x58(%rsp)
movq 0x88(%rsp), %rax
movzbl 0x3(%rax), %eax
movl %eax, 0x54(%rsp)
movl 0x58(%rsp), %eax
cmpl 0x54(%rsp), %eax
je 0x3e7a
movl 0x58(%rsp), %ecx
movl 0x54(%rsp), %r8d
leaq 0x241fa(%rip), %rdi     # 0x28057
leaq 0x24219(%rip), %rsi     # 0x2807d
movl $0x40, %edx
movb $0x0, %al
callq 0x3180
movl $0x1, %edi
callq 0x33e0
jmp 0x3e7c
jmp 0x3e7e
movl $0x5, 0x50(%rsp)
movq 0x88(%rsp), %rax
movzbl 0x4(%rax), %eax
movl %eax, 0x4c(%rsp)
movl 0x50(%rsp), %eax
cmpl 0x4c(%rsp), %eax
je 0x3ecd
movl 0x50(%rsp), %ecx
movl 0x4c(%rsp), %r8d
leaq 0x241a7(%rip), %rdi     # 0x28057
leaq 0x241c6(%rip), %rsi     # 0x2807d
movl $0x41, %edx
movb $0x0, %al
callq 0x3180
movl $0x1, %edi
callq 0x33e0
jmp 0x3ecf
jmp 0x3ed1
movl $0xff, 0x48(%rsp)
movq 0x88(%rsp), %rax
movzbl 0x5(%rax), %eax
movl %eax, 0x44(%rsp)
movl 0x48(%rsp), %eax
cmpl 0x44(%rsp), %eax
je 0x3f20
movl 0x48(%rsp), %ecx
movl 0x44(%rsp), %r8d
leaq 0x24154(%rip), %rdi     # 0x28057
leaq 0x24173(%rip), %rsi     # 0x2807d
movl $0x42, %edx
movb $0x0, %al
callq 0x3180
movl $0x1, %edi
callq 0x33e0
jmp 0x3f22
leaq 0x9c(%rsp), %rdi
leaq 0x24177(%rip), %rsi     # 0x280a8
callq 0x4260
movl %eax, 0x84(%rsp)
movl $0x0, 0x40(%rsp)
movl 0x84(%rsp), %eax
movl %eax, 0x3c(%rsp)
movl 0x40(%rsp), %eax
cmpl 0x3c(%rsp), %eax
je 0x3f87
movl 0x40(%rsp), %ecx
movl 0x3c(%rsp), %r8d
leaq 0x240ed(%rip), %rdi     # 0x28057
leaq 0x2410c(%rip), %rsi     # 0x2807d
movl $0x45, %edx
movb $0x0, %al
callq 0x3180
movl $0x1, %edi
callq 0x33e0
jmp 0x3f89
jmp 0x3f8b
movl $0x2, 0x38(%rsp)
movq 0x90(%rsp), %rax
movzwl (%rax), %eax
movl %eax, 0x34(%rsp)
movl 0x38(%rsp), %eax
cmpl 0x34(%rsp), %eax
je 0x3fd9
movl 0x38(%rsp), %ecx
movl 0x34(%rsp), %r8d
leaq 0x2409b(%rip), %rdi     # 0x28057
leaq 0x240ba(%rip), %rsi     # 0x2807d
movl $0x46, %edx
movb $0x0, %al
callq 0x3180
movl $0x1, %edi
callq 0x33e0
jmp 0x3fdb
jmp 0x3fdd
movl $0x7b, 0x30(%rsp)
movzwl 0x9e(%rsp), %edi
callq 0x3150
movzwl %ax, %eax
movl %eax, 0x2c(%rsp)
movl 0x30(%rsp), %eax
cmpl 0x2c(%rsp), %eax
je 0x4030
movl 0x30(%rsp), %ecx
movl 0x2c(%rsp), %r8d
leaq 0x24044(%rip), %rdi     # 0x28057
leaq 0x24063(%rip), %rsi     # 0x2807d
movl $0x47, %edx
movb $0x0, %al
callq 0x3180
movl $0x1, %edi
callq 0x33e0
jmp 0x4032
jmp 0x4034
movl $0x0, 0x28(%rsp)
movl 0xa0(%rsp), %eax
movl %eax, 0x24(%rsp)
movl 0x28(%rsp), %eax
cmpl 0x24(%rsp), %eax
je 0x407e
movl 0x28(%rsp), %ecx
movl 0x24(%rsp), %r8d
leaq 0x23ff6(%rip), %rdi     # 0x28057
leaq 0x24015(%rip), %rsi     # 0x2807d
movl $0x48, %edx
movb $0x0, %al
callq 0x3180
movl $0x1, %edi
callq 0x33e0
jmp 0x4080
leaq 0x9c(%rsp), %rdi
leaq 0x2401e(%rip), %rsi     # 0x280ad
callq 0x4260
movl %eax, 0x84(%rsp)
movl $0x0, 0x20(%rsp)
movl 0x84(%rsp), %eax
movl %eax, 0x1c(%rsp)
movl 0x20(%rsp), %eax
cmpl 0x1c(%rsp), %eax
je 0x40e5
movl 0x20(%rsp), %ecx
movl 0x1c(%rsp), %r8d
leaq 0x23f8f(%rip), %rdi     # 0x28057
leaq 0x23fae(%rip), %rsi     # 0x2807d
movl $0x4b, %edx
movb $0x0, %al
callq 0x3180
movl $0x1, %edi
callq 0x33e0
jmp 0x40e7
jmp 0x40e9
movl $0x2, 0x18(%rsp)
movq 0x90(%rsp), %rax
movzwl (%rax), %eax
movl %eax, 0x14(%rsp)
movl 0x18(%rsp), %eax
cmpl 0x14(%rsp), %eax
je 0x4137
movl 0x18(%rsp), %ecx
movl 0x14(%rsp), %r8d
leaq 0x23f3d(%rip), %rdi     # 0x28057
leaq 0x23f5c(%rip), %rsi     # 0x2807d
movl $0x4c, %edx
movb $0x0, %al
callq 0x3180
movl $0x1, %edi
callq 0x33e0
jmp 0x4139
jmp 0x413b
movl $0x0, 0x10(%rsp)
movzwl 0x9e(%rsp), %edi
callq 0x3150
movzwl %ax, %eax
movl %eax, 0xc(%rsp)
movl 0x10(%rsp), %eax
cmpl 0xc(%rsp), %eax
je 0x418e
movl 0x10(%rsp), %ecx
movl 0xc(%rsp), %r8d
leaq 0x23ee6(%rip), %rdi     # 0x28057
leaq 0x23f05(%rip), %rsi     # 0x2807d
movl $0x4d, %edx
movb $0x0, %al
callq 0x3180
movl $0x1, %edi
callq 0x33e0
jmp 0x4190
jmp 0x4192
movl $0x1020304, 0x8(%rsp)   # imm = 0x1020304
movl 0xa0(%rsp), %edi
callq 0x31b0
movl %eax, 0x4(%rsp)
movl 0x8(%rsp), %eax
cmpl 0x4(%rsp), %eax
je 0x41e1
movl 0x8(%rsp), %ecx
movl 0x4(%rsp), %r8d
leaq 0x23e93(%rip), %rdi     # 0x28057
leaq 0x23eb2(%rip), %rsi     # 0x2807d
movl $0x4e, %edx
movb $0x0, %al
callq 0x3180
movl $0x1, %edi
callq 0x33e0
jmp 0x41e3
xorl %eax, %eax
addq $0xf8, %rsp
retq
nopl (%rax)