#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*/ sgelsd_(int *, int *, int *, float *, int *, float *, int *,
                           float *, float *, int *, float *, int *, int *,
                           int *);
int aa_cla_sgelsd(int m, int n, int nrhs, float *A, int lda, float *B, int ldb,
                  float *S, float *rcond, int *rank, float *work, int lwork,
                  int *iwork) {
  int info = 0;
  sgelsd_(&m, &n, &nrhs, A, &lda, B, &ldb, S, rcond, rank, work, &lwork, iwork,
          &info);
  return info;
}


x86 assembly (clang, -O0):
<aa_cla_sgelsd>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    0x40(%rbp),%rax
mov    0x38(%rbp),%eax
mov    0x30(%rbp),%rax
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%eax
mov    %edi,-0x2c(%rbp)
mov    %esi,-0x30(%rbp)
mov    %edx,-0x34(%rbp)
mov    %rcx,-0x40(%rbp)
mov    %r8d,-0x44(%rbp)
mov    %r9,-0x50(%rbp)
movl   $0x0,-0x54(%rbp)
mov    -0x40(%rbp),%rcx
mov    -0x50(%rbp),%r9
mov    0x18(%rbp),%r12
mov    0x20(%rbp),%r15
mov    0x28(%rbp),%r14
mov    0x30(%rbp),%rbx
mov    0x40(%rbp),%r10
lea    -0x2c(%rbp),%rdi
lea    -0x30(%rbp),%rsi
lea    -0x34(%rbp),%rdx
lea    -0x44(%rbp),%r8
lea    0x10(%rbp),%r13
lea    0x38(%rbp),%r11
lea    -0x54(%rbp),%rax
mov    %r13,(%rsp)
mov    %r12,0x8(%rsp)
mov    %r15,0x10(%rsp)
mov    %r14,0x18(%rsp)
mov    %rbx,0x20(%rsp)
mov    %r11,0x28(%rsp)
mov    %r10,0x30(%rsp)
mov    %rax,0x38(%rsp)
call   1030 <sgelsd_@plt>
mov    -0x54(%rbp),%eax
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<aa_cla_sgelsd>:
sub    $0x58,%rsp
movups 0x68(%rsp),%xmm0
movups 0x78(%rsp),%xmm1
mov    0x90(%rsp),%rax
mov    %edi,0x54(%rsp)
mov    %esi,0x50(%rsp)
mov    %edx,0x4c(%rsp)
mov    %r8d,0x48(%rsp)
movl   $0x0,0x44(%rsp)
lea    0x44(%rsp),%rdx
mov    %rdx,0x38(%rsp)
mov    %rax,0x30(%rsp)
lea    0x88(%rsp),%rax
mov    %rax,0x28(%rsp)
movups %xmm1,0x18(%rsp)
movups %xmm0,0x8(%rsp)
lea    0x60(%rsp),%rax
mov    %rax,(%rsp)
lea    0x54(%rsp),%rdi
lea    0x50(%rsp),%rsi
lea    0x4c(%rsp),%rdx
lea    0x48(%rsp),%r8
call   1030 <sgelsd_@plt>
mov    0x44(%rsp),%eax
add    $0x58,%rsp
ret

LLVM IR (-O0):
define i32 @aa_cla_sgelsd(i32 %0, i32 %1, i32 %2, float* %3, i32 %4, float* %5, i32 %6, float* %7, float* %8, i32* %9, float* %10, i32 %11, i32* %12) {
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca float*
%18 = alloca i32
%19 = alloca float*
%20 = alloca i32
%21 = alloca float*
%22 = alloca float*
%23 = alloca i32*
%24 = alloca float*
%25 = alloca i32
%26 = alloca i32*
%27 = alloca i32
store i32 %0, i32* %14
store i32 %1, i32* %15
store i32 %2, i32* %16
store float* %3, float** %17
store i32 %4, i32* %18
store float* %5, float** %19
store i32 %6, i32* %20
store float* %7, float** %21
store float* %8, float** %22
store i32* %9, i32** %23
store float* %10, float** %24
store i32 %11, i32* %25
store i32* %12, i32** %26
store i32 0, i32* %27
%28 = load float*, float** %17
%29 = load float*, float** %19
%30 = load float*, float** %21
%31 = load float*, float** %22
%32 = load i32*, i32** %23
%33 = load float*, float** %24
%34 = load i32*, i32** %26
%35 = call i32 @sgelsd_(i32* %14, i32* %15, i32* %16, float* %28, i32* %18, float* %29, i32* %20, float* %30, float* %31, i32* %32, float* %33, i32* %25, i32* %34, i32* %27)
%36 = load i32, i32* %27
ret i32 %36
}

LLVM IR (-O2):
define i32 @aa_cla_sgelsd(i32 %0, i32 %1, i32 %2, float* %3, i32 %4, float* %5, i32 %6, float* %7, float* %8, i32* %9, float* %10, i32 %11, i32* %12) {
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
store i32 %0, i32* %14
store i32 %1, i32* %15
store i32 %2, i32* %16
store i32 %4, i32* %17
store i32 %6, i32* %18
store i32 %11, i32* %19
%21 = bitcast i32* %20 to i8*
store i32 0, i32* %20
%22 = call i32 @sgelsd_(i32* %14, i32* %15, i32* %16, float* %3, i32* %17, float* %5, i32* %18, float* %7, float* %8, i32* %9, float* %10, i32* %19, i32* %12, i32* %20)
%23 = load i32, i32* %20
ret i32 %23
}