#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 */

/* Variables and functions */
int /*<<< orphan*/ atoi(char *);
int create_trip(char *);
int /*<<< orphan*/ freopen(char *, char *, int /*<<< orphan*/);
scalar_t__ generate_gps_report(char *, int /*<<< orphan*/);
scalar_t__ generate_gsm_report(char *, int /*<<< orphan*/);
scalar_t__ generate_obd_report(char *, int /*<<< orphan*/);
scalar_t__ generate_wii_report(char *, int /*<<< orphan*/);
int log_gps(char *, char *, int /*<<< orphan*/);
int log_gsm(char *, char *, int /*<<< orphan*/);
int log_obd(char *, char *, int /*<<< orphan*/);
int log_wii(char *, char *, int /*<<< orphan*/);
scalar_t__ parse_gps(char *, int /*<<< orphan*/);
scalar_t__ parse_gsm(char *, int /*<<< orphan*/);
scalar_t__ parse_obd(char *, int /*<<< orphan*/);
scalar_t__ parse_wii(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stderr;
scalar_t__ strcmp(char *, char *);
scalar_t__ update_trip_data(char *, int /*<<< orphan*/);
scalar_t__ update_trip_report(char *, int /*<<< orphan*/);
int main(int argc, char **args) {
  freopen("/dev/null", "w", stderr);
  if (args[1] == NULL) {
    printf("No arguments given. Use: [create] database; [log] [gps | gsm | obd "
           "| wii] device database tripid; [parse] database tripid; [report] "
           "database tripid\n");
    return -1;
  } else if (strcmp(args[1], "create") == 0) {
    if (args[2] == NULL) {
      printf("Please enter a database\n");
      return -1;
    }
    int tripid = create_trip(args[2]);
    if (tripid > 0)
      return tripid;
    return 0;
  } else if (strcmp(args[1], "log") == 0) {
    if (args[2] == NULL) {
      printf("Please enter a sensor type\n");
      return -1;
    } else if (args[3] == NULL) {
      printf("Please enter a device name\n");
      return -1;
    } else if (args[4] == NULL) {
      printf("Please enter a database\n");
      return -1;
    } else if (args[5] == NULL) {
      printf("Please enter a trip id\n");
      return -1;
    }
    if (strcmp(args[2], "gsm") == 0)
      return log_gsm(args[3], args[4], atoi(args[5]));
    else if (strcmp(args[2], "gps") == 0)
      return log_gps(args[3], args[4], atoi(args[5]));
    else if (strcmp(args[2], "obd") == 0)
      return log_obd(args[3], args[4], atoi(args[5]));
    else if (strcmp(args[2], "wii") == 0)
      return log_wii(args[3], args[4], atoi(args[5]));
  } else if (strcmp(args[1], "parse") == 0) {
    if (args[2] == NULL) {
      printf("Please enter a database\n");
      return -1;
    } else if (args[3] == NULL) {
      printf("Please enter a trip id\n");
      return -1;
    }
    if (parse_gps(args[2], atoi(args[3])) < 0 ||
        parse_gsm(args[2], atoi(args[3])) < 0 ||
        parse_obd(args[2], atoi(args[3])) < 0 ||
        parse_wii(args[2], atoi(args[3])) < 0 ||
        update_trip_data(args[2], atoi(args[3])) < 0)
      return -1;
    return 0;
  } else if (strcmp(args[1], "report") == 0) {
    if (args[2] == NULL) {
      printf("Please enter a database\n");
      return -1;
    } else if (args[3] == NULL) {
      printf("Please enter a trip id\n");
      return -1;
    }
    if (generate_gps_report(args[2], atoi(args[3])) < 0 ||
        generate_gsm_report(args[2], atoi(args[3])) < 0 ||
        generate_obd_report(args[2], atoi(args[3])) < 0 ||
        generate_wii_report(args[2], atoi(args[3])) < 0 ||
        update_trip_report(args[2], atoi(args[3])) < 0)
      return -1;
    return 0;
  } else {
    printf("Wrong arguments given. Use: [create] database; [log] [gps | gsm | "
           "obd | wii] device database tripid; [parse] database tripid; "
           "[report] database tripid\n");
    return -1;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2d90(%rip),%rax
mov    (%rax),%edx
lea    0xda7(%rip),%rdi
lea    0xdaa(%rip),%rsi
call   10b0 <freopen@plt>
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x8(%rax)
jne    128c <main+0x5c>
lea    0xd91(%rip),%rdi
call   1090 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1865 <main+0x635>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe06(%rip),%rsi
call   10d0 <strcmp@plt>
cmp    $0x0,%rax
jne    1302 <main+0xd2>
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x10(%rax)
jne    12d1 <main+0xa1>
lea    0xde8(%rip),%rdi
call   1090 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1865 <main+0x635>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1070 <create_trip@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    12f6 <main+0xc6>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1865 <main+0x635>
movl   $0x0,-0x4(%rbp)
jmp    1865 <main+0x635>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdb0(%rip),%rsi
call   10d0 <strcmp@plt>
cmp    $0x0,%rax
jne    1547 <main+0x317>
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x10(%rax)
jne    1347 <main+0x117>
lea    0xd8f(%rip),%rdi
call   1090 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1865 <main+0x635>
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x18(%rax)
jne    136e <main+0x13e>
lea    0xd84(%rip),%rdi
call   1090 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1865 <main+0x635>
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x20(%rax)
jne    1395 <main+0x165>
lea    0xd24(%rip),%rdi
call   1090 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1865 <main+0x635>
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x28(%rax)
jne    13bc <main+0x18c>
lea    0xd52(%rip),%rdi
call   1090 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1865 <main+0x635>
jmp    13c1 <main+0x191>
jmp    13c6 <main+0x196>
jmp    13cb <main+0x19b>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xd3b(%rip),%rsi
call   10d0 <strcmp@plt>
cmp    $0x0,%rax
jne    1425 <main+0x1f5>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rdi
call   1110 <atoi@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
call   1080 <log_gsm@plt>
mov    %eax,-0x4(%rbp)
jmp    1865 <main+0x635>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xce5(%rip),%rsi
call   10d0 <strcmp@plt>
cmp    $0x0,%rax
jne    147f <main+0x24f>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rdi
call   1110 <atoi@plt>
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    %eax,%edx
call   10e0 <log_gps@plt>
mov    %eax,-0x4(%rbp)
jmp    1865 <main+0x635>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xc8f(%rip),%rsi
call   10d0 <strcmp@plt>
cmp    $0x0,%rax
jne    14d9 <main+0x2a9>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
mov    %rax,-0x48(%rbp)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rax
mov    %rax,-0x40(%rbp)
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rdi
call   1110 <atoi@plt>
mov    -0x48(%rbp),%rdi
mov    -0x40(%rbp),%rsi
mov    %eax,%edx
call   1040 <log_obd@plt>
mov    %eax,-0x4(%rbp)
jmp    1865 <main+0x635>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xc39(%rip),%rsi
call   10d0 <strcmp@plt>
cmp    $0x0,%rax
jne    1533 <main+0x303>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
mov    %rax,-0x58(%rbp)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rax
mov    %rax,-0x50(%rbp)
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rdi
call   1110 <atoi@plt>
mov    -0x58(%rbp),%rdi
mov    -0x50(%rbp),%rsi
mov    %eax,%edx
call   10c0 <log_wii@plt>
mov    %eax,-0x4(%rbp)
jmp    1865 <main+0x635>
jmp    1538 <main+0x308>
jmp    153d <main+0x30d>
jmp    1542 <main+0x312>
jmp    185b <main+0x62b>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xbcf(%rip),%rsi
call   10d0 <strcmp@plt>
cmp    $0x0,%rax
jne    16b6 <main+0x486>
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x10(%rax)
jne    158c <main+0x35c>
lea    0xb2d(%rip),%rdi
call   1090 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1865 <main+0x635>
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x18(%rax)
jne    15b3 <main+0x383>
lea    0xb5b(%rip),%rdi
call   1090 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1865 <main+0x635>
jmp    15b8 <main+0x388>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x60(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1110 <atoi@plt>
mov    -0x60(%rbp),%rdi
mov    %eax,%esi
call   10a0 <parse_gps@plt>
cmp    $0x0,%rax
jl     169e <main+0x46e>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x68(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1110 <atoi@plt>
mov    -0x68(%rbp),%rdi
mov    %eax,%esi
call   1140 <parse_gsm@plt>
cmp    $0x0,%rax
jl     169e <main+0x46e>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x70(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1110 <atoi@plt>
mov    -0x70(%rbp),%rdi
mov    %eax,%esi
call   1100 <parse_obd@plt>
cmp    $0x0,%rax
jl     169e <main+0x46e>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x78(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1110 <atoi@plt>
mov    -0x78(%rbp),%rdi
mov    %eax,%esi
call   1030 <parse_wii@plt>
cmp    $0x0,%rax
jl     169e <main+0x46e>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x80(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1110 <atoi@plt>
mov    -0x80(%rbp),%rdi
mov    %eax,%esi
call   1120 <update_trip_data@plt>
cmp    $0x0,%rax
jge    16aa <main+0x47a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1865 <main+0x635>
movl   $0x0,-0x4(%rbp)
jmp    1865 <main+0x635>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xa66(%rip),%rsi
call   10d0 <strcmp@plt>
cmp    $0x0,%rax
jne    1843 <main+0x613>
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x10(%rax)
jne    16fb <main+0x4cb>
lea    0x9be(%rip),%rdi
call   1090 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1865 <main+0x635>
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x18(%rax)
jne    1722 <main+0x4f2>
lea    0x9ec(%rip),%rdi
call   1090 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1865 <main+0x635>
jmp    1727 <main+0x4f7>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x88(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1110 <atoi@plt>
mov    -0x88(%rbp),%rdi
mov    %eax,%esi
call   1150 <generate_gps_report@plt>
cmp    $0x0,%rax
jl     182b <main+0x5fb>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x90(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1110 <atoi@plt>
mov    -0x90(%rbp),%rdi
mov    %eax,%esi
call   10f0 <generate_gsm_report@plt>
cmp    $0x0,%rax
jl     182b <main+0x5fb>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x98(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1110 <atoi@plt>
mov    -0x98(%rbp),%rdi
mov    %eax,%esi
call   1130 <generate_obd_report@plt>
cmp    $0x0,%rax
jl     182b <main+0x5fb>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0xa0(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1110 <atoi@plt>
mov    -0xa0(%rbp),%rdi
mov    %eax,%esi
call   1060 <generate_wii_report@plt>
cmp    $0x0,%rax
jl     182b <main+0x5fb>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0xa8(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1110 <atoi@plt>
mov    -0xa8(%rbp),%rdi
mov    %eax,%esi
call   1050 <update_trip_report@plt>
cmp    $0x0,%rax
jge    1837 <main+0x607>
movl   $0xffffffff,-0x4(%rbp)
jmp    1865 <main+0x635>
movl   $0x0,-0x4(%rbp)
jmp    1865 <main+0x635>
lea    0x8e8(%rip),%rdi
call   1090 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1865 <main+0x635>
jmp    1860 <main+0x630>
jmp    1865 <main+0x635>
mov    -0x4(%rbp),%eax
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    0x2da1(%rip),%rax
mov    (%rax),%edx
lea    0xdb8(%rip),%rdi
lea    0xdbb(%rip),%rsi
call   10b0 <freopen@plt>
mov    0x8(%rbx),%rdi
test   %rdi,%rdi
je     12c1 <main+0x91>
lea    0xda8(%rip),%rsi
call   10d0 <strcmp@plt>
test   %rax,%rax
je     12cd <main+0x9d>
mov    0x8(%rbx),%rdi
lea    0xd9a(%rip),%rsi
call   10d0 <strcmp@plt>
test   %rax,%rax
je     12ed <main+0xbd>
mov    0x8(%rbx),%rdi
lea    0xd99(%rip),%rsi
call   10d0 <strcmp@plt>
test   %rax,%rax
je     13a1 <main+0x171>
mov    0x8(%rbx),%rdi
lea    0xd86(%rip),%rsi
call   10d0 <strcmp@plt>
test   %rax,%rax
je     1455 <main+0x225>
lea    0xd78(%rip),%rdi
jmp    1527 <main+0x2f7>
lea    0xe68(%rip),%rdi
jmp    1527 <main+0x2f7>
mov    0x10(%rbx),%rdi
test   %rdi,%rdi
je     1505 <main+0x2d5>
call   1080 <create_trip@plt>
xor    %r14d,%r14d
test   %eax,%eax
cmovns %eax,%r14d
jmp    1532 <main+0x302>
mov    0x10(%rbx),%rdi
test   %rdi,%rdi
je     150e <main+0x2de>
cmpq   $0x0,0x18(%rbx)
je     1520 <main+0x2f0>
cmpq   $0x0,0x20(%rbx)
je     1505 <main+0x2d5>
cmpq   $0x0,0x28(%rbx)
je     1517 <main+0x2e7>
lea    0xcf5(%rip),%rsi
call   10d0 <strcmp@plt>
test   %rax,%rax
je     153b <main+0x30b>
mov    0x10(%rbx),%rdi
lea    0xce0(%rip),%rsi
call   10d0 <strcmp@plt>
test   %rax,%rax
je     155e <main+0x32e>
mov    0x10(%rbx),%rdi
lea    0xccb(%rip),%rsi
call   10d0 <strcmp@plt>
test   %rax,%rax
je     1581 <main+0x351>
mov    0x10(%rbx),%rdi
lea    0xcb6(%rip),%rsi
call   10d0 <strcmp@plt>
xor    %r14d,%r14d
test   %rax,%rax
jne    1532 <main+0x302>
mov    0x18(%rbx),%r14
mov    0x20(%rbx),%r15
mov    0x28(%rbx),%rdi
call   1110 <atoi@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %eax,%edx
pop    %rbx
pop    %r14
pop    %r15
jmp    10c0 <log_wii@plt>
mov    0x10(%rbx),%r14
test   %r14,%r14
je     1505 <main+0x2d5>
mov    0x18(%rbx),%rdi
test   %rdi,%rdi
je     1517 <main+0x2e7>
call   1110 <atoi@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   10a0 <parse_gps@plt>
mov    $0xffffffff,%r14d
test   %rax,%rax
js     1532 <main+0x302>
mov    0x10(%rbx),%r15
mov    0x18(%rbx),%rdi
call   1110 <atoi@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   1140 <parse_gsm@plt>
test   %rax,%rax
js     1532 <main+0x302>
mov    0x10(%rbx),%r15
mov    0x18(%rbx),%rdi
call   1110 <atoi@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   1100 <parse_obd@plt>
test   %rax,%rax
js     1532 <main+0x302>
mov    0x10(%rbx),%r15
mov    0x18(%rbx),%rdi
call   1110 <atoi@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   1030 <parse_wii@plt>
test   %rax,%rax
js     1532 <main+0x302>
mov    0x10(%rbx),%r14
mov    0x18(%rbx),%rdi
call   1110 <atoi@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1120 <update_trip_data@plt>
jmp    14fc <main+0x2cc>
mov    0x10(%rbx),%r14
test   %r14,%r14
je     1505 <main+0x2d5>
mov    0x18(%rbx),%rdi
test   %rdi,%rdi
je     1517 <main+0x2e7>
call   1110 <atoi@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1150 <generate_gps_report@plt>
mov    $0xffffffff,%r14d
test   %rax,%rax
js     1532 <main+0x302>
mov    0x10(%rbx),%r15
mov    0x18(%rbx),%rdi
call   1110 <atoi@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   10f0 <generate_gsm_report@plt>
test   %rax,%rax
js     1532 <main+0x302>
mov    0x10(%rbx),%r15
mov    0x18(%rbx),%rdi
call   1110 <atoi@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   1130 <generate_obd_report@plt>
test   %rax,%rax
js     1532 <main+0x302>
mov    0x10(%rbx),%r15
mov    0x18(%rbx),%rdi
call   1110 <atoi@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   1070 <generate_wii_report@plt>
test   %rax,%rax
js     1532 <main+0x302>
mov    0x10(%rbx),%r14
mov    0x18(%rbx),%rdi
call   1110 <atoi@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1050 <update_trip_report@plt>
mov    %rax,%r14
sar    $0x3f,%r14
jmp    1532 <main+0x302>
lea    0xc0c(%rip),%rdi
jmp    1527 <main+0x2f7>
lea    0xbe8(%rip),%rdi
jmp    1527 <main+0x2f7>
lea    0xbad(%rip),%rdi
jmp    1527 <main+0x2f7>
lea    0xbbb(%rip),%rdi
call   1060 <puts@plt>
mov    $0xffffffff,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %r15
ret
mov    0x18(%rbx),%r14
mov    0x20(%rbx),%r15
mov    0x28(%rbx),%rdi
call   1110 <atoi@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %eax,%edx
pop    %rbx
pop    %r14
pop    %r15
jmp    1090 <log_gsm@plt>
mov    0x18(%rbx),%r14
mov    0x20(%rbx),%r15
mov    0x28(%rbx),%rdi
call   1110 <atoi@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %eax,%edx
pop    %rbx
pop    %r14
pop    %r15
jmp    10e0 <log_gps@plt>
mov    0x18(%rbx),%r14
mov    0x20(%rbx),%r15
mov    0x28(%rbx),%rdi
call   1110 <atoi@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %eax,%edx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <log_obd@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"/dev/null\00"
@.str.1 = [2 x i8] c"w\00"
@stderr = global i32 0
@.str.2 = [149 x i8] c"No arguments given. Use: [create] database; [log] [gps | gsm | obd | wii] device database tripid; [parse] database tripid; [report] database tripid\0A\00"
@.str.3 = [7 x i8] c"create\00"
@.str.4 = [25 x i8] c"Please enter a database\0A\00"
@.str.5 = [4 x i8] c"log\00"
@.str.6 = [28 x i8] c"Please enter a sensor type\0A\00"
@.str.7 = [28 x i8] c"Please enter a device name\0A\00"
@.str.8 = [24 x i8] c"Please enter a trip id\0A\00"
@.str.9 = [4 x i8] c"gsm\00"
@.str.10 = [4 x i8] c"gps\00"
@.str.11 = [4 x i8] c"obd\00"
@.str.12 = [4 x i8] c"wii\00"
@.str.13 = [6 x i8] c"parse\00"
@.str.14 = [7 x i8] c"report\00"
@.str.15 = [152 x i8] c"Wrong arguments given. Use: [create] database; [log] [gps | gsm | obd | wii] device database tripid; [parse] database tripid; [report] database tripid\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* @stderr
%8 = call i32 @freopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = call i32 @printf(i8* getelementptr inbounds ([149 x i8], [149 x i8]* @.str.2, i64 0, i64 0))
store i32 -1, i32* %3
br label %301
15: ; preds = %2
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 1
%18 = load i8*, i8** %17
%19 = call i64 @strcmp(i8* %18, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %38
21: ; preds = %15
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 2
%24 = load i8*, i8** %23
%25 = icmp eq i8* %24, null
br i1 %25, label %26, label %28
26: ; preds = %21
%27 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0))
store i32 -1, i32* %3
br label %301
28: ; preds = %21
%29 = load i8**, i8*** %5
%30 = getelementptr inbounds i8*, i8** %29, i64 2
%31 = load i8*, i8** %30
%32 = call i32 @create_trip(i8* %31)
store i32 %32, i32* %6
%33 = load i32, i32* %6
%34 = icmp sgt i32 %33, 0
br i1 %34, label %35, label %37
35: ; preds = %28
%36 = load i32, i32* %6
store i32 %36, i32* %3
br label %301
37: ; preds = %28
store i32 0, i32* %3
br label %301
38: ; preds = %15
%39 = load i8**, i8*** %5
%40 = getelementptr inbounds i8*, i8** %39, i64 1
%41 = load i8*, i8** %40
%42 = call i64 @strcmp(i8* %41, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%43 = icmp eq i64 %42, 0
br i1 %43, label %44, label %151
44: ; preds = %38
%45 = load i8**, i8*** %5
%46 = getelementptr inbounds i8*, i8** %45, i64 2
%47 = load i8*, i8** %46
%48 = icmp eq i8* %47, null
br i1 %48, label %49, label %51
49: ; preds = %44
%50 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.6, i64 0, i64 0))
store i32 -1, i32* %3
br label %301
51: ; preds = %44
%52 = load i8**, i8*** %5
%53 = getelementptr inbounds i8*, i8** %52, i64 3
%54 = load i8*, i8** %53
%55 = icmp eq i8* %54, null
br i1 %55, label %56, label %58
56: ; preds = %51
%57 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.7, i64 0, i64 0))
store i32 -1, i32* %3
br label %301
58: ; preds = %51
%59 = load i8**, i8*** %5
%60 = getelementptr inbounds i8*, i8** %59, i64 4
%61 = load i8*, i8** %60
%62 = icmp eq i8* %61, null
br i1 %62, label %63, label %65
63: ; preds = %58
%64 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0))
store i32 -1, i32* %3
br label %301
65: ; preds = %58
%66 = load i8**, i8*** %5
%67 = getelementptr inbounds i8*, i8** %66, i64 5
%68 = load i8*, i8** %67
%69 = icmp eq i8* %68, null
br i1 %69, label %70, label %72
70: ; preds = %65
%71 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.8, i64 0, i64 0))
store i32 -1, i32* %3
br label %301
72: ; preds = %65
br label %73
73: ; preds = %72
br label %74
74: ; preds = %73
br label %75
75: ; preds = %74
%76 = load i8**, i8*** %5
%77 = getelementptr inbounds i8*, i8** %76, i64 2
%78 = load i8*, i8** %77
%79 = call i64 @strcmp(i8* %78, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%80 = icmp eq i64 %79, 0
br i1 %80, label %81, label %93
81: ; preds = %75
%82 = load i8**, i8*** %5
%83 = getelementptr inbounds i8*, i8** %82, i64 3
%84 = load i8*, i8** %83
%85 = load i8**, i8*** %5
%86 = getelementptr inbounds i8*, i8** %85, i64 4
%87 = load i8*, i8** %86
%88 = load i8**, i8*** %5
%89 = getelementptr inbounds i8*, i8** %88, i64 5
%90 = load i8*, i8** %89
%91 = call i32 @atoi(i8* %90)
%92 = call i32 @log_gsm(i8* %84, i8* %87, i32 %91)
store i32 %92, i32* %3
br label %301
93: ; preds = %75
%94 = load i8**, i8*** %5
%95 = getelementptr inbounds i8*, i8** %94, i64 2
%96 = load i8*, i8** %95
%97 = call i64 @strcmp(i8* %96, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0))
%98 = icmp eq i64 %97, 0
br i1 %98, label %99, label %111
99: ; preds = %93
%100 = load i8**, i8*** %5
%101 = getelementptr inbounds i8*, i8** %100, i64 3
%102 = load i8*, i8** %101
%103 = load i8**, i8*** %5
%104 = getelementptr inbounds i8*, i8** %103, i64 4
%105 = load i8*, i8** %104
%106 = load i8**, i8*** %5
%107 = getelementptr inbounds i8*, i8** %106, i64 5
%108 = load i8*, i8** %107
%109 = call i32 @atoi(i8* %108)
%110 = call i32 @log_gps(i8* %102, i8* %105, i32 %109)
store i32 %110, i32* %3
br label %301
111: ; preds = %93
%112 = load i8**, i8*** %5
%113 = getelementptr inbounds i8*, i8** %112, i64 2
%114 = load i8*, i8** %113
%115 = call i64 @strcmp(i8* %114, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0))
%116 = icmp eq i64 %115, 0
br i1 %116, label %117, label %129
117: ; preds = %111
%118 = load i8**, i8*** %5
%119 = getelementptr inbounds i8*, i8** %118, i64 3
%120 = load i8*, i8** %119
%121 = load i8**, i8*** %5
%122 = getelementptr inbounds i8*, i8** %121, i64 4
%123 = load i8*, i8** %122
%124 = load i8**, i8*** %5
%125 = getelementptr inbounds i8*, i8** %124, i64 5
%126 = load i8*, i8** %125
%127 = call i32 @atoi(i8* %126)
%128 = call i32 @log_obd(i8* %120, i8* %123, i32 %127)
store i32 %128, i32* %3
br label %301
129: ; preds = %111
%130 = load i8**, i8*** %5
%131 = getelementptr inbounds i8*, i8** %130, i64 2
%132 = load i8*, i8** %131
%133 = call i64 @strcmp(i8* %132, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0))
%134 = icmp eq i64 %133, 0
br i1 %134, label %135, label %147
135: ; preds = %129
%136 = load i8**, i8*** %5
%137 = getelementptr inbounds i8*, i8** %136, i64 3
%138 = load i8*, i8** %137
%139 = load i8**, i8*** %5
%140 = getelementptr inbounds i8*, i8** %139, i64 4
%141 = load i8*, i8** %140
%142 = load i8**, i8*** %5
%143 = getelementptr inbounds i8*, i8** %142, i64 5
%144 = load i8*, i8** %143
%145 = call i32 @atoi(i8* %144)
%146 = call i32 @log_wii(i8* %138, i8* %141, i32 %145)
store i32 %146, i32* %3
br label %301
147: ; preds = %129
br label %148
148: ; preds = %147
br label %149
149: ; preds = %148
br label %150
150: ; preds = %149
br label %299
151: ; preds = %38
%152 = load i8**, i8*** %5
%153 = getelementptr inbounds i8*, i8** %152, i64 1
%154 = load i8*, i8** %153
%155 = call i64 @strcmp(i8* %154, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i64 0, i64 0))
%156 = icmp eq i64 %155, 0
br i1 %156, label %157, label %224
157: ; preds = %151
%158 = load i8**, i8*** %5
%159 = getelementptr inbounds i8*, i8** %158, i64 2
%160 = load i8*, i8** %159
%161 = icmp eq i8* %160, null
br i1 %161, label %162, label %164
162: ; preds = %157
%163 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0))
store i32 -1, i32* %3
br label %301
164: ; preds = %157
%165 = load i8**, i8*** %5
%166 = getelementptr inbounds i8*, i8** %165, i64 3
%167 = load i8*, i8** %166
%168 = icmp eq i8* %167, null
br i1 %168, label %169, label %171
169: ; preds = %164
%170 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.8, i64 0, i64 0))
store i32 -1, i32* %3
br label %301
171: ; preds = %164
br label %172
172: ; preds = %171
%173 = load i8**, i8*** %5
%174 = getelementptr inbounds i8*, i8** %173, i64 2
%175 = load i8*, i8** %174
%176 = load i8**, i8*** %5
%177 = getelementptr inbounds i8*, i8** %176, i64 3
%178 = load i8*, i8** %177
%179 = call i32 @atoi(i8* %178)
%180 = call i64 @parse_gps(i8* %175, i32 %179)
%181 = icmp slt i64 %180, 0
br i1 %181, label %222, label %182
182: ; preds = %172
%183 = load i8**, i8*** %5
%184 = getelementptr inbounds i8*, i8** %183, i64 2
%185 = load i8*, i8** %184
%186 = load i8**, i8*** %5
%187 = getelementptr inbounds i8*, i8** %186, i64 3
%188 = load i8*, i8** %187
%189 = call i32 @atoi(i8* %188)
%190 = call i64 @parse_gsm(i8* %185, i32 %189)
%191 = icmp slt i64 %190, 0
br i1 %191, label %222, label %192
192: ; preds = %182
%193 = load i8**, i8*** %5
%194 = getelementptr inbounds i8*, i8** %193, i64 2
%195 = load i8*, i8** %194
%196 = load i8**, i8*** %5
%197 = getelementptr inbounds i8*, i8** %196, i64 3
%198 = load i8*, i8** %197
%199 = call i32 @atoi(i8* %198)
%200 = call i64 @parse_obd(i8* %195, i32 %199)
%201 = icmp slt i64 %200, 0
br i1 %201, label %222, label %202
202: ; preds = %192
%203 = load i8**, i8*** %5
%204 = getelementptr inbounds i8*, i8** %203, i64 2
%205 = load i8*, i8** %204
%206 = load i8**, i8*** %5
%207 = getelementptr inbounds i8*, i8** %206, i64 3
%208 = load i8*, i8** %207
%209 = call i32 @atoi(i8* %208)
%210 = call i64 @parse_wii(i8* %205, i32 %209)
%211 = icmp slt i64 %210, 0
br i1 %211, label %222, label %212
212: ; preds = %202
%213 = load i8**, i8*** %5
%214 = getelementptr inbounds i8*, i8** %213, i64 2
%215 = load i8*, i8** %214
%216 = load i8**, i8*** %5
%217 = getelementptr inbounds i8*, i8** %216, i64 3
%218 = load i8*, i8** %217
%219 = call i32 @atoi(i8* %218)
%220 = call i64 @update_trip_data(i8* %215, i32 %219)
%221 = icmp slt i64 %220, 0
br i1 %221, label %222, label %223
222: ; preds = %212, %202, %192, %182, %172
store i32 -1, i32* %3
br label %301
223: ; preds = %212
store i32 0, i32* %3
br label %301
224: ; preds = %151
%225 = load i8**, i8*** %5
%226 = getelementptr inbounds i8*, i8** %225, i64 1
%227 = load i8*, i8** %226
%228 = call i64 @strcmp(i8* %227, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.14, i64 0, i64 0))
%229 = icmp eq i64 %228, 0
br i1 %229, label %230, label %297
230: ; preds = %224
%231 = load i8**, i8*** %5
%232 = getelementptr inbounds i8*, i8** %231, i64 2
%233 = load i8*, i8** %232
%234 = icmp eq i8* %233, null
br i1 %234, label %235, label %237
235: ; preds = %230
%236 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0))
store i32 -1, i32* %3
br label %301
237: ; preds = %230
%238 = load i8**, i8*** %5
%239 = getelementptr inbounds i8*, i8** %238, i64 3
%240 = load i8*, i8** %239
%241 = icmp eq i8* %240, null
br i1 %241, label %242, label %244
242: ; preds = %237
%243 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.8, i64 0, i64 0))
store i32 -1, i32* %3
br label %301
244: ; preds = %237
br label %245
245: ; preds = %244
%246 = load i8**, i8*** %5
%247 = getelementptr inbounds i8*, i8** %246, i64 2
%248 = load i8*, i8** %247
%249 = load i8**, i8*** %5
%250 = getelementptr inbounds i8*, i8** %249, i64 3
%251 = load i8*, i8** %250
%252 = call i32 @atoi(i8* %251)
%253 = call i64 @generate_gps_report(i8* %248, i32 %252)
%254 = icmp slt i64 %253, 0
br i1 %254, label %295, label %255
255: ; preds = %245
%256 = load i8**, i8*** %5
%257 = getelementptr inbounds i8*, i8** %256, i64 2
%258 = load i8*, i8** %257
%259 = load i8**, i8*** %5
%260 = getelementptr inbounds i8*, i8** %259, i64 3
%261 = load i8*, i8** %260
%262 = call i32 @atoi(i8* %261)
%263 = call i64 @generate_gsm_report(i8* %258, i32 %262)
%264 = icmp slt i64 %263, 0
br i1 %264, label %295, label %265
265: ; preds = %255
%266 = load i8**, i8*** %5
%267 = getelementptr inbounds i8*, i8** %266, i64 2
%268 = load i8*, i8** %267
%269 = load i8**, i8*** %5
%270 = getelementptr inbounds i8*, i8** %269, i64 3
%271 = load i8*, i8** %270
%272 = call i32 @atoi(i8* %271)
%273 = call i64 @generate_obd_report(i8* %268, i32 %272)
%274 = icmp slt i64 %273, 0
br i1 %274, label %295, label %275
275: ; preds = %265
%276 = load i8**, i8*** %5
%277 = getelementptr inbounds i8*, i8** %276, i64 2
%278 = load i8*, i8** %277
%279 = load i8**, i8*** %5
%280 = getelementptr inbounds i8*, i8** %279, i64 3
%281 = load i8*, i8** %280
%282 = call i32 @atoi(i8* %281)
%283 = call i64 @generate_wii_report(i8* %278, i32 %282)
%284 = icmp slt i64 %283, 0
br i1 %284, label %295, label %285
285: ; preds = %275
%286 = load i8**, i8*** %5
%287 = getelementptr inbounds i8*, i8** %286, i64 2
%288 = load i8*, i8** %287
%289 = load i8**, i8*** %5
%290 = getelementptr inbounds i8*, i8** %289, i64 3
%291 = load i8*, i8** %290
%292 = call i32 @atoi(i8* %291)
%293 = call i64 @update_trip_report(i8* %288, i32 %292)
%294 = icmp slt i64 %293, 0
br i1 %294, label %295, label %296
295: ; preds = %285, %275, %265, %255, %245
store i32 -1, i32* %3
br label %301
296: ; preds = %285
store i32 0, i32* %3
br label %301
297: ; preds = %224
%298 = call i32 @printf(i8* getelementptr inbounds ([152 x i8], [152 x i8]* @.str.15, i64 0, i64 0))
store i32 -1, i32* %3
br label %301
299: ; preds = %150
br label %300
300: ; preds = %299
br label %301
301: ; preds = %13, %26, %35, %37, %49, %56, %63, %70, %81, %99, %117, %135, %162, %169, %222, %223, %235, %242, %295, %296, %297, %300
%302 = load i32, i32* %3
ret i32 %302
}

LLVM IR (-O2):
@.str = [10 x i8] c"/dev/null\00"
@.str.1 = [2 x i8] c"w\00"
@stderr = global i32 0
@.str.3 = [7 x i8] c"create\00"
@.str.5 = [4 x i8] c"log\00"
@.str.9 = [4 x i8] c"gsm\00"
@.str.10 = [4 x i8] c"gps\00"
@.str.11 = [4 x i8] c"obd\00"
@.str.12 = [4 x i8] c"wii\00"
@.str.13 = [6 x i8] c"parse\00"
@.str.14 = [7 x i8] c"report\00"
@str = [151 x i8] c"Wrong arguments given. Use: [create] database; [log] [gps | gsm | obd | wii] device database tripid; [parse] database tripid; [report] database tripid\00"
@str.20 = [23 x i8] c"Please enter a trip id\00"
@str.22 = [27 x i8] c"Please enter a device name\00"
@str.23 = [27 x i8] c"Please enter a sensor type\00"
@str.24 = [24 x i8] c"Please enter a database\00"
@str.25 = [148 x i8] c"No arguments given. Use: [create] database; [log] [gps | gsm | obd | wii] device database tripid; [parse] database tripid; [report] database tripid\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @freopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([148 x i8], [148 x i8]* @str.25, i64 0, i64 0))
br label %182
10: ; preds = %2
%11 = tail call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %23
13: ; preds = %10
%14 = getelementptr inbounds i8*, i8** %1, i64 2
%15 = load i8*, i8** %14
%16 = icmp eq i8* %15, null
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.24, i64 0, i64 0))
br label %182
19: ; preds = %13
%20 = tail call i32 @create_trip(i8* %15)
%21 = icmp sgt i32 %20, 0
%22 = select i1 %21, i32 %20, i32 0
br label %182
23: ; preds = %10
%24 = load i8*, i8** %5
%25 = tail call i64 @strcmp(i8* %24, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%26 = icmp eq i64 %25, 0
br i1 %26, label %27, label %90
27: ; preds = %23
%28 = getelementptr inbounds i8*, i8** %1, i64 2
%29 = load i8*, i8** %28
%30 = icmp eq i8* %29, null
br i1 %30, label %31, label %33
31: ; preds = %27
%32 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.23, i64 0, i64 0))
br label %182
33: ; preds = %27
%34 = getelementptr inbounds i8*, i8** %1, i64 3
%35 = load i8*, i8** %34
%36 = icmp eq i8* %35, null
br i1 %36, label %37, label %39
37: ; preds = %33
%38 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.22, i64 0, i64 0))
br label %182
39: ; preds = %33
%40 = getelementptr inbounds i8*, i8** %1, i64 4
%41 = load i8*, i8** %40
%42 = icmp eq i8* %41, null
br i1 %42, label %43, label %45
43: ; preds = %39
%44 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.24, i64 0, i64 0))
br label %182
45: ; preds = %39
%46 = getelementptr inbounds i8*, i8** %1, i64 5
%47 = load i8*, i8** %46
%48 = icmp eq i8* %47, null
br i1 %48, label %49, label %51
49: ; preds = %45
%50 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.20, i64 0, i64 0))
br label %182
51: ; preds = %45
%52 = tail call i64 @strcmp(i8* %29, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%53 = icmp eq i64 %52, 0
br i1 %53, label %54, label %60
54: ; preds = %51
%55 = load i8*, i8** %34
%56 = load i8*, i8** %40
%57 = load i8*, i8** %46
%58 = tail call i32 @atoi(i8* %57)
%59 = tail call i32 @log_gsm(i8* %55, i8* %56, i32 %58)
br label %182
60: ; preds = %51
%61 = load i8*, i8** %28
%62 = tail call i64 @strcmp(i8* %61, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0))
%63 = icmp eq i64 %62, 0
br i1 %63, label %64, label %70
64: ; preds = %60
%65 = load i8*, i8** %34
%66 = load i8*, i8** %40
%67 = load i8*, i8** %46
%68 = tail call i32 @atoi(i8* %67)
%69 = tail call i32 @log_gps(i8* %65, i8* %66, i32 %68)
br label %182
70: ; preds = %60
%71 = load i8*, i8** %28
%72 = tail call i64 @strcmp(i8* %71, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0))
%73 = icmp eq i64 %72, 0
br i1 %73, label %74, label %80
74: ; preds = %70
%75 = load i8*, i8** %34
%76 = load i8*, i8** %40
%77 = load i8*, i8** %46
%78 = tail call i32 @atoi(i8* %77)
%79 = tail call i32 @log_obd(i8* %75, i8* %76, i32 %78)
br label %182
80: ; preds = %70
%81 = load i8*, i8** %28
%82 = tail call i64 @strcmp(i8* %81, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0))
%83 = icmp eq i64 %82, 0
br i1 %83, label %84, label %182
84: ; preds = %80
%85 = load i8*, i8** %34
%86 = load i8*, i8** %40
%87 = load i8*, i8** %46
%88 = tail call i32 @atoi(i8* %87)
%89 = tail call i32 @log_wii(i8* %85, i8* %86, i32 %88)
br label %182
90: ; preds = %23
%91 = load i8*, i8** %5
%92 = tail call i64 @strcmp(i8* %91, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i64 0, i64 0))
%93 = icmp eq i64 %92, 0
br i1 %93, label %94, label %135
94: ; preds = %90
%95 = getelementptr inbounds i8*, i8** %1, i64 2
%96 = load i8*, i8** %95
%97 = icmp eq i8* %96, null
br i1 %97, label %98, label %100
98: ; preds = %94
%99 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.24, i64 0, i64 0))
br label %182
100: ; preds = %94
%101 = getelementptr inbounds i8*, i8** %1, i64 3
%102 = load i8*, i8** %101
%103 = icmp eq i8* %102, null
br i1 %103, label %104, label %106
104: ; preds = %100
%105 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.20, i64 0, i64 0))
br label %182
106: ; preds = %100
%107 = tail call i32 @atoi(i8* %102)
%108 = tail call i64 @parse_gps(i8* %96, i32 %107)
%109 = icmp slt i64 %108, 0
br i1 %109, label %182, label %110
110: ; preds = %106
%111 = load i8*, i8** %95
%112 = load i8*, i8** %101
%113 = tail call i32 @atoi(i8* %112)
%114 = tail call i64 @parse_gsm(i8* %111, i32 %113)
%115 = icmp slt i64 %114, 0
br i1 %115, label %182, label %116
116: ; preds = %110
%117 = load i8*, i8** %95
%118 = load i8*, i8** %101
%119 = tail call i32 @atoi(i8* %118)
%120 = tail call i64 @parse_obd(i8* %117, i32 %119)
%121 = icmp slt i64 %120, 0
br i1 %121, label %182, label %122
122: ; preds = %116
%123 = load i8*, i8** %95
%124 = load i8*, i8** %101
%125 = tail call i32 @atoi(i8* %124)
%126 = tail call i64 @parse_wii(i8* %123, i32 %125)
%127 = icmp slt i64 %126, 0
br i1 %127, label %182, label %128
128: ; preds = %122
%129 = load i8*, i8** %95
%130 = load i8*, i8** %101
%131 = tail call i32 @atoi(i8* %130)
%132 = tail call i64 @update_trip_data(i8* %129, i32 %131)
%133 = ashr i64 %132, 63
%134 = trunc i64 %133 to i32
br label %182
135: ; preds = %90
%136 = load i8*, i8** %5
%137 = tail call i64 @strcmp(i8* %136, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.14, i64 0, i64 0))
%138 = icmp eq i64 %137, 0
br i1 %138, label %139, label %180
139: ; preds = %135
%140 = getelementptr inbounds i8*, i8** %1, i64 2
%141 = load i8*, i8** %140
%142 = icmp eq i8* %141, null
br i1 %142, label %143, label %145
143: ; preds = %139
%144 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.24, i64 0, i64 0))
br label %182
145: ; preds = %139
%146 = getelementptr inbounds i8*, i8** %1, i64 3
%147 = load i8*, i8** %146
%148 = icmp eq i8* %147, null
br i1 %148, label %149, label %151
149: ; preds = %145
%150 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.20, i64 0, i64 0))
br label %182
151: ; preds = %145
%152 = tail call i32 @atoi(i8* %147)
%153 = tail call i64 @generate_gps_report(i8* %141, i32 %152)
%154 = icmp slt i64 %153, 0
br i1 %154, label %182, label %155
155: ; preds = %151
%156 = load i8*, i8** %140
%157 = load i8*, i8** %146
%158 = tail call i32 @atoi(i8* %157)
%159 = tail call i64 @generate_gsm_report(i8* %156, i32 %158)
%160 = icmp slt i64 %159, 0
br i1 %160, label %182, label %161
161: ; preds = %155
%162 = load i8*, i8** %140
%163 = load i8*, i8** %146
%164 = tail call i32 @atoi(i8* %163)
%165 = tail call i64 @generate_obd_report(i8* %162, i32 %164)
%166 = icmp slt i64 %165, 0
br i1 %166, label %182, label %167
167: ; preds = %161
%168 = load i8*, i8** %140
%169 = load i8*, i8** %146
%170 = tail call i32 @atoi(i8* %169)
%171 = tail call i64 @generate_wii_report(i8* %168, i32 %170)
%172 = icmp slt i64 %171, 0
br i1 %172, label %182, label %173
173: ; preds = %167
%174 = load i8*, i8** %140
%175 = load i8*, i8** %146
%176 = tail call i32 @atoi(i8* %175)
%177 = tail call i64 @update_trip_report(i8* %174, i32 %176)
%178 = ashr i64 %177, 63
%179 = trunc i64 %178 to i32
br label %182
180: ; preds = %135
%181 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([151 x i8], [151 x i8]* @str, i64 0, i64 0))
br label %182
182: ; preds = %173, %128, %151, %155, %161, %167, %106, %110, %116, %122, %80, %8, %17, %19, %31, %37, %43, %49, %54, %64, %74, %84, %98, %104, %143, %149, %180
%183 = phi i32 [ -1, %8 ], [ -1, %17 ], [ %22, %19 ], [ -1, %31 ], [ -1, %37 ], [ -1, %43 ], [ -1, %49 ], [ %59, %54 ], [ %69, %64 ], [ %79, %74 ], [ %89, %84 ], [ 0, %80 ], [ -1, %98 ], [ -1, %104 ], [ -1, %143 ], [ -1, %149 ], [ -1, %180 ], [ -1, %122 ], [ -1, %116 ], [ -1, %110 ], [ -1, %106 ], [ -1, %167 ], [ -1, %161 ], [ -1, %155 ], [ -1, %151 ], [ %134, %128 ], [ %179, %173 ]
ret i32 %183
}