#include <openb3d.mod/stbimageloader.mod/.bmx/stbimageloader.bmx.debug.win32.x64.h>
struct BBDebugScope_1{int kind; const char *name; BBDebugDecl decls[2]; };
struct BBDebugScope_11{int kind; const char *name; BBDebugDecl decls[12]; };
struct BBDebugScope_2{int kind; const char *name; BBDebugDecl decls[3]; };
struct BBDebugScope_3{int kind; const char *name; BBDebugDecl decls[4]; };
void _openb3d_stbimageloader_TPixmapLoaderB3D_New(struct openb3d_stbimageloader_TPixmapLoaderB3D_obj* o) {
	_brl_pixmap_TPixmapLoader_New((struct brl_pixmap_TPixmapLoader_obj*)o);
	o->clas = &openb3d_stbimageloader_TPixmapLoaderB3D;
}
struct brl_pixmap_TPixmap_obj* _openb3d_stbimageloader_TPixmapLoaderB3D_LoadPixmap_TTStream(struct openb3d_stbimageloader_TPixmapLoaderB3D_obj* o,struct brl_stream_TStream_obj* bbt_stream){
	((struct openb3d_stbimageloader_TPixmapLoaderB3D_obj*)bbNullObjectTest((BBObject*)o));
	BBSIZET bbt_bufLen=0;
	BBBYTE* bbt_buffer=0;
	struct brl_ramstream_TRamStream_obj* bbt_ram=(struct brl_ramstream_TRamStream_obj*)((struct brl_ramstream_TRamStream_obj*)&bbNullObject);
	struct brl_pixmap_TPixmap_obj* bbt_pixmap=(struct brl_pixmap_TPixmap_obj*)((struct brl_pixmap_TPixmap_obj*)&bbNullObject);
	BBBYTE* bbt_imgPtr=0;
	BBINT bbt_width=0;
	BBINT bbt_height=0;
	BBINT bbt_channels=0;
	BBINT bbt_test=0;
	struct BBDebugScope_11 __scope = {
		BBDEBUGSCOPE_FUNCTION,
		"LoadPixmap",
		{
			{
				BBDEBUGDECL_LOCAL,
				"Self",
				":TPixmapLoaderB3D",
				.var_address=&o
			},
			{
				BBDEBUGDECL_LOCAL,
				"stream",
				":TStream",
				.var_address=&bbt_stream
			},
			{
				BBDEBUGDECL_LOCAL,
				"bufLen",
				"t",
				.var_address=&bbt_bufLen
			},
			{
				BBDEBUGDECL_LOCAL,
				"buffer",
				"*b",
				.var_address=&bbt_buffer
			},
			{
				BBDEBUGDECL_LOCAL,
				"ram",
				":TRamStream",
				.var_address=&bbt_ram
			},
			{
				BBDEBUGDECL_LOCAL,
				"pixmap",
				":TPixmap",
				.var_address=&bbt_pixmap
			},
			{
				BBDEBUGDECL_LOCAL,
				"imgPtr",
				"*b",
				.var_address=&bbt_imgPtr
			},
			{
				BBDEBUGDECL_LOCAL,
				"width",
				"i",
				.var_address=&bbt_width
			},
			{
				BBDEBUGDECL_LOCAL,
				"height",
				"i",
				.var_address=&bbt_height
			},
			{
				BBDEBUGDECL_LOCAL,
				"channels",
				"i",
				.var_address=&bbt_channels
			},
			{
				BBDEBUGDECL_LOCAL,
				"test",
				"i",
				.var_address=&bbt_test
			},
			{
				BBDEBUGDECL_END
			}
		}
	};
	bbOnDebugEnterScope((BBDebugScope *)&__scope);
	struct BBDebugStm __stmt_0 = {0x9af431c92a44377d, 49, 0};
	bbOnDebugEnterStm(&__stmt_0);
	bbt_bufLen=((BBSIZET)brl_stream_StreamSize((struct brl_stream_TStream_obj*)bbt_stream));
	struct BBDebugStm __stmt_1 = {0x9af431c92a44377d, 53, 0};
	bbOnDebugEnterStm(&__stmt_1);
	bbt_buffer=bbMemAlloc((size_t)bbt_bufLen);
	struct BBDebugStm __stmt_2 = {0x9af431c92a44377d, 54, 0};
	bbOnDebugEnterStm(&__stmt_2);
	bbt_ram=(struct brl_ramstream_TRamStream_obj*)brl_ramstream_CreateRamStream(bbt_buffer,((BBLONG)bbt_bufLen),1,1);
	struct BBDebugStm __stmt_3 = {0x9af431c92a44377d, 55, 0};
	bbOnDebugEnterStm(&__stmt_3);
	brl_stream_CopyStream((struct brl_stream_TStream_obj*)bbt_stream,(struct brl_stream_TStream_obj*)((struct brl_stream_TStream_obj*)bbObjectDowncast((BBOBJECT)bbt_ram,(BBClass*)&brl_stream_TStream)),4096);
	struct BBDebugStm __stmt_4 = {0x9af431c92a44377d, 57, 0};
	bbOnDebugEnterStm(&__stmt_4);
	bbt_pixmap=(struct brl_pixmap_TPixmap_obj*)((struct brl_pixmap_TPixmap_obj*)&bbNullObject);
	struct BBDebugStm __stmt_5 = {0x9af431c92a44377d, 57, 0};
	bbOnDebugEnterStm(&__stmt_5);
	bbt_imgPtr=0;
	struct BBDebugStm __stmt_6 = {0x9af431c92a44377d, 57, 0};
	bbOnDebugEnterStm(&__stmt_6);
	bbt_width=0;
	struct BBDebugStm __stmt_7 = {0x9af431c92a44377d, 57, 0};
	bbOnDebugEnterStm(&__stmt_7);
	bbt_height=0;
	struct BBDebugStm __stmt_8 = {0x9af431c92a44377d, 57, 0};
	bbOnDebugEnterStm(&__stmt_8);
	bbt_channels=0;
	struct BBDebugStm __stmt_9 = {0x9af431c92a44377d, 59, 0};
	bbOnDebugEnterStm(&__stmt_9);
	bbt_test=stbi_info_from_memory(bbt_buffer,bbt_bufLen,(&bbt_width),(&bbt_height),(&bbt_channels));
	struct BBDebugStm __stmt_10 = {0x9af431c92a44377d, 61, 0};
	bbOnDebugEnterStm(&__stmt_10);
	if(bbt_test==1){
		struct BBDebugScope __scope = {
			BBDEBUGSCOPE_LOCALBLOCK,
			0,
			{
				{
					BBDEBUGDECL_END
				}
			}
		};
		bbOnDebugEnterScope((BBDebugScope *)&__scope);
		struct BBDebugStm __stmt_0 = {0x9af431c92a44377d, 62, 0};
		bbOnDebugEnterStm(&__stmt_0);
		bbt_imgPtr=stbi_load_from_memory(bbt_buffer,bbt_bufLen,(&bbt_width),(&bbt_height),(&bbt_channels),4);
		struct BBDebugStm __stmt_1 = {0x9af431c92a44377d, 63, 0};
		bbOnDebugEnterStm(&__stmt_1);
		if(bbt_channels==3){
			struct BBDebugScope __scope = {
				BBDEBUGSCOPE_LOCALBLOCK,
				0,
				{
					{
						BBDEBUGDECL_END
					}
				}
			};
			bbOnDebugEnterScope((BBDebugScope *)&__scope);
			struct BBDebugStm __stmt_0 = {0x9af431c92a44377d, 63, 0};
			bbOnDebugEnterStm(&__stmt_0);
			bbt_channels=4;
			bbOnDebugLeaveScope();
		}
		bbOnDebugLeaveScope();
	}
	struct BBDebugStm __stmt_11 = {0x9af431c92a44377d, 66, 0};
	bbOnDebugEnterStm(&__stmt_11);
	if(bbt_imgPtr){
		BBINT bbt_pf=0;
		struct BBDebugScope_1 __scope = {
			BBDEBUGSCOPE_LOCALBLOCK,
			0,
			{
				{
					BBDEBUGDECL_LOCAL,
					"pf",
					"i",
					.var_address=&bbt_pf
				},
				{
					BBDEBUGDECL_END
				}
			}
		};
		bbOnDebugEnterScope((BBDebugScope *)&__scope);
		struct BBDebugStm __stmt_0 = {0x9af431c92a44377d, 67, 0};
		bbOnDebugEnterStm(&__stmt_0);
		bbt_pf=0;
		struct BBDebugStm __stmt_1 = {0x9af431c92a44377d, 68, 0};
		bbOnDebugEnterStm(&__stmt_1);
		BBINT bbt_=bbt_channels;
		struct BBDebugStm __stmt_2 = {0x9af431c92a44377d, 69, 0};
		bbOnDebugEnterStm(&__stmt_2);
		if(bbt_==1){
			struct BBDebugScope __scope = {
				BBDEBUGSCOPE_LOCALBLOCK,
				0,
				{
					{
						BBDEBUGDECL_END
					}
				}
			};
			bbOnDebugEnterScope((BBDebugScope *)&__scope);
			struct BBDebugStm __stmt_0 = {0x9af431c92a44377d, 70, 0};
			bbOnDebugEnterStm(&__stmt_0);
			bbt_pf=1;
			bbOnDebugLeaveScope();
		}else{
			struct BBDebugScope __scope = {
				BBDEBUGSCOPE_LOCALBLOCK,
				0,
				{
					{
						BBDEBUGDECL_END
					}
				}
			};
			bbOnDebugEnterScope((BBDebugScope *)&__scope);
			struct BBDebugStm __stmt_0 = {0x9af431c92a44377d, 71, 0};
			bbOnDebugEnterStm(&__stmt_0);
			if(bbt_==3){
				struct BBDebugScope __scope = {
					BBDEBUGSCOPE_LOCALBLOCK,
					0,
					{
						{
							BBDEBUGDECL_END
						}
					}
				};
				bbOnDebugEnterScope((BBDebugScope *)&__scope);
				struct BBDebugStm __stmt_0 = {0x9af431c92a44377d, 72, 0};
				bbOnDebugEnterStm(&__stmt_0);
				bbt_pf=4;
				bbOnDebugLeaveScope();
			}else{
				struct BBDebugScope __scope = {
					BBDEBUGSCOPE_LOCALBLOCK,
					0,
					{
						{
							BBDEBUGDECL_END
						}
					}
				};
				bbOnDebugEnterScope((BBDebugScope *)&__scope);
				struct BBDebugStm __stmt_0 = {0x9af431c92a44377d, 73, 0};
				bbOnDebugEnterStm(&__stmt_0);
				if(bbt_==4){
					struct BBDebugScope __scope = {
						BBDEBUGSCOPE_LOCALBLOCK,
						0,
						{
							{
								BBDEBUGDECL_END
							}
						}
					};
					bbOnDebugEnterScope((BBDebugScope *)&__scope);
					struct BBDebugStm __stmt_0 = {0x9af431c92a44377d, 74, 0};
					bbOnDebugEnterStm(&__stmt_0);
					bbt_pf=6;
					bbOnDebugLeaveScope();
				}else{
					struct BBDebugScope __scope = {
						BBDEBUGSCOPE_LOCALBLOCK,
						0,
						{
							{
								BBDEBUGDECL_END
							}
						}
					};
					bbOnDebugEnterScope((BBDebugScope *)&__scope);
					struct BBDebugStm __stmt_0 = {0x9af431c92a44377d, 75, 0};
					bbOnDebugEnterStm(&__stmt_0);
					if(bbt_==2){
						BBBYTE* bbt_src=0;
						BBBYTE* bbt_dst=0;
						struct BBDebugScope_2 __scope = {
							BBDEBUGSCOPE_LOCALBLOCK,
							0,
							{
								{
									BBDEBUGDECL_LOCAL,
									"src",
									"*b",
									.var_address=&bbt_src
								},
								{
									BBDEBUGDECL_LOCAL,
									"dst",
									"*b",
									.var_address=&bbt_dst
								},
								{
									BBDEBUGDECL_END
								}
							}
						};
						bbOnDebugEnterScope((BBDebugScope *)&__scope);
						struct BBDebugStm __stmt_0 = {0x9af431c92a44377d, 76, 0};
						bbOnDebugEnterStm(&__stmt_0);
						bbt_src=bbt_imgPtr;
						struct BBDebugStm __stmt_1 = {0x9af431c92a44377d, 77, 0};
						bbOnDebugEnterStm(&__stmt_1);
						bbt_dst=((struct brl_pixmap_TPixmap_obj*)bbNullObjectTest((BBObject*)bbt_pixmap))->_brl_pixmap_tpixmap_pixels ;
						struct BBDebugStm __stmt_2 = {0x9af431c92a44377d, 78, 0};
						bbOnDebugEnterStm(&__stmt_2);
						bbt_pixmap=(struct brl_pixmap_TPixmap_obj*)brl_pixmap_CreatePixmap(bbt_width,bbt_height,6,4);
						struct BBDebugStm __stmt_3 = {0x9af431c92a44377d, 80, 0};
						bbOnDebugEnterStm(&__stmt_3);
						{
							BBINT bbt_y=0;
							BBINT bbt_2=bbt_height;
							for(;(bbt_y<bbt_2);bbt_y=(bbt_y+1)){
								struct BBDebugScope_1 __scope = {
									BBDEBUGSCOPE_LOCALBLOCK,
									0,
									{
										{
											BBDEBUGDECL_LOCAL,
											"y",
											"i",
											.var_address=&bbt_y
										},
										{
											BBDEBUGDECL_END
										}
									}
								};
								bbOnDebugEnterScope((BBDebugScope *)&__scope);
								struct BBDebugStm __stmt_0 = {0x9af431c92a44377d, 81, 0};
								bbOnDebugEnterStm(&__stmt_0);
								{
									BBINT bbt_x=0;
									BBINT bbt_3=bbt_width;
									for(;(bbt_x<bbt_3);bbt_x=(bbt_x+1)){
										BBINT bbt_a=0;
										BBINT bbt_i=0;
										struct BBDebugScope_3 __scope = {
											BBDEBUGSCOPE_LOCALBLOCK,
											0,
											{
												{
													BBDEBUGDECL_LOCAL,
													"x",
													"i",
													.var_address=&bbt_x
												},
												{
													BBDEBUGDECL_LOCAL,
													"a",
													"i",
													.var_address=&bbt_a
												},
												{
													BBDEBUGDECL_LOCAL,
													"i",
													"i",
													.var_address=&bbt_i
												},
												{
													BBDEBUGDECL_END
												}
											}
										};
										bbOnDebugEnterScope((BBDebugScope *)&__scope);
										struct BBDebugStm __stmt_0 = {0x9af431c92a44377d, 82, 0};
										bbOnDebugEnterStm(&__stmt_0);
										bbt_a=((BBINT)bbt_src[0]);
										struct BBDebugStm __stmt_1 = {0x9af431c92a44377d, 83, 0};
										bbOnDebugEnterStm(&__stmt_1);
										bbt_i=((BBINT)bbt_src[1]);
										struct BBDebugStm __stmt_2 = {0x9af431c92a44377d, 84, 0};
										bbOnDebugEnterStm(&__stmt_2);
										bbt_dst[0]=((BBBYTE)bbt_i);
										struct BBDebugStm __stmt_3 = {0x9af431c92a44377d, 85, 0};
										bbOnDebugEnterStm(&__stmt_3);
										bbt_dst[1]=((BBBYTE)bbt_i);
										struct BBDebugStm __stmt_4 = {0x9af431c92a44377d, 86, 0};
										bbOnDebugEnterStm(&__stmt_4);
										bbt_dst[2]=((BBBYTE)bbt_i);
										struct BBDebugStm __stmt_5 = {0x9af431c92a44377d, 87, 0};
										bbOnDebugEnterStm(&__stmt_5);
										bbt_dst[3]=((BBBYTE)bbt_a);
										struct BBDebugStm __stmt_6 = {0x9af431c92a44377d, 88, 0};
										bbOnDebugEnterStm(&__stmt_6);
										bbt_src+=2;
										struct BBDebugStm __stmt_7 = {0x9af431c92a44377d, 89, 0};
										bbOnDebugEnterStm(&__stmt_7);
										bbt_dst+=4;
										bbOnDebugLeaveScope();
									}
								}
								bbOnDebugLeaveScope();
							}
						}
						bbOnDebugLeaveScope();
					}
					bbOnDebugLeaveScope();
				}
				bbOnDebugLeaveScope();
			}
			bbOnDebugLeaveScope();
		}
		struct BBDebugStm __stmt_3 = {0x9af431c92a44377d, 94, 0};
		bbOnDebugEnterStm(&__stmt_3);
		if(bbt_pf!=0){
			struct BBDebugScope __scope = {
				BBDEBUGSCOPE_LOCALBLOCK,
				0,
				{
					{
						BBDEBUGDECL_END
					}
				}
			};
			bbOnDebugEnterScope((BBDebugScope *)&__scope);
			struct BBDebugStm __stmt_0 = {0x9af431c92a44377d, 95, 0};
			bbOnDebugEnterStm(&__stmt_0);
			bbt_pixmap=(struct brl_pixmap_TPixmap_obj*)brl_pixmap_CreatePixmap(bbt_width,bbt_height,bbt_pf,((BBINT*)BBARRAYDATAINDEX((brl_pixmap_pixel_BytesPerPixel),(brl_pixmap_pixel_BytesPerPixel)->dims,((BBUINT)bbt_pf)))[((BBUINT)bbt_pf)]);
			struct BBDebugStm __stmt_1 = {0x9af431c92a44377d, 97, 0};
			bbOnDebugEnterStm(&__stmt_1);
			bbMemCopy((void*)((struct brl_pixmap_TPixmap_obj*)bbNullObjectTest((BBObject*)bbt_pixmap))->_brl_pixmap_tpixmap_pixels ,(const void*)bbt_imgPtr,(size_t)((BBSIZET)((bbt_width*bbt_height)*((BBINT*)BBARRAYDATAINDEX((brl_pixmap_pixel_BytesPerPixel),(brl_pixmap_pixel_BytesPerPixel)->dims,((BBUINT)bbt_pf)))[((BBUINT)bbt_pf)])));
			bbOnDebugLeaveScope();
		}
		struct BBDebugStm __stmt_4 = {0x9af431c92a44377d, 103, 0};
		bbOnDebugEnterStm(&__stmt_4);
		brl_stream_CloseStream((struct brl_stream_TStream_obj*)((struct brl_stream_TStream_obj*)bbObjectDowncast((BBOBJECT)bbt_ram,(BBClass*)&brl_stream_TStream)));
		struct BBDebugStm __stmt_5 = {0x9af431c92a44377d, 104, 0};
		bbOnDebugEnterStm(&__stmt_5);
		bbMemFree((void*)bbt_buffer);
		struct BBDebugStm __stmt_6 = {0x9af431c92a44377d, 105, 0};
		bbOnDebugEnterStm(&__stmt_6);
		stbi_image_free(bbt_imgPtr);
		bbOnDebugLeaveScope();
	}
	struct BBDebugStm __stmt_12 = {0x9af431c92a44377d, 108, 0};
	bbOnDebugEnterStm(&__stmt_12);
	bbOnDebugLeaveScope();
	return (struct brl_pixmap_TPixmap_obj*)bbt_pixmap;
}
struct BBDebugScope_2 openb3d_stbimageloader_TPixmapLoaderB3D_scope ={
	BBDEBUGSCOPE_USERTYPE,
	"TPixmapLoaderB3D",
	{
		{
			BBDEBUGDECL_TYPEMETHOD,
			"New",
			"()",
			.func_ptr=(BBFuncPtr)&_openb3d_stbimageloader_TPixmapLoaderB3D_New
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"LoadPixmap",
			"(:TStream):TPixmap",
			.func_ptr=(BBFuncPtr)&_openb3d_stbimageloader_TPixmapLoaderB3D_LoadPixmap_TTStream
		},
		{
			BBDEBUGDECL_END
		}
	}
};
struct BBClass_openb3d_stbimageloader_TPixmapLoaderB3D openb3d_stbimageloader_TPixmapLoaderB3D={
	&brl_pixmap_TPixmapLoader,
	bbObjectFree,
	(BBDebugScope*)&openb3d_stbimageloader_TPixmapLoaderB3D_scope,
	sizeof(struct openb3d_stbimageloader_TPixmapLoaderB3D_obj),
	(void (*)(BBOBJECT))_openb3d_stbimageloader_TPixmapLoaderB3D_New,
	bbObjectDtor,
	bbObjectToString,
	bbObjectCompare,
	bbObjectSendMessage,
	0,
	0,
	0
	,0
	,sizeof(void*)
	,_openb3d_stbimageloader_TPixmapLoaderB3D_LoadPixmap_TTStream
};

static int __bb_openb3d_stbimageloader_stbimageloader_inited = 0;
int __bb_openb3d_stbimageloader_stbimageloader(){
	if (!__bb_openb3d_stbimageloader_stbimageloader_inited) {
		__bb_openb3d_stbimageloader_stbimageloader_inited = 1;
		__bb_brl_blitz_blitz();
		__bb_brl_pixmap_pixmap();
		__bb_brl_ramstream_ramstream();
		bbObjectRegisterType((BBCLASS)&openb3d_stbimageloader_TPixmapLoaderB3D);
		bbRegisterSource(0x9af431c92a44377d, "c:/BlitzmaxNG/mod/openb3d.mod/stbimageloader.mod/stbimageloader.bmx");
		struct BBDebugScope __scope = {
			BBDEBUGSCOPE_FUNCTION,
			"stbimageloader",
			{
				{
					BBDEBUGDECL_END
				}
			}
		};
		bbOnDebugEnterScope((BBDebugScope *)&__scope);
		struct BBDebugStm __stmt_0 = {0x9af431c92a44377d, 114, 0};
		bbOnDebugEnterStm(&__stmt_0);
		(struct openb3d_stbimageloader_TPixmapLoaderB3D_obj*)bbObjectNew((BBClass *)&openb3d_stbimageloader_TPixmapLoaderB3D);
		bbOnDebugLeaveScope();
		return 0;
	}
	return 0;
}