// File: /workspace/github_c_makefile_star2_O0/canboat[P]canboat/nmea0183/../common/common.c
// Function: getJSONLookupList
static bool getJSONLookupList(const char *message, const char *fieldName, char *value, size_t len)
{
  const char *loc      = message + 1;
  size_t      fieldLen = strlen(fieldName);
  const char *end;

  for (;;)
  {
    loc = strstr(loc, fieldName);
    if (!loc)
    {
      return false;
    }
    if (loc[-1] == '"' && loc[fieldLen] == '"' && loc[fieldLen + 1] == ':')
    {
      break;
    }
    loc += fieldLen;
  }

  /* field has been found */
  loc += fieldLen + 2;

  while (isspace((unsigned char) *loc))
  {
    loc++;
  }

  if (strncmp(loc, "null", 4) == 0)
  {
    return false;
  }

  end = strchr(loc, '}');

  if (*loc != '{' || end == NULL)
  {
    logError("Cannot extract lookup for field '%s': it is not a -nv style lookup\n%s\n", fieldName, loc);
    return false;
  }
  end++;
  len--;
  if (end - loc < len)
  {
    len = end - loc;
  }
  memcpy(value, loc, len);
  value[len] = '\0';

  return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rdi
callq 0x20a0
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x2280
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x3b02
movb $0x0, -0x1(%rbp)
jmp 0x3c3d
movq -0x30(%rbp), %rax
movsbl -0x1(%rax), %eax
cmpl $0x22, %eax
jne 0x3b34
movq -0x30(%rbp), %rax
movq -0x38(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x22, %eax
jne 0x3b34
movq -0x30(%rbp), %rax
movq -0x38(%rbp), %rcx
movsbl 0x1(%rax,%rcx), %eax
cmpl $0x3a, %eax
jne 0x3b34
jmp 0x3b42
movq -0x38(%rbp), %rax
addq -0x30(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0x3ae1
movq -0x38(%rbp), %rax
addq $0x2, %rax
addq -0x30(%rbp), %rax
movq %rax, -0x30(%rbp)
callq 0x2290
movq (%rax), %rax
movq -0x30(%rbp), %rcx
movzbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
je 0x3b80
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x3b52
movq -0x30(%rbp), %rdi
leaq 0x1941(%rip), %rsi      # 0x54cc
movl $0x4, %edx
callq 0x2070
cmpl $0x0, %eax
jne 0x3ba3
movb $0x0, -0x1(%rbp)
jmp 0x3c3d
movq -0x30(%rbp), %rdi
movl $0x7d, %esi
callq 0x20c0
movq %rax, -0x40(%rbp)
movq -0x30(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x7b, %eax
jne 0x3bc8
cmpq $0x0, -0x40(%rbp)
jne 0x3be4
movq -0x18(%rbp), %rsi
movq -0x30(%rbp), %rdx
leaq 0x1a97(%rip), %rdi      # 0x566e
movb $0x0, %al
callq 0x2ac0
movb $0x0, -0x1(%rbp)
jmp 0x3c3d
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
movq -0x28(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x28(%rbp)
movq -0x40(%rbp), %rax
movq -0x30(%rbp), %rcx
subq %rcx, %rax
cmpq -0x28(%rbp), %rax
jae 0x3c1c
movq -0x40(%rbp), %rax
movq -0x30(%rbp), %rcx
subq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x2180
movq -0x20(%rbp), %rax
movq -0x28(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)