---
Function {
 argument: None,
 arguments: FunctionArguments {
  arguments: [
   FunctionArgument {
    identifier: "pkgs",
    default: None,
   },
   FunctionArgument {
    identifier: "lib",
    default: None,
   },
  ],
  ellipsis: false,
 },
 definition: LetIn {
  bindings: [
   KeyValue(
    AttributePath {
     attributes: [
      Raw {
       content: "zeroPad",
       position: (5, 3),
      },
     ],
    },
    Function {
     argument: Some(
      "n",
     ),
     arguments: FunctionArguments {
      arguments: [],
      ellipsis: false,
     },
     definition: BinaryOperation {
      operator: Addition,
      operands: [
       FunctionApplication {
        function: PropertyAccess {
         expression: Variable {
          identifier: "lib",
          position: (6, 5),
         },
         attribute_path: AttributePath {
          attributes: [
           Raw {
            content: "optionalString",
            position: (6, 9),
           },
          ],
         },
         default: None,
        },
        arguments: [
         BinaryOperation {
          operator: LessThan,
          operands: [
           Variable {
            identifier: "n",
            position: (6, 25),
           },
           Int {
            value: 16,
            position: (6, 29),
           },
          ],
          position: (6, 27),
         },
         String {
          parts: [
           Raw {
            content: "0",
            position: (6, 34),
           },
          ],
         },
        ],
       },
       IfThenElse {
        predicate: BinaryOperation {
         operator: GreaterThan,
         operands: [
          Variable {
           identifier: "n",
           position: (7, 11),
          },
          Int {
           value: 255,
           position: (7, 15),
          },
         ],
         position: (7, 13),
        },
        then: FunctionApplication {
         function: Variable {
          identifier: "throw",
          position: (8, 13),
         },
         arguments: [
          String {
           parts: [
            Raw {
             content: "Can't have more than 255 nets or nodes!",
             position: (8, 20),
            },
           ],
          },
         ],
        },
        else_: FunctionApplication {
         function: PropertyAccess {
          expression: Variable {
           identifier: "lib",
           position: (9, 13),
          },
          attribute_path: AttributePath {
           attributes: [
            Raw {
             content: "toHexString",
             position: (9, 17),
            },
           ],
          },
          default: None,
         },
         arguments: [
          Variable {
           identifier: "n",
           position: (9, 29),
          },
         ],
        },
        position: (7, 8),
       },
      ],
      position: (6, 37),
     },
     position: (5, 13),
    },
   ),
  ],
  target: Map {
   bindings: [
    KeyValue(
     AttributePath {
      attributes: [
       Raw {
        content: "qemuNicMac",
        position: (13, 3),
       },
      ],
     },
     Function {
      argument: Some(
       "net",
      ),
      arguments: FunctionArguments {
       arguments: [],
       ellipsis: false,
      },
      definition: Function {
       argument: Some(
        "machine",
       ),
       arguments: FunctionArguments {
        arguments: [],
        ellipsis: false,
       },
       definition: String {
        parts: [
         Raw {
          content: "52:54:00:12:",
          position: (13, 31),
         },
         Expression {
          expression: FunctionApplication {
           function: Variable {
            identifier: "zeroPad",
            position: (13, 45),
           },
           arguments: [
            Variable {
             identifier: "net",
             position: (13, 53),
            },
           ],
          },
         },
         Raw {
          content: ":",
          position: (13, 57),
         },
         Expression {
          expression: FunctionApplication {
           function: Variable {
            identifier: "zeroPad",
            position: (13, 60),
           },
           arguments: [
            Variable {
             identifier: "machine",
             position: (13, 68),
            },
           ],
          },
         },
        ],
       },
       position: (13, 21),
      },
      position: (13, 16),
     },
    ),
    KeyValue(
     AttributePath {
      attributes: [
       Raw {
        content: "qemuNICFlags",
        position: (15, 3),
       },
      ],
     },
     Function {
      argument: Some(
       "nic",
      ),
      arguments: FunctionArguments {
       arguments: [],
       ellipsis: false,
      },
      definition: Function {
       argument: Some(
        "net",
       ),
       arguments: FunctionArguments {
        arguments: [],
        ellipsis: false,
       },
       definition: Function {
        argument: Some(
         "machine",
        ),
        arguments: FunctionArguments {
         arguments: [],
         ellipsis: false,
        },
        definition: List {
         elements: [
          String {
           parts: [
            Raw {
             content: "-device virtio-net-pci,netdev=vlan",
             position: (16, 8),
            },
            Expression {
             expression: FunctionApplication {
              function: Variable {
               identifier: "toString",
               position: (16, 44),
              },
              arguments: [
               Variable {
                identifier: "nic",
                position: (16, 53),
               },
              ],
             },
            },
            Raw {
             content: ",mac=",
             position: (16, 57),
            },
            Expression {
             expression: FunctionApplication {
              function: Variable {
               identifier: "qemuNicMac",
               position: (16, 64),
              },
              arguments: [
               Variable {
                identifier: "net",
                position: (16, 75),
               },
               Variable {
                identifier: "machine",
                position: (16, 79),
               },
              ],
             },
            },
           ],
          },
          String {
           parts: [
            Raw {
             content: "-netdev vde,id=vlan",
             position: (17, 9),
            },
            Expression {
             expression: FunctionApplication {
              function: Variable {
               identifier: "toString",
               position: (17, 30),
              },
              arguments: [
               Variable {
                identifier: "nic",
                position: (17, 39),
               },
              ],
             },
            },
            Raw {
             content: ",sock=\"$QEMU_VDE_SOCKET_",
             position: (17, 43),
            },
            Expression {
             expression: FunctionApplication {
              function: Variable {
               identifier: "toString",
               position: (17, 69),
              },
              arguments: [
               Variable {
                identifier: "net",
                position: (17, 78),
               },
              ],
             },
            },
            Raw {
             content: "\"",
             position: (17, 82),
            },
           ],
          },
         ],
         position: (16, 5),
        },
        position: (15, 28),
       },
       position: (15, 23),
      },
      position: (15, 18),
     },
    ),
    KeyValue(
     AttributePath {
      attributes: [
       Raw {
        content: "qemuSerialDevice",
        position: (20, 3),
       },
      ],
     },
     IfThenElse {
      predicate: BinaryOperation {
       operator: LogicalOr,
       operands: [
        PropertyAccess {
         expression: Variable {
          identifier: "pkgs",
          position: (20, 25),
         },
         attribute_path: AttributePath {
          attributes: [
           Raw {
            content: "stdenv",
            position: (20, 30),
           },
           Raw {
            content: "hostPlatform",
            position: (20, 37),
           },
           Raw {
            content: "isx86",
            position: (20, 50),
           },
          ],
         },
         default: None,
        },
        PropertyAccess {
         expression: Variable {
          identifier: "pkgs",
          position: (20, 59),
         },
         attribute_path: AttributePath {
          attributes: [
           Raw {
            content: "stdenv",
            position: (20, 64),
           },
           Raw {
            content: "hostPlatform",
            position: (20, 71),
           },
           Raw {
            content: "isRiscV",
            position: (20, 84),
           },
          ],
         },
         default: None,
        },
       ],
       position: (20, 56),
      },
      then: String {
       parts: [
        Raw {
         content: "ttyS0",
         position: (20, 98),
        },
       ],
      },
      else_: IfThenElse {
       predicate: With {
        expression: PropertyAccess {
         expression: Variable {
          identifier: "pkgs",
          position: (21, 23),
         },
         attribute_path: AttributePath {
          attributes: [
           Raw {
            content: "stdenv",
            position: (21, 28),
           },
           Raw {
            content: "hostPlatform",
            position: (21, 35),
           },
          ],
         },
         default: None,
        },
        target: BinaryOperation {
         operator: LogicalOr,
         operands: [
          BinaryOperation {
           operator: LogicalOr,
           operands: [
            Variable {
             identifier: "isAarch32",
             position: (21, 49),
            },
            Variable {
             identifier: "isAarch64",
             position: (21, 62),
            },
           ],
           position: (21, 59),
          },
          Variable {
           identifier: "isPower",
           position: (21, 75),
          },
         ],
         position: (21, 72),
        },
        position: (21, 18),
       },
       then: String {
        parts: [
         Raw {
          content: "ttyAMA0",
          position: (21, 90),
         },
        ],
       },
       else_: FunctionApplication {
        function: Variable {
         identifier: "throw",
         position: (22, 14),
        },
        arguments: [
         String {
          parts: [
           Raw {
            content: "Unknown QEMU serial device for system '",
            position: (22, 21),
           },
           Expression {
            expression: PropertyAccess {
             expression: Variable {
              identifier: "pkgs",
              position: (22, 62),
             },
             attribute_path: AttributePath {
              attributes: [
               Raw {
                content: "stdenv",
                position: (22, 67),
               },
               Raw {
                content: "hostPlatform",
                position: (22, 74),
               },
               Raw {
                content: "system",
                position: (22, 87),
               },
              ],
             },
             default: None,
            },
           },
           Raw {
            content: "'",
            position: (22, 94),
           },
          ],
         },
        ],
       },
       position: (21, 14),
      },
      position: (20, 22),
     },
    ),
    KeyValue(
     AttributePath {
      attributes: [
       Raw {
        content: "qemuBinary",
        position: (24, 3),
       },
      ],
     },
     Function {
      argument: Some(
       "qemuPkg",
      ),
      arguments: FunctionArguments {
       arguments: [],
       ellipsis: false,
      },
      definition: PropertyAccess {
       expression: Map {
        bindings: [
         KeyValue(
          AttributePath {
           attributes: [
            Raw {
             content: "x86_64-linux",
             position: (25, 5),
            },
           ],
          },
          String {
           parts: [
            Expression {
             expression: Variable {
              identifier: "qemuPkg",
              position: (25, 23),
             },
            },
            Raw {
             content: "/bin/qemu-kvm -cpu max",
             position: (25, 31),
            },
           ],
          },
         ),
         KeyValue(
          AttributePath {
           attributes: [
            Raw {
             content: "armv7l-linux",
             position: (26, 5),
            },
           ],
          },
          String {
           parts: [
            Expression {
             expression: Variable {
              identifier: "qemuPkg",
              position: (26, 23),
             },
            },
            Raw {
             content: "/bin/qemu-system-arm -enable-kvm -machine virt -cpu host",
             position: (26, 31),
            },
           ],
          },
         ),
         KeyValue(
          AttributePath {
           attributes: [
            Raw {
             content: "aarch64-linux",
             position: (27, 5),
            },
           ],
          },
          String {
           parts: [
            Expression {
             expression: Variable {
              identifier: "qemuPkg",
              position: (27, 24),
             },
            },
            Raw {
             content: "/bin/qemu-system-aarch64 -enable-kvm -machine virt,gic-version=host -cpu host",
             position: (27, 32),
            },
           ],
          },
         ),
         KeyValue(
          AttributePath {
           attributes: [
            Raw {
             content: "powerpc64le-linux",
             position: (28, 5),
            },
           ],
          },
          String {
           parts: [
            Expression {
             expression: Variable {
              identifier: "qemuPkg",
              position: (28, 28),
             },
            },
            Raw {
             content: "/bin/qemu-system-ppc64 -machine powernv",
             position: (28, 36),
            },
           ],
          },
         ),
         KeyValue(
          AttributePath {
           attributes: [
            Raw {
             content: "powerpc64-linux",
             position: (29, 5),
            },
           ],
          },
          String {
           parts: [
            Expression {
             expression: Variable {
              identifier: "qemuPkg",
              position: (29, 26),
             },
            },
            Raw {
             content: "/bin/qemu-system-ppc64 -machine powernv",
             position: (29, 34),
            },
           ],
          },
         ),
         KeyValue(
          AttributePath {
           attributes: [
            Raw {
             content: "x86_64-darwin",
             position: (30, 5),
            },
           ],
          },
          String {
           parts: [
            Expression {
             expression: Variable {
              identifier: "qemuPkg",
              position: (30, 24),
             },
            },
            Raw {
             content: "/bin/qemu-kvm -cpu max",
             position: (30, 32),
            },
           ],
          },
         ),
        ],
        recursive: false,
        position: (24, 25),
       },
       attribute_path: AttributePath {
        attributes: [
         Expression {
          expression: PropertyAccess {
           expression: Variable {
            identifier: "pkgs",
            position: (31, 7),
           },
           attribute_path: AttributePath {
            attributes: [
             Raw {
              content: "stdenv",
              position: (31, 12),
             },
             Raw {
              content: "hostPlatform",
              position: (31, 19),
             },
             Raw {
              content: "system",
              position: (31, 32),
             },
            ],
           },
           default: None,
          },
         },
        ],
       },
       default: Some(
        String {
         parts: [
          Expression {
           expression: Variable {
            identifier: "qemuPkg",
            position: (31, 46),
           },
          },
          Raw {
           content: "/bin/qemu-kvm",
           position: (31, 54),
          },
         ],
        },
       ),
      },
      position: (24, 16),
     },
    ),
   ],
   recursive: true,
   position: (12, 1),
  },
  position: (4, 1),
 },
 position: (2, 1),
}