// File: QZzcoder[P]LiveChat/server.cpp
// Function: newUser(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
bool newUser(string name,string password){
    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 * from User where name = \"" + name + "\"";
    mysql_query(&mysql_conn,sql.c_str());
    ptr_res = mysql_store_result(&mysql_conn);
    if(!ptr_res){return false;}

    sql = "insert into User values(\""+name+"\",\""+password+"\",0);";
    return !mysql_query(&mysql_conn,sql.c_str());
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x5d0, %rsp            # imm = 0x5D0
movq %rdi, -0x590(%rbp)
movq %rsi, -0x588(%rbp)
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
leaq -0x4a0(%rbp), %rdi
callq 0x3160
leaq -0x4a0(%rbp), %rdi
leaq 0x97f9(%rip), %rsi      # 0xe004
leaq 0x97fc(%rip), %rdx      # 0xe00e
leaq 0x10aa7(%rip), %rcx     # 0x152c0
leaq 0x97f3(%rip), %r8       # 0xe013
xorl %r9d, %r9d
xorl %eax, %eax
movq $0x0, (%rsp)
movq $0x0, 0x8(%rsp)
callq 0x3190
cmpq $0x0, %rax
jne 0x485e
movq 0x10790(%rip), %rdi     # 0x14fd8
leaq 0x97c9(%rip), %rsi      # 0xe018
callq 0x3310
movl $0x1, %edi
callq 0x33b0
movq -0x590(%rbp), %rdx
leaq 0x986c(%rip), %rsi      # 0xe0d8
leaq -0x4f0(%rbp), %rdi
movq %rdi, -0x598(%rbp)
callq 0x6340
movq -0x598(%rbp), %rsi
leaq 0x986b(%rip), %rdx      # 0xe0f8
leaq -0x4d0(%rbp), %rdi
callq 0x62f0
jmp 0x489b
leaq -0x4f0(%rbp), %rdi
callq 0x3200
leaq -0x4d0(%rbp), %rdi
callq 0x3120
movq %rax, %rsi
leaq -0x4a0(%rbp), %rdi
callq 0x3210
jmp 0x48c4
leaq -0x4a0(%rbp), %rdi
callq 0x31a0
movq %rax, -0x5a0(%rbp)
jmp 0x48d9
movq -0x5a0(%rbp), %rax
movq %rax, -0x4a8(%rbp)
cmpq $0x0, -0x4a8(%rbp)
jne 0x493e
movb $0x0, -0x1(%rbp)
movl $0x1, -0x500(%rbp)
jmp 0x4aa1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x4f8(%rbp)
movl %eax, -0x4fc(%rbp)
leaq -0x4f0(%rbp), %rdi
callq 0x3200
jmp 0x4ac7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x4f8(%rbp)
movl %eax, -0x4fc(%rbp)
jmp 0x4abb
movq -0x590(%rbp), %rdx
leaq 0x97cc(%rip), %rsi      # 0xe118
leaq -0x580(%rbp), %rdi
callq 0x6340
jmp 0x495a
leaq 0x97d1(%rip), %rdx      # 0xe132
leaq -0x560(%rbp), %rdi
leaq -0x580(%rbp), %rsi
callq 0x62f0
jmp 0x4976
movq -0x588(%rbp), %rdx
leaq -0x540(%rbp), %rdi
leaq -0x560(%rbp), %rsi
callq 0x6450
jmp 0x4992
leaq 0x979d(%rip), %rdx      # 0xe136
leaq -0x520(%rbp), %rdi
leaq -0x540(%rbp), %rsi
callq 0x62f0
jmp 0x49ae
leaq -0x4d0(%rbp), %rdi
movq %rdi, -0x5b0(%rbp)
leaq -0x520(%rbp), %rsi
movq %rsi, -0x5b8(%rbp)
callq 0x33c0
movq -0x5b8(%rbp), %rdi
callq 0x3200
leaq -0x540(%rbp), %rdi
callq 0x3200
leaq -0x560(%rbp), %rdi
callq 0x3200
leaq -0x580(%rbp), %rdi
callq 0x3200
movq -0x5b0(%rbp), %rdi
callq 0x3120
movq %rax, %rsi
leaq -0x4a0(%rbp), %rdi
callq 0x3210
movl %eax, -0x5a4(%rbp)
jmp 0x4a22
movl -0x5a4(%rbp), %eax
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
andb $0x1, %al
movb %al, -0x1(%rbp)
movl $0x1, -0x500(%rbp)
jmp 0x4aa1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x4f8(%rbp)
movl %eax, -0x4fc(%rbp)
jmp 0x4a93
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x4f8(%rbp)
movl %eax, -0x4fc(%rbp)
jmp 0x4a87
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x4f8(%rbp)
movl %eax, -0x4fc(%rbp)
leaq -0x540(%rbp), %rdi
callq 0x3200
leaq -0x560(%rbp), %rdi
callq 0x3200
leaq -0x580(%rbp), %rdi
callq 0x3200
jmp 0x4abb
leaq -0x4d0(%rbp), %rdi
callq 0x3200
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x5d0, %rsp            # imm = 0x5D0
popq %rbp
retq
leaq -0x4d0(%rbp), %rdi
callq 0x3200
movq -0x4f8(%rbp), %rdi
callq 0x34d0
nopw %cs:(%rax,%rax)