#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 code_table_3_1(unsigned char **);
unsigned char *flag_table_3_4_location(unsigned char **sec) {
  int grid_template, center;
  unsigned char *gds;
  gds = sec[3];
  grid_template = code_table_3_1(sec);
  center = ((int)((sec[1][5] << 8) + (sec[1][6])));
  switch (grid_template) {
  case 0:
  case 1:
  case 2:
  case 3:
  case 40:
  case 41:
  case 42:
  case 43:
    return gds + 71;
    break;
  case 4:
  case 5:
    return gds + 47;
    break;
  case 10:
  case 12:
    return gds + 59;
    break;
  case 20:
    return gds + 64;
    break;
  case 30:
  case 31:
    return gds + 64;
    break;
  case 50:
  case 51:
  case 52:
  case 53:
    return NULL;
    break;
  case 90:
  case 140:
    return gds + 63;
    break;
  case 110:
    return gds + 56;
    break;
  case 190:
  case 120:
    return gds + 38;
    break;
  case 204:
    return gds + 71;
    break;
  case 1000:
    return gds + 50;
    break;
  case 32768:
    if (center == 7)
      return gds + 71;
    return NULL;
    break;
  case 32769:
    if (center == 7)
      return gds + 71;
    return NULL;
    break;
  case 40110:
    if ((center == 34) || (center == 35))
      return gds + 56;
    return NULL;
    break;
  default:
    break;
  }
  return NULL;
}


x86 assembly (clang, -O0):
<flag_table_3_4_location>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <code_table_3_1@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movzwl 0x5(%rax),%eax
shl    $0x10,%eax
bswap  %eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x24(%rbp)
sub    $0x4,%eax
jb     1297 <flag_table_3_4_location+0x187>
jmp    115c <flag_table_3_4_location+0x4c>
mov    -0x24(%rbp),%eax
add    $0xfffffffc,%eax
sub    $0x2,%eax
jb     12a8 <flag_table_3_4_location+0x198>
jmp    1170 <flag_table_3_4_location+0x60>
mov    -0x24(%rbp),%eax
sub    $0xa,%eax
je     12b9 <flag_table_3_4_location+0x1a9>
jmp    1181 <flag_table_3_4_location+0x71>
mov    -0x24(%rbp),%eax
sub    $0xc,%eax
je     12b9 <flag_table_3_4_location+0x1a9>
jmp    1192 <flag_table_3_4_location+0x82>
mov    -0x24(%rbp),%eax
sub    $0x14,%eax
je     12ca <flag_table_3_4_location+0x1ba>
jmp    11a3 <flag_table_3_4_location+0x93>
mov    -0x24(%rbp),%eax
add    $0xffffffe2,%eax
sub    $0x2,%eax
jb     12db <flag_table_3_4_location+0x1cb>
jmp    11b7 <flag_table_3_4_location+0xa7>
mov    -0x24(%rbp),%eax
add    $0xffffffd8,%eax
sub    $0x4,%eax
jb     1297 <flag_table_3_4_location+0x187>
jmp    11cb <flag_table_3_4_location+0xbb>
mov    -0x24(%rbp),%eax
add    $0xffffffce,%eax
sub    $0x4,%eax
jb     12ec <flag_table_3_4_location+0x1dc>
jmp    11df <flag_table_3_4_location+0xcf>
mov    -0x24(%rbp),%eax
sub    $0x5a,%eax
je     12f9 <flag_table_3_4_location+0x1e9>
jmp    11f0 <flag_table_3_4_location+0xe0>
mov    -0x24(%rbp),%eax
sub    $0x6e,%eax
je     130a <flag_table_3_4_location+0x1fa>
jmp    1201 <flag_table_3_4_location+0xf1>
mov    -0x24(%rbp),%eax
sub    $0x78,%eax
je     131b <flag_table_3_4_location+0x20b>
jmp    1212 <flag_table_3_4_location+0x102>
mov    -0x24(%rbp),%eax
sub    $0x8c,%eax
je     12f9 <flag_table_3_4_location+0x1e9>
jmp    1225 <flag_table_3_4_location+0x115>
mov    -0x24(%rbp),%eax
sub    $0xbe,%eax
je     131b <flag_table_3_4_location+0x20b>
jmp    1238 <flag_table_3_4_location+0x128>
mov    -0x24(%rbp),%eax
sub    $0xcc,%eax
je     132c <flag_table_3_4_location+0x21c>
jmp    124b <flag_table_3_4_location+0x13b>
mov    -0x24(%rbp),%eax
sub    $0x3e8,%eax
je     133d <flag_table_3_4_location+0x22d>
jmp    125e <flag_table_3_4_location+0x14e>
mov    -0x24(%rbp),%eax
sub    $0x8000,%eax
je     134e <flag_table_3_4_location+0x23e>
jmp    1271 <flag_table_3_4_location+0x161>
mov    -0x24(%rbp),%eax
sub    $0x8001,%eax
je     1376 <flag_table_3_4_location+0x266>
jmp    1284 <flag_table_3_4_location+0x174>
mov    -0x24(%rbp),%eax
sub    $0x9cae,%eax
je     139e <flag_table_3_4_location+0x28e>
jmp    13d0 <flag_table_3_4_location+0x2c0>
mov    -0x20(%rbp),%rax
add    $0x47,%rax
mov    %rax,-0x8(%rbp)
jmp    13dd <flag_table_3_4_location+0x2cd>
mov    -0x20(%rbp),%rax
add    $0x2f,%rax
mov    %rax,-0x8(%rbp)
jmp    13dd <flag_table_3_4_location+0x2cd>
mov    -0x20(%rbp),%rax
add    $0x3b,%rax
mov    %rax,-0x8(%rbp)
jmp    13dd <flag_table_3_4_location+0x2cd>
mov    -0x20(%rbp),%rax
add    $0x40,%rax
mov    %rax,-0x8(%rbp)
jmp    13dd <flag_table_3_4_location+0x2cd>
mov    -0x20(%rbp),%rax
add    $0x40,%rax
mov    %rax,-0x8(%rbp)
jmp    13dd <flag_table_3_4_location+0x2cd>
movq   $0x0,-0x8(%rbp)
jmp    13dd <flag_table_3_4_location+0x2cd>
mov    -0x20(%rbp),%rax
add    $0x3f,%rax
mov    %rax,-0x8(%rbp)
jmp    13dd <flag_table_3_4_location+0x2cd>
mov    -0x20(%rbp),%rax
add    $0x38,%rax
mov    %rax,-0x8(%rbp)
jmp    13dd <flag_table_3_4_location+0x2cd>
mov    -0x20(%rbp),%rax
add    $0x26,%rax
mov    %rax,-0x8(%rbp)
jmp    13dd <flag_table_3_4_location+0x2cd>
mov    -0x20(%rbp),%rax
add    $0x47,%rax
mov    %rax,-0x8(%rbp)
jmp    13dd <flag_table_3_4_location+0x2cd>
mov    -0x20(%rbp),%rax
add    $0x32,%rax
mov    %rax,-0x8(%rbp)
jmp    13dd <flag_table_3_4_location+0x2cd>
cmpl   $0x7,-0x18(%rbp)
jne    1369 <flag_table_3_4_location+0x259>
mov    -0x20(%rbp),%rax
add    $0x47,%rax
mov    %rax,-0x8(%rbp)
jmp    13dd <flag_table_3_4_location+0x2cd>
movq   $0x0,-0x8(%rbp)
jmp    13dd <flag_table_3_4_location+0x2cd>
cmpl   $0x7,-0x18(%rbp)
jne    1391 <flag_table_3_4_location+0x281>
mov    -0x20(%rbp),%rax
add    $0x47,%rax
mov    %rax,-0x8(%rbp)
jmp    13dd <flag_table_3_4_location+0x2cd>
movq   $0x0,-0x8(%rbp)
jmp    13dd <flag_table_3_4_location+0x2cd>
cmpl   $0x22,-0x18(%rbp)
je     13b2 <flag_table_3_4_location+0x2a2>
cmpl   $0x23,-0x18(%rbp)
jne    13c3 <flag_table_3_4_location+0x2b3>
mov    -0x20(%rbp),%rax
add    $0x38,%rax
mov    %rax,-0x8(%rbp)
jmp    13dd <flag_table_3_4_location+0x2cd>
movq   $0x0,-0x8(%rbp)
jmp    13dd <flag_table_3_4_location+0x2cd>
jmp    13d5 <flag_table_3_4_location+0x2c5>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flag_table_3_4_location>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x18(%rdi),%r14
call   1030 <code_table_3_1@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x3e7,%ecx
jg     1153 <flag_table_3_4_location+0x43>
cmp    $0xcc,%ecx
ja     11d6 <flag_table_3_4_location+0xc6>
mov    %ecx,%ecx
lea    0xebf(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
add    $0x47,%r14
jmp    11d3 <flag_table_3_4_location+0xc3>
mov    0x8(%rbx),%rdx
movzwl 0x5(%rdx),%edx
shl    $0x10,%edx
bswap  %edx
cmp    $0x8000,%ecx
jg     1180 <flag_table_3_4_location+0x70>
cmp    $0x3e8,%ecx
je     11cf <flag_table_3_4_location+0xbf>
cmp    $0x8000,%ecx
je     11ba <flag_table_3_4_location+0xaa>
jmp    11d6 <flag_table_3_4_location+0xc6>
add    $0x40,%r14
jmp    11d3 <flag_table_3_4_location+0xc3>
cmp    $0x8001,%ecx
je     11ba <flag_table_3_4_location+0xaa>
cmp    $0x9cae,%ecx
jne    11d6 <flag_table_3_4_location+0xc6>
and    $0xfffffffe,%edx
add    $0x38,%r14
xor    %eax,%eax
cmp    $0x22,%edx
cmove  %r14,%rax
jmp    11d6 <flag_table_3_4_location+0xc6>
add    $0x2f,%r14
jmp    11d3 <flag_table_3_4_location+0xc3>
add    $0x3b,%r14
jmp    11d3 <flag_table_3_4_location+0xc3>
add    $0x3f,%r14
jmp    11d3 <flag_table_3_4_location+0xc3>
add    $0x26,%r14
jmp    11d3 <flag_table_3_4_location+0xc3>
add    $0x47,%r14
xor    %eax,%eax
cmp    $0x7,%edx
cmove  %r14,%rax
jmp    11d6 <flag_table_3_4_location+0xc6>
add    $0x38,%r14
jmp    11d3 <flag_table_3_4_location+0xc3>
add    $0x32,%r14
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @flag_table_3_4_location(i8** %0) {
%2 = alloca i8*
%3 = alloca i8**
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i8** %0, i8*** %3
%7 = load i8**, i8*** %3
%8 = getelementptr inbounds i8*, i8** %7, i64 3
%9 = load i8*, i8** %8
store i8* %9, i8** %6
%10 = load i8**, i8*** %3
%11 = call i32 @code_table_3_1(i8** %10)
store i32 %11, i32* %4
%12 = load i8**, i8*** %3
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = getelementptr inbounds i8, i8* %14, i64 5
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8**, i8*** %3
%20 = getelementptr inbounds i8*, i8** %19, i64 1
%21 = load i8*, i8** %20
%22 = getelementptr inbounds i8, i8* %21, i64 6
%23 = load i8, i8* %22
%24 = zext i8 %23 to i32
%25 = add nsw i32 %18, %24
store i32 %25, i32* %5
%26 = load i32, i32* %4
switch i32 %26, label %82 [
i32 0, label %27
i32 1, label %27
i32 2, label %27
i32 3, label %27
i32 40, label %27
i32 41, label %27
i32 42, label %27
i32 43, label %27
i32 4, label %30
i32 5, label %30
i32 10, label %33
i32 12, label %33
i32 20, label %36
i32 30, label %39
i32 31, label %39
i32 50, label %42
i32 51, label %42
i32 52, label %42
i32 53, label %42
i32 90, label %43
i32 140, label %43
i32 110, label %46
i32 190, label %49
i32 120, label %49
i32 204, label %52
i32 1000, label %55
i32 32768, label %58
i32 32769, label %65
i32 40110, label %72
]
27: ; preds = %1, %1, %1, %1, %1, %1, %1, %1
%28 = load i8*, i8** %6
%29 = getelementptr inbounds i8, i8* %28, i64 71
store i8* %29, i8** %2
br label %84
30: ; preds = %1, %1
%31 = load i8*, i8** %6
%32 = getelementptr inbounds i8, i8* %31, i64 47
store i8* %32, i8** %2
br label %84
33: ; preds = %1, %1
%34 = load i8*, i8** %6
%35 = getelementptr inbounds i8, i8* %34, i64 59
store i8* %35, i8** %2
br label %84
36: ; preds = %1
%37 = load i8*, i8** %6
%38 = getelementptr inbounds i8, i8* %37, i64 64
store i8* %38, i8** %2
br label %84
39: ; preds = %1, %1
%40 = load i8*, i8** %6
%41 = getelementptr inbounds i8, i8* %40, i64 64
store i8* %41, i8** %2
br label %84
42: ; preds = %1, %1, %1, %1
store i8* null, i8** %2
br label %84
43: ; preds = %1, %1
%44 = load i8*, i8** %6
%45 = getelementptr inbounds i8, i8* %44, i64 63
store i8* %45, i8** %2
br label %84
46: ; preds = %1
%47 = load i8*, i8** %6
%48 = getelementptr inbounds i8, i8* %47, i64 56
store i8* %48, i8** %2
br label %84
49: ; preds = %1, %1
%50 = load i8*, i8** %6
%51 = getelementptr inbounds i8, i8* %50, i64 38
store i8* %51, i8** %2
br label %84
52: ; preds = %1
%53 = load i8*, i8** %6
%54 = getelementptr inbounds i8, i8* %53, i64 71
store i8* %54, i8** %2
br label %84
55: ; preds = %1
%56 = load i8*, i8** %6
%57 = getelementptr inbounds i8, i8* %56, i64 50
store i8* %57, i8** %2
br label %84
58: ; preds = %1
%59 = load i32, i32* %5
%60 = icmp eq i32 %59, 7
br i1 %60, label %61, label %64
61: ; preds = %58
%62 = load i8*, i8** %6
%63 = getelementptr inbounds i8, i8* %62, i64 71
store i8* %63, i8** %2
br label %84
64: ; preds = %58
store i8* null, i8** %2
br label %84
65: ; preds = %1
%66 = load i32, i32* %5
%67 = icmp eq i32 %66, 7
br i1 %67, label %68, label %71
68: ; preds = %65
%69 = load i8*, i8** %6
%70 = getelementptr inbounds i8, i8* %69, i64 71
store i8* %70, i8** %2
br label %84
71: ; preds = %65
store i8* null, i8** %2
br label %84
72: ; preds = %1
%73 = load i32, i32* %5
%74 = icmp eq i32 %73, 34
br i1 %74, label %78, label %75
75: ; preds = %72
%76 = load i32, i32* %5
%77 = icmp eq i32 %76, 35
br i1 %77, label %78, label %81
78: ; preds = %75, %72
%79 = load i8*, i8** %6
%80 = getelementptr inbounds i8, i8* %79, i64 56
store i8* %80, i8** %2
br label %84
81: ; preds = %75
store i8* null, i8** %2
br label %84
82: ; preds = %1
br label %83
83: ; preds = %82
store i8* null, i8** %2
br label %84
84: ; preds = %83, %81, %78, %71, %68, %64, %61, %55, %52, %49, %46, %43, %42, %39, %36, %33, %30, %27
%85 = load i8*, i8** %2
ret i8* %85
}

LLVM IR (-O2):
define i8* @flag_table_3_4_location(i8** %0) {
%2 = getelementptr inbounds i8*, i8** %0, i64 3
%3 = load i8*, i8** %2
%4 = tail call i32 @code_table_3_1(i8** %0)
%5 = getelementptr inbounds i8*, i8** %0, i64 1
%6 = load i8*, i8** %5
%7 = getelementptr inbounds i8, i8* %6, i64 5
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = shl nuw nsw i32 %9, 8
%11 = getelementptr inbounds i8, i8* %6, i64 6
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = or i32 %10, %13
switch i32 %4, label %48 [
i32 0, label %15
i32 1, label %15
i32 2, label %15
i32 3, label %15
i32 40, label %15
i32 41, label %15
i32 42, label %15
i32 43, label %15
i32 4, label %17
i32 5, label %17
i32 10, label %19
i32 12, label %19
i32 20, label %21
i32 30, label %23
i32 31, label %23
i32 40110, label %43
i32 32769, label %39
i32 32768, label %35
i32 1000, label %33
i32 90, label %25
i32 140, label %25
i32 110, label %27
i32 190, label %29
i32 120, label %29
i32 204, label %31
]
15: ; preds = %1, %1, %1, %1, %1, %1, %1, %1
%16 = getelementptr inbounds i8, i8* %3, i64 71
br label %48
17: ; preds = %1, %1
%18 = getelementptr inbounds i8, i8* %3, i64 47
br label %48
19: ; preds = %1, %1
%20 = getelementptr inbounds i8, i8* %3, i64 59
br label %48
21: ; preds = %1
%22 = getelementptr inbounds i8, i8* %3, i64 64
br label %48
23: ; preds = %1, %1
%24 = getelementptr inbounds i8, i8* %3, i64 64
br label %48
25: ; preds = %1, %1
%26 = getelementptr inbounds i8, i8* %3, i64 63
br label %48
27: ; preds = %1
%28 = getelementptr inbounds i8, i8* %3, i64 56
br label %48
29: ; preds = %1, %1
%30 = getelementptr inbounds i8, i8* %3, i64 38
br label %48
31: ; preds = %1
%32 = getelementptr inbounds i8, i8* %3, i64 71
br label %48
33: ; preds = %1
%34 = getelementptr inbounds i8, i8* %3, i64 50
br label %48
35: ; preds = %1
%36 = icmp eq i32 %14, 7
%37 = getelementptr inbounds i8, i8* %3, i64 71
%38 = select i1 %36, i8* %37, i8* null
br label %48
39: ; preds = %1
%40 = icmp eq i32 %14, 7
%41 = getelementptr inbounds i8, i8* %3, i64 71
%42 = select i1 %40, i8* %41, i8* null
br label %48
43: ; preds = %1
%44 = and i32 %14, 65534
%45 = icmp eq i32 %44, 34
%46 = getelementptr inbounds i8, i8* %3, i64 56
%47 = select i1 %45, i8* %46, i8* null
br label %48
48: ; preds = %43, %39, %35, %1, %33, %31, %29, %27, %25, %23, %21, %19, %17, %15
%49 = phi i8* [ %34, %33 ], [ %32, %31 ], [ %30, %29 ], [ %28, %27 ], [ %26, %25 ], [ %24, %23 ], [ %22, %21 ], [ %20, %19 ], [ %18, %17 ], [ %16, %15 ], [ null, %1 ], [ %38, %35 ], [ %42, %39 ], [ %47, %43 ]
ret i8* %49
}