#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*/ multiply4x4(float *, float *);
void translate(float *matrix, float x, float y, float z) {
  float newmatrix[16] = {1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0,
                         0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0};
  newmatrix[12] = x;
  newmatrix[13] = y;
  newmatrix[14] = z;
  multiply4x4(matrix, newmatrix);
}


x86 assembly (clang, -O0):
<translate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  %xmm2,-0x14(%rbp)
lea    -0x60(%rbp),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1030 <memset@plt>
movss  0xead(%rip),%xmm0
movss  %xmm0,-0x60(%rbp)
movss  0xea0(%rip),%xmm0
movss  %xmm0,-0x4c(%rbp)
movss  0xe93(%rip),%xmm0
movss  %xmm0,-0x38(%rbp)
movss  0xe86(%rip),%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x30(%rbp)
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x60(%rbp),%rsi
call   1040 <multiply4x4@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<translate>:
sub    $0x48,%rsp
xorps  %xmm3,%xmm3
movaps %xmm3,(%rsp)
movaps %xmm3,0x10(%rsp)
movaps %xmm3,0x20(%rsp)
movl   $0x3f800000,(%rsp)
movl   $0x3f800000,0x14(%rsp)
3f
movl   $0x3f800000,0x28(%rsp)
3f
movl   $0x3f800000,0x3c(%rsp)
3f
movss  %xmm0,0x30(%rsp)
movss  %xmm1,0x34(%rsp)
movss  %xmm2,0x38(%rsp)
mov    %rsp,%rsi
call   1030 <multiply4x4@plt>
add    $0x48,%rsp
ret

LLVM IR (-O0):
define void @translate(float* %0, float %1, float %2, float %3) {
%5 = alloca float*
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca [16 x float]
store float* %0, float** %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%10 = bitcast [16 x float]* %9 to i8*
%11 = bitcast i8* %10 to [16 x float]*
%12 = getelementptr inbounds [16 x float], [16 x float]* %11, i32 0, i32 0
store float 1.000000e+00, float* %12
%13 = getelementptr inbounds [16 x float], [16 x float]* %11, i32 0, i32 5
store float 1.000000e+00, float* %13
%14 = getelementptr inbounds [16 x float], [16 x float]* %11, i32 0, i32 10
store float 1.000000e+00, float* %14
%15 = getelementptr inbounds [16 x float], [16 x float]* %11, i32 0, i32 15
store float 1.000000e+00, float* %15
%16 = load float, float* %6
%17 = getelementptr inbounds [16 x float], [16 x float]* %9, i64 0, i64 12
store float %16, float* %17
%18 = load float, float* %7
%19 = getelementptr inbounds [16 x float], [16 x float]* %9, i64 0, i64 13
store float %18, float* %19
%20 = load float, float* %8
%21 = getelementptr inbounds [16 x float], [16 x float]* %9, i64 0, i64 14
store float %20, float* %21
%22 = load float*, float** %5
%23 = getelementptr inbounds [16 x float], [16 x float]* %9, i64 0, i64 0
%24 = call i32 @multiply4x4(float* %22, float* %23)
ret void
}

LLVM IR (-O2):
define void @translate(float* %0, float %1, float %2, float %3) {
%5 = alloca [16 x float]
%6 = bitcast [16 x float]* %5 to i8*
%7 = getelementptr inbounds [16 x float], [16 x float]* %5, i64 0, i64 0
store float 1.000000e+00, float* %7
%8 = getelementptr inbounds [16 x float], [16 x float]* %5, i64 0, i64 5
store float 1.000000e+00, float* %8
%9 = getelementptr inbounds [16 x float], [16 x float]* %5, i64 0, i64 10
store float 1.000000e+00, float* %9
%10 = getelementptr inbounds [16 x float], [16 x float]* %5, i64 0, i64 15
store float 1.000000e+00, float* %10
%11 = getelementptr inbounds [16 x float], [16 x float]* %5, i64 0, i64 12
store float %1, float* %11
%12 = getelementptr inbounds [16 x float], [16 x float]* %5, i64 0, i64 13
store float %2, float* %12
%13 = getelementptr inbounds [16 x float], [16 x float]* %5, i64 0, i64 14
store float %3, float* %13
%14 = call i32 @multiply4x4(float* %0, float* %7)
ret void
}