#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 getchar();
int /*<<< orphan*/ puts(char *);
int main() {
  char i, j;
  puts("Ready");
  while (1) {
    i = getchar();
    j = getchar();
    getchar();
    if (i == ' ') {
      break;
    }
    if ((i + j == 'b' + 'd') || (i + j == 'p' + 'q')) {
      puts("Mirrored pair");
    } else {
      puts("Ordinary pair");
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x6(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
movsbl -0x5(%rbp),%eax
cmp    $0x20,%eax
jne    1168 <main+0x48>
jmp    11b4 <main+0x94>
movsbl -0x5(%rbp),%eax
movsbl -0x6(%rbp),%ecx
add    %ecx,%eax
cmp    $0xc6,%eax
je     1192 <main+0x72>
movsbl -0x5(%rbp),%eax
movsbl -0x6(%rbp),%ecx
add    %ecx,%eax
cmp    $0xe1,%eax
jne    11a3 <main+0x83>
lea    0xe6d(%rip),%rdi
call   1030 <puts@plt>
jmp    11af <main+0x8f>
lea    0xe6a(%rip),%rdi
call   1030 <puts@plt>
jmp    113b <main+0x1b>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
lea    0xed2(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0x20,%bl
jne    115e <main+0x3e>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xea1(%rip),%r14
lea    0xea8(%rip),%r15
jmp    1193 <main+0x73>
xchg   %ax,%ax
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0x20,%bl
je     1151 <main+0x31>
movsbl %bl,%ecx
movsbl %bpl,%eax
add    %ecx,%eax
mov    %r14,%rcx
cmp    $0xe1,%eax
je     11a9 <main+0x89>
mov    %r15,%rcx
mov    %r14,%rdi
cmp    $0xc6,%eax
je     1170 <main+0x50>
mov    %rcx,%rdi
jmp    1170 <main+0x50>

LLVM IR (-O0):
@.str = [6 x i8] c"Ready\00"
@.str.1 = [14 x i8] c"Mirrored pair\00"
@.str.2 = [14 x i8] c"Ordinary pair\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
store i32 0, i32* %1
%4 = call i32 @puts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %0, %31
%6 = call signext i8 (...) @getchar()
store i8 %6, i8* %2
%7 = call signext i8 (...) @getchar()
store i8 %7, i8* %3
%8 = call signext i8 (...) @getchar()
%9 = load i8, i8* %2
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 32
br i1 %11, label %12, label %13
12: ; preds = %5
br label %32
13: ; preds = %5
%14 = load i8, i8* %2
%15 = sext i8 %14 to i32
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = add nsw i32 %15, %17
%19 = icmp eq i32 %18, 198
br i1 %19, label %27, label %20
20: ; preds = %13
%21 = load i8, i8* %2
%22 = sext i8 %21 to i32
%23 = load i8, i8* %3
%24 = sext i8 %23 to i32
%25 = add nsw i32 %22, %24
%26 = icmp eq i32 %25, 225
br i1 %26, label %27, label %29
27: ; preds = %20, %13
%28 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
br label %31
29: ; preds = %20
%30 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
br label %31
31: ; preds = %29, %27
br label %5
32: ; preds = %12
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"Ready\00"
@.str.1 = [14 x i8] c"Mirrored pair\00"
@.str.2 = [14 x i8] c"Ordinary pair\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call signext i8 (...) @getchar()
%3 = tail call signext i8 (...) @getchar()
%4 = tail call signext i8 (...) @getchar()
%5 = icmp eq i8 %2, 32
br i1 %5, label %21, label %6
6: ; preds = %0, %6
%7 = phi i8 [ %18, %6 ], [ %3, %0 ]
%8 = phi i8 [ %17, %6 ], [ %2, %0 ]
%9 = sext i8 %8 to i32
%10 = sext i8 %7 to i32
%11 = add nsw i32 %10, %9
%12 = icmp eq i32 %11, 198
%13 = icmp eq i32 %11, 225
%14 = or i1 %12, %13
%15 = select i1 %14, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0)
%16 = tail call i32 @puts(i8* dereferenceable(1) %15)
%17 = tail call signext i8 (...) @getchar()
%18 = tail call signext i8 (...) @getchar()
%19 = tail call signext i8 (...) @getchar()
%20 = icmp eq i8 %17, 32
br i1 %20, label %21, label %6
21: ; preds = %6, %0
ret i32 0
}