/* binary.c generated by valac 0.56.19, the Vala compiler
 * generated from binary.vala, do not modify */

#include <glib-object.h>
#include <gee.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gio/gio.h>
#include <gobject/gvaluecollector.h>

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

typedef enum  {
	PROTON_PLUS_VDF_BIN_TYPES_BIN_TYPE_NODE = 0x00,
	PROTON_PLUS_VDF_BIN_TYPES_BIN_TYPE_STRING = 0x01,
	PROTON_PLUS_VDF_BIN_TYPES_BIN_TYPE_INT32 = 0x02,
	PROTON_PLUS_VDF_BIN_TYPES_BIN_TYPE_FLOAT32 = 0x03,
	PROTON_PLUS_VDF_BIN_TYPES_BIN_TYPE_POINTER = 0x04,
	PROTON_PLUS_VDF_BIN_TYPES_BIN_TYPE_WIDESTRING = 0x05,
	PROTON_PLUS_VDF_BIN_TYPES_BIN_TYPE_COLOR = 0x06,
	PROTON_PLUS_VDF_BIN_TYPES_BIN_TYPE_UINT64 = 0x07,
	PROTON_PLUS_VDF_BIN_TYPES_BIN_TYPE_END = 0x08,
	PROTON_PLUS_VDF_BIN_TYPES_BIN_TYPE_INT64 = 0x0A,
	PROTON_PLUS_VDF_BIN_TYPES_BIN_TYPE_END_ALT = 0x0B
} ProtonPlusVDFBIN_TYPES;

#define PROTON_PLUS_VDF_TYPE_BIN_TYPES (proton_plus_vdf_bin_types_get_type ())

#define PROTON_PLUS_VDF_TYPE_BINARY (proton_plus_vdf_binary_get_type ())
#define PROTON_PLUS_VDF_BINARY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_VDF_TYPE_BINARY, ProtonPlusVDFBinary))
#define PROTON_PLUS_VDF_BINARY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_VDF_TYPE_BINARY, ProtonPlusVDFBinaryClass))
#define PROTON_PLUS_VDF_IS_BINARY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_VDF_TYPE_BINARY))
#define PROTON_PLUS_VDF_IS_BINARY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_VDF_TYPE_BINARY))
#define PROTON_PLUS_VDF_BINARY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_VDF_TYPE_BINARY, ProtonPlusVDFBinaryClass))

typedef struct _ProtonPlusVDFBinary ProtonPlusVDFBinary;
typedef struct _ProtonPlusVDFBinaryClass ProtonPlusVDFBinaryClass;
typedef struct _ProtonPlusVDFBinaryPrivate ProtonPlusVDFBinaryPrivate;

#define PROTON_PLUS_VDF_TYPE_NODE (proton_plus_vdf_node_get_type ())
#define PROTON_PLUS_VDF_NODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_VDF_TYPE_NODE, ProtonPlusVDFNode))
#define PROTON_PLUS_VDF_NODE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_VDF_TYPE_NODE, ProtonPlusVDFNodeClass))
#define PROTON_PLUS_VDF_IS_NODE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_VDF_TYPE_NODE))
#define PROTON_PLUS_VDF_IS_NODE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_VDF_TYPE_NODE))
#define PROTON_PLUS_VDF_NODE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_VDF_TYPE_NODE, ProtonPlusVDFNodeClass))

typedef struct _ProtonPlusVDFNode ProtonPlusVDFNode;
typedef struct _ProtonPlusVDFNodeClass ProtonPlusVDFNodeClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))
typedef struct _ProtonPlusVDFNodePrivate ProtonPlusVDFNodePrivate;
typedef struct _ProtonPlusVDFParamSpecBinary ProtonPlusVDFParamSpecBinary;

struct _ProtonPlusVDFBinary {
	GTypeInstance parent_instance;
	volatile int ref_count;
	ProtonPlusVDFBinaryPrivate * priv;
	GeeTreeMap* nodes;
};

struct _ProtonPlusVDFBinaryClass {
	GTypeClass parent_class;
	void (*finalize) (ProtonPlusVDFBinary *self);
};

struct _ProtonPlusVDFBinaryPrivate {
	ProtonPlusVDFNode** _nodes;
	gint _nodes_length1;
	gint __nodes_size_;
	GFile* file;
	GInputStream* input_stream;
	GDataInputStream* reader;
	gint current_node_index;
	GDataOutputStream* writer;
};

struct _ProtonPlusVDFNode {
	GeeTreeMap parent_instance;
	ProtonPlusVDFNodePrivate * priv;
	gchar* node_name;
};

struct _ProtonPlusVDFNodeClass {
	GeeTreeMapClass parent_class;
};

struct _ProtonPlusVDFParamSpecBinary {
	GParamSpec parent_instance;
};

static gint ProtonPlusVDFBinary_private_offset;
static gpointer proton_plus_vdf_binary_parent_class = NULL;

VALA_EXTERN GType proton_plus_vdf_bin_types_get_type (void) G_GNUC_CONST ;
VALA_EXTERN gpointer proton_plus_vdf_binary_ref (gpointer instance);
VALA_EXTERN void proton_plus_vdf_binary_unref (gpointer instance);
VALA_EXTERN GParamSpec* proton_plus_vdf_param_spec_binary (const gchar* name,
                                               const gchar* nick,
                                               const gchar* blurb,
                                               GType object_type,
                                               GParamFlags flags);
VALA_EXTERN void proton_plus_vdf_value_set_binary (GValue* value,
                                       gpointer v_object);
VALA_EXTERN void proton_plus_vdf_value_take_binary (GValue* value,
                                        gpointer v_object);
VALA_EXTERN gpointer proton_plus_vdf_value_get_binary (const GValue* value);
VALA_EXTERN GType proton_plus_vdf_binary_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ProtonPlusVDFBinary, proton_plus_vdf_binary_unref)
VALA_EXTERN GType proton_plus_vdf_node_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ProtonPlusVDFNode, g_object_unref)
static gchar* proton_plus_vdf_binary_eat_string (ProtonPlusVDFBinary* self,
                                          GError** error);
static void proton_plus_vdf_binary_parse_node (ProtonPlusVDFBinary* self,
                                        const gchar* current_node,
                                        GError** error);
VALA_EXTERN ProtonPlusVDFNode* proton_plus_vdf_node_new (const gchar* name);
VALA_EXTERN ProtonPlusVDFNode* proton_plus_vdf_node_construct (GType object_type,
                                                   const gchar* name);
static void _vala_array_add1 (ProtonPlusVDFNode** * array,
                       gint* length,
                       gint* size,
                       ProtonPlusVDFNode* value);
static void proton_plus_vdf_binary_get_data (ProtonPlusVDFBinary* self,
                                      ProtonPlusVDFBIN_TYPES type,
                                      GError** error);
static guint proton_plus_vdf_binary_count_dots (ProtonPlusVDFBinary* self,
                                         const gchar* str);
static void proton_plus_vdf_binary_save_node (ProtonPlusVDFBinary* self,
                                       const gchar* node_name,
                                       guint layer,
                                       gchar** _nodes,
                                       gint _nodes_length1,
                                       GError** error);
VALA_EXTERN void proton_plus_vdf_binary_save (ProtonPlusVDFBinary* self,
                                  GError** error);
static void _vala_array_add2 (gchar** * array,
                       gint* length,
                       gint* size,
                       gchar* value);
VALA_EXTERN ProtonPlusVDFBinary* proton_plus_vdf_binary_new (const gchar* path);
VALA_EXTERN ProtonPlusVDFBinary* proton_plus_vdf_binary_construct (GType object_type,
                                                       const gchar* path);
static void proton_plus_vdf_binary_finalize (ProtonPlusVDFBinary * obj);
static GType proton_plus_vdf_binary_get_type_once (void);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static gssize _vala_array_length (gpointer array);

static GType
proton_plus_vdf_bin_types_get_type_once (void)
{
	static const GEnumValue values[] = {{PROTON_PLUS_VDF_BIN_TYPES_BIN_TYPE_NODE, "PROTON_PLUS_VDF_BIN_TYPES_BIN_TYPE_NODE", "bin-type-node"}, {PROTON_PLUS_VDF_BIN_TYPES_BIN_TYPE_STRING, "PROTON_PLUS_VDF_BIN_TYPES_BIN_TYPE_STRING", "bin-type-string"}, {PROTON_PLUS_VDF_BIN_TYPES_BIN_TYPE_INT32, "PROTON_PLUS_VDF_BIN_TYPES_BIN_TYPE_INT32", "bin-type-int32"}, {PROTON_PLUS_VDF_BIN_TYPES_BIN_TYPE_FLOAT32, "PROTON_PLUS_VDF_BIN_TYPES_BIN_TYPE_FLOAT32", "bin-type-float32"}, {PROTON_PLUS_VDF_BIN_TYPES_BIN_TYPE_POINTER, "PROTON_PLUS_VDF_BIN_TYPES_BIN_TYPE_POINTER", "bin-type-pointer"}, {PROTON_PLUS_VDF_BIN_TYPES_BIN_TYPE_WIDESTRING, "PROTON_PLUS_VDF_BIN_TYPES_BIN_TYPE_WIDESTRING", "bin-type-widestring"}, {PROTON_PLUS_VDF_BIN_TYPES_BIN_TYPE_COLOR, "PROTON_PLUS_VDF_BIN_TYPES_BIN_TYPE_COLOR", "bin-type-color"}, {PROTON_PLUS_VDF_BIN_TYPES_BIN_TYPE_UINT64, "PROTON_PLUS_VDF_BIN_TYPES_BIN_TYPE_UINT64", "bin-type-uint64"}, {PROTON_PLUS_VDF_BIN_TYPES_BIN_TYPE_END, "PROTON_PLUS_VDF_BIN_TYPES_BIN_TYPE_END", "bin-type-end"}, {PROTON_PLUS_VDF_BIN_TYPES_BIN_TYPE_INT64, "PROTON_PLUS_VDF_BIN_TYPES_BIN_TYPE_INT64", "bin-type-int64"}, {PROTON_PLUS_VDF_BIN_TYPES_BIN_TYPE_END_ALT, "PROTON_PLUS_VDF_BIN_TYPES_BIN_TYPE_END_ALT", "bin-type-end-alt"}, {0, NULL, NULL}};
	GType proton_plus_vdf_bin_types_type_id;
	proton_plus_vdf_bin_types_type_id = g_enum_register_static ("ProtonPlusVDFBIN_TYPES", values);
	return proton_plus_vdf_bin_types_type_id;
}

GType
proton_plus_vdf_bin_types_get_type (void)
{
	static volatile gsize proton_plus_vdf_bin_types_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_vdf_bin_types_type_id__once)) {
		GType proton_plus_vdf_bin_types_type_id;
		proton_plus_vdf_bin_types_type_id = proton_plus_vdf_bin_types_get_type_once ();
		g_once_init_leave (&proton_plus_vdf_bin_types_type_id__once, proton_plus_vdf_bin_types_type_id);
	}
	return proton_plus_vdf_bin_types_type_id__once;
}

static inline gpointer
proton_plus_vdf_binary_get_instance_private (ProtonPlusVDFBinary* self)
{
	return G_STRUCT_MEMBER_P (self, ProtonPlusVDFBinary_private_offset);
}

static gpointer
_g_error_copy0 (gpointer self)
{
	return self ? g_error_copy (self) : NULL;
}

static gchar*
proton_plus_vdf_binary_eat_string (ProtonPlusVDFBinary* self,
                                   GError** error)
{
	gsize len = 0UL;
	GError* _inner_error0_ = NULL;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	{
		gchar* str = NULL;
		GDataInputStream* _tmp0_;
		gsize _tmp1_ = 0UL;
		gchar* _tmp2_;
		GDataInputStream* _tmp3_;
		_tmp0_ = self->priv->reader;
		_tmp2_ = g_data_input_stream_read_upto (_tmp0_, "\0", (gssize) 1, &_tmp1_, NULL, &_inner_error0_);
		len = _tmp1_;
		str = _tmp2_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp3_ = self->priv->reader;
		g_data_input_stream_read_byte (_tmp3_, NULL, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_free0 (str);
			goto __catch0_g_error;
		}
		result = str;
		return result;
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp4_;
		const gchar* _tmp5_;
		GError* _tmp6_;
		GError* _tmp7_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp4_ = e;
		_tmp5_ = _tmp4_->message;
		g_warning ("binary.vala:32: Error: %s", _tmp5_);
		_tmp6_ = e;
		_tmp7_ = _g_error_copy0 (_tmp6_);
		_inner_error0_ = _tmp7_;
		_g_error_free0 (e);
		goto __finally0;
	}
	__finally0:
	g_propagate_error (error, _inner_error0_);
	return NULL;
}

static void
_vala_array_add1 (ProtonPlusVDFNode** * array,
                  gint* length,
                  gint* size,
                  ProtonPlusVDFNode* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (ProtonPlusVDFNode*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static void
proton_plus_vdf_binary_parse_node (ProtonPlusVDFBinary* self,
                                   const gchar* current_node,
                                   GError** error)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (current_node != NULL);
	{
		ProtonPlusVDFNode* _tmp0_;
		ProtonPlusVDFNode** _tmp1_;
		gint _tmp1__length1;
		_tmp0_ = proton_plus_vdf_node_new (current_node);
		_vala_array_add1 (&self->priv->_nodes, &self->priv->_nodes_length1, &self->priv->__nodes_size_, _tmp0_);
		_tmp1_ = self->priv->_nodes;
		_tmp1__length1 = self->priv->_nodes_length1;
		self->priv->current_node_index = _tmp1__length1 - 1;
		while (TRUE) {
			guint8 type = 0U;
			GDataInputStream* _tmp2_;
			_tmp2_ = self->priv->reader;
			type = g_data_input_stream_read_byte (_tmp2_, NULL, &_inner_error0_);
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
			switch (type) {
				case PROTON_PLUS_VDF_BIN_TYPES_BIN_TYPE_NODE:
				{
					gchar* _tmp3_ = NULL;
					gchar* _tmp4_;
					gchar* _tmp5_;
					gchar* _tmp6_;
					gchar* _tmp7_;
					gchar* _tmp8_;
					_tmp4_ = proton_plus_vdf_binary_eat_string (self, &_inner_error0_);
					_tmp3_ = _tmp4_;
					if (G_UNLIKELY (_inner_error0_ != NULL)) {
						goto __catch0_g_error;
					}
					_tmp5_ = g_strconcat (current_node, ".", NULL);
					_tmp6_ = _tmp5_;
					_tmp7_ = g_strconcat (_tmp6_, _tmp3_, NULL);
					_tmp8_ = _tmp7_;
					proton_plus_vdf_binary_parse_node (self, _tmp8_, &_inner_error0_);
					_g_free0 (_tmp8_);
					_g_free0 (_tmp6_);
					if (G_UNLIKELY (_inner_error0_ != NULL)) {
						_g_free0 (_tmp3_);
						goto __catch0_g_error;
					}
					_g_free0 (_tmp3_);
					break;
				}
				case PROTON_PLUS_VDF_BIN_TYPES_BIN_TYPE_STRING:
				case PROTON_PLUS_VDF_BIN_TYPES_BIN_TYPE_INT32:
				case PROTON_PLUS_VDF_BIN_TYPES_BIN_TYPE_FLOAT32:
				case PROTON_PLUS_VDF_BIN_TYPES_BIN_TYPE_POINTER:
				case PROTON_PLUS_VDF_BIN_TYPES_BIN_TYPE_WIDESTRING:
				case PROTON_PLUS_VDF_BIN_TYPES_BIN_TYPE_COLOR:
				case PROTON_PLUS_VDF_BIN_TYPES_BIN_TYPE_UINT64:
				case PROTON_PLUS_VDF_BIN_TYPES_BIN_TYPE_INT64:
				{
					proton_plus_vdf_binary_get_data (self, type, &_inner_error0_);
					if (G_UNLIKELY (_inner_error0_ != NULL)) {
						goto __catch0_g_error;
					}
					break;
				}
				case PROTON_PLUS_VDF_BIN_TYPES_BIN_TYPE_END:
				case PROTON_PLUS_VDF_BIN_TYPES_BIN_TYPE_END_ALT:
				{
					return;
				}
				default:
				{
					GError* _tmp9_;
					_tmp9_ = g_error_new (g_quark_from_string ("vala-vdf"), 0, "Unexpected byte");
					_inner_error0_ = _tmp9_;
					goto __catch0_g_error;
				}
			}
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp10_;
		const gchar* _tmp11_;
		GError* _tmp12_;
		GError* _tmp13_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp10_ = e;
		_tmp11_ = _tmp10_->message;
		g_warning ("binary.vala:65: Error: %s", _tmp11_);
		_tmp12_ = e;
		_tmp13_ = _g_error_copy0 (_tmp12_);
		_inner_error0_ = _tmp13_;
		_g_error_free0 (e);
		goto __finally0;
	}
	__finally0:
	g_propagate_error (error, _inner_error0_);
	return;
}

static void
proton_plus_vdf_binary_get_data (ProtonPlusVDFBinary* self,
                                 ProtonPlusVDFBIN_TYPES type,
                                 GError** error)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	if (self->priv->current_node_index < 0) {
		GError* _tmp0_;
		_tmp0_ = g_error_new (g_quark_from_string ("vala-vdf"), 0, "Not in a node");
		_inner_error0_ = _tmp0_;
		g_propagate_error (error, _inner_error0_);
		return;
	}
	switch (type) {
		case PROTON_PLUS_VDF_BIN_TYPES_BIN_TYPE_STRING:
		case PROTON_PLUS_VDF_BIN_TYPES_BIN_TYPE_WIDESTRING:
		{
			gchar* _tmp1_ = NULL;
			gchar* _tmp2_;
			gchar* _tmp3_ = NULL;
			gchar* _tmp4_;
			ProtonPlusVDFNode** _tmp5_;
			gint _tmp5__length1;
			ProtonPlusVDFNode* _tmp6_;
			GVariant* _tmp7_;
			GVariant* _tmp8_;
			_tmp2_ = proton_plus_vdf_binary_eat_string (self, &_inner_error0_);
			_tmp1_ = _tmp2_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				g_propagate_error (error, _inner_error0_);
				return;
			}
			_tmp4_ = proton_plus_vdf_binary_eat_string (self, &_inner_error0_);
			_tmp3_ = _tmp4_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				g_propagate_error (error, _inner_error0_);
				_g_free0 (_tmp1_);
				return;
			}
			_tmp5_ = self->priv->_nodes;
			_tmp5__length1 = self->priv->_nodes_length1;
			_tmp6_ = _tmp5_[self->priv->current_node_index];
			_tmp7_ = g_variant_new_string (_tmp3_);
			g_variant_ref_sink (_tmp7_);
			_tmp8_ = _tmp7_;
			gee_abstract_map_set ((GeeAbstractMap*) _tmp6_, _tmp1_, _tmp8_);
			_g_variant_unref0 (_tmp8_);
			_g_free0 (_tmp3_);
			_g_free0 (_tmp1_);
			break;
		}
		case PROTON_PLUS_VDF_BIN_TYPES_BIN_TYPE_INT32:
		{
			gchar* _tmp9_ = NULL;
			gchar* _tmp10_;
			gint32 _tmp11_ = 0;
			GDataInputStream* _tmp12_;
			ProtonPlusVDFNode** _tmp13_;
			gint _tmp13__length1;
			ProtonPlusVDFNode* _tmp14_;
			GVariant* _tmp15_;
			GVariant* _tmp16_;
			_tmp10_ = proton_plus_vdf_binary_eat_string (self, &_inner_error0_);
			_tmp9_ = _tmp10_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				g_propagate_error (error, _inner_error0_);
				return;
			}
			_tmp12_ = self->priv->reader;
			_tmp11_ = g_data_input_stream_read_int32 (_tmp12_, NULL, &_inner_error0_);
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				g_propagate_error (error, _inner_error0_);
				_g_free0 (_tmp9_);
				return;
			}
			_tmp13_ = self->priv->_nodes;
			_tmp13__length1 = self->priv->_nodes_length1;
			_tmp14_ = _tmp13_[self->priv->current_node_index];
			_tmp15_ = g_variant_new_int32 (_tmp11_);
			g_variant_ref_sink (_tmp15_);
			_tmp16_ = _tmp15_;
			gee_abstract_map_set ((GeeAbstractMap*) _tmp14_, _tmp9_, _tmp16_);
			_g_variant_unref0 (_tmp16_);
			_g_free0 (_tmp9_);
			break;
		}
		case PROTON_PLUS_VDF_BIN_TYPES_BIN_TYPE_FLOAT32:
		{
			GError* _tmp17_;
			_tmp17_ = g_error_new (g_quark_from_string ("vala-vdf"), 0, "Floats not supported yet");
			_inner_error0_ = _tmp17_;
			g_propagate_error (error, _inner_error0_);
			return;
		}
		case PROTON_PLUS_VDF_BIN_TYPES_BIN_TYPE_POINTER:
		{
			GError* _tmp18_;
			_tmp18_ = g_error_new (g_quark_from_string ("vala-vdf"), 0, "Pointers not supported yet");
			_inner_error0_ = _tmp18_;
			g_propagate_error (error, _inner_error0_);
			return;
		}
		case PROTON_PLUS_VDF_BIN_TYPES_BIN_TYPE_COLOR:
		{
			GError* _tmp19_;
			_tmp19_ = g_error_new (g_quark_from_string ("vala-vdf"), 0, "Colors not supported yet");
			_inner_error0_ = _tmp19_;
			g_propagate_error (error, _inner_error0_);
			return;
		}
		case PROTON_PLUS_VDF_BIN_TYPES_BIN_TYPE_UINT64:
		{
			gchar* _tmp20_ = NULL;
			gchar* _tmp21_;
			guint64 _tmp22_ = 0ULL;
			GDataInputStream* _tmp23_;
			ProtonPlusVDFNode** _tmp24_;
			gint _tmp24__length1;
			ProtonPlusVDFNode* _tmp25_;
			GVariant* _tmp26_;
			GVariant* _tmp27_;
			_tmp21_ = proton_plus_vdf_binary_eat_string (self, &_inner_error0_);
			_tmp20_ = _tmp21_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				g_propagate_error (error, _inner_error0_);
				return;
			}
			_tmp23_ = self->priv->reader;
			_tmp22_ = g_data_input_stream_read_uint64 (_tmp23_, NULL, &_inner_error0_);
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				g_propagate_error (error, _inner_error0_);
				_g_free0 (_tmp20_);
				return;
			}
			_tmp24_ = self->priv->_nodes;
			_tmp24__length1 = self->priv->_nodes_length1;
			_tmp25_ = _tmp24_[self->priv->current_node_index];
			_tmp26_ = g_variant_new_uint64 (_tmp22_);
			g_variant_ref_sink (_tmp26_);
			_tmp27_ = _tmp26_;
			gee_abstract_map_set ((GeeAbstractMap*) _tmp25_, _tmp20_, _tmp27_);
			_g_variant_unref0 (_tmp27_);
			_g_free0 (_tmp20_);
			break;
		}
		case PROTON_PLUS_VDF_BIN_TYPES_BIN_TYPE_INT64:
		{
			gchar* _tmp28_ = NULL;
			gchar* _tmp29_;
			gint64 _tmp30_ = 0LL;
			GDataInputStream* _tmp31_;
			ProtonPlusVDFNode** _tmp32_;
			gint _tmp32__length1;
			ProtonPlusVDFNode* _tmp33_;
			GVariant* _tmp34_;
			GVariant* _tmp35_;
			_tmp29_ = proton_plus_vdf_binary_eat_string (self, &_inner_error0_);
			_tmp28_ = _tmp29_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				g_propagate_error (error, _inner_error0_);
				return;
			}
			_tmp31_ = self->priv->reader;
			_tmp30_ = g_data_input_stream_read_int64 (_tmp31_, NULL, &_inner_error0_);
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				g_propagate_error (error, _inner_error0_);
				_g_free0 (_tmp28_);
				return;
			}
			_tmp32_ = self->priv->_nodes;
			_tmp32__length1 = self->priv->_nodes_length1;
			_tmp33_ = _tmp32_[self->priv->current_node_index];
			_tmp34_ = g_variant_new_int64 (_tmp30_);
			g_variant_ref_sink (_tmp34_);
			_tmp35_ = _tmp34_;
			gee_abstract_map_set ((GeeAbstractMap*) _tmp33_, _tmp28_, _tmp35_);
			_g_variant_unref0 (_tmp35_);
			_g_free0 (_tmp28_);
			break;
		}
		default:
		{
			GError* _tmp36_;
			_tmp36_ = g_error_new (g_quark_from_string ("vala-vdf"), 0, "Unexpected byte");
			_inner_error0_ = _tmp36_;
			g_propagate_error (error, _inner_error0_);
			return;
		}
	}
}

static gchar
string_get (const gchar* self,
            glong index)
{
	gchar _tmp0_;
	gchar result;
	g_return_val_if_fail (self != NULL, '\0');
	_tmp0_ = ((gchar*) self)[index];
	result = _tmp0_;
	return result;
}

static guint
proton_plus_vdf_binary_count_dots (ProtonPlusVDFBinary* self,
                                   const gchar* str)
{
	guint ret = 0U;
	guint result;
	g_return_val_if_fail (self != NULL, 0U);
	g_return_val_if_fail (str != NULL, 0U);
	ret = (guint) 0;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp0_ = FALSE;
			_tmp0_ = TRUE;
			while (TRUE) {
				gint _tmp2_;
				gint _tmp3_;
				if (!_tmp0_) {
					gint _tmp1_;
					_tmp1_ = i;
					i = _tmp1_ + 1;
				}
				_tmp0_ = FALSE;
				_tmp2_ = strlen (str);
				_tmp3_ = _tmp2_;
				if (!(i < _tmp3_)) {
					break;
				}
				if (string_get (str, (glong) i) == '.') {
					guint _tmp4_;
					_tmp4_ = ret;
					ret = _tmp4_ + 1;
				}
			}
		}
	}
	result = ret;
	return result;
}

static gpointer
_g_object_ref0 (gpointer self)
{
	return self ? g_object_ref (self) : NULL;
}

static gboolean
string_contains (const gchar* self,
                 const gchar* needle)
{
	gchar* _tmp0_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (needle != NULL, FALSE);
	_tmp0_ = strstr ((gchar*) self, (gchar*) needle);
	result = _tmp0_ != NULL;
	return result;
}

static void
proton_plus_vdf_binary_save_node (ProtonPlusVDFBinary* self,
                                  const gchar* node_name,
                                  guint layer,
                                  gchar** _nodes,
                                  gint _nodes_length1,
                                  GError** error)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (node_name != NULL);
	{
		GDataOutputStream* _tmp0_;
		gchar** splitted_name = NULL;
		gchar** _tmp1_;
		gchar** _tmp2_;
		gint splitted_name_length1;
		gint _splitted_name_size_;
		GDataOutputStream* _tmp3_;
		gchar** _tmp4_;
		gint _tmp4__length1;
		gchar** _tmp5_;
		gint _tmp5__length1;
		const gchar* _tmp6_;
		GDataOutputStream* _tmp7_;
		ProtonPlusVDFNode* node = NULL;
		GeeTreeMap* _tmp8_;
		gpointer _tmp9_;
		ProtonPlusVDFNode* _tmp10_;
		GDataOutputStream* _tmp82_;
		_tmp0_ = self->priv->writer;
		g_data_output_stream_put_byte (_tmp0_, (guint8) PROTON_PLUS_VDF_BIN_TYPES_BIN_TYPE_NODE, NULL, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp2_ = _tmp1_ = g_strsplit (node_name, ".", 0);
		splitted_name = _tmp2_;
		splitted_name_length1 = _vala_array_length (_tmp1_);
		_splitted_name_size_ = splitted_name_length1;
		_tmp3_ = self->priv->writer;
		_tmp4_ = splitted_name;
		_tmp4__length1 = splitted_name_length1;
		_tmp5_ = splitted_name;
		_tmp5__length1 = splitted_name_length1;
		_tmp6_ = _tmp4_[_tmp5__length1 - 1];
		g_data_output_stream_put_string (_tmp3_, _tmp6_, NULL, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			splitted_name = (_vala_array_free (splitted_name, splitted_name_length1, (GDestroyNotify) g_free), NULL);
			goto __catch0_g_error;
		}
		_tmp7_ = self->priv->writer;
		g_data_output_stream_put_byte (_tmp7_, (guint8) '\0', NULL, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			splitted_name = (_vala_array_free (splitted_name, splitted_name_length1, (GDestroyNotify) g_free), NULL);
			goto __catch0_g_error;
		}
		_tmp8_ = self->nodes;
		_tmp9_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp8_, node_name);
		_tmp10_ = _g_object_ref0 ((ProtonPlusVDFNode*) _tmp9_);
		node = _tmp10_;
		{
			GeeIterator* _elem_it = NULL;
			ProtonPlusVDFNode* _tmp11_;
			GeeSet* _tmp12_;
			GeeSet* _tmp13_;
			GeeSet* _tmp14_;
			GeeIterator* _tmp15_;
			GeeIterator* _tmp16_;
			_tmp11_ = node;
			_tmp12_ = gee_abstract_map_get_entries ((GeeAbstractMap*) _tmp11_);
			_tmp13_ = _tmp12_;
			_tmp14_ = _tmp13_;
			_tmp15_ = gee_iterable_iterator ((GeeIterable*) _tmp14_);
			_tmp16_ = _tmp15_;
			_g_object_unref0 (_tmp14_);
			_elem_it = _tmp16_;
			while (TRUE) {
				GeeIterator* _tmp17_;
				GeeMapEntry* elem = NULL;
				GeeIterator* _tmp18_;
				gpointer _tmp19_;
				GeeMapEntry* _tmp20_;
				gconstpointer _tmp21_;
				gconstpointer _tmp22_;
				const GVariantType* _tmp23_;
				_tmp17_ = _elem_it;
				if (!gee_iterator_next (_tmp17_)) {
					break;
				}
				_tmp18_ = _elem_it;
				_tmp19_ = gee_iterator_get (_tmp18_);
				elem = (GeeMapEntry*) _tmp19_;
				_tmp20_ = elem;
				_tmp21_ = gee_map_entry_get_value (_tmp20_);
				_tmp22_ = _tmp21_;
				_tmp23_ = G_VARIANT_TYPE_STRING;
				if (g_variant_is_of_type ((GVariant*) _tmp22_, _tmp23_)) {
					GDataOutputStream* _tmp24_;
					GDataOutputStream* _tmp25_;
					GeeMapEntry* _tmp26_;
					gconstpointer _tmp27_;
					gconstpointer _tmp28_;
					GDataOutputStream* _tmp29_;
					GDataOutputStream* _tmp30_;
					GeeMapEntry* _tmp31_;
					gconstpointer _tmp32_;
					gconstpointer _tmp33_;
					const gchar* _tmp34_;
					GDataOutputStream* _tmp35_;
					_tmp24_ = self->priv->writer;
					g_data_output_stream_put_byte (_tmp24_, (guint8) PROTON_PLUS_VDF_BIN_TYPES_BIN_TYPE_STRING, NULL, &_inner_error0_);
					if (G_UNLIKELY (_inner_error0_ != NULL)) {
						_g_object_unref0 (elem);
						_g_object_unref0 (_elem_it);
						_g_object_unref0 (node);
						splitted_name = (_vala_array_free (splitted_name, splitted_name_length1, (GDestroyNotify) g_free), NULL);
						goto __catch0_g_error;
					}
					_tmp25_ = self->priv->writer;
					_tmp26_ = elem;
					_tmp27_ = gee_map_entry_get_key (_tmp26_);
					_tmp28_ = _tmp27_;
					g_data_output_stream_put_string (_tmp25_, (const gchar*) _tmp28_, NULL, &_inner_error0_);
					if (G_UNLIKELY (_inner_error0_ != NULL)) {
						_g_object_unref0 (elem);
						_g_object_unref0 (_elem_it);
						_g_object_unref0 (node);
						splitted_name = (_vala_array_free (splitted_name, splitted_name_length1, (GDestroyNotify) g_free), NULL);
						goto __catch0_g_error;
					}
					_tmp29_ = self->priv->writer;
					g_data_output_stream_put_byte (_tmp29_, (guint8) '\0', NULL, &_inner_error0_);
					if (G_UNLIKELY (_inner_error0_ != NULL)) {
						_g_object_unref0 (elem);
						_g_object_unref0 (_elem_it);
						_g_object_unref0 (node);
						splitted_name = (_vala_array_free (splitted_name, splitted_name_length1, (GDestroyNotify) g_free), NULL);
						goto __catch0_g_error;
					}
					_tmp30_ = self->priv->writer;
					_tmp31_ = elem;
					_tmp32_ = gee_map_entry_get_value (_tmp31_);
					_tmp33_ = _tmp32_;
					_tmp34_ = g_variant_get_string ((GVariant*) _tmp33_, NULL);
					g_data_output_stream_put_string (_tmp30_, _tmp34_, NULL, &_inner_error0_);
					if (G_UNLIKELY (_inner_error0_ != NULL)) {
						_g_object_unref0 (elem);
						_g_object_unref0 (_elem_it);
						_g_object_unref0 (node);
						splitted_name = (_vala_array_free (splitted_name, splitted_name_length1, (GDestroyNotify) g_free), NULL);
						goto __catch0_g_error;
					}
					_tmp35_ = self->priv->writer;
					g_data_output_stream_put_byte (_tmp35_, (guint8) '\0', NULL, &_inner_error0_);
					if (G_UNLIKELY (_inner_error0_ != NULL)) {
						_g_object_unref0 (elem);
						_g_object_unref0 (_elem_it);
						_g_object_unref0 (node);
						splitted_name = (_vala_array_free (splitted_name, splitted_name_length1, (GDestroyNotify) g_free), NULL);
						goto __catch0_g_error;
					}
				} else {
					GeeMapEntry* _tmp36_;
					gconstpointer _tmp37_;
					gconstpointer _tmp38_;
					const GVariantType* _tmp39_;
					_tmp36_ = elem;
					_tmp37_ = gee_map_entry_get_value (_tmp36_);
					_tmp38_ = _tmp37_;
					_tmp39_ = G_VARIANT_TYPE_UINT64;
					if (g_variant_is_of_type ((GVariant*) _tmp38_, _tmp39_)) {
						GDataOutputStream* _tmp40_;
						GDataOutputStream* _tmp41_;
						GeeMapEntry* _tmp42_;
						gconstpointer _tmp43_;
						gconstpointer _tmp44_;
						GDataOutputStream* _tmp45_;
						GDataOutputStream* _tmp46_;
						GeeMapEntry* _tmp47_;
						gconstpointer _tmp48_;
						gconstpointer _tmp49_;
						_tmp40_ = self->priv->writer;
						g_data_output_stream_put_byte (_tmp40_, (guint8) PROTON_PLUS_VDF_BIN_TYPES_BIN_TYPE_UINT64, NULL, &_inner_error0_);
						if (G_UNLIKELY (_inner_error0_ != NULL)) {
							_g_object_unref0 (elem);
							_g_object_unref0 (_elem_it);
							_g_object_unref0 (node);
							splitted_name = (_vala_array_free (splitted_name, splitted_name_length1, (GDestroyNotify) g_free), NULL);
							goto __catch0_g_error;
						}
						_tmp41_ = self->priv->writer;
						_tmp42_ = elem;
						_tmp43_ = gee_map_entry_get_key (_tmp42_);
						_tmp44_ = _tmp43_;
						g_data_output_stream_put_string (_tmp41_, (const gchar*) _tmp44_, NULL, &_inner_error0_);
						if (G_UNLIKELY (_inner_error0_ != NULL)) {
							_g_object_unref0 (elem);
							_g_object_unref0 (_elem_it);
							_g_object_unref0 (node);
							splitted_name = (_vala_array_free (splitted_name, splitted_name_length1, (GDestroyNotify) g_free), NULL);
							goto __catch0_g_error;
						}
						_tmp45_ = self->priv->writer;
						g_data_output_stream_put_byte (_tmp45_, (guint8) '\0', NULL, &_inner_error0_);
						if (G_UNLIKELY (_inner_error0_ != NULL)) {
							_g_object_unref0 (elem);
							_g_object_unref0 (_elem_it);
							_g_object_unref0 (node);
							splitted_name = (_vala_array_free (splitted_name, splitted_name_length1, (GDestroyNotify) g_free), NULL);
							goto __catch0_g_error;
						}
						_tmp46_ = self->priv->writer;
						_tmp47_ = elem;
						_tmp48_ = gee_map_entry_get_value (_tmp47_);
						_tmp49_ = _tmp48_;
						g_data_output_stream_put_uint64 (_tmp46_, g_variant_get_uint64 ((GVariant*) _tmp49_), NULL, &_inner_error0_);
						if (G_UNLIKELY (_inner_error0_ != NULL)) {
							_g_object_unref0 (elem);
							_g_object_unref0 (_elem_it);
							_g_object_unref0 (node);
							splitted_name = (_vala_array_free (splitted_name, splitted_name_length1, (GDestroyNotify) g_free), NULL);
							goto __catch0_g_error;
						}
					} else {
						GeeMapEntry* _tmp50_;
						gconstpointer _tmp51_;
						gconstpointer _tmp52_;
						const GVariantType* _tmp53_;
						_tmp50_ = elem;
						_tmp51_ = gee_map_entry_get_value (_tmp50_);
						_tmp52_ = _tmp51_;
						_tmp53_ = G_VARIANT_TYPE_INT64;
						if (g_variant_is_of_type ((GVariant*) _tmp52_, _tmp53_)) {
							GDataOutputStream* _tmp54_;
							GDataOutputStream* _tmp55_;
							GeeMapEntry* _tmp56_;
							gconstpointer _tmp57_;
							gconstpointer _tmp58_;
							GDataOutputStream* _tmp59_;
							GDataOutputStream* _tmp60_;
							GeeMapEntry* _tmp61_;
							gconstpointer _tmp62_;
							gconstpointer _tmp63_;
							_tmp54_ = self->priv->writer;
							g_data_output_stream_put_byte (_tmp54_, (guint8) PROTON_PLUS_VDF_BIN_TYPES_BIN_TYPE_INT64, NULL, &_inner_error0_);
							if (G_UNLIKELY (_inner_error0_ != NULL)) {
								_g_object_unref0 (elem);
								_g_object_unref0 (_elem_it);
								_g_object_unref0 (node);
								splitted_name = (_vala_array_free (splitted_name, splitted_name_length1, (GDestroyNotify) g_free), NULL);
								goto __catch0_g_error;
							}
							_tmp55_ = self->priv->writer;
							_tmp56_ = elem;
							_tmp57_ = gee_map_entry_get_key (_tmp56_);
							_tmp58_ = _tmp57_;
							g_data_output_stream_put_string (_tmp55_, (const gchar*) _tmp58_, NULL, &_inner_error0_);
							if (G_UNLIKELY (_inner_error0_ != NULL)) {
								_g_object_unref0 (elem);
								_g_object_unref0 (_elem_it);
								_g_object_unref0 (node);
								splitted_name = (_vala_array_free (splitted_name, splitted_name_length1, (GDestroyNotify) g_free), NULL);
								goto __catch0_g_error;
							}
							_tmp59_ = self->priv->writer;
							g_data_output_stream_put_byte (_tmp59_, (guint8) '\0', NULL, &_inner_error0_);
							if (G_UNLIKELY (_inner_error0_ != NULL)) {
								_g_object_unref0 (elem);
								_g_object_unref0 (_elem_it);
								_g_object_unref0 (node);
								splitted_name = (_vala_array_free (splitted_name, splitted_name_length1, (GDestroyNotify) g_free), NULL);
								goto __catch0_g_error;
							}
							_tmp60_ = self->priv->writer;
							_tmp61_ = elem;
							_tmp62_ = gee_map_entry_get_value (_tmp61_);
							_tmp63_ = _tmp62_;
							g_data_output_stream_put_int64 (_tmp60_, g_variant_get_int64 ((GVariant*) _tmp63_), NULL, &_inner_error0_);
							if (G_UNLIKELY (_inner_error0_ != NULL)) {
								_g_object_unref0 (elem);
								_g_object_unref0 (_elem_it);
								_g_object_unref0 (node);
								splitted_name = (_vala_array_free (splitted_name, splitted_name_length1, (GDestroyNotify) g_free), NULL);
								goto __catch0_g_error;
							}
						} else {
							GeeMapEntry* _tmp64_;
							gconstpointer _tmp65_;
							gconstpointer _tmp66_;
							const GVariantType* _tmp67_;
							_tmp64_ = elem;
							_tmp65_ = gee_map_entry_get_value (_tmp64_);
							_tmp66_ = _tmp65_;
							_tmp67_ = G_VARIANT_TYPE_INT32;
							if (g_variant_is_of_type ((GVariant*) _tmp66_, _tmp67_)) {
								GDataOutputStream* _tmp68_;
								GDataOutputStream* _tmp69_;
								GeeMapEntry* _tmp70_;
								gconstpointer _tmp71_;
								gconstpointer _tmp72_;
								GDataOutputStream* _tmp73_;
								GDataOutputStream* _tmp74_;
								GeeMapEntry* _tmp75_;
								gconstpointer _tmp76_;
								gconstpointer _tmp77_;
								_tmp68_ = self->priv->writer;
								g_data_output_stream_put_byte (_tmp68_, (guint8) PROTON_PLUS_VDF_BIN_TYPES_BIN_TYPE_INT32, NULL, &_inner_error0_);
								if (G_UNLIKELY (_inner_error0_ != NULL)) {
									_g_object_unref0 (elem);
									_g_object_unref0 (_elem_it);
									_g_object_unref0 (node);
									splitted_name = (_vala_array_free (splitted_name, splitted_name_length1, (GDestroyNotify) g_free), NULL);
									goto __catch0_g_error;
								}
								_tmp69_ = self->priv->writer;
								_tmp70_ = elem;
								_tmp71_ = gee_map_entry_get_key (_tmp70_);
								_tmp72_ = _tmp71_;
								g_data_output_stream_put_string (_tmp69_, (const gchar*) _tmp72_, NULL, &_inner_error0_);
								if (G_UNLIKELY (_inner_error0_ != NULL)) {
									_g_object_unref0 (elem);
									_g_object_unref0 (_elem_it);
									_g_object_unref0 (node);
									splitted_name = (_vala_array_free (splitted_name, splitted_name_length1, (GDestroyNotify) g_free), NULL);
									goto __catch0_g_error;
								}
								_tmp73_ = self->priv->writer;
								g_data_output_stream_put_byte (_tmp73_, (guint8) '\0', NULL, &_inner_error0_);
								if (G_UNLIKELY (_inner_error0_ != NULL)) {
									_g_object_unref0 (elem);
									_g_object_unref0 (_elem_it);
									_g_object_unref0 (node);
									splitted_name = (_vala_array_free (splitted_name, splitted_name_length1, (GDestroyNotify) g_free), NULL);
									goto __catch0_g_error;
								}
								_tmp74_ = self->priv->writer;
								_tmp75_ = elem;
								_tmp76_ = gee_map_entry_get_value (_tmp75_);
								_tmp77_ = _tmp76_;
								g_data_output_stream_put_int32 (_tmp74_, g_variant_get_int32 ((GVariant*) _tmp77_), NULL, &_inner_error0_);
								if (G_UNLIKELY (_inner_error0_ != NULL)) {
									_g_object_unref0 (elem);
									_g_object_unref0 (_elem_it);
									_g_object_unref0 (node);
									splitted_name = (_vala_array_free (splitted_name, splitted_name_length1, (GDestroyNotify) g_free), NULL);
									goto __catch0_g_error;
								}
							}
						}
					}
				}
				_g_object_unref0 (elem);
			}
			_g_object_unref0 (_elem_it);
		}
		{
			gchar** node_i_collection = NULL;
			gint node_i_collection_length1 = 0;
			gint _node_i_collection_size_ = 0;
			gint node_i_it = 0;
			node_i_collection = _nodes;
			node_i_collection_length1 = _nodes_length1;
			for (node_i_it = 0; node_i_it < node_i_collection_length1; node_i_it = node_i_it + 1) {
				gchar* _tmp78_;
				gchar* node_i = NULL;
				_tmp78_ = g_strdup (node_i_collection[node_i_it]);
				node_i = _tmp78_;
				{
					const gchar* _tmp79_;
					_tmp79_ = node_i;
					if (string_contains (_tmp79_, node_name)) {
						const gchar* _tmp80_;
						_tmp80_ = node_i;
						if (proton_plus_vdf_binary_count_dots (self, _tmp80_) == (layer + 1)) {
							const gchar* _tmp81_;
							_tmp81_ = node_i;
							proton_plus_vdf_binary_save_node (self, _tmp81_, layer + 1, _nodes, (gint) _nodes_length1, &_inner_error0_);
							if (G_UNLIKELY (_inner_error0_ != NULL)) {
								_g_free0 (node_i);
								_g_object_unref0 (node);
								splitted_name = (_vala_array_free (splitted_name, splitted_name_length1, (GDestroyNotify) g_free), NULL);
								goto __catch0_g_error;
							}
						}
					}
					_g_free0 (node_i);
				}
			}
		}
		_tmp82_ = self->priv->writer;
		g_data_output_stream_put_byte (_tmp82_, (guint8) PROTON_PLUS_VDF_BIN_TYPES_BIN_TYPE_END, NULL, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_object_unref0 (node);
			splitted_name = (_vala_array_free (splitted_name, splitted_name_length1, (GDestroyNotify) g_free), NULL);
			goto __catch0_g_error;
		}
		_g_object_unref0 (node);
		splitted_name = (_vala_array_free (splitted_name, splitted_name_length1, (GDestroyNotify) g_free), NULL);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp83_;
		GError* _tmp84_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp83_ = e;
		_tmp84_ = _g_error_copy0 (_tmp83_);
		_inner_error0_ = _tmp84_;
		_g_error_free0 (e);
		goto __finally0;
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		return;
	}
}

static void
_vala_array_add2 (gchar** * array,
                  gint* length,
                  gint* size,
                  gchar* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gchar*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

void
proton_plus_vdf_binary_save (ProtonPlusVDFBinary* self,
                             GError** error)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	{
		GFileOutputStream* output_stream = NULL;
		GFile* _tmp0_;
		GFileOutputStream* _tmp1_;
		GFileOutputStream* _tmp2_;
		GDataOutputStream* _tmp3_;
		GDataOutputStream* _tmp4_;
		gchar** keys = NULL;
		GeeTreeMap* _tmp5_;
		GeeSet* _tmp6_;
		GeeSet* _tmp7_;
		GeeSet* _tmp8_;
		gint _tmp9_ = 0;
		gpointer* _tmp10_;
		gchar** _tmp11_;
		gint _tmp11__length1;
		gint keys_length1;
		gint _keys_size_;
		gchar** root_nodes = NULL;
		gchar** _tmp12_;
		gint root_nodes_length1;
		gint _root_nodes_size_;
		gchar** _tmp13_;
		gint _tmp13__length1;
		gchar** _tmp18_;
		gint _tmp18__length1;
		GDataOutputStream* _tmp22_;
		GFileOutputStream* _tmp23_;
		GFileOutputStream* _tmp24_;
		_tmp0_ = self->priv->file;
		_tmp1_ = g_file_replace (_tmp0_, NULL, FALSE, G_FILE_CREATE_PRIVATE, NULL, &_inner_error0_);
		output_stream = _tmp1_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp2_ = output_stream;
		_tmp3_ = g_data_output_stream_new ((GOutputStream*) _tmp2_);
		_g_object_unref0 (self->priv->writer);
		self->priv->writer = _tmp3_;
		_tmp4_ = self->priv->writer;
		g_data_output_stream_set_byte_order (_tmp4_, G_DATA_STREAM_BYTE_ORDER_LITTLE_ENDIAN);
		_tmp5_ = self->nodes;
		_tmp6_ = gee_abstract_map_get_keys ((GeeAbstractMap*) _tmp5_);
		_tmp7_ = _tmp6_;
		_tmp8_ = _tmp7_;
		_tmp10_ = gee_collection_to_array ((GeeCollection*) _tmp8_, &_tmp9_);
		_tmp11_ = _tmp10_;
		_tmp11__length1 = _tmp9_;
		_g_object_unref0 (_tmp8_);
		keys = _tmp11_;
		keys_length1 = _tmp11__length1;
		_keys_size_ = keys_length1;
		_tmp12_ = g_new0 (gchar*, 0 + 1);
		root_nodes = _tmp12_;
		root_nodes_length1 = 0;
		_root_nodes_size_ = root_nodes_length1;
		_tmp13_ = keys;
		_tmp13__length1 = keys_length1;
		{
			gchar** elem_collection = NULL;
			gint elem_collection_length1 = 0;
			gint _elem_collection_size_ = 0;
			gint elem_it = 0;
			elem_collection = _tmp13_;
			elem_collection_length1 = _tmp13__length1;
			for (elem_it = 0; elem_it < elem_collection_length1; elem_it = elem_it + 1) {
				gchar* _tmp14_;
				gchar* elem = NULL;
				_tmp14_ = g_strdup (elem_collection[elem_it]);
				elem = _tmp14_;
				{
					const gchar* _tmp15_;
					_tmp15_ = elem;
					if (!string_contains (_tmp15_, ".")) {
						const gchar* _tmp16_;
						gchar* _tmp17_;
						_tmp16_ = elem;
						_tmp17_ = g_strdup (_tmp16_);
						_vala_array_add2 (&root_nodes, &root_nodes_length1, &_root_nodes_size_, _tmp17_);
					}
					_g_free0 (elem);
				}
			}
		}
		_tmp18_ = root_nodes;
		_tmp18__length1 = root_nodes_length1;
		{
			gchar** rn_collection = NULL;
			gint rn_collection_length1 = 0;
			gint _rn_collection_size_ = 0;
			gint rn_it = 0;
			rn_collection = _tmp18_;
			rn_collection_length1 = _tmp18__length1;
			for (rn_it = 0; rn_it < rn_collection_length1; rn_it = rn_it + 1) {
				gchar* _tmp19_;
				gchar* rn = NULL;
				_tmp19_ = g_strdup (rn_collection[rn_it]);
				rn = _tmp19_;
				{
					const gchar* _tmp20_;
					gchar** _tmp21_;
					gint _tmp21__length1;
					_tmp20_ = rn;
					_tmp21_ = keys;
					_tmp21__length1 = keys_length1;
					proton_plus_vdf_binary_save_node (self, _tmp20_, (guint) 0, _tmp21_, (gint) _tmp21__length1, &_inner_error0_);
					if (G_UNLIKELY (_inner_error0_ != NULL)) {
						_g_free0 (rn);
						root_nodes = (_vala_array_free (root_nodes, root_nodes_length1, (GDestroyNotify) g_free), NULL);
						keys = (_vala_array_free (keys, keys_length1, (GDestroyNotify) g_free), NULL);
						_g_object_unref0 (output_stream);
						goto __catch0_g_error;
					}
					_g_free0 (rn);
				}
			}
		}
		_tmp22_ = self->priv->writer;
		g_data_output_stream_put_byte (_tmp22_, (guint8) PROTON_PLUS_VDF_BIN_TYPES_BIN_TYPE_END, NULL, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			root_nodes = (_vala_array_free (root_nodes, root_nodes_length1, (GDestroyNotify) g_free), NULL);
			keys = (_vala_array_free (keys, keys_length1, (GDestroyNotify) g_free), NULL);
			_g_object_unref0 (output_stream);
			goto __catch0_g_error;
		}
		_tmp23_ = output_stream;
		g_output_stream_flush ((GOutputStream*) _tmp23_, NULL, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			root_nodes = (_vala_array_free (root_nodes, root_nodes_length1, (GDestroyNotify) g_free), NULL);
			keys = (_vala_array_free (keys, keys_length1, (GDestroyNotify) g_free), NULL);
			_g_object_unref0 (output_stream);
			goto __catch0_g_error;
		}
		_tmp24_ = output_stream;
		g_output_stream_close ((GOutputStream*) _tmp24_, NULL, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			root_nodes = (_vala_array_free (root_nodes, root_nodes_length1, (GDestroyNotify) g_free), NULL);
			keys = (_vala_array_free (keys, keys_length1, (GDestroyNotify) g_free), NULL);
			_g_object_unref0 (output_stream);
			goto __catch0_g_error;
		}
		root_nodes = (_vala_array_free (root_nodes, root_nodes_length1, (GDestroyNotify) g_free), NULL);
		keys = (_vala_array_free (keys, keys_length1, (GDestroyNotify) g_free), NULL);
		_g_object_unref0 (output_stream);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp25_;
		GError* _tmp26_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp25_ = e;
		_tmp26_ = _g_error_copy0 (_tmp25_);
		_inner_error0_ = _tmp26_;
		_g_error_free0 (e);
		goto __finally0;
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		return;
	}
}

ProtonPlusVDFBinary*
proton_plus_vdf_binary_construct (GType object_type,
                                  const gchar* path)
{
	ProtonPlusVDFBinary* self = NULL;
	GError* _inner_error0_ = NULL;
	g_return_val_if_fail (path != NULL, NULL);
	self = (ProtonPlusVDFBinary*) g_type_create_instance (object_type);
	{
		GFile* _tmp0_;
		GFileInputStream* _tmp1_ = NULL;
		GFile* _tmp2_;
		GFileInputStream* _tmp3_;
		GFileInputStream* _tmp4_;
		GInputStream* _tmp5_;
		GDataInputStream* _tmp6_;
		GDataInputStream* _tmp7_;
		GeeTreeMap* _tmp8_;
		_tmp0_ = g_file_new_for_path (path);
		_g_object_unref0 (self->priv->file);
		self->priv->file = _tmp0_;
		_tmp2_ = self->priv->file;
		_tmp3_ = g_file_read (_tmp2_, NULL, &_inner_error0_);
		_tmp1_ = _tmp3_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp4_ = _tmp1_;
		_tmp1_ = NULL;
		_g_object_unref0 (self->priv->input_stream);
		self->priv->input_stream = (GInputStream*) _tmp4_;
		_tmp5_ = self->priv->input_stream;
		_tmp6_ = g_data_input_stream_new (_tmp5_);
		_g_object_unref0 (self->priv->reader);
		self->priv->reader = _tmp6_;
		self->priv->current_node_index = -1;
		_tmp7_ = self->priv->reader;
		g_data_input_stream_set_byte_order (_tmp7_, G_DATA_STREAM_BYTE_ORDER_LITTLE_ENDIAN);
		_tmp8_ = gee_tree_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, PROTON_PLUS_VDF_TYPE_NODE, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
		_g_object_unref0 (self->nodes);
		self->nodes = _tmp8_;
		while (TRUE) {
			guint8 type = 0U;
			GDataInputStream* _tmp9_;
			_tmp9_ = self->priv->reader;
			type = g_data_input_stream_read_byte (_tmp9_, NULL, &_inner_error0_);
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				_g_object_unref0 (_tmp1_);
				goto __catch0_g_error;
			}
			switch (type) {
				case PROTON_PLUS_VDF_BIN_TYPES_BIN_TYPE_NODE:
				{
					gchar* _tmp10_ = NULL;
					gchar* _tmp11_;
					_tmp11_ = proton_plus_vdf_binary_eat_string (self, &_inner_error0_);
					_tmp10_ = _tmp11_;
					if (G_UNLIKELY (_inner_error0_ != NULL)) {
						_g_object_unref0 (_tmp1_);
						goto __catch0_g_error;
					}
					proton_plus_vdf_binary_parse_node (self, _tmp10_, &_inner_error0_);
					if (G_UNLIKELY (_inner_error0_ != NULL)) {
						_g_free0 (_tmp10_);
						_g_object_unref0 (_tmp1_);
						goto __catch0_g_error;
					}
					_g_free0 (_tmp10_);
					break;
				}
				case PROTON_PLUS_VDF_BIN_TYPES_BIN_TYPE_END:
				case PROTON_PLUS_VDF_BIN_TYPES_BIN_TYPE_END_ALT:
				{
					ProtonPlusVDFNode** _tmp12_;
					gint _tmp12__length1;
					GInputStream* _tmp18_;
					_tmp12_ = self->priv->_nodes;
					_tmp12__length1 = self->priv->_nodes_length1;
					{
						ProtonPlusVDFNode** node_collection = NULL;
						gint node_collection_length1 = 0;
						gint _node_collection_size_ = 0;
						gint node_it = 0;
						node_collection = _tmp12_;
						node_collection_length1 = _tmp12__length1;
						for (node_it = 0; node_it < node_collection_length1; node_it = node_it + 1) {
							ProtonPlusVDFNode* _tmp13_;
							ProtonPlusVDFNode* node = NULL;
							_tmp13_ = _g_object_ref0 (node_collection[node_it]);
							node = _tmp13_;
							{
								GeeTreeMap* _tmp14_;
								ProtonPlusVDFNode* _tmp15_;
								const gchar* _tmp16_;
								ProtonPlusVDFNode* _tmp17_;
								_tmp14_ = self->nodes;
								_tmp15_ = node;
								_tmp16_ = _tmp15_->node_name;
								_tmp17_ = node;
								gee_abstract_map_set ((GeeAbstractMap*) _tmp14_, _tmp16_, _tmp17_);
								_g_object_unref0 (node);
							}
						}
					}
					_tmp18_ = self->priv->input_stream;
					g_input_stream_close (_tmp18_, NULL, &_inner_error0_);
					if (G_UNLIKELY (_inner_error0_ != NULL)) {
						_g_object_unref0 (_tmp1_);
						goto __catch0_g_error;
					}
					_g_object_unref0 (_tmp1_);
					return self;
				}
				default:
				{
					GError* _tmp19_;
					_tmp19_ = g_error_new (g_quark_from_string ("vala-vdf"), 0, "Unexpected byte");
					_inner_error0_ = _tmp19_;
					_g_object_unref0 (_tmp1_);
					goto __catch0_g_error;
				}
			}
		}
		_g_object_unref0 (_tmp1_);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp20_;
		const gchar* _tmp21_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp20_ = e;
		_tmp21_ = _tmp20_->message;
		g_warning ("binary.vala:210: %s\n", _tmp21_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return NULL;
	}
	return self;
}

ProtonPlusVDFBinary*
proton_plus_vdf_binary_new (const gchar* path)
{
	return proton_plus_vdf_binary_construct (PROTON_PLUS_VDF_TYPE_BINARY, path);
}

static void
proton_plus_vdf_value_binary_init (GValue* value)
{
	value->data[0].v_pointer = NULL;
}

static void
proton_plus_vdf_value_binary_free_value (GValue* value)
{
	if (value->data[0].v_pointer) {
		proton_plus_vdf_binary_unref (value->data[0].v_pointer);
	}
}

static void
proton_plus_vdf_value_binary_copy_value (const GValue* src_value,
                                         GValue* dest_value)
{
	if (src_value->data[0].v_pointer) {
		dest_value->data[0].v_pointer = proton_plus_vdf_binary_ref (src_value->data[0].v_pointer);
	} else {
		dest_value->data[0].v_pointer = NULL;
	}
}

static gpointer
proton_plus_vdf_value_binary_peek_pointer (const GValue* value)
{
	return value->data[0].v_pointer;
}

static gchar*
proton_plus_vdf_value_binary_collect_value (GValue* value,
                                            guint n_collect_values,
                                            GTypeCValue* collect_values,
                                            guint collect_flags)
{
	if (collect_values[0].v_pointer) {
		ProtonPlusVDFBinary * object;
		object = collect_values[0].v_pointer;
		if (object->parent_instance.g_class == NULL) {
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		}
		value->data[0].v_pointer = proton_plus_vdf_binary_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}

static gchar*
proton_plus_vdf_value_binary_lcopy_value (const GValue* value,
                                          guint n_collect_values,
                                          GTypeCValue* collect_values,
                                          guint collect_flags)
{
	ProtonPlusVDFBinary ** object_p;
	object_p = collect_values[0].v_pointer;
	if (!object_p) {
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
	}
	if (!value->data[0].v_pointer) {
		*object_p = NULL;
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
		*object_p = value->data[0].v_pointer;
	} else {
		*object_p = proton_plus_vdf_binary_ref (value->data[0].v_pointer);
	}
	return NULL;
}

GParamSpec*
proton_plus_vdf_param_spec_binary (const gchar* name,
                                   const gchar* nick,
                                   const gchar* blurb,
                                   GType object_type,
                                   GParamFlags flags)
{
	ProtonPlusVDFParamSpecBinary* spec;
	g_return_val_if_fail (g_type_is_a (object_type, PROTON_PLUS_VDF_TYPE_BINARY), NULL);
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
	G_PARAM_SPEC (spec)->value_type = object_type;
	return G_PARAM_SPEC (spec);
}

gpointer
proton_plus_vdf_value_get_binary (const GValue* value)
{
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PROTON_PLUS_VDF_TYPE_BINARY), NULL);
	return value->data[0].v_pointer;
}

void
proton_plus_vdf_value_set_binary (GValue* value,
                                  gpointer v_object)
{
	ProtonPlusVDFBinary * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PROTON_PLUS_VDF_TYPE_BINARY));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, PROTON_PLUS_VDF_TYPE_BINARY));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		proton_plus_vdf_binary_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		proton_plus_vdf_binary_unref (old);
	}
}

void
proton_plus_vdf_value_take_binary (GValue* value,
                                   gpointer v_object)
{
	ProtonPlusVDFBinary * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PROTON_PLUS_VDF_TYPE_BINARY));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, PROTON_PLUS_VDF_TYPE_BINARY));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		proton_plus_vdf_binary_unref (old);
	}
}

static void
proton_plus_vdf_binary_class_init (ProtonPlusVDFBinaryClass * klass,
                                   gpointer klass_data)
{
	proton_plus_vdf_binary_parent_class = g_type_class_peek_parent (klass);
	((ProtonPlusVDFBinaryClass *) klass)->finalize = proton_plus_vdf_binary_finalize;
	g_type_class_adjust_private_offset (klass, &ProtonPlusVDFBinary_private_offset);
}

static void
proton_plus_vdf_binary_instance_init (ProtonPlusVDFBinary * self,
                                      gpointer klass)
{
	self->priv = proton_plus_vdf_binary_get_instance_private (self);
	self->ref_count = 1;
}

static void
proton_plus_vdf_binary_finalize (ProtonPlusVDFBinary * obj)
{
	ProtonPlusVDFBinary * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PROTON_PLUS_VDF_TYPE_BINARY, ProtonPlusVDFBinary);
	g_signal_handlers_destroy (self);
	self->priv->_nodes = (_vala_array_free (self->priv->_nodes, self->priv->_nodes_length1, (GDestroyNotify) g_object_unref), NULL);
	_g_object_unref0 (self->nodes);
	_g_object_unref0 (self->priv->file);
	_g_object_unref0 (self->priv->input_stream);
	_g_object_unref0 (self->priv->reader);
	_g_object_unref0 (self->priv->writer);
}

static GType
proton_plus_vdf_binary_get_type_once (void)
{
	static const GTypeValueTable g_define_type_value_table = { proton_plus_vdf_value_binary_init, proton_plus_vdf_value_binary_free_value, proton_plus_vdf_value_binary_copy_value, proton_plus_vdf_value_binary_peek_pointer, "p", proton_plus_vdf_value_binary_collect_value, "p", proton_plus_vdf_value_binary_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusVDFBinaryClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_vdf_binary_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusVDFBinary), 0, (GInstanceInitFunc) proton_plus_vdf_binary_instance_init, &g_define_type_value_table };
	static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
	GType proton_plus_vdf_binary_type_id;
	proton_plus_vdf_binary_type_id = g_type_register_fundamental (g_type_fundamental_next (), "ProtonPlusVDFBinary", &g_define_type_info, &g_define_type_fundamental_info, 0);
	ProtonPlusVDFBinary_private_offset = g_type_add_instance_private (proton_plus_vdf_binary_type_id, sizeof (ProtonPlusVDFBinaryPrivate));
	return proton_plus_vdf_binary_type_id;
}

GType
proton_plus_vdf_binary_get_type (void)
{
	static volatile gsize proton_plus_vdf_binary_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_vdf_binary_type_id__once)) {
		GType proton_plus_vdf_binary_type_id;
		proton_plus_vdf_binary_type_id = proton_plus_vdf_binary_get_type_once ();
		g_once_init_leave (&proton_plus_vdf_binary_type_id__once, proton_plus_vdf_binary_type_id);
	}
	return proton_plus_vdf_binary_type_id__once;
}

gpointer
proton_plus_vdf_binary_ref (gpointer instance)
{
	ProtonPlusVDFBinary * self;
	self = instance;
	g_atomic_int_inc (&self->ref_count);
	return instance;
}

void
proton_plus_vdf_binary_unref (gpointer instance)
{
	ProtonPlusVDFBinary * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		PROTON_PLUS_VDF_BINARY_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}

static void
_vala_array_free (gpointer array,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

static gssize
_vala_array_length (gpointer array)
{
	gssize length;
	length = 0;
	if (array) {
		while (((gpointer*) array)[length]) {
			length++;
		}
	}
	return length;
}

