// File: UTAP[P]APHTTP/examples/main.cpp
// Function: main
int main(int argc, char **argv) {
  srand(time(NULL)); // for rand
  try {
    MyServer server(argc > 1 ? atoi(argv[1]) : 5000);
    server.setNotFoundErrPage("static/404.html");
    server.get("/login", new ShowPage("static/logincss.html"));
    server.post("/login", new LoginHandler());
    server.get("/up", new ShowPage("static/upload_form.html"));
    server.post("/up", new UploadHandler());
    server.get("/rand", new RandomNumberHandler());
    server.get("/home.png", new ShowImage("static/home.png"));
    server.get("/", new ShowPage("static/home.html"));
    server.get("/colors", new ColorHandler("template/colors.html"));
    server.run();
  } catch (const Server::Exception& e) {
    cerr << e.getMessage() << endl;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x360, %rsp            # imm = 0x360
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
xorl %eax, %eax
movl %eax, %edi
callq 0x4390
movl %eax, %edi
callq 0x43d0
cmpl $0x1, -0x8(%rbp)
jle 0x7dc4
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x45e0
movl %eax, -0x2a4(%rbp)
jmp 0x7dd1
movl $0x1388, %eax           # imm = 0x1388
movl %eax, -0x2a4(%rbp)
jmp 0x7dd1
movl -0x2a4(%rbp), %esi
leaq -0x38(%rbp), %rdi
callq 0x7d50
jmp 0x7de2
leaq -0x69(%rbp), %rdi
movq %rdi, -0x2b0(%rbp)
callq 0x46c0
movq -0x2b0(%rbp), %rdx
leaq 0x192b7(%rip), %rsi     # 0x210b7
leaq -0x68(%rbp), %rdi
callq 0x4550
jmp 0x7e0b
leaq -0x38(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x1b8f0
jmp 0x7e1a
leaq -0x68(%rbp), %rdi
callq 0x4768
leaq -0x69(%rbp), %rdi
callq 0x4440
leaq -0x91(%rbp), %rdi
movq %rdi, -0x2b8(%rbp)
callq 0x46c0
movq -0x2b8(%rbp), %rdx
leaq 0x1927a(%rip), %rsi     # 0x210c7
leaq -0x90(%rbp), %rdi
callq 0x4550
jmp 0x7e5b
movl $0x48, %edi
callq 0x4400
movq %rax, -0x2c0(%rbp)
jmp 0x7e6e
movb $0x1, -0xba(%rbp)
leaq -0xb9(%rbp), %rdi
movq %rdi, -0x2c8(%rbp)
callq 0x46c0
movq -0x2c8(%rbp), %rdx
leaq 0x19238(%rip), %rsi     # 0x210ce
leaq -0xb8(%rbp), %rdi
callq 0x4550
jmp 0x7ea4
movq -0x2c0(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x1b650
jmp 0x7eb9
movq -0x2c0(%rbp), %rdx
movb $0x0, -0xba(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x1a960
jmp 0x7ed9
leaq -0xb8(%rbp), %rdi
callq 0x4768
leaq -0xb9(%rbp), %rdi
callq 0x4440
leaq -0x90(%rbp), %rdi
callq 0x4768
leaq -0x91(%rbp), %rdi
callq 0x4440
leaq -0xe1(%rbp), %rdi
movq %rdi, -0x2d0(%rbp)
callq 0x46c0
movq -0x2d0(%rbp), %rdx
leaq 0x1919d(%rip), %rsi     # 0x210c7
leaq -0xe0(%rbp), %rdi
callq 0x4550
jmp 0x7f38
movl $0x8, %edi
callq 0x4400
movq %rax, -0x2d8(%rbp)
jmp 0x7f4b
movq -0x2d8(%rbp), %rdi
movq $0x0, (%rdi)
callq 0x8880
movq -0x2d8(%rbp), %rdx
leaq -0x38(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0x1aa30
jmp 0x7f77
leaq -0xe0(%rbp), %rdi
callq 0x4768
leaq -0xe1(%rbp), %rdi
callq 0x4440
leaq -0x109(%rbp), %rdi
movq %rdi, -0x2e0(%rbp)
callq 0x46c0
movq -0x2e0(%rbp), %rdx
leaq 0x19133(%rip), %rsi     # 0x210e3
leaq -0x108(%rbp), %rdi
callq 0x4550
jmp 0x7fbe
movl $0x48, %edi
callq 0x4400
movq %rax, -0x2e8(%rbp)
jmp 0x7fd1
movb $0x1, -0x132(%rbp)
leaq -0x131(%rbp), %rdi
movq %rdi, -0x2f0(%rbp)
callq 0x46c0
movq -0x2f0(%rbp), %rdx
leaq 0x190ee(%rip), %rsi     # 0x210e7
leaq -0x130(%rbp), %rdi
callq 0x4550
jmp 0x8007
movq -0x2e8(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0x1b650
jmp 0x801c
movq -0x2e8(%rbp), %rdx
movb $0x0, -0x132(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x108(%rbp), %rsi
callq 0x1a960
jmp 0x803c
leaq -0x130(%rbp), %rdi
callq 0x4768
leaq -0x131(%rbp), %rdi
callq 0x4440
leaq -0x108(%rbp), %rdi
callq 0x4768
leaq -0x109(%rbp), %rdi
callq 0x4440
leaq -0x159(%rbp), %rdi
movq %rdi, -0x2f8(%rbp)
callq 0x46c0
movq -0x2f8(%rbp), %rdx
leaq 0x19056(%rip), %rsi     # 0x210e3
leaq -0x158(%rbp), %rdi
callq 0x4550
jmp 0x809b
movl $0x8, %edi
callq 0x4400
movq %rax, -0x300(%rbp)
jmp 0x80ae
movq -0x300(%rbp), %rdi
movq $0x0, (%rdi)
callq 0x88c0
movq -0x300(%rbp), %rdx
leaq -0x38(%rbp), %rdi
leaq -0x158(%rbp), %rsi
callq 0x1aa30
jmp 0x80da
leaq -0x158(%rbp), %rdi
callq 0x4768
leaq -0x159(%rbp), %rdi
callq 0x4440
leaq -0x181(%rbp), %rdi
movq %rdi, -0x308(%rbp)
callq 0x46c0
movq -0x308(%rbp), %rdx
leaq 0x18fec(%rip), %rsi     # 0x210ff
leaq -0x180(%rbp), %rdi
callq 0x4550
jmp 0x8121
movl $0x8, %edi
callq 0x4400
movq %rax, -0x310(%rbp)
jmp 0x8134
movq -0x310(%rbp), %rdi
movq $0x0, (%rdi)
callq 0x8900
movq -0x310(%rbp), %rdx
leaq -0x38(%rbp), %rdi
leaq -0x180(%rbp), %rsi
callq 0x1a960
jmp 0x8160
leaq -0x180(%rbp), %rdi
callq 0x4768
leaq -0x181(%rbp), %rdi
callq 0x4440
leaq -0x1a9(%rbp), %rdi
movq %rdi, -0x318(%rbp)
callq 0x46c0
movq -0x318(%rbp), %rdx
leaq 0x18f72(%rip), %rsi     # 0x2110b
leaq -0x1a8(%rbp), %rdi
callq 0x4550
jmp 0x81a7
movl $0x48, %edi
callq 0x4400
movq %rax, -0x320(%rbp)
jmp 0x81ba
movb $0x1, -0x1d2(%rbp)
leaq -0x1d1(%rbp), %rdi
movq %rdi, -0x328(%rbp)
callq 0x46c0
movq -0x328(%rbp), %rdx
leaq 0x18f23(%rip), %rsi     # 0x21105
leaq -0x1d0(%rbp), %rdi
callq 0x4550
jmp 0x81f0
movq -0x320(%rbp), %rdi
leaq -0x1d0(%rbp), %rsi
callq 0x1b7a0
jmp 0x8205
movq -0x320(%rbp), %rdx
movb $0x0, -0x1d2(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x1a8(%rbp), %rsi
callq 0x1a960
jmp 0x8225
leaq -0x1d0(%rbp), %rdi
callq 0x4768
leaq -0x1d1(%rbp), %rdi
callq 0x4440
leaq -0x1a8(%rbp), %rdi
callq 0x4768
leaq -0x1a9(%rbp), %rdi
callq 0x4440
leaq -0x1f9(%rbp), %rdi
movq %rdi, -0x330(%rbp)
callq 0x46c0
movq -0x330(%rbp), %rdx
leaq 0x18da5(%rip), %rsi     # 0x2101b
leaq -0x1f8(%rbp), %rdi
callq 0x4550
jmp 0x8284
movl $0x48, %edi
callq 0x4400
movq %rax, -0x338(%rbp)
jmp 0x8297
movb $0x1, -0x222(%rbp)
leaq -0x221(%rbp), %rdi
movq %rdi, -0x340(%rbp)
callq 0x46c0
movq -0x340(%rbp), %rdx
leaq 0x18e56(%rip), %rsi     # 0x21115
leaq -0x220(%rbp), %rdi
callq 0x4550
jmp 0x82cd
movq -0x338(%rbp), %rdi
leaq -0x220(%rbp), %rsi
callq 0x1b650
jmp 0x82e2
movq -0x338(%rbp), %rdx
movb $0x0, -0x222(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x1f8(%rbp), %rsi
callq 0x1a960
jmp 0x8302
leaq -0x220(%rbp), %rdi
callq 0x4768
leaq -0x221(%rbp), %rdi
callq 0x4440
leaq -0x1f8(%rbp), %rdi
callq 0x4768
leaq -0x1f9(%rbp), %rdi
callq 0x4440
leaq -0x249(%rbp), %rdi
movq %rdi, -0x348(%rbp)
callq 0x46c0
movq -0x348(%rbp), %rdx
leaq 0x18dd3(%rip), %rsi     # 0x21126
leaq -0x248(%rbp), %rdi
callq 0x4550
jmp 0x8361
movl $0x30, %edi
callq 0x4400
movq %rax, -0x350(%rbp)
jmp 0x8374
movb $0x1, -0x272(%rbp)
leaq -0x271(%rbp), %rdi
movq %rdi, -0x358(%rbp)
callq 0x46c0
movq -0x358(%rbp), %rdx
leaq 0x18d92(%rip), %rsi     # 0x2112e
leaq -0x270(%rbp), %rdi
callq 0x4550
jmp 0x83aa
movq -0x350(%rbp), %rdi
leaq -0x270(%rbp), %rsi
callq 0x94a0
jmp 0x83bf
movq -0x350(%rbp), %rdx
movb $0x0, -0x272(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x248(%rbp), %rsi
callq 0x1a960
jmp 0x83df
leaq -0x270(%rbp), %rdi
callq 0x4768
leaq -0x271(%rbp), %rdi
callq 0x4440
leaq -0x248(%rbp), %rdi
callq 0x4768
leaq -0x249(%rbp), %rdi
callq 0x4440
leaq -0x38(%rbp), %rdi
callq 0x1ab00
jmp 0x841a
leaq -0x38(%rbp), %rdi
callq 0x8940
jmp 0x882c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x87b5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x845c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x4768
leaq -0x69(%rbp), %rdi
callq 0x4440
jmp 0x87ac
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x84dd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x84d1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x84ac
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0x4768
leaq -0xb9(%rbp), %rdi
callq 0x4440
testb $0x1, -0xba(%rbp)
jne 0x84c3
jmp 0x84cf
movq -0x2c0(%rbp), %rdi
callq 0x43a0
jmp 0x84d1
leaq -0x90(%rbp), %rdi
callq 0x4768
leaq -0x91(%rbp), %rdi
callq 0x4440
jmp 0x87ac
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x8514
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0x4768
leaq -0xe1(%rbp), %rdi
callq 0x4440
jmp 0x87ac
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x8598
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x858c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x8567
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x130(%rbp), %rdi
callq 0x4768
leaq -0x131(%rbp), %rdi
callq 0x4440
testb $0x1, -0x132(%rbp)
jne 0x857e
jmp 0x858a
movq -0x2e8(%rbp), %rdi
callq 0x43a0
jmp 0x858c
leaq -0x108(%rbp), %rdi
callq 0x4768
leaq -0x109(%rbp), %rdi
callq 0x4440
jmp 0x87ac
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x85cf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x158(%rbp), %rdi
callq 0x4768
leaq -0x159(%rbp), %rdi
callq 0x4440
jmp 0x87ac
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x8606
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x180(%rbp), %rdi
callq 0x4768
leaq -0x181(%rbp), %rdi
callq 0x4440
jmp 0x87ac
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x868a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x867e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x8659
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x1d0(%rbp), %rdi
callq 0x4768
leaq -0x1d1(%rbp), %rdi
callq 0x4440
testb $0x1, -0x1d2(%rbp)
jne 0x8670
jmp 0x867c
movq -0x320(%rbp), %rdi
callq 0x43a0
jmp 0x867e
leaq -0x1a8(%rbp), %rdi
callq 0x4768
leaq -0x1a9(%rbp), %rdi
callq 0x4440
jmp 0x87ac
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x870e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x8702
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x86dd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x220(%rbp), %rdi
callq 0x4768
leaq -0x221(%rbp), %rdi
callq 0x4440
testb $0x1, -0x222(%rbp)
jne 0x86f4
jmp 0x8700
movq -0x338(%rbp), %rdi
callq 0x43a0
jmp 0x8702
leaq -0x1f8(%rbp), %rdi
callq 0x4768
leaq -0x1f9(%rbp), %rdi
callq 0x4440
jmp 0x87ac
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x8792
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x8786
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x8761
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x270(%rbp), %rdi
callq 0x4768
leaq -0x271(%rbp), %rdi
callq 0x4440
testb $0x1, -0x272(%rbp)
jne 0x8778
jmp 0x8784
movq -0x350(%rbp), %rdi
callq 0x43a0
jmp 0x8786
leaq -0x248(%rbp), %rdi
callq 0x4768
leaq -0x249(%rbp), %rdi
callq 0x4440
jmp 0x87ac
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x8940
movl -0x44(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x8867
movq -0x40(%rbp), %rdi
callq 0x41e0
movq %rax, -0x280(%rbp)
movq -0x280(%rbp), %rsi
leaq -0x2a0(%rbp), %rdi
callq 0x1b260
jmp 0x87ea
movq 0x247ff(%rip), %rdi     # 0x2cff0
leaq -0x2a0(%rbp), %rsi
callq 0x4370
movq %rax, -0x360(%rbp)
jmp 0x8806
movq -0x360(%rbp), %rdi
movq 0x24794(%rip), %rsi     # 0x2cfa8
callq 0x4430
jmp 0x881b
leaq -0x2a0(%rbp), %rdi
callq 0x4768
callq 0x4640
movl -0x4(%rbp), %eax
addq $0x360, %rsp            # imm = 0x360
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x885e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x2a0(%rbp), %rdi
callq 0x4768
callq 0x4640
jmp 0x8865
jmp 0x8867
movq -0x40(%rbp), %rdi
callq 0x46b0
movq %rax, %rdi
callq 0x8960
nopl (%rax,%rax)