#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 */
int /*<<< orphan*/ doubles_mat44_rotate_z(double, double *);
int /*<<< orphan*/ doubles_mat_AB(double *, int, int, double *, int, int,
                                  double *, int, int);
int /*<<< orphan*/ memcpy(double *, double *, int);
void doubles_mat44_rotate_z_self(double rad, double out[16]) {
  double tmp[16], prod[16];
  doubles_mat44_rotate_z(rad, tmp);
  doubles_mat_AB(out, 4, 4, tmp, 4, 4, prod, 4, 4);
  memcpy(out, prod, sizeof(double) * 16);
}


x86 assembly (clang, -O0):
<doubles_mat44_rotate_z_self>:
push   %rbp
mov    %rsp,%rbp
sub    $0x130,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    -0x90(%rbp),%rdi
call   1050 <doubles_mat44_rotate_z@plt>
mov    -0x10(%rbp),%rdi
lea    -0x90(%rbp),%rcx
lea    -0x110(%rbp),%rax
mov    $0x4,%r9d
mov    %r9d,%esi
mov    %r9d,%edx
mov    %r9d,%r8d
mov    %rax,(%rsp)
movl   $0x4,0x8(%rsp)
movl   $0x4,0x10(%rsp)
call   1040 <doubles_mat_AB@plt>
mov    -0x10(%rbp),%rdi
lea    -0x110(%rbp),%rsi
mov    $0x80,%edx
call   1030 <memcpy@plt>
add    $0x130,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doubles_mat44_rotate_z_self>:
push   %r15
push   %r14
push   %rbx
sub    $0x100,%rsp
mov    %rdi,%rbx
lea    0x80(%rsp),%r14
mov    %r14,%rdi
call   1050 <doubles_mat44_rotate_z@plt>
sub    $0x8,%rsp
lea    0x8(%rsp),%r15
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x4,%edx
mov    %r14,%rcx
mov    $0x4,%r8d
mov    $0x4,%r9d
push   $0x4
push   $0x4
push   %r15
call   1040 <doubles_mat_AB@plt>
add    $0x20,%rsp
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x80,%edx
call   1030 <memcpy@plt>
add    $0x100,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @doubles_mat44_rotate_z_self(double %0, double* %1) {
%3 = alloca double
%4 = alloca double*
%5 = alloca [16 x double]
%6 = alloca [16 x double]
store double %0, double* %3
store double* %1, double** %4
%7 = load double, double* %3
%8 = getelementptr inbounds [16 x double], [16 x double]* %5, i64 0, i64 0
%9 = call i32 @doubles_mat44_rotate_z(double %7, double* %8)
%10 = load double*, double** %4
%11 = getelementptr inbounds [16 x double], [16 x double]* %5, i64 0, i64 0
%12 = getelementptr inbounds [16 x double], [16 x double]* %6, i64 0, i64 0
%13 = call i32 @doubles_mat_AB(double* %10, i32 4, i32 4, double* %11, i32 4, i32 4, double* %12, i32 4, i32 4)
%14 = load double*, double** %4
%15 = getelementptr inbounds [16 x double], [16 x double]* %6, i64 0, i64 0
%16 = call i32 @memcpy(double* %14, double* %15, i32 128)
ret void
}

LLVM IR (-O2):
define void @doubles_mat44_rotate_z_self(double %0, double* %1) {
%3 = alloca [16 x double]
%4 = alloca [16 x double]
%5 = bitcast [16 x double]* %3 to i8*
%6 = bitcast [16 x double]* %4 to i8*
%7 = getelementptr inbounds [16 x double], [16 x double]* %3, i64 0, i64 0
%8 = call i32 @doubles_mat44_rotate_z(double %0, double* %7)
%9 = getelementptr inbounds [16 x double], [16 x double]* %4, i64 0, i64 0
%10 = call i32 @doubles_mat_AB(double* %1, i32 4, i32 4, double* %7, i32 4, i32 4, double* %9, i32 4, i32 4)
%11 = call i32 @memcpy(double* %1, double* %9, i32 128)
ret void
}