#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 PACKET_FANOUT_CBPF;
int PACKET_FANOUT_CPU;
int PACKET_FANOUT_EBPF;
int PACKET_FANOUT_FLAG_ROLLOVER;
int PACKET_FANOUT_HASH;
int PACKET_FANOUT_LB;
int PACKET_FANOUT_ROLLOVER;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ set_cpuaffinity(int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ test_control_group();
int /*<<< orphan*/ test_control_single();
int test_datapath(int, int, int const *, int const *);
int main(int argc, char **argv) {
  const int expect_hash[2][2] = {{15, 5}, {20, 5}};
  const int expect_hash_rb[2][2] = {{15, 5}, {20, 15}};
  const int expect_lb[2][2] = {{10, 10}, {18, 17}};
  const int expect_rb[2][2] = {{15, 5}, {20, 15}};
  const int expect_cpu0[2][2] = {{20, 0}, {20, 0}};
  const int expect_cpu1[2][2] = {{0, 20}, {0, 20}};
  const int expect_bpf[2][2] = {{15, 5}, {15, 20}};
  int port_off = 2, tries = 5, ret;
  test_control_single();
  test_control_group();
  ret = test_datapath(PACKET_FANOUT_HASH, port_off, expect_hash[0],
                      expect_hash[1]);
  while (ret && tries--) {
    fprintf(stderr, "info: trying alternate ports (%d)\n", tries);
    ret = test_datapath(PACKET_FANOUT_HASH, ++port_off, expect_hash[0],
                        expect_hash[1]);
  }
  ret |= test_datapath(PACKET_FANOUT_HASH | PACKET_FANOUT_FLAG_ROLLOVER,
                       port_off, expect_hash_rb[0], expect_hash_rb[1]);
  ret |= test_datapath(PACKET_FANOUT_LB, port_off, expect_lb[0], expect_lb[1]);
  ret |= test_datapath(PACKET_FANOUT_ROLLOVER, port_off, expect_rb[0],
                       expect_rb[1]);
  ret |=
      test_datapath(PACKET_FANOUT_CBPF, port_off, expect_bpf[0], expect_bpf[1]);
  ret |=
      test_datapath(PACKET_FANOUT_EBPF, port_off, expect_bpf[0], expect_bpf[1]);
  set_cpuaffinity(0);
  ret |= test_datapath(PACKET_FANOUT_CPU, port_off, expect_cpu0[0],
                       expect_cpu0[1]);
  if (!set_cpuaffinity(1))
    ret |= test_datapath(PACKET_FANOUT_CPU, port_off, expect_cpu1[0],
                         expect_cpu1[1]);
  if (ret) {
    return 1;
  }
  printf("OK. All tests passed\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xe80(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xe7d(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xe7a(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xe77(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xe74(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xe71(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xe4e(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xe4b(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0xe58(%rip),%rax
mov    %rax,-0x60(%rbp)
mov    0xe55(%rip),%rax
mov    %rax,-0x58(%rbp)
mov    0xe52(%rip),%rax
mov    %rax,-0x70(%rbp)
mov    0xe4f(%rip),%rax
mov    %rax,-0x68(%rbp)
mov    0xe4c(%rip),%rax
mov    %rax,-0x80(%rbp)
mov    0xe49(%rip),%rax
mov    %rax,-0x78(%rbp)
movl   $0x2,-0x84(%rbp)
movl   $0x5,-0x88(%rbp)
mov    $0x0,%al
call   1080 <test_control_single@plt>
mov    $0x0,%al
call   1050 <test_control_group@plt>
mov    0x2d94(%rip),%rax
mov    (%rax),%edi
mov    -0x84(%rbp),%esi
lea    -0x20(%rbp),%rdx
lea    -0x20(%rbp),%rcx
add    $0x8,%rcx
call   1070 <test_datapath@plt>
mov    %eax,-0x8c(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x8c(%rbp)
mov    %al,-0x8d(%rbp)
je     128d <main+0x12d>
mov    -0x88(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x88(%rbp)
cmp    $0x0,%eax
setne  %al
mov    %al,-0x8d(%rbp)
mov    -0x8d(%rbp),%al
test   $0x1,%al
jne    12a0 <main+0x140>
jmp    12ef <main+0x18f>
mov    0x2d11(%rip),%rax
mov    (%rax),%edi
mov    -0x88(%rbp),%edx
lea    0xdaa(%rip),%rsi
call   1060 <fprintf@plt>
mov    0x2d0e(%rip),%rax
mov    (%rax),%edi
mov    -0x84(%rbp),%esi
add    $0x1,%esi
mov    %esi,-0x84(%rbp)
lea    -0x20(%rbp),%rdx
lea    -0x20(%rbp),%rcx
add    $0x8,%rcx
call   1070 <test_datapath@plt>
mov    %eax,-0x8c(%rbp)
jmp    125b <main+0xfb>
mov    0x2cda(%rip),%rax
mov    (%rax),%edi
mov    0x2cb1(%rip),%rax
or     (%rax),%edi
mov    -0x84(%rbp),%esi
lea    -0x30(%rbp),%rdx
lea    -0x30(%rbp),%rcx
add    $0x8,%rcx
call   1070 <test_datapath@plt>
or     -0x8c(%rbp),%eax
mov    %eax,-0x8c(%rbp)
mov    0x2c9d(%rip),%rax
mov    (%rax),%edi
mov    -0x84(%rbp),%esi
lea    -0x40(%rbp),%rdx
lea    -0x40(%rbp),%rcx
add    $0x8,%rcx
call   1070 <test_datapath@plt>
or     -0x8c(%rbp),%eax
mov    %eax,-0x8c(%rbp)
mov    0x2c99(%rip),%rax
mov    (%rax),%edi
mov    -0x84(%rbp),%esi
lea    -0x50(%rbp),%rdx
lea    -0x50(%rbp),%rcx
add    $0x8,%rcx
call   1070 <test_datapath@plt>
or     -0x8c(%rbp),%eax
mov    %eax,-0x8c(%rbp)
mov    0x2c1d(%rip),%rax
mov    (%rax),%edi
mov    -0x84(%rbp),%esi
lea    -0x80(%rbp),%rdx
lea    -0x80(%rbp),%rcx
add    $0x8,%rcx
call   1070 <test_datapath@plt>
or     -0x8c(%rbp),%eax
mov    %eax,-0x8c(%rbp)
mov    0x2c29(%rip),%rax
mov    (%rax),%edi
mov    -0x84(%rbp),%esi
lea    -0x80(%rbp),%rdx
lea    -0x80(%rbp),%rcx
add    $0x8,%rcx
call   1070 <test_datapath@plt>
or     -0x8c(%rbp),%eax
mov    %eax,-0x8c(%rbp)
xor    %edi,%edi
call   1030 <set_cpuaffinity@plt>
mov    0x2c06(%rip),%rax
mov    (%rax),%edi
mov    -0x84(%rbp),%esi
lea    -0x60(%rbp),%rdx
lea    -0x60(%rbp),%rcx
add    $0x8,%rcx
call   1070 <test_datapath@plt>
or     -0x8c(%rbp),%eax
mov    %eax,-0x8c(%rbp)
mov    $0x1,%edi
call   1030 <set_cpuaffinity@plt>
cmp    $0x0,%eax
jne    1446 <main+0x2e6>
mov    0x2bc7(%rip),%rax
mov    (%rax),%edi
mov    -0x84(%rbp),%esi
lea    -0x70(%rbp),%rdx
lea    -0x70(%rbp),%rcx
add    $0x8,%rcx
call   1070 <test_datapath@plt>
or     -0x8c(%rbp),%eax
mov    %eax,-0x8c(%rbp)
cmpl   $0x0,-0x8c(%rbp)
je     145f <main+0x2ff>
movl   $0x1,-0x4(%rbp)
jmp    1472 <main+0x312>
lea    0xc1d(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
movaps 0xe8b(%rip),%xmm0
movaps %xmm0,(%rsp)
movaps 0xea0(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xe84(%rip),%xmm1
movaps %xmm1,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps 0xe93(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xe97(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xe9b(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
xor    %r12d,%r12d
xor    %eax,%eax
call   1080 <test_control_single@plt>
xor    %eax,%eax
call   1050 <test_control_group@plt>
mov    0x2dfe(%rip),%rbx
mov    (%rbx),%edi
lea    0x8(%rsp),%rbp
mov    $0x2,%r15d
mov    %rsp,%rdx
mov    $0x2,%esi
mov    %rbp,%rcx
call   1070 <test_datapath@plt>
test   %eax,%eax
je     12f4 <main+0x194>
mov    0x2dba(%rip),%r14
mov    (%r14),%edi
lea    0xe58(%rip),%rsi
mov    $0x4,%edx
call   1060 <fprintf@plt>
mov    (%rbx),%edi
mov    $0x3,%r15d
mov    %rsp,%rdx
mov    $0x3,%esi
mov    %rbp,%rcx
call   1070 <test_datapath@plt>
test   %eax,%eax
je     12f4 <main+0x194>
mov    (%r14),%edi
lea    0xe24(%rip),%rsi
mov    $0x3,%edx
call   1060 <fprintf@plt>
mov    (%rbx),%edi
mov    %rsp,%rdx
mov    $0x4,%esi
mov    %rbp,%rcx
call   1070 <test_datapath@plt>
test   %eax,%eax
je     12ee <main+0x18e>
mov    (%r14),%edi
lea    0xdf6(%rip),%rsi
mov    $0x2,%edx
call   1060 <fprintf@plt>
mov    (%rbx),%edi
mov    $0x5,%r15d
mov    %rsp,%rdx
mov    $0x5,%esi
mov    %rbp,%rcx
call   1070 <test_datapath@plt>
test   %eax,%eax
je     12f4 <main+0x194>
mov    (%r14),%edi
lea    0xdc6(%rip),%rsi
mov    $0x1,%edx
call   1060 <fprintf@plt>
mov    (%rbx),%edi
mov    $0x6,%r15d
mov    %rsp,%rdx
mov    $0x6,%esi
mov    %rbp,%rcx
call   1070 <test_datapath@plt>
test   %eax,%eax
je     12f4 <main+0x194>
mov    (%r14),%edi
lea    0xd96(%rip),%rsi
xor    %edx,%edx
call   1060 <fprintf@plt>
mov    (%rbx),%edi
mov    $0x7,%r15d
mov    %rsp,%rdx
mov    $0x7,%esi
mov    %rbp,%rcx
call   1070 <test_datapath@plt>
mov    %eax,%r12d
jmp    12f4 <main+0x194>
mov    $0x4,%r15d
mov    0x2cb5(%rip),%rax
mov    (%rax),%edi
or     (%rbx),%edi
lea    0x68(%rsp),%rcx
lea    0x60(%rsp),%rdx
mov    %r15d,%esi
call   1070 <test_datapath@plt>
mov    %eax,%ebx
mov    0x2cae(%rip),%rax
mov    (%rax),%edi
lea    0x58(%rsp),%rcx
lea    0x50(%rsp),%rdx
mov    %r15d,%esi
call   1070 <test_datapath@plt>
mov    %eax,%r14d
or     %r12d,%r14d
or     %ebx,%r14d
mov    0x2cb2(%rip),%rax
mov    (%rax),%edi
lea    0x48(%rsp),%rcx
lea    0x40(%rsp),%rdx
mov    %r15d,%esi
call   1070 <test_datapath@plt>
mov    %eax,%r13d
mov    0x2c44(%rip),%rax
mov    (%rax),%edi
lea    0x18(%rsp),%rbp
lea    0x10(%rsp),%r12
mov    %r15d,%esi
mov    %r12,%rdx
mov    %rbp,%rcx
call   1070 <test_datapath@plt>
mov    %eax,%ebx
or     %r13d,%ebx
mov    0x2c56(%rip),%rax
mov    (%rax),%edi
mov    %r15d,%esi
mov    %r12,%rdx
mov    %rbp,%rcx
call   1070 <test_datapath@plt>
mov    %eax,%ebp
or     %ebx,%ebp
or     %r14d,%ebp
xor    %edi,%edi
call   1030 <set_cpuaffinity@plt>
mov    0x2c41(%rip),%r12
mov    (%r12),%edi
lea    0x38(%rsp),%rcx
lea    0x30(%rsp),%rdx
mov    %r15d,%esi
call   1070 <test_datapath@plt>
mov    %eax,%ebx
or     %ebp,%ebx
mov    $0x1,%r14d
mov    $0x1,%edi
call   1030 <set_cpuaffinity@plt>
test   %eax,%eax
je     13fa <main+0x29a>
test   %ebx,%ebx
jne    13e8 <main+0x288>
lea    0xca3(%rip),%rdi
call   1040 <puts@plt>
xor    %r14d,%r14d
mov    %r14d,%eax
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    (%r12),%edi
lea    0x28(%rsp),%rcx
lea    0x20(%rsp),%rdx
mov    %r15d,%esi
call   1070 <test_datapath@plt>
or     %eax,%ebx
test   %ebx,%ebx
jne    13e8 <main+0x288>
jmp    13d9 <main+0x279>

LLVM IR (-O0):
@__const.main.expect_hash = [2 x [2 x i32]] [[2 x i32] [i32 15, i32 5], [2 x i32] [i32 20, i32 5]]
@__const.main.expect_hash_rb = [2 x [2 x i32]] [[2 x i32] [i32 15, i32 5], [2 x i32] [i32 20, i32 15]]
@__const.main.expect_lb = [2 x [2 x i32]] [[2 x i32] [i32 10, i32 10], [2 x i32] [i32 18, i32 17]]
@__const.main.expect_rb = [2 x [2 x i32]] [[2 x i32] [i32 15, i32 5], [2 x i32] [i32 20, i32 15]]
@__const.main.expect_cpu0 = [2 x [2 x i32]] [[2 x i32] [i32 20, i32 0], [2 x i32] [i32 20, i32 0]]
@__const.main.expect_cpu1 = [2 x [2 x i32]] [[2 x i32] [i32 0, i32 20], [2 x i32] [i32 0, i32 20]]
@__const.main.expect_bpf = [2 x [2 x i32]] [[2 x i32] [i32 15, i32 5], [2 x i32] [i32 15, i32 20]]
@PACKET_FANOUT_HASH = global i32 0
@stderr = global i32 0
@.str = [35 x i8] c"info: trying alternate ports (%d)\0A\00"
@PACKET_FANOUT_FLAG_ROLLOVER = global i32 0
@PACKET_FANOUT_LB = global i32 0
@PACKET_FANOUT_ROLLOVER = global i32 0
@PACKET_FANOUT_CBPF = global i32 0
@PACKET_FANOUT_EBPF = global i32 0
@PACKET_FANOUT_CPU = global i32 0
@.str.1 = [22 x i8] c"OK. All tests passed\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [2 x [2 x i32]]
%7 = alloca [2 x [2 x i32]]
%8 = alloca [2 x [2 x i32]]
%9 = alloca [2 x [2 x i32]]
%10 = alloca [2 x [2 x i32]]
%11 = alloca [2 x [2 x i32]]
%12 = alloca [2 x [2 x i32]]
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%16 = bitcast [2 x [2 x i32]]* %6 to i8*
%17 = bitcast [2 x [2 x i32]]* %7 to i8*
%18 = bitcast [2 x [2 x i32]]* %8 to i8*
%19 = bitcast [2 x [2 x i32]]* %9 to i8*
%20 = bitcast [2 x [2 x i32]]* %10 to i8*
%21 = bitcast [2 x [2 x i32]]* %11 to i8*
%22 = bitcast [2 x [2 x i32]]* %12 to i8*
store i32 2, i32* %13
store i32 5, i32* %14
%23 = call i32 (...) @test_control_single()
%24 = call i32 (...) @test_control_group()
%25 = load i32, i32* @PACKET_FANOUT_HASH
%26 = load i32, i32* %13
%27 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %6, i64 0, i64 0
%28 = getelementptr inbounds [2 x i32], [2 x i32]* %27, i64 0, i64 0
%29 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %6, i64 0, i64 1
%30 = getelementptr inbounds [2 x i32], [2 x i32]* %29, i64 0, i64 0
%31 = call i32 @test_datapath(i32 %25, i32 %26, i32* %28, i32* %30)
store i32 %31, i32* %15
br label %32
32: ; preds = %41, %2
%33 = load i32, i32* %15
%34 = icmp ne i32 %33, 0
br i1 %34, label %35, label %39
35: ; preds = %32
%36 = load i32, i32* %14
%37 = add nsw i32 %36, -1
store i32 %37, i32* %14
%38 = icmp ne i32 %36, 0
br label %39
39: ; preds = %35, %32
%40 = phi i1 [ false, %32 ], [ %38, %35 ]
br i1 %40, label %41, label %53
41: ; preds = %39
%42 = load i32, i32* @stderr
%43 = load i32, i32* %14
%44 = call i32 @fprintf(i32 %42, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %43)
%45 = load i32, i32* @PACKET_FANOUT_HASH
%46 = load i32, i32* %13
%47 = add nsw i32 %46, 1
store i32 %47, i32* %13
%48 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %6, i64 0, i64 0
%49 = getelementptr inbounds [2 x i32], [2 x i32]* %48, i64 0, i64 0
%50 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %6, i64 0, i64 1
%51 = getelementptr inbounds [2 x i32], [2 x i32]* %50, i64 0, i64 0
%52 = call i32 @test_datapath(i32 %45, i32 %47, i32* %49, i32* %51)
store i32 %52, i32* %15
br label %32
53: ; preds = %39
%54 = load i32, i32* @PACKET_FANOUT_HASH
%55 = load i32, i32* @PACKET_FANOUT_FLAG_ROLLOVER
%56 = or i32 %54, %55
%57 = load i32, i32* %13
%58 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %7, i64 0, i64 0
%59 = getelementptr inbounds [2 x i32], [2 x i32]* %58, i64 0, i64 0
%60 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %7, i64 0, i64 1
%61 = getelementptr inbounds [2 x i32], [2 x i32]* %60, i64 0, i64 0
%62 = call i32 @test_datapath(i32 %56, i32 %57, i32* %59, i32* %61)
%63 = load i32, i32* %15
%64 = or i32 %63, %62
store i32 %64, i32* %15
%65 = load i32, i32* @PACKET_FANOUT_LB
%66 = load i32, i32* %13
%67 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %8, i64 0, i64 0
%68 = getelementptr inbounds [2 x i32], [2 x i32]* %67, i64 0, i64 0
%69 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %8, i64 0, i64 1
%70 = getelementptr inbounds [2 x i32], [2 x i32]* %69, i64 0, i64 0
%71 = call i32 @test_datapath(i32 %65, i32 %66, i32* %68, i32* %70)
%72 = load i32, i32* %15
%73 = or i32 %72, %71
store i32 %73, i32* %15
%74 = load i32, i32* @PACKET_FANOUT_ROLLOVER
%75 = load i32, i32* %13
%76 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %9, i64 0, i64 0
%77 = getelementptr inbounds [2 x i32], [2 x i32]* %76, i64 0, i64 0
%78 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %9, i64 0, i64 1
%79 = getelementptr inbounds [2 x i32], [2 x i32]* %78, i64 0, i64 0
%80 = call i32 @test_datapath(i32 %74, i32 %75, i32* %77, i32* %79)
%81 = load i32, i32* %15
%82 = or i32 %81, %80
store i32 %82, i32* %15
%83 = load i32, i32* @PACKET_FANOUT_CBPF
%84 = load i32, i32* %13
%85 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %12, i64 0, i64 0
%86 = getelementptr inbounds [2 x i32], [2 x i32]* %85, i64 0, i64 0
%87 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %12, i64 0, i64 1
%88 = getelementptr inbounds [2 x i32], [2 x i32]* %87, i64 0, i64 0
%89 = call i32 @test_datapath(i32 %83, i32 %84, i32* %86, i32* %88)
%90 = load i32, i32* %15
%91 = or i32 %90, %89
store i32 %91, i32* %15
%92 = load i32, i32* @PACKET_FANOUT_EBPF
%93 = load i32, i32* %13
%94 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %12, i64 0, i64 0
%95 = getelementptr inbounds [2 x i32], [2 x i32]* %94, i64 0, i64 0
%96 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %12, i64 0, i64 1
%97 = getelementptr inbounds [2 x i32], [2 x i32]* %96, i64 0, i64 0
%98 = call i32 @test_datapath(i32 %92, i32 %93, i32* %95, i32* %97)
%99 = load i32, i32* %15
%100 = or i32 %99, %98
store i32 %100, i32* %15
%101 = call i32 @set_cpuaffinity(i32 0)
%102 = load i32, i32* @PACKET_FANOUT_CPU
%103 = load i32, i32* %13
%104 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %10, i64 0, i64 0
%105 = getelementptr inbounds [2 x i32], [2 x i32]* %104, i64 0, i64 0
%106 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %10, i64 0, i64 1
%107 = getelementptr inbounds [2 x i32], [2 x i32]* %106, i64 0, i64 0
%108 = call i32 @test_datapath(i32 %102, i32 %103, i32* %105, i32* %107)
%109 = load i32, i32* %15
%110 = or i32 %109, %108
store i32 %110, i32* %15
%111 = call i32 @set_cpuaffinity(i32 1)
%112 = icmp ne i32 %111, 0
br i1 %112, label %123, label %113
113: ; preds = %53
%114 = load i32, i32* @PACKET_FANOUT_CPU
%115 = load i32, i32* %13
%116 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %11, i64 0, i64 0
%117 = getelementptr inbounds [2 x i32], [2 x i32]* %116, i64 0, i64 0
%118 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %11, i64 0, i64 1
%119 = getelementptr inbounds [2 x i32], [2 x i32]* %118, i64 0, i64 0
%120 = call i32 @test_datapath(i32 %114, i32 %115, i32* %117, i32* %119)
%121 = load i32, i32* %15
%122 = or i32 %121, %120
store i32 %122, i32* %15
br label %123
123: ; preds = %113, %53
%124 = load i32, i32* %15
%125 = icmp ne i32 %124, 0
br i1 %125, label %126, label %127
126: ; preds = %123
store i32 1, i32* %3
br label %129
127: ; preds = %123
%128 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %3
br label %129
129: ; preds = %127, %126
%130 = load i32, i32* %3
ret i32 %130
}

LLVM IR (-O2):
@__const.main.expect_hash = [2 x [2 x i32]] [[2 x i32] [i32 15, i32 5], [2 x i32] [i32 20, i32 5]]
@__const.main.expect_lb = [2 x [2 x i32]] [[2 x i32] [i32 10, i32 10], [2 x i32] [i32 18, i32 17]]
@__const.main.expect_rb = [2 x [2 x i32]] [[2 x i32] [i32 15, i32 5], [2 x i32] [i32 20, i32 15]]
@__const.main.expect_cpu0 = [2 x [2 x i32]] [[2 x i32] [i32 20, i32 0], [2 x i32] [i32 20, i32 0]]
@__const.main.expect_cpu1 = [2 x [2 x i32]] [[2 x i32] [i32 0, i32 20], [2 x i32] [i32 0, i32 20]]
@__const.main.expect_bpf = [2 x [2 x i32]] [[2 x i32] [i32 15, i32 5], [2 x i32] [i32 15, i32 20]]
@PACKET_FANOUT_HASH = global i32 0
@stderr = global i32 0
@.str = [35 x i8] c"info: trying alternate ports (%d)\0A\00"
@PACKET_FANOUT_FLAG_ROLLOVER = global i32 0
@PACKET_FANOUT_LB = global i32 0
@PACKET_FANOUT_ROLLOVER = global i32 0
@PACKET_FANOUT_CBPF = global i32 0
@PACKET_FANOUT_EBPF = global i32 0
@PACKET_FANOUT_CPU = global i32 0
@str = [21 x i8] c"OK. All tests passed\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [2 x [2 x i32]]
%4 = alloca [2 x [2 x i32]]
%5 = alloca [2 x [2 x i32]]
%6 = alloca [2 x [2 x i32]]
%7 = alloca [2 x [2 x i32]]
%8 = alloca [2 x [2 x i32]]
%9 = alloca [2 x [2 x i32]]
%10 = bitcast [2 x [2 x i32]]* %3 to i8*
%11 = bitcast [2 x [2 x i32]]* %4 to i8*
%12 = bitcast [2 x [2 x i32]]* %5 to i8*
%13 = bitcast [2 x [2 x i32]]* %6 to i8*
%14 = bitcast [2 x [2 x i32]]* %7 to i8*
%15 = bitcast [2 x [2 x i32]]* %8 to i8*
%16 = bitcast [2 x [2 x i32]]* %9 to i8*
%17 = tail call i32 (...) @test_control_single()
%18 = tail call i32 (...) @test_control_group()
%19 = load i32, i32* @PACKET_FANOUT_HASH
%20 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %3, i64 0, i64 0, i64 0
%21 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %3, i64 0, i64 1, i64 0
%22 = call i32 @test_datapath(i32 %19, i32 2, i32* %20, i32* %21)
%23 = icmp eq i32 %22, 0
br i1 %23, label %53, label %24
24: ; preds = %2
%25 = load i32, i32* @stderr
%26 = call i32 @fprintf(i32 %25, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 4)
%27 = load i32, i32* @PACKET_FANOUT_HASH
%28 = call i32 @test_datapath(i32 %27, i32 3, i32* %20, i32* %21)
%29 = icmp eq i32 %28, 0
br i1 %29, label %53, label %30
30: ; preds = %24
%31 = load i32, i32* @stderr
%32 = call i32 @fprintf(i32 %31, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 3)
%33 = load i32, i32* @PACKET_FANOUT_HASH
%34 = call i32 @test_datapath(i32 %33, i32 4, i32* %20, i32* %21)
%35 = icmp eq i32 %34, 0
br i1 %35, label %53, label %36
36: ; preds = %30
%37 = load i32, i32* @stderr
%38 = call i32 @fprintf(i32 %37, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 2)
%39 = load i32, i32* @PACKET_FANOUT_HASH
%40 = call i32 @test_datapath(i32 %39, i32 5, i32* %20, i32* %21)
%41 = icmp eq i32 %40, 0
br i1 %41, label %53, label %42
42: ; preds = %36
%43 = load i32, i32* @stderr
%44 = call i32 @fprintf(i32 %43, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 1)
%45 = load i32, i32* @PACKET_FANOUT_HASH
%46 = call i32 @test_datapath(i32 %45, i32 6, i32* %20, i32* %21)
%47 = icmp eq i32 %46, 0
br i1 %47, label %53, label %48
48: ; preds = %42
%49 = load i32, i32* @stderr
%50 = call i32 @fprintf(i32 %49, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 0)
%51 = load i32, i32* @PACKET_FANOUT_HASH
%52 = call i32 @test_datapath(i32 %51, i32 7, i32* %20, i32* %21)
br label %53
53: ; preds = %48, %24, %30, %36, %42, %2
%54 = phi i32 [ 2, %2 ], [ 3, %24 ], [ 4, %30 ], [ 5, %36 ], [ 6, %42 ], [ 7, %48 ]
%55 = phi i32 [ 0, %2 ], [ 0, %24 ], [ 0, %30 ], [ 0, %36 ], [ 0, %42 ], [ %52, %48 ]
%56 = load i32, i32* @PACKET_FANOUT_HASH
%57 = load i32, i32* @PACKET_FANOUT_FLAG_ROLLOVER
%58 = or i32 %57, %56
%59 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %4, i64 0, i64 0, i64 0
%60 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %4, i64 0, i64 1, i64 0
%61 = call i32 @test_datapath(i32 %58, i32 %54, i32* %59, i32* %60)
%62 = or i32 %61, %55
%63 = load i32, i32* @PACKET_FANOUT_LB
%64 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %5, i64 0, i64 0, i64 0
%65 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %5, i64 0, i64 1, i64 0
%66 = call i32 @test_datapath(i32 %63, i32 %54, i32* %64, i32* %65)
%67 = or i32 %62, %66
%68 = load i32, i32* @PACKET_FANOUT_ROLLOVER
%69 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %6, i64 0, i64 0, i64 0
%70 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %6, i64 0, i64 1, i64 0
%71 = call i32 @test_datapath(i32 %68, i32 %54, i32* %69, i32* %70)
%72 = or i32 %67, %71
%73 = load i32, i32* @PACKET_FANOUT_CBPF
%74 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %9, i64 0, i64 0, i64 0
%75 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %9, i64 0, i64 1, i64 0
%76 = call i32 @test_datapath(i32 %73, i32 %54, i32* %74, i32* %75)
%77 = or i32 %72, %76
%78 = load i32, i32* @PACKET_FANOUT_EBPF
%79 = call i32 @test_datapath(i32 %78, i32 %54, i32* %74, i32* %75)
%80 = or i32 %77, %79
%81 = call i32 @set_cpuaffinity(i32 0)
%82 = load i32, i32* @PACKET_FANOUT_CPU
%83 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %7, i64 0, i64 0, i64 0
%84 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %7, i64 0, i64 1, i64 0
%85 = call i32 @test_datapath(i32 %82, i32 %54, i32* %83, i32* %84)
%86 = or i32 %80, %85
%87 = call i32 @set_cpuaffinity(i32 1)
%88 = icmp eq i32 %87, 0
br i1 %88, label %89, label %95
89: ; preds = %53
%90 = load i32, i32* @PACKET_FANOUT_CPU
%91 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %8, i64 0, i64 0, i64 0
%92 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %8, i64 0, i64 1, i64 0
%93 = call i32 @test_datapath(i32 %90, i32 %54, i32* %91, i32* %92)
%94 = or i32 %93, %86
br label %95
95: ; preds = %89, %53
%96 = phi i32 [ %86, %53 ], [ %94, %89 ]
%97 = icmp eq i32 %96, 0
br i1 %97, label %98, label %100
98: ; preds = %95
%99 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
br label %100
100: ; preds = %95, %98
%101 = phi i32 [ 0, %98 ], [ 1, %95 ]
ret i32 %101
}