#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 EOF;
char getchar();
int /*<<< orphan*/ putchar(char);
char repeatCharConst() {
  char c;
  putchar('\'');
  if ((c = getchar()) != EOF) {
    putchar(c);
    switch (c) {
    case '\'':
      return c;
    case '\\':
      if ((c = getchar()) != EOF) {
        putchar(c);
        if ((c = getchar()) != EOF) {
          putchar(c);
          return c;
        } else
          return EOF;
      } else
        return EOF;
      break;
    default:
      if ((c = getchar()) != EOF) {
        putchar(c);
        return c;
      } else
        return EOF;
    }
  } else
    return EOF;
}


x86 assembly (clang, -O0):
<repeatCharConst>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x27,%edi
call   1030 <putchar@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x2(%rbp)
movsbl %al,%eax
mov    0x2ea2(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     124c <repeatCharConst+0x12c>
movsbl -0x2(%rbp),%edi
call   1030 <putchar@plt>
movsbl -0x2(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0x27,%eax
je     1180 <repeatCharConst+0x60>
jmp    116f <repeatCharConst+0x4f>
mov    -0x8(%rbp),%eax
sub    $0x5c,%eax
je     118b <repeatCharConst+0x6b>
jmp    1208 <repeatCharConst+0xe8>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
jmp    1258 <repeatCharConst+0x138>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x2(%rbp)
movsbl %al,%eax
mov    0x2e49(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     11f7 <repeatCharConst+0xd7>
movsbl -0x2(%rbp),%edi
call   1030 <putchar@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x2(%rbp)
movsbl %al,%eax
mov    0x2e21(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     11e6 <repeatCharConst+0xc6>
movsbl -0x2(%rbp),%edi
call   1030 <putchar@plt>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
jmp    1258 <repeatCharConst+0x138>
mov    0x2dfb(%rip),%rax
mov    (%rax),%al
mov    %al,-0x1(%rbp)
jmp    1258 <repeatCharConst+0x138>
mov    0x2dea(%rip),%rax
mov    (%rax),%al
mov    %al,-0x1(%rbp)
jmp    1258 <repeatCharConst+0x138>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x2(%rbp)
movsbl %al,%eax
mov    0x2dcc(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     123b <repeatCharConst+0x11b>
movsbl -0x2(%rbp),%edi
call   1030 <putchar@plt>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
jmp    1258 <repeatCharConst+0x138>
mov    0x2da6(%rip),%rax
mov    (%rax),%al
mov    %al,-0x1(%rbp)
jmp    1258 <repeatCharConst+0x138>
mov    0x2d95(%rip),%rax
mov    (%rax),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<repeatCharConst>:
push   %rbp
push   %r14
push   %rbx
mov    $0x27,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%ebx
mov    0x2eaa(%rip),%r14
cmp    (%r14),%al
je     1183 <repeatCharConst+0x63>
movsbl %bl,%ebp
mov    %ebp,%edi
call   1030 <putchar@plt>
cmp    $0x27,%ebp
je     1183 <repeatCharConst+0x63>
cmp    $0x5c,%ebp
jne    116d <repeatCharConst+0x4d>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%ebx
cmp    (%r14),%al
je     1183 <repeatCharConst+0x63>
movsbl %bl,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%ebx
cmp    (%r14),%al
je     1183 <repeatCharConst+0x63>
movsbl %bl,%edi
call   1030 <putchar@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@EOF = global i8 0
define signext i8 @repeatCharConst() {
%1 = alloca i8
%2 = alloca i8
%3 = call i32 @putchar(i8 signext 39)
%4 = call signext i8 (...) @getchar()
store i8 %4, i8* %2
%5 = sext i8 %4 to i32
%6 = load i8, i8* @EOF
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %5, %7
br i1 %8, label %9, label %50
9: ; preds = %0
%10 = load i8, i8* %2
%11 = call i32 @putchar(i8 signext %10)
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
switch i32 %13, label %38 [
i32 39, label %14
i32 92, label %16
]
14: ; preds = %9
%15 = load i8, i8* %2
store i8 %15, i8* %1
br label %52
16: ; preds = %9
%17 = call signext i8 (...) @getchar()
store i8 %17, i8* %2
%18 = sext i8 %17 to i32
%19 = load i8, i8* @EOF
%20 = sext i8 %19 to i32
%21 = icmp ne i32 %18, %20
br i1 %21, label %22, label %36
22: ; preds = %16
%23 = load i8, i8* %2
%24 = call i32 @putchar(i8 signext %23)
%25 = call signext i8 (...) @getchar()
store i8 %25, i8* %2
%26 = sext i8 %25 to i32
%27 = load i8, i8* @EOF
%28 = sext i8 %27 to i32
%29 = icmp ne i32 %26, %28
br i1 %29, label %30, label %34
30: ; preds = %22
%31 = load i8, i8* %2
%32 = call i32 @putchar(i8 signext %31)
%33 = load i8, i8* %2
store i8 %33, i8* %1
br label %52
34: ; preds = %22
%35 = load i8, i8* @EOF
store i8 %35, i8* %1
br label %52
36: ; preds = %16
%37 = load i8, i8* @EOF
store i8 %37, i8* %1
br label %52
38: ; preds = %9
%39 = call signext i8 (...) @getchar()
store i8 %39, i8* %2
%40 = sext i8 %39 to i32
%41 = load i8, i8* @EOF
%42 = sext i8 %41 to i32
%43 = icmp ne i32 %40, %42
br i1 %43, label %44, label %48
44: ; preds = %38
%45 = load i8, i8* %2
%46 = call i32 @putchar(i8 signext %45)
%47 = load i8, i8* %2
store i8 %47, i8* %1
br label %52
48: ; preds = %38
%49 = load i8, i8* @EOF
store i8 %49, i8* %1
br label %52
50: ; preds = %0
%51 = load i8, i8* @EOF
store i8 %51, i8* %1
br label %52
52: ; preds = %50, %48, %44, %36, %34, %30, %14
%53 = load i8, i8* %1
ret i8 %53
}

LLVM IR (-O2):
@EOF = global i8 0
define signext i8 @repeatCharConst() {
%1 = tail call i32 @putchar(i8 signext 39)
%2 = tail call signext i8 (...) @getchar()
%3 = load i8, i8* @EOF
%4 = icmp eq i8 %2, %3
br i1 %4, label %24, label %5
5: ; preds = %0
%6 = sext i8 %2 to i32
%7 = tail call i32 @putchar(i8 signext %2)
switch i32 %6, label %17 [
i32 39, label %24
i32 92, label %8
]
8: ; preds = %5
%9 = tail call signext i8 (...) @getchar()
%10 = load i8, i8* @EOF
%11 = icmp eq i8 %9, %10
br i1 %11, label %24, label %12
12: ; preds = %8
%13 = tail call i32 @putchar(i8 signext %9)
%14 = tail call signext i8 (...) @getchar()
%15 = load i8, i8* @EOF
%16 = icmp eq i8 %14, %15
br i1 %16, label %24, label %21
17: ; preds = %5
%18 = tail call signext i8 (...) @getchar()
%19 = load i8, i8* @EOF
%20 = icmp eq i8 %18, %19
br i1 %20, label %24, label %21
21: ; preds = %17, %12
%22 = phi i8 [ %14, %12 ], [ %18, %17 ]
%23 = tail call i32 @putchar(i8 signext %22)
br label %24
24: ; preds = %21, %0, %17, %8, %12, %5
%25 = phi i8 [ %2, %5 ], [ %14, %12 ], [ %9, %8 ], [ %18, %17 ], [ %2, %0 ], [ %22, %21 ]
ret i8 %25
}