// File: /workspace/github_c_makefile_star2_O2/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 0x6658c4(%rip), %rdi    # 0x6c7be0
movl $0x400, %edx            # imm = 0x400
xorl %esi, %esi
callq 0x62f0
movb $0x59, 0x665941(%rip)   # 0x6c7c70
movabsq $0x90f080e1b010d1c, %rax # imm = 0x90F080E1B010D1C
movq %rax, 0x6658f0(%rip)    # 0x6c7c30
movb $0x39, 0x6658f1(%rip)   # 0x6c7c38
movb $0x28, 0x6658fa(%rip)   # 0x6c7c48
movb $0x33, 0x6658f7(%rip)   # 0x6c7c4c
movb $0xc, 0x6658de(%rip)    # 0x6c7c3a
movb $0x34, 0x6658eb(%rip)   # 0x6c7c4e
movb $0x35, 0x6658e6(%rip)   # 0x6c7c50
movb $0xb, 0x6658bd(%rip)    # 0x6c7c2e
movb $0x2, 0x6658a4(%rip)    # 0x6c7c1c
movb $0x3, 0x66589f(%rip)    # 0x6c7c1e
movb $0x4, 0x66589a(%rip)    # 0x6c7c20
movb $0x5, 0x665895(%rip)    # 0x6c7c22
movb $0x6, 0x665890(%rip)    # 0x6c7c24
movb $0x7, 0x66588b(%rip)    # 0x6c7c26
movb $0x8, 0x665886(%rip)    # 0x6c7c28
movb $0x9, 0x665881(%rip)    # 0x6c7c2a
movb $0xa, 0x66587c(%rip)    # 0x6c7c2c
movb $0x27, 0x66588f(%rip)   # 0x6c7c46
movb $0xd, 0x66587e(%rip)    # 0x6c7c3c
movw $0x9c2b, 0x66587b(%rip) # imm = 0x9C2B
movl $0x9d1b9b1a, 0x66586d(%rip) # imm = 0x9D1B9B1A
movb $0x29, 0x665872(%rip)   # 0x6c7c4a
movaps 0x11171(%rip), %xmm0    # 0x73550
movups %xmm0, 0x665802(%rip)   # 0x6c7be8
movaps 0x11173(%rip), %xmm0    # 0x73560
movups %xmm0, 0x665804(%rip)   # 0x6c7bf8
movaps 0x11175(%rip), %xmm0    # 0x73570
movups %xmm0, 0x665806(%rip)   # 0x6c7c08
movl $0x9a2c9915, 0x66580c(%rip) # imm = 0x9A2C9915
movb $-0x2d, 0x665865(%rip)  # 0x6c7c78
movb $0x52, 0x66588a(%rip)   # 0x6c7ca4
movb $0x4f, 0x665871(%rip)   # 0x6c7c92
movb $0x50, 0x66586c(%rip)   # 0x6c7c94
movb $0x51, 0x665867(%rip)   # 0x6c7c96
movb $0x4b, 0x665862(%rip)   # 0x6c7c98
movb $0x4c, 0x66585d(%rip)   # 0x6c7c9a
movb $0x4d, 0x665858(%rip)   # 0x6c7c9c
movb $0x47, 0x665853(%rip)   # 0x6c7c9e
movb $0x48, 0x66584e(%rip)   # 0x6c7ca0
movb $0x49, 0x665849(%rip)   # 0x6c7ca2
movb $0x53, 0x665846(%rip)   # 0x6c7ca6
movb $-0x4b, 0x665821(%rip)  # 0x6c7c88
movb $0x37, 0x66581c(%rip)   # 0x6c7c8a
movb $0x4a, 0x665817(%rip)   # 0x6c7c8c
movb $0x4e, 0x665812(%rip)   # 0x6c7c8e
movw $0xd9c, 0x66580b(%rip)  # imm = 0xD9C
movb $-0x38, 0x6657f8(%rip)  # 0x6c7c84
movb $-0x30, 0x6657ef(%rip)  # 0x6c7c82
movb $-0x33, 0x6657e4(%rip)  # 0x6c7c7e
movb $-0x35, 0x6657df(%rip)  # 0x6c7c80
movb $-0x2e, 0x6657ca(%rip)  # 0x6c7c72
movb $-0x39, 0x6657c5(%rip)  # 0x6c7c74
movb $-0x31, 0x6657c4(%rip)  # 0x6c7c7a
movb $-0x37, 0x6657b9(%rip)  # 0x6c7c76
movb $-0x2f, 0x6657b8(%rip)  # 0x6c7c7c
movb $0x3b, 0x665789(%rip)   # 0x6c7c54
movb $0x3c, 0x665784(%rip)   # 0x6c7c56
movb $0x3d, 0x66577f(%rip)   # 0x6c7c58
movb $0x3e, 0x66577a(%rip)   # 0x6c7c5a
movb $0x3f, 0x665775(%rip)   # 0x6c7c5c
movb $0x40, 0x665770(%rip)   # 0x6c7c5e
movb $0x41, 0x66576b(%rip)   # 0x6c7c60
movb $0x42, 0x665766(%rip)   # 0x6c7c62
movb $0x43, 0x665761(%rip)   # 0x6c7c64
movb $0x44, 0x66575c(%rip)   # 0x6c7c66
movb $0x57, 0x665757(%rip)   # 0x6c7c68
movb $0x58, 0x665752(%rip)   # 0x6c7c6a
movb $0x45, 0x665767(%rip)   # 0x6c7c86
movb $0x3a, 0x66572c(%rip)   # 0x6c7c52
movb $0x46, 0x665741(%rip)   # 0x6c7c6e
movb $0x36, 0x665876(%rip)   # 0x6c7daa
movb $0x2a, 0x665867(%rip)   # 0x6c7da2
movb $-0x63, 0x665866(%rip)  # 0x6c7da8
movb $0x1d, 0x665857(%rip)   # 0x6c7da0
movb $-0x48, 0x66585c(%rip)  # 0x6c7dac
movb $0x38, 0x66584d(%rip)   # 0x6c7da4
movb $-0x25, 0x665848(%rip)  # 0x6c7da6
movb $-0x24, 0x665849(%rip)  # 0x6c7dae
movb $-0x2, 0x665700(%rip)   # 0x6c7c6c
movb $0x54, 0x6657a1(%rip)   # 0x6c7d14
movb $-0x23, 0x665730(%rip)  # 0x6c7caa
pushq $0x21
popq %rdi
callq 0x6cf0
testl %eax, %eax
je 0x625a1
callq 0x6b40
leaq 0x11008(%rip), %rdi     # 0x7359a
movq %rax, %rsi
xorl %eax, %eax
callq 0x22427
pushq $0x1
popq %rbx
jmp 0x625ff
leaq 0xc(%rsp), %rbx
leaq 0x10(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x64100
movl (%rbx), %eax
leaq 0x114ad1(%rip), %rbx    # 0x177090
movl %eax, (%rbx)
movq (%r14), %rax
leaq 0x114acd(%rip), %r14    # 0x177098
movq %rax, (%r14)
callq 0x1bc84
callq 0x1cb32
movl $0x303, %edi            # imm = 0x303
xorl %esi, %esi
callq 0x63b0
movl (%rbx), %edi
movq (%r14), %rsi
callq 0xa00f
movl %eax, %ebx
callq 0x1c013
callq 0x64172
callq 0x6330
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq