#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ dDumpLine(int /*<<< orphan*/ *);
int /*<<< orphan*/ dParseFloatFormat(char *, int *, int *);
int /*<<< orphan*/ dParseIntFormat(char *, int *, int *);
int /*<<< orphan*/ dReadValues(int /*<<< orphan*/ *, int, double *, int, int);
int /*<<< orphan*/ dReadVector(int /*<<< orphan*/ *, int, int *, int, int);
int /*<<< orphan*/ dallocateA(int, int, double **, int **, int **);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sscanf(char *, char *, int *);
int /*<<< orphan*/ *stdin;
int /*<<< orphan*/ stdout;
void dreadhb(int *nrow, int *ncol, int *nonz, double **nzval, int **rowind,
             int **colptr) {
  register int i, numer_lines = 0, rhscrd = 0;
  int tmp, colnum, colsize, rownum, rowsize, valnum, valsize;
  char buf[100], type[4];
  FILE *fp;
  fp = stdin;
  fgets(buf, 100, fp);
  fputs(buf, stdout);
  for (i = 0; i < 5; i++) {
    fscanf(fp, "%14c", buf);
    buf[14] = 0;
    sscanf(buf, "%d", &tmp);
    if (i == 3)
      numer_lines = tmp;
    if (i == 4 && tmp)
      rhscrd = tmp;
  }
  dDumpLine(fp);
  fscanf(fp, "%3c", type);
  fscanf(fp, "%11c", buf);
  type[3] = 0;
  fscanf(fp, "%14c", buf);
  sscanf(buf, "%d", nrow);
  fscanf(fp, "%14c", buf);
  sscanf(buf, "%d", ncol);
  fscanf(fp, "%14c", buf);
  sscanf(buf, "%d", nonz);
  fscanf(fp, "%14c", buf);
  sscanf(buf, "%d", &tmp);
  if (tmp != 0)
    printf("This is not an assembled matrix!\n");
  if (*nrow != *ncol)
    printf("Matrix is not square.\n");
  dDumpLine(fp);
  dallocateA(*ncol, *nonz, nzval, rowind, colptr);
  fscanf(fp, "%16c", buf);
  dParseIntFormat(buf, &colnum, &colsize);
  fscanf(fp, "%16c", buf);
  dParseIntFormat(buf, &rownum, &rowsize);
  fscanf(fp, "%20c", buf);
  dParseFloatFormat(buf, &valnum, &valsize);
  fscanf(fp, "%20c", buf);
  dDumpLine(fp);
  if (rhscrd)
    dDumpLine(fp);
  dReadVector(fp, *ncol + 1, *colptr, colnum, colsize);
  dReadVector(fp, *nonz, *rowind, rownum, rowsize);
  if (numer_lines) {
    dReadValues(fp, *nonz, *nzval, valnum, valsize);
  }
  fclose(fp);
}


x86 assembly (clang, -O0):
<dreadhb>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
movl   $0x0,-0x38(%rbp)
movl   $0x0,-0x3c(%rbp)
mov    0x2df0(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0xd0(%rbp)
lea    -0xc0(%rbp),%rdi
mov    -0xd0(%rbp),%rdx
mov    $0x64,%esi
call   10a0 <fgets@plt>
lea    -0xc0(%rbp),%rdi
mov    0x2db0(%rip),%rax
mov    (%rax),%esi
call   1080 <fputs@plt>
movl   $0x0,-0x34(%rbp)
cmpl   $0x5,-0x34(%rbp)
jge    12b5 <dreadhb+0xf5>
mov    -0xd0(%rbp),%rdi
lea    -0xc0(%rbp),%rdx
lea    0xdab(%rip),%rsi
call   1090 <fscanf@plt>
movb   $0x0,-0xb2(%rbp)
lea    -0xc0(%rbp),%rdi
lea    0xd96(%rip),%rsi
lea    -0x40(%rbp),%rdx
call   10b0 <sscanf@plt>
cmpl   $0x3,-0x34(%rbp)
jne    1288 <dreadhb+0xc8>
mov    -0x40(%rbp),%eax
mov    %eax,-0x38(%rbp)
cmpl   $0x4,-0x34(%rbp)
jne    12a2 <dreadhb+0xe2>
cmpl   $0x0,-0x40(%rbp)
je     12a2 <dreadhb+0xe2>
mov    -0x40(%rbp),%eax
mov    %eax,-0x3c(%rbp)
jmp    12a7 <dreadhb+0xe7>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1236 <dreadhb+0x76>
mov    -0xd0(%rbp),%rdi
call   1050 <dDumpLine@plt>
mov    -0xd0(%rbp),%rdi
lea    -0xc4(%rbp),%rdx
lea    0xd32(%rip),%rsi
call   1090 <fscanf@plt>
mov    -0xd0(%rbp),%rdi
lea    -0xc0(%rbp),%rdx
lea    0xd1c(%rip),%rsi
call   1090 <fscanf@plt>
movb   $0x0,-0xc1(%rbp)
mov    -0xd0(%rbp),%rdi
lea    -0xc0(%rbp),%rdx
lea    0xcef(%rip),%rsi
call   1090 <fscanf@plt>
lea    -0xc0(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xcdd(%rip),%rsi
call   10b0 <sscanf@plt>
mov    -0xd0(%rbp),%rdi
lea    -0xc0(%rbp),%rdx
lea    0xcbe(%rip),%rsi
call   1090 <fscanf@plt>
lea    -0xc0(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xcac(%rip),%rsi
call   10b0 <sscanf@plt>
mov    -0xd0(%rbp),%rdi
lea    -0xc0(%rbp),%rdx
lea    0xc8d(%rip),%rsi
call   1090 <fscanf@plt>
lea    -0xc0(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0xc7b(%rip),%rsi
call   10b0 <sscanf@plt>
mov    -0xd0(%rbp),%rdi
lea    -0xc0(%rbp),%rdx
lea    0xc5c(%rip),%rsi
call   1090 <fscanf@plt>
lea    -0xc0(%rbp),%rdi
lea    0xc4e(%rip),%rsi
lea    -0x40(%rbp),%rdx
call   10b0 <sscanf@plt>
cmpl   $0x0,-0x40(%rbp)
je     13d6 <dreadhb+0x216>
lea    0xc40(%rip),%rdi
call   1070 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
je     13f4 <dreadhb+0x234>
lea    0xc44(%rip),%rdi
call   1070 <printf@plt>
mov    -0xd0(%rbp),%rdi
call   1050 <dDumpLine@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x30(%rbp),%r8
call   10e0 <dallocateA@plt>
mov    -0xd0(%rbp),%rdi
lea    -0xc0(%rbp),%rdx
lea    0xc18(%rip),%rsi
call   1090 <fscanf@plt>
lea    -0xc0(%rbp),%rdi
lea    -0x44(%rbp),%rsi
lea    -0x48(%rbp),%rdx
call   10c0 <dParseIntFormat@plt>
mov    -0xd0(%rbp),%rdi
lea    -0xc0(%rbp),%rdx
lea    0xbea(%rip),%rsi
call   1090 <fscanf@plt>
lea    -0xc0(%rbp),%rdi
lea    -0x4c(%rbp),%rsi
lea    -0x50(%rbp),%rdx
call   10c0 <dParseIntFormat@plt>
mov    -0xd0(%rbp),%rdi
lea    -0xc0(%rbp),%rdx
lea    0xbc1(%rip),%rsi
call   1090 <fscanf@plt>
lea    -0xc0(%rbp),%rdi
lea    -0x54(%rbp),%rsi
lea    -0x58(%rbp),%rdx
call   1030 <dParseFloatFormat@plt>
mov    -0xd0(%rbp),%rdi
lea    -0xc0(%rbp),%rdx
lea    0xb93(%rip),%rsi
call   1090 <fscanf@plt>
mov    -0xd0(%rbp),%rdi
call   1050 <dDumpLine@plt>
cmpl   $0x0,-0x3c(%rbp)
je     14e3 <dreadhb+0x323>
mov    -0xd0(%rbp),%rdi
call   1050 <dDumpLine@plt>
mov    -0xd0(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
add    $0x1,%esi
mov    -0x30(%rbp),%rax
mov    (%rax),%rdx
mov    -0x44(%rbp),%ecx
mov    -0x48(%rbp),%r8d
call   1040 <dReadVector@plt>
mov    -0xd0(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
mov    -0x28(%rbp),%rax
mov    (%rax),%rdx
mov    -0x4c(%rbp),%ecx
mov    -0x50(%rbp),%r8d
call   1040 <dReadVector@plt>
cmpl   $0x0,-0x38(%rbp)
je     1550 <dreadhb+0x390>
mov    -0xd0(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
mov    -0x20(%rbp),%rax
mov    (%rax),%rdx
mov    -0x54(%rbp),%ecx
mov    -0x58(%rbp),%r8d
call   10d0 <dReadValues@plt>
mov    -0xd0(%rbp),%rdi
call   1060 <fclose@plt>
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dreadhb>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xc8,%rsp
mov    %r9,0x40(%rsp)
mov    %r8,0x58(%rsp)
mov    %rcx,0x50(%rsp)
mov    %rdx,0x48(%rsp)
mov    %rsi,0x10(%rsp)
mov    %rdi,%r14
mov    0x2df4(%rip),%rax
mov    (%rax),%rbx
lea    0x60(%rsp),%r12
mov    %r12,%rdi
mov    $0x64,%esi
mov    %rbx,%rdx
call   10a0 <fgets@plt>
mov    0x2dc5(%rip),%rax
mov    (%rax),%esi
mov    %r12,%rdi
call   1080 <fputs@plt>
lea    0xddc(%rip),%r13
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %r12,%rdx
call   1090 <fscanf@plt>
movb   $0x0,0x6e(%rsp)
lea    0xdc7(%rip),%r15
lea    0xc(%rsp),%rbp
mov    %r12,%rdi
mov    %r15,%rsi
mov    %rbp,%rdx
call   10b0 <sscanf@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %r12,%rdx
call   1090 <fscanf@plt>
movb   $0x0,0x6e(%rsp)
mov    %r12,%rdi
mov    %r15,%rsi
mov    %rbp,%rdx
call   10b0 <sscanf@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %r12,%rdx
call   1090 <fscanf@plt>
movb   $0x0,0x6e(%rsp)
mov    %r12,%rdi
mov    %r15,%rsi
mov    %rbp,%rdx
call   10b0 <sscanf@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %r12,%rdx
call   1090 <fscanf@plt>
movb   $0x0,0x6e(%rsp)
mov    %r12,%rdi
mov    %r15,%rsi
mov    %rbp,%rdx
call   10b0 <sscanf@plt>
mov    0xc(%rsp),%eax
mov    %eax,0x20(%rsp)
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %r12,%rdx
call   1090 <fscanf@plt>
movb   $0x0,0x6e(%rsp)
mov    %r12,%rdi
mov    %r15,%rsi
mov    %rbp,%rdx
call   10b0 <sscanf@plt>
mov    0xc(%rsp),%eax
mov    %eax,0x1c(%rsp)
mov    %rbx,%rdi
call   1060 <dDumpLine@plt>
lea    0xd14(%rip),%rsi
lea    0x3c(%rsp),%rdx
mov    %rbx,%rdi
call   1090 <fscanf@plt>
lea    0xd04(%rip),%rsi
mov    %rbx,%rdi
mov    %r12,%rdx
call   1090 <fscanf@plt>
movb   $0x0,0x3f(%rsp)
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %r12,%rdx
call   1090 <fscanf@plt>
mov    %r12,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   10b0 <sscanf@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %r12,%rdx
call   1090 <fscanf@plt>
mov    %r12,%rdi
mov    %r15,%rsi
mov    0x10(%rsp),%rdx
call   10b0 <sscanf@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %r12,%rdx
call   1090 <fscanf@plt>
mov    %r12,%rdi
mov    %r15,%rsi
mov    0x48(%rsp),%rdx
mov    %rdx,%rbp
call   10b0 <sscanf@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %r12,%rdx
call   1090 <fscanf@plt>
mov    %r12,%rdi
mov    %r15,%rsi
lea    0xc(%rsp),%rdx
call   10b0 <sscanf@plt>
cmpl   $0x0,0xc(%rsp)
je     13a4 <dreadhb+0x1e4>
lea    0xc92(%rip),%rdi
call   1040 <puts@plt>
mov    (%r14),%eax
mov    0x10(%rsp),%rcx
cmp    (%rcx),%eax
je     13bc <dreadhb+0x1fc>
lea    0xc64(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1060 <dDumpLine@plt>
mov    0x10(%rsp),%rax
mov    (%rax),%edi
mov    %rbp,%r12
mov    0x0(%rbp),%esi
mov    0x50(%rsp),%rdx
mov    %rdx,%r15
mov    0x58(%rsp),%r13
mov    %r13,%rcx
mov    0x40(%rsp),%r8
call   10e0 <dallocateA@plt>
lea    0xc1f(%rip),%r14
lea    0x60(%rsp),%rbp
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %rbp,%rdx
call   1090 <fscanf@plt>
lea    0x38(%rsp),%rsi
lea    0x34(%rsp),%rdx
mov    %rbp,%rdi
call   10c0 <dParseIntFormat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %rbp,%rdx
call   1090 <fscanf@plt>
lea    0x30(%rsp),%rsi
lea    0x2c(%rsp),%rdx
mov    %rbp,%rdi
call   10c0 <dParseIntFormat@plt>
lea    0xbd8(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %rbp,%rdx
call   1090 <fscanf@plt>
lea    0x28(%rsp),%rsi
lea    0x24(%rsp),%rdx
mov    %rbp,%rdi
call   1030 <dParseFloatFormat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %rbp,%rdx
call   1090 <fscanf@plt>
mov    %rbx,%rdi
call   1060 <dDumpLine@plt>
cmpl   $0x0,0x1c(%rsp)
je     1483 <dreadhb+0x2c3>
mov    %rbx,%rdi
call   1060 <dDumpLine@plt>
mov    0x10(%rsp),%rax
mov    (%rax),%esi
add    $0x1,%esi
mov    0x40(%rsp),%rax
mov    (%rax),%rdx
mov    0x38(%rsp),%ecx
mov    0x34(%rsp),%r8d
mov    %rbx,%rdi
call   1050 <dReadVector@plt>
mov    (%r12),%esi
mov    0x0(%r13),%rdx
mov    0x30(%rsp),%ecx
mov    0x2c(%rsp),%r8d
mov    %rbx,%rdi
call   1050 <dReadVector@plt>
cmpl   $0x0,0x20(%rsp)
je     14de <dreadhb+0x31e>
mov    (%r12),%esi
mov    (%r15),%rdx
mov    0x28(%rsp),%ecx
mov    0x24(%rsp),%r8d
mov    %rbx,%rdi
call   10d0 <dReadValues@plt>
mov    %rbx,%rdi
call   1070 <fclose@plt>
add    $0xc8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stdin = global i32* null
@stdout = global i32 0
@.str = [5 x i8] c"%14c\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [4 x i8] c"%3c\00"
@.str.3 = [5 x i8] c"%11c\00"
@.str.4 = [34 x i8] c"This is not an assembled matrix!\0A\00"
@.str.5 = [23 x i8] c"Matrix is not square.\0A\00"
@.str.6 = [5 x i8] c"%16c\00"
@.str.7 = [5 x i8] c"%20c\00"
define void @dreadhb(i32* %0, i32* %1, i32* %2, double** %3, i32** %4, i32** %5) {
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca double**
%11 = alloca i32**
%12 = alloca i32**
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca [100 x i8]
%24 = alloca [4 x i8]
%25 = alloca i32*
store i32* %0, i32** %7
store i32* %1, i32** %8
store i32* %2, i32** %9
store double** %3, double*** %10
store i32** %4, i32*** %11
store i32** %5, i32*** %12
store i32 0, i32* %14
store i32 0, i32* %15
%26 = load i32*, i32** @stdin
store i32* %26, i32** %25
%27 = getelementptr inbounds [100 x i8], [100 x i8]* %23, i64 0, i64 0
%28 = load i32*, i32** %25
%29 = call i32 @fgets(i8* %27, i32 100, i32* %28)
%30 = getelementptr inbounds [100 x i8], [100 x i8]* %23, i64 0, i64 0
%31 = load i32, i32* @stdout
%32 = call i32 @fputs(i8* %30, i32 %31)
store i32 0, i32* %13
br label %33
33: ; preds = %56, %6
%34 = load i32, i32* %13
%35 = icmp slt i32 %34, 5
br i1 %35, label %36, label %59
36: ; preds = %33
%37 = load i32*, i32** %25
%38 = getelementptr inbounds [100 x i8], [100 x i8]* %23, i64 0, i64 0
%39 = call i32 @fscanf(i32* %37, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %38)
%40 = getelementptr inbounds [100 x i8], [100 x i8]* %23, i64 0, i64 14
store i8 0, i8* %40
%41 = getelementptr inbounds [100 x i8], [100 x i8]* %23, i64 0, i64 0
%42 = call i32 @sscanf(i8* %41, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %16)
%43 = load i32, i32* %13
%44 = icmp eq i32 %43, 3
br i1 %44, label %45, label %47
45: ; preds = %36
%46 = load i32, i32* %16
store i32 %46, i32* %14
br label %47
47: ; preds = %45, %36
%48 = load i32, i32* %13
%49 = icmp eq i32 %48, 4
br i1 %49, label %50, label %55
50: ; preds = %47
%51 = load i32, i32* %16
%52 = icmp ne i32 %51, 0
br i1 %52, label %53, label %55
53: ; preds = %50
%54 = load i32, i32* %16
store i32 %54, i32* %15
br label %55
55: ; preds = %53, %50, %47
br label %56
56: ; preds = %55
%57 = load i32, i32* %13
%58 = add nsw i32 %57, 1
store i32 %58, i32* %13
br label %33
59: ; preds = %33
%60 = load i32*, i32** %25
%61 = call i32 @dDumpLine(i32* %60)
%62 = load i32*, i32** %25
%63 = getelementptr inbounds [4 x i8], [4 x i8]* %24, i64 0, i64 0
%64 = call i32 @fscanf(i32* %62, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %63)
%65 = load i32*, i32** %25
%66 = getelementptr inbounds [100 x i8], [100 x i8]* %23, i64 0, i64 0
%67 = call i32 @fscanf(i32* %65, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* %66)
%68 = getelementptr inbounds [4 x i8], [4 x i8]* %24, i64 0, i64 3
store i8 0, i8* %68
%69 = load i32*, i32** %25
%70 = getelementptr inbounds [100 x i8], [100 x i8]* %23, i64 0, i64 0
%71 = call i32 @fscanf(i32* %69, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %70)
%72 = getelementptr inbounds [100 x i8], [100 x i8]* %23, i64 0, i64 0
%73 = load i32*, i32** %7
%74 = call i32 @sscanf(i8* %72, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %73)
%75 = load i32*, i32** %25
%76 = getelementptr inbounds [100 x i8], [100 x i8]* %23, i64 0, i64 0
%77 = call i32 @fscanf(i32* %75, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %76)
%78 = getelementptr inbounds [100 x i8], [100 x i8]* %23, i64 0, i64 0
%79 = load i32*, i32** %8
%80 = call i32 @sscanf(i8* %78, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %79)
%81 = load i32*, i32** %25
%82 = getelementptr inbounds [100 x i8], [100 x i8]* %23, i64 0, i64 0
%83 = call i32 @fscanf(i32* %81, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %82)
%84 = getelementptr inbounds [100 x i8], [100 x i8]* %23, i64 0, i64 0
%85 = load i32*, i32** %9
%86 = call i32 @sscanf(i8* %84, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %85)
%87 = load i32*, i32** %25
%88 = getelementptr inbounds [100 x i8], [100 x i8]* %23, i64 0, i64 0
%89 = call i32 @fscanf(i32* %87, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %88)
%90 = getelementptr inbounds [100 x i8], [100 x i8]* %23, i64 0, i64 0
%91 = call i32 @sscanf(i8* %90, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %16)
%92 = load i32, i32* %16
%93 = icmp ne i32 %92, 0
br i1 %93, label %94, label %96
94: ; preds = %59
%95 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0))
br label %96
96: ; preds = %94, %59
%97 = load i32*, i32** %7
%98 = load i32, i32* %97
%99 = load i32*, i32** %8
%100 = load i32, i32* %99
%101 = icmp ne i32 %98, %100
br i1 %101, label %102, label %104
102: ; preds = %96
%103 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0))
br label %104
104: ; preds = %102, %96
%105 = load i32*, i32** %25
%106 = call i32 @dDumpLine(i32* %105)
%107 = load i32*, i32** %8
%108 = load i32, i32* %107
%109 = load i32*, i32** %9
%110 = load i32, i32* %109
%111 = load double**, double*** %10
%112 = load i32**, i32*** %11
%113 = load i32**, i32*** %12
%114 = call i32 @dallocateA(i32 %108, i32 %110, double** %111, i32** %112, i32** %113)
%115 = load i32*, i32** %25
%116 = getelementptr inbounds [100 x i8], [100 x i8]* %23, i64 0, i64 0
%117 = call i32 @fscanf(i32* %115, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i8* %116)
%118 = getelementptr inbounds [100 x i8], [100 x i8]* %23, i64 0, i64 0
%119 = call i32 @dParseIntFormat(i8* %118, i32* %17, i32* %18)
%120 = load i32*, i32** %25
%121 = getelementptr inbounds [100 x i8], [100 x i8]* %23, i64 0, i64 0
%122 = call i32 @fscanf(i32* %120, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i8* %121)
%123 = getelementptr inbounds [100 x i8], [100 x i8]* %23, i64 0, i64 0
%124 = call i32 @dParseIntFormat(i8* %123, i32* %19, i32* %20)
%125 = load i32*, i32** %25
%126 = getelementptr inbounds [100 x i8], [100 x i8]* %23, i64 0, i64 0
%127 = call i32 @fscanf(i32* %125, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i8* %126)
%128 = getelementptr inbounds [100 x i8], [100 x i8]* %23, i64 0, i64 0
%129 = call i32 @dParseFloatFormat(i8* %128, i32* %21, i32* %22)
%130 = load i32*, i32** %25
%131 = getelementptr inbounds [100 x i8], [100 x i8]* %23, i64 0, i64 0
%132 = call i32 @fscanf(i32* %130, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i8* %131)
%133 = load i32*, i32** %25
%134 = call i32 @dDumpLine(i32* %133)
%135 = load i32, i32* %15
%136 = icmp ne i32 %135, 0
br i1 %136, label %137, label %140
137: ; preds = %104
%138 = load i32*, i32** %25
%139 = call i32 @dDumpLine(i32* %138)
br label %140
140: ; preds = %137, %104
%141 = load i32*, i32** %25
%142 = load i32*, i32** %8
%143 = load i32, i32* %142
%144 = add nsw i32 %143, 1
%145 = load i32**, i32*** %12
%146 = load i32*, i32** %145
%147 = load i32, i32* %17
%148 = load i32, i32* %18
%149 = call i32 @dReadVector(i32* %141, i32 %144, i32* %146, i32 %147, i32 %148)
%150 = load i32*, i32** %25
%151 = load i32*, i32** %9
%152 = load i32, i32* %151
%153 = load i32**, i32*** %11
%154 = load i32*, i32** %153
%155 = load i32, i32* %19
%156 = load i32, i32* %20
%157 = call i32 @dReadVector(i32* %150, i32 %152, i32* %154, i32 %155, i32 %156)
%158 = load i32, i32* %14
%159 = icmp ne i32 %158, 0
br i1 %159, label %160, label %169
160: ; preds = %140
%161 = load i32*, i32** %25
%162 = load i32*, i32** %9
%163 = load i32, i32* %162
%164 = load double**, double*** %10
%165 = load double*, double** %164
%166 = load i32, i32* %21
%167 = load i32, i32* %22
%168 = call i32 @dReadValues(i32* %161, i32 %163, double* %165, i32 %166, i32 %167)
br label %169
169: ; preds = %160, %140
%170 = load i32*, i32** %25
%171 = call i32 @fclose(i32* %170)
ret void
}

LLVM IR (-O2):
@stdin = global i32* null
@stdout = global i32 0
@.str = [5 x i8] c"%14c\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [4 x i8] c"%3c\00"
@.str.3 = [5 x i8] c"%11c\00"
@.str.6 = [5 x i8] c"%16c\00"
@.str.7 = [5 x i8] c"%20c\00"
@str = [22 x i8] c"Matrix is not square.\00"
@str.8 = [33 x i8] c"This is not an assembled matrix!\00"
define void @dreadhb(i32* %0, i32* %1, i32* %2, double** %3, i32** %4, i32** %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca [100 x i8]
%15 = alloca [4 x i8]
%16 = bitcast i32* %7 to i8*
%17 = bitcast i32* %8 to i8*
%18 = bitcast i32* %9 to i8*
%19 = bitcast i32* %10 to i8*
%20 = bitcast i32* %11 to i8*
%21 = bitcast i32* %12 to i8*
%22 = bitcast i32* %13 to i8*
%23 = getelementptr inbounds [100 x i8], [100 x i8]* %14, i64 0, i64 0
%24 = getelementptr inbounds [4 x i8], [4 x i8]* %15, i64 0, i64 0
%25 = load i32*, i32** @stdin
%26 = call i32 @fgets(i8* %23, i32 100, i32* %25)
%27 = load i32, i32* @stdout
%28 = call i32 @fputs(i8* %23, i32 %27)
%29 = getelementptr inbounds [100 x i8], [100 x i8]* %14, i64 0, i64 14
%30 = call i32 @fscanf(i32* %25, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %23)
store i8 0, i8* %29
%31 = call i32 @sscanf(i8* %23, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %7)
%32 = call i32 @fscanf(i32* %25, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %23)
store i8 0, i8* %29
%33 = call i32 @sscanf(i8* %23, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %7)
%34 = call i32 @fscanf(i32* %25, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %23)
store i8 0, i8* %29
%35 = call i32 @sscanf(i8* %23, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %7)
%36 = call i32 @fscanf(i32* %25, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %23)
store i8 0, i8* %29
%37 = call i32 @sscanf(i8* %23, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %7)
%38 = load i32, i32* %7
%39 = call i32 @fscanf(i32* %25, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %23)
store i8 0, i8* %29
%40 = call i32 @sscanf(i8* %23, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %7)
%41 = load i32, i32* %7
%42 = call i32 @dDumpLine(i32* %25)
%43 = call i32 @fscanf(i32* %25, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %24)
%44 = call i32 @fscanf(i32* %25, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* %23)
%45 = getelementptr inbounds [4 x i8], [4 x i8]* %15, i64 0, i64 3
store i8 0, i8* %45
%46 = call i32 @fscanf(i32* %25, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %23)
%47 = call i32 @sscanf(i8* %23, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %0)
%48 = call i32 @fscanf(i32* %25, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %23)
%49 = call i32 @sscanf(i8* %23, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%50 = call i32 @fscanf(i32* %25, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %23)
%51 = call i32 @sscanf(i8* %23, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%52 = call i32 @fscanf(i32* %25, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %23)
%53 = call i32 @sscanf(i8* %23, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %7)
%54 = load i32, i32* %7
%55 = icmp eq i32 %54, 0
br i1 %55, label %58, label %56
56: ; preds = %6
%57 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.8, i64 0, i64 0))
br label %58
58: ; preds = %56, %6
%59 = load i32, i32* %0
%60 = load i32, i32* %1
%61 = icmp eq i32 %59, %60
br i1 %61, label %64, label %62
62: ; preds = %58
%63 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
br label %64
64: ; preds = %62, %58
%65 = call i32 @dDumpLine(i32* %25)
%66 = load i32, i32* %1
%67 = load i32, i32* %2
%68 = call i32 @dallocateA(i32 %66, i32 %67, double** %3, i32** %4, i32** %5)
%69 = call i32 @fscanf(i32* %25, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i8* %23)
%70 = call i32 @dParseIntFormat(i8* %23, i32* %8, i32* %9)
%71 = call i32 @fscanf(i32* %25, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i8* %23)
%72 = call i32 @dParseIntFormat(i8* %23, i32* %10, i32* %11)
%73 = call i32 @fscanf(i32* %25, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i8* %23)
%74 = call i32 @dParseFloatFormat(i8* %23, i32* %12, i32* %13)
%75 = call i32 @fscanf(i32* %25, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i8* %23)
%76 = call i32 @dDumpLine(i32* %25)
%77 = icmp eq i32 %41, 0
br i1 %77, label %80, label %78
78: ; preds = %64
%79 = call i32 @dDumpLine(i32* %25)
br label %80
80: ; preds = %78, %64
%81 = load i32, i32* %1
%82 = add nsw i32 %81, 1
%83 = load i32*, i32** %5
%84 = load i32, i32* %8
%85 = load i32, i32* %9
%86 = call i32 @dReadVector(i32* %25, i32 %82, i32* %83, i32 %84, i32 %85)
%87 = load i32, i32* %2
%88 = load i32*, i32** %4
%89 = load i32, i32* %10
%90 = load i32, i32* %11
%91 = call i32 @dReadVector(i32* %25, i32 %87, i32* %88, i32 %89, i32 %90)
%92 = icmp eq i32 %38, 0
br i1 %92, label %99, label %93
93: ; preds = %80
%94 = load i32, i32* %2
%95 = load double*, double** %3
%96 = load i32, i32* %12
%97 = load i32, i32* %13
%98 = call i32 @dReadValues(i32* %25, i32 %94, double* %95, i32 %96, i32 %97)
br label %99
99: ; preds = %93, %80
%100 = call i32 @fclose(i32* %25)
ret void
}