#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*/ GPSparser(char **);
void GPSinput(char c) {
  static char str[70];
  static char *data[20];
  static int t = 0;
  static int j = 0;
  static int first = 1;
  if (first == 1) {
    data[t++] = &str[0];
    first = 0;
  }
  if (c == ',' || c == '.' || c == '*') {
    str[j] = '\0';
    data[t++] = &str[++j];
  } else if (c != '\n') {
    str[j++] = c;
  }
  if (c == '\n') {
    str[j] = '\0';
    t = 1;
    j = 0;
    GPSparser(data);
  }
}


x86 assembly (clang, -O0):
<GPSinput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
cmpl   $0x1,0x2f03(%rip)
jne    115b <GPSinput+0x4b>
mov    0x2fff(%rip),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,0x2ff4(%rip)
movslq %eax,%rcx
lea    0x2f4a(%rip),%rax
lea    0x2ef3(%rip),%rdx
mov    %rdx,(%rax,%rcx,8)
movl   $0x0,0x2ecd(%rip)
movsbl -0x1(%rbp),%eax
cmp    $0x2c,%eax
je     1182 <GPSinput+0x72>
movsbl -0x1(%rbp),%eax
cmp    $0x2e,%eax
je     1182 <GPSinput+0x72>
movsbl -0x1(%rbp),%eax
cmp    $0x2a,%eax
jne    11d3 <GPSinput+0xc3>
movslq 0x2fab(%rip),%rcx
lea    0x2eb0(%rip),%rax
movb   $0x0,(%rax,%rcx,1)
mov    0x2f9a(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f91(%rip)
cltq
lea    0x2e94(%rip),%rdx
add    %rax,%rdx
mov    0x2f7b(%rip),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,0x2f70(%rip)
movslq %eax,%rcx
lea    0x2ec6(%rip),%rax
mov    %rdx,(%rax,%rcx,8)
jmp    1206 <GPSinput+0xf6>
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
je     1201 <GPSinput+0xf1>
mov    -0x1(%rbp),%dl
mov    0x2f4b(%rip),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,0x2f40(%rip)
movslq %eax,%rcx
lea    0x2e42(%rip),%rax
mov    %dl,(%rax,%rcx,1)
jmp    1206 <GPSinput+0xf6>
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
jne    1245 <GPSinput+0x135>
movslq 0x2f1a(%rip),%rcx
lea    0x2e1f(%rip),%rax
movb   $0x0,(%rax,%rcx,1)
movl   $0x1,0x2f01(%rip)
movl   $0x0,0x2efb(%rip)
lea    0x2e50(%rip),%rdi
call   1030 <GPSparser@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPSinput>:
cmpb   $0x0,0x3021(%rip)
jne    1142 <GPSinput+0x32>
movslq 0x3010(%rip),%rax
lea    0x1(%rax),%ecx
mov    %ecx,0x3007(%rip)
lea    0x2f60(%rip),%rcx
lea    0x2f09(%rip),%rdx
mov    %rdx,(%rcx,%rax,8)
movb   $0x1,0x2ff6(%rip)
lea    -0xa(%rdi),%eax
cmp    $0x24,%al
ja     11cf <GPSinput+0xbf>
movzbl %al,%eax
lea    0xea9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movslq 0x2fcd(%rip),%rax
lea    0x2ed2(%rip),%rcx
movb   $0x0,(%rax,%rcx,1)
lea    0x1(%rax),%rdx
mov    %edx,0x2fb8(%rip)
lea    0x1(%rax,%rcx,1),%rax
movslq 0x2fa8(%rip),%rcx
lea    0x1(%rcx),%edx
mov    %edx,0x2f9f(%rip)
lea    0x2ef8(%rip),%rdx
mov    %rax,(%rdx,%rcx,8)
ret
movslq 0x2f90(%rip),%rax
lea    0x2e95(%rip),%rcx
movb   $0x0,(%rax,%rcx,1)
movl   $0x1,0x2f77(%rip)
movl   $0x0,0x2f71(%rip)
lea    0x2ec6(%rip),%rdi
jmp    1030 <GPSparser@plt>
movslq 0x2f5e(%rip),%rax
lea    0x1(%rax),%ecx
mov    %ecx,0x2f55(%rip)
lea    0x2e5a(%rip),%rcx
mov    %dil,(%rax,%rcx,1)
ret

LLVM IR (-O0):
@GPSinput.str = internal global [70 x i8] zeroinitializer
@GPSinput.data = internal global [20 x i8*] zeroinitializer
@GPSinput.t = internal global i32 0
@GPSinput.j = internal global i32 0
@GPSinput.first = internal global i32 1
define void @GPSinput(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i32, i32* @GPSinput.first
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load i32, i32* @GPSinput.t
%7 = add nsw i32 %6, 1
store i32 %7, i32* @GPSinput.t
%8 = sext i32 %6 to i64
%9 = getelementptr inbounds [20 x i8*], [20 x i8*]* @GPSinput.data, i64 0, i64 %8
store i8* getelementptr inbounds ([70 x i8], [70 x i8]* @GPSinput.str, i64 0, i64 0), i8** %9
store i32 0, i32* @GPSinput.first
br label %10
10: ; preds = %5, %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 44
br i1 %13, label %22, label %14
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 46
br i1 %17, label %22, label %18
18: ; preds = %14
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 42
br i1 %21, label %22, label %34
22: ; preds = %18, %14, %10
%23 = load i32, i32* @GPSinput.j
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [70 x i8], [70 x i8]* @GPSinput.str, i64 0, i64 %24
store i8 0, i8* %25
%26 = load i32, i32* @GPSinput.j
%27 = add nsw i32 %26, 1
store i32 %27, i32* @GPSinput.j
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [70 x i8], [70 x i8]* @GPSinput.str, i64 0, i64 %28
%30 = load i32, i32* @GPSinput.t
%31 = add nsw i32 %30, 1
store i32 %31, i32* @GPSinput.t
%32 = sext i32 %30 to i64
%33 = getelementptr inbounds [20 x i8*], [20 x i8*]* @GPSinput.data, i64 0, i64 %32
store i8* %29, i8** %33
br label %45
34: ; preds = %18
%35 = load i8, i8* %2
%36 = sext i8 %35 to i32
%37 = icmp ne i32 %36, 10
br i1 %37, label %38, label %44
38: ; preds = %34
%39 = load i8, i8* %2
%40 = load i32, i32* @GPSinput.j
%41 = add nsw i32 %40, 1
store i32 %41, i32* @GPSinput.j
%42 = sext i32 %40 to i64
%43 = getelementptr inbounds [70 x i8], [70 x i8]* @GPSinput.str, i64 0, i64 %42
store i8 %39, i8* %43
br label %44
44: ; preds = %38, %34
br label %45
45: ; preds = %44, %22
%46 = load i8, i8* %2
%47 = sext i8 %46 to i32
%48 = icmp eq i32 %47, 10
br i1 %48, label %49, label %54
49: ; preds = %45
%50 = load i32, i32* @GPSinput.j
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds [70 x i8], [70 x i8]* @GPSinput.str, i64 0, i64 %51
store i8 0, i8* %52
store i32 1, i32* @GPSinput.t
store i32 0, i32* @GPSinput.j
%53 = call i32 @GPSparser(i8** getelementptr inbounds ([20 x i8*], [20 x i8*]* @GPSinput.data, i64 0, i64 0))
br label %54
54: ; preds = %49, %45
ret void
}

LLVM IR (-O2):
@GPSinput.str = internal global [70 x i8] zeroinitializer
@GPSinput.data = internal global [20 x i8*] zeroinitializer
@GPSinput.t = internal unnamed_addr global i32 0
@GPSinput.j = internal unnamed_addr global i32 0
@GPSinput.first = internal unnamed_addr global i1 false
define void @GPSinput(i8 signext %0) {
%2 = load i1, i1* @GPSinput.first
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = load i32, i32* @GPSinput.t
%5 = add nsw i32 %4, 1
store i32 %5, i32* @GPSinput.t
%6 = sext i32 %4 to i64
%7 = getelementptr inbounds [20 x i8*], [20 x i8*]* @GPSinput.data, i64 0, i64 %6
store i8* getelementptr inbounds ([70 x i8], [70 x i8]* @GPSinput.str, i64 0, i64 0), i8** %7
store i1 true, i1* @GPSinput.first
br label %8
8: ; preds = %3, %1
switch i8 %0, label %20 [
i8 46, label %9
i8 44, label %9
i8 42, label %9
i8 10, label %25
]
9: ; preds = %8, %8, %8
%10 = load i32, i32* @GPSinput.j
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [70 x i8], [70 x i8]* @GPSinput.str, i64 0, i64 %11
store i8 0, i8* %12
%13 = add nsw i32 %10, 1
store i32 %13, i32* @GPSinput.j
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [70 x i8], [70 x i8]* @GPSinput.str, i64 0, i64 %14
%16 = load i32, i32* @GPSinput.t
%17 = add nsw i32 %16, 1
store i32 %17, i32* @GPSinput.t
%18 = sext i32 %16 to i64
%19 = getelementptr inbounds [20 x i8*], [20 x i8*]* @GPSinput.data, i64 0, i64 %18
store i8* %15, i8** %19
br label %30
20: ; preds = %8
%21 = load i32, i32* @GPSinput.j
%22 = add nsw i32 %21, 1
store i32 %22, i32* @GPSinput.j
%23 = sext i32 %21 to i64
%24 = getelementptr inbounds [70 x i8], [70 x i8]* @GPSinput.str, i64 0, i64 %23
store i8 %0, i8* %24
br label %30
25: ; preds = %8
%26 = load i32, i32* @GPSinput.j
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [70 x i8], [70 x i8]* @GPSinput.str, i64 0, i64 %27
store i8 0, i8* %28
store i32 1, i32* @GPSinput.t
store i32 0, i32* @GPSinput.j
%29 = tail call i32 @GPSparser(i8** getelementptr inbounds ([20 x i8*], [20 x i8*]* @GPSinput.data, i64 0, i64 0))
br label %30
30: ; preds = %9, %20, %25
ret void
}