#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ A_BOLD;
int /*<<< orphan*/ A_STANDOUT;
int EOF;
int /*<<< orphan*/ attroff(int /*<<< orphan*/);
int /*<<< orphan*/ attron(int /*<<< orphan*/);
int /*<<< orphan*/ clear();
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ getch();
int /*<<< orphan*/ getmaxyx(int /*<<< orphan*/, int, int);
int /*<<< orphan*/ getyx(int /*<<< orphan*/, int, int);
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ move(int, int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ printw(char *, ...);
int /*<<< orphan*/ refresh();
int /*<<< orphan*/ stdscr;
int main(int argc, char **argv) {
  int ch, prev, row, col;
  prev = EOF;
  FILE *fp;
  int y, x;
  if (argc != 2) {
    printf("Usage: %s <a c file name>\n", argv[0]);
    exit(1);
  }
  fp = fopen(argv[1], "r");
  if (fp == NULL) {
    perror("Cannot open input file");
    exit(1);
  }
  initscr();
  getmaxyx(stdscr, row, col);
  while ((ch = fgetc(fp)) != EOF) {
    getyx(stdscr, y, x);
    if (y == (row - 1)) {
      printw("<-Press Any Key->");
      getch();
      clear();
      move(0, 0);
    }
    if (prev == '/' && ch == '*') {
      attron(A_BOLD);
      getyx(stdscr, y, x);
      move(y, x - 1);
      printw("%c%c", '/', ch);
    } else {
      printw("%c", ch);
      refresh();
      if (prev == '*' && ch == '/')
        attroff(A_BOLD);
      prev = ch;
    }
  }
  attron(A_STANDOUT);
  printw("\nhohohohoh");
  attroff(A_STANDOUT);
  refresh();
  endwin();
  fclose(fp);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2dbb(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     1259 <main+0x49>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xdb6(%rip),%rdi
call   1060 <printf@plt>
mov    $0x1,%edi
call   1110 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdb3(%rip),%rsi
call   10f0 <fopen@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    1292 <main+0x82>
lea    0xd9a(%rip),%rdi
call   1100 <perror@plt>
mov    $0x1,%edi
call   1110 <exit@plt>
mov    $0x0,%al
call   1070 <initscr@plt>
mov    0x2d40(%rip),%rax
mov    (%rax),%edi
mov    -0x1c(%rbp),%esi
mov    -0x20(%rbp),%edx
call   10a0 <getmaxyx@plt>
mov    -0x28(%rbp),%rdi
call   1080 <fgetc@plt>
mov    %eax,-0x14(%rbp)
mov    0x2d28(%rip),%rcx
cmp    (%rcx),%eax
je     13b6 <main+0x1a6>
mov    0x2d11(%rip),%rax
mov    (%rax),%edi
mov    -0x2c(%rbp),%esi
mov    -0x30(%rbp),%edx
call   1050 <getyx@plt>
mov    -0x2c(%rbp),%eax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jne    1312 <main+0x102>
lea    0xd40(%rip),%rdi
mov    $0x0,%al
call   10b0 <printw@plt>
mov    $0x0,%al
call   10d0 <getch@plt>
mov    $0x0,%al
call   1120 <clear@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1130 <move@plt>
cmpl   $0x2f,-0x18(%rbp)
jne    1371 <main+0x161>
cmpl   $0x2a,-0x14(%rbp)
jne    1371 <main+0x161>
mov    0x2c9b(%rip),%rax
mov    (%rax),%edi
call   1090 <attron@plt>
mov    0x2ca5(%rip),%rax
mov    (%rax),%edi
mov    -0x2c(%rbp),%esi
mov    -0x30(%rbp),%edx
call   1050 <getyx@plt>
mov    -0x2c(%rbp),%edi
mov    -0x30(%rbp),%esi
sub    $0x1,%esi
call   1130 <move@plt>
mov    -0x14(%rbp),%edx
lea    0xce6(%rip),%rdi
mov    $0x2f,%esi
mov    $0x0,%al
call   10b0 <printw@plt>
jmp    13b1 <main+0x1a1>
mov    -0x14(%rbp),%esi
lea    0xccd(%rip),%rdi
mov    $0x0,%al
call   10b0 <printw@plt>
mov    $0x0,%al
call   10c0 <refresh@plt>
cmpl   $0x2a,-0x18(%rbp)
jne    13ab <main+0x19b>
cmpl   $0x2f,-0x14(%rbp)
jne    13ab <main+0x19b>
mov    0x2c24(%rip),%rax
mov    (%rax),%edi
call   1030 <attroff@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    12ad <main+0x9d>
mov    0x2c13(%rip),%rax
mov    (%rax),%edi
call   1090 <attron@plt>
lea    0xc80(%rip),%rdi
mov    $0x0,%al
call   10b0 <printw@plt>
mov    0x2bf7(%rip),%rax
mov    (%rax),%edi
call   1030 <attroff@plt>
mov    $0x0,%al
call   10c0 <refresh@plt>
mov    $0x0,%al
call   10e0 <endwin@plt>
mov    -0x28(%rbp),%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
cmp    $0x2,%edi
jne    133f <main+0x14f>
mov    0x2ddd(%rip),%r12
mov    (%r12),%r15d
mov    0x8(%rsi),%rdi
lea    0xe01(%rip),%rsi
call   10e0 <fopen@plt>
test   %rax,%rax
je     1358 <main+0x168>
mov    %rax,%rbx
xor    %eax,%eax
call   1070 <initscr@plt>
mov    0x2da7(%rip),%r13
mov    0x0(%r13),%edi
call   10a0 <getmaxyx@plt>
mov    %rbx,%rdi
call   1080 <fgetc@plt>
cmp    (%r12),%eax
jne    129c <main+0xac>
mov    0x2d79(%rip),%rbp
mov    0x0(%rbp),%edi
call   1090 <attron@plt>
lea    0xdd3(%rip),%rdi
xor    %eax,%eax
call   10b0 <printw@plt>
mov    0x0(%rbp),%edi
call   1030 <attroff@plt>
xor    %eax,%eax
call   10c0 <refresh@plt>
xor    %eax,%eax
call   10d0 <endwin@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %eax,%ebp
mov    0x2d23(%rip),%r14
jmp    12fa <main+0x10a>
nopw   0x0(%rax,%rax,1)
mov    (%r14),%edi
call   1090 <attron@plt>
mov    0x0(%r13),%edi
call   1050 <getyx@plt>
call   1110 <move@plt>
mov    $0x2f,%ebp
lea    0xd62(%rip),%rdi
mov    $0x2f,%esi
mov    $0x2a,%edx
xor    %eax,%eax
call   10b0 <printw@plt>
mov    %ebp,%r15d
mov    %rbx,%rdi
call   1080 <fgetc@plt>
mov    %eax,%ebp
cmp    (%r12),%eax
je     1250 <main+0x60>
mov    0x0(%r13),%edi
call   1050 <getyx@plt>
cmp    $0x2f,%r15d
jne    130e <main+0x11e>
cmp    $0x2a,%ebp
je     12b0 <main+0xc0>
lea    0xd21(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   10b0 <printw@plt>
xor    %eax,%eax
call   10c0 <refresh@plt>
cmp    $0x2a,%r15d
jne    12e3 <main+0xf3>
cmp    $0x2f,%ebp
jne    12e3 <main+0xf3>
mov    (%r14),%edi
call   1030 <attroff@plt>
mov    $0x2f,%ebp
jmp    12e3 <main+0xf3>
mov    (%rsi),%rsi
lea    0xcb7(%rip),%rdi
call   1060 <printf@plt>
mov    $0x1,%edi
call   1100 <exit@plt>
lea    0xcbe(%rip),%rdi
call   10f0 <perror@plt>
mov    $0x1,%edi
call   1100 <exit@plt>

LLVM IR (-O0):
@EOF = global i32 0
@.str = [27 x i8] c"Usage: %s <a c file name>\0A\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [23 x i8] c"Cannot open input file\00"
@stdscr = global i32 0
@.str.3 = [18 x i8] c"<-Press Any Key->\00"
@A_BOLD = global i32 0
@.str.4 = [5 x i8] c"%c%c\00"
@.str.5 = [3 x i8] c"%c\00"
@A_STANDOUT = global i32 0
@.str.6 = [11 x i8] c"\0Ahohohohoh\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32*
%11 = alloca i32
%12 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%13 = load i32, i32* @EOF
store i32 %13, i32* %7
%14 = load i32, i32* %4
%15 = icmp ne i32 %14, 2
br i1 %15, label %16, label %22
16: ; preds = %2
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 0
%19 = load i8*, i8** %18
%20 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %19)
%21 = call i32 @exit(i32 1)
unreachable
22: ; preds = %2
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i64 1
%25 = load i8*, i8** %24
%26 = call i32* @fopen(i8* %25, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %26, i32** %10
%27 = load i32*, i32** %10
%28 = icmp eq i32* %27, null
br i1 %28, label %29, label %32
29: ; preds = %22
%30 = call i32 @perror(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
%31 = call i32 @exit(i32 1)
unreachable
32: ; preds = %22
%33 = call i32 (...) @initscr()
%34 = load i32, i32* @stdscr
%35 = load i32, i32* %8
%36 = load i32, i32* %9
%37 = call i32 @getmaxyx(i32 %34, i32 %35, i32 %36)
br label %38
38: ; preds = %90, %32
%39 = load i32*, i32** %10
%40 = call i32 @fgetc(i32* %39)
store i32 %40, i32* %6
%41 = load i32, i32* @EOF
%42 = icmp ne i32 %40, %41
br i1 %42, label %43, label %91
43: ; preds = %38
%44 = load i32, i32* @stdscr
%45 = load i32, i32* %11
%46 = load i32, i32* %12
%47 = call i32 @getyx(i32 %44, i32 %45, i32 %46)
%48 = load i32, i32* %11
%49 = load i32, i32* %8
%50 = sub nsw i32 %49, 1
%51 = icmp eq i32 %48, %50
br i1 %51, label %52, label %57
52: ; preds = %43
%53 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%54 = call i32 (...) @getch()
%55 = call i32 (...) @clear()
%56 = call i32 @move(i32 0, i32 0)
br label %57
57: ; preds = %52, %43
%58 = load i32, i32* %7
%59 = icmp eq i32 %58, 47
br i1 %59, label %60, label %76
60: ; preds = %57
%61 = load i32, i32* %6
%62 = icmp eq i32 %61, 42
br i1 %62, label %63, label %76
63: ; preds = %60
%64 = load i32, i32* @A_BOLD
%65 = call i32 @attron(i32 %64)
%66 = load i32, i32* @stdscr
%67 = load i32, i32* %11
%68 = load i32, i32* %12
%69 = call i32 @getyx(i32 %66, i32 %67, i32 %68)
%70 = load i32, i32* %11
%71 = load i32, i32* %12
%72 = sub nsw i32 %71, 1
%73 = call i32 @move(i32 %70, i32 %72)
%74 = load i32, i32* %6
%75 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 47, i32 %74)
br label %90
76: ; preds = %60, %57
%77 = load i32, i32* %6
%78 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 %77)
%79 = call i32 (...) @refresh()
%80 = load i32, i32* %7
%81 = icmp eq i32 %80, 42
br i1 %81, label %82, label %88
82: ; preds = %76
%83 = load i32, i32* %6
%84 = icmp eq i32 %83, 47
br i1 %84, label %85, label %88
85: ; preds = %82
%86 = load i32, i32* @A_BOLD
%87 = call i32 @attroff(i32 %86)
br label %88
88: ; preds = %85, %82, %76
%89 = load i32, i32* %6
store i32 %89, i32* %7
br label %90
90: ; preds = %88, %63
br label %38
91: ; preds = %38
%92 = load i32, i32* @A_STANDOUT
%93 = call i32 @attron(i32 %92)
%94 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0))
%95 = load i32, i32* @A_STANDOUT
%96 = call i32 @attroff(i32 %95)
%97 = call i32 (...) @refresh()
%98 = call i32 (...) @endwin()
%99 = load i32*, i32** %10
%100 = call i32 @fclose(i32* %99)
ret i32 0
}

LLVM IR (-O2):
@EOF = global i32 0
@.str = [27 x i8] c"Usage: %s <a c file name>\0A\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [23 x i8] c"Cannot open input file\00"
@stdscr = global i32 0
@A_BOLD = global i32 0
@.str.4 = [5 x i8] c"%c%c\00"
@.str.5 = [3 x i8] c"%c\00"
@A_STANDOUT = global i32 0
@.str.6 = [11 x i8] c"\0Ahohohohoh\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i32, i32* @EOF
%4 = icmp eq i32 %0, 2
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = load i8*, i8** %1
%7 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = tail call i32* @fopen(i8* %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%13 = icmp eq i32* %12, null
br i1 %13, label %14, label %17
14: ; preds = %9
%15 = tail call i32 @perror(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
%16 = tail call i32 @exit(i32 1)
unreachable
17: ; preds = %9
%18 = tail call i32 (...) @initscr()
%19 = load i32, i32* @stdscr
%20 = tail call i32 @getmaxyx(i32 %19, i32 undef, i32 undef)
%21 = tail call i32 @fgetc(i32* %12)
%22 = load i32, i32* @EOF
%23 = icmp eq i32 %21, %22
br i1 %23, label %53, label %24
24: ; preds = %17, %48
%25 = phi i32 [ %50, %48 ], [ %21, %17 ]
%26 = phi i32 [ %49, %48 ], [ %3, %17 ]
%27 = load i32, i32* @stdscr
%28 = tail call i32 @getyx(i32 %27, i32 undef, i32 undef)
%29 = icmp eq i32 %26, 47
%30 = icmp eq i32 %25, 42
%31 = and i1 %29, %30
br i1 %31, label %32, label %39
32: ; preds = %24
%33 = load i32, i32* @A_BOLD
%34 = tail call i32 @attron(i32 %33)
%35 = load i32, i32* @stdscr
%36 = tail call i32 @getyx(i32 %35, i32 undef, i32 undef)
%37 = tail call i32 @move(i32 undef, i32 undef)
%38 = tail call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 47, i32 42)
br label %48
39: ; preds = %24
%40 = tail call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 %25)
%41 = tail call i32 (...) @refresh()
%42 = icmp eq i32 %26, 42
%43 = icmp eq i32 %25, 47
%44 = and i1 %42, %43
br i1 %44, label %45, label %48
45: ; preds = %39
%46 = load i32, i32* @A_BOLD
%47 = tail call i32 @attroff(i32 %46)
br label %48
48: ; preds = %39, %45, %32
%49 = phi i32 [ 47, %32 ], [ 47, %45 ], [ %25, %39 ]
%50 = tail call i32 @fgetc(i32* %12)
%51 = load i32, i32* @EOF
%52 = icmp eq i32 %50, %51
br i1 %52, label %53, label %24
53: ; preds = %48, %17
%54 = load i32, i32* @A_STANDOUT
%55 = tail call i32 @attron(i32 %54)
%56 = tail call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0))
%57 = load i32, i32* @A_STANDOUT
%58 = tail call i32 @attroff(i32 %57)
%59 = tail call i32 (...) @refresh()
%60 = tail call i32 (...) @endwin()
%61 = tail call i32 @fclose(i32* %12)
ret i32 0
}