#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 *, float);
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)) {
      fprintf(stderr, "Invalid latitude: %f\n", latitude);
      return 2;
    }
    if ((longitude < -180) || (longitude > 180)) {
      fprintf(stderr, "Invalid longitude: %f\n", longitude);
      return 2;
    }
    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    126c <main+0x12c>
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     11cf <main+0x8f>
movss  -0x8(%rbp),%xmm0
movss  0xe3e(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    11f5 <main+0xb5>
mov    0x2e0a(%rip),%rax
mov    (%rax),%edi
movss  -0x8(%rbp),%xmm0
lea    0xe44(%rip),%rsi
call   1050 <fprintf@plt>
movl   $0x2,-0x4(%rbp)
jmp    127f <main+0x13f>
movss  0xe0b(%rip),%xmm0
ucomiss -0xc(%rbp),%xmm0
ja     121d <main+0xdd>
movss  -0xc(%rbp),%xmm0
movss  0xdf8(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    1243 <main+0x103>
mov    0x2dbc(%rip),%rax
mov    (%rax),%edi
movss  -0xc(%rbp),%xmm0
lea    0xe0c(%rip),%rsi
call   1050 <fprintf@plt>
movl   $0x2,-0x4(%rbp)
jmp    127f <main+0x13f>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    -0x60(%rbp),%rsi
lea    0xdf5(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
jmp    1162 <main+0x22>
lea    0xdaf(%rip),%rdi
call   1030 <puts@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%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    0x8(%rsp),%rsi
lea    0xc(%rsp),%rdx
lea    0x10(%rsp),%rcx
call   1060 <scanf@plt>
cmp    $0x3,%eax
jne    124d <main+0x10d>
movss  0x8(%rsp),%xmm0
movss  0xe74(%rip),%xmm1
ucomiss %xmm0,%xmm1
ja     123b <main+0xfb>
ucomiss 0xe68(%rip),%xmm0
ja     123b <main+0xfb>
lea    0xea9(%rip),%r14
lea    0x10(%rsp),%rbx
lea    0xe62(%rip),%r15
lea    0x8(%rsp),%r12
lea    0xc(%rsp),%r13
lea    0xeb6(%rip),%rbp
cs nopw 0x0(%rax,%rax,1)
movss  0xc(%rsp),%xmm1
movss  0xe2a(%rip),%xmm2
ucomiss %xmm1,%xmm2
ja     125d <main+0x11d>
ucomiss 0xe22(%rip),%xmm1
ja     125d <main+0x11d>
cvtss2sd %xmm0,%xmm0
cvtss2sd %xmm1,%xmm1
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x2,%al
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
mov    %rbx,%rcx
call   1060 <scanf@plt>
cmp    $0x3,%eax
jne    124d <main+0x10d>
mov    %rbp,%rdi
call   1030 <puts@plt>
movss  0x8(%rsp),%xmm0
movss  0xdd3(%rip),%xmm1
ucomiss %xmm0,%xmm1
ja     123b <main+0xfb>
ucomiss 0xdcb(%rip),%xmm0
jbe    11d0 <main+0x90>
mov    0x2d9e(%rip),%rax
mov    (%rax),%edi
lea    0xdda(%rip),%rsi
jmp    1270 <main+0x130>
lea    0xdce(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
jmp    127a <main+0x13a>
mov    0x2d7c(%rip),%rax
mov    (%rax),%edi
lea    0xdce(%rip),%rsi
movaps %xmm1,%xmm0
call   1050 <fprintf@plt>
mov    $0x2,%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 = [22 x i8] c"Invalid latitude: %f\0A\00"
@.str.4 = [23 x i8] c"Invalid longitude: %f\0A\00"
@.str.5 = [42 x i8] c"{latitude: %f, longitude: %f, info: '%s'}\00"
@.str.6 = [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 = %37, %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 %44
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 %23, label %20
20: ; preds = %17
%21 = load float, float* %2
%22 = fcmp ogt float %21, 9.000000e+01
br i1 %22, label %23, label %27
23: ; preds = %20, %17
%24 = load i32, i32* @stderr
%25 = load float, float* %2
%26 = call i32 @fprintf(i32 %24, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), float %25)
store i32 2, i32* %1
br label %46
27: ; preds = %20
%28 = load float, float* %3
%29 = fcmp olt float %28, -1.800000e+02
br i1 %29, label %33, label %30
30: ; preds = %27
%31 = load float, float* %3
%32 = fcmp ogt float %31, 1.800000e+02
br i1 %32, label %33, label %37
33: ; preds = %30, %27
%34 = load i32, i32* @stderr
%35 = load float, float* %3
%36 = call i32 @fprintf(i32 %34, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), float %35)
store i32 2, i32* %1
br label %46
37: ; preds = %30
%38 = load float, float* %2
%39 = fpext float %38 to double
%40 = load float, float* %3
%41 = fpext float %40 to double
%42 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.5, i64 0, i64 0), double %39, double %41, i8* %42)
br label %7
44: ; preds = %7
%45 = call i32 @puts(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
store i32 0, i32* %1
br label %46
46: ; preds = %44, %33, %23
%47 = load i32, i32* %1
ret i32 %47
}

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 = [22 x i8] c"Invalid latitude: %f\0A\00"
@.str.4 = [23 x i8] c"Invalid longitude: %f\0A\00"
@.str.5 = [42 x i8] c"{latitude: %f, longitude: %f, info: '%s'}\00"
@.str.6 = [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 %10, label %40
10: ; preds = %0
%11 = load float, float* %1
%12 = fcmp olt float %11, -9.000000e+01
%13 = fcmp ogt float %11, 9.000000e+01
%14 = or i1 %12, %13
br i1 %14, label %21, label %25
15: ; preds = %34
%16 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%17 = load float, float* %1
%18 = fcmp olt float %17, -9.000000e+01
%19 = fcmp ogt float %17, 9.000000e+01
%20 = or i1 %18, %19
br i1 %20, label %21, label %25
21: ; preds = %15, %10
%22 = phi float [ %11, %10 ], [ %17, %15 ]
%23 = load i32, i32* @stderr
%24 = call i32 @fprintf(i32 %23, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), float %22)
br label %42
25: ; preds = %10, %15
%26 = phi float [ %17, %15 ], [ %11, %10 ]
%27 = load float, float* %2
%28 = fcmp olt float %27, -1.800000e+02
%29 = fcmp ogt float %27, 1.800000e+02
%30 = or i1 %28, %29
br i1 %30, label %31, label %34
31: ; preds = %25
%32 = load i32, i32* @stderr
%33 = call i32 @fprintf(i32 %32, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), float %27)
br label %42
34: ; preds = %25
%35 = fpext float %26 to double
%36 = fpext float %27 to double
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.5, i64 0, i64 0), double %35, double %36, i8* %6)
%38 = call i32 @scanf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), float* %1, float* %2, i8* %6)
%39 = icmp eq i32 %38, 3
br i1 %39, label %15, label %40
40: ; preds = %34, %0
%41 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
br label %42
42: ; preds = %40, %31, %21
%43 = phi i32 [ 2, %21 ], [ 2, %31 ], [ 0, %40 ]
ret i32 %43
}