#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ sqlite3;

/* Variables and functions */
int db_table_upgrade(int /*<<< orphan*/ *, char *, char *);
int db_upgrade_v20(sqlite3 *hdl) {
  return db_table_upgrade(
      hdl, "files",
      "CREATE TABLE new_files ("
      "   id                 INTEGER PRIMARY KEY NOT NULL,"
      "   path               VARCHAR(4096) NOT NULL,"
      "   virtual_path       VARCHAR(4096) DEFAULT NULL,"
      "   fname              VARCHAR(255) NOT NULL,"
      "   directory_id       INTEGER DEFAULT 0,"
      "   title              VARCHAR(1024) DEFAULT NULL COLLATE DAAP,"
      "   artist             VARCHAR(1024) DEFAULT NULL COLLATE DAAP,"
      "   album              VARCHAR(1024) NOT NULL COLLATE DAAP,"
      "   album_artist       VARCHAR(1024) NOT NULL COLLATE DAAP,"
      "   genre              VARCHAR(255) DEFAULT NULL COLLATE DAAP,"
      "   comment            VARCHAR(4096) DEFAULT NULL COLLATE DAAP,"
      "   type               VARCHAR(255) DEFAULT NULL COLLATE DAAP,"
      "   composer           VARCHAR(1024) DEFAULT NULL COLLATE DAAP,"
      "   orchestra          VARCHAR(1024) DEFAULT NULL COLLATE DAAP,"
      "   conductor          VARCHAR(1024) DEFAULT NULL COLLATE DAAP,"
      "   grouping           VARCHAR(1024) DEFAULT NULL COLLATE DAAP,"
      "   url                VARCHAR(1024) DEFAULT NULL,"
      "   bitrate            INTEGER DEFAULT 0,"
      "   samplerate         INTEGER DEFAULT 0,"
      "   song_length        INTEGER DEFAULT 0,"
      "   file_size          INTEGER DEFAULT 0,"
      "   year               INTEGER DEFAULT 0,"
      "   date_released      INTEGER DEFAULT 0,"
      "   track              INTEGER DEFAULT 0,"
      "   total_tracks       INTEGER DEFAULT 0,"
      "   disc               INTEGER DEFAULT 0,"
      "   total_discs        INTEGER DEFAULT 0,"
      "   bpm                INTEGER DEFAULT 0,"
      "   compilation        INTEGER DEFAULT 0,"
      "   artwork            INTEGER DEFAULT 0,"
      "   rating             INTEGER DEFAULT 0,"
      "   play_count         INTEGER DEFAULT 0,"
      "   skip_count         INTEGER DEFAULT 0,"
      "   seek               INTEGER DEFAULT 0,"
      "   data_kind          INTEGER DEFAULT 0,"
      "   media_kind         INTEGER DEFAULT 0,"
      "   item_kind          INTEGER DEFAULT 0,"
      "   description        INTEGER DEFAULT 0,"
      "   db_timestamp       INTEGER DEFAULT 0,"
      "   time_added         INTEGER DEFAULT 0,"
      "   time_modified      INTEGER DEFAULT 0,"
      "   time_played        INTEGER DEFAULT 0,"
      "   time_skipped       INTEGER DEFAULT 0,"
      "   disabled           INTEGER DEFAULT 0,"
      "   sample_count       INTEGER DEFAULT 0,"
      "   codectype          VARCHAR(5) DEFAULT NULL,"
      "   idx                INTEGER NOT NULL,"
      "   has_video          INTEGER DEFAULT 0,"
      "   contentrating      INTEGER DEFAULT 0,"
      "   bits_per_sample    INTEGER DEFAULT 0,"
      "   tv_series_name     VARCHAR(1024) DEFAULT NULL COLLATE DAAP,"
      "   tv_episode_num_str VARCHAR(1024) DEFAULT NULL COLLATE DAAP,"
      "   tv_network_name    VARCHAR(1024) DEFAULT NULL COLLATE DAAP,"
      "   tv_episode_sort    INTEGER NOT NULL,"
      "   tv_season_num      INTEGER NOT NULL,"
      "   songartistid       INTEGER DEFAULT 0,"
      "   songalbumid        INTEGER DEFAULT 0,"
      "   title_sort         VARCHAR(1024) DEFAULT NULL COLLATE DAAP,"
      "   artist_sort        VARCHAR(1024) DEFAULT NULL COLLATE DAAP,"
      "   album_sort         VARCHAR(1024) DEFAULT NULL COLLATE DAAP,"
      "   album_artist_sort  VARCHAR(1024) DEFAULT NULL COLLATE DAAP,"
      "   composer_sort      VARCHAR(1024) DEFAULT NULL COLLATE DAAP"
      ");");
}


x86 assembly (clang, -O0):
<db_upgrade_v20>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
lea    0xed8(%rip),%rdx
call   1030 <db_table_upgrade@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<db_upgrade_v20>:
lea    0xee9(%rip),%rsi
lea    0xee8(%rip),%rdx
jmp    1030 <db_table_upgrade@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"files\00"
@.str.1 = [2955 x i8] c"CREATE TABLE new_files ( id INTEGER PRIMARY KEY NOT NULL, path VARCHAR(4096) NOT NULL, virtual_path VARCHAR(4096) DEFAULT NULL, fname VARCHAR(255) NOT NULL, directory_id INTEGER DEFAULT 0, title VARCHAR(1024) DEFAULT NULL COLLATE DAAP, artist VARCHAR(1024) DEFAULT NULL COLLATE DAAP, album VARCHAR(1024) NOT NULL COLLATE DAAP, album_artist VARCHAR(1024) NOT NULL COLLATE DAAP, genre VARCHAR(255) DEFAULT NULL COLLATE DAAP, comment VARCHAR(4096) DEFAULT NULL COLLATE DAAP, type VARCHAR(255) DEFAULT NULL COLLATE DAAP, composer VARCHAR(1024) DEFAULT NULL COLLATE DAAP, orchestra VARCHAR(1024) DEFAULT NULL COLLATE DAAP, conductor VARCHAR(1024) DEFAULT NULL COLLATE DAAP, grouping VARCHAR(1024) DEFAULT NULL COLLATE DAAP, url VARCHAR(1024) DEFAULT NULL, bitrate INTEGER DEFAULT 0, samplerate INTEGER DEFAULT 0, song_length INTEGER DEFAULT 0, file_size INTEGER DEFAULT 0, year INTEGER DEFAULT 0, date_released INTEGER DEFAULT 0, track INTEGER DEFAULT 0, total_tracks INTEGER DEFAULT 0, disc INTEGER DEFAULT 0, total_discs INTEGER DEFAULT 0, bpm INTEGER DEFAULT 0, compilation INTEGER DEFAULT 0, artwork INTEGER DEFAULT 0, rating INTEGER DEFAULT 0, play_count INTEGER DEFAULT 0, skip_count INTEGER DEFAULT 0, seek INTEGER DEFAULT 0, data_kind INTEGER DEFAULT 0, media_kind INTEGER DEFAULT 0, item_kind INTEGER DEFAULT 0, description INTEGER DEFAULT 0, db_timestamp INTEGER DEFAULT 0, time_added INTEGER DEFAULT 0, time_modified INTEGER DEFAULT 0, time_played INTEGER DEFAULT 0, time_skipped INTEGER DEFAULT 0, disabled INTEGER DEFAULT 0, sample_count INTEGER DEFAULT 0, codectype VARCHAR(5) DEFAULT NULL, idx INTEGER NOT NULL, has_video INTEGER DEFAULT 0, contentrating INTEGER DEFAULT 0, bits_per_sample INTEGER DEFAULT 0, tv_series_name VARCHAR(1024) DEFAULT NULL COLLATE DAAP, tv_episode_num_str VARCHAR(1024) DEFAULT NULL COLLATE DAAP, tv_network_name VARCHAR(1024) DEFAULT NULL COLLATE DAAP, tv_episode_sort INTEGER NOT NULL, tv_season_num INTEGER NOT NULL, songartistid INTEGER DEFAULT 0, songalbumid INTEGER DEFAULT 0, title_sort VARCHAR(1024) DEFAULT NULL COLLATE DAAP, artist_sort VARCHAR(1024) DEFAULT NULL COLLATE DAAP, album_sort VARCHAR(1024) DEFAULT NULL COLLATE DAAP, album_artist_sort VARCHAR(1024) DEFAULT NULL COLLATE DAAP, composer_sort VARCHAR(1024) DEFAULT NULL COLLATE DAAP);\00"
define i32 @db_upgrade_v20(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @db_table_upgrade(i32* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2955 x i8], [2955 x i8]* @.str.1, i64 0, i64 0))
ret i32 %4
}

LLVM IR (-O2):
@.str = [6 x i8] c"files\00"
@.str.1 = [2955 x i8] c"CREATE TABLE new_files ( id INTEGER PRIMARY KEY NOT NULL, path VARCHAR(4096) NOT NULL, virtual_path VARCHAR(4096) DEFAULT NULL, fname VARCHAR(255) NOT NULL, directory_id INTEGER DEFAULT 0, title VARCHAR(1024) DEFAULT NULL COLLATE DAAP, artist VARCHAR(1024) DEFAULT NULL COLLATE DAAP, album VARCHAR(1024) NOT NULL COLLATE DAAP, album_artist VARCHAR(1024) NOT NULL COLLATE DAAP, genre VARCHAR(255) DEFAULT NULL COLLATE DAAP, comment VARCHAR(4096) DEFAULT NULL COLLATE DAAP, type VARCHAR(255) DEFAULT NULL COLLATE DAAP, composer VARCHAR(1024) DEFAULT NULL COLLATE DAAP, orchestra VARCHAR(1024) DEFAULT NULL COLLATE DAAP, conductor VARCHAR(1024) DEFAULT NULL COLLATE DAAP, grouping VARCHAR(1024) DEFAULT NULL COLLATE DAAP, url VARCHAR(1024) DEFAULT NULL, bitrate INTEGER DEFAULT 0, samplerate INTEGER DEFAULT 0, song_length INTEGER DEFAULT 0, file_size INTEGER DEFAULT 0, year INTEGER DEFAULT 0, date_released INTEGER DEFAULT 0, track INTEGER DEFAULT 0, total_tracks INTEGER DEFAULT 0, disc INTEGER DEFAULT 0, total_discs INTEGER DEFAULT 0, bpm INTEGER DEFAULT 0, compilation INTEGER DEFAULT 0, artwork INTEGER DEFAULT 0, rating INTEGER DEFAULT 0, play_count INTEGER DEFAULT 0, skip_count INTEGER DEFAULT 0, seek INTEGER DEFAULT 0, data_kind INTEGER DEFAULT 0, media_kind INTEGER DEFAULT 0, item_kind INTEGER DEFAULT 0, description INTEGER DEFAULT 0, db_timestamp INTEGER DEFAULT 0, time_added INTEGER DEFAULT 0, time_modified INTEGER DEFAULT 0, time_played INTEGER DEFAULT 0, time_skipped INTEGER DEFAULT 0, disabled INTEGER DEFAULT 0, sample_count INTEGER DEFAULT 0, codectype VARCHAR(5) DEFAULT NULL, idx INTEGER NOT NULL, has_video INTEGER DEFAULT 0, contentrating INTEGER DEFAULT 0, bits_per_sample INTEGER DEFAULT 0, tv_series_name VARCHAR(1024) DEFAULT NULL COLLATE DAAP, tv_episode_num_str VARCHAR(1024) DEFAULT NULL COLLATE DAAP, tv_network_name VARCHAR(1024) DEFAULT NULL COLLATE DAAP, tv_episode_sort INTEGER NOT NULL, tv_season_num INTEGER NOT NULL, songartistid INTEGER DEFAULT 0, songalbumid INTEGER DEFAULT 0, title_sort VARCHAR(1024) DEFAULT NULL COLLATE DAAP, artist_sort VARCHAR(1024) DEFAULT NULL COLLATE DAAP, album_sort VARCHAR(1024) DEFAULT NULL COLLATE DAAP, album_artist_sort VARCHAR(1024) DEFAULT NULL COLLATE DAAP, composer_sort VARCHAR(1024) DEFAULT NULL COLLATE DAAP);\00"
define i32 @db_upgrade_v20(i32* %0) {
%2 = tail call i32 @db_table_upgrade(i32* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2955 x i8], [2955 x i8]* @.str.1, i64 0, i64 0))
ret i32 %2
}