Extracting and comparing values

I was trying to extract value of g1 and p1 only inside the tags where t1 is "Reading C (bytes)" and comparing them to make sure p1 is always less than g1. Here is the Json file I'm using -

File:-

{
  "g1" : 1482568,
  "n1" : "v_4",
  "p1" : 0,
  "s1" : "RC",
  "t1" : "LM",
}
{
  "g1" : 1482568,
  "n1" : "v_4",
  "p1" : 1482568,
  "s1" : "RC",
  "t1" : "LM",
}
{
  "g1" : 1482568,
  "n1" : "v_4",
  "p1" : 0,
  "s1" : "RC",
  "t1" : "Reading C (bytes)",
}
{
  "g1" : 1482568,
  "n1" : "v_4",
  "p1" : 1282568,
  "s1" : "RC",
  "t1" : "Reading C (bytes)",
}
{
  "g1" : 1482568,
  "n1" : "v_4",
  "p1" : 1482568,
  "s1" : "RC",
  "t1" : "Reading C (bytes)",
}
{
  "g1" : 543278,
  "n1" : "v_4",
  "p1" : 0,
  "s1" : "RC",
  "t1" : "LV",
}
{
  "g1" : 1482568,
  "n1" : "v_4",
  "p1" : 0,
  "s1" : "RC",
  "t1" : "LM",
}

I was trying using simple shell scripting to extract the line number of starting and ending t1 and computing the difference. Could you please assist awk to simply extracting the values and comparing g1 and p1 regardless of b number of tags using t1 = Reading C (bytes)

Thanks

Is t1 always going to be after p1 & g1? If so, you could do something like:

$ awk '$1~/"g1"/ {g=$3} $1~/"p1"/ {p=$3} /"t1" : "Reading C \(bytes\)",/ {printf "%s %s %s\n", g, p, (p < g ? "OK" : "Bad")}' x.json
1482568, 0, OK
1482568, 1282568, OK
1482568, 1482568, Bad

Thanks, but it showing bad if we have p1=212856 and g1=1482568

Try (p+0 < g+0 ? ...