#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*/ tensor_mtxm(double *, unsigned int, double const *,
                               unsigned int, double const *, unsigned int);
int /*<<< orphan*/ tensor_mxm(double *, unsigned int, double *, unsigned int,
                              double const *, unsigned int);
void tensor_2t(double *out, const double *Jrt, unsigned int nr, unsigned int mr,
               const double *Jst, unsigned int ns, unsigned int ms,
               const double *u, double *work) {
  tensor_mtxm(work, nr, Jrt, mr, u, ms);
  tensor_mxm(out, nr, work, ms, Jst, ns);
}


x86 assembly (clang, -O0):
<tensor_2t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
mov    0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%ecx
mov    0x18(%rbp),%r8
mov    0x10(%rbp),%r9d
call   1040 <tensor_mtxm@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    0x20(%rbp),%rdx
mov    0x10(%rbp),%ecx
mov    -0x20(%rbp),%r8
mov    -0x24(%rbp),%r9d
call   1030 <tensor_mxm@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tensor_2t>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9d,%r14d
mov    %r8,%r15
mov    %edx,%r13d
mov    %rsi,%rdx
mov    %rdi,%r12
mov    0x50(%rsp),%rbx
mov    0x48(%rsp),%r8
mov    0x40(%rsp),%ebp
mov    %rbx,%rdi
mov    %r13d,%esi
mov    %ebp,%r9d
call   1040 <tensor_mtxm@plt>
mov    %r12,%rdi
mov    %r13d,%esi
mov    %rbx,%rdx
mov    %ebp,%ecx
mov    %r15,%r8
mov    %r14d,%r9d
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <tensor_mxm@plt>

LLVM IR (-O0):
define void @tensor_2t(double* %0, double* %1, i32 %2, i32 %3, double* %4, i32 %5, i32 %6, double* %7, double* %8) {
%10 = alloca double*
%11 = alloca double*
%12 = alloca i32
%13 = alloca i32
%14 = alloca double*
%15 = alloca i32
%16 = alloca i32
%17 = alloca double*
%18 = alloca double*
store double* %0, double** %10
store double* %1, double** %11
store i32 %2, i32* %12
store i32 %3, i32* %13
store double* %4, double** %14
store i32 %5, i32* %15
store i32 %6, i32* %16
store double* %7, double** %17
store double* %8, double** %18
%19 = load double*, double** %18
%20 = load i32, i32* %12
%21 = load double*, double** %11
%22 = load i32, i32* %13
%23 = load double*, double** %17
%24 = load i32, i32* %16
%25 = call i32 @tensor_mtxm(double* %19, i32 %20, double* %21, i32 %22, double* %23, i32 %24)
%26 = load double*, double** %10
%27 = load i32, i32* %12
%28 = load double*, double** %18
%29 = load i32, i32* %16
%30 = load double*, double** %14
%31 = load i32, i32* %15
%32 = call i32 @tensor_mxm(double* %26, i32 %27, double* %28, i32 %29, double* %30, i32 %31)
ret void
}

LLVM IR (-O2):
define void @tensor_2t(double* %0, double* %1, i32 %2, i32 %3, double* %4, i32 %5, i32 %6, double* %7, double* %8) {
%10 = tail call i32 @tensor_mtxm(double* %8, i32 %2, double* %1, i32 %3, double* %7, i32 %6)
%11 = tail call i32 @tensor_mxm(double* %0, i32 %2, double* %8, i32 %6, double* %4, i32 %5)
ret void
}