#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*/ putchar(int);
char getOneChar() {
  char inChar;
  do {
    inChar = getchar();
    if ((inChar != 13) || (inChar != 11))
      putchar(inChar);
    else if (inChar != 13) {
      putchar(13);
      putchar(11);
    }
  } while ((inChar == 13) || (inChar == 11));
  return inChar;
}


x86 assembly (clang, -O0):
<getOneChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0xd,%eax
jne    114c <getOneChar+0x2c>
movsbl -0x1(%rbp),%eax
cmp    $0xb,%eax
je     115a <getOneChar+0x3a>
movsbl -0x1(%rbp),%edi
call   1030 <putchar@plt>
jmp    1180 <getOneChar+0x60>
movsbl -0x1(%rbp),%eax
cmp    $0xd,%eax
je     117b <getOneChar+0x5b>
mov    $0xd,%edi
call   1030 <putchar@plt>
mov    $0xb,%edi
call   1030 <putchar@plt>
jmp    1180 <getOneChar+0x60>
jmp    1185 <getOneChar+0x65>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xd,%ecx
mov    %al,-0x2(%rbp)
je     11a4 <getOneChar+0x84>
movsbl -0x1(%rbp),%eax
cmp    $0xb,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
test   $0x1,%al
jne    1128 <getOneChar+0x8>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getOneChar>:
push   %rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%ebx
movsbl %al,%edi
call   1030 <putchar@plt>
cmp    $0xb,%bl
je     1130 <getOneChar+0x10>
cmp    $0xd,%bl
je     1130 <getOneChar+0x10>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @getOneChar() {
%1 = alloca i8
br label %2
2: ; preds = %32, %0
%3 = call signext i8 (...) @getchar()
store i8 %3, i8* %1
%4 = load i8, i8* %1
%5 = sext i8 %4 to i32
%6 = icmp ne i32 %5, 13
br i1 %6, label %11, label %7
7: ; preds = %2
%8 = load i8, i8* %1
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 11
br i1 %10, label %11, label %15
11: ; preds = %7, %2
%12 = load i8, i8* %1
%13 = sext i8 %12 to i32
%14 = call i32 @putchar(i32 %13)
br label %23
15: ; preds = %7
%16 = load i8, i8* %1
%17 = sext i8 %16 to i32
%18 = icmp ne i32 %17, 13
br i1 %18, label %19, label %22
19: ; preds = %15
%20 = call i32 @putchar(i32 13)
%21 = call i32 @putchar(i32 11)
br label %22
22: ; preds = %19, %15
br label %23
23: ; preds = %22, %11
br label %24
24: ; preds = %23
%25 = load i8, i8* %1
%26 = sext i8 %25 to i32
%27 = icmp eq i32 %26, 13
br i1 %27, label %32, label %28
28: ; preds = %24
%29 = load i8, i8* %1
%30 = sext i8 %29 to i32
%31 = icmp eq i32 %30, 11
br label %32
32: ; preds = %28, %24
%33 = phi i1 [ true, %24 ], [ %31, %28 ]
br i1 %33, label %2, label %34
34: ; preds = %32
%35 = load i8, i8* %1
ret i8 %35
}

LLVM IR (-O2):
define signext i8 @getOneChar() {
br label %1
1: ; preds = %5, %0
%2 = tail call signext i8 (...) @getchar()
%3 = sext i8 %2 to i32
%4 = tail call i32 @putchar(i32 %3)
switch i8 %2, label %6 [
i8 13, label %5
i8 11, label %5
]
5: ; preds = %1, %1
br label %1
6: ; preds = %1
ret i8 %2
}