# 3 inputs
# 6 outputs
# 14 D-type flipflops
# 44 inverters
# 75 gates (31 ANDs + 9 NANDs + 16 ORs + 19 NORs)

INPUT(G0)
INPUT(G1)
INPUT(G2)

OUTPUT(G117)
OUTPUT(G132)
OUTPUT(G66)
OUTPUT(G118)
OUTPUT(G133)
OUTPUT(G67)

G10 = DFF(G29)
G11 = DFF(G30)
G12 = DFF(G34)
G13 = DFF(G39)
G14 = DFF(G44)
G15 = DFF(G56)
G16 = DFF(G86)
G17 = DFF(G92)
G18 = DFF(G98)
G19 = DFF(G102)
G20 = DFF(G107)
G21 = DFF(G113)
G22 = DFF(G119)
G23 = DFF(G125)

G28 = NOT(G130)
G38 = NOT(G10)
G40 = NOT(G13)
G45 = NOT(G12)
G46 = NOT(G11)
G50 = NOT(G14)
G51 = NOT(G23)
G54 = NOT(G11)
G55 = NOT(G13)
G59 = NOT(G12)
G60 = NOT(G22)
G64 = NOT(G15)
I155 = NOT(G16)
G66 = NOT(I155)
I158 = NOT(G17)
G67 = NOT(I158)
G76 = NOT(G10)
G82 = NOT(G11)
G87 = NOT(G16)
G91 = NOT(G12)
G93 = NOT(G17)
G96 = NOT(G14)
G99 = NOT(G18)
G103 = NOT(G13)
G108 = NOT(G112)
G114 = NOT(G21)
I210 = NOT(G18)
G117 = NOT(I210)
I213 = NOT(G19)
G118 = NOT(I213)
G120 = NOT(G124)
G121 = NOT(G22)
I221 = NOT(G2)
G124 = NOT(I221)
G126 = NOT(G131)
G127 = NOT(G23)
I229 = NOT(G0)
G130 = NOT(I229)
I232 = NOT(G1)
G131 = NOT(I232)
I235 = NOT(G20)
G132 = NOT(I235)
I238 = NOT(G21)
G133 = NOT(I238)

G26 = AND(G28, G50)
G27 = AND(G51, G28)
G31 = AND(G10, G45, G13)
G32 = AND(G10, G11)
G33 = AND(G38, G46)
G35 = AND(G10, G11, G12)
G36 = AND(G38, G45)
G37 = AND(G46, G45)
G42 = AND(G40, G41)
G48 = AND(G45, G46, G10, G47)
G49 = AND(G50, G51, G52)
G57 = AND(G59, G11, G60, G61)
G58 = AND(G64, G65)
G62 = AND(G59, G11, G60, G61)
G63 = AND(G64, G65)
G74 = AND(G12, G14, G19)
G75 = AND(G82, G91, G14)
G88 = AND(G14, G87)
G89 = AND(G103, G96)
G90 = AND(G91, G103)
G94 = AND(G93, G13)
G95 = AND(G96, G13)
G100 = AND(G99, G14, G12)
G105 = AND(G103, G108, G104)
G110 = AND(G108, G109)
G111 = AND(G10, G112)
G115 = AND(G114, G14)
G122 = AND(G120, G121)
G123 = AND(G124, G22)
G128 = AND(G126, G127)
G129 = AND(G131, G23)

G24 = OR(G38, G46, G45, G40)
G25 = OR(G38, G11, G12)
G68 = OR(G11, G12, G13, G96)
G69 = OR(G103, G18)
G70 = OR(G103, G14)
G71 = OR(G82, G12, G13)
G72 = OR(G91, G20)
G73 = OR(G103, G20)
G77 = OR(G112, G103, G96, G19)
G78 = OR(G108, G76)
G79 = OR(G103, G14)
G80 = OR(G11, G14)
G81 = OR(G12, G13)
G83 = OR(G11, G12, G13, G96)
G84 = OR(G82, G91, G14)
G85 = OR(G91, G96, G17)

G41 = NAND(G12, G11, G10)
G43 = NAND(G24, G25, G28)
G52 = NAND(G13, G45, G46, G10)
G65 = NAND(G59, G54, G22, G61)
G97 = NAND(G83, G84, G85, G108)
G101 = NAND(G68, G69, G70, G108)
G106 = NAND(G77, G78)
G109 = NAND(G71, G72, G73, G14)
G116 = NAND(G79, G80, G81, G108)

G29 = NOR(G10, G130)
G30 = NOR(G31, G32, G33, G130)
G34 = NOR(G35, G36, G37, G130)
G39 = NOR(G42, G43)
G44 = NOR(G48, G49, G53)
G47 = NOR(G50, G40)
G53 = NOR(G26, G27)
G56 = NOR(G57, G58, G130)
G61 = NOR(G14, G55)
G86 = NOR(G88, G89, G90, G112)
G92 = NOR(G94, G95, G97)
G98 = NOR(G100, G101)
G102 = NOR(G105, G106)
G104 = NOR(G74, G75)
G107 = NOR(G110, G111)
G112 = NOR(G62, G63)
G113 = NOR(G115, G116)
G119 = NOR(G122, G123, G130)
G125 = NOR(G128, G129, G130)
