#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, longitude;
  char info[80];
  int print_linefeed = 0;
  puts("data=[");
  while (scanf("%f, %f, %79[^\n]", &latitude, &longitude, info) == 3) {
    if (print_linefeed) {
      printf(",\n");
    } else {
      print_linefeed = 0;
    }
    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'}\n", 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    0xe93(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11a7 <main+0x67>
movl   $0x0,-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    0xe46(%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    0xe0f(%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    0xdf9(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
jmp    1162 <main+0x22>
lea    0xdb1(%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   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x60,%rsp
lea    0xebc(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb7(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
lea    0x10(%rsp),%rcx
call   1060 <scanf@plt>
cmp    $0x3,%eax
jne    1203 <main+0xc3>
lea    0xed2(%rip),%r14
lea    0x10(%rsp),%rbx
lea    0xe87(%rip),%r15
lea    0xc(%rsp),%r12
lea    0x8(%rsp),%r13
nopw   0x0(%rax,%rax,1)
movss  0xc(%rsp),%xmm0
movss  0xe52(%rip),%xmm1
ucomiss %xmm0,%xmm1
ja     1213 <main+0xd3>
ucomiss 0xe4a(%rip),%xmm0
ja     1213 <main+0xd3>
movss  0x8(%rsp),%xmm1
movss  0xe3e(%rip),%xmm2
ucomiss %xmm1,%xmm2
ja     1225 <main+0xe5>
ucomiss 0xe36(%rip),%xmm1
ja     1225 <main+0xe5>
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
je     11a0 <main+0x60>
lea    0xe1a(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
jmp    1242 <main+0x102>
mov    0x2dc6(%rip),%rax
mov    (%rax),%edi
lea    0xe04(%rip),%rsi
jmp    1238 <main+0xf8>
mov    0x2db4(%rip),%rax
mov    (%rax),%edi
lea    0xe09(%rip),%rsi
movaps %xmm1,%xmm0
call   1050 <fprintf@plt>
mov    $0x2,%eax
add    $0x60,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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