#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*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdin;
scalar_t__ strcmp(char *, char *);
int main() {
  int a = 1;
  int count = 0;
  while (a) {
    char entry[100];
    fgets(entry, 100, stdin);
    if (count == 0) {
      printf("Ready\n");
      count++;
    }
    if (strcmp(entry, "  \n") == 0) {
      break;
    } else if ((strcmp(entry, "bd\n") == 0) || (strcmp(entry, "db\n") == 0) ||
               (strcmp(entry, "pq\n") == 0) || (strcmp(entry, "qp\n") == 0)) {
      printf("Mirrored pair\n");
    } else {
      printf("Ordinary pair\n");
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     123b <main+0x10b>
lea    -0x70(%rbp),%rdi
mov    0x2e86(%rip),%rax
mov    (%rax),%edx
mov    $0x64,%esi
call   1040 <fgets@plt>
cmpl   $0x0,-0xc(%rbp)
jne    118d <main+0x5d>
lea    0xe81(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
lea    -0x70(%rbp),%rdi
lea    0xe6f(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    11ac <main+0x7c>
jmp    123b <main+0x10b>
lea    -0x70(%rbp),%rdi
lea    0xe54(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
je     1214 <main+0xe4>
lea    -0x70(%rbp),%rdi
lea    0xe3e(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
je     1214 <main+0xe4>
lea    -0x70(%rbp),%rdi
lea    0xe28(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
je     1214 <main+0xe4>
lea    -0x70(%rbp),%rdi
lea    0xe12(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1225 <main+0xf5>
lea    0xe00(%rip),%rdi
call   1030 <printf@plt>
jmp    1231 <main+0x101>
lea    0xdfe(%rip),%rdi
call   1030 <printf@plt>
jmp    1236 <main+0x106>
jmp    114d <main+0x1d>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    0x2ea3(%rip),%rbp
mov    0x0(%rbp),%edx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x64,%esi
call   1040 <fgets@plt>
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
lea    0xe95(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
je     1225 <main+0xf5>
lea    0xe81(%rip),%r14
mov    %rsp,%rbx
lea    0xe95(%rip),%r13
lea    0xe6c(%rip),%r15
lea    0xe6d(%rip),%r12
jmp    11c5 <main+0x95>
nopl   (%rax)
call   1030 <puts@plt>
mov    0x0(%rbp),%edx
mov    %rbx,%rdi
mov    $0x64,%esi
call   1040 <fgets@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     1225 <main+0xf5>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <strcmp@plt>
mov    %r13,%rdi
test   %rax,%rax
je     11a0 <main+0x70>
mov    %rbx,%rdi
mov    %r12,%rsi
call   1050 <strcmp@plt>
mov    %r13,%rdi
test   %rax,%rax
je     11a0 <main+0x70>
mov    %rbx,%rdi
lea    0xe17(%rip),%rsi
call   1050 <strcmp@plt>
mov    %r13,%rdi
test   %rax,%rax
je     11a0 <main+0x70>
mov    %rbx,%rdi
lea    0xe04(%rip),%rsi
call   1050 <strcmp@plt>
mov    %r13,%rdi
test   %rax,%rax
je     11a0 <main+0x70>
lea    0xdf4(%rip),%rdi
jmp    11a0 <main+0x70>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [7 x i8] c"Ready\0A\00"
@.str.1 = [4 x i8] c" \0A\00"
@.str.2 = [4 x i8] c"bd\0A\00"
@.str.3 = [4 x i8] c"db\0A\00"
@.str.4 = [4 x i8] c"pq\0A\00"
@.str.5 = [4 x i8] c"qp\0A\00"
@.str.6 = [15 x i8] c"Mirrored pair\0A\00"
@.str.7 = [15 x i8] c"Ordinary pair\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [100 x i8]
store i32 0, i32* %1
store i32 1, i32* %2
store i32 0, i32* %3
br label %5
5: ; preds = %44, %0
%6 = load i32, i32* %2
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %45
8: ; preds = %5
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%10 = load i32, i32* @stdin
%11 = call i32 @fgets(i8* %9, i32 100, i32 %10)
%12 = load i32, i32* %3
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %18
14: ; preds = %8
%15 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %18
18: ; preds = %14, %8
%19 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%20 = call i64 @strcmp(i8* %19, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%21 = icmp eq i64 %20, 0
br i1 %21, label %22, label %23
22: ; preds = %18
br label %45
23: ; preds = %18
%24 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%25 = call i64 @strcmp(i8* %24, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%26 = icmp eq i64 %25, 0
br i1 %26, label %39, label %27
27: ; preds = %23
%28 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%29 = call i64 @strcmp(i8* %28, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%30 = icmp eq i64 %29, 0
br i1 %30, label %39, label %31
31: ; preds = %27
%32 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%33 = call i64 @strcmp(i8* %32, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%34 = icmp eq i64 %33, 0
br i1 %34, label %39, label %35
35: ; preds = %31
%36 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%37 = call i64 @strcmp(i8* %36, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%38 = icmp eq i64 %37, 0
br i1 %38, label %39, label %41
39: ; preds = %35, %31, %27, %23
%40 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0))
br label %43
41: ; preds = %35
%42 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.7, i64 0, i64 0))
br label %43
43: ; preds = %41, %39
br label %44
44: ; preds = %43
br label %5
45: ; preds = %22, %5
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@.str.1 = [4 x i8] c" \0A\00"
@.str.2 = [4 x i8] c"bd\0A\00"
@.str.3 = [4 x i8] c"db\0A\00"
@.str.4 = [4 x i8] c"pq\0A\00"
@.str.5 = [4 x i8] c"qp\0A\00"
@str = [14 x i8] c"Ordinary pair\00"
@str.8 = [14 x i8] c"Mirrored pair\00"
@str.9 = [6 x i8] c"Ready\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stdin
%4 = call i32 @fgets(i8* %2, i32 100, i32 %3)
%5 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.9, i64 0, i64 0))
%6 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
br i1 %7, label %28, label %8
8: ; preds = %0, %21
%9 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
br i1 %10, label %21, label %11
11: ; preds = %8
%12 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%13 = icmp eq i64 %12, 0
br i1 %13, label %21, label %14
14: ; preds = %11
%15 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%16 = icmp eq i64 %15, 0
br i1 %16, label %21, label %17
17: ; preds = %14
%18 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%19 = icmp eq i64 %18, 0
%20 = select i1 %19, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @str.8, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0)
br label %21
21: ; preds = %17, %8, %11, %14
%22 = phi i8* [ getelementptr inbounds ([14 x i8], [14 x i8]* @str.8, i64 0, i64 0), %14 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @str.8, i64 0, i64 0), %11 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @str.8, i64 0, i64 0), %8 ], [ %20, %17 ]
%23 = call i32 @puts(i8* dereferenceable(1) %22)
%24 = load i32, i32* @stdin
%25 = call i32 @fgets(i8* %2, i32 100, i32 %24)
%26 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%27 = icmp eq i64 %26, 0
br i1 %27, label %28, label %8
28: ; preds = %21, %0
ret i32 0
}