#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 */
char EOF;
int errno;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
char fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ gets(char *);
scalar_t__ isdigit(char);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ remove(char *);
int /*<<< orphan*/ rename(char *, char *);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
int main() {
  char buff[1024];
  int i = 0;
  char s;
  int size = 0;
  int del = 0;
  int lines = 0;
  int predl = 0;
  int digit = 0;
  printf(
      "Введите имя файла, из которого хотите удалить предложения с цифрами: ");
  int N = 256;
  char filename[N];
  gets(filename);
  FILE *fp;
  fp = fopen(filename, "r+");
  if (fp != NULL) {
    printf("Данные из файла: \n");
    while ((s = fgetc(fp)) != EOF) {
      printf("%c", s);
      if (s == '.')
        predl++;
      if (isdigit(s))
        digit++;
      if (s == '\n')
        lines++;
      size++;
    }
    printf("Количество символов: %d\n", size);
    printf("Количестиво предложений: %d.\n", predl);
    printf("Количество цифр: %d.\n", digit);
    printf("Количество строк в файле: %d.\n", lines);
    FILE *tmp;
    tmp = fopen("temp", "w+");
    rewind(fp);
    while (!feof(fp)) {
      i = 0;
      del = 0;
      do {
        if ((s = fgetc(fp)) != EOF) {
          buff[i] = s;
          if (isdigit(s))
            del = 1;
          i++;
        }
      } while (s != '.' && s != '!' && s != '?' && !feof(fp));
      buff[i] = '\0';
      if (!del) {
        fputs(buff, tmp);
      }
    }
    fclose(fp);
    fclose(tmp);
    remove(filename);
    rename("temp", filename);
    printf("\t ------------ \t");
    printf(
        "\nПредложения с цифрами удалены!\nТеперь содержимое файла таково:\n");
    fp = fopen(filename, "r");
    while ((s = fgetc(fp)) != EOF) {
      printf("%c", s);
    }
    fclose(fp);
  } else
    printf("Ошибка открытия файла: ");
  if (errno == 2)
    printf("файл именем \"%s\" не найден!", filename);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x460,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x414(%rbp)
movl   $0x0,-0x41c(%rbp)
movl   $0x0,-0x420(%rbp)
movl   $0x0,-0x424(%rbp)
movl   $0x0,-0x428(%rbp)
movl   $0x0,-0x42c(%rbp)
lea    0xdfb(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movl   $0x100,-0x430(%rbp)
mov    -0x430(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x438(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x458(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x440(%rbp)
call   10b0 <gets@plt>
mov    -0x458(%rbp),%rdi
lea    0xe24(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x448(%rbp)
cmpq   $0x0,-0x448(%rbp)
je     15b3 <main+0x403>
lea    0xe06(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x448(%rbp),%rdi
call   1090 <fgetc@plt>
mov    %al,-0x415(%rbp)
movsbl %al,%eax
mov    0x2d49(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1336 <main+0x186>
movsbl -0x415(%rbp),%esi
lea    0xdea(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movsbl -0x415(%rbp),%eax
cmp    $0x2e,%eax
jne    12de <main+0x12e>
mov    -0x428(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x428(%rbp)
movsbl -0x415(%rbp),%edi
call   1040 <isdigit@plt>
cmp    $0x0,%rax
je     1303 <main+0x153>
mov    -0x42c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x42c(%rbp)
movsbl -0x415(%rbp),%eax
cmp    $0xa,%eax
jne    1322 <main+0x172>
mov    -0x424(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x424(%rbp)
mov    -0x41c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x41c(%rbp)
jmp    1283 <main+0xd3>
mov    -0x41c(%rbp),%esi
lea    0xd62(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x428(%rbp),%esi
lea    0xd79(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x42c(%rbp),%esi
lea    0xd99(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x424(%rbp),%esi
lea    0xda9(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xdcf(%rip),%rdi
lea    0xdcd(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x450(%rbp)
mov    -0x448(%rbp),%rdi
call   1070 <rewind@plt>
mov    -0x448(%rbp),%rdi
call   10a0 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    13cd <main+0x21d>
jmp    14f4 <main+0x344>
movl   $0x0,-0x414(%rbp)
movl   $0x0,-0x420(%rbp)
mov    -0x448(%rbp),%rdi
call   1090 <fgetc@plt>
mov    %al,-0x415(%rbp)
movsbl %al,%eax
mov    0x2beb(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     144b <main+0x29b>
mov    -0x415(%rbp),%cl
movslq -0x414(%rbp),%rax
mov    %cl,-0x410(%rbp,%rax,1)
movsbl -0x415(%rbp),%edi
call   1040 <isdigit@plt>
cmp    $0x0,%rax
je     143c <main+0x28c>
movl   $0x1,-0x420(%rbp)
mov    -0x414(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x414(%rbp)
jmp    1450 <main+0x2a0>
movsbl -0x415(%rbp),%ecx
xor    %eax,%eax
cmp    $0x2e,%ecx
mov    %al,-0x459(%rbp)
je     14b2 <main+0x302>
movsbl -0x415(%rbp),%ecx
xor    %eax,%eax
cmp    $0x21,%ecx
mov    %al,-0x459(%rbp)
je     14b2 <main+0x302>
movsbl -0x415(%rbp),%ecx
xor    %eax,%eax
cmp    $0x3f,%ecx
mov    %al,-0x459(%rbp)
je     14b2 <main+0x302>
mov    -0x448(%rbp),%rdi
call   10a0 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x459(%rbp)
mov    -0x459(%rbp),%al
test   $0x1,%al
jne    13e1 <main+0x231>
movslq -0x414(%rbp),%rax
movb   $0x0,-0x410(%rbp,%rax,1)
cmpl   $0x0,-0x420(%rbp)
jne    14ef <main+0x33f>
lea    -0x410(%rbp),%rdi
mov    -0x450(%rbp),%rsi
call   1080 <fputs@plt>
jmp    13ac <main+0x1fc>
mov    -0x448(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x450(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x458(%rbp),%rdi
call   1030 <remove@plt>
mov    -0x458(%rbp),%rsi
lea    0xc36(%rip),%rdi
call   10d0 <rename@plt>
lea    0xc32(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xc35(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x458(%rbp),%rdi
lea    0xc96(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x448(%rbp)
mov    -0x448(%rbp),%rdi
call   1090 <fgetc@plt>
mov    %al,-0x415(%rbp)
movsbl %al,%eax
mov    0x2a6b(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     15a2 <main+0x3f2>
movsbl -0x415(%rbp),%esi
lea    0xb0c(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1561 <main+0x3b1>
mov    -0x448(%rbp),%rdi
call   1050 <fclose@plt>
jmp    15c1 <main+0x411>
lea    0xc33(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    0x2a10(%rip),%rax
cmpl   $0x2,(%rax)
jne    15e6 <main+0x436>
mov    -0x458(%rbp),%rsi
lea    0xc39(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x438(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x518,%rsp
lea    0xe18(%rip),%rdi
xor    %r15d,%r15d
xor    %eax,%eax
call   1080 <printf@plt>
mov    %rsp,%r14
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   10d0 <gets@plt>
lea    0xe76(%rip),%rsi
mov    %rbx,%rdi
call   10e0 <fopen@plt>
test   %rax,%rax
je     13c4 <main+0x1f4>
mov    %rax,%rbp
mov    %r14,0x8(%rsp)
lea    0xf84(%rip),%rdi
call   1060 <puts@plt>
mov    %rbp,%rdi
call   10b0 <fgetc@plt>
mov    0x2dab(%rip),%r14
mov    $0x0,%r13d
mov    $0x0,%r12d
mov    $0x0,%ebx
cmp    (%r14),%al
mov    %rbp,(%rsp)
je     12b2 <main+0xe2>
xor    %ebx,%ebx
xor    %r12d,%r12d
xor    %r13d,%r13d
xor    %r15d,%r15d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl %al,%ebp
mov    %ebp,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
cmp    $0x2e,%bpl
sete   %al
add    %eax,%r13d
mov    %ebp,%edi
call   1050 <isdigit@plt>
cmp    $0x1,%rax
sbb    $0xffffffff,%r12d
xor    %eax,%eax
cmp    $0xa,%bpl
sete   %al
add    %eax,%r15d
add    $0x1,%ebx
mov    (%rsp),%rdi
call   10b0 <fgetc@plt>
cmp    (%r14),%al
jne    1270 <main+0xa0>
lea    0xdc9(%rip),%rdi
xor    %ebp,%ebp
mov    %ebx,%esi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xde2(%rip),%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xe05(%rip),%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xe18(%rip),%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xe3b(%rip),%rdi
lea    0xe39(%rip),%rsi
call   10e0 <fopen@plt>
mov    %rax,%r12
mov    (%rsp),%r14
mov    %r14,%rdi
call   1090 <rewind@plt>
mov    %r14,%rdi
call   10c0 <feof@plt>
test   %eax,%eax
je     1408 <main+0x238>
mov    %r14,%rdi
call   1070 <fclose@plt>
mov    %r12,%rdi
call   1070 <fclose@plt>
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <remove@plt>
lea    0xdec(%rip),%rdi
mov    %rbx,%rsi
call   10f0 <rename@plt>
lea    0xde5(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xe62(%rip),%rdi
call   1060 <puts@plt>
lea    0xddc(%rip),%rsi
mov    %rbx,%rdi
call   10e0 <fopen@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   10b0 <fgetc@plt>
mov    0x2c58(%rip),%rbp
cmp    0x0(%rbp),%al
je     13b5 <main+0x1e5>
cs nopw 0x0(%rax,%rax,1)
nop
movsbl %al,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
call   10b0 <fgetc@plt>
cmp    0x0(%rbp),%al
jne    13a0 <main+0x1d0>
mov    %rbx,%rdi
call   1070 <fclose@plt>
mov    0x8(%rsp),%r14
jmp    13d2 <main+0x202>
lea    0xd89(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    0x2bff(%rip),%rax
cmpl   $0x2,(%rax)
jne    13f1 <main+0x221>
lea    0xd9a(%rip),%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %r14,%rsp
xor    %eax,%eax
add    $0x518,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
movabs $0x8000400200000000,%r13
xor    %r15d,%r15d
jmp    143b <main+0x26b>
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   10c0 <feof@plt>
mov    $0x0,%ebp
mov    $0x0,%r15d
test   %eax,%eax
jne    1329 <main+0x159>
mov    %r14,%rdi
call   10b0 <fgetc@plt>
mov    %eax,%ebx
mov    0x2b9c(%rip),%rax
cmp    (%rax),%bl
je     1472 <main+0x2a2>
movslq %r15d,%r15
mov    %bl,0x110(%rsp,%r15,1)
movsbl %bl,%edi
call   1050 <isdigit@plt>
test   %rax,%rax
mov    $0x1,%eax
cmovne %eax,%ebp
add    $0x1,%r15d
cmp    $0x3f,%bl
ja     14b0 <main+0x2e0>
movzbl %bl,%eax
bt     %rax,%r13
jae    14b0 <main+0x2e0>
movslq %r15d,%rax
movb   $0x0,0x110(%rsp,%rax,1)
test   %ebp,%ebp
jne    1420 <main+0x250>
lea    0x110(%rsp),%rdi
mov    %r12,%rsi
call   10a0 <fputs@plt>
jmp    1420 <main+0x250>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
call   10c0 <feof@plt>
test   %eax,%eax
jne    1480 <main+0x2b0>
jmp    143b <main+0x26b>

LLVM IR (-O0):
@.str = [127 x i8] c"\D0\92\D0\B2\D0\B5\D0\B4\D0\B8\D1\82\D0\B5 \D0\B8\D0\BC\D1\8F \D1\84\D0\B0\D0\B9\D0\BB\D0\B0, \D0\B8\D0\B7 \D0\BA\D0\BE\D1\82\D0\BE\D1\80\D0\BE\D0\B3\D0\BE \D1\85\D0\BE\D1\82\D0\B8\D1\82\D0\B5 \D1\83\D0\B4\D0\B0\D0\BB\D0\B8\D1\82\D1\8C \D0\BF\D1\80\D0\B5\D0\B4\D0\BB\D0\BE\D0\B6\D0\B5\D0\BD\D0\B8\D1\8F \D1\81 \D1\86\D0\B8\D1\84\D1\80\D0\B0\D0\BC\D0\B8: \00"
@.str.1 = [3 x i8] c"r+\00"
@.str.2 = [32 x i8] c"\D0\94\D0\B0\D0\BD\D0\BD\D1\8B\D0\B5 \D0\B8\D0\B7 \D1\84\D0\B0\D0\B9\D0\BB\D0\B0: \0A\00"
@EOF = global i8 0
@.str.3 = [3 x i8] c"%c\00"
@.str.4 = [43 x i8] c"\D0\9A\D0\BE\D0\BB\D0\B8\D1\87\D0\B5\D1\81\D1\82\D0\B2\D0\BE \D1\81\D0\B8\D0\BC\D0\B2\D0\BE\D0\BB\D0\BE\D0\B2: %d\0A\00"
@.str.5 = [52 x i8] c"\D0\9A\D0\BE\D0\BB\D0\B8\D1\87\D0\B5\D1\81\D1\82\D0\B8\D0\B2\D0\BE \D0\BF\D1\80\D0\B5\D0\B4\D0\BB\D0\BE\D0\B6\D0\B5\D0\BD\D0\B8\D0\B9: %d.\0A\00"
@.str.6 = [36 x i8] c"\D0\9A\D0\BE\D0\BB\D0\B8\D1\87\D0\B5\D1\81\D1\82\D0\B2\D0\BE \D1\86\D0\B8\D1\84\D1\80: %d.\0A\00"
@.str.7 = [52 x i8] c"\D0\9A\D0\BE\D0\BB\D0\B8\D1\87\D0\B5\D1\81\D1\82\D0\B2\D0\BE \D1\81\D1\82\D1\80\D0\BE\D0\BA \D0\B2 \D1\84\D0\B0\D0\B9\D0\BB\D0\B5: %d.\0A\00"
@.str.8 = [5 x i8] c"temp\00"
@.str.9 = [3 x i8] c"w+\00"
@.str.10 = [17 x i8] c"\09 ------------ \09\00"
@.str.11 = [118 x i8] c"\0A\D0\9F\D1\80\D0\B5\D0\B4\D0\BB\D0\BE\D0\B6\D0\B5\D0\BD\D0\B8\D1\8F \D1\81 \D1\86\D0\B8\D1\84\D1\80\D0\B0\D0\BC\D0\B8 \D1\83\D0\B4\D0\B0\D0\BB\D0\B5\D0\BD\D1\8B!\0A\D0\A2\D0\B5\D0\BF\D0\B5\D1\80\D1\8C \D1\81\D0\BE\D0\B4\D0\B5\D1\80\D0\B6\D0\B8\D0\BC\D0\BE\D0\B5 \D1\84\D0\B0\D0\B9\D0\BB\D0\B0 \D1\82\D0\B0\D0\BA\D0\BE\D0\B2\D0\BE:\0A\00"
@.str.12 = [2 x i8] c"r\00"
@.str.13 = [43 x i8] c"\D0\9E\D1\88\D0\B8\D0\B1\D0\BA\D0\B0 \D0\BE\D1\82\D0\BA\D1\80\D1\8B\D1\82\D0\B8\D1\8F \D1\84\D0\B0\D0\B9\D0\BB\D0\B0: \00"
@errno = global i32 0
@.str.14 = [46 x i8] c"\D1\84\D0\B0\D0\B9\D0\BB \D0\B8\D0\BC\D0\B5\D0\BD\D0\B5\D0\BC \22%s\22 \D0\BD\D0\B5 \D0\BD\D0\B0\D0\B9\D0\B4\D0\B5\D0\BD!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1024 x i8]
%3 = alloca i32
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i64
%13 = alloca i32*
%14 = alloca i32*
store i32 0, i32* %1
store i32 0, i32* %3
store i32 0, i32* %5
store i32 0, i32* %6
store i32 0, i32* %7
store i32 0, i32* %8
store i32 0, i32* %9
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([127 x i8], [127 x i8]* @.str, i64 0, i64 0))
store i32 256, i32* %10
%16 = load i32, i32* %10
%17 = zext i32 %16 to i64
%18 = call i8* @llvm.stacksave()
store i8* %18, i8** %11
%19 = alloca i8, i64 %17
store i64 %17, i64* %12
%20 = call i32 @gets(i8* %19)
%21 = call i32* @fopen(i8* %19, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %21, i32** %13
%22 = load i32*, i32** %13
%23 = icmp ne i32* %22, null
br i1 %23, label %24, label %152
24: ; preds = %0
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
br label %26
26: ; preds = %57, %24
%27 = load i32*, i32** %13
%28 = call signext i8 @fgetc(i32* %27)
store i8 %28, i8* %4
%29 = sext i8 %28 to i32
%30 = load i8, i8* @EOF
%31 = sext i8 %30 to i32
%32 = icmp ne i32 %29, %31
br i1 %32, label %33, label %60
33: ; preds = %26
%34 = load i8, i8* %4
%35 = sext i8 %34 to i32
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %35)
%37 = load i8, i8* %4
%38 = sext i8 %37 to i32
%39 = icmp eq i32 %38, 46
br i1 %39, label %40, label %43
40: ; preds = %33
%41 = load i32, i32* %8
%42 = add nsw i32 %41, 1
store i32 %42, i32* %8
br label %43
43: ; preds = %40, %33
%44 = load i8, i8* %4
%45 = call i64 @isdigit(i8 signext %44)
%46 = icmp ne i64 %45, 0
br i1 %46, label %47, label %50
47: ; preds = %43
%48 = load i32, i32* %9
%49 = add nsw i32 %48, 1
store i32 %49, i32* %9
br label %50
50: ; preds = %47, %43
%51 = load i8, i8* %4
%52 = sext i8 %51 to i32
%53 = icmp eq i32 %52, 10
br i1 %53, label %54, label %57
54: ; preds = %50
%55 = load i32, i32* %7
%56 = add nsw i32 %55, 1
store i32 %56, i32* %7
br label %57
57: ; preds = %54, %50
%58 = load i32, i32* %5
%59 = add nsw i32 %58, 1
store i32 %59, i32* %5
br label %26
60: ; preds = %26
%61 = load i32, i32* %5
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.4, i64 0, i64 0), i32 %61)
%63 = load i32, i32* %8
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.5, i64 0, i64 0), i32 %63)
%65 = load i32, i32* %9
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.6, i64 0, i64 0), i32 %65)
%67 = load i32, i32* %7
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.7, i64 0, i64 0), i32 %67)
%69 = call i32* @fopen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
store i32* %69, i32** %14
%70 = load i32*, i32** %13
%71 = call i32 @rewind(i32* %70)
br label %72
72: ; preds = %127, %60
%73 = load i32*, i32** %13
%74 = call i32 @feof(i32* %73)
%75 = icmp ne i32 %74, 0
%76 = xor i1 %75, true
br i1 %76, label %77, label %128
77: ; preds = %72
store i32 0, i32* %3
store i32 0, i32* %6
br label %78
78: ; preds = %115, %77
%79 = load i32*, i32** %13
%80 = call signext i8 @fgetc(i32* %79)
store i8 %80, i8* %4
%81 = sext i8 %80 to i32
%82 = load i8, i8* @EOF
%83 = sext i8 %82 to i32
%84 = icmp ne i32 %81, %83
br i1 %84, label %85, label %97
85: ; preds = %78
%86 = load i8, i8* %4
%87 = load i32, i32* %3
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 %88
store i8 %86, i8* %89
%90 = load i8, i8* %4
%91 = call i64 @isdigit(i8 signext %90)
%92 = icmp ne i64 %91, 0
br i1 %92, label %93, label %94
93: ; preds = %85
store i32 1, i32* %6
br label %94
94: ; preds = %93, %85
%95 = load i32, i32* %3
%96 = add nsw i32 %95, 1
store i32 %96, i32* %3
br label %97
97: ; preds = %94, %78
br label %98
98: ; preds = %97
%99 = load i8, i8* %4
%100 = sext i8 %99 to i32
%101 = icmp ne i32 %100, 46
br i1 %101, label %102, label %115
102: ; preds = %98
%103 = load i8, i8* %4
%104 = sext i8 %103 to i32
%105 = icmp ne i32 %104, 33
br i1 %105, label %106, label %115
106: ; preds = %102
%107 = load i8, i8* %4
%108 = sext i8 %107 to i32
%109 = icmp ne i32 %108, 63
br i1 %109, label %110, label %115
110: ; preds = %106
%111 = load i32*, i32** %13
%112 = call i32 @feof(i32* %111)
%113 = icmp ne i32 %112, 0
%114 = xor i1 %113, true
br label %115
115: ; preds = %110, %106, %102, %98
%116 = phi i1 [ false, %106 ], [ false, %102 ], [ false, %98 ], [ %114, %110 ]
br i1 %116, label %78, label %117
117: ; preds = %115
%118 = load i32, i32* %3
%119 = sext i32 %118 to i64
%120 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 %119
store i8 0, i8* %120
%121 = load i32, i32* %6
%122 = icmp ne i32 %121, 0
br i1 %122, label %127, label %123
123: ; preds = %117
%124 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%125 = load i32*, i32** %14
%126 = call i32 @fputs(i8* %124, i32* %125)
br label %127
127: ; preds = %123, %117
br label %72
128: ; preds = %72
%129 = load i32*, i32** %13
%130 = call i32 @fclose(i32* %129)
%131 = load i32*, i32** %14
%132 = call i32 @fclose(i32* %131)
%133 = call i32 @remove(i8* %19)
%134 = call i32 @rename(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i8* %19)
%135 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.10, i64 0, i64 0))
%136 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([118 x i8], [118 x i8]* @.str.11, i64 0, i64 0))
%137 = call i32* @fopen(i8* %19, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0))
store i32* %137, i32** %13
br label %138
138: ; preds = %145, %128
%139 = load i32*, i32** %13
%140 = call signext i8 @fgetc(i32* %139)
store i8 %140, i8* %4
%141 = sext i8 %140 to i32
%142 = load i8, i8* @EOF
%143 = sext i8 %142 to i32
%144 = icmp ne i32 %141, %143
br i1 %144, label %145, label %149
145: ; preds = %138
%146 = load i8, i8* %4
%147 = sext i8 %146 to i32
%148 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %147)
br label %138
149: ; preds = %138
%150 = load i32*, i32** %13
%151 = call i32 @fclose(i32* %150)
br label %154
152: ; preds = %0
%153 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.13, i64 0, i64 0))
br label %154
154: ; preds = %152, %149
%155 = load i32, i32* @errno
%156 = icmp eq i32 %155, 2
br i1 %156, label %157, label %159
157: ; preds = %154
%158 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.14, i64 0, i64 0), i8* %19)
br label %159
159: ; preds = %157, %154
store i32 0, i32* %1
%160 = load i8*, i8** %11
%161 = load i32, i32* %1
ret i32 %161
}

LLVM IR (-O2):
@.str = [127 x i8] c"\D0\92\D0\B2\D0\B5\D0\B4\D0\B8\D1\82\D0\B5 \D0\B8\D0\BC\D1\8F \D1\84\D0\B0\D0\B9\D0\BB\D0\B0, \D0\B8\D0\B7 \D0\BA\D0\BE\D1\82\D0\BE\D1\80\D0\BE\D0\B3\D0\BE \D1\85\D0\BE\D1\82\D0\B8\D1\82\D0\B5 \D1\83\D0\B4\D0\B0\D0\BB\D0\B8\D1\82\D1\8C \D0\BF\D1\80\D0\B5\D0\B4\D0\BB\D0\BE\D0\B6\D0\B5\D0\BD\D0\B8\D1\8F \D1\81 \D1\86\D0\B8\D1\84\D1\80\D0\B0\D0\BC\D0\B8: \00"
@.str.1 = [3 x i8] c"r+\00"
@EOF = global i8 0
@.str.4 = [43 x i8] c"\D0\9A\D0\BE\D0\BB\D0\B8\D1\87\D0\B5\D1\81\D1\82\D0\B2\D0\BE \D1\81\D0\B8\D0\BC\D0\B2\D0\BE\D0\BB\D0\BE\D0\B2: %d\0A\00"
@.str.5 = [52 x i8] c"\D0\9A\D0\BE\D0\BB\D0\B8\D1\87\D0\B5\D1\81\D1\82\D0\B8\D0\B2\D0\BE \D0\BF\D1\80\D0\B5\D0\B4\D0\BB\D0\BE\D0\B6\D0\B5\D0\BD\D0\B8\D0\B9: %d.\0A\00"
@.str.6 = [36 x i8] c"\D0\9A\D0\BE\D0\BB\D0\B8\D1\87\D0\B5\D1\81\D1\82\D0\B2\D0\BE \D1\86\D0\B8\D1\84\D1\80: %d.\0A\00"
@.str.7 = [52 x i8] c"\D0\9A\D0\BE\D0\BB\D0\B8\D1\87\D0\B5\D1\81\D1\82\D0\B2\D0\BE \D1\81\D1\82\D1\80\D0\BE\D0\BA \D0\B2 \D1\84\D0\B0\D0\B9\D0\BB\D0\B5: %d.\0A\00"
@.str.8 = [5 x i8] c"temp\00"
@.str.9 = [3 x i8] c"w+\00"
@.str.10 = [17 x i8] c"\09 ------------ \09\00"
@.str.12 = [2 x i8] c"r\00"
@.str.13 = [43 x i8] c"\D0\9E\D1\88\D0\B8\D0\B1\D0\BA\D0\B0 \D0\BE\D1\82\D0\BA\D1\80\D1\8B\D1\82\D0\B8\D1\8F \D1\84\D0\B0\D0\B9\D0\BB\D0\B0: \00"
@errno = global i32 0
@.str.14 = [46 x i8] c"\D1\84\D0\B0\D0\B9\D0\BB \D0\B8\D0\BC\D0\B5\D0\BD\D0\B5\D0\BC \22%s\22 \D0\BD\D0\B5 \D0\BD\D0\B0\D0\B9\D0\B4\D0\B5\D0\BD!\00"
@str = [31 x i8] c"\D0\94\D0\B0\D0\BD\D0\BD\D1\8B\D0\B5 \D0\B8\D0\B7 \D1\84\D0\B0\D0\B9\D0\BB\D0\B0: \00"
@str.15 = [117 x i8] c"\0A\D0\9F\D1\80\D0\B5\D0\B4\D0\BB\D0\BE\D0\B6\D0\B5\D0\BD\D0\B8\D1\8F \D1\81 \D1\86\D0\B8\D1\84\D1\80\D0\B0\D0\BC\D0\B8 \D1\83\D0\B4\D0\B0\D0\BB\D0\B5\D0\BD\D1\8B!\0A\D0\A2\D0\B5\D0\BF\D0\B5\D1\80\D1\8C \D1\81\D0\BE\D0\B4\D0\B5\D1\80\D0\B6\D0\B8\D0\BC\D0\BE\D0\B5 \D1\84\D0\B0\D0\B9\D0\BB\D0\B0 \D1\82\D0\B0\D0\BA\D0\BE\D0\B2\D0\BE:\00"
define i32 @main() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([127 x i8], [127 x i8]* @.str, i64 0, i64 0))
%4 = tail call i8* @llvm.stacksave()
%5 = alloca [256 x i8]
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%7 = call i32 @gets(i8* %6)
%8 = call i32* @fopen(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp eq i32* %8, null
br i1 %9, label %101, label %10
10: ; preds = %0
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
%12 = call signext i8 @fgetc(i32* %8)
%13 = load i8, i8* @EOF
%14 = icmp eq i8 %12, %13
br i1 %14, label %37, label %15
15: ; preds = %10, %15
%16 = phi i8 [ %34, %15 ], [ %12, %10 ]
%17 = phi i32 [ %33, %15 ], [ 0, %10 ]
%18 = phi i32 [ %29, %15 ], [ 0, %10 ]
%19 = phi i32 [ %25, %15 ], [ 0, %10 ]
%20 = phi i32 [ %32, %15 ], [ 0, %10 ]
%21 = sext i8 %16 to i32
%22 = call i32 @putchar(i32 %21)
%23 = icmp eq i8 %16, 46
%24 = zext i1 %23 to i32
%25 = add nuw nsw i32 %19, %24
%26 = call i64 @isdigit(i8 signext %16)
%27 = icmp ne i64 %26, 0
%28 = zext i1 %27 to i32
%29 = add nuw nsw i32 %18, %28
%30 = icmp eq i8 %16, 10
%31 = zext i1 %30 to i32
%32 = add nuw nsw i32 %20, %31
%33 = add nuw nsw i32 %17, 1
%34 = call signext i8 @fgetc(i32* %8)
%35 = load i8, i8* @EOF
%36 = icmp eq i8 %34, %35
br i1 %36, label %37, label %15
37: ; preds = %15, %10
%38 = phi i32 [ 0, %10 ], [ %32, %15 ]
%39 = phi i32 [ 0, %10 ], [ %25, %15 ]
%40 = phi i32 [ 0, %10 ], [ %29, %15 ]
%41 = phi i32 [ 0, %10 ], [ %33, %15 ]
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.4, i64 0, i64 0), i32 %41)
%43 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @.str.5, i64 0, i64 0), i32 %39)
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.6, i64 0, i64 0), i32 %40)
%45 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @.str.7, i64 0, i64 0), i32 %38)
%46 = call i32* @fopen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
%47 = call i32 @rewind(i32* %8)
%48 = call i32 @feof(i32* %8)
%49 = icmp eq i32 %48, 0
br i1 %49, label %50, label %81
50: ; preds = %37, %69
%51 = phi i32 [ %70, %69 ], [ 0, %37 ]
%52 = phi i32 [ %71, %69 ], [ 0, %37 ]
%53 = call signext i8 @fgetc(i32* %8)
%54 = load i8, i8* @EOF
%55 = icmp eq i8 %53, %54
br i1 %55, label %63, label %56
56: ; preds = %50
%57 = sext i32 %52 to i64
%58 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 %57
store i8 %53, i8* %58
%59 = call i64 @isdigit(i8 signext %53)
%60 = icmp eq i64 %59, 0
%61 = select i1 %60, i32 %51, i32 1
%62 = add nsw i32 %52, 1
br label %63
63: ; preds = %50, %56
%64 = phi i32 [ %61, %56 ], [ %51, %50 ]
%65 = phi i32 [ %62, %56 ], [ %52, %50 ]
switch i8 %53, label %66 [
i8 63, label %72
i8 46, label %72
i8 33, label %72
]
66: ; preds = %63
%67 = call i32 @feof(i32* %8)
%68 = icmp eq i32 %67, 0
br i1 %68, label %69, label %72
69: ; preds = %66, %78
%70 = phi i32 [ %64, %66 ], [ 0, %78 ]
%71 = phi i32 [ %65, %66 ], [ 0, %78 ]
br label %50
72: ; preds = %63, %63, %63, %66
%73 = sext i32 %65 to i64
%74 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 %73
store i8 0, i8* %74
%75 = icmp eq i32 %64, 0
br i1 %75, label %76, label %78
76: ; preds = %72
%77 = call i32 @fputs(i8* %2, i32* %46)
br label %78
78: ; preds = %76, %72
%79 = call i32 @feof(i32* %8)
%80 = icmp eq i32 %79, 0
br i1 %80, label %69, label %81
81: ; preds = %78, %37
%82 = call i32 @fclose(i32* %8)
%83 = call i32 @fclose(i32* %46)
%84 = call i32 @remove(i8* %6)
%85 = call i32 @rename(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i8* %6)
%86 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.10, i64 0, i64 0))
%87 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([117 x i8], [117 x i8]* @str.15, i64 0, i64 0))
%88 = call i32* @fopen(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0))
%89 = call signext i8 @fgetc(i32* %88)
%90 = load i8, i8* @EOF
%91 = icmp eq i8 %89, %90
br i1 %91, label %99, label %92
92: ; preds = %81, %92
%93 = phi i8 [ %96, %92 ], [ %89, %81 ]
%94 = sext i8 %93 to i32
%95 = call i32 @putchar(i32 %94)
%96 = call signext i8 @fgetc(i32* %88)
%97 = load i8, i8* @EOF
%98 = icmp eq i8 %96, %97
br i1 %98, label %99, label %92
99: ; preds = %92, %81
%100 = call i32 @fclose(i32* %88)
br label %103
101: ; preds = %0
%102 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.13, i64 0, i64 0))
br label %103
103: ; preds = %101, %99
%104 = load i32, i32* @errno
%105 = icmp eq i32 %104, 2
br i1 %105, label %106, label %108
106: ; preds = %103
%107 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.14, i64 0, i64 0), i8* %6)
br label %108
108: ; preds = %106, %103
ret i32 0
}