#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*/ roadmap_log(int, char *, int, char *, char const);
int roadmap_math_street_address(const char *image, int length) {
  int i;
  int digit;
  int result = 0;
  if ((length > 8) && ((image[0] == 'W') || (image[0] == 'E') ||
                       (image[0] == 'S') || (image[0] == 'N'))) {
    int separator = 0;
    int part1 = 0;
    int part2 = 0;
    int multiplier = 10;
    for (i = length - 1; i > 0; --i) {
      if ((image[i] == 'W') || (image[i] == 'E') || (image[i] == 'S') ||
          (image[i] == 'N') || (image[i] == '-')) {
        separator = i;
      }
    }
    for (i = 1; i < separator; ++i) {
      if (image[i] < '0' || image[i] > '9') {
        roadmap_log(3,
                    "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                    "outputs/2022-01-22/02-19-57/repos/maximuska/Freemap-waze/"
                    "refs/heads/master/roadmap_math.c",
                    1488, "bad numerical character %c", image[i]);
      }
      part1 = (part1 * 10) + (image[i] - '0');
    }
    for (i = separator + 1; i < length; ++i) {
      if (image[i] < '0' || image[i] > '9') {
        roadmap_log(4,
                    "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                    "outputs/2022-01-22/02-19-57/repos/maximuska/Freemap-waze/"
                    "refs/heads/master/roadmap_math.c",
                    1496, "bad numerical character %c", image[i]);
      }
      part2 = (part2 * 10) + (image[i] - '0');
      multiplier *= 10;
    }
    return (part1 * multiplier) + part2;
  }
  for (i = 0; i < length; i++) {
    digit = image[i];
    if ((digit < '0') || (digit > '9')) {
      if (length >= 9) {
        continue;
      } else if (digit == '-' || digit == ' ') {
        continue;
      } else if (digit >= 'A' && digit <= 'Z') {
        digit = '1' + digit - 'A';
      } else if (digit >= 'a' && digit <= 'z') {
        digit = '1' + digit - 'a';
      } else {
        roadmap_log(4,
                    "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                    "outputs/2022-01-22/02-19-57/repos/maximuska/Freemap-waze/"
                    "refs/heads/master/roadmap_math.c",
                    1520, "bad numerical character %c", digit);
        continue;
      }
    }
    result = (result * 10) + (digit - '0');
  }
  return result;
}


x86 assembly (clang, -O0):
<roadmap_math_street_address>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x20(%rbp)
cmpl   $0x8,-0x14(%rbp)
jle    1356 <roadmap_math_street_address+0x246>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x57,%eax
je     1170 <roadmap_math_street_address+0x60>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x45,%eax
je     1170 <roadmap_math_street_address+0x60>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x53,%eax
je     1170 <roadmap_math_street_address+0x60>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x4e,%eax
jne    1356 <roadmap_math_street_address+0x246>
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
movl   $0xa,-0x30(%rbp)
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jle    1221 <roadmap_math_street_address+0x111>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x57,%eax
je     1208 <roadmap_math_street_address+0xf8>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x45,%eax
je     1208 <roadmap_math_street_address+0xf8>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x53,%eax
je     1208 <roadmap_math_street_address+0xf8>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x4e,%eax
je     1208 <roadmap_math_street_address+0xf8>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2d,%eax
jne    120e <roadmap_math_street_address+0xfe>
mov    -0x18(%rbp),%eax
mov    %eax,-0x24(%rbp)
jmp    1213 <roadmap_math_street_address+0x103>
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
jmp    1195 <roadmap_math_street_address+0x85>
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    12ae <roadmap_math_street_address+0x19e>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x30,%eax
jl     125e <roadmap_math_street_address+0x14e>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x39,%eax
jle    1288 <roadmap_math_street_address+0x178>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%r8
mov    $0x3,%edi
lea    0xd8e(%rip),%rsi
mov    $0x5d0,%edx
lea    0xe14(%rip),%rcx
movsbl (%rax,%r8,1),%r8d
call   1030 <roadmap_log@plt>
imul   $0xa,-0x28(%rbp),%eax
mov    -0x10(%rbp),%rcx
movslq -0x18(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
sub    $0x30,%ecx
add    %ecx,%eax
mov    %eax,-0x28(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1228 <roadmap_math_street_address+0x118>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1344 <roadmap_math_street_address+0x234>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x30,%eax
jl     12ed <roadmap_math_street_address+0x1dd>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x39,%eax
jle    1317 <roadmap_math_street_address+0x207>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%r8
mov    $0x4,%edi
lea    0xcff(%rip),%rsi
mov    $0x5d8,%edx
lea    0xd85(%rip),%rcx
movsbl (%rax,%r8,1),%r8d
call   1030 <roadmap_log@plt>
imul   $0xa,-0x2c(%rbp),%eax
mov    -0x10(%rbp),%rcx
movslq -0x18(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
sub    $0x30,%ecx
add    %ecx,%eax
mov    %eax,-0x2c(%rbp)
imul   $0xa,-0x30(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    12b7 <roadmap_math_street_address+0x1a7>
mov    -0x28(%rbp),%eax
imul   -0x30(%rbp),%eax
add    -0x2c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    145e <roadmap_math_street_address+0x34e>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1458 <roadmap_math_street_address+0x348>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x30,-0x1c(%rbp)
jl     138c <roadmap_math_street_address+0x27c>
cmpl   $0x39,-0x1c(%rbp)
jle    143b <roadmap_math_street_address+0x32b>
cmpl   $0x9,-0x14(%rbp)
jl     139b <roadmap_math_street_address+0x28b>
jmp    144a <roadmap_math_street_address+0x33a>
cmpl   $0x2d,-0x1c(%rbp)
je     13af <roadmap_math_street_address+0x29f>
cmpl   $0x20,-0x1c(%rbp)
jne    13b4 <roadmap_math_street_address+0x2a4>
jmp    144a <roadmap_math_street_address+0x33a>
cmpl   $0x41,-0x1c(%rbp)
jl     13d9 <roadmap_math_street_address+0x2c9>
cmpl   $0x5a,-0x1c(%rbp)
jg     13d9 <roadmap_math_street_address+0x2c9>
mov    -0x1c(%rbp),%eax
add    $0x31,%eax
sub    $0x41,%eax
mov    %eax,-0x1c(%rbp)
jmp    142c <roadmap_math_street_address+0x31c>
cmpl   $0x61,-0x1c(%rbp)
jl     13fe <roadmap_math_street_address+0x2ee>
cmpl   $0x7a,-0x1c(%rbp)
jg     13fe <roadmap_math_street_address+0x2ee>
mov    -0x1c(%rbp),%eax
add    $0x31,%eax
sub    $0x61,%eax
mov    %eax,-0x1c(%rbp)
jmp    1427 <roadmap_math_street_address+0x317>
mov    -0x1c(%rbp),%eax
mov    $0x4,%edi
lea    0xbf3(%rip),%rsi
mov    $0x5f0,%edx
lea    0xc79(%rip),%rcx
movsbl %al,%r8d
call   1030 <roadmap_log@plt>
jmp    144a <roadmap_math_street_address+0x33a>
jmp    142c <roadmap_math_street_address+0x31c>
jmp    1431 <roadmap_math_street_address+0x321>
jmp    1436 <roadmap_math_street_address+0x326>
jmp    143b <roadmap_math_street_address+0x32b>
imul   $0xa,-0x20(%rbp),%eax
mov    -0x1c(%rbp),%ecx
sub    $0x30,%ecx
add    %ecx,%eax
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    135d <roadmap_math_street_address+0x24d>
mov    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<roadmap_math_street_address>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %rdi,%r13
cmp    $0x9,%esi
jl     1186 <roadmap_math_street_address+0x76>
mov    0x0(%r13),%al
add    $0xbb,%al
cmp    $0x12,%al
ja     118f <roadmap_math_street_address+0x7f>
movzbl %al,%eax
mov    $0x44201,%ecx
bt     %rax,%rcx
jae    118f <roadmap_math_street_address+0x7f>
mov    %r14d,%eax
xor    %r12d,%r12d
movabs $0x44201000001,%rcx
jmp    115e <roadmap_math_street_address+0x4e>
lea    0x1(%rax),%rdx
cmp    $0x2,%rdx
jbe    1219 <roadmap_math_street_address+0x109>
mov    %rax,%rdx
add    $0xffffffffffffffff,%rax
mov    %eax,%esi
movzbl 0x0(%r13,%rsi,1),%ebx
add    $0xd3,%bl
cmp    $0x2a,%bl
ja     1150 <roadmap_math_street_address+0x40>
movzbl %bl,%esi
bt     %rsi,%rcx
jae    1150 <roadmap_math_street_address+0x40>
add    $0xffffffff,%edx
mov    %edx,%r12d
jmp    1150 <roadmap_math_street_address+0x40>
test   %r14d,%r14d
jle    131d <roadmap_math_street_address+0x20d>
mov    %r14d,%ebx
xor    %r15d,%r15d
lea    0xef6(%rip),%r12
xor    %ebp,%ebp
jmp    11c8 <roadmap_math_street_address+0xb8>
add    $0xfffffff0,%r8d
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    0x0(%rbp,%rbp,4),%eax
lea    (%r8,%rax,2),%ebp
add    $0xffffffd0,%ebp
add    $0x1,%r15
cmp    %r15,%rbx
je     131f <roadmap_math_street_address+0x20f>
movsbl 0x0(%r13,%r15,1),%r8d
lea    -0x3a(%r8),%eax
cmp    $0xf5,%al
ja     11b0 <roadmap_math_street_address+0xa0>
cmp    $0x8,%r14d
jg     11bb <roadmap_math_street_address+0xab>
cmp    $0x20,%r8b
je     11bb <roadmap_math_street_address+0xab>
cmp    $0x2d,%r8b
je     11bb <roadmap_math_street_address+0xab>
lea    -0x41(%r8),%eax
cmp    $0x19,%al
jbe    11a0 <roadmap_math_street_address+0x90>
lea    -0x61(%r8),%eax
cmp    $0x19,%al
ja     11fe <roadmap_math_street_address+0xee>
add    $0xffffffd0,%r8d
jmp    11b0 <roadmap_math_street_address+0xa0>
mov    $0x4,%edi
lea    0xdf6(%rip),%rsi
mov    $0x5f0,%edx
mov    %r12,%rcx
call   1030 <roadmap_log@plt>
jmp    11bb <roadmap_math_street_address+0xab>
mov    %r14d,0x4(%rsp)
xor    %r15d,%r15d
mov    $0x0,%ebx
cmp    $0x2,%r12d
jl     128c <roadmap_math_street_address+0x17c>
mov    %r12d,%ebp
xor    %ebx,%ebx
mov    $0x1,%r14d
jmp    1255 <roadmap_math_street_address+0x145>
nopl   0x0(%rax)
lea    (%rbx,%rbx,4),%ecx
movsbl %al,%eax
lea    (%rax,%rcx,2),%ebx
add    $0xffffffd0,%ebx
add    $0x1,%r14
cmp    %r14,%rbp
je     128c <roadmap_math_street_address+0x17c>
movzbl 0x0(%r13,%r14,1),%eax
lea    -0x3a(%rax),%ecx
cmp    $0xf5,%cl
ja     1240 <roadmap_math_street_address+0x130>
movsbl %al,%r8d
mov    $0x3,%edi
lea    0xd8d(%rip),%rsi
mov    $0x5d0,%edx
lea    0xe13(%rip),%rcx
call   1030 <roadmap_log@plt>
movzbl 0x0(%r13,%r14,1),%eax
jmp    1240 <roadmap_math_street_address+0x130>
lea    0x1(%r12),%eax
mov    $0xa,%ebp
mov    0x4(%rsp),%ecx
cmp    %ecx,%eax
jge    1315 <roadmap_math_street_address+0x205>
cltq
add    %rax,%r13
not    %r12d
add    %ecx,%r12d
xor    %r14d,%r14d
mov    $0xa,%ebp
xor    %r15d,%r15d
jmp    12de <roadmap_math_street_address+0x1ce>
cs nopw 0x0(%rax,%rax,1)
lea    (%r15,%r15,4),%ecx
movsbl %al,%eax
lea    (%rax,%rcx,2),%r15d
add    $0xffffffd0,%r15d
add    %ebp,%ebp
lea    0x0(%rbp,%rbp,4),%ebp
add    $0x1,%r14
cmp    %r14d,%r12d
je     1315 <roadmap_math_street_address+0x205>
movzbl 0x0(%r13,%r14,1),%eax
lea    -0x3a(%rax),%ecx
cmp    $0xf5,%cl
ja     12c0 <roadmap_math_street_address+0x1b0>
movsbl %al,%r8d
mov    $0x4,%edi
lea    0xd04(%rip),%rsi
mov    $0x5d8,%edx
lea    0xd8a(%rip),%rcx
call   1030 <roadmap_log@plt>
movzbl 0x0(%r13,%r14,1),%eax
jmp    12c0 <roadmap_math_street_address+0x1b0>
imul   %ebx,%ebp
add    %r15d,%ebp
jmp    131f <roadmap_math_street_address+0x20f>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [146 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/maximuska/Freemap-waze/refs/heads/master/roadmap_math.c\00"
@.str.1 = [27 x i8] c"bad numerical character %c\00"
define i32 @roadmap_math_street_address(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 0, i32* %8
%13 = load i32, i32* %5
%14 = icmp sgt i32 %13, 8
br i1 %14, label %15, label %185
15: ; preds = %2
%16 = load i8*, i8** %4
%17 = getelementptr inbounds i8, i8* %16, i64 0
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 87
br i1 %20, label %39, label %21
21: ; preds = %15
%22 = load i8*, i8** %4
%23 = getelementptr inbounds i8, i8* %22, i64 0
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, 69
br i1 %26, label %39, label %27
27: ; preds = %21
%28 = load i8*, i8** %4
%29 = getelementptr inbounds i8, i8* %28, i64 0
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = icmp eq i32 %31, 83
br i1 %32, label %39, label %33
33: ; preds = %27
%34 = load i8*, i8** %4
%35 = getelementptr inbounds i8, i8* %34, i64 0
%36 = load i8, i8* %35
%37 = sext i8 %36 to i32
%38 = icmp eq i32 %37, 78
br i1 %38, label %39, label %185
39: ; preds = %33, %27, %21, %15
store i32 0, i32* %9
store i32 0, i32* %10
store i32 0, i32* %11
store i32 10, i32* %12
%40 = load i32, i32* %5
%41 = sub nsw i32 %40, 1
store i32 %41, i32* %6
br label %42
42: ; preds = %88, %39
%43 = load i32, i32* %6
%44 = icmp sgt i32 %43, 0
br i1 %44, label %45, label %91
45: ; preds = %42
%46 = load i8*, i8** %4
%47 = load i32, i32* %6
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds i8, i8* %46, i64 %48
%50 = load i8, i8* %49
%51 = sext i8 %50 to i32
%52 = icmp eq i32 %51, 87
br i1 %52, label %85, label %53
53: ; preds = %45
%54 = load i8*, i8** %4
%55 = load i32, i32* %6
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds i8, i8* %54, i64 %56
%58 = load i8, i8* %57
%59 = sext i8 %58 to i32
%60 = icmp eq i32 %59, 69
br i1 %60, label %85, label %61
61: ; preds = %53
%62 = load i8*, i8** %4
%63 = load i32, i32* %6
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds i8, i8* %62, i64 %64
%66 = load i8, i8* %65
%67 = sext i8 %66 to i32
%68 = icmp eq i32 %67, 83
br i1 %68, label %85, label %69
69: ; preds = %61
%70 = load i8*, i8** %4
%71 = load i32, i32* %6
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds i8, i8* %70, i64 %72
%74 = load i8, i8* %73
%75 = sext i8 %74 to i32
%76 = icmp eq i32 %75, 78
br i1 %76, label %85, label %77
77: ; preds = %69
%78 = load i8*, i8** %4
%79 = load i32, i32* %6
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds i8, i8* %78, i64 %80
%82 = load i8, i8* %81
%83 = sext i8 %82 to i32
%84 = icmp eq i32 %83, 45
br i1 %84, label %85, label %87
85: ; preds = %77, %69, %61, %53, %45
%86 = load i32, i32* %6
store i32 %86, i32* %9
br label %87
87: ; preds = %85, %77
br label %88
88: ; preds = %87
%89 = load i32, i32* %6
%90 = add nsw i32 %89, -1
store i32 %90, i32* %6
br label %42
91: ; preds = %42
store i32 1, i32* %6
br label %92
92: ; preds = %130, %91
%93 = load i32, i32* %6
%94 = load i32, i32* %9
%95 = icmp slt i32 %93, %94
br i1 %95, label %96, label %133
96: ; preds = %92
%97 = load i8*, i8** %4
%98 = load i32, i32* %6
%99 = sext i32 %98 to i64
%100 = getelementptr inbounds i8, i8* %97, i64 %99
%101 = load i8, i8* %100
%102 = sext i8 %101 to i32
%103 = icmp slt i32 %102, 48
br i1 %103, label %112, label %104
104: ; preds = %96
%105 = load i8*, i8** %4
%106 = load i32, i32* %6
%107 = sext i32 %106 to i64
%108 = getelementptr inbounds i8, i8* %105, i64 %107
%109 = load i8, i8* %108
%110 = sext i8 %109 to i32
%111 = icmp sgt i32 %110, 57
br i1 %111, label %112, label %119
112: ; preds = %104, %96
%113 = load i8*, i8** %4
%114 = load i32, i32* %6
%115 = sext i32 %114 to i64
%116 = getelementptr inbounds i8, i8* %113, i64 %115
%117 = load i8, i8* %116
%118 = call i32 @roadmap_log(i32 3, i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str, i64 0, i64 0), i32 1488, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8 signext %117)
br label %119
119: ; preds = %112, %104
%120 = load i32, i32* %10
%121 = mul nsw i32 %120, 10
%122 = load i8*, i8** %4
%123 = load i32, i32* %6
%124 = sext i32 %123 to i64
%125 = getelementptr inbounds i8, i8* %122, i64 %124
%126 = load i8, i8* %125
%127 = sext i8 %126 to i32
%128 = sub nsw i32 %127, 48
%129 = add nsw i32 %121, %128
store i32 %129, i32* %10
br label %130
130: ; preds = %119
%131 = load i32, i32* %6
%132 = add nsw i32 %131, 1
store i32 %132, i32* %6
br label %92
133: ; preds = %92
%134 = load i32, i32* %9
%135 = add nsw i32 %134, 1
store i32 %135, i32* %6
br label %136
136: ; preds = %176, %133
%137 = load i32, i32* %6
%138 = load i32, i32* %5
%139 = icmp slt i32 %137, %138
br i1 %139, label %140, label %179
140: ; preds = %136
%141 = load i8*, i8** %4
%142 = load i32, i32* %6
%143 = sext i32 %142 to i64
%144 = getelementptr inbounds i8, i8* %141, i64 %143
%145 = load i8, i8* %144
%146 = sext i8 %145 to i32
%147 = icmp slt i32 %146, 48
br i1 %147, label %156, label %148
148: ; preds = %140
%149 = load i8*, i8** %4
%150 = load i32, i32* %6
%151 = sext i32 %150 to i64
%152 = getelementptr inbounds i8, i8* %149, i64 %151
%153 = load i8, i8* %152
%154 = sext i8 %153 to i32
%155 = icmp sgt i32 %154, 57
br i1 %155, label %156, label %163
156: ; preds = %148, %140
%157 = load i8*, i8** %4
%158 = load i32, i32* %6
%159 = sext i32 %158 to i64
%160 = getelementptr inbounds i8, i8* %157, i64 %159
%161 = load i8, i8* %160
%162 = call i32 @roadmap_log(i32 4, i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str, i64 0, i64 0), i32 1496, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8 signext %161)
br label %163
163: ; preds = %156, %148
%164 = load i32, i32* %11
%165 = mul nsw i32 %164, 10
%166 = load i8*, i8** %4
%167 = load i32, i32* %6
%168 = sext i32 %167 to i64
%169 = getelementptr inbounds i8, i8* %166, i64 %168
%170 = load i8, i8* %169
%171 = sext i8 %170 to i32
%172 = sub nsw i32 %171, 48
%173 = add nsw i32 %165, %172
store i32 %173, i32* %11
%174 = load i32, i32* %12
%175 = mul nsw i32 %174, 10
store i32 %175, i32* %12
br label %176
176: ; preds = %163
%177 = load i32, i32* %6
%178 = add nsw i32 %177, 1
store i32 %178, i32* %6
br label %136
179: ; preds = %136
%180 = load i32, i32* %10
%181 = load i32, i32* %12
%182 = mul nsw i32 %180, %181
%183 = load i32, i32* %11
%184 = add nsw i32 %182, %183
store i32 %184, i32* %3
br label %252
185: ; preds = %33, %2
store i32 0, i32* %6
br label %186
186: ; preds = %247, %185
%187 = load i32, i32* %6
%188 = load i32, i32* %5
%189 = icmp slt i32 %187, %188
br i1 %189, label %190, label %250
190: ; preds = %186
%191 = load i8*, i8** %4
%192 = load i32, i32* %6
%193 = sext i32 %192 to i64
%194 = getelementptr inbounds i8, i8* %191, i64 %193
%195 = load i8, i8* %194
%196 = sext i8 %195 to i32
store i32 %196, i32* %7
%197 = load i32, i32* %7
%198 = icmp slt i32 %197, 48
br i1 %198, label %202, label %199
199: ; preds = %190
%200 = load i32, i32* %7
%201 = icmp sgt i32 %200, 57
br i1 %201, label %202, label %241
202: ; preds = %199, %190
%203 = load i32, i32* %5
%204 = icmp sge i32 %203, 9
br i1 %204, label %205, label %206
205: ; preds = %202
br label %247
206: ; preds = %202
%207 = load i32, i32* %7
%208 = icmp eq i32 %207, 45
br i1 %208, label %212, label %209
209: ; preds = %206
%210 = load i32, i32* %7
%211 = icmp eq i32 %210, 32
br i1 %211, label %212, label %213
212: ; preds = %209, %206
br label %247
213: ; preds = %209
%214 = load i32, i32* %7
%215 = icmp sge i32 %214, 65
br i1 %215, label %216, label %223
216: ; preds = %213
%217 = load i32, i32* %7
%218 = icmp sle i32 %217, 90
br i1 %218, label %219, label %223
219: ; preds = %216
%220 = load i32, i32* %7
%221 = add nsw i32 49, %220
%222 = sub nsw i32 %221, 65
store i32 %222, i32* %7
br label %238
223: ; preds = %216, %213
%224 = load i32, i32* %7
%225 = icmp sge i32 %224, 97
br i1 %225, label %226, label %233
226: ; preds = %223
%227 = load i32, i32* %7
%228 = icmp sle i32 %227, 122
br i1 %228, label %229, label %233
229: ; preds = %226
%230 = load i32, i32* %7
%231 = add nsw i32 49, %230
%232 = sub nsw i32 %231, 97
store i32 %232, i32* %7
br label %237
233: ; preds = %226, %223
%234 = load i32, i32* %7
%235 = trunc i32 %234 to i8
%236 = call i32 @roadmap_log(i32 4, i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str, i64 0, i64 0), i32 1520, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8 signext %235)
br label %247
237: ; preds = %229
br label %238
238: ; preds = %237, %219
br label %239
239: ; preds = %238
br label %240
240: ; preds = %239
br label %241
241: ; preds = %240, %199
%242 = load i32, i32* %8
%243 = mul nsw i32 %242, 10
%244 = load i32, i32* %7
%245 = sub nsw i32 %244, 48
%246 = add nsw i32 %243, %245
store i32 %246, i32* %8
br label %247
247: ; preds = %241, %233, %212, %205
%248 = load i32, i32* %6
%249 = add nsw i32 %248, 1
store i32 %249, i32* %6
br label %186
250: ; preds = %186
%251 = load i32, i32* %8
store i32 %251, i32* %3
br label %252
252: ; preds = %250, %179
%253 = load i32, i32* %3
ret i32 %253
}

LLVM IR (-O2):
@.str = [146 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/maximuska/Freemap-waze/refs/heads/master/roadmap_math.c\00"
@.str.1 = [27 x i8] c"bad numerical character %c\00"
define i32 @roadmap_math_street_address(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 8
br i1 %3, label %4, label %74
4: ; preds = %2
%5 = load i8, i8* %0
switch i8 %5, label %76 [
i8 87, label %6
i8 69, label %6
i8 83, label %6
i8 78, label %6
]
6: ; preds = %4, %4, %4, %4
%7 = zext i32 %1 to i64
br label %12
8: ; preds = %21
%9 = icmp sgt i32 %22, 1
br i1 %9, label %10, label %24
10: ; preds = %8
%11 = zext i32 %22 to i64
br label %30
12: ; preds = %6, %21
%13 = phi i64 [ %7, %6 ], [ %15, %21 ]
%14 = phi i32 [ 0, %6 ], [ %22, %21 ]
%15 = add nsw i64 %13, -1
%16 = and i64 %15, 4294967295
%17 = getelementptr inbounds i8, i8* %0, i64 %16
%18 = load i8, i8* %17
switch i8 %18, label %21 [
i8 87, label %19
i8 69, label %19
i8 83, label %19
i8 78, label %19
i8 45, label %19
]
19: ; preds = %12, %12, %12, %12, %12
%20 = trunc i64 %15 to i32
br label %21
21: ; preds = %12, %19
%22 = phi i32 [ %20, %19 ], [ %14, %12 ]
%23 = icmp ugt i64 %13, 2
br i1 %23, label %12, label %8
24: ; preds = %40, %8
%25 = phi i32 [ 0, %8 ], [ %45, %40 ]
%26 = add i32 %22, 1
%27 = icmp slt i32 %26, %1
br i1 %27, label %28, label %69
28: ; preds = %24
%29 = sext i32 %26 to i64
br label %48
30: ; preds = %10, %40
%31 = phi i64 [ 1, %10 ], [ %46, %40 ]
%32 = phi i32 [ 0, %10 ], [ %45, %40 ]
%33 = getelementptr inbounds i8, i8* %0, i64 %31
%34 = load i8, i8* %33
%35 = add i8 %34, -58
%36 = icmp ult i8 %35, -10
br i1 %36, label %37, label %40
37: ; preds = %30
%38 = tail call i32 @roadmap_log(i32 3, i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str, i64 0, i64 0), i32 1488, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8 signext %34)
%39 = load i8, i8* %33
br label %40
40: ; preds = %30, %37
%41 = phi i8 [ %34, %30 ], [ %39, %37 ]
%42 = mul nsw i32 %32, 10
%43 = sext i8 %41 to i32
%44 = add i32 %42, -48
%45 = add i32 %44, %43
%46 = add nuw nsw i64 %31, 1
%47 = icmp eq i64 %46, %11
br i1 %47, label %24, label %30
48: ; preds = %28, %59
%49 = phi i64 [ %29, %28 ], [ %66, %59 ]
%50 = phi i32 [ 10, %28 ], [ %65, %59 ]
%51 = phi i32 [ 0, %28 ], [ %64, %59 ]
%52 = getelementptr inbounds i8, i8* %0, i64 %49
%53 = load i8, i8* %52
%54 = add i8 %53, -58
%55 = icmp ult i8 %54, -10
br i1 %55, label %56, label %59
56: ; preds = %48
%57 = tail call i32 @roadmap_log(i32 4, i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str, i64 0, i64 0), i32 1496, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8 signext %53)
%58 = load i8, i8* %52
br label %59
59: ; preds = %48, %56
%60 = phi i8 [ %53, %48 ], [ %58, %56 ]
%61 = mul nsw i32 %51, 10
%62 = sext i8 %60 to i32
%63 = add i32 %61, -48
%64 = add i32 %63, %62
%65 = mul nsw i32 %50, 10
%66 = add nsw i64 %49, 1
%67 = trunc i64 %66 to i32
%68 = icmp eq i32 %67, %1
br i1 %68, label %69, label %48
69: ; preds = %59, %24
%70 = phi i32 [ 0, %24 ], [ %64, %59 ]
%71 = phi i32 [ 10, %24 ], [ %65, %59 ]
%72 = mul nsw i32 %71, %25
%73 = add nsw i32 %72, %70
br label %109
74: ; preds = %2
%75 = icmp sgt i32 %1, 0
br i1 %75, label %76, label %109
76: ; preds = %4, %74
%77 = zext i32 %1 to i64
br label %78
78: ; preds = %76, %105
%79 = phi i64 [ 0, %76 ], [ %107, %105 ]
%80 = phi i32 [ 0, %76 ], [ %106, %105 ]
%81 = getelementptr inbounds i8, i8* %0, i64 %79
%82 = load i8, i8* %81
%83 = sext i8 %82 to i32
%84 = add i8 %82, -58
%85 = icmp ult i8 %84, -10
br i1 %85, label %86, label %100
86: ; preds = %78
br i1 %3, label %105, label %87
87: ; preds = %86
switch i8 %82, label %88 [
i8 45, label %105
i8 32, label %105
]
88: ; preds = %87
%89 = add i8 %82, -65
%90 = icmp ult i8 %89, 26
br i1 %90, label %91, label %93
91: ; preds = %88
%92 = add nsw i32 %83, -16
br label %100
93: ; preds = %88
%94 = add i8 %82, -97
%95 = icmp ult i8 %94, 26
br i1 %95, label %96, label %98
96: ; preds = %93
%97 = add nsw i32 %83, -48
br label %100
98: ; preds = %93
%99 = tail call i32 @roadmap_log(i32 4, i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str, i64 0, i64 0), i32 1520, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8 signext %82)
br label %105
100: ; preds = %91, %96, %78
%101 = phi i32 [ %92, %91 ], [ %97, %96 ], [ %83, %78 ]
%102 = mul nsw i32 %80, 10
%103 = add i32 %102, -48
%104 = add i32 %103, %101
br label %105
105: ; preds = %87, %87, %86, %100, %98
%106 = phi i32 [ %80, %86 ], [ %80, %87 ], [ %104, %100 ], [ %80, %98 ], [ %80, %87 ]
%107 = add nuw nsw i64 %79, 1
%108 = icmp eq i64 %107, %77
br i1 %108, label %109, label %78
109: ; preds = %105, %74, %69
%110 = phi i32 [ %73, %69 ], [ 0, %74 ], [ %106, %105 ]
ret i32 %110
}