#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*/ clear_first_string(char *, char *);
int /*<<< orphan*/ clear_str(char *);
int /*<<< orphan*/ del_sys_symb(char *, char *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
scalar_t__ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ put_str(char *);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
void main() {
  FILE *tmp_file, *source_file;
  char str1[5000];
  char str2[5000];
  char str_tmp[5000];
  int i = 0;
  int j = 0;
  short int str_num = 0;
  short int index_of_symbol = 0;
  short int sc = 0;
  short int prev = 0;
  char concat = 0;
  source_file = fopen("source_file", "r");
  while (fgets(str1, 800, source_file) != 0) {
    if (str1[0] == '<') {
      if (strlen(str_tmp) != 0)
        put_str(str_tmp);
      clear_str(str2);
      del_sys_symb(str2, str1);
      clear_str(str_tmp);
      strcpy(str_tmp, str2);
      clear_str(str2);
      clear_str(str1);
      prev = 1;
      concat = 0;
    } else {
      str_tmp[strlen(str_tmp) - 1] = ' ';
      strcat(str_tmp, str1);
      clear_str(str1);
      del_sys_symb(str1, str_tmp);
      clear_str(str_tmp);
      strcpy(str_tmp, str1);
      clear_str(str1);
      prev = 0;
      concat = 1;
    };
    if (sc == 0) {
      clear_str(str1);
      clear_first_string(str1, str_tmp);
      clear_str(str_tmp);
      strcpy(str_tmp, str1);
      clear_str(str1);
    }
    sc += 1;
  };
  put_str(str_tmp);
  fclose(source_file);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3ae0,%rsp
movl   $0x0,-0x3ac4(%rbp)
movl   $0x0,-0x3ac8(%rbp)
movw   $0x0,-0x3aca(%rbp)
movw   $0x0,-0x3acc(%rbp)
movw   $0x0,-0x3ace(%rbp)
movw   $0x0,-0x3ad0(%rbp)
movb   $0x0,-0x3ad1(%rbp)
lea    0xe0f(%rip),%rdi
lea    0xe14(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x10(%rbp)
lea    -0x13a0(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x320,%esi
call   1080 <fgets@plt>
cmp    $0x0,%rax
je     13b2 <main+0x212>
movsbl -0x13a0(%rbp),%eax
cmp    $0x3c,%eax
jne    12bc <main+0x11c>
lea    -0x3ac0(%rbp),%rdi
call   1050 <strlen@plt>
cmp    $0x0,%eax
je     1251 <main+0xb1>
lea    -0x3ac0(%rbp),%rdi
call   10b0 <put_str@plt>
lea    -0x2730(%rbp),%rdi
call   1090 <clear_str@plt>
lea    -0x2730(%rbp),%rdi
lea    -0x13a0(%rbp),%rsi
call   1070 <del_sys_symb@plt>
lea    -0x3ac0(%rbp),%rdi
call   1090 <clear_str@plt>
lea    -0x3ac0(%rbp),%rdi
lea    -0x2730(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x2730(%rbp),%rdi
call   1090 <clear_str@plt>
lea    -0x13a0(%rbp),%rdi
call   1090 <clear_str@plt>
movw   $0x1,-0x3ad0(%rbp)
movb   $0x0,-0x3ad1(%rbp)
jmp    1342 <main+0x1a2>
lea    -0x3ac0(%rbp),%rdi
call   1050 <strlen@plt>
sub    $0x1,%eax
cltq
movb   $0x20,-0x3ac0(%rbp,%rax,1)
20
lea    -0x3ac0(%rbp),%rdi
lea    -0x13a0(%rbp),%rsi
call   10c0 <strcat@plt>
lea    -0x13a0(%rbp),%rdi
call   1090 <clear_str@plt>
lea    -0x13a0(%rbp),%rdi
lea    -0x3ac0(%rbp),%rsi
call   1070 <del_sys_symb@plt>
lea    -0x3ac0(%rbp),%rdi
call   1090 <clear_str@plt>
lea    -0x3ac0(%rbp),%rdi
lea    -0x13a0(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x13a0(%rbp),%rdi
call   1090 <clear_str@plt>
movw   $0x0,-0x3ad0(%rbp)
movb   $0x1,-0x3ad1(%rbp)
movswl -0x3ace(%rbp),%eax
cmp    $0x0,%eax
jne    139c <main+0x1fc>
lea    -0x13a0(%rbp),%rdi
call   1090 <clear_str@plt>
lea    -0x13a0(%rbp),%rdi
lea    -0x3ac0(%rbp),%rsi
call   1060 <clear_first_string@plt>
lea    -0x3ac0(%rbp),%rdi
call   1090 <clear_str@plt>
lea    -0x3ac0(%rbp),%rdi
lea    -0x13a0(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x13a0(%rbp),%rdi
call   1090 <clear_str@plt>
movswl -0x3ace(%rbp),%eax
add    $0x1,%eax
mov    %ax,-0x3ace(%rbp)
jmp    1201 <main+0x61>
lea    -0x3ac0(%rbp),%rdi
call   10b0 <put_str@plt>
mov    -0x10(%rbp),%rdi
call   1040 <fclose@plt>
add    $0x3ae0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x3aa8,%rsp
lea    0xe48(%rip),%rdi
lea    0xe4d(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,%r14
mov    %rsp,%rdi
mov    $0x320,%esi
mov    %rax,%rdx
call   1080 <fgets@plt>
test   %rax,%rax
je     12f0 <main+0x150>
xor    %ebp,%ebp
lea    0x1390(%rsp),%r12
lea    0x2720(%rsp),%r15
mov    %rsp,%r13
jmp    121f <main+0x7f>
nopw   0x0(%rax,%rax,1)
movswl %bp,%ebp
add    $0x1,%ebp
mov    %r13,%rdi
mov    $0x320,%esi
mov    %r14,%rdx
call   1080 <fgets@plt>
test   %rax,%rax
je     12f0 <main+0x150>
movzbl (%rsp),%ebx
mov    %r12,%rdi
call   1050 <strlen@plt>
cmp    $0x3c,%bl
jne    1270 <main+0xd0>
test   %eax,%eax
je     123c <main+0x9c>
mov    %r12,%rdi
call   10b0 <put_str@plt>
mov    %r15,%rdi
call   1090 <clear_str@plt>
mov    %r15,%rdi
mov    %r13,%rsi
call   1070 <del_sys_symb@plt>
mov    %r12,%rdi
call   1090 <clear_str@plt>
mov    %r12,%rdi
mov    %r15,%rsi
call   1030 <strcpy@plt>
mov    %r15,%rdi
call   1090 <clear_str@plt>
jmp    12a9 <main+0x109>
nopl   0x0(%rax)
cltq
movb   $0x20,-0x1(%rax,%r12,1)
mov    %r12,%rdi
mov    %r13,%rsi
call   10c0 <strcat@plt>
mov    %r13,%rdi
call   1090 <clear_str@plt>
mov    %r13,%rdi
mov    %r12,%rsi
call   1070 <del_sys_symb@plt>
mov    %r12,%rdi
call   1090 <clear_str@plt>
mov    %r12,%rdi
mov    %r13,%rsi
call   1030 <strcpy@plt>
mov    %r13,%rdi
call   1090 <clear_str@plt>
test   $0xffff,%ebp
jne    1200 <main+0x60>
mov    %r13,%rdi
call   1090 <clear_str@plt>
mov    %r13,%rdi
mov    %r12,%rsi
call   1060 <clear_first_string@plt>
mov    %r12,%rdi
call   1090 <clear_str@plt>
mov    %r12,%rdi
mov    %r13,%rsi
call   1030 <strcpy@plt>
mov    %r13,%rdi
call   1090 <clear_str@plt>
jmp    1200 <main+0x60>
lea    0x1390(%rsp),%rdi
call   10b0 <put_str@plt>
mov    %r14,%rdi
call   1040 <fclose@plt>
add    $0x3aa8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [12 x i8] c"source_file\00"
@.str.1 = [2 x i8] c"r\00"
define void @main() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca [5000 x i8]
%4 = alloca [5000 x i8]
%5 = alloca [5000 x i8]
%6 = alloca i32
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i16
%11 = alloca i16
%12 = alloca i8
store i32 0, i32* %6
store i32 0, i32* %7
store i16 0, i16* %8
store i16 0, i16* %9
store i16 0, i16* %10
store i16 0, i16* %11
store i8 0, i8* %12
%13 = call i32* @fopen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %13, i32** %2
br label %14
14: ; preds = %84, %0
%15 = getelementptr inbounds [5000 x i8], [5000 x i8]* %3, i64 0, i64 0
%16 = load i32*, i32** %2
%17 = call i64 @fgets(i8* %15, i32 800, i32* %16)
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %89
19: ; preds = %14
%20 = getelementptr inbounds [5000 x i8], [5000 x i8]* %3, i64 0, i64 0
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = icmp eq i32 %22, 60
br i1 %23, label %24, label %46
24: ; preds = %19
%25 = getelementptr inbounds [5000 x i8], [5000 x i8]* %5, i64 0, i64 0
%26 = call i32 @strlen(i8* %25)
%27 = icmp ne i32 %26, 0
br i1 %27, label %28, label %31
28: ; preds = %24
%29 = getelementptr inbounds [5000 x i8], [5000 x i8]* %5, i64 0, i64 0
%30 = call i32 @put_str(i8* %29)
br label %31
31: ; preds = %28, %24
%32 = getelementptr inbounds [5000 x i8], [5000 x i8]* %4, i64 0, i64 0
%33 = call i32 @clear_str(i8* %32)
%34 = getelementptr inbounds [5000 x i8], [5000 x i8]* %4, i64 0, i64 0
%35 = getelementptr inbounds [5000 x i8], [5000 x i8]* %3, i64 0, i64 0
%36 = call i32 @del_sys_symb(i8* %34, i8* %35)
%37 = getelementptr inbounds [5000 x i8], [5000 x i8]* %5, i64 0, i64 0
%38 = call i32 @clear_str(i8* %37)
%39 = getelementptr inbounds [5000 x i8], [5000 x i8]* %5, i64 0, i64 0
%40 = getelementptr inbounds [5000 x i8], [5000 x i8]* %4, i64 0, i64 0
%41 = call i32 @strcpy(i8* %39, i8* %40)
%42 = getelementptr inbounds [5000 x i8], [5000 x i8]* %4, i64 0, i64 0
%43 = call i32 @clear_str(i8* %42)
%44 = getelementptr inbounds [5000 x i8], [5000 x i8]* %3, i64 0, i64 0
%45 = call i32 @clear_str(i8* %44)
store i16 1, i16* %11
store i8 0, i8* %12
br label %67
46: ; preds = %19
%47 = getelementptr inbounds [5000 x i8], [5000 x i8]* %5, i64 0, i64 0
%48 = call i32 @strlen(i8* %47)
%49 = sub nsw i32 %48, 1
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds [5000 x i8], [5000 x i8]* %5, i64 0, i64 %50
store i8 32, i8* %51
%52 = getelementptr inbounds [5000 x i8], [5000 x i8]* %5, i64 0, i64 0
%53 = getelementptr inbounds [5000 x i8], [5000 x i8]* %3, i64 0, i64 0
%54 = call i32 @strcat(i8* %52, i8* %53)
%55 = getelementptr inbounds [5000 x i8], [5000 x i8]* %3, i64 0, i64 0
%56 = call i32 @clear_str(i8* %55)
%57 = getelementptr inbounds [5000 x i8], [5000 x i8]* %3, i64 0, i64 0
%58 = getelementptr inbounds [5000 x i8], [5000 x i8]* %5, i64 0, i64 0
%59 = call i32 @del_sys_symb(i8* %57, i8* %58)
%60 = getelementptr inbounds [5000 x i8], [5000 x i8]* %5, i64 0, i64 0
%61 = call i32 @clear_str(i8* %60)
%62 = getelementptr inbounds [5000 x i8], [5000 x i8]* %5, i64 0, i64 0
%63 = getelementptr inbounds [5000 x i8], [5000 x i8]* %3, i64 0, i64 0
%64 = call i32 @strcpy(i8* %62, i8* %63)
%65 = getelementptr inbounds [5000 x i8], [5000 x i8]* %3, i64 0, i64 0
%66 = call i32 @clear_str(i8* %65)
store i16 0, i16* %11
store i8 1, i8* %12
br label %67
67: ; preds = %46, %31
%68 = load i16, i16* %10
%69 = sext i16 %68 to i32
%70 = icmp eq i32 %69, 0
br i1 %70, label %71, label %84
71: ; preds = %67
%72 = getelementptr inbounds [5000 x i8], [5000 x i8]* %3, i64 0, i64 0
%73 = call i32 @clear_str(i8* %72)
%74 = getelementptr inbounds [5000 x i8], [5000 x i8]* %3, i64 0, i64 0
%75 = getelementptr inbounds [5000 x i8], [5000 x i8]* %5, i64 0, i64 0
%76 = call i32 @clear_first_string(i8* %74, i8* %75)
%77 = getelementptr inbounds [5000 x i8], [5000 x i8]* %5, i64 0, i64 0
%78 = call i32 @clear_str(i8* %77)
%79 = getelementptr inbounds [5000 x i8], [5000 x i8]* %5, i64 0, i64 0
%80 = getelementptr inbounds [5000 x i8], [5000 x i8]* %3, i64 0, i64 0
%81 = call i32 @strcpy(i8* %79, i8* %80)
%82 = getelementptr inbounds [5000 x i8], [5000 x i8]* %3, i64 0, i64 0
%83 = call i32 @clear_str(i8* %82)
br label %84
84: ; preds = %71, %67
%85 = load i16, i16* %10
%86 = sext i16 %85 to i32
%87 = add nsw i32 %86, 1
%88 = trunc i32 %87 to i16
store i16 %88, i16* %10
br label %14
89: ; preds = %14
%90 = getelementptr inbounds [5000 x i8], [5000 x i8]* %5, i64 0, i64 0
%91 = call i32 @put_str(i8* %90)
%92 = load i32*, i32** %2
%93 = call i32 @fclose(i32* %92)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"source_file\00"
@.str.1 = [2 x i8] c"r\00"
define void @main() {
%1 = alloca [5000 x i8]
%2 = alloca [5000 x i8]
%3 = alloca [5000 x i8]
%4 = getelementptr inbounds [5000 x i8], [5000 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [5000 x i8], [5000 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [5000 x i8], [5000 x i8]* %3, i64 0, i64 0
%7 = tail call i32* @fopen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%8 = call i64 @fgets(i8* %4, i32 800, i32* %7)
%9 = icmp eq i64 %8, 0
br i1 %9, label %49, label %10
10: ; preds = %0, %45
%11 = phi i32 [ %46, %45 ], [ 0, %0 ]
%12 = load i8, i8* %4
%13 = icmp eq i8 %12, 60
%14 = call i32 @strlen(i8* %6)
br i1 %13, label %15, label %25
15: ; preds = %10
%16 = icmp eq i32 %14, 0
br i1 %16, label %19, label %17
17: ; preds = %15
%18 = call i32 @put_str(i8* %6)
br label %19
19: ; preds = %17, %15
%20 = call i32 @clear_str(i8* %5)
%21 = call i32 @del_sys_symb(i8* %5, i8* %4)
%22 = call i32 @clear_str(i8* %6)
%23 = call i32 @strcpy(i8* %6, i8* %5)
%24 = call i32 @clear_str(i8* %5)
br label %34
25: ; preds = %10
%26 = add nsw i32 %14, -1
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [5000 x i8], [5000 x i8]* %3, i64 0, i64 %27
store i8 32, i8* %28
%29 = call i32 @strcat(i8* %6, i8* %4)
%30 = call i32 @clear_str(i8* %4)
%31 = call i32 @del_sys_symb(i8* %4, i8* %6)
%32 = call i32 @clear_str(i8* %6)
%33 = call i32 @strcpy(i8* %6, i8* %4)
br label %34
34: ; preds = %25, %19
%35 = call i32 @clear_str(i8* %4)
%36 = shl i32 %11, 16
%37 = ashr exact i32 %36, 16
%38 = icmp eq i32 %36, 0
br i1 %38, label %39, label %45
39: ; preds = %34
%40 = call i32 @clear_str(i8* %4)
%41 = call i32 @clear_first_string(i8* %4, i8* %6)
%42 = call i32 @clear_str(i8* %6)
%43 = call i32 @strcpy(i8* %6, i8* %4)
%44 = call i32 @clear_str(i8* %4)
br label %45
45: ; preds = %39, %34
%46 = add nsw i32 %37, 1
%47 = call i64 @fgets(i8* %4, i32 800, i32* %7)
%48 = icmp eq i64 %47, 0
br i1 %48, label %49, label %10
49: ; preds = %45, %0
%50 = call i32 @put_str(i8* %6)
%51 = call i32 @fclose(i32* %7)
ret void
}