```ts
export function scanPairs(input: string): string[][] {
  if (typeof input !== 'string' || input === '') {
    throw new Error('Input must be a non-empty string');
  }

  const result: string[][] = [];
  let currentPair: [string, string] | null = null;
  let inQuotes = false;

  for (let i = 0; i < input.length; i++) {
    const char = input[i];

    if (char === '"') {
      if (!inQuotes) {
        inQuotes = true;
      } else {
        inQuotes = false;
      }
    }

    if (char === ';' && !inQuotes) {
      if (currentPair !== null) {
        result.push(currentPair);
        currentPair = null;
      }
      continue;
    }

    if (currentPair === null) {
      currentPair = [char, ''];
    } else {
      currentPair[1] += char;
    }
  }

  if (currentPair !== null) {
    result.push(currentPair);
  }

  return result;
}

export function parseOption(segment: string): string[] {
  const [key, value] = segment.split('=');

  if (!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(key)) {
    throw new Error('Key must be a bare identifier');
  }

  let parsedValue = value;
  if (parsedValue.startsWith('"') && parsedValue.endsWith('"')) {
    parsedValue = parsedValue.slice(1, -1);
  }

  return [key, parsedValue];
}
```