int dgghrd(char *COMPQ, char *COMPZ, int N, int ILO, int IHI, double *A,
           int LDA, double *B, int LDB, double *Q, int LDQ, double *Z,
           int LDZ) {
  extern void dgghrd_(char *N, char *COMPZ, int *Np, int *ILOp, int *IHIp,
                      double *A, int *LDAp, double *B, int *LDBp, double *Q,
                      int *LDQp, double *Z, int *LDZp, int *INFO);
  int INFO;
  dgghrd_(COMPQ, COMPZ, &N, &ILO, &IHI, A, &LDA, B, &LDB, Q, &LDQ, Z, &LDZ,
          &INFO);
  return INFO;
}


x86 assembly (clang, -O0):
<dgghrd>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    0x40(%rbp),%eax
mov    0x38(%rbp),%rax
mov    0x30(%rbp),%eax
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%eax
mov    %rdi,-0x30(%rbp)
mov    %rsi,-0x38(%rbp)
mov    %edx,-0x3c(%rbp)
mov    %ecx,-0x40(%rbp)
mov    %r8d,-0x44(%rbp)
mov    %r9,-0x50(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    -0x50(%rbp),%r9
mov    0x18(%rbp),%r12
mov    0x28(%rbp),%r14
mov    0x38(%rbp),%r11
lea    -0x3c(%rbp),%rdx
lea    -0x40(%rbp),%rcx
lea    -0x44(%rbp),%r8
lea    0x10(%rbp),%r13
lea    0x20(%rbp),%r15
lea    0x30(%rbp),%rbx
lea    0x40(%rbp),%r10
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 <dgghrd_@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):
<dgghrd>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    0x48(%rsp),%r10
mov    0x58(%rsp),%r11
mov    0x68(%rsp),%r14
mov    %edx,0xc(%rsp)
mov    %ecx,0x8(%rsp)
mov    %r8d,0x4(%rsp)
mov    %rsp,%rbx
lea    0x70(%rsp),%rax
lea    0x60(%rsp),%r15
lea    0x50(%rsp),%r12
lea    0x40(%rsp),%r13
lea    0xc(%rsp),%rdx
lea    0x8(%rsp),%rcx
lea    0x4(%rsp),%r8
push   %rbx
push   %rax
push   %r14
push   %r15
push   %r11
push   %r12
push   %r10
push   %r13
call   1030 <dgghrd_@plt>
add    $0x40,%rsp
mov    (%rsp),%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

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