// File: /workspace/github_cpp_makefile_star2_O1/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
movq %rsi, %r14
movq %rdi, %rbx
movl $0x0, (%rdi)
movb $0x1, 0x4(%rdi)
leaq 0x90(%rdi), %rax
movq %rax, (%rsp)
addq $0xa8, %rdi
vxorps %xmm0, %xmm0, %xmm0
vmovups %zmm0, 0x8(%rbx)
vmovups %zmm0, 0x48(%rbx)
vmovups %zmm0, 0x80(%rbx)
movl $0x80, 0xc(%rbx)
orb $0x61, 0x30(%rbx)
movq $0x0, 0x18(%rbx)
movq $0xc, 0x28(%rbx)
movq 0x8(%rsi), %rsi
subq (%r14), %rsi
sarq $0x2, %rsi
movq %rsi, 0x88(%rbx)
movq %rdi, 0x28(%rsp)
vzeroupper
callq 0x6252
movq (%r14), %r13
movq 0x8(%r14), %r14
cmpq %r14, %r13
je 0x603e
leaq 0x8(%rbx), %rax
movq %rax, 0x30(%rsp)
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
xorl %r15d, %r15d
movslq (%r13), %rax
movq %rax, 0x10(%rbx)
movl $0x12a, %edi            # imm = 0x12A
movq 0x30(%rsp), %rsi
xorl %edx, %edx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movl %ebp, %r8d
xorl %r9d, %r9d
xorl %eax, %eax
callq 0x2060
movl %eax, (%rbx)
cmpl $-0x1, %eax
jne 0x600b
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
leaq 0x8(%rsp), %r12
movq %r12, %rdi
leaq 0x73ac(%rip), %rsi      # 0xd384
leaq 0x73b4(%rip), %rdx      # 0xd393
callq 0x4ed6
movq %rbx, %rdi
movq %r12, %rsi
callq 0x6284
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x600b
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21d0
movl (%rbx), %edi
movl %r15d, %edx
shlq $0x3, %rdx
addq 0xa8(%rbx), %rdx
movl $0x80082407, %esi       # imm = 0x80082407
xorl %eax, %eax
callq 0x2240
cmpl $-0x1, %ebp
jne 0x602e
movl (%rbx), %ebp
incl %r15d
addq $0x4, %r13
cmpq %r14, %r13
jne 0x5f92
movq 0x88(%rbx), %rax
leaq 0x1(%rax,%rax), %rsi
movq (%rsp), %rdi
callq 0x6252
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x6066
jmp 0x6066
movq %rax, %r14
jmp 0x608a
movq %rax, %r14
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x608a
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21d0
movq 0x28(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x60a6
movq 0xb8(%rbx), %rsi
subq %rdi, %rsi
callq 0x21d0
movq (%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x60c1
movq 0xa0(%rbx), %rsi
subq %rdi, %rsi
callq 0x21d0
movq %r14, %rdi
callq 0x22b0
nop