// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: preinitengine
int preinitengine(void)
{
	char compiler[30] = "an unidentified compiler";

#if defined(_MSC_VER)
	sprintf(compiler, "MS Visual C++ %d.%02d", _MSC_VER/100, _MSC_VER%100);
#elif defined(__clang__)
	sprintf(compiler, "Clang %d.%d", __clang_major__, __clang_minor__);
#elif defined(__GNUC__)
	sprintf(compiler, "GCC %d.%d", __GNUC__, __GNUC_MINOR__);
#endif

	buildprintf("\nBUILD engine by Ken Silverman (http://www.advsys.net/ken)\n"
	       "Additional improvements by Jonathon Fowler (http://www.jonof.id.au)\n"
	       "and other contributors. See BUILDLIC.TXT for terms.\n\n"
	       "Version %s.\nBuilt %s %s using %s.\n%d-bit word size.\n\n",
	       build_version, build_date, build_time, compiler, (int)(sizeof(intptr_t)<<3));

	// Detect anomalous structure packing.
	assert(sizeof(sectortype) == 40);
	assert((intptr_t)&sector[1] - (intptr_t)&sector[0] == sizeof(sectortype));
	assert(sizeof(walltype) == 32);
	assert((intptr_t)&wall[1] - (intptr_t)&wall[0] == sizeof(walltype));
	assert(sizeof(spritetype) == 44);
	assert((intptr_t)&sprite[1] - (intptr_t)&sprite[0] == sizeof(spritetype));
	assert(sizeof(spriteexttype) == 12);
	assert((intptr_t)&spriteext[1] - (intptr_t)&spriteext[0] == sizeof(spriteexttype));

	if (initsystem()) exit(1);

#ifndef USING_A_C
	makeasmwriteable();

	if (Bgetenv("BUILD_NOP6")) {
		buildprintf("Disabling P6 optimizations.\n");
		dommxoverlay = 0;
	}
	if (dommxoverlay) mmxoverlay();
#endif

	validmodecnt = 0;
	getvalidmodes();

	initcrc32table();

	preinitcalled = 1;
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq 0x7b2d1(%rip), %rax     # 0xb2dc0
movq %rax, -0x20(%rbp)
movq 0x7b2ce(%rip), %rax     # 0xb2dc8
movq %rax, -0x18(%rbp)
movq 0x7b2cb(%rip), %rax     # 0xb2dd0
movq %rax, -0x10(%rbp)
movl 0x7b2c9(%rip), %eax     # 0xb2dd8
movl %eax, -0x8(%rbp)
movw 0x7b2c3(%rip), %ax      # 0xb2ddc
movw %ax, -0x4(%rbp)
leaq -0x20(%rbp), %rdi
leaq 0x7b2e0(%rip), %rsi     # 0xb2e08
movl $0x13, %edx
movl $0x1, %ecx
movb $0x0, %al
callq 0x6a30
leaq 0xaa2b8(%rip), %rax     # 0xe1df8
movq (%rax), %rsi
leaq 0xaa2b6(%rip), %rax     # 0xe1e00
movq (%rax), %rdx
leaq 0xaa2b4(%rip), %rax     # 0xe1e08
movq (%rax), %rcx
leaq -0x20(%rbp), %r8
leaq 0x7b2b2(%rip), %rdi     # 0xb2e14
movl $0x40, %r9d
movb $0x0, %al
callq 0x37c90
leaq 0x248a4a(%rip), %rcx    # 0x2805c0
movq %rcx, %rax
addq $0x28, %rax
subq %rcx, %rax
cmpq $0x28, %rax
jne 0x37b88
jmp 0x37ba7
leaq 0x7b36f(%rip), %rdi     # 0xb2efe
leaq 0x7b3aa(%rip), %rsi     # 0xb2f40
movl $0x14fc, %edx           # imm = 0x14FC
leaq 0x7b3ab(%rip), %rcx     # 0xb2f4d
callq 0x61a0
leaq 0x1bda02(%rip), %rcx    # 0x1f55b0
movq %rcx, %rax
addq $0x20, %rax
subq %rcx, %rax
cmpq $0x20, %rax
jne 0x37bc0
jmp 0x37bdf
leaq 0x7b39e(%rip), %rdi     # 0xb2f65
leaq 0x7b372(%rip), %rsi     # 0xb2f40
movl $0x14fe, %edx           # imm = 0x14FE
leaq 0x7b373(%rip), %rcx     # 0xb2f4d
callq 0x61a0
leaq 0x281c2a(%rip), %rcx    # 0x2b9810
movq %rcx, %rax
addq $0x2c, %rax
subq %rcx, %rax
cmpq $0x2c, %rax
jne 0x37bf8
jmp 0x37c17
leaq 0x7b3a2(%rip), %rdi     # 0xb2fa1
leaq 0x7b33a(%rip), %rsi     # 0xb2f40
movl $0x1500, %edx           # imm = 0x1500
leaq 0x7b33b(%rip), %rcx     # 0xb2f4d
callq 0x61a0
leaq 0x331bf2(%rip), %rcx    # 0x369810
movq %rcx, %rax
addq $0xc, %rax
subq %rcx, %rax
cmpq $0xc, %rax
jne 0x37c30
jmp 0x37c4f
leaq 0x7b3ac(%rip), %rdi     # 0xb2fe3
leaq 0x7b302(%rip), %rsi     # 0xb2f40
movl $0x1502, %edx           # imm = 0x1502
leaq 0x7b303(%rip), %rcx     # 0xb2f4d
callq 0x61a0
callq 0xa4d60
cmpl $0x0, %eax
je 0x37c63
movl $0x1, %edi
callq 0x6630
movl $0x0, 0x3627a3(%rip)    # 0x39a410
callq 0xa5720
callq 0xa83a0
movl $0x1, 0x362793(%rip)    # 0x39a414
xorl %eax, %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)