// File: /workspace/github_c_makefile_star2_O0/google[P]multichase/multiload.c
// Function: load_stream_triad
static void load_stream_triad(per_thread_t *t) {
#define LOOP_OPS 3
#define LOOP_ALIGN 16
  uint64_t load_loop, load_bites;
  register uint64_t N, i;
  register double *a;
  register double *b;
  register double *c;
  register double *tmp;

  load_loop =
      t->x.load_total_memory -
      (LOOP_OPS * LOOP_ALIGN);  // subract to allow aligning count/addresses
  load_loop = (load_loop / LOOP_OPS) &
              ~(LOOP_ALIGN - 1);  // divide by 3 buffers and align byte count on
                                  // LOOP_ALIGN byte multiple
  N = load_loop / sizeof(double);
  load_bites = N * sizeof(double) * LOOP_OPS;
  size_t aa = (((size_t)t->x.load_arena + LOOP_ALIGN) &
               ~(LOOP_ALIGN));  // align on 16 byte address
  a = (double *)aa;
  b = a + N;
  c = b + N;
  if (verbosity > 1) {
    printf(
        "load_arena=%p, load_total_memory=0x%lX, load_loop=0x%lX, N=0x%lX, "
        "a=%p, b=%p, c=%p\n",
        (char *)t->x.load_arena, t->x.load_total_memory, load_loop, N, a, b, c);
  }

  LOAD_MEMORY_INIT_MIBPS
  do {
    tmp = a;
    a = b;
    b = c;
    c = tmp;

    for (i = 0; i < N; ++i) {
      a[i] = b[i] + c[i];
    }
    LOAD_MEMORY_SAMPLE_MIBPS
  } while (1);
#undef LOOP_OPS
#undef LOOP_ALIGN
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0xb0(%rax), %rax
subq $0x30, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl $0x3, %ecx
xorl %edx, %edx
divq %rcx
andq $-0x10, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
shrq $0x3, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
shlq $0x3, %rax
imulq $0x3, %rax, %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0xa8(%rax), %rax
addq $0x10, %rax
andq $-0x11, %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq -0x20(%rbp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq -0x20(%rbp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
cmpl $0x1, 0x106d90(%rip)    # 0x517360
jle 0x410613
movq -0x8(%rbp), %rax
movq 0xa8(%rax), %rsi
movq -0x8(%rbp), %rax
movq 0xb0(%rax), %rdx
movq -0x10(%rbp), %rcx
movq -0x20(%rbp), %r8
movq -0x30(%rbp), %r9
movq -0x38(%rbp), %r10
movq -0x40(%rbp), %rax
leaq 0xcd155(%rip), %rdi     # 0x4dd758
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
movb $0x0, %al
callq 0x41e150
movq $0x0, -0x58(%rbp)
movq $-0x1, -0x60(%rbp)
movq $0x0, -0x68(%rbp)
movq $0x0, -0x88(%rbp)
movq $0x0, -0x90(%rbp)
callq 0x404250
movq %rax, %xmm0
movaps 0xcb9fe(%rip), %xmm1    # 0x4dc050
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0xcba02(%rip), %xmm1    # 0x4dc060
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movsd %xmm0, -0x70(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x40(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpq -0x20(%rbp), %rax
jae 0x4106d9
movq -0x38(%rbp), %rax
movq -0x28(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x40(%rbp), %rax
movq -0x28(%rbp), %rcx
addsd (%rax,%rcx,8), %xmm0
movq -0x30(%rbp), %rax
movq -0x28(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x41069a
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
movq -0x8(%rbp), %rax
movq 0xc8(%rax), %rax
movq %rax, -0x68(%rbp)
movq -0x60(%rbp), %rax
cmpq -0x68(%rbp), %rax
je 0x41083e
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
cmpq $0x0, %rax
jne 0x41083e
callq 0x404250
movq %rax, %xmm0
movaps 0xcb92b(%rip), %xmm2    # 0x4dc050
movaps %xmm2, -0xb0(%rbp)
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
movapd 0xcb928(%rip), %xmm1    # 0x4dc060
movaps %xmm1, -0xa0(%rbp)
subpd %xmm1, %xmm0
movaps %xmm0, %xmm3
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm3, %xmm0
movsd %xmm0, -0x78(%rbp)
movq -0x58(%rbp), %rax
movq -0x18(%rbp), %rcx
imulq %rcx, %rax
movq %rax, %xmm0
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movsd %xmm0, -0x88(%rbp)
movsd -0x78(%rbp), %xmm0
movsd -0x70(%rbp), %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, -0x80(%rbp)
movsd -0x88(%rbp), %xmm0
movsd 0xcb886(%rip), %xmm1    # 0x4dc028
mulsd %xmm1, %xmm0
movsd -0x80(%rbp), %xmm1
movsd 0xcb88d(%rip), %xmm2    # 0x4dc040
mulsd %xmm2, %xmm1
mulsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x90(%rbp)
movq -0x8(%rbp), %rax
movsd -0x90(%rbp), %xmm0
movsd 0xcb86d(%rip), %xmm2    # 0x4dc048
movaps %xmm0, %xmm1
subsd %xmm2, %xmm1
cvttsd2si %xmm1, %rdx
cvttsd2si %xmm0, %rcx
movq %rcx, %rsi
sarq $0x3f, %rsi
andq %rsi, %rdx
orq %rdx, %rcx
lock
addq %rcx, 0x8(%rax)
movq -0x68(%rbp), %rax
movq %rax, -0x60(%rbp)
movq $0x0, -0x58(%rbp)
callq 0x404250
movaps -0xb0(%rbp), %xmm2
movaps -0xa0(%rbp), %xmm1
movq %rax, %xmm0
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movsd %xmm0, -0x70(%rbp)
jmp 0x410840
movb $0x1, %al
testb $0x1, %al
jne 0x410672
jmp 0x41084c
addq $0xc0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)