Relative clause with both direct object and head noun as object


From
[here](https://www3.nhk.or.jp/news/easy/k10011570531000/k10011570531000.html):

> 国土交通省によると、３つの会社は走るのに必要なガソリンの量や外に出るガスの量を調べる **検査を国が決めたルール**
> と違うやり方で行っていました。そして、ルールどおりに検査したと記録していました。  
>  According to the land ministry, three companies were operating in a way
> different to the rules that the nation had decided upon. The nation had
> chosen inspections which investigate amount of gases that are emitted and
> the amount of fuel that is needed for running. They also recorded that they
> had made inspections in accordance with the rules.

This is my best effort at translation but I think something is not quite
right. The part in bold is bothering me. It looks like 決める has two objects
i.e. ルール and 検査.

I parse 国が決めたルール as "the rules chosen by the nation". But also 検査を国が決めた as
"The nation has chosen an examination". I can't join these together to make
anything meaningful, hence why I wrote two separate sentences. Am I parsing
this wrongly?




検査 is the object of 行っていました. A simplified version of this sentence is:

> 3つの会社は検査を行って【おこなって】いました。  
>  The three companies were conducting examinations.

行っていました is modified by a long adverbial expression 国が決めたルールと違うやり方で ("in a way
that is different from rules set by the government").




検査 is the object of 行っていました. A simplified version of this sentence is:

> 3つの会社は検査を行って【おこなって】いました。  
>  The three companies were conducting examinations.

行っていました is modified by a long adverbial expression 国が決めたルールと違うやり方で ("in a way
that is different from rules set by the government").

