#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*/ printf(char *, ...);
int /*<<< orphan*/ putchar(char);
main() {
  char c, word[80], *cptr;
  printf("<HTML>\n<DL>\n");
  while ((c = getchar()) != EOF) {
    if (c == '\\') {
      c = getchar();
      if (c == 'b') {
        while ((c = getchar()) != '{')
          ;
        cptr = word;
        while ((c = getchar()) != '}') {
          *cptr = c;
          cptr++;
        }
        *cptr = '\0';
        printf("\n<DT> <A NAME=\"%s\" ></A> <B> %s </B>", word, word);
      } else {
        if (c == 'e') {
          c = getchar();
          printf(" <I> ");
        }
      }
    } else if (c == '}')
      printf("</I>");
    else if (c == '{')
      ;
    else
      putchar(c);
  }
  printf("</DL>\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl %al,%eax
mov    0x2e87(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1283 <main+0x153>
movsbl -0x5(%rbp),%eax
cmp    $0x5c,%eax
jne    1239 <main+0x109>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x62,%eax
jne    120a <main+0xda>
jmp    1195 <main+0x65>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl %al,%eax
cmp    $0x7b,%eax
je     11b0 <main+0x80>
jmp    1195 <main+0x65>
lea    -0x60(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl %al,%eax
cmp    $0x7d,%eax
je     11e8 <main+0xb8>
mov    -0x5(%rbp),%cl
mov    -0x68(%rbp),%rax
mov    %cl,(%rax)
mov    -0x68(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x68(%rbp)
jmp    11b8 <main+0x88>
mov    -0x68(%rbp),%rax
movb   $0x0,(%rax)
lea    -0x60(%rbp),%rsi
lea    -0x60(%rbp),%rdx
lea    0xe0f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1234 <main+0x104>
movsbl -0x5(%rbp),%eax
cmp    $0x65,%eax
jne    122f <main+0xff>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %al,-0x5(%rbp)
lea    0xe0a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1234 <main+0x104>
jmp    127e <main+0x14e>
movsbl -0x5(%rbp),%eax
cmp    $0x7d,%eax
jne    1259 <main+0x129>
lea    0xdeb(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1279 <main+0x149>
movsbl -0x5(%rbp),%eax
cmp    $0x7b,%eax
jne    126b <main+0x13b>
jmp    1274 <main+0x144>
movsbl -0x5(%rbp),%edi
call   1030 <putchar@plt>
jmp    1279 <main+0x149>
jmp    127e <main+0x14e>
jmp    114d <main+0x1d>
lea    0xdb3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%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    $0x58,%rsp
lea    0xedb(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
mov    0x2e80(%rip),%rbx
cmp    (%rbx),%al
jne    1189 <main+0x49>
lea    0xec9(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe9b(%rip),%r15
lea    0xe8e(%rip),%r14
mov    %rsp,%r13
lea    0xe5f(%rip),%r12
jmp    11c3 <main+0x83>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl %al,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
cmp    (%rbx),%al
je     116c <main+0x2c>
cmp    $0x7d,%al
je     1230 <main+0xf0>
cmp    $0x7b,%al
je     11b8 <main+0x78>
cmp    $0x5c,%al
jne    11b0 <main+0x70>
xor    %eax,%eax
call   1060 <getchar@plt>
cmp    $0x65,%al
je     1235 <main+0xf5>
cmp    $0x62,%al
jne    11b8 <main+0x78>
xchg   %ax,%ax
xor    %eax,%eax
call   1060 <getchar@plt>
cmp    $0x7b,%al
jne    11e0 <main+0xa0>
xor    %eax,%eax
call   1060 <getchar@plt>
mov    %r13,%rbp
cmp    $0x7d,%al
je     1212 <main+0xd2>
mov    %r13,%rbp
nopl   0x0(%rax)
mov    %al,0x0(%rbp)
add    $0x1,%rbp
xor    %eax,%eax
call   1060 <getchar@plt>
cmp    $0x7d,%al
jne    1200 <main+0xc0>
movb   $0x0,0x0(%rbp)
mov    %r12,%rdi
mov    %r13,%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   1050 <printf@plt>
jmp    11b8 <main+0x78>
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
jmp    123f <main+0xff>
xor    %eax,%eax
call   1060 <getchar@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    11b8 <main+0x78>

LLVM IR (-O0):
@.str = [13 x i8] c"<HTML>\0A<DL>\0A\00"
@EOF = global i8 0
@.str.1 = [37 x i8] c"\0A<DT> <A NAME=\22%s\22 ></A> <B> %s </B>\00"
@.str.2 = [6 x i8] c" <I> \00"
@.str.3 = [5 x i8] c"</I>\00"
@.str.4 = [7 x i8] c"</DL>\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca [80 x i8]
%4 = alloca i8*
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %68, %0
%7 = call signext i8 (...) @getchar()
store i8 %7, i8* %2
%8 = sext i8 %7 to i32
%9 = load i8, i8* @EOF
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %8, %10
br i1 %11, label %12, label %69
12: ; preds = %6
%13 = load i8, i8* %2
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 92
br i1 %15, label %16, label %52
16: ; preds = %12
%17 = call signext i8 (...) @getchar()
store i8 %17, i8* %2
%18 = load i8, i8* %2
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 98
br i1 %20, label %21, label %43
21: ; preds = %16
br label %22
22: ; preds = %26, %21
%23 = call signext i8 (...) @getchar()
store i8 %23, i8* %2
%24 = sext i8 %23 to i32
%25 = icmp ne i32 %24, 123
br i1 %25, label %26, label %27
26: ; preds = %22
br label %22
27: ; preds = %22
%28 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
store i8* %28, i8** %4
br label %29
29: ; preds = %33, %27
%30 = call signext i8 (...) @getchar()
store i8 %30, i8* %2
%31 = sext i8 %30 to i32
%32 = icmp ne i32 %31, 125
br i1 %32, label %33, label %38
33: ; preds = %29
%34 = load i8, i8* %2
%35 = load i8*, i8** %4
store i8 %34, i8* %35
%36 = load i8*, i8** %4
%37 = getelementptr inbounds i8, i8* %36, i32 1
store i8* %37, i8** %4
br label %29
38: ; preds = %29
%39 = load i8*, i8** %4
store i8 0, i8* %39
%40 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%41 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i8* %40, i8* %41)
br label %51
43: ; preds = %16
%44 = load i8, i8* %2
%45 = sext i8 %44 to i32
%46 = icmp eq i32 %45, 101
br i1 %46, label %47, label %50
47: ; preds = %43
%48 = call signext i8 (...) @getchar()
store i8 %48, i8* %2
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %50
50: ; preds = %47, %43
br label %51
51: ; preds = %50, %38
br label %68
52: ; preds = %12
%53 = load i8, i8* %2
%54 = sext i8 %53 to i32
%55 = icmp eq i32 %54, 125
br i1 %55, label %56, label %58
56: ; preds = %52
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
br label %67
58: ; preds = %52
%59 = load i8, i8* %2
%60 = sext i8 %59 to i32
%61 = icmp eq i32 %60, 123
br i1 %61, label %62, label %63
62: ; preds = %58
br label %66
63: ; preds = %58
%64 = load i8, i8* %2
%65 = call i32 @putchar(i8 signext %64)
br label %66
66: ; preds = %63, %62
br label %67
67: ; preds = %66, %56
br label %68
68: ; preds = %67, %51
br label %6
69: ; preds = %6
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%71 = load i32, i32* %1
ret i32 %71
}

LLVM IR (-O2):
@EOF = global i8 0
@.str.1 = [37 x i8] c"\0A<DT> <A NAME=\22%s\22 ></A> <B> %s </B>\00"
@.str.2 = [6 x i8] c" <I> \00"
@.str.3 = [5 x i8] c"</I>\00"
@str = [12 x i8] c"<HTML>\0A<DL>\00"
@str.5 = [6 x i8] c"</DL>\00"
define i32 @main() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%4 = call signext i8 (...) @getchar()
%5 = load i8, i8* @EOF
%6 = icmp eq i8 %4, %5
br i1 %6, label %37, label %7
7: ; preds = %0, %33
%8 = phi i8 [ %34, %33 ], [ %4, %0 ]
switch i8 %8, label %31 [
i8 92, label %9
i8 125, label %29
i8 123, label %33
]
9: ; preds = %7
%10 = call signext i8 (...) @getchar()
switch i8 %10, label %33 [
i8 98, label %11
i8 101, label %26
]
11: ; preds = %9, %11
%12 = call signext i8 (...) @getchar()
%13 = icmp eq i8 %12, 123
br i1 %13, label %14, label %11
14: ; preds = %11
%15 = call signext i8 (...) @getchar()
%16 = icmp eq i8 %15, 125
br i1 %16, label %23, label %17
17: ; preds = %14, %17
%18 = phi i8 [ %21, %17 ], [ %15, %14 ]
%19 = phi i8* [ %20, %17 ], [ %2, %14 ]
store i8 %18, i8* %19
%20 = getelementptr inbounds i8, i8* %19, i64 1
%21 = call signext i8 (...) @getchar()
%22 = icmp eq i8 %21, 125
br i1 %22, label %23, label %17
23: ; preds = %17, %14
%24 = phi i8* [ %2, %14 ], [ %20, %17 ]
store i8 0, i8* %24
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i8* %2, i8* %2)
br label %33
26: ; preds = %9
%27 = call signext i8 (...) @getchar()
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %33
29: ; preds = %7
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
br label %33
31: ; preds = %7
%32 = call i32 @putchar(i8 signext %8)
br label %33
33: ; preds = %7, %9, %29, %31, %23, %26
%34 = call signext i8 (...) @getchar()
%35 = load i8, i8* @EOF
%36 = icmp eq i8 %34, %35
br i1 %36, label %37, label %7
37: ; preds = %33, %0
%38 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.5, i64 0, i64 0))
ret i32 0
}