// File: /workspace/github_cpp_makefile_star2_O3/dentiny[P]HTTP-Cache-Proxy/Proxy.cpp
// Function: Proxy::acceptRequest(int)
Request acceptRequest(int fd)
	{
		// receive port number of the current player
		std::vector<char> buffer(BUFFER_SIZE, '\0');
	    int len = recv(fd, &buffer.data()[0], BUFFER_SIZE, 0);
	    if(len == -1)
	    {
	        throw ProxyException("In acceptRequest(), server receive request error");
	    }
	    buffer[len] = '\0';

	    // get current time for request
	    time_t cur = time(NULL);
	    tm * tm = localtime(&cur);
	    char * dt = asctime(tm);
	    std::string cur_time(dt);

	    // extract HTTP action and url from request
	    Request request(cur_time, buffer, len);
	    parser.parseRequest(request);
	    return request;
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %r14
movl $0x10000, %edi          # imm = 0x10000
callq 0x3330
movq %rax, %rbx
movl $0x10000, %edx          # imm = 0x10000
movq %rax, %rdi
xorl %esi, %esi
callq 0x31f0
movl $0x10000, %edx          # imm = 0x10000
movl %ebp, %edi
movq %rbx, %rsi
xorl %ecx, %ecx
callq 0x3100
movq %rax, %r12
cmpl $-0x1, %r12d
je 0x53d8
movslq %r12d, %rax
movb $0x0, (%rbx,%rax)
xorl %edi, %edi
callq 0x32f0
leaq 0x70(%rsp), %rdi
movq %rax, (%rdi)
callq 0x3260
movq %rax, %rdi
callq 0x3140
leaq 0x30(%rsp), %rdi
leaq 0xf(%rsp), %rdx
movq %rax, %rsi
callq 0x39d6
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
movl $0x10000, %edi          # imm = 0x10000
callq 0x3330
leaq 0x10(%rsp), %r13
movq %rax, (%r13)
movq %rax, %rbp
addq $0x10000, %rbp          # imm = 0x10000
movq %rbp, 0x10(%r13)
movl $0x10000, %edx          # imm = 0x10000
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3290
movq %rbp, 0x8(%r13)
leaq 0x30(%rsp), %rsi
movq %r14, %rdi
movq %r13, %rdx
movl %r12d, %ecx
callq 0x6b42
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x5393
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x3340
movq %r15, %rdi
movq %r14, %rsi
callq 0x6ca8
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x53b9
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x3340
movl $0x10000, %esi          # imm = 0x10000
movq %rbx, %rdi
callq 0x3340
movq %r14, %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x28, %edi
callq 0x31a0
movq %rax, %r14
leaq 0x60(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x7d87(%rip), %rsi      # 0xd17d
leaq 0x7db0(%rip), %rdx      # 0xd1ad
leaq 0x50(%rsp), %rdi
callq 0x3c80
movb $0x1, %bpl
leaq 0x50(%rsp), %rsi
movq %r14, %rdi
callq 0x6a7c
xorl %ebp, %ebp
leaq 0xc8e8(%rip), %rsi      # 0x11d08
leaq 0x169f(%rip), %rdx      # 0x6ac6
movq %r14, %rdi
callq 0x34e0
movq %rax, %r15
movq 0x50(%rsp), %rdi
cmpq %r12, %rdi
je 0x5449
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x3340
testb %bpl, %bpl
jne 0x5453
jmp 0x54ab
movq %rax, %r15
movq %r14, %rdi
callq 0x3250
jmp 0x54ab
movq %rax, %r15
movq %r14, %rdi
callq 0x553e
jmp 0x5489
movq %rax, %r15
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x5489
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x3340
jmp 0x5489
movq %rax, %r15
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x54ab
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x3340
jmp 0x54ab
jmp 0x54a8
movq %rax, %r15
movl $0x10000, %esi          # imm = 0x10000
movq %rbx, %rdi
callq 0x3340
movq %r15, %rdi
callq 0x3510