// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/jfbuild/src/sdlayer2.c
// Function: main
int main(int argc, char *argv[])
{
	int r;

	buildkeytranslationtable();

	// SDL must be initialised before GTK or else crashing will ensue.
	if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER)) {
		buildprintf("Early initialisation of SDL failed! (%s)\n", SDL_GetError());
		return 1;
	}

#ifdef HAVE_GTK
	wmgtk_init(&argc, &argv);
#endif

#ifdef __APPLE__
	// consume Xcode's "-NSDocumentRevisionsDebugMode xx" parameter
	_buildargv = calloc(argc+1, sizeof(char *));
	for (r = _buildargc = 0; r < argc; r++) {
		if (strcmp(argv[r], "-NSDocumentRevisionsDebugMode") == 0) {
			r++;
		} else {
			_buildargv[_buildargc++] = argv[r];
		}
	}
	_buildargv[_buildargc] = 0;
#else
	_buildargc = argc;
	_buildargv = (const char **)argv;
#endif

	startwin_open();
	baselayer_init();

	// This avoids doubled character input in the (OSX) startup window's edit fields.
	SDL_EventState(SDL_TEXTINPUT, SDL_IGNORE);

	r = app_main(_buildargc, (char const * const*)_buildargv);

#ifdef __APPLE__
	free(_buildargv);
#endif

	startwin_close();
#ifdef HAVE_GTK
	wmgtk_exit();
#endif

	SDL_Quit();

	return r;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movl %edi, 0xc(%rsp)
movq %rsi, 0x10(%rsp)
leaq 0x6611c9(%rip), %rdi    # 0x6cebe0
movl $0x400, %edx            # imm = 0x400
xorl %esi, %esi
callq 0x62f0
movb $0x59, 0x661246(%rip)   # 0x6cec70
movabsq $0x90f080e1b010d1c, %rax # imm = 0x90F080E1B010D1C
movq %rax, 0x6611f5(%rip)    # 0x6cec30
movb $0x39, 0x6611f6(%rip)   # 0x6cec38
movb $0x28, 0x6611ff(%rip)   # 0x6cec48
movb $0x33, 0x6611fc(%rip)   # 0x6cec4c
movb $0xc, 0x6611e3(%rip)    # 0x6cec3a
movb $0x34, 0x6611f0(%rip)   # 0x6cec4e
movb $0x35, 0x6611eb(%rip)   # 0x6cec50
movb $0xb, 0x6611c2(%rip)    # 0x6cec2e
movb $0x2, 0x6611a9(%rip)    # 0x6cec1c
movb $0x3, 0x6611a4(%rip)    # 0x6cec1e
movb $0x4, 0x66119f(%rip)    # 0x6cec20
movb $0x5, 0x66119a(%rip)    # 0x6cec22
movb $0x6, 0x661195(%rip)    # 0x6cec24
movb $0x7, 0x661190(%rip)    # 0x6cec26
movb $0x8, 0x66118b(%rip)    # 0x6cec28
movb $0x9, 0x661186(%rip)    # 0x6cec2a
movb $0xa, 0x661181(%rip)    # 0x6cec2c
movb $0x27, 0x661194(%rip)   # 0x6cec46
movb $0xd, 0x661183(%rip)    # 0x6cec3c
movw $0x9c2b, 0x661180(%rip) # imm = 0x9C2B
movl $0x9d1b9b1a, 0x661172(%rip) # imm = 0x9D1B9B1A
movb $0x29, 0x661177(%rip)   # 0x6cec4a
movaps 0x10c16(%rip), %xmm0    # 0x7e6f0
movups %xmm0, 0x661107(%rip)   # 0x6cebe8
movaps 0x10c18(%rip), %xmm0    # 0x7e700
movups %xmm0, 0x661109(%rip)   # 0x6cebf8
movaps 0x10c1a(%rip), %xmm0    # 0x7e710
movups %xmm0, 0x66110b(%rip)   # 0x6cec08
movl $0x9a2c9915, 0x661111(%rip) # imm = 0x9A2C9915
movb $-0x2d, 0x66116a(%rip)  # 0x6cec78
movb $0x52, 0x66118f(%rip)   # 0x6ceca4
movb $0x4f, 0x661176(%rip)   # 0x6cec92
movb $0x50, 0x661171(%rip)   # 0x6cec94
movb $0x51, 0x66116c(%rip)   # 0x6cec96
movb $0x4b, 0x661167(%rip)   # 0x6cec98
movb $0x4c, 0x661162(%rip)   # 0x6cec9a
movb $0x4d, 0x66115d(%rip)   # 0x6cec9c
movb $0x47, 0x661158(%rip)   # 0x6cec9e
movb $0x48, 0x661153(%rip)   # 0x6ceca0
movb $0x49, 0x66114e(%rip)   # 0x6ceca2
movb $0x53, 0x66114b(%rip)   # 0x6ceca6
movb $-0x4b, 0x661126(%rip)  # 0x6cec88
movb $0x37, 0x661121(%rip)   # 0x6cec8a
movb $0x4a, 0x66111c(%rip)   # 0x6cec8c
movb $0x4e, 0x661117(%rip)   # 0x6cec8e
movw $0xd9c, 0x661110(%rip)  # imm = 0xD9C
movb $-0x38, 0x6610fd(%rip)  # 0x6cec84
movb $-0x30, 0x6610f4(%rip)  # 0x6cec82
movb $-0x33, 0x6610e9(%rip)  # 0x6cec7e
movb $-0x35, 0x6610e4(%rip)  # 0x6cec80
movb $-0x2e, 0x6610cf(%rip)  # 0x6cec72
movb $-0x39, 0x6610ca(%rip)  # 0x6cec74
movb $-0x31, 0x6610c9(%rip)  # 0x6cec7a
movb $-0x37, 0x6610be(%rip)  # 0x6cec76
movb $-0x2f, 0x6610bd(%rip)  # 0x6cec7c
movb $0x3b, 0x66108e(%rip)   # 0x6cec54
movb $0x3c, 0x661089(%rip)   # 0x6cec56
movb $0x3d, 0x661084(%rip)   # 0x6cec58
movb $0x3e, 0x66107f(%rip)   # 0x6cec5a
movb $0x3f, 0x66107a(%rip)   # 0x6cec5c
movb $0x40, 0x661075(%rip)   # 0x6cec5e
movb $0x41, 0x661070(%rip)   # 0x6cec60
movb $0x42, 0x66106b(%rip)   # 0x6cec62
movb $0x43, 0x661066(%rip)   # 0x6cec64
movb $0x44, 0x661061(%rip)   # 0x6cec66
movb $0x57, 0x66105c(%rip)   # 0x6cec68
movb $0x58, 0x661057(%rip)   # 0x6cec6a
movb $0x45, 0x66106c(%rip)   # 0x6cec86
movb $0x3a, 0x661031(%rip)   # 0x6cec52
movb $0x46, 0x661046(%rip)   # 0x6cec6e
movb $0x36, 0x66117b(%rip)   # 0x6cedaa
movb $0x2a, 0x66116c(%rip)   # 0x6ceda2
movb $-0x63, 0x66116b(%rip)  # 0x6ceda8
movb $0x1d, 0x66115c(%rip)   # 0x6ceda0
movb $-0x48, 0x661161(%rip)  # 0x6cedac
movb $0x38, 0x661152(%rip)   # 0x6ceda4
movb $-0x25, 0x66114d(%rip)  # 0x6ceda6
movb $-0x24, 0x66114e(%rip)  # 0x6cedae
movb $-0x2, 0x661005(%rip)   # 0x6cec6c
movb $0x54, 0x6610a6(%rip)   # 0x6ced14
movb $-0x23, 0x661035(%rip)  # 0x6cecaa
movl $0x21, %edi
callq 0x6cf0
testl %eax, %eax
je 0x6dca0
callq 0x6b40
leaq 0x10aab(%rip), %rdi     # 0x7e73a
movq %rax, %rsi
xorl %eax, %eax
callq 0x25221
movl $0x1, %ebx
jmp 0x6dcfe
leaq 0xc(%rsp), %rbx
leaq 0x10(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6f9a8
movl (%rbx), %eax
leaq 0x1103d2(%rip), %rbx    # 0x17e090
movl %eax, (%rbx)
movq (%r14), %rax
leaq 0x1103ce(%rip), %r14    # 0x17e098
movq %rax, (%r14)
callq 0x1e1e8
callq 0x1f12d
movl $0x303, %edi            # imm = 0x303
xorl %esi, %esi
callq 0x63b0
movl (%rbx), %edi
movq (%r14), %rsi
callq 0xad17
movl %eax, %ebx
callq 0x1e58e
callq 0x6fa1f
callq 0x6330
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq