#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 */
char getchar();
scalar_t__ malloc(long);
int /*<<< orphan*/ printf(char *);
scalar_t__ realloc(char *, long);
int /*<<< orphan*/ t_error(char *);
char *read_buffer_from_stdio(long maxbuffersize) {
  char *bffr = NULL;
  long int buffer_index = 0, buffer_size = 0, h;
  if (256 > maxbuffersize) {
    printf("\nWarning::BUFFERINCREMENT is larger than MAXBUFFERSIZE\n");
    buffer_size = maxbuffersize;
  } else {
    buffer_size = 256;
  }
  bffr = (char *)malloc(buffer_size * sizeof(char));
  if (bffr == NULL) {
    t_error("Cannot allocate the buffer");
  }
  bffr[buffer_size - 1] = '\0';
  bffr[0] = '\0';
  bffr[1] = '\0';
  bffr[2] = '\0';
  h = 1;
  while (!(bffr[0] == '/' && bffr[1] == '*' && bffr[2] == '*')) {
    if (h > 1) {
      printf("TO START A COMMENT DIGIT '/**' OTHERWISE 'N' \n");
    }
    do {
      bffr[0] = getchar();
      if (bffr[0] == 'N') {
        bffr[0] = '\0';
        return bffr;
      }
    } while (bffr[0] != '/');
    bffr[1] = getchar();
    bffr[2] = getchar();
    h++;
  }
  buffer_index = 0;
  do {
    if (buffer_index < buffer_size - 1) {
      bffr[buffer_index] = getchar();
      buffer_index++;
    } else {
      if (buffer_size == maxbuffersize) {
        printf("\nWarning::A very long comment has exceeded the maximum  "
               "buffer size\n");
        printf("Warning::Closing the comment\n");
        bffr[buffer_index - 2] = '\n';
        bffr[buffer_index - 3] = ' ';
        bffr[buffer_index - 4] = '.';
        bffr[buffer_index - 5] = '.';
        bffr[buffer_index - 6] = '.';
        bffr[buffer_index - 7] = ' ';
        break;
      } else if (buffer_size + 256 > maxbuffersize) {
        buffer_size = maxbuffersize;
        bffr = (char *)realloc(bffr, buffer_size * sizeof(char));
        if (bffr == NULL) {
          t_error("Cannot expand the buffer");
        }
        bffr[buffer_size - 1] = '\0';
      } else {
        buffer_size += 256;
        bffr = (char *)realloc(bffr, buffer_size * sizeof(char));
        if (bffr == NULL) {
          t_error("Cannot expand the buffer");
        }
        bffr[buffer_size - 1] = '\0';
      }
    }
  } while (!(bffr[buffer_index - 1] == '\n' && bffr[buffer_index - 2] == '/' &&
             bffr[buffer_index - 3] == '*'));
  bffr[buffer_index - 3] = '\0';
  return bffr;
}


x86 assembly (clang, -O0):
<read_buffer_from_stdio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    $0x100,%eax
cmp    -0x10(%rbp),%rax
jle    119c <read_buffer_from_stdio+0x4c>
lea    0xe76(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    11a4 <read_buffer_from_stdio+0x54>
movq   $0x100,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
shl    $0x0,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    11cc <read_buffer_from_stdio+0x7c>
lea    0xe71(%rip),%rdi
call   1070 <t_error@plt>
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rax
movb   $0x0,0x1(%rax)
mov    -0x18(%rbp),%rax
movb   $0x0,0x2(%rax)
movq   $0x1,-0x30(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x2f,%ecx
mov    %al,-0x31(%rbp)
jne    1237 <read_buffer_from_stdio+0xe7>
mov    -0x18(%rbp),%rax
movsbl 0x1(%rax),%ecx
xor    %eax,%eax
cmp    $0x2a,%ecx
mov    %al,-0x31(%rbp)
jne    1237 <read_buffer_from_stdio+0xe7>
mov    -0x18(%rbp),%rax
movsbl 0x2(%rax),%eax
cmp    $0x2a,%eax
sete   %al
mov    %al,-0x31(%rbp)
mov    -0x31(%rbp),%al
xor    $0xff,%al
test   $0x1,%al
jne    1249 <read_buffer_from_stdio+0xf9>
jmp    12de <read_buffer_from_stdio+0x18e>
cmpq   $0x1,-0x30(%rbp)
jle    1260 <read_buffer_from_stdio+0x110>
lea    0xdf8(%rip),%rdi
call   1030 <printf@plt>
jmp    1265 <read_buffer_from_stdio+0x115>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x4e,%eax
jne    1298 <read_buffer_from_stdio+0x148>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    14db <read_buffer_from_stdio+0x38b>
jmp    129d <read_buffer_from_stdio+0x14d>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    1265 <read_buffer_from_stdio+0x115>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    11fb <read_buffer_from_stdio+0xab>
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x28(%rbp),%rcx
sub    $0x1,%rcx
cmp    %rcx,%rax
jge    1320 <read_buffer_from_stdio+0x1d0>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,%dl
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    145c <read_buffer_from_stdio+0x30c>
mov    -0x28(%rbp),%rax
cmp    -0x10(%rbp),%rax
jne    13ab <read_buffer_from_stdio+0x25b>
lea    0xd4d(%rip),%rdi
call   1030 <printf@plt>
lea    0xd86(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
sub    $0x2,%rcx
movb   $0xa,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
sub    $0x3,%rcx
movb   $0x20,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
sub    $0x4,%rcx
movb   $0x2e,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
sub    $0x5,%rcx
movb   $0x2e,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
sub    $0x6,%rcx
movb   $0x2e,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
sub    $0x7,%rcx
movb   $0x20,(%rax,%rcx,1)
jmp    14c3 <read_buffer_from_stdio+0x373>
mov    -0x28(%rbp),%rax
add    $0x100,%rax
cmp    -0x10(%rbp),%rax
jle    1408 <read_buffer_from_stdio+0x2b8>
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x28(%rbp),%rsi
shl    $0x0,%rsi
call   1060 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    13f3 <read_buffer_from_stdio+0x2a3>
lea    0xcf7(%rip),%rdi
call   1070 <t_error@plt>
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    1452 <read_buffer_from_stdio+0x302>
mov    -0x28(%rbp),%rax
add    $0x100,%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x28(%rbp),%rsi
shl    $0x0,%rsi
call   1060 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1442 <read_buffer_from_stdio+0x2f2>
lea    0xca8(%rip),%rdi
call   1070 <t_error@plt>
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    1457 <read_buffer_from_stdio+0x307>
jmp    145c <read_buffer_from_stdio+0x30c>
jmp    1461 <read_buffer_from_stdio+0x311>
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
sub    $0x1,%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0x32(%rbp)
jne    14b6 <read_buffer_from_stdio+0x366>
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
sub    $0x2,%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x2f,%ecx
mov    %al,-0x32(%rbp)
jne    14b6 <read_buffer_from_stdio+0x366>
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
sub    $0x3,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2a,%eax
sete   %al
mov    %al,-0x32(%rbp)
mov    -0x32(%rbp),%al
xor    $0xff,%al
test   $0x1,%al
jne    12e6 <read_buffer_from_stdio+0x196>
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
sub    $0x3,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_buffer_from_stdio>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x100,%r15d
cmp    $0xff,%rdi
jg     117c <read_buffer_from_stdio+0x2c>
lea    0xf4f(%rip),%rdi
call   1030 <puts@plt>
mov    %r14,%r15
mov    %r15,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1198 <read_buffer_from_stdio+0x48>
lea    0xe6d(%rip),%rdi
call   1070 <t_error@plt>
movb   $0x0,-0x1(%r15,%rbx,1)
movw   $0x0,(%rbx)
movb   $0x0,0x2(%rbx)
mov    $0x1,%ebp
lea    0xee2(%rip),%r12
xor    %eax,%eax
xor    %ecx,%ecx
cmp    $0x2f,%cl
jne    11c6 <read_buffer_from_stdio+0x76>
cmpb   $0x2a,0x1(%rbx)
jne    11c6 <read_buffer_from_stdio+0x76>
cmp    $0x2a,%al
je     122a <read_buffer_from_stdio+0xda>
cmp    $0x2,%rbp
jb     11e0 <read_buffer_from_stdio+0x90>
mov    %r12,%rdi
call   1030 <puts@plt>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %al,(%rbx)
cmp    $0x4e,%al
je     1212 <read_buffer_from_stdio+0xc2>
cmp    $0x2f,%al
jne    11e0 <read_buffer_from_stdio+0x90>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %al,0x1(%rbx)
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %al,0x2(%rbx)
add    $0x1,%rbp
mov    (%rbx),%cl
cmp    $0x2f,%cl
je     11bc <read_buffer_from_stdio+0x6c>
jmp    11c6 <read_buffer_from_stdio+0x76>
mov    %rbx,%rax
movb   $0x0,(%rax)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xdea(%rip),%r12
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    -0x1(%r15),%rax
cmp    %rax,%rbp
jge    1260 <read_buffer_from_stdio+0x110>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %al,(%rbx,%rbp,1)
add    $0x1,%rbp
cmpb   $0xa,-0x1(%rbp,%rbx,1)
jne    1240 <read_buffer_from_stdio+0xf0>
jmp    12df <read_buffer_from_stdio+0x18f>
cmp    %r14,%r15
je     1304 <read_buffer_from_stdio+0x1b4>
lea    0x100(%r15),%r13
mov    %rbx,%rdi
cmp    %r14,%r13
jle    12b0 <read_buffer_from_stdio+0x160>
mov    %r14,%rsi
call   1060 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1290 <read_buffer_from_stdio+0x140>
mov    %r12,%rdi
call   1070 <t_error@plt>
movb   $0x0,-0x1(%rbx,%r14,1)
mov    %r14,%r15
cmpb   $0xa,-0x1(%rbp,%rbx,1)
jne    1240 <read_buffer_from_stdio+0xf0>
jmp    12df <read_buffer_from_stdio+0x18f>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r13,%rsi
call   1060 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    12c8 <read_buffer_from_stdio+0x178>
mov    %r12,%rdi
call   1070 <t_error@plt>
movb   $0x0,0xff(%r15,%rbx,1)
mov    %r13,%r15
cmpb   $0xa,-0x1(%rbp,%rbx,1)
jne    1240 <read_buffer_from_stdio+0xf0>
cmpb   $0x2f,-0x2(%rbp,%rbx,1)
jne    1240 <read_buffer_from_stdio+0xf0>
cmpb   $0x2a,-0x3(%rbx,%rbp,1)
jne    1240 <read_buffer_from_stdio+0xf0>
add    $0xfffffffffffffffd,%rbp
mov    %rbp,%rax
add    %rbx,%rax
jmp    1215 <read_buffer_from_stdio+0xc5>
lea    0xd29(%rip),%rdi
call   1030 <puts@plt>
lea    0xd61(%rip),%rdi
call   1030 <puts@plt>
lea    -0x3(%rbp),%rax
movw   $0xa20,-0x3(%rbx,%rbp,1)
movl   $0x2e2e2e20,-0x7(%rbp,%rbx,1)
2e
add    %rbx,%rax
jmp    1215 <read_buffer_from_stdio+0xc5>

LLVM IR (-O0):
@.str = [56 x i8] c"\0AWarning::BUFFERINCREMENT is larger than MAXBUFFERSIZE\0A\00"
@.str.1 = [27 x i8] c"Cannot allocate the buffer\00"
@.str.2 = [47 x i8] c"TO START A COMMENT DIGIT '/**' OTHERWISE 'N' \0A\00"
@.str.3 = [69 x i8] c"\0AWarning::A very long comment has exceeded the maximum buffer size\0A\00"
@.str.4 = [30 x i8] c"Warning::Closing the comment\0A\00"
@.str.5 = [25 x i8] c"Cannot expand the buffer\00"
define i8* @read_buffer_from_stdio(i64 %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i64 %0, i64* %3
store i8* null, i8** %4
store i64 0, i64* %5
store i64 0, i64* %6
%8 = load i64, i64* %3
%9 = icmp sgt i64 256, %8
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%12 = load i64, i64* %3
store i64 %12, i64* %6
br label %14
13: ; preds = %1
store i64 256, i64* %6
br label %14
14: ; preds = %13, %10
%15 = load i64, i64* %6
%16 = mul i64 %15, 1
%17 = call i64 @malloc(i64 %16)
%18 = inttoptr i64 %17 to i8*
store i8* %18, i8** %4
%19 = load i8*, i8** %4
%20 = icmp eq i8* %19, null
br i1 %20, label %21, label %23
21: ; preds = %14
%22 = call i32 @t_error(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
br label %23
23: ; preds = %21, %14
%24 = load i8*, i8** %4
%25 = load i64, i64* %6
%26 = sub nsw i64 %25, 1
%27 = getelementptr inbounds i8, i8* %24, i64 %26
store i8 0, i8* %27
%28 = load i8*, i8** %4
%29 = getelementptr inbounds i8, i8* %28, i64 0
store i8 0, i8* %29
%30 = load i8*, i8** %4
%31 = getelementptr inbounds i8, i8* %30, i64 1
store i8 0, i8* %31
%32 = load i8*, i8** %4
%33 = getelementptr inbounds i8, i8* %32, i64 2
store i8 0, i8* %33
store i64 1, i64* %7
br label %34
34: ; preds = %81, %23
%35 = load i8*, i8** %4
%36 = getelementptr inbounds i8, i8* %35, i64 0
%37 = load i8, i8* %36
%38 = sext i8 %37 to i32
%39 = icmp eq i32 %38, 47
br i1 %39, label %40, label %52
40: ; preds = %34
%41 = load i8*, i8** %4
%42 = getelementptr inbounds i8, i8* %41, i64 1
%43 = load i8, i8* %42
%44 = sext i8 %43 to i32
%45 = icmp eq i32 %44, 42
br i1 %45, label %46, label %52
46: ; preds = %40
%47 = load i8*, i8** %4
%48 = getelementptr inbounds i8, i8* %47, i64 2
%49 = load i8, i8* %48
%50 = sext i8 %49 to i32
%51 = icmp eq i32 %50, 42
br label %52
52: ; preds = %46, %40, %34
%53 = phi i1 [ false, %40 ], [ false, %34 ], [ %51, %46 ]
%54 = xor i1 %53, true
br i1 %54, label %55, label %90
55: ; preds = %52
%56 = load i64, i64* %7
%57 = icmp sgt i64 %56, 1
br i1 %57, label %58, label %60
58: ; preds = %55
%59 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0))
br label %60
60: ; preds = %58, %55
br label %61
61: ; preds = %75, %60
%62 = call signext i8 (...) @getchar()
%63 = load i8*, i8** %4
%64 = getelementptr inbounds i8, i8* %63, i64 0
store i8 %62, i8* %64
%65 = load i8*, i8** %4
%66 = getelementptr inbounds i8, i8* %65, i64 0
%67 = load i8, i8* %66
%68 = sext i8 %67 to i32
%69 = icmp eq i32 %68, 78
br i1 %69, label %70, label %74
70: ; preds = %61
%71 = load i8*, i8** %4
%72 = getelementptr inbounds i8, i8* %71, i64 0
store i8 0, i8* %72
%73 = load i8*, i8** %4
store i8* %73, i8** %2
br label %208
74: ; preds = %61
br label %75
75: ; preds = %74
%76 = load i8*, i8** %4
%77 = getelementptr inbounds i8, i8* %76, i64 0
%78 = load i8, i8* %77
%79 = sext i8 %78 to i32
%80 = icmp ne i32 %79, 47
br i1 %80, label %61, label %81
81: ; preds = %75
%82 = call signext i8 (...) @getchar()
%83 = load i8*, i8** %4
%84 = getelementptr inbounds i8, i8* %83, i64 1
store i8 %82, i8* %84
%85 = call signext i8 (...) @getchar()
%86 = load i8*, i8** %4
%87 = getelementptr inbounds i8, i8* %86, i64 2
store i8 %85, i8* %87
%88 = load i64, i64* %7
%89 = add nsw i64 %88, 1
store i64 %89, i64* %7
br label %34
90: ; preds = %52
store i64 0, i64* %5
br label %91
91: ; preds = %199, %90
%92 = load i64, i64* %5
%93 = load i64, i64* %6
%94 = sub nsw i64 %93, 1
%95 = icmp slt i64 %92, %94
br i1 %95, label %96, label %103
96: ; preds = %91
%97 = call signext i8 (...) @getchar()
%98 = load i8*, i8** %4
%99 = load i64, i64* %5
%100 = getelementptr inbounds i8, i8* %98, i64 %99
store i8 %97, i8* %100
%101 = load i64, i64* %5
%102 = add nsw i64 %101, 1
store i64 %102, i64* %5
br label %174
103: ; preds = %91
%104 = load i64, i64* %6
%105 = load i64, i64* %3
%106 = icmp eq i64 %104, %105
br i1 %106, label %107, label %134
107: ; preds = %103
%108 = call i32 @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.3, i64 0, i64 0))
%109 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0))
%110 = load i8*, i8** %4
%111 = load i64, i64* %5
%112 = sub nsw i64 %111, 2
%113 = getelementptr inbounds i8, i8* %110, i64 %112
store i8 10, i8* %113
%114 = load i8*, i8** %4
%115 = load i64, i64* %5
%116 = sub nsw i64 %115, 3
%117 = getelementptr inbounds i8, i8* %114, i64 %116
store i8 32, i8* %117
%118 = load i8*, i8** %4
%119 = load i64, i64* %5
%120 = sub nsw i64 %119, 4
%121 = getelementptr inbounds i8, i8* %118, i64 %120
store i8 46, i8* %121
%122 = load i8*, i8** %4
%123 = load i64, i64* %5
%124 = sub nsw i64 %123, 5
%125 = getelementptr inbounds i8, i8* %122, i64 %124
store i8 46, i8* %125
%126 = load i8*, i8** %4
%127 = load i64, i64* %5
%128 = sub nsw i64 %127, 6
%129 = getelementptr inbounds i8, i8* %126, i64 %128
store i8 46, i8* %129
%130 = load i8*, i8** %4
%131 = load i64, i64* %5
%132 = sub nsw i64 %131, 7
%133 = getelementptr inbounds i8, i8* %130, i64 %132
store i8 32, i8* %133
br label %202
134: ; preds = %103
%135 = load i64, i64* %6
%136 = add nsw i64 %135, 256
%137 = load i64, i64* %3
%138 = icmp sgt i64 %136, %137
br i1 %138, label %139, label %155
139: ; preds = %134
%140 = load i64, i64* %3
store i64 %140, i64* %6
%141 = load i8*, i8** %4
%142 = load i64, i64* %6
%143 = mul i64 %142, 1
%144 = call i64 @realloc(i8* %141, i64 %143)
%145 = inttoptr i64 %144 to i8*
store i8* %145, i8** %4
%146 = load i8*, i8** %4
%147 = icmp eq i8* %146, null
br i1 %147, label %148, label %150
148: ; preds = %139
%149 = call i32 @t_error(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0))
br label %150
150: ; preds = %148, %139
%151 = load i8*, i8** %4
%152 = load i64, i64* %6
%153 = sub nsw i64 %152, 1
%154 = getelementptr inbounds i8, i8* %151, i64 %153
store i8 0, i8* %154
br label %172
155: ; preds = %134
%156 = load i64, i64* %6
%157 = add nsw i64 %156, 256
store i64 %157, i64* %6
%158 = load i8*, i8** %4
%159 = load i64, i64* %6
%160 = mul i64 %159, 1
%161 = call i64 @realloc(i8* %158, i64 %160)
%162 = inttoptr i64 %161 to i8*
store i8* %162, i8** %4
%163 = load i8*, i8** %4
%164 = icmp eq i8* %163, null
br i1 %164, label %165, label %167
165: ; preds = %155
%166 = call i32 @t_error(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0))
br label %167
167: ; preds = %165, %155
%168 = load i8*, i8** %4
%169 = load i64, i64* %6
%170 = sub nsw i64 %169, 1
%171 = getelementptr inbounds i8, i8* %168, i64 %170
store i8 0, i8* %171
br label %172
172: ; preds = %167, %150
br label %173
173: ; preds = %172
br label %174
174: ; preds = %173, %96
br label %175
175: ; preds = %174
%176 = load i8*, i8** %4
%177 = load i64, i64* %5
%178 = sub nsw i64 %177, 1
%179 = getelementptr inbounds i8, i8* %176, i64 %178
%180 = load i8, i8* %179
%181 = sext i8 %180 to i32
%182 = icmp eq i32 %181, 10
br i1 %182, label %183, label %199
183: ; preds = %175
%184 = load i8*, i8** %4
%185 = load i64, i64* %5
%186 = sub nsw i64 %185, 2
%187 = getelementptr inbounds i8, i8* %184, i64 %186
%188 = load i8, i8* %187
%189 = sext i8 %188 to i32
%190 = icmp eq i32 %189, 47
br i1 %190, label %191, label %199
191: ; preds = %183
%192 = load i8*, i8** %4
%193 = load i64, i64* %5
%194 = sub nsw i64 %193, 3
%195 = getelementptr inbounds i8, i8* %192, i64 %194
%196 = load i8, i8* %195
%197 = sext i8 %196 to i32
%198 = icmp eq i32 %197, 42
br label %199
199: ; preds = %191, %183, %175
%200 = phi i1 [ false, %183 ], [ false, %175 ], [ %198, %191 ]
%201 = xor i1 %200, true
br i1 %201, label %91, label %202
202: ; preds = %199, %107
%203 = load i8*, i8** %4
%204 = load i64, i64* %5
%205 = sub nsw i64 %204, 3
%206 = getelementptr inbounds i8, i8* %203, i64 %205
store i8 0, i8* %206
%207 = load i8*, i8** %4
store i8* %207, i8** %2
br label %208
208: ; preds = %202, %70
%209 = load i8*, i8** %2
ret i8* %209
}

LLVM IR (-O2):
@.str.1 = [27 x i8] c"Cannot allocate the buffer\00"
@.str.5 = [25 x i8] c"Cannot expand the buffer\00"
@str = [68 x i8] c"\0AWarning::A very long comment has exceeded the maximum buffer size\00"
@str.6 = [29 x i8] c"Warning::Closing the comment\00"
@str.7 = [46 x i8] c"TO START A COMMENT DIGIT '/**' OTHERWISE 'N' \00"
@str.8 = [55 x i8] c"\0AWarning::BUFFERINCREMENT is larger than MAXBUFFERSIZE\00"
define i8* @read_buffer_from_stdio(i64 %0) {
%2 = icmp slt i64 %0, 256
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str.8, i64 0, i64 0))
br label %5
5: ; preds = %1, %3
%6 = phi i64 [ %0, %3 ], [ 256, %1 ]
%7 = tail call i64 @malloc(i64 %6)
%8 = inttoptr i64 %7 to i8*
%9 = icmp eq i64 %7, 0
br i1 %9, label %10, label %12
10: ; preds = %5
%11 = tail call i32 @t_error(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %5
%13 = add nsw i64 %6, -1
%14 = getelementptr inbounds i8, i8* %8, i64 %13
store i8 0, i8* %14
store i8 0, i8* %8
%15 = getelementptr inbounds i8, i8* %8, i64 1
store i8 0, i8* %15
%16 = getelementptr inbounds i8, i8* %8, i64 2
store i8 0, i8* %16
br label %17
17: ; preds = %36, %12
%18 = phi i8 [ %38, %36 ], [ 0, %12 ]
%19 = phi i8 [ %40, %36 ], [ 0, %12 ]
%20 = phi i64 [ %39, %36 ], [ 1, %12 ]
%21 = icmp eq i8 %19, 47
br i1 %21, label %22, label %29
22: ; preds = %17
%23 = load i8, i8* %15
%24 = icmp eq i8 %23, 42
%25 = icmp eq i8 %18, 42
%26 = and i1 %24, %25
br i1 %26, label %27, label %29
27: ; preds = %22
%28 = add nsw i64 %0, -1
br label %41
29: ; preds = %17, %22
%30 = icmp ugt i64 %20, 1
br i1 %30, label %31, label %33
31: ; preds = %29
%32 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.7, i64 0, i64 0))
br label %33
33: ; preds = %31, %29
br label %34
34: ; preds = %33, %34
%35 = tail call signext i8 (...) @getchar()
store i8 %35, i8* %8
switch i8 %35, label %34 [
i8 78, label %111
i8 47, label %36
]
36: ; preds = %34
%37 = tail call signext i8 (...) @getchar()
store i8 %37, i8* %15
%38 = tail call signext i8 (...) @getchar()
store i8 %38, i8* %16
%39 = add nuw nsw i64 %20, 1
%40 = load i8, i8* %8
br label %17
41: ; preds = %106, %27
%42 = phi i8* [ %8, %27 ], [ %89, %106 ]
%43 = phi i64 [ 0, %27 ], [ %90, %106 ]
%44 = phi i64 [ %6, %27 ], [ %91, %106 ]
%45 = add nsw i64 %44, -1
%46 = icmp slt i64 %43, %45
br i1 %46, label %47, label %51
47: ; preds = %41
%48 = tail call signext i8 (...) @getchar()
%49 = getelementptr inbounds i8, i8* %42, i64 %43
store i8 %48, i8* %49
%50 = add nsw i64 %43, 1
br label %88
51: ; preds = %41
%52 = icmp eq i64 %44, %0
br i1 %52, label %53, label %68
53: ; preds = %51
%54 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([68 x i8], [68 x i8]* @str, i64 0, i64 0))
%55 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.6, i64 0, i64 0))
%56 = add nsw i64 %43, -2
%57 = getelementptr inbounds i8, i8* %42, i64 %56
store i8 10, i8* %57
%58 = add nsw i64 %43, -3
%59 = getelementptr inbounds i8, i8* %42, i64 %58
store i8 32, i8* %59
%60 = add nsw i64 %43, -4
%61 = getelementptr inbounds i8, i8* %42, i64 %60
store i8 46, i8* %61
%62 = add nsw i64 %43, -5
%63 = getelementptr inbounds i8, i8* %42, i64 %62
store i8 46, i8* %63
%64 = add nsw i64 %43, -6
%65 = getelementptr inbounds i8, i8* %42, i64 %64
store i8 46, i8* %65
%66 = add nsw i64 %43, -7
%67 = getelementptr inbounds i8, i8* %42, i64 %66
store i8 32, i8* %67
br label %107
68: ; preds = %51
%69 = add nsw i64 %44, 256
%70 = icmp sgt i64 %69, %0
br i1 %70, label %71, label %79
71: ; preds = %68
%72 = tail call i64 @realloc(i8* %42, i64 %0)
%73 = inttoptr i64 %72 to i8*
%74 = icmp eq i64 %72, 0
br i1 %74, label %75, label %77
75: ; preds = %71
%76 = tail call i32 @t_error(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0))
br label %77
77: ; preds = %75, %71
%78 = getelementptr inbounds i8, i8* %73, i64 %28
store i8 0, i8* %78
br label %88
79: ; preds = %68
%80 = tail call i64 @realloc(i8* %42, i64 %69)
%81 = inttoptr i64 %80 to i8*
%82 = icmp eq i64 %80, 0
br i1 %82, label %83, label %85
83: ; preds = %79
%84 = tail call i32 @t_error(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0))
br label %85
85: ; preds = %83, %79
%86 = add nsw i64 %44, 255
%87 = getelementptr inbounds i8, i8* %81, i64 %86
store i8 0, i8* %87
br label %88
88: ; preds = %47, %77, %85
%89 = phi i8* [ %42, %47 ], [ %73, %77 ], [ %81, %85 ]
%90 = phi i64 [ %50, %47 ], [ %43, %77 ], [ %43, %85 ]
%91 = phi i64 [ %44, %47 ], [ %0, %77 ], [ %69, %85 ]
%92 = add nsw i64 %90, -1
%93 = getelementptr inbounds i8, i8* %89, i64 %92
%94 = load i8, i8* %93
%95 = icmp eq i8 %94, 10
br i1 %95, label %96, label %106
96: ; preds = %88
%97 = add nsw i64 %90, -2
%98 = getelementptr inbounds i8, i8* %89, i64 %97
%99 = load i8, i8* %98
%100 = icmp eq i8 %99, 47
br i1 %100, label %101, label %106
101: ; preds = %96
%102 = add nsw i64 %90, -3
%103 = getelementptr inbounds i8, i8* %89, i64 %102
%104 = load i8, i8* %103
%105 = icmp eq i8 %104, 42
br i1 %105, label %107, label %106
106: ; preds = %101, %96, %88
br label %41
107: ; preds = %101, %53
%108 = phi i64 [ %58, %53 ], [ %102, %101 ]
%109 = phi i8* [ %42, %53 ], [ %89, %101 ]
%110 = getelementptr inbounds i8, i8* %109, i64 %108
br label %111
111: ; preds = %34, %107
%112 = phi i8* [ %110, %107 ], [ %8, %34 ]
%113 = phi i8* [ %109, %107 ], [ %8, %34 ]
store i8 0, i8* %112
ret i8* %113
}