#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 atoi(char const *);
int roadmap_coord_fraction(char const *);
char *strchr(char const *, char);
int strlen(char const *);
int roadmap_coord_to_binary(const char *image, int is_longitude) {
  int value;
  int sign = 1;
  int length;
  const char *p;
  switch (*image) {
  case '-':
    sign = -1;
    ++image;
    break;
  case '+':
    ++image;
    break;
  case 'W':
  case 'w':
    if (!is_longitude)
      return 181000000;
    sign = -1;
    ++image;
    break;
  case 'E':
  case 'e':
    if (!is_longitude)
      return 181000000;
    ++image;
    break;
  case 'S':
  case 's':
    if (is_longitude)
      return 181000000;
    sign = -1;
    ++image;
    break;
  case 'N':
  case 'n':
    if (is_longitude)
      return 181000000;
    ++image;
    break;
  }
  switch (image[strlen(image) - 1]) {
  case 'W':
  case 'w':
    if (!is_longitude)
      return 181000000;
    sign = -1;
    break;
  case 'E':
  case 'e':
    if (!is_longitude)
      return 181000000;
    sign = 1;
    break;
  case 'S':
  case 's':
    if (is_longitude)
      return 181000000;
    sign = -1;
    break;
  case 'N':
  case 'n':
    if (is_longitude)
      return 181000000;
    sign = 1;
    break;
  }
  p = strchr(image, '.');
  if (p == NULL) {
    length = strlen(image);
    p = image + length;
  } else {
    length = p - image;
    ++p;
  }
  value = atoi(image);
  switch (length) {
  case 3:
    if (!is_longitude)
      return 181000000;
  case 1:
  case 2:
    value = (value * 1000000) + roadmap_coord_fraction(p);
    break;
  case 5:
    if (!is_longitude)
      return 181000000;
  case 4:
    value = ((value / 100) * 1000000) + (((value % 100) * 1000000) / 60) +
            (roadmap_coord_fraction(p) / 60);
    break;
  case 7:
    if (!is_longitude)
      return 181000000;
  case 6:
    value =
        ((value / 10000) * 1000000) + ((((value / 100) % 100) * 1000000) / 60) +
        (((value % 100) * 1000000) / 3600) + (roadmap_coord_fraction(p) / 3600);
    break;
  default:
    return 181000000;
  }
  return sign * value;
}


x86 assembly (clang, -O0):
<roadmap_coord_to_binary>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x1,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
add    $0xffffffd5,%eax
mov    %eax,%ecx
mov    %rcx,-0x30(%rbp)
sub    $0x4c,%eax
ja     1251 <roadmap_coord_to_binary+0x111>
mov    -0x30(%rbp),%rax
lea    0xe86(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0xffffffff,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1251 <roadmap_coord_to_binary+0x111>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1251 <roadmap_coord_to_binary+0x111>
cmpl   $0x0,-0x14(%rbp)
jne    11c2 <roadmap_coord_to_binary+0x82>
movl   $0xac9d740,-0x4(%rbp)
jmp    1505 <roadmap_coord_to_binary+0x3c5>
movl   $0xffffffff,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1251 <roadmap_coord_to_binary+0x111>
cmpl   $0x0,-0x14(%rbp)
jne    11f0 <roadmap_coord_to_binary+0xb0>
movl   $0xac9d740,-0x4(%rbp)
jmp    1505 <roadmap_coord_to_binary+0x3c5>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1251 <roadmap_coord_to_binary+0x111>
cmpl   $0x0,-0x14(%rbp)
je     1217 <roadmap_coord_to_binary+0xd7>
movl   $0xac9d740,-0x4(%rbp)
jmp    1505 <roadmap_coord_to_binary+0x3c5>
movl   $0xffffffff,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1251 <roadmap_coord_to_binary+0x111>
cmpl   $0x0,-0x14(%rbp)
je     1245 <roadmap_coord_to_binary+0x105>
movl   $0xac9d740,-0x4(%rbp)
jmp    1505 <roadmap_coord_to_binary+0x3c5>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    %rdi,-0x40(%rbp)
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x40(%rbp),%rax
add    $0xffffffff,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
add    $0xffffffbb,%eax
mov    %eax,%ecx
mov    %rcx,-0x38(%rbp)
sub    $0x32,%eax
ja     1317 <roadmap_coord_to_binary+0x1d7>
mov    -0x38(%rbp),%rax
lea    0xea9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
cmpl   $0x0,-0x14(%rbp)
jne    12aa <roadmap_coord_to_binary+0x16a>
movl   $0xac9d740,-0x4(%rbp)
jmp    1505 <roadmap_coord_to_binary+0x3c5>
movl   $0xffffffff,-0x1c(%rbp)
jmp    1317 <roadmap_coord_to_binary+0x1d7>
cmpl   $0x0,-0x14(%rbp)
jne    12cc <roadmap_coord_to_binary+0x18c>
movl   $0xac9d740,-0x4(%rbp)
jmp    1505 <roadmap_coord_to_binary+0x3c5>
movl   $0x1,-0x1c(%rbp)
jmp    1317 <roadmap_coord_to_binary+0x1d7>
cmpl   $0x0,-0x14(%rbp)
je     12ee <roadmap_coord_to_binary+0x1ae>
movl   $0xac9d740,-0x4(%rbp)
jmp    1505 <roadmap_coord_to_binary+0x3c5>
movl   $0xffffffff,-0x1c(%rbp)
jmp    1317 <roadmap_coord_to_binary+0x1d7>
cmpl   $0x0,-0x14(%rbp)
je     1310 <roadmap_coord_to_binary+0x1d0>
movl   $0xac9d740,-0x4(%rbp)
jmp    1505 <roadmap_coord_to_binary+0x3c5>
movl   $0x1,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2e,%esi
call   1050 <strchr@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    1354 <roadmap_coord_to_binary+0x214>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
jmp    136e <roadmap_coord_to_binary+0x22e>
mov    -0x28(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x20(%rbp)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x20(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x48(%rbp)
sub    $0x6,%eax
ja     14ef <roadmap_coord_to_binary+0x3af>
mov    -0x48(%rbp),%rax
lea    0xe66(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
cmpl   $0x0,-0x14(%rbp)
jne    13b9 <roadmap_coord_to_binary+0x279>
movl   $0xac9d740,-0x4(%rbp)
jmp    1505 <roadmap_coord_to_binary+0x3c5>
jmp    13be <roadmap_coord_to_binary+0x27e>
imul   $0xf4240,-0x18(%rbp),%eax
mov    %eax,-0x4c(%rbp)
mov    -0x28(%rbp),%rdi
call   1030 <roadmap_coord_fraction@plt>
mov    %eax,%ecx
mov    -0x4c(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x18(%rbp)
jmp    14fb <roadmap_coord_to_binary+0x3bb>
cmpl   $0x0,-0x14(%rbp)
jne    13f6 <roadmap_coord_to_binary+0x2b6>
movl   $0xac9d740,-0x4(%rbp)
jmp    1505 <roadmap_coord_to_binary+0x3c5>
jmp    13fb <roadmap_coord_to_binary+0x2bb>
mov    -0x18(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
imul   $0xf4240,%eax,%eax
mov    %eax,-0x54(%rbp)
mov    -0x18(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
imul   $0xf4240,%edx,%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x54(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x50(%rbp)
mov    -0x28(%rbp),%rdi
call   1030 <roadmap_coord_fraction@plt>
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x50(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x18(%rbp)
jmp    14fb <roadmap_coord_to_binary+0x3bb>
cmpl   $0x0,-0x14(%rbp)
jne    1468 <roadmap_coord_to_binary+0x328>
movl   $0xac9d740,-0x4(%rbp)
jmp    1505 <roadmap_coord_to_binary+0x3c5>
jmp    146d <roadmap_coord_to_binary+0x32d>
mov    -0x18(%rbp),%eax
mov    $0x2710,%ecx
cltd
idiv   %ecx
imul   $0xf4240,%eax,%eax
mov    %eax,-0x60(%rbp)
mov    -0x18(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    $0x64,%ecx
cltd
idiv   %ecx
imul   $0xf4240,%edx,%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x60(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x5c(%rbp)
mov    -0x18(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
imul   $0xf4240,%edx,%eax
mov    $0xe10,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x5c(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x58(%rbp)
mov    -0x28(%rbp),%rdi
call   1030 <roadmap_coord_fraction@plt>
mov    $0xe10,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x58(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x18(%rbp)
jmp    14fb <roadmap_coord_to_binary+0x3bb>
movl   $0xac9d740,-0x4(%rbp)
jmp    1505 <roadmap_coord_to_binary+0x3c5>
mov    -0x1c(%rbp),%eax
imul   -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<roadmap_coord_to_binary>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %esi,%r15d
mov    %rdi,%rbx
movsbl (%rdi),%eax
mov    $0x1,%r12d
add    $0xffffffd5,%eax
cmp    $0x4c,%eax
ja     11b0 <roadmap_coord_to_binary+0x70>
lea    0xe9a(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
test   %r15d,%r15d
jne    1187 <roadmap_coord_to_binary+0x47>
jmp    123b <roadmap_coord_to_binary+0xfb>
mov    $0xac9d740,%eax
test   %r15d,%r15d
jne    13e1 <roadmap_coord_to_binary+0x2a1>
add    $0x1,%rbx
jmp    11b0 <roadmap_coord_to_binary+0x70>
mov    $0xac9d740,%eax
test   %r15d,%r15d
jne    13e1 <roadmap_coord_to_binary+0x2a1>
jmp    11a6 <roadmap_coord_to_binary+0x66>
test   %r15d,%r15d
je     123b <roadmap_coord_to_binary+0xfb>
add    $0x1,%rbx
mov    $0xffffffff,%r12d
mov    %rbx,%rdi
call   1040 <strlen@plt>
cltq
movsbl -0x1(%rax,%rbx,1),%eax
add    $0xffffffbb,%eax
cmp    $0x32,%eax
ja     121b <roadmap_coord_to_binary+0xdb>
lea    0xf66(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x1,%r12d
test   %r15d,%r15d
jne    121b <roadmap_coord_to_binary+0xdb>
jmp    123b <roadmap_coord_to_binary+0xfb>
mov    $0xac9d740,%eax
test   %r15d,%r15d
jne    13e1 <roadmap_coord_to_binary+0x2a1>
mov    $0x1,%r12d
jmp    121b <roadmap_coord_to_binary+0xdb>
mov    $0xac9d740,%eax
test   %r15d,%r15d
jne    13e1 <roadmap_coord_to_binary+0x2a1>
mov    $0xffffffff,%r12d
jmp    121b <roadmap_coord_to_binary+0xdb>
mov    $0xffffffff,%r12d
test   %r15d,%r15d
je     123b <roadmap_coord_to_binary+0xfb>
mov    %rbx,%rdi
mov    $0x2e,%esi
call   1050 <strchr@plt>
test   %rax,%rax
je     1245 <roadmap_coord_to_binary+0x105>
mov    %rax,%r14
mov    %r14d,%ebp
sub    %ebx,%ebp
add    $0x1,%r14
jmp    1255 <roadmap_coord_to_binary+0x115>
mov    $0xac9d740,%eax
jmp    13e1 <roadmap_coord_to_binary+0x2a1>
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %eax,%ebp
movslq %eax,%r14
add    %rbx,%r14
mov    %rbx,%rdi
call   1060 <atoi@plt>
mov    %eax,%ecx
mov    $0xac9d740,%eax
add    $0xffffffff,%ebp
cmp    $0x6,%ebp
ja     13e1 <roadmap_coord_to_binary+0x2a1>
lea    0xf89(%rip),%rdx
movslq (%rdx,%rbp,4),%rsi
add    %rdx,%rsi
jmp    *%rsi
test   %r15d,%r15d
je     13e1 <roadmap_coord_to_binary+0x2a1>
imul   $0xf4240,%ecx,%ebx
mov    %r14,%rdi
call   1030 <roadmap_coord_fraction@plt>
add    %ebx,%eax
jmp    13dd <roadmap_coord_to_binary+0x29d>
test   %r15d,%r15d
je     13e1 <roadmap_coord_to_binary+0x2a1>
movslq %ecx,%rax
imul   $0x51eb851f,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rax
sar    $0x5,%eax
add    %edx,%eax
imul   $0xf4240,%eax,%edx
imul   $0x64,%eax,%eax
sub    %eax,%ecx
imul   $0xf4240,%ecx,%eax
movslq %eax,%rbx
imul   $0xffffffff88888889,%rbx,%rax
shr    $0x20,%rax
add    %eax,%ebx
mov    %ebx,%eax
shr    $0x1f,%eax
sar    $0x5,%ebx
add    %eax,%ebx
add    %edx,%ebx
mov    %r14,%rdi
call   1030 <roadmap_coord_fraction@plt>
cltq
imul   $0xffffffff88888889,%rax,%rcx
shr    $0x20,%rcx
add    %ecx,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0x5,%eax
jmp    13d9 <roadmap_coord_to_binary+0x299>
test   %r15d,%r15d
je     13e1 <roadmap_coord_to_binary+0x2a1>
movslq %ecx,%rcx
imul   $0x68db8bad,%rcx,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rax
sar    $0xc,%eax
add    %edx,%eax
imul   $0xf4240,%eax,%eax
imul   $0x51eb851f,%rcx,%rdx
mov    %rdx,%rsi
shr    $0x3f,%rsi
shr    $0x20,%rdx
sar    $0x5,%edx
add    %esi,%edx
movslq %edx,%rdx
imul   $0x51eb851f,%rdx,%rsi
mov    %rsi,%rdi
shr    $0x3f,%rdi
shr    $0x20,%rsi
sar    $0x5,%esi
add    %edi,%esi
imul   $0x64,%esi,%esi
imul   $0x64,%edx,%edi
sub    %esi,%edx
imul   $0xf4240,%edx,%edx
movslq %edx,%rdx
imul   $0xffffffff88888889,%rdx,%rsi
shr    $0x20,%rsi
add    %esi,%edx
mov    %edx,%esi
shr    $0x1f,%esi
sar    $0x5,%edx
add    %esi,%edx
sub    %edi,%ecx
imul   $0xf4240,%ecx,%ecx
movslq %ecx,%rbx
imul   $0xffffffff91a2b3c5,%rbx,%rcx
shr    $0x20,%rcx
add    %ecx,%ebx
mov    %ebx,%ecx
shr    $0x1f,%ecx
sar    $0xb,%ebx
add    %ecx,%ebx
add    %eax,%ebx
add    %edx,%ebx
mov    %r14,%rdi
call   1030 <roadmap_coord_fraction@plt>
cltq
imul   $0xffffffff91a2b3c5,%rax,%rcx
shr    $0x20,%rcx
add    %ecx,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0xb,%eax
add    %ecx,%eax
add    %ebx,%eax
imul   %r12d,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @roadmap_coord_to_binary(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 1, i32* %7
%10 = load i8*, i8** %4
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
switch i32 %12, label %47 [
i32 45, label %13
i32 43, label %16
i32 87, label %19
i32 119, label %19
i32 69, label %26
i32 101, label %26
i32 83, label %33
i32 115, label %33
i32 78, label %40
i32 110, label %40
]
13: ; preds = %2
store i32 -1, i32* %7
%14 = load i8*, i8** %4
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %4
br label %47
16: ; preds = %2
%17 = load i8*, i8** %4
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %4
br label %47
19: ; preds = %2, %2
%20 = load i32, i32* %5
%21 = icmp ne i32 %20, 0
br i1 %21, label %23, label %22
22: ; preds = %19
store i32 181000000, i32* %3
br label %159
23: ; preds = %19
store i32 -1, i32* %7
%24 = load i8*, i8** %4
%25 = getelementptr inbounds i8, i8* %24, i32 1
store i8* %25, i8** %4
br label %47
26: ; preds = %2, %2
%27 = load i32, i32* %5
%28 = icmp ne i32 %27, 0
br i1 %28, label %30, label %29
29: ; preds = %26
store i32 181000000, i32* %3
br label %159
30: ; preds = %26
%31 = load i8*, i8** %4
%32 = getelementptr inbounds i8, i8* %31, i32 1
store i8* %32, i8** %4
br label %47
33: ; preds = %2, %2
%34 = load i32, i32* %5
%35 = icmp ne i32 %34, 0
br i1 %35, label %36, label %37
36: ; preds = %33
store i32 181000000, i32* %3
br label %159
37: ; preds = %33
store i32 -1, i32* %7
%38 = load i8*, i8** %4
%39 = getelementptr inbounds i8, i8* %38, i32 1
store i8* %39, i8** %4
br label %47
40: ; preds = %2, %2
%41 = load i32, i32* %5
%42 = icmp ne i32 %41, 0
br i1 %42, label %43, label %44
43: ; preds = %40
store i32 181000000, i32* %3
br label %159
44: ; preds = %40
%45 = load i8*, i8** %4
%46 = getelementptr inbounds i8, i8* %45, i32 1
store i8* %46, i8** %4
br label %47
47: ; preds = %2, %44, %37, %30, %23, %16, %13
%48 = load i8*, i8** %4
%49 = load i8*, i8** %4
%50 = call i32 @strlen(i8* %49)
%51 = sub nsw i32 %50, 1
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds i8, i8* %48, i64 %52
%54 = load i8, i8* %53
%55 = sext i8 %54 to i32
switch i32 %55, label %76 [
i32 87, label %56
i32 119, label %56
i32 69, label %61
i32 101, label %61
i32 83, label %66
i32 115, label %66
i32 78, label %71
i32 110, label %71
]
56: ; preds = %47, %47
%57 = load i32, i32* %5
%58 = icmp ne i32 %57, 0
br i1 %58, label %60, label %59
59: ; preds = %56
store i32 181000000, i32* %3
br label %159
60: ; preds = %56
store i32 -1, i32* %7
br label %76
61: ; preds = %47, %47
%62 = load i32, i32* %5
%63 = icmp ne i32 %62, 0
br i1 %63, label %65, label %64
64: ; preds = %61
store i32 181000000, i32* %3
br label %159
65: ; preds = %61
store i32 1, i32* %7
br label %76
66: ; preds = %47, %47
%67 = load i32, i32* %5
%68 = icmp ne i32 %67, 0
br i1 %68, label %69, label %70
69: ; preds = %66
store i32 181000000, i32* %3
br label %159
70: ; preds = %66
store i32 -1, i32* %7
br label %76
71: ; preds = %47, %47
%72 = load i32, i32* %5
%73 = icmp ne i32 %72, 0
br i1 %73, label %74, label %75
74: ; preds = %71
store i32 181000000, i32* %3
br label %159
75: ; preds = %71
store i32 1, i32* %7
br label %76
76: ; preds = %47, %75, %70, %65, %60
%77 = load i8*, i8** %4
%78 = call i8* @strchr(i8* %77, i8 signext 46)
store i8* %78, i8** %9
%79 = load i8*, i8** %9
%80 = icmp eq i8* %79, null
br i1 %80, label %81, label %88
81: ; preds = %76
%82 = load i8*, i8** %4
%83 = call i32 @strlen(i8* %82)
store i32 %83, i32* %8
%84 = load i8*, i8** %4
%85 = load i32, i32* %8
%86 = sext i32 %85 to i64
%87 = getelementptr inbounds i8, i8* %84, i64 %86
store i8* %87, i8** %9
br label %97
88: ; preds = %76
%89 = load i8*, i8** %9
%90 = load i8*, i8** %4
%91 = ptrtoint i8* %89 to i64
%92 = ptrtoint i8* %90 to i64
%93 = sub i64 %91, %92
%94 = trunc i64 %93 to i32
store i32 %94, i32* %8
%95 = load i8*, i8** %9
%96 = getelementptr inbounds i8, i8* %95, i32 1
store i8* %96, i8** %9
br label %97
97: ; preds = %88, %81
%98 = load i8*, i8** %4
%99 = call i32 @atoi(i8* %98)
store i32 %99, i32* %6
%100 = load i32, i32* %8
switch i32 %100, label %154 [
i32 3, label %101
i32 1, label %106
i32 2, label %106
i32 5, label %112
i32 4, label %117
i32 7, label %130
i32 6, label %135
]
101: ; preds = %97
%102 = load i32, i32* %5
%103 = icmp ne i32 %102, 0
br i1 %103, label %105, label %104
104: ; preds = %101
store i32 181000000, i32* %3
br label %159
105: ; preds = %101
br label %106
106: ; preds = %97, %97, %105
%107 = load i32, i32* %6
%108 = mul nsw i32 %107, 1000000
%109 = load i8*, i8** %9
%110 = call i32 @roadmap_coord_fraction(i8* %109)
%111 = add nsw i32 %108, %110
store i32 %111, i32* %6
br label %155
112: ; preds = %97
%113 = load i32, i32* %5
%114 = icmp ne i32 %113, 0
br i1 %114, label %116, label %115
115: ; preds = %112
store i32 181000000, i32* %3
br label %159
116: ; preds = %112
br label %117
117: ; preds = %97, %116
%118 = load i32, i32* %6
%119 = sdiv i32 %118, 100
%120 = mul nsw i32 %119, 1000000
%121 = load i32, i32* %6
%122 = srem i32 %121, 100
%123 = mul nsw i32 %122, 1000000
%124 = sdiv i32 %123, 60
%125 = add nsw i32 %120, %124
%126 = load i8*, i8** %9
%127 = call i32 @roadmap_coord_fraction(i8* %126)
%128 = sdiv i32 %127, 60
%129 = add nsw i32 %125, %128
store i32 %129, i32* %6
br label %155
130: ; preds = %97
%131 = load i32, i32* %5
%132 = icmp ne i32 %131, 0
br i1 %132, label %134, label %133
133: ; preds = %130
store i32 181000000, i32* %3
br label %159
134: ; preds = %130
br label %135
135: ; preds = %97, %134
%136 = load i32, i32* %6
%137 = sdiv i32 %136, 10000
%138 = mul nsw i32 %137, 1000000
%139 = load i32, i32* %6
%140 = sdiv i32 %139, 100
%141 = srem i32 %140, 100
%142 = mul nsw i32 %141, 1000000
%143 = sdiv i32 %142, 60
%144 = add nsw i32 %138, %143
%145 = load i32, i32* %6
%146 = srem i32 %145, 100
%147 = mul nsw i32 %146, 1000000
%148 = sdiv i32 %147, 3600
%149 = add nsw i32 %144, %148
%150 = load i8*, i8** %9
%151 = call i32 @roadmap_coord_fraction(i8* %150)
%152 = sdiv i32 %151, 3600
%153 = add nsw i32 %149, %152
store i32 %153, i32* %6
br label %155
154: ; preds = %97
store i32 181000000, i32* %3
br label %159
155: ; preds = %135, %117, %106
%156 = load i32, i32* %7
%157 = load i32, i32* %6
%158 = mul nsw i32 %156, %157
store i32 %158, i32* %3
br label %159
159: ; preds = %155, %154, %133, %115, %104, %74, %69, %64, %59, %43, %36, %29, %22
%160 = load i32, i32* %3
ret i32 %160
}

LLVM IR (-O2):
define i32 @roadmap_coord_to_binary(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = sext i8 %3 to i32
switch i32 %4, label %25 [
i32 45, label %5
i32 43, label %7
i32 87, label %9
i32 119, label %9
i32 69, label %13
i32 101, label %13
i32 83, label %17
i32 115, label %17
i32 78, label %21
i32 110, label %21
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %0, i64 1
br label %25
7: ; preds = %2
%8 = getelementptr inbounds i8, i8* %0, i64 1
br label %25
9: ; preds = %2, %2
%10 = icmp eq i32 %1, 0
br i1 %10, label %98, label %11
11: ; preds = %9
%12 = getelementptr inbounds i8, i8* %0, i64 1
br label %25
13: ; preds = %2, %2
%14 = icmp eq i32 %1, 0
br i1 %14, label %98, label %15
15: ; preds = %13
%16 = getelementptr inbounds i8, i8* %0, i64 1
br label %25
17: ; preds = %2, %2
%18 = icmp eq i32 %1, 0
br i1 %18, label %19, label %98
19: ; preds = %17
%20 = getelementptr inbounds i8, i8* %0, i64 1
br label %25
21: ; preds = %2, %2
%22 = icmp eq i32 %1, 0
br i1 %22, label %23, label %98
23: ; preds = %21
%24 = getelementptr inbounds i8, i8* %0, i64 1
br label %25
25: ; preds = %2, %23, %19, %15, %11, %7, %5
%26 = phi i8* [ %0, %2 ], [ %24, %23 ], [ %20, %19 ], [ %16, %15 ], [ %12, %11 ], [ %8, %7 ], [ %6, %5 ]
%27 = phi i32 [ 1, %2 ], [ 1, %23 ], [ -1, %19 ], [ 1, %15 ], [ -1, %11 ], [ 1, %7 ], [ -1, %5 ]
%28 = tail call i32 @strlen(i8* %26)
%29 = add nsw i32 %28, -1
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i8, i8* %26, i64 %30
%32 = load i8, i8* %31
%33 = sext i8 %32 to i32
switch i32 %33, label %42 [
i32 87, label %34
i32 119, label %34
i32 69, label %36
i32 101, label %36
i32 83, label %38
i32 115, label %38
i32 78, label %40
i32 110, label %40
]
34: ; preds = %25, %25
%35 = icmp eq i32 %1, 0
br i1 %35, label %98, label %42
36: ; preds = %25, %25
%37 = icmp eq i32 %1, 0
br i1 %37, label %98, label %42
38: ; preds = %25, %25
%39 = icmp eq i32 %1, 0
br i1 %39, label %42, label %98
40: ; preds = %25, %25
%41 = icmp eq i32 %1, 0
br i1 %41, label %42, label %98
42: ; preds = %40, %38, %36, %34, %25
%43 = phi i32 [ %27, %25 ], [ -1, %34 ], [ 1, %36 ], [ -1, %38 ], [ 1, %40 ]
%44 = tail call i8* @strchr(i8* %26, i8 signext 46)
%45 = icmp eq i8* %44, null
br i1 %45, label %46, label %50
46: ; preds = %42
%47 = tail call i32 @strlen(i8* %26)
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds i8, i8* %26, i64 %48
br label %56
50: ; preds = %42
%51 = ptrtoint i8* %44 to i64
%52 = ptrtoint i8* %26 to i64
%53 = sub i64 %51, %52
%54 = trunc i64 %53 to i32
%55 = getelementptr inbounds i8, i8* %44, i64 1
br label %56
56: ; preds = %50, %46
%57 = phi i32 [ %47, %46 ], [ %54, %50 ]
%58 = phi i8* [ %49, %46 ], [ %55, %50 ]
%59 = tail call i32 @atoi(i8* %26)
switch i32 %57, label %98 [
i32 3, label %60
i32 1, label %62
i32 2, label %62
i32 5, label %66
i32 4, label %68
i32 7, label %78
i32 6, label %80
]
60: ; preds = %56
%61 = icmp eq i32 %1, 0
br i1 %61, label %98, label %62
62: ; preds = %60, %56, %56
%63 = mul nsw i32 %59, 1000000
%64 = tail call i32 @roadmap_coord_fraction(i8* %58)
%65 = add nsw i32 %64, %63
br label %95
66: ; preds = %56
%67 = icmp eq i32 %1, 0
br i1 %67, label %98, label %68
68: ; preds = %66, %56
%69 = sdiv i32 %59, 100
%70 = mul nsw i32 %69, 1000000
%71 = srem i32 %59, 100
%72 = mul nsw i32 %71, 1000000
%73 = sdiv i32 %72, 60
%74 = add nsw i32 %73, %70
%75 = tail call i32 @roadmap_coord_fraction(i8* %58)
%76 = sdiv i32 %75, 60
%77 = add nsw i32 %74, %76
br label %95
78: ; preds = %56
%79 = icmp eq i32 %1, 0
br i1 %79, label %98, label %80
80: ; preds = %78, %56
%81 = sdiv i32 %59, 10000
%82 = mul nsw i32 %81, 1000000
%83 = sdiv i32 %59, 100
%84 = srem i32 %83, 100
%85 = mul nsw i32 %84, 1000000
%86 = sdiv i32 %85, 60
%87 = srem i32 %59, 100
%88 = mul nsw i32 %87, 1000000
%89 = sdiv i32 %88, 3600
%90 = tail call i32 @roadmap_coord_fraction(i8* %58)
%91 = sdiv i32 %90, 3600
%92 = add i32 %89, %82
%93 = add i32 %92, %86
%94 = add i32 %93, %91
br label %95
95: ; preds = %80, %68, %62
%96 = phi i32 [ %94, %80 ], [ %77, %68 ], [ %65, %62 ]
%97 = mul nsw i32 %96, %43
br label %98
98: ; preds = %56, %78, %66, %60, %40, %38, %36, %34, %21, %17, %13, %9, %95
%99 = phi i32 [ %97, %95 ], [ 181000000, %9 ], [ 181000000, %13 ], [ 181000000, %17 ], [ 181000000, %21 ], [ 181000000, %34 ], [ 181000000, %36 ], [ 181000000, %38 ], [ 181000000, %40 ], [ 181000000, %60 ], [ 181000000, %66 ], [ 181000000, %78 ], [ 181000000, %56 ]
ret i32 %99
}