// File: QZzcoder[P]LiveChat/server.cpp
// Function: getOldMsg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
vector<string> getOldMsg(string name){
    vector<string> ret;
    MYSQL mysql_conn;
    MYSQL_RES * ptr_res;
    MYSQL_ROW result_row;
    mysql_init(&mysql_conn);
    if(!mysql_real_connect(&mysql_conn,"localhost","root",dbpassword,"Chat",0,NULL,0)){
        cout<<"mysql error";
        exit(1);
    }
    string sql = "select logofftime from User where name = \"" + name + "\";";
    if(!mysql_query(&mysql_conn,sql.c_str())){
        ptr_res = mysql_use_result(&mysql_conn);
        if(ptr_res){
            result_row = mysql_fetch_row(ptr_res);
        }
    }
    string logofftime = result_row[0];

    mysql_init(&mysql_conn);
    if(!mysql_real_connect(&mysql_conn,"localhost","root",dbpassword,"Chat",0,NULL,0)){
        cout<<"mysql error";
        exit(1);
    }
    sql = "select * from message where target = \"" + name + "\" and time > "+logofftime+";";
    if(!mysql_query(&mysql_conn,sql.c_str())){
        ptr_res = mysql_use_result(&mysql_conn);
        if(ptr_res){
            while((result_row = mysql_fetch_row(ptr_res))!=NULL){
                vector<string> temp(4,"");
                for(int i = 0;i<mysql_num_fields(ptr_res);i++){
                    temp[i] = result_row[i];
                }
                ret.push_back(temp[1]+":"+temp[3]);
            }
        }
    }
    mysql_close(&mysql_conn);

    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x6d0, %rsp            # imm = 0x6D0
movq %rsi, -0x640(%rbp)
movq %rdi, -0x638(%rbp)
movq %rdi, %rax
movq %rax, -0x630(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movb $0x0, -0x11(%rbp)
callq 0x62d0
leaq -0x4a0(%rbp), %rdi
callq 0x3160
jmp 0x3832
movq %rsp, %rax
movq $0x0, 0x8(%rax)
movq $0x0, (%rax)
leaq 0xa7b9(%rip), %rsi      # 0xe004
leaq 0xa7bc(%rip), %rdx      # 0xe00e
leaq 0x11a67(%rip), %rcx     # 0x152c0
leaq 0xa7b3(%rip), %r8       # 0xe013
leaq -0x4a0(%rbp), %rdi
xorl %r9d, %r9d
callq 0x3190
movq %rax, -0x648(%rbp)
jmp 0x3878
movq -0x648(%rbp), %rax
cmpq $0x0, %rax
jne 0x38bb
movq 0x1174c(%rip), %rdi     # 0x14fd8
leaq 0xa785(%rip), %rsi      # 0xe018
callq 0x3310
jmp 0x389a
movl $0x1, %edi
callq 0x33b0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x4b8(%rbp)
movl %eax, -0x4bc(%rbp)
jmp 0x3f37
movq -0x640(%rbp), %rdx
leaq 0xa75b(%rip), %rsi      # 0xe024
leaq -0x500(%rbp), %rdi
callq 0x6340
jmp 0x38d7
leaq 0xa771(%rip), %rdx      # 0xe04f
leaq -0x4e0(%rbp), %rdi
leaq -0x500(%rbp), %rsi
callq 0x62f0
jmp 0x38f3
leaq -0x500(%rbp), %rdi
callq 0x3200
leaq -0x4e0(%rbp), %rdi
callq 0x3120
movq %rax, %rsi
leaq -0x4a0(%rbp), %rdi
callq 0x3210
movl %eax, -0x64c(%rbp)
jmp 0x3922
movl -0x64c(%rbp), %eax
cmpl $0x0, %eax
jne 0x39bf
leaq -0x4a0(%rbp), %rdi
callq 0x3510
movq %rax, -0x658(%rbp)
jmp 0x3946
movq -0x658(%rbp), %rax
movq %rax, -0x4a8(%rbp)
cmpq $0x0, -0x4a8(%rbp)
je 0x39bd
movq -0x4a8(%rbp), %rdi
callq 0x3340
movq %rax, -0x660(%rbp)
jmp 0x3973
movq -0x660(%rbp), %rax
movq %rax, -0x4b0(%rbp)
jmp 0x39bd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x4b8(%rbp)
movl %eax, -0x4bc(%rbp)
leaq -0x500(%rbp), %rdi
callq 0x3200
jmp 0x3f37
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x4b8(%rbp)
movl %eax, -0x4bc(%rbp)
jmp 0x3f0d
jmp 0x39bf
movq -0x4b0(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x670(%rbp)
leaq -0x521(%rbp), %rdi
movq %rdi, -0x668(%rbp)
callq 0x34e0
movq -0x670(%rbp), %rsi
movq -0x668(%rbp), %rdx
leaq -0x520(%rbp), %rdi
callq 0x33f0
jmp 0x39ff
leaq -0x521(%rbp), %rdi
callq 0x3380
leaq -0x4a0(%rbp), %rdi
callq 0x3160
jmp 0x3a19
movq %rsp, %rax
movq $0x0, 0x8(%rax)
movq $0x0, (%rax)
leaq 0xa5d2(%rip), %rsi      # 0xe004
leaq 0xa5d5(%rip), %rdx      # 0xe00e
leaq 0x11880(%rip), %rcx     # 0x152c0
leaq 0xa5cc(%rip), %r8       # 0xe013
leaq -0x4a0(%rbp), %rdi
xorl %r9d, %r9d
callq 0x3190
movq %rax, -0x678(%rbp)
jmp 0x3a5f
movq -0x678(%rbp), %rax
cmpq $0x0, %rax
jne 0x3ac5
movq 0x11565(%rip), %rdi     # 0x14fd8
leaq 0xa59e(%rip), %rsi      # 0xe018
callq 0x3310
jmp 0x3a81
movl $0x1, %edi
callq 0x33b0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x4b8(%rbp)
movl %eax, -0x4bc(%rbp)
leaq -0x521(%rbp), %rdi
callq 0x3380
jmp 0x3f0d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x4b8(%rbp)
movl %eax, -0x4bc(%rbp)
jmp 0x3f01
movq -0x640(%rbp), %rdx
leaq 0xa57f(%rip), %rsi      # 0xe052
leaq -0x5a8(%rbp), %rdi
callq 0x6340
jmp 0x3ae1
leaq 0xa591(%rip), %rdx      # 0xe079
leaq -0x588(%rbp), %rdi
leaq -0x5a8(%rbp), %rsi
callq 0x62f0
jmp 0x3afd
leaq -0x568(%rbp), %rdi
leaq -0x588(%rbp), %rsi
leaq -0x520(%rbp), %rdx
callq 0x6450
jmp 0x3b19
leaq 0xa530(%rip), %rdx      # 0xe050
leaq -0x548(%rbp), %rdi
leaq -0x568(%rbp), %rsi
callq 0x62f0
jmp 0x3b35
leaq -0x4e0(%rbp), %rdi
movq %rdi, -0x688(%rbp)
leaq -0x548(%rbp), %rsi
movq %rsi, -0x690(%rbp)
callq 0x33c0
movq -0x690(%rbp), %rdi
callq 0x3200
leaq -0x568(%rbp), %rdi
callq 0x3200
leaq -0x588(%rbp), %rdi
callq 0x3200
leaq -0x5a8(%rbp), %rdi
callq 0x3200
movq -0x688(%rbp), %rdi
callq 0x3120
movq %rax, %rsi
leaq -0x4a0(%rbp), %rdi
callq 0x3210
movl %eax, -0x67c(%rbp)
jmp 0x3ba9
movl -0x67c(%rbp), %eax
cmpl $0x0, %eax
jne 0x3ecf
leaq -0x4a0(%rbp), %rdi
callq 0x3510
movq %rax, -0x698(%rbp)
jmp 0x3bcd
movq -0x698(%rbp), %rax
movq %rax, -0x4a8(%rbp)
cmpq $0x0, -0x4a8(%rbp)
je 0x3ecd
jmp 0x3beb
movq -0x4a8(%rbp), %rdi
callq 0x3340
movq %rax, -0x6a0(%rbp)
jmp 0x3c00
movq -0x6a0(%rbp), %rax
movq %rax, -0x4b0(%rbp)
cmpq $0x0, %rax
je 0x3ecb
leaq -0x5e1(%rbp), %rdi
movq %rdi, -0x6a8(%rbp)
callq 0x34e0
movq -0x6a8(%rbp), %rdx
leaq 0xa529(%rip), %rsi      # 0xe162
leaq -0x5e0(%rbp), %rdi
callq 0x33f0
jmp 0x3c47
leaq -0x5e2(%rbp), %rdi
movq %rdi, -0x6b0(%rbp)
callq 0x64a0
movq -0x6b0(%rbp), %rcx
leaq -0x5c0(%rbp), %rdi
movl $0x4, %esi
leaq -0x5e0(%rbp), %rdx
callq 0x64c0
jmp 0x3c7b
leaq -0x5e2(%rbp), %rdi
callq 0x6540
leaq -0x5e0(%rbp), %rdi
callq 0x3200
leaq -0x5e1(%rbp), %rdi
callq 0x3380
movl $0x0, -0x5e8(%rbp)
movl -0x5e8(%rbp), %eax
movl %eax, -0x6b8(%rbp)
movq -0x4a8(%rbp), %rdi
callq 0x3470
movl %eax, -0x6b4(%rbp)
jmp 0x3cc9
movl -0x6b8(%rbp), %eax
movl -0x6b4(%rbp), %ecx
cmpl %ecx, %eax
jae 0x3def
movq -0x4b0(%rbp), %rax
movslq -0x5e8(%rbp), %rsi
movq (%rax,%rsi,8), %rax
movq %rax, -0x6c0(%rbp)
leaq -0x5c0(%rbp), %rdi
callq 0x6560
movq -0x6c0(%rbp), %rsi
movq %rax, %rdi
callq 0x33e0
jmp 0x3d13
jmp 0x3d15
movl -0x5e8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5e8(%rbp)
jmp 0x3ca9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x4b8(%rbp)
movl %eax, -0x4bc(%rbp)
jmp 0x3d78
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x4b8(%rbp)
movl %eax, -0x4bc(%rbp)
jmp 0x3d6c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x4b8(%rbp)
movl %eax, -0x4bc(%rbp)
leaq -0x568(%rbp), %rdi
callq 0x3200
leaq -0x588(%rbp), %rdi
callq 0x3200
leaq -0x5a8(%rbp), %rdi
callq 0x3200
jmp 0x3f01
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x4b8(%rbp)
movl %eax, -0x4bc(%rbp)
jmp 0x3dc7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x4b8(%rbp)
movl %eax, -0x4bc(%rbp)
leaq -0x5e2(%rbp), %rdi
callq 0x6540
leaq -0x5e0(%rbp), %rdi
callq 0x3200
leaq -0x5e1(%rbp), %rdi
callq 0x3380
jmp 0x3f01
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x4b8(%rbp)
movl %eax, -0x4bc(%rbp)
jmp 0x3ebd
leaq -0x5c0(%rbp), %rdi
movl $0x1, %esi
callq 0x6560
movq %rax, %rsi
leaq 0xa3fa(%rip), %rdx      # 0xe204
leaq -0x628(%rbp), %rdi
callq 0x65b0
jmp 0x3e18
leaq -0x5c0(%rbp), %rdi
movl $0x3, %esi
callq 0x6560
movq %rax, %rdx
leaq -0x608(%rbp), %rdi
leaq -0x628(%rbp), %rsi
callq 0x6450
jmp 0x3e41
movq -0x638(%rbp), %rdi
leaq -0x608(%rbp), %rsi
callq 0x6580
jmp 0x3e56
leaq -0x608(%rbp), %rdi
callq 0x3200
leaq -0x628(%rbp), %rdi
callq 0x3200
leaq -0x5c0(%rbp), %rdi
callq 0x6630
jmp 0x3beb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x4b8(%rbp)
movl %eax, -0x4bc(%rbp)
jmp 0x3eb1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x4b8(%rbp)
movl %eax, -0x4bc(%rbp)
leaq -0x608(%rbp), %rdi
callq 0x3200
leaq -0x628(%rbp), %rdi
callq 0x3200
leaq -0x5c0(%rbp), %rdi
callq 0x6630
jmp 0x3f01
jmp 0x3ecd
jmp 0x3ecf
leaq -0x4a0(%rbp), %rdi
callq 0x33d0
jmp 0x3edd
movb $0x1, -0x11(%rbp)
leaq -0x520(%rbp), %rdi
callq 0x3200
leaq -0x4e0(%rbp), %rdi
callq 0x3200
testb $0x1, -0x11(%rbp)
jne 0x3f27
jmp 0x3f1b
leaq -0x520(%rbp), %rdi
callq 0x3200
leaq -0x4e0(%rbp), %rdi
callq 0x3200
jmp 0x3f37
movq -0x638(%rbp), %rdi
callq 0x6630
movq -0x630(%rbp), %rax
addq $0x6d0, %rsp            # imm = 0x6D0
popq %rbp
retq
movq -0x638(%rbp), %rdi
callq 0x6630
movq -0x4b8(%rbp), %rdi
callq 0x34d0
nop