#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 */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ BPF_MAP_TYPE_CGROUP_ARRAY;
int /*<<< orphan*/ O_RDONLY;
int bpf_create_map(int /*<<< orphan*/, int, int, int, int /*<<< orphan*/);
int bpf_obj_get(char const *);
int bpf_obj_pin(int, char const *);
int bpf_update_elem(int, int *, int *, int /*<<< orphan*/);
int /*<<< orphan*/ close(int);
int errno;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, ...);
int getopt(int, char **, char *);
int open(char const *, int /*<<< orphan*/);
char *optarg;
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ stderr;
char *strerror(int);
int /*<<< orphan*/ usage();
int main(int argc, char **argv) {
  const char *pinned_file = NULL, *cg2 = NULL;
  int create_array = 1;
  int array_key = 0;
  int array_fd = -1;
  int cg2_fd = -1;
  int ret = -1;
  int opt;
  while ((opt = getopt(argc, argv, "F:U:v:")) != -1) {
    switch (opt) {
    case 'F':
      pinned_file = optarg;
      break;
    case 'U':
      pinned_file = optarg;
      create_array = 0;
      break;
    case 'v':
      cg2 = optarg;
      break;
    default:
      usage();
      goto out;
    }
  }
  if (!cg2 || !pinned_file) {
    usage();
    goto out;
  }
  cg2_fd = open(cg2, O_RDONLY);
  if (cg2_fd < 0) {
    fprintf(stderr, "open(%s,...): %s(%d)\n", cg2, strerror(errno), errno);
    goto out;
  }
  if (create_array) {
    array_fd = bpf_create_map(BPF_MAP_TYPE_CGROUP_ARRAY, sizeof(uint32_t),
                              sizeof(uint32_t), 1, 0);
    if (array_fd < 0) {
      fprintf(stderr, "bpf_create_map(BPF_MAP_TYPE_CGROUP_ARRAY,...): %s(%d)\n",
              strerror(errno), errno);
      goto out;
    }
  } else {
    array_fd = bpf_obj_get(pinned_file);
    if (array_fd < 0) {
      fprintf(stderr, "bpf_obj_get(%s): %s(%d)\n", pinned_file, strerror(errno),
              errno);
      goto out;
    }
  }
  ret = bpf_update_elem(array_fd, &array_key, &cg2_fd, 0);
  if (ret) {
    perror("bpf_update_elem");
    goto out;
  }
  if (create_array) {
    ret = bpf_obj_pin(array_fd, pinned_file);
    if (ret) {
      fprintf(stderr, "bpf_obj_pin(..., %s): %s(%d)\n", pinned_file,
              strerror(errno), errno);
      goto out;
    }
  }
out:
  if (array_fd != -1) {
    close(array_fd);
  }
  if (cg2_fd != -1) {
    close(cg2_fd);
  }
  return ret;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
movl   $0x1,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0xffffffff,-0x2c(%rbp)
movl   $0xffffffff,-0x30(%rbp)
movl   $0xffffffff,-0x34(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xdf9(%rip),%rdx
call   10c0 <getopt@plt>
mov    %eax,-0x38(%rbp)
cmp    $0xffffffff,%eax
je     129f <main+0xef>
mov    -0x38(%rbp),%eax
mov    %eax,-0x3c(%rbp)
sub    $0x46,%eax
je     124e <main+0x9e>
jmp    122c <main+0x7c>
mov    -0x3c(%rbp),%eax
sub    $0x55,%eax
je     1261 <main+0xb1>
jmp    123d <main+0x8d>
mov    -0x3c(%rbp),%eax
sub    $0x76,%eax
je     127b <main+0xcb>
jmp    128e <main+0xde>
mov    0x2da3(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
jmp    129a <main+0xea>
mov    0x2d90(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x24(%rbp)
jmp    129a <main+0xea>
mov    0x2d76(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
jmp    129a <main+0xea>
mov    $0x0,%al
call   1090 <usage@plt>
jmp    14a8 <main+0x2f8>
jmp    11f9 <main+0x49>
cmpq   $0x0,-0x20(%rbp)
je     12b5 <main+0x105>
cmpq   $0x0,-0x18(%rbp)
jne    12c1 <main+0x111>
mov    $0x0,%al
call   1090 <usage@plt>
jmp    14a8 <main+0x2f8>
mov    -0x20(%rbp),%rdi
mov    0x2d0c(%rip),%rax
mov    (%rax),%esi
call   10a0 <open@plt>
mov    %eax,-0x30(%rbp)
cmpl   $0x0,-0x30(%rbp)
jge    1329 <main+0x179>
mov    0x2ce1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4c(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    0x2cc5(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
mov    -0x4c(%rbp),%edi
mov    -0x48(%rbp),%rdx
mov    %rax,%rcx
mov    0x2cad(%rip),%rax
mov    (%rax),%r8d
lea    0xcea(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
jmp    14a8 <main+0x2f8>
cmpl   $0x0,-0x24(%rbp)
je     139e <main+0x1ee>
mov    0x2ca6(%rip),%rax
mov    (%rax),%edi
mov    $0x4,%edx
mov    $0x1,%ecx
xor    %r8d,%r8d
mov    %edx,%esi
call   1070 <bpf_create_map@plt>
mov    %eax,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
jge    1399 <main+0x1e9>
mov    0x2c64(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x50(%rbp)
mov    0x2c50(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
mov    -0x50(%rbp),%edi
mov    %rax,%rdx
mov    0x2c3c(%rip),%rax
mov    (%rax),%ecx
lea    0xc90(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
jmp    14a8 <main+0x2f8>
jmp    1402 <main+0x252>
mov    -0x18(%rbp),%rdi
call   1040 <bpf_obj_get@plt>
mov    %eax,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
jge    13fd <main+0x24d>
mov    0x2c0d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x5c(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    0x2bf1(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
mov    -0x5c(%rbp),%edi
mov    -0x58(%rbp),%rdx
mov    %rax,%rcx
mov    0x2bd9(%rip),%rax
mov    (%rax),%r8d
lea    0xc63(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
jmp    14a8 <main+0x2f8>
jmp    1402 <main+0x252>
mov    -0x2c(%rbp),%edi
lea    -0x28(%rbp),%rsi
lea    -0x30(%rbp),%rdx
xor    %ecx,%ecx
call   1080 <bpf_update_elem@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
je     1432 <main+0x282>
lea    0xc45(%rip),%rdi
call   10b0 <perror@plt>
jmp    14a8 <main+0x2f8>
cmpl   $0x0,-0x24(%rbp)
je     14a3 <main+0x2f3>
mov    -0x2c(%rbp),%edi
mov    -0x18(%rbp),%rsi
call   1030 <bpf_obj_pin@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
je     149e <main+0x2ee>
mov    0x2b6c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x6c(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    0x2b50(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
mov    -0x6c(%rbp),%edi
mov    -0x68(%rbp),%rdx
mov    %rax,%rcx
mov    0x2b38(%rip),%rax
mov    (%rax),%r8d
lea    0xbeb(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
jmp    14a8 <main+0x2f8>
jmp    14a3 <main+0x2f3>
jmp    14a8 <main+0x2f8>
cmpl   $0xffffffff,-0x2c(%rbp)
je     14ba <main+0x30a>
mov    -0x2c(%rbp),%edi
call   1050 <close@plt>
cmpl   $0xffffffff,-0x30(%rbp)
je     14cc <main+0x31c>
mov    -0x30(%rbp),%edi
call   1050 <close@plt>
mov    -0x34(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%rbp
mov    %edi,%ebx
movl   $0x0,0x14(%rsp)
movl   $0x1,0x10(%rsp)
xor    %r14d,%r14d
lea    0xe23(%rip),%r15
mov    0x2e14(%rip),%r13
xor    %r12d,%r12d
jmp    11f4 <main+0x44>
nopl   0x0(%rax)
mov    0x0(%r13),%r12
mov    %ebx,%edi
mov    %rbp,%rsi
mov    %r15,%rdx
call   10c0 <getopt@plt>
cmp    $0x46,%eax
je     11f0 <main+0x40>
cmp    $0xffffffff,%eax
je     122d <main+0x7d>
cmp    $0x55,%eax
je     121f <main+0x6f>
cmp    $0x76,%eax
jne    1300 <main+0x150>
mov    0x0(%r13),%r14
jmp    11f4 <main+0x44>
mov    0x0(%r13),%r12
movl   $0x0,0x10(%rsp)
jmp    11f4 <main+0x44>
test   %r14,%r14
je     1300 <main+0x150>
test   %r12,%r12
je     1300 <main+0x150>
mov    0x2d92(%rip),%rax
mov    (%rax),%esi
mov    %r14,%rdi
call   10a0 <open@plt>
mov    %eax,%r15d
mov    %eax,0xc(%rsp)
test   %eax,%eax
js     131d <main+0x16d>
cmpl   $0x0,0x10(%rsp)
je     1360 <main+0x1b0>
mov    0x2d6f(%rip),%rax
mov    (%rax),%edi
mov    $0x4,%esi
mov    $0x4,%edx
mov    $0x1,%ecx
xor    %r8d,%r8d
call   1070 <bpf_create_map@plt>
mov    %eax,%r14d
test   %eax,%eax
js     1399 <main+0x1e9>
lea    0x14(%rsp),%rsi
lea    0xc(%rsp),%rdx
xor    %ebp,%ebp
mov    %r14d,%edi
xor    %ecx,%ecx
call   1080 <bpf_update_elem@plt>
test   %eax,%eax
jne    1389 <main+0x1d9>
mov    %r14d,%edi
mov    %r12,%rsi
call   1030 <bpf_obj_pin@plt>
test   %eax,%eax
je     1406 <main+0x256>
mov    %eax,%ebx
mov    0x2cf9(%rip),%rax
mov    (%rax),%ebp
mov    0x2ce8(%rip),%r15
mov    (%r15),%edi
call   10d0 <strerror@plt>
mov    (%r15),%r8d
lea    0xd93(%rip),%rsi
mov    %ebp,%edi
mov    %r12,%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    %ebx,%ebp
jmp    1406 <main+0x256>
xor    %eax,%eax
call   1090 <usage@plt>
mov    $0xffffffff,%ebp
mov    %ebp,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2ca4(%rip),%rax
mov    (%rax),%ebx
mov    0x2c93(%rip),%rbp
mov    0x0(%rbp),%edi
call   10d0 <strerror@plt>
mov    0x0(%rbp),%r8d
lea    0xcc7(%rip),%rsi
mov    %ebx,%edi
mov    %r14,%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    $0xffffffff,%ebp
cmp    $0xffffffff,%r15d
jne    141d <main+0x26d>
jmp    130c <main+0x15c>
mov    %r12,%rdi
call   1040 <bpf_obj_get@plt>
mov    %eax,%r14d
test   %eax,%eax
js     13c9 <main+0x219>
lea    0x14(%rsp),%rsi
lea    0xc(%rsp),%rdx
xor    %ebp,%ebp
mov    %r14d,%edi
xor    %ecx,%ecx
call   1080 <bpf_update_elem@plt>
test   %eax,%eax
je     1406 <main+0x256>
mov    %eax,%ebp
lea    0xcdb(%rip),%rdi
call   10b0 <perror@plt>
jmp    1406 <main+0x256>
mov    0x2c28(%rip),%rax
mov    (%rax),%ebx
mov    0x2c17(%rip),%rbp
mov    0x0(%rbp),%edi
call   10d0 <strerror@plt>
mov    0x0(%rbp),%ecx
lea    0xc62(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
xor    %eax,%eax
call   1060 <fprintf@plt>
jmp    13fb <main+0x24b>
mov    0x2bf8(%rip),%rax
mov    (%rax),%ebx
mov    0x2be7(%rip),%rbp
mov    0x0(%rbp),%edi
call   10d0 <strerror@plt>
mov    0x0(%rbp),%r8d
lea    0xc68(%rip),%rsi
mov    %ebx,%edi
mov    %r12,%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    $0xffffffff,%ebp
cmp    $0xffffffff,%r14d
je     141d <main+0x26d>
mov    %r14d,%edi
call   1050 <close@plt>
mov    0xc(%rsp),%r15d
cmp    $0xffffffff,%r15d
je     130c <main+0x15c>
mov    %r15d,%edi
call   1050 <close@plt>
jmp    130c <main+0x15c>

LLVM IR (-O0):
@.str = [7 x i8] c"F:U:v:\00"
@optarg = global i8* null
@O_RDONLY = global i32 0
@stderr = global i32 0
@.str.1 = [22 x i8] c"open(%s,...): %s(%d)\0A\00"
@errno = global i32 0
@BPF_MAP_TYPE_CGROUP_ARRAY = global i32 0
@.str.2 = [55 x i8] c"bpf_create_map(BPF_MAP_TYPE_CGROUP_ARRAY,...): %s(%d)\0A\00"
@.str.3 = [25 x i8] c"bpf_obj_get(%s): %s(%d)\0A\00"
@.str.4 = [16 x i8] c"bpf_update_elem\00"
@.str.5 = [30 x i8] c"bpf_obj_pin(..., %s): %s(%d)\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* null, i8** %6
store i8* null, i8** %7
store i32 1, i32* %8
store i32 0, i32* %9
store i32 -1, i32* %10
store i32 -1, i32* %11
store i32 -1, i32* %12
br label %14
14: ; preds = %29, %2
%15 = load i32, i32* %4
%16 = load i8**, i8*** %5
%17 = call i32 @getopt(i32 %15, i8** %16, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
store i32 %17, i32* %13
%18 = icmp ne i32 %17, -1
br i1 %18, label %19, label %30
19: ; preds = %14
%20 = load i32, i32* %13
switch i32 %20, label %27 [
i32 70, label %21
i32 85, label %23
i32 118, label %25
]
21: ; preds = %19
%22 = load i8*, i8** @optarg
store i8* %22, i8** %6
br label %29
23: ; preds = %19
%24 = load i8*, i8** @optarg
store i8* %24, i8** %6
store i32 0, i32* %8
br label %29
25: ; preds = %19
%26 = load i8*, i8** @optarg
store i8* %26, i8** %7
br label %29
27: ; preds = %19
%28 = call i32 (...) @usage()
br label %104
29: ; preds = %25, %23, %21
br label %14
30: ; preds = %14
%31 = load i8*, i8** %7
%32 = icmp ne i8* %31, null
br i1 %32, label %33, label %36
33: ; preds = %30
%34 = load i8*, i8** %6
%35 = icmp ne i8* %34, null
br i1 %35, label %38, label %36
36: ; preds = %33, %30
%37 = call i32 (...) @usage()
br label %104
38: ; preds = %33
%39 = load i8*, i8** %7
%40 = load i32, i32* @O_RDONLY
%41 = call i32 @open(i8* %39, i32 %40)
store i32 %41, i32* %11
%42 = load i32, i32* %11
%43 = icmp slt i32 %42, 0
br i1 %43, label %44, label %51
44: ; preds = %38
%45 = load i32, i32* @stderr
%46 = load i8*, i8** %7
%47 = load i32, i32* @errno
%48 = call i8* @strerror(i32 %47)
%49 = load i32, i32* @errno
%50 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %45, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %46, i8* %48, i32 %49)
br label %104
51: ; preds = %38
%52 = load i32, i32* %8
%53 = icmp ne i32 %52, 0
br i1 %53, label %54, label %66
54: ; preds = %51
%55 = load i32, i32* @BPF_MAP_TYPE_CGROUP_ARRAY
%56 = call i32 @bpf_create_map(i32 %55, i32 4, i32 4, i32 1, i32 0)
store i32 %56, i32* %10
%57 = load i32, i32* %10
%58 = icmp slt i32 %57, 0
br i1 %58, label %59, label %65
59: ; preds = %54
%60 = load i32, i32* @stderr
%61 = load i32, i32* @errno
%62 = call i8* @strerror(i32 %61)
%63 = load i32, i32* @errno
%64 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %60, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.2, i64 0, i64 0), i8* %62, i32 %63)
br label %104
65: ; preds = %54
br label %79
66: ; preds = %51
%67 = load i8*, i8** %6
%68 = call i32 @bpf_obj_get(i8* %67)
store i32 %68, i32* %10
%69 = load i32, i32* %10
%70 = icmp slt i32 %69, 0
br i1 %70, label %71, label %78
71: ; preds = %66
%72 = load i32, i32* @stderr
%73 = load i8*, i8** %6
%74 = load i32, i32* @errno
%75 = call i8* @strerror(i32 %74)
%76 = load i32, i32* @errno
%77 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %72, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i8* %73, i8* %75, i32 %76)
br label %104
78: ; preds = %66
br label %79
79: ; preds = %78, %65
%80 = load i32, i32* %10
%81 = call i32 @bpf_update_elem(i32 %80, i32* %9, i32* %11, i32 0)
store i32 %81, i32* %12
%82 = load i32, i32* %12
%83 = icmp ne i32 %82, 0
br i1 %83, label %84, label %86
84: ; preds = %79
%85 = call i32 @perror(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
br label %104
86: ; preds = %79
%87 = load i32, i32* %8
%88 = icmp ne i32 %87, 0
br i1 %88, label %89, label %103
89: ; preds = %86
%90 = load i32, i32* %10
%91 = load i8*, i8** %6
%92 = call i32 @bpf_obj_pin(i32 %90, i8* %91)
store i32 %92, i32* %12
%93 = load i32, i32* %12
%94 = icmp ne i32 %93, 0
br i1 %94, label %95, label %102
95: ; preds = %89
%96 = load i32, i32* @stderr
%97 = load i8*, i8** %6
%98 = load i32, i32* @errno
%99 = call i8* @strerror(i32 %98)
%100 = load i32, i32* @errno
%101 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %96, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0), i8* %97, i8* %99, i32 %100)
br label %104
102: ; preds = %89
br label %103
103: ; preds = %102, %86
br label %104
104: ; preds = %103, %95, %84, %71, %59, %44, %36, %27
%105 = load i32, i32* %10
%106 = icmp ne i32 %105, -1
br i1 %106, label %107, label %110
107: ; preds = %104
%108 = load i32, i32* %10
%109 = call i32 @close(i32 %108)
br label %110
110: ; preds = %107, %104
%111 = load i32, i32* %11
%112 = icmp ne i32 %111, -1
br i1 %112, label %113, label %116
113: ; preds = %110
%114 = load i32, i32* %11
%115 = call i32 @close(i32 %114)
br label %116
116: ; preds = %113, %110
%117 = load i32, i32* %12
ret i32 %117
}

LLVM IR (-O2):
@.str = [7 x i8] c"F:U:v:\00"
@optarg = global i8* null
@O_RDONLY = global i32 0
@stderr = global i32 0
@.str.1 = [22 x i8] c"open(%s,...): %s(%d)\0A\00"
@errno = global i32 0
@BPF_MAP_TYPE_CGROUP_ARRAY = global i32 0
@.str.2 = [55 x i8] c"bpf_create_map(BPF_MAP_TYPE_CGROUP_ARRAY,...): %s(%d)\0A\00"
@.str.3 = [25 x i8] c"bpf_obj_get(%s): %s(%d)\0A\00"
@.str.4 = [16 x i8] c"bpf_update_elem\00"
@.str.5 = [30 x i8] c"bpf_obj_pin(..., %s): %s(%d)\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%6 = bitcast i32* %4 to i8*
br label %7
7: ; preds = %21, %2
%8 = phi i8* [ %22, %21 ], [ null, %2 ]
%9 = phi i32 [ %12, %21 ], [ 1, %2 ]
%10 = phi i8* [ %15, %21 ], [ null, %2 ]
br label %11
11: ; preds = %7, %19
%12 = phi i32 [ %9, %7 ], [ 0, %19 ]
%13 = phi i8* [ %10, %7 ], [ %20, %19 ]
br label %14
14: ; preds = %11, %17
%15 = phi i8* [ %18, %17 ], [ %13, %11 ]
%16 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
switch i32 %16, label %23 [
i32 -1, label %25
i32 70, label %17
i32 85, label %19
i32 118, label %21
]
17: ; preds = %14
%18 = load i8*, i8** @optarg
br label %14
19: ; preds = %14
%20 = load i8*, i8** @optarg
br label %11
21: ; preds = %14
%22 = load i8*, i8** @optarg
br label %7
23: ; preds = %14
%24 = tail call i32 (...) @usage()
br label %97
25: ; preds = %14
%26 = icmp ne i8* %8, null
%27 = icmp ne i8* %15, null
%28 = select i1 %26, i1 %27, i1 false
br i1 %28, label %31, label %29
29: ; preds = %25
%30 = tail call i32 (...) @usage()
br label %97
31: ; preds = %25
%32 = load i32, i32* @O_RDONLY
%33 = tail call i32 @open(i8* %8, i32 %32)
store i32 %33, i32* %4
%34 = icmp slt i32 %33, 0
br i1 %34, label %35, label %41
35: ; preds = %31
%36 = load i32, i32* @stderr
%37 = load i32, i32* @errno
%38 = tail call i8* @strerror(i32 %37)
%39 = load i32, i32* @errno
%40 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %36, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %8, i8* %38, i32 %39)
br label %89
41: ; preds = %31
%42 = icmp eq i32 %12, 0
br i1 %42, label %53, label %43
43: ; preds = %41
%44 = load i32, i32* @BPF_MAP_TYPE_CGROUP_ARRAY
%45 = tail call i32 @bpf_create_map(i32 %44, i32 4, i32 4, i32 1, i32 0)
%46 = icmp slt i32 %45, 0
br i1 %46, label %47, label %65
47: ; preds = %43
%48 = load i32, i32* @stderr
%49 = load i32, i32* @errno
%50 = tail call i8* @strerror(i32 %49)
%51 = load i32, i32* @errno
%52 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %48, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.2, i64 0, i64 0), i8* %50, i32 %51)
br label %81
53: ; preds = %41
%54 = tail call i32 @bpf_obj_get(i8* %15)
%55 = icmp slt i32 %54, 0
br i1 %55, label %56, label %62
56: ; preds = %53
%57 = load i32, i32* @stderr
%58 = load i32, i32* @errno
%59 = tail call i8* @strerror(i32 %58)
%60 = load i32, i32* @errno
%61 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %57, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i8* %15, i8* %59, i32 %60)
br label %81
62: ; preds = %53
%63 = call i32 @bpf_update_elem(i32 %54, i32* %3, i32* %4, i32 0)
%64 = icmp eq i32 %63, 0
br i1 %64, label %84, label %68
65: ; preds = %43
%66 = call i32 @bpf_update_elem(i32 %45, i32* %3, i32* %4, i32 0)
%67 = icmp eq i32 %66, 0
br i1 %67, label %72, label %68
68: ; preds = %65, %62
%69 = phi i32 [ %66, %65 ], [ %63, %62 ]
%70 = phi i32 [ %45, %65 ], [ %54, %62 ]
%71 = call i32 @perror(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
br label %84
72: ; preds = %65
%73 = call i32 @bpf_obj_pin(i32 %45, i8* %15)
%74 = icmp eq i32 %73, 0
br i1 %74, label %84, label %75
75: ; preds = %72
%76 = load i32, i32* @stderr
%77 = load i32, i32* @errno
%78 = call i8* @strerror(i32 %77)
%79 = load i32, i32* @errno
%80 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %76, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0), i8* %15, i8* %78, i32 %79)
br label %84
81: ; preds = %56, %47
%82 = phi i32 [ %45, %47 ], [ %54, %56 ]
%83 = icmp eq i32 %82, -1
br i1 %83, label %93, label %84
84: ; preds = %62, %72, %75, %68, %81
%85 = phi i32 [ -1, %81 ], [ 0, %62 ], [ 0, %72 ], [ %73, %75 ], [ %69, %68 ]
%86 = phi i32 [ %82, %81 ], [ %54, %62 ], [ %45, %72 ], [ %45, %75 ], [ %70, %68 ]
%87 = call i32 @close(i32 %86)
%88 = load i32, i32* %4
br label %89
89: ; preds = %35, %84
%90 = phi i32 [ %88, %84 ], [ %33, %35 ]
%91 = phi i32 [ %85, %84 ], [ -1, %35 ]
%92 = icmp eq i32 %90, -1
br i1 %92, label %97, label %93
93: ; preds = %81, %89
%94 = phi i32 [ %91, %89 ], [ -1, %81 ]
%95 = phi i32 [ %90, %89 ], [ %33, %81 ]
%96 = call i32 @close(i32 %95)
br label %97
97: ; preds = %29, %23, %93, %89
%98 = phi i32 [ %94, %93 ], [ %91, %89 ], [ -1, %23 ], [ -1, %29 ]
ret i32 %98
}