#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*/ arraycopy(char *, char *);
int strlen(char *);
void stripline(char line[]) {
  char c;
  int inTag;
  char save[32000];
  int i = 0;
  for (int j = 0; j < strlen(line); j++) {
    c = line[j];
    if (c == '<') {
      inTag = 1;
    }
    if (!inTag) {
      save[i] = c;
      i++;
    }
    if (c == '>') {
      inTag = 0;
    }
  }
  save[i] = '\0';
  arraycopy(save, line);
}


x86 assembly (clang, -O0):
<stripline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x7d20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x7d14(%rbp)
movl   $0x0,-0x7d18(%rbp)
mov    -0x7d18(%rbp),%eax
mov    %eax,-0x7d1c(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x7d1c(%rbp),%eax
cmp    %ecx,%eax
jge    11e4 <stripline+0xc4>
mov    -0x8(%rbp),%rax
movslq -0x7d18(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0x3c,%eax
jne    118d <stripline+0x6d>
movl   $0x1,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    11b7 <stripline+0x97>
mov    -0x9(%rbp),%cl
movslq -0x7d14(%rbp),%rax
mov    %cl,-0x7d10(%rbp,%rax,1)
mov    -0x7d14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7d14(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0x3e,%eax
jne    11cb <stripline+0xab>
movl   $0x0,-0x10(%rbp)
jmp    11d0 <stripline+0xb0>
mov    -0x7d18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7d18(%rbp)
jmp    1143 <stripline+0x23>
movslq -0x7d14(%rbp),%rax
movb   $0x0,-0x7d10(%rbp,%rax,1)
lea    -0x7d10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <arraycopy@plt>
add    $0x7d20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stripline>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x7d08,%rsp
mov    %rdi,%r14
call   1030 <strlen@plt>
test   %eax,%eax
jle    1185 <stripline+0x65>
xor    %r15d,%r15d
mov    $0x1,%r12d
xor    %ebp,%ebp
xor    %r13d,%r13d
jmp    1169 <stripline+0x49>
nopl   (%rax)
cmp    $0x3e,%al
cmove  %r15d,%ebx
add    $0x1,%rbp
mov    %r14,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbp
jge    1188 <stripline+0x68>
movzbl (%r14,%rbp,1),%eax
cmp    $0x3c,%al
cmove  %r12d,%ebx
test   %ebx,%ebx
jne    1150 <stripline+0x30>
movslq %r13d,%r13
mov    %al,(%rsp,%r13,1)
add    $0x1,%r13d
jmp    1150 <stripline+0x30>
xor    %r13d,%r13d
movslq %r13d,%rax
movb   $0x0,(%rsp,%rax,1)
mov    %rsp,%rdi
mov    %r14,%rsi
call   1040 <arraycopy@plt>
add    $0x7d08,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @stripline(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
%4 = alloca i32
%5 = alloca [32000 x i8]
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %6
store i32 0, i32* %7
br label %8
8: ; preds = %39, %1
%9 = load i32, i32* %7
%10 = load i8*, i8** %2
%11 = call i32 @strlen(i8* %10)
%12 = icmp slt i32 %9, %11
br i1 %12, label %13, label %42
13: ; preds = %8
%14 = load i8*, i8** %2
%15 = load i32, i32* %7
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
%18 = load i8, i8* %17
store i8 %18, i8* %3
%19 = load i8, i8* %3
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 60
br i1 %21, label %22, label %23
22: ; preds = %13
store i32 1, i32* %4
br label %23
23: ; preds = %22, %13
%24 = load i32, i32* %4
%25 = icmp ne i32 %24, 0
br i1 %25, label %33, label %26
26: ; preds = %23
%27 = load i8, i8* %3
%28 = load i32, i32* %6
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [32000 x i8], [32000 x i8]* %5, i64 0, i64 %29
store i8 %27, i8* %30
%31 = load i32, i32* %6
%32 = add nsw i32 %31, 1
store i32 %32, i32* %6
br label %33
33: ; preds = %26, %23
%34 = load i8, i8* %3
%35 = sext i8 %34 to i32
%36 = icmp eq i32 %35, 62
br i1 %36, label %37, label %38
37: ; preds = %33
store i32 0, i32* %4
br label %38
38: ; preds = %37, %33
br label %39
39: ; preds = %38
%40 = load i32, i32* %7
%41 = add nsw i32 %40, 1
store i32 %41, i32* %7
br label %8
42: ; preds = %8
%43 = load i32, i32* %6
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds [32000 x i8], [32000 x i8]* %5, i64 0, i64 %44
store i8 0, i8* %45
%46 = getelementptr inbounds [32000 x i8], [32000 x i8]* %5, i64 0, i64 0
%47 = load i8*, i8** %2
%48 = call i32 @arraycopy(i8* %46, i8* %47)
ret void
}

LLVM IR (-O2):
define void @stripline(i8* %0) {
%2 = alloca [32000 x i8]
%3 = getelementptr inbounds [32000 x i8], [32000 x i8]* %2, i64 0, i64 0
%4 = tail call i32 @strlen(i8* %0)
%5 = icmp sgt i32 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %24, %1
%7 = phi i32 [ 0, %1 ], [ %25, %24 ]
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [32000 x i8], [32000 x i8]* %2, i64 0, i64 %8
store i8 0, i8* %9
%10 = call i32 @arraycopy(i8* %3, i8* %0)
ret void
11: ; preds = %1, %24
%12 = phi i64 [ %28, %24 ], [ 0, %1 ]
%13 = phi i32 [ %25, %24 ], [ 0, %1 ]
%14 = phi i32 [ %27, %24 ], [ undef, %1 ]
%15 = getelementptr inbounds i8, i8* %0, i64 %12
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 60
%18 = select i1 %17, i32 1, i32 %14
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %24
20: ; preds = %11
%21 = sext i32 %13 to i64
%22 = getelementptr inbounds [32000 x i8], [32000 x i8]* %2, i64 0, i64 %21
store i8 %16, i8* %22
%23 = add nsw i32 %13, 1
br label %24
24: ; preds = %20, %11
%25 = phi i32 [ %13, %11 ], [ %23, %20 ]
%26 = icmp eq i8 %16, 62
%27 = select i1 %26, i32 0, i32 %18
%28 = add nuw nsw i64 %12, 1
%29 = tail call i32 @strlen(i8* %0)
%30 = sext i32 %29 to i64
%31 = icmp slt i64 %28, %30
br i1 %31, label %11, label %6
}