#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
double sqrt(double);
void modhs76(double *p, double *x, int m, int n, void *data) {
  x[0] = p[0];
  x[1] = sqrt(0.5) * p[1];
  x[2] = p[2];
  x[3] = sqrt(0.5) * p[3];
}


x86 assembly (clang, -O0):
<modhs76>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  0xebe(%rip),%xmm0
call   1030 <sqrt@plt>
mov    -0x8(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x10(%rax)
movsd  0xe8d(%rip),%xmm0
call   1030 <sqrt@plt>
mov    -0x8(%rbp),%rax
mulsd  0x18(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x18(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<modhs76>:
movsd  (%rdi),%xmm0
movsd  %xmm0,(%rsi)
movsd  0xef0(%rip),%xmm0
movsd  0x8(%rdi),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsi)
movsd  0x10(%rdi),%xmm1
movsd  %xmm1,0x10(%rsi)
mulsd  0x18(%rdi),%xmm0
movsd  %xmm0,0x18(%rsi)
ret

LLVM IR (-O0):
define void @modhs76(double* %0, double* %1, i32 %2, i32 %3, i8* %4) {
%6 = alloca double*
%7 = alloca double*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
store double* %0, double** %6
store double* %1, double** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%11 = load double*, double** %6
%12 = getelementptr inbounds double, double* %11, i64 0
%13 = load double, double* %12
%14 = load double*, double** %7
%15 = getelementptr inbounds double, double* %14, i64 0
store double %13, double* %15
%16 = call double @sqrt(double 5.000000e-01)
%17 = load double*, double** %6
%18 = getelementptr inbounds double, double* %17, i64 1
%19 = load double, double* %18
%20 = fmul double %16, %19
%21 = load double*, double** %7
%22 = getelementptr inbounds double, double* %21, i64 1
store double %20, double* %22
%23 = load double*, double** %6
%24 = getelementptr inbounds double, double* %23, i64 2
%25 = load double, double* %24
%26 = load double*, double** %7
%27 = getelementptr inbounds double, double* %26, i64 2
store double %25, double* %27
%28 = call double @sqrt(double 5.000000e-01)
%29 = load double*, double** %6
%30 = getelementptr inbounds double, double* %29, i64 3
%31 = load double, double* %30
%32 = fmul double %28, %31
%33 = load double*, double** %7
%34 = getelementptr inbounds double, double* %33, i64 3
store double %32, double* %34
ret void
}

LLVM IR (-O2):
define void @modhs76(double* nocapture %0, double* nocapture writeonly %1, i32 %2, i32 %3, i8* nocapture readnone %4) {
%6 = load double, double* %0
store double %6, double* %1
%7 = getelementptr inbounds double, double* %0, i64 1
%8 = load double, double* %7
%9 = fmul double %8, 0x3FE6A09E667F3BCD
%10 = getelementptr inbounds double, double* %1, i64 1
store double %9, double* %10
%11 = getelementptr inbounds double, double* %0, i64 2
%12 = load double, double* %11
%13 = getelementptr inbounds double, double* %1, i64 2
store double %12, double* %13
%14 = getelementptr inbounds double, double* %0, i64 3
%15 = load double, double* %14
%16 = fmul double %15, 0x3FE6A09E667F3BCD
%17 = getelementptr inbounds double, double* %1, i64 3
store double %16, double* %17
ret void
}