#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 sock_fprog {
  int dummy;
};
struct sock_filter {
  int dummy;
};

/* Variables and functions */
scalar_t__ BPF_ABS;
scalar_t__ BPF_B;
scalar_t__ BPF_H;
scalar_t__ BPF_IND;
scalar_t__ BPF_LD;
scalar_t__ BPF_LDX;
scalar_t__ BPF_MEM;
scalar_t__ BPF_MISC;
scalar_t__ BPF_MSH;
scalar_t__ BPF_ST;
struct sock_filter BPF_STMT(scalar_t__, int);
scalar_t__ BPF_STX;
scalar_t__ BPF_TAX;
scalar_t__ BPF_W;
int SKF_AD_ALU_XOR_X;
int SKF_AD_OFF;
int __add_inst(struct sock_fprog *, struct sock_filter *);
int vlan_hdr_shift(int /*<<< orphan*/);
int __bpf_l4v4_hash(struct sock_fprog *fprog, bool vlan) {
  int vlan_shift = vlan ? vlan_hdr_shift(0) : 0;
  int err;
  {
    struct sock_filter inst = BPF_STMT(BPF_STX, 0);
    err = __add_inst(fprog, &inst);
    if (err)
      goto err_add_inst;
  };
  {
    struct sock_filter inst =
        BPF_STMT(BPF_LDX + BPF_B + BPF_MSH, 14 + vlan_shift);
    err = __add_inst(fprog, &inst);
    if (err)
      goto err_add_inst;
  };
  {
    struct sock_filter inst =
        BPF_STMT(BPF_LD + BPF_H + BPF_IND, 14 + vlan_shift);
    err = __add_inst(fprog, &inst);
    if (err)
      goto err_add_inst;
  };
  {
    struct sock_filter inst = BPF_STMT(BPF_LDX + BPF_W + BPF_MEM, 0);
    err = __add_inst(fprog, &inst);
    if (err)
      goto err_add_inst;
  };
  {
    struct sock_filter inst =
        BPF_STMT(BPF_LD + BPF_B + BPF_ABS, SKF_AD_OFF + SKF_AD_ALU_XOR_X);
    err = __add_inst(fprog, &inst);
    if (err)
      goto err_add_inst;
  };
  {
    struct sock_filter inst = BPF_STMT(BPF_ST, 0);
    err = __add_inst(fprog, &inst);
    if (err)
      goto err_add_inst;
  };
  {
    struct sock_filter inst =
        BPF_STMT(BPF_LDX + BPF_B + BPF_MSH, 14 + vlan_shift);
    err = __add_inst(fprog, &inst);
    if (err)
      goto err_add_inst;
  };
  {
    struct sock_filter inst =
        BPF_STMT(BPF_LD + BPF_H + BPF_IND, 16 + vlan_shift);
    err = __add_inst(fprog, &inst);
    if (err)
      goto err_add_inst;
  };
  {
    struct sock_filter inst = BPF_STMT(BPF_LDX + BPF_W + BPF_MEM, 0);
    err = __add_inst(fprog, &inst);
    if (err)
      goto err_add_inst;
  };
  {
    struct sock_filter inst =
        BPF_STMT(BPF_LD + BPF_B + BPF_ABS, SKF_AD_OFF + SKF_AD_ALU_XOR_X);
    err = __add_inst(fprog, &inst);
    if (err)
      goto err_add_inst;
  };
  {
    struct sock_filter inst = BPF_STMT(BPF_MISC + BPF_TAX, 0);
    err = __add_inst(fprog, &inst);
    if (err)
      goto err_add_inst;
  };
  ;
  return 0;
err_add_inst:
  return err;
}


x86 assembly (clang, -O0):
<__bpf_l4v4_hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     115b <__bpf_l4v4_hash+0x2b>
xor    %edi,%edi
call   1030 <vlan_hdr_shift@plt>
mov    %eax,-0x74(%rbp)
jmp    1165 <__bpf_l4v4_hash+0x35>
xor    %eax,%eax
mov    %eax,-0x74(%rbp)
jmp    1165 <__bpf_l4v4_hash+0x35>
mov    -0x74(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    0x2e56(%rip),%rax
mov    (%rax),%rdi
xor    %esi,%esi
call   1040 <BPF_STMT@plt>
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1050 <__add_inst@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     119e <__bpf_l4v4_hash+0x6e>
jmp    1482 <__bpf_l4v4_hash+0x352>
mov    0x2e53(%rip),%rax
mov    (%rax),%rdi
mov    0x2de9(%rip),%rax
add    (%rax),%rdi
mov    0x2e1f(%rip),%rax
add    (%rax),%rdi
mov    -0x18(%rbp),%esi
add    $0xe,%esi
call   1040 <BPF_STMT@plt>
mov    %eax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x28(%rbp),%rsi
call   1050 <__add_inst@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     11e9 <__bpf_l4v4_hash+0xb9>
jmp    1482 <__bpf_l4v4_hash+0x352>
mov    0x2db8(%rip),%rax
mov    (%rax),%rdi
mov    0x2da6(%rip),%rax
add    (%rax),%rdi
mov    0x2d84(%rip),%rax
add    (%rax),%rdi
mov    -0x18(%rbp),%esi
add    $0xe,%esi
call   1040 <BPF_STMT@plt>
mov    %eax,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1050 <__add_inst@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1234 <__bpf_l4v4_hash+0x104>
jmp    1482 <__bpf_l4v4_hash+0x352>
mov    0x2dbd(%rip),%rax
mov    (%rax),%rdi
mov    0x2da3(%rip),%rax
add    (%rax),%rdi
mov    0x2d41(%rip),%rax
add    (%rax),%rdi
xor    %esi,%esi
call   1040 <BPF_STMT@plt>
mov    %eax,-0x38(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x38(%rbp),%rsi
call   1050 <__add_inst@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     127b <__bpf_l4v4_hash+0x14b>
jmp    1482 <__bpf_l4v4_hash+0x352>
mov    0x2d26(%rip),%rax
mov    (%rax),%rdi
mov    0x2d0c(%rip),%rax
add    (%rax),%rdi
mov    0x2d3a(%rip),%rax
add    (%rax),%rdi
mov    0x2d18(%rip),%rax
mov    (%rax),%esi
mov    0x2cbf(%rip),%rax
add    (%rax),%esi
call   1040 <BPF_STMT@plt>
mov    %eax,-0x40(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1050 <__add_inst@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     12d2 <__bpf_l4v4_hash+0x1a2>
jmp    1482 <__bpf_l4v4_hash+0x352>
mov    0x2c9f(%rip),%rax
mov    (%rax),%rdi
xor    %esi,%esi
call   1040 <BPF_STMT@plt>
mov    %eax,-0x48(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x48(%rbp),%rsi
call   1050 <__add_inst@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1305 <__bpf_l4v4_hash+0x1d5>
jmp    1482 <__bpf_l4v4_hash+0x352>
mov    0x2cec(%rip),%rax
mov    (%rax),%rdi
mov    0x2c82(%rip),%rax
add    (%rax),%rdi
mov    0x2cb8(%rip),%rax
add    (%rax),%rdi
mov    -0x18(%rbp),%esi
add    $0xe,%esi
call   1040 <BPF_STMT@plt>
mov    %eax,-0x50(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x50(%rbp),%rsi
call   1050 <__add_inst@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1350 <__bpf_l4v4_hash+0x220>
jmp    1482 <__bpf_l4v4_hash+0x352>
mov    0x2c51(%rip),%rax
mov    (%rax),%rdi
mov    0x2c3f(%rip),%rax
add    (%rax),%rdi
mov    0x2c1d(%rip),%rax
add    (%rax),%rdi
mov    -0x18(%rbp),%esi
add    $0x10,%esi
call   1040 <BPF_STMT@plt>
mov    %eax,-0x58(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x58(%rbp),%rsi
call   1050 <__add_inst@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     139b <__bpf_l4v4_hash+0x26b>
jmp    1482 <__bpf_l4v4_hash+0x352>
mov    0x2c56(%rip),%rax
mov    (%rax),%rdi
mov    0x2c3c(%rip),%rax
add    (%rax),%rdi
mov    0x2bda(%rip),%rax
add    (%rax),%rdi
xor    %esi,%esi
call   1040 <BPF_STMT@plt>
mov    %eax,-0x60(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x60(%rbp),%rsi
call   1050 <__add_inst@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     13e2 <__bpf_l4v4_hash+0x2b2>
jmp    1482 <__bpf_l4v4_hash+0x352>
mov    0x2bbf(%rip),%rax
mov    (%rax),%rdi
mov    0x2ba5(%rip),%rax
add    (%rax),%rdi
mov    0x2bd3(%rip),%rax
add    (%rax),%rdi
mov    0x2bb1(%rip),%rax
mov    (%rax),%esi
mov    0x2b58(%rip),%rax
add    (%rax),%esi
call   1040 <BPF_STMT@plt>
mov    %eax,-0x68(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x68(%rbp),%rsi
call   1050 <__add_inst@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1439 <__bpf_l4v4_hash+0x309>
jmp    1482 <__bpf_l4v4_hash+0x352>
mov    0x2b80(%rip),%rax
mov    (%rax),%rdi
mov    0x2b26(%rip),%rax
add    (%rax),%rdi
xor    %esi,%esi
call   1040 <BPF_STMT@plt>
mov    %eax,-0x70(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x70(%rbp),%rsi
call   1050 <__add_inst@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1476 <__bpf_l4v4_hash+0x346>
jmp    1482 <__bpf_l4v4_hash+0x352>
movl   $0x0,-0x4(%rbp)
jmp    1488 <__bpf_l4v4_hash+0x358>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__bpf_l4v4_hash>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdi,%rbx
test   %esi,%esi
je     114e <__bpf_l4v4_hash+0x1e>
xor    %edi,%edi
call   1030 <vlan_hdr_shift@plt>
mov    %eax,%r14d
jmp    1151 <__bpf_l4v4_hash+0x21>
xor    %r14d,%r14d
mov    0x2e70(%rip),%rax
mov    (%rax),%rdi
xor    %esi,%esi
call   1040 <BPF_STMT@plt>
mov    %eax,(%rsp)
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1050 <__add_inst@plt>
test   %eax,%eax
jne    139c <__bpf_l4v4_hash+0x26c>
mov    0x2e79(%rip),%r12
mov    0x2e12(%rip),%r15
mov    (%r15),%rdi
add    (%r12),%rdi
mov    0x2e44(%rip),%r13
add    0x0(%r13),%rdi
lea    0xe(%r14),%ebp
mov    %ebp,%esi
call   1040 <BPF_STMT@plt>
mov    %eax,(%rsp)
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1050 <__add_inst@plt>
test   %eax,%eax
jne    139c <__bpf_l4v4_hash+0x26c>
mov    0x2de8(%rip),%rax
mov    0x2dd9(%rip),%rcx
mov    (%rcx),%rdi
add    (%rax),%rdi
mov    0x2db4(%rip),%rax
add    (%rax),%rdi
mov    %ebp,%esi
call   1040 <BPF_STMT@plt>
mov    %eax,(%rsp)
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1050 <__add_inst@plt>
test   %eax,%eax
jne    139c <__bpf_l4v4_hash+0x26c>
mov    0x2ded(%rip),%rax
mov    (%rax),%rdi
add    (%r12),%rdi
mov    0x2d87(%rip),%rax
add    (%rax),%rdi
xor    %esi,%esi
call   1040 <BPF_STMT@plt>
mov    %eax,(%rsp)
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1050 <__add_inst@plt>
test   %eax,%eax
jne    139c <__bpf_l4v4_hash+0x26c>
mov    (%r15),%rdi
mov    0x2d75(%rip),%rax
add    (%rax),%rdi
mov    0x2d93(%rip),%rax
add    (%rax),%rdi
mov    0x2d71(%rip),%rax
mov    0x2d1a(%rip),%rcx
mov    (%rcx),%esi
add    (%rax),%esi
call   1040 <BPF_STMT@plt>
mov    %eax,(%rsp)
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1050 <__add_inst@plt>
test   %eax,%eax
jne    139c <__bpf_l4v4_hash+0x26c>
mov    0x2d04(%rip),%rax
mov    (%rax),%rdi
xor    %esi,%esi
call   1040 <BPF_STMT@plt>
mov    %eax,(%rsp)
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1050 <__add_inst@plt>
test   %eax,%eax
jne    139c <__bpf_l4v4_hash+0x26c>
mov    (%r15),%rdi
add    (%r12),%rdi
add    0x0(%r13),%rdi
mov    %ebp,%esi
call   1040 <BPF_STMT@plt>
mov    %eax,(%rsp)
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1050 <__add_inst@plt>
test   %eax,%eax
jne    139c <__bpf_l4v4_hash+0x26c>
mov    0x2cdd(%rip),%rax
mov    (%rax),%rdi
mov    0x2cdb(%rip),%rax
add    (%rax),%rdi
mov    0x2cb1(%rip),%rax
add    (%rax),%rdi
add    $0x10,%r14d
mov    %r14d,%esi
call   1040 <BPF_STMT@plt>
mov    %eax,(%rsp)
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1050 <__add_inst@plt>
test   %eax,%eax
jne    139c <__bpf_l4v4_hash+0x26c>
mov    0x2ce5(%rip),%rax
mov    (%rax),%rdi
add    (%r12),%rdi
mov    0x2c7f(%rip),%rax
add    (%rax),%rdi
xor    %esi,%esi
call   1040 <BPF_STMT@plt>
mov    %eax,(%rsp)
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1050 <__add_inst@plt>
test   %eax,%eax
jne    139c <__bpf_l4v4_hash+0x26c>
mov    (%r15),%rdi
mov    0x2c71(%rip),%rax
add    (%rax),%rdi
mov    0x2c8f(%rip),%rax
add    (%rax),%rdi
mov    0x2c1d(%rip),%rax
mov    (%rax),%esi
mov    0x2c64(%rip),%rax
add    (%rax),%esi
call   1040 <BPF_STMT@plt>
mov    %eax,(%rsp)
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1050 <__add_inst@plt>
test   %eax,%eax
jne    139c <__bpf_l4v4_hash+0x26c>
mov    0x2c4c(%rip),%rax
mov    0x2bf5(%rip),%rcx
mov    (%rcx),%rdi
add    (%rax),%rdi
xor    %ebp,%ebp
xor    %esi,%esi
call   1040 <BPF_STMT@plt>
mov    %eax,(%rsp)
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1050 <__add_inst@plt>
test   %eax,%eax
je     139e <__bpf_l4v4_hash+0x26e>
mov    %eax,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.sock_fprog = type { i32 }
%struct.sock_filter = type { i32 }
@BPF_STX = global i64 0
@BPF_LDX = global i64 0
@BPF_B = global i64 0
@BPF_MSH = global i64 0
@BPF_LD = global i64 0
@BPF_H = global i64 0
@BPF_IND = global i64 0
@BPF_W = global i64 0
@BPF_MEM = global i64 0
@BPF_ABS = global i64 0
@SKF_AD_OFF = global i32 0
@SKF_AD_ALU_XOR_X = global i32 0
@BPF_ST = global i64 0
@BPF_MISC = global i64 0
@BPF_TAX = global i64 0
define i32 @__bpf_l4v4_hash(%struct.sock_fprog* %0, i32 %1) {
%3 = alloca i32
%4 = alloca %struct.sock_fprog*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca %struct.sock_filter
%9 = alloca %struct.sock_filter
%10 = alloca %struct.sock_filter
%11 = alloca %struct.sock_filter
%12 = alloca %struct.sock_filter
%13 = alloca %struct.sock_filter
%14 = alloca %struct.sock_filter
%15 = alloca %struct.sock_filter
%16 = alloca %struct.sock_filter
%17 = alloca %struct.sock_filter
%18 = alloca %struct.sock_filter
store %struct.sock_fprog* %0, %struct.sock_fprog** %4
store i32 %1, i32* %5
%19 = load i32, i32* %5
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %2
%22 = call i32 @vlan_hdr_shift(i32 0)
br label %24
23: ; preds = %2
br label %24
24: ; preds = %23, %21
%25 = phi i32 [ %22, %21 ], [ 0, %23 ]
store i32 %25, i32* %6
%26 = load i64, i64* @BPF_STX
%27 = call i32 @BPF_STMT(i64 %26, i32 0)
%28 = getelementptr inbounds %struct.sock_filter, %struct.sock_filter* %8, i32 0, i32 0
store i32 %27, i32* %28
%29 = load %struct.sock_fprog*, %struct.sock_fprog** %4
%30 = call i32 @__add_inst(%struct.sock_fprog* %29, %struct.sock_filter* %8)
store i32 %30, i32* %7
%31 = load i32, i32* %7
%32 = icmp ne i32 %31, 0
br i1 %32, label %33, label %34
33: ; preds = %24
br label %173
34: ; preds = %24
%35 = load i64, i64* @BPF_LDX
%36 = load i64, i64* @BPF_B
%37 = add nsw i64 %35, %36
%38 = load i64, i64* @BPF_MSH
%39 = add nsw i64 %37, %38
%40 = load i32, i32* %6
%41 = add nsw i32 14, %40
%42 = call i32 @BPF_STMT(i64 %39, i32 %41)
%43 = getelementptr inbounds %struct.sock_filter, %struct.sock_filter* %9, i32 0, i32 0
store i32 %42, i32* %43
%44 = load %struct.sock_fprog*, %struct.sock_fprog** %4
%45 = call i32 @__add_inst(%struct.sock_fprog* %44, %struct.sock_filter* %9)
store i32 %45, i32* %7
%46 = load i32, i32* %7
%47 = icmp ne i32 %46, 0
br i1 %47, label %48, label %49
48: ; preds = %34
br label %173
49: ; preds = %34
%50 = load i64, i64* @BPF_LD
%51 = load i64, i64* @BPF_H
%52 = add nsw i64 %50, %51
%53 = load i64, i64* @BPF_IND
%54 = add nsw i64 %52, %53
%55 = load i32, i32* %6
%56 = add nsw i32 14, %55
%57 = call i32 @BPF_STMT(i64 %54, i32 %56)
%58 = getelementptr inbounds %struct.sock_filter, %struct.sock_filter* %10, i32 0, i32 0
store i32 %57, i32* %58
%59 = load %struct.sock_fprog*, %struct.sock_fprog** %4
%60 = call i32 @__add_inst(%struct.sock_fprog* %59, %struct.sock_filter* %10)
store i32 %60, i32* %7
%61 = load i32, i32* %7
%62 = icmp ne i32 %61, 0
br i1 %62, label %63, label %64
63: ; preds = %49
br label %173
64: ; preds = %49
%65 = load i64, i64* @BPF_LDX
%66 = load i64, i64* @BPF_W
%67 = add nsw i64 %65, %66
%68 = load i64, i64* @BPF_MEM
%69 = add nsw i64 %67, %68
%70 = call i32 @BPF_STMT(i64 %69, i32 0)
%71 = getelementptr inbounds %struct.sock_filter, %struct.sock_filter* %11, i32 0, i32 0
store i32 %70, i32* %71
%72 = load %struct.sock_fprog*, %struct.sock_fprog** %4
%73 = call i32 @__add_inst(%struct.sock_fprog* %72, %struct.sock_filter* %11)
store i32 %73, i32* %7
%74 = load i32, i32* %7
%75 = icmp ne i32 %74, 0
br i1 %75, label %76, label %77
76: ; preds = %64
br label %173
77: ; preds = %64
%78 = load i64, i64* @BPF_LD
%79 = load i64, i64* @BPF_B
%80 = add nsw i64 %78, %79
%81 = load i64, i64* @BPF_ABS
%82 = add nsw i64 %80, %81
%83 = load i32, i32* @SKF_AD_OFF
%84 = load i32, i32* @SKF_AD_ALU_XOR_X
%85 = add nsw i32 %83, %84
%86 = call i32 @BPF_STMT(i64 %82, i32 %85)
%87 = getelementptr inbounds %struct.sock_filter, %struct.sock_filter* %12, i32 0, i32 0
store i32 %86, i32* %87
%88 = load %struct.sock_fprog*, %struct.sock_fprog** %4
%89 = call i32 @__add_inst(%struct.sock_fprog* %88, %struct.sock_filter* %12)
store i32 %89, i32* %7
%90 = load i32, i32* %7
%91 = icmp ne i32 %90, 0
br i1 %91, label %92, label %93
92: ; preds = %77
br label %173
93: ; preds = %77
%94 = load i64, i64* @BPF_ST
%95 = call i32 @BPF_STMT(i64 %94, i32 0)
%96 = getelementptr inbounds %struct.sock_filter, %struct.sock_filter* %13, i32 0, i32 0
store i32 %95, i32* %96
%97 = load %struct.sock_fprog*, %struct.sock_fprog** %4
%98 = call i32 @__add_inst(%struct.sock_fprog* %97, %struct.sock_filter* %13)
store i32 %98, i32* %7
%99 = load i32, i32* %7
%100 = icmp ne i32 %99, 0
br i1 %100, label %101, label %102
101: ; preds = %93
br label %173
102: ; preds = %93
%103 = load i64, i64* @BPF_LDX
%104 = load i64, i64* @BPF_B
%105 = add nsw i64 %103, %104
%106 = load i64, i64* @BPF_MSH
%107 = add nsw i64 %105, %106
%108 = load i32, i32* %6
%109 = add nsw i32 14, %108
%110 = call i32 @BPF_STMT(i64 %107, i32 %109)
%111 = getelementptr inbounds %struct.sock_filter, %struct.sock_filter* %14, i32 0, i32 0
store i32 %110, i32* %111
%112 = load %struct.sock_fprog*, %struct.sock_fprog** %4
%113 = call i32 @__add_inst(%struct.sock_fprog* %112, %struct.sock_filter* %14)
store i32 %113, i32* %7
%114 = load i32, i32* %7
%115 = icmp ne i32 %114, 0
br i1 %115, label %116, label %117
116: ; preds = %102
br label %173
117: ; preds = %102
%118 = load i64, i64* @BPF_LD
%119 = load i64, i64* @BPF_H
%120 = add nsw i64 %118, %119
%121 = load i64, i64* @BPF_IND
%122 = add nsw i64 %120, %121
%123 = load i32, i32* %6
%124 = add nsw i32 16, %123
%125 = call i32 @BPF_STMT(i64 %122, i32 %124)
%126 = getelementptr inbounds %struct.sock_filter, %struct.sock_filter* %15, i32 0, i32 0
store i32 %125, i32* %126
%127 = load %struct.sock_fprog*, %struct.sock_fprog** %4
%128 = call i32 @__add_inst(%struct.sock_fprog* %127, %struct.sock_filter* %15)
store i32 %128, i32* %7
%129 = load i32, i32* %7
%130 = icmp ne i32 %129, 0
br i1 %130, label %131, label %132
131: ; preds = %117
br label %173
132: ; preds = %117
%133 = load i64, i64* @BPF_LDX
%134 = load i64, i64* @BPF_W
%135 = add nsw i64 %133, %134
%136 = load i64, i64* @BPF_MEM
%137 = add nsw i64 %135, %136
%138 = call i32 @BPF_STMT(i64 %137, i32 0)
%139 = getelementptr inbounds %struct.sock_filter, %struct.sock_filter* %16, i32 0, i32 0
store i32 %138, i32* %139
%140 = load %struct.sock_fprog*, %struct.sock_fprog** %4
%141 = call i32 @__add_inst(%struct.sock_fprog* %140, %struct.sock_filter* %16)
store i32 %141, i32* %7
%142 = load i32, i32* %7
%143 = icmp ne i32 %142, 0
br i1 %143, label %144, label %145
144: ; preds = %132
br label %173
145: ; preds = %132
%146 = load i64, i64* @BPF_LD
%147 = load i64, i64* @BPF_B
%148 = add nsw i64 %146, %147
%149 = load i64, i64* @BPF_ABS
%150 = add nsw i64 %148, %149
%151 = load i32, i32* @SKF_AD_OFF
%152 = load i32, i32* @SKF_AD_ALU_XOR_X
%153 = add nsw i32 %151, %152
%154 = call i32 @BPF_STMT(i64 %150, i32 %153)
%155 = getelementptr inbounds %struct.sock_filter, %struct.sock_filter* %17, i32 0, i32 0
store i32 %154, i32* %155
%156 = load %struct.sock_fprog*, %struct.sock_fprog** %4
%157 = call i32 @__add_inst(%struct.sock_fprog* %156, %struct.sock_filter* %17)
store i32 %157, i32* %7
%158 = load i32, i32* %7
%159 = icmp ne i32 %158, 0
br i1 %159, label %160, label %161
160: ; preds = %145
br label %173
161: ; preds = %145
%162 = load i64, i64* @BPF_MISC
%163 = load i64, i64* @BPF_TAX
%164 = add nsw i64 %162, %163
%165 = call i32 @BPF_STMT(i64 %164, i32 0)
%166 = getelementptr inbounds %struct.sock_filter, %struct.sock_filter* %18, i32 0, i32 0
store i32 %165, i32* %166
%167 = load %struct.sock_fprog*, %struct.sock_fprog** %4
%168 = call i32 @__add_inst(%struct.sock_fprog* %167, %struct.sock_filter* %18)
store i32 %168, i32* %7
%169 = load i32, i32* %7
%170 = icmp ne i32 %169, 0
br i1 %170, label %171, label %172
171: ; preds = %161
br label %173
172: ; preds = %161
store i32 0, i32* %3
br label %175
173: ; preds = %171, %160, %144, %131, %116, %101, %92, %76, %63, %48, %33
%174 = load i32, i32* %7
store i32 %174, i32* %3
br label %175
175: ; preds = %173, %172
%176 = load i32, i32* %3
ret i32 %176
}

LLVM IR (-O2):
%struct.sock_fprog = type { i32 }
%struct.sock_filter = type { i32 }
@BPF_STX = global i64 0
@BPF_LDX = global i64 0
@BPF_B = global i64 0
@BPF_MSH = global i64 0
@BPF_LD = global i64 0
@BPF_H = global i64 0
@BPF_IND = global i64 0
@BPF_W = global i64 0
@BPF_MEM = global i64 0
@BPF_ABS = global i64 0
@SKF_AD_OFF = global i32 0
@SKF_AD_ALU_XOR_X = global i32 0
@BPF_ST = global i64 0
@BPF_MISC = global i64 0
@BPF_TAX = global i64 0
define i32 @__bpf_l4v4_hash(%struct.sock_fprog* %0, i32 %1) {
%3 = alloca %struct.sock_filter
%4 = alloca %struct.sock_filter
%5 = alloca %struct.sock_filter
%6 = alloca %struct.sock_filter
%7 = alloca %struct.sock_filter
%8 = alloca %struct.sock_filter
%9 = alloca %struct.sock_filter
%10 = alloca %struct.sock_filter
%11 = alloca %struct.sock_filter
%12 = alloca %struct.sock_filter
%13 = alloca %struct.sock_filter
%14 = icmp eq i32 %1, 0
br i1 %14, label %17, label %15
15: ; preds = %2
%16 = tail call i32 @vlan_hdr_shift(i32 0)
br label %17
17: ; preds = %2, %15
%18 = phi i32 [ %16, %15 ], [ 0, %2 ]
%19 = bitcast %struct.sock_filter* %3 to i8*
%20 = load i64, i64* @BPF_STX
%21 = tail call i32 @BPF_STMT(i64 %20, i32 0)
%22 = getelementptr inbounds %struct.sock_filter, %struct.sock_filter* %3, i64 0, i32 0
store i32 %21, i32* %22
%23 = call i32 @__add_inst(%struct.sock_fprog* %0, %struct.sock_filter* %3)
%24 = icmp eq i32 %23, 0
br i1 %24, label %25, label %137
25: ; preds = %17
%26 = bitcast %struct.sock_filter* %4 to i8*
%27 = load i64, i64* @BPF_LDX
%28 = load i64, i64* @BPF_B
%29 = add nsw i64 %28, %27
%30 = load i64, i64* @BPF_MSH
%31 = add nsw i64 %29, %30
%32 = add nsw i32 %18, 14
%33 = call i32 @BPF_STMT(i64 %31, i32 %32)
%34 = getelementptr inbounds %struct.sock_filter, %struct.sock_filter* %4, i64 0, i32 0
store i32 %33, i32* %34
%35 = call i32 @__add_inst(%struct.sock_fprog* %0, %struct.sock_filter* %4)
%36 = icmp eq i32 %35, 0
br i1 %36, label %37, label %137
37: ; preds = %25
%38 = bitcast %struct.sock_filter* %5 to i8*
%39 = load i64, i64* @BPF_LD
%40 = load i64, i64* @BPF_H
%41 = add nsw i64 %40, %39
%42 = load i64, i64* @BPF_IND
%43 = add nsw i64 %41, %42
%44 = call i32 @BPF_STMT(i64 %43, i32 %32)
%45 = getelementptr inbounds %struct.sock_filter, %struct.sock_filter* %5, i64 0, i32 0
store i32 %44, i32* %45
%46 = call i32 @__add_inst(%struct.sock_fprog* %0, %struct.sock_filter* %5)
%47 = icmp eq i32 %46, 0
br i1 %47, label %48, label %137
48: ; preds = %37
%49 = bitcast %struct.sock_filter* %6 to i8*
%50 = load i64, i64* @BPF_LDX
%51 = load i64, i64* @BPF_W
%52 = add nsw i64 %51, %50
%53 = load i64, i64* @BPF_MEM
%54 = add nsw i64 %52, %53
%55 = call i32 @BPF_STMT(i64 %54, i32 0)
%56 = getelementptr inbounds %struct.sock_filter, %struct.sock_filter* %6, i64 0, i32 0
store i32 %55, i32* %56
%57 = call i32 @__add_inst(%struct.sock_fprog* %0, %struct.sock_filter* %6)
%58 = icmp eq i32 %57, 0
br i1 %58, label %59, label %137
59: ; preds = %48
%60 = bitcast %struct.sock_filter* %7 to i8*
%61 = load i64, i64* @BPF_LD
%62 = load i64, i64* @BPF_B
%63 = add nsw i64 %62, %61
%64 = load i64, i64* @BPF_ABS
%65 = add nsw i64 %63, %64
%66 = load i32, i32* @SKF_AD_OFF
%67 = load i32, i32* @SKF_AD_ALU_XOR_X
%68 = add nsw i32 %67, %66
%69 = call i32 @BPF_STMT(i64 %65, i32 %68)
%70 = getelementptr inbounds %struct.sock_filter, %struct.sock_filter* %7, i64 0, i32 0
store i32 %69, i32* %70
%71 = call i32 @__add_inst(%struct.sock_fprog* %0, %struct.sock_filter* %7)
%72 = icmp eq i32 %71, 0
br i1 %72, label %73, label %137
73: ; preds = %59
%74 = bitcast %struct.sock_filter* %8 to i8*
%75 = load i64, i64* @BPF_ST
%76 = call i32 @BPF_STMT(i64 %75, i32 0)
%77 = getelementptr inbounds %struct.sock_filter, %struct.sock_filter* %8, i64 0, i32 0
store i32 %76, i32* %77
%78 = call i32 @__add_inst(%struct.sock_fprog* %0, %struct.sock_filter* %8)
%79 = icmp eq i32 %78, 0
br i1 %79, label %80, label %137
80: ; preds = %73
%81 = bitcast %struct.sock_filter* %9 to i8*
%82 = load i64, i64* @BPF_LDX
%83 = load i64, i64* @BPF_B
%84 = add nsw i64 %83, %82
%85 = load i64, i64* @BPF_MSH
%86 = add nsw i64 %84, %85
%87 = call i32 @BPF_STMT(i64 %86, i32 %32)
%88 = getelementptr inbounds %struct.sock_filter, %struct.sock_filter* %9, i64 0, i32 0
store i32 %87, i32* %88
%89 = call i32 @__add_inst(%struct.sock_fprog* %0, %struct.sock_filter* %9)
%90 = icmp eq i32 %89, 0
br i1 %90, label %91, label %137
91: ; preds = %80
%92 = bitcast %struct.sock_filter* %10 to i8*
%93 = load i64, i64* @BPF_LD
%94 = load i64, i64* @BPF_H
%95 = add nsw i64 %94, %93
%96 = load i64, i64* @BPF_IND
%97 = add nsw i64 %95, %96
%98 = add nsw i32 %18, 16
%99 = call i32 @BPF_STMT(i64 %97, i32 %98)
%100 = getelementptr inbounds %struct.sock_filter, %struct.sock_filter* %10, i64 0, i32 0
store i32 %99, i32* %100
%101 = call i32 @__add_inst(%struct.sock_fprog* %0, %struct.sock_filter* %10)
%102 = icmp eq i32 %101, 0
br i1 %102, label %103, label %137
103: ; preds = %91
%104 = bitcast %struct.sock_filter* %11 to i8*
%105 = load i64, i64* @BPF_LDX
%106 = load i64, i64* @BPF_W
%107 = add nsw i64 %106, %105
%108 = load i64, i64* @BPF_MEM
%109 = add nsw i64 %107, %108
%110 = call i32 @BPF_STMT(i64 %109, i32 0)
%111 = getelementptr inbounds %struct.sock_filter, %struct.sock_filter* %11, i64 0, i32 0
store i32 %110, i32* %111
%112 = call i32 @__add_inst(%struct.sock_fprog* %0, %struct.sock_filter* %11)
%113 = icmp eq i32 %112, 0
br i1 %113, label %114, label %137
114: ; preds = %103
%115 = bitcast %struct.sock_filter* %12 to i8*
%116 = load i64, i64* @BPF_LD
%117 = load i64, i64* @BPF_B
%118 = add nsw i64 %117, %116
%119 = load i64, i64* @BPF_ABS
%120 = add nsw i64 %118, %119
%121 = load i32, i32* @SKF_AD_OFF
%122 = load i32, i32* @SKF_AD_ALU_XOR_X
%123 = add nsw i32 %122, %121
%124 = call i32 @BPF_STMT(i64 %120, i32 %123)
%125 = getelementptr inbounds %struct.sock_filter, %struct.sock_filter* %12, i64 0, i32 0
store i32 %124, i32* %125
%126 = call i32 @__add_inst(%struct.sock_fprog* %0, %struct.sock_filter* %12)
%127 = icmp eq i32 %126, 0
br i1 %127, label %128, label %137
128: ; preds = %114
%129 = bitcast %struct.sock_filter* %13 to i8*
%130 = load i64, i64* @BPF_MISC
%131 = load i64, i64* @BPF_TAX
%132 = add nsw i64 %131, %130
%133 = call i32 @BPF_STMT(i64 %132, i32 0)
%134 = getelementptr inbounds %struct.sock_filter, %struct.sock_filter* %13, i64 0, i32 0
store i32 %133, i32* %134
%135 = call i32 @__add_inst(%struct.sock_fprog* %0, %struct.sock_filter* %13)
%136 = icmp eq i32 %135, 0
br i1 %136, label %139, label %137
137: ; preds = %128, %114, %103, %91, %80, %73, %59, %48, %37, %25, %17
%138 = phi i32 [ %23, %17 ], [ %35, %25 ], [ %46, %37 ], [ %57, %48 ], [ %71, %59 ], [ %78, %73 ], [ %89, %80 ], [ %101, %91 ], [ %112, %103 ], [ %126, %114 ], [ %135, %128 ]
br label %139
139: ; preds = %128, %137
%140 = phi i32 [ %138, %137 ], [ 0, %128 ]
ret i32 %140
}