#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 */
scalar_t__ lat_lon_decode(char *, char *, double *);
int sscanf(char *, char *, double *, ...);
int sscanf_lat_lon(char *readln, double *lat, double *lon) {
  double dlat, dlon, mlat, mlon;
  char ns[2], ew[2];
  if (sscanf(readln, "%lf %lf %s %lf %lf %s", &dlat, &mlat, ns, &dlon, &mlon,
             ew) == 6) {
    *lat = (dlat + mlat / 60.);
    if (*ns == 's' || *ns == 'S')
      *lat = -*lat;
    else if (*ns != 'n' && *ns != 'N')
      return 0;
    *lon = (dlon + mlon / 60.);
    if (*ew == 'w' || *ew == 'W')
      *lon = -*lon;
    else if (*ew != 'e' && *ew != 'E')
      return 0;
    return 2;
  } else if (sscanf(readln, "%lf %s %lf %s", &dlat, ns, &dlon, ew) == 4) {
    *lat = dlat;
    if (*ns == 's' || *ns == 'S')
      *lat = -*lat;
    else if (*ns != 'n' && *ns != 'N')
      return 0;
    *lon = dlon;
    if (*ew == 'w' || *ew == 'W')
      *lon = -*lon;
    else if (*ew != 'e' && *ew != 'E')
      return 0;
    *lon = dlon * (*ew == 'e' || *ew == 'E' ? 1 : -1);
    return 2;
  } else if (sscanf(readln, "%lf %lf", &dlat, &dlon) == 2) {
    *lat = dlat;
    *lon = dlon;
    return 2;
  } else if (lat_lon_decode(readln, "NSns", &dlat) &&
             lat_lon_decode(readln, "EWew", &dlon)) {
    *lat = dlat;
    *lon = dlon;
    return 2;
  } else
    return 0;
}


x86 assembly (clang, -O0):
<sscanf_lat_lon>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x42(%rbp),%r8
lea    -0x44(%rbp),%rax
lea    0xec1(%rip),%rsi
lea    -0x28(%rbp),%rdx
lea    -0x38(%rbp),%rcx
lea    -0x30(%rbp),%r9
lea    -0x40(%rbp),%r10
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
mov    $0x0,%al
call   1040 <sscanf@plt>
cmp    $0x6,%eax
jne    12a2 <sscanf_lat_lon+0x182>
movsd  -0x28(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm1
movsd  0xe7e(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsbl -0x42(%rbp),%eax
cmp    $0x73,%eax
je     11ac <sscanf_lat_lon+0x8c>
movsbl -0x42(%rbp),%eax
cmp    $0x53,%eax
jne    11d8 <sscanf_lat_lon+0xb8>
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    1203 <sscanf_lat_lon+0xe3>
movsbl -0x42(%rbp),%eax
cmp    $0x6e,%eax
je     11fe <sscanf_lat_lon+0xde>
movsbl -0x42(%rbp),%eax
cmp    $0x4e,%eax
je     11fe <sscanf_lat_lon+0xde>
movl   $0x0,-0x4(%rbp)
jmp    14d8 <sscanf_lat_lon+0x3b8>
jmp    1203 <sscanf_lat_lon+0xe3>
movsd  -0x30(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm1
movsd  0xdeb(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
movsbl -0x44(%rbp),%eax
cmp    $0x77,%eax
je     123f <sscanf_lat_lon+0x11f>
movsbl -0x44(%rbp),%eax
cmp    $0x57,%eax
jne    126b <sscanf_lat_lon+0x14b>
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    1296 <sscanf_lat_lon+0x176>
movsbl -0x44(%rbp),%eax
cmp    $0x65,%eax
je     1291 <sscanf_lat_lon+0x171>
movsbl -0x44(%rbp),%eax
cmp    $0x45,%eax
je     1291 <sscanf_lat_lon+0x171>
movl   $0x0,-0x4(%rbp)
jmp    14d8 <sscanf_lat_lon+0x3b8>
jmp    1296 <sscanf_lat_lon+0x176>
movl   $0x2,-0x4(%rbp)
jmp    14d8 <sscanf_lat_lon+0x3b8>
mov    -0x10(%rbp),%rdi
lea    -0x42(%rbp),%rcx
lea    -0x44(%rbp),%r9
lea    0xd69(%rip),%rsi
lea    -0x28(%rbp),%rdx
lea    -0x30(%rbp),%r8
mov    $0x0,%al
call   1040 <sscanf@plt>
cmp    $0x4,%eax
jne    1426 <sscanf_lat_lon+0x306>
movsd  -0x28(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsbl -0x42(%rbp),%eax
cmp    $0x73,%eax
je     12f4 <sscanf_lat_lon+0x1d4>
movsbl -0x42(%rbp),%eax
cmp    $0x53,%eax
jne    1320 <sscanf_lat_lon+0x200>
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    134b <sscanf_lat_lon+0x22b>
movsbl -0x42(%rbp),%eax
cmp    $0x6e,%eax
je     1346 <sscanf_lat_lon+0x226>
movsbl -0x42(%rbp),%eax
cmp    $0x4e,%eax
je     1346 <sscanf_lat_lon+0x226>
movl   $0x0,-0x4(%rbp)
jmp    14d8 <sscanf_lat_lon+0x3b8>
jmp    134b <sscanf_lat_lon+0x22b>
movsd  -0x30(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
movsbl -0x44(%rbp),%eax
cmp    $0x77,%eax
je     1372 <sscanf_lat_lon+0x252>
movsbl -0x44(%rbp),%eax
cmp    $0x57,%eax
jne    139e <sscanf_lat_lon+0x27e>
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    13c9 <sscanf_lat_lon+0x2a9>
movsbl -0x44(%rbp),%eax
cmp    $0x65,%eax
je     13c4 <sscanf_lat_lon+0x2a4>
movsbl -0x44(%rbp),%eax
cmp    $0x45,%eax
je     13c4 <sscanf_lat_lon+0x2a4>
movl   $0x0,-0x4(%rbp)
jmp    14d8 <sscanf_lat_lon+0x3b8>
jmp    13c9 <sscanf_lat_lon+0x2a9>
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsbl -0x44(%rbp),%ecx
mov    $0x1,%al
cmp    $0x65,%ecx
mov    %al,-0x45(%rbp)
je     13f2 <sscanf_lat_lon+0x2d2>
movsbl -0x44(%rbp),%eax
cmp    $0x45,%eax
sete   %al
mov    %al,-0x45(%rbp)
movsd  -0x50(%rbp),%xmm0
mov    -0x45(%rbp),%dl
mov    $0xffffffff,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0x2,-0x4(%rbp)
jmp    14d8 <sscanf_lat_lon+0x3b8>
mov    -0x10(%rbp),%rdi
lea    0xbfb(%rip),%rsi
lea    -0x28(%rbp),%rdx
lea    -0x30(%rbp),%rcx
mov    $0x0,%al
call   1040 <sscanf@plt>
cmp    $0x2,%eax
jne    146f <sscanf_lat_lon+0x34f>
movsd  -0x28(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x30(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0x2,-0x4(%rbp)
jmp    14d8 <sscanf_lat_lon+0x3b8>
mov    -0x10(%rbp),%rdi
lea    0xbba(%rip),%rsi
lea    -0x28(%rbp),%rdx
call   1030 <lat_lon_decode@plt>
cmp    $0x0,%rax
je     14d1 <sscanf_lat_lon+0x3b1>
mov    -0x10(%rbp),%rdi
lea    0xba1(%rip),%rsi
lea    -0x30(%rbp),%rdx
call   1030 <lat_lon_decode@plt>
cmp    $0x0,%rax
je     14d1 <sscanf_lat_lon+0x3b1>
movsd  -0x28(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x30(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0x2,-0x4(%rbp)
jmp    14d8 <sscanf_lat_lon+0x3b8>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sscanf_lat_lon>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x30,%rsp
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
lea    0xc(%rsp),%rbp
lea    0x20(%rsp),%r10
lea    0xed2(%rip),%rsi
xor    %r12d,%r12d
lea    0x18(%rsp),%rdx
lea    0x28(%rsp),%rcx
lea    0xe(%rsp),%r8
lea    0x10(%rsp),%r9
xor    %eax,%eax
push   %rbp
push   %r10
call   1040 <sscanf@plt>
add    $0x10,%rsp
cmp    $0x6,%eax
jne    11e9 <sscanf_lat_lon+0xc9>
movsd  0x28(%rsp),%xmm0
divsd  0xe92(%rip),%xmm0
addsd  0x18(%rsp),%xmm0
movsd  %xmm0,(%r15)
mov    0xe(%rsp),%al
and    $0xdf,%al
cmp    $0x4e,%al
je     11a8 <sscanf_lat_lon+0x88>
cmp    $0x53,%al
jne    12d8 <sscanf_lat_lon+0x1b8>
xorpd  0xe5d(%rip),%xmm0
movlpd %xmm0,(%r15)
movsd  0x20(%rsp),%xmm0
divsd  0xe5a(%rip),%xmm0
addsd  0x10(%rsp),%xmm0
movsd  %xmm0,(%r14)
mov    0xc(%rsp),%al
and    $0xdf,%al
cmp    $0x45,%al
je     12d2 <sscanf_lat_lon+0x1b2>
cmp    $0x57,%al
jne    12d8 <sscanf_lat_lon+0x1b8>
xorpd  0xe21(%rip),%xmm0
movlpd %xmm0,(%r14)
jmp    12d2 <sscanf_lat_lon+0x1b2>
lea    0xe3e(%rip),%rsi
xor    %r12d,%r12d
lea    0x18(%rsp),%rdx
lea    0xe(%rsp),%rcx
lea    0x10(%rsp),%r8
lea    0xc(%rsp),%r9
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <sscanf@plt>
cmp    $0x4,%eax
jne    1267 <sscanf_lat_lon+0x147>
movsd  0x18(%rsp),%xmm0
movsd  %xmm0,(%r15)
mov    0xe(%rsp),%al
and    $0xdf,%al
cmp    $0x4e,%al
je     1240 <sscanf_lat_lon+0x120>
cmp    $0x53,%al
jne    12d8 <sscanf_lat_lon+0x1b8>
xorpd  0xdc5(%rip),%xmm0
movlpd %xmm0,(%r15)
movsd  0x10(%rsp),%xmm0
movsd  %xmm0,(%r14)
mov    0xc(%rsp),%al
and    $0xdf,%al
cmp    $0x57,%al
je     1259 <sscanf_lat_lon+0x139>
cmp    $0x45,%al
jne    12d8 <sscanf_lat_lon+0x1b8>
cmp    $0x45,%al
je     12cd <sscanf_lat_lon+0x1ad>
xorpd  0xd9b(%rip),%xmm0
jmp    12cd <sscanf_lat_lon+0x1ad>
lea    0xdce(%rip),%rsi
xor    %r12d,%r12d
lea    0x18(%rsp),%rdx
lea    0x10(%rsp),%rcx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <sscanf@plt>
cmp    $0x2,%eax
je     12bc <sscanf_lat_lon+0x19c>
lea    0xdb3(%rip),%rsi
lea    0x18(%rsp),%rdx
mov    %rbx,%rdi
call   1030 <lat_lon_decode@plt>
test   %rax,%rax
je     12d8 <sscanf_lat_lon+0x1b8>
lea    0xd9f(%rip),%rsi
lea    0x10(%rsp),%rdx
mov    %rbx,%rdi
call   1030 <lat_lon_decode@plt>
test   %rax,%rax
je     12d8 <sscanf_lat_lon+0x1b8>
movsd  0x18(%rsp),%xmm0
movsd  %xmm0,(%r15)
movsd  0x10(%rsp),%xmm0
movsd  %xmm0,(%r14)
mov    $0x2,%r12d
mov    %r12d,%eax
add    $0x30,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [22 x i8] c"%lf %lf %s %lf %lf %s\00"
@.str.1 = [14 x i8] c"%lf %s %lf %s\00"
@.str.2 = [8 x i8] c"%lf %lf\00"
@.str.3 = [5 x i8] c"NSns\00"
@.str.4 = [5 x i8] c"EWew\00"
define i32 @sscanf_lat_lon(i8* %0, double* %1, double* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca double*
%7 = alloca double*
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca [2 x i8]
%13 = alloca [2 x i8]
store i8* %0, i8** %5
store double* %1, double** %6
store double* %2, double** %7
%14 = load i8*, i8** %5
%15 = getelementptr inbounds [2 x i8], [2 x i8]* %12, i64 0, i64 0
%16 = getelementptr inbounds [2 x i8], [2 x i8]* %13, i64 0, i64 0
%17 = call i32 (i8*, i8*, double*, ...) @sscanf(i8* %14, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), double* %8, double* %10, i8* %15, double* %9, double* %11, i8* %16)
%18 = icmp eq i32 %17, 6
br i1 %18, label %19, label %84
19: ; preds = %3
%20 = load double, double* %8
%21 = load double, double* %10
%22 = fdiv double %21, 6.000000e+01
%23 = fadd double %20, %22
%24 = load double*, double** %6
store double %23, double* %24
%25 = getelementptr inbounds [2 x i8], [2 x i8]* %12, i64 0, i64 0
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = icmp eq i32 %27, 115
br i1 %28, label %34, label %29
29: ; preds = %19
%30 = getelementptr inbounds [2 x i8], [2 x i8]* %12, i64 0, i64 0
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
%33 = icmp eq i32 %32, 83
br i1 %33, label %34, label %39
34: ; preds = %29, %19
%35 = load double*, double** %6
%36 = load double, double* %35
%37 = fneg double %36
%38 = load double*, double** %6
store double %37, double* %38
br label %51
39: ; preds = %29
%40 = getelementptr inbounds [2 x i8], [2 x i8]* %12, i64 0, i64 0
%41 = load i8, i8* %40
%42 = sext i8 %41 to i32
%43 = icmp ne i32 %42, 110
br i1 %43, label %44, label %50
44: ; preds = %39
%45 = getelementptr inbounds [2 x i8], [2 x i8]* %12, i64 0, i64 0
%46 = load i8, i8* %45
%47 = sext i8 %46 to i32
%48 = icmp ne i32 %47, 78
br i1 %48, label %49, label %50
49: ; preds = %44
store i32 0, i32* %4
br label %189
50: ; preds = %44, %39
br label %51
51: ; preds = %50, %34
%52 = load double, double* %9
%53 = load double, double* %11
%54 = fdiv double %53, 6.000000e+01
%55 = fadd double %52, %54
%56 = load double*, double** %7
store double %55, double* %56
%57 = getelementptr inbounds [2 x i8], [2 x i8]* %13, i64 0, i64 0
%58 = load i8, i8* %57
%59 = sext i8 %58 to i32
%60 = icmp eq i32 %59, 119
br i1 %60, label %66, label %61
61: ; preds = %51
%62 = getelementptr inbounds [2 x i8], [2 x i8]* %13, i64 0, i64 0
%63 = load i8, i8* %62
%64 = sext i8 %63 to i32
%65 = icmp eq i32 %64, 87
br i1 %65, label %66, label %71
66: ; preds = %61, %51
%67 = load double*, double** %7
%68 = load double, double* %67
%69 = fneg double %68
%70 = load double*, double** %7
store double %69, double* %70
br label %83
71: ; preds = %61
%72 = getelementptr inbounds [2 x i8], [2 x i8]* %13, i64 0, i64 0
%73 = load i8, i8* %72
%74 = sext i8 %73 to i32
%75 = icmp ne i32 %74, 101
br i1 %75, label %76, label %82
76: ; preds = %71
%77 = getelementptr inbounds [2 x i8], [2 x i8]* %13, i64 0, i64 0
%78 = load i8, i8* %77
%79 = sext i8 %78 to i32
%80 = icmp ne i32 %79, 69
br i1 %80, label %81, label %82
81: ; preds = %76
store i32 0, i32* %4
br label %189
82: ; preds = %76, %71
br label %83
83: ; preds = %82, %66
store i32 2, i32* %4
br label %189
84: ; preds = %3
%85 = load i8*, i8** %5
%86 = getelementptr inbounds [2 x i8], [2 x i8]* %12, i64 0, i64 0
%87 = getelementptr inbounds [2 x i8], [2 x i8]* %13, i64 0, i64 0
%88 = call i32 (i8*, i8*, double*, ...) @sscanf(i8* %85, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), double* %8, i8* %86, double* %9, i8* %87)
%89 = icmp eq i32 %88, 4
br i1 %89, label %90, label %166
90: ; preds = %84
%91 = load double, double* %8
%92 = load double*, double** %6
store double %91, double* %92
%93 = getelementptr inbounds [2 x i8], [2 x i8]* %12, i64 0, i64 0
%94 = load i8, i8* %93
%95 = sext i8 %94 to i32
%96 = icmp eq i32 %95, 115
br i1 %96, label %102, label %97
97: ; preds = %90
%98 = getelementptr inbounds [2 x i8], [2 x i8]* %12, i64 0, i64 0
%99 = load i8, i8* %98
%100 = sext i8 %99 to i32
%101 = icmp eq i32 %100, 83
br i1 %101, label %102, label %107
102: ; preds = %97, %90
%103 = load double*, double** %6
%104 = load double, double* %103
%105 = fneg double %104
%106 = load double*, double** %6
store double %105, double* %106
br label %119
107: ; preds = %97
%108 = getelementptr inbounds [2 x i8], [2 x i8]* %12, i64 0, i64 0
%109 = load i8, i8* %108
%110 = sext i8 %109 to i32
%111 = icmp ne i32 %110, 110
br i1 %111, label %112, label %118
112: ; preds = %107
%113 = getelementptr inbounds [2 x i8], [2 x i8]* %12, i64 0, i64 0
%114 = load i8, i8* %113
%115 = sext i8 %114 to i32
%116 = icmp ne i32 %115, 78
br i1 %116, label %117, label %118
117: ; preds = %112
store i32 0, i32* %4
br label %189
118: ; preds = %112, %107
br label %119
119: ; preds = %118, %102
%120 = load double, double* %9
%121 = load double*, double** %7
store double %120, double* %121
%122 = getelementptr inbounds [2 x i8], [2 x i8]* %13, i64 0, i64 0
%123 = load i8, i8* %122
%124 = sext i8 %123 to i32
%125 = icmp eq i32 %124, 119
br i1 %125, label %131, label %126
126: ; preds = %119
%127 = getelementptr inbounds [2 x i8], [2 x i8]* %13, i64 0, i64 0
%128 = load i8, i8* %127
%129 = sext i8 %128 to i32
%130 = icmp eq i32 %129, 87
br i1 %130, label %131, label %136
131: ; preds = %126, %119
%132 = load double*, double** %7
%133 = load double, double* %132
%134 = fneg double %133
%135 = load double*, double** %7
store double %134, double* %135
br label %148
136: ; preds = %126
%137 = getelementptr inbounds [2 x i8], [2 x i8]* %13, i64 0, i64 0
%138 = load i8, i8* %137
%139 = sext i8 %138 to i32
%140 = icmp ne i32 %139, 101
br i1 %140, label %141, label %147
141: ; preds = %136
%142 = getelementptr inbounds [2 x i8], [2 x i8]* %13, i64 0, i64 0
%143 = load i8, i8* %142
%144 = sext i8 %143 to i32
%145 = icmp ne i32 %144, 69
br i1 %145, label %146, label %147
146: ; preds = %141
store i32 0, i32* %4
br label %189
147: ; preds = %141, %136
br label %148
148: ; preds = %147, %131
%149 = load double, double* %9
%150 = getelementptr inbounds [2 x i8], [2 x i8]* %13, i64 0, i64 0
%151 = load i8, i8* %150
%152 = sext i8 %151 to i32
%153 = icmp eq i32 %152, 101
br i1 %153, label %159, label %154
154: ; preds = %148
%155 = getelementptr inbounds [2 x i8], [2 x i8]* %13, i64 0, i64 0
%156 = load i8, i8* %155
%157 = sext i8 %156 to i32
%158 = icmp eq i32 %157, 69
br label %159
159: ; preds = %154, %148
%160 = phi i1 [ true, %148 ], [ %158, %154 ]
%161 = zext i1 %160 to i64
%162 = select i1 %160, i32 1, i32 -1
%163 = sitofp i32 %162 to double
%164 = fmul double %149, %163
%165 = load double*, double** %7
store double %164, double* %165
store i32 2, i32* %4
br label %189
166: ; preds = %84
%167 = load i8*, i8** %5
%168 = call i32 (i8*, i8*, double*, ...) @sscanf(i8* %167, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), double* %8, double* %9)
%169 = icmp eq i32 %168, 2
br i1 %169, label %170, label %175
170: ; preds = %166
%171 = load double, double* %8
%172 = load double*, double** %6
store double %171, double* %172
%173 = load double, double* %9
%174 = load double*, double** %7
store double %173, double* %174
store i32 2, i32* %4
br label %189
175: ; preds = %166
%176 = load i8*, i8** %5
%177 = call i64 @lat_lon_decode(i8* %176, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), double* %8)
%178 = icmp ne i64 %177, 0
br i1 %178, label %179, label %188
179: ; preds = %175
%180 = load i8*, i8** %5
%181 = call i64 @lat_lon_decode(i8* %180, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), double* %9)
%182 = icmp ne i64 %181, 0
br i1 %182, label %183, label %188
183: ; preds = %179
%184 = load double, double* %8
%185 = load double*, double** %6
store double %184, double* %185
%186 = load double, double* %9
%187 = load double*, double** %7
store double %186, double* %187
store i32 2, i32* %4
br label %189
188: ; preds = %179, %175
store i32 0, i32* %4
br label %189
189: ; preds = %188, %183, %170, %159, %146, %117, %83, %81, %49
%190 = load i32, i32* %4
ret i32 %190
}

LLVM IR (-O2):
@.str = [22 x i8] c"%lf %lf %s %lf %lf %s\00"
@.str.1 = [14 x i8] c"%lf %s %lf %s\00"
@.str.2 = [8 x i8] c"%lf %lf\00"
@.str.3 = [5 x i8] c"NSns\00"
@.str.4 = [5 x i8] c"EWew\00"
define i32 @sscanf_lat_lon(i8* %0, double* nocapture writeonly %1, double* nocapture writeonly %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca [2 x i8]
%9 = alloca [2 x i8]
%10 = bitcast double* %4 to i8*
%11 = bitcast double* %5 to i8*
%12 = bitcast double* %6 to i8*
%13 = bitcast double* %7 to i8*
%14 = getelementptr inbounds [2 x i8], [2 x i8]* %8, i64 0, i64 0
%15 = getelementptr inbounds [2 x i8], [2 x i8]* %9, i64 0, i64 0
%16 = call i32 (i8*, i8*, double*, ...) @sscanf(i8* %0, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), double* %4, double* %6, i8* %14, double* %5, double* %7, i8* %15)
%17 = icmp eq i32 %16, 6
br i1 %17, label %18, label %37
18: ; preds = %3
%19 = load double, double* %4
%20 = load double, double* %6
%21 = fdiv double %20, 6.000000e+01
%22 = fadd double %19, %21
store double %22, double* %1
%23 = load i8, i8* %14
%24 = and i8 %23, -33
switch i8 %24, label %69 [
i8 83, label %25
i8 78, label %27
]
25: ; preds = %18
%26 = fneg double %22
store double %26, double* %1
br label %27
27: ; preds = %18, %25
%28 = load double, double* %5
%29 = load double, double* %7
%30 = fdiv double %29, 6.000000e+01
%31 = fadd double %28, %30
store double %31, double* %2
%32 = load i8, i8* %15
%33 = and i8 %32, -33
switch i8 %33, label %69 [
i8 87, label %34
i8 69, label %36
]
34: ; preds = %27
%35 = fneg double %31
store double %35, double* %2
br label %36
36: ; preds = %27, %34
br label %69
37: ; preds = %3
%38 = call i32 (i8*, i8*, double*, ...) @sscanf(i8* %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), double* %4, i8* %14, double* %5, i8* %15)
%39 = icmp eq i32 %38, 4
br i1 %39, label %40, label %54
40: ; preds = %37
%41 = load double, double* %4
store double %41, double* %1
%42 = load i8, i8* %14
%43 = and i8 %42, -33
switch i8 %43, label %69 [
i8 83, label %44
i8 78, label %46
]
44: ; preds = %40
%45 = fneg double %41
store double %45, double* %1
br label %46
46: ; preds = %40, %44
%47 = load double, double* %5
store double %47, double* %2
%48 = load i8, i8* %15
%49 = and i8 %48, -33
switch i8 %49, label %69 [
i8 87, label %50
i8 69, label %50
]
50: ; preds = %46, %46
%51 = fneg double %47
%52 = icmp eq i8 %49, 69
%53 = select i1 %52, double %47, double %51
store double %53, double* %2
br label %69
54: ; preds = %37
%55 = call i32 (i8*, i8*, double*, ...) @sscanf(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), double* %4, double* %5)
%56 = icmp eq i32 %55, 2
br i1 %56, label %57, label %60
57: ; preds = %54
%58 = load double, double* %4
store double %58, double* %1
%59 = load double, double* %5
store double %59, double* %2
br label %69
60: ; preds = %54
%61 = call i64 @lat_lon_decode(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), double* %4)
%62 = icmp eq i64 %61, 0
br i1 %62, label %69, label %63
63: ; preds = %60
%64 = call i64 @lat_lon_decode(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), double* %5)
%65 = icmp eq i64 %64, 0
br i1 %65, label %69, label %66
66: ; preds = %63
%67 = load double, double* %4
store double %67, double* %1
%68 = load double, double* %5
store double %68, double* %2
br label %69
69: ; preds = %46, %40, %27, %18, %60, %63, %66, %57, %50, %36
%70 = phi i32 [ 2, %36 ], [ 2, %50 ], [ 2, %57 ], [ 2, %66 ], [ 0, %63 ], [ 0, %60 ], [ 0, %18 ], [ 0, %27 ], [ 0, %40 ], [ 0, %46 ]
ret i32 %70
}