#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 cos(double);
double sin(double);
void make_rot_angle(double angle, double rot[2][2]) {
  double c = cos(angle), s = sin(angle);
  rot[0][0] = c;
  rot[0][1] = -s;
  rot[1][0] = s;
  rot[1][1] = c;
}


x86 assembly (clang, -O0):
<make_rot_angle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x20(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0x20(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x10(%rax)
movsd  -0x18(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x18(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_rot_angle>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movsd  %xmm0,(%rsp)
call   1040 <cos@plt>
movsd  %xmm0,0x8(%rsp)
movsd  (%rsp),%xmm0
call   1030 <sin@plt>
movsd  0x8(%rsp),%xmm2
movsd  %xmm2,(%rbx)
movaps 0xead(%rip),%xmm1
xorps  %xmm0,%xmm1
movlps %xmm1,0x8(%rbx)
movsd  %xmm0,0x10(%rbx)
movsd  %xmm2,0x18(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @make_rot_angle(double %0, [2 x double]* %1) {
%3 = alloca double
%4 = alloca [2 x double]*
%5 = alloca double
%6 = alloca double
store double %0, double* %3
store [2 x double]* %1, [2 x double]** %4
%7 = load double, double* %3
%8 = call double @cos(double %7)
store double %8, double* %5
%9 = load double, double* %3
%10 = call double @sin(double %9)
store double %10, double* %6
%11 = load double, double* %5
%12 = load [2 x double]*, [2 x double]** %4
%13 = getelementptr inbounds [2 x double], [2 x double]* %12, i64 0
%14 = getelementptr inbounds [2 x double], [2 x double]* %13, i64 0, i64 0
store double %11, double* %14
%15 = load double, double* %6
%16 = fneg double %15
%17 = load [2 x double]*, [2 x double]** %4
%18 = getelementptr inbounds [2 x double], [2 x double]* %17, i64 0
%19 = getelementptr inbounds [2 x double], [2 x double]* %18, i64 0, i64 1
store double %16, double* %19
%20 = load double, double* %6
%21 = load [2 x double]*, [2 x double]** %4
%22 = getelementptr inbounds [2 x double], [2 x double]* %21, i64 1
%23 = getelementptr inbounds [2 x double], [2 x double]* %22, i64 0, i64 0
store double %20, double* %23
%24 = load double, double* %5
%25 = load [2 x double]*, [2 x double]** %4
%26 = getelementptr inbounds [2 x double], [2 x double]* %25, i64 1
%27 = getelementptr inbounds [2 x double], [2 x double]* %26, i64 0, i64 1
store double %24, double* %27
ret void
}

LLVM IR (-O2):
define void @make_rot_angle(double %0, [2 x double]* nocapture writeonly %1) {
%3 = tail call double @cos(double %0)
%4 = tail call double @sin(double %0)
%5 = getelementptr inbounds [2 x double], [2 x double]* %1, i64 0, i64 0
store double %3, double* %5
%6 = fneg double %4
%7 = getelementptr inbounds [2 x double], [2 x double]* %1, i64 0, i64 1
store double %6, double* %7
%8 = getelementptr inbounds [2 x double], [2 x double]* %1, i64 1, i64 0
store double %4, double* %8
%9 = getelementptr inbounds [2 x double], [2 x double]* %1, i64 1, i64 1
store double %3, double* %9
ret void
}