// File: /workspace/github_c_makefile_star2_O3/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 0x398d(%rip), %rsi      # 0x80b6
movq %rsp, %r14
movq %r14, %rdi
callq 0x43f0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x43d0
movq %rsp, %rdi
callq 0x4490
leaq 0x7042(%rip), %rax      # 0xb790
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)
movl $0x0, 0x620(%rbx)
movaps 0x388f(%rip), %xmm0     # 0x8020
movups %xmm0, 0x5f4(%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 0x38f2(%rip), %rsi      # 0x80b6
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       # 0x4b4c
xorl %edx, %edx
movq %rbx, %rcx
callq 0x4f9e
movq 0x5c8(%rbx), %r15
leaq 0x3817(%rip), %rsi      # 0x80c0
movq %rsp, %rdi
callq 0x43f0
movq %rsp, %rsi
movq %r15, %rdi
xorl %edx, %edx
callq 0x505e
addq $0x478, %rax            # imm = 0x478
leaq 0x29b(%rip), %rsi       # 0x4b66
movq %rax, %rdi
xorl %edx, %edx
movq %rbx, %rcx
callq 0x4f9e
movq %rsp, %rdi
callq 0x4490
movq 0x5c8(%rbx), %r15
leaq 0x3960(%rip), %rsi      # 0x824e
movq %rsp, %rdi
callq 0x43f0
movq %rsp, %rsi
movq %r15, %rdi
xorl %edx, %edx
callq 0x505e
addq $0x478, %rax            # imm = 0x478
leaq 0x32c(%rip), %rsi       # 0x4c3c
movq %rax, %rdi
xorl %edx, %edx
movq %rbx, %rcx
callq 0x4f9e
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 0x505e
movq (%rax), %rcx
movq %rax, %rdi
movl $0x20, %esi
callq *0x120(%rcx)
movq %rsp, %rdi
callq 0x4490
movq 0x5c8(%rbx), %r15
leaq 0x375b(%rip), %rsi      # 0x80c5
movq %rsp, %rdi
callq 0x43f0
movq %rsp, %rsi
movq %r15, %rdi
xorl %edx, %edx
callq 0x505e
movq %rax, %r15
movq %rsp, %rdi
callq 0x4490
leaq 0x478(%r15), %rdi
leaq 0x34a(%rip), %rsi       # 0x4ce2
xorl %edx, %edx
movq %rbx, %rcx
callq 0x4f9e
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 0x36bd(%rip), %rsi      # 0x80ca
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       # 0x4d56
xorl %edx, %edx
movq %rbx, %rcx
callq 0x4f9e
movq 0x5b8(%rbx), %rdi
movl $0xe, 0x30(%rdi)
addq $0x278, %rdi            # imm = 0x278
leaq 0x48a(%rip), %rsi       # 0x4f04
xorl %edx, %edx
movq %rbx, %rcx
callq 0x50d8
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 0x4b23
jmp 0x4b20
jmp 0x4b2f
jmp 0x4b20
jmp 0x4b2f
jmp 0x4b2f
jmp 0x4b2f
jmp 0x4b2f
jmp 0x4ae1
movq %rax, %r15
movl $0x68, %esi
jmp 0x4b00
movq %rax, %r15
movl $0x688, %esi            # imm = 0x688
jmp 0x4b00
movq %rax, %r15
movl $0x5c8, %esi            # imm = 0x5C8
jmp 0x4b00
movq %rax, %r15
movq %rsp, %rdi
callq 0x4490
jmp 0x4afb
movq %rax, %r15
movl $0x6d8, %esi            # imm = 0x6D8
movq %r12, %rdi
callq 0x4050
jmp 0x4b32
movq %rax, %r15
jmp 0x4b3a
movq %rax, %r15
movq %rsp, %rdi
callq 0x4490
jmp 0x4b42
jmp 0x4b20
jmp 0x4b20
movq %rax, %r15
movq %rsp, %rdi
callq 0x4490
jmp 0x4b32
jmp 0x4b2f
movq %rax, %r15
movq %r14, %rdi
callq 0x4490
movq %rbx, %rdi
callq 0x4280
movq %r15, %rdi
callq 0x4190