compilation_unit {
  package_statement {
    package_name: "ExplorerTest"
  }
  is_api: true
  declarations {
    class_declaration {
      name {
        name: "B"
      }
      members {
        variable {
          binding {
            name: "x"
            type {
              expression_pattern {
                expression {
                  int_type_literal {
                  }
                }
              }
            }
          }
        }
      }
      members {
        function {
          name {
            name: "GetSetX"
          }
          self_pattern {
            addr_pattern {
              binding_pattern {
                name: "self"
                type {
                  expression_pattern {
                    expression {
                      operator {
                        op: Ptr
                        arguments {
                          identifier {
                            name: "Self"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
          param_pattern {
            fields {
              binding_pattern {
                name: "x"
                type {
                  expression_pattern {
                    expression {
                      int_type_literal {
                      }
                    }
                  }
                }
              }
            }
          }
          return_term {
            kind: Expression
            type {
              int_type_literal {
              }
            }
          }
          body {
            statements {
              variable_definition {
                pattern {
                  binding_pattern {
                    name: "oldX"
                    type {
                      auto_pattern {
                      }
                    }
                  }
                }
                init {
                  simple_member_access {
                    field: "x"
                    object {
                      operator {
                        op: Deref
                        arguments {
                          identifier {
                            name: "self"
                          }
                        }
                      }
                    }
                  }
                }
                is_returned: false
              }
            }
            statements {
              assign {
                lhs {
                  simple_member_access {
                    field: "x"
                    object {
                      operator {
                        op: Deref
                        arguments {
                          identifier {
                            name: "self"
                          }
                        }
                      }
                    }
                  }
                }
                rhs {
                  identifier {
                    name: "x"
                  }
                }
                op: Plain
              }
            }
            statements {
              return_expression_statement {
                expression {
                  identifier {
                    name: "oldX"
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  declarations {
    class_declaration {
      name {
        name: "A"
      }
      members {
        variable {
          binding {
            name: "b"
            type {
              expression_pattern {
                expression {
                  identifier {
                    name: "B"
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  declarations {
    function {
      name {
        name: "Main"
      }
      param_pattern {
      }
      return_term {
        kind: Expression
        type {
          int_type_literal {
          }
        }
      }
      body {
        statements {
          variable_definition {
            pattern {
              binding_pattern {
                name: "b"
                type {
                  expression_pattern {
                    expression {
                      identifier {
                        name: "B"
                      }
                    }
                  }
                }
              }
            }
            init {
              struct_literal {
                fields {
                  name: "x"
                  expression {
                    int_literal {
                      value: 0
                    }
                  }
                }
              }
            }
            is_returned: false
          }
        }
        statements {
          variable_definition {
            pattern {
              binding_pattern {
                name: "a"
                type {
                  expression_pattern {
                    expression {
                      identifier {
                        name: "A"
                      }
                    }
                  }
                }
              }
            }
            init {
              struct_literal {
                fields {
                  name: "b"
                  expression {
                    identifier {
                      name: "b"
                    }
                  }
                }
              }
            }
            is_returned: false
          }
        }
        statements {
          variable_definition {
            pattern {
              binding_pattern {
                name: "x"
                type {
                  auto_pattern {
                  }
                }
              }
            }
            init {
              call {
                function {
                  simple_member_access {
                    field: "GetSetX"
                    object {
                      simple_member_access {
                        field: "b"
                        object {
                          identifier {
                            name: "a"
                          }
                        }
                      }
                    }
                  }
                }
                argument {
                  tuple_literal {
                    fields {
                      int_literal {
                        value: 42
                      }
                    }
                  }
                }
              }
            }
            is_returned: false
          }
        }
        statements {
          if_statement {
            condition {
              operator {
                op: Eq
                arguments {
                  simple_member_access {
                    field: "x"
                    object {
                      simple_member_access {
                        field: "b"
                        object {
                          identifier {
                            name: "a"
                          }
                        }
                      }
                    }
                  }
                }
                arguments {
                  int_literal {
                    value: 42
                  }
                }
              }
            }
            then_block {
              statements {
                return_expression_statement {
                  expression {
                    identifier {
                      name: "x"
                    }
                  }
                }
              }
            }
          }
        }
        statements {
          return_expression_statement {
            expression {
              int_literal {
                value: 1
              }
            }
          }
        }
      }
    }
  }
}
