// File: /workspace/github_c_makefile_star2_O1/enzo1982[P]smooth/samples/beatclock/beat.cpp
// Function: BeatClock::BeatClock()
BeatClock::BeatClock() : Application("BeatClock")
{
	actbeats    = -1;
	actcbeats   = -1;
	actccbeats  = -1;
	timeformat  = 0;
	centi	    = True;
	isalarm	    = False;
	alarmexec   = False;
	alarmbeats  = 0;
	alarmsecs   = 0;
	alarmoption = 0;
	modechange  = 3;
	timezone    = 0;

	wmpaint	    = True;
	wpx	    = 16;
	wpy	    = 16;

	ReadConfig();

	wnd		= new GUI::Window("BeatClock", Point(wpx, wpy), Size(164, 103));
	title		= new Titlebar(TB_CLOSEBUTTON);
	menubar		= new Menubar();
	timer		= new Timer();
	dragcontrol	= new DragControl();

	timer->onInterval.Connect(&BeatClock::PaintTime, this);

	MenuEntry	*entry;

	menubar->AddEntry("Mode")->onAction.Connect(&BeatClock::Mode, this);
	menubar->AddEntry("Options")->onAction.Connect(&BeatClock::ShowOptionsDialog, this);
	menubar->AddEntry()->SetOrientation(OR_RIGHT);

	entry = menubar->AddEntry("Info");
	entry->onAction.Connect(&BeatClock::Info, this);
	entry->SetOrientation(OR_RIGHT);

	Add(wnd);

	wnd->Add(dragcontrol);
	wnd->Add(title);
	wnd->Add(menubar);

	wnd->SetIcon(ImageLoader::Load("beat.pci:0"));
	wnd->onPaint.Connect(&BeatClock::PaintAll, this);
	wnd->SetFlags(WF_TOPMOST | WF_NOTASKBUTTON | WF_NORESIZE);
	wnd->onChangePosition.Connect(&BeatClock::OnChangePosition, this);
	wnd->Show();

	timer->Start(50);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x3955(%rip), %rsi      # 0x807e
movq %rsp, %r14
movq %r14, %rdi
callq 0x43f0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x43d0
movq %rsp, %rdi
callq 0x4490
leaq 0x7022(%rip), %rax      # 0xb770
movq %rax, (%rbx)
leaq 0x608(%rbx), %r14
movq %r14, %rdi
xorl %esi, %esi
callq 0x4270
movaps 0x38a7(%rip), %xmm0     # 0x8010
movups %xmm0, 0x5e0(%rbx)
movw $0x1, 0x5f0(%rbx)
movb $0x0, 0x5f2(%rbx)
movq $0x0, 0x5f4(%rbx)
movl $0x0, 0x620(%rbx)
movq $0x3, 0x5fc(%rbx)
movb $0x1, 0x624(%rbx)
movabsq $0x1000000010, %rax     # imm = 0x1000000010
movq %rax, 0x628(%rbx)
movl $0x6d8, %edi            # imm = 0x6D8
callq 0x42d0
movq %rax, %r12
leaq 0x38b2(%rip), %rsi      # 0x807e
movq %rsp, %rdi
callq 0x43f0
movq 0x628(%rbx), %rax
leaq 0x18(%rsp), %rdx
movq %rax, (%rdx)
movabsq $0x67000000a4, %rax     # imm = 0x67000000A4
leaq 0x20(%rsp), %rcx
movq %rax, (%rcx)
movq %rsp, %rsi
movq %r12, %rdi
xorl %r8d, %r8d
callq 0x41a0
movq %r12, 0x5b8(%rbx)
movq %rsp, %rdi
callq 0x4490
movl $0x5c8, %edi            # imm = 0x5C8
callq 0x42d0
movq %rax, %r12
movq %rax, %rdi
movl $0x4, %esi
callq 0x40f0
movq %r12, 0x5c0(%rbx)
movl $0x688, %edi            # imm = 0x688
callq 0x42d0
movq %rax, %r12
movq %rax, %rdi
callq 0x4180
movq %r12, 0x5c8(%rbx)
movl $0x68, %edi
callq 0x42d0
movq %rax, %r12
movq %rax, %rdi
callq 0x4310
movq %r12, 0x5d8(%rbx)
movl $0x5c8, %edi            # imm = 0x5C8
callq 0x42d0
movq %rax, %r12
movq %rax, %rdi
callq 0x42a0
movq %r12, 0x5d0(%rbx)
movq 0x5d8(%rbx), %rdi
addq $0x48, %rdi
leaq 0x2bb(%rip), %rsi       # 0x4b54
xorl %edx, %edx
movq %rbx, %rcx
callq 0x5024
movq 0x5c8(%rbx), %r15
leaq 0x37d7(%rip), %rsi      # 0x8088
movq %rsp, %rdi
callq 0x43f0
movq %rsp, %rsi
movq %r15, %rdi
xorl %edx, %edx
callq 0x50e2
addq $0x478, %rax            # imm = 0x478
leaq 0x29b(%rip), %rsi       # 0x4b6e
movq %rax, %rdi
xorl %edx, %edx
movq %rbx, %rcx
callq 0x5024
movq %rsp, %rdi
callq 0x4490
movq 0x5c8(%rbx), %r15
leaq 0x3920(%rip), %rsi      # 0x8216
movq %rsp, %rdi
callq 0x43f0
movq %rsp, %rsi
movq %r15, %rdi
xorl %edx, %edx
callq 0x50e2
addq $0x478, %rax            # imm = 0x478
leaq 0x32c(%rip), %rsi       # 0x4c44
movq %rax, %rdi
xorl %edx, %edx
movq %rbx, %rcx
callq 0x5024
movq %rsp, %rdi
callq 0x4490
movq 0x5c8(%rbx), %r15
movq %rsp, %rdi
xorl %esi, %esi
callq 0x4270
movq %rsp, %rsi
movq %r15, %rdi
xorl %edx, %edx
callq 0x50e2
movq (%rax), %rcx
movq %rax, %rdi
movl $0x20, %esi
callq *0x120(%rcx)
movq %rsp, %rdi
callq 0x4490
movq 0x5c8(%rbx), %r15
leaq 0x371b(%rip), %rsi      # 0x808d
movq %rsp, %rdi
callq 0x43f0
movq %rsp, %rsi
movq %r15, %rdi
xorl %edx, %edx
callq 0x50e2
movq %rax, %r15
movq %rsp, %rdi
callq 0x4490
leaq 0x478(%r15), %rdi
leaq 0x34a(%rip), %rsi       # 0x4cea
xorl %edx, %edx
movq %rbx, %rcx
callq 0x5024
movq (%r15), %rax
movq %r15, %rdi
movl $0x20, %esi
callq *0x120(%rax)
movq 0x5b8(%rbx), %rsi
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x30(%rax)
movq 0x5b8(%rbx), %rdi
movq 0x5d0(%rbx), %rsi
movq (%rdi), %rax
callq *0x30(%rax)
movq 0x5b8(%rbx), %rdi
movq 0x5c0(%rbx), %rsi
movq (%rdi), %rax
callq *0x30(%rax)
movq 0x5b8(%rbx), %rdi
movq 0x5c8(%rbx), %rsi
movq (%rdi), %rax
callq *0x30(%rax)
movq 0x5b8(%rbx), %r15
leaq 0x367d(%rip), %rsi      # 0x8092
movq %rsp, %rdi
callq 0x43f0
leaq 0x18(%rsp), %rdi
movq %rsp, %rsi
callq 0x4410
leaq 0x18(%rsp), %rsi
movq %r15, %rdi
callq 0x4250
leaq 0x18(%rsp), %rdi
callq 0x4130
movq %rsp, %rdi
callq 0x4490
movl $0x648, %edi            # imm = 0x648
addq 0x5b8(%rbx), %rdi
leaq 0x302(%rip), %rsi       # 0x4d5e
xorl %edx, %edx
movq %rbx, %rcx
callq 0x5024
movq 0x5b8(%rbx), %rdi
movl $0xe, 0x30(%rdi)
addq $0x278, %rdi            # imm = 0x278
leaq 0x502(%rip), %rsi       # 0x4f84
xorl %edx, %edx
movq %rbx, %rcx
callq 0x515c
movq 0x5b8(%rbx), %rdi
movq (%rdi), %rax
callq *0x58(%rax)
movq 0x5d8(%rbx), %rdi
movl $0x32, %esi
callq 0x4030
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %r15
leaq 0x18(%rsp), %rdi
callq 0x4130
jmp 0x4b2b
jmp 0x4b28
jmp 0x4b37
jmp 0x4b28
jmp 0x4b37
jmp 0x4b37
jmp 0x4b37
jmp 0x4b37
jmp 0x4ae9
movq %rax, %r15
movl $0x68, %esi
jmp 0x4b08
movq %rax, %r15
movl $0x688, %esi            # imm = 0x688
jmp 0x4b08
movq %rax, %r15
movl $0x5c8, %esi            # imm = 0x5C8
jmp 0x4b08
movq %rax, %r15
movq %rsp, %rdi
callq 0x4490
jmp 0x4b03
movq %rax, %r15
movl $0x6d8, %esi            # imm = 0x6D8
movq %r12, %rdi
callq 0x4050
jmp 0x4b3a
movq %rax, %r15
jmp 0x4b42
movq %rax, %r15
movq %rsp, %rdi
callq 0x4490
jmp 0x4b4a
jmp 0x4b28
jmp 0x4b28
movq %rax, %r15
movq %rsp, %rdi
callq 0x4490
jmp 0x4b3a
jmp 0x4b37
movq %rax, %r15
movq %r14, %rdi
callq 0x4490
movq %rbx, %rdi
callq 0x4280
movq %r15, %rdi
callq 0x4190