#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*/ fbtext_putc(char);
void fbtext_puts(char *s) {
  char outchar;
  while (*s) {
    outchar = *s;
    if (*s == '\\') {
      if (*(s + 1) == 'n') {
        outchar = '\n';
        s += 2;
      } else if (*(s + 1) == 't') {
        outchar = '\t';
        s += 2;
      } else if (*(s + 1) == 'r') {
        outchar = '\r';
        s += 2;
      } else {
        s++;
      }
    } else {
      s++;
    }
    fbtext_putc(outchar);
  }
}


x86 assembly (clang, -O0):
<fbtext_puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     11e9 <fbtext_puts+0xd9>
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5c,%eax
jne    11cf <fbtext_puts+0xbf>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x6e,%eax
jne    1168 <fbtext_puts+0x58>
movb   $0xa,-0x9(%rbp)
mov    -0x8(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x8(%rbp)
jmp    11ca <fbtext_puts+0xba>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x74,%eax
jne    118e <fbtext_puts+0x7e>
movb   $0x9,-0x9(%rbp)
mov    -0x8(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x8(%rbp)
jmp    11c5 <fbtext_puts+0xb5>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x72,%eax
jne    11b4 <fbtext_puts+0xa4>
movb   $0xd,-0x9(%rbp)
mov    -0x8(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x8(%rbp)
jmp    11c0 <fbtext_puts+0xb0>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    11c5 <fbtext_puts+0xb5>
jmp    11ca <fbtext_puts+0xba>
jmp    11db <fbtext_puts+0xcb>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
movsbl -0x9(%rbp),%edi
call   1030 <fbtext_putc@plt>
jmp    111c <fbtext_puts+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fbtext_puts>:
push   %rbx
mov    %rdi,%rbx
jmp    1128 <fbtext_puts+0x18>
add    $0x2,%rbx
mov    $0xd,%al
nopl   0x0(%rax)
movsbl %al,%edi
call   1030 <fbtext_putc@plt>
movzbl (%rbx),%eax
cmp    $0x5c,%al
je     1140 <fbtext_puts+0x30>
test   %al,%al
je     1168 <fbtext_puts+0x58>
add    $0x1,%rbx
jmp    1120 <fbtext_puts+0x10>
nopl   0x0(%rax)
movzbl 0x1(%rbx),%eax
cmp    $0x74,%al
je     1158 <fbtext_puts+0x48>
cmp    $0x72,%al
je     1116 <fbtext_puts+0x6>
cmp    $0x6e,%al
jne    1160 <fbtext_puts+0x50>
add    $0x2,%rbx
mov    $0xa,%al
jmp    1120 <fbtext_puts+0x10>
add    $0x2,%rbx
mov    $0x9,%al
jmp    1120 <fbtext_puts+0x10>
add    $0x1,%rbx
mov    $0x5c,%al
jmp    1120 <fbtext_puts+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @fbtext_puts(i8* nocapture %0) {
br label %2
2: ; preds = %16, %1
%3 = phi i8* [ %0, %1 ], [ %17, %16 ]
%4 = load i8, i8* %3
switch i8 %4, label %14 [
i8 0, label %20
i8 92, label %5
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
%7 = load i8, i8* %6
switch i8 %7, label %16 [
i8 110, label %8
i8 116, label %10
i8 114, label %12
]
8: ; preds = %5
%9 = getelementptr inbounds i8, i8* %3, i64 2
br label %16
10: ; preds = %5
%11 = getelementptr inbounds i8, i8* %3, i64 2
br label %16
12: ; preds = %5
%13 = getelementptr inbounds i8, i8* %3, i64 2
br label %16
14: ; preds = %2
%15 = getelementptr inbounds i8, i8* %3, i64 1
br label %16
16: ; preds = %5, %8, %12, %10, %14
%17 = phi i8* [ %9, %8 ], [ %11, %10 ], [ %13, %12 ], [ %15, %14 ], [ %6, %5 ]
%18 = phi i8 [ 10, %8 ], [ 9, %10 ], [ 13, %12 ], [ %4, %14 ], [ 92, %5 ]
%19 = tail call i32 @fbtext_putc(i8 signext %18)
br label %2
20: ; preds = %2
ret void
}