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

#include "xmpp-vala.h"
#include <gee.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>

#define XMPP_PRESENCE_NS_URI "jabber:client"
#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

enum  {
	XMPP_PRESENCE_FLAG_0_PROPERTY,
	XMPP_PRESENCE_FLAG_NUM_PROPERTIES
};
static GParamSpec* xmpp_presence_flag_properties[XMPP_PRESENCE_FLAG_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _xmpp_jid_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_jid_unref (var), NULL)))

struct _XmppPresenceFlagPrivate {
	GeeHashMap* resources;
	GeeHashMap* presences;
};

static gint XmppPresenceFlag_private_offset;
static gpointer xmpp_presence_flag_parent_class = NULL;
XmppFlagIdentity* xmpp_presence_flag_IDENTITY = NULL;

static guint _xmpp_jid_hash_bare_func_gee_hash_data_func (gconstpointer v,
                                                   gpointer self);
static gboolean _xmpp_jid_equals_bare_func_gee_equal_data_func (gconstpointer a,
                                                         gconstpointer b,
                                                         gpointer self);
static guint _xmpp_jid_hash_func_gee_hash_data_func (gconstpointer v,
                                              gpointer self);
static gboolean _xmpp_jid_equals_func_gee_equal_data_func (gconstpointer a,
                                                    gconstpointer b,
                                                    gpointer self);
static gchar* xmpp_presence_flag_real_get_ns (XmppXmppStreamFlag* base);
static gchar* xmpp_presence_flag_real_get_id (XmppXmppStreamFlag* base);
static void xmpp_presence_flag_finalize (GObject * obj);
static GType xmpp_presence_flag_get_type_once (void);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
xmpp_presence_flag_get_instance_private (XmppPresenceFlag* self)
{
	return G_STRUCT_MEMBER_P (self, XmppPresenceFlag_private_offset);
}

static guint
_xmpp_jid_hash_bare_func_gee_hash_data_func (gconstpointer v,
                                             gpointer self)
{
	guint result;
	result = xmpp_jid_hash_bare_func ((XmppJid*) v);
	return result;
}

static gboolean
_xmpp_jid_equals_bare_func_gee_equal_data_func (gconstpointer a,
                                                gconstpointer b,
                                                gpointer self)
{
	gboolean result;
	result = xmpp_jid_equals_bare_func ((XmppJid*) a, (XmppJid*) b);
	return result;
}

static guint
_xmpp_jid_hash_func_gee_hash_data_func (gconstpointer v,
                                        gpointer self)
{
	guint result;
	result = xmpp_jid_hash_func ((XmppJid*) v);
	return result;
}

static gboolean
_xmpp_jid_equals_func_gee_equal_data_func (gconstpointer a,
                                           gconstpointer b,
                                           gpointer self)
{
	gboolean result;
	result = xmpp_jid_equals_func ((XmppJid*) a, (XmppJid*) b);
	return result;
}

GeeSet*
xmpp_presence_flag_get_available_jids (XmppPresenceFlag* self)
{
	GeeHashMap* _tmp0_;
	GeeSet* _tmp1_;
	GeeSet* _tmp2_;
	GeeSet* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->resources;
	_tmp1_ = gee_abstract_map_get_keys ((GeeAbstractMap*) _tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

GeeList*
xmpp_presence_flag_get_resources (XmppPresenceFlag* self,
                                  XmppJid* jid)
{
	GeeHashMap* _tmp0_;
	GeeArrayList* ret = NULL;
	GeeArrayList* _tmp1_;
	GeeArrayList* _tmp2_;
	GeeHashMap* _tmp3_;
	gpointer _tmp4_;
	GeeList* _tmp5_;
	GeeList* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (jid != NULL, NULL);
	_tmp0_ = self->priv->resources;
	if (!gee_abstract_map_has_key ((GeeAbstractMap*) _tmp0_, jid)) {
		result = NULL;
		return result;
	}
	_tmp1_ = gee_array_list_new (XMPP_TYPE_JID, (GBoxedCopyFunc) xmpp_jid_ref, (GDestroyNotify) xmpp_jid_unref, _xmpp_jid_equals_func_gee_equal_data_func, NULL, NULL);
	ret = _tmp1_;
	_tmp2_ = ret;
	_tmp3_ = self->priv->resources;
	_tmp4_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp3_, jid);
	_tmp5_ = (GeeList*) _tmp4_;
	gee_array_list_add_all (_tmp2_, (GeeCollection*) _tmp5_);
	_g_object_unref0 (_tmp5_);
	result = (GeeList*) ret;
	return result;
}

XmppPresenceStanza*
xmpp_presence_flag_get_presence (XmppPresenceFlag* self,
                                 XmppJid* full_jid)
{
	GeeHashMap* _tmp0_;
	gpointer _tmp1_;
	XmppPresenceStanza* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (full_jid != NULL, NULL);
	_tmp0_ = self->priv->presences;
	_tmp1_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp0_, full_jid);
	result = (XmppPresenceStanza*) _tmp1_;
	return result;
}

GeeList*
xmpp_presence_flag_get_presences (XmppPresenceFlag* self,
                                  XmppJid* jid)
{
	GeeList* ret = NULL;
	GeeArrayList* _tmp0_;
	GeeList* jid_res = NULL;
	GeeHashMap* _tmp1_;
	gpointer _tmp2_;
	GeeList* _tmp3_;
	GeeList* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (jid != NULL, NULL);
	_tmp0_ = gee_array_list_new (XMPP_PRESENCE_TYPE_STANZA, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	ret = (GeeList*) _tmp0_;
	_tmp1_ = self->priv->resources;
	_tmp2_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp1_, jid);
	jid_res = (GeeList*) _tmp2_;
	_tmp3_ = jid_res;
	if (_tmp3_ == NULL) {
		result = ret;
		_g_object_unref0 (jid_res);
		return result;
	}
	{
		GeeList* _full_jid_list = NULL;
		GeeList* _tmp4_;
		gint _full_jid_size = 0;
		GeeList* _tmp5_;
		gint _tmp6_;
		gint _tmp7_;
		gint _full_jid_index = 0;
		_tmp4_ = jid_res;
		_full_jid_list = _tmp4_;
		_tmp5_ = _full_jid_list;
		_tmp6_ = gee_collection_get_size ((GeeCollection*) _tmp5_);
		_tmp7_ = _tmp6_;
		_full_jid_size = _tmp7_;
		_full_jid_index = -1;
		while (TRUE) {
			gint _tmp8_;
			gint _tmp9_;
			XmppJid* full_jid = NULL;
			GeeList* _tmp10_;
			gpointer _tmp11_;
			GeeList* _tmp12_;
			GeeHashMap* _tmp13_;
			XmppJid* _tmp14_;
			gpointer _tmp15_;
			XmppPresenceStanza* _tmp16_;
			_full_jid_index = _full_jid_index + 1;
			_tmp8_ = _full_jid_index;
			_tmp9_ = _full_jid_size;
			if (!(_tmp8_ < _tmp9_)) {
				break;
			}
			_tmp10_ = _full_jid_list;
			_tmp11_ = gee_list_get (_tmp10_, _full_jid_index);
			full_jid = (XmppJid*) _tmp11_;
			_tmp12_ = ret;
			_tmp13_ = self->priv->presences;
			_tmp14_ = full_jid;
			_tmp15_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp13_, _tmp14_);
			_tmp16_ = (XmppPresenceStanza*) _tmp15_;
			gee_collection_add ((GeeCollection*) _tmp12_, _tmp16_);
			_g_object_unref0 (_tmp16_);
			_xmpp_jid_unref0 (full_jid);
		}
	}
	result = ret;
	_g_object_unref0 (jid_res);
	return result;
}

void
xmpp_presence_flag_add_presence (XmppPresenceFlag* self,
                                 XmppPresenceStanza* presence)
{
	GeeHashMap* _tmp0_;
	XmppJid* _tmp1_;
	XmppJid* _tmp2_;
	XmppJid* _tmp3_;
	gboolean _tmp4_;
	GeeHashMap* _tmp11_;
	XmppJid* _tmp12_;
	XmppJid* _tmp13_;
	XmppJid* _tmp14_;
	gpointer _tmp15_;
	GeeList* _tmp16_;
	XmppJid* _tmp17_;
	XmppJid* _tmp18_;
	XmppJid* _tmp19_;
	gboolean _tmp20_;
	GeeHashMap* _tmp30_;
	XmppJid* _tmp31_;
	XmppJid* _tmp32_;
	XmppJid* _tmp33_;
	gpointer _tmp34_;
	GeeList* _tmp35_;
	XmppJid* _tmp36_;
	XmppJid* _tmp37_;
	XmppJid* _tmp38_;
	GeeHashMap* _tmp39_;
	XmppJid* _tmp40_;
	XmppJid* _tmp41_;
	XmppJid* _tmp42_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (presence != NULL);
	_tmp0_ = self->priv->resources;
	_tmp1_ = xmpp_stanza_get_from ((XmppStanza*) presence);
	_tmp2_ = _tmp1_;
	_tmp3_ = _tmp2_;
	_tmp4_ = !gee_abstract_map_has_key ((GeeAbstractMap*) _tmp0_, _tmp3_);
	_xmpp_jid_unref0 (_tmp3_);
	if (_tmp4_) {
		GeeHashMap* _tmp5_;
		XmppJid* _tmp6_;
		XmppJid* _tmp7_;
		XmppJid* _tmp8_;
		GeeArrayList* _tmp9_;
		GeeArrayList* _tmp10_;
		_tmp5_ = self->priv->resources;
		_tmp6_ = xmpp_stanza_get_from ((XmppStanza*) presence);
		_tmp7_ = _tmp6_;
		_tmp8_ = _tmp7_;
		_tmp9_ = gee_array_list_new (XMPP_TYPE_JID, (GBoxedCopyFunc) xmpp_jid_ref, (GDestroyNotify) xmpp_jid_unref, _xmpp_jid_equals_func_gee_equal_data_func, NULL, NULL);
		_tmp10_ = _tmp9_;
		gee_abstract_map_set ((GeeAbstractMap*) _tmp5_, _tmp8_, (GeeList*) _tmp10_);
		_g_object_unref0 (_tmp10_);
		_xmpp_jid_unref0 (_tmp8_);
	}
	_tmp11_ = self->priv->resources;
	_tmp12_ = xmpp_stanza_get_from ((XmppStanza*) presence);
	_tmp13_ = _tmp12_;
	_tmp14_ = _tmp13_;
	_tmp15_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp11_, _tmp14_);
	_tmp16_ = (GeeList*) _tmp15_;
	_tmp17_ = xmpp_stanza_get_from ((XmppStanza*) presence);
	_tmp18_ = _tmp17_;
	_tmp19_ = _tmp18_;
	_tmp20_ = gee_collection_contains ((GeeCollection*) _tmp16_, _tmp19_);
	_xmpp_jid_unref0 (_tmp19_);
	_g_object_unref0 (_tmp16_);
	_xmpp_jid_unref0 (_tmp14_);
	if (_tmp20_) {
		GeeHashMap* _tmp21_;
		XmppJid* _tmp22_;
		XmppJid* _tmp23_;
		XmppJid* _tmp24_;
		gpointer _tmp25_;
		GeeList* _tmp26_;
		XmppJid* _tmp27_;
		XmppJid* _tmp28_;
		XmppJid* _tmp29_;
		_tmp21_ = self->priv->resources;
		_tmp22_ = xmpp_stanza_get_from ((XmppStanza*) presence);
		_tmp23_ = _tmp22_;
		_tmp24_ = _tmp23_;
		_tmp25_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp21_, _tmp24_);
		_tmp26_ = (GeeList*) _tmp25_;
		_tmp27_ = xmpp_stanza_get_from ((XmppStanza*) presence);
		_tmp28_ = _tmp27_;
		_tmp29_ = _tmp28_;
		gee_collection_remove ((GeeCollection*) _tmp26_, _tmp29_);
		_xmpp_jid_unref0 (_tmp29_);
		_g_object_unref0 (_tmp26_);
		_xmpp_jid_unref0 (_tmp24_);
	}
	_tmp30_ = self->priv->resources;
	_tmp31_ = xmpp_stanza_get_from ((XmppStanza*) presence);
	_tmp32_ = _tmp31_;
	_tmp33_ = _tmp32_;
	_tmp34_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp30_, _tmp33_);
	_tmp35_ = (GeeList*) _tmp34_;
	_tmp36_ = xmpp_stanza_get_from ((XmppStanza*) presence);
	_tmp37_ = _tmp36_;
	_tmp38_ = _tmp37_;
	gee_collection_add ((GeeCollection*) _tmp35_, _tmp38_);
	_xmpp_jid_unref0 (_tmp38_);
	_g_object_unref0 (_tmp35_);
	_xmpp_jid_unref0 (_tmp33_);
	_tmp39_ = self->priv->presences;
	_tmp40_ = xmpp_stanza_get_from ((XmppStanza*) presence);
	_tmp41_ = _tmp40_;
	_tmp42_ = _tmp41_;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp39_, _tmp42_, presence);
	_xmpp_jid_unref0 (_tmp42_);
}

void
xmpp_presence_flag_remove_presence (XmppPresenceFlag* self,
                                    XmppJid* jid)
{
	GeeHashMap* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (jid != NULL);
	_tmp0_ = self->priv->resources;
	if (gee_abstract_map_has_key ((GeeAbstractMap*) _tmp0_, jid)) {
		if (xmpp_jid_is_bare (jid)) {
			GeeHashMap* _tmp12_;
			{
				GeeList* _full_jid_list = NULL;
				GeeHashMap* _tmp1_;
				gpointer _tmp2_;
				gint _full_jid_size = 0;
				GeeList* _tmp3_;
				gint _tmp4_;
				gint _tmp5_;
				gint _full_jid_index = 0;
				_tmp1_ = self->priv->resources;
				_tmp2_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp1_, jid);
				_full_jid_list = (GeeList*) _tmp2_;
				_tmp3_ = _full_jid_list;
				_tmp4_ = gee_collection_get_size ((GeeCollection*) _tmp3_);
				_tmp5_ = _tmp4_;
				_full_jid_size = _tmp5_;
				_full_jid_index = -1;
				while (TRUE) {
					gint _tmp6_;
					gint _tmp7_;
					XmppJid* full_jid = NULL;
					GeeList* _tmp8_;
					gpointer _tmp9_;
					GeeHashMap* _tmp10_;
					XmppJid* _tmp11_;
					_full_jid_index = _full_jid_index + 1;
					_tmp6_ = _full_jid_index;
					_tmp7_ = _full_jid_size;
					if (!(_tmp6_ < _tmp7_)) {
						break;
					}
					_tmp8_ = _full_jid_list;
					_tmp9_ = gee_list_get (_tmp8_, _full_jid_index);
					full_jid = (XmppJid*) _tmp9_;
					_tmp10_ = self->priv->presences;
					_tmp11_ = full_jid;
					gee_abstract_map_unset ((GeeAbstractMap*) _tmp10_, _tmp11_, NULL);
					_xmpp_jid_unref0 (full_jid);
				}
				_g_object_unref0 (_full_jid_list);
			}
			_tmp12_ = self->priv->resources;
			gee_abstract_map_unset ((GeeAbstractMap*) _tmp12_, jid, NULL);
		} else {
			GeeHashMap* _tmp13_;
			gpointer _tmp14_;
			GeeList* _tmp15_;
			GeeHashMap* _tmp16_;
			gpointer _tmp17_;
			GeeList* _tmp18_;
			gint _tmp19_;
			gint _tmp20_;
			gboolean _tmp21_;
			GeeHashMap* _tmp23_;
			_tmp13_ = self->priv->resources;
			_tmp14_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp13_, jid);
			_tmp15_ = (GeeList*) _tmp14_;
			gee_collection_remove ((GeeCollection*) _tmp15_, jid);
			_g_object_unref0 (_tmp15_);
			_tmp16_ = self->priv->resources;
			_tmp17_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp16_, jid);
			_tmp18_ = (GeeList*) _tmp17_;
			_tmp19_ = gee_collection_get_size ((GeeCollection*) _tmp18_);
			_tmp20_ = _tmp19_;
			_tmp21_ = _tmp20_ == 0;
			_g_object_unref0 (_tmp18_);
			if (_tmp21_) {
				GeeHashMap* _tmp22_;
				_tmp22_ = self->priv->resources;
				gee_abstract_map_unset ((GeeAbstractMap*) _tmp22_, jid, NULL);
			}
			_tmp23_ = self->priv->presences;
			gee_abstract_map_unset ((GeeAbstractMap*) _tmp23_, jid, NULL);
		}
	}
}

static gchar*
xmpp_presence_flag_real_get_ns (XmppXmppStreamFlag* base)
{
	XmppPresenceFlag * self;
	gchar* _tmp0_;
	gchar* result;
	self = (XmppPresenceFlag*) base;
	_tmp0_ = g_strdup (XMPP_PRESENCE_NS_URI);
	result = _tmp0_;
	return result;
}

static gchar*
xmpp_presence_flag_real_get_id (XmppXmppStreamFlag* base)
{
	XmppPresenceFlag * self;
	XmppFlagIdentity* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* result;
	self = (XmppPresenceFlag*) base;
	_tmp0_ = xmpp_presence_flag_IDENTITY;
	_tmp1_ = xmpp_flag_identity_get_id (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = g_strdup (_tmp2_);
	result = _tmp3_;
	return result;
}

XmppPresenceFlag*
xmpp_presence_flag_construct (GType object_type)
{
	XmppPresenceFlag * self = NULL;
	self = (XmppPresenceFlag*) xmpp_xmpp_stream_flag_construct (object_type);
	return self;
}

XmppPresenceFlag*
xmpp_presence_flag_new (void)
{
	return xmpp_presence_flag_construct (XMPP_PRESENCE_TYPE_FLAG);
}

static void
xmpp_presence_flag_class_init (XmppPresenceFlagClass * klass,
                               gpointer klass_data)
{
	XmppFlagIdentity* _tmp0_;
	xmpp_presence_flag_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &XmppPresenceFlag_private_offset);
	((XmppXmppStreamFlagClass *) klass)->get_ns = (gchar* (*) (XmppXmppStreamFlag*)) xmpp_presence_flag_real_get_ns;
	((XmppXmppStreamFlagClass *) klass)->get_id = (gchar* (*) (XmppXmppStreamFlag*)) xmpp_presence_flag_real_get_id;
	G_OBJECT_CLASS (klass)->finalize = xmpp_presence_flag_finalize;
	_tmp0_ = xmpp_flag_identity_new (XMPP_PRESENCE_TYPE_FLAG, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, XMPP_PRESENCE_NS_URI, "presence");
	xmpp_presence_flag_IDENTITY = _tmp0_;
}

static void
xmpp_presence_flag_instance_init (XmppPresenceFlag * self,
                                  gpointer klass)
{
	GeeHashMap* _tmp0_;
	GeeHashMap* _tmp1_;
	self->priv = xmpp_presence_flag_get_instance_private (self);
	_tmp0_ = gee_hash_map_new (XMPP_TYPE_JID, (GBoxedCopyFunc) xmpp_jid_ref, (GDestroyNotify) xmpp_jid_unref, GEE_TYPE_LIST, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _xmpp_jid_hash_bare_func_gee_hash_data_func, NULL, NULL, _xmpp_jid_equals_bare_func_gee_equal_data_func, NULL, NULL, NULL, NULL, NULL);
	self->priv->resources = _tmp0_;
	_tmp1_ = gee_hash_map_new (XMPP_TYPE_JID, (GBoxedCopyFunc) xmpp_jid_ref, (GDestroyNotify) xmpp_jid_unref, XMPP_PRESENCE_TYPE_STANZA, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _xmpp_jid_hash_func_gee_hash_data_func, NULL, NULL, _xmpp_jid_equals_func_gee_equal_data_func, NULL, NULL, NULL, NULL, NULL);
	self->priv->presences = _tmp1_;
}

static void
xmpp_presence_flag_finalize (GObject * obj)
{
	XmppPresenceFlag * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, XMPP_PRESENCE_TYPE_FLAG, XmppPresenceFlag);
	_g_object_unref0 (self->priv->resources);
	_g_object_unref0 (self->priv->presences);
	G_OBJECT_CLASS (xmpp_presence_flag_parent_class)->finalize (obj);
}

static GType
xmpp_presence_flag_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (XmppPresenceFlagClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) xmpp_presence_flag_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (XmppPresenceFlag), 0, (GInstanceInitFunc) xmpp_presence_flag_instance_init, NULL };
	GType xmpp_presence_flag_type_id;
	xmpp_presence_flag_type_id = g_type_register_static (XMPP_TYPE_XMPP_STREAM_FLAG, "XmppPresenceFlag", &g_define_type_info, 0);
	XmppPresenceFlag_private_offset = g_type_add_instance_private (xmpp_presence_flag_type_id, sizeof (XmppPresenceFlagPrivate));
	return xmpp_presence_flag_type_id;
}

GType
xmpp_presence_flag_get_type (void)
{
	static volatile gsize xmpp_presence_flag_type_id__once = 0;
	if (g_once_init_enter (&xmpp_presence_flag_type_id__once)) {
		GType xmpp_presence_flag_type_id;
		xmpp_presence_flag_type_id = xmpp_presence_flag_get_type_once ();
		g_once_init_leave (&xmpp_presence_flag_type_id__once, xmpp_presence_flag_type_id);
	}
	return xmpp_presence_flag_type_id__once;
}

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;
}

