// File: /workspace/github_cpp_makefile_star2_O3/WojciechMula[P]utf16utf8/benchmarks/linux-perf-events.h
// Function: LinuxEvents<0>::LinuxEvents(std::vector<int, std::allocator<int>>)
explicit LinuxEvents(std::vector<int> config_vec) : fd(0), working(true) {
    memset(&attribs, 0, sizeof(attribs));
    attribs.type = TYPE;
    attribs.size = sizeof(attribs);
    attribs.disabled = 1;
    attribs.exclude_kernel = 1;
    attribs.exclude_hv = 1;

    attribs.sample_period = 0;
    attribs.read_format = PERF_FORMAT_GROUP | PERF_FORMAT_ID;
    const int pid = 0;  // the current process
    const int cpu = -1; // all CPUs
    const unsigned long flags = 0;

    int group = -1; // no group
    num_events = config_vec.size();
    ids.resize(config_vec.size());
    uint32_t i = 0;
    for (auto config : config_vec) {
      attribs.config = config;
      fd = static_cast<int>(syscall(__NR_perf_event_open, &attribs, pid, cpu, group, flags));
      if (fd == -1) {
        report_error("perf_event_open");
      }
      ioctl(fd, PERF_EVENT_IOC_ID, &ids[i++]);
      if (group == -1) {
        group = fd;
      }
    }

    temp_result_vec.resize(num_events * 2 + 1);
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
vxorps %xmm0, %xmm0, %xmm0
movl $0x0, (%rdi)
movq %rdi, %rbx
movb $0x1, 0x4(%rdi)
movq %rsi, %r14
leaq 0x90(%rdi), %rax
addq $0xa8, %rdi
vmovups %zmm0, 0x48(%rbx)
vmovups %zmm0, 0x8(%rbx)
vmovups %zmm0, 0x80(%rbx)
movl $0x80, 0xc(%rbx)
movq $0x61, 0x30(%rbx)
movq $0xc, 0x28(%rbx)
movq %rax, (%rsp)
movq 0x8(%rsi), %rsi
subq (%r14), %rsi
sarq $0x2, %rsi
movq %rsi, 0x88(%rbx)
movq %rdi, 0x28(%rsp)
vzeroupper
callq 0x6284
movq (%r14), %r13
movq 0x8(%r14), %r14
cmpq %r14, %r13
je 0x607c
leaq 0x8(%rbx), %rax
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
xorl %r15d, %r15d
movq %rax, 0x30(%rsp)
movslq (%r13), %rax
movq 0x30(%rsp), %rsi
movl $0x12a, %edi            # imm = 0x12A
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
xorl %edx, %edx
movl %ebp, %r8d
xorl %r9d, %r9d
movq %rax, 0x10(%rbx)
xorl %eax, %eax
callq 0x2060
movl %eax, (%rbx)
cmpl $-0x1, %eax
jne 0x6049
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
leaq 0x8(%rsp), %r12
leaq 0x74ff(%rip), %rsi      # 0xd510
leaq 0x7507(%rip), %rdx      # 0xd51f
movq %r12, %rdi
callq 0x4ef2
movq %rbx, %rdi
movq %r12, %rsi
callq 0x62b6
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x6047
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21d0
movl (%rbx), %eax
movl %r15d, %edx
shlq $0x3, %rdx
addq 0xa8(%rbx), %rdx
movl $0x80082407, %esi       # imm = 0x80082407
movl %eax, %edi
xorl %eax, %eax
callq 0x2240
cmpl $-0x1, %ebp
jne 0x606c
movl (%rbx), %ebp
incl %r15d
addq $0x4, %r13
cmpq %r14, %r13
jne 0x5fce
movq 0x88(%rbx), %rax
leaq 0x1(%rax,%rax), %rsi
movq (%rsp), %rdi
callq 0x6284
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x60a4
jmp 0x60a4
movq %rax, %r14
jmp 0x60c8
movq 0x8(%rsp), %rdi
movq %rax, %r14
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x60c8
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21d0
movq 0x28(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x60e4
movq 0xb8(%rbx), %rsi
subq %rdi, %rsi
callq 0x21d0
movq (%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x60ff
movq 0xa0(%rbx), %rsi
subq %rdi, %rsi
callq 0x21d0
movq %r14, %rdi
callq 0x22b0
nop