// File: /workspace/github_cpp_makefile_star2_O1/UTAP[P]APHTTP/examples/handlers.cpp
// Function: RandomNumberHandler::callback(Request*)
Response *RandomNumberHandler::callback(Request *req) {
  Response *res = new Response;
  res->setHeader("Content-Type", "text/html");
  string body;
  body += "<!DOCTYPE html>";
  body += "<html>";
  body += "<body style=\"text-align: center;\">";
  body += "<h1>AP HTTP</h1>";
  body += "<p>";
  body += "a random number in [1, 10] is: ";
  body += to_string(rand() % 10 + 1);
  body += "</p>";
  body += "<p>";
  body += "SeddionId: ";
  body += req->getSessionId();
  body += "</p>";
  body += "</body>";
  body += "</html>";
  res->setBody(body);
  return res;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rsi, %r14
movl $0x78, %edi
callq 0x4350
movq %rax, %r13
movq %rax, %rdi
movl $0xc8, %esi
callq 0x82ea
leaq -0xb8(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x1212a(%rip), %rsi     # 0x19175
leaq 0x1212f(%rip), %rdx     # 0x19181
leaq -0xc8(%rbp), %rdi
callq 0x6f6c
leaq -0x98(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x12111(%rip), %rsi     # 0x19182
leaq 0x12113(%rip), %rdx     # 0x1918b
leaq -0xa8(%rbp), %rdi
callq 0x6f6c
leaq -0xc8(%rbp), %rsi
leaq -0xa8(%rbp), %rdx
movq %r13, %rdi
callq 0xa430
movq -0xa8(%rbp), %rdi
cmpq %r12, %rdi
je 0x70ab
callq 0x4310
movq -0xc8(%rbp), %rdi
cmpq %r15, %rdi
je 0x70bc
callq 0x4310
leaq -0x38(%rbp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x120b6(%rip), %rsi     # 0x1918c
leaq -0x48(%rbp), %rdi
callq 0x45f0
leaq 0x120b6(%rip), %rsi     # 0x1919c
leaq -0x48(%rbp), %rdi
callq 0x45f0
leaq 0x120ad(%rip), %rsi     # 0x191a3
leaq -0x48(%rbp), %rdi
callq 0x45f0
leaq 0x120c0(%rip), %rsi     # 0x191c6
leaq -0x48(%rbp), %rdi
callq 0x45f0
leaq 0x120c1(%rip), %rsi     # 0x191d7
leaq -0x48(%rbp), %rdi
callq 0x45f0
leaq 0x120b5(%rip), %rsi     # 0x191db
leaq -0x48(%rbp), %rdi
callq 0x45f0
movq %r14, %rbx
callq 0x4100
cltq
imulq $0x66666667, %rax, %rcx # imm = 0x66666667
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x22, %rcx
addl %edx, %ecx
addl %ecx, %ecx
leal (%rcx,%rcx,4), %ecx
negl %ecx
leal (%rax,%rcx), %r14d
incl %r14d
movl %r14d, %r15d
negl %r15d
cmovsl %r14d, %r15d
cmpl $0xa, %r15d
movl $0x2, %r12d
sbbl $0x0, %r12d
shrl $0x1f, %r14d
leal (%r12,%r14), %esi
leaq -0x58(%rbp), %rax
movq %rax, -0x10(%rax)
leaq -0x68(%rbp), %rdi
movl $0x2d, %edx
callq 0x43d0
movl %r14d, %edi
addq -0x68(%rbp), %rdi
movl %r12d, %esi
movl %r15d, %edx
callq 0x7cc9
movq -0x68(%rbp), %rsi
movq -0x60(%rbp), %rdx
leaq -0x48(%rbp), %rdi
callq 0x4130
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %r15
cmpq %r15, %rdi
movq %rbx, %r14
je 0x71c9
callq 0x4310
leaq 0x1202b(%rip), %rsi     # 0x191fb
leaq -0x48(%rbp), %rdi
callq 0x45f0
leaq 0x11ff7(%rip), %rsi     # 0x191d7
leaq -0x48(%rbp), %rdi
callq 0x45f0
leaq 0x12010(%rip), %rsi     # 0x19200
leaq -0x48(%rbp), %rdi
callq 0x45f0
leaq -0x68(%rbp), %rdi
movq %r14, %rsi
callq 0xb7b0
movq -0x68(%rbp), %rsi
movq -0x60(%rbp), %rdx
leaq -0x48(%rbp), %rdi
callq 0x4130
movq -0x68(%rbp), %rdi
cmpq %r15, %rdi
je 0x7224
callq 0x4310
leaq 0x11fd0(%rip), %rsi     # 0x191fb
leaq -0x48(%rbp), %rdi
callq 0x45f0
leaq 0x11fd1(%rip), %rsi     # 0x1920c
leaq -0x48(%rbp), %rdi
callq 0x45f0
leaq 0x11fc9(%rip), %rsi     # 0x19214
leaq -0x48(%rbp), %rdi
callq 0x45f0
leaq -0x78(%rbp), %r15
movq %r15, -0x10(%r15)
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
addq %rsi, %rdx
leaq -0x88(%rbp), %rdi
callq 0x7e12
leaq -0x88(%rbp), %rsi
movq %r13, %rdi
callq 0xa454
movq -0x88(%rbp), %rdi
cmpq %r15, %rdi
je 0x7293
callq 0x4310
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x72a5
callq 0x4310
movq %r13, %rax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq -0x88(%rbp), %rdi
jmp 0x72cd
movq %rax, %r14
movq -0x68(%rbp), %rdi
cmpq %r15, %rdi
jne 0x72e6
jmp 0x7321
jmp 0x731e
movq %rax, %r14
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x7321
callq 0x4310
jmp 0x7321
jmp 0x731e
movq %rax, %r14
movq -0xa8(%rbp), %rdi
cmpq %r12, %rdi
je 0x7308
callq 0x4310
jmp 0x7308
movq %rax, %r14
movq -0xc8(%rbp), %rdi
cmpq %r15, %rdi
jne 0x732e
jmp 0x7333
movq %rax, %r14
movq %r13, %rdi
jmp 0x732e
movq %rax, %r14
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x7333
callq 0x4310
movq %r14, %rdi
callq 0x45a0
nop