#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 */
struct __sk_buff {
  int /*<<< orphan*/ hash;
  int /*<<< orphan*/ protocol;
  int /*<<< orphan*/ len;
};
typedef int volatile __u8;
typedef int __u32;
typedef int volatile __u16;

/* Variables and functions */
int TC_ACT_OK;
int TC_ACT_SHOT;
__attribute__((section("test1"), used)) int process(struct __sk_buff *skb) {
  {
    __u8 tmp = *(volatile __u8 *)&skb->len;
    if (tmp != ((*(volatile __u32 *)&skb->len) & 0xFF))
      return TC_ACT_SHOT;
  };
  {
    __u16 tmp = *(volatile __u16 *)&skb->len;
    if (tmp != ((*(volatile __u32 *)&skb->len) & 0xFFFF))
      return TC_ACT_SHOT;
  };
  {
    __u32 tmp = *(volatile __u32 *)&skb->len;
    if (tmp != ((*(volatile __u32 *)&skb->len) & 0xFFFFFFFF))
      return TC_ACT_SHOT;
  };
  {
    __u16 tmp = *(volatile __u16 *)&skb->protocol;
    if (tmp != ((*(volatile __u32 *)&skb->protocol) & 0xFFFF))
      return TC_ACT_SHOT;
  };
  {
    __u32 tmp = *(volatile __u32 *)&skb->protocol;
    if (tmp != ((*(volatile __u32 *)&skb->protocol) & 0xFFFFFFFF))
      return TC_ACT_SHOT;
  };
  {
    __u8 tmp = *(volatile __u8 *)&skb->hash;
    if (tmp != ((*(volatile __u32 *)&skb->hash) & 0xFF))
      return TC_ACT_SHOT;
  };
  {
    __u16 tmp = *(volatile __u16 *)&skb->hash;
    if (tmp != ((*(volatile __u32 *)&skb->hash) & 0xFFFF))
      return TC_ACT_SHOT;
  };
  {
    __u32 tmp = *(volatile __u32 *)&skb->hash;
    if (tmp != ((*(volatile __u32 *)&skb->hash) & 0xFFFFFFFF))
      return TC_ACT_SHOT;
  };
  return TC_ACT_OK;
}


x86 assembly (clang, -O0):
<process>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x10(%rbp),%rcx
mov    0x8(%rcx),%ecx
and    $0xff,%ecx
cmp    %ecx,%eax
je     113b <process+0x3b>
mov    0x2eb7(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    129d <process+0x19d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x10(%rbp),%rcx
mov    0x8(%rcx),%ecx
and    $0xffff,%ecx
cmp    %ecx,%eax
je     116e <process+0x6e>
mov    0x2e84(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    129d <process+0x19d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x10(%rbp),%rcx
mov    0x8(%rcx),%ecx
and    $0xffffffff,%ecx
cmp    %ecx,%eax
je     119e <process+0x9e>
mov    0x2e54(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    129d <process+0x19d>
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    -0x10(%rbp),%rcx
mov    0x4(%rcx),%ecx
and    $0xffff,%ecx
cmp    %ecx,%eax
je     11d1 <process+0xd1>
mov    0x2e21(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    129d <process+0x19d>
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    -0x10(%rbp),%rcx
mov    0x4(%rcx),%ecx
and    $0xffffffff,%ecx
cmp    %ecx,%eax
je     1201 <process+0x101>
mov    0x2df1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    129d <process+0x19d>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    -0x10(%rbp),%rcx
mov    (%rcx),%ecx
and    $0xff,%ecx
cmp    %ecx,%eax
je     1232 <process+0x132>
mov    0x2dc0(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    129d <process+0x19d>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    -0x10(%rbp),%rcx
mov    (%rcx),%ecx
and    $0xffff,%ecx
cmp    %ecx,%eax
je     1263 <process+0x163>
mov    0x2d8f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    129d <process+0x19d>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%eax
mov    -0x10(%rbp),%rcx
mov    (%rcx),%ecx
and    $0xffffffff,%ecx
cmp    %ecx,%eax
je     1291 <process+0x191>
mov    0x2d61(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    129d <process+0x19d>
mov    0x2d48(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<process>:
mov    0x8(%rdi),%eax
mov    %eax,-0x4(%rsp)
mov    -0x4(%rsp),%ecx
mov    0x8(%rdi),%eax
movzbl %al,%edx
mov    0x2ed0(%rip),%rax
mov    (%rax),%eax
cmp    %edx,%ecx
jne    118d <process+0x8d>
mov    0x8(%rdi),%ecx
mov    %ecx,-0x4(%rsp)
mov    -0x4(%rsp),%ecx
mov    0x8(%rdi),%edx
movzwl %dx,%edx
cmp    %edx,%ecx
jne    118d <process+0x8d>
mov    0x8(%rdi),%ecx
cmp    0x8(%rdi),%ecx
jne    118d <process+0x8d>
mov    0x4(%rdi),%ecx
mov    %ecx,-0x4(%rsp)
mov    -0x4(%rsp),%ecx
mov    0x4(%rdi),%edx
movzwl %dx,%edx
cmp    %edx,%ecx
jne    118d <process+0x8d>
mov    0x4(%rdi),%ecx
cmp    0x4(%rdi),%ecx
jne    118d <process+0x8d>
mov    (%rdi),%ecx
mov    %ecx,-0x4(%rsp)
mov    -0x4(%rsp),%ecx
mov    (%rdi),%edx
movzbl %dl,%edx
cmp    %edx,%ecx
jne    118d <process+0x8d>
mov    (%rdi),%ecx
mov    %ecx,-0x4(%rsp)
mov    -0x4(%rsp),%ecx
mov    (%rdi),%edx
movzwl %dx,%edx
cmp    %edx,%ecx
jne    118d <process+0x8d>
mov    (%rdi),%ecx
cmp    (%rdi),%ecx
jne    118d <process+0x8d>
mov    0x2e55(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
%struct.__sk_buff = type { i32, i32, i32 }
@TC_ACT_SHOT = global i32 0
@TC_ACT_OK = global i32 0
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32 (%struct.__sk_buff*)* @process to i8*)], section "llvm.metadata"
define i32 @process(%struct.__sk_buff* %0) section "test1" {
%2 = alloca i32
%3 = alloca %struct.__sk_buff*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store %struct.__sk_buff* %0, %struct.__sk_buff** %3
%12 = load %struct.__sk_buff*, %struct.__sk_buff** %3
%13 = getelementptr inbounds %struct.__sk_buff, %struct.__sk_buff* %12, i32 0, i32 2
%14 = load volatile i32, i32* %13
store volatile i32 %14, i32* %4
%15 = load volatile i32, i32* %4
%16 = load %struct.__sk_buff*, %struct.__sk_buff** %3
%17 = getelementptr inbounds %struct.__sk_buff, %struct.__sk_buff* %16, i32 0, i32 2
%18 = load volatile i32, i32* %17
%19 = and i32 %18, 255
%20 = icmp ne i32 %15, %19
br i1 %20, label %21, label %23
21: ; preds = %1
%22 = load i32, i32* @TC_ACT_SHOT
store i32 %22, i32* %2
br label %109
23: ; preds = %1
%24 = load %struct.__sk_buff*, %struct.__sk_buff** %3
%25 = getelementptr inbounds %struct.__sk_buff, %struct.__sk_buff* %24, i32 0, i32 2
%26 = load volatile i32, i32* %25
store volatile i32 %26, i32* %5
%27 = load volatile i32, i32* %5
%28 = load %struct.__sk_buff*, %struct.__sk_buff** %3
%29 = getelementptr inbounds %struct.__sk_buff, %struct.__sk_buff* %28, i32 0, i32 2
%30 = load volatile i32, i32* %29
%31 = and i32 %30, 65535
%32 = icmp ne i32 %27, %31
br i1 %32, label %33, label %35
33: ; preds = %23
%34 = load i32, i32* @TC_ACT_SHOT
store i32 %34, i32* %2
br label %109
35: ; preds = %23
%36 = load %struct.__sk_buff*, %struct.__sk_buff** %3
%37 = getelementptr inbounds %struct.__sk_buff, %struct.__sk_buff* %36, i32 0, i32 2
%38 = load volatile i32, i32* %37
store i32 %38, i32* %6
%39 = load i32, i32* %6
%40 = load %struct.__sk_buff*, %struct.__sk_buff** %3
%41 = getelementptr inbounds %struct.__sk_buff, %struct.__sk_buff* %40, i32 0, i32 2
%42 = load volatile i32, i32* %41
%43 = and i32 %42, -1
%44 = icmp ne i32 %39, %43
br i1 %44, label %45, label %47
45: ; preds = %35
%46 = load i32, i32* @TC_ACT_SHOT
store i32 %46, i32* %2
br label %109
47: ; preds = %35
%48 = load %struct.__sk_buff*, %struct.__sk_buff** %3
%49 = getelementptr inbounds %struct.__sk_buff, %struct.__sk_buff* %48, i32 0, i32 1
%50 = load volatile i32, i32* %49
store volatile i32 %50, i32* %7
%51 = load volatile i32, i32* %7
%52 = load %struct.__sk_buff*, %struct.__sk_buff** %3
%53 = getelementptr inbounds %struct.__sk_buff, %struct.__sk_buff* %52, i32 0, i32 1
%54 = load volatile i32, i32* %53
%55 = and i32 %54, 65535
%56 = icmp ne i32 %51, %55
br i1 %56, label %57, label %59
57: ; preds = %47
%58 = load i32, i32* @TC_ACT_SHOT
store i32 %58, i32* %2
br label %109
59: ; preds = %47
%60 = load %struct.__sk_buff*, %struct.__sk_buff** %3
%61 = getelementptr inbounds %struct.__sk_buff, %struct.__sk_buff* %60, i32 0, i32 1
%62 = load volatile i32, i32* %61
store i32 %62, i32* %8
%63 = load i32, i32* %8
%64 = load %struct.__sk_buff*, %struct.__sk_buff** %3
%65 = getelementptr inbounds %struct.__sk_buff, %struct.__sk_buff* %64, i32 0, i32 1
%66 = load volatile i32, i32* %65
%67 = and i32 %66, -1
%68 = icmp ne i32 %63, %67
br i1 %68, label %69, label %71
69: ; preds = %59
%70 = load i32, i32* @TC_ACT_SHOT
store i32 %70, i32* %2
br label %109
71: ; preds = %59
%72 = load %struct.__sk_buff*, %struct.__sk_buff** %3
%73 = getelementptr inbounds %struct.__sk_buff, %struct.__sk_buff* %72, i32 0, i32 0
%74 = load volatile i32, i32* %73
store volatile i32 %74, i32* %9
%75 = load volatile i32, i32* %9
%76 = load %struct.__sk_buff*, %struct.__sk_buff** %3
%77 = getelementptr inbounds %struct.__sk_buff, %struct.__sk_buff* %76, i32 0, i32 0
%78 = load volatile i32, i32* %77
%79 = and i32 %78, 255
%80 = icmp ne i32 %75, %79
br i1 %80, label %81, label %83
81: ; preds = %71
%82 = load i32, i32* @TC_ACT_SHOT
store i32 %82, i32* %2
br label %109
83: ; preds = %71
%84 = load %struct.__sk_buff*, %struct.__sk_buff** %3
%85 = getelementptr inbounds %struct.__sk_buff, %struct.__sk_buff* %84, i32 0, i32 0
%86 = load volatile i32, i32* %85
store volatile i32 %86, i32* %10
%87 = load volatile i32, i32* %10
%88 = load %struct.__sk_buff*, %struct.__sk_buff** %3
%89 = getelementptr inbounds %struct.__sk_buff, %struct.__sk_buff* %88, i32 0, i32 0
%90 = load volatile i32, i32* %89
%91 = and i32 %90, 65535
%92 = icmp ne i32 %87, %91
br i1 %92, label %93, label %95
93: ; preds = %83
%94 = load i32, i32* @TC_ACT_SHOT
store i32 %94, i32* %2
br label %109
95: ; preds = %83
%96 = load %struct.__sk_buff*, %struct.__sk_buff** %3
%97 = getelementptr inbounds %struct.__sk_buff, %struct.__sk_buff* %96, i32 0, i32 0
%98 = load volatile i32, i32* %97
store i32 %98, i32* %11
%99 = load i32, i32* %11
%100 = load %struct.__sk_buff*, %struct.__sk_buff** %3
%101 = getelementptr inbounds %struct.__sk_buff, %struct.__sk_buff* %100, i32 0, i32 0
%102 = load volatile i32, i32* %101
%103 = and i32 %102, -1
%104 = icmp ne i32 %99, %103
br i1 %104, label %105, label %107
105: ; preds = %95
%106 = load i32, i32* @TC_ACT_SHOT
store i32 %106, i32* %2
br label %109
107: ; preds = %95
%108 = load i32, i32* @TC_ACT_OK
store i32 %108, i32* %2
br label %109
109: ; preds = %107, %105, %93, %81, %69, %57, %45, %33, %21
%110 = load i32, i32* %2
ret i32 %110
}

LLVM IR (-O2):
%struct.__sk_buff = type { i32, i32, i32 }
@TC_ACT_SHOT = global i32 0
@TC_ACT_OK = global i32 0
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32 (%struct.__sk_buff*)* @process to i8*)], section "llvm.metadata"
define i32 @process(%struct.__sk_buff* %0) section "test1" {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = bitcast i32* %2 to i8*
%8 = getelementptr inbounds %struct.__sk_buff, %struct.__sk_buff* %0, i64 0, i32 2
%9 = load volatile i32, i32* %8
store volatile i32 %9, i32* %2
%10 = load volatile i32, i32* %2
%11 = load volatile i32, i32* %8
%12 = and i32 %11, 255
%13 = icmp eq i32 %10, %12
%14 = load i32, i32* @TC_ACT_SHOT
br i1 %13, label %15, label %59
15: ; preds = %1
%16 = bitcast i32* %3 to i8*
%17 = load volatile i32, i32* %8
store volatile i32 %17, i32* %3
%18 = load volatile i32, i32* %3
%19 = load volatile i32, i32* %8
%20 = and i32 %19, 65535
%21 = icmp eq i32 %18, %20
br i1 %21, label %22, label %59
22: ; preds = %15
%23 = load volatile i32, i32* %8
%24 = load volatile i32, i32* %8
%25 = icmp eq i32 %23, %24
br i1 %25, label %26, label %59
26: ; preds = %22
%27 = bitcast i32* %4 to i8*
%28 = getelementptr inbounds %struct.__sk_buff, %struct.__sk_buff* %0, i64 0, i32 1
%29 = load volatile i32, i32* %28
store volatile i32 %29, i32* %4
%30 = load volatile i32, i32* %4
%31 = load volatile i32, i32* %28
%32 = and i32 %31, 65535
%33 = icmp eq i32 %30, %32
br i1 %33, label %34, label %59
34: ; preds = %26
%35 = load volatile i32, i32* %28
%36 = load volatile i32, i32* %28
%37 = icmp eq i32 %35, %36
br i1 %37, label %38, label %59
38: ; preds = %34
%39 = bitcast i32* %5 to i8*
%40 = getelementptr inbounds %struct.__sk_buff, %struct.__sk_buff* %0, i64 0, i32 0
%41 = load volatile i32, i32* %40
store volatile i32 %41, i32* %5
%42 = load volatile i32, i32* %5
%43 = load volatile i32, i32* %40
%44 = and i32 %43, 255
%45 = icmp eq i32 %42, %44
br i1 %45, label %46, label %59
46: ; preds = %38
%47 = bitcast i32* %6 to i8*
%48 = load volatile i32, i32* %40
store volatile i32 %48, i32* %6
%49 = load volatile i32, i32* %6
%50 = load volatile i32, i32* %40
%51 = and i32 %50, 65535
%52 = icmp eq i32 %49, %51
br i1 %52, label %53, label %59
53: ; preds = %46
%54 = load volatile i32, i32* %40
%55 = load volatile i32, i32* %40
%56 = icmp eq i32 %54, %55
%57 = load i32, i32* @TC_ACT_OK
%58 = select i1 %56, i32 %57, i32 %14
br label %59
59: ; preds = %53, %46, %38, %34, %26, %22, %15, %1
%60 = phi i32 [ %14, %1 ], [ %14, %15 ], [ %14, %22 ], [ %14, %26 ], [ %14, %34 ], [ %14, %38 ], [ %14, %46 ], [ %58, %53 ]
ret i32 %60
}