#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*/ assert(double **);
int /*<<< orphan*/ matrix3_initialize(double **);
void matrix3_scale(double m[4][4], double sx, double sy, double sz) {
  assert(m);
  matrix3_initialize(m);
  m[0][0] = sx;
  m[1][1] = sy;
  m[2][2] = sz;
}


x86 assembly (clang, -O0):
<matrix3_scale>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1040 <matrix3_initialize@plt>
movsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x18(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x28(%rax)
movsd  -0x20(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x50(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<matrix3_scale>:
push   %rbx
sub    $0x20,%rsp
movsd  %xmm2,0x18(%rsp)
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
mov    %rdi,%rbx
call   1030 <assert@plt>
mov    %rbx,%rdi
call   1040 <matrix3_initialize@plt>
movsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%rbx)
movsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x28(%rbx)
movsd  0x18(%rsp),%xmm0
movsd  %xmm0,0x50(%rbx)
add    $0x20,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define void @matrix3_scale([4 x double]* %0, double %1, double %2, double %3) {
%5 = bitcast [4 x double]* %0 to double**
%6 = tail call i32 @assert(double** %5)
%7 = tail call i32 @matrix3_initialize(double** %5)
%8 = getelementptr inbounds [4 x double], [4 x double]* %0, i64 0, i64 0
store double %1, double* %8
%9 = getelementptr inbounds [4 x double], [4 x double]* %0, i64 1, i64 1
store double %2, double* %9
%10 = getelementptr inbounds [4 x double], [4 x double]* %0, i64 2, i64 2
store double %3, double* %10
ret void
}