// File: kn-sumanth[P]tcpproxy_server/tcpproxy_server.cpp
// Function: tcp_proxy::bridge::handle_upstream_connect(boost::system::error_code const&)
void handle_upstream_connect(const boost::system::error_code& error)
      {
         if (!error)
         {
            // Setup async read from remote server (upstream)
            upstream_socket_.async_read_some(
                 boost::asio::buffer(upstream_data_,max_data_length),
                 boost::bind(&bridge::handle_upstream_read,
                      shared_from_this(),
                      boost::asio::placeholders::error,
                      boost::asio::placeholders::bytes_transferred));

            // Setup async read from client (downstream)
            downstream_socket_.async_read_some(
                 boost::asio::buffer(downstream_data_,max_data_length),
                 boost::bind(&bridge::handle_downstream_read,
                      shared_from_this(),
                      boost::asio::placeholders::error,
                      boost::asio::placeholders::bytes_transferred));
         }
         else
            close();
      }

// Assembly:
subq $0xe8, %rsp
movq %rdi, 0xe0(%rsp)
movq %rsi, 0xd8(%rsp)
movq 0xe0(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0xd8(%rsp), %rdi
callq 0xede0
testb $0x1, %al
jne 0x1e0ba
jmp 0x1e2bb
movq 0x20(%rsp), %rdi
movq %rdi, %rax
addq $0x60, %rax
movq %rax, 0x10(%rsp)
addq $0x20b2, %rdi           # imm = 0x20B2
movl $0x2000, %esi           # imm = 0x2000
callq 0x21430
movq 0x20(%rsp), %rsi
movq %rax, 0xc8(%rsp)
movq %rdx, 0xd0(%rsp)
leaq 0x98(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0x1e2f0
movq 0x18(%rsp), %rcx
leaq 0x34d1(%rip), %rax      # 0x215e0
movq %rax, 0x88(%rsp)
movq $0x0, 0x90(%rsp)
movq 0x88(%rsp), %rsi
movq 0x90(%rsp), %rdx
leaq -0x41ea(%rip), %r8      # 0x19f50
leaq 0x35ef(%rip), %r9       # 0x21730
leaq 0xa8(%rsp), %rdi
callq 0x21490
jmp 0x1e150
movq 0x10(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
leaq 0xa8(%rsp), %rdx
callq 0x213e0
jmp 0x1e16c
leaq 0xa8(%rsp), %rdi
callq 0x21740
jmp 0x1e17b
leaq 0x98(%rsp), %rdi
callq 0xe880
movq 0x20(%rsp), %rdi
movq %rdi, %rax
addq $0x10, %rax
movq %rax, (%rsp)
addq $0xb2, %rdi
movl $0x2000, %esi           # imm = 0x2000
callq 0x21430
movq 0x20(%rsp), %rsi
movq %rax, 0x68(%rsp)
movq %rdx, 0x70(%rsp)
leaq 0x38(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x1e2f0
movq 0x8(%rsp), %rcx
leaq 0x358d(%rip), %rax      # 0x21760
movq %rax, 0x28(%rsp)
movq $0x0, 0x30(%rsp)
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
leaq -0x42a2(%rip), %r8      # 0x19f50
leaq 0x3537(%rip), %r9       # 0x21730
leaq 0x48(%rsp), %rdi
callq 0x21490
jmp 0x1e205
movq (%rsp), %rdi
leaq 0x68(%rsp), %rsi
leaq 0x48(%rsp), %rdx
callq 0x213e0
jmp 0x1e21a
leaq 0x48(%rsp), %rdi
callq 0x21740
jmp 0x1e226
leaq 0x38(%rsp), %rdi
callq 0xe880
jmp 0x1e2c5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x80(%rsp)
movl %eax, 0x7c(%rsp)
jmp 0x1e26a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x80(%rsp)
movl %eax, 0x7c(%rsp)
leaq 0xa8(%rsp), %rdi
callq 0x21740
jmp 0x1e268
jmp 0x1e26a
leaq 0x98(%rsp), %rdi
callq 0xe880
jmp 0x1e279
jmp 0x1e2cd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x80(%rsp)
movl %eax, 0x7c(%rsp)
jmp 0x1e2ad
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x80(%rsp)
movl %eax, 0x7c(%rsp)
leaq 0x48(%rsp), %rdi
callq 0x21740
jmp 0x1e2ab
jmp 0x1e2ad
leaq 0x38(%rsp), %rdi
callq 0xe880
jmp 0x1e2b9
jmp 0x1e2cd
movq 0x20(%rsp), %rdi
callq 0x218b0
addq $0xe8, %rsp
retq
movq 0x80(%rsp), %rdi
callq 0x7590
movq %rax, %rdi
callq 0x84c0
nopw %cs:(%rax,%rax)
nopl (%rax)