// Auto-generated by ayasin's gen-kernel.py version 0.74 invoked with:
// (align=0, epilog_instructions=[], instructions=['vaddpd %ymm@,%ymm@,%ymm@'], label_prefix='Lbl', loops=1, mode='basicblock', mode_args='', offset=0, prolog_instructions=[], reference='MGM', registers=16, registers_max=16, unroll_factor=1)
// Do not modify!
//
/* fp-add-lat exposes the execution latency while fp-add-bw expose the throughput of a floating-point vector ADD instruction (e.g.)
 */
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>

#define MSG "Reference: A Metric-Guided Method for Discovering Impactful Features and Architectural Insights for Skylake-Based Processors. Ahmad Yasin, Jawad Haj-Yahya, Yosi Ben-Asher, Avi Mendelson. TACO 2019 and HiPEAC 2020."

int main(int argc, const char* argv[])
{
    uint64_t n;
    if (argc<2) {
        printf("%s: missing <num-iterations> arg!\n", argv[0]);
        exit(-1);
    }
    if (MSG) printf("%s\n", MSG ? MSG : "");
    n= atol(argv[1]);
    asm("	PAUSE");
    for (uint64_t i0=0; i0<n; i0++) {
        asm("	vaddpd %ymm0,%ymm0,%ymm0");
        asm("	vaddpd %ymm1,%ymm1,%ymm1");
        asm("	vaddpd %ymm2,%ymm2,%ymm2");
        asm("	vaddpd %ymm3,%ymm3,%ymm3");
        asm("	vaddpd %ymm4,%ymm4,%ymm4");
        asm("	vaddpd %ymm5,%ymm5,%ymm5");
        asm("	vaddpd %ymm6,%ymm6,%ymm6");
        asm("	vaddpd %ymm7,%ymm7,%ymm7");
        asm("	vaddpd %ymm8,%ymm8,%ymm8");
        asm("	vaddpd %ymm9,%ymm9,%ymm9");
        asm("	vaddpd %ymm10,%ymm10,%ymm10");
        asm("	vaddpd %ymm11,%ymm11,%ymm11");
        asm("	vaddpd %ymm12,%ymm12,%ymm12");
        asm("	vaddpd %ymm13,%ymm13,%ymm13");
        asm("	vaddpd %ymm14,%ymm14,%ymm14");
        asm("	vaddpd %ymm15,%ymm15,%ymm15");
    }
    asm(".align 512; Lbl_end:");

    return 0;
}
