#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*/ mudstrlcat(char *, char *, int);
char *one_argument(char const *, char *);
scalar_t__ strcmp(char *, char *);
int strlen(char *);
void remove_area_names(const char *inp, char *out) {
  char buf[1024], *pbuf = buf;
  int len;
  *out = '\0';
  while (inp && *inp) {
    inp = one_argument(inp, buf);
    if ((len = strlen(buf)) < 5 || strcmp(".are", pbuf + len - 4)) {
      if (*out)
        mudstrlcat(out, " ", 1024);
      mudstrlcat(out, buf, 1024);
    }
  }
}


x86 assembly (clang, -O0):
<remove_area_names>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x410(%rbp),%rax
mov    %rax,-0x418(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x41d(%rbp)
je     118e <remove_area_names+0x4e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x41d(%rbp)
mov    -0x41d(%rbp),%al
test   $0x1,%al
jne    11a1 <remove_area_names+0x61>
jmp    1237 <remove_area_names+0xf7>
mov    -0x8(%rbp),%rdi
lea    -0x410(%rbp),%rsi
call   1050 <one_argument@plt>
mov    %rax,-0x8(%rbp)
lea    -0x410(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x41c(%rbp)
cmp    $0x5,%eax
jl     11fb <remove_area_names+0xbb>
mov    -0x418(%rbp),%rsi
movslq -0x41c(%rbp),%rax
add    %rax,%rsi
add    $0xfffffffffffffffc,%rsi
lea    0xe14(%rip),%rdi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     1232 <remove_area_names+0xf2>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     121d <remove_area_names+0xdd>
mov    -0x10(%rbp),%rdi
lea    0xdf2(%rip),%rsi
mov    $0x400,%edx
call   1060 <mudstrlcat@plt>
mov    -0x10(%rbp),%rdi
lea    -0x410(%rbp),%rsi
mov    $0x400,%edx
call   1060 <mudstrlcat@plt>
jmp    1168 <remove_area_names+0x28>
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_area_names>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x400,%rsp
movb   $0x0,(%rsi)
test   %rdi,%rdi
je     11e4 <remove_area_names+0xa4>
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsp,%r15
lea    0xe99(%rip),%r12
lea    0xe8d(%rip),%r13
jmp    1195 <remove_area_names+0x55>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
mov    %r15,%rsi
mov    $0x400,%edx
call   1060 <mudstrlcat@plt>
test   %rbx,%rbx
je     11e4 <remove_area_names+0xa4>
cmpb   $0x0,(%rbx)
je     11e4 <remove_area_names+0xa4>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <one_argument@plt>
mov    %rax,%rbx
mov    %r15,%rdi
call   1030 <strlen@plt>
cmp    $0x5,%eax
jl     11cc <remove_area_names+0x8c>
mov    %eax,%eax
lea    (%rsp,%rax,1),%rsi
add    $0xfffffffffffffffc,%rsi
mov    %r13,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1190 <remove_area_names+0x50>
cmpb   $0x0,(%r14)
je     1180 <remove_area_names+0x40>
mov    %r14,%rdi
mov    %r12,%rsi
mov    $0x400,%edx
call   1060 <mudstrlcat@plt>
jmp    1180 <remove_area_names+0x40>
add    $0x400,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [5 x i8] c".are\00"
@.str.1 = [2 x i8] c" \00"
define void @remove_area_names(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [1024 x i8]
%6 = alloca i8*
%7 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
store i8* %8, i8** %6
%9 = load i8*, i8** %4
store i8 0, i8* %9
br label %10
10: ; preds = %46, %2
%11 = load i8*, i8** %3
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %18
13: ; preds = %10
%14 = load i8*, i8** %3
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp ne i32 %16, 0
br label %18
18: ; preds = %13, %10
%19 = phi i1 [ false, %10 ], [ %17, %13 ]
br i1 %19, label %20, label %47
20: ; preds = %18
%21 = load i8*, i8** %3
%22 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%23 = call i8* @one_argument(i8* %21, i8* %22)
store i8* %23, i8** %3
%24 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%25 = call i32 @strlen(i8* %24)
store i32 %25, i32* %7
%26 = icmp slt i32 %25, 5
br i1 %26, label %35, label %27
27: ; preds = %20
%28 = load i8*, i8** %6
%29 = load i32, i32* %7
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i8, i8* %28, i64 %30
%32 = getelementptr inbounds i8, i8* %31, i64 -4
%33 = call i64 @strcmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %32)
%34 = icmp ne i64 %33, 0
br i1 %34, label %35, label %46
35: ; preds = %27, %20
%36 = load i8*, i8** %4
%37 = load i8, i8* %36
%38 = icmp ne i8 %37, 0
br i1 %38, label %39, label %42
39: ; preds = %35
%40 = load i8*, i8** %4
%41 = call i32 @mudstrlcat(i8* %40, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1024)
br label %42
42: ; preds = %39, %35
%43 = load i8*, i8** %4
%44 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%45 = call i32 @mudstrlcat(i8* %43, i8* %44, i32 1024)
br label %46
46: ; preds = %42, %27
br label %10
47: ; preds = %18
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c".are\00"
@.str.1 = [2 x i8] c" \00"
define void @remove_area_names(i8* %0, i8* %1) {
%3 = alloca [1024 x i8]
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
store i8 0, i8* %1
%5 = icmp eq i8* %0, null
br i1 %5, label %29, label %6
6: ; preds = %2, %27
%7 = phi i8* [ %11, %27 ], [ %0, %2 ]
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 0
br i1 %9, label %29, label %10
10: ; preds = %6
%11 = call i8* @one_argument(i8* %7, i8* %4)
%12 = call i32 @strlen(i8* %4)
%13 = icmp slt i32 %12, 5
br i1 %13, label %20, label %14
14: ; preds = %10
%15 = zext i32 %12 to i64
%16 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 %15
%17 = getelementptr inbounds i8, i8* %16, i64 -4
%18 = call i64 @strcmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %17)
%19 = icmp eq i64 %18, 0
br i1 %19, label %27, label %20
20: ; preds = %14, %10
%21 = load i8, i8* %1
%22 = icmp eq i8 %21, 0
br i1 %22, label %25, label %23
23: ; preds = %20
%24 = call i32 @mudstrlcat(i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1024)
br label %25
25: ; preds = %23, %20
%26 = call i32 @mudstrlcat(i8* %1, i8* %4, i32 1024)
br label %27
27: ; preds = %25, %14
%28 = icmp eq i8* %11, null
br i1 %28, label %29, label %6
29: ; preds = %6, %27, %2
ret void
}