#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*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
char *strtok(char *, char *);
void removeRepeat(char *homee, char *arra) {
  if (arra[1] == 'h') {
    int ccc = 0;
    char res[512];
    strcpy(res, "");
    char *ar = strtok(arra, "/");
    while (ar != NULL) {
      if (ccc > 1) {
        strcat(res, "/");
        strcat(res, ar);
      }
      ar = strtok(NULL, "/");
      ccc++;
    }
    strcpy(arra, res);
  }
}


x86 assembly (clang, -O0):
<removeRepeat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x230,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x68,%eax
jne    11f8 <removeRepeat+0xc8>
movl   $0x0,-0x14(%rbp)
lea    -0x220(%rbp),%rdi
lea    0xe98(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rdi
lea    0xe87(%rip),%rsi
call   1040 <strtok@plt>
mov    %rax,-0x228(%rbp)
cmpq   $0x0,-0x228(%rbp)
je     11e8 <removeRepeat+0xb8>
cmpl   $0x1,-0x14(%rbp)
jle    11c3 <removeRepeat+0x93>
lea    -0x220(%rbp),%rdi
lea    0xe55(%rip),%rsi
call   1050 <strcat@plt>
lea    -0x220(%rbp),%rdi
mov    -0x228(%rbp),%rsi
call   1050 <strcat@plt>
xor    %eax,%eax
mov    %eax,%edi
lea    0xe32(%rip),%rsi
call   1040 <strtok@plt>
mov    %rax,-0x228(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1185 <removeRepeat+0x55>
mov    -0x10(%rbp),%rdi
lea    -0x220(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x230,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<removeRepeat>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x208,%rsp
cmpb   $0x68,0x1(%rsi)
jne    11e3 <removeRepeat+0xb3>
mov    %rsi,%r14
lea    0xeaf(%rip),%rsi
mov    %rsp,%rdi
call   1030 <strcpy@plt>
lea    0xe9f(%rip),%rsi
mov    %r14,%rdi
call   1040 <strtok@plt>
test   %rax,%rax
je     11d8 <removeRepeat+0xa8>
lea    0xe8b(%rip),%rsi
xor    %edi,%edi
call   1040 <strtok@plt>
test   %rax,%rax
je     11d8 <removeRepeat+0xa8>
lea    0xe78(%rip),%rsi
xor    %edi,%edi
call   1040 <strtok@plt>
test   %rax,%rax
je     11d8 <removeRepeat+0xa8>
mov    %rax,%rbx
lea    0xe62(%rip),%r15
mov    %rsp,%r12
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r12,%rdi
mov    %r15,%rsi
call   1050 <strcat@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1050 <strcat@plt>
xor    %edi,%edi
mov    %r15,%rsi
call   1040 <strtok@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    11b0 <removeRepeat+0x80>
mov    %rsp,%rsi
mov    %r14,%rdi
call   1030 <strcpy@plt>
add    $0x208,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [2 x i8] c"/\00"
define void @removeRepeat(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca [512 x i8]
%7 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%8 = load i8*, i8** %4
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 104
br i1 %12, label %13, label %38
13: ; preds = %2
store i32 0, i32* %5
%14 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%15 = call i32 @strcpy(i8* %14, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%16 = load i8*, i8** %4
%17 = call i8* @strtok(i8* %16, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i8* %17, i8** %7
br label %18
18: ; preds = %30, %13
%19 = load i8*, i8** %7
%20 = icmp ne i8* %19, null
br i1 %20, label %21, label %34
21: ; preds = %18
%22 = load i32, i32* %5
%23 = icmp sgt i32 %22, 1
br i1 %23, label %24, label %30
24: ; preds = %21
%25 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%26 = call i32 @strcat(i8* %25, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%27 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%28 = load i8*, i8** %7
%29 = call i32 @strcat(i8* %27, i8* %28)
br label %30
30: ; preds = %24, %21
%31 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i8* %31, i8** %7
%32 = load i32, i32* %5
%33 = add nsw i32 %32, 1
store i32 %33, i32* %5
br label %18
34: ; preds = %18
%35 = load i8*, i8** %4
%36 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%37 = call i32 @strcpy(i8* %35, i8* %36)
br label %38
38: ; preds = %34, %2
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [2 x i8] c"/\00"
define void @removeRepeat(i8* nocapture readnone %0, i8* %1) {
%3 = alloca [512 x i8]
%4 = getelementptr inbounds i8, i8* %1, i64 1
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 104
br i1 %6, label %7, label %26
7: ; preds = %2
%8 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%9 = call i32 @strcpy(i8* %8, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%10 = call i8* @strtok(i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%11 = icmp eq i8* %10, null
br i1 %11, label %24, label %12
12: ; preds = %7
%13 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%14 = icmp eq i8* %13, null
br i1 %14, label %24, label %15
15: ; preds = %12
%16 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%17 = icmp eq i8* %16, null
br i1 %17, label %24, label %18
18: ; preds = %15, %18
%19 = phi i8* [ %22, %18 ], [ %16, %15 ]
%20 = call i32 @strcat(i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%21 = call i32 @strcat(i8* %8, i8* %19)
%22 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%23 = icmp eq i8* %22, null
br i1 %23, label %24, label %18
24: ; preds = %18, %12, %15, %7
%25 = call i32 @strcpy(i8* %1, i8* %8)
br label %26
26: ; preds = %24, %2
ret void
}