#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*/ fclose(int /*<<< orphan*/);
scalar_t__ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ freopen(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int, ...);
int /*<<< orphan*/ stdin;
int strlen(char *);
int main() {
  int i, index, dot;
  char num[100];
  freopen("sample3.in", "r", stdin);
  while (fgets(num, 200, stdin)) {
    dot = -1;
    for (i = 0; i < strlen(num); i++)
      if (num[i] == '.')
        dot = i;
    if (dot == -1) {
      index = strlen(num) - 1;
      printf("%c.", num[0]);
      for (i = 1; i < strlen(num); i++)
        printf("%c", num[i]);
      printf("e%d\n", index);
    } else if (dot != -1 && num[0] != '0') {
      index = dot - 1;
      printf("%c.", num[0]);
      for (i = 1; i < strlen(num) - 1; i++) {
        if (i == dot)
          continue;
        printf("%c", num[i]);
      }
      printf("e%d\n", index);
    } else if (dot != -1 && num[0] == '0') {
      for (i = 0; i < strlen(num) - 1; i++)
        if (num[i] != '.' && num[i] > '0' && num[i] <= '9')
          dot = i;
      index = -dot + 1;
      if (dot == strlen(num) - 2)
        printf("%ce%d\n", num[dot], index);
      else {
        printf("%c.", num[dot - 2]);
        for (i = dot; i < strlen(num) - 1; i++)
          printf("%c", num[i]);
        printf("e%d\n", index);
      }
    }
  }
  fclose(stdin);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e7f(%rip),%rax
mov    (%rax),%edx
lea    0xe8e(%rip),%rdi
lea    0xe92(%rip),%rsi
call   1060 <freopen@plt>
lea    -0x80(%rbp),%rdi
mov    0x2e5f(%rip),%rax
mov    (%rax),%edx
mov    $0xc8,%esi
call   1070 <fgets@plt>
cmp    $0x0,%rax
je     14a4 <main+0x354>
movl   $0xffffffff,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x84(%rbp)
lea    -0x80(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x84(%rbp),%eax
cmp    %ecx,%eax
jge    11fa <main+0xaa>
movslq -0x8(%rbp),%rax
movsbl -0x80(%rbp,%rax,1),%eax
cmp    $0x2e,%eax
jne    11e7 <main+0x97>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    11ec <main+0x9c>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11ad <main+0x5d>
cmpl   $0xffffffff,-0x10(%rbp)
jne    1289 <main+0x139>
lea    -0x80(%rbp),%rdi
call   1040 <strlen@plt>
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
movsbl -0x80(%rbp),%esi
lea    0xdef(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x88(%rbp)
lea    -0x80(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x88(%rbp),%eax
cmp    %ecx,%eax
jge    1273 <main+0x123>
movslq -0x8(%rbp),%rax
movsbl -0x80(%rbp,%rax,1),%esi
lea    0xdb3(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    122c <main+0xdc>
mov    -0xc(%rbp),%esi
lea    0xd99(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    149f <main+0x34f>
cmpl   $0xffffffff,-0x10(%rbp)
je     1333 <main+0x1e3>
movsbl -0x80(%rbp),%eax
cmp    $0x30,%eax
je     1333 <main+0x1e3>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
movsbl -0x80(%rbp),%esi
lea    0xd59(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x8c(%rbp)
lea    -0x80(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x8c(%rbp),%eax
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    131d <main+0x1cd>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    12f8 <main+0x1a8>
jmp    130f <main+0x1bf>
movslq -0x8(%rbp),%rax
movsbl -0x80(%rbp,%rax,1),%esi
lea    0xd09(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    12c2 <main+0x172>
mov    -0xc(%rbp),%esi
lea    0xcef(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    149a <main+0x34a>
cmpl   $0xffffffff,-0x10(%rbp)
je     1495 <main+0x345>
movsbl -0x80(%rbp),%eax
cmp    $0x30,%eax
jne    1495 <main+0x345>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x90(%rbp)
lea    -0x80(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x90(%rbp),%eax
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    13c5 <main+0x275>
movslq -0x8(%rbp),%rax
movsbl -0x80(%rbp,%rax,1),%eax
cmp    $0x2e,%eax
je     13b2 <main+0x262>
movslq -0x8(%rbp),%rax
movsbl -0x80(%rbp,%rax,1),%eax
cmp    $0x30,%eax
jle    13b2 <main+0x262>
movslq -0x8(%rbp),%rax
movsbl -0x80(%rbp,%rax,1),%eax
cmp    $0x39,%eax
jg     13b2 <main+0x262>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    13b7 <main+0x267>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1351 <main+0x201>
xor    %eax,%eax
sub    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x94(%rbp)
lea    -0x80(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x94(%rbp),%eax
sub    $0x2,%ecx
cmp    %ecx,%eax
jne    1414 <main+0x2c4>
movslq -0x10(%rbp),%rax
movsbl -0x80(%rbp,%rax,1),%esi
mov    -0xc(%rbp),%edx
lea    0xc0c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1490 <main+0x340>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
cltq
movsbl -0x80(%rbp,%rax,1),%esi
lea    0xbe5(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x98(%rbp)
lea    -0x80(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x98(%rbp),%eax
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    147f <main+0x32f>
movslq -0x8(%rbp),%rax
movsbl -0x80(%rbp,%rax,1),%esi
lea    0xba7(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1435 <main+0x2e5>
mov    -0xc(%rbp),%esi
lea    0xb8d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1495 <main+0x345>
jmp    149a <main+0x34a>
jmp    149f <main+0x34f>
jmp    117e <main+0x2e>
mov    0x2b3d(%rip),%rax
mov    (%rax),%edi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    0x2e83(%rip),%r14
mov    (%r14),%edx
lea    0xe91(%rip),%rdi
lea    0xe95(%rip),%rsi
call   1060 <freopen@plt>
mov    (%r14),%edx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xc8,%esi
call   1070 <fgets@plt>
test   %rax,%rax
je     13c3 <main+0x273>
lea    0xe73(%rip),%r12
jmp    11ca <main+0x7a>
lea    0xe6f(%rip),%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    (%r14),%edx
mov    %rbx,%rdi
mov    $0xc8,%esi
call   1070 <fgets@plt>
test   %rax,%rax
je     13c3 <main+0x273>
mov    %rbx,%rdi
call   1040 <strlen@plt>
test   %eax,%eax
jle    1290 <main+0x140>
mov    $0xffffffff,%r15d
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmpb   $0x2e,(%rsp,%rbp,1)
cmove  %ebp,%r15d
add    $0x1,%rbp
mov    %rbx,%rdi
call   1040 <strlen@plt>
cltq
cmp    %rax,%rbp
jl     11f0 <main+0xa0>
cmp    $0xffffffff,%r15d
je     1290 <main+0x140>
movsbl (%rsp),%esi
cmp    $0x30,%esi
jne    12f6 <main+0x1a6>
mov    %rbx,%rdi
call   1040 <strlen@plt>
cmp    $0x2,%eax
jl     1252 <main+0x102>
xor    %ebp,%ebp
nopl   (%rax)
movzbl (%rsp,%rbp,1),%eax
add    $0xcf,%al
cmp    $0x9,%al
cmovb  %ebp,%r15d
add    $0x1,%rbp
mov    %rbx,%rdi
call   1040 <strlen@plt>
add    $0xffffffff,%eax
cltq
cmp    %rax,%rbp
jl     1230 <main+0xe0>
mov    $0x1,%ebp
sub    %r15d,%ebp
mov    %rbx,%rdi
call   1040 <strlen@plt>
add    $0xfffffffe,%eax
cmp    %eax,%r15d
jne    135a <main+0x20a>
movslq %r15d,%rax
movsbl (%rsp,%rax,1),%esi
lea    0xd98(%rip),%rdi
mov    %ebp,%edx
xor    %eax,%eax
call   1050 <printf@plt>
jmp    11b1 <main+0x61>
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %eax,%r15d
add    $0xffffffff,%r15d
movsbl (%rsp),%esi
lea    0xd63(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
cmp    $0x2,%eax
jl     11a0 <main+0x50>
mov    $0x1,%ebp
nopw   0x0(%rax,%rax,1)
movsbl (%rsp,%rbp,1),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbp
mov    %rbx,%rdi
call   1040 <strlen@plt>
cltq
cmp    %rax,%rbp
jl     12d0 <main+0x180>
jmp    11a0 <main+0x50>
lea    -0x1(%r15),%r13d
lea    0xd0c(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
cmp    $0x3,%eax
jl     134b <main+0x1fb>
mov    %r15d,%r15d
mov    $0x1,%ebp
jmp    1336 <main+0x1e6>
nop
add    $0x1,%rbp
mov    %rbx,%rdi
call   1040 <strlen@plt>
add    $0xffffffff,%eax
cltq
cmp    %rax,%rbp
jge    134b <main+0x1fb>
cmp    %rbp,%r15
je     1320 <main+0x1d0>
movsbl (%rsp,%rbp,1),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    1320 <main+0x1d0>
lea    0xcc4(%rip),%rdi
mov    %r13d,%esi
jmp    11aa <main+0x5a>
movslq %r15d,%r13
movsbl -0x2(%r13,%rbx,1),%esi
lea    0xca3(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
add    $0xffffffff,%eax
cmp    %eax,%r15d
jge    13b5 <main+0x265>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl (%rsp,%r13,1),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%r13
mov    %rbx,%rdi
call   1040 <strlen@plt>
add    $0xffffffff,%eax
cltq
cmp    %rax,%r13
jl     1390 <main+0x240>
lea    0xc5a(%rip),%rdi
mov    %ebp,%esi
jmp    11aa <main+0x5a>
mov    (%r14),%edi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"sample3.in\00"
@.str.1 = [2 x i8] c"r\00"
@stdin = global i32 0
@.str.2 = [4 x i8] c"%c.\00"
@.str.3 = [3 x i8] c"%c\00"
@.str.4 = [5 x i8] c"e%d\0A\00"
@.str.5 = [7 x i8] c"%ce%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca [100 x i8]
store i32 0, i32* %1
%6 = load i32, i32* @stdin
%7 = call i32 @freopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %6)
br label %8
8: ; preds = %190, %0
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%10 = load i32, i32* @stdin
%11 = call i64 @fgets(i8* %9, i32 200, i32 %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %191
13: ; preds = %8
store i32 -1, i32* %4
store i32 0, i32* %2
br label %14
14: ; preds = %29, %13
%15 = load i32, i32* %2
%16 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%17 = call i32 @strlen(i8* %16)
%18 = icmp slt i32 %15, %17
br i1 %18, label %19, label %32
19: ; preds = %14
%20 = load i32, i32* %2
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 %21
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = icmp eq i32 %24, 46
br i1 %25, label %26, label %28
26: ; preds = %19
%27 = load i32, i32* %2
store i32 %27, i32* %4
br label %28
28: ; preds = %26, %19
br label %29
29: ; preds = %28
%30 = load i32, i32* %2
%31 = add nsw i32 %30, 1
store i32 %31, i32* %2
br label %14
32: ; preds = %14
%33 = load i32, i32* %4
%34 = icmp eq i32 %33, -1
br i1 %34, label %35, label %61
35: ; preds = %32
%36 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%37 = call i32 @strlen(i8* %36)
%38 = sub nsw i32 %37, 1
store i32 %38, i32* %3
%39 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%40 = load i8, i8* %39
%41 = sext i8 %40 to i32
%42 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %41)
store i32 1, i32* %2
br label %43
43: ; preds = %55, %35
%44 = load i32, i32* %2
%45 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%46 = call i32 @strlen(i8* %45)
%47 = icmp slt i32 %44, %46
br i1 %47, label %48, label %58
48: ; preds = %43
%49 = load i32, i32* %2
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 %50
%52 = load i8, i8* %51
%53 = sext i8 %52 to i32
%54 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %53)
br label %55
55: ; preds = %48
%56 = load i32, i32* %2
%57 = add nsw i32 %56, 1
store i32 %57, i32* %2
br label %43
58: ; preds = %43
%59 = load i32, i32* %3
%60 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %59)
br label %190
61: ; preds = %32
%62 = load i32, i32* %4
%63 = icmp ne i32 %62, -1
br i1 %63, label %64, label %100
64: ; preds = %61
%65 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%66 = load i8, i8* %65
%67 = sext i8 %66 to i32
%68 = icmp ne i32 %67, 48
br i1 %68, label %69, label %100
69: ; preds = %64
%70 = load i32, i32* %4
%71 = sub nsw i32 %70, 1
store i32 %71, i32* %3
%72 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%73 = load i8, i8* %72
%74 = sext i8 %73 to i32
%75 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %74)
store i32 1, i32* %2
br label %76
76: ; preds = %94, %69
%77 = load i32, i32* %2
%78 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%79 = call i32 @strlen(i8* %78)
%80 = sub nsw i32 %79, 1
%81 = icmp slt i32 %77, %80
br i1 %81, label %82, label %97
82: ; preds = %76
%83 = load i32, i32* %2
%84 = load i32, i32* %4
%85 = icmp eq i32 %83, %84
br i1 %85, label %86, label %87
86: ; preds = %82
br label %94
87: ; preds = %82
%88 = load i32, i32* %2
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 %89
%91 = load i8, i8* %90
%92 = sext i8 %91 to i32
%93 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %92)
br label %94
94: ; preds = %87, %86
%95 = load i32, i32* %2
%96 = add nsw i32 %95, 1
store i32 %96, i32* %2
br label %76
97: ; preds = %76
%98 = load i32, i32* %3
%99 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %98)
br label %189
100: ; preds = %64, %61
%101 = load i32, i32* %4
%102 = icmp ne i32 %101, -1
br i1 %102, label %103, label %188
103: ; preds = %100
%104 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%105 = load i8, i8* %104
%106 = sext i8 %105 to i32
%107 = icmp eq i32 %106, 48
br i1 %107, label %108, label %188
108: ; preds = %103
store i32 0, i32* %2
br label %109
109: ; preds = %139, %108
%110 = load i32, i32* %2
%111 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%112 = call i32 @strlen(i8* %111)
%113 = sub nsw i32 %112, 1
%114 = icmp slt i32 %110, %113
br i1 %114, label %115, label %142
115: ; preds = %109
%116 = load i32, i32* %2
%117 = sext i32 %116 to i64
%118 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 %117
%119 = load i8, i8* %118
%120 = sext i8 %119 to i32
%121 = icmp ne i32 %120, 46
br i1 %121, label %122, label %138
122: ; preds = %115
%123 = load i32, i32* %2
%124 = sext i32 %123 to i64
%125 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 %124
%126 = load i8, i8* %125
%127 = sext i8 %126 to i32
%128 = icmp sgt i32 %127, 48
br i1 %128, label %129, label %138
129: ; preds = %122
%130 = load i32, i32* %2
%131 = sext i32 %130 to i64
%132 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 %131
%133 = load i8, i8* %132
%134 = sext i8 %133 to i32
%135 = icmp sle i32 %134, 57
br i1 %135, label %136, label %138
136: ; preds = %129
%137 = load i32, i32* %2
store i32 %137, i32* %4
br label %138
138: ; preds = %136, %129, %122, %115
br label %139
139: ; preds = %138
%140 = load i32, i32* %2
%141 = add nsw i32 %140, 1
store i32 %141, i32* %2
br label %109
142: ; preds = %109
%143 = load i32, i32* %4
%144 = sub nsw i32 0, %143
%145 = add nsw i32 %144, 1
store i32 %145, i32* %3
%146 = load i32, i32* %4
%147 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%148 = call i32 @strlen(i8* %147)
%149 = sub nsw i32 %148, 2
%150 = icmp eq i32 %146, %149
br i1 %150, label %151, label %159
151: ; preds = %142
%152 = load i32, i32* %4
%153 = sext i32 %152 to i64
%154 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 %153
%155 = load i8, i8* %154
%156 = sext i8 %155 to i32
%157 = load i32, i32* %3
%158 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i32 %156, i32 %157)
br label %187
159: ; preds = %142
%160 = load i32, i32* %4
%161 = sub nsw i32 %160, 2
%162 = sext i32 %161 to i64
%163 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 %162
%164 = load i8, i8* %163
%165 = sext i8 %164 to i32
%166 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %165)
%167 = load i32, i32* %4
store i32 %167, i32* %2
br label %168
168: ; preds = %181, %159
%169 = load i32, i32* %2
%170 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%171 = call i32 @strlen(i8* %170)
%172 = sub nsw i32 %171, 1
%173 = icmp slt i32 %169, %172
br i1 %173, label %174, label %184
174: ; preds = %168
%175 = load i32, i32* %2
%176 = sext i32 %175 to i64
%177 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 %176
%178 = load i8, i8* %177
%179 = sext i8 %178 to i32
%180 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %179)
br label %181
181: ; preds = %174
%182 = load i32, i32* %2
%183 = add nsw i32 %182, 1
store i32 %183, i32* %2
br label %168
184: ; preds = %168
%185 = load i32, i32* %3
%186 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %185)
br label %187
187: ; preds = %184, %151
br label %188
188: ; preds = %187, %103, %100
br label %189
189: ; preds = %188, %97
br label %190
190: ; preds = %189, %58
br label %8
191: ; preds = %8
%192 = load i32, i32* @stdin
%193 = call i32 @fclose(i32 %192)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"sample3.in\00"
@.str.1 = [2 x i8] c"r\00"
@stdin = global i32 0
@.str.2 = [4 x i8] c"%c.\00"
@.str.3 = [3 x i8] c"%c\00"
@.str.4 = [5 x i8] c"e%d\0A\00"
@.str.5 = [7 x i8] c"%ce%d\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stdin
%4 = tail call i32 @freopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @stdin
%6 = call i64 @fgets(i8* %2, i32 200, i32 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %130, label %8
8: ; preds = %0, %126
%9 = call i32 @strlen(i8* %2)
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %25
11: ; preds = %8, %11
%12 = phi i64 [ %19, %11 ], [ 0, %8 ]
%13 = phi i32 [ %18, %11 ], [ -1, %8 ]
%14 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %12
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 46
%17 = trunc i64 %12 to i32
%18 = select i1 %16, i32 %17, i32 %13
%19 = add nuw nsw i64 %12, 1
%20 = call i32 @strlen(i8* %2)
%21 = sext i32 %20 to i64
%22 = icmp slt i64 %19, %21
br i1 %22, label %11, label %23
23: ; preds = %11
%24 = icmp eq i32 %18, -1
br i1 %24, label %25, label %45
25: ; preds = %8, %23
%26 = call i32 @strlen(i8* %2)
%27 = add nsw i32 %26, -1
%28 = load i8, i8* %2
%29 = sext i8 %28 to i32
%30 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %29)
%31 = call i32 @strlen(i8* %2)
%32 = icmp sgt i32 %31, 1
br i1 %32, label %33, label %43
33: ; preds = %25, %33
%34 = phi i64 [ %39, %33 ], [ 1, %25 ]
%35 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %34
%36 = load i8, i8* %35
%37 = sext i8 %36 to i32
%38 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %37)
%39 = add nuw nsw i64 %34, 1
%40 = call i32 @strlen(i8* %2)
%41 = sext i32 %40 to i64
%42 = icmp slt i64 %39, %41
br i1 %42, label %33, label %43
43: ; preds = %33, %25
%44 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %27)
br label %126
45: ; preds = %23
%46 = load i8, i8* %2
%47 = icmp eq i8 %46, 48
br i1 %47, label %48, label %51
48: ; preds = %45
%49 = call i32 @strlen(i8* %2)
%50 = icmp sgt i32 %49, 1
br i1 %50, label %75, label %89
51: ; preds = %45
%52 = sext i8 %46 to i32
%53 = add nsw i32 %18, -1
%54 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %52)
%55 = call i32 @strlen(i8* %2)
%56 = icmp sgt i32 %55, 2
br i1 %56, label %57, label %73
57: ; preds = %51
%58 = zext i32 %18 to i64
br label %59
59: ; preds = %57, %67
%60 = phi i64 [ 1, %57 ], [ %68, %67 ]
%61 = icmp eq i64 %60, %58
br i1 %61, label %67, label %62
62: ; preds = %59
%63 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %60
%64 = load i8, i8* %63
%65 = sext i8 %64 to i32
%66 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %65)
br label %67
67: ; preds = %59, %62
%68 = add nuw nsw i64 %60, 1
%69 = call i32 @strlen(i8* %2)
%70 = add nsw i32 %69, -1
%71 = sext i32 %70 to i64
%72 = icmp slt i64 %68, %71
br i1 %72, label %59, label %73
73: ; preds = %67, %51
%74 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %53)
br label %126
75: ; preds = %48, %75
%76 = phi i64 [ %84, %75 ], [ 0, %48 ]
%77 = phi i32 [ %83, %75 ], [ %18, %48 ]
%78 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %76
%79 = load i8, i8* %78
%80 = add i8 %79, -49
%81 = icmp ult i8 %80, 9
%82 = trunc i64 %76 to i32
%83 = select i1 %81, i32 %82, i32 %77
%84 = add nuw nsw i64 %76, 1
%85 = call i32 @strlen(i8* %2)
%86 = add nsw i32 %85, -1
%87 = sext i32 %86 to i64
%88 = icmp slt i64 %84, %87
br i1 %88, label %75, label %89
89: ; preds = %75, %48
%90 = phi i32 [ %18, %48 ], [ %83, %75 ]
%91 = sub i32 1, %90
%92 = call i32 @strlen(i8* %2)
%93 = add nsw i32 %92, -2
%94 = icmp eq i32 %90, %93
br i1 %94, label %95, label %101
95: ; preds = %89
%96 = sext i32 %90 to i64
%97 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %96
%98 = load i8, i8* %97
%99 = sext i8 %98 to i32
%100 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i32 %99, i32 %91)
br label %126
101: ; preds = %89
%102 = add nsw i32 %90, -2
%103 = sext i32 %102 to i64
%104 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %103
%105 = load i8, i8* %104
%106 = sext i8 %105 to i32
%107 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %106)
%108 = call i32 @strlen(i8* %2)
%109 = add nsw i32 %108, -1
%110 = icmp slt i32 %90, %109
br i1 %110, label %111, label %124
111: ; preds = %101
%112 = sext i32 %90 to i64
br label %113
113: ; preds = %111, %113
%114 = phi i64 [ %112, %111 ], [ %119, %113 ]
%115 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %114
%116 = load i8, i8* %115
%117 = sext i8 %116 to i32
%118 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %117)
%119 = add nsw i64 %114, 1
%120 = call i32 @strlen(i8* %2)
%121 = add nsw i32 %120, -1
%122 = sext i32 %121 to i64
%123 = icmp slt i64 %119, %122
br i1 %123, label %113, label %124
124: ; preds = %113, %101
%125 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %91)
br label %126
126: ; preds = %73, %95, %124, %43
%127 = load i32, i32* @stdin
%128 = call i64 @fgets(i8* %2, i32 200, i32 %127)
%129 = icmp eq i64 %128, 0
br i1 %129, label %130, label %8
130: ; preds = %126, %0
%131 = load i32, i32* @stdin
%132 = call i32 @fclose(i32 %131)
ret i32 0
}