// File: /workspace/github_c_makefile_star2_O0/agl[P]obstcp/libobstcp.c
// Function: client_parse_advert
static int
client_parse_advert(uint8_t *public, const char *advert, unsigned inlen) {
  uint8_t decoded[384];
  unsigned j = 0;
  char public_found = 0;
  uint32_t v;
  const unsigned len = base32_decode_length(inlen);

  if (len > 384) return 0;
  if (!base32_decode(decoded, advert, inlen)) return 0;

  for (;;) {
    if (j == len) break;
    if (!varint_get(&v, decoded, len, &j)) return 0;
    switch (v >> 1) {
    case OBSTCP_KIND_PUBLIC:
      if (!(v & 1)) return 0;
      if (!varint_get(&v, decoded, len, &j)) return 0;
      if (v != 32) return 0;
      if (j + v > len) return 0;
      memcpy(public, decoded + j, 32);
      public_found = 1;
      j += 32;
      break;
    default:
      if (v & 1) {
        if (!varint_get(&v, decoded, len, &j)) return 0;
        if (j + v > len) return 0;
        j += v;
      }
    }
  }

  return public_found;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1b0, %rsp            # imm = 0x1B0
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movl $0x0, -0x1a4(%rbp)
movb $0x0, -0x1a5(%rbp)
movl -0x1c(%rbp), %edi
callq 0x9e80
movl %eax, -0x1b0(%rbp)
cmpl $0x180, -0x1b0(%rbp)    # imm = 0x180
jbe 0x32cd
movl $0x0, -0x4(%rbp)
jmp 0x3497
leaq -0x1a0(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x1c(%rbp), %edx
callq 0x9e90
cmpl $0x0, %eax
jne 0x32f1
movl $0x0, -0x4(%rbp)
jmp 0x3497
jmp 0x32f3
movl -0x1a4(%rbp), %eax
cmpl -0x1b0(%rbp), %eax
jne 0x3306
jmp 0x348d
leaq -0x1a0(%rbp), %rsi
movl -0x1b0(%rbp), %edx
leaq -0x1ac(%rbp), %rdi
leaq -0x1a4(%rbp), %rcx
callq 0x4dd0
cmpl $0x0, %eax
jne 0x3337
movl $0x0, -0x4(%rbp)
jmp 0x3497
movl -0x1ac(%rbp), %eax
testl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
jne 0x341b
jmp 0x334a
movl -0x1ac(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x3364
movl $0x0, -0x4(%rbp)
jmp 0x3497
leaq -0x1a0(%rbp), %rsi
movl -0x1b0(%rbp), %edx
leaq -0x1ac(%rbp), %rdi
leaq -0x1a4(%rbp), %rcx
callq 0x4dd0
cmpl $0x0, %eax
jne 0x3395
movl $0x0, -0x4(%rbp)
jmp 0x3497
cmpl $0x20, -0x1ac(%rbp)
je 0x33aa
movl $0x0, -0x4(%rbp)
jmp 0x3497
movl -0x1a4(%rbp), %eax
addl -0x1ac(%rbp), %eax
cmpl -0x1b0(%rbp), %eax
jbe 0x33ca
movl $0x0, -0x4(%rbp)
jmp 0x3497
movq -0x10(%rbp), %rax
movl -0x1a4(%rbp), %ecx
movq -0x1a0(%rbp,%rcx), %rdx
movq %rdx, (%rax)
movq -0x198(%rbp,%rcx), %rdx
movq %rdx, 0x8(%rax)
movq -0x190(%rbp,%rcx), %rdx
movq %rdx, 0x10(%rax)
movq -0x188(%rbp,%rcx), %rcx
movq %rcx, 0x18(%rax)
movb $0x1, -0x1a5(%rbp)
movl -0x1a4(%rbp), %eax
addl $0x20, %eax
movl %eax, -0x1a4(%rbp)
jmp 0x3488
movl -0x1ac(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x3486
leaq -0x1a0(%rbp), %rsi
movl -0x1b0(%rbp), %edx
leaq -0x1ac(%rbp), %rdi
leaq -0x1a4(%rbp), %rcx
callq 0x4dd0
cmpl $0x0, %eax
jne 0x3457
movl $0x0, -0x4(%rbp)
jmp 0x3497
movl -0x1a4(%rbp), %eax
addl -0x1ac(%rbp), %eax
cmpl -0x1b0(%rbp), %eax
jbe 0x3474
movl $0x0, -0x4(%rbp)
jmp 0x3497
movl -0x1ac(%rbp), %eax
addl -0x1a4(%rbp), %eax
movl %eax, -0x1a4(%rbp)
jmp 0x3488
jmp 0x32f3
movsbl -0x1a5(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbp
retq
nopw %cs:(%rax,%rax)