// File: /workspace/github_c_makefile_star2_O1/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 0x661f15(%rip), %rdi    # 0x6cdbf0
movl $0x400, %edx            # imm = 0x400
xorl %esi, %esi
callq 0x62f0
movabsq $0x90f080e1b010d1c, %rax # imm = 0x90F080E1B010D1C
movq %rax, 0x661f48(%rip)    # 0x6cdc40
movb $0x59, 0x661f81(%rip)   # 0x6cdc80
movb $0x39, 0x661f42(%rip)   # 0x6cdc48
movb $0x28, 0x661f4b(%rip)   # 0x6cdc58
movb $0x33, 0x661f48(%rip)   # 0x6cdc5c
movb $0xc, 0x661f2f(%rip)    # 0x6cdc4a
movb $0x34, 0x661f3c(%rip)   # 0x6cdc5e
movb $0x35, 0x661f37(%rip)   # 0x6cdc60
movb $0xb, 0x661f0e(%rip)    # 0x6cdc3e
movb $0x2, 0x661ef5(%rip)    # 0x6cdc2c
movb $0x3, 0x661ef0(%rip)    # 0x6cdc2e
movb $0x4, 0x661eeb(%rip)    # 0x6cdc30
movb $0x5, 0x661ee6(%rip)    # 0x6cdc32
movb $0x6, 0x661ee1(%rip)    # 0x6cdc34
movb $0x7, 0x661edc(%rip)    # 0x6cdc36
movb $0x8, 0x661ed7(%rip)    # 0x6cdc38
movb $0x9, 0x661ed2(%rip)    # 0x6cdc3a
movb $0xa, 0x661ecd(%rip)    # 0x6cdc3c
movb $0x27, 0x661ee0(%rip)   # 0x6cdc56
movb $0xd, 0x661ecf(%rip)    # 0x6cdc4c
movl $0x9d1b9b1a, 0x661ec7(%rip) # imm = 0x9D1B9B1A
movw $0x9c2b, 0x661ec2(%rip) # imm = 0x9C2B
movb $0x29, 0x661ec3(%rip)   # 0x6cdc5a
movaps 0x114b2(%rip), %xmm0    # 0x7d250
movups %xmm0, 0x661e53(%rip)   # 0x6cdbf8
movaps 0x114b4(%rip), %xmm0    # 0x7d260
movups %xmm0, 0x661e55(%rip)   # 0x6cdc08
movaps 0x114b6(%rip), %xmm0    # 0x7d270
movups %xmm0, 0x661e57(%rip)   # 0x6cdc18
movl $0x9a2c9915, 0x661e5d(%rip) # imm = 0x9A2C9915
movb $-0x2d, 0x661eb6(%rip)  # 0x6cdc88
movb $0x52, 0x661edb(%rip)   # 0x6cdcb4
movb $0x4f, 0x661ec2(%rip)   # 0x6cdca2
movb $0x50, 0x661ebd(%rip)   # 0x6cdca4
movb $0x51, 0x661eb8(%rip)   # 0x6cdca6
movb $0x4b, 0x661eb3(%rip)   # 0x6cdca8
movb $0x4c, 0x661eae(%rip)   # 0x6cdcaa
movb $0x4d, 0x661ea9(%rip)   # 0x6cdcac
movb $0x47, 0x661ea4(%rip)   # 0x6cdcae
movb $0x48, 0x661e9f(%rip)   # 0x6cdcb0
movb $0x49, 0x661e9a(%rip)   # 0x6cdcb2
movb $0x53, 0x661e97(%rip)   # 0x6cdcb6
movb $-0x4b, 0x661e72(%rip)  # 0x6cdc98
movb $0x37, 0x661e6d(%rip)   # 0x6cdc9a
movb $0x4a, 0x661e68(%rip)   # 0x6cdc9c
movb $0x4e, 0x661e63(%rip)   # 0x6cdc9e
movw $0xd9c, 0x661e5c(%rip)  # imm = 0xD9C
movb $-0x38, 0x661e49(%rip)  # 0x6cdc94
movb $-0x30, 0x661e40(%rip)  # 0x6cdc92
movb $-0x33, 0x661e35(%rip)  # 0x6cdc8e
movb $-0x35, 0x661e30(%rip)  # 0x6cdc90
movb $-0x2e, 0x661e1b(%rip)  # 0x6cdc82
movb $-0x39, 0x661e16(%rip)  # 0x6cdc84
movb $-0x31, 0x661e15(%rip)  # 0x6cdc8a
movb $-0x37, 0x661e0a(%rip)  # 0x6cdc86
movb $-0x2f, 0x661e09(%rip)  # 0x6cdc8c
movb $0x3b, 0x661dda(%rip)   # 0x6cdc64
movb $0x3c, 0x661dd5(%rip)   # 0x6cdc66
movb $0x3d, 0x661dd0(%rip)   # 0x6cdc68
movb $0x3e, 0x661dcb(%rip)   # 0x6cdc6a
movb $0x3f, 0x661dc6(%rip)   # 0x6cdc6c
movb $0x40, 0x661dc1(%rip)   # 0x6cdc6e
movb $0x41, 0x661dbc(%rip)   # 0x6cdc70
movb $0x42, 0x661db7(%rip)   # 0x6cdc72
movb $0x43, 0x661db2(%rip)   # 0x6cdc74
movb $0x44, 0x661dad(%rip)   # 0x6cdc76
movb $0x57, 0x661da8(%rip)   # 0x6cdc78
movb $0x58, 0x661da3(%rip)   # 0x6cdc7a
movb $0x45, 0x661db8(%rip)   # 0x6cdc96
movb $0x3a, 0x661d7d(%rip)   # 0x6cdc62
movb $0x46, 0x661d92(%rip)   # 0x6cdc7e
movb $0x36, 0x661ec7(%rip)   # 0x6cddba
movb $0x2a, 0x661eb8(%rip)   # 0x6cddb2
movb $-0x63, 0x661eb7(%rip)  # 0x6cddb8
movb $0x1d, 0x661ea8(%rip)   # 0x6cddb0
movb $-0x48, 0x661ead(%rip)  # 0x6cddbc
movb $0x38, 0x661e9e(%rip)   # 0x6cddb4
movb $-0x25, 0x661e99(%rip)  # 0x6cddb6
movb $-0x24, 0x661e9a(%rip)  # 0x6cddbe
movb $-0x2, 0x661d51(%rip)   # 0x6cdc7c
movb $0x54, 0x661df2(%rip)   # 0x6cdd24
movb $-0x23, 0x661d81(%rip)  # 0x6cdcba
movl $0x21, %edi
callq 0x6cf0
testl %eax, %eax
je 0x6bf64
callq 0x6b40
leaq 0x11347(%rip), %rdi     # 0x7d29a
movq %rax, %rsi
xorl %eax, %eax
callq 0x24cb4
movl $0x1, %ebx
jmp 0x6bfc2
leaq 0xc(%rsp), %rbx
leaq 0x10(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6dc1c
movl (%rbx), %eax
leaq 0x11110e(%rip), %rbx    # 0x17d090
movl %eax, (%rbx)
movq (%r14), %rax
leaq 0x11110a(%rip), %r14    # 0x17d098
movq %rax, (%r14)
callq 0x1dd6c
callq 0x1ec98
movl $0x303, %edi            # imm = 0x303
xorl %esi, %esi
callq 0x63b0
movl (%rbx), %edi
movq (%r14), %rsi
callq 0xab8f
movl %eax, %ebx
callq 0x1e111
callq 0x6dc93
callq 0x6330
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq