#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*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int strlen(char *);
int main() {
  int i, n, j, lens1, lens2, count1 = 0, count2 = 0;
  char s1[2000], s2[2000];
  printf("Enter the string you want to search 1[0]1 those type= ");
  scanf("%s", s1);
  printf("\n");
  scanf("%s", s2);
  printf("\n");
  printf("Input:\n");
  printf("%d", n);
  printf("%s", s1);
  printf("\n");
  printf("%s", s2);
  lens1 = strlen(s1);
  lens2 = strlen(s2);
  i = 0;
  while (s1[i] == '1') {
    while (s1[i + 1] == '0' || s1[i + 2] == '1') {
      i++;
    }
    count1++;
    i++;
  }
  j = 0;
  while (s2[j] == '1') {
    while (s2[j + 1] == '0' || s2[j + 2] == '1') {
      j++;
    }
    count2++;
    j++;
  }
  printf("\n");
  printf("%d \n%d", count1, count2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xfd0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x7f0(%rbp),%rsi
lea    0xecb(%rip),%rdi
call   1050 <scanf@plt>
lea    0xec8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0xfc0(%rbp),%rsi
lea    0xeaa(%rip),%rdi
call   1050 <scanf@plt>
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xe8e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x7f0(%rbp),%rsi
lea    0xe6a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe65(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0xfc0(%rbp),%rsi
lea    0xe47(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x7f0(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
lea    -0xfc0(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x18(%rbp)
movl   $0x0,-0x8(%rbp)
movslq -0x8(%rbp),%rax
movsbl -0x7f0(%rbp,%rax,1),%eax
ff
cmp    $0x31,%eax
jne    12ab <main+0x17b>
jmp    1236 <main+0x106>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
cltq
movsbl -0x7f0(%rbp,%rax,1),%ecx
ff
mov    $0x1,%al
cmp    $0x30,%ecx
mov    %al,-0xfc1(%rbp)
je     1273 <main+0x143>
mov    -0x8(%rbp),%eax
add    $0x2,%eax
cltq
movsbl -0x7f0(%rbp,%rax,1),%eax
ff
cmp    $0x31,%eax
sete   %al
mov    %al,-0xfc1(%rbp)
mov    -0xfc1(%rbp),%al
test   $0x1,%al
jne    1286 <main+0x156>
jmp    1294 <main+0x164>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1236 <main+0x106>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    121c <main+0xec>
movl   $0x0,-0x10(%rbp)
movslq -0x10(%rbp),%rax
movsbl -0xfc0(%rbp,%rax,1),%eax
ff
cmp    $0x31,%eax
jne    1341 <main+0x211>
jmp    12cc <main+0x19c>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
cltq
movsbl -0xfc0(%rbp,%rax,1),%ecx
ff
mov    $0x1,%al
cmp    $0x30,%ecx
mov    %al,-0xfc2(%rbp)
je     1309 <main+0x1d9>
mov    -0x10(%rbp),%eax
add    $0x2,%eax
cltq
movsbl -0xfc0(%rbp,%rax,1),%eax
ff
cmp    $0x31,%eax
sete   %al
mov    %al,-0xfc2(%rbp)
mov    -0xfc2(%rbp),%al
test   $0x1,%al
jne    131c <main+0x1ec>
jmp    132a <main+0x1fa>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    12cc <main+0x19c>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    12b2 <main+0x182>
lea    0xcf8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x1c(%rbp),%esi
mov    -0x20(%rbp),%edx
lea    0xce6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xfd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xfa0,%rsp
movabs $0x100000000,%rbx
lea    0xe8f(%rip),%rdi
xor    %r14d,%r14d
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xeb5(%rip),%r13
lea    0x7d0(%rsp),%r15
mov    %r13,%rdi
mov    %r15,%rsi
call   1070 <scanf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rsp,%r12
mov    %r13,%rdi
mov    %r12,%rsi
call   1070 <scanf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe83(%rip),%rdi
call   1040 <puts@plt>
lea    0xe74(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r13,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r13,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r15,%rdi
call   1050 <strlen@plt>
mov    %r12,%rdi
call   1050 <strlen@plt>
cmpb   $0x31,0x7d0(%rsp)
31
mov    $0x0,%r15d
jne    125d <main+0x10d>
xor    %r15d,%r15d
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
mov    %rax,%rcx
shl    $0x20,%rcx
cltq
nopl   0x0(%rax)
add    $0x1,%rax
add    %rbx,%rcx
cmpb   $0x30,0x7d0(%rsp,%rax,1)
30
je     1230 <main+0xe0>
cmpb   $0x31,0x7d1(%rsp,%rax,1)
31
je     1230 <main+0xe0>
add    $0x1,%r15d
sar    $0x20,%rcx
cmpb   $0x31,0x7d0(%rsp,%rcx,1)
31
je     1220 <main+0xd0>
cmpb   $0x31,(%rsp)
jne    12a2 <main+0x152>
xor    %r14d,%r14d
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
mov    %rax,%rcx
shl    $0x20,%rcx
cltq
nopl   0x0(%rax)
add    $0x1,%rax
add    %rbx,%rcx
cmpb   $0x30,(%rsp,%rax,1)
je     1280 <main+0x130>
cmpb   $0x31,0x1(%rsp,%rax,1)
je     1280 <main+0x130>
add    $0x1,%r14d
sar    $0x20,%rcx
cmpb   $0x31,(%rsp,%rcx,1)
je     1270 <main+0x120>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xd87(%rip),%rdi
mov    %r15d,%esi
mov    %r14d,%edx
xor    %eax,%eax
call   1060 <printf@plt>
xor    %eax,%eax
add    $0xfa0,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [55 x i8] c"Enter the string you want to search 1[0]1 those type= \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [8 x i8] c"Input:\0A\00"
@.str.4 = [3 x i8] c"%d\00"
@.str.5 = [7 x i8] c"%d \0A%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca [2000 x i8]
%10 = alloca [2000 x i8]
store i32 0, i32* %1
store i32 0, i32* %7
store i32 0, i32* %8
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%12 = getelementptr inbounds [2000 x i8], [2000 x i8]* %9, i64 0, i64 0
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %12)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%15 = getelementptr inbounds [2000 x i8], [2000 x i8]* %10, i64 0, i64 0
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %15)
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%19 = load i32, i32* %3
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %19)
%21 = getelementptr inbounds [2000 x i8], [2000 x i8]* %9, i64 0, i64 0
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %21)
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%24 = getelementptr inbounds [2000 x i8], [2000 x i8]* %10, i64 0, i64 0
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %24)
%26 = getelementptr inbounds [2000 x i8], [2000 x i8]* %9, i64 0, i64 0
%27 = call i32 @strlen(i8* %26)
store i32 %27, i32* %5
%28 = getelementptr inbounds [2000 x i8], [2000 x i8]* %10, i64 0, i64 0
%29 = call i32 @strlen(i8* %28)
store i32 %29, i32* %6
store i32 0, i32* %2
br label %30
30: ; preds = %59, %0
%31 = load i32, i32* %2
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [2000 x i8], [2000 x i8]* %9, i64 0, i64 %32
%34 = load i8, i8* %33
%35 = sext i8 %34 to i32
%36 = icmp eq i32 %35, 49
br i1 %36, label %37, label %64
37: ; preds = %30
br label %38
38: ; preds = %56, %37
%39 = load i32, i32* %2
%40 = add nsw i32 %39, 1
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds [2000 x i8], [2000 x i8]* %9, i64 0, i64 %41
%43 = load i8, i8* %42
%44 = sext i8 %43 to i32
%45 = icmp eq i32 %44, 48
br i1 %45, label %54, label %46
46: ; preds = %38
%47 = load i32, i32* %2
%48 = add nsw i32 %47, 2
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds [2000 x i8], [2000 x i8]* %9, i64 0, i64 %49
%51 = load i8, i8* %50
%52 = sext i8 %51 to i32
%53 = icmp eq i32 %52, 49
br label %54
54: ; preds = %46, %38
%55 = phi i1 [ true, %38 ], [ %53, %46 ]
br i1 %55, label %56, label %59
56: ; preds = %54
%57 = load i32, i32* %2
%58 = add nsw i32 %57, 1
store i32 %58, i32* %2
br label %38
59: ; preds = %54
%60 = load i32, i32* %7
%61 = add nsw i32 %60, 1
store i32 %61, i32* %7
%62 = load i32, i32* %2
%63 = add nsw i32 %62, 1
store i32 %63, i32* %2
br label %30
64: ; preds = %30
store i32 0, i32* %4
br label %65
65: ; preds = %94, %64
%66 = load i32, i32* %4
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds [2000 x i8], [2000 x i8]* %10, i64 0, i64 %67
%69 = load i8, i8* %68
%70 = sext i8 %69 to i32
%71 = icmp eq i32 %70, 49
br i1 %71, label %72, label %99
72: ; preds = %65
br label %73
73: ; preds = %91, %72
%74 = load i32, i32* %4
%75 = add nsw i32 %74, 1
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds [2000 x i8], [2000 x i8]* %10, i64 0, i64 %76
%78 = load i8, i8* %77
%79 = sext i8 %78 to i32
%80 = icmp eq i32 %79, 48
br i1 %80, label %89, label %81
81: ; preds = %73
%82 = load i32, i32* %4
%83 = add nsw i32 %82, 2
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds [2000 x i8], [2000 x i8]* %10, i64 0, i64 %84
%86 = load i8, i8* %85
%87 = sext i8 %86 to i32
%88 = icmp eq i32 %87, 49
br label %89
89: ; preds = %81, %73
%90 = phi i1 [ true, %73 ], [ %88, %81 ]
br i1 %90, label %91, label %94
91: ; preds = %89
%92 = load i32, i32* %4
%93 = add nsw i32 %92, 1
store i32 %93, i32* %4
br label %73
94: ; preds = %89
%95 = load i32, i32* %8
%96 = add nsw i32 %95, 1
store i32 %96, i32* %8
%97 = load i32, i32* %4
%98 = add nsw i32 %97, 1
store i32 %98, i32* %4
br label %65
99: ; preds = %65
%100 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%101 = load i32, i32* %7
%102 = load i32, i32* %8
%103 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i32 %101, i32 %102)
ret i32 0
}

LLVM IR (-O2):
@.str = [55 x i8] c"Enter the string you want to search 1[0]1 those type= \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.4 = [3 x i8] c"%d\00"
@.str.5 = [7 x i8] c"%d \0A%d\00"
@str = [7 x i8] c"Input:\00"
define i32 @main() {
%1 = alloca [2000 x i8]
%2 = alloca [2000 x i8]
%3 = getelementptr inbounds [2000 x i8], [2000 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [2000 x i8], [2000 x i8]* %2, i64 0, i64 0
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%7 = call i32 @putchar(i32 10)
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%9 = call i32 @putchar(i32 10)
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 undef)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%13 = call i32 @putchar(i32 10)
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%15 = call i32 @strlen(i8* %3)
%16 = call i32 @strlen(i8* %4)
%17 = load i8, i8* %3
%18 = icmp eq i8 %17, 49
br i1 %18, label %19, label %24
19: ; preds = %0, %40
%20 = phi i32 [ %41, %40 ], [ 0, %0 ]
%21 = phi i64 [ %30, %40 ], [ 0, %0 ]
%22 = shl i64 %21, 32
%23 = ashr exact i64 %22, 32
br label %28
24: ; preds = %40, %0
%25 = phi i32 [ 0, %0 ], [ %41, %40 ]
%26 = load i8, i8* %4
%27 = icmp eq i8 %26, 49
br i1 %27, label %47, label %71
28: ; preds = %34, %19
%29 = phi i64 [ %23, %19 ], [ %30, %34 ]
%30 = add nsw i64 %29, 1
%31 = getelementptr inbounds [2000 x i8], [2000 x i8]* %1, i64 0, i64 %30
%32 = load i8, i8* %31
%33 = icmp eq i8 %32, 48
br i1 %33, label %34, label %35
34: ; preds = %28, %35
br label %28
35: ; preds = %28
%36 = add nsw i64 %29, 2
%37 = getelementptr inbounds [2000 x i8], [2000 x i8]* %1, i64 0, i64 %36
%38 = load i8, i8* %37
%39 = icmp eq i8 %38, 49
br i1 %39, label %34, label %40
40: ; preds = %35
%41 = add nuw nsw i32 %20, 1
%42 = shl i64 %30, 32
%43 = ashr exact i64 %42, 32
%44 = getelementptr inbounds [2000 x i8], [2000 x i8]* %1, i64 0, i64 %43
%45 = load i8, i8* %44
%46 = icmp eq i8 %45, 49
br i1 %46, label %19, label %24
47: ; preds = %24, %64
%48 = phi i32 [ %65, %64 ], [ 0, %24 ]
%49 = phi i64 [ %54, %64 ], [ 0, %24 ]
%50 = shl i64 %49, 32
%51 = ashr exact i64 %50, 32
br label %52
52: ; preds = %58, %47
%53 = phi i64 [ %51, %47 ], [ %54, %58 ]
%54 = add nsw i64 %53, 1
%55 = getelementptr inbounds [2000 x i8], [2000 x i8]* %2, i64 0, i64 %54
%56 = load i8, i8* %55
%57 = icmp eq i8 %56, 48
br i1 %57, label %58, label %59
58: ; preds = %52, %59
br label %52
59: ; preds = %52
%60 = add nsw i64 %53, 2
%61 = getelementptr inbounds [2000 x i8], [2000 x i8]* %2, i64 0, i64 %60
%62 = load i8, i8* %61
%63 = icmp eq i8 %62, 49
br i1 %63, label %58, label %64
64: ; preds = %59
%65 = add nuw nsw i32 %48, 1
%66 = shl i64 %54, 32
%67 = ashr exact i64 %66, 32
%68 = getelementptr inbounds [2000 x i8], [2000 x i8]* %2, i64 0, i64 %67
%69 = load i8, i8* %68
%70 = icmp eq i8 %69, 49
br i1 %70, label %47, label %71
71: ; preds = %64, %24
%72 = phi i32 [ 0, %24 ], [ %65, %64 ]
%73 = call i32 @putchar(i32 10)
%74 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i32 %25, i32 %72)
ret i32 0
}