#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 {
  unsigned short len;
  struct sock_filter *filter;
};
struct sock_filter {
  int dummy;
};
typedef int /*<<< orphan*/ filter;

/* Variables and functions */
int BPF_K;
int BPF_RET;
struct sock_filter BPF_STMT(int, int /*<<< orphan*/);
int /*<<< orphan*/ CLOCK_PROCESS_CPUTIME_ID;
int /*<<< orphan*/ PR_SET_NO_NEW_PRIVS;
int /*<<< orphan*/ PR_SET_SECCOMP;
int /*<<< orphan*/ SECCOMP_MODE_FILTER;
int /*<<< orphan*/ SECCOMP_RET_ALLOW;
int /*<<< orphan*/ assert(int);
unsigned long long calibrate();
long prctl(int /*<<< orphan*/, int, struct sock_fprog *, ...);
int /*<<< orphan*/ printf(char *, ...);
unsigned long long strtoull(char *, int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ system(char *);
unsigned long long timing(int /*<<< orphan*/, unsigned long long);
int main(int argc, char *argv[]) {
  struct sock_filter filter[] = {
      BPF_STMT(BPF_RET | BPF_K, SECCOMP_RET_ALLOW),
  };
  struct sock_fprog prog = {
      .len = (unsigned short)(sizeof(filter) / sizeof(filter[0])),
      .filter = filter,
  };
  long ret;
  unsigned long long samples;
  unsigned long long native, filter1, filter2;
  printf("Current BPF sysctl settings:\n");
  system("sysctl net.core.bpf_jit_enable");
  system("sysctl net.core.bpf_jit_harden");
  if (argc > 1)
    samples = strtoull(argv[1], NULL, 0);
  else
    samples = calibrate();
  printf("Benchmarking %llu syscalls...\n", samples);
  native = timing(CLOCK_PROCESS_CPUTIME_ID, samples) / samples;
  printf("getpid native: %llu ns\n", native);
  ret = prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0);
  assert(ret == 0);
  ret = prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, &prog);
  assert(ret == 0);
  filter1 = timing(CLOCK_PROCESS_CPUTIME_ID, samples) / samples;
  printf("getpid RET_ALLOW 1 filter: %llu ns\n", filter1);
  if (filter1 == native)
    printf("No overhead measured!? Try running again with more samples.\n");
  ret = prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, &prog);
  assert(ret == 0);
  filter2 = timing(CLOCK_PROCESS_CPUTIME_ID, samples) / samples;
  printf("getpid RET_ALLOW 2 filters: %llu ns\n", filter2);
  printf("Estimated total seccomp overhead for 1 filter: %llu ns\n",
         filter1 - native);
  printf("Estimated total seccomp overhead for 2 filters: %llu ns\n",
         filter2 - native);
  printf("Estimated seccomp per-filter overhead: %llu ns\n", filter2 - filter1);
  printf("Estimated seccomp entry overhead: %llu ns\n",
         filter1 - native - (filter2 - filter1));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e43(%rip),%rax
mov    (%rax),%edi
mov    0x2e42(%rip),%rax
or     (%rax),%edi
mov    0x2e09(%rip),%rax
mov    (%rax),%esi
call   10a0 <BPF_STMT@plt>
mov    %eax,-0x18(%rbp)
movw   $0x1,-0x28(%rbp)
lea    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    0xe32(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe42(%rip),%rdi
call   1040 <system@plt>
lea    0xe55(%rip),%rdi
call   1040 <system@plt>
cmpl   $0x1,-0x8(%rbp)
jle    1213 <main+0x93>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1060 <strtoull@plt>
mov    %rax,-0x38(%rbp)
jmp    121e <main+0x9e>
mov    $0x0,%al
call   1080 <calibrate@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rsi
lea    0xe33(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    0x2d99(%rip),%rax
mov    (%rax),%edi
mov    -0x38(%rbp),%rsi
call   1030 <timing@plt>
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x38(%rbp)
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rsi
lea    0xe22(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    0x2d49(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
xor    %eax,%eax
mov    %eax,%edx
xor    %r8d,%r8d
mov    %r8d,%ecx
mov    $0x0,%al
call   1090 <prctl@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
mov    0x2d2c(%rip),%rax
mov    (%rax),%edi
mov    0x2d33(%rip),%rax
mov    (%rax),%esi
lea    -0x28(%rbp),%rdx
mov    $0x0,%al
call   1090 <prctl@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
mov    0x2d01(%rip),%rax
mov    (%rax),%edi
mov    -0x38(%rbp),%rsi
call   1030 <timing@plt>
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x38(%rbp)
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rsi
lea    0xda2(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x48(%rbp),%rax
cmp    -0x40(%rbp),%rax
jne    1314 <main+0x194>
lea    0xdaa(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    0x2cad(%rip),%rax
mov    (%rax),%edi
mov    0x2cb4(%rip),%rax
mov    (%rax),%esi
lea    -0x28(%rbp),%rdx
mov    $0x0,%al
call   1090 <prctl@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
mov    0x2c82(%rip),%rax
mov    (%rax),%edi
mov    -0x38(%rbp),%rsi
call   1030 <timing@plt>
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x38(%rbp)
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rsi
lea    0xd84(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x48(%rbp),%rsi
sub    -0x40(%rbp),%rsi
lea    0xd93(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x50(%rbp),%rsi
sub    -0x40(%rbp),%rsi
lea    0xdb5(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x50(%rbp),%rsi
sub    -0x48(%rbp),%rsi
lea    0xdd8(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x48(%rbp),%rsi
sub    -0x40(%rbp),%rsi
mov    -0x50(%rbp),%rax
sub    -0x48(%rbp),%rax
sub    %rax,%rsi
lea    0xde7(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x50,%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,%rbx
mov    %edi,%ebp
mov    0x2e36(%rip),%rax
mov    0x2e37(%rip),%rcx
mov    (%rcx),%edi
or     (%rax),%edi
mov    0x2dfc(%rip),%rax
mov    (%rax),%esi
call   10b0 <BPF_STMT@plt>
mov    %eax,(%rsp)
movw   $0x1,0x8(%rsp)
mov    %rsp,%rax
mov    %rax,0x10(%rsp)
lea    0xfae(%rip),%rdi
call   1030 <puts@plt>
lea    0xe18(%rip),%rdi
call   1050 <system@plt>
lea    0xe2b(%rip),%rdi
call   1050 <system@plt>
cmp    $0x2,%ebp
jl     120d <main+0x7d>
mov    0x8(%rbx),%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1070 <strtoull@plt>
jmp    1214 <main+0x84>
xor    %eax,%eax
call   1090 <calibrate@plt>
mov    %rax,%r12
lea    0xe20(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x2da1(%rip),%rbp
mov    0x0(%rbp),%edi
mov    %r12,%rsi
call   1040 <timing@plt>
mov    %rax,%rcx
or     %r12,%rcx
shr    $0x20,%rcx
je     1250 <main+0xc0>
xor    %edx,%edx
div    %r12
mov    %rax,%r14
jmp    1258 <main+0xc8>
xor    %edx,%edx
div    %r12d
mov    %eax,%r14d
lea    0xdfe(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x2d40(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %eax,%eax
call   10a0 <prctl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1080 <assert@plt>
mov    0x2d2e(%rip),%rax
mov    (%rax),%edi
mov    0x2d35(%rip),%rbx
mov    (%rbx),%esi
lea    0x8(%rsp),%rdx
xor    %eax,%eax
call   10a0 <prctl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1080 <assert@plt>
mov    0x0(%rbp),%edi
mov    %r12,%rsi
call   1040 <timing@plt>
mov    %rax,%rcx
or     %r12,%rcx
shr    $0x20,%rcx
je     12e0 <main+0x150>
xor    %edx,%edx
div    %r12
mov    %rax,%r15
jmp    12e8 <main+0x158>
xor    %edx,%edx
div    %r12d
mov    %eax,%r15d
lea    0xd86(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r15,%r13
sub    %r14,%r13
jne    130d <main+0x17d>
lea    0xe9f(%rip),%rdi
call   1030 <puts@plt>
mov    0x2cb4(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%esi
lea    0x8(%rsp),%rdx
xor    %eax,%eax
call   10a0 <prctl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1080 <assert@plt>
mov    0x2c97(%rip),%rax
mov    (%rax),%edi
mov    %r12,%rsi
call   1040 <timing@plt>
mov    %rax,%rcx
or     %r12,%rcx
shr    $0x20,%rcx
je     1359 <main+0x1c9>
xor    %edx,%edx
div    %r12
mov    %rax,%rbx
jmp    1360 <main+0x1d0>
xor    %edx,%edx
div    %r12d
mov    %eax,%ebx
lea    0xd32(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xd46(%rip),%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rsi
sub    %r14,%rsi
lea    0xd67(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
sub    %r15,%rbx
lea    0xd8f(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
sub    %rbx,%r13
lea    0xdab(%rip),%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.sock_filter = type { i32 }
%struct.sock_fprog = type { i16, %struct.sock_filter* }
@BPF_RET = global i32 0
@BPF_K = global i32 0
@SECCOMP_RET_ALLOW = global i32 0
@.str = [30 x i8] c"Current BPF sysctl settings:\0A\00"
@.str.1 = [31 x i8] c"sysctl net.core.bpf_jit_enable\00"
@.str.2 = [31 x i8] c"sysctl net.core.bpf_jit_harden\00"
@.str.3 = [31 x i8] c"Benchmarking %llu syscalls...\0A\00"
@CLOCK_PROCESS_CPUTIME_ID = global i32 0
@.str.4 = [24 x i8] c"getpid native: %llu ns\0A\00"
@PR_SET_NO_NEW_PRIVS = global i32 0
@PR_SET_SECCOMP = global i32 0
@SECCOMP_MODE_FILTER = global i32 0
@.str.5 = [36 x i8] c"getpid RET_ALLOW 1 filter: %llu ns\0A\00"
@.str.6 = [61 x i8] c"No overhead measured!? Try running again with more samples.\0A\00"
@.str.7 = [37 x i8] c"getpid RET_ALLOW 2 filters: %llu ns\0A\00"
@.str.8 = [56 x i8] c"Estimated total seccomp overhead for 1 filter: %llu ns\0A\00"
@.str.9 = [57 x i8] c"Estimated total seccomp overhead for 2 filters: %llu ns\0A\00"
@.str.10 = [48 x i8] c"Estimated seccomp per-filter overhead: %llu ns\0A\00"
@.str.11 = [43 x i8] c"Estimated seccomp entry overhead: %llu ns\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [1 x %struct.sock_filter]
%7 = alloca %struct.sock_fprog
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%13 = getelementptr inbounds [1 x %struct.sock_filter], [1 x %struct.sock_filter]* %6, i64 0, i64 0
%14 = load i32, i32* @BPF_RET
%15 = load i32, i32* @BPF_K
%16 = or i32 %14, %15
%17 = load i32, i32* @SECCOMP_RET_ALLOW
%18 = call i32 @BPF_STMT(i32 %16, i32 %17)
%19 = getelementptr inbounds %struct.sock_filter, %struct.sock_filter* %13, i32 0, i32 0
store i32 %18, i32* %19
%20 = getelementptr inbounds %struct.sock_fprog, %struct.sock_fprog* %7, i32 0, i32 0
store i16 1, i16* %20
%21 = getelementptr inbounds %struct.sock_fprog, %struct.sock_fprog* %7, i32 0, i32 1
%22 = getelementptr inbounds [1 x %struct.sock_filter], [1 x %struct.sock_filter]* %6, i64 0, i64 0
store %struct.sock_filter* %22, %struct.sock_filter** %21
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%24 = call i32 @system(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
%25 = call i32 @system(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%26 = load i32, i32* %4
%27 = icmp sgt i32 %26, 1
br i1 %27, label %28, label %33
28: ; preds = %2
%29 = load i8**, i8*** %5
%30 = getelementptr inbounds i8*, i8** %29, i64 1
%31 = load i8*, i8** %30
%32 = call i64 @strtoull(i8* %31, i32* null, i32 0)
store i64 %32, i64* %9
br label %35
33: ; preds = %2
%34 = call i64 (...) @calibrate()
store i64 %34, i64* %9
br label %35
35: ; preds = %33, %28
%36 = load i64, i64* %9
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), i64 %36)
%38 = load i32, i32* @CLOCK_PROCESS_CPUTIME_ID
%39 = load i64, i64* %9
%40 = call i64 @timing(i32 %38, i64 %39)
%41 = load i64, i64* %9
%42 = udiv i64 %40, %41
store i64 %42, i64* %10
%43 = load i64, i64* %10
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i64 %43)
%45 = load i32, i32* @PR_SET_NO_NEW_PRIVS
%46 = call i64 (i32, i32, %struct.sock_fprog*, ...) @prctl(i32 %45, i32 1, %struct.sock_fprog* null, i32 0, i32 0)
store i64 %46, i64* %8
%47 = load i64, i64* %8
%48 = icmp eq i64 %47, 0
%49 = zext i1 %48 to i32
%50 = call i32 @assert(i32 %49)
%51 = load i32, i32* @PR_SET_SECCOMP
%52 = load i32, i32* @SECCOMP_MODE_FILTER
%53 = call i64 (i32, i32, %struct.sock_fprog*, ...) @prctl(i32 %51, i32 %52, %struct.sock_fprog* %7)
store i64 %53, i64* %8
%54 = load i64, i64* %8
%55 = icmp eq i64 %54, 0
%56 = zext i1 %55 to i32
%57 = call i32 @assert(i32 %56)
%58 = load i32, i32* @CLOCK_PROCESS_CPUTIME_ID
%59 = load i64, i64* %9
%60 = call i64 @timing(i32 %58, i64 %59)
%61 = load i64, i64* %9
%62 = udiv i64 %60, %61
store i64 %62, i64* %11
%63 = load i64, i64* %11
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.5, i64 0, i64 0), i64 %63)
%65 = load i64, i64* %11
%66 = load i64, i64* %10
%67 = icmp eq i64 %65, %66
br i1 %67, label %68, label %70
68: ; preds = %35
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.6, i64 0, i64 0))
br label %70
70: ; preds = %68, %35
%71 = load i32, i32* @PR_SET_SECCOMP
%72 = load i32, i32* @SECCOMP_MODE_FILTER
%73 = call i64 (i32, i32, %struct.sock_fprog*, ...) @prctl(i32 %71, i32 %72, %struct.sock_fprog* %7)
store i64 %73, i64* %8
%74 = load i64, i64* %8
%75 = icmp eq i64 %74, 0
%76 = zext i1 %75 to i32
%77 = call i32 @assert(i32 %76)
%78 = load i32, i32* @CLOCK_PROCESS_CPUTIME_ID
%79 = load i64, i64* %9
%80 = call i64 @timing(i32 %78, i64 %79)
%81 = load i64, i64* %9
%82 = udiv i64 %80, %81
store i64 %82, i64* %12
%83 = load i64, i64* %12
%84 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.7, i64 0, i64 0), i64 %83)
%85 = load i64, i64* %11
%86 = load i64, i64* %10
%87 = sub i64 %85, %86
%88 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.8, i64 0, i64 0), i64 %87)
%89 = load i64, i64* %12
%90 = load i64, i64* %10
%91 = sub i64 %89, %90
%92 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.9, i64 0, i64 0), i64 %91)
%93 = load i64, i64* %12
%94 = load i64, i64* %11
%95 = sub i64 %93, %94
%96 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.10, i64 0, i64 0), i64 %95)
%97 = load i64, i64* %11
%98 = load i64, i64* %10
%99 = sub i64 %97, %98
%100 = load i64, i64* %12
%101 = load i64, i64* %11
%102 = sub i64 %100, %101
%103 = sub i64 %99, %102
%104 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.11, i64 0, i64 0), i64 %103)
ret i32 0
}

LLVM IR (-O2):
%struct.sock_filter = type { i32 }
%struct.sock_fprog = type { i16, %struct.sock_filter* }
@BPF_RET = global i32 0
@BPF_K = global i32 0
@SECCOMP_RET_ALLOW = global i32 0
@.str.1 = [31 x i8] c"sysctl net.core.bpf_jit_enable\00"
@.str.2 = [31 x i8] c"sysctl net.core.bpf_jit_harden\00"
@.str.3 = [31 x i8] c"Benchmarking %llu syscalls...\0A\00"
@CLOCK_PROCESS_CPUTIME_ID = global i32 0
@.str.4 = [24 x i8] c"getpid native: %llu ns\0A\00"
@PR_SET_NO_NEW_PRIVS = global i32 0
@PR_SET_SECCOMP = global i32 0
@SECCOMP_MODE_FILTER = global i32 0
@.str.5 = [36 x i8] c"getpid RET_ALLOW 1 filter: %llu ns\0A\00"
@.str.7 = [37 x i8] c"getpid RET_ALLOW 2 filters: %llu ns\0A\00"
@.str.8 = [56 x i8] c"Estimated total seccomp overhead for 1 filter: %llu ns\0A\00"
@.str.9 = [57 x i8] c"Estimated total seccomp overhead for 2 filters: %llu ns\0A\00"
@.str.10 = [48 x i8] c"Estimated seccomp per-filter overhead: %llu ns\0A\00"
@.str.11 = [43 x i8] c"Estimated seccomp entry overhead: %llu ns\0A\00"
@str = [29 x i8] c"Current BPF sysctl settings:\00"
@str.12 = [60 x i8] c"No overhead measured!? Try running again with more samples.\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [1 x %struct.sock_filter]
%4 = alloca %struct.sock_fprog
%5 = bitcast [1 x %struct.sock_filter]* %3 to i8*
%6 = getelementptr inbounds [1 x %struct.sock_filter], [1 x %struct.sock_filter]* %3, i64 0, i64 0
%7 = load i32, i32* @BPF_RET
%8 = load i32, i32* @BPF_K
%9 = or i32 %8, %7
%10 = load i32, i32* @SECCOMP_RET_ALLOW
%11 = tail call i32 @BPF_STMT(i32 %9, i32 %10)
%12 = getelementptr inbounds [1 x %struct.sock_filter], [1 x %struct.sock_filter]* %3, i64 0, i64 0, i32 0
store i32 %11, i32* %12
%13 = bitcast %struct.sock_fprog* %4 to i8*
%14 = getelementptr inbounds %struct.sock_fprog, %struct.sock_fprog* %4, i64 0, i32 0
store i16 1, i16* %14
%15 = getelementptr inbounds %struct.sock_fprog, %struct.sock_fprog* %4, i64 0, i32 1
store %struct.sock_filter* %6, %struct.sock_filter** %15
%16 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%17 = call i32 @system(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
%18 = call i32 @system(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%19 = icmp sgt i32 %0, 1
br i1 %19, label %20, label %24
20: ; preds = %2
%21 = getelementptr inbounds i8*, i8** %1, i64 1
%22 = load i8*, i8** %21
%23 = call i64 @strtoull(i8* nocapture %22, i32* null, i32 0)
br label %26
24: ; preds = %2
%25 = call i64 (...) @calibrate()
br label %26
26: ; preds = %24, %20
%27 = phi i64 [ %23, %20 ], [ %25, %24 ]
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), i64 %27)
%29 = load i32, i32* @CLOCK_PROCESS_CPUTIME_ID
%30 = call i64 @timing(i32 %29, i64 %27)
%31 = udiv i64 %30, %27
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i64 %31)
%33 = load i32, i32* @PR_SET_NO_NEW_PRIVS
%34 = call i64 (i32, i32, %struct.sock_fprog*, ...) @prctl(i32 %33, i32 1, %struct.sock_fprog* null, i32 0, i32 0)
%35 = icmp eq i64 %34, 0
%36 = zext i1 %35 to i32
%37 = call i32 @assert(i32 %36)
%38 = load i32, i32* @PR_SET_SECCOMP
%39 = load i32, i32* @SECCOMP_MODE_FILTER
%40 = call i64 (i32, i32, %struct.sock_fprog*, ...) @prctl(i32 %38, i32 %39, %struct.sock_fprog* %4)
%41 = icmp eq i64 %40, 0
%42 = zext i1 %41 to i32
%43 = call i32 @assert(i32 %42)
%44 = load i32, i32* @CLOCK_PROCESS_CPUTIME_ID
%45 = call i64 @timing(i32 %44, i64 %27)
%46 = udiv i64 %45, %27
%47 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.5, i64 0, i64 0), i64 %46)
%48 = icmp eq i64 %46, %31
br i1 %48, label %49, label %51
49: ; preds = %26
%50 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str.12, i64 0, i64 0))
br label %51
51: ; preds = %49, %26
%52 = load i32, i32* @PR_SET_SECCOMP
%53 = load i32, i32* @SECCOMP_MODE_FILTER
%54 = call i64 (i32, i32, %struct.sock_fprog*, ...) @prctl(i32 %52, i32 %53, %struct.sock_fprog* %4)
%55 = icmp eq i64 %54, 0
%56 = zext i1 %55 to i32
%57 = call i32 @assert(i32 %56)
%58 = load i32, i32* @CLOCK_PROCESS_CPUTIME_ID
%59 = call i64 @timing(i32 %58, i64 %27)
%60 = udiv i64 %59, %27
%61 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.7, i64 0, i64 0), i64 %60)
%62 = sub i64 %46, %31
%63 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @.str.8, i64 0, i64 0), i64 %62)
%64 = sub i64 %60, %31
%65 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @.str.9, i64 0, i64 0), i64 %64)
%66 = sub i64 %60, %46
%67 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.10, i64 0, i64 0), i64 %66)
%68 = sub i64 %62, %66
%69 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.11, i64 0, i64 0), i64 %68)
ret i32 0
}