#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 abs(int);
int get_FITS_key(int const, char **, char *, char *);
int /*<<< orphan*/ memset(char *, char, int);
int /*<<< orphan*/ printf(char *, ...);
int snprintf(char *, int, char *, int);
int sscanf(char *, char *, int *);
int /*<<< orphan*/ strcpy(char *, char *);
int FITS_image_size(const int ncards, char **header) {
  char val[70], keyword[8];
  int i, p, bitpix, bytepix, naxis, naxisn, size;
  memset(val, ' ', 70);
  if ((p = get_FITS_key(ncards, header, "BITPIX", val)) == -1) {
    printf("\n\tERROR! FITS_image_size(): BITPIX not found in the header\n");
    return (0);
  }
  if (p != 1)
    printf("\n\tWARNING! header does not conform to FITS standard (BITPIX)\n");
  if (sscanf(val, "%d", &bitpix) < 1) {
    printf("\n\tERROR! FITS_image_size(): reading BITPIX\n");
    return (0);
  }
  bytepix = abs(bitpix) / 8;
  strcpy(keyword, "NAXIS");
  if ((p = get_FITS_key(ncards, header, keyword, val)) == -1) {
    printf("\n\tERROR! FITS_image_size(): NAXIS not found in the header\n");
    return (0);
  }
  if (p != 2)
    printf("\n\tWARNING! header does not conform to FITS standard (NAXIS)\n");
  if (sscanf(val, "%d", &naxis) < 1) {
    printf("\n\tERROR! FITS_image_size(): reading NAXIS\n");
    return (0);
  }
  if (naxis == 0)
    return (0);
  size = bytepix;
  for (i = 1; i <= naxis; i++) {
    if (snprintf((keyword + 5), 8 - 5, "%d", i) < 1) {
      printf("\n\tERROR! FITS_image_size(): %s\n", keyword);
      return (0);
    }
    if ((p = get_FITS_key(ncards, header, keyword, val)) == -1) {
      printf("\n\tERROR! FITS_image_size(): %s not found in the header\n",
             keyword);
      return (0);
    }
    if (p != i + 2)
      printf("\n\tWARNING! header does not conform to FITS standard (%s)\n",
             keyword);
    if (sscanf(val, "%d", &naxisn) < 1) {
      printf("\n\tERROR! FITS_image_size(): reading %s\n", keyword);
      return (0);
    }
    size *= naxisn;
  }
  return (size);
}


x86 assembly (clang, -O0):
<FITS_image_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x60(%rbp),%rdi
mov    $0x20,%esi
mov    $0x46,%edx
call   1070 <memset@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    -0x60(%rbp),%rcx
lea    0xe59(%rip),%rdx
call   1080 <get_FITS_key@plt>
mov    %eax,-0x70(%rbp)
cmp    $0xffffffff,%eax
jne    11d2 <FITS_image_size+0x62>
lea    0xe48(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1405 <FITS_image_size+0x295>
cmpl   $0x1,-0x70(%rbp)
je     11ea <FITS_image_size+0x7a>
lea    0xe60(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x60(%rbp),%rdi
lea    0xe8c(%rip),%rsi
lea    -0x74(%rbp),%rdx
call   1090 <sscanf@plt>
cmp    $0x1,%eax
jge    1221 <FITS_image_size+0xb1>
lea    0xe76(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1405 <FITS_image_size+0x295>
mov    -0x74(%rbp),%edi
call   1040 <abs@plt>
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x78(%rbp)
lea    -0x68(%rbp),%rdi
lea    0xe71(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    -0x68(%rbp),%rdx
lea    -0x60(%rbp),%rcx
call   1080 <get_FITS_key@plt>
mov    %eax,-0x70(%rbp)
cmp    $0xffffffff,%eax
jne    127e <FITS_image_size+0x10e>
lea    0xe4b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1405 <FITS_image_size+0x295>
cmpl   $0x2,-0x70(%rbp)
je     1296 <FITS_image_size+0x126>
lea    0xe62(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x60(%rbp),%rdi
lea    0xde0(%rip),%rsi
lea    -0x7c(%rbp),%rdx
call   1090 <sscanf@plt>
cmp    $0x1,%eax
jge    12cd <FITS_image_size+0x15d>
lea    0xe74(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1405 <FITS_image_size+0x295>
cmpl   $0x0,-0x7c(%rbp)
jne    12e3 <FITS_image_size+0x173>
movl   $0x0,-0x4(%rbp)
jmp    1405 <FITS_image_size+0x295>
mov    -0x78(%rbp),%eax
mov    %eax,-0x84(%rbp)
movl   $0x1,-0x6c(%rbp)
mov    -0x6c(%rbp),%eax
cmp    -0x7c(%rbp),%eax
jg     13fc <FITS_image_size+0x28c>
lea    -0x68(%rbp),%rdi
add    $0x5,%rdi
mov    -0x6c(%rbp),%ecx
mov    $0x3,%esi
lea    0xd6b(%rip),%rdx
call   1060 <snprintf@plt>
cmp    $0x1,%eax
jge    1342 <FITS_image_size+0x1d2>
lea    -0x68(%rbp),%rsi
lea    0xe2a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1405 <FITS_image_size+0x295>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    -0x68(%rbp),%rdx
lea    -0x60(%rbp),%rcx
call   1080 <get_FITS_key@plt>
mov    %eax,-0x70(%rbp)
cmp    $0xffffffff,%eax
jne    1380 <FITS_image_size+0x210>
lea    -0x68(%rbp),%rsi
lea    0xe0c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1405 <FITS_image_size+0x295>
mov    -0x70(%rbp),%eax
mov    -0x6c(%rbp),%ecx
add    $0x2,%ecx
cmp    %ecx,%eax
je     13a3 <FITS_image_size+0x233>
lea    -0x68(%rbp),%rsi
lea    0xe15(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x60(%rbp),%rdi
lea    0xcd3(%rip),%rsi
lea    -0x80(%rbp),%rdx
call   1090 <sscanf@plt>
cmp    $0x1,%eax
jge    13de <FITS_image_size+0x26e>
lea    -0x68(%rbp),%rsi
lea    0xe20(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1405 <FITS_image_size+0x295>
mov    -0x80(%rbp),%eax
imul   -0x84(%rbp),%eax
mov    %eax,-0x84(%rbp)
mov    -0x6c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6c(%rbp)
jmp    12f3 <FITS_image_size+0x183>
mov    -0x84(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FITS_image_size>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %rsi,%r14
mov    %edi,%r15d
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x20,%esi
mov    $0x46,%edx
call   1070 <memset@plt>
lea    0xfdf(%rip),%rdx
mov    %r15d,%edi
mov    %r14,%rsi
mov    %rbx,%rcx
call   1080 <get_FITS_key@plt>
cmp    $0x1,%eax
je     11d2 <FITS_image_size+0x62>
cmp    $0xffffffff,%eax
jne    11c6 <FITS_image_size+0x56>
lea    0x1004(%rip),%rdi
jmp    1308 <FITS_image_size+0x198>
lea    0xfbb(%rip),%rdi
call   1040 <puts@plt>
lea    0xe27(%rip),%rsi
lea    0x20(%rsp),%rdi
lea    0x1c(%rsp),%rdx
call   1090 <sscanf@plt>
test   %eax,%eax
jle    1234 <FITS_image_size+0xc4>
mov    0x1c(%rsp),%eax
mov    %eax,%ebx
neg    %ebx
cmovs  %eax,%ebx
lea    0xee3(%rip),%rsi
lea    0xc(%rsp),%rbp
mov    %rbp,%rdi
call   1030 <strcpy@plt>
lea    0x20(%rsp),%rcx
mov    %r15d,%edi
mov    %r14,%rsi
mov    %rbp,%rdx
call   1080 <get_FITS_key@plt>
cmp    $0x2,%eax
je     124c <FITS_image_size+0xdc>
cmp    $0xffffffff,%eax
jne    1240 <FITS_image_size+0xd0>
lea    0xef4(%rip),%rdi
jmp    1308 <FITS_image_size+0x198>
lea    0xf22(%rip),%rdi
jmp    1308 <FITS_image_size+0x198>
lea    0xea0(%rip),%rdi
call   1040 <puts@plt>
lea    0xdad(%rip),%rsi
lea    0x20(%rsp),%rdi
lea    0x14(%rsp),%rdx
call   1090 <sscanf@plt>
test   %eax,%eax
jle    1301 <FITS_image_size+0x191>
shr    $0x3,%ebx
cmpl   $0x0,0x14(%rsp)
je     130d <FITS_image_size+0x19d>
jle    130f <FITS_image_size+0x19f>
mov    $0x1,%ebp
lea    0xd76(%rip),%r13
lea    0x20(%rsp),%r12
nop
lea    0x11(%rsp),%rdi
mov    $0x3,%esi
mov    %r13,%rdx
mov    %ebp,%ecx
call   1060 <snprintf@plt>
test   %eax,%eax
jle    1320 <FITS_image_size+0x1b0>
mov    %r15d,%edi
mov    %r14,%rsi
lea    0xc(%rsp),%rdx
mov    %r12,%rcx
call   1080 <get_FITS_key@plt>
cmp    $0xffffffff,%eax
je     1329 <FITS_image_size+0x1b9>
add    $0x2,%ebp
cmp    %ebp,%eax
je     12da <FITS_image_size+0x16a>
lea    0xd8d(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r12,%rdi
mov    %r13,%rsi
lea    0x18(%rsp),%rdx
call   1090 <sscanf@plt>
test   %eax,%eax
jle    1332 <FITS_image_size+0x1c2>
imul   0x18(%rsp),%ebx
lea    -0x2(%rbp),%eax
add    $0xffffffff,%ebp
cmp    0x14(%rsp),%eax
jl     1290 <FITS_image_size+0x120>
jmp    130f <FITS_image_size+0x19f>
lea    0xdb5(%rip),%rdi
call   1040 <puts@plt>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xcdc(%rip),%rdi
jmp    1339 <FITS_image_size+0x1c9>
lea    0xcf3(%rip),%rdi
jmp    1339 <FITS_image_size+0x1c9>
lea    0xd5c(%rip),%rdi
xor    %ebx,%ebx
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    130f <FITS_image_size+0x19f>

LLVM IR (-O0):
@.str = [7 x i8] c"BITPIX\00"
@.str.1 = [60 x i8] c"\0A\09ERROR! FITS_image_size(): BITPIX not found in the header\0A\00"
@.str.2 = [62 x i8] c"\0A\09WARNING! header does not conform to FITS standard (BITPIX)\0A\00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [44 x i8] c"\0A\09ERROR! FITS_image_size(): reading BITPIX\0A\00"
@.str.5 = [6 x i8] c"NAXIS\00"
@.str.6 = [59 x i8] c"\0A\09ERROR! FITS_image_size(): NAXIS not found in the header\0A\00"
@.str.7 = [61 x i8] c"\0A\09WARNING! header does not conform to FITS standard (NAXIS)\0A\00"
@.str.8 = [43 x i8] c"\0A\09ERROR! FITS_image_size(): reading NAXIS\0A\00"
@.str.9 = [32 x i8] c"\0A\09ERROR! FITS_image_size(): %s\0A\00"
@.str.10 = [56 x i8] c"\0A\09ERROR! FITS_image_size(): %s not found in the header\0A\00"
@.str.11 = [58 x i8] c"\0A\09WARNING! header does not conform to FITS standard (%s)\0A\00"
@.str.12 = [40 x i8] c"\0A\09ERROR! FITS_image_size(): reading %s\0A\00"
define i32 @FITS_image_size(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [70 x i8]
%7 = alloca [8 x i8]
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i32 %0, i32* %4
store i8** %1, i8*** %5
%15 = getelementptr inbounds [70 x i8], [70 x i8]* %6, i64 0, i64 0
%16 = call i32 @memset(i8* %15, i8 signext 32, i32 70)
%17 = load i32, i32* %4
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds [70 x i8], [70 x i8]* %6, i64 0, i64 0
%20 = call i32 @get_FITS_key(i32 %17, i8** %18, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %19)
store i32 %20, i32* %9
%21 = icmp eq i32 %20, -1
br i1 %21, label %22, label %24
22: ; preds = %2
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %3
br label %113
24: ; preds = %2
%25 = load i32, i32* %9
%26 = icmp ne i32 %25, 1
br i1 %26, label %27, label %29
27: ; preds = %24
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.2, i64 0, i64 0))
br label %29
29: ; preds = %27, %24
%30 = getelementptr inbounds [70 x i8], [70 x i8]* %6, i64 0, i64 0
%31 = call i32 @sscanf(i8* %30, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %10)
%32 = icmp slt i32 %31, 1
br i1 %32, label %33, label %35
33: ; preds = %29
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %3
br label %113
35: ; preds = %29
%36 = load i32, i32* %10
%37 = call i32 @abs(i32 %36)
%38 = sdiv i32 %37, 8
store i32 %38, i32* %11
%39 = getelementptr inbounds [8 x i8], [8 x i8]* %7, i64 0, i64 0
%40 = call i32 @strcpy(i8* %39, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%41 = load i32, i32* %4
%42 = load i8**, i8*** %5
%43 = getelementptr inbounds [8 x i8], [8 x i8]* %7, i64 0, i64 0
%44 = getelementptr inbounds [70 x i8], [70 x i8]* %6, i64 0, i64 0
%45 = call i32 @get_FITS_key(i32 %41, i8** %42, i8* %43, i8* %44)
store i32 %45, i32* %9
%46 = icmp eq i32 %45, -1
br i1 %46, label %47, label %49
47: ; preds = %35
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.6, i64 0, i64 0))
store i32 0, i32* %3
br label %113
49: ; preds = %35
%50 = load i32, i32* %9
%51 = icmp ne i32 %50, 2
br i1 %51, label %52, label %54
52: ; preds = %49
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.7, i64 0, i64 0))
br label %54
54: ; preds = %52, %49
%55 = getelementptr inbounds [70 x i8], [70 x i8]* %6, i64 0, i64 0
%56 = call i32 @sscanf(i8* %55, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %12)
%57 = icmp slt i32 %56, 1
br i1 %57, label %58, label %60
58: ; preds = %54
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.8, i64 0, i64 0))
store i32 0, i32* %3
br label %113
60: ; preds = %54
%61 = load i32, i32* %12
%62 = icmp eq i32 %61, 0
br i1 %62, label %63, label %64
63: ; preds = %60
store i32 0, i32* %3
br label %113
64: ; preds = %60
%65 = load i32, i32* %11
store i32 %65, i32* %14
store i32 1, i32* %8
br label %66
66: ; preds = %108, %64
%67 = load i32, i32* %8
%68 = load i32, i32* %12
%69 = icmp sle i32 %67, %68
br i1 %69, label %70, label %111
70: ; preds = %66
%71 = getelementptr inbounds [8 x i8], [8 x i8]* %7, i64 0, i64 0
%72 = getelementptr inbounds i8, i8* %71, i64 5
%73 = load i32, i32* %8
%74 = call i32 @snprintf(i8* %72, i32 3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %73)
%75 = icmp slt i32 %74, 1
br i1 %75, label %76, label %79
76: ; preds = %70
%77 = getelementptr inbounds [8 x i8], [8 x i8]* %7, i64 0, i64 0
%78 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.9, i64 0, i64 0), i8* %77)
store i32 0, i32* %3
br label %113
79: ; preds = %70
%80 = load i32, i32* %4
%81 = load i8**, i8*** %5
%82 = getelementptr inbounds [8 x i8], [8 x i8]* %7, i64 0, i64 0
%83 = getelementptr inbounds [70 x i8], [70 x i8]* %6, i64 0, i64 0
%84 = call i32 @get_FITS_key(i32 %80, i8** %81, i8* %82, i8* %83)
store i32 %84, i32* %9
%85 = icmp eq i32 %84, -1
br i1 %85, label %86, label %89
86: ; preds = %79
%87 = getelementptr inbounds [8 x i8], [8 x i8]* %7, i64 0, i64 0
%88 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.10, i64 0, i64 0), i8* %87)
store i32 0, i32* %3
br label %113
89: ; preds = %79
%90 = load i32, i32* %9
%91 = load i32, i32* %8
%92 = add nsw i32 %91, 2
%93 = icmp ne i32 %90, %92
br i1 %93, label %94, label %97
94: ; preds = %89
%95 = getelementptr inbounds [8 x i8], [8 x i8]* %7, i64 0, i64 0
%96 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.11, i64 0, i64 0), i8* %95)
br label %97
97: ; preds = %94, %89
%98 = getelementptr inbounds [70 x i8], [70 x i8]* %6, i64 0, i64 0
%99 = call i32 @sscanf(i8* %98, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %13)
%100 = icmp slt i32 %99, 1
br i1 %100, label %101, label %104
101: ; preds = %97
%102 = getelementptr inbounds [8 x i8], [8 x i8]* %7, i64 0, i64 0
%103 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.12, i64 0, i64 0), i8* %102)
store i32 0, i32* %3
br label %113
104: ; preds = %97
%105 = load i32, i32* %13
%106 = load i32, i32* %14
%107 = mul nsw i32 %106, %105
store i32 %107, i32* %14
br label %108
108: ; preds = %104
%109 = load i32, i32* %8
%110 = add nsw i32 %109, 1
store i32 %110, i32* %8
br label %66
111: ; preds = %66
%112 = load i32, i32* %14
store i32 %112, i32* %3
br label %113
113: ; preds = %111, %101, %86, %76, %63, %58, %47, %33, %22
%114 = load i32, i32* %3
ret i32 %114
}

LLVM IR (-O2):
@.str = [7 x i8] c"BITPIX\00"
@.str.3 = [3 x i8] c"%d\00"
@.str.5 = [6 x i8] c"NAXIS\00"
@.str.9 = [32 x i8] c"\0A\09ERROR! FITS_image_size(): %s\0A\00"
@.str.10 = [56 x i8] c"\0A\09ERROR! FITS_image_size(): %s not found in the header\0A\00"
@.str.11 = [58 x i8] c"\0A\09WARNING! header does not conform to FITS standard (%s)\0A\00"
@.str.12 = [40 x i8] c"\0A\09ERROR! FITS_image_size(): reading %s\0A\00"
@str = [42 x i8] c"\0A\09ERROR! FITS_image_size(): reading NAXIS\00"
@str.13 = [60 x i8] c"\0A\09WARNING! header does not conform to FITS standard (NAXIS)\00"
@str.14 = [58 x i8] c"\0A\09ERROR! FITS_image_size(): NAXIS not found in the header\00"
@str.15 = [43 x i8] c"\0A\09ERROR! FITS_image_size(): reading BITPIX\00"
@str.16 = [61 x i8] c"\0A\09WARNING! header does not conform to FITS standard (BITPIX)\00"
@str.17 = [59 x i8] c"\0A\09ERROR! FITS_image_size(): BITPIX not found in the header\00"
define i32 @FITS_image_size(i32 %0, i8** %1) {
%3 = alloca [70 x i8]
%4 = alloca [8 x i8]
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = getelementptr inbounds [70 x i8], [70 x i8]* %3, i64 0, i64 0
%9 = getelementptr inbounds [8 x i8], [8 x i8]* %4, i64 0, i64 0
%10 = bitcast i32* %5 to i8*
%11 = bitcast i32* %6 to i8*
%12 = bitcast i32* %7 to i8*
%13 = call i32 @memset(i8* %8, i8 signext 32, i32 70)
%14 = call i32 @get_FITS_key(i32 %0, i8** %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %8)
switch i32 %14, label %17 [
i32 -1, label %15
i32 1, label %19
]
15: ; preds = %2
%16 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str.17, i64 0, i64 0))
br label %74
17: ; preds = %2
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str.16, i64 0, i64 0))
br label %19
19: ; preds = %2, %17
%20 = call i32 @sscanf(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %5)
%21 = icmp slt i32 %20, 1
br i1 %21, label %22, label %24
22: ; preds = %19
%23 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.15, i64 0, i64 0))
br label %74
24: ; preds = %19
%25 = load i32, i32* %5
%26 = call i32 @llvm.abs.i32(i32 %25, i1 true)
%27 = lshr i32 %26, 3
%28 = call i32 @strcpy(i8* %9, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%29 = call i32 @get_FITS_key(i32 %0, i8** %1, i8* %9, i8* %8)
switch i32 %29, label %32 [
i32 -1, label %30
i32 2, label %34
]
30: ; preds = %24
%31 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str.14, i64 0, i64 0))
br label %74
32: ; preds = %24
%33 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str.13, i64 0, i64 0))
br label %34
34: ; preds = %24, %32
%35 = call i32 @sscanf(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %6)
%36 = icmp slt i32 %35, 1
br i1 %36, label %37, label %39
37: ; preds = %34
%38 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
br label %74
39: ; preds = %34
%40 = load i32, i32* %6
%41 = icmp eq i32 %40, 0
br i1 %41, label %74, label %42
42: ; preds = %39
%43 = icmp slt i32 %40, 1
br i1 %43, label %74, label %44
44: ; preds = %42
%45 = getelementptr inbounds [8 x i8], [8 x i8]* %4, i64 0, i64 5
br label %46
46: ; preds = %44, %68
%47 = phi i32 [ %27, %44 ], [ %70, %68 ]
%48 = phi i32 [ 1, %44 ], [ %71, %68 ]
%49 = call i32 @snprintf(i8* %45, i32 3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %48)
%50 = icmp slt i32 %49, 1
br i1 %50, label %51, label %53
51: ; preds = %46
%52 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.9, i64 0, i64 0), i8* %9)
br label %74
53: ; preds = %46
%54 = call i32 @get_FITS_key(i32 %0, i8** %1, i8* %9, i8* %8)
%55 = icmp eq i32 %54, -1
br i1 %55, label %56, label %58
56: ; preds = %53
%57 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @.str.10, i64 0, i64 0), i8* %9)
br label %74
58: ; preds = %53
%59 = add nuw nsw i32 %48, 2
%60 = icmp eq i32 %54, %59
br i1 %60, label %63, label %61
61: ; preds = %58
%62 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @.str.11, i64 0, i64 0), i8* %9)
br label %63
63: ; preds = %61, %58
%64 = call i32 @sscanf(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %7)
%65 = icmp slt i32 %64, 1
br i1 %65, label %66, label %68
66: ; preds = %63
%67 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.12, i64 0, i64 0), i8* %9)
br label %74
68: ; preds = %63
%69 = load i32, i32* %7
%70 = mul nsw i32 %69, %47
%71 = add nuw nsw i32 %48, 1
%72 = load i32, i32* %6
%73 = icmp slt i32 %48, %72
br i1 %73, label %46, label %74
74: ; preds = %68, %42, %39, %66, %56, %51, %37, %30, %22, %15
%75 = phi i32 [ 0, %15 ], [ 0, %22 ], [ 0, %30 ], [ 0, %37 ], [ 0, %51 ], [ 0, %56 ], [ 0, %66 ], [ 0, %39 ], [ %27, %42 ], [ %70, %68 ]
ret i32 %75
}