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

/*
Copyright (C) 2012 2013 2014 Johan Mattsson

This library is free software; you can redistribute it and/or modify 
it under the terms of the GNU Lesser General Public License as 
published by the Free Software Foundation; either version 3 of the 
License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but 
WITHOUT ANY WARRANTY; without even the implied warranty of 
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 
Lesser General Public License for more details.
*/

#include "birdfont.h"
#include <gee.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gio/gio.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

enum  {
	BIRD_FONT_DIRECTORY_TABLE_0_PROPERTY,
	BIRD_FONT_DIRECTORY_TABLE_NUM_PROPERTIES
};
static GParamSpec* bird_font_directory_table_properties[BIRD_FONT_DIRECTORY_TABLE_NUM_PROPERTIES];
#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_string_free0(var) ((var == NULL) ? NULL : (var = (g_string_free (var, TRUE), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))

struct _BirdFontDirectoryTablePrivate {
	GeeArrayList* tables;
};

static gint BirdFontDirectoryTable_private_offset;
static gpointer bird_font_directory_table_parent_class = NULL;

static gboolean bird_font_directory_table_validate_checksum_for_entire_font (BirdFontDirectoryTable* self,
                                                                      BirdFontFontData* dis,
                                                                      GFile* f,
                                                                      GError** error);
static void bird_font_directory_table_finalize (GObject * obj);
static GType bird_font_directory_table_get_type_once (void);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
bird_font_directory_table_get_instance_private (BirdFontDirectoryTable* self)
{
	return G_STRUCT_MEMBER_P (self, BirdFontDirectoryTable_private_offset);
}

BirdFontDirectoryTable*
bird_font_directory_table_construct (GType object_type)
{
	BirdFontDirectoryTable * self = NULL;
	BirdFontOffsetTable* _tmp0_;
	BirdFontLocaTable* _tmp1_;
	BirdFontGaspTable* _tmp2_;
	BirdFontGdefTable* _tmp3_;
	BirdFontLocaTable* _tmp4_;
	BirdFontGlyfTable* _tmp5_;
	BirdFontGlyfTable* _tmp6_;
	BirdFontGsubTable* _tmp7_;
	BirdFontGlyfTable* _tmp8_;
	BirdFontCmapTable* _tmp9_;
	BirdFontCvtTable* _tmp10_;
	BirdFontGlyfTable* _tmp11_;
	BirdFontHeadTable* _tmp12_;
	BirdFontHeadTable* _tmp13_;
	BirdFontGlyfTable* _tmp14_;
	BirdFontHmtxTable* _tmp15_;
	BirdFontGlyfTable* _tmp16_;
	BirdFontHeadTable* _tmp17_;
	BirdFontHmtxTable* _tmp18_;
	BirdFontHheaTable* _tmp19_;
	BirdFontGlyfTable* _tmp20_;
	BirdFontKernTable* _tmp21_;
	BirdFontGposTable* _tmp22_;
	BirdFontGlyfTable* _tmp23_;
	BirdFontMaxpTable* _tmp24_;
	BirdFontNameTable* _tmp25_;
	BirdFontGlyfTable* _tmp26_;
	BirdFontHmtxTable* _tmp27_;
	BirdFontHheaTable* _tmp28_;
	BirdFontOs2Table* _tmp29_;
	BirdFontGlyfTable* _tmp30_;
	BirdFontPostTable* _tmp31_;
	BirdFontGlyfTable* _tmp32_;
	BirdFontKernTable* _tmp33_;
	BirdFontFkTable* _tmp34_;
	gchar* _tmp35_;
	GeeArrayList* _tmp36_;
	self = (BirdFontDirectoryTable*) bird_font_otf_table_construct (object_type);
	_tmp0_ = bird_font_offset_table_new (self);
	_g_object_unref0 (self->offset_table);
	self->offset_table = _tmp0_;
	_tmp1_ = bird_font_loca_table_new ();
	_g_object_unref0 (self->loca_table);
	self->loca_table = _tmp1_;
	_tmp2_ = bird_font_gasp_table_new ();
	_g_object_unref0 (self->gasp_table);
	self->gasp_table = _tmp2_;
	_tmp3_ = bird_font_gdef_table_new ();
	_g_object_unref0 (self->gdef_table);
	self->gdef_table = _tmp3_;
	_tmp4_ = self->loca_table;
	_tmp5_ = bird_font_glyf_table_new (_tmp4_);
	_g_object_unref0 (self->glyf_table);
	self->glyf_table = _tmp5_;
	_tmp6_ = self->glyf_table;
	_tmp7_ = bird_font_gsub_table_new (_tmp6_);
	_g_object_unref0 (self->gsub_table);
	self->gsub_table = _tmp7_;
	_tmp8_ = self->glyf_table;
	_tmp9_ = bird_font_cmap_table_new (_tmp8_);
	_g_object_unref0 (self->cmap_table);
	self->cmap_table = _tmp9_;
	_tmp10_ = bird_font_cvt_table_new ();
	_g_object_unref0 (self->cvt_table);
	self->cvt_table = _tmp10_;
	_tmp11_ = self->glyf_table;
	_tmp12_ = bird_font_head_table_new (_tmp11_);
	_g_object_unref0 (self->head_table);
	self->head_table = _tmp12_;
	_tmp13_ = self->head_table;
	_tmp14_ = self->glyf_table;
	_tmp15_ = bird_font_hmtx_table_new (_tmp13_, _tmp14_);
	_g_object_unref0 (self->hmtx_table);
	self->hmtx_table = _tmp15_;
	_tmp16_ = self->glyf_table;
	_tmp17_ = self->head_table;
	_tmp18_ = self->hmtx_table;
	_tmp19_ = bird_font_hhea_table_new (_tmp16_, _tmp17_, _tmp18_);
	_g_object_unref0 (self->hhea_table);
	self->hhea_table = _tmp19_;
	_tmp20_ = self->glyf_table;
	_tmp21_ = bird_font_kern_table_new (_tmp20_);
	_g_object_unref0 (self->kern_table);
	self->kern_table = _tmp21_;
	_tmp22_ = bird_font_gpos_table_new ();
	_g_object_unref0 (self->gpos_table);
	self->gpos_table = _tmp22_;
	_tmp23_ = self->glyf_table;
	_tmp24_ = bird_font_maxp_table_new (_tmp23_);
	_g_object_unref0 (self->maxp_table);
	self->maxp_table = _tmp24_;
	_tmp25_ = bird_font_name_table_new ();
	_g_object_unref0 (self->name_table);
	self->name_table = _tmp25_;
	_tmp26_ = self->glyf_table;
	_tmp27_ = self->hmtx_table;
	_tmp28_ = self->hhea_table;
	_tmp29_ = bird_font_os2_table_new (_tmp26_, _tmp27_, _tmp28_);
	_g_object_unref0 (self->os_2_table);
	self->os_2_table = _tmp29_;
	_tmp30_ = self->glyf_table;
	_tmp31_ = bird_font_post_table_new (_tmp30_);
	_g_object_unref0 (self->post_table);
	self->post_table = _tmp31_;
	_tmp32_ = self->glyf_table;
	_tmp33_ = self->kern_table;
	_tmp34_ = bird_font_fk_table_new (_tmp32_, _tmp33_);
	_g_object_unref0 (self->fk_table);
	self->fk_table = _tmp34_;
	_tmp35_ = g_strdup ("Directory table");
	_g_free0 (((BirdFontOtfTable*) self)->id);
	((BirdFontOtfTable*) self)->id = _tmp35_;
	_tmp36_ = gee_array_list_new (BIRD_FONT_TYPE_OTF_TABLE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	_g_object_unref0 (self->priv->tables);
	self->priv->tables = _tmp36_;
	return self;
}

BirdFontDirectoryTable*
bird_font_directory_table_new (void)
{
	return bird_font_directory_table_construct (BIRD_FONT_TYPE_DIRECTORY_TABLE);
}

void
bird_font_directory_table_process (BirdFontDirectoryTable* self,
                                   GError** error)
{
	BirdFontGlyfTable* _tmp0_;
	BirdFontGsubTable* _tmp1_;
	BirdFontGaspTable* _tmp2_;
	BirdFontGdefTable* _tmp3_;
	BirdFontCmapTable* _tmp4_;
	BirdFontGlyfTable* _tmp5_;
	BirdFontCvtTable* _tmp6_;
	BirdFontHmtxTable* _tmp7_;
	BirdFontHheaTable* _tmp8_;
	BirdFontMaxpTable* _tmp9_;
	BirdFontNameTable* _tmp10_;
	BirdFontOs2Table* _tmp11_;
	BirdFontHeadTable* _tmp12_;
	BirdFontLocaTable* _tmp13_;
	BirdFontGlyfTable* _tmp14_;
	BirdFontHeadTable* _tmp15_;
	BirdFontPostTable* _tmp16_;
	BirdFontKernTable* _tmp17_;
	BirdFontGposTable* _tmp18_;
	BirdFontGlyfTable* _tmp19_;
	BirdFontOffsetTable* _tmp20_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->glyf_table;
	bird_font_glyf_table_process (_tmp0_, &_inner_error0_);
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		return;
	}
	_tmp1_ = self->gsub_table;
	bird_font_gsub_table_process (_tmp1_, &_inner_error0_);
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		return;
	}
	_tmp2_ = self->gasp_table;
	bird_font_gasp_table_process (_tmp2_, &_inner_error0_);
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		return;
	}
	_tmp3_ = self->gdef_table;
	bird_font_gdef_table_process (_tmp3_, &_inner_error0_);
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		return;
	}
	_tmp4_ = self->cmap_table;
	_tmp5_ = self->glyf_table;
	bird_font_cmap_table_process (_tmp4_, _tmp5_, &_inner_error0_);
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		return;
	}
	_tmp6_ = self->cvt_table;
	bird_font_cvt_table_process (_tmp6_, &_inner_error0_);
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		return;
	}
	_tmp7_ = self->hmtx_table;
	bird_font_hmtx_table_process (_tmp7_);
	_tmp8_ = self->hhea_table;
	bird_font_hhea_table_process (_tmp8_, &_inner_error0_);
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		return;
	}
	_tmp9_ = self->maxp_table;
	bird_font_maxp_table_process (_tmp9_);
	_tmp10_ = self->name_table;
	bird_font_name_table_process (_tmp10_, &_inner_error0_);
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		return;
	}
	_tmp11_ = self->os_2_table;
	bird_font_os2_table_process (_tmp11_);
	_tmp12_ = self->head_table;
	bird_font_head_table_process (_tmp12_, &_inner_error0_);
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		return;
	}
	_tmp13_ = self->loca_table;
	_tmp14_ = self->glyf_table;
	_tmp15_ = self->head_table;
	bird_font_loca_table_process (_tmp13_, _tmp14_, _tmp15_);
	_tmp16_ = self->post_table;
	bird_font_post_table_process (_tmp16_, &_inner_error0_);
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		return;
	}
	_tmp17_ = self->kern_table;
	bird_font_kern_table_process (_tmp17_, &_inner_error0_);
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		return;
	}
	_tmp18_ = self->gpos_table;
	_tmp19_ = self->glyf_table;
	bird_font_gpos_table_process (_tmp18_, _tmp19_, &_inner_error0_);
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		return;
	}
	_tmp20_ = self->offset_table;
	bird_font_offset_table_process (_tmp20_, &_inner_error0_);
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		return;
	}
	bird_font_directory_table_process_directory (self, &_inner_error0_);
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		return;
	}
}

void
bird_font_directory_table_process_mac (BirdFontDirectoryTable* self,
                                       GError** error)
{
	BirdFontOs2Table* _tmp0_;
	BirdFontOffsetTable* _tmp1_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->os_2_table;
	bird_font_os2_table_process_mac (_tmp0_);
	_tmp1_ = self->offset_table;
	bird_font_offset_table_process (_tmp1_, &_inner_error0_);
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		return;
	}
	bird_font_directory_table_process_directory (self, &_inner_error0_);
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		return;
	}
}

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

GeeArrayList*
bird_font_directory_table_get_tables (BirdFontDirectoryTable* self)
{
	GeeArrayList* _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	GeeArrayList* _tmp36_;
	GeeArrayList* _tmp37_;
	GeeArrayList* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->tables;
	_tmp1_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_ == 0) {
		GeeArrayList* _tmp3_;
		BirdFontOffsetTable* _tmp4_;
		GeeArrayList* _tmp5_;
		GeeArrayList* _tmp6_;
		BirdFontFkTable* _tmp7_;
		GeeArrayList* _tmp8_;
		BirdFontGposTable* _tmp9_;
		GeeArrayList* _tmp10_;
		BirdFontGsubTable* _tmp11_;
		GeeArrayList* _tmp12_;
		BirdFontOs2Table* _tmp13_;
		GeeArrayList* _tmp14_;
		BirdFontCmapTable* _tmp15_;
		GeeArrayList* _tmp16_;
		BirdFontGaspTable* _tmp17_;
		GeeArrayList* _tmp18_;
		BirdFontGlyfTable* _tmp19_;
		GeeArrayList* _tmp20_;
		BirdFontHeadTable* _tmp21_;
		GeeArrayList* _tmp22_;
		BirdFontHheaTable* _tmp23_;
		GeeArrayList* _tmp24_;
		BirdFontHmtxTable* _tmp25_;
		GeeArrayList* _tmp26_;
		BirdFontKernTable* _tmp27_;
		GeeArrayList* _tmp28_;
		BirdFontLocaTable* _tmp29_;
		GeeArrayList* _tmp30_;
		BirdFontMaxpTable* _tmp31_;
		GeeArrayList* _tmp32_;
		BirdFontNameTable* _tmp33_;
		GeeArrayList* _tmp34_;
		BirdFontPostTable* _tmp35_;
		_tmp3_ = self->priv->tables;
		_tmp4_ = self->offset_table;
		gee_abstract_collection_add ((GeeAbstractCollection*) _tmp3_, (BirdFontOtfTable*) _tmp4_);
		_tmp5_ = self->priv->tables;
		gee_abstract_collection_add ((GeeAbstractCollection*) _tmp5_, (BirdFontOtfTable*) self);
		_tmp6_ = self->priv->tables;
		_tmp7_ = self->fk_table;
		gee_abstract_collection_add ((GeeAbstractCollection*) _tmp6_, (BirdFontOtfTable*) _tmp7_);
		_tmp8_ = self->priv->tables;
		_tmp9_ = self->gpos_table;
		gee_abstract_collection_add ((GeeAbstractCollection*) _tmp8_, (BirdFontOtfTable*) _tmp9_);
		_tmp10_ = self->priv->tables;
		_tmp11_ = self->gsub_table;
		gee_abstract_collection_add ((GeeAbstractCollection*) _tmp10_, (BirdFontOtfTable*) _tmp11_);
		_tmp12_ = self->priv->tables;
		_tmp13_ = self->os_2_table;
		gee_abstract_collection_add ((GeeAbstractCollection*) _tmp12_, (BirdFontOtfTable*) _tmp13_);
		_tmp14_ = self->priv->tables;
		_tmp15_ = self->cmap_table;
		gee_abstract_collection_add ((GeeAbstractCollection*) _tmp14_, (BirdFontOtfTable*) _tmp15_);
		_tmp16_ = self->priv->tables;
		_tmp17_ = self->gasp_table;
		gee_abstract_collection_add ((GeeAbstractCollection*) _tmp16_, (BirdFontOtfTable*) _tmp17_);
		_tmp18_ = self->priv->tables;
		_tmp19_ = self->glyf_table;
		gee_abstract_collection_add ((GeeAbstractCollection*) _tmp18_, (BirdFontOtfTable*) _tmp19_);
		_tmp20_ = self->priv->tables;
		_tmp21_ = self->head_table;
		gee_abstract_collection_add ((GeeAbstractCollection*) _tmp20_, (BirdFontOtfTable*) _tmp21_);
		_tmp22_ = self->priv->tables;
		_tmp23_ = self->hhea_table;
		gee_abstract_collection_add ((GeeAbstractCollection*) _tmp22_, (BirdFontOtfTable*) _tmp23_);
		_tmp24_ = self->priv->tables;
		_tmp25_ = self->hmtx_table;
		gee_abstract_collection_add ((GeeAbstractCollection*) _tmp24_, (BirdFontOtfTable*) _tmp25_);
		_tmp26_ = self->priv->tables;
		_tmp27_ = self->kern_table;
		gee_abstract_collection_add ((GeeAbstractCollection*) _tmp26_, (BirdFontOtfTable*) _tmp27_);
		_tmp28_ = self->priv->tables;
		_tmp29_ = self->loca_table;
		gee_abstract_collection_add ((GeeAbstractCollection*) _tmp28_, (BirdFontOtfTable*) _tmp29_);
		_tmp30_ = self->priv->tables;
		_tmp31_ = self->maxp_table;
		gee_abstract_collection_add ((GeeAbstractCollection*) _tmp30_, (BirdFontOtfTable*) _tmp31_);
		_tmp32_ = self->priv->tables;
		_tmp33_ = self->name_table;
		gee_abstract_collection_add ((GeeAbstractCollection*) _tmp32_, (BirdFontOtfTable*) _tmp33_);
		_tmp34_ = self->priv->tables;
		_tmp35_ = self->post_table;
		gee_abstract_collection_add ((GeeAbstractCollection*) _tmp34_, (BirdFontOtfTable*) _tmp35_);
	}
	_tmp36_ = self->priv->tables;
	_tmp37_ = _g_object_ref0 (_tmp36_);
	result = _tmp37_;
	return result;
}

void
bird_font_directory_table_set_offset_table (BirdFontDirectoryTable* self,
                                            BirdFontOffsetTable* ot)
{
	BirdFontOffsetTable* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (ot != NULL);
	_tmp0_ = _g_object_ref0 (ot);
	_g_object_unref0 (self->offset_table);
	self->offset_table = _tmp0_;
}

static const gchar*
string_to_string (const gchar* self)
{
	const gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	result = self;
	return result;
}

void
bird_font_directory_table_parse (BirdFontDirectoryTable* self,
                                 BirdFontFontData* dis,
                                 BirdFontOpenFontFormatReader* reader_callback,
                                 GError** error)
{
	GString* tag = NULL;
	GString* _tmp0_;
	guint32 checksum = 0U;
	guint32 offset = 0U;
	guint32 length = 0U;
	BirdFontOffsetTable* _tmp1_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (dis != NULL);
	g_return_if_fail (reader_callback != NULL);
	_tmp0_ = g_string_new ("");
	tag = _tmp0_;
	_tmp1_ = self->offset_table;
	g_return_if_fail (((gint) _tmp1_->num_tables) > 0);
	{
		guint i = 0U;
		i = (guint) 0;
		{
			gboolean _tmp2_ = FALSE;
			_tmp2_ = TRUE;
			while (TRUE) {
				BirdFontOffsetTable* _tmp4_;
				GString* _tmp5_;
				guint8 _tmp6_ = 0U;
				GString* _tmp7_;
				guint8 _tmp8_ = 0U;
				GString* _tmp9_;
				guint8 _tmp10_ = 0U;
				GString* _tmp11_;
				guint8 _tmp12_ = 0U;
				GString* _tmp13_;
				GString* _tmp14_;
				const gchar* _tmp15_;
				const gchar* _tmp16_;
				gchar* _tmp17_;
				gchar* _tmp18_;
				gchar* _tmp19_;
				gchar* _tmp20_;
				gchar* _tmp21_;
				gchar* _tmp22_;
				gchar* _tmp23_;
				gchar* _tmp24_;
				GString* _tmp25_;
				const gchar* _tmp26_;
				if (!_tmp2_) {
					guint _tmp3_;
					_tmp3_ = i;
					i = _tmp3_ + 1;
				}
				_tmp2_ = FALSE;
				_tmp4_ = self->offset_table;
				if (!(i < ((guint) _tmp4_->num_tables))) {
					break;
				}
				_tmp5_ = tag;
				g_string_erase (_tmp5_, (gssize) 0, (gssize) -1);
				_tmp6_ = bird_font_font_data_read_byte (dis, &_inner_error0_);
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					g_propagate_error (error, _inner_error0_);
					_g_string_free0 (tag);
					return;
				}
				_tmp7_ = tag;
				g_string_append_unichar (_tmp7_, (gunichar) _tmp6_);
				_tmp8_ = bird_font_font_data_read_byte (dis, &_inner_error0_);
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					g_propagate_error (error, _inner_error0_);
					_g_string_free0 (tag);
					return;
				}
				_tmp9_ = tag;
				g_string_append_unichar (_tmp9_, (gunichar) _tmp8_);
				_tmp10_ = bird_font_font_data_read_byte (dis, &_inner_error0_);
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					g_propagate_error (error, _inner_error0_);
					_g_string_free0 (tag);
					return;
				}
				_tmp11_ = tag;
				g_string_append_unichar (_tmp11_, (gunichar) _tmp10_);
				_tmp12_ = bird_font_font_data_read_byte (dis, &_inner_error0_);
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					g_propagate_error (error, _inner_error0_);
					_g_string_free0 (tag);
					return;
				}
				_tmp13_ = tag;
				g_string_append_unichar (_tmp13_, (gunichar) _tmp12_);
				checksum = bird_font_font_data_read_ulong (dis);
				offset = bird_font_font_data_read_ulong (dis);
				length = bird_font_font_data_read_ulong (dis);
				_tmp14_ = tag;
				_tmp15_ = _tmp14_->str;
				_tmp16_ = string_to_string (_tmp15_);
				_tmp17_ = g_strdup_printf ("%u", offset);
				_tmp18_ = _tmp17_;
				_tmp19_ = g_strdup_printf ("%u", length);
				_tmp20_ = _tmp19_;
				_tmp21_ = g_strdup_printf ("%u", checksum);
				_tmp22_ = _tmp21_;
				_tmp23_ = g_strconcat (_tmp16_, " \toffset: ", _tmp18_, " \tlength: ", _tmp20_, " \tchecksum: ", _tmp22_, ".\n", NULL);
				_tmp24_ = _tmp23_;
				bird_font_printd (_tmp24_);
				_g_free0 (_tmp24_);
				_g_free0 (_tmp22_);
				_g_free0 (_tmp20_);
				_g_free0 (_tmp18_);
				_tmp25_ = tag;
				_tmp26_ = _tmp25_->str;
				if (g_strcmp0 (_tmp26_, "FK  ") == 0) {
					BirdFontFkTable* _tmp27_;
					GString* _tmp28_;
					const gchar* _tmp29_;
					gchar* _tmp30_;
					BirdFontFkTable* _tmp31_;
					BirdFontFkTable* _tmp32_;
					BirdFontFkTable* _tmp33_;
					_tmp27_ = self->fk_table;
					_tmp28_ = tag;
					_tmp29_ = _tmp28_->str;
					_tmp30_ = g_strdup (_tmp29_);
					_g_free0 (((BirdFontOtfTable*) _tmp27_)->id);
					((BirdFontOtfTable*) _tmp27_)->id = _tmp30_;
					_tmp31_ = self->fk_table;
					((BirdFontOtfTable*) _tmp31_)->checksum = checksum;
					_tmp32_ = self->fk_table;
					((BirdFontOtfTable*) _tmp32_)->offset = offset;
					_tmp33_ = self->fk_table;
					((BirdFontOtfTable*) _tmp33_)->length = length;
				} else {
					GString* _tmp34_;
					const gchar* _tmp35_;
					_tmp34_ = tag;
					_tmp35_ = _tmp34_->str;
					if (g_strcmp0 (_tmp35_, "cvt") == 0) {
						BirdFontCvtTable* _tmp36_;
						GString* _tmp37_;
						const gchar* _tmp38_;
						gchar* _tmp39_;
						BirdFontCvtTable* _tmp40_;
						BirdFontCvtTable* _tmp41_;
						BirdFontCvtTable* _tmp42_;
						_tmp36_ = self->cvt_table;
						_tmp37_ = tag;
						_tmp38_ = _tmp37_->str;
						_tmp39_ = g_strdup (_tmp38_);
						_g_free0 (((BirdFontOtfTable*) _tmp36_)->id);
						((BirdFontOtfTable*) _tmp36_)->id = _tmp39_;
						_tmp40_ = self->cvt_table;
						((BirdFontOtfTable*) _tmp40_)->checksum = checksum;
						_tmp41_ = self->cvt_table;
						((BirdFontOtfTable*) _tmp41_)->offset = offset;
						_tmp42_ = self->cvt_table;
						((BirdFontOtfTable*) _tmp42_)->length = length;
					} else {
						GString* _tmp43_;
						const gchar* _tmp44_;
						_tmp43_ = tag;
						_tmp44_ = _tmp43_->str;
						if (g_strcmp0 (_tmp44_, "hmtx") == 0) {
							BirdFontHmtxTable* _tmp45_;
							GString* _tmp46_;
							const gchar* _tmp47_;
							gchar* _tmp48_;
							BirdFontHmtxTable* _tmp49_;
							BirdFontHmtxTable* _tmp50_;
							BirdFontHmtxTable* _tmp51_;
							_tmp45_ = self->hmtx_table;
							_tmp46_ = tag;
							_tmp47_ = _tmp46_->str;
							_tmp48_ = g_strdup (_tmp47_);
							_g_free0 (((BirdFontOtfTable*) _tmp45_)->id);
							((BirdFontOtfTable*) _tmp45_)->id = _tmp48_;
							_tmp49_ = self->hmtx_table;
							((BirdFontOtfTable*) _tmp49_)->checksum = checksum;
							_tmp50_ = self->hmtx_table;
							((BirdFontOtfTable*) _tmp50_)->offset = offset;
							_tmp51_ = self->hmtx_table;
							((BirdFontOtfTable*) _tmp51_)->length = length;
						} else {
							GString* _tmp52_;
							const gchar* _tmp53_;
							_tmp52_ = tag;
							_tmp53_ = _tmp52_->str;
							if (g_strcmp0 (_tmp53_, "hhea") == 0) {
								BirdFontHheaTable* _tmp54_;
								GString* _tmp55_;
								const gchar* _tmp56_;
								gchar* _tmp57_;
								BirdFontHheaTable* _tmp58_;
								BirdFontHheaTable* _tmp59_;
								BirdFontHheaTable* _tmp60_;
								_tmp54_ = self->hhea_table;
								_tmp55_ = tag;
								_tmp56_ = _tmp55_->str;
								_tmp57_ = g_strdup (_tmp56_);
								_g_free0 (((BirdFontOtfTable*) _tmp54_)->id);
								((BirdFontOtfTable*) _tmp54_)->id = _tmp57_;
								_tmp58_ = self->hhea_table;
								((BirdFontOtfTable*) _tmp58_)->checksum = checksum;
								_tmp59_ = self->hhea_table;
								((BirdFontOtfTable*) _tmp59_)->offset = offset;
								_tmp60_ = self->hhea_table;
								((BirdFontOtfTable*) _tmp60_)->length = length;
							} else {
								GString* _tmp61_;
								const gchar* _tmp62_;
								_tmp61_ = tag;
								_tmp62_ = _tmp61_->str;
								if (g_strcmp0 (_tmp62_, "loca") == 0) {
									BirdFontLocaTable* _tmp63_;
									GString* _tmp64_;
									const gchar* _tmp65_;
									gchar* _tmp66_;
									BirdFontLocaTable* _tmp67_;
									BirdFontLocaTable* _tmp68_;
									BirdFontLocaTable* _tmp69_;
									_tmp63_ = self->loca_table;
									_tmp64_ = tag;
									_tmp65_ = _tmp64_->str;
									_tmp66_ = g_strdup (_tmp65_);
									_g_free0 (((BirdFontOtfTable*) _tmp63_)->id);
									((BirdFontOtfTable*) _tmp63_)->id = _tmp66_;
									_tmp67_ = self->loca_table;
									((BirdFontOtfTable*) _tmp67_)->checksum = checksum;
									_tmp68_ = self->loca_table;
									((BirdFontOtfTable*) _tmp68_)->offset = offset;
									_tmp69_ = self->loca_table;
									((BirdFontOtfTable*) _tmp69_)->length = length;
								} else {
									GString* _tmp70_;
									const gchar* _tmp71_;
									_tmp70_ = tag;
									_tmp71_ = _tmp70_->str;
									if (g_strcmp0 (_tmp71_, "cmap") == 0) {
										BirdFontCmapTable* _tmp72_;
										GString* _tmp73_;
										const gchar* _tmp74_;
										gchar* _tmp75_;
										BirdFontCmapTable* _tmp76_;
										BirdFontCmapTable* _tmp77_;
										BirdFontCmapTable* _tmp78_;
										_tmp72_ = self->cmap_table;
										_tmp73_ = tag;
										_tmp74_ = _tmp73_->str;
										_tmp75_ = g_strdup (_tmp74_);
										_g_free0 (((BirdFontOtfTable*) _tmp72_)->id);
										((BirdFontOtfTable*) _tmp72_)->id = _tmp75_;
										_tmp76_ = self->cmap_table;
										((BirdFontOtfTable*) _tmp76_)->checksum = checksum;
										_tmp77_ = self->cmap_table;
										((BirdFontOtfTable*) _tmp77_)->offset = offset;
										_tmp78_ = self->cmap_table;
										((BirdFontOtfTable*) _tmp78_)->length = length;
									} else {
										GString* _tmp79_;
										const gchar* _tmp80_;
										_tmp79_ = tag;
										_tmp80_ = _tmp79_->str;
										if (g_strcmp0 (_tmp80_, "maxp") == 0) {
											BirdFontMaxpTable* _tmp81_;
											GString* _tmp82_;
											const gchar* _tmp83_;
											gchar* _tmp84_;
											BirdFontMaxpTable* _tmp85_;
											BirdFontMaxpTable* _tmp86_;
											BirdFontMaxpTable* _tmp87_;
											_tmp81_ = self->maxp_table;
											_tmp82_ = tag;
											_tmp83_ = _tmp82_->str;
											_tmp84_ = g_strdup (_tmp83_);
											_g_free0 (((BirdFontOtfTable*) _tmp81_)->id);
											((BirdFontOtfTable*) _tmp81_)->id = _tmp84_;
											_tmp85_ = self->maxp_table;
											((BirdFontOtfTable*) _tmp85_)->checksum = checksum;
											_tmp86_ = self->maxp_table;
											((BirdFontOtfTable*) _tmp86_)->offset = offset;
											_tmp87_ = self->maxp_table;
											((BirdFontOtfTable*) _tmp87_)->length = length;
										} else {
											GString* _tmp88_;
											const gchar* _tmp89_;
											_tmp88_ = tag;
											_tmp89_ = _tmp88_->str;
											if (g_strcmp0 (_tmp89_, "gasp") == 0) {
												BirdFontGaspTable* _tmp90_;
												GString* _tmp91_;
												const gchar* _tmp92_;
												gchar* _tmp93_;
												BirdFontGaspTable* _tmp94_;
												BirdFontGaspTable* _tmp95_;
												BirdFontGaspTable* _tmp96_;
												_tmp90_ = self->gasp_table;
												_tmp91_ = tag;
												_tmp92_ = _tmp91_->str;
												_tmp93_ = g_strdup (_tmp92_);
												_g_free0 (((BirdFontOtfTable*) _tmp90_)->id);
												((BirdFontOtfTable*) _tmp90_)->id = _tmp93_;
												_tmp94_ = self->gasp_table;
												((BirdFontOtfTable*) _tmp94_)->checksum = checksum;
												_tmp95_ = self->gasp_table;
												((BirdFontOtfTable*) _tmp95_)->offset = offset;
												_tmp96_ = self->gasp_table;
												((BirdFontOtfTable*) _tmp96_)->length = length;
											} else {
												GString* _tmp97_;
												const gchar* _tmp98_;
												_tmp97_ = tag;
												_tmp98_ = _tmp97_->str;
												if (g_strcmp0 (_tmp98_, "gdef") == 0) {
													BirdFontGdefTable* _tmp99_;
													GString* _tmp100_;
													const gchar* _tmp101_;
													gchar* _tmp102_;
													BirdFontGdefTable* _tmp103_;
													BirdFontGdefTable* _tmp104_;
													BirdFontGdefTable* _tmp105_;
													_tmp99_ = self->gdef_table;
													_tmp100_ = tag;
													_tmp101_ = _tmp100_->str;
													_tmp102_ = g_strdup (_tmp101_);
													_g_free0 (((BirdFontOtfTable*) _tmp99_)->id);
													((BirdFontOtfTable*) _tmp99_)->id = _tmp102_;
													_tmp103_ = self->gdef_table;
													((BirdFontOtfTable*) _tmp103_)->checksum = checksum;
													_tmp104_ = self->gdef_table;
													((BirdFontOtfTable*) _tmp104_)->offset = offset;
													_tmp105_ = self->gdef_table;
													((BirdFontOtfTable*) _tmp105_)->length = length;
												} else {
													GString* _tmp106_;
													const gchar* _tmp107_;
													_tmp106_ = tag;
													_tmp107_ = _tmp106_->str;
													if (g_strcmp0 (_tmp107_, "glyf") == 0) {
														BirdFontGlyfTable* _tmp108_;
														GString* _tmp109_;
														const gchar* _tmp110_;
														gchar* _tmp111_;
														BirdFontGlyfTable* _tmp112_;
														BirdFontGlyfTable* _tmp113_;
														BirdFontGlyfTable* _tmp114_;
														_tmp108_ = self->glyf_table;
														_tmp109_ = tag;
														_tmp110_ = _tmp109_->str;
														_tmp111_ = g_strdup (_tmp110_);
														_g_free0 (((BirdFontOtfTable*) _tmp108_)->id);
														((BirdFontOtfTable*) _tmp108_)->id = _tmp111_;
														_tmp112_ = self->glyf_table;
														((BirdFontOtfTable*) _tmp112_)->checksum = checksum;
														_tmp113_ = self->glyf_table;
														((BirdFontOtfTable*) _tmp113_)->offset = offset;
														_tmp114_ = self->glyf_table;
														((BirdFontOtfTable*) _tmp114_)->length = length;
													} else {
														GString* _tmp115_;
														const gchar* _tmp116_;
														_tmp115_ = tag;
														_tmp116_ = _tmp115_->str;
														if (g_strcmp0 (_tmp116_, "head") == 0) {
															BirdFontHeadTable* _tmp117_;
															GString* _tmp118_;
															const gchar* _tmp119_;
															gchar* _tmp120_;
															BirdFontHeadTable* _tmp121_;
															BirdFontHeadTable* _tmp122_;
															BirdFontHeadTable* _tmp123_;
															_tmp117_ = self->head_table;
															_tmp118_ = tag;
															_tmp119_ = _tmp118_->str;
															_tmp120_ = g_strdup (_tmp119_);
															_g_free0 (((BirdFontOtfTable*) _tmp117_)->id);
															((BirdFontOtfTable*) _tmp117_)->id = _tmp120_;
															_tmp121_ = self->head_table;
															((BirdFontOtfTable*) _tmp121_)->checksum = checksum;
															_tmp122_ = self->head_table;
															((BirdFontOtfTable*) _tmp122_)->offset = offset;
															_tmp123_ = self->head_table;
															((BirdFontOtfTable*) _tmp123_)->length = length;
														} else {
															GString* _tmp124_;
															const gchar* _tmp125_;
															_tmp124_ = tag;
															_tmp125_ = _tmp124_->str;
															if (g_strcmp0 (_tmp125_, "name") == 0) {
																BirdFontNameTable* _tmp126_;
																GString* _tmp127_;
																const gchar* _tmp128_;
																gchar* _tmp129_;
																BirdFontNameTable* _tmp130_;
																BirdFontNameTable* _tmp131_;
																BirdFontNameTable* _tmp132_;
																_tmp126_ = self->name_table;
																_tmp127_ = tag;
																_tmp128_ = _tmp127_->str;
																_tmp129_ = g_strdup (_tmp128_);
																_g_free0 (((BirdFontOtfTable*) _tmp126_)->id);
																((BirdFontOtfTable*) _tmp126_)->id = _tmp129_;
																_tmp130_ = self->name_table;
																((BirdFontOtfTable*) _tmp130_)->checksum = checksum;
																_tmp131_ = self->name_table;
																((BirdFontOtfTable*) _tmp131_)->offset = offset;
																_tmp132_ = self->name_table;
																((BirdFontOtfTable*) _tmp132_)->length = length;
															} else {
																GString* _tmp133_;
																const gchar* _tmp134_;
																_tmp133_ = tag;
																_tmp134_ = _tmp133_->str;
																if (g_strcmp0 (_tmp134_, "OS/2") == 0) {
																	BirdFontOs2Table* _tmp135_;
																	GString* _tmp136_;
																	const gchar* _tmp137_;
																	gchar* _tmp138_;
																	BirdFontOs2Table* _tmp139_;
																	BirdFontOs2Table* _tmp140_;
																	BirdFontOs2Table* _tmp141_;
																	_tmp135_ = self->os_2_table;
																	_tmp136_ = tag;
																	_tmp137_ = _tmp136_->str;
																	_tmp138_ = g_strdup (_tmp137_);
																	_g_free0 (((BirdFontOtfTable*) _tmp135_)->id);
																	((BirdFontOtfTable*) _tmp135_)->id = _tmp138_;
																	_tmp139_ = self->os_2_table;
																	((BirdFontOtfTable*) _tmp139_)->checksum = checksum;
																	_tmp140_ = self->os_2_table;
																	((BirdFontOtfTable*) _tmp140_)->offset = offset;
																	_tmp141_ = self->os_2_table;
																	((BirdFontOtfTable*) _tmp141_)->length = length;
																} else {
																	GString* _tmp142_;
																	const gchar* _tmp143_;
																	_tmp142_ = tag;
																	_tmp143_ = _tmp142_->str;
																	if (g_strcmp0 (_tmp143_, "post") == 0) {
																		BirdFontPostTable* _tmp144_;
																		GString* _tmp145_;
																		const gchar* _tmp146_;
																		gchar* _tmp147_;
																		BirdFontPostTable* _tmp148_;
																		BirdFontPostTable* _tmp149_;
																		BirdFontPostTable* _tmp150_;
																		_tmp144_ = self->post_table;
																		_tmp145_ = tag;
																		_tmp146_ = _tmp145_->str;
																		_tmp147_ = g_strdup (_tmp146_);
																		_g_free0 (((BirdFontOtfTable*) _tmp144_)->id);
																		((BirdFontOtfTable*) _tmp144_)->id = _tmp147_;
																		_tmp148_ = self->post_table;
																		((BirdFontOtfTable*) _tmp148_)->checksum = checksum;
																		_tmp149_ = self->post_table;
																		((BirdFontOtfTable*) _tmp149_)->offset = offset;
																		_tmp150_ = self->post_table;
																		((BirdFontOtfTable*) _tmp150_)->length = length;
																	} else {
																		GString* _tmp151_;
																		const gchar* _tmp152_;
																		_tmp151_ = tag;
																		_tmp152_ = _tmp151_->str;
																		if (g_strcmp0 (_tmp152_, "kern") == 0) {
																			BirdFontKernTable* _tmp153_;
																			GString* _tmp154_;
																			const gchar* _tmp155_;
																			gchar* _tmp156_;
																			BirdFontKernTable* _tmp157_;
																			BirdFontKernTable* _tmp158_;
																			BirdFontKernTable* _tmp159_;
																			_tmp153_ = self->kern_table;
																			_tmp154_ = tag;
																			_tmp155_ = _tmp154_->str;
																			_tmp156_ = g_strdup (_tmp155_);
																			_g_free0 (((BirdFontOtfTable*) _tmp153_)->id);
																			((BirdFontOtfTable*) _tmp153_)->id = _tmp156_;
																			_tmp157_ = self->kern_table;
																			((BirdFontOtfTable*) _tmp157_)->checksum = checksum;
																			_tmp158_ = self->kern_table;
																			((BirdFontOtfTable*) _tmp158_)->offset = offset;
																			_tmp159_ = self->kern_table;
																			((BirdFontOtfTable*) _tmp159_)->length = length;
																		} else {
																			GString* _tmp160_;
																			const gchar* _tmp161_;
																			_tmp160_ = tag;
																			_tmp161_ = _tmp160_->str;
																			if (g_strcmp0 (_tmp161_, "GPOS") == 0) {
																				BirdFontGposTable* _tmp162_;
																				GString* _tmp163_;
																				const gchar* _tmp164_;
																				gchar* _tmp165_;
																				BirdFontGposTable* _tmp166_;
																				BirdFontGposTable* _tmp167_;
																				BirdFontGposTable* _tmp168_;
																				_tmp162_ = self->gpos_table;
																				_tmp163_ = tag;
																				_tmp164_ = _tmp163_->str;
																				_tmp165_ = g_strdup (_tmp164_);
																				_g_free0 (((BirdFontOtfTable*) _tmp162_)->id);
																				((BirdFontOtfTable*) _tmp162_)->id = _tmp165_;
																				_tmp166_ = self->gpos_table;
																				((BirdFontOtfTable*) _tmp166_)->checksum = checksum;
																				_tmp167_ = self->gpos_table;
																				((BirdFontOtfTable*) _tmp167_)->offset = offset;
																				_tmp168_ = self->gpos_table;
																				((BirdFontOtfTable*) _tmp168_)->length = length;
																			}
																		}
																	}
																}
															}
														}
													}
												}
											}
										}
									}
								}
							}
						}
					}
				}
			}
		}
	}
	_g_string_free0 (tag);
}

void
bird_font_directory_table_parse_all_tables (BirdFontDirectoryTable* self,
                                            BirdFontFontData* dis,
                                            BirdFontOpenFontFormatReader* reader_callback,
                                            GError** error)
{
	BirdFontHeadTable* _tmp0_;
	BirdFontHheaTable* _tmp1_;
	BirdFontNameTable* _tmp2_;
	BirdFontPostTable* _tmp3_;
	BirdFontOs2Table* _tmp4_;
	BirdFontMaxpTable* _tmp5_;
	BirdFontLocaTable* _tmp6_;
	BirdFontHeadTable* _tmp7_;
	BirdFontMaxpTable* _tmp8_;
	BirdFontHmtxTable* _tmp9_;
	BirdFontHheaTable* _tmp10_;
	BirdFontLocaTable* _tmp11_;
	BirdFontCmapTable* _tmp12_;
	BirdFontGposTable* _tmp13_;
	BirdFontKernTable* _tmp14_;
	BirdFontGlyfTable* _tmp16_;
	BirdFontCmapTable* _tmp17_;
	BirdFontLocaTable* _tmp18_;
	BirdFontHmtxTable* _tmp19_;
	BirdFontHeadTable* _tmp20_;
	BirdFontPostTable* _tmp21_;
	BirdFontKernTable* _tmp22_;
	BirdFontKernTable* _tmp23_;
	BirdFontKernTable* _tmp25_;
	BirdFontFkTable* _tmp27_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (dis != NULL);
	g_return_if_fail (reader_callback != NULL);
	_tmp0_ = self->head_table;
	bird_font_otf_table_parse ((BirdFontOtfTable*) _tmp0_, dis, &_inner_error0_);
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		return;
	}
	_tmp1_ = self->hhea_table;
	bird_font_otf_table_parse ((BirdFontOtfTable*) _tmp1_, dis, &_inner_error0_);
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		return;
	}
	bird_font_open_font_format_reader_set_limits (reader_callback);
	_tmp2_ = self->name_table;
	bird_font_otf_table_parse ((BirdFontOtfTable*) _tmp2_, dis, &_inner_error0_);
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		return;
	}
	_tmp3_ = self->post_table;
	bird_font_otf_table_parse ((BirdFontOtfTable*) _tmp3_, dis, &_inner_error0_);
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		return;
	}
	_tmp4_ = self->os_2_table;
	bird_font_otf_table_parse ((BirdFontOtfTable*) _tmp4_, dis, &_inner_error0_);
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		return;
	}
	_tmp5_ = self->maxp_table;
	bird_font_otf_table_parse ((BirdFontOtfTable*) _tmp5_, dis, &_inner_error0_);
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		return;
	}
	_tmp6_ = self->loca_table;
	_tmp7_ = self->head_table;
	_tmp8_ = self->maxp_table;
	bird_font_loca_table_parse (_tmp6_, dis, _tmp7_, _tmp8_, &_inner_error0_);
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		return;
	}
	_tmp9_ = self->hmtx_table;
	_tmp10_ = self->hhea_table;
	_tmp11_ = self->loca_table;
	bird_font_hmtx_table_parse (_tmp9_, dis, _tmp10_, _tmp11_, &_inner_error0_);
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		return;
	}
	_tmp12_ = self->cmap_table;
	bird_font_otf_table_parse ((BirdFontOtfTable*) _tmp12_, dis, &_inner_error0_);
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		return;
	}
	_tmp13_ = self->gpos_table;
	bird_font_otf_table_parse ((BirdFontOtfTable*) _tmp13_, dis, &_inner_error0_);
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		return;
	}
	_tmp14_ = self->kern_table;
	if (bird_font_otf_table_has_data ((BirdFontOtfTable*) _tmp14_)) {
		BirdFontKernTable* _tmp15_;
		_tmp15_ = self->kern_table;
		bird_font_otf_table_parse ((BirdFontOtfTable*) _tmp15_, dis, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			g_propagate_error (error, _inner_error0_);
			return;
		}
	}
	_tmp16_ = self->glyf_table;
	_tmp17_ = self->cmap_table;
	_tmp18_ = self->loca_table;
	_tmp19_ = self->hmtx_table;
	_tmp20_ = self->head_table;
	_tmp21_ = self->post_table;
	_tmp22_ = self->kern_table;
	bird_font_glyf_table_parse (_tmp16_, dis, _tmp17_, _tmp18_, _tmp19_, _tmp20_, _tmp21_, _tmp22_, &_inner_error0_);
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		return;
	}
	_tmp23_ = self->kern_table;
	if (bird_font_otf_table_has_data ((BirdFontOtfTable*) _tmp23_)) {
		BirdFontGaspTable* _tmp24_;
		_tmp24_ = self->gasp_table;
		bird_font_otf_table_parse ((BirdFontOtfTable*) _tmp24_, dis, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			g_propagate_error (error, _inner_error0_);
			return;
		}
	}
	_tmp25_ = self->kern_table;
	if (bird_font_otf_table_has_data ((BirdFontOtfTable*) _tmp25_)) {
		BirdFontCvtTable* _tmp26_;
		_tmp26_ = self->cvt_table;
		bird_font_otf_table_parse ((BirdFontOtfTable*) _tmp26_, dis, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			g_propagate_error (error, _inner_error0_);
			return;
		}
	}
	_tmp27_ = self->fk_table;
	if (bird_font_otf_table_has_data ((BirdFontOtfTable*) _tmp27_)) {
		BirdFontFkTable* _tmp28_;
		_tmp28_ = self->fk_table;
		bird_font_otf_table_parse ((BirdFontOtfTable*) _tmp28_, dis, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			g_propagate_error (error, _inner_error0_);
			return;
		}
	}
}

void
bird_font_directory_table_parse_fk_table (BirdFontDirectoryTable* self,
                                          BirdFontFontData* dis,
                                          GError** error)
{
	BirdFontFkTable* _tmp0_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (dis != NULL);
	_tmp0_ = self->fk_table;
	if (bird_font_otf_table_has_data ((BirdFontOtfTable*) _tmp0_)) {
		BirdFontFkTable* _tmp1_;
		_tmp1_ = self->fk_table;
		bird_font_otf_table_parse ((BirdFontOtfTable*) _tmp1_, dis, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			g_propagate_error (error, _inner_error0_);
			return;
		}
	} else {
		g_warning ("DirectoryTable.vala:284: Fk table is empty.");
	}
}

void
bird_font_directory_table_parse_kern_table (BirdFontDirectoryTable* self,
                                            BirdFontFontData* dis,
                                            GError** error)
{
	BirdFontKernTable* _tmp0_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (dis != NULL);
	_tmp0_ = self->kern_table;
	if (bird_font_otf_table_has_data ((BirdFontOtfTable*) _tmp0_)) {
		BirdFontKernTable* _tmp1_;
		_tmp1_ = self->kern_table;
		bird_font_otf_table_parse ((BirdFontOtfTable*) _tmp1_, dis, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			g_propagate_error (error, _inner_error0_);
			return;
		}
	} else {
		g_warning ("DirectoryTable.vala:292: Kern table is empty.");
	}
}

void
bird_font_directory_table_parse_cmap_table (BirdFontDirectoryTable* self,
                                            BirdFontFontData* dis,
                                            GError** error)
{
	BirdFontCmapTable* _tmp0_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (dis != NULL);
	_tmp0_ = self->cmap_table;
	if (bird_font_otf_table_has_data ((BirdFontOtfTable*) _tmp0_)) {
		BirdFontCmapTable* _tmp1_;
		_tmp1_ = self->cmap_table;
		bird_font_otf_table_parse ((BirdFontOtfTable*) _tmp1_, dis, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			g_propagate_error (error, _inner_error0_);
			return;
		}
	} else {
		g_warning ("DirectoryTable.vala:300: Cmap table is empty.");
	}
}

void
bird_font_directory_table_parse_head_table (BirdFontDirectoryTable* self,
                                            BirdFontFontData* dis,
                                            GError** error)
{
	BirdFontHeadTable* _tmp0_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (dis != NULL);
	_tmp0_ = self->head_table;
	if (bird_font_otf_table_has_data ((BirdFontOtfTable*) _tmp0_)) {
		BirdFontHeadTable* _tmp1_;
		_tmp1_ = self->head_table;
		bird_font_otf_table_parse ((BirdFontOtfTable*) _tmp1_, dis, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			g_propagate_error (error, _inner_error0_);
			return;
		}
	} else {
		g_warning ("DirectoryTable.vala:308: Head table is empty.");
	}
}

gboolean
bird_font_directory_table_validate_tables (BirdFontDirectoryTable* self,
                                           BirdFontFontData* dis,
                                           GFile* file)
{
	gboolean valid = FALSE;
	GError* _inner_error0_ = NULL;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (dis != NULL, FALSE);
	g_return_val_if_fail (file != NULL, FALSE);
	valid = TRUE;
	{
		gboolean _tmp0_ = FALSE;
		BirdFontGlyfTable* _tmp1_;
		BirdFontMaxpTable* _tmp2_;
		BirdFontLocaTable* _tmp3_;
		BirdFontCmapTable* _tmp4_;
		BirdFontHheaTable* _tmp5_;
		BirdFontHmtxTable* _tmp6_;
		BirdFontNameTable* _tmp7_;
		BirdFontOs2Table* _tmp8_;
		BirdFontPostTable* _tmp9_;
		gboolean _tmp10_ = FALSE;
		BirdFontKernTable* _tmp11_;
		gboolean _tmp13_ = FALSE;
		BirdFontFkTable* _tmp14_;
		BirdFontGposTable* _tmp16_;
		bird_font_font_data_seek (dis, (guint) 0);
		_tmp0_ = bird_font_directory_table_validate_checksum_for_entire_font (self, dis, file, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		if (!_tmp0_) {
			g_warning ("DirectoryTable.vala:319: file has invalid checksum");
		} else {
			bird_font_printd ("Font file has valid checksum.\n");
		}
		_tmp1_ = self->glyf_table;
		if (!bird_font_otf_table_validate ((BirdFontOtfTable*) _tmp1_, dis)) {
			g_warning ("DirectoryTable.vala:328: glyf_table has invalid checksum");
			valid = FALSE;
		}
		_tmp2_ = self->maxp_table;
		if (!bird_font_otf_table_validate ((BirdFontOtfTable*) _tmp2_, dis)) {
			g_warning ("DirectoryTable.vala:333: maxp_table has is invalid checksum");
			valid = FALSE;
		}
		_tmp3_ = self->loca_table;
		if (!bird_font_otf_table_validate ((BirdFontOtfTable*) _tmp3_, dis)) {
			g_warning ("DirectoryTable.vala:338: loca_table has invalid checksum");
			valid = FALSE;
		}
		_tmp4_ = self->cmap_table;
		if (!bird_font_otf_table_validate ((BirdFontOtfTable*) _tmp4_, dis)) {
			g_warning ("DirectoryTable.vala:343: cmap_table has invalid checksum");
			valid = FALSE;
		}
		_tmp5_ = self->hhea_table;
		if (!bird_font_otf_table_validate ((BirdFontOtfTable*) _tmp5_, dis)) {
			g_warning ("DirectoryTable.vala:348: hhea_table has invalid checksum");
			valid = FALSE;
		}
		_tmp6_ = self->hmtx_table;
		if (!bird_font_otf_table_validate ((BirdFontOtfTable*) _tmp6_, dis)) {
			g_warning ("DirectoryTable.vala:353: hmtx_table has invalid checksum");
			valid = FALSE;
		}
		_tmp7_ = self->name_table;
		if (!bird_font_otf_table_validate ((BirdFontOtfTable*) _tmp7_, dis)) {
			g_warning ("DirectoryTable.vala:358: name_table has invalid checksum");
			valid = FALSE;
		}
		_tmp8_ = self->os_2_table;
		if (!bird_font_otf_table_validate ((BirdFontOtfTable*) _tmp8_, dis)) {
			g_warning ("DirectoryTable.vala:363: os_2_table has invalid checksum");
			valid = FALSE;
		}
		_tmp9_ = self->post_table;
		if (!bird_font_otf_table_validate ((BirdFontOtfTable*) _tmp9_, dis)) {
			g_warning ("DirectoryTable.vala:368: post_table has invalid checksum");
			valid = FALSE;
		}
		_tmp11_ = self->kern_table;
		if (bird_font_otf_table_has_data ((BirdFontOtfTable*) _tmp11_)) {
			BirdFontKernTable* _tmp12_;
			_tmp12_ = self->kern_table;
			_tmp10_ = !bird_font_otf_table_validate ((BirdFontOtfTable*) _tmp12_, dis);
		} else {
			_tmp10_ = FALSE;
		}
		if (_tmp10_) {
			g_warning ("DirectoryTable.vala:373: kern_table has invalid checksum");
			valid = FALSE;
		}
		_tmp14_ = self->fk_table;
		if (bird_font_otf_table_has_data ((BirdFontOtfTable*) _tmp14_)) {
			BirdFontFkTable* _tmp15_;
			_tmp15_ = self->fk_table;
			_tmp13_ = !bird_font_otf_table_validate ((BirdFontOtfTable*) _tmp15_, dis);
		} else {
			_tmp13_ = FALSE;
		}
		if (_tmp13_) {
			g_warning ("DirectoryTable.vala:378: fk_table has invalid checksum");
			valid = FALSE;
		}
		_tmp16_ = self->gpos_table;
		if (!bird_font_otf_table_validate ((BirdFontOtfTable*) _tmp16_, dis)) {
			BirdFontGposTable* _tmp17_;
			BirdFontFontData* _tmp18_;
			g_warning ("DirectoryTable.vala:383: %s", "gpos_table has invalid checksum");
			_tmp17_ = self->gpos_table;
			_tmp18_ = ((BirdFontOtfTable*) _tmp17_)->font_data;
			if (_tmp18_ != NULL) {
				BirdFontGposTable* _tmp19_;
				BirdFontFontData* _tmp20_;
				gchar* _tmp21_;
				gchar* _tmp22_;
				gchar* _tmp23_;
				gchar* _tmp24_;
				_tmp19_ = self->gpos_table;
				_tmp20_ = ((BirdFontOtfTable*) _tmp19_)->font_data;
				_tmp21_ = g_strdup_printf ("%u", bird_font_font_data_length (G_TYPE_CHECK_INSTANCE_CAST (_tmp20_, BIRD_FONT_TYPE_FONT_DATA, BirdFontFontData)));
				_tmp22_ = _tmp21_;
				_tmp23_ = g_strconcat ("Length: ", _tmp22_, "\n", NULL);
				_tmp24_ = _tmp23_;
				g_warning ("DirectoryTable.vala:386: %s", _tmp24_);
				_g_free0 (_tmp24_);
				_g_free0 (_tmp22_);
			} else {
				g_warning ("DirectoryTable.vala:388: font_data is null");
			}
			valid = FALSE;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp25_;
		const gchar* _tmp26_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp25_ = e;
		_tmp26_ = _tmp25_->message;
		g_warning ("DirectoryTable.vala:394: %s", _tmp26_);
		valid = FALSE;
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		gboolean _tmp27_ = FALSE;
		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 _tmp27_;
	}
	result = valid;
	return result;
}

static gboolean
bird_font_directory_table_validate_checksum_for_entire_font (BirdFontDirectoryTable* self,
                                                             BirdFontFontData* dis,
                                                             GFile* f,
                                                             GError** error)
{
	guint p = 0U;
	BirdFontHeadTable* _tmp0_;
	BirdFontHeadTable* _tmp1_;
	guint32 checksum_font = 0U;
	guint32 checksum_head = 0U;
	BirdFontHeadTable* _tmp2_;
	GError* _inner_error0_ = NULL;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (dis != NULL, FALSE);
	g_return_val_if_fail (f != NULL, FALSE);
	_tmp0_ = self->head_table;
	_tmp1_ = self->head_table;
	p = (guint) (((BirdFontOtfTable*) _tmp0_)->offset + bird_font_head_table_get_checksum_position (_tmp1_));
	_tmp2_ = self->head_table;
	checksum_head = bird_font_head_table_get_font_checksum (_tmp2_);
	bird_font_font_data_seek (dis, (guint) 0);
	bird_font_font_data_write_at (dis, p + 0, (guint8) 0, &_inner_error0_);
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		gboolean _tmp3_ = FALSE;
		g_propagate_error (error, _inner_error0_);
		return _tmp3_;
	}
	bird_font_font_data_write_at (dis, p + 1, (guint8) 0, &_inner_error0_);
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		gboolean _tmp4_ = FALSE;
		g_propagate_error (error, _inner_error0_);
		return _tmp4_;
	}
	bird_font_font_data_write_at (dis, p + 2, (guint8) 0, &_inner_error0_);
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		gboolean _tmp5_ = FALSE;
		g_propagate_error (error, _inner_error0_);
		return _tmp5_;
	}
	bird_font_font_data_write_at (dis, p + 3, (guint8) 0, &_inner_error0_);
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		gboolean _tmp6_ = FALSE;
		g_propagate_error (error, _inner_error0_);
		return _tmp6_;
	}
	checksum_font = (guint32) (0xB1B0AFBALL - bird_font_font_data_checksum (dis));
	if (checksum_font != checksum_head) {
		gchar* _tmp7_;
		gchar* _tmp8_;
		gchar* _tmp9_;
		gchar* _tmp10_;
		gchar* _tmp11_;
		gchar* _tmp12_;
		_tmp7_ = g_strdup_printf ("%u", checksum_font);
		_tmp8_ = _tmp7_;
		_tmp9_ = g_strdup_printf ("%u", checksum_head);
		_tmp10_ = _tmp9_;
		_tmp11_ = g_strconcat ("Fontfile checksum in head table does not match calculated checksum. ch" \
"ecksum_font: ", _tmp8_, " checksum_head: ", _tmp10_, NULL);
		_tmp12_ = _tmp11_;
		g_warning ("DirectoryTable.vala:418: %s", _tmp12_);
		_g_free0 (_tmp12_);
		_g_free0 (_tmp10_);
		_g_free0 (_tmp8_);
		result = FALSE;
		return result;
	}
	result = TRUE;
	return result;
}

glong
bird_font_directory_table_get_font_file_size (BirdFontDirectoryTable* self)
{
	glong length = 0L;
	glong result;
	g_return_val_if_fail (self != NULL, 0L);
	length = (glong) 0;
	{
		GeeArrayList* _t_list = NULL;
		GeeArrayList* _tmp0_;
		gint _t_size = 0;
		GeeArrayList* _tmp1_;
		gint _tmp2_;
		gint _tmp3_;
		gint _t_index = 0;
		_tmp0_ = self->priv->tables;
		_t_list = _tmp0_;
		_tmp1_ = _t_list;
		_tmp2_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp1_);
		_tmp3_ = _tmp2_;
		_t_size = _tmp3_;
		_t_index = -1;
		while (TRUE) {
			gint _tmp4_;
			gint _tmp5_;
			BirdFontOtfTable* t = NULL;
			GeeArrayList* _tmp6_;
			gpointer _tmp7_;
			BirdFontOtfTable* _tmp8_;
			BirdFontFontData* _tmp9_;
			BirdFontFontData* _tmp10_;
			_t_index = _t_index + 1;
			_tmp4_ = _t_index;
			_tmp5_ = _t_size;
			if (!(_tmp4_ < _tmp5_)) {
				break;
			}
			_tmp6_ = _t_list;
			_tmp7_ = gee_abstract_list_get ((GeeAbstractList*) _tmp6_, _t_index);
			t = (BirdFontOtfTable*) _tmp7_;
			_tmp8_ = t;
			_tmp9_ = bird_font_otf_table_get_font_data (_tmp8_);
			_tmp10_ = _tmp9_;
			length += (glong) bird_font_font_data_length_with_padding (_tmp10_);
			_g_object_unref0 (_tmp10_);
			_g_object_unref0 (t);
		}
	}
	result = length;
	return result;
}

void
bird_font_directory_table_process_directory (BirdFontDirectoryTable* self,
                                             GError** error)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	bird_font_directory_table_create_directory (self, &_inner_error0_);
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		return;
	}
	bird_font_directory_table_create_directory (self, &_inner_error0_);
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		return;
	}
}

guint32
bird_font_directory_table_get_font_file_checksum (BirdFontDirectoryTable* self)
{
	guint32 checksum = 0U;
	guint32 result;
	g_return_val_if_fail (self != NULL, 0U);
	checksum = (guint32) 0;
	{
		GeeArrayList* _t_list = NULL;
		GeeArrayList* _tmp0_;
		gint _t_size = 0;
		GeeArrayList* _tmp1_;
		gint _tmp2_;
		gint _tmp3_;
		gint _t_index = 0;
		_tmp0_ = self->priv->tables;
		_t_list = _tmp0_;
		_tmp1_ = _t_list;
		_tmp2_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp1_);
		_tmp3_ = _tmp2_;
		_t_size = _tmp3_;
		_t_index = -1;
		while (TRUE) {
			gint _tmp4_;
			gint _tmp5_;
			BirdFontOtfTable* t = NULL;
			GeeArrayList* _tmp6_;
			gpointer _tmp7_;
			BirdFontOtfTable* _tmp8_;
			BirdFontFontData* _tmp9_;
			BirdFontFontData* _tmp10_;
			_t_index = _t_index + 1;
			_tmp4_ = _t_index;
			_tmp5_ = _t_size;
			if (!(_tmp4_ < _tmp5_)) {
				break;
			}
			_tmp6_ = _t_list;
			_tmp7_ = gee_abstract_list_get ((GeeAbstractList*) _tmp6_, _t_index);
			t = (BirdFontOtfTable*) _tmp7_;
			_tmp8_ = t;
			_tmp9_ = bird_font_otf_table_get_font_data (_tmp8_);
			_tmp10_ = _tmp9_;
			bird_font_font_data_continous_checksum (_tmp10_, &checksum);
			_g_object_unref0 (_tmp10_);
			_g_object_unref0 (t);
		}
	}
	result = checksum;
	return result;
}

void
bird_font_directory_table_create_directory (BirdFontDirectoryTable* self,
                                            GError** error)
{
	BirdFontFontData* fd = NULL;
	guint32 table_offset = 0U;
	guint32 table_length = 0U;
	guint32 checksum = 0U;
	BirdFontFontData* _tmp0_;
	BirdFontOffsetTable* _tmp1_;
	BirdFontOffsetTable* _tmp2_;
	BirdFontFontData* _tmp3_;
	BirdFontFontData* _tmp4_;
	BirdFontFontData* _tmp5_;
	BirdFontHeadTable* _tmp8_;
	BirdFontHeadTable* _tmp9_;
	BirdFontFontData* _tmp49_;
	BirdFontFontData* _tmp50_;
	BirdFontFontData* _tmp51_;
	BirdFontHeadTable* _tmp52_;
	BirdFontHeadTable* _tmp53_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	table_offset = (guint32) 0;
	table_length = (guint32) 0;
	checksum = (guint32) 0;
	_tmp0_ = bird_font_font_data_new ((guint32) 1024);
	_g_object_unref0 (fd);
	fd = _tmp0_;
	_tmp1_ = self->offset_table;
	g_return_if_fail (((gint) _tmp1_->num_tables) > 0);
	_tmp2_ = self->offset_table;
	_tmp3_ = bird_font_otf_table_get_font_data ((BirdFontOtfTable*) _tmp2_);
	_tmp4_ = _tmp3_;
	table_offset += (guint32) bird_font_font_data_length_with_padding (_tmp4_);
	_g_object_unref0 (_tmp4_);
	_tmp5_ = ((BirdFontOtfTable*) self)->font_data;
	if (_tmp5_ != NULL) {
		BirdFontFontData* _tmp6_;
		BirdFontFontData* _tmp7_;
		_tmp6_ = bird_font_otf_table_get_font_data ((BirdFontOtfTable*) self);
		_tmp7_ = _tmp6_;
		table_offset += (guint32) bird_font_font_data_length_with_padding (_tmp7_);
		_g_object_unref0 (_tmp7_);
	}
	_tmp8_ = self->head_table;
	bird_font_head_table_set_checksum_adjustment (_tmp8_, (guint32) 0);
	_tmp9_ = self->head_table;
	bird_font_head_table_process (_tmp9_, &_inner_error0_);
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		_g_object_unref0 (fd);
		return;
	}
	{
		GeeArrayList* _t_list = NULL;
		GeeArrayList* _tmp10_;
		gint _t_size = 0;
		GeeArrayList* _tmp11_;
		gint _tmp12_;
		gint _tmp13_;
		gint _t_index = 0;
		_tmp10_ = self->priv->tables;
		_t_list = _tmp10_;
		_tmp11_ = _t_list;
		_tmp12_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp11_);
		_tmp13_ = _tmp12_;
		_t_size = _tmp13_;
		_t_index = -1;
		while (TRUE) {
			gint _tmp14_;
			gint _tmp15_;
			BirdFontOtfTable* t = NULL;
			GeeArrayList* _tmp16_;
			gpointer _tmp17_;
			gboolean _tmp18_ = FALSE;
			BirdFontOtfTable* _tmp19_;
			BirdFontOtfTable* _tmp21_;
			const gchar* _tmp22_;
			const gchar* _tmp23_;
			gchar* _tmp24_;
			gchar* _tmp25_;
			BirdFontOtfTable* _tmp26_;
			BirdFontFontData* _tmp27_;
			BirdFontFontData* _tmp28_;
			gchar* _tmp29_;
			gchar* _tmp30_;
			gchar* _tmp31_;
			gchar* _tmp32_;
			BirdFontOtfTable* _tmp33_;
			BirdFontFontData* _tmp34_;
			BirdFontFontData* _tmp35_;
			BirdFontFontData* _tmp36_;
			BirdFontOtfTable* _tmp37_;
			gchar* _tmp38_;
			gchar* _tmp39_;
			BirdFontFontData* _tmp40_;
			BirdFontOtfTable* _tmp41_;
			BirdFontFontData* _tmp42_;
			BirdFontFontData* _tmp43_;
			BirdFontFontData* _tmp44_;
			BirdFontFontData* _tmp45_;
			BirdFontOtfTable* _tmp46_;
			BirdFontFontData* _tmp47_;
			BirdFontFontData* _tmp48_;
			_t_index = _t_index + 1;
			_tmp14_ = _t_index;
			_tmp15_ = _t_size;
			if (!(_tmp14_ < _tmp15_)) {
				break;
			}
			_tmp16_ = _t_list;
			_tmp17_ = gee_abstract_list_get ((GeeAbstractList*) _tmp16_, _t_index);
			t = (BirdFontOtfTable*) _tmp17_;
			_tmp19_ = t;
			if (BIRD_FONT_IS_DIRECTORY_TABLE (_tmp19_)) {
				_tmp18_ = TRUE;
			} else {
				BirdFontOtfTable* _tmp20_;
				_tmp20_ = t;
				_tmp18_ = BIRD_FONT_IS_OFFSET_TABLE (_tmp20_);
			}
			if (_tmp18_) {
				_g_object_unref0 (t);
				continue;
			}
			_tmp21_ = t;
			_tmp22_ = _tmp21_->id;
			_tmp23_ = string_to_string (_tmp22_);
			_tmp24_ = g_strdup_printf ("%u", table_offset);
			_tmp25_ = _tmp24_;
			_tmp26_ = t;
			_tmp27_ = bird_font_otf_table_get_font_data (_tmp26_);
			_tmp28_ = _tmp27_;
			_tmp29_ = g_strdup_printf ("%u", bird_font_font_data_length_with_padding (_tmp28_));
			_tmp30_ = _tmp29_;
			_tmp31_ = g_strconcat ("c ", _tmp23_, "  offset: ", _tmp25_, "  len with pad  ", _tmp30_, "\n", NULL);
			_tmp32_ = _tmp31_;
			bird_font_printd (_tmp32_);
			_g_free0 (_tmp32_);
			_g_free0 (_tmp30_);
			_g_object_unref0 (_tmp28_);
			_g_free0 (_tmp25_);
			_tmp33_ = t;
			_tmp34_ = bird_font_otf_table_get_font_data (_tmp33_);
			_tmp35_ = _tmp34_;
			table_length = (guint32) bird_font_font_data_length (_tmp35_);
			_g_object_unref0 (_tmp35_);
			_tmp36_ = fd;
			_tmp37_ = t;
			_tmp38_ = bird_font_otf_table_get_id (_tmp37_);
			_tmp39_ = _tmp38_;
			bird_font_font_data_add_tag (_tmp36_, _tmp39_);
			_g_free0 (_tmp39_);
			_tmp40_ = fd;
			_tmp41_ = t;
			_tmp42_ = bird_font_otf_table_get_font_data (_tmp41_);
			_tmp43_ = _tmp42_;
			bird_font_font_data_add_u32 (_tmp40_, bird_font_font_data_checksum (_tmp43_));
			_g_object_unref0 (_tmp43_);
			_tmp44_ = fd;
			bird_font_font_data_add_u32 (_tmp44_, table_offset);
			_tmp45_ = fd;
			bird_font_font_data_add_u32 (_tmp45_, table_length);
			_tmp46_ = t;
			_tmp47_ = bird_font_otf_table_get_font_data (_tmp46_);
			_tmp48_ = _tmp47_;
			table_offset += (guint32) bird_font_font_data_length_with_padding (_tmp48_);
			_g_object_unref0 (_tmp48_);
			_g_object_unref0 (t);
		}
	}
	_tmp49_ = fd;
	bird_font_font_data_pad (_tmp49_);
	_tmp50_ = fd;
	_tmp51_ = _g_object_ref0 (_tmp50_);
	_g_object_unref0 (((BirdFontOtfTable*) self)->font_data);
	((BirdFontOtfTable*) self)->font_data = _tmp51_;
	checksum = bird_font_directory_table_get_font_file_checksum (self);
	_tmp52_ = self->head_table;
	bird_font_head_table_set_checksum_adjustment (_tmp52_, (guint32) (0xB1B0AFBALL - checksum));
	_tmp53_ = self->head_table;
	bird_font_head_table_process (_tmp53_, &_inner_error0_);
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		_g_object_unref0 (fd);
		return;
	}
	_g_object_unref0 (fd);
}

static void
bird_font_directory_table_class_init (BirdFontDirectoryTableClass * klass,
                                      gpointer klass_data)
{
	bird_font_directory_table_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &BirdFontDirectoryTable_private_offset);
	G_OBJECT_CLASS (klass)->finalize = bird_font_directory_table_finalize;
}

static void
bird_font_directory_table_instance_init (BirdFontDirectoryTable * self,
                                         gpointer klass)
{
	self->priv = bird_font_directory_table_get_instance_private (self);
}

static void
bird_font_directory_table_finalize (GObject * obj)
{
	BirdFontDirectoryTable * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BIRD_FONT_TYPE_DIRECTORY_TABLE, BirdFontDirectoryTable);
	_g_object_unref0 (self->cmap_table);
	_g_object_unref0 (self->cvt_table);
	_g_object_unref0 (self->fk_table);
	_g_object_unref0 (self->gasp_table);
	_g_object_unref0 (self->gdef_table);
	_g_object_unref0 (self->glyf_table);
	_g_object_unref0 (self->gpos_table);
	_g_object_unref0 (self->gsub_table);
	_g_object_unref0 (self->head_table);
	_g_object_unref0 (self->hhea_table);
	_g_object_unref0 (self->hmtx_table);
	_g_object_unref0 (self->kern_table);
	_g_object_unref0 (self->maxp_table);
	_g_object_unref0 (self->name_table);
	_g_object_unref0 (self->os_2_table);
	_g_object_unref0 (self->post_table);
	_g_object_unref0 (self->loca_table);
	_g_object_unref0 (self->offset_table);
	_g_object_unref0 (self->priv->tables);
	G_OBJECT_CLASS (bird_font_directory_table_parent_class)->finalize (obj);
}

/** Table with list of tables sorted by table tag. */
static GType
bird_font_directory_table_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (BirdFontDirectoryTableClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) bird_font_directory_table_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BirdFontDirectoryTable), 0, (GInstanceInitFunc) bird_font_directory_table_instance_init, NULL };
	GType bird_font_directory_table_type_id;
	bird_font_directory_table_type_id = g_type_register_static (BIRD_FONT_TYPE_OTF_TABLE, "BirdFontDirectoryTable", &g_define_type_info, 0);
	BirdFontDirectoryTable_private_offset = g_type_add_instance_private (bird_font_directory_table_type_id, sizeof (BirdFontDirectoryTablePrivate));
	return bird_font_directory_table_type_id;
}

GType
bird_font_directory_table_get_type (void)
{
	static volatile gsize bird_font_directory_table_type_id__once = 0;
	if (g_once_init_enter (&bird_font_directory_table_type_id__once)) {
		GType bird_font_directory_table_type_id;
		bird_font_directory_table_type_id = bird_font_directory_table_get_type_once ();
		g_once_init_leave (&bird_font_directory_table_type_id__once, bird_font_directory_table_type_id);
	}
	return bird_font_directory_table_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;
}

