int dhseqr(char *JOB, char *COMPZ, int N, int ILO, int IHI, double *H, int LDH,
           double *WR, double *WI, double *Z, int LDZ, double *WORK,
           int LWORK) {
  extern void dhseqr_(char *JOB, char *COMPZ, int *Np, int *ILOp, int *IHIp,
                      double *H, int *LDHp, double *WR, double *WI, double *Z,
                      int *LDZ, double *WORK, int *LWORK, int *INFOp);
  int INFO;
  dhseqr_(JOB, COMPZ, &N, &ILO, &IHI, H, &LDH, WR, WI, Z, &LDZ, WORK, &LWORK,
          &INFO);
  return INFO;
}


x86 assembly (clang, -O0):
<dhseqr>:
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),%rax
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    0x20(%rbp),%r15
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    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 <dhseqr_@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):
<dhseqr>:
sub    $0x58,%rsp
movups 0x68(%rsp),%xmm0
mov    0x78(%rsp),%r10
mov    0x88(%rsp),%rax
mov    %edx,0x54(%rsp)
mov    %ecx,0x50(%rsp)
mov    %r8d,0x4c(%rsp)
lea    0x48(%rsp),%rcx
mov    %rcx,0x38(%rsp)
lea    0x90(%rsp),%rcx
mov    %rcx,0x30(%rsp)
mov    %rax,0x28(%rsp)
lea    0x80(%rsp),%rax
mov    %rax,0x20(%rsp)
mov    %r10,0x18(%rsp)
movups %xmm0,0x8(%rsp)
lea    0x60(%rsp),%rax
mov    %rax,(%rsp)
lea    0x54(%rsp),%rdx
lea    0x50(%rsp),%rcx
lea    0x4c(%rsp),%r8
call   1030 <dhseqr_@plt>
mov    0x48(%rsp),%eax
add    $0x58,%rsp
ret

LLVM IR (-O0):
define i32 @dhseqr(i8* %0, i8* %1, i32 %2, i32 %3, i32 %4, double* %5, i32 %6, double* %7, double* %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 double*
%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 double* %8, double** %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** %22
%33 = load double*, double** %23
%34 = load double*, double** %25
%35 = load i32, i32* %27
ret i32 %35
}

LLVM IR (-O2):
define i32 @dhseqr(i8* %0, i8* %1, i32 %2, i32 %3, i32 %4, double* %5, i32 %6, double* %7, double* %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
store i32 %2, i32* %14
store i32 %3, i32* %15
store i32 %4, i32* %16
store i32 %6, i32* %17
store i32 %10, i32* %18
store i32 %12, i32* %19
%21 = bitcast i32* %20 to i8*
%22 = load i32, i32* %20
ret i32 %22
}