// File: /workspace/github_c_makefile_star2_O1/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 $0x0, 0x10(%rsp)
movq %rsp, %rbx
leaq 0x4(%rsp), %rdx
movq %rbx, %rsi
xorl %eax, %eax
callq 0x1080
movslq (%rbx), %r12
leaq (,%r12,4), %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
testq %r12, %r12
jle 0x1234
movq %rbx, %rcx
movq %r14, %rbp
movq %r15, %r12
xorl %r13d, %r13d
movq %rcx, 0x8(%rsp)
leaq 0xe23(%rip), %rdi       # 0x2028
movq 0x8(%rsp), %rsi
movq %rbp, %rdx
movq %r12, %rcx
xorl %eax, %eax
callq 0x1080
movq 0x8(%rsp), %rcx
incq %r13
movslq (%rsp), %rax
addq $0x4, %r12
addq $0x4, %rbp
addq $0x4, %rcx
cmpq %rax, %r13
jl 0x11f9
callq 0x1040
movq %rax, 0x8(%rsp)
leaq 0xdcb(%rip), %rbp       # 0x2010
movslq 0x4(%rsp), %rdi
callq 0x1858
movq %rax, %r13
cmpl $0x0, (%rsp)
jle 0x12bd
xorl %r12d, %r12d
movl (%rbx,%r12,4), %eax
cmpq $0x5, %rax
ja 0x12b1
movslq (%r14,%r12,4), %rsi
movslq (%r15,%r12,4), %rdx
movslq (%rbp,%rax,4), %rax
addq %rbp, %rax
jmpq *%rax
movq %r13, %rdi
callq 0x1ba9
jmp 0x12b1
movq %r13, %rdi
callq 0x1c00
jmp 0x12b1
movq %r13, %rdi
callq 0x19ed
jmp 0x12b1
movq %r13, %rdi
callq 0x1c28
jmp 0x12b1
movq %r13, %rdi
callq 0x1a93
jmp 0x12b1
movq %r13, %rdi
callq 0x1c13
incq %r12
movslq (%rsp), %rax
cmpq %rax, %r12
jl 0x125b
movq %r13, %rdi
callq 0x1957
movq 0x10(%rsp), %rax
incl %eax
movq %rax, 0x10(%rsp)
cmpl $0xa, %eax
jne 0x1245
callq 0x1040
subq 0x8(%rsp), %rax
vcvtsi2sd %rax, %xmm0, %xmm0
vmovsd 0xd17(%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 0xd25(%rip), %rdi       # 0x2034
movb $0x1, %al
callq 0x1050
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq