#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_stmt;
typedef int /*<<< orphan*/ sqlite3;

/* Variables and functions */
int Menu();
int SQLITE_OK;
int /*<<< orphan*/ SQLITE_ROW;
int /*<<< orphan*/ asprintf(char **, char *, char **, ...);
int atoi(char *);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sqlite3_close(int /*<<< orphan*/ *);
int sqlite3_column_int(int /*<<< orphan*/ *, int);
char *sqlite3_column_text(int /*<<< orphan*/ *, int);
char *sqlite3_errmsg(int /*<<< orphan*/ *);
int sqlite3_exec(int /*<<< orphan*/ *, char *, int /*<<< orphan*/ *,
                 int /*<<< orphan*/ *, char **);
int /*<<< orphan*/ sqlite3_free(char *);
int sqlite3_open(char *, int /*<<< orphan*/ **);
int sqlite3_prepare(int /*<<< orphan*/ *, char *, int, int /*<<< orphan*/ **,
                    int /*<<< orphan*/ *);
int /*<<< orphan*/ sqlite3_step(int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ strncat(char *, char *, int);
int main(int argc, char **argv) {
  char *query = NULL;
  char usrNme[20];
  char crrElec[150];
  char sede[20];
  char resp[50];
  char fullStmt[1024];
  int response;
  char aluNme[1024];
  char aluDni[20];
  char auxOpcionLocal[50];
  char auxObservaciones[1024];
  int auxIntDni;
  int auxIntMetodo;
  sqlite3 *db;
  char *errMsg = 0;
  int rc;
  sqlite3_stmt *stmt;
  sqlite3_stmt *result;
  rc = sqlite3_open("universitas.db", &db);
  if (rc != SQLITE_OK) {
    fprintf(stderr, "No se puede acceder a la base de datos: %s.\n",
            sqlite3_errmsg(db));
    sqlite3_close(db);
    return (1);
  }
  do {
    response = Menu();
    switch (response) {
    case '1':
      printf("Ingrese nombre de usuario para el acceso: ");
      fgets(usrNme, 20, stdin);
      printf("Ingrese correo electronico del usuario: ");
      fgets(crrElec, 150, stdin);
      printf("Ingrese sede del usuario: ");
      fgets(sede, 20, stdin);
      strcpy(fullStmt,
             "INSERT INTO usuarios (userName, email, location) VALUES ('");
      strncat(fullStmt, usrNme, 1024);
      strncat(fullStmt, "', '", 1024);
      strncat(fullStmt, crrElec, 1024);
      strncat(fullStmt, "', '", 1024);
      strncat(fullStmt, sede, 1024);
      strncat(fullStmt, "');", 1024);
      printf("\n");
      printf(fullStmt);
      rc = sqlite3_exec(db, fullStmt, NULL, NULL, &errMsg);
      if (rc != SQLITE_OK) {
        fprintf(stderr, "Error al crear el primer registro: %s.\n", errMsg);
        sqlite3_free(errMsg);
        sqlite3_close(db);
        return (2);
      }
      fullStmt[0] = '\0';
      break;
    case '2':
      printf("Ingrese nombre de usuario a modificar: ");
      fgets(usrNme, 20, stdin);
      printf("Ingrese nombre de usuario deseado: ");
      fgets(usrNme, 20, stdin);
      printf("Ingrese correo electronico del usuario: ");
      fgets(crrElec, 150, stdin);
      printf("Ingrese sede del usuario: ");
      fgets(sede, 20, stdin);
      strcpy(fullStmt, "UPDATE usuarios SET userName = '");
      strncat(fullStmt, usrNme, 1024);
      strncat(fullStmt, "', email = '", 1024);
      strncat(fullStmt, crrElec, 1024);
      strncat(fullStmt, "', location = '", 1024);
      strncat(fullStmt, sede, 1024);
      strncat(fullStmt, "' WHERE userName = '", 1024);
      strncat(fullStmt, usrNme, 1024);
      strncat(fullStmt, "';", 1024);
      printf(fullStmt);
      getchar();
      rc = sqlite3_exec(db, fullStmt, NULL, NULL, &errMsg);
      if (rc != SQLITE_OK) {
        fprintf(stderr, "Error al crear el primer registro: %s.\n", errMsg);
        sqlite3_free(errMsg);
        sqlite3_close(db);
        return (2);
      }
      fullStmt[0] = '\0';
      break;
    case '3':
      printf("Ingrese nombre de usuario para eliminar: ");
      fgets(usrNme, 20, stdin);
      asprintf(&query, "DELETE FROM usuarios WHERE username = '%s';\n commit;",
               &usrNme);
      rc = sqlite3_exec(db, query, NULL, NULL, &errMsg);
      if (errMsg != NULL) {
        printf("Error in sqlite3_exec: %s\n", errMsg);
        sqlite3_free(errMsg);
      }
      getchar();
      free(query);
      break;
    case '4':
      rc = sqlite3_prepare(db, "SELECT * FROM usuarios", -1, &result, NULL);
      if (rc != SQLITE_OK) {
        fprintf(stderr, "Error en la consulta: %s.\n", sqlite3_errmsg(db));
        sqlite3_close(db);
        return (3);
      }
      while (sqlite3_step(result) == SQLITE_ROW) {
        fprintf(stderr,
                "Los usuarios actuales son:  ============= ID = %i \n UserName "
                "= %s \n Privilegios = %i \n Correo = %s \n Sede = %s.\n",
                sqlite3_column_int(result, 0), sqlite3_column_text(result, 1),
                sqlite3_column_int(result, 2), sqlite3_column_text(result, 3),
                sqlite3_column_text(result, 4));
        getchar();
      }
      break;
    case '5':
      printf("Ingrese nombre del nuevo alumno: \n");
      fgets(aluNme, 1024, stdin);
      printf("Ingrese numero de documento: \n");
      fgets(aluDni, 20, stdin);
      printf("Ingrese plan de pago deseado: \n 1 -- 6 cuotas sin interes \n 2 "
             "-- 12 cuotas con interes del 10 porciento \n 1 -- 1 pago con 35 "
             "porciento de descuento \n");
      fgets(auxOpcionLocal, 50, stdin);
      printf("Ingrese, de ser necesario, una observacion del usuario: \n");
      fgets(auxObservaciones, 1024, stdin);
      auxIntDni = atoi(aluDni);
      auxIntMetodo = atoi(auxOpcionLocal);
      asprintf(&query,
               "INSERT INTO alumnos(aluNme, aluDni, metodoPago, costoTotal, "
               "observaciones) VALUES ('%s', '%i', '%i', '%i', '%s')",
               &aluNme, auxIntDni, auxIntMetodo, 25000, &auxObservaciones);
      rc = sqlite3_exec(db, query, NULL, NULL, &errMsg);
      if (errMsg != NULL) {
        printf("Error in sqlite3_exec: %s\n", errMsg);
        sqlite3_free(errMsg);
      }
      getchar();
      free(query);
      break;
    case '8':
      rc = sqlite3_prepare(db, "SELECT * FROM alumnos", -1, &result, NULL);
      if (rc != SQLITE_OK) {
        fprintf(stderr, "Error en la consulta: %s.\n", sqlite3_errmsg(db));
        sqlite3_close(db);
        return (3);
      }
      while (sqlite3_step(result) == SQLITE_ROW) {
        fprintf(stderr,
                "Los usuarios actuales son:  ============= ID = %i \n Nombre "
                "Alumno = %s \n Dni = %i \n Metodo de Pago = %i \n Costo total "
                "del año = %i.\n Observaciones = %s \n",
                sqlite3_column_int(result, 0), sqlite3_column_text(result, 1),
                sqlite3_column_int(result, 2), sqlite3_column_int(result, 3),
                sqlite3_column_int(result, 4), sqlite3_column_text(result, 5));
        getchar();
      }
      break;
    }
  } while (response != '0');
  sqlite3_close(db);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0xdb8(%rbp)
lea    0xdbd(%rip),%rdi
lea    -0xdb0(%rbp),%rsi
call   1060 <sqlite3_open@plt>
mov    %eax,-0xdbc(%rbp)
mov    -0xdbc(%rbp),%eax
mov    0x2d66(%rip),%rcx
cmp    (%rcx),%eax
je     12d4 <main+0xa4>
mov    0x2d3f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xdd4(%rbp)
mov    -0xdb0(%rbp),%rdi
call   10b0 <sqlite3_errmsg@plt>
mov    -0xdd4(%rbp),%edi
mov    %rax,%rdx
lea    0xd7a(%rip),%rsi
mov    $0x0,%al
call   10e0 <fprintf@plt>
mov    -0xdb0(%rbp),%rdi
call   10f0 <sqlite3_close@plt>
movl   $0x1,-0x4(%rbp)
jmp    1bf6 <main+0x9c6>
jmp    12d9 <main+0xa9>
xor    %eax,%eax
call   1100 <Menu@plt>
mov    %eax,-0x534(%rbp)
mov    -0x534(%rbp),%eax
add    $0xffffffcf,%eax
mov    %eax,%ecx
mov    %rcx,-0xde0(%rbp)
sub    $0x7,%eax
ja     1bd1 <main+0x9a1>
mov    -0xde0(%rbp),%rax
lea    0xcf1(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xd3d(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0x30(%rbp),%rdi
mov    0x2caf(%rip),%rax
mov    (%rax),%edx
mov    $0x14,%esi
call   1090 <fgets@plt>
lea    0xd43(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0xd0(%rbp),%rdi
mov    0x2c87(%rip),%rax
mov    (%rax),%edx
mov    $0x96,%esi
call   1090 <fgets@plt>
lea    0xd44(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0xf0(%rbp),%rdi
mov    0x2c5f(%rip),%rax
mov    (%rax),%edx
mov    $0x14,%esi
call   1090 <fgets@plt>
lea    -0x530(%rbp),%rdi
lea    0xd30(%rip),%rsi
call   1040 <strcpy@plt>
lea    -0x530(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    $0x400,%edx
call   1080 <strncat@plt>
lea    -0x530(%rbp),%rdi
lea    0xd43(%rip),%rsi
mov    $0x400,%edx
call   1080 <strncat@plt>
lea    -0x530(%rbp),%rdi
lea    -0xd0(%rbp),%rsi
mov    $0x400,%edx
call   1080 <strncat@plt>
lea    -0x530(%rbp),%rdi
lea    0xd13(%rip),%rsi
mov    $0x400,%edx
call   1080 <strncat@plt>
lea    -0x530(%rbp),%rdi
lea    -0xf0(%rbp),%rsi
mov    $0x400,%edx
call   1080 <strncat@plt>
lea    -0x530(%rbp),%rdi
lea    0xce8(%rip),%rsi
mov    $0x400,%edx
call   1080 <strncat@plt>
lea    0xfd2(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0x530(%rbp),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0xdb0(%rbp),%rdi
lea    -0x530(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%ecx
lea    -0xdb8(%rbp),%r8
mov    %rcx,%rdx
call   1050 <sqlite3_exec@plt>
mov    %eax,-0xdbc(%rbp)
mov    -0xdbc(%rbp),%eax
mov    0x2b6b(%rip),%rcx
cmp    (%rcx),%eax
je     14c7 <main+0x297>
mov    0x2b44(%rip),%rax
mov    (%rax),%edi
mov    -0xdb8(%rbp),%rdx
lea    0xc73(%rip),%rsi
mov    $0x0,%al
call   10e0 <fprintf@plt>
mov    -0xdb8(%rbp),%rdi
call   1150 <sqlite3_free@plt>
mov    -0xdb0(%rbp),%rdi
call   10f0 <sqlite3_close@plt>
movl   $0x2,-0x4(%rbp)
jmp    1bf6 <main+0x9c6>
movb   $0x0,-0x530(%rbp)
jmp    1bd1 <main+0x9a1>
lea    0xc5d(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0x30(%rbp),%rdi
mov    0x2af4(%rip),%rax
mov    (%rax),%edx
mov    $0x14,%esi
call   1090 <fgets@plt>
lea    0xc60(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0x30(%rbp),%rdi
mov    0x2acf(%rip),%rax
mov    (%rax),%edx
mov    $0x14,%esi
call   1090 <fgets@plt>
lea    0xb63(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0xd0(%rbp),%rdi
mov    0x2aa7(%rip),%rax
mov    (%rax),%edx
mov    $0x96,%esi
call   1090 <fgets@plt>
lea    0xb64(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0xf0(%rbp),%rdi
mov    0x2a7f(%rip),%rax
mov    (%rax),%edx
mov    $0x14,%esi
call   1090 <fgets@plt>
lea    -0x530(%rbp),%rdi
lea    0xc08(%rip),%rsi
call   1040 <strcpy@plt>
lea    -0x530(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    $0x400,%edx
call   1080 <strncat@plt>
lea    -0x530(%rbp),%rdi
lea    0xc01(%rip),%rsi
mov    $0x400,%edx
call   1080 <strncat@plt>
lea    -0x530(%rbp),%rdi
lea    -0xd0(%rbp),%rsi
mov    $0x400,%edx
call   1080 <strncat@plt>
lea    -0x530(%rbp),%rdi
lea    0xbde(%rip),%rsi
mov    $0x400,%edx
call   1080 <strncat@plt>
lea    -0x530(%rbp),%rdi
lea    -0xf0(%rbp),%rsi
mov    $0x400,%edx
call   1080 <strncat@plt>
lea    -0x530(%rbp),%rdi
lea    0xbbe(%rip),%rsi
mov    $0x400,%edx
call   1080 <strncat@plt>
lea    -0x530(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    $0x400,%edx
call   1080 <strncat@plt>
lea    -0x530(%rbp),%rdi
lea    0xba6(%rip),%rsi
mov    $0x400,%edx
call   1080 <strncat@plt>
lea    -0x530(%rbp),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    $0x0,%al
call   10c0 <getchar@plt>
mov    -0xdb0(%rbp),%rdi
lea    -0x530(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%ecx
lea    -0xdb8(%rbp),%r8
mov    %rcx,%rdx
call   1050 <sqlite3_exec@plt>
mov    %eax,-0xdbc(%rbp)
mov    -0xdbc(%rbp),%eax
mov    0x2965(%rip),%rcx
cmp    (%rcx),%eax
je     16cd <main+0x49d>
mov    0x293e(%rip),%rax
mov    (%rax),%edi
mov    -0xdb8(%rbp),%rdx
lea    0xa6d(%rip),%rsi
mov    $0x0,%al
call   10e0 <fprintf@plt>
mov    -0xdb8(%rbp),%rdi
call   1150 <sqlite3_free@plt>
mov    -0xdb0(%rbp),%rdi
call   10f0 <sqlite3_close@plt>
movl   $0x2,-0x4(%rbp)
jmp    1bf6 <main+0x9c6>
movb   $0x0,-0x530(%rbp)
jmp    1bd1 <main+0x9a1>
lea    0xaf9(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0x30(%rbp),%rdi
mov    0x28ee(%rip),%rax
mov    (%rax),%edx
mov    $0x14,%esi
call   1090 <fgets@plt>
lea    -0x30(%rbp),%rdx
lea    -0x18(%rbp),%rdi
lea    0xaf6(%rip),%rsi
mov    $0x0,%al
call   1120 <asprintf@plt>
mov    -0xdb0(%rbp),%rdi
mov    -0x18(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%ecx
lea    -0xdb8(%rbp),%r8
mov    %rcx,%rdx
call   1050 <sqlite3_exec@plt>
mov    %eax,-0xdbc(%rbp)
cmpq   $0x0,-0xdb8(%rbp)
je     1767 <main+0x537>
mov    -0xdb8(%rbp),%rsi
lea    0xae4(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0xdb8(%rbp),%rdi
call   1150 <sqlite3_free@plt>
mov    $0x0,%al
call   10c0 <getchar@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
jmp    1bd1 <main+0x9a1>
mov    -0xdb0(%rbp),%rdi
lea    0xac9(%rip),%rsi
mov    $0xffffffff,%edx
lea    -0xdd0(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%r8d
call   1130 <sqlite3_prepare@plt>
mov    %eax,-0xdbc(%rbp)
mov    -0xdbc(%rbp),%eax
mov    0x2835(%rip),%rcx
cmp    (%rcx),%eax
je     1805 <main+0x5d5>
mov    0x280e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xde4(%rbp)
mov    -0xdb0(%rbp),%rdi
call   10b0 <sqlite3_errmsg@plt>
mov    -0xde4(%rbp),%edi
mov    %rax,%rdx
lea    0xa84(%rip),%rsi
mov    $0x0,%al
call   10e0 <fprintf@plt>
mov    -0xdb0(%rbp),%rdi
call   10f0 <sqlite3_close@plt>
movl   $0x3,-0x4(%rbp)
jmp    1bf6 <main+0x9c6>
jmp    180a <main+0x5da>
mov    -0xdd0(%rbp),%rdi
call   10d0 <sqlite3_step@plt>
mov    0x27ab(%rip),%rcx
cmp    (%rcx),%eax
jne    18df <main+0x6af>
mov    0x27a4(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xe08(%rbp)
mov    -0xdd0(%rbp),%rdi
xor    %esi,%esi
call   10a0 <sqlite3_column_int@plt>
mov    %eax,-0xe04(%rbp)
mov    -0xdd0(%rbp),%rdi
mov    $0x1,%esi
call   1110 <sqlite3_column_text@plt>
mov    %rax,-0xe00(%rbp)
mov    -0xdd0(%rbp),%rdi
mov    $0x2,%esi
call   10a0 <sqlite3_column_int@plt>
mov    %eax,-0xdf4(%rbp)
mov    -0xdd0(%rbp),%rdi
mov    $0x3,%esi
call   1110 <sqlite3_column_text@plt>
mov    %rax,-0xdf0(%rbp)
mov    -0xdd0(%rbp),%rdi
mov    $0x4,%esi
call   1110 <sqlite3_column_text@plt>
mov    -0xe08(%rbp),%edi
mov    -0xe04(%rbp),%edx
mov    -0xe00(%rbp),%rcx
mov    -0xdf4(%rbp),%r8d
mov    -0xdf0(%rbp),%r9
lea    0x9bd(%rip),%rsi
mov    %rax,(%rsp)
mov    $0x0,%al
call   10e0 <fprintf@plt>
mov    $0x0,%al
call   10c0 <getchar@plt>
jmp    180a <main+0x5da>
jmp    1bd1 <main+0x9a1>
lea    0xa0b(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0x940(%rbp),%rdi
mov    0x26e0(%rip),%rax
mov    (%rax),%edx
mov    $0x400,%esi
call   1090 <fgets@plt>
lea    0xa06(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0x960(%rbp),%rdi
mov    0x26b8(%rip),%rax
mov    (%rax),%edx
mov    $0x14,%esi
call   1090 <fgets@plt>
lea    0x9fd(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0x9a0(%rbp),%rdi
mov    0x2690(%rip),%rax
mov    (%rax),%edx
mov    $0x32,%esi
call   1090 <fgets@plt>
lea    0xa6b(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0xda0(%rbp),%rdi
mov    0x2668(%rip),%rax
mov    (%rax),%edx
mov    $0x400,%esi
call   1090 <fgets@plt>
lea    -0x960(%rbp),%rdi
call   1140 <atoi@plt>
mov    %eax,-0xda4(%rbp)
lea    -0x9a0(%rbp),%rdi
call   1140 <atoi@plt>
mov    %eax,-0xda8(%rbp)
lea    -0x940(%rbp),%rdx
mov    -0xda4(%rbp),%ecx
mov    -0xda8(%rbp),%r8d
lea    -0x18(%rbp),%rdi
lea    0xa41(%rip),%rsi
mov    $0x61a8,%r9d
lea    -0xda0(%rbp),%rax
mov    %rax,(%rsp)
mov    $0x0,%al
call   1120 <asprintf@plt>
mov    -0xdb0(%rbp),%rdi
mov    -0x18(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%ecx
lea    -0xdb8(%rbp),%r8
mov    %rcx,%rdx
call   1050 <sqlite3_exec@plt>
mov    %eax,-0xdbc(%rbp)
cmpq   $0x0,-0xdb8(%rbp)
je     1a32 <main+0x802>
mov    -0xdb8(%rbp),%rsi
lea    0x819(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0xdb8(%rbp),%rdi
call   1150 <sqlite3_free@plt>
mov    $0x0,%al
call   10c0 <getchar@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
jmp    1bd1 <main+0x9a1>
mov    -0xdb0(%rbp),%rdi
lea    0xa24(%rip),%rsi
mov    $0xffffffff,%edx
lea    -0xdd0(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%r8d
call   1130 <sqlite3_prepare@plt>
mov    %eax,-0xdbc(%rbp)
mov    -0xdbc(%rbp),%eax
mov    0x256a(%rip),%rcx
cmp    (%rcx),%eax
je     1ad0 <main+0x8a0>
mov    0x2543(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xe0c(%rbp)
mov    -0xdb0(%rbp),%rdi
call   10b0 <sqlite3_errmsg@plt>
mov    -0xe0c(%rbp),%edi
mov    %rax,%rdx
lea    0x7b9(%rip),%rsi
mov    $0x0,%al
call   10e0 <fprintf@plt>
mov    -0xdb0(%rbp),%rdi
call   10f0 <sqlite3_close@plt>
movl   $0x3,-0x4(%rbp)
jmp    1bf6 <main+0x9c6>
jmp    1ad5 <main+0x8a5>
mov    -0xdd0(%rbp),%rdi
call   10d0 <sqlite3_step@plt>
mov    0x24e0(%rip),%rcx
cmp    (%rcx),%eax
jne    1bcc <main+0x99c>
mov    0x24d9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xe28(%rbp)
mov    -0xdd0(%rbp),%rdi
xor    %esi,%esi
call   10a0 <sqlite3_column_int@plt>
mov    %eax,-0xe24(%rbp)
mov    -0xdd0(%rbp),%rdi
mov    $0x1,%esi
call   1110 <sqlite3_column_text@plt>
mov    %rax,-0xe20(%rbp)
mov    -0xdd0(%rbp),%rdi
mov    $0x2,%esi
call   10a0 <sqlite3_column_int@plt>
mov    %eax,-0xe18(%rbp)
mov    -0xdd0(%rbp),%rdi
mov    $0x3,%esi
call   10a0 <sqlite3_column_int@plt>
mov    %eax,-0xe14(%rbp)
mov    -0xdd0(%rbp),%rdi
mov    $0x4,%esi
call   10a0 <sqlite3_column_int@plt>
mov    %eax,-0xe10(%rbp)
mov    -0xdd0(%rbp),%rdi
mov    $0x5,%esi
call   1110 <sqlite3_column_text@plt>
mov    -0xe28(%rbp),%edi
mov    -0xe24(%rbp),%edx
mov    -0xe20(%rbp),%rcx
mov    -0xe18(%rbp),%r8d
mov    -0xe14(%rbp),%r9d
mov    -0xe10(%rbp),%r10d
lea    0x8df(%rip),%rsi
mov    %r10d,(%rsp)
mov    %rax,0x8(%rsp)
mov    $0x0,%al
call   10e0 <fprintf@plt>
mov    $0x0,%al
call   10c0 <getchar@plt>
jmp    1ad5 <main+0x8a5>
jmp    1bd1 <main+0x9a1>
jmp    1bd6 <main+0x9a6>
cmpl   $0x30,-0x534(%rbp)
jne    12d9 <main+0xa9>
mov    -0xdb0(%rbp),%rdi
call   10f0 <sqlite3_close@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xe40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xd88,%rsp
movq   $0x0,0x30(%rsp)
movq   $0x0,0x18(%rsp)
lea    0xdaa(%rip),%rdi
lea    0x20(%rsp),%rsi
call   1080 <sqlite3_open@plt>
mov    0x2d5d(%rip),%rcx
cmp    (%rcx),%eax
jne    18e3 <main+0x693>
xor    %eax,%eax
mov    %rax,0x28(%rsp)
jmp    12b1 <main+0x61>
nopl   0x0(%rax)
xor    %eax,%eax
call   10e0 <getchar@plt>
mov    0x30(%rsp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
call   1120 <Menu@plt>
mov    %rax,%rcx
mov    %rax,0x38(%rsp)
add    $0xffffffd0,%eax
cmp    $0x8,%eax
ja     12b1 <main+0x61>
lea    0xd31(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xd81(%rip),%rdi
xor    %eax,%eax
call   1090 <printf@plt>
mov    0x2cf3(%rip),%rbx
mov    (%rbx),%edx
lea    0x40(%rsp),%rbp
mov    %rbp,%rdi
mov    $0x14,%esi
call   10b0 <fgets@plt>
lea    0xd83(%rip),%rdi
xor    %eax,%eax
call   1090 <printf@plt>
mov    (%rbx),%edx
lea    0xe0(%rsp),%r14
mov    %r14,%rdi
mov    $0x96,%esi
call   10b0 <fgets@plt>
lea    0xd87(%rip),%rdi
xor    %eax,%eax
call   1090 <printf@plt>
mov    (%rbx),%edx
lea    0x60(%rsp),%r15
mov    %r15,%rdi
mov    $0x14,%esi
call   10b0 <fgets@plt>
lea    0x180(%rsp),%rbx
mov    %rbx,%rdi
lea    0xd75(%rip),%rsi
call   1050 <strcpy@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    $0x400,%edx
call   10a0 <strncat@plt>
mov    %rbx,%rdi
lea    0xd91(%rip),%rbp
mov    %rbp,%rsi
mov    $0x400,%edx
call   10a0 <strncat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x400,%edx
call   10a0 <strncat@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    $0x400,%edx
call   10a0 <strncat@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x400,%edx
call   10a0 <strncat@plt>
mov    %rbx,%rdi
lea    0xd4f(%rip),%rsi
mov    $0x400,%edx
call   10a0 <strncat@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1090 <printf@plt>
mov    0x20(%rsp),%rdi
mov    %rbx,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
lea    0x18(%rsp),%r8
call   1070 <sqlite3_exec@plt>
mov    0x2bed(%rip),%rcx
cmp    (%rcx),%eax
jne    193d <main+0x6ed>
movb   $0x0,0x180(%rsp)
jmp    12b1 <main+0x61>
lea    0xd24(%rip),%rdi
xor    %eax,%eax
call   1090 <printf@plt>
mov    0x2bbb(%rip),%rbx
mov    (%rbx),%edx
lea    0x40(%rsp),%r14
mov    %r14,%rdi
mov    $0x14,%esi
call   10b0 <fgets@plt>
lea    0xd23(%rip),%rdi
xor    %eax,%eax
call   1090 <printf@plt>
mov    (%rbx),%edx
mov    %r14,%rdi
mov    $0x14,%esi
call   10b0 <fgets@plt>
lea    0xc2e(%rip),%rdi
xor    %eax,%eax
call   1090 <printf@plt>
mov    (%rbx),%edx
lea    0xe0(%rsp),%rbp
mov    %rbp,%rdi
mov    $0x96,%esi
call   10b0 <fgets@plt>
lea    0xc32(%rip),%rdi
xor    %eax,%eax
call   1090 <printf@plt>
mov    (%rbx),%edx
lea    0x60(%rsp),%r15
mov    %r15,%rdi
mov    $0x14,%esi
call   10b0 <fgets@plt>
lea    0x180(%rsp),%rbx
mov    %rbx,%rdi
lea    0xcd8(%rip),%rsi
call   1050 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x400,%edx
call   10a0 <strncat@plt>
mov    %rbx,%rdi
lea    0xcda(%rip),%rsi
mov    $0x400,%edx
call   10a0 <strncat@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    $0x400,%edx
call   10a0 <strncat@plt>
mov    %rbx,%rdi
lea    0xcc3(%rip),%rsi
mov    $0x400,%edx
call   10a0 <strncat@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x400,%edx
call   10a0 <strncat@plt>
mov    %rbx,%rdi
lea    0xcaf(%rip),%rsi
mov    $0x400,%edx
call   10a0 <strncat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x400,%edx
call   10a0 <strncat@plt>
mov    %rbx,%rdi
lea    0xca0(%rip),%rsi
mov    $0x400,%edx
call   10a0 <strncat@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1090 <printf@plt>
xor    %eax,%eax
call   10e0 <getchar@plt>
mov    0x20(%rsp),%rdi
mov    %rbx,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
lea    0x18(%rsp),%r8
call   1070 <sqlite3_exec@plt>
mov    0x2a76(%rip),%rcx
cmp    (%rcx),%eax
jne    193d <main+0x6ed>
movb   $0x0,0x180(%rsp)
jmp    12b1 <main+0x61>
lea    0xc4f(%rip),%rdi
xor    %eax,%eax
call   1090 <printf@plt>
mov    0x2a44(%rip),%rax
mov    (%rax),%edx
lea    0x40(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x14,%esi
call   10b0 <fgets@plt>
lea    0x30(%rsp),%rdi
lea    0xc4b(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1140 <asprintf@plt>
jmp    178d <main+0x53d>
mov    0x20(%rsp),%rdi
lea    0xc80(%rip),%rsi
mov    $0xffffffff,%edx
lea    0x10(%rsp),%rcx
xor    %r8d,%r8d
call   1150 <sqlite3_prepare@plt>
mov    0x29f8(%rip),%rcx
cmp    (%rcx),%eax
jne    1910 <main+0x6c0>
mov    0x10(%rsp),%rdi
call   10f0 <sqlite3_step@plt>
mov    0x29bf(%rip),%rcx
cmp    (%rcx),%eax
jne    12b1 <main+0x61>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    0x29a9(%rip),%rax
mov    (%rax),%r12d
mov    0x10(%rsp),%rdi
xor    %esi,%esi
call   10c0 <sqlite3_column_int@plt>
mov    %eax,%r13d
mov    0x10(%rsp),%rdi
mov    $0x1,%esi
call   1130 <sqlite3_column_text@plt>
mov    %rax,%rbx
mov    0x10(%rsp),%rdi
mov    $0x2,%esi
call   10c0 <sqlite3_column_int@plt>
mov    %eax,%ebp
mov    0x10(%rsp),%rdi
mov    $0x3,%esi
call   1130 <sqlite3_column_text@plt>
mov    %rax,%r15
mov    0x10(%rsp),%rdi
mov    $0x4,%esi
call   1130 <sqlite3_column_text@plt>
mov    %rax,(%rsp)
mov    %r12d,%edi
lea    0xbfe(%rip),%rsi
mov    %r13d,%edx
mov    %rbx,%rcx
mov    %ebp,%r8d
mov    %r15,%r9
xor    %eax,%eax
call   1100 <fprintf@plt>
xor    %eax,%eax
call   10e0 <getchar@plt>
mov    0x10(%rsp),%rdi
call   10f0 <sqlite3_step@plt>
mov    0x2912(%rip),%rcx
cmp    (%rcx),%eax
je     1620 <main+0x3d0>
jmp    18d3 <main+0x683>
lea    0xd52(%rip),%rdi
call   1060 <puts@plt>
mov    0x290a(%rip),%rbx
mov    (%rbx),%edx
lea    0x980(%rsp),%r14
mov    %r14,%rdi
mov    $0x400,%esi
call   10b0 <fgets@plt>
lea    0xd4a(%rip),%rdi
call   1060 <puts@plt>
mov    (%rbx),%edx
lea    0x80(%rsp),%r15
mov    %r15,%rdi
mov    $0x14,%esi
call   10b0 <fgets@plt>
lea    0xd45(%rip),%rdi
call   1060 <puts@plt>
mov    (%rbx),%edx
lea    0xa0(%rsp),%r12
mov    %r12,%rdi
mov    $0x32,%esi
call   10b0 <fgets@plt>
lea    0xdb7(%rip),%rdi
call   1060 <puts@plt>
mov    (%rbx),%edx
lea    0x580(%rsp),%rbp
mov    %rbp,%rdi
mov    $0x400,%esi
call   10b0 <fgets@plt>
mov    %r15,%rdi
call   1160 <atoi@plt>
mov    %eax,%ebx
mov    %r12,%rdi
call   1160 <atoi@plt>
mov    %rbp,(%rsp)
lea    0x30(%rsp),%rdi
lea    0xb82(%rip),%rsi
mov    %r14,%rdx
mov    %ebx,%ecx
mov    %eax,%r8d
mov    $0x61a8,%r9d
xor    %eax,%eax
call   1140 <asprintf@plt>
mov    0x20(%rsp),%rdi
mov    0x30(%rsp),%rsi
xor    %edx,%edx
xor    %ecx,%ecx
lea    0x18(%rsp),%r8
call   1070 <sqlite3_exec@plt>
mov    0x18(%rsp),%rsi
test   %rsi,%rsi
je     12a0 <main+0x50>
lea    0xa82(%rip),%rdi
xor    %eax,%eax
call   1090 <printf@plt>
mov    0x18(%rsp),%rdi
call   1170 <sqlite3_free@plt>
jmp    12a0 <main+0x50>
mov    0x20(%rsp),%rdi
lea    0xb8f(%rip),%rsi
mov    $0xffffffff,%edx
lea    0x10(%rsp),%rcx
xor    %r8d,%r8d
call   1150 <sqlite3_prepare@plt>
mov    0x27f3(%rip),%rcx
cmp    (%rcx),%eax
jne    1910 <main+0x6c0>
mov    0x10(%rsp),%rdi
call   10f0 <sqlite3_step@plt>
mov    0x27ba(%rip),%rcx
cmp    (%rcx),%eax
jne    12b1 <main+0x61>
cs nopw 0x0(%rax,%rax,1)
mov    0x27a9(%rip),%rax
mov    (%rax),%r15d
mov    0x10(%rsp),%rdi
xor    %esi,%esi
call   10c0 <sqlite3_column_int@plt>
mov    %eax,%ebx
mov    0x10(%rsp),%rdi
mov    $0x1,%esi
call   1130 <sqlite3_column_text@plt>
mov    %rax,%r12
mov    0x10(%rsp),%rdi
mov    $0x2,%esi
call   10c0 <sqlite3_column_int@plt>
mov    %eax,%r13d
mov    0x10(%rsp),%rdi
mov    $0x3,%esi
call   10c0 <sqlite3_column_int@plt>
mov    %eax,%ebp
mov    0x10(%rsp),%rdi
mov    $0x4,%esi
call   10c0 <sqlite3_column_int@plt>
mov    %eax,%r14d
mov    0x10(%rsp),%rdi
mov    $0x5,%esi
call   1130 <sqlite3_column_text@plt>
mov    %rax,0x8(%rsp)
mov    %r14d,(%rsp)
mov    %r15d,%edi
lea    0xae0(%rip),%rsi
mov    %ebx,%edx
mov    %r12,%rcx
mov    %r13d,%r8d
mov    %ebp,%r9d
xor    %eax,%eax
call   1100 <fprintf@plt>
xor    %eax,%eax
call   10e0 <getchar@plt>
mov    0x10(%rsp),%rdi
call   10f0 <sqlite3_step@plt>
mov    0x26fd(%rip),%rcx
cmp    (%rcx),%eax
je     1820 <main+0x5d0>
cmpl   $0x30,0x38(%rsp)
jne    12b1 <main+0x61>
jmp    196d <main+0x71d>
mov    0x26e6(%rip),%rax
mov    (%rax),%ebx
mov    0x20(%rsp),%rdi
call   10d0 <sqlite3_errmsg@plt>
lea    0x736(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
xor    %eax,%eax
call   1100 <fprintf@plt>
mov    $0x1,%eax
jmp    1968 <main+0x718>
mov    0x26b9(%rip),%rax
mov    (%rax),%ebx
mov    0x20(%rsp),%rdi
call   10d0 <sqlite3_errmsg@plt>
lea    0x944(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
xor    %eax,%eax
call   1100 <fprintf@plt>
mov    $0x3,%eax
jmp    1968 <main+0x718>
mov    0x268c(%rip),%rax
mov    (%rax),%edi
mov    0x18(%rsp),%rdx
lea    0x7c1(%rip),%rsi
xor    %eax,%eax
call   1100 <fprintf@plt>
mov    0x18(%rsp),%rdi
call   1170 <sqlite3_free@plt>
mov    $0x2,%eax
mov    %rax,0x28(%rsp)
mov    0x20(%rsp),%rdi
call   1110 <sqlite3_close@plt>
mov    0x28(%rsp),%rax
add    $0xd88,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [15 x i8] c"universitas.db\00"
@SQLITE_OK = global i32 0
@stderr = global i32 0
@.str.1 = [45 x i8] c"No se puede acceder a la base de datos: %s.\0A\00"
@.str.2 = [43 x i8] c"Ingrese nombre de usuario para el acceso: \00"
@stdin = global i32 0
@.str.3 = [41 x i8] c"Ingrese correo electronico del usuario: \00"
@.str.4 = [27 x i8] c"Ingrese sede del usuario: \00"
@.str.5 = [59 x i8] c"INSERT INTO usuarios (userName, email, location) VALUES ('\00"
@.str.6 = [5 x i8] c"', '\00"
@.str.7 = [4 x i8] c"');\00"
@.str.8 = [2 x i8] c"\0A\00"
@.str.9 = [40 x i8] c"Error al crear el primer registro: %s.\0A\00"
@.str.10 = [40 x i8] c"Ingrese nombre de usuario a modificar: \00"
@.str.11 = [36 x i8] c"Ingrese nombre de usuario deseado: \00"
@.str.12 = [33 x i8] c"UPDATE usuarios SET userName = '\00"
@.str.13 = [13 x i8] c"', email = '\00"
@.str.14 = [16 x i8] c"', location = '\00"
@.str.15 = [21 x i8] c"' WHERE userName = '\00"
@.str.16 = [3 x i8] c"';\00"
@.str.17 = [42 x i8] c"Ingrese nombre de usuario para eliminar: \00"
@.str.18 = [53 x i8] c"DELETE FROM usuarios WHERE username = '%s';\0A commit;\00"
@.str.19 = [27 x i8] c"Error in sqlite3_exec: %s\0A\00"
@.str.20 = [23 x i8] c"SELECT * FROM usuarios\00"
@.str.21 = [27 x i8] c"Error en la consulta: %s.\0A\00"
@SQLITE_ROW = global i32 0
@.str.22 = [113 x i8] c"Los usuarios actuales son: ============= ID = %i \0A UserName = %s \0A Privilegios = %i \0A Correo = %s \0A Sede = %s.\0A\00"
@.str.23 = [35 x i8] c"Ingrese nombre del nuevo alumno: \0A\00"
@.str.24 = [31 x i8] c"Ingrese numero de documento: \0A\00"
@.str.25 = [150 x i8] c"Ingrese plan de pago deseado: \0A 1 -- 6 cuotas sin interes \0A 2 -- 12 cuotas con interes del 10 porciento \0A 1 -- 1 pago con 35 porciento de descuento \0A\00"
@.str.26 = [58 x i8] c"Ingrese, de ser necesario, una observacion del usuario: \0A\00"
@.str.27 = [113 x i8] c"INSERT INTO alumnos(aluNme, aluDni, metodoPago, costoTotal, observaciones) VALUES ('%s', '%i', '%i', '%i', '%s')\00"
@.str.28 = [22 x i8] c"SELECT * FROM alumnos\00"
@.str.29 = [155 x i8] c"Los usuarios actuales son: ============= ID = %i \0A Nombre Alumno = %s \0A Dni = %i \0A Metodo de Pago = %i \0A Costo total del a\C3\B1o = %i.\0A Observaciones = %s \0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca [20 x i8]
%8 = alloca [150 x i8]
%9 = alloca [20 x i8]
%10 = alloca [50 x i8]
%11 = alloca [1024 x i8]
%12 = alloca i32
%13 = alloca [1024 x i8]
%14 = alloca [20 x i8]
%15 = alloca [50 x i8]
%16 = alloca [1024 x i8]
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32*
%20 = alloca i8*
%21 = alloca i32
%22 = alloca i32*
%23 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* null, i8** %6
store i8* null, i8** %20
%24 = call i32 @sqlite3_open(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32** %19)
store i32 %24, i32* %21
%25 = load i32, i32* %21
%26 = load i32, i32* @SQLITE_OK
%27 = icmp ne i32 %25, %26
br i1 %27, label %28, label %35
28: ; preds = %2
%29 = load i32, i32* @stderr
%30 = load i32*, i32** %19
%31 = call i8* @sqlite3_errmsg(i32* %30)
%32 = call i32 (i32, i8*, ...) @fprintf(i32 %29, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0), i8* %31)
%33 = load i32*, i32** %19
%34 = call i32 @sqlite3_close(i32* %33)
store i32 1, i32* %3
br label %283
35: ; preds = %2
br label %36
36: ; preds = %277, %35
%37 = call i32 (...) @Menu()
store i32 %37, i32* %12
%38 = load i32, i32* %12
switch i32 %38, label %276 [
i32 49, label %39
i32 50, label %88
i32 51, label %146
i32 52, label %167
i32 53, label %201
i32 56, label %240
]
39: ; preds = %36
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0))
%41 = getelementptr inbounds [20 x i8], [20 x i8]* %7, i64 0, i64 0
%42 = load i32, i32* @stdin
%43 = call i32 @fgets(i8* %41, i32 20, i32 %42)
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i64 0, i64 0))
%45 = getelementptr inbounds [150 x i8], [150 x i8]* %8, i64 0, i64 0
%46 = load i32, i32* @stdin
%47 = call i32 @fgets(i8* %45, i32 150, i32 %46)
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0))
%49 = getelementptr inbounds [20 x i8], [20 x i8]* %9, i64 0, i64 0
%50 = load i32, i32* @stdin
%51 = call i32 @fgets(i8* %49, i32 20, i32 %50)
%52 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%53 = call i32 @strcpy(i8* %52, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.5, i64 0, i64 0))
%54 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%55 = getelementptr inbounds [20 x i8], [20 x i8]* %7, i64 0, i64 0
%56 = call i32 @strncat(i8* %54, i8* %55, i32 1024)
%57 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%58 = call i32 @strncat(i8* %57, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 1024)
%59 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%60 = getelementptr inbounds [150 x i8], [150 x i8]* %8, i64 0, i64 0
%61 = call i32 @strncat(i8* %59, i8* %60, i32 1024)
%62 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%63 = call i32 @strncat(i8* %62, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 1024)
%64 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%65 = getelementptr inbounds [20 x i8], [20 x i8]* %9, i64 0, i64 0
%66 = call i32 @strncat(i8* %64, i8* %65, i32 1024)
%67 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%68 = call i32 @strncat(i8* %67, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i32 1024)
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%70 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%71 = call i32 (i8*, ...) @printf(i8* %70)
%72 = load i32*, i32** %19
%73 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%74 = call i32 @sqlite3_exec(i32* %72, i8* %73, i32* null, i32* null, i8** %20)
store i32 %74, i32* %21
%75 = load i32, i32* %21
%76 = load i32, i32* @SQLITE_OK
%77 = icmp ne i32 %75, %76
br i1 %77, label %78, label %86
78: ; preds = %39
%79 = load i32, i32* @stderr
%80 = load i8*, i8** %20
%81 = call i32 (i32, i8*, ...) @fprintf(i32 %79, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.9, i64 0, i64 0), i8* %80)
%82 = load i8*, i8** %20
%83 = call i32 @sqlite3_free(i8* %82)
%84 = load i32*, i32** %19
%85 = call i32 @sqlite3_close(i32* %84)
store i32 2, i32* %3
br label %283
86: ; preds = %39
%87 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
store i8 0, i8* %87
br label %276
88: ; preds = %36
%89 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.10, i64 0, i64 0))
%90 = getelementptr inbounds [20 x i8], [20 x i8]* %7, i64 0, i64 0
%91 = load i32, i32* @stdin
%92 = call i32 @fgets(i8* %90, i32 20, i32 %91)
%93 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.11, i64 0, i64 0))
%94 = getelementptr inbounds [20 x i8], [20 x i8]* %7, i64 0, i64 0
%95 = load i32, i32* @stdin
%96 = call i32 @fgets(i8* %94, i32 20, i32 %95)
%97 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i64 0, i64 0))
%98 = getelementptr inbounds [150 x i8], [150 x i8]* %8, i64 0, i64 0
%99 = load i32, i32* @stdin
%100 = call i32 @fgets(i8* %98, i32 150, i32 %99)
%101 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0))
%102 = getelementptr inbounds [20 x i8], [20 x i8]* %9, i64 0, i64 0
%103 = load i32, i32* @stdin
%104 = call i32 @fgets(i8* %102, i32 20, i32 %103)
%105 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%106 = call i32 @strcpy(i8* %105, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.12, i64 0, i64 0))
%107 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%108 = getelementptr inbounds [20 x i8], [20 x i8]* %7, i64 0, i64 0
%109 = call i32 @strncat(i8* %107, i8* %108, i32 1024)
%110 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%111 = call i32 @strncat(i8* %110, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.13, i64 0, i64 0), i32 1024)
%112 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%113 = getelementptr inbounds [150 x i8], [150 x i8]* %8, i64 0, i64 0
%114 = call i32 @strncat(i8* %112, i8* %113, i32 1024)
%115 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%116 = call i32 @strncat(i8* %115, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.14, i64 0, i64 0), i32 1024)
%117 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%118 = getelementptr inbounds [20 x i8], [20 x i8]* %9, i64 0, i64 0
%119 = call i32 @strncat(i8* %117, i8* %118, i32 1024)
%120 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%121 = call i32 @strncat(i8* %120, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.15, i64 0, i64 0), i32 1024)
%122 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%123 = getelementptr inbounds [20 x i8], [20 x i8]* %7, i64 0, i64 0
%124 = call i32 @strncat(i8* %122, i8* %123, i32 1024)
%125 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%126 = call i32 @strncat(i8* %125, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.16, i64 0, i64 0), i32 1024)
%127 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%128 = call i32 (i8*, ...) @printf(i8* %127)
%129 = call i32 (...) @getchar()
%130 = load i32*, i32** %19
%131 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%132 = call i32 @sqlite3_exec(i32* %130, i8* %131, i32* null, i32* null, i8** %20)
store i32 %132, i32* %21
%133 = load i32, i32* %21
%134 = load i32, i32* @SQLITE_OK
%135 = icmp ne i32 %133, %134
br i1 %135, label %136, label %144
136: ; preds = %88
%137 = load i32, i32* @stderr
%138 = load i8*, i8** %20
%139 = call i32 (i32, i8*, ...) @fprintf(i32 %137, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.9, i64 0, i64 0), i8* %138)
%140 = load i8*, i8** %20
%141 = call i32 @sqlite3_free(i8* %140)
%142 = load i32*, i32** %19
%143 = call i32 @sqlite3_close(i32* %142)
store i32 2, i32* %3
br label %283
144: ; preds = %88
%145 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
store i8 0, i8* %145
br label %276
146: ; preds = %36
%147 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.17, i64 0, i64 0))
%148 = getelementptr inbounds [20 x i8], [20 x i8]* %7, i64 0, i64 0
%149 = load i32, i32* @stdin
%150 = call i32 @fgets(i8* %148, i32 20, i32 %149)
%151 = bitcast [20 x i8]* %7 to i8**
%152 = call i32 (i8**, i8*, i8**, ...) @asprintf(i8** %6, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.18, i64 0, i64 0), i8** %151)
%153 = load i32*, i32** %19
%154 = load i8*, i8** %6
%155 = call i32 @sqlite3_exec(i32* %153, i8* %154, i32* null, i32* null, i8** %20)
store i32 %155, i32* %21
%156 = load i8*, i8** %20
%157 = icmp ne i8* %156, null
br i1 %157, label %158, label %163
158: ; preds = %146
%159 = load i8*, i8** %20
%160 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.19, i64 0, i64 0), i8* %159)
%161 = load i8*, i8** %20
%162 = call i32 @sqlite3_free(i8* %161)
br label %163
163: ; preds = %158, %146
%164 = call i32 (...) @getchar()
%165 = load i8*, i8** %6
%166 = call i32 @free(i8* %165)
br label %276
167: ; preds = %36
%168 = load i32*, i32** %19
%169 = call i32 @sqlite3_prepare(i32* %168, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.20, i64 0, i64 0), i32 -1, i32** %23, i32* null)
store i32 %169, i32* %21
%170 = load i32, i32* %21
%171 = load i32, i32* @SQLITE_OK
%172 = icmp ne i32 %170, %171
br i1 %172, label %173, label %180
173: ; preds = %167
%174 = load i32, i32* @stderr
%175 = load i32*, i32** %19
%176 = call i8* @sqlite3_errmsg(i32* %175)
%177 = call i32 (i32, i8*, ...) @fprintf(i32 %174, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.21, i64 0, i64 0), i8* %176)
%178 = load i32*, i32** %19
%179 = call i32 @sqlite3_close(i32* %178)
store i32 3, i32* %3
br label %283
180: ; preds = %167
br label %181
181: ; preds = %186, %180
%182 = load i32*, i32** %23
%183 = call i32 @sqlite3_step(i32* %182)
%184 = load i32, i32* @SQLITE_ROW
%185 = icmp eq i32 %183, %184
br i1 %185, label %186, label %200
186: ; preds = %181
%187 = load i32, i32* @stderr
%188 = load i32*, i32** %23
%189 = call i32 @sqlite3_column_int(i32* %188, i32 0)
%190 = load i32*, i32** %23
%191 = call i8* @sqlite3_column_text(i32* %190, i32 1)
%192 = load i32*, i32** %23
%193 = call i32 @sqlite3_column_int(i32* %192, i32 2)
%194 = load i32*, i32** %23
%195 = call i8* @sqlite3_column_text(i32* %194, i32 3)
%196 = load i32*, i32** %23
%197 = call i8* @sqlite3_column_text(i32* %196, i32 4)
%198 = call i32 (i32, i8*, ...) @fprintf(i32 %187, i8* getelementptr inbounds ([113 x i8], [113 x i8]* @.str.22, i64 0, i64 0), i32 %189, i8* %191, i32 %193, i8* %195, i8* %197)
%199 = call i32 (...) @getchar()
br label %181
200: ; preds = %181
br label %276
201: ; preds = %36
%202 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.23, i64 0, i64 0))
%203 = getelementptr inbounds [1024 x i8], [1024 x i8]* %13, i64 0, i64 0
%204 = load i32, i32* @stdin
%205 = call i32 @fgets(i8* %203, i32 1024, i32 %204)
%206 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.24, i64 0, i64 0))
%207 = getelementptr inbounds [20 x i8], [20 x i8]* %14, i64 0, i64 0
%208 = load i32, i32* @stdin
%209 = call i32 @fgets(i8* %207, i32 20, i32 %208)
%210 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str.25, i64 0, i64 0))
%211 = getelementptr inbounds [50 x i8], [50 x i8]* %15, i64 0, i64 0
%212 = load i32, i32* @stdin
%213 = call i32 @fgets(i8* %211, i32 50, i32 %212)
%214 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.26, i64 0, i64 0))
%215 = getelementptr inbounds [1024 x i8], [1024 x i8]* %16, i64 0, i64 0
%216 = load i32, i32* @stdin
%217 = call i32 @fgets(i8* %215, i32 1024, i32 %216)
%218 = getelementptr inbounds [20 x i8], [20 x i8]* %14, i64 0, i64 0
%219 = call i32 @atoi(i8* %218)
store i32 %219, i32* %17
%220 = getelementptr inbounds [50 x i8], [50 x i8]* %15, i64 0, i64 0
%221 = call i32 @atoi(i8* %220)
store i32 %221, i32* %18
%222 = bitcast [1024 x i8]* %13 to i8**
%223 = load i32, i32* %17
%224 = load i32, i32* %18
%225 = call i32 (i8**, i8*, i8**, ...) @asprintf(i8** %6, i8* getelementptr inbounds ([113 x i8], [113 x i8]* @.str.27, i64 0, i64 0), i8** %222, i32 %223, i32 %224, i32 25000, [1024 x i8]* %16)
%226 = load i32*, i32** %19
%227 = load i8*, i8** %6
%228 = call i32 @sqlite3_exec(i32* %226, i8* %227, i32* null, i32* null, i8** %20)
store i32 %228, i32* %21
%229 = load i8*, i8** %20
%230 = icmp ne i8* %229, null
br i1 %230, label %231, label %236
231: ; preds = %201
%232 = load i8*, i8** %20
%233 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.19, i64 0, i64 0), i8* %232)
%234 = load i8*, i8** %20
%235 = call i32 @sqlite3_free(i8* %234)
br label %236
236: ; preds = %231, %201
%237 = call i32 (...) @getchar()
%238 = load i8*, i8** %6
%239 = call i32 @free(i8* %238)
br label %276
240: ; preds = %36
%241 = load i32*, i32** %19
%242 = call i32 @sqlite3_prepare(i32* %241, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.28, i64 0, i64 0), i32 -1, i32** %23, i32* null)
store i32 %242, i32* %21
%243 = load i32, i32* %21
%244 = load i32, i32* @SQLITE_OK
%245 = icmp ne i32 %243, %244
br i1 %245, label %246, label %253
246: ; preds = %240
%247 = load i32, i32* @stderr
%248 = load i32*, i32** %19
%249 = call i8* @sqlite3_errmsg(i32* %248)
%250 = call i32 (i32, i8*, ...) @fprintf(i32 %247, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.21, i64 0, i64 0), i8* %249)
%251 = load i32*, i32** %19
%252 = call i32 @sqlite3_close(i32* %251)
store i32 3, i32* %3
br label %283
253: ; preds = %240
br label %254
254: ; preds = %259, %253
%255 = load i32*, i32** %23
%256 = call i32 @sqlite3_step(i32* %255)
%257 = load i32, i32* @SQLITE_ROW
%258 = icmp eq i32 %256, %257
br i1 %258, label %259, label %275
259: ; preds = %254
%260 = load i32, i32* @stderr
%261 = load i32*, i32** %23
%262 = call i32 @sqlite3_column_int(i32* %261, i32 0)
%263 = load i32*, i32** %23
%264 = call i8* @sqlite3_column_text(i32* %263, i32 1)
%265 = load i32*, i32** %23
%266 = call i32 @sqlite3_column_int(i32* %265, i32 2)
%267 = load i32*, i32** %23
%268 = call i32 @sqlite3_column_int(i32* %267, i32 3)
%269 = load i32*, i32** %23
%270 = call i32 @sqlite3_column_int(i32* %269, i32 4)
%271 = load i32*, i32** %23
%272 = call i8* @sqlite3_column_text(i32* %271, i32 5)
%273 = call i32 (i32, i8*, ...) @fprintf(i32 %260, i8* getelementptr inbounds ([155 x i8], [155 x i8]* @.str.29, i64 0, i64 0), i32 %262, i8* %264, i32 %266, i32 %268, i32 %270, i8* %272)
%274 = call i32 (...) @getchar()
br label %254
275: ; preds = %254
br label %276
276: ; preds = %36, %275, %236, %200, %163, %144, %86
br label %277
277: ; preds = %276
%278 = load i32, i32* %12
%279 = icmp ne i32 %278, 48
br i1 %279, label %36, label %280
280: ; preds = %277
%281 = load i32*, i32** %19
%282 = call i32 @sqlite3_close(i32* %281)
store i32 0, i32* %3
br label %283
283: ; preds = %280, %246, %173, %136, %78, %28
%284 = load i32, i32* %3
ret i32 %284
}

LLVM IR (-O2):
@.str = [15 x i8] c"universitas.db\00"
@SQLITE_OK = global i32 0
@stderr = global i32 0
@.str.1 = [45 x i8] c"No se puede acceder a la base de datos: %s.\0A\00"
@.str.2 = [43 x i8] c"Ingrese nombre de usuario para el acceso: \00"
@stdin = global i32 0
@.str.3 = [41 x i8] c"Ingrese correo electronico del usuario: \00"
@.str.4 = [27 x i8] c"Ingrese sede del usuario: \00"
@.str.5 = [59 x i8] c"INSERT INTO usuarios (userName, email, location) VALUES ('\00"
@.str.6 = [5 x i8] c"', '\00"
@.str.7 = [4 x i8] c"');\00"
@.str.9 = [40 x i8] c"Error al crear el primer registro: %s.\0A\00"
@.str.10 = [40 x i8] c"Ingrese nombre de usuario a modificar: \00"
@.str.11 = [36 x i8] c"Ingrese nombre de usuario deseado: \00"
@.str.12 = [33 x i8] c"UPDATE usuarios SET userName = '\00"
@.str.13 = [13 x i8] c"', email = '\00"
@.str.14 = [16 x i8] c"', location = '\00"
@.str.15 = [21 x i8] c"' WHERE userName = '\00"
@.str.16 = [3 x i8] c"';\00"
@.str.17 = [42 x i8] c"Ingrese nombre de usuario para eliminar: \00"
@.str.18 = [53 x i8] c"DELETE FROM usuarios WHERE username = '%s';\0A commit;\00"
@.str.19 = [27 x i8] c"Error in sqlite3_exec: %s\0A\00"
@.str.20 = [23 x i8] c"SELECT * FROM usuarios\00"
@.str.21 = [27 x i8] c"Error en la consulta: %s.\0A\00"
@SQLITE_ROW = global i32 0
@.str.22 = [113 x i8] c"Los usuarios actuales son: ============= ID = %i \0A UserName = %s \0A Privilegios = %i \0A Correo = %s \0A Sede = %s.\0A\00"
@.str.27 = [113 x i8] c"INSERT INTO alumnos(aluNme, aluDni, metodoPago, costoTotal, observaciones) VALUES ('%s', '%i', '%i', '%i', '%s')\00"
@.str.28 = [22 x i8] c"SELECT * FROM alumnos\00"
@.str.29 = [155 x i8] c"Los usuarios actuales son: ============= ID = %i \0A Nombre Alumno = %s \0A Dni = %i \0A Metodo de Pago = %i \0A Costo total del a\C3\B1o = %i.\0A Observaciones = %s \0A\00"
@str = [34 x i8] c"Ingrese nombre del nuevo alumno: \00"
@str.30 = [30 x i8] c"Ingrese numero de documento: \00"
@str.31 = [149 x i8] c"Ingrese plan de pago deseado: \0A 1 -- 6 cuotas sin interes \0A 2 -- 12 cuotas con interes del 10 porciento \0A 1 -- 1 pago con 35 porciento de descuento \00"
@str.32 = [57 x i8] c"Ingrese, de ser necesario, una observacion del usuario: \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i8*
%4 = alloca [20 x i8]
%5 = alloca [150 x i8]
%6 = alloca [20 x i8]
%7 = alloca [1024 x i8]
%8 = alloca [1024 x i8]
%9 = alloca [20 x i8]
%10 = alloca [50 x i8]
%11 = alloca [1024 x i8]
%12 = alloca i32*
%13 = alloca i8*
%14 = alloca i32*
%15 = bitcast i8** %3 to i8*
store i8* null, i8** %3
%16 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%17 = getelementptr inbounds [150 x i8], [150 x i8]* %5, i64 0, i64 0
%18 = getelementptr inbounds [20 x i8], [20 x i8]* %6, i64 0, i64 0
%19 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%20 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%21 = getelementptr inbounds [20 x i8], [20 x i8]* %9, i64 0, i64 0
%22 = getelementptr inbounds [50 x i8], [50 x i8]* %10, i64 0, i64 0
%23 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%24 = bitcast i32** %12 to i8*
%25 = bitcast i8** %13 to i8*
store i8* null, i8** %13
%26 = bitcast i32** %14 to i8*
%27 = call i32 @sqlite3_open(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32** %12)
%28 = load i32, i32* @SQLITE_OK
%29 = icmp eq i32 %27, %28
br i1 %29, label %30, label %33
30: ; preds = %2
%31 = bitcast [1024 x i8]* %8 to i8**
%32 = bitcast [20 x i8]* %4 to i8**
br label %38
33: ; preds = %2
%34 = load i32, i32* @stderr
%35 = load i32*, i32** %12
%36 = call i8* @sqlite3_errmsg(i32* %35)
%37 = call i32 (i32, i8*, ...) @fprintf(i32 %34, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0), i8* %36)
br label %223
38: ; preds = %185, %30
%39 = call i32 (...) @Menu()
switch i32 %39, label %185 [
i32 49, label %40
i32 50, label %70
i32 51, label %105
i32 52, label %123
i32 53, label %156
i32 56, label %186
i32 48, label %223
]
40: ; preds = %38
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0))
%42 = load i32, i32* @stdin
%43 = call i32 @fgets(i8* %16, i32 20, i32 %42)
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i64 0, i64 0))
%45 = load i32, i32* @stdin
%46 = call i32 @fgets(i8* %17, i32 150, i32 %45)
%47 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0))
%48 = load i32, i32* @stdin
%49 = call i32 @fgets(i8* %18, i32 20, i32 %48)
%50 = call i32 @strcpy(i8* %19, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.5, i64 0, i64 0))
%51 = call i32 @strncat(i8* %19, i8* %16, i32 1024)
%52 = call i32 @strncat(i8* %19, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 1024)
%53 = call i32 @strncat(i8* %19, i8* %17, i32 1024)
%54 = call i32 @strncat(i8* %19, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 1024)
%55 = call i32 @strncat(i8* %19, i8* %18, i32 1024)
%56 = call i32 @strncat(i8* %19, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i32 1024)
%57 = call i32 @putchar(i32 10)
%58 = call i32 (i8*, ...) @printf(i8* %19)
%59 = load i32*, i32** %12
%60 = call i32 @sqlite3_exec(i32* %59, i8* %19, i32* null, i32* null, i8** %13)
%61 = load i32, i32* @SQLITE_OK
%62 = icmp eq i32 %60, %61
br i1 %62, label %69, label %63
63: ; preds = %40
%64 = load i32, i32* @stderr
%65 = load i8*, i8** %13
%66 = call i32 (i32, i8*, ...) @fprintf(i32 %64, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.9, i64 0, i64 0), i8* %65)
%67 = load i8*, i8** %13
%68 = call i32 @sqlite3_free(i8* %67)
br label %223
69: ; preds = %40
store i8 0, i8* %19
br label %185
70: ; preds = %38
%71 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.10, i64 0, i64 0))
%72 = load i32, i32* @stdin
%73 = call i32 @fgets(i8* %16, i32 20, i32 %72)
%74 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.11, i64 0, i64 0))
%75 = load i32, i32* @stdin
%76 = call i32 @fgets(i8* %16, i32 20, i32 %75)
%77 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i64 0, i64 0))
%78 = load i32, i32* @stdin
%79 = call i32 @fgets(i8* %17, i32 150, i32 %78)
%80 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0))
%81 = load i32, i32* @stdin
%82 = call i32 @fgets(i8* %18, i32 20, i32 %81)
%83 = call i32 @strcpy(i8* %19, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.12, i64 0, i64 0))
%84 = call i32 @strncat(i8* %19, i8* %16, i32 1024)
%85 = call i32 @strncat(i8* %19, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.13, i64 0, i64 0), i32 1024)
%86 = call i32 @strncat(i8* %19, i8* %17, i32 1024)
%87 = call i32 @strncat(i8* %19, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.14, i64 0, i64 0), i32 1024)
%88 = call i32 @strncat(i8* %19, i8* %18, i32 1024)
%89 = call i32 @strncat(i8* %19, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.15, i64 0, i64 0), i32 1024)
%90 = call i32 @strncat(i8* %19, i8* %16, i32 1024)
%91 = call i32 @strncat(i8* %19, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.16, i64 0, i64 0), i32 1024)
%92 = call i32 (i8*, ...) @printf(i8* %19)
%93 = call i32 (...) @getchar()
%94 = load i32*, i32** %12
%95 = call i32 @sqlite3_exec(i32* %94, i8* %19, i32* null, i32* null, i8** %13)
%96 = load i32, i32* @SQLITE_OK
%97 = icmp eq i32 %95, %96
br i1 %97, label %104, label %98
98: ; preds = %70
%99 = load i32, i32* @stderr
%100 = load i8*, i8** %13
%101 = call i32 (i32, i8*, ...) @fprintf(i32 %99, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.9, i64 0, i64 0), i8* %100)
%102 = load i8*, i8** %13
%103 = call i32 @sqlite3_free(i8* %102)
br label %223
104: ; preds = %70
store i8 0, i8* %19
br label %185
105: ; preds = %38
%106 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.17, i64 0, i64 0))
%107 = load i32, i32* @stdin
%108 = call i32 @fgets(i8* %16, i32 20, i32 %107)
%109 = call i32 (i8**, i8*, i8**, ...) @asprintf(i8** %3, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.18, i64 0, i64 0), i8** %32)
%110 = load i32*, i32** %12
%111 = load i8*, i8** %3
%112 = call i32 @sqlite3_exec(i32* %110, i8* %111, i32* null, i32* null, i8** %13)
%113 = load i8*, i8** %13
%114 = icmp eq i8* %113, null
br i1 %114, label %119, label %115
115: ; preds = %105
%116 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.19, i64 0, i64 0), i8* %113)
%117 = load i8*, i8** %13
%118 = call i32 @sqlite3_free(i8* %117)
br label %119
119: ; preds = %115, %105
%120 = call i32 (...) @getchar()
%121 = load i8*, i8** %3
%122 = call i32 @free(i8* %121)
br label %185
123: ; preds = %38
%124 = load i32*, i32** %12
%125 = call i32 @sqlite3_prepare(i32* %124, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.20, i64 0, i64 0), i32 -1, i32** %14, i32* null)
%126 = load i32, i32* @SQLITE_OK
%127 = icmp eq i32 %125, %126
br i1 %127, label %128, label %133
128: ; preds = %123
%129 = load i32*, i32** %14
%130 = call i32 @sqlite3_step(i32* %129)
%131 = load i32, i32* @SQLITE_ROW
%132 = icmp eq i32 %130, %131
br i1 %132, label %138, label %185
133: ; preds = %123
%134 = load i32, i32* @stderr
%135 = load i32*, i32** %12
%136 = call i8* @sqlite3_errmsg(i32* %135)
%137 = call i32 (i32, i8*, ...) @fprintf(i32 %134, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.21, i64 0, i64 0), i8* %136)
br label %223
138: ; preds = %128, %138
%139 = load i32, i32* @stderr
%140 = load i32*, i32** %14
%141 = call i32 @sqlite3_column_int(i32* %140, i32 0)
%142 = load i32*, i32** %14
%143 = call i8* @sqlite3_column_text(i32* %142, i32 1)
%144 = load i32*, i32** %14
%145 = call i32 @sqlite3_column_int(i32* %144, i32 2)
%146 = load i32*, i32** %14
%147 = call i8* @sqlite3_column_text(i32* %146, i32 3)
%148 = load i32*, i32** %14
%149 = call i8* @sqlite3_column_text(i32* %148, i32 4)
%150 = call i32 (i32, i8*, ...) @fprintf(i32 %139, i8* getelementptr inbounds ([113 x i8], [113 x i8]* @.str.22, i64 0, i64 0), i32 %141, i8* %143, i32 %145, i8* %147, i8* %149)
%151 = call i32 (...) @getchar()
%152 = load i32*, i32** %14
%153 = call i32 @sqlite3_step(i32* %152)
%154 = load i32, i32* @SQLITE_ROW
%155 = icmp eq i32 %153, %154
br i1 %155, label %138, label %221
156: ; preds = %38
%157 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%158 = load i32, i32* @stdin
%159 = call i32 @fgets(i8* %20, i32 1024, i32 %158)
%160 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.30, i64 0, i64 0))
%161 = load i32, i32* @stdin
%162 = call i32 @fgets(i8* %21, i32 20, i32 %161)
%163 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([149 x i8], [149 x i8]* @str.31, i64 0, i64 0))
%164 = load i32, i32* @stdin
%165 = call i32 @fgets(i8* %22, i32 50, i32 %164)
%166 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str.32, i64 0, i64 0))
%167 = load i32, i32* @stdin
%168 = call i32 @fgets(i8* %23, i32 1024, i32 %167)
%169 = call i32 @atoi(i8* %21)
%170 = call i32 @atoi(i8* %22)
%171 = call i32 (i8**, i8*, i8**, ...) @asprintf(i8** %3, i8* getelementptr inbounds ([113 x i8], [113 x i8]* @.str.27, i64 0, i64 0), i8** %31, i32 %169, i32 %170, i32 25000, [1024 x i8]* %11)
%172 = load i32*, i32** %12
%173 = load i8*, i8** %3
%174 = call i32 @sqlite3_exec(i32* %172, i8* %173, i32* null, i32* null, i8** %13)
%175 = load i8*, i8** %13
%176 = icmp eq i8* %175, null
br i1 %176, label %181, label %177
177: ; preds = %156
%178 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.19, i64 0, i64 0), i8* %175)
%179 = load i8*, i8** %13
%180 = call i32 @sqlite3_free(i8* %179)
br label %181
181: ; preds = %177, %156
%182 = call i32 (...) @getchar()
%183 = load i8*, i8** %3
%184 = call i32 @free(i8* %183)
br label %185
185: ; preds = %181, %119, %104, %69, %128, %191, %221, %38
br label %38
186: ; preds = %38
%187 = load i32*, i32** %12
%188 = call i32 @sqlite3_prepare(i32* %187, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.28, i64 0, i64 0), i32 -1, i32** %14, i32* null)
%189 = load i32, i32* @SQLITE_OK
%190 = icmp eq i32 %188, %189
br i1 %190, label %191, label %196
191: ; preds = %186
%192 = load i32*, i32** %14
%193 = call i32 @sqlite3_step(i32* %192)
%194 = load i32, i32* @SQLITE_ROW
%195 = icmp eq i32 %193, %194
br i1 %195, label %201, label %185
196: ; preds = %186
%197 = load i32, i32* @stderr
%198 = load i32*, i32** %12
%199 = call i8* @sqlite3_errmsg(i32* %198)
%200 = call i32 (i32, i8*, ...) @fprintf(i32 %197, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.21, i64 0, i64 0), i8* %199)
br label %223
201: ; preds = %191, %201
%202 = load i32, i32* @stderr
%203 = load i32*, i32** %14
%204 = call i32 @sqlite3_column_int(i32* %203, i32 0)
%205 = load i32*, i32** %14
%206 = call i8* @sqlite3_column_text(i32* %205, i32 1)
%207 = load i32*, i32** %14
%208 = call i32 @sqlite3_column_int(i32* %207, i32 2)
%209 = load i32*, i32** %14
%210 = call i32 @sqlite3_column_int(i32* %209, i32 3)
%211 = load i32*, i32** %14
%212 = call i32 @sqlite3_column_int(i32* %211, i32 4)
%213 = load i32*, i32** %14
%214 = call i8* @sqlite3_column_text(i32* %213, i32 5)
%215 = call i32 (i32, i8*, ...) @fprintf(i32 %202, i8* getelementptr inbounds ([155 x i8], [155 x i8]* @.str.29, i64 0, i64 0), i32 %204, i8* %206, i32 %208, i32 %210, i32 %212, i8* %214)
%216 = call i32 (...) @getchar()
%217 = load i32*, i32** %14
%218 = call i32 @sqlite3_step(i32* %217)
%219 = load i32, i32* @SQLITE_ROW
%220 = icmp eq i32 %218, %219
br i1 %220, label %201, label %221
221: ; preds = %201, %138
%222 = icmp eq i32 %39, 48
br i1 %222, label %223, label %185
223: ; preds = %221, %38, %196, %133, %98, %63, %33
%224 = phi i32 [ 1, %33 ], [ 3, %196 ], [ 3, %133 ], [ 2, %98 ], [ 2, %63 ], [ 0, %38 ], [ 0, %221 ]
%225 = load i32*, i32** %12
%226 = call i32 @sqlite3_close(i32* %225)
ret i32 %224
}