#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*/ printf(char *);
void geofence_aprs_frequency(char *lat, char *lon) {
  if (lon[0] == '-' && ((lon[1] == '0' && lon[2] >= '4') || (lon[1] == '1'))) {
    printf("US\n");
  } else if (lon[0] == '+' &&
             ((lon[1] == '0' && lon[2] >= '9') || (lon[1] == '1'))) {
    printf("CN\n");
  } else {
    printf("EU\n");
  }
}


x86 assembly (clang, -O0):
<geofence_aprs_frequency>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    1174 <geofence_aprs_frequency+0x64>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x30,%eax
jne    1152 <geofence_aprs_frequency+0x42>
mov    -0x10(%rbp),%rax
movsbl 0x2(%rax),%eax
cmp    $0x34,%eax
jge    1163 <geofence_aprs_frequency+0x53>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x31,%eax
jne    1174 <geofence_aprs_frequency+0x64>
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
jmp    11d9 <geofence_aprs_frequency+0xc9>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2b,%eax
jne    11c8 <geofence_aprs_frequency+0xb8>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x30,%eax
jne    11a6 <geofence_aprs_frequency+0x96>
mov    -0x10(%rbp),%rax
movsbl 0x2(%rax),%eax
cmp    $0x39,%eax
jge    11b7 <geofence_aprs_frequency+0xa7>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x31,%eax
jne    11c8 <geofence_aprs_frequency+0xb8>
lea    0xe46(%rip),%rdi
call   1030 <printf@plt>
jmp    11d4 <geofence_aprs_frequency+0xc4>
lea    0xe39(%rip),%rdi
call   1030 <printf@plt>
jmp    11d9 <geofence_aprs_frequency+0xc9>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<geofence_aprs_frequency>:
mov    (%rsi),%al
cmp    $0x2b,%al
je     1137 <geofence_aprs_frequency+0x27>
cmp    $0x2d,%al
jne    114f <geofence_aprs_frequency+0x3f>
mov    0x1(%rsi),%al
lea    0xee2(%rip),%rdi
cmp    $0x31,%al
je     1132 <geofence_aprs_frequency+0x22>
cmp    $0x30,%al
jne    114f <geofence_aprs_frequency+0x3f>
cmpb   $0x33,0x2(%rsi)
jle    114f <geofence_aprs_frequency+0x3f>
jmp    1030 <puts@plt>
mov    0x1(%rsi),%al
lea    0xec2(%rip),%rdi
cmp    $0x31,%al
je     1132 <geofence_aprs_frequency+0x22>
cmp    $0x30,%al
jne    114f <geofence_aprs_frequency+0x3f>
cmpb   $0x38,0x2(%rsi)
jg     1132 <geofence_aprs_frequency+0x22>
lea    0xeaa(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"US\0A\00"
@.str.1 = [4 x i8] c"CN\0A\00"
@.str.2 = [4 x i8] c"EU\0A\00"
define void @geofence_aprs_frequency(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 45
br i1 %9, label %10, label %30
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = getelementptr inbounds i8, i8* %11, i64 1
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 48
br i1 %15, label %16, label %22
16: ; preds = %10
%17 = load i8*, i8** %4
%18 = getelementptr inbounds i8, i8* %17, i64 2
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = icmp sge i32 %20, 52
br i1 %21, label %28, label %22
22: ; preds = %16, %10
%23 = load i8*, i8** %4
%24 = getelementptr inbounds i8, i8* %23, i64 1
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = icmp eq i32 %26, 49
br i1 %27, label %28, label %30
28: ; preds = %22, %16
%29 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %59
30: ; preds = %22, %2
%31 = load i8*, i8** %4
%32 = getelementptr inbounds i8, i8* %31, i64 0
%33 = load i8, i8* %32
%34 = sext i8 %33 to i32
%35 = icmp eq i32 %34, 43
br i1 %35, label %36, label %56
36: ; preds = %30
%37 = load i8*, i8** %4
%38 = getelementptr inbounds i8, i8* %37, i64 1
%39 = load i8, i8* %38
%40 = sext i8 %39 to i32
%41 = icmp eq i32 %40, 48
br i1 %41, label %42, label %48
42: ; preds = %36
%43 = load i8*, i8** %4
%44 = getelementptr inbounds i8, i8* %43, i64 2
%45 = load i8, i8* %44
%46 = sext i8 %45 to i32
%47 = icmp sge i32 %46, 57
br i1 %47, label %54, label %48
48: ; preds = %42, %36
%49 = load i8*, i8** %4
%50 = getelementptr inbounds i8, i8* %49, i64 1
%51 = load i8, i8* %50
%52 = sext i8 %51 to i32
%53 = icmp eq i32 %52, 49
br i1 %53, label %54, label %56
54: ; preds = %48, %42
%55 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %58
56: ; preds = %48, %30
%57 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
br label %58
58: ; preds = %56, %54
br label %59
59: ; preds = %58, %28
ret void
}

LLVM IR (-O2):
@str = [3 x i8] c"EU\00"
@str.3 = [3 x i8] c"CN\00"
@str.4 = [3 x i8] c"US\00"
define void @geofence_aprs_frequency(i8* nocapture readnone %0, i8* nocapture %1) {
%3 = load i8, i8* %1
switch i8 %3, label %18 [
i8 45, label %4
i8 43, label %11
]
4: ; preds = %2
%5 = getelementptr inbounds i8, i8* %1, i64 1
%6 = load i8, i8* %5
switch i8 %6, label %18 [
i8 48, label %7
i8 49, label %19
]
7: ; preds = %4
%8 = getelementptr inbounds i8, i8* %1, i64 2
%9 = load i8, i8* %8
%10 = icmp sgt i8 %9, 51
br i1 %10, label %19, label %18
11: ; preds = %2
%12 = getelementptr inbounds i8, i8* %1, i64 1
%13 = load i8, i8* %12
switch i8 %13, label %18 [
i8 48, label %14
i8 49, label %19
]
14: ; preds = %11
%15 = getelementptr inbounds i8, i8* %1, i64 2
%16 = load i8, i8* %15
%17 = icmp sgt i8 %16, 56
br i1 %17, label %19, label %18
18: ; preds = %11, %2, %4, %14, %7
br label %19
19: ; preds = %14, %11, %7, %4, %18
%20 = phi i8* [ getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0), %18 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @str.4, i64 0, i64 0), %4 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @str.4, i64 0, i64 0), %7 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @str.3, i64 0, i64 0), %11 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @str.3, i64 0, i64 0), %14 ]
%21 = tail call i32 @puts(i8* dereferenceable(1) %20)
ret void
}