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

#include "xmpp-vala.h"
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gee.h>
#include <glib-object.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

#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_date_time_unref0(var) ((var == NULL) ? NULL : (var = (g_date_time_unref (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _xmpp_stanza_entry_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_stanza_entry_unref (var), NULL)))
#define _xmpp_xep_jingle_content_thumbnails_thumbnail_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_xep_jingle_content_thumbnails_thumbnail_unref (var), NULL)))
typedef struct _XmppXepFileMetadataElementParamSpecFileMetadata XmppXepFileMetadataElementParamSpecFileMetadata;

struct _XmppXepFileMetadataElementFileMetadataPrivate {
	gchar* _name;
	gchar* _mime_type;
	gint64 _size;
	gchar* _desc;
	GDateTime* _date;
	gint _width;
	gint _height;
	gint64 _length;
};

struct _XmppXepFileMetadataElementParamSpecFileMetadata {
	GParamSpec parent_instance;
};

static gint XmppXepFileMetadataElementFileMetadata_private_offset;
static gpointer xmpp_xep_file_metadata_element_file_metadata_parent_class = NULL;

static void xmpp_xep_file_metadata_element_file_metadata_finalize (XmppXepFileMetadataElementFileMetadata * obj);
static GType xmpp_xep_file_metadata_element_file_metadata_get_type_once (void);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
xmpp_xep_file_metadata_element_file_metadata_get_instance_private (XmppXepFileMetadataElementFileMetadata* self)
{
	return G_STRUCT_MEMBER_P (self, XmppXepFileMetadataElementFileMetadata_private_offset);
}

XmppStanzaNode*
xmpp_xep_file_metadata_element_file_metadata_to_stanza_node (XmppXepFileMetadataElementFileMetadata* self)
{
	XmppStanzaNode* node = NULL;
	XmppStanzaNode* _tmp0_;
	XmppStanzaNode* _tmp1_;
	XmppStanzaNode* _tmp2_;
	XmppStanzaNode* _tmp3_;
	const gchar* _tmp4_;
	const gchar* _tmp15_;
	gint64 _tmp36_;
	GDateTime* _tmp49_;
	const gchar* _tmp62_;
	gint _tmp73_;
	gint _tmp86_;
	gint64 _tmp99_;
	XmppStanzaNode* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = xmpp_stanza_node_new_build ("file", XMPP_XEP_FILE_METADATA_ELEMENT_NS_URI, NULL, NULL);
	_tmp1_ = _tmp0_;
	_tmp2_ = xmpp_stanza_node_add_self_xmlns (_tmp1_);
	_tmp3_ = _tmp2_;
	_xmpp_stanza_entry_unref0 (_tmp1_);
	node = _tmp3_;
	_tmp4_ = self->priv->_name;
	if (_tmp4_ != NULL) {
		XmppStanzaNode* _tmp5_;
		XmppStanzaNode* _tmp6_;
		XmppStanzaNode* _tmp7_;
		const gchar* _tmp8_;
		XmppStanzaNode* _tmp9_;
		XmppStanzaNode* _tmp10_;
		XmppStanzaNode* _tmp11_;
		XmppStanzaNode* _tmp12_;
		XmppStanzaNode* _tmp13_;
		XmppStanzaNode* _tmp14_;
		_tmp5_ = node;
		_tmp6_ = xmpp_stanza_node_new_build ("name", XMPP_XEP_FILE_METADATA_ELEMENT_NS_URI, NULL, NULL);
		_tmp7_ = _tmp6_;
		_tmp8_ = self->priv->_name;
		_tmp9_ = xmpp_stanza_node_new_text (_tmp8_);
		_tmp10_ = _tmp9_;
		_tmp11_ = xmpp_stanza_node_put_node (_tmp7_, _tmp10_);
		_tmp12_ = _tmp11_;
		_tmp13_ = xmpp_stanza_node_put_node (_tmp5_, _tmp12_);
		_tmp14_ = _tmp13_;
		_xmpp_stanza_entry_unref0 (_tmp14_);
		_xmpp_stanza_entry_unref0 (_tmp12_);
		_xmpp_stanza_entry_unref0 (_tmp10_);
		_xmpp_stanza_entry_unref0 (_tmp7_);
	}
	_tmp15_ = self->priv->_mime_type;
	if (_tmp15_ != NULL) {
		XmppStanzaNode* _tmp16_;
		XmppStanzaNode* _tmp17_;
		XmppStanzaNode* _tmp18_;
		const gchar* _tmp19_;
		XmppStanzaNode* _tmp20_;
		XmppStanzaNode* _tmp21_;
		XmppStanzaNode* _tmp22_;
		XmppStanzaNode* _tmp23_;
		XmppStanzaNode* _tmp24_;
		XmppStanzaNode* _tmp25_;
		XmppStanzaNode* _tmp26_;
		XmppStanzaNode* _tmp27_;
		XmppStanzaNode* _tmp28_;
		const gchar* _tmp29_;
		XmppStanzaNode* _tmp30_;
		XmppStanzaNode* _tmp31_;
		XmppStanzaNode* _tmp32_;
		XmppStanzaNode* _tmp33_;
		XmppStanzaNode* _tmp34_;
		XmppStanzaNode* _tmp35_;
		_tmp16_ = node;
		_tmp17_ = xmpp_stanza_node_new_build ("media_type", XMPP_XEP_FILE_METADATA_ELEMENT_NS_URI, NULL, NULL);
		_tmp18_ = _tmp17_;
		_tmp19_ = self->priv->_mime_type;
		_tmp20_ = xmpp_stanza_node_new_text (_tmp19_);
		_tmp21_ = _tmp20_;
		_tmp22_ = xmpp_stanza_node_put_node (_tmp18_, _tmp21_);
		_tmp23_ = _tmp22_;
		_tmp24_ = xmpp_stanza_node_put_node (_tmp16_, _tmp23_);
		_tmp25_ = _tmp24_;
		_xmpp_stanza_entry_unref0 (_tmp25_);
		_xmpp_stanza_entry_unref0 (_tmp23_);
		_xmpp_stanza_entry_unref0 (_tmp21_);
		_xmpp_stanza_entry_unref0 (_tmp18_);
		_tmp26_ = node;
		_tmp27_ = xmpp_stanza_node_new_build ("media-type", XMPP_XEP_FILE_METADATA_ELEMENT_NS_URI, NULL, NULL);
		_tmp28_ = _tmp27_;
		_tmp29_ = self->priv->_mime_type;
		_tmp30_ = xmpp_stanza_node_new_text (_tmp29_);
		_tmp31_ = _tmp30_;
		_tmp32_ = xmpp_stanza_node_put_node (_tmp28_, _tmp31_);
		_tmp33_ = _tmp32_;
		_tmp34_ = xmpp_stanza_node_put_node (_tmp26_, _tmp33_);
		_tmp35_ = _tmp34_;
		_xmpp_stanza_entry_unref0 (_tmp35_);
		_xmpp_stanza_entry_unref0 (_tmp33_);
		_xmpp_stanza_entry_unref0 (_tmp31_);
		_xmpp_stanza_entry_unref0 (_tmp28_);
	}
	_tmp36_ = self->priv->_size;
	if (_tmp36_ != ((gint64) -1)) {
		XmppStanzaNode* _tmp37_;
		XmppStanzaNode* _tmp38_;
		XmppStanzaNode* _tmp39_;
		gint64 _tmp40_;
		gchar* _tmp41_;
		gchar* _tmp42_;
		XmppStanzaNode* _tmp43_;
		XmppStanzaNode* _tmp44_;
		XmppStanzaNode* _tmp45_;
		XmppStanzaNode* _tmp46_;
		XmppStanzaNode* _tmp47_;
		XmppStanzaNode* _tmp48_;
		_tmp37_ = node;
		_tmp38_ = xmpp_stanza_node_new_build ("size", XMPP_XEP_FILE_METADATA_ELEMENT_NS_URI, NULL, NULL);
		_tmp39_ = _tmp38_;
		_tmp40_ = self->priv->_size;
		_tmp41_ = g_strdup_printf ("%" G_GINT64_FORMAT, _tmp40_);
		_tmp42_ = _tmp41_;
		_tmp43_ = xmpp_stanza_node_new_text (_tmp42_);
		_tmp44_ = _tmp43_;
		_tmp45_ = xmpp_stanza_node_put_node (_tmp39_, _tmp44_);
		_tmp46_ = _tmp45_;
		_tmp47_ = xmpp_stanza_node_put_node (_tmp37_, _tmp46_);
		_tmp48_ = _tmp47_;
		_xmpp_stanza_entry_unref0 (_tmp48_);
		_xmpp_stanza_entry_unref0 (_tmp46_);
		_xmpp_stanza_entry_unref0 (_tmp44_);
		_g_free0 (_tmp42_);
		_xmpp_stanza_entry_unref0 (_tmp39_);
	}
	_tmp49_ = self->priv->_date;
	if (_tmp49_ != NULL) {
		XmppStanzaNode* _tmp50_;
		XmppStanzaNode* _tmp51_;
		XmppStanzaNode* _tmp52_;
		GDateTime* _tmp53_;
		gchar* _tmp54_;
		gchar* _tmp55_;
		XmppStanzaNode* _tmp56_;
		XmppStanzaNode* _tmp57_;
		XmppStanzaNode* _tmp58_;
		XmppStanzaNode* _tmp59_;
		XmppStanzaNode* _tmp60_;
		XmppStanzaNode* _tmp61_;
		_tmp50_ = node;
		_tmp51_ = xmpp_stanza_node_new_build ("date", XMPP_XEP_FILE_METADATA_ELEMENT_NS_URI, NULL, NULL);
		_tmp52_ = _tmp51_;
		_tmp53_ = self->priv->_date;
		_tmp54_ = xmpp_xep_date_time_profiles_to_datetime (_tmp53_);
		_tmp55_ = _tmp54_;
		_tmp56_ = xmpp_stanza_node_new_text (_tmp55_);
		_tmp57_ = _tmp56_;
		_tmp58_ = xmpp_stanza_node_put_node (_tmp52_, _tmp57_);
		_tmp59_ = _tmp58_;
		_tmp60_ = xmpp_stanza_node_put_node (_tmp50_, _tmp59_);
		_tmp61_ = _tmp60_;
		_xmpp_stanza_entry_unref0 (_tmp61_);
		_xmpp_stanza_entry_unref0 (_tmp59_);
		_xmpp_stanza_entry_unref0 (_tmp57_);
		_g_free0 (_tmp55_);
		_xmpp_stanza_entry_unref0 (_tmp52_);
	}
	_tmp62_ = self->priv->_desc;
	if (_tmp62_ != NULL) {
		XmppStanzaNode* _tmp63_;
		XmppStanzaNode* _tmp64_;
		XmppStanzaNode* _tmp65_;
		const gchar* _tmp66_;
		XmppStanzaNode* _tmp67_;
		XmppStanzaNode* _tmp68_;
		XmppStanzaNode* _tmp69_;
		XmppStanzaNode* _tmp70_;
		XmppStanzaNode* _tmp71_;
		XmppStanzaNode* _tmp72_;
		_tmp63_ = node;
		_tmp64_ = xmpp_stanza_node_new_build ("desc", XMPP_XEP_FILE_METADATA_ELEMENT_NS_URI, NULL, NULL);
		_tmp65_ = _tmp64_;
		_tmp66_ = self->priv->_desc;
		_tmp67_ = xmpp_stanza_node_new_text (_tmp66_);
		_tmp68_ = _tmp67_;
		_tmp69_ = xmpp_stanza_node_put_node (_tmp65_, _tmp68_);
		_tmp70_ = _tmp69_;
		_tmp71_ = xmpp_stanza_node_put_node (_tmp63_, _tmp70_);
		_tmp72_ = _tmp71_;
		_xmpp_stanza_entry_unref0 (_tmp72_);
		_xmpp_stanza_entry_unref0 (_tmp70_);
		_xmpp_stanza_entry_unref0 (_tmp68_);
		_xmpp_stanza_entry_unref0 (_tmp65_);
	}
	_tmp73_ = self->priv->_width;
	if (_tmp73_ != -1) {
		XmppStanzaNode* _tmp74_;
		XmppStanzaNode* _tmp75_;
		XmppStanzaNode* _tmp76_;
		gint _tmp77_;
		gchar* _tmp78_;
		gchar* _tmp79_;
		XmppStanzaNode* _tmp80_;
		XmppStanzaNode* _tmp81_;
		XmppStanzaNode* _tmp82_;
		XmppStanzaNode* _tmp83_;
		XmppStanzaNode* _tmp84_;
		XmppStanzaNode* _tmp85_;
		_tmp74_ = node;
		_tmp75_ = xmpp_stanza_node_new_build ("width", XMPP_XEP_FILE_METADATA_ELEMENT_NS_URI, NULL, NULL);
		_tmp76_ = _tmp75_;
		_tmp77_ = self->priv->_width;
		_tmp78_ = g_strdup_printf ("%i", _tmp77_);
		_tmp79_ = _tmp78_;
		_tmp80_ = xmpp_stanza_node_new_text (_tmp79_);
		_tmp81_ = _tmp80_;
		_tmp82_ = xmpp_stanza_node_put_node (_tmp76_, _tmp81_);
		_tmp83_ = _tmp82_;
		_tmp84_ = xmpp_stanza_node_put_node (_tmp74_, _tmp83_);
		_tmp85_ = _tmp84_;
		_xmpp_stanza_entry_unref0 (_tmp85_);
		_xmpp_stanza_entry_unref0 (_tmp83_);
		_xmpp_stanza_entry_unref0 (_tmp81_);
		_g_free0 (_tmp79_);
		_xmpp_stanza_entry_unref0 (_tmp76_);
	}
	_tmp86_ = self->priv->_height;
	if (_tmp86_ != -1) {
		XmppStanzaNode* _tmp87_;
		XmppStanzaNode* _tmp88_;
		XmppStanzaNode* _tmp89_;
		gint _tmp90_;
		gchar* _tmp91_;
		gchar* _tmp92_;
		XmppStanzaNode* _tmp93_;
		XmppStanzaNode* _tmp94_;
		XmppStanzaNode* _tmp95_;
		XmppStanzaNode* _tmp96_;
		XmppStanzaNode* _tmp97_;
		XmppStanzaNode* _tmp98_;
		_tmp87_ = node;
		_tmp88_ = xmpp_stanza_node_new_build ("height", XMPP_XEP_FILE_METADATA_ELEMENT_NS_URI, NULL, NULL);
		_tmp89_ = _tmp88_;
		_tmp90_ = self->priv->_height;
		_tmp91_ = g_strdup_printf ("%i", _tmp90_);
		_tmp92_ = _tmp91_;
		_tmp93_ = xmpp_stanza_node_new_text (_tmp92_);
		_tmp94_ = _tmp93_;
		_tmp95_ = xmpp_stanza_node_put_node (_tmp89_, _tmp94_);
		_tmp96_ = _tmp95_;
		_tmp97_ = xmpp_stanza_node_put_node (_tmp87_, _tmp96_);
		_tmp98_ = _tmp97_;
		_xmpp_stanza_entry_unref0 (_tmp98_);
		_xmpp_stanza_entry_unref0 (_tmp96_);
		_xmpp_stanza_entry_unref0 (_tmp94_);
		_g_free0 (_tmp92_);
		_xmpp_stanza_entry_unref0 (_tmp89_);
	}
	_tmp99_ = self->priv->_length;
	if (_tmp99_ != ((gint64) -1)) {
		XmppStanzaNode* _tmp100_;
		XmppStanzaNode* _tmp101_;
		XmppStanzaNode* _tmp102_;
		gint64 _tmp103_;
		gchar* _tmp104_;
		gchar* _tmp105_;
		XmppStanzaNode* _tmp106_;
		XmppStanzaNode* _tmp107_;
		XmppStanzaNode* _tmp108_;
		XmppStanzaNode* _tmp109_;
		XmppStanzaNode* _tmp110_;
		XmppStanzaNode* _tmp111_;
		_tmp100_ = node;
		_tmp101_ = xmpp_stanza_node_new_build ("length", XMPP_XEP_FILE_METADATA_ELEMENT_NS_URI, NULL, NULL);
		_tmp102_ = _tmp101_;
		_tmp103_ = self->priv->_length;
		_tmp104_ = g_strdup_printf ("%" G_GINT64_FORMAT, _tmp103_);
		_tmp105_ = _tmp104_;
		_tmp106_ = xmpp_stanza_node_new_text (_tmp105_);
		_tmp107_ = _tmp106_;
		_tmp108_ = xmpp_stanza_node_put_node (_tmp102_, _tmp107_);
		_tmp109_ = _tmp108_;
		_tmp110_ = xmpp_stanza_node_put_node (_tmp100_, _tmp109_);
		_tmp111_ = _tmp110_;
		_xmpp_stanza_entry_unref0 (_tmp111_);
		_xmpp_stanza_entry_unref0 (_tmp109_);
		_xmpp_stanza_entry_unref0 (_tmp107_);
		_g_free0 (_tmp105_);
		_xmpp_stanza_entry_unref0 (_tmp102_);
	}
	{
		GeeList* _hash_list = NULL;
		GeeList* _tmp112_;
		gint _hash_size = 0;
		GeeList* _tmp113_;
		gint _tmp114_;
		gint _tmp115_;
		gint _hash_index = 0;
		_tmp112_ = self->hashes;
		_hash_list = _tmp112_;
		_tmp113_ = _hash_list;
		_tmp114_ = gee_collection_get_size ((GeeCollection*) _tmp113_);
		_tmp115_ = _tmp114_;
		_hash_size = _tmp115_;
		_hash_index = -1;
		while (TRUE) {
			gint _tmp116_;
			gint _tmp117_;
			XmppXepCryptographicHashesHash* hash = NULL;
			GeeList* _tmp118_;
			gpointer _tmp119_;
			XmppStanzaNode* _tmp120_;
			XmppXepCryptographicHashesHash* _tmp121_;
			XmppStanzaNode* _tmp122_;
			XmppStanzaNode* _tmp123_;
			XmppStanzaNode* _tmp124_;
			XmppStanzaNode* _tmp125_;
			_hash_index = _hash_index + 1;
			_tmp116_ = _hash_index;
			_tmp117_ = _hash_size;
			if (!(_tmp116_ < _tmp117_)) {
				break;
			}
			_tmp118_ = _hash_list;
			_tmp119_ = gee_list_get (_tmp118_, _hash_index);
			hash = (XmppXepCryptographicHashesHash*) _tmp119_;
			_tmp120_ = node;
			_tmp121_ = hash;
			_tmp122_ = xmpp_xep_cryptographic_hashes_hash_to_stanza_node (_tmp121_);
			_tmp123_ = _tmp122_;
			_tmp124_ = xmpp_stanza_node_put_node (_tmp120_, _tmp123_);
			_tmp125_ = _tmp124_;
			_xmpp_stanza_entry_unref0 (_tmp125_);
			_xmpp_stanza_entry_unref0 (_tmp123_);
			_g_object_unref0 (hash);
		}
	}
	{
		GeeList* _thumbnail_list = NULL;
		GeeList* _tmp126_;
		gint _thumbnail_size = 0;
		GeeList* _tmp127_;
		gint _tmp128_;
		gint _tmp129_;
		gint _thumbnail_index = 0;
		_tmp126_ = self->thumbnails;
		_thumbnail_list = _tmp126_;
		_tmp127_ = _thumbnail_list;
		_tmp128_ = gee_collection_get_size ((GeeCollection*) _tmp127_);
		_tmp129_ = _tmp128_;
		_thumbnail_size = _tmp129_;
		_thumbnail_index = -1;
		while (TRUE) {
			gint _tmp130_;
			gint _tmp131_;
			XmppXepJingleContentThumbnailsThumbnail* thumbnail = NULL;
			GeeList* _tmp132_;
			gpointer _tmp133_;
			XmppStanzaNode* _tmp134_;
			XmppXepJingleContentThumbnailsThumbnail* _tmp135_;
			XmppStanzaNode* _tmp136_;
			XmppStanzaNode* _tmp137_;
			XmppStanzaNode* _tmp138_;
			XmppStanzaNode* _tmp139_;
			_thumbnail_index = _thumbnail_index + 1;
			_tmp130_ = _thumbnail_index;
			_tmp131_ = _thumbnail_size;
			if (!(_tmp130_ < _tmp131_)) {
				break;
			}
			_tmp132_ = _thumbnail_list;
			_tmp133_ = gee_list_get (_tmp132_, _thumbnail_index);
			thumbnail = (XmppXepJingleContentThumbnailsThumbnail*) _tmp133_;
			_tmp134_ = node;
			_tmp135_ = thumbnail;
			_tmp136_ = xmpp_xep_jingle_content_thumbnails_thumbnail_to_stanza_node (_tmp135_);
			_tmp137_ = _tmp136_;
			_tmp138_ = xmpp_stanza_node_put_node (_tmp134_, _tmp137_);
			_tmp139_ = _tmp138_;
			_xmpp_stanza_entry_unref0 (_tmp139_);
			_xmpp_stanza_entry_unref0 (_tmp137_);
			_xmpp_xep_jingle_content_thumbnails_thumbnail_unref0 (thumbnail);
		}
	}
	result = node;
	return result;
}

XmppXepFileMetadataElementFileMetadata*
xmpp_xep_file_metadata_element_file_metadata_construct (GType object_type)
{
	XmppXepFileMetadataElementFileMetadata* self = NULL;
	self = (XmppXepFileMetadataElementFileMetadata*) g_type_create_instance (object_type);
	return self;
}

XmppXepFileMetadataElementFileMetadata*
xmpp_xep_file_metadata_element_file_metadata_new (void)
{
	return xmpp_xep_file_metadata_element_file_metadata_construct (XMPP_XEP_FILE_METADATA_ELEMENT_TYPE_FILE_METADATA);
}

const gchar*
xmpp_xep_file_metadata_element_file_metadata_get_name (XmppXepFileMetadataElementFileMetadata* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_name;
	result = _tmp0_;
	return result;
}

void
xmpp_xep_file_metadata_element_file_metadata_set_name (XmppXepFileMetadataElementFileMetadata* self,
                                                       const gchar* value)
{
	gchar* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup (value);
	_g_free0 (self->priv->_name);
	self->priv->_name = _tmp0_;
}

const gchar*
xmpp_xep_file_metadata_element_file_metadata_get_mime_type (XmppXepFileMetadataElementFileMetadata* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_mime_type;
	result = _tmp0_;
	return result;
}

void
xmpp_xep_file_metadata_element_file_metadata_set_mime_type (XmppXepFileMetadataElementFileMetadata* self,
                                                            const gchar* value)
{
	gchar* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup (value);
	_g_free0 (self->priv->_mime_type);
	self->priv->_mime_type = _tmp0_;
}

gint64
xmpp_xep_file_metadata_element_file_metadata_get_size (XmppXepFileMetadataElementFileMetadata* self)
{
	gint64 result;
	g_return_val_if_fail (self != NULL, -1LL);
	result = self->priv->_size;
	return result;
}

void
xmpp_xep_file_metadata_element_file_metadata_set_size (XmppXepFileMetadataElementFileMetadata* self,
                                                       gint64 value)
{
	g_return_if_fail (self != NULL);
	self->priv->_size = value;
}

const gchar*
xmpp_xep_file_metadata_element_file_metadata_get_desc (XmppXepFileMetadataElementFileMetadata* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_desc;
	result = _tmp0_;
	return result;
}

void
xmpp_xep_file_metadata_element_file_metadata_set_desc (XmppXepFileMetadataElementFileMetadata* self,
                                                       const gchar* value)
{
	gchar* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup (value);
	_g_free0 (self->priv->_desc);
	self->priv->_desc = _tmp0_;
}

GDateTime*
xmpp_xep_file_metadata_element_file_metadata_get_date (XmppXepFileMetadataElementFileMetadata* self)
{
	GDateTime* result;
	GDateTime* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_date;
	result = _tmp0_;
	return result;
}

static gpointer
_g_date_time_ref0 (gpointer self)
{
	return self ? g_date_time_ref (self) : NULL;
}

void
xmpp_xep_file_metadata_element_file_metadata_set_date (XmppXepFileMetadataElementFileMetadata* self,
                                                       GDateTime* value)
{
	GDateTime* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_date_time_ref0 (value);
	_g_date_time_unref0 (self->priv->_date);
	self->priv->_date = _tmp0_;
}

gint
xmpp_xep_file_metadata_element_file_metadata_get_width (XmppXepFileMetadataElementFileMetadata* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	result = self->priv->_width;
	return result;
}

void
xmpp_xep_file_metadata_element_file_metadata_set_width (XmppXepFileMetadataElementFileMetadata* self,
                                                        gint value)
{
	g_return_if_fail (self != NULL);
	self->priv->_width = value;
}

gint
xmpp_xep_file_metadata_element_file_metadata_get_height (XmppXepFileMetadataElementFileMetadata* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	result = self->priv->_height;
	return result;
}

void
xmpp_xep_file_metadata_element_file_metadata_set_height (XmppXepFileMetadataElementFileMetadata* self,
                                                         gint value)
{
	g_return_if_fail (self != NULL);
	self->priv->_height = value;
}

gint64
xmpp_xep_file_metadata_element_file_metadata_get_length (XmppXepFileMetadataElementFileMetadata* self)
{
	gint64 result;
	g_return_val_if_fail (self != NULL, -1LL);
	result = self->priv->_length;
	return result;
}

void
xmpp_xep_file_metadata_element_file_metadata_set_length (XmppXepFileMetadataElementFileMetadata* self,
                                                         gint64 value)
{
	g_return_if_fail (self != NULL);
	self->priv->_length = value;
}

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

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

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

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

static gchar*
xmpp_xep_file_metadata_element_value_file_metadata_collect_value (GValue* value,
                                                                  guint n_collect_values,
                                                                  GTypeCValue* collect_values,
                                                                  guint collect_flags)
{
	if (collect_values[0].v_pointer) {
		XmppXepFileMetadataElementFileMetadata * 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 = xmpp_xep_file_metadata_element_file_metadata_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}

static gchar*
xmpp_xep_file_metadata_element_value_file_metadata_lcopy_value (const GValue* value,
                                                                guint n_collect_values,
                                                                GTypeCValue* collect_values,
                                                                guint collect_flags)
{
	XmppXepFileMetadataElementFileMetadata ** 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 = xmpp_xep_file_metadata_element_file_metadata_ref (value->data[0].v_pointer);
	}
	return NULL;
}

GParamSpec*
xmpp_xep_file_metadata_element_param_spec_file_metadata (const gchar* name,
                                                         const gchar* nick,
                                                         const gchar* blurb,
                                                         GType object_type,
                                                         GParamFlags flags)
{
	XmppXepFileMetadataElementParamSpecFileMetadata* spec;
	g_return_val_if_fail (g_type_is_a (object_type, XMPP_XEP_FILE_METADATA_ELEMENT_TYPE_FILE_METADATA), 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
xmpp_xep_file_metadata_element_value_get_file_metadata (const GValue* value)
{
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, XMPP_XEP_FILE_METADATA_ELEMENT_TYPE_FILE_METADATA), NULL);
	return value->data[0].v_pointer;
}

void
xmpp_xep_file_metadata_element_value_set_file_metadata (GValue* value,
                                                        gpointer v_object)
{
	XmppXepFileMetadataElementFileMetadata * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, XMPP_XEP_FILE_METADATA_ELEMENT_TYPE_FILE_METADATA));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, XMPP_XEP_FILE_METADATA_ELEMENT_TYPE_FILE_METADATA));
		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;
		xmpp_xep_file_metadata_element_file_metadata_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		xmpp_xep_file_metadata_element_file_metadata_unref (old);
	}
}

void
xmpp_xep_file_metadata_element_value_take_file_metadata (GValue* value,
                                                         gpointer v_object)
{
	XmppXepFileMetadataElementFileMetadata * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, XMPP_XEP_FILE_METADATA_ELEMENT_TYPE_FILE_METADATA));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, XMPP_XEP_FILE_METADATA_ELEMENT_TYPE_FILE_METADATA));
		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) {
		xmpp_xep_file_metadata_element_file_metadata_unref (old);
	}
}

static void
xmpp_xep_file_metadata_element_file_metadata_class_init (XmppXepFileMetadataElementFileMetadataClass * klass,
                                                         gpointer klass_data)
{
	xmpp_xep_file_metadata_element_file_metadata_parent_class = g_type_class_peek_parent (klass);
	((XmppXepFileMetadataElementFileMetadataClass *) klass)->finalize = xmpp_xep_file_metadata_element_file_metadata_finalize;
	g_type_class_adjust_private_offset (klass, &XmppXepFileMetadataElementFileMetadata_private_offset);
}

static void
xmpp_xep_file_metadata_element_file_metadata_instance_init (XmppXepFileMetadataElementFileMetadata * self,
                                                            gpointer klass)
{
	GeeArrayList* _tmp0_;
	GeeArrayList* _tmp1_;
	self->priv = xmpp_xep_file_metadata_element_file_metadata_get_instance_private (self);
	self->priv->_size = (gint64) -1;
	self->priv->_width = -1;
	self->priv->_height = -1;
	_tmp0_ = gee_array_list_new (XMPP_XEP_CRYPTOGRAPHIC_HASHES_TYPE_HASH, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	self->hashes = (GeeList*) _tmp0_;
	self->priv->_length = (gint64) -1;
	_tmp1_ = gee_array_list_new (XMPP_XEP_JINGLE_CONTENT_THUMBNAILS_TYPE_THUMBNAIL, (GBoxedCopyFunc) xmpp_xep_jingle_content_thumbnails_thumbnail_ref, (GDestroyNotify) xmpp_xep_jingle_content_thumbnails_thumbnail_unref, NULL, NULL, NULL);
	self->thumbnails = (GeeList*) _tmp1_;
	self->ref_count = 1;
}

static void
xmpp_xep_file_metadata_element_file_metadata_finalize (XmppXepFileMetadataElementFileMetadata * obj)
{
	XmppXepFileMetadataElementFileMetadata * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, XMPP_XEP_FILE_METADATA_ELEMENT_TYPE_FILE_METADATA, XmppXepFileMetadataElementFileMetadata);
	g_signal_handlers_destroy (self);
	_g_free0 (self->priv->_name);
	_g_free0 (self->priv->_mime_type);
	_g_free0 (self->priv->_desc);
	_g_date_time_unref0 (self->priv->_date);
	_g_object_unref0 (self->hashes);
	_g_object_unref0 (self->thumbnails);
}

static GType
xmpp_xep_file_metadata_element_file_metadata_get_type_once (void)
{
	static const GTypeValueTable g_define_type_value_table = { xmpp_xep_file_metadata_element_value_file_metadata_init, xmpp_xep_file_metadata_element_value_file_metadata_free_value, xmpp_xep_file_metadata_element_value_file_metadata_copy_value, xmpp_xep_file_metadata_element_value_file_metadata_peek_pointer, "p", xmpp_xep_file_metadata_element_value_file_metadata_collect_value, "p", xmpp_xep_file_metadata_element_value_file_metadata_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (XmppXepFileMetadataElementFileMetadataClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) xmpp_xep_file_metadata_element_file_metadata_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (XmppXepFileMetadataElementFileMetadata), 0, (GInstanceInitFunc) xmpp_xep_file_metadata_element_file_metadata_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 xmpp_xep_file_metadata_element_file_metadata_type_id;
	xmpp_xep_file_metadata_element_file_metadata_type_id = g_type_register_fundamental (g_type_fundamental_next (), "XmppXepFileMetadataElementFileMetadata", &g_define_type_info, &g_define_type_fundamental_info, 0);
	XmppXepFileMetadataElementFileMetadata_private_offset = g_type_add_instance_private (xmpp_xep_file_metadata_element_file_metadata_type_id, sizeof (XmppXepFileMetadataElementFileMetadataPrivate));
	return xmpp_xep_file_metadata_element_file_metadata_type_id;
}

GType
xmpp_xep_file_metadata_element_file_metadata_get_type (void)
{
	static volatile gsize xmpp_xep_file_metadata_element_file_metadata_type_id__once = 0;
	if (g_once_init_enter (&xmpp_xep_file_metadata_element_file_metadata_type_id__once)) {
		GType xmpp_xep_file_metadata_element_file_metadata_type_id;
		xmpp_xep_file_metadata_element_file_metadata_type_id = xmpp_xep_file_metadata_element_file_metadata_get_type_once ();
		g_once_init_leave (&xmpp_xep_file_metadata_element_file_metadata_type_id__once, xmpp_xep_file_metadata_element_file_metadata_type_id);
	}
	return xmpp_xep_file_metadata_element_file_metadata_type_id__once;
}

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

void
xmpp_xep_file_metadata_element_file_metadata_unref (gpointer instance)
{
	XmppXepFileMetadataElementFileMetadata * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		XMPP_XEP_FILE_METADATA_ELEMENT_FILE_METADATA_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

static gint64
int64_parse (const gchar* str,
             guint _base)
{
	gint64 result;
	g_return_val_if_fail (str != NULL, -1LL);
	result = g_ascii_strtoll (str, NULL, _base);
	return result;
}

XmppXepFileMetadataElementFileMetadata*
xmpp_xep_file_metadata_element_get_file_metadata (XmppStanzaNode* node)
{
	XmppStanzaNode* file_node = NULL;
	XmppStanzaNode* _tmp0_;
	XmppStanzaNode* _tmp1_;
	XmppXepFileMetadataElementFileMetadata* metadata = NULL;
	XmppXepFileMetadataElementFileMetadata* _tmp2_;
	XmppStanzaNode* name_node = NULL;
	XmppStanzaNode* _tmp3_;
	XmppStanzaNode* _tmp4_;
	gboolean _tmp5_ = FALSE;
	XmppStanzaNode* _tmp6_;
	XmppStanzaNode* desc_node = NULL;
	XmppStanzaNode* _tmp12_;
	XmppStanzaNode* _tmp13_;
	gboolean _tmp14_ = FALSE;
	XmppStanzaNode* _tmp15_;
	XmppStanzaNode* mime_node_bad = NULL;
	XmppStanzaNode* _tmp21_;
	XmppStanzaNode* _tmp22_;
	gboolean _tmp23_ = FALSE;
	XmppStanzaNode* _tmp24_;
	XmppStanzaNode* mime_node = NULL;
	XmppStanzaNode* _tmp30_;
	XmppStanzaNode* _tmp31_;
	gboolean _tmp32_ = FALSE;
	XmppStanzaNode* _tmp33_;
	XmppStanzaNode* size_node = NULL;
	XmppStanzaNode* _tmp39_;
	XmppStanzaNode* _tmp40_;
	gboolean _tmp41_ = FALSE;
	XmppStanzaNode* _tmp42_;
	XmppStanzaNode* date_node = NULL;
	XmppStanzaNode* _tmp48_;
	XmppStanzaNode* _tmp49_;
	gboolean _tmp50_ = FALSE;
	XmppStanzaNode* _tmp51_;
	XmppStanzaNode* width_node = NULL;
	XmppStanzaNode* _tmp59_;
	XmppStanzaNode* _tmp60_;
	gboolean _tmp61_ = FALSE;
	XmppStanzaNode* _tmp62_;
	XmppStanzaNode* height_node = NULL;
	XmppStanzaNode* _tmp68_;
	XmppStanzaNode* _tmp69_;
	gboolean _tmp70_ = FALSE;
	XmppStanzaNode* _tmp71_;
	XmppStanzaNode* length_node = NULL;
	XmppStanzaNode* _tmp77_;
	XmppStanzaNode* _tmp78_;
	gboolean _tmp79_ = FALSE;
	XmppStanzaNode* _tmp80_;
	XmppXepFileMetadataElementFileMetadata* _tmp86_;
	XmppStanzaNode* _tmp87_;
	GeeList* _tmp88_;
	XmppXepFileMetadataElementFileMetadata* _tmp89_;
	XmppStanzaNode* _tmp90_;
	GeeList* _tmp91_;
	XmppXepFileMetadataElementFileMetadata* result;
	g_return_val_if_fail (node != NULL, NULL);
	_tmp0_ = xmpp_stanza_node_get_subnode (node, "file", XMPP_XEP_FILE_METADATA_ELEMENT_NS_URI, FALSE);
	file_node = _tmp0_;
	_tmp1_ = file_node;
	if (_tmp1_ == NULL) {
		result = NULL;
		_xmpp_stanza_entry_unref0 (file_node);
		return result;
	}
	_tmp2_ = xmpp_xep_file_metadata_element_file_metadata_new ();
	metadata = _tmp2_;
	_tmp3_ = file_node;
	_tmp4_ = xmpp_stanza_node_get_subnode (_tmp3_, "name", NULL, FALSE);
	name_node = _tmp4_;
	_tmp6_ = name_node;
	if (_tmp6_ != NULL) {
		XmppStanzaNode* _tmp7_;
		const gchar* _tmp8_;
		_tmp7_ = name_node;
		_tmp8_ = xmpp_stanza_entry_get_string_content ((XmppStanzaEntry*) _tmp7_);
		_tmp5_ = _tmp8_ != NULL;
	} else {
		_tmp5_ = FALSE;
	}
	if (_tmp5_) {
		XmppXepFileMetadataElementFileMetadata* _tmp9_;
		XmppStanzaNode* _tmp10_;
		const gchar* _tmp11_;
		_tmp9_ = metadata;
		_tmp10_ = name_node;
		_tmp11_ = xmpp_stanza_entry_get_string_content ((XmppStanzaEntry*) _tmp10_);
		xmpp_xep_file_metadata_element_file_metadata_set_name (_tmp9_, _tmp11_);
	}
	_tmp12_ = file_node;
	_tmp13_ = xmpp_stanza_node_get_subnode (_tmp12_, "desc", NULL, FALSE);
	desc_node = _tmp13_;
	_tmp15_ = desc_node;
	if (_tmp15_ != NULL) {
		XmppStanzaNode* _tmp16_;
		const gchar* _tmp17_;
		_tmp16_ = desc_node;
		_tmp17_ = xmpp_stanza_entry_get_string_content ((XmppStanzaEntry*) _tmp16_);
		_tmp14_ = _tmp17_ != NULL;
	} else {
		_tmp14_ = FALSE;
	}
	if (_tmp14_) {
		XmppXepFileMetadataElementFileMetadata* _tmp18_;
		XmppStanzaNode* _tmp19_;
		const gchar* _tmp20_;
		_tmp18_ = metadata;
		_tmp19_ = desc_node;
		_tmp20_ = xmpp_stanza_entry_get_string_content ((XmppStanzaEntry*) _tmp19_);
		xmpp_xep_file_metadata_element_file_metadata_set_desc (_tmp18_, _tmp20_);
	}
	_tmp21_ = file_node;
	_tmp22_ = xmpp_stanza_node_get_subnode (_tmp21_, "media_type", NULL, FALSE);
	mime_node_bad = _tmp22_;
	_tmp24_ = mime_node_bad;
	if (_tmp24_ != NULL) {
		XmppStanzaNode* _tmp25_;
		const gchar* _tmp26_;
		_tmp25_ = mime_node_bad;
		_tmp26_ = xmpp_stanza_entry_get_string_content ((XmppStanzaEntry*) _tmp25_);
		_tmp23_ = _tmp26_ != NULL;
	} else {
		_tmp23_ = FALSE;
	}
	if (_tmp23_) {
		XmppXepFileMetadataElementFileMetadata* _tmp27_;
		XmppStanzaNode* _tmp28_;
		const gchar* _tmp29_;
		_tmp27_ = metadata;
		_tmp28_ = mime_node_bad;
		_tmp29_ = xmpp_stanza_entry_get_string_content ((XmppStanzaEntry*) _tmp28_);
		xmpp_xep_file_metadata_element_file_metadata_set_mime_type (_tmp27_, _tmp29_);
	}
	_tmp30_ = file_node;
	_tmp31_ = xmpp_stanza_node_get_subnode (_tmp30_, "media-type", NULL, FALSE);
	mime_node = _tmp31_;
	_tmp33_ = mime_node;
	if (_tmp33_ != NULL) {
		XmppStanzaNode* _tmp34_;
		const gchar* _tmp35_;
		_tmp34_ = mime_node;
		_tmp35_ = xmpp_stanza_entry_get_string_content ((XmppStanzaEntry*) _tmp34_);
		_tmp32_ = _tmp35_ != NULL;
	} else {
		_tmp32_ = FALSE;
	}
	if (_tmp32_) {
		XmppXepFileMetadataElementFileMetadata* _tmp36_;
		XmppStanzaNode* _tmp37_;
		const gchar* _tmp38_;
		_tmp36_ = metadata;
		_tmp37_ = mime_node;
		_tmp38_ = xmpp_stanza_entry_get_string_content ((XmppStanzaEntry*) _tmp37_);
		xmpp_xep_file_metadata_element_file_metadata_set_mime_type (_tmp36_, _tmp38_);
	}
	_tmp39_ = file_node;
	_tmp40_ = xmpp_stanza_node_get_subnode (_tmp39_, "size", NULL, FALSE);
	size_node = _tmp40_;
	_tmp42_ = size_node;
	if (_tmp42_ != NULL) {
		XmppStanzaNode* _tmp43_;
		const gchar* _tmp44_;
		_tmp43_ = size_node;
		_tmp44_ = xmpp_stanza_entry_get_string_content ((XmppStanzaEntry*) _tmp43_);
		_tmp41_ = _tmp44_ != NULL;
	} else {
		_tmp41_ = FALSE;
	}
	if (_tmp41_) {
		XmppXepFileMetadataElementFileMetadata* _tmp45_;
		XmppStanzaNode* _tmp46_;
		const gchar* _tmp47_;
		_tmp45_ = metadata;
		_tmp46_ = size_node;
		_tmp47_ = xmpp_stanza_entry_get_string_content ((XmppStanzaEntry*) _tmp46_);
		xmpp_xep_file_metadata_element_file_metadata_set_size (_tmp45_, int64_parse (_tmp47_, (guint) 0));
	}
	_tmp48_ = file_node;
	_tmp49_ = xmpp_stanza_node_get_subnode (_tmp48_, "date", NULL, FALSE);
	date_node = _tmp49_;
	_tmp51_ = date_node;
	if (_tmp51_ != NULL) {
		XmppStanzaNode* _tmp52_;
		const gchar* _tmp53_;
		_tmp52_ = date_node;
		_tmp53_ = xmpp_stanza_entry_get_string_content ((XmppStanzaEntry*) _tmp52_);
		_tmp50_ = _tmp53_ != NULL;
	} else {
		_tmp50_ = FALSE;
	}
	if (_tmp50_) {
		XmppXepFileMetadataElementFileMetadata* _tmp54_;
		XmppStanzaNode* _tmp55_;
		const gchar* _tmp56_;
		GDateTime* _tmp57_;
		GDateTime* _tmp58_;
		_tmp54_ = metadata;
		_tmp55_ = date_node;
		_tmp56_ = xmpp_stanza_entry_get_string_content ((XmppStanzaEntry*) _tmp55_);
		_tmp57_ = xmpp_xep_date_time_profiles_parse_string (_tmp56_);
		_tmp58_ = _tmp57_;
		xmpp_xep_file_metadata_element_file_metadata_set_date (_tmp54_, _tmp58_);
		_g_date_time_unref0 (_tmp58_);
	}
	_tmp59_ = file_node;
	_tmp60_ = xmpp_stanza_node_get_subnode (_tmp59_, "width", NULL, FALSE);
	width_node = _tmp60_;
	_tmp62_ = width_node;
	if (_tmp62_ != NULL) {
		XmppStanzaNode* _tmp63_;
		const gchar* _tmp64_;
		_tmp63_ = width_node;
		_tmp64_ = xmpp_stanza_entry_get_string_content ((XmppStanzaEntry*) _tmp63_);
		_tmp61_ = _tmp64_ != NULL;
	} else {
		_tmp61_ = FALSE;
	}
	if (_tmp61_) {
		XmppXepFileMetadataElementFileMetadata* _tmp65_;
		XmppStanzaNode* _tmp66_;
		const gchar* _tmp67_;
		_tmp65_ = metadata;
		_tmp66_ = width_node;
		_tmp67_ = xmpp_stanza_entry_get_string_content ((XmppStanzaEntry*) _tmp66_);
		xmpp_xep_file_metadata_element_file_metadata_set_width (_tmp65_, atoi (_tmp67_));
	}
	_tmp68_ = file_node;
	_tmp69_ = xmpp_stanza_node_get_subnode (_tmp68_, "height", NULL, FALSE);
	height_node = _tmp69_;
	_tmp71_ = height_node;
	if (_tmp71_ != NULL) {
		XmppStanzaNode* _tmp72_;
		const gchar* _tmp73_;
		_tmp72_ = height_node;
		_tmp73_ = xmpp_stanza_entry_get_string_content ((XmppStanzaEntry*) _tmp72_);
		_tmp70_ = _tmp73_ != NULL;
	} else {
		_tmp70_ = FALSE;
	}
	if (_tmp70_) {
		XmppXepFileMetadataElementFileMetadata* _tmp74_;
		XmppStanzaNode* _tmp75_;
		const gchar* _tmp76_;
		_tmp74_ = metadata;
		_tmp75_ = height_node;
		_tmp76_ = xmpp_stanza_entry_get_string_content ((XmppStanzaEntry*) _tmp75_);
		xmpp_xep_file_metadata_element_file_metadata_set_height (_tmp74_, atoi (_tmp76_));
	}
	_tmp77_ = file_node;
	_tmp78_ = xmpp_stanza_node_get_subnode (_tmp77_, "length", NULL, FALSE);
	length_node = _tmp78_;
	_tmp80_ = length_node;
	if (_tmp80_ != NULL) {
		XmppStanzaNode* _tmp81_;
		const gchar* _tmp82_;
		_tmp81_ = length_node;
		_tmp82_ = xmpp_stanza_entry_get_string_content ((XmppStanzaEntry*) _tmp81_);
		_tmp79_ = _tmp82_ != NULL;
	} else {
		_tmp79_ = FALSE;
	}
	if (_tmp79_) {
		XmppXepFileMetadataElementFileMetadata* _tmp83_;
		XmppStanzaNode* _tmp84_;
		const gchar* _tmp85_;
		_tmp83_ = metadata;
		_tmp84_ = length_node;
		_tmp85_ = xmpp_stanza_entry_get_string_content ((XmppStanzaEntry*) _tmp84_);
		xmpp_xep_file_metadata_element_file_metadata_set_length (_tmp83_, (gint64) atoi (_tmp85_));
	}
	_tmp86_ = metadata;
	_tmp87_ = file_node;
	_tmp88_ = xmpp_xep_jingle_content_thumbnails_get_thumbnails (_tmp87_);
	_g_object_unref0 (_tmp86_->thumbnails);
	_tmp86_->thumbnails = _tmp88_;
	_tmp89_ = metadata;
	_tmp90_ = file_node;
	_tmp91_ = xmpp_xep_cryptographic_hashes_get_hashes (_tmp90_);
	_g_object_unref0 (_tmp89_->hashes);
	_tmp89_->hashes = _tmp91_;
	result = metadata;
	_xmpp_stanza_entry_unref0 (length_node);
	_xmpp_stanza_entry_unref0 (height_node);
	_xmpp_stanza_entry_unref0 (width_node);
	_xmpp_stanza_entry_unref0 (date_node);
	_xmpp_stanza_entry_unref0 (size_node);
	_xmpp_stanza_entry_unref0 (mime_node);
	_xmpp_stanza_entry_unref0 (mime_node_bad);
	_xmpp_stanza_entry_unref0 (desc_node);
	_xmpp_stanza_entry_unref0 (name_node);
	_xmpp_stanza_entry_unref0 (file_node);
	return result;
}

static inline gpointer
_vala_memdup2 (gconstpointer mem,
               gsize byte_size)
{
	gpointer new_mem;
	if (mem && byte_size != 0) {
		new_mem = g_malloc (byte_size);
		memcpy (new_mem, mem, byte_size);
	} else {
		new_mem = NULL;
	}
	return new_mem;
}

