#!/usr/bin/perl -sw
use strict;

$::identfier = 'main' if (!defined($::identfier));
$::size = '' if (!defined($::size));

printf "const unsigned char %s[%s] =\n", $::identfier, $::size;
while(<>)
{
  chomp;
  my @word = split;
  my $code = $word[1];

  my $escape = '"';
  for(my $i = 0; $i < length($code); $i += 2)
  {
    $escape = $escape . '\\x' . substr($code, $i, 2);
  }
  $escape .= '"';
  s/\s+[^\s]*\s+/: /;
  printf "  %-24s /* %-30s */\n", $escape, $_;
}
print "  ;\n";
