#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 */
unsigned char *
observation_generating_process_identifier_location(unsigned char **sec) {
  int p;
  p = (((int)((sec[4][7] << 8) + (sec[4][8]))));
  if (p == 30 || p == 31 || p == 35)
    return sec[4] + 12;
  return NULL;
}


x86 assembly (clang, -O0):
<observation_generating_process_identifier_location>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rax
movzbl 0x7(%rax),%eax
shl    $0x8,%eax
mov    -0x10(%rbp),%rcx
mov    0x20(%rcx),%rcx
movzbl 0x8(%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x1e,-0x14(%rbp)
je     1146 <observation_generating_process_identifier_location+0x46>
cmpl   $0x1f,-0x14(%rbp)
je     1146 <observation_generating_process_identifier_location+0x46>
cmpl   $0x23,-0x14(%rbp)
jne    115b <observation_generating_process_identifier_location+0x5b>
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rax
add    $0xc,%rax
mov    %rax,-0x8(%rbp)
jmp    1163 <observation_generating_process_identifier_location+0x63>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<observation_generating_process_identifier_location>:
mov    0x20(%rdi),%rcx
movzwl 0x7(%rcx),%edx
shl    $0x10,%edx
bswap  %edx
mov    %edx,%esi
and    $0xfffffffe,%esi
add    $0xc,%rcx
xor    %eax,%eax
cmp    $0x1e,%esi
cmove  %rcx,%rax
cmp    $0x23,%edx
cmove  %rcx,%rax
ret

LLVM IR (-O0):
define i8* @observation_generating_process_identifier_location(i8** %0) {
%2 = alloca i8*
%3 = alloca i8**
%4 = alloca i32
store i8** %0, i8*** %3
%5 = load i8**, i8*** %3
%6 = getelementptr inbounds i8*, i8** %5, i64 4
%7 = load i8*, i8** %6
%8 = getelementptr inbounds i8, i8* %7, i64 7
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 8
%12 = load i8**, i8*** %3
%13 = getelementptr inbounds i8*, i8** %12, i64 4
%14 = load i8*, i8** %13
%15 = getelementptr inbounds i8, i8* %14, i64 8
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = add nsw i32 %11, %17
store i32 %18, i32* %4
%19 = load i32, i32* %4
%20 = icmp eq i32 %19, 30
br i1 %20, label %27, label %21
21: ; preds = %1
%22 = load i32, i32* %4
%23 = icmp eq i32 %22, 31
br i1 %23, label %27, label %24
24: ; preds = %21
%25 = load i32, i32* %4
%26 = icmp eq i32 %25, 35
br i1 %26, label %27, label %32
27: ; preds = %24, %21, %1
%28 = load i8**, i8*** %3
%29 = getelementptr inbounds i8*, i8** %28, i64 4
%30 = load i8*, i8** %29
%31 = getelementptr inbounds i8, i8* %30, i64 12
store i8* %31, i8** %2
br label %33
32: ; preds = %24
store i8* null, i8** %2
br label %33
33: ; preds = %32, %27
%34 = load i8*, i8** %2
ret i8* %34
}

LLVM IR (-O2):
define i8* @observation_generating_process_identifier_location(i8** nocapture %0) {
%2 = getelementptr inbounds i8*, i8** %0, i64 4
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 7
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = getelementptr inbounds i8, i8* %3, i64 8
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = or i32 %7, %10
%12 = and i32 %11, 65534
%13 = icmp eq i32 %12, 30
%14 = icmp eq i32 %11, 35
%15 = or i1 %14, %13
%16 = getelementptr inbounds i8, i8* %3, i64 12
%17 = select i1 %15, i8* %16, i8* null
ret i8* %17
}