// File: /workspace/github_cpp_makefile_star2_O3/tjohnman[P]sfxr-sdl2/build/../src/main.cpp
// Function: ddkInit()
void ddkInit()
{
	srand(time(NULL));

	ddkSetMode(640,480, DDK_WINDOW, "sfxr"); // requests window size etc from ddrawkit

	if (LoadTGA(font, "/usr/local/share/sfxr/images/font.tga")) {
        	/* Try again in cwd */
		if (LoadTGA(font, "images/font.tga")) {
			fprintf(stderr,
				"Error could not open /usr/local/share/sfxr/images/font.tga"
				" nor images/font.tga\n");
			exit(1);
		}
	}

	if (LoadTGA(ld48, "/usr/local/share/sfxr/images/ld48.tga")) {
        	/* Try again in cwd */
		if (LoadTGA(ld48, "images/ld48.tga")) {
			fprintf(stderr,
				"Error could not open /usr/local/share/sfxr/images/ld48.tga"
				" nor images/ld48.tga\n");
			exit(1);
		}
	}

	ld48.width=ld48.pitch;

	input=new DPInput;

	strcpy(categories[0].name, "PICKUP/COIN");
	strcpy(categories[1].name, "LASER/SHOOT");
	strcpy(categories[2].name, "EXPLOSION");
	strcpy(categories[3].name, "POWERUP");
	strcpy(categories[4].name, "HIT/HURT");
	strcpy(categories[5].name, "JUMP");
	strcpy(categories[6].name, "BLIP/SELECT");

	ResetParams();

	SDL_AudioSpec des;
	des.freq = 44100;
	des.format = AUDIO_S16SYS;
	des.channels = 1;
	des.samples = 512;
	des.callback = SDLAudioCallback;
	des.userdata = NULL;
	VERIFY(!SDL_OpenAudio(&des, NULL));
	SDL_PauseAudio(0);
}

// Assembly:
subq $0x28, %rsp
xorl %edi, %edi
callq 0x2240
movl %eax, %edi
callq 0x2260
leaq 0x302b(%rip), %rcx      # 0xa516
movl $0x280, %edi            # imm = 0x280
movl $0x1e0, %esi            # imm = 0x1E0
xorl %edx, %edx
callq 0x7989
leaq 0x5dc5(%rip), %rdi      # 0xd2c8
leaq 0x2e56(%rip), %rsi      # 0xa360
callq 0x8d58
testl %eax, %eax
je 0x752e
leaq 0x5dae(%rip), %rdi      # 0xd2c8
leaq 0x2e55(%rip), %rsi      # 0xa376
callq 0x8d58
testl %eax, %eax
jne 0x7684
leaq 0x5dab(%rip), %rdi      # 0xd2e0
leaq 0x2e9a(%rip), %rsi      # 0xa3d6
callq 0x8d58
testl %eax, %eax
je 0x7560
leaq 0x5d94(%rip), %rdi      # 0xd2e0
leaq 0x2e99(%rip), %rsi      # 0xa3ec
callq 0x8d58
testl %eax, %eax
jne 0x7689
movl 0x5d8a(%rip), %eax      # 0xd2f0
movl %eax, 0x5d7c(%rip)      # 0xd2e8
movl $0x1, %edi
callq 0x2290
movq %rax, 0x7093(%rip)      # 0xe610
movabsq $0x432f50554b434950, %rax # imm = 0x432F50554B434950
movq %rax, 0x5d72(%rip)      # 0xd300
movl $0x4e494f, 0x5d70(%rip) # imm = 0x4E494F
movabsq $0x48532f524553414c, %rax # imm = 0x48532F524553414C
movq %rax, 0x5d77(%rip)      # 0xd320
movl $0x544f4f, 0x5d75(%rip) # imm = 0x544F4F
movabsq $0x4f49534f4c505845, %rax # imm = 0x4F49534F4C505845
movq %rax, 0x5d7c(%rip)      # 0xd340
movw $0x4e, 0x5d7b(%rip)     # 0xd348
movabsq $0x50555245574f50, %rax # imm = 0x50555245574F50
movq %rax, 0x5d82(%rip)      # 0xd360
movabsq $0x545255482f544948, %rax # imm = 0x545255482F544948
movq %rax, 0x5d91(%rip)      # 0xd380
xorl %eax, %eax
movb %al, 0x5d91(%rip)       # 0xd388
movb %al, 0x5da7(%rip)       # 0xd3a4
movl $0x504d554a, 0x5d99(%rip) # imm = 0x504D554A
movabsq $0x4c45532f50494c42, %rax # imm = 0x4C45532F50494C42
movq %rax, 0x5da8(%rip)      # 0xd3c0
movl $0x544345, 0x5da6(%rip) # imm = 0x544345
callq 0x27bf
leaq 0x8(%rsp), %rdi
movl $0xac44, (%rdi)         # imm = 0xAC44
movw $0x8010, 0x4(%rdi)      # imm = 0x8010
movb $0x1, 0x6(%rdi)
movw $0x200, 0x8(%rdi)       # imm = 0x200
leaq 0x45(%rip), %rax        # 0x768e
movq %rax, 0x10(%rdi)
movq $0x0, 0x18(%rdi)
xorl %esi, %esi
callq 0x2410
testl %eax, %eax
je 0x7678
leaq 0x2e21(%rip), %rdi      # 0xa488
leaq 0x2e2a(%rip), %rdx      # 0xa498
movl $0x557, %esi            # imm = 0x557
callq 0x7810
xorl %edi, %edi
callq 0x21c0
addq $0x28, %rsp
retq
callq 0x2500
callq 0x2525