#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 */
scalar_t__ IS_KANJI(char *);
void normalize(char *p) {
  for (; *p; p++) {
    if (IS_KANJI(p))
      p++;
    else if (*p == '\\')
      *p = '/';
  }
}


x86 assembly (clang, -O0):
<normalize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     117f <normalize+0x6f>
mov    -0x8(%rbp),%rdi
call   1030 <IS_KANJI@plt>
cmp    $0x0,%rax
je     114d <normalize+0x3d>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1169 <normalize+0x59>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5c,%eax
jne    1164 <normalize+0x54>
mov    -0x8(%rbp),%rax
movb   $0x2f,(%rax)
jmp    1169 <normalize+0x59>
jmp    116e <normalize+0x5e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <normalize+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<normalize>:
push   %rbx
cmpb   $0x0,(%rdi)
je     1145 <normalize+0x35>
mov    %rdi,%rbx
jmp    112e <normalize+0x1e>
nopl   0x0(%rax,%rax,1)
add    $0x1,%rbx
cmpb   $0x0,0x1(%rbx)
lea    0x1(%rbx),%rbx
je     1145 <normalize+0x35>
mov    %rbx,%rdi
call   1030 <IS_KANJI@plt>
test   %rax,%rax
jne    1120 <normalize+0x10>
cmpb   $0x5c,(%rbx)
jne    1124 <normalize+0x14>
movb   $0x2f,(%rbx)
jmp    1124 <normalize+0x14>
pop    %rbx
ret

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

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