#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*/ _store_8(unsigned long, int);
unsigned long str32_charindex(char *, int);
int str32_charsearch(char *, int, int);
unsigned long str32_strlen(char *);
char *pass_space_label(char *target_str) {
  while (str32_charsearch(target_str, 1, 0x20) != -1) {
    target_str++;
  }
  if (str32_charsearch(target_str, 1, 0x2E) != -1) {
    unsigned long int length_temp = str32_charindex(target_str, 0x20);
    if (length_temp == -1)
      length_temp = str32_strlen(target_str);
    if (length_temp != -1) {
      target_str += length_temp;
      if (str32_charsearch(target_str, 1, 0x20) != -1) {
        while (str32_charsearch(target_str, 1, 0x20) != -1) {
          target_str++;
        }
      } else {
        _store_8((unsigned long int)target_str, 0x20);
        target_str++;
      }
    }
  }
  return target_str;
}


x86 assembly (clang, -O0):
<pass_space_label>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
mov    $0x20,%edx
call   1060 <str32_charsearch@plt>
cmp    $0xffffffff,%eax
je     1179 <pass_space_label+0x39>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    114c <pass_space_label+0xc>
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
mov    $0x2e,%edx
call   1060 <str32_charsearch@plt>
cmp    $0xffffffff,%eax
je     124d <pass_space_label+0x10d>
mov    -0x8(%rbp),%rdi
mov    $0x20,%esi
call   1040 <str32_charindex@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0xffffffffffffffff,-0x10(%rbp)
jne    11bf <pass_space_label+0x7f>
mov    -0x8(%rbp),%rdi
call   1030 <str32_strlen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0xffffffffffffffff,-0x10(%rbp)
je     1248 <pass_space_label+0x108>
mov    -0x10(%rbp),%rax
add    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
mov    $0x20,%edx
call   1060 <str32_charsearch@plt>
cmp    $0xffffffff,%eax
je     1229 <pass_space_label+0xe9>
jmp    11f7 <pass_space_label+0xb7>
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
mov    $0x20,%edx
call   1060 <str32_charsearch@plt>
cmp    $0xffffffff,%eax
je     1224 <pass_space_label+0xe4>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    11f7 <pass_space_label+0xb7>
jmp    1243 <pass_space_label+0x103>
mov    -0x8(%rbp),%rdi
mov    $0x20,%esi
call   1050 <_store_8@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1248 <pass_space_label+0x108>
jmp    124d <pass_space_label+0x10d>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pass_space_label>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    -0x1(%rdi),%r14
nop
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x20,%edx
call   1060 <str32_charsearch@plt>
add    $0x1,%rbx
add    $0x1,%r14
cmp    $0xffffffff,%eax
jne    1150 <pass_space_label+0x10>
lea    -0x1(%rbx),%r15
mov    %r15,%rdi
mov    $0x1,%esi
mov    $0x2e,%edx
call   1060 <str32_charsearch@plt>
cmp    $0xffffffff,%eax
je     1213 <pass_space_label+0xd3>
mov    %r15,%rdi
mov    $0x20,%esi
call   1040 <str32_charindex@plt>
mov    %rax,%r12
cmp    $0xffffffffffffffff,%rax
jne    11b5 <pass_space_label+0x75>
mov    %r15,%rdi
call   1030 <str32_strlen@plt>
mov    %rax,%r12
cmp    $0xffffffffffffffff,%rax
je     1213 <pass_space_label+0xd3>
lea    (%rbx,%r12,1),%rdi
add    $0xffffffffffffffff,%rdi
mov    $0x1,%esi
mov    $0x20,%edx
call   1060 <str32_charsearch@plt>
cmp    $0xffffffff,%eax
je     11fd <pass_space_label+0xbd>
lea    (%rbx,%r12,1),%r15
add    $0xfffffffffffffffe,%r15
nopl   0x0(%rax)
add    $0x1,%r15
mov    %r15,%rdi
mov    $0x1,%esi
mov    $0x20,%edx
call   1060 <str32_charsearch@plt>
cmp    $0xffffffff,%eax
jne    11e0 <pass_space_label+0xa0>
jmp    1213 <pass_space_label+0xd3>
add    %r12,%r14
mov    %r14,%rdi
mov    $0x20,%esi
call   1050 <_store_8@plt>
add    %r12,%rbx
mov    %rbx,%r15
mov    %r15,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @pass_space_label(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
br label %4
4: ; preds = %8, %1
%5 = load i8*, i8** %2
%6 = call i32 @str32_charsearch(i8* %5, i32 1, i32 32)
%7 = icmp ne i32 %6, -1
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %2
br label %4
11: ; preds = %4
%12 = load i8*, i8** %2
%13 = call i32 @str32_charsearch(i8* %12, i32 1, i32 46)
%14 = icmp ne i32 %13, -1
br i1 %14, label %15, label %50
15: ; preds = %11
%16 = load i8*, i8** %2
%17 = call i64 @str32_charindex(i8* %16, i32 32)
store i64 %17, i64* %3
%18 = load i64, i64* %3
%19 = icmp eq i64 %18, -1
br i1 %19, label %20, label %23
20: ; preds = %15
%21 = load i8*, i8** %2
%22 = call i64 @str32_strlen(i8* %21)
store i64 %22, i64* %3
br label %23
23: ; preds = %20, %15
%24 = load i64, i64* %3
%25 = icmp ne i64 %24, -1
br i1 %25, label %26, label %49
26: ; preds = %23
%27 = load i64, i64* %3
%28 = load i8*, i8** %2
%29 = getelementptr inbounds i8, i8* %28, i64 %27
store i8* %29, i8** %2
%30 = load i8*, i8** %2
%31 = call i32 @str32_charsearch(i8* %30, i32 1, i32 32)
%32 = icmp ne i32 %31, -1
br i1 %32, label %33, label %42
33: ; preds = %26
br label %34
34: ; preds = %38, %33
%35 = load i8*, i8** %2
%36 = call i32 @str32_charsearch(i8* %35, i32 1, i32 32)
%37 = icmp ne i32 %36, -1
br i1 %37, label %38, label %41
38: ; preds = %34
%39 = load i8*, i8** %2
%40 = getelementptr inbounds i8, i8* %39, i32 1
store i8* %40, i8** %2
br label %34
41: ; preds = %34
br label %48
42: ; preds = %26
%43 = load i8*, i8** %2
%44 = ptrtoint i8* %43 to i64
%45 = call i32 @_store_8(i64 %44, i32 32)
%46 = load i8*, i8** %2
%47 = getelementptr inbounds i8, i8* %46, i32 1
store i8* %47, i8** %2
br label %48
48: ; preds = %42, %41
br label %49
49: ; preds = %48, %23
br label %50
50: ; preds = %49, %11
%51 = load i8*, i8** %2
ret i8* %51
}

LLVM IR (-O2):
define i8* @pass_space_label(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = tail call i32 @str32_charsearch(i8* %3, i32 1, i32 32)
%5 = icmp eq i32 %4, -1
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = tail call i32 @str32_charsearch(i8* %3, i32 1, i32 46)
%9 = icmp eq i32 %8, -1
br i1 %9, label %30, label %10
10: ; preds = %7
%11 = tail call i64 @str32_charindex(i8* %3, i32 32)
%12 = icmp eq i64 %11, -1
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = tail call i64 @str32_strlen(i8* %3)
%15 = icmp eq i64 %14, -1
br i1 %15, label %30, label %16
16: ; preds = %10, %13
%17 = phi i64 [ %14, %13 ], [ %11, %10 ]
%18 = getelementptr inbounds i8, i8* %3, i64 %17
%19 = tail call i32 @str32_charsearch(i8* %18, i32 1, i32 32)
%20 = icmp eq i32 %19, -1
br i1 %20, label %26, label %21
21: ; preds = %16, %21
%22 = phi i8* [ %25, %21 ], [ %18, %16 ]
%23 = tail call i32 @str32_charsearch(i8* %22, i32 1, i32 32)
%24 = icmp eq i32 %23, -1
%25 = getelementptr inbounds i8, i8* %22, i64 1
br i1 %24, label %30, label %21
26: ; preds = %16
%27 = ptrtoint i8* %18 to i64
%28 = tail call i32 @_store_8(i64 %27, i32 32)
%29 = getelementptr inbounds i8, i8* %18, i64 1
br label %30
30: ; preds = %21, %13, %26, %7
%31 = phi i8* [ %3, %7 ], [ %29, %26 ], [ %3, %13 ], [ %22, %21 ]
ret i8* %31
}