#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*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ puts(char *);
int scanf(char *, float *, float *, char *);
int /*<<< orphan*/ stderr;
int main() {
  float latitude;
  float longitude;
  char info[80];
  int started = 0;
  puts("data=[");
  while (scanf("%f,%f,%79[^\n]", &latitude, &longitude, info) == 3) {
    if (started) {
      printf(",\n");
    } else {
      started = 1;
    }
    if ((latitude < -90) || (latitude > 90) || (longitude < -180) ||
        (longitude > 180)) {
      fprintf(stderr, "Bad data value\n");
    } else {
      printf("{ latitude: %f, longitude: %f, info: ':%s' }", latitude,
             longitude, info);
    }
  }
  puts("\n]");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x64(%rbp)
lea    0xeb3(%rip),%rdi
call   1030 <puts@plt>
lea    -0x60(%rbp),%rcx
lea    0xeaa(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1060 <scanf@plt>
cmp    $0x3,%eax
jne    123a <main+0xfa>
cmpl   $0x0,-0x64(%rbp)
je     11a0 <main+0x60>
lea    0xe91(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11a7 <main+0x67>
movl   $0x1,-0x64(%rbp)
movss  0xe51(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
ja     11f7 <main+0xb7>
movss  -0x8(%rbp),%xmm0
movss  0xe3e(%rip),%xmm1
ucomiss %xmm1,%xmm0
ja     11f7 <main+0xb7>
movss  0xe31(%rip),%xmm0
ucomiss -0xc(%rbp),%xmm0
ja     11f7 <main+0xb7>
movss  -0xc(%rbp),%xmm0
movss  0xe1e(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    1211 <main+0xd1>
mov    0x2de2(%rip),%rax
mov    (%rax),%edi
lea    0xe21(%rip),%rsi
call   1050 <fprintf@plt>
jmp    1235 <main+0xf5>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    -0x60(%rbp),%rsi
lea    0xe0a(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
jmp    1162 <main+0x22>
lea    0xde1(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
lea    0xebb(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb6(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
lea    0x10(%rsp),%rcx
call   1060 <scanf@plt>
cmp    $0x3,%eax
jne    1238 <main+0xf8>
lea    0xe92(%rip),%r15
lea    0xc(%rsp),%r12
lea    0x8(%rsp),%r13
lea    0x10(%rsp),%rbx
lea    0xec7(%rip),%rbp
lea    0xe93(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movss  0xc(%rsp),%xmm0
movss  0xe42(%rip),%xmm1
ucomiss %xmm0,%xmm1
ja     1200 <main+0xc0>
ucomiss 0xe3a(%rip),%xmm0
ja     1200 <main+0xc0>
movss  0x8(%rsp),%xmm1
movss  0xe2e(%rip),%xmm2
ucomiss %xmm1,%xmm2
ja     1200 <main+0xc0>
ucomiss 0xe26(%rip),%xmm1
ja     1200 <main+0xc0>
cvtss2sd %xmm0,%xmm0
cvtss2sd %xmm1,%xmm1
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x2,%al
call   1040 <printf@plt>
jmp    1215 <main+0xd5>
nop
mov    0x2dd9(%rip),%rax
mov    (%rax),%edi
lea    0xe15(%rip),%rsi
call   1050 <fprintf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
mov    %rbx,%rcx
call   1060 <scanf@plt>
cmp    $0x3,%eax
jne    1238 <main+0xf8>
mov    %rbp,%rdi
call   1030 <puts@plt>
jmp    11b0 <main+0x70>
lea    0xde3(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"data=[\00"
@.str.1 = [14 x i8] c"%f,%f,%79[^\0A]\00"
@.str.2 = [3 x i8] c",\0A\00"
@stderr = global i32 0
@.str.3 = [16 x i8] c"Bad data value\0A\00"
@.str.4 = [45 x i8] c"{ latitude: %f, longitude: %f, info: ':%s' }\00"
@.str.5 = [3 x i8] c"\0A]\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca [80 x i8]
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %5
%6 = call i32 @puts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %39, %0
%8 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%9 = call i32 @scanf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), float* %2, float* %3, i8* %8)
%10 = icmp eq i32 %9, 3
br i1 %10, label %11, label %40
11: ; preds = %7
%12 = load i32, i32* %5
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %17
16: ; preds = %11
store i32 1, i32* %5
br label %17
17: ; preds = %16, %14
%18 = load float, float* %2
%19 = fcmp olt float %18, -9.000000e+01
br i1 %19, label %29, label %20
20: ; preds = %17
%21 = load float, float* %2
%22 = fcmp ogt float %21, 9.000000e+01
br i1 %22, label %29, label %23
23: ; preds = %20
%24 = load float, float* %3
%25 = fcmp olt float %24, -1.800000e+02
br i1 %25, label %29, label %26
26: ; preds = %23
%27 = load float, float* %3
%28 = fcmp ogt float %27, 1.800000e+02
br i1 %28, label %29, label %32
29: ; preds = %26, %23, %20, %17
%30 = load i32, i32* @stderr
%31 = call i32 @fprintf(i32 %30, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
br label %39
32: ; preds = %26
%33 = load float, float* %2
%34 = fpext float %33 to double
%35 = load float, float* %3
%36 = fpext float %35 to double
%37 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.4, i64 0, i64 0), double %34, double %36, i8* %37)
br label %39
39: ; preds = %32, %29
br label %7
40: ; preds = %7
%41 = call i32 @puts(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"data=[\00"
@.str.1 = [14 x i8] c"%f,%f,%79[^\0A]\00"
@stderr = global i32 0
@.str.3 = [16 x i8] c"Bad data value\0A\00"
@.str.4 = [45 x i8] c"{ latitude: %f, longitude: %f, info: ':%s' }\00"
@.str.5 = [3 x i8] c"\0A]\00"
@str = [2 x i8] c",\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca [80 x i8]
%4 = bitcast float* %1 to i8*
%5 = bitcast float* %2 to i8*
%6 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), float* %1, float* %2, i8* %6)
%9 = icmp eq i32 %8, 3
br i1 %9, label %12, label %32
10: ; preds = %29
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
br label %12
12: ; preds = %0, %10
%13 = load float, float* %1
%14 = fcmp olt float %13, -9.000000e+01
%15 = fcmp ogt float %13, 9.000000e+01
%16 = or i1 %14, %15
%17 = load float, float* %2
%18 = fcmp olt float %17, -1.800000e+02
%19 = select i1 %16, i1 true, i1 %18
%20 = fcmp ogt float %17, 1.800000e+02
%21 = select i1 %19, i1 true, i1 %20
br i1 %21, label %22, label %25
22: ; preds = %12
%23 = load i32, i32* @stderr
%24 = call i32 @fprintf(i32 %23, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
br label %29
25: ; preds = %12
%26 = fpext float %13 to double
%27 = fpext float %17 to double
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str.4, i64 0, i64 0), double %26, double %27, i8* %6)
br label %29
29: ; preds = %25, %22
%30 = call i32 @scanf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), float* %1, float* %2, i8* %6)
%31 = icmp eq i32 %30, 3
br i1 %31, label %10, label %32
32: ; preds = %29, %0
%33 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
ret i32 0
}