#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*/ gets(char *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ system(char *);
int zm(char);
int main(int argc, char *argv[]) {
  char a[] = {0}, *p;
  int n;
  system("reset");
  gets(a);
  p = a;
  for (n = zm(*p); *p != '\0' && *(p + 1) != '\0'; p++)
    if ((!zm(*p)) && zm(*(p + 1)))
      n++;
  printf("Ò»¹²ÓÐ%d¸öµ¥´Ê\n", n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x11(%rbp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1060 <memset@plt>
lea    0xe83(%rip),%rdi
call   1040 <system@plt>
lea    -0x11(%rbp),%rdi
call   1070 <gets@plt>
lea    -0x11(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%edi
call   1030 <zm@plt>
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x25(%rbp)
je     11c8 <main+0x78>
mov    -0x20(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x25(%rbp)
mov    -0x25(%rbp),%al
test   $0x1,%al
jne    11d8 <main+0x88>
jmp    1222 <main+0xd2>
mov    -0x20(%rbp),%rax
movsbl (%rax),%edi
call   1030 <zm@plt>
cmp    $0x0,%eax
jne    120c <main+0xbc>
mov    -0x20(%rbp),%rax
movsbl 0x1(%rax),%edi
call   1030 <zm@plt>
cmp    $0x0,%eax
je     120c <main+0xbc>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1211 <main+0xc1>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    11a2 <main+0x52>
mov    -0x24(%rbp),%esi
lea    0xdda(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
movb   $0x0,0x7(%rsp)
lea    0xeb1(%rip),%rdi
call   1040 <system@plt>
lea    0x7(%rsp),%rdi
call   1060 <gets@plt>
movsbl 0x7(%rsp),%edi
call   1030 <zm@plt>
mov    %eax,%ebp
mov    0x7(%rsp),%al
test   %al,%al
je     11ac <main+0x6c>
lea    0x8(%rsp),%rbx
jmp    118b <main+0x4b>
nopl   0x0(%rax)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
je     11ac <main+0x6c>
cmpb   $0x0,(%rbx)
je     11ac <main+0x6c>
movsbl %al,%edi
call   1030 <zm@plt>
test   %eax,%eax
jne    1180 <main+0x40>
movsbl (%rbx),%edi
call   1030 <zm@plt>
cmp    $0x1,%eax
sbb    $0xffffffff,%ebp
jmp    1180 <main+0x40>
lea    0xe53(%rip),%rdi
mov    %ebp,%esi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"reset\00"
@.str.1 = [28 x i8] c"\C3\92\C2\BB\C2\B9\C2\B2\C3\93\C3\90%d\C2\B8\C3\B6\C2\B5\C2\A5\C2\B4\C3\8A\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [1 x i8]
%7 = alloca i8*
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = bitcast [1 x i8]* %6 to i8*
%10 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%11 = getelementptr inbounds [1 x i8], [1 x i8]* %6, i64 0, i64 0
%12 = call i32 @gets(i8* %11)
%13 = getelementptr inbounds [1 x i8], [1 x i8]* %6, i64 0, i64 0
store i8* %13, i8** %7
%14 = load i8*, i8** %7
%15 = load i8, i8* %14
%16 = call i32 @zm(i8 signext %15)
store i32 %16, i32* %8
br label %17
17: ; preds = %45, %2
%18 = load i8*, i8** %7
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %28
22: ; preds = %17
%23 = load i8*, i8** %7
%24 = getelementptr inbounds i8, i8* %23, i64 1
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = icmp ne i32 %26, 0
br label %28
28: ; preds = %22, %17
%29 = phi i1 [ false, %17 ], [ %27, %22 ]
br i1 %29, label %30, label %48
30: ; preds = %28
%31 = load i8*, i8** %7
%32 = load i8, i8* %31
%33 = call i32 @zm(i8 signext %32)
%34 = icmp ne i32 %33, 0
br i1 %34, label %44, label %35
35: ; preds = %30
%36 = load i8*, i8** %7
%37 = getelementptr inbounds i8, i8* %36, i64 1
%38 = load i8, i8* %37
%39 = call i32 @zm(i8 signext %38)
%40 = icmp ne i32 %39, 0
br i1 %40, label %41, label %44
41: ; preds = %35
%42 = load i32, i32* %8
%43 = add nsw i32 %42, 1
store i32 %43, i32* %8
br label %44
44: ; preds = %41, %35, %30
br label %45
45: ; preds = %44
%46 = load i8*, i8** %7
%47 = getelementptr inbounds i8, i8* %46, i32 1
store i8* %47, i8** %7
br label %17
48: ; preds = %28
%49 = load i32, i32* %8
%50 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 %49)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"reset\00"
@.str.1 = [28 x i8] c"\C3\92\C2\BB\C2\B9\C2\B2\C3\93\C3\90%d\C2\B8\C3\B6\C2\B5\C2\A5\C2\B4\C3\8A\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [1 x i8]
%4 = getelementptr inbounds [1 x i8], [1 x i8]* %3, i64 0, i64 0
store i8 0, i8* %4
%5 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @gets(i8* %4)
%7 = load i8, i8* %4
%8 = call i32 @zm(i8 signext %7)
%9 = load i8, i8* %4
%10 = icmp eq i8 %9, 0
br i1 %10, label %31, label %11
11: ; preds = %2, %27
%12 = phi i8 [ %29, %27 ], [ %9, %2 ]
%13 = phi i32 [ %28, %27 ], [ %8, %2 ]
%14 = phi i8* [ %15, %27 ], [ %4, %2 ]
%15 = getelementptr inbounds i8, i8* %14, i64 1
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 0
br i1 %17, label %31, label %18
18: ; preds = %11
%19 = call i32 @zm(i8 signext %12)
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %27
21: ; preds = %18
%22 = load i8, i8* %15
%23 = call i32 @zm(i8 signext %22)
%24 = icmp ne i32 %23, 0
%25 = zext i1 %24 to i32
%26 = add nsw i32 %13, %25
br label %27
27: ; preds = %21, %18
%28 = phi i32 [ %13, %18 ], [ %26, %21 ]
%29 = load i8, i8* %15
%30 = icmp eq i8 %29, 0
br i1 %30, label %31, label %11
31: ; preds = %11, %27, %2
%32 = phi i32 [ %8, %2 ], [ %28, %27 ], [ %13, %11 ]
%33 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 %32)
ret i32 0
}