#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_5_location(unsigned char **sec) {
  unsigned char *gds;
  int center;
  gds = sec[3];
  center = ((int)((sec[1][5] << 8) + (sec[1][6])));
  switch (code_table_3_1(sec)) {
  case 20:
  case 30:
  case 31:
    return gds + 63;
    break;
  case 110:
    return gds + 55;
    break;
  case 40110:
    if ((center == 34) || (center == 35))
      return gds + 55;
    break;
  default:
    break;
  }
  return NULL;
}


x86 assembly (clang, -O0):
<flag_table_3_5_location>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movzwl 0x5(%rax),%eax
shl    $0x10,%eax
bswap  %eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <code_table_3_1@plt>
mov    %eax,%ecx
mov    %ecx,-0x20(%rbp)
sub    $0x14,%eax
je     1190 <flag_table_3_5_location+0x80>
jmp    1158 <flag_table_3_5_location+0x48>
mov    -0x20(%rbp),%eax
add    $0xffffffe2,%eax
sub    $0x2,%eax
jb     1190 <flag_table_3_5_location+0x80>
jmp    116c <flag_table_3_5_location+0x5c>
mov    -0x20(%rbp),%eax
sub    $0x6e,%eax
je     11a1 <flag_table_3_5_location+0x91>
jmp    117d <flag_table_3_5_location+0x6d>
mov    -0x20(%rbp),%eax
sub    $0x9cae,%eax
je     11b2 <flag_table_3_5_location+0xa2>
jmp    11dc <flag_table_3_5_location+0xcc>
mov    -0x18(%rbp),%rax
add    $0x3f,%rax
mov    %rax,-0x8(%rbp)
jmp    11e9 <flag_table_3_5_location+0xd9>
mov    -0x18(%rbp),%rax
add    $0x37,%rax
mov    %rax,-0x8(%rbp)
jmp    11e9 <flag_table_3_5_location+0xd9>
cmpl   $0x22,-0x1c(%rbp)
je     11c6 <flag_table_3_5_location+0xb6>
cmpl   $0x23,-0x1c(%rbp)
jne    11d7 <flag_table_3_5_location+0xc7>
mov    -0x18(%rbp),%rax
add    $0x37,%rax
mov    %rax,-0x8(%rbp)
jmp    11e9 <flag_table_3_5_location+0xd9>
jmp    11e1 <flag_table_3_5_location+0xd1>
jmp    11e1 <flag_table_3_5_location+0xd1>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flag_table_3_5_location>:
push   %rbp
push   %r14
push   %rbx
mov    0x8(%rdi),%rax
mov    0x18(%rdi),%rbx
movzbl 0x5(%rax),%r14d
movzbl 0x6(%rax),%ebp
call   1030 <code_table_3_1@plt>
cmp    $0x1f,%eax
ja     113f <flag_table_3_5_location+0x2f>
mov    $0xc0100000,%ecx
bt     %eax,%ecx
jae    113f <flag_table_3_5_location+0x2f>
add    $0x3f,%rbx
jmp    116c <flag_table_3_5_location+0x5c>
cmp    $0x6e,%eax
je     1164 <flag_table_3_5_location+0x54>
cmp    $0x9cae,%eax
jne    116a <flag_table_3_5_location+0x5a>
shl    $0x8,%r14d
and    $0xfffffffe,%ebp
or     %r14d,%ebp
add    $0x37,%rbx
xor    %eax,%eax
cmp    $0x22,%ebp
cmovne %rax,%rbx
jmp    116c <flag_table_3_5_location+0x5c>
add    $0x37,%rbx
jmp    116c <flag_table_3_5_location+0x5c>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @flag_table_3_5_location(i8** %0) {
%2 = alloca i8*
%3 = alloca i8**
%4 = alloca i8*
%5 = alloca i32
store i8** %0, i8*** %3
%6 = load i8**, i8*** %3
%7 = getelementptr inbounds i8*, i8** %6, i64 3
%8 = load i8*, i8** %7
store i8* %8, i8** %4
%9 = load i8**, i8*** %3
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = getelementptr inbounds i8, i8* %11, i64 5
%13 = load i8, i8* %12
%14 = zext i8 %13 to i32
%15 = shl i32 %14, 8
%16 = load i8**, i8*** %3
%17 = getelementptr inbounds i8*, i8** %16, i64 1
%18 = load i8*, i8** %17
%19 = getelementptr inbounds i8, i8* %18, i64 6
%20 = load i8, i8* %19
%21 = zext i8 %20 to i32
%22 = add nsw i32 %15, %21
store i32 %22, i32* %5
%23 = load i8**, i8*** %3
%24 = call i32 @code_table_3_1(i8** %23)
switch i32 %24, label %41 [
i32 20, label %25
i32 30, label %25
i32 31, label %25
i32 110, label %28
i32 40110, label %31
]
25: ; preds = %1, %1, %1
%26 = load i8*, i8** %4
%27 = getelementptr inbounds i8, i8* %26, i64 63
store i8* %27, i8** %2
br label %43
28: ; preds = %1
%29 = load i8*, i8** %4
%30 = getelementptr inbounds i8, i8* %29, i64 55
store i8* %30, i8** %2
br label %43
31: ; preds = %1
%32 = load i32, i32* %5
%33 = icmp eq i32 %32, 34
br i1 %33, label %37, label %34
34: ; preds = %31
%35 = load i32, i32* %5
%36 = icmp eq i32 %35, 35
br i1 %36, label %37, label %40
37: ; preds = %34, %31
%38 = load i8*, i8** %4
%39 = getelementptr inbounds i8, i8* %38, i64 55
store i8* %39, i8** %2
br label %43
40: ; preds = %34
br label %42
41: ; preds = %1
br label %42
42: ; preds = %41, %40
store i8* null, i8** %2
br label %43
43: ; preds = %42, %37, %28, %25
%44 = load i8*, i8** %2
ret i8* %44
}

LLVM IR (-O2):
define i8* @flag_table_3_5_location(i8** %0) {
%2 = getelementptr inbounds i8*, i8** %0, i64 3
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8*, i8** %0, i64 1
%5 = load i8*, i8** %4
%6 = getelementptr inbounds i8, i8* %5, i64 5
%7 = load i8, i8* %6
%8 = getelementptr inbounds i8, i8* %5, i64 6
%9 = load i8, i8* %8
%10 = tail call i32 @code_table_3_1(i8** %0)
switch i32 %10, label %24 [
i32 20, label %11
i32 30, label %11
i32 31, label %11
i32 110, label %13
i32 40110, label %15
]
11: ; preds = %1, %1, %1
%12 = getelementptr inbounds i8, i8* %3, i64 63
br label %24
13: ; preds = %1
%14 = getelementptr inbounds i8, i8* %3, i64 55
br label %24
15: ; preds = %1
%16 = zext i8 %7 to i32
%17 = shl nuw nsw i32 %16, 8
%18 = and i8 %9, -2
%19 = zext i8 %18 to i32
%20 = or i32 %17, %19
%21 = icmp eq i32 %20, 34
%22 = getelementptr inbounds i8, i8* %3, i64 55
%23 = select i1 %21, i8* %22, i8* null
br label %24
24: ; preds = %15, %1, %13, %11
%25 = phi i8* [ %14, %13 ], [ %12, %11 ], [ null, %1 ], [ %23, %15 ]
ret i8* %25
}