#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ removeExtension(char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int /*<<< orphan*/ stderr;
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int main(int argc, char **argv) {
  int i, itmp, j, k;
  int ndim;
  int inode, nenode, nnode, nelmt;
  int point_stat, cell_stat;
  int dumi, n1, n2, n3;
  float x, y, z;
  char token[62], dumc[10];
  char fonly[62], infname[62], outfname[62];
  FILE *inf, *outf;
  if (argc < 2) {
    fprintf(stderr, "ERROR: input file not entered!\n");
    exit(-1);
  }
  printf("input file: %s\n", argv[1]);
  printf("--------------------------------\n");
  strcpy(infname, argv[1]);
  removeExtension(argv[1], fonly);
  inf = fopen(argv[1], "r");
  if (inf == NULL) {
    fprintf(stderr, "ERROR: file \"%s\" not found!", argv[1]);
    exit(-1);
  }
  nnode = 0;
  nelmt = 0;
  point_stat = 0;
  cell_stat = 0;
  sprintf(outfname, "%s.jou", fonly);
  outf = fopen(outfname, "w");
  point_stat = 0;
  cell_stat = 0;
  while (!feof(inf)) {
    fscanf(inf, "%s", token);
    if (point_stat != 1 && strcmp(token, "POINTS") == 0) {
      printf("reading/writing POINTS...");
      fscanf(inf, "%d", &nnode);
      fscanf(inf, "%s\n", dumc);
      for (i = 0; i < nnode; i++) {
        fscanf(inf, "%f %f %f", &x, &y, &z);
        fprintf(outf, "create vertex %.4f %.4f %.4f\n", x, y, z);
      }
      printf("complete\n");
      continue;
    }
    if (cell_stat != 1 && strcmp(token, "CELLS") == 0) {
      printf("reading/writing CELLS...");
      fscanf(inf, "%d", &nelmt);
      fscanf(inf, "%d\n", &dumi);
      for (i = 0; i < nelmt; i++) {
        fprintf(outf, "create surface vertex ");
        fscanf(inf, "%d", &nenode);
        for (j = 0; j < nenode - 1; j++) {
          fscanf(inf, "%d", &inode);
          fprintf(outf, "%d ", inode + 1);
        }
        fscanf(inf, "%d", &inode);
        fprintf(outf, "%d\n", inode + 1);
      }
      printf("complete\n");
      fclose(inf);
      fclose(outf);
      break;
    }
  }
  printf("--------------------------------\n");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x180,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    11f5 <main+0x45>
mov    0x2e06(%rip),%rax
movslq (%rax),%rdi
lea    0xe1c(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    $0xffffffff,%edi
call   10d0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe1c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe1e(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x130(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    -0xf0(%rbp),%rsi
call   1060 <removeExtension@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe02(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x178(%rbp)
cmpq   $0x0,-0x178(%rbp)
jne    1294 <main+0xe4>
mov    0x2d6f(%rip),%rax
movslq (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xdd1(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    $0xffffffff,%edi
call   10d0 <exit@plt>
movl   $0x0,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
movl   $0x0,-0x38(%rbp)
movl   $0x0,-0x3c(%rbp)
lea    -0x170(%rbp),%rdi
lea    -0xf0(%rbp),%rdx
lea    0xdab(%rip),%rsi
call   10c0 <sprintf@plt>
lea    -0x170(%rbp),%rdi
lea    0xd9f(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x180(%rbp)
movl   $0x0,-0x38(%rbp)
movl   $0x0,-0x3c(%rbp)
mov    -0x178(%rbp),%rdi
call   10a0 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1313 <main+0x163>
jmp    1592 <main+0x3e2>
mov    -0x178(%rbp),%rdi
lea    -0xa0(%rbp),%rdx
lea    0xd51(%rip),%rsi
mov    $0x0,%al
call   1070 <fscanf@plt>
cmpl   $0x1,-0x38(%rbp)
je     141e <main+0x26e>
lea    -0xa0(%rbp),%rdi
lea    0xd35(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    141e <main+0x26e>
lea    0xd26(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x178(%rbp),%rdi
lea    0xd2b(%rip),%rsi
lea    -0x30(%rbp),%rdx
mov    $0x0,%al
call   1070 <fscanf@plt>
mov    -0x178(%rbp),%rdi
lea    -0xaa(%rbp),%rdx
lea    0xc9a(%rip),%rsi
mov    $0x0,%al
call   1070 <fscanf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x30(%rbp),%eax
jge    140b <main+0x25b>
mov    -0x178(%rbp),%rdi
lea    0xce6(%rip),%rsi
lea    -0x50(%rbp),%rdx
lea    -0x54(%rbp),%rcx
lea    -0x58(%rbp),%r8
mov    $0x0,%al
call   1070 <fscanf@plt>
mov    -0x180(%rbp),%rdi
movss  -0x50(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x54(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0x58(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
lea    0xcb3(%rip),%rsi
mov    $0x3,%al
call   1090 <fprintf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    13a0 <main+0x1f0>
lea    0xcb5(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    12f2 <main+0x142>
cmpl   $0x1,-0x3c(%rbp)
je     158d <main+0x3dd>
lea    -0xa0(%rbp),%rdi
lea    0xc9b(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    158d <main+0x3dd>
lea    0xc8b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x178(%rbp),%rdi
lea    0xc3c(%rip),%rsi
lea    -0x34(%rbp),%rdx
mov    $0x0,%al
call   1070 <fscanf@plt>
mov    -0x178(%rbp),%rdi
lea    0xc76(%rip),%rsi
lea    -0x40(%rbp),%rdx
mov    $0x0,%al
call   1070 <fscanf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x34(%rbp),%eax
jge    1562 <main+0x3b2>
mov    -0x180(%rbp),%rdi
lea    0xc4e(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x178(%rbp),%rdi
lea    0xbe2(%rip),%rsi
lea    -0x2c(%rbp),%rdx
mov    $0x0,%al
call   1070 <fscanf@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x2c(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1520 <main+0x370>
mov    -0x178(%rbp),%rdi
lea    0xbb1(%rip),%rsi
lea    -0x28(%rbp),%rdx
mov    $0x0,%al
call   1070 <fscanf@plt>
mov    -0x180(%rbp),%rdi
mov    -0x28(%rbp),%edx
add    $0x1,%edx
lea    0xc00(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    14cd <main+0x31d>
mov    -0x178(%rbp),%rdi
lea    0xb6f(%rip),%rsi
lea    -0x28(%rbp),%rdx
mov    $0x0,%al
call   1070 <fscanf@plt>
mov    -0x180(%rbp),%rdi
mov    -0x28(%rbp),%edx
add    $0x1,%edx
lea    0xba3(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    148c <main+0x2dc>
lea    0xb5e(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x178(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x180(%rbp),%rdi
call   1040 <fclose@plt>
jmp    1592 <main+0x3e2>
jmp    12f2 <main+0x142>
lea    0xa97(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x180,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x148,%rsp
cmp    $0x1,%edi
jle    151a <main+0x34a>
mov    %rsi,%rbp
mov    0x8(%rsi),%rsi
lea    0xe28(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xedd(%rip),%rdi
call   1040 <puts@plt>
mov    0x8(%rbp),%rsi
lea    0x100(%rsp),%rdi
call   1030 <strcpy@plt>
mov    0x8(%rbp),%rdi
lea    0x40(%rsp),%rsi
call   1070 <removeExtension@plt>
mov    0x8(%rbp),%rdi
lea    0xdfb(%rip),%rsi
call   10c0 <fopen@plt>
test   %rax,%rax
je     1544 <main+0x374>
mov    %rax,%rbx
movl   $0x0,0xc(%rsp)
movl   $0x0,0x8(%rsp)
lea    0xdf1(%rip),%rsi
lea    0xc0(%rsp),%rbp
lea    0x40(%rsp),%rdx
mov    %rbp,%rdi
call   10d0 <sprintf@plt>
lea    0xddc(%rip),%rsi
mov    %rbp,%rdi
call   10c0 <fopen@plt>
mov    %rax,0x28(%rsp)
mov    %rbx,%rdi
call   10b0 <feof@plt>
test   %eax,%eax
je     12b2 <main+0xe2>
lea    0xe4a(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x148,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0x80(%rsp),%r15
lea    0x24(%rsp),%r12
lea    0x1c(%rsp),%r14
jmp    12fc <main+0x12c>
cs nopw 0x0(%rax,%rax,1)
mov    %r15,%rdi
lea    0xdcb(%rip),%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
je     13e6 <main+0x216>
mov    %rbx,%rdi
call   10b0 <feof@plt>
test   %eax,%eax
lea    0x80(%rsp),%r15
jne    1292 <main+0xc2>
mov    %rbx,%rdi
lea    0xd51(%rip),%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1080 <fscanf@plt>
mov    %r15,%rdi
lea    0xd40(%rip),%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
jne    12d0 <main+0x100>
lea    0xd36(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
lea    0xd3f(%rip),%rsi
lea    0xc(%rsp),%rdx
xor    %eax,%eax
call   1080 <fscanf@plt>
mov    %rbx,%rdi
lea    0xcda(%rip),%rsi
lea    0x36(%rsp),%rdx
xor    %eax,%eax
call   1080 <fscanf@plt>
cmpl   $0x0,0xc(%rsp)
lea    0xd14(%rip),%rbp
mov    %rbx,%r13
mov    0x28(%rsp),%rbx
jle    13d2 <main+0x202>
xor    %r15d,%r15d
nopw   0x0(%rax,%rax,1)
mov    %r13,%rdi
mov    %rbp,%rsi
mov    %r12,%rdx
lea    0x20(%rsp),%rcx
mov    %r14,%r8
xor    %eax,%eax
call   1080 <fscanf@plt>
movss  0x24(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  0x20(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  0x1c(%rsp),%xmm2
cvtss2sd %xmm2,%xmm2
mov    %rbx,%rdi
lea    0xcc7(%rip),%rsi
mov    $0x3,%al
call   10a0 <fprintf@plt>
add    $0x1,%r15d
cmp    0xc(%rsp),%r15d
jl     1380 <main+0x1b0>
lea    0xd2b(%rip),%rdi
call   1040 <puts@plt>
mov    %r13,%rbx
jmp    12e8 <main+0x118>
lea    0xcbe(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xc80(%rip),%rsi
lea    0x8(%rsp),%rdx
mov    %rbx,%rdi
xor    %eax,%eax
call   1080 <fscanf@plt>
lea    0xcb3(%rip),%rsi
lea    0x30(%rsp),%rdx
mov    %rbx,%rdi
xor    %eax,%eax
call   1080 <fscanf@plt>
cmpl   $0x0,0x8(%rsp)
mov    0x28(%rsp),%rbp
jle    14f9 <main+0x329>
lea    0xc44(%rip),%r14
lea    0x14(%rsp),%r13
lea    0xc9c(%rip),%r15
xor    %eax,%eax
jmp    1485 <main+0x2b5>
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   1080 <fscanf@plt>
mov    0x14(%rsp),%edx
add    $0x1,%edx
mov    %rbp,%rdi
lea    0xc53(%rip),%rsi
xor    %eax,%eax
call   10a0 <fprintf@plt>
mov    0x18(%rsp),%eax
add    $0x1,%eax
cmp    0x8(%rsp),%eax
jge    14f9 <main+0x329>
mov    %eax,0x18(%rsp)
mov    $0x16,%esi
mov    $0x1,%edx
lea    0xc2e(%rip),%rdi
mov    %rbp,%rcx
call   10f0 <fwrite@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
lea    0x10(%rsp),%rdx
xor    %eax,%eax
call   1080 <fscanf@plt>
cmpl   $0x2,0x10(%rsp)
jl     1450 <main+0x280>
xor    %r12d,%r12d
xchg   %ax,%ax
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   1080 <fscanf@plt>
mov    0x14(%rsp),%edx
add    $0x1,%edx
mov    %rbp,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   10a0 <fprintf@plt>
add    $0x1,%r12d
mov    0x10(%rsp),%eax
add    $0xffffffff,%eax
cmp    %eax,%r12d
jl     14c0 <main+0x2f0>
jmp    1450 <main+0x280>
lea    0xc04(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1050 <fclose@plt>
mov    %rbp,%rdi
call   1050 <fclose@plt>
jmp    1292 <main+0xc2>
mov    0x2abf(%rip),%rax
movslq (%rax),%rcx
lea    0xad5(%rip),%rdi
mov    $0x1f,%esi
mov    $0x1,%edx
call   10f0 <fwrite@plt>
mov    $0xffffffff,%edi
call   10e0 <exit@plt>
mov    0x2a95(%rip),%rax
movslq (%rax),%rdi
mov    0x8(%rbp),%rdx
lea    0xad9(%rip),%rsi
xor    %eax,%eax
call   10a0 <fprintf@plt>
mov    $0xffffffff,%edi
call   10e0 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [32 x i8] c"ERROR: input file not entered!\0A\00"
@.str.1 = [16 x i8] c"input file: %s\0A\00"
@.str.2 = [34 x i8] c"--------------------------------\0A\00"
@.str.3 = [2 x i8] c"r\00"
@.str.4 = [28 x i8] c"ERROR: file \22%s\22 not found!\00"
@.str.5 = [7 x i8] c"%s.jou\00"
@.str.6 = [2 x i8] c"w\00"
@.str.7 = [3 x i8] c"%s\00"
@.str.8 = [7 x i8] c"POINTS\00"
@.str.9 = [26 x i8] c"reading/writing POINTS...\00"
@.str.10 = [3 x i8] c"%d\00"
@.str.11 = [4 x i8] c"%s\0A\00"
@.str.12 = [9 x i8] c"%f %f %f\00"
@.str.13 = [30 x i8] c"create vertex %.4f %.4f %.4f\0A\00"
@.str.14 = [10 x i8] c"complete\0A\00"
@.str.15 = [6 x i8] c"CELLS\00"
@.str.16 = [25 x i8] c"reading/writing CELLS...\00"
@.str.17 = [4 x i8] c"%d\0A\00"
@.str.18 = [23 x i8] c"create surface vertex \00"
@.str.19 = [4 x i8] c"%d \00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca float
%22 = alloca float
%23 = alloca float
%24 = alloca [62 x i8]
%25 = alloca [10 x i8]
%26 = alloca [62 x i8]
%27 = alloca [62 x i8]
%28 = alloca [62 x i8]
%29 = alloca i32*
%30 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%31 = load i32, i32* %4
%32 = icmp slt i32 %31, 2
br i1 %32, label %33, label %39
33: ; preds = %2
%34 = load i32, i32* @stderr
%35 = sext i32 %34 to i64
%36 = inttoptr i64 %35 to i32*
%37 = call i32 (i32*, i8*, ...) @fprintf(i32* %36, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%38 = call i32 @exit(i32 -1)
unreachable
39: ; preds = %2
%40 = load i8**, i8*** %5
%41 = getelementptr inbounds i8*, i8** %40, i64 1
%42 = load i8*, i8** %41
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* %42)
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0))
%45 = getelementptr inbounds [62 x i8], [62 x i8]* %27, i64 0, i64 0
%46 = load i8**, i8*** %5
%47 = getelementptr inbounds i8*, i8** %46, i64 1
%48 = load i8*, i8** %47
%49 = call i32 @strcpy(i8* %45, i8* %48)
%50 = load i8**, i8*** %5
%51 = getelementptr inbounds i8*, i8** %50, i64 1
%52 = load i8*, i8** %51
%53 = getelementptr inbounds [62 x i8], [62 x i8]* %26, i64 0, i64 0
%54 = call i32 @removeExtension(i8* %52, i8* %53)
%55 = load i8**, i8*** %5
%56 = getelementptr inbounds i8*, i8** %55, i64 1
%57 = load i8*, i8** %56
%58 = call i32* @fopen(i8* %57, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %58, i32** %29
%59 = load i32*, i32** %29
%60 = icmp eq i32* %59, null
br i1 %60, label %61, label %70
61: ; preds = %39
%62 = load i32, i32* @stderr
%63 = sext i32 %62 to i64
%64 = inttoptr i64 %63 to i32*
%65 = load i8**, i8*** %5
%66 = getelementptr inbounds i8*, i8** %65, i64 1
%67 = load i8*, i8** %66
%68 = call i32 (i32*, i8*, ...) @fprintf(i32* %64, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0), i8* %67)
%69 = call i32 @exit(i32 -1)
unreachable
70: ; preds = %39
store i32 0, i32* %13
store i32 0, i32* %14
store i32 0, i32* %15
store i32 0, i32* %16
%71 = getelementptr inbounds [62 x i8], [62 x i8]* %28, i64 0, i64 0
%72 = getelementptr inbounds [62 x i8], [62 x i8]* %26, i64 0, i64 0
%73 = call i32 @sprintf(i8* %71, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i8* %72)
%74 = getelementptr inbounds [62 x i8], [62 x i8]* %28, i64 0, i64 0
%75 = call i32* @fopen(i8* %74, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
store i32* %75, i32** %30
store i32 0, i32* %15
store i32 0, i32* %16
br label %76
76: ; preds = %171, %116, %70
%77 = load i32*, i32** %29
%78 = call i32 @feof(i32* %77)
%79 = icmp ne i32 %78, 0
%80 = xor i1 %79, true
br i1 %80, label %81, label %172
81: ; preds = %76
%82 = load i32*, i32** %29
%83 = getelementptr inbounds [62 x i8], [62 x i8]* %24, i64 0, i64 0
%84 = call i32 (i32*, i8*, ...) @fscanf(i32* %82, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* %83)
%85 = load i32, i32* %15
%86 = icmp ne i32 %85, 1
br i1 %86, label %87, label %118
87: ; preds = %81
%88 = getelementptr inbounds [62 x i8], [62 x i8]* %24, i64 0, i64 0
%89 = call i64 @strcmp(i8* %88, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0))
%90 = icmp eq i64 %89, 0
br i1 %90, label %91, label %118
91: ; preds = %87
%92 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.9, i64 0, i64 0))
%93 = load i32*, i32** %29
%94 = call i32 (i32*, i8*, ...) @fscanf(i32* %93, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i32* %13)
%95 = load i32*, i32** %29
%96 = getelementptr inbounds [10 x i8], [10 x i8]* %25, i64 0, i64 0
%97 = call i32 (i32*, i8*, ...) @fscanf(i32* %95, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0), i8* %96)
store i32 0, i32* %6
br label %98
98: ; preds = %113, %91
%99 = load i32, i32* %6
%100 = load i32, i32* %13
%101 = icmp slt i32 %99, %100
br i1 %101, label %102, label %116
102: ; preds = %98
%103 = load i32*, i32** %29
%104 = call i32 (i32*, i8*, ...) @fscanf(i32* %103, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i64 0, i64 0), float* %21, float* %22, float* %23)
%105 = load i32*, i32** %30
%106 = load float, float* %21
%107 = fpext float %106 to double
%108 = load float, float* %22
%109 = fpext float %108 to double
%110 = load float, float* %23
%111 = fpext float %110 to double
%112 = call i32 (i32*, i8*, ...) @fprintf(i32* %105, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.13, i64 0, i64 0), double %107, double %109, double %111)
br label %113
113: ; preds = %102
%114 = load i32, i32* %6
%115 = add nsw i32 %114, 1
store i32 %115, i32* %6
br label %98
116: ; preds = %98
%117 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.14, i64 0, i64 0))
br label %76
118: ; preds = %87, %81
%119 = load i32, i32* %16
%120 = icmp ne i32 %119, 1
br i1 %120, label %121, label %171
121: ; preds = %118
%122 = getelementptr inbounds [62 x i8], [62 x i8]* %24, i64 0, i64 0
%123 = call i64 @strcmp(i8* %122, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.15, i64 0, i64 0))
%124 = icmp eq i64 %123, 0
br i1 %124, label %125, label %171
125: ; preds = %121
%126 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.16, i64 0, i64 0))
%127 = load i32*, i32** %29
%128 = call i32 (i32*, i8*, ...) @fscanf(i32* %127, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i32* %14)
%129 = load i32*, i32** %29
%130 = call i32 (i32*, i8*, ...) @fscanf(i32* %129, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i64 0, i64 0), i32* %17)
store i32 0, i32* %6
br label %131
131: ; preds = %162, %125
%132 = load i32, i32* %6
%133 = load i32, i32* %14
%134 = icmp slt i32 %132, %133
br i1 %134, label %135, label %165
135: ; preds = %131
%136 = load i32*, i32** %30
%137 = call i32 (i32*, i8*, ...) @fprintf(i32* %136, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.18, i64 0, i64 0))
%138 = load i32*, i32** %29
%139 = call i32 (i32*, i8*, ...) @fscanf(i32* %138, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i32* %12)
store i32 0, i32* %8
br label %140
140: ; preds = %152, %135
%141 = load i32, i32* %8
%142 = load i32, i32* %12
%143 = sub nsw i32 %142, 1
%144 = icmp slt i32 %141, %143
br i1 %144, label %145, label %155
145: ; preds = %140
%146 = load i32*, i32** %29
%147 = call i32 (i32*, i8*, ...) @fscanf(i32* %146, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i32* %11)
%148 = load i32*, i32** %30
%149 = load i32, i32* %11
%150 = add nsw i32 %149, 1
%151 = call i32 (i32*, i8*, ...) @fprintf(i32* %148, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.19, i64 0, i64 0), i32 %150)
br label %152
152: ; preds = %145
%153 = load i32, i32* %8
%154 = add nsw i32 %153, 1
store i32 %154, i32* %8
br label %140
155: ; preds = %140
%156 = load i32*, i32** %29
%157 = call i32 (i32*, i8*, ...) @fscanf(i32* %156, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i32* %11)
%158 = load i32*, i32** %30
%159 = load i32, i32* %11
%160 = add nsw i32 %159, 1
%161 = call i32 (i32*, i8*, ...) @fprintf(i32* %158, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i64 0, i64 0), i32 %160)
br label %162
162: ; preds = %155
%163 = load i32, i32* %6
%164 = add nsw i32 %163, 1
store i32 %164, i32* %6
br label %131
165: ; preds = %131
%166 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.14, i64 0, i64 0))
%167 = load i32*, i32** %29
%168 = call i32 @fclose(i32* %167)
%169 = load i32*, i32** %30
%170 = call i32 @fclose(i32* %169)
br label %172
171: ; preds = %121, %118
br label %76
172: ; preds = %165, %76
%173 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [32 x i8] c"ERROR: input file not entered!\0A\00"
@.str.1 = [16 x i8] c"input file: %s\0A\00"
@.str.3 = [2 x i8] c"r\00"
@.str.4 = [28 x i8] c"ERROR: file \22%s\22 not found!\00"
@.str.5 = [7 x i8] c"%s.jou\00"
@.str.6 = [2 x i8] c"w\00"
@.str.7 = [3 x i8] c"%s\00"
@.str.8 = [7 x i8] c"POINTS\00"
@.str.9 = [26 x i8] c"reading/writing POINTS...\00"
@.str.10 = [3 x i8] c"%d\00"
@.str.11 = [4 x i8] c"%s\0A\00"
@.str.12 = [9 x i8] c"%f %f %f\00"
@.str.13 = [30 x i8] c"create vertex %.4f %.4f %.4f\0A\00"
@.str.15 = [6 x i8] c"CELLS\00"
@.str.16 = [25 x i8] c"reading/writing CELLS...\00"
@.str.17 = [4 x i8] c"%d\0A\00"
@.str.18 = [23 x i8] c"create surface vertex \00"
@.str.19 = [4 x i8] c"%d \00"
@str.20 = [33 x i8] c"--------------------------------\00"
@str.22 = [9 x i8] c"complete\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca [62 x i8]
%12 = alloca [10 x i8]
%13 = alloca [62 x i8]
%14 = alloca [62 x i8]
%15 = alloca [62 x i8]
%16 = bitcast i32* %3 to i8*
%17 = bitcast i32* %4 to i8*
%18 = bitcast i32* %5 to i8*
%19 = bitcast i32* %6 to i8*
%20 = bitcast i32* %7 to i8*
%21 = bitcast float* %8 to i8*
%22 = bitcast float* %9 to i8*
%23 = bitcast float* %10 to i8*
%24 = getelementptr inbounds [62 x i8], [62 x i8]* %11, i64 0, i64 0
%25 = getelementptr inbounds [10 x i8], [10 x i8]* %12, i64 0, i64 0
%26 = getelementptr inbounds [62 x i8], [62 x i8]* %13, i64 0, i64 0
%27 = getelementptr inbounds [62 x i8], [62 x i8]* %14, i64 0, i64 0
%28 = getelementptr inbounds [62 x i8], [62 x i8]* %15, i64 0, i64 0
%29 = icmp slt i32 %0, 2
br i1 %29, label %30, label %36
30: ; preds = %2
%31 = load i32, i32* @stderr
%32 = sext i32 %31 to i64
%33 = inttoptr i64 %32 to i32*
%34 = tail call i64 @fwrite(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i64 31, i64 1, i32* %33)
%35 = tail call i32 @exit(i32 -1)
unreachable
36: ; preds = %2
%37 = getelementptr inbounds i8*, i8** %1, i64 1
%38 = load i8*, i8** %37
%39 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* %38)
%40 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.20, i64 0, i64 0))
%41 = load i8*, i8** %37
%42 = call i32 @strcpy(i8* %27, i8* %41)
%43 = load i8*, i8** %37
%44 = call i32 @removeExtension(i8* %43, i8* %26)
%45 = load i8*, i8** %37
%46 = call i32* @fopen(i8* %45, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%47 = icmp eq i32* %46, null
br i1 %47, label %48, label %55
48: ; preds = %36
%49 = load i32, i32* @stderr
%50 = sext i32 %49 to i64
%51 = inttoptr i64 %50 to i32*
%52 = load i8*, i8** %37
%53 = call i32 (i32*, i8*, ...) @fprintf(i32* %51, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0), i8* %52)
%54 = call i32 @exit(i32 -1)
unreachable
55: ; preds = %36
store i32 0, i32* %5
store i32 0, i32* %6
%56 = call i32 @sprintf(i8* %28, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i8* %26)
%57 = call i32* @fopen(i8* %28, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%58 = call i32 @feof(i32* %46)
%59 = icmp eq i32 %58, 0
br i1 %59, label %60, label %125
60: ; preds = %55, %85
%61 = call i32 (i32*, i8*, ...) @fscanf(i32* %46, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* %24)
%62 = call i64 @strcmp(i8* %24, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0))
%63 = icmp eq i64 %62, 0
br i1 %63, label %64, label %88
64: ; preds = %60
%65 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.9, i64 0, i64 0))
%66 = call i32 (i32*, i8*, ...) @fscanf(i32* %46, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i32* %5)
%67 = call i32 (i32*, i8*, ...) @fscanf(i32* %46, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0), i8* %25)
%68 = load i32, i32* %5
%69 = icmp sgt i32 %68, 0
br i1 %69, label %70, label %83
70: ; preds = %64, %70
%71 = phi i32 [ %80, %70 ], [ 0, %64 ]
%72 = call i32 (i32*, i8*, ...) @fscanf(i32* %46, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i64 0, i64 0), float* %8, float* %9, float* %10)
%73 = load float, float* %8
%74 = fpext float %73 to double
%75 = load float, float* %9
%76 = fpext float %75 to double
%77 = load float, float* %10
%78 = fpext float %77 to double
%79 = call i32 (i32*, i8*, ...) @fprintf(i32* %57, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.13, i64 0, i64 0), double %74, double %76, double %78)
%80 = add nuw nsw i32 %71, 1
%81 = load i32, i32* %5
%82 = icmp slt i32 %80, %81
br i1 %82, label %70, label %83
83: ; preds = %70, %64
%84 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.22, i64 0, i64 0))
br label %85
85: ; preds = %83, %88
%86 = call i32 @feof(i32* %46)
%87 = icmp eq i32 %86, 0
br i1 %87, label %60, label %125
88: ; preds = %60
%89 = call i64 @strcmp(i8* %24, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.15, i64 0, i64 0))
%90 = icmp eq i64 %89, 0
br i1 %90, label %91, label %85
91: ; preds = %88
%92 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.16, i64 0, i64 0))
%93 = call i32 (i32*, i8*, ...) @fscanf(i32* %46, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i32* %6)
%94 = call i32 (i32*, i8*, ...) @fscanf(i32* %46, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i64 0, i64 0), i32* %7)
%95 = load i32, i32* %6
%96 = icmp sgt i32 %95, 0
br i1 %96, label %97, label %121
97: ; preds = %91, %113
%98 = phi i32 [ %118, %113 ], [ 0, %91 ]
%99 = call i64 @fwrite(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.18, i64 0, i64 0), i64 22, i64 1, i32* %57)
%100 = call i32 (i32*, i8*, ...) @fscanf(i32* %46, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i32* %4)
%101 = load i32, i32* %4
%102 = icmp sgt i32 %101, 1
br i1 %102, label %103, label %113
103: ; preds = %97, %103
%104 = phi i32 [ %109, %103 ], [ 0, %97 ]
%105 = call i32 (i32*, i8*, ...) @fscanf(i32* %46, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i32* %3)
%106 = load i32, i32* %3
%107 = add nsw i32 %106, 1
%108 = call i32 (i32*, i8*, ...) @fprintf(i32* %57, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.19, i64 0, i64 0), i32 %107)
%109 = add nuw nsw i32 %104, 1
%110 = load i32, i32* %4
%111 = add nsw i32 %110, -1
%112 = icmp slt i32 %109, %111
br i1 %112, label %103, label %113
113: ; preds = %103, %97
%114 = call i32 (i32*, i8*, ...) @fscanf(i32* %46, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i32* %3)
%115 = load i32, i32* %3
%116 = add nsw i32 %115, 1
%117 = call i32 (i32*, i8*, ...) @fprintf(i32* %57, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i64 0, i64 0), i32 %116)
%118 = add nuw nsw i32 %98, 1
%119 = load i32, i32* %6
%120 = icmp slt i32 %118, %119
br i1 %120, label %97, label %121
121: ; preds = %113, %91
%122 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.22, i64 0, i64 0))
%123 = call i32 @fclose(i32* %46)
%124 = call i32 @fclose(i32* %57)
br label %125
125: ; preds = %85, %55, %121
%126 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.20, i64 0, i64 0))
ret i32 0
}