#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*/ imc_fits_mkstrg(char *, char *, char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, ...);
int sscanf(char *, char *, char *, ...);
scalar_t__ strncmp(char *, char *, int);
int /*<<< orphan*/ strncpy(char *, char *, int);
int imh_reformat_fits(char *line) {
  char key[9] = "", strg[81] = "", com[50] = "";
  char quote;
  int pos;
  char cp[162] = "";
  strncpy(cp, line, 80);
  cp[80] = '\0';
  if (strncmp(cp, "COMMENT ", 8) == 0 || strncmp(cp, "HISTORY ", 8) == 0) {
    sprintf(line, "%-80.80s", cp);
    return 1;
  }
  if (sscanf(cp, "%[-A-Z0-9_ ]%*[=] %*[\']%[^\']%c%n", key, strg, &quote,
             &pos) == 3) {
    sscanf(cp + pos, "%*[ /]%[\040-\177]", com);
    imc_fits_mkstrg(line, key, strg, com);
    return 1;
  }
  if (sscanf(cp, "%[-A-Z0-9_ ]%*[=] %[\']%n", key, strg, &pos) == 2) {
    sscanf(cp + pos, "%*[ /]%[\040-\177]", com);
    imc_fits_mkstrg(line, key, " ", com);
    return 1;
  } else if (sscanf(cp, "%[-A-Z0-9_ ]%*[=] %[-+0-9.E]%n", key, strg, &pos) ==
             2) {
    sscanf(cp + pos, "%*[ /]%[\040-\177]", com);
    sprintf(line, "%-8.8s= %20.20s / %-47.47s", key, strg, com);
    return 2;
  } else {
    sscanf(cp, "%[-A-Z0-9_ ]%*[=] %[^/]%*[ /]%[\040-\177]", key, strg, com);
    imc_fits_mkstrg(line, key, strg, com);
    return -1;
  }
}


x86 assembly (clang, -O0):
<imh_reformat_fits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x160,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x19(%rbp),%rdi
xor    %esi,%esi
mov    $0x9,%edx
call   1050 <memset@plt>
lea    -0x70(%rbp),%rdi
xor    %esi,%esi
mov    $0x51,%edx
call   1050 <memset@plt>
lea    -0xb0(%rbp),%rdi
xor    %esi,%esi
mov    $0x32,%edx
call   1050 <memset@plt>
lea    -0x160(%rbp),%rdi
xor    %esi,%esi
mov    $0xa2,%edx
call   1050 <memset@plt>
lea    -0x160(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x50,%edx
call   1030 <strncpy@plt>
movb   $0x0,-0x110(%rbp)
lea    -0x160(%rbp),%rdi
lea    0xe21(%rip),%rsi
mov    $0x8,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
je     1215 <imh_reformat_fits+0xb5>
lea    -0x160(%rbp),%rdi
lea    0xe08(%rip),%rsi
mov    $0x8,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    123a <imh_reformat_fits+0xda>
mov    -0x10(%rbp),%rdi
lea    -0x160(%rbp),%rdx
lea    0xdeb(%rip),%rsi
mov    $0x0,%al
call   1080 <sprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    13f5 <imh_reformat_fits+0x295>
lea    -0x160(%rbp),%rdi
lea    -0x19(%rbp),%rdx
lea    -0x70(%rbp),%rcx
lea    0xdcb(%rip),%rsi
lea    -0xb1(%rbp),%r8
lea    -0xb8(%rbp),%r9
mov    $0x0,%al
call   1060 <sscanf@plt>
cmp    $0x3,%eax
jne    12b8 <imh_reformat_fits+0x158>
lea    -0x160(%rbp),%rdi
movslq -0xb8(%rbp),%rax
add    %rax,%rdi
lea    -0xb0(%rbp),%rdx
lea    0xe19(%rip),%rsi
mov    $0x0,%al
call   1060 <sscanf@plt>
mov    -0x10(%rbp),%rdi
lea    -0x19(%rbp),%rsi
lea    -0x70(%rbp),%rdx
lea    -0xb0(%rbp),%rcx
call   1070 <imc_fits_mkstrg@plt>
movl   $0x1,-0x4(%rbp)
jmp    13f5 <imh_reformat_fits+0x295>
lea    -0x160(%rbp),%rdi
lea    -0x19(%rbp),%rdx
lea    -0x70(%rbp),%rcx
lea    0xd6e(%rip),%rsi
lea    -0xb8(%rbp),%r8
mov    $0x0,%al
call   1060 <sscanf@plt>
cmp    $0x2,%eax
jne    1332 <imh_reformat_fits+0x1d2>
lea    -0x160(%rbp),%rdi
movslq -0xb8(%rbp),%rax
add    %rax,%rdi
lea    -0xb0(%rbp),%rdx
lea    0xda2(%rip),%rsi
mov    $0x0,%al
call   1060 <sscanf@plt>
mov    -0x10(%rbp),%rdi
lea    -0x19(%rbp),%rsi
lea    -0xb0(%rbp),%rcx
lea    0xce6(%rip),%rdx
call   1070 <imc_fits_mkstrg@plt>
movl   $0x1,-0x4(%rbp)
jmp    13f5 <imh_reformat_fits+0x295>
lea    -0x160(%rbp),%rdi
lea    -0x19(%rbp),%rdx
lea    -0x70(%rbp),%rcx
lea    0xd0d(%rip),%rsi
lea    -0xb8(%rbp),%r8
mov    $0x0,%al
call   1060 <sscanf@plt>
cmp    $0x2,%eax
jne    13b2 <imh_reformat_fits+0x252>
lea    -0x160(%rbp),%rdi
movslq -0xb8(%rbp),%rax
add    %rax,%rdi
lea    -0xb0(%rbp),%rdx
lea    0xd28(%rip),%rsi
mov    $0x0,%al
call   1060 <sscanf@plt>
mov    -0x10(%rbp),%rdi
lea    -0x19(%rbp),%rdx
lea    -0x70(%rbp),%rcx
lea    -0xb0(%rbp),%r8
lea    0xcd5(%rip),%rsi
mov    $0x0,%al
call   1080 <sprintf@plt>
movl   $0x2,-0x4(%rbp)
jmp    13f5 <imh_reformat_fits+0x295>
lea    -0x160(%rbp),%rdi
lea    -0x19(%rbp),%rdx
lea    -0x70(%rbp),%rcx
lea    -0xb0(%rbp),%r8
lea    0xcc0(%rip),%rsi
mov    $0x0,%al
call   1060 <sscanf@plt>
mov    -0x10(%rbp),%rdi
lea    -0x19(%rbp),%rsi
lea    -0x70(%rbp),%rdx
lea    -0xb0(%rbp),%rcx
call   1070 <imc_fits_mkstrg@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x160,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imh_reformat_fits>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x168,%rsp
mov    %rdi,%r14
movb   $0x0,0x18(%rsp)
movq   $0x0,0x10(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movb   $0x0,0xb0(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movw   $0x0,0x50(%rsp)
movaps %xmm0,0x150(%rsp)
movaps %xmm0,0x140(%rsp)
movaps %xmm0,0x130(%rsp)
movaps %xmm0,0x120(%rsp)
movaps %xmm0,0x110(%rsp)
movaps %xmm0,0x100(%rsp)
movaps %xmm0,0xf0(%rsp)
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xc0(%rsp)
movw   $0x0,0x160(%rsp)
lea    0xc0(%rsp),%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x50,%edx
call   1030 <strncpy@plt>
movb   $0x0,0x110(%rsp)
lea    0xdcd(%rip),%rsi
mov    %rbx,%rdi
mov    $0x8,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     12c4 <imh_reformat_fits+0x174>
lea    0xdbd(%rip),%rsi
lea    0xc0(%rsp),%rdi
mov    $0x8,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     12c4 <imh_reformat_fits+0x174>
lea    0xdb1(%rip),%rsi
lea    0xc0(%rsp),%rdi
lea    0x10(%rsp),%rdx
lea    0x60(%rsp),%rcx
lea    0x1f(%rsp),%r8
lea    0xc(%rsp),%r9
xor    %eax,%eax
call   1050 <sscanf@plt>
cmp    $0x3,%eax
jne    12df <imh_reformat_fits+0x18f>
movslq 0xc(%rsp),%rax
lea    (%rsp,%rax,1),%rdi
add    $0xc0,%rdi
lea    0xdfd(%rip),%rsi
lea    0x20(%rsp),%rbx
mov    %rbx,%rdx
xor    %eax,%eax
call   1050 <sscanf@plt>
lea    0x10(%rsp),%rsi
lea    0x60(%rsp),%rdx
jmp    133b <imh_reformat_fits+0x1eb>
lea    0xd47(%rip),%rsi
lea    0xc0(%rsp),%rdx
mov    %r14,%rdi
xor    %eax,%eax
call   1070 <sprintf@plt>
jmp    1346 <imh_reformat_fits+0x1f6>
lea    0xd56(%rip),%rsi
lea    0xc0(%rsp),%rdi
lea    0x10(%rsp),%rdx
lea    0x60(%rsp),%rcx
lea    0xc(%rsp),%r8
xor    %eax,%eax
call   1050 <sscanf@plt>
cmp    $0x2,%eax
jne    135a <imh_reformat_fits+0x20a>
movslq 0xc(%rsp),%rax
lea    (%rsp,%rax,1),%rdi
add    $0xc0,%rdi
lea    0xd86(%rip),%rsi
lea    0x20(%rsp),%rbx
mov    %rbx,%rdx
xor    %eax,%eax
call   1050 <sscanf@plt>
lea    0xcd1(%rip),%rdx
lea    0x10(%rsp),%rsi
mov    %r14,%rdi
mov    %rbx,%rcx
call   1060 <imc_fits_mkstrg@plt>
mov    $0x1,%eax
add    $0x168,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret
lea    0xcf4(%rip),%rsi
lea    0xc0(%rsp),%rdi
lea    0x10(%rsp),%rdx
lea    0x60(%rsp),%rcx
lea    0xc(%rsp),%r8
xor    %eax,%eax
call   1050 <sscanf@plt>
cmp    $0x2,%eax
jne    13d2 <imh_reformat_fits+0x282>
movslq 0xc(%rsp),%rax
lea    (%rsp,%rax,1),%rdi
add    $0xc0,%rdi
lea    0xd0b(%rip),%rsi
lea    0x20(%rsp),%rbx
mov    %rbx,%rdx
xor    %eax,%eax
call   1050 <sscanf@plt>
lea    0xcc3(%rip),%rsi
lea    0x10(%rsp),%rdx
lea    0x60(%rsp),%rcx
mov    %r14,%rdi
mov    %rbx,%r8
xor    %eax,%eax
call   1070 <sprintf@plt>
mov    $0x2,%eax
jmp    134b <imh_reformat_fits+0x1fb>
lea    0xcb6(%rip),%rsi
lea    0xc0(%rsp),%rdi
lea    0x10(%rsp),%rbx
lea    0x60(%rsp),%r15
lea    0x20(%rsp),%r12
mov    %rbx,%rdx
mov    %r15,%rcx
mov    %r12,%r8
xor    %eax,%eax
call   1050 <sscanf@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r12,%rcx
call   1060 <imc_fits_mkstrg@plt>
mov    $0xffffffff,%eax
jmp    134b <imh_reformat_fits+0x1fb>

LLVM IR (-O0):
@.str = [9 x i8] c"COMMENT \00"
@.str.1 = [9 x i8] c"HISTORY \00"
@.str.2 = [9 x i8] c"%-80.80s\00"
@.str.3 = [33 x i8] c"%[-A-Z0-9_ ]%*[=] %*[']%[^']%c%n\00"
@.str.4 = [13 x i8] c"%*[ /]%[ -\7F]\00"
@.str.5 = [25 x i8] c"%[-A-Z0-9_ ]%*[=] %[']%n\00"
@.str.6 = [2 x i8] c" \00"
@.str.7 = [31 x i8] c"%[-A-Z0-9_ ]%*[=] %[-+0-9.E]%n\00"
@.str.8 = [27 x i8] c"%-8.8s= %20.20s / %-47.47s\00"
@.str.9 = [36 x i8] c"%[-A-Z0-9_ ]%*[=] %[^/]%*[ /]%[ -\7F]\00"
define i32 @imh_reformat_fits(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [9 x i8]
%5 = alloca [81 x i8]
%6 = alloca [50 x i8]
%7 = alloca i8
%8 = alloca i32
%9 = alloca [162 x i8]
store i8* %0, i8** %3
%10 = bitcast [9 x i8]* %4 to i8*
%11 = bitcast [81 x i8]* %5 to i8*
%12 = bitcast [50 x i8]* %6 to i8*
%13 = bitcast [162 x i8]* %9 to i8*
%14 = getelementptr inbounds [162 x i8], [162 x i8]* %9, i64 0, i64 0
%15 = load i8*, i8** %3
%16 = call i32 @strncpy(i8* %14, i8* %15, i32 80)
%17 = getelementptr inbounds [162 x i8], [162 x i8]* %9, i64 0, i64 80
store i8 0, i8* %17
%18 = getelementptr inbounds [162 x i8], [162 x i8]* %9, i64 0, i64 0
%19 = call i64 @strncmp(i8* %18, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 8)
%20 = icmp eq i64 %19, 0
br i1 %20, label %25, label %21
21: ; preds = %1
%22 = getelementptr inbounds [162 x i8], [162 x i8]* %9, i64 0, i64 0
%23 = call i64 @strncmp(i8* %22, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 8)
%24 = icmp eq i64 %23, 0
br i1 %24, label %25, label %29
25: ; preds = %21, %1
%26 = load i8*, i8** %3
%27 = getelementptr inbounds [162 x i8], [162 x i8]* %9, i64 0, i64 0
%28 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %26, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* %27)
store i32 1, i32* %2
br label %93
29: ; preds = %21
%30 = getelementptr inbounds [162 x i8], [162 x i8]* %9, i64 0, i64 0
%31 = getelementptr inbounds [9 x i8], [9 x i8]* %4, i64 0, i64 0
%32 = getelementptr inbounds [81 x i8], [81 x i8]* %5, i64 0, i64 0
%33 = call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %30, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0), i8* %31, i8* %32, i8* %7, i32* %8)
%34 = icmp eq i32 %33, 3
br i1 %34, label %35, label %47
35: ; preds = %29
%36 = getelementptr inbounds [162 x i8], [162 x i8]* %9, i64 0, i64 0
%37 = load i32, i32* %8
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds i8, i8* %36, i64 %38
%40 = getelementptr inbounds [50 x i8], [50 x i8]* %6, i64 0, i64 0
%41 = call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %39, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i8* %40)
%42 = load i8*, i8** %3
%43 = getelementptr inbounds [9 x i8], [9 x i8]* %4, i64 0, i64 0
%44 = getelementptr inbounds [81 x i8], [81 x i8]* %5, i64 0, i64 0
%45 = getelementptr inbounds [50 x i8], [50 x i8]* %6, i64 0, i64 0
%46 = call i32 @imc_fits_mkstrg(i8* %42, i8* %43, i8* %44, i8* %45)
store i32 1, i32* %2
br label %93
47: ; preds = %29
%48 = getelementptr inbounds [162 x i8], [162 x i8]* %9, i64 0, i64 0
%49 = getelementptr inbounds [9 x i8], [9 x i8]* %4, i64 0, i64 0
%50 = getelementptr inbounds [81 x i8], [81 x i8]* %5, i64 0, i64 0
%51 = call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %48, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), i8* %49, i8* %50, i32* %8)
%52 = icmp eq i32 %51, 2
br i1 %52, label %53, label %64
53: ; preds = %47
%54 = getelementptr inbounds [162 x i8], [162 x i8]* %9, i64 0, i64 0
%55 = load i32, i32* %8
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds i8, i8* %54, i64 %56
%58 = getelementptr inbounds [50 x i8], [50 x i8]* %6, i64 0, i64 0
%59 = call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %57, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i8* %58)
%60 = load i8*, i8** %3
%61 = getelementptr inbounds [9 x i8], [9 x i8]* %4, i64 0, i64 0
%62 = getelementptr inbounds [50 x i8], [50 x i8]* %6, i64 0, i64 0
%63 = call i32 @imc_fits_mkstrg(i8* %60, i8* %61, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0), i8* %62)
store i32 1, i32* %2
br label %93
64: ; preds = %47
%65 = getelementptr inbounds [162 x i8], [162 x i8]* %9, i64 0, i64 0
%66 = getelementptr inbounds [9 x i8], [9 x i8]* %4, i64 0, i64 0
%67 = getelementptr inbounds [81 x i8], [81 x i8]* %5, i64 0, i64 0
%68 = call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %65, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.7, i64 0, i64 0), i8* %66, i8* %67, i32* %8)
%69 = icmp eq i32 %68, 2
br i1 %69, label %70, label %82
70: ; preds = %64
%71 = getelementptr inbounds [162 x i8], [162 x i8]* %9, i64 0, i64 0
%72 = load i32, i32* %8
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds i8, i8* %71, i64 %73
%75 = getelementptr inbounds [50 x i8], [50 x i8]* %6, i64 0, i64 0
%76 = call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %74, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i8* %75)
%77 = load i8*, i8** %3
%78 = getelementptr inbounds [9 x i8], [9 x i8]* %4, i64 0, i64 0
%79 = getelementptr inbounds [81 x i8], [81 x i8]* %5, i64 0, i64 0
%80 = getelementptr inbounds [50 x i8], [50 x i8]* %6, i64 0, i64 0
%81 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %77, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.8, i64 0, i64 0), i8* %78, i8* %79, i8* %80)
store i32 2, i32* %2
br label %93
82: ; preds = %64
%83 = getelementptr inbounds [162 x i8], [162 x i8]* %9, i64 0, i64 0
%84 = getelementptr inbounds [9 x i8], [9 x i8]* %4, i64 0, i64 0
%85 = getelementptr inbounds [81 x i8], [81 x i8]* %5, i64 0, i64 0
%86 = getelementptr inbounds [50 x i8], [50 x i8]* %6, i64 0, i64 0
%87 = call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %83, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.9, i64 0, i64 0), i8* %84, i8* %85, i8* %86)
%88 = load i8*, i8** %3
%89 = getelementptr inbounds [9 x i8], [9 x i8]* %4, i64 0, i64 0
%90 = getelementptr inbounds [81 x i8], [81 x i8]* %5, i64 0, i64 0
%91 = getelementptr inbounds [50 x i8], [50 x i8]* %6, i64 0, i64 0
%92 = call i32 @imc_fits_mkstrg(i8* %88, i8* %89, i8* %90, i8* %91)
store i32 -1, i32* %2
br label %93
93: ; preds = %82, %70, %53, %35, %25
%94 = load i32, i32* %2
ret i32 %94
}

LLVM IR (-O2):
@.str = [9 x i8] c"COMMENT \00"
@.str.1 = [9 x i8] c"HISTORY \00"
@.str.2 = [9 x i8] c"%-80.80s\00"
@.str.3 = [33 x i8] c"%[-A-Z0-9_ ]%*[=] %*[']%[^']%c%n\00"
@.str.4 = [13 x i8] c"%*[ /]%[ -\7F]\00"
@.str.5 = [25 x i8] c"%[-A-Z0-9_ ]%*[=] %[']%n\00"
@.str.6 = [2 x i8] c" \00"
@.str.7 = [31 x i8] c"%[-A-Z0-9_ ]%*[=] %[-+0-9.E]%n\00"
@.str.8 = [27 x i8] c"%-8.8s= %20.20s / %-47.47s\00"
@.str.9 = [36 x i8] c"%[-A-Z0-9_ ]%*[=] %[^/]%*[ /]%[ -\7F]\00"
define i32 @imh_reformat_fits(i8* %0) {
%2 = alloca [9 x i8]
%3 = alloca [81 x i8]
%4 = alloca [50 x i8]
%5 = alloca i8
%6 = alloca i32
%7 = alloca [162 x i8]
%8 = getelementptr inbounds [9 x i8], [9 x i8]* %2, i64 0, i64 0
%9 = getelementptr inbounds [81 x i8], [81 x i8]* %3, i64 0, i64 0
%10 = getelementptr inbounds [50 x i8], [50 x i8]* %4, i64 0, i64 0
%11 = bitcast i32* %6 to i8*
%12 = getelementptr inbounds [162 x i8], [162 x i8]* %7, i64 0, i64 0
%13 = call i32 @strncpy(i8* %12, i8* %0, i32 80)
%14 = getelementptr inbounds [162 x i8], [162 x i8]* %7, i64 0, i64 80
store i8 0, i8* %14
%15 = call i64 @strncmp(i8* %12, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 8)
%16 = icmp eq i64 %15, 0
br i1 %16, label %20, label %17
17: ; preds = %1
%18 = call i64 @strncmp(i8* %12, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 8)
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %17, %1
%21 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* %12)
br label %52
22: ; preds = %17
%23 = call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %12, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0), i8* %8, i8* %9, i8* %5, i32* %6)
%24 = icmp eq i32 %23, 3
br i1 %24, label %25, label %31
25: ; preds = %22
%26 = load i32, i32* %6
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [162 x i8], [162 x i8]* %7, i64 0, i64 %27
%29 = call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %28, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i8* %10)
%30 = call i32 @imc_fits_mkstrg(i8* %0, i8* %8, i8* %9, i8* %10)
br label %52
31: ; preds = %22
%32 = call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %12, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), i8* %8, i8* %9, i32* %6)
%33 = icmp eq i32 %32, 2
br i1 %33, label %34, label %40
34: ; preds = %31
%35 = load i32, i32* %6
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [162 x i8], [162 x i8]* %7, i64 0, i64 %36
%38 = call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %37, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i8* %10)
%39 = call i32 @imc_fits_mkstrg(i8* %0, i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0), i8* %10)
br label %52
40: ; preds = %31
%41 = call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %12, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.7, i64 0, i64 0), i8* %8, i8* %9, i32* %6)
%42 = icmp eq i32 %41, 2
br i1 %42, label %43, label %49
43: ; preds = %40
%44 = load i32, i32* %6
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds [162 x i8], [162 x i8]* %7, i64 0, i64 %45
%47 = call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %46, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i8* %10)
%48 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.8, i64 0, i64 0), i8* %8, i8* %9, i8* %10)
br label %52
49: ; preds = %40
%50 = call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %12, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.9, i64 0, i64 0), i8* %8, i8* %9, i8* %10)
%51 = call i32 @imc_fits_mkstrg(i8* %0, i8* %8, i8* %9, i8* %10)
br label %52
52: ; preds = %49, %43, %34, %25, %20
%53 = phi i32 [ 1, %20 ], [ 1, %25 ], [ 1, %34 ], [ 2, %43 ], [ -1, %49 ]
ret i32 %53
}