user: Converte this assembly snippet into its equivalent C code:

```asm
<db_initialization>:
  endbr64
  push   %r13
  mov    %rcx,%r13
  lea    D0(%rip),%rcx
  push   %r12
  mov    %rsi,%r12
  mov    $0x2,%esi
  push   %rbp
  mov    %rdi,%rbp
  mov    %r12,%rdi
  push   %rbx
  mov    %rdx,%rbx
  mov    %r13,%rdx
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  call   <join_strings@plt>
  mov    %rbx,%rdi
  mov    %r13,%rdx
  mov    $0x2,%esi
  lea    D49(%rip),%rcx
  call   <join_strings@plt>
  mov    (%rbx),%rdi
  call   <file_exists@plt>
  test   %rax,%rax
  jne    L30
  mov    (%r12),%rdi
  call   <file_exists@plt>
  test   %rax,%rax
  jne    L48
L27:
  mov    (%rbx),%rdi
  mov    %rbp,%rsi
  lea    0x10(%rsp),%rbx
  call   <sqlite3_open@plt>
  mov    0x0(%rbp),%rdi
  mov    %rbx,%r8
  xor    %ecx,%ecx
  lea    D26(%rip),%rsi
  xor    %edx,%edx
  call   <sqlite3_exec@plt>
  mov    0x10(%rsp),%rsi
  test   %rsi,%rsi
  je     L19
  lea    D9(%rip),%rdi
  call   <printf@plt>
  mov    0x10(%rsp),%rdi
  call   <sqlite3_free@plt>
  mov    $0xffffffff,%edi
  call   <exit@plt>
L19:
  mov    0x0(%rbp),%rdi
  lea    D18(%rip),%rsi
  mov    %rbx,%r8
  xor    %ecx,%ecx
  xor    %edx,%edx
  call   <sqlite3_exec@plt>
  mov    0x10(%rsp),%rsi
  test   %rsi,%rsi
  je     L37
  lea    D9(%rip),%rdi
  call   <printf@plt>
  mov    0x10(%rsp),%rdi
  call   <sqlite3_free@plt>
  mov    $0xffffffff,%edi
  call   <exit@plt>
L37:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L54
  add    $0x28,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopw   0x0(%rax,%rax,1)
L30:
  mov    (%rbx),%rdi
  call   <unlink@plt>
  mov    (%r12),%rdi
  call   <file_exists@plt>
  test   %rax,%rax
  je     L27
L48:
  mov    (%r12),%rdi
  lea    0xc(%rsp),%rsi
  call   <stat@plt>
  mov    0xc(%rsp),%edx
  mov    (%rbx),%rsi
  mov    (%r12),%rdi
  call   <file_copy@plt>
  jmp    L27
L54:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: tag: D0
data_type: string
name: unpack_data
arguments: tag: D49
data_type: string
name: unpack_data
arguments: tag: D26
data_type: string
name: unpack_data
arguments: tag: D9
data_type: string
name: unpack_data
arguments: tag: D18
data_type: string

tool: D0: mnemon.db

tool: D49: _mnemon.db

tool: D26: CREATE TABLE IF NOT EXISTS file ( inode INT NOT NULL PRIMARY KEY, path TEXT NOT NULL, mtime VARCHAR(255) NOT NULL )

tool: D9: %s


tool: D18: CREATE TABLE IF NOT EXISTS backup ( timestamp INT NOT NULL PRIMARY KEY, directory VARCHAR(255) NOT NULL, total_files INT NOT NULL, total_bytes INT NOT NULL, added_files INT NOT NULL, added_bytes INT NOT NULL )

assistant: ```c
int db_initialization(sqlite3 **db, char **db_filename, char **db_temp_filename, char *path) {
  char *error;
  struct stat stats;
  join_strings(db_filename, 2, path, "mnemon.db");
  join_strings(db_temp_filename, 2, path, "_mnemon.db");
  if (file_exists(*db_temp_filename))
    unlink(*db_temp_filename);
  if (file_exists(*db_filename)) {
    stat(*db_filename, &stats);
    file_copy(*db_filename, *db_temp_filename, stats);
  }
  sqlite3_open(*db_temp_filename, db);
  sqlite3_exec(*db, "CREATE TABLE IF NOT EXISTS file ( inode INT NOT NULL PRIMARY KEY, path TEXT NOT NULL, mtime VARCHAR(255) NOT NULL )", NULL, NULL, &error);
  if (error != NULL) {
    printf("%s\n", error);
    sqlite3_free(error);
    exit(-1);
  }
  sqlite3_exec(*db, "CREATE TABLE IF NOT EXISTS backup ( timestamp INT NOT NULL PRIMARY KEY, directory VARCHAR(255) NOT NULL, total_files INT NOT NULL, total_bytes INT NOT NULL, added_files INT NOT NULL, added_bytes INT NOT NULL )", NULL, NULL, &error);
  if (error != NULL) {
    printf("%s\n", error);
    sqlite3_free(error);
    exit(-1);
  }
  return 0;
}
```