#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 */
char *Find_meta(char *);
char *safestrchr(char *, char);
void Clean_meta(char *t) {
  char *s = t;
  if (t) {
    while ((s = safestrchr(s, '\\')))
      *s = '/';
    s = t;
    for (s = t; (s = Find_meta(s)); ++s) {
      *s = '_';
    }
  }
}


x86 assembly (clang, -O0):
<Clean_meta>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     11b0 <Clean_meta+0x90>
jmp    1144 <Clean_meta+0x24>
mov    -0x10(%rbp),%rdi
mov    $0x5c,%esi
call   1030 <safestrchr@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     116c <Clean_meta+0x4c>
mov    -0x10(%rbp),%rax
movb   $0x2f,(%rax)
jmp    1144 <Clean_meta+0x24>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <Find_meta@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     11ab <Clean_meta+0x8b>
mov    -0x10(%rbp),%rax
movb   $0x5f,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    117c <Clean_meta+0x5c>
jmp    11b0 <Clean_meta+0x90>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Clean_meta>:
push   %rbx
test   %rdi,%rdi
je     1166 <Clean_meta+0x46>
mov    %rdi,%rbx
nopl   0x0(%rax)
mov    $0x5c,%esi
call   1030 <safestrchr@plt>
test   %rax,%rax
je     1147 <Clean_meta+0x27>
movb   $0x2f,(%rax)
mov    %rax,%rdi
jmp    1130 <Clean_meta+0x10>
mov    %rbx,%rdi
nopw   0x0(%rax,%rax,1)
call   1040 <Find_meta@plt>
test   %rax,%rax
je     1166 <Clean_meta+0x46>
movb   $0x5f,(%rax)
add    $0x1,%rax
mov    %rax,%rdi
jmp    1150 <Clean_meta+0x30>
pop    %rbx
ret

LLVM IR (-O0):
define void @Clean_meta(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
%5 = load i8*, i8** %2
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %27
7: ; preds = %1
br label %8
8: ; preds = %12, %7
%9 = load i8*, i8** %3
%10 = call i8* @safestrchr(i8* %9, i8 signext 92)
store i8* %10, i8** %3
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = load i8*, i8** %3
store i8 47, i8* %13
br label %8
14: ; preds = %8
%15 = load i8*, i8** %2
store i8* %15, i8** %3
%16 = load i8*, i8** %2
store i8* %16, i8** %3
br label %17
17: ; preds = %23, %14
%18 = load i8*, i8** %3
%19 = call i8* @Find_meta(i8* %18)
store i8* %19, i8** %3
%20 = icmp ne i8* %19, null
br i1 %20, label %21, label %26
21: ; preds = %17
%22 = load i8*, i8** %3
store i8 95, i8* %22
br label %23
23: ; preds = %21
%24 = load i8*, i8** %3
%25 = getelementptr inbounds i8, i8* %24, i32 1
store i8* %25, i8** %3
br label %17
26: ; preds = %17
br label %27
27: ; preds = %26, %1
ret void
}

LLVM IR (-O2):
define void @Clean_meta(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %18, label %3
3: ; preds = %1
%4 = tail call i8* @safestrchr(i8* %0, i8 signext 92)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %9
6: ; preds = %9, %3
%7 = tail call i8* @Find_meta(i8* %0)
%8 = icmp eq i8* %7, null
br i1 %8, label %18, label %13
9: ; preds = %3, %9
%10 = phi i8* [ %11, %9 ], [ %4, %3 ]
store i8 47, i8* %10
%11 = tail call i8* @safestrchr(i8* %10, i8 signext 92)
%12 = icmp eq i8* %11, null
br i1 %12, label %6, label %9
13: ; preds = %6, %13
%14 = phi i8* [ %16, %13 ], [ %7, %6 ]
store i8 95, i8* %14
%15 = getelementptr inbounds i8, i8* %14, i64 1
%16 = tail call i8* @Find_meta(i8* %15)
%17 = icmp eq i8* %16, null
br i1 %17, label %18, label %13
18: ; preds = %13, %6, %1
ret void
}