#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 EOF;
int /*<<< orphan*/ printf(char *, char *);
int read_line(char *, int, int);
int /*<<< orphan*/ start_vet(char *, int);
int main(void) {
  int vet_pos = 0;
  char vet[100];
  while ((vet_pos = read_line(vet, 100, vet_pos)) != EOF) {
    if (vet_pos == (100 - 1)) {
      printf("Compact line: %s\n", vet);
      vet_pos = 0;
      start_vet(vet, 100);
    }
  }
  printf("Compact line: %s", vet);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    -0x70(%rbp),%rdi
mov    -0x8(%rbp),%edx
mov    $0x64,%esi
call   1050 <read_line@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e87(%rip),%rcx
cmp    (%rcx),%eax
je     119d <main+0x6d>
cmpl   $0x63,-0x8(%rbp)
jne    1198 <main+0x68>
lea    -0x70(%rbp),%rsi
lea    0xe82(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
lea    -0x70(%rbp),%rdi
mov    $0x64,%esi
call   1040 <start_vet@plt>
jmp    1146 <main+0x16>
lea    -0x70(%rbp),%rsi
lea    0xe6a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x70,%rsp
mov    %rsp,%rdi
mov    $0x64,%esi
xor    %edx,%edx
call   1050 <read_line@plt>
mov    0x2e99(%rip),%r15
cmp    (%r15),%eax
jne    116f <main+0x3f>
lea    0xeb7(%rip),%rdi
mov    %rsp,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret
lea    0xe8a(%rip),%r14
mov    %rsp,%rbx
jmp    1194 <main+0x64>
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x64,%esi
mov    %eax,%edx
call   1050 <read_line@plt>
cmp    (%r15),%eax
je     1154 <main+0x24>
cmp    $0x63,%eax
jne    1180 <main+0x50>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x64,%esi
call   1040 <start_vet@plt>
xor    %eax,%eax
jmp    1180 <main+0x50>

LLVM IR (-O0):
@EOF = global i32 0
@.str = [18 x i8] c"Compact line: %s\0A\00"
@.str.1 = [17 x i8] c"Compact line: %s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [100 x i8]
store i32 0, i32* %1
store i32 0, i32* %2
br label %4
4: ; preds = %18, %0
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%6 = load i32, i32* %2
%7 = call i32 @read_line(i8* %5, i32 100, i32 %6)
store i32 %7, i32* %2
%8 = load i32, i32* @EOF
%9 = icmp ne i32 %7, %8
br i1 %9, label %10, label %19
10: ; preds = %4
%11 = load i32, i32* %2
%12 = icmp eq i32 %11, 99
br i1 %12, label %13, label %18
13: ; preds = %10
%14 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%15 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %14)
store i32 0, i32* %2
%16 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%17 = call i32 @start_vet(i8* %16, i32 100)
br label %18
18: ; preds = %13, %10
br label %4
19: ; preds = %4
%20 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%21 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %20)
ret i32 0
}

LLVM IR (-O2):
@EOF = global i32 0
@.str = [18 x i8] c"Compact line: %s\0A\00"
@.str.1 = [17 x i8] c"Compact line: %s\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @read_line(i8* %2, i32 100, i32 0)
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
br i1 %5, label %17, label %6
6: ; preds = %0, %12
%7 = phi i32 [ %14, %12 ], [ %3, %0 ]
%8 = icmp eq i32 %7, 99
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %2)
%11 = call i32 @start_vet(i8* %2, i32 100)
br label %12
12: ; preds = %9, %6
%13 = phi i32 [ 0, %9 ], [ %7, %6 ]
%14 = call i32 @read_line(i8* %2, i32 100, i32 %13)
%15 = load i32, i32* @EOF
%16 = icmp eq i32 %14, %15
br i1 %16, label %17, label %6
17: ; preds = %12, %0
%18 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}