#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*/ dskbcw_(int *, int *);
int /*<<< orphan*/ dskbow_(int *, char *, int *, int *, int *);
int /*<<< orphan*/ dskbw_(int *, char *, int *, int *);
int /*<<< orphan*/ dskbww_(int *, int *);
int filec_getdebug();
int getbo();
int /*<<< orphan*/ gethd(char *, char *, char *);
int /*<<< orphan*/ gethdl(int *, char *);
int /*<<< orphan*/ padhd(char *, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ puthd(char *, char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
int sscanf(char *, char *, int *);
scalar_t__ strcmp(char *, char *);
int strlen(char *);
int wrfile(char *filename, char *head, char *array, int naxis, int *axis,
           int type) {
  int size, lun;
  int lflag;
  int istat;
  char s[80], s1[80];
  int t;
  int headl, j, i;
  int as;
  int filec_debug = filec_getdebug();
  if (filec_debug) {
    printf("Filename      : %s\n", filename);
    printf("Header        : \n%s<END\n", head);
    printf("Array dim     : %d\n", naxis);
    for (i = 0; i < naxis; i++)
      printf("              : %d\n", axis[i]);
    printf("Type          : %d", type);
    if (type == 1)
      printf(" (signed_byte)\n");
    else if (type == 2)
      printf(" (unsigned_byte)\n");
    else if (type == 3)
      printf(" (signed_short)\n");
    else if (type == 4)
      printf(" (unsigned_short)\n");
    else if (type == 5)
      printf(" (signed_long)\n");
    else if (type == 6)
      printf(" (unsigned_long)\n");
    else if (type == 7)
      printf(" (float)\n");
    else if (type == 8)
      printf(" (double)\n");
  }
  as = 1;
  for (i = 0; i < naxis; i++) {
    as *= axis[i];
    sprintf(s1, "SIZE%d", i + 1);
    gethd(s1, s, head);
    if (*s == 0 || sscanf(s, "%d", &t) != 1 || t != axis[i]) {
      sprintf(s, "%4d", axis[i]);
      puthd(s1, s, head);
    }
  }
  gethd("DIM", s, head);
  if (sscanf(s, "%d", &t) != 1 || t != naxis) {
    sprintf(s, "%d", naxis);
    puthd("DIM", s, head);
  }
  gethd("TYPE", s, head);
  if (type == 1 && strcmp(s, "signed_byte"))
    puthd("TYPE", "signed_byte", head);
  else if (type == 2 && strcmp(s, "unsigned_byte"))
    puthd("TYPE", "unsigned_byte", head);
  else if (type == 3 && strcmp(s, "signed_short"))
    puthd("TYPE", "signed_short", head);
  else if (type == 4 && strcmp(s, "unsigned_short"))
    puthd("TYPE", "unsigned_short", head);
  else if (type == 5 && strcmp(s, "signed_long"))
    puthd("TYPE", "signed_long", head);
  else if (type == 6 && strcmp(s, "unsigned_long"))
    puthd("TYPE", "unsigned_long", head);
  else if (type == 7 && strcmp(s, "float"))
    puthd("TYPE", "float", head);
  else if (type == 8 && strcmp(s, "double"))
    puthd("TYPE", "double", head);
  else if (type == 9 && strcmp(s, "complex"))
    puthd("TYPE", "float", head);
  else if (type == 10 && strcmp(s, "double_complex"))
    puthd("TYPE", "double", head);
  gethd("BYTE_ORDER", s, head);
  if (getbo() == 0 && strcmp(s, "little_endian") != 0)
    puthd("BYTE_ORDER", "little_endian", head);
  else if (getbo() == 1 && strcmp(s, "big_endian") != 0)
    puthd("BYTE_ORDER", "big_endian", head);
  istat = 0;
  if (type == 1)
    as *= sizeof(char);
  else if (type == 2)
    as *= sizeof(unsigned char);
  else if (type == 3)
    as *= sizeof(short);
  else if (type == 4)
    as *= sizeof(unsigned short);
  else if (type == 5)
    as *= sizeof(int);
  else if (type == 6)
    as *= sizeof(unsigned int);
  else if (type == 7)
    as *= sizeof(float);
  else if (type == 8)
    as *= sizeof(double);
  else if (type == 9)
    as *= 2 * sizeof(float);
  else if (type == 10)
    as *= 2 * sizeof(double);
  padhd(head, 512);
  gethdl(&headl, head);
  size = headl + as;
  if (filec_debug)
    printf("Updated Header        : \n%s<END\n", head);
  lun = 1;
  if (filec_debug)
    printf("Opening file : %s\n", filename);
  j = strlen(filename);
  dskbow_(&lun, filename, &j, &size, &istat);
  if (istat != 0)
    return (istat);
  lflag = (1 == 0);
  dskbww_(&lun, &lflag);
  dskbw_(&lun, head, &headl, &istat);
  if (istat != 0)
    goto close;
  dskbw_(&lun, (char *)array, &as, &istat);
  if (istat != 0)
    goto close;
  lflag = (1 == 1);
  dskbww_(&lun, &lflag);
close:
  dskbcw_(&lun, &istat);
  return (istat);
}


x86 assembly (clang, -O0):
<wrfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9d,-0x34(%rbp)
mov    $0x0,%al
call   1030 <filec_getdebug@plt>
mov    %eax,-0x108(%rbp)
cmpl   $0x0,-0x108(%rbp)
je     13c6 <wrfile+0x1d6>
mov    -0x10(%rbp),%rsi
lea    0xdc9(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x18(%rbp),%rsi
lea    0xf0a(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x24(%rbp),%esi
lea    0xdba(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x100(%rbp)
mov    -0x100(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    12aa <wrfile+0xba>
mov    -0x30(%rbp),%rax
movslq -0x100(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xd99(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x100(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x100(%rbp)
jmp    126b <wrfile+0x7b>
mov    -0x34(%rbp),%esi
lea    0xd88(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
cmpl   $0x1,-0x34(%rbp)
jne    12d8 <wrfile+0xe8>
lea    0xd83(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    13c1 <wrfile+0x1d1>
cmpl   $0x2,-0x34(%rbp)
jne    12f5 <wrfile+0x105>
lea    0xd76(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    13bc <wrfile+0x1cc>
cmpl   $0x3,-0x34(%rbp)
jne    1312 <wrfile+0x122>
lea    0xd6b(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    13b7 <wrfile+0x1c7>
cmpl   $0x4,-0x34(%rbp)
jne    132f <wrfile+0x13f>
lea    0xd5f(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    13b2 <wrfile+0x1c2>
cmpl   $0x5,-0x34(%rbp)
jne    134c <wrfile+0x15c>
lea    0xd55(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    13ad <wrfile+0x1bd>
cmpl   $0x6,-0x34(%rbp)
jne    1369 <wrfile+0x179>
lea    0xd48(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    13a8 <wrfile+0x1b8>
cmpl   $0x7,-0x34(%rbp)
jne    1386 <wrfile+0x196>
lea    0xd3d(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    13a3 <wrfile+0x1b3>
cmpl   $0x8,-0x34(%rbp)
jne    139e <wrfile+0x1ae>
lea    0xd2a(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    13a3 <wrfile+0x1b3>
jmp    13a8 <wrfile+0x1b8>
jmp    13ad <wrfile+0x1bd>
jmp    13b2 <wrfile+0x1c2>
jmp    13b7 <wrfile+0x1c7>
jmp    13bc <wrfile+0x1cc>
jmp    13c1 <wrfile+0x1d1>
jmp    13c6 <wrfile+0x1d6>
movl   $0x1,-0x104(%rbp)
movl   $0x0,-0x100(%rbp)
mov    -0x100(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    14d5 <wrfile+0x2e5>
mov    -0x30(%rbp),%rax
movslq -0x100(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
imul   -0x104(%rbp),%eax
mov    %eax,-0x104(%rbp)
lea    -0xf0(%rbp),%rdi
mov    -0x100(%rbp),%edx
add    $0x1,%edx
lea    0xcb1(%rip),%rsi
call   1100 <sprintf@plt>
lea    -0xf0(%rbp),%rdi
lea    -0xa0(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   10c0 <gethd@plt>
movsbl -0xa0(%rbp),%eax
cmp    $0x0,%eax
je     1484 <wrfile+0x294>
lea    -0xa0(%rbp),%rdi
lea    0xbf7(%rip),%rsi
lea    -0xf4(%rbp),%rdx
call   10b0 <sscanf@plt>
cmp    $0x1,%eax
jne    1484 <wrfile+0x294>
mov    -0xf4(%rbp),%eax
mov    -0x30(%rbp),%rcx
movslq -0x100(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
je     14bc <wrfile+0x2cc>
lea    -0xa0(%rbp),%rdi
mov    -0x30(%rbp),%rax
movslq -0x100(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xc33(%rip),%rsi
call   1100 <sprintf@plt>
lea    -0xf0(%rbp),%rdi
lea    -0xa0(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1070 <puthd@plt>
jmp    14c1 <wrfile+0x2d1>
mov    -0x100(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x100(%rbp)
jmp    13da <wrfile+0x1ea>
lea    -0xa0(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xbf0(%rip),%rdi
call   10c0 <gethd@plt>
lea    -0xa0(%rbp),%rdi
lea    0xb52(%rip),%rsi
lea    -0xf4(%rbp),%rdx
call   10b0 <sscanf@plt>
cmp    $0x1,%eax
jne    151e <wrfile+0x32e>
mov    -0xf4(%rbp),%eax
cmp    -0x24(%rbp),%eax
je     154b <wrfile+0x35b>
lea    -0xa0(%rbp),%rdi
mov    -0x24(%rbp),%edx
lea    0xb1d(%rip),%rsi
call   1100 <sprintf@plt>
lea    -0xa0(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xb91(%rip),%rdi
call   1070 <puthd@plt>
lea    -0xa0(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xb7e(%rip),%rdi
call   10c0 <gethd@plt>
cmpl   $0x1,-0x34(%rbp)
jne    15a5 <wrfile+0x3b5>
lea    -0xa0(%rbp),%rdi
lea    0xb68(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
je     15a5 <wrfile+0x3b5>
mov    -0x18(%rbp),%rdx
lea    0xb47(%rip),%rdi
lea    0xb47(%rip),%rsi
call   1070 <puthd@plt>
jmp    1828 <wrfile+0x638>
cmpl   $0x2,-0x34(%rbp)
jne    15e8 <wrfile+0x3f8>
lea    -0xa0(%rbp),%rdi
lea    0xb23(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
je     15e8 <wrfile+0x3f8>
mov    -0x18(%rbp),%rdx
lea    0xb04(%rip),%rdi
lea    0xb02(%rip),%rsi
call   1070 <puthd@plt>
jmp    1823 <wrfile+0x633>
cmpl   $0x3,-0x34(%rbp)
jne    162b <wrfile+0x43b>
lea    -0xa0(%rbp),%rdi
lea    0xaf0(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
je     162b <wrfile+0x43b>
mov    -0x18(%rbp),%rdx
lea    0xac1(%rip),%rdi
lea    0xacf(%rip),%rsi
call   1070 <puthd@plt>
jmp    181e <wrfile+0x62e>
cmpl   $0x4,-0x34(%rbp)
jne    166e <wrfile+0x47e>
lea    -0xa0(%rbp),%rdi
lea    0xaab(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
je     166e <wrfile+0x47e>
mov    -0x18(%rbp),%rdx
lea    0xa7e(%rip),%rdi
lea    0xa8a(%rip),%rsi
call   1070 <puthd@plt>
jmp    1819 <wrfile+0x629>
cmpl   $0x5,-0x34(%rbp)
jne    16b1 <wrfile+0x4c1>
lea    -0xa0(%rbp),%rdi
lea    0xa79(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
je     16b1 <wrfile+0x4c1>
mov    -0x18(%rbp),%rdx
lea    0xa3b(%rip),%rdi
lea    0xa58(%rip),%rsi
call   1070 <puthd@plt>
jmp    1814 <wrfile+0x624>
cmpl   $0x6,-0x34(%rbp)
jne    16f4 <wrfile+0x504>
lea    -0xa0(%rbp),%rdi
lea    0xa34(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
je     16f4 <wrfile+0x504>
mov    -0x18(%rbp),%rdx
lea    0x9f8(%rip),%rdi
lea    0xa13(%rip),%rsi
call   1070 <puthd@plt>
jmp    180f <wrfile+0x61f>
cmpl   $0x7,-0x34(%rbp)
jne    1737 <wrfile+0x547>
lea    -0xa0(%rbp),%rdi
lea    0x9ff(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
je     1737 <wrfile+0x547>
mov    -0x18(%rbp),%rdx
lea    0x9b5(%rip),%rdi
lea    0x9de(%rip),%rsi
call   1070 <puthd@plt>
jmp    180a <wrfile+0x61a>
cmpl   $0x8,-0x34(%rbp)
jne    177a <wrfile+0x58a>
lea    -0xa0(%rbp),%rdi
lea    0x9c2(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
je     177a <wrfile+0x58a>
mov    -0x18(%rbp),%rdx
lea    0x972(%rip),%rdi
lea    0x9a1(%rip),%rsi
call   1070 <puthd@plt>
jmp    1805 <wrfile+0x615>
cmpl   $0x9,-0x34(%rbp)
jne    17bd <wrfile+0x5cd>
lea    -0xa0(%rbp),%rdi
lea    0x98d(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
je     17bd <wrfile+0x5cd>
mov    -0x18(%rbp),%rdx
lea    0x92f(%rip),%rdi
lea    0x958(%rip),%rsi
call   1070 <puthd@plt>
jmp    1800 <wrfile+0x610>
cmpl   $0xa,-0x34(%rbp)
jne    17fb <wrfile+0x60b>
lea    -0xa0(%rbp),%rdi
lea    0x943(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
je     17fb <wrfile+0x60b>
mov    -0x18(%rbp),%rdx
lea    0x8ec(%rip),%rdi
lea    0x91b(%rip),%rsi
call   1070 <puthd@plt>
jmp    1800 <wrfile+0x610>
jmp    1805 <wrfile+0x615>
jmp    180a <wrfile+0x61a>
jmp    180f <wrfile+0x61f>
jmp    1814 <wrfile+0x624>
jmp    1819 <wrfile+0x629>
jmp    181e <wrfile+0x62e>
jmp    1823 <wrfile+0x633>
jmp    1828 <wrfile+0x638>
lea    -0xa0(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0x8ed(%rip),%rdi
call   10c0 <gethd@plt>
mov    $0x0,%al
call   10e0 <getbo@plt>
cmp    $0x0,%eax
jne    1888 <wrfile+0x698>
lea    -0xa0(%rbp),%rdi
lea    0x8d5(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
je     1888 <wrfile+0x698>
mov    -0x18(%rbp),%rdx
lea    0x8b0(%rip),%rdi
lea    0x8b4(%rip),%rsi
call   1070 <puthd@plt>
jmp    18d1 <wrfile+0x6e1>
mov    $0x0,%al
call   10e0 <getbo@plt>
cmp    $0x1,%eax
jne    18cc <wrfile+0x6dc>
lea    -0xa0(%rbp),%rdi
lea    0x89a(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
je     18cc <wrfile+0x6dc>
mov    -0x18(%rbp),%rdx
lea    0x867(%rip),%rdi
lea    0x879(%rip),%rsi
call   1070 <puthd@plt>
jmp    18d1 <wrfile+0x6e1>
movl   $0x0,-0x44(%rbp)
cmpl   $0x1,-0x34(%rbp)
jne    18f8 <wrfile+0x708>
movslq -0x104(%rbp),%rax
shl    $0x0,%rax
mov    %eax,-0x104(%rbp)
jmp    1a40 <wrfile+0x850>
cmpl   $0x2,-0x34(%rbp)
jne    1918 <wrfile+0x728>
movslq -0x104(%rbp),%rax
shl    $0x0,%rax
mov    %eax,-0x104(%rbp)
jmp    1a3b <wrfile+0x84b>
cmpl   $0x3,-0x34(%rbp)
jne    1938 <wrfile+0x748>
movslq -0x104(%rbp),%rax
shl    $0x1,%rax
mov    %eax,-0x104(%rbp)
jmp    1a36 <wrfile+0x846>
cmpl   $0x4,-0x34(%rbp)
jne    1958 <wrfile+0x768>
movslq -0x104(%rbp),%rax
shl    $0x1,%rax
mov    %eax,-0x104(%rbp)
jmp    1a31 <wrfile+0x841>
cmpl   $0x5,-0x34(%rbp)
jne    1978 <wrfile+0x788>
movslq -0x104(%rbp),%rax
shl    $0x2,%rax
mov    %eax,-0x104(%rbp)
jmp    1a2c <wrfile+0x83c>
cmpl   $0x6,-0x34(%rbp)
jne    1998 <wrfile+0x7a8>
movslq -0x104(%rbp),%rax
shl    $0x2,%rax
mov    %eax,-0x104(%rbp)
jmp    1a27 <wrfile+0x837>
cmpl   $0x7,-0x34(%rbp)
jne    19b8 <wrfile+0x7c8>
movslq -0x104(%rbp),%rax
shl    $0x2,%rax
mov    %eax,-0x104(%rbp)
jmp    1a22 <wrfile+0x832>
cmpl   $0x8,-0x34(%rbp)
jne    19d8 <wrfile+0x7e8>
movslq -0x104(%rbp),%rax
shl    $0x3,%rax
mov    %eax,-0x104(%rbp)
jmp    1a1d <wrfile+0x82d>
cmpl   $0x9,-0x34(%rbp)
jne    19f8 <wrfile+0x808>
movslq -0x104(%rbp),%rax
shl    $0x3,%rax
mov    %eax,-0x104(%rbp)
jmp    1a18 <wrfile+0x828>
cmpl   $0xa,-0x34(%rbp)
jne    1a13 <wrfile+0x823>
movslq -0x104(%rbp),%rax
shl    $0x4,%rax
mov    %eax,-0x104(%rbp)
jmp    1a18 <wrfile+0x828>
jmp    1a1d <wrfile+0x82d>
jmp    1a22 <wrfile+0x832>
jmp    1a27 <wrfile+0x837>
jmp    1a2c <wrfile+0x83c>
jmp    1a31 <wrfile+0x841>
jmp    1a36 <wrfile+0x846>
jmp    1a3b <wrfile+0x84b>
jmp    1a40 <wrfile+0x850>
mov    -0x18(%rbp),%rdi
mov    $0x200,%esi
call   10f0 <padhd@plt>
mov    -0x18(%rbp),%rsi
lea    -0xf8(%rbp),%rdi
call   10d0 <gethdl@plt>
mov    -0xf8(%rbp),%eax
add    -0x104(%rbp),%eax
mov    %eax,-0x38(%rbp)
cmpl   $0x0,-0x108(%rbp)
je     1a8c <wrfile+0x89c>
mov    -0x18(%rbp),%rsi
lea    0x6c6(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x1,-0x3c(%rbp)
cmpl   $0x0,-0x108(%rbp)
je     1ab2 <wrfile+0x8c2>
mov    -0x10(%rbp),%rsi
lea    0x6c1(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0xfc(%rbp)
mov    -0x10(%rbp),%rsi
lea    -0x3c(%rbp),%rdi
lea    -0xfc(%rbp),%rdx
lea    -0x38(%rbp),%rcx
lea    -0x44(%rbp),%r8
call   1050 <dskbow_@plt>
cmpl   $0x0,-0x44(%rbp)
je     1af2 <wrfile+0x902>
mov    -0x44(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1b7b <wrfile+0x98b>
movl   $0x0,-0x40(%rbp)
lea    -0x3c(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   10a0 <dskbww_@plt>
mov    -0x18(%rbp),%rsi
lea    -0x3c(%rbp),%rdi
lea    -0xf8(%rbp),%rdx
lea    -0x44(%rbp),%rcx
call   1110 <dskbw_@plt>
cmpl   $0x0,-0x44(%rbp)
je     1b2d <wrfile+0x93d>
jmp    1b68 <wrfile+0x978>
mov    -0x20(%rbp),%rsi
lea    -0x3c(%rbp),%rdi
lea    -0x104(%rbp),%rdx
lea    -0x44(%rbp),%rcx
call   1110 <dskbw_@plt>
cmpl   $0x0,-0x44(%rbp)
je     1b54 <wrfile+0x964>
jmp    1b68 <wrfile+0x978>
movl   $0x1,-0x40(%rbp)
lea    -0x3c(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   10a0 <dskbww_@plt>
lea    -0x3c(%rbp),%rdi
lea    -0x44(%rbp),%rsi
call   1090 <dskbcw_@plt>
mov    -0x44(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrfile>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xe8,%rsp
mov    %r9,0x30(%rsp)
mov    %r8,%r14
mov    %ecx,%ebp
mov    %rdx,0x38(%rsp)
mov    %rsi,%r12
mov    %rdi,%r13
xor    %eax,%eax
call   1030 <filec_getdebug@plt>
mov    %ebp,%r15d
mov    %eax,0x1c(%rsp)
test   %eax,%eax
mov    %ebp,0x14(%rsp)
je     12cd <wrfile+0xcd>
lea    0xe1d(%rip),%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xee2(%rip),%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xe0f(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1070 <printf@plt>
test   %ebp,%ebp
jle    1297 <wrfile+0x97>
lea    0xe0f(%rip),%rbx
xor    %ebp,%ebp
nop
mov    (%r14,%rbp,4),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
add    $0x1,%rbp
cmp    %rbp,%r15
jne    1280 <wrfile+0x80>
lea    0xe02(%rip),%rdi
mov    0x30(%rsp),%rbx
mov    %ebx,%esi
xor    %eax,%eax
call   1070 <printf@plt>
lea    -0x1(%rbx),%eax
cmp    $0x7,%eax
mov    0x14(%rsp),%ebp
ja     12cd <wrfile+0xcd>
cltq
lea    0xd83(%rip),%rcx
movslq (%rcx,%rax,4),%rdi
add    %rcx,%rdi
call   1040 <puts@plt>
mov    %r13,0x28(%rsp)
mov    %r12,%rbx
movl   $0x1,(%rsp)
test   %ebp,%ebp
jle    1393 <wrfile+0x193>
mov    $0x1,%eax
mov    $0x1,%r12d
lea    0x90(%rsp),%r13
lea    0x40(%rsp),%rbp
nopl   0x0(%rax)
imul   -0x4(%r14,%r12,4),%eax
mov    %eax,(%rsp)
mov    %r13,%rdi
lea    0xda0(%rip),%rsi
mov    %r12d,%edx
call   1110 <sprintf@plt>
mov    %r13,%rdi
mov    %rbp,%rsi
mov    %rbx,%rdx
call   10d0 <gethd@plt>
cmpb   $0x0,0x40(%rsp)
je     1360 <wrfile+0x160>
mov    %rbp,%rdi
lea    0xd76(%rip),%rsi
lea    0xc(%rsp),%rdx
call   10c0 <sscanf@plt>
cmp    $0x1,%eax
jne    1360 <wrfile+0x160>
mov    0xc(%rsp),%eax
cmp    -0x4(%r14,%r12,4),%eax
je     1382 <wrfile+0x182>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    -0x4(%r14,%r12,4),%edx
mov    %rbp,%rdi
lea    0xd4b(%rip),%rsi
call   1110 <sprintf@plt>
mov    %r13,%rdi
mov    %rbp,%rsi
mov    %rbx,%rdx
call   1080 <puthd@plt>
cmp    %r12,%r15
je     1393 <wrfile+0x193>
mov    (%rsp),%eax
add    $0x1,%r12
jmp    1300 <wrfile+0x100>
lea    0xd24(%rip),%rdi
lea    0x40(%rsp),%rbp
mov    %rbp,%rsi
mov    %rbx,%r14
mov    %rbx,%rdx
call   10d0 <gethd@plt>
lea    0xcfc(%rip),%rsi
lea    0xc(%rsp),%rdx
mov    %rbp,%rdi
call   10c0 <sscanf@plt>
cmp    $0x1,%eax
mov    0x14(%rsp),%edx
jne    13d0 <wrfile+0x1d0>
cmp    %edx,0xc(%rsp)
je     13f6 <wrfile+0x1f6>
lea    0xcd9(%rip),%rsi
lea    0x40(%rsp),%rbx
mov    %rbx,%rdi
call   1110 <sprintf@plt>
lea    0xcd3(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1080 <puthd@plt>
lea    0xcc5(%rip),%rdi
lea    0x40(%rsp),%rsi
mov    %r14,%rdx
call   10d0 <gethd@plt>
mov    0x30(%rsp),%rbp
cmp    $0x1,%ebp
jne    1434 <wrfile+0x234>
lea    0xcae(%rip),%rbx
lea    0x40(%rsp),%rdi
mov    %rbx,%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
mov    0x28(%rsp),%r15
jne    14a0 <wrfile+0x2a0>
jmp    14b2 <wrfile+0x2b2>
lea    -0x2(%rbp),%eax
cmp    $0x8,%eax
mov    0x28(%rsp),%r15
ja     14b2 <wrfile+0x2b2>
lea    0xbb8(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xc6f(%rip),%rbx
jmp    148e <wrfile+0x28e>
lea    0xc76(%rip),%rbx
jmp    148e <wrfile+0x28e>
lea    0xc6b(%rip),%rbx
jmp    148e <wrfile+0x28e>
lea    0xc73(%rip),%rbx
jmp    148e <wrfile+0x28e>
lea    0xc68(%rip),%rbx
jmp    148e <wrfile+0x28e>
lea    0xc6d(%rip),%rbx
jmp    148e <wrfile+0x28e>
lea    0xc6a(%rip),%rbx
lea    0x40(%rsp),%rdi
mov    %rbx,%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
je     14b2 <wrfile+0x2b2>
lea    0xc1b(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1080 <puthd@plt>
lea    0xc55(%rip),%rdi
lea    0x40(%rsp),%rsi
mov    %r14,%rdx
call   10d0 <gethd@plt>
xor    %eax,%eax
call   10f0 <getbo@plt>
test   %eax,%eax
je     14f8 <wrfile+0x2f8>
xor    %eax,%eax
call   10f0 <getbo@plt>
cmp    $0x1,%eax
jne    1523 <wrfile+0x323>
lea    0xc43(%rip),%rbx
lea    0x40(%rsp),%rdi
mov    %rbx,%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
jne    1511 <wrfile+0x311>
jmp    1523 <wrfile+0x323>
lea    0xc1a(%rip),%rbx
lea    0x40(%rsp),%rdi
mov    %rbx,%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
je     14d1 <wrfile+0x2d1>
lea    0xbf6(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1080 <puthd@plt>
movl   $0x0,0x4(%rsp)
cmp    $0x1,%ebp
je     155d <wrfile+0x35d>
add    $0xfffffffd,%ebp
cmp    $0x7,%ebp
ja     155d <wrfile+0x35d>
lea    0xae5(%rip),%rax
movslq (%rax,%rbp,4),%rcx
add    %rax,%rcx
jmp    *%rcx
shll   $0x2,(%rsp)
jmp    155d <wrfile+0x35d>
shll   (%rsp)
jmp    155d <wrfile+0x35d>
shll   $0x3,(%rsp)
jmp    155d <wrfile+0x35d>
shll   $0x4,(%rsp)
mov    %r14,%rdi
mov    $0x200,%esi
call   1100 <padhd@plt>
lea    0x18(%rsp),%rdi
mov    %r14,%rsi
call   10e0 <gethdl@plt>
mov    (%rsp),%eax
add    0x18(%rsp),%eax
mov    %eax,0x24(%rsp)
cmpl   $0x0,0x1c(%rsp)
je     15b5 <wrfile+0x3b5>
lea    0xba2(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
movl   $0x1,0x8(%rsp)
lea    0xbaa(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
jmp    15bd <wrfile+0x3bd>
movl   $0x1,0x8(%rsp)
mov    %r15,%rdi
call   1050 <strlen@plt>
mov    %eax,0x20(%rsp)
lea    0x8(%rsp),%rdi
lea    0x20(%rsp),%rdx
lea    0x24(%rsp),%rcx
lea    0x4(%rsp),%r8
mov    %r15,%rsi
call   1060 <dskbow_@plt>
mov    0x4(%rsp),%eax
test   %eax,%eax
jne    166b <wrfile+0x46b>
movl   $0x0,0x10(%rsp)
lea    0x8(%rsp),%rbx
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   10b0 <dskbww_@plt>
lea    0x18(%rsp),%rdx
lea    0x4(%rsp),%rcx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1120 <dskbw_@plt>
cmpl   $0x0,0x4(%rsp)
jne    1658 <wrfile+0x458>
lea    0x8(%rsp),%rdi
mov    %rsp,%rdx
lea    0x4(%rsp),%rcx
mov    0x38(%rsp),%rsi
call   1120 <dskbw_@plt>
cmpl   $0x0,0x4(%rsp)
jne    1658 <wrfile+0x458>
movl   $0x1,0x10(%rsp)
lea    0x8(%rsp),%rdi
lea    0x10(%rsp),%rsi
call   10b0 <dskbww_@plt>
lea    0x8(%rsp),%rdi
lea    0x4(%rsp),%rsi
call   10a0 <dskbcw_@plt>
mov    0x4(%rsp),%eax
add    $0xe8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xa82(%rip),%rsi
lea    0x40(%rsp),%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
je     14b2 <wrfile+0x2b2>
lea    0xa54(%rip),%rbx
jmp    14a0 <wrfile+0x2a0>
lea    0xa55(%rip),%rsi
lea    0x40(%rsp),%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
je     14b2 <wrfile+0x2b2>
lea    0xa34(%rip),%rbx
jmp    14a0 <wrfile+0x2a0>

LLVM IR (-O0):
@.str = [20 x i8] c"Filename : %s\0A\00"
@.str.1 = [25 x i8] c"Header : \0A%s<END\0A\00"
@.str.2 = [20 x i8] c"Array dim : %d\0A\00"
@.str.3 = [20 x i8] c" : %d\0A\00"
@.str.4 = [19 x i8] c"Type : %d\00"
@.str.5 = [16 x i8] c" (signed_byte)\0A\00"
@.str.6 = [18 x i8] c" (unsigned_byte)\0A\00"
@.str.7 = [17 x i8] c" (signed_short)\0A\00"
@.str.8 = [19 x i8] c" (unsigned_short)\0A\00"
@.str.9 = [16 x i8] c" (signed_long)\0A\00"
@.str.10 = [18 x i8] c" (unsigned_long)\0A\00"
@.str.11 = [10 x i8] c" (float)\0A\00"
@.str.12 = [11 x i8] c" (double)\0A\00"
@.str.13 = [7 x i8] c"SIZE%d\00"
@.str.14 = [3 x i8] c"%d\00"
@.str.15 = [4 x i8] c"%4d\00"
@.str.16 = [4 x i8] c"DIM\00"
@.str.17 = [5 x i8] c"TYPE\00"
@.str.18 = [12 x i8] c"signed_byte\00"
@.str.19 = [14 x i8] c"unsigned_byte\00"
@.str.20 = [13 x i8] c"signed_short\00"
@.str.21 = [15 x i8] c"unsigned_short\00"
@.str.22 = [12 x i8] c"signed_long\00"
@.str.23 = [14 x i8] c"unsigned_long\00"
@.str.24 = [6 x i8] c"float\00"
@.str.25 = [7 x i8] c"double\00"
@.str.26 = [8 x i8] c"complex\00"
@.str.27 = [15 x i8] c"double_complex\00"
@.str.28 = [11 x i8] c"BYTE_ORDER\00"
@.str.29 = [14 x i8] c"little_endian\00"
@.str.30 = [11 x i8] c"big_endian\00"
@.str.31 = [33 x i8] c"Updated Header : \0A%s<END\0A\00"
@.str.32 = [19 x i8] c"Opening file : %s\0A\00"
define i32 @wrfile(i8* %0, i8* %1, i8* %2, i32 %3, i32* %4, i32 %5) {
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i32*
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca [80 x i8]
%19 = alloca [80 x i8]
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
store i8* %0, i8** %8
store i8* %1, i8** %9
store i8* %2, i8** %10
store i32 %3, i32* %11
store i32* %4, i32** %12
store i32 %5, i32* %13
%26 = call i32 (...) @filec_getdebug()
store i32 %26, i32* %25
%27 = load i32, i32* %25
%28 = icmp ne i32 %27, 0
br i1 %28, label %29, label %100
29: ; preds = %6
%30 = load i8*, i8** %8
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %30)
%32 = load i8*, i8** %9
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* %32)
%34 = load i32, i32* %11
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %34)
store i32 0, i32* %23
br label %36
36: ; preds = %47, %29
%37 = load i32, i32* %23
%38 = load i32, i32* %11
%39 = icmp slt i32 %37, %38
br i1 %39, label %40, label %50
40: ; preds = %36
%41 = load i32*, i32** %12
%42 = load i32, i32* %23
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds i32, i32* %41, i64 %43
%45 = load i32, i32* %44
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i32 %45)
br label %47
47: ; preds = %40
%48 = load i32, i32* %23
%49 = add nsw i32 %48, 1
store i32 %49, i32* %23
br label %36
50: ; preds = %36
%51 = load i32, i32* %13
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i32 %51)
%53 = load i32, i32* %13
%54 = icmp eq i32 %53, 1
br i1 %54, label %55, label %57
55: ; preds = %50
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0))
br label %99
57: ; preds = %50
%58 = load i32, i32* %13
%59 = icmp eq i32 %58, 2
br i1 %59, label %60, label %62
60: ; preds = %57
%61 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0))
br label %98
62: ; preds = %57
%63 = load i32, i32* %13
%64 = icmp eq i32 %63, 3
br i1 %64, label %65, label %67
65: ; preds = %62
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0))
br label %97
67: ; preds = %62
%68 = load i32, i32* %13
%69 = icmp eq i32 %68, 4
br i1 %69, label %70, label %72
70: ; preds = %67
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0))
br label %96
72: ; preds = %67
%73 = load i32, i32* %13
%74 = icmp eq i32 %73, 5
br i1 %74, label %75, label %77
75: ; preds = %72
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0))
br label %95
77: ; preds = %72
%78 = load i32, i32* %13
%79 = icmp eq i32 %78, 6
br i1 %79, label %80, label %82
80: ; preds = %77
%81 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.10, i64 0, i64 0))
br label %94
82: ; preds = %77
%83 = load i32, i32* %13
%84 = icmp eq i32 %83, 7
br i1 %84, label %85, label %87
85: ; preds = %82
%86 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i64 0, i64 0))
br label %93
87: ; preds = %82
%88 = load i32, i32* %13
%89 = icmp eq i32 %88, 8
br i1 %89, label %90, label %92
90: ; preds = %87
%91 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.12, i64 0, i64 0))
br label %92
92: ; preds = %90, %87
br label %93
93: ; preds = %92, %85
br label %94
94: ; preds = %93, %80
br label %95
95: ; preds = %94, %75
br label %96
96: ; preds = %95, %70
br label %97
97: ; preds = %96, %65
br label %98
98: ; preds = %97, %60
br label %99
99: ; preds = %98, %55
br label %100
100: ; preds = %99, %6
store i32 1, i32* %24
store i32 0, i32* %23
br label %101
101: ; preds = %150, %100
%102 = load i32, i32* %23
%103 = load i32, i32* %11
%104 = icmp slt i32 %102, %103
br i1 %104, label %105, label %153
105: ; preds = %101
%106 = load i32*, i32** %12
%107 = load i32, i32* %23
%108 = sext i32 %107 to i64
%109 = getelementptr inbounds i32, i32* %106, i64 %108
%110 = load i32, i32* %109
%111 = load i32, i32* %24
%112 = mul nsw i32 %111, %110
store i32 %112, i32* %24
%113 = getelementptr inbounds [80 x i8], [80 x i8]* %19, i64 0, i64 0
%114 = load i32, i32* %23
%115 = add nsw i32 %114, 1
%116 = call i32 @sprintf(i8* %113, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.13, i64 0, i64 0), i32 %115)
%117 = getelementptr inbounds [80 x i8], [80 x i8]* %19, i64 0, i64 0
%118 = getelementptr inbounds [80 x i8], [80 x i8]* %18, i64 0, i64 0
%119 = load i8*, i8** %9
%120 = call i32 @gethd(i8* %117, i8* %118, i8* %119)
%121 = getelementptr inbounds [80 x i8], [80 x i8]* %18, i64 0, i64 0
%122 = load i8, i8* %121
%123 = sext i8 %122 to i32
%124 = icmp eq i32 %123, 0
br i1 %124, label %137, label %125
125: ; preds = %105
%126 = getelementptr inbounds [80 x i8], [80 x i8]* %18, i64 0, i64 0
%127 = call i32 @sscanf(i8* %126, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0), i32* %20)
%128 = icmp ne i32 %127, 1
br i1 %128, label %137, label %129
129: ; preds = %125
%130 = load i32, i32* %20
%131 = load i32*, i32** %12
%132 = load i32, i32* %23
%133 = sext i32 %132 to i64
%134 = getelementptr inbounds i32, i32* %131, i64 %133
%135 = load i32, i32* %134
%136 = icmp ne i32 %130, %135
br i1 %136, label %137, label %149
137: ; preds = %129, %125, %105
%138 = getelementptr inbounds [80 x i8], [80 x i8]* %18, i64 0, i64 0
%139 = load i32*, i32** %12
%140 = load i32, i32* %23
%141 = sext i32 %140 to i64
%142 = getelementptr inbounds i32, i32* %139, i64 %141
%143 = load i32, i32* %142
%144 = call i32 @sprintf(i8* %138, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), i32 %143)
%145 = getelementptr inbounds [80 x i8], [80 x i8]* %19, i64 0, i64 0
%146 = getelementptr inbounds [80 x i8], [80 x i8]* %18, i64 0, i64 0
%147 = load i8*, i8** %9
%148 = call i32 @puthd(i8* %145, i8* %146, i8* %147)
br label %149
149: ; preds = %137, %129
br label %150
150: ; preds = %149
%151 = load i32, i32* %23
%152 = add nsw i32 %151, 1
store i32 %152, i32* %23
br label %101
153: ; preds = %101
%154 = getelementptr inbounds [80 x i8], [80 x i8]* %18, i64 0, i64 0
%155 = load i8*, i8** %9
%156 = call i32 @gethd(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i64 0, i64 0), i8* %154, i8* %155)
%157 = getelementptr inbounds [80 x i8], [80 x i8]* %18, i64 0, i64 0
%158 = call i32 @sscanf(i8* %157, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0), i32* %20)
%159 = icmp ne i32 %158, 1
br i1 %159, label %164, label %160
160: ; preds = %153
%161 = load i32, i32* %20
%162 = load i32, i32* %11
%163 = icmp ne i32 %161, %162
br i1 %163, label %164, label %171
164: ; preds = %160, %153
%165 = getelementptr inbounds [80 x i8], [80 x i8]* %18, i64 0, i64 0
%166 = load i32, i32* %11
%167 = call i32 @sprintf(i8* %165, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0), i32 %166)
%168 = getelementptr inbounds [80 x i8], [80 x i8]* %18, i64 0, i64 0
%169 = load i8*, i8** %9
%170 = call i32 @puthd(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i64 0, i64 0), i8* %168, i8* %169)
br label %171
171: ; preds = %164, %160
%172 = getelementptr inbounds [80 x i8], [80 x i8]* %18, i64 0, i64 0
%173 = load i8*, i8** %9
%174 = call i32 @gethd(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.17, i64 0, i64 0), i8* %172, i8* %173)
%175 = load i32, i32* %13
%176 = icmp eq i32 %175, 1
br i1 %176, label %177, label %184
177: ; preds = %171
%178 = getelementptr inbounds [80 x i8], [80 x i8]* %18, i64 0, i64 0
%179 = call i64 @strcmp(i8* %178, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.18, i64 0, i64 0))
%180 = icmp ne i64 %179, 0
br i1 %180, label %181, label %184
181: ; preds = %177
%182 = load i8*, i8** %9
%183 = call i32 @puthd(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.18, i64 0, i64 0), i8* %182)
br label %283
184: ; preds = %177, %171
%185 = load i32, i32* %13
%186 = icmp eq i32 %185, 2
br i1 %186, label %187, label %194
187: ; preds = %184
%188 = getelementptr inbounds [80 x i8], [80 x i8]* %18, i64 0, i64 0
%189 = call i64 @strcmp(i8* %188, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.19, i64 0, i64 0))
%190 = icmp ne i64 %189, 0
br i1 %190, label %191, label %194
191: ; preds = %187
%192 = load i8*, i8** %9
%193 = call i32 @puthd(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.19, i64 0, i64 0), i8* %192)
br label %282
194: ; preds = %187, %184
%195 = load i32, i32* %13
%196 = icmp eq i32 %195, 3
br i1 %196, label %197, label %204
197: ; preds = %194
%198 = getelementptr inbounds [80 x i8], [80 x i8]* %18, i64 0, i64 0
%199 = call i64 @strcmp(i8* %198, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.20, i64 0, i64 0))
%200 = icmp ne i64 %199, 0
br i1 %200, label %201, label %204
201: ; preds = %197
%202 = load i8*, i8** %9
%203 = call i32 @puthd(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.20, i64 0, i64 0), i8* %202)
br label %281
204: ; preds = %197, %194
%205 = load i32, i32* %13
%206 = icmp eq i32 %205, 4
br i1 %206, label %207, label %214
207: ; preds = %204
%208 = getelementptr inbounds [80 x i8], [80 x i8]* %18, i64 0, i64 0
%209 = call i64 @strcmp(i8* %208, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.21, i64 0, i64 0))
%210 = icmp ne i64 %209, 0
br i1 %210, label %211, label %214
211: ; preds = %207
%212 = load i8*, i8** %9
%213 = call i32 @puthd(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.21, i64 0, i64 0), i8* %212)
br label %280
214: ; preds = %207, %204
%215 = load i32, i32* %13
%216 = icmp eq i32 %215, 5
br i1 %216, label %217, label %224
217: ; preds = %214
%218 = getelementptr inbounds [80 x i8], [80 x i8]* %18, i64 0, i64 0
%219 = call i64 @strcmp(i8* %218, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.22, i64 0, i64 0))
%220 = icmp ne i64 %219, 0
br i1 %220, label %221, label %224
221: ; preds = %217
%222 = load i8*, i8** %9
%223 = call i32 @puthd(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.22, i64 0, i64 0), i8* %222)
br label %279
224: ; preds = %217, %214
%225 = load i32, i32* %13
%226 = icmp eq i32 %225, 6
br i1 %226, label %227, label %234
227: ; preds = %224
%228 = getelementptr inbounds [80 x i8], [80 x i8]* %18, i64 0, i64 0
%229 = call i64 @strcmp(i8* %228, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.23, i64 0, i64 0))
%230 = icmp ne i64 %229, 0
br i1 %230, label %231, label %234
231: ; preds = %227
%232 = load i8*, i8** %9
%233 = call i32 @puthd(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.23, i64 0, i64 0), i8* %232)
br label %278
234: ; preds = %227, %224
%235 = load i32, i32* %13
%236 = icmp eq i32 %235, 7
br i1 %236, label %237, label %244
237: ; preds = %234
%238 = getelementptr inbounds [80 x i8], [80 x i8]* %18, i64 0, i64 0
%239 = call i64 @strcmp(i8* %238, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.24, i64 0, i64 0))
%240 = icmp ne i64 %239, 0
br i1 %240, label %241, label %244
241: ; preds = %237
%242 = load i8*, i8** %9
%243 = call i32 @puthd(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.24, i64 0, i64 0), i8* %242)
br label %277
244: ; preds = %237, %234
%245 = load i32, i32* %13
%246 = icmp eq i32 %245, 8
br i1 %246, label %247, label %254
247: ; preds = %244
%248 = getelementptr inbounds [80 x i8], [80 x i8]* %18, i64 0, i64 0
%249 = call i64 @strcmp(i8* %248, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.25, i64 0, i64 0))
%250 = icmp ne i64 %249, 0
br i1 %250, label %251, label %254
251: ; preds = %247
%252 = load i8*, i8** %9
%253 = call i32 @puthd(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.25, i64 0, i64 0), i8* %252)
br label %276
254: ; preds = %247, %244
%255 = load i32, i32* %13
%256 = icmp eq i32 %255, 9
br i1 %256, label %257, label %264
257: ; preds = %254
%258 = getelementptr inbounds [80 x i8], [80 x i8]* %18, i64 0, i64 0
%259 = call i64 @strcmp(i8* %258, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.26, i64 0, i64 0))
%260 = icmp ne i64 %259, 0
br i1 %260, label %261, label %264
261: ; preds = %257
%262 = load i8*, i8** %9
%263 = call i32 @puthd(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.24, i64 0, i64 0), i8* %262)
br label %275
264: ; preds = %257, %254
%265 = load i32, i32* %13
%266 = icmp eq i32 %265, 10
br i1 %266, label %267, label %274
267: ; preds = %264
%268 = getelementptr inbounds [80 x i8], [80 x i8]* %18, i64 0, i64 0
%269 = call i64 @strcmp(i8* %268, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.27, i64 0, i64 0))
%270 = icmp ne i64 %269, 0
br i1 %270, label %271, label %274
271: ; preds = %267
%272 = load i8*, i8** %9
%273 = call i32 @puthd(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.25, i64 0, i64 0), i8* %272)
br label %274
274: ; preds = %271, %267, %264
br label %275
275: ; preds = %274, %261
br label %276
276: ; preds = %275, %251
br label %277
277: ; preds = %276, %241
br label %278
278: ; preds = %277, %231
br label %279
279: ; preds = %278, %221
br label %280
280: ; preds = %279, %211
br label %281
281: ; preds = %280, %201
br label %282
282: ; preds = %281, %191
br label %283
283: ; preds = %282, %181
%284 = getelementptr inbounds [80 x i8], [80 x i8]* %18, i64 0, i64 0
%285 = load i8*, i8** %9
%286 = call i32 @gethd(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.28, i64 0, i64 0), i8* %284, i8* %285)
%287 = call i32 (...) @getbo()
%288 = icmp eq i32 %287, 0
br i1 %288, label %289, label %296
289: ; preds = %283
%290 = getelementptr inbounds [80 x i8], [80 x i8]* %18, i64 0, i64 0
%291 = call i64 @strcmp(i8* %290, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.29, i64 0, i64 0))
%292 = icmp ne i64 %291, 0
br i1 %292, label %293, label %296
293: ; preds = %289
%294 = load i8*, i8** %9
%295 = call i32 @puthd(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.28, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.29, i64 0, i64 0), i8* %294)
br label %307
296: ; preds = %289, %283
%297 = call i32 (...) @getbo()
%298 = icmp eq i32 %297, 1
br i1 %298, label %299, label %306
299: ; preds = %296
%300 = getelementptr inbounds [80 x i8], [80 x i8]* %18, i64 0, i64 0
%301 = call i64 @strcmp(i8* %300, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.30, i64 0, i64 0))
%302 = icmp ne i64 %301, 0
br i1 %302, label %303, label %306
303: ; preds = %299
%304 = load i8*, i8** %9
%305 = call i32 @puthd(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.28, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.30, i64 0, i64 0), i8* %304)
br label %306
306: ; preds = %303, %299, %296
br label %307
307: ; preds = %306, %293
store i32 0, i32* %17
%308 = load i32, i32* %13
%309 = icmp eq i32 %308, 1
br i1 %309, label %310, label %315
310: ; preds = %307
%311 = load i32, i32* %24
%312 = sext i32 %311 to i64
%313 = mul i64 %312, 1
%314 = trunc i64 %313 to i32
store i32 %314, i32* %24
br label %396
315: ; preds = %307
%316 = load i32, i32* %13
%317 = icmp eq i32 %316, 2
br i1 %317, label %318, label %323
318: ; preds = %315
%319 = load i32, i32* %24
%320 = sext i32 %319 to i64
%321 = mul i64 %320, 1
%322 = trunc i64 %321 to i32
store i32 %322, i32* %24
br label %395
323: ; preds = %315
%324 = load i32, i32* %13
%325 = icmp eq i32 %324, 3
br i1 %325, label %326, label %331
326: ; preds = %323
%327 = load i32, i32* %24
%328 = sext i32 %327 to i64
%329 = mul i64 %328, 2
%330 = trunc i64 %329 to i32
store i32 %330, i32* %24
br label %394
331: ; preds = %323
%332 = load i32, i32* %13
%333 = icmp eq i32 %332, 4
br i1 %333, label %334, label %339
334: ; preds = %331
%335 = load i32, i32* %24
%336 = sext i32 %335 to i64
%337 = mul i64 %336, 2
%338 = trunc i64 %337 to i32
store i32 %338, i32* %24
br label %393
339: ; preds = %331
%340 = load i32, i32* %13
%341 = icmp eq i32 %340, 5
br i1 %341, label %342, label %347
342: ; preds = %339
%343 = load i32, i32* %24
%344 = sext i32 %343 to i64
%345 = mul i64 %344, 4
%346 = trunc i64 %345 to i32
store i32 %346, i32* %24
br label %392
347: ; preds = %339
%348 = load i32, i32* %13
%349 = icmp eq i32 %348, 6
br i1 %349, label %350, label %355
350: ; preds = %347
%351 = load i32, i32* %24
%352 = sext i32 %351 to i64
%353 = mul i64 %352, 4
%354 = trunc i64 %353 to i32
store i32 %354, i32* %24
br label %391
355: ; preds = %347
%356 = load i32, i32* %13
%357 = icmp eq i32 %356, 7
br i1 %357, label %358, label %363
358: ; preds = %355
%359 = load i32, i32* %24
%360 = sext i32 %359 to i64
%361 = mul i64 %360, 4
%362 = trunc i64 %361 to i32
store i32 %362, i32* %24
br label %390
363: ; preds = %355
%364 = load i32, i32* %13
%365 = icmp eq i32 %364, 8
br i1 %365, label %366, label %371
366: ; preds = %363
%367 = load i32, i32* %24
%368 = sext i32 %367 to i64
%369 = mul i64 %368, 8
%370 = trunc i64 %369 to i32
store i32 %370, i32* %24
br label %389
371: ; preds = %363
%372 = load i32, i32* %13
%373 = icmp eq i32 %372, 9
br i1 %373, label %374, label %379
374: ; preds = %371
%375 = load i32, i32* %24
%376 = sext i32 %375 to i64
%377 = mul i64 %376, 8
%378 = trunc i64 %377 to i32
store i32 %378, i32* %24
br label %388
379: ; preds = %371
%380 = load i32, i32* %13
%381 = icmp eq i32 %380, 10
br i1 %381, label %382, label %387
382: ; preds = %379
%383 = load i32, i32* %24
%384 = sext i32 %383 to i64
%385 = mul i64 %384, 16
%386 = trunc i64 %385 to i32
store i32 %386, i32* %24
br label %387
387: ; preds = %382, %379
br label %388
388: ; preds = %387, %374
br label %389
389: ; preds = %388, %366
br label %390
390: ; preds = %389, %358
br label %391
391: ; preds = %390, %350
br label %392
392: ; preds = %391, %342
br label %393
393: ; preds = %392, %334
br label %394
394: ; preds = %393, %326
br label %395
395: ; preds = %394, %318
br label %396
396: ; preds = %395, %310
%397 = load i8*, i8** %9
%398 = call i32 @padhd(i8* %397, i32 512)
%399 = load i8*, i8** %9
%400 = call i32 @gethdl(i32* %21, i8* %399)
%401 = load i32, i32* %21
%402 = load i32, i32* %24
%403 = add nsw i32 %401, %402
store i32 %403, i32* %14
%404 = load i32, i32* %25
%405 = icmp ne i32 %404, 0
br i1 %405, label %406, label %409
406: ; preds = %396
%407 = load i8*, i8** %9
%408 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.31, i64 0, i64 0), i8* %407)
br label %409
409: ; preds = %406, %396
store i32 1, i32* %15
%410 = load i32, i32* %25
%411 = icmp ne i32 %410, 0
br i1 %411, label %412, label %415
412: ; preds = %409
%413 = load i8*, i8** %8
%414 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.32, i64 0, i64 0), i8* %413)
br label %415
415: ; preds = %412, %409
%416 = load i8*, i8** %8
%417 = call i32 @strlen(i8* %416)
store i32 %417, i32* %22
%418 = load i8*, i8** %8
%419 = call i32 @dskbow_(i32* %15, i8* %418, i32* %22, i32* %14, i32* %17)
%420 = load i32, i32* %17
%421 = icmp ne i32 %420, 0
br i1 %421, label %422, label %424
422: ; preds = %415
%423 = load i32, i32* %17
store i32 %423, i32* %7
br label %442
424: ; preds = %415
store i32 0, i32* %16
%425 = call i32 @dskbww_(i32* %15, i32* %16)
%426 = load i8*, i8** %9
%427 = call i32 @dskbw_(i32* %15, i8* %426, i32* %21, i32* %17)
%428 = load i32, i32* %17
%429 = icmp ne i32 %428, 0
br i1 %429, label %430, label %431
430: ; preds = %424
br label %439
431: ; preds = %424
%432 = load i8*, i8** %10
%433 = call i32 @dskbw_(i32* %15, i8* %432, i32* %24, i32* %17)
%434 = load i32, i32* %17
%435 = icmp ne i32 %434, 0
br i1 %435, label %436, label %437
436: ; preds = %431
br label %439
437: ; preds = %431
store i32 1, i32* %16
%438 = call i32 @dskbww_(i32* %15, i32* %16)
br label %439
439: ; preds = %437, %436, %430
%440 = call i32 @dskbcw_(i32* %15, i32* %17)
%441 = load i32, i32* %17
store i32 %441, i32* %7
br label %442
442: ; preds = %439, %422
%443 = load i32, i32* %7
ret i32 %443
}

LLVM IR (-O2):
@.str = [20 x i8] c"Filename : %s\0A\00"
@.str.1 = [25 x i8] c"Header : \0A%s<END\0A\00"
@.str.2 = [20 x i8] c"Array dim : %d\0A\00"
@.str.3 = [20 x i8] c" : %d\0A\00"
@.str.4 = [19 x i8] c"Type : %d\00"
@.str.13 = [7 x i8] c"SIZE%d\00"
@.str.14 = [3 x i8] c"%d\00"
@.str.15 = [4 x i8] c"%4d\00"
@.str.16 = [4 x i8] c"DIM\00"
@.str.17 = [5 x i8] c"TYPE\00"
@.str.18 = [12 x i8] c"signed_byte\00"
@.str.19 = [14 x i8] c"unsigned_byte\00"
@.str.20 = [13 x i8] c"signed_short\00"
@.str.21 = [15 x i8] c"unsigned_short\00"
@.str.22 = [12 x i8] c"signed_long\00"
@.str.23 = [14 x i8] c"unsigned_long\00"
@.str.24 = [6 x i8] c"float\00"
@.str.25 = [7 x i8] c"double\00"
@.str.26 = [8 x i8] c"complex\00"
@.str.27 = [15 x i8] c"double_complex\00"
@.str.28 = [11 x i8] c"BYTE_ORDER\00"
@.str.29 = [14 x i8] c"little_endian\00"
@.str.30 = [11 x i8] c"big_endian\00"
@.str.31 = [33 x i8] c"Updated Header : \0A%s<END\0A\00"
@.str.32 = [19 x i8] c"Opening file : %s\0A\00"
@str = [10 x i8] c" (double)\00"
@str.33 = [9 x i8] c" (float)\00"
@str.34 = [17 x i8] c" (unsigned_long)\00"
@str.35 = [15 x i8] c" (signed_long)\00"
@str.36 = [18 x i8] c" (unsigned_short)\00"
@str.37 = [16 x i8] c" (signed_short)\00"
@str.38 = [17 x i8] c" (unsigned_byte)\00"
@str.39 = [15 x i8] c" (signed_byte)\00"
@reltable.wrfile = [8 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([15 x i8]* @str.39 to i64), i64 ptrtoint ([8 x i32]* @reltable.wrfile to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([17 x i8]* @str.38 to i64), i64 ptrtoint ([8 x i32]* @reltable.wrfile to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([16 x i8]* @str.37 to i64), i64 ptrtoint ([8 x i32]* @reltable.wrfile to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([18 x i8]* @str.36 to i64), i64 ptrtoint ([8 x i32]* @reltable.wrfile to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([15 x i8]* @str.35 to i64), i64 ptrtoint ([8 x i32]* @reltable.wrfile to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([17 x i8]* @str.34 to i64), i64 ptrtoint ([8 x i32]* @reltable.wrfile to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @str.33 to i64), i64 ptrtoint ([8 x i32]* @reltable.wrfile to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @str to i64), i64 ptrtoint ([8 x i32]* @reltable.wrfile to i64)) to i32)]
define i32 @wrfile(i8* %0, i8* %1, i8* %2, i32 %3, i32* nocapture %4, i32 %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca [80 x i8]
%12 = alloca [80 x i8]
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = bitcast i32* %7 to i8*
%18 = bitcast i32* %8 to i8*
%19 = bitcast i32* %9 to i8*
%20 = bitcast i32* %10 to i8*
%21 = getelementptr inbounds [80 x i8], [80 x i8]* %11, i64 0, i64 0
%22 = getelementptr inbounds [80 x i8], [80 x i8]* %12, i64 0, i64 0
%23 = bitcast i32* %13 to i8*
%24 = bitcast i32* %14 to i8*
%25 = bitcast i32* %15 to i8*
%26 = bitcast i32* %16 to i8*
%27 = tail call i32 (...) @filec_getdebug()
%28 = icmp eq i32 %27, 0
br i1 %28, label %52, label %29
29: ; preds = %6
%30 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %0)
%31 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%32 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %3)
%33 = icmp sgt i32 %3, 0
br i1 %33, label %34, label %43
34: ; preds = %29
%35 = zext i32 %3 to i64
br label %36
36: ; preds = %34, %36
%37 = phi i64 [ 0, %34 ], [ %41, %36 ]
%38 = getelementptr inbounds i32, i32* %4, i64 %37
%39 = load i32, i32* %38
%40 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i32 %39)
%41 = add nuw nsw i64 %37, 1
%42 = icmp eq i64 %41, %35
br i1 %42, label %43, label %36
43: ; preds = %36, %29
%44 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i32 %5)
%45 = add i32 %5, -1
%46 = icmp ult i32 %45, 8
br i1 %46, label %47, label %52
47: ; preds = %43
%48 = sext i32 %45 to i64
%49 = shl i64 %48, 2
%50 = call i8* @llvm.load.relative.i64(i8* bitcast ([8 x i32]* @reltable.wrfile to i8*), i64 %49)
%51 = tail call i32 @puts(i8* dereferenceable(1) %50)
br label %52
52: ; preds = %43, %47, %6
store i32 1, i32* %16
%53 = icmp sgt i32 %3, 0
br i1 %53, label %54, label %83
54: ; preds = %52
%55 = zext i32 %3 to i64
br label %56
56: ; preds = %81, %54
%57 = phi i32 [ 1, %54 ], [ %82, %81 ]
%58 = phi i64 [ 0, %54 ], [ %62, %81 ]
%59 = getelementptr inbounds i32, i32* %4, i64 %58
%60 = load i32, i32* %59
%61 = mul nsw i32 %57, %60
store i32 %61, i32* %16
%62 = add nuw nsw i64 %58, 1
%63 = trunc i64 %62 to i32
%64 = call i32 @sprintf(i8* %22, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.13, i64 0, i64 0), i32 %63)
%65 = call i32 @gethd(i8* %22, i8* %21, i8* %1)
%66 = load i8, i8* %21
%67 = icmp eq i8 %66, 0
br i1 %67, label %75, label %68
68: ; preds = %56
%69 = call i32 @sscanf(i8* %21, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0), i32* %13)
%70 = icmp eq i32 %69, 1
br i1 %70, label %71, label %75
71: ; preds = %68
%72 = load i32, i32* %13
%73 = load i32, i32* %59
%74 = icmp eq i32 %72, %73
br i1 %74, label %79, label %75
75: ; preds = %71, %68, %56
%76 = load i32, i32* %59
%77 = call i32 @sprintf(i8* %21, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), i32 %76)
%78 = call i32 @puthd(i8* %22, i8* %21, i8* %1)
br label %79
79: ; preds = %71, %75
%80 = icmp eq i64 %62, %55
br i1 %80, label %83, label %81
81: ; preds = %79
%82 = load i32, i32* %16
br label %56
83: ; preds = %79, %52
%84 = call i32 @gethd(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i64 0, i64 0), i8* %21, i8* %1)
%85 = call i32 @sscanf(i8* %21, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0), i32* %13)
%86 = icmp eq i32 %85, 1
%87 = load i32, i32* %13
%88 = icmp eq i32 %87, %3
%89 = select i1 %86, i1 %88, i1 false
br i1 %89, label %93, label %90
90: ; preds = %83
%91 = call i32 @sprintf(i8* %21, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0), i32 %3)
%92 = call i32 @puthd(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i64 0, i64 0), i8* %21, i8* %1)
br label %93
93: ; preds = %83, %90
%94 = call i32 @gethd(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.17, i64 0, i64 0), i8* %21, i8* %1)
%95 = icmp eq i32 %5, 1
br i1 %95, label %96, label %99
96: ; preds = %93
%97 = call i64 @strcmp(i8* %21, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.18, i64 0, i64 0))
%98 = icmp eq i64 %97, 0
br i1 %98, label %130, label %127
99: ; preds = %93
switch i32 %5, label %130 [
i32 2, label %100
i32 3, label %103
i32 4, label %106
i32 5, label %109
i32 6, label %112
i32 7, label %115
i32 8, label %118
i32 9, label %121
i32 10, label %124
]
100: ; preds = %99
%101 = call i64 @strcmp(i8* %21, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.19, i64 0, i64 0))
%102 = icmp eq i64 %101, 0
br i1 %102, label %130, label %127
103: ; preds = %99
%104 = call i64 @strcmp(i8* %21, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.20, i64 0, i64 0))
%105 = icmp eq i64 %104, 0
br i1 %105, label %130, label %127
106: ; preds = %99
%107 = call i64 @strcmp(i8* %21, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.21, i64 0, i64 0))
%108 = icmp eq i64 %107, 0
br i1 %108, label %130, label %127
109: ; preds = %99
%110 = call i64 @strcmp(i8* %21, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.22, i64 0, i64 0))
%111 = icmp eq i64 %110, 0
br i1 %111, label %130, label %127
112: ; preds = %99
%113 = call i64 @strcmp(i8* %21, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.23, i64 0, i64 0))
%114 = icmp eq i64 %113, 0
br i1 %114, label %130, label %127
115: ; preds = %99
%116 = call i64 @strcmp(i8* %21, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.24, i64 0, i64 0))
%117 = icmp eq i64 %116, 0
br i1 %117, label %130, label %127
118: ; preds = %99
%119 = call i64 @strcmp(i8* %21, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.25, i64 0, i64 0))
%120 = icmp eq i64 %119, 0
br i1 %120, label %130, label %127
121: ; preds = %99
%122 = call i64 @strcmp(i8* %21, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.26, i64 0, i64 0))
%123 = icmp eq i64 %122, 0
br i1 %123, label %130, label %127
124: ; preds = %99
%125 = call i64 @strcmp(i8* %21, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.27, i64 0, i64 0))
%126 = icmp eq i64 %125, 0
br i1 %126, label %130, label %127
127: ; preds = %124, %121, %118, %115, %112, %109, %106, %103, %100, %96
%128 = phi i8* [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str.18, i64 0, i64 0), %96 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.19, i64 0, i64 0), %100 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str.20, i64 0, i64 0), %103 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str.21, i64 0, i64 0), %106 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str.22, i64 0, i64 0), %109 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.23, i64 0, i64 0), %112 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.24, i64 0, i64 0), %115 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.25, i64 0, i64 0), %118 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.24, i64 0, i64 0), %121 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.25, i64 0, i64 0), %124 ]
%129 = call i32 @puthd(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.17, i64 0, i64 0), i8* %128, i8* %1)
br label %130
130: ; preds = %127, %96, %121, %118, %115, %112, %109, %106, %103, %100, %99, %124
%131 = call i32 @gethd(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.28, i64 0, i64 0), i8* %21, i8* %1)
%132 = call i32 (...) @getbo()
%133 = icmp eq i32 %132, 0
br i1 %133, label %134, label %137
134: ; preds = %130
%135 = call i64 @strcmp(i8* %21, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.29, i64 0, i64 0))
%136 = icmp eq i64 %135, 0
br i1 %136, label %137, label %143
137: ; preds = %134, %130
%138 = call i32 (...) @getbo()
%139 = icmp eq i32 %138, 1
br i1 %139, label %140, label %146
140: ; preds = %137
%141 = call i64 @strcmp(i8* %21, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.30, i64 0, i64 0))
%142 = icmp eq i64 %141, 0
br i1 %142, label %146, label %143
143: ; preds = %140, %134
%144 = phi i8* [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.29, i64 0, i64 0), %134 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str.30, i64 0, i64 0), %140 ]
%145 = call i32 @puthd(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.28, i64 0, i64 0), i8* %144, i8* %1)
br label %146
146: ; preds = %143, %137, %140
store i32 0, i32* %10
br i1 %95, label %172, label %147
147: ; preds = %146
switch i32 %5, label %172 [
i32 10, label %169
i32 3, label %148
i32 4, label %151
i32 5, label %154
i32 6, label %157
i32 7, label %160
i32 8, label %163
i32 9, label %166
]
148: ; preds = %147
%149 = load i32, i32* %16
%150 = shl i32 %149, 1
store i32 %150, i32* %16
br label %172
151: ; preds = %147
%152 = load i32, i32* %16
%153 = shl i32 %152, 1
store i32 %153, i32* %16
br label %172
154: ; preds = %147
%155 = load i32, i32* %16
%156 = shl i32 %155, 2
store i32 %156, i32* %16
br label %172
157: ; preds = %147
%158 = load i32, i32* %16
%159 = shl i32 %158, 2
store i32 %159, i32* %16
br label %172
160: ; preds = %147
%161 = load i32, i32* %16
%162 = shl i32 %161, 2
store i32 %162, i32* %16
br label %172
163: ; preds = %147
%164 = load i32, i32* %16
%165 = shl i32 %164, 3
store i32 %165, i32* %16
br label %172
166: ; preds = %147
%167 = load i32, i32* %16
%168 = shl i32 %167, 3
store i32 %168, i32* %16
br label %172
169: ; preds = %147
%170 = load i32, i32* %16
%171 = shl i32 %170, 4
store i32 %171, i32* %16
br label %172
172: ; preds = %147, %146, %151, %157, %163, %169, %166, %160, %154, %148
%173 = call i32 @padhd(i8* %1, i32 512)
%174 = call i32 @gethdl(i32* %14, i8* %1)
%175 = load i32, i32* %14
%176 = load i32, i32* %16
%177 = add nsw i32 %176, %175
store i32 %177, i32* %7
br i1 %28, label %181, label %178
178: ; preds = %172
%179 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.31, i64 0, i64 0), i8* %1)
store i32 1, i32* %8
%180 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.32, i64 0, i64 0), i8* %0)
br label %182
181: ; preds = %172
store i32 1, i32* %8
br label %182
182: ; preds = %181, %178
%183 = call i32 @strlen(i8* %0)
store i32 %183, i32* %15
%184 = call i32 @dskbow_(i32* %8, i8* %0, i32* %15, i32* %7, i32* %10)
%185 = load i32, i32* %10
%186 = icmp eq i32 %185, 0
br i1 %186, label %187, label %201
187: ; preds = %182
store i32 0, i32* %9
%188 = call i32 @dskbww_(i32* %8, i32* %9)
%189 = call i32 @dskbw_(i32* %8, i8* %1, i32* %14, i32* %10)
%190 = load i32, i32* %10
%191 = icmp eq i32 %190, 0
br i1 %191, label %192, label %198
192: ; preds = %187
%193 = call i32 @dskbw_(i32* %8, i8* %2, i32* %16, i32* %10)
%194 = load i32, i32* %10
%195 = icmp eq i32 %194, 0
br i1 %195, label %196, label %198
196: ; preds = %192
store i32 1, i32* %9
%197 = call i32 @dskbww_(i32* %8, i32* %9)
br label %198
198: ; preds = %192, %187, %196
%199 = call i32 @dskbcw_(i32* %8, i32* %10)
%200 = load i32, i32* %10
br label %201
201: ; preds = %182, %198
%202 = phi i32 [ %200, %198 ], [ %185, %182 ]
ret i32 %202
}