#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*/ crawlWarn(char *, char *);
char *strchr(char *, char);
int cleanresourceWinToUnix(char resource[]) {
  char *cp;
  if (strchr(resource, '\\') != NULL) {
    crawlWarn(
        "collection \"%s\" contains \"\\\" characters. Correct format is "
        "//host/shares not \\\\host\\shares. Will convert \"\\\" to \"/\"",
        resource);
    while ((cp = strchr(resource, '\\')) != NULL) {
      (*cp) = '/';
    }
  }
}


x86 assembly (clang, -O0):
<cleanresourceWinToUnix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x5c,%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
je     1181 <cleanresourceWinToUnix+0x61>
mov    -0x10(%rbp),%rsi
lea    0xeb1(%rip),%rdi
call   1040 <crawlWarn@plt>
mov    -0x10(%rbp),%rdi
mov    $0x5c,%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     117c <cleanresourceWinToUnix+0x5c>
mov    -0x18(%rbp),%rax
movb   $0x2f,(%rax)
jmp    1154 <cleanresourceWinToUnix+0x34>
jmp    1181 <cleanresourceWinToUnix+0x61>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleanresourceWinToUnix>:
push   %rbx
mov    %rdi,%rbx
mov    $0x5c,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1167 <cleanresourceWinToUnix+0x47>
lea    0xec6(%rip),%rdi
mov    %rbx,%rsi
call   1040 <crawlWarn@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    $0x5c,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1167 <cleanresourceWinToUnix+0x47>
movb   $0x2f,(%rax)
jmp    1150 <cleanresourceWinToUnix+0x30>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [116 x i8] c"collection \22%s\22 contains \22\\\22 characters. Correct format is //host/shares not \\\\host\\shares. Will convert \22\\\22 to \22/\22\00"
define i32 @cleanresourceWinToUnix(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @strchr(i8* %5, i8 signext 92)
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %18
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i32 @crawlWarn(i8* getelementptr inbounds ([116 x i8], [116 x i8]* @.str, i64 0, i64 0), i8* %9)
br label %11
11: ; preds = %15, %8
%12 = load i8*, i8** %3
%13 = call i8* @strchr(i8* %12, i8 signext 92)
store i8* %13, i8** %4
%14 = icmp ne i8* %13, null
br i1 %14, label %15, label %17
15: ; preds = %11
%16 = load i8*, i8** %4
store i8 47, i8* %16
br label %11
17: ; preds = %11
br label %18
18: ; preds = %17, %1
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
@.str = [116 x i8] c"collection \22%s\22 contains \22\\\22 characters. Correct format is //host/shares not \\\\host\\shares. Will convert \22\\\22 to \22/\22\00"
define i32 @cleanresourceWinToUnix(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 92)
%3 = icmp eq i8* %2, null
br i1 %3, label %12, label %4
4: ; preds = %1
%5 = tail call i32 @crawlWarn(i8* getelementptr inbounds ([116 x i8], [116 x i8]* @.str, i64 0, i64 0), i8* %0)
%6 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 92)
%7 = icmp eq i8* %6, null
br i1 %7, label %12, label %8
8: ; preds = %4, %8
%9 = phi i8* [ %10, %8 ], [ %6, %4 ]
store i8 47, i8* %9
%10 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 92)
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %8
12: ; preds = %8, %4, %1
ret i32 undef
}