// File: /workspace/github_cpp_makefile_star2_O1/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 0x3003(%rip), %rcx      # 0xa506
movl $0x280, %edi            # imm = 0x280
movl $0x1e0, %esi            # imm = 0x1E0
xorl %edx, %edx
callq 0x799d
leaq 0x5dad(%rip), %rdi      # 0xd2c8
leaq 0x2e2e(%rip), %rsi      # 0xa350
callq 0x8da4
testl %eax, %eax
je 0x7546
leaq 0x5d96(%rip), %rdi      # 0xd2c8
leaq 0x2e2d(%rip), %rsi      # 0xa366
callq 0x8da4
testl %eax, %eax
jne 0x769c
leaq 0x5d93(%rip), %rdi      # 0xd2e0
leaq 0x2e72(%rip), %rsi      # 0xa3c6
callq 0x8da4
testl %eax, %eax
je 0x7578
leaq 0x5d7c(%rip), %rdi      # 0xd2e0
leaq 0x2e71(%rip), %rsi      # 0xa3dc
callq 0x8da4
testl %eax, %eax
jne 0x76a1
movl 0x5d72(%rip), %eax      # 0xd2f0
movl %eax, 0x5d64(%rip)      # 0xd2e8
movl $0x1, %edi
callq 0x2290
movq %rax, 0x706b(%rip)      # 0xe600
movabsq $0x432f50554b434950, %rax # imm = 0x432F50554B434950
movq %rax, 0x5d5a(%rip)      # 0xd300
movl $0x4e494f, 0x5d58(%rip) # imm = 0x4E494F
movabsq $0x48532f524553414c, %rax # imm = 0x48532F524553414C
movq %rax, 0x5d5f(%rip)      # 0xd320
movl $0x544f4f, 0x5d5d(%rip) # imm = 0x544F4F
movabsq $0x4f49534f4c505845, %rax # imm = 0x4F49534F4C505845
movq %rax, 0x5d64(%rip)      # 0xd340
movw $0x4e, 0x5d63(%rip)     # 0xd348
movabsq $0x50555245574f50, %rax # imm = 0x50555245574F50
movq %rax, 0x5d6a(%rip)      # 0xd360
movabsq $0x545255482f544948, %rax # imm = 0x545255482F544948
movq %rax, 0x5d79(%rip)      # 0xd380
xorl %eax, %eax
movb %al, 0x5d79(%rip)       # 0xd388
movb %al, 0x5d8f(%rip)       # 0xd3a4
movl $0x504d554a, 0x5d81(%rip) # imm = 0x504D554A
movabsq $0x4c45532f50494c42, %rax # imm = 0x4C45532F50494C42
movq %rax, 0x5d90(%rip)      # 0xd3c0
movl $0x544345, 0x5d8e(%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        # 0x76a6
movq %rax, 0x10(%rdi)
movq $0x0, 0x18(%rdi)
xorl %esi, %esi
callq 0x2410
testl %eax, %eax
je 0x7690
leaq 0x2df9(%rip), %rdi      # 0xa478
leaq 0x2e02(%rip), %rdx      # 0xa488
movl $0x557, %esi            # imm = 0x557
callq 0x7824
xorl %edi, %edi
callq 0x21c0
addq $0x28, %rsp
retq
callq 0x2500
callq 0x2525