// File: /workspace/github_cpp_makefile_star2_O2/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 0x3270
movl %eax, %edi
callq 0x3290
leaq 0x27b7(%rip), %rcx      # 0x9506
movl $0x280, %edi            # imm = 0x280
movl $0x1e0, %esi            # imm = 0x1E0
xorl %edx, %edx
callq 0x7233
leaq 0x6581(%rip), %rdi      # 0xd2e8
leaq 0x25e2(%rip), %rsi      # 0x9350
callq 0x84c4
testl %eax, %eax
je 0x6d92
leaq 0x656a(%rip), %rdi      # 0xd2e8
leaq 0x25e1(%rip), %rsi      # 0x9366
callq 0x84c4
testl %eax, %eax
jne 0x6ee3
leaq 0x6567(%rip), %rdi      # 0xd300
leaq 0x2626(%rip), %rsi      # 0x93c6
callq 0x84c4
testl %eax, %eax
je 0x6dc4
leaq 0x6550(%rip), %rdi      # 0xd300
leaq 0x2625(%rip), %rsi      # 0x93dc
callq 0x84c4
testl %eax, %eax
jne 0x6ef6
movl 0x6546(%rip), %eax      # 0xd310
movl %eax, 0x6538(%rip)      # 0xd308
pushq $0x1
popq %rdi
callq 0x32c0
movq %rax, 0x7851(%rip)      # 0xe630
movabsq $0x432f50554b434950, %rax # imm = 0x432F50554B434950
movq %rax, 0x6530(%rip)      # 0xd320
movl $0x4e494f, 0x652e(%rip) # imm = 0x4E494F
movabsq $0x48532f524553414c, %rax # imm = 0x48532F524553414C
movq %rax, 0x6535(%rip)      # 0xd340
movl $0x544f4f, 0x6533(%rip) # imm = 0x544F4F
movabsq $0x4f49534f4c505845, %rax # imm = 0x4F49534F4C505845
movq %rax, 0x653a(%rip)      # 0xd360
movw $0x4e, 0x6539(%rip)     # 0xd368
movabsq $0x50555245574f50, %rax # imm = 0x50555245574F50
movq %rax, 0x6540(%rip)      # 0xd380
movabsq $0x545255482f544948, %rax # imm = 0x545255482F544948
movq %rax, 0x654f(%rip)      # 0xd3a0
xorl %eax, %eax
movb %al, 0x654f(%rip)       # 0xd3a8
movb %al, 0x6565(%rip)       # 0xd3c4
movl $0x504d554a, 0x6557(%rip) # imm = 0x504D554A
movabsq $0x4c45532f50494c42, %rax # imm = 0x4C45532F50494C42
movq %rax, 0x6566(%rip)      # 0xd3e0
movl $0x544345, 0x6564(%rip) # imm = 0x544345
callq 0x3770
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 0x6f(%rip), %rax        # 0x6f1a
movq %rax, 0x10(%rdi)
andq $0x0, 0x18(%rdi)
xorl %esi, %esi
callq 0x3450
testl %eax, %eax
je 0x6ed7
leaq 0x25b2(%rip), %rdi      # 0x9478
leaq 0x25bb(%rip), %rdx      # 0x9488
movl $0x557, %esi            # imm = 0x557
callq 0x70bc
xorl %edi, %edi
callq 0x31e0
addq $0x28, %rsp
retq
movq 0x60ee(%rip), %rax      # 0xcfd8
movq (%rax), %rcx
leaq 0x2482(%rip), %rdi      # 0x9376
jmp 0x6f07
movq 0x60db(%rip), %rax      # 0xcfd8
movq (%rax), %rcx
leaq 0x24e5(%rip), %rdi      # 0x93ec
pushq $0x4f
popq %rsi
pushq $0x1
popq %rdx
callq 0x3510
pushq $0x1
popq %rdi
callq 0x3350