#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_upgrade_files_table(int /*<<< orphan*/ *, char *, char *);
int db_upgrade_v14(sqlite3 *hdl) {
  return db_upgrade_files_table(
      hdl,
      "SELECT 'INSERT INTO files "
      "(id, path, fname, title, artist, album, genre, comment, type, composer,"
      " orchestra, conductor, grouping, url, bitrate, samplerate, song_length, "
      "file_size, year, track,"
      " total_tracks, disc, total_discs, bpm, compilation, rating, play_count, "
      "seek, data_kind, item_kind,"
      " description, time_added, time_modified, time_played, db_timestamp, "
      "disabled, sample_count,"
      " codectype, idx, has_video, contentrating, bits_per_sample, "
      "album_artist,"
      " media_kind, tv_series_name, tv_episode_num_str, tv_network_name, "
      "tv_episode_sort, tv_season_num, "
      " songartistid, songalbumid, "
      " title_sort, artist_sort, album_sort, composer_sort, album_artist_sort)"
      " VALUES (' || id || ', ' || QUOTE(path) || ', ' || QUOTE(fname) || ', ' "
      "|| QUOTE(title) || ', '"
      " || QUOTE(artist) || ', ' || QUOTE(album) || ', ' || QUOTE(genre) || ', "
      "' || QUOTE(comment) || ', '"
      " || QUOTE(type) || ', ' || QUOTE(composer) || ', ' || QUOTE(orchestra) "
      "|| ', ' || QUOTE(conductor) || ', '"
      " || QUOTE(grouping) || ', ' || QUOTE(url) || ', ' || bitrate || ', ' || "
      "samplerate || ', '"
      " || song_length || ', ' || file_size || ', ' || year || ', ' || track "
      "|| ', ' || total_tracks || ', '"
      " || disc || ', ' || total_discs || ', ' || bpm || ', ' || compilation "
      "|| ', ' || rating || ', '"
      " || play_count || ', 0, ' || data_kind || ', ' || item_kind || ', ' ||  "
      "QUOTE(description) || ', '"
      " || time_added || ', ' || time_modified || ', ' || time_played || ', ' "
      "|| db_timestamp || ', '"
      " || disabled || ', ' || sample_count || ', ' || QUOTE(codectype) || ', "
      "' || idx || ', '"
      " || has_video || ', ' || contentrating || ', ' || bits_per_sample || ', "
      "' || QUOTE(album_artist) || ', '"
      " || media_kind || ', ' || QUOTE(tv_series_name) || ', ' || "
      "QUOTE(tv_episode_num_str) || ', '"
      " || QUOTE(tv_network_name) || ', ' || tv_episode_sort || ', ' || "
      "tv_season_num || ', "
      " daap_songalbumid(' || QUOTE(album_artist) || ', ''''), ' || "
      "songalbumid || ', '"
      " || QUOTE(title_sort) || ', ' || QUOTE(artist_sort) || ', ' || "
      "QUOTE(album_sort) || ', '"
      " || QUOTE(composer_sort) || ', ' || QUOTE(album_artist_sort) || ');' "
      "FROM files;",
      "CREATE TABLE IF NOT EXISTS files ("
      "   id                 INTEGER PRIMARY KEY NOT NULL,"
      "   path               VARCHAR(4096) NOT NULL,"
      "   fname              VARCHAR(255) NOT NULL,"
      "   title              VARCHAR(1024) DEFAULT NULL COLLATE DAAP,"
      "   artist             VARCHAR(1024) DEFAULT NULL COLLATE DAAP,"
      "   album              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,"
      "   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,"
      "   rating             INTEGER DEFAULT 0,"
      "   play_count         INTEGER DEFAULT 0,"
      "   seek               INTEGER DEFAULT 0,"
      "   data_kind          INTEGER DEFAULT 0,"
      "   item_kind          INTEGER DEFAULT 0,"
      "   description        INTEGER DEFAULT 0,"
      "   time_added         INTEGER DEFAULT 0,"
      "   time_modified      INTEGER DEFAULT 0,"
      "   time_played        INTEGER DEFAULT 0,"
      "   db_timestamp       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,"
      "   album_artist       VARCHAR(1024) NOT NULL COLLATE DAAP,"
      "   media_kind         INTEGER NOT NULL,"
      "   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 NOT NULL,"
      "   songalbumid        INTEGER NOT NULL,"
      "   title_sort         VARCHAR(1024) DEFAULT NULL COLLATE DAAP,"
      "   artist_sort        VARCHAR(1024) DEFAULT NULL COLLATE DAAP,"
      "   album_sort         VARCHAR(1024) DEFAULT NULL COLLATE DAAP,"
      "   composer_sort      VARCHAR(1024) DEFAULT NULL COLLATE DAAP,"
      "   album_artist_sort  VARCHAR(1024) DEFAULT NULL COLLATE DAAP"
      ");");
}


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

x86 assembly (clang, -O2):
<db_upgrade_v14>:
lea    0xee9(%rip),%rsi
lea    0x16e1(%rip),%rdx
jmp    1030 <db_upgrade_files_table@plt>

LLVM IR (-O0):
@.str = [2047 x i8] c"SELECT 'INSERT INTO files (id, path, fname, title, artist, album, genre, comment, type, composer, orchestra, conductor, grouping, url, bitrate, samplerate, song_length, file_size, year, track, total_tracks, disc, total_discs, bpm, compilation, rating, play_count, seek, data_kind, item_kind, description, time_added, time_modified, time_played, db_timestamp, disabled, sample_count, codectype, idx, has_video, contentrating, bits_per_sample, album_artist, media_kind, tv_series_name, tv_episode_num_str, tv_network_name, tv_episode_sort, tv_season_num, songartistid, songalbumid, title_sort, artist_sort, album_sort, composer_sort, album_artist_sort) VALUES (' || id || ', ' || QUOTE(path) || ', ' || QUOTE(fname) || ', ' || QUOTE(title) || ', ' || QUOTE(artist) || ', ' || QUOTE(album) || ', ' || QUOTE(genre) || ', ' || QUOTE(comment) || ', ' || QUOTE(type) || ', ' || QUOTE(composer) || ', ' || QUOTE(orchestra) || ', ' || QUOTE(conductor) || ', ' || QUOTE(grouping) || ', ' || QUOTE(url) || ', ' || bitrate || ', ' || samplerate || ', ' || song_length || ', ' || file_size || ', ' || year || ', ' || track || ', ' || total_tracks || ', ' || disc || ', ' || total_discs || ', ' || bpm || ', ' || compilation || ', ' || rating || ', ' || play_count || ', 0, ' || data_kind || ', ' || item_kind || ', ' || QUOTE(description) || ', ' || time_added || ', ' || time_modified || ', ' || time_played || ', ' || db_timestamp || ', ' || disabled || ', ' || sample_count || ', ' || QUOTE(codectype) || ', ' || idx || ', ' || has_video || ', ' || contentrating || ', ' || bits_per_sample || ', ' || QUOTE(album_artist) || ', ' || media_kind || ', ' || QUOTE(tv_series_name) || ', ' || QUOTE(tv_episode_num_str) || ', ' || QUOTE(tv_network_name) || ', ' || tv_episode_sort || ', ' || tv_season_num || ', daap_songalbumid(' || QUOTE(album_artist) || ', ''''), ' || songalbumid || ', ' || QUOTE(title_sort) || ', ' || QUOTE(artist_sort) || ', ' || QUOTE(album_sort) || ', ' || QUOTE(composer_sort) || ', ' || QUOTE(album_artist_sort) || ');' FROM files;\00"
@.str.1 = [2713 x i8] c"CREATE TABLE IF NOT EXISTS files ( id INTEGER PRIMARY KEY NOT NULL, path VARCHAR(4096) NOT NULL, fname VARCHAR(255) NOT NULL, title VARCHAR(1024) DEFAULT NULL COLLATE DAAP, artist VARCHAR(1024) DEFAULT NULL COLLATE DAAP, album 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, 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, rating INTEGER DEFAULT 0, play_count INTEGER DEFAULT 0, seek INTEGER DEFAULT 0, data_kind INTEGER DEFAULT 0, item_kind INTEGER DEFAULT 0, description INTEGER DEFAULT 0, time_added INTEGER DEFAULT 0, time_modified INTEGER DEFAULT 0, time_played INTEGER DEFAULT 0, db_timestamp 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, album_artist VARCHAR(1024) NOT NULL COLLATE DAAP, media_kind INTEGER NOT NULL, 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 NOT NULL, songalbumid INTEGER NOT NULL, title_sort VARCHAR(1024) DEFAULT NULL COLLATE DAAP, artist_sort VARCHAR(1024) DEFAULT NULL COLLATE DAAP, album_sort VARCHAR(1024) DEFAULT NULL COLLATE DAAP, composer_sort VARCHAR(1024) DEFAULT NULL COLLATE DAAP, album_artist_sort VARCHAR(1024) DEFAULT NULL COLLATE DAAP);\00"
define i32 @db_upgrade_v14(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @db_upgrade_files_table(i32* %3, i8* getelementptr inbounds ([2047 x i8], [2047 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2713 x i8], [2713 x i8]* @.str.1, i64 0, i64 0))
ret i32 %4
}

LLVM IR (-O2):
@.str = [2047 x i8] c"SELECT 'INSERT INTO files (id, path, fname, title, artist, album, genre, comment, type, composer, orchestra, conductor, grouping, url, bitrate, samplerate, song_length, file_size, year, track, total_tracks, disc, total_discs, bpm, compilation, rating, play_count, seek, data_kind, item_kind, description, time_added, time_modified, time_played, db_timestamp, disabled, sample_count, codectype, idx, has_video, contentrating, bits_per_sample, album_artist, media_kind, tv_series_name, tv_episode_num_str, tv_network_name, tv_episode_sort, tv_season_num, songartistid, songalbumid, title_sort, artist_sort, album_sort, composer_sort, album_artist_sort) VALUES (' || id || ', ' || QUOTE(path) || ', ' || QUOTE(fname) || ', ' || QUOTE(title) || ', ' || QUOTE(artist) || ', ' || QUOTE(album) || ', ' || QUOTE(genre) || ', ' || QUOTE(comment) || ', ' || QUOTE(type) || ', ' || QUOTE(composer) || ', ' || QUOTE(orchestra) || ', ' || QUOTE(conductor) || ', ' || QUOTE(grouping) || ', ' || QUOTE(url) || ', ' || bitrate || ', ' || samplerate || ', ' || song_length || ', ' || file_size || ', ' || year || ', ' || track || ', ' || total_tracks || ', ' || disc || ', ' || total_discs || ', ' || bpm || ', ' || compilation || ', ' || rating || ', ' || play_count || ', 0, ' || data_kind || ', ' || item_kind || ', ' || QUOTE(description) || ', ' || time_added || ', ' || time_modified || ', ' || time_played || ', ' || db_timestamp || ', ' || disabled || ', ' || sample_count || ', ' || QUOTE(codectype) || ', ' || idx || ', ' || has_video || ', ' || contentrating || ', ' || bits_per_sample || ', ' || QUOTE(album_artist) || ', ' || media_kind || ', ' || QUOTE(tv_series_name) || ', ' || QUOTE(tv_episode_num_str) || ', ' || QUOTE(tv_network_name) || ', ' || tv_episode_sort || ', ' || tv_season_num || ', daap_songalbumid(' || QUOTE(album_artist) || ', ''''), ' || songalbumid || ', ' || QUOTE(title_sort) || ', ' || QUOTE(artist_sort) || ', ' || QUOTE(album_sort) || ', ' || QUOTE(composer_sort) || ', ' || QUOTE(album_artist_sort) || ');' FROM files;\00"
@.str.1 = [2713 x i8] c"CREATE TABLE IF NOT EXISTS files ( id INTEGER PRIMARY KEY NOT NULL, path VARCHAR(4096) NOT NULL, fname VARCHAR(255) NOT NULL, title VARCHAR(1024) DEFAULT NULL COLLATE DAAP, artist VARCHAR(1024) DEFAULT NULL COLLATE DAAP, album 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, 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, rating INTEGER DEFAULT 0, play_count INTEGER DEFAULT 0, seek INTEGER DEFAULT 0, data_kind INTEGER DEFAULT 0, item_kind INTEGER DEFAULT 0, description INTEGER DEFAULT 0, time_added INTEGER DEFAULT 0, time_modified INTEGER DEFAULT 0, time_played INTEGER DEFAULT 0, db_timestamp 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, album_artist VARCHAR(1024) NOT NULL COLLATE DAAP, media_kind INTEGER NOT NULL, 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 NOT NULL, songalbumid INTEGER NOT NULL, title_sort VARCHAR(1024) DEFAULT NULL COLLATE DAAP, artist_sort VARCHAR(1024) DEFAULT NULL COLLATE DAAP, album_sort VARCHAR(1024) DEFAULT NULL COLLATE DAAP, composer_sort VARCHAR(1024) DEFAULT NULL COLLATE DAAP, album_artist_sort VARCHAR(1024) DEFAULT NULL COLLATE DAAP);\00"
define i32 @db_upgrade_v14(i32* %0) {
%2 = tail call i32 @db_upgrade_files_table(i32* %0, i8* getelementptr inbounds ([2047 x i8], [2047 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2713 x i8], [2713 x i8]* @.str.1, i64 0, i64 0))
ret i32 %2
}