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

```asm
<db_initialization>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,%rbp
  mov    %rsi,%r12
  mov    %rdx,%rbx
  mov    %rcx,%r13
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  lea    D24(%rip),%rcx
  mov    %r13,%rdx
  mov    $0x2,%esi
  mov    %r12,%rdi
  call   <join_strings@plt>
  lea    D3(%rip),%rcx
  mov    %r13,%rdx
  mov    $0x2,%esi
  mov    %rbx,%rdi
  call   <join_strings@plt>
  mov    (%rbx),%rdi
  call   <file_exists@plt>
  test   %rax,%rax
  jne    L56
L63:
  mov    (%r12),%rdi
  call   <file_exists@plt>
  test   %rax,%rax
  jne    L52
L21:
  mov    %rbp,%rsi
  mov    (%rbx),%rdi
  call   <sqlite3_open@plt>
  lea    0x10(%rsp),%r8
  mov    $0x0,%ecx
  mov    $0x0,%edx
  lea    D16(%rip),%rsi
  mov    0x0(%rbp),%rdi
  call   <sqlite3_exec@plt>
  mov    0x10(%rsp),%rsi
  test   %rsi,%rsi
  je     L49
  lea    D29(%rip),%rdi
  call   <printf@plt>
  mov    0x10(%rsp),%rdi
  call   <sqlite3_free@plt>
  mov    $0xffffffff,%edi
  call   <exit@plt>
L49:
  lea    0x10(%rsp),%r8
  mov    $0x0,%ecx
  mov    $0x0,%edx
  lea    D35(%rip),%rsi
  mov    0x0(%rbp),%rdi
  call   <sqlite3_exec@plt>
  mov    0x10(%rsp),%rsi
  test   %rsi,%rsi
  je     L1
  lea    D29(%rip),%rdi
  call   <printf@plt>
  mov    0x10(%rsp),%rdi
  call   <sqlite3_free@plt>
  mov    $0xffffffff,%edi
  call   <exit@plt>
L1:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L55
  mov    $0x0,%eax
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L56:
  mov    (%rbx),%rdi
  call   <unlink@plt>
  jmp    L63
L52:
  lea    0xc(%rsp),%rsi
  mov    (%r12),%rdi
  call   <stat@plt>
  mov    0xc(%rsp),%edx
  mov    (%rbx),%rsi
  mov    (%r12),%rdi
  call   <file_copy@plt>
  jmp    L21
L55:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_label: D24
data_type: string
name: retrieve_data
arguments: data_label: D3
data_type: string
name: retrieve_data
arguments: data_label: D16
data_type: string
name: retrieve_data
arguments: data_label: D29
data_type: string
name: retrieve_data
arguments: data_label: D35
data_type: string

tool: D24: mnemon.db

tool: D3: _mnemon.db

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

tool: D29: %s


tool: D35: 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;
}
```