#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__ EOF;
int /*<<< orphan*/ printf(char *, char *);
scalar_t__ scanf(char *, char *);
int main(int argc, const char *argv[]) {
  char b[201];
  int i;
  while (scanf("%s", b) != EOF) {
    for (i = 0; b[i] != '\0'; i++) {
      if (b[i] == '1')
        b[i] = '0';
      else if (b[i] == '0')
        b[i] = '1';
    }
    printf("%s\n", b);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0xe0(%rbp),%rsi
lea    0xeb9(%rip),%rdi
call   1040 <scanf@plt>
mov    0x2e95(%rip),%rcx
cmp    (%rcx),%rax
je     1207 <main+0xe7>
movl   $0x0,-0xe4(%rbp)
movslq -0xe4(%rbp),%rax
movsbl -0xe0(%rbp,%rax,1),%eax
ff
cmp    $0x0,%eax
je     11ef <main+0xcf>
movslq -0xe4(%rbp),%rax
movsbl -0xe0(%rbp,%rax,1),%eax
ff
cmp    $0x31,%eax
jne    11aa <main+0x8a>
movslq -0xe4(%rbp),%rax
movb   $0x30,-0xe0(%rbp,%rax,1)
30
jmp    11d6 <main+0xb6>
movslq -0xe4(%rbp),%rax
movsbl -0xe0(%rbp,%rax,1),%eax
ff
cmp    $0x30,%eax
jne    11d1 <main+0xb1>
movslq -0xe4(%rbp),%rax
movb   $0x31,-0xe0(%rbp,%rax,1)
31
jmp    11d6 <main+0xb6>
jmp    11db <main+0xbb>
mov    -0xe4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xe4(%rbp)
jmp    1166 <main+0x46>
lea    -0xe0(%rbp),%rsi
lea    0xe06(%rip),%rdi
call   1030 <printf@plt>
jmp    1139 <main+0x19>
xor    %eax,%eax
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0xd8,%rsp
lea    0xecb(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
mov    0x2ea4(%rip),%r12
cmp    (%r12),%rax
je     11a1 <main+0x81>
xor    %ecx,%ecx
lea    0xeb0(%rip),%r14
mov    %rsp,%rbx
lea    0xea3(%rip),%r15
jmp    1169 <main+0x49>
nop
mov    $0x30,%al
mov    %al,(%rsp,%rcx,1)
add    $0x1,%rcx
movzbl (%rsp,%rcx,1),%eax
test   %al,%al
je     1180 <main+0x60>
cmp    $0x31,%al
je     1160 <main+0x40>
cmp    $0x30,%al
jne    1165 <main+0x45>
mov    $0x31,%al
jmp    1162 <main+0x42>
nopl   (%rax)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    $0x0,%ecx
cmp    (%r12),%rax
jne    1169 <main+0x49>
xor    %eax,%eax
add    $0xd8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@EOF = global i64 0
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [201 x i8]
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %8
8: ; preds = %48, %2
%9 = getelementptr inbounds [201 x i8], [201 x i8]* %6, i64 0, i64 0
%10 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = load i64, i64* @EOF
%12 = icmp ne i64 %10, %11
br i1 %12, label %13, label %51
13: ; preds = %8
store i32 0, i32* %7
br label %14
14: ; preds = %45, %13
%15 = load i32, i32* %7
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [201 x i8], [201 x i8]* %6, i64 0, i64 %16
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %48
21: ; preds = %14
%22 = load i32, i32* %7
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [201 x i8], [201 x i8]* %6, i64 0, i64 %23
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = icmp eq i32 %26, 49
br i1 %27, label %28, label %32
28: ; preds = %21
%29 = load i32, i32* %7
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [201 x i8], [201 x i8]* %6, i64 0, i64 %30
store i8 48, i8* %31
br label %44
32: ; preds = %21
%33 = load i32, i32* %7
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [201 x i8], [201 x i8]* %6, i64 0, i64 %34
%36 = load i8, i8* %35
%37 = sext i8 %36 to i32
%38 = icmp eq i32 %37, 48
br i1 %38, label %39, label %43
39: ; preds = %32
%40 = load i32, i32* %7
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds [201 x i8], [201 x i8]* %6, i64 0, i64 %41
store i8 49, i8* %42
br label %43
43: ; preds = %39, %32
br label %44
44: ; preds = %43, %28
br label %45
45: ; preds = %44
%46 = load i32, i32* %7
%47 = add nsw i32 %46, 1
store i32 %47, i32* %7
br label %14
48: ; preds = %14
%49 = getelementptr inbounds [201 x i8], [201 x i8]* %6, i64 0, i64 0
%50 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %49)
br label %8
51: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@EOF = global i64 0
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [201 x i8]
%4 = getelementptr inbounds [201 x i8], [201 x i8]* %3, i64 0, i64 0
%5 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i64, i64* @EOF
%7 = icmp eq i64 %5, %6
br i1 %7, label %24, label %8
8: ; preds = %2, %17
%9 = phi i64 [ %18, %17 ], [ 0, %2 ]
%10 = getelementptr inbounds [201 x i8], [201 x i8]* %3, i64 0, i64 %9
%11 = load i8, i8* %10
switch i8 %11, label %15 [
i8 0, label %19
i8 49, label %13
i8 48, label %12
]
12: ; preds = %8
br label %13
13: ; preds = %8, %12
%14 = phi i8 [ 49, %12 ], [ 48, %8 ]
store i8 %14, i8* %10
br label %15
15: ; preds = %13, %8
%16 = add nuw i64 %9, 1
br label %17
17: ; preds = %15, %19
%18 = phi i64 [ %16, %15 ], [ 0, %19 ]
br label %8
19: ; preds = %8
%20 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%21 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%22 = load i64, i64* @EOF
%23 = icmp eq i64 %21, %22
br i1 %23, label %24, label %17
24: ; preds = %19, %2
ret i32 0
}