// File: /workspace/github_c_makefile_star2_O2/6851-2021[P]euler_tour_tree/benchmark.c
// Function: benchmark_ops
void benchmark_ops() {
    int ops, n;

    scanf("%d, %d\n", &ops, &n);

    int* op_array = malloc(sizeof(int) * ops);
    int* i_array = malloc(sizeof(int) * ops);
    int* j_array = malloc(sizeof(int) * ops);
    for (int line = 0; line < ops; line++) {
        scanf("%d, %d, %d\n", op_array + line, i_array + line, j_array + line);
    }

    clock_t start_time = clock();

    for (int round = 0; round < 10; round ++) {

        EulerTourTree* tree = make_euler_tour_tree(n);

        for (int line = 0; line < ops; line++) {
            int op = op_array[line];
            int i = i_array[line];
            int j = j_array[line];

            if (op == 0) {
                connectivity(tree, i, j);
            } else if (op == 1) {
                link(tree, i, j);
            } else if (op == 2) {
                cut(tree, i);
            } else if (op == 3) {
                subtree_aggregate_min(tree, i);
            } else if (op == 4) {
                point_update(tree, i, j);
            } else if (op == 5) {
                subtree_update(tree, i, j);
            }
        }
        destroy_euler_tour_tree(tree);
    }

    clock_t end_time = clock();
    printf("%f %d %d\n", ((double) (end_time-start_time))*1e6/CLOCKS_PER_SEC/ops, ops, n);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
leaq 0xe8b(%rip), %rdi       # 0x202c
movq %rsp, %rbx
leaq 0x4(%rsp), %rdx
movq %rbx, %rsi
xorl %eax, %eax
callq 0x1080
movslq (%rbx), %r12
movq %r12, %r15
shlq $0x2, %r15
movq %r15, %rdi
callq 0x1060
movq %rax, %rbx
movq %r15, %rdi
callq 0x1060
movq %rax, %r14
movq %r15, %rdi
callq 0x1060
movq %rax, %r15
movq %r12, %rax
movq %rbx, %rbp
movq %r14, %r12
movq %r15, %r13
xorl %ecx, %ecx
cltq
cmpq %rax, %rcx
jge 0x1228
leaq 0xe2e(%rip), %rdi       # 0x2028
movq %rbp, %rsi
movq %r12, %rdx
movq %rcx, 0x8(%rsp)
movq %r13, %rcx
xorl %eax, %eax
callq 0x1080
movq 0x8(%rsp), %rcx
incq %rcx
movl (%rsp), %eax
addq $0x4, %r13
addq $0x4, %r12
addq $0x4, %rbp
jmp 0x11ec
xorl %r13d, %r13d
callq 0x1040
movq %rax, 0x10(%rsp)
leaq 0xdd4(%rip), %r12       # 0x2010
cmpl $0xa, %r13d
je 0x12d1
movq %r13, 0x8(%rsp)
movslq 0x4(%rsp), %rdi
callq 0x1838
movq %rax, %r13
xorl %ebp, %ebp
movslq (%rsp), %rax
cmpq %rax, %rbp
jge 0x12bc
movl (%rbx,%rbp,4), %eax
cmpq $0x5, %rax
ja 0x12b7
movslq (%r14,%rbp,4), %rsi
movslq (%r15,%rbp,4), %rdx
movslq (%r12,%rax,4), %rax
addq %r12, %rax
jmpq *%rax
movq %r13, %rdi
callq 0x1b81
jmp 0x12b7
movq %r13, %rdi
callq 0x1bd8
jmp 0x12b7
movq %r13, %rdi
callq 0x19c6
jmp 0x12b7
movq %r13, %rdi
callq 0x1c00
jmp 0x12b7
movq %r13, %rdi
callq 0x1a67
jmp 0x12b7
movq %r13, %rdi
callq 0x1beb
incq %rbp
jmp 0x125a
movq %r13, %rdi
callq 0x1933
movq 0x8(%rsp), %r13
incl %r13d
jmp 0x123c
callq 0x1040
subq 0x10(%rsp), %rax
vcvtsi2sd %rax, %xmm0, %xmm0
vmovsd 0xd20(%rip), %xmm1      # 0x2008
vmulsd %xmm1, %xmm0, %xmm0
vdivsd %xmm1, %xmm0, %xmm0
movl (%rsp), %esi
vcvtsi2sd %esi, %xmm2, %xmm1
vdivsd %xmm1, %xmm0, %xmm0
movl 0x4(%rsp), %edx
leaq 0xd2e(%rip), %rdi       # 0x2034
movb $0x1, %al
callq 0x1050
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq