#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*/ dgeqrfp_(int *, int *, double *, int *, double *, double *,
                            int *, int *);
int main() {
  double a[4] = {0, 2, 2, -1};
  int m = 2;
  int n = 2;
  int info = 0;
  int lda = m;
  int lwork = n;
  double work[2];
  double tau[2];
  dgeqrfp_(&m, &n, a, &lda, tau, work, &lwork, &info);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xed8(%rip),%rax
mov    %rax,-0x8(%rbp)
movl   $0x2,-0x24(%rbp)
movl   $0x2,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x28(%rbp),%eax
mov    %eax,-0x34(%rbp)
lea    -0x20(%rbp),%rdx
lea    -0x60(%rbp),%r8
lea    -0x50(%rbp),%r9
lea    -0x24(%rbp),%rdi
lea    -0x28(%rbp),%rsi
lea    -0x30(%rbp),%rcx
lea    -0x34(%rbp),%r10
lea    -0x2c(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <dgeqrfp_@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x68,%rsp
movaps 0xef5(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movl   $0x2,0x1c(%rsp)
movl   $0x2,0x18(%rsp)
movl   $0x0,0x14(%rsp)
movl   $0x2,0x10(%rsp)
movl   $0x2,0xc(%rsp)
lea    0x14(%rsp),%rax
lea    0xc(%rsp),%r10
lea    0x1c(%rsp),%rdi
lea    0x18(%rsp),%rsi
lea    0x20(%rsp),%rdx
lea    0x10(%rsp),%rcx
lea    0x40(%rsp),%r8
lea    0x50(%rsp),%r9
push   %rax
push   %r10
call   1030 <dgeqrfp_@plt>
add    $0x10,%rsp
xor    %eax,%eax
add    $0x68,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [4 x double] [double 0.000000e+00, double 2.000000e+00, double 2.000000e+00, double -1.000000e+00]
define i32 @main() {
%1 = alloca [4 x double]
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca [2 x double]
%8 = alloca [2 x double]
%9 = bitcast [4 x double]* %1 to i8*
store i32 2, i32* %2
store i32 2, i32* %3
store i32 0, i32* %4
%10 = load i32, i32* %2
store i32 %10, i32* %5
%11 = load i32, i32* %3
store i32 %11, i32* %6
%12 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 0, i64 0
%13 = getelementptr inbounds [2 x double], [2 x double]* %8, i64 0, i64 0
%14 = getelementptr inbounds [2 x double], [2 x double]* %7, i64 0, i64 0
%15 = call i32 @dgeqrfp_(i32* %2, i32* %3, double* %12, i32* %5, double* %13, double* %14, i32* %6, i32* %4)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [4 x double] [double 0.000000e+00, double 2.000000e+00, double 2.000000e+00, double -1.000000e+00]
define i32 @main() {
%1 = alloca [4 x double]
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca [2 x double]
%8 = alloca [2 x double]
%9 = bitcast [4 x double]* %1 to i8*
%10 = bitcast i32* %2 to i8*
store i32 2, i32* %2
%11 = bitcast i32* %3 to i8*
store i32 2, i32* %3
%12 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%13 = bitcast i32* %5 to i8*
store i32 2, i32* %5
%14 = bitcast i32* %6 to i8*
store i32 2, i32* %6
%15 = bitcast [2 x double]* %7 to i8*
%16 = bitcast [2 x double]* %8 to i8*
%17 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 0, i64 0
%18 = getelementptr inbounds [2 x double], [2 x double]* %8, i64 0, i64 0
%19 = getelementptr inbounds [2 x double], [2 x double]* %7, i64 0, i64 0
%20 = call i32 @dgeqrfp_(i32* %2, i32* %3, double* %17, i32* %5, double* %18, double* %19, i32* %6, i32* %4)
ret i32 0
}