#include "test_01.bmx.gui.debug.win32.x64.h"
struct BBString_1{BBClass_String* clas;BBULONG hash;int length;BBChar buf[1];};
struct BBString_2{BBClass_String* clas;BBULONG hash;int length;BBChar buf[2];};
struct BBString_4{BBClass_String* clas;BBULONG hash;int length;BBChar buf[4];};
struct BBString_3{BBClass_String* clas;BBULONG hash;int length;BBChar buf[3];};
struct BBString_6{BBClass_String* clas;BBULONG hash;int length;BBChar buf[6];};
struct BBString_5{BBClass_String* clas;BBULONG hash;int length;BBChar buf[5];};
struct BBString_103{BBClass_String* clas;BBULONG hash;int length;BBChar buf[103];};
struct BBString_14{BBClass_String* clas;BBULONG hash;int length;BBChar buf[14];};
struct BBString_34{BBClass_String* clas;BBULONG hash;int length;BBChar buf[34];};
struct BBString_9{BBClass_String* clas;BBULONG hash;int length;BBChar buf[9];};
struct BBString_7{BBClass_String* clas;BBULONG hash;int length;BBChar buf[7];};
struct BBString_20{BBClass_String* clas;BBULONG hash;int length;BBChar buf[20];};
struct BBString_10{BBClass_String* clas;BBULONG hash;int length;BBChar buf[10];};
static struct BBString_1 _s17={
	&bbStringClass,
	0xa8d4ace0dc8d360e,
	1,
	{32}
};
static struct BBString_2 _s14={
	&bbStringClass,
	0xb45f2c51d6c02a18,
	2,
	{39,41}
};
static struct BBString_4 _s13={
	&bbStringClass,
	0xa9334e301eb2dda2,
	4,
	{39,44,32,39}
};
static struct BBString_3 _s4={
	&bbStringClass,
	0x453a52ae0ab874fd,
	3,
	{65,104,111}
};
static struct BBString_6 _s3={
	&bbStringClass,
	0xb1124114a7d0e010,
	6,
	{65,108,102,114,101,100}
};
static struct BBString_5 _s5={
	&bbStringClass,
	0xafa6d80c759ac003,
	5,
	{66,114,105,97,110}
};
static struct BBString_103 _s19={
	&bbStringClass,
	0xd220572dc8fc735,
	103,
	{67,82,69,65,84,69,32,84,65,66,76,69,32,112,101,114,115
	,111,110,32,40,105,100,32,105,110,116,101,103,101,114,32,112
	,114,105,109,97,114,121,32,107,101,121,32,65,85,84,79,73
	,78,67,82,69,77,69,78,84,44,32,32,102,111,114,101,110
	,97,109,101,32,118,97,114,99,104,97,114,40,51,48,41,44
	,32,115,117,114,110,97,109,101,32,118,97,114,99,104,97,114
	,40,51,48,41,32,41}
};
static struct BBString_14 _s2={
	&bbStringClass,
	0x5251d743a8cd53b8,
	14,
	{68,105,100,110,39,116,32,119,111,114,107,46,46,46}
};
static struct BBString_34 _s12={
	&bbStringClass,
	0x93d873a925903049,
	34,
	{73,78,83,69,82,84,32,73,78,84,79,32,112,101,114,115,111
	,110,32,118,97,108,117,101,115,32,40,78,85,76,76,44,32
	,39}
};
static struct BBString_9 _s6={
	&bbStringClass,
	0xbad99da7372c0373,
	9,
	{75,101,114,110,105,103,104,97,110}
};
static struct BBString_7 _s16={
	&bbStringClass,
	0x87ee27a2c7b1203e,
	7,
	{78,97,109,101,32,61,32}
};
static struct BBString_5 _s7={
	&bbStringClass,
	0xfec999912e46dbdd,
	5,
	{80,101,116,101,114}
};
static struct BBString_20 _s15={
	&bbStringClass,
	0xc862f5e03a238528,
	20,
	{83,69,76,69,67,84,32,42,32,102,114,111,109,32,112,101,114
	,115,111,110}
};
static struct BBString_6 _s1={
	&bbStringClass,
	0xd31c7633b1e4bfb8,
	6,
	{83,81,76,73,84,69}
};
static struct BBString_10 _s8={
	&bbStringClass,
	0x8fdf9b99c93f2d77,
	10,
	{87,101,105,110,98,101,114,103,101,114}
};
static struct BBString_10 _s0={
	&bbStringClass,
	0x3ac3cf9cf8636892,
	10,
	{109,97,120,116,101,115,116,46,100,98}
};
struct BBDebugScope_1{int kind; const char *name; BBDebugDecl decls[2]; };
struct BBDebugScope_2{int kind; const char *name; BBDebugDecl decls[3]; };
void _m_test_01_errorAndClose(struct database_core_TDBConnection_obj* bbt_db){
	struct BBDebugScope_1 __scope = {
		BBDEBUGSCOPE_FUNCTION,
		"errorAndClose",
		{
			{
				BBDEBUGDECL_LOCAL,
				"db",
				":TDBConnection",
				.var_address=&bbt_db
			},
			{
				BBDEBUGDECL_END
			}
		}
	};
	bbOnDebugEnterScope((BBDebugScope *)&__scope);
	struct BBDebugStm __stmt_0 = {0xe84542c7f17e9f2b, 72, 0};
	bbOnDebugEnterStm(&__stmt_0);
	struct database_core_TDatabaseError_obj* bbt_;
	brl_standardio_Print(((struct database_core_TDatabaseError_obj*)bbNullObjectTest((BBObject*)(bbt_ = ((struct database_core_TDBConnection_obj*)bbNullObjectTest((BBObject*)bbt_db))->clas->m_error((struct database_core_TDBConnection_obj*)bbt_db))))->clas->ToString((struct database_core_TDatabaseError_obj*)bbt_));
	struct BBDebugStm __stmt_1 = {0xe84542c7f17e9f2b, 73, 0};
	bbOnDebugEnterStm(&__stmt_1);
	((struct database_core_TDBConnection_obj*)bbNullObjectTest((BBObject*)bbt_db))->clas->m_close((struct database_core_TDBConnection_obj*)bbt_db);
	struct BBDebugStm __stmt_2 = {0xe84542c7f17e9f2b, 74, 0};
	bbOnDebugEnterStm(&__stmt_2);
	bbEnd();
	bbOnDebugLeaveScope();
}
static int _bb_main_inited = 0;
int _bb_main(){
	if (!_bb_main_inited) {
		_bb_main_inited = 1;
		__bb_brl_blitz_blitz();
		__bb_database_sqlite_sqlite();
		__bb_brl_filesystem_filesystem();
		__bb_brl_standardio_standardio();
		bbRegisterSource(0xe84542c7f17e9f2b, "C:/BMX/mod/database.mod/sqlite.mod/tests/test_01.bmx");
		struct database_core_TDBConnection_obj* bbt_db=(struct database_core_TDBConnection_obj*)((struct database_core_TDBConnection_obj*)&bbNullObject);
		BBARRAY bbt_names=(&bbEmptyArray);
		struct BBDebugScope_2 __scope = {
			BBDEBUGSCOPE_FUNCTION,
			"test_01",
			{
				{
					BBDEBUGDECL_LOCAL,
					"db",
					":TDBConnection",
					.var_address=&bbt_db
				},
				{
					BBDEBUGDECL_LOCAL,
					"names",
					"[][]$",
					.var_address=&bbt_names
				},
				{
					BBDEBUGDECL_END
				}
			}
		};
		bbOnDebugEnterScope((BBDebugScope *)&__scope);
		struct BBDebugStm __stmt_0 = {0xe84542c7f17e9f2b, 7, 0};
		bbOnDebugEnterStm(&__stmt_0);
		brl_filesystem_DeleteFile((BBString*)&_s0);
		struct BBDebugStm __stmt_1 = {0xe84542c7f17e9f2b, 9, 0};
		bbOnDebugEnterStm(&__stmt_1);
		bbt_db=(struct database_core_TDBConnection_obj*)database_core_LoadDatabase(((BBString*)&_s1),((BBString*)&_s0),((BBString*)&bbEmptyString),0,((BBString*)&bbEmptyString),((BBString*)&bbEmptyString),((BBString*)&bbEmptyString),((BBString*)&bbEmptyString));
		struct BBDebugStm __stmt_2 = {0xe84542c7f17e9f2b, 11, 0};
		bbOnDebugEnterStm(&__stmt_2);
		if(!(((BBObject*)bbt_db)!= &bbNullObject)){
			struct BBDebugScope __scope = {
				BBDEBUGSCOPE_LOCALBLOCK,
				0,
				{
					{
						BBDEBUGDECL_END
					}
				}
			};
			bbOnDebugEnterScope((BBDebugScope *)&__scope);
			struct BBDebugStm __stmt_0 = {0xe84542c7f17e9f2b, 12, 0};
			bbOnDebugEnterStm(&__stmt_0);
			brl_standardio_Print((BBString*)&_s2);
			struct BBDebugStm __stmt_1 = {0xe84542c7f17e9f2b, 13, 0};
			bbOnDebugEnterStm(&__stmt_1);
			bbEnd();
			bbOnDebugLeaveScope();
		}
		struct BBDebugStm __stmt_3 = {0xe84542c7f17e9f2b, 19, 0};
		bbOnDebugEnterStm(&__stmt_3);
		BBSTRING bbt_3[]={((BBString*)&_s3),((BBString*)&_s4)};
		BBARRAY bbt_4 = bbArrayFromData("$",2,bbt_3);
		BBSTRING bbt_5[]={((BBString*)&_s5),((BBString*)&_s6)};
		BBARRAY bbt_6 = bbArrayFromData("$",2,bbt_5);
		BBSTRING bbt_7[]={((BBString*)&_s7),((BBString*)&_s8)};
		BBARRAY bbt_8 = bbArrayFromData("$",2,bbt_7);
		BBARRAY bbt_[]={bbt_4,bbt_6,bbt_8};
		BBARRAY bbt_2 = bbArrayFromData("[]$",3,bbt_);
		bbt_names=bbt_2;
		struct BBDebugStm __stmt_4 = {0xe84542c7f17e9f2b, 21, 0};
		bbOnDebugEnterStm(&__stmt_4);
		if(((struct database_core_TDBConnection_obj*)bbNullObjectTest((BBObject*)bbt_db))->clas->m_isOpen((struct database_core_TDBConnection_obj*)bbt_db)!=0){
			BBSTRING bbt_s=(&bbEmptyString);
			struct database_core_TDatabaseQuery_obj* bbt_query=(struct database_core_TDatabaseQuery_obj*)((struct database_core_TDatabaseQuery_obj*)&bbNullObject);
			struct BBDebugScope_2 __scope = {
				BBDEBUGSCOPE_LOCALBLOCK,
				0,
				{
					{
						BBDEBUGDECL_LOCAL,
						"s",
						"$",
						.var_address=&bbt_s
					},
					{
						BBDEBUGDECL_LOCAL,
						"query",
						":TDatabaseQuery",
						.var_address=&bbt_query
					},
					{
						BBDEBUGDECL_END
					}
				}
			};
			bbOnDebugEnterScope((BBDebugScope *)&__scope);
			struct BBDebugStm __stmt_0 = {0xe84542c7f17e9f2b, 23, 0};
			bbOnDebugEnterStm(&__stmt_0);
			bbt_s=((BBString*)&_s19);
			struct BBDebugStm __stmt_1 = {0xe84542c7f17e9f2b, 27, 0};
			bbOnDebugEnterStm(&__stmt_1);
			((struct database_core_TDBConnection_obj*)bbNullObjectTest((BBObject*)bbt_db))->clas->m_executeQuery_S((struct database_core_TDBConnection_obj*)bbt_db,bbt_s);
			struct BBDebugStm __stmt_2 = {0xe84542c7f17e9f2b, 29, 0};
			bbOnDebugEnterStm(&__stmt_2);
			if(((struct database_core_TDBConnection_obj*)bbNullObjectTest((BBObject*)bbt_db))->clas->m_hasError((struct database_core_TDBConnection_obj*)bbt_db)!=0){
				struct BBDebugScope __scope = {
					BBDEBUGSCOPE_LOCALBLOCK,
					0,
					{
						{
							BBDEBUGDECL_END
						}
					}
				};
				bbOnDebugEnterScope((BBDebugScope *)&__scope);
				struct BBDebugStm __stmt_0 = {0xe84542c7f17e9f2b, 30, 0};
				bbOnDebugEnterStm(&__stmt_0);
				_m_test_01_errorAndClose((struct database_core_TDBConnection_obj*)bbt_db);
				bbOnDebugLeaveScope();
			}
			struct BBDebugStm __stmt_3 = {0xe84542c7f17e9f2b, 34, 0};
			bbOnDebugEnterStm(&__stmt_3);
			((struct database_core_TDBConnection_obj*)bbNullObjectTest((BBObject*)bbt_db))->clas->m_startTransaction((struct database_core_TDBConnection_obj*)bbt_db);
			struct BBDebugStm __stmt_4 = {0xe84542c7f17e9f2b, 36, 0};
			bbOnDebugEnterStm(&__stmt_4);
			if(((struct database_core_TDBConnection_obj*)bbNullObjectTest((BBObject*)bbt_db))->clas->m_hasError((struct database_core_TDBConnection_obj*)bbt_db)!=0){
				struct BBDebugScope __scope = {
					BBDEBUGSCOPE_LOCALBLOCK,
					0,
					{
						{
							BBDEBUGDECL_END
						}
					}
				};
				bbOnDebugEnterScope((BBDebugScope *)&__scope);
				struct BBDebugStm __stmt_0 = {0xe84542c7f17e9f2b, 37, 0};
				bbOnDebugEnterStm(&__stmt_0);
				_m_test_01_errorAndClose((struct database_core_TDBConnection_obj*)bbt_db);
				bbOnDebugLeaveScope();
			}
			struct BBDebugStm __stmt_5 = {0xe84542c7f17e9f2b, 40, 0};
			bbOnDebugEnterStm(&__stmt_5);
			{
				BBINT bbt_i=0;
				BBINT bbt_9=(bbt_names->scales[0]);
				for(;(bbt_i<bbt_9);bbt_i=(bbt_i+1)){
					struct BBDebugScope_1 __scope = {
						BBDEBUGSCOPE_LOCALBLOCK,
						0,
						{
							{
								BBDEBUGDECL_LOCAL,
								"i",
								"i",
								.var_address=&bbt_i
							},
							{
								BBDEBUGDECL_END
							}
						}
					};
					bbOnDebugEnterScope((BBDebugScope *)&__scope);
					struct BBDebugStm __stmt_0 = {0xe84542c7f17e9f2b, 41, 0};
					bbOnDebugEnterStm(&__stmt_0);
					BBARRAY bbt_10=((BBARRAY*)BBARRAYDATAINDEX((bbt_names),(bbt_names)->dims,((BBUINT)bbt_i)))[((BBUINT)bbt_i)];
					BBARRAY bbt_11=((BBARRAY*)BBARRAYDATAINDEX((bbt_names),(bbt_names)->dims,((BBUINT)bbt_i)))[((BBUINT)bbt_i)];
					((struct database_core_TDBConnection_obj*)bbNullObjectTest((BBObject*)bbt_db))->clas->m_executeQuery_S((struct database_core_TDBConnection_obj*)bbt_db,bbStringConcat(bbStringConcat(bbStringConcat(bbStringConcat(((BBString*)&_s12),((BBSTRING*)BBARRAYDATAINDEX((bbt_10),(bbt_10)->dims,0U))[0U]),((BBString*)&_s13)),((BBSTRING*)BBARRAYDATAINDEX((bbt_11),(bbt_11)->dims,1U))[1U]),((BBString*)&_s14)));
					struct BBDebugStm __stmt_1 = {0xe84542c7f17e9f2b, 42, 0};
					bbOnDebugEnterStm(&__stmt_1);
					if(((struct database_core_TDBConnection_obj*)bbNullObjectTest((BBObject*)bbt_db))->clas->m_hasError((struct database_core_TDBConnection_obj*)bbt_db)!=0){
						struct BBDebugScope __scope = {
							BBDEBUGSCOPE_LOCALBLOCK,
							0,
							{
								{
									BBDEBUGDECL_END
								}
							}
						};
						bbOnDebugEnterScope((BBDebugScope *)&__scope);
						struct BBDebugStm __stmt_0 = {0xe84542c7f17e9f2b, 43, 0};
						bbOnDebugEnterStm(&__stmt_0);
						_m_test_01_errorAndClose((struct database_core_TDBConnection_obj*)bbt_db);
						bbOnDebugLeaveScope();
					}
					bbOnDebugLeaveScope();
				}
			}
			struct BBDebugStm __stmt_6 = {0xe84542c7f17e9f2b, 49, 0};
			bbOnDebugEnterStm(&__stmt_6);
			((struct database_core_TDBConnection_obj*)bbNullObjectTest((BBObject*)bbt_db))->clas->m_commit((struct database_core_TDBConnection_obj*)bbt_db);
			struct BBDebugStm __stmt_7 = {0xe84542c7f17e9f2b, 51, 0};
			bbOnDebugEnterStm(&__stmt_7);
			if(((struct database_core_TDBConnection_obj*)bbNullObjectTest((BBObject*)bbt_db))->clas->m_hasError((struct database_core_TDBConnection_obj*)bbt_db)!=0){
				struct BBDebugScope __scope = {
					BBDEBUGSCOPE_LOCALBLOCK,
					0,
					{
						{
							BBDEBUGDECL_END
						}
					}
				};
				bbOnDebugEnterScope((BBDebugScope *)&__scope);
				struct BBDebugStm __stmt_0 = {0xe84542c7f17e9f2b, 52, 0};
				bbOnDebugEnterStm(&__stmt_0);
				_m_test_01_errorAndClose((struct database_core_TDBConnection_obj*)bbt_db);
				bbOnDebugLeaveScope();
			}
			struct BBDebugStm __stmt_8 = {0xe84542c7f17e9f2b, 55, 0};
			bbOnDebugEnterStm(&__stmt_8);
			bbt_query=(struct database_core_TDatabaseQuery_obj*)((struct database_core_TDBConnection_obj*)bbNullObjectTest((BBObject*)bbt_db))->clas->m_executeQuery_S((struct database_core_TDBConnection_obj*)bbt_db,((BBString*)&_s15));
			struct BBDebugStm __stmt_9 = {0xe84542c7f17e9f2b, 56, 0};
			bbOnDebugEnterStm(&__stmt_9);
			if(((struct database_core_TDBConnection_obj*)bbNullObjectTest((BBObject*)bbt_db))->clas->m_hasError((struct database_core_TDBConnection_obj*)bbt_db)!=0){
				struct BBDebugScope __scope = {
					BBDEBUGSCOPE_LOCALBLOCK,
					0,
					{
						{
							BBDEBUGDECL_END
						}
					}
				};
				bbOnDebugEnterScope((BBDebugScope *)&__scope);
				struct BBDebugStm __stmt_0 = {0xe84542c7f17e9f2b, 57, 0};
				bbOnDebugEnterStm(&__stmt_0);
				_m_test_01_errorAndClose((struct database_core_TDBConnection_obj*)bbt_db);
				bbOnDebugLeaveScope();
			}
			struct BBDebugStm __stmt_10 = {0xe84542c7f17e9f2b, 60, 0};
			bbOnDebugEnterStm(&__stmt_10);
			while(((struct database_core_TDatabaseQuery_obj*)bbNullObjectTest((BBObject*)bbt_query))->clas->m_nextRow((struct database_core_TDatabaseQuery_obj*)bbt_query)!=0){
				struct database_core_TQueryRecord_obj* bbt_record=(struct database_core_TQueryRecord_obj*)((struct database_core_TQueryRecord_obj*)&bbNullObject);
				struct BBDebugScope_1 __scope = {
					BBDEBUGSCOPE_LOCALBLOCK,
					0,
					{
						{
							BBDEBUGDECL_LOCAL,
							"record",
							":TQueryRecord",
							.var_address=&bbt_record
						},
						{
							BBDEBUGDECL_END
						}
					}
				};
				bbOnDebugEnterScope((BBDebugScope *)&__scope);
				struct BBDebugStm __stmt_0 = {0xe84542c7f17e9f2b, 61, 0};
				bbOnDebugEnterStm(&__stmt_0);
				bbt_record=(struct database_core_TQueryRecord_obj*)((struct database_core_TDatabaseQuery_obj*)bbNullObjectTest((BBObject*)bbt_query))->clas->m_rowRecord((struct database_core_TDatabaseQuery_obj*)bbt_query);
				struct BBDebugStm __stmt_1 = {0xe84542c7f17e9f2b, 63, 0};
				bbOnDebugEnterStm(&__stmt_1);
				brl_standardio_Print(bbStringConcat(bbStringConcat(bbStringConcat(((BBString*)&_s16),((struct database_core_dbtypes_TDBString_obj*)bbNullObjectTest((BBObject*)((struct database_core_dbtypes_TDBString_obj*)bbObjectDowncast((BBOBJECT)((struct database_core_TQueryRecord_obj*)bbNullObjectTest((BBObject*)bbt_record))->clas->m_value_i((struct database_core_TQueryRecord_obj*)bbt_record,1),(BBClass*)&database_core_dbtypes_TDBString))))->_database_core_dbtypes_tdbstring_value ),((BBString*)&_s17)),((struct database_core_dbtypes_TDBString_obj*)bbNullObjectTest((BBObject*)((struct database_core_dbtypes_TDBString_obj*)bbObjectDowncast((BBOBJECT)((struct database_core_TQueryRecord_obj*)bbNullObjectTest((BBObject*)bbt_record))->clas->m_value_i((struct database_core_TQueryRecord_obj*)bbt_record,2),(BBClass*)&database_core_dbtypes_TDBString))))->_database_core_dbtypes_tdbstring_value ));
				bbOnDebugLeaveScope();
			}
			struct BBDebugStm __stmt_11 = {0xe84542c7f17e9f2b, 67, 0};
			bbOnDebugEnterStm(&__stmt_11);
			((struct database_core_TDBConnection_obj*)bbNullObjectTest((BBObject*)bbt_db))->clas->m_close((struct database_core_TDBConnection_obj*)bbt_db);
			bbOnDebugLeaveScope();
		}
		bbOnDebugLeaveScope();
		return 0;
	}
	return 0;
}