#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*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
int main(void) {
  int i;
  FILE *f = fopen("viscii.html", "w");
  if (!f)
    return 1;
  fputs("<html>\n <head>\n  <meta http-equiv=\"Content-Type\" "
        "content=\"text/html;charset=viscii\">\n  <title>VISCII</title>\n"
        " </head>\n <body>\n  <table>\n   <tr><th>  ",
        f);
  for (i = 0; i < 16; i++) {
    fprintf(f, "<th>%X", i);
  }
  for (i = 0; i < 256; i++) {
    if (0 == (i & 0x0F)) {
      fprintf(f, "\n   <tr><th>%02X", i);
    }
    fprintf(f, "<td>%c",
            ((i >= 32 && i != 127) || (i == 2) || (i == 5) || (i == 6) ||
             (i == 0x14) || (i == 0x19) || (i == 0x1E))
                ? (char)i
                : ' ');
  }
  fputs("\n  </table>\n </body>\n</html>\n", f);
  fclose(f);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
lea    0xeaf(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    117d <main+0x3d>
movl   $0x1,-0x4(%rbp)
jmp    12b3 <main+0x173>
mov    -0x10(%rbp),%rsi
lea    0xe86(%rip),%rdi
call   1040 <fputs@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x10,-0x8(%rbp)
jge    11c2 <main+0x82>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%eax
lea    0xef8(%rip),%rsi
movsbl %al,%edx
call   1050 <fprintf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1194 <main+0x54>
movl   $0x0,-0x8(%rbp)
cmpl   $0x100,-0x8(%rbp)
jge    1293 <main+0x153>
mov    -0x8(%rbp),%ecx
and    $0xf,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
jne    11fc <main+0xbc>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%eax
lea    0xeb7(%rip),%rsi
movsbl %al,%edx
call   1050 <fprintf@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x20,-0x8(%rbp)
jl     1218 <main+0xd8>
cmpl   $0x7f,-0x8(%rbp)
jne    1254 <main+0x114>
cmpl   $0x2,-0x8(%rbp)
je     1254 <main+0x114>
cmpl   $0x5,-0x8(%rbp)
je     1254 <main+0x114>
cmpl   $0x6,-0x8(%rbp)
je     1254 <main+0x114>
cmpl   $0x14,-0x8(%rbp)
je     1254 <main+0x114>
cmpl   $0x19,-0x8(%rbp)
je     1254 <main+0x114>
cmpl   $0x1e,-0x8(%rbp)
jne    1262 <main+0x122>
mov    -0x8(%rbp),%eax
movsbl %al,%eax
mov    %eax,-0x1c(%rbp)
jmp    126f <main+0x12f>
mov    $0x20,%eax
mov    %eax,-0x1c(%rbp)
jmp    126f <main+0x12f>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%eax
lea    0xe3f(%rip),%rsi
movsbl %al,%edx
call   1050 <fprintf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11c9 <main+0x89>
mov    -0x10(%rbp),%rsi
lea    0xe25(%rip),%rdi
call   1040 <fputs@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xeb1(%rip),%rdi
lea    0xeb6(%rip),%rsi
call   1050 <fopen@plt>
test   %rax,%rax
je     1327 <main+0x1e7>
mov    %rax,%r12
lea    0xea0(%rip),%rdi
mov    $0x95,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1060 <fwrite@plt>
lea    0xf1d(%rip),%r14
xor    %ebx,%ebx
mov    %r12,%rdi
mov    %r14,%rsi
xor    %edx,%edx
call   1040 <fprintf@plt>
mov    %r12,%rdi
mov    %r14,%rsi
mov    $0x1,%edx
call   1040 <fprintf@plt>
mov    %r12,%rdi
mov    %r14,%rsi
mov    $0x2,%edx
call   1040 <fprintf@plt>
mov    %r12,%rdi
mov    %r14,%rsi
mov    $0x3,%edx
call   1040 <fprintf@plt>
mov    %r12,%rdi
mov    %r14,%rsi
mov    $0x4,%edx
call   1040 <fprintf@plt>
mov    %r12,%rdi
mov    %r14,%rsi
mov    $0x5,%edx
call   1040 <fprintf@plt>
mov    %r12,%rdi
mov    %r14,%rsi
mov    $0x6,%edx
call   1040 <fprintf@plt>
mov    %r12,%rdi
mov    %r14,%rsi
mov    $0x7,%edx
call   1040 <fprintf@plt>
mov    %r12,%rdi
mov    %r14,%rsi
mov    $0x8,%edx
call   1040 <fprintf@plt>
mov    %r12,%rdi
mov    %r14,%rsi
mov    $0x9,%edx
call   1040 <fprintf@plt>
mov    %r12,%rdi
mov    %r14,%rsi
mov    $0xa,%edx
call   1040 <fprintf@plt>
mov    %r12,%rdi
mov    %r14,%rsi
mov    $0xb,%edx
call   1040 <fprintf@plt>
mov    %r12,%rdi
mov    %r14,%rsi
mov    $0xc,%edx
call   1040 <fprintf@plt>
mov    %r12,%rdi
mov    %r14,%rsi
mov    $0xd,%edx
call   1040 <fprintf@plt>
mov    %r12,%rdi
mov    %r14,%rsi
mov    $0xe,%edx
call   1040 <fprintf@plt>
mov    %r12,%rdi
mov    %r14,%rsi
mov    $0xf,%edx
call   1040 <fprintf@plt>
lea    0xe1e(%rip),%r14
lea    0xe28(%rip),%r15
jmp    12ed <main+0x1ad>
cs nopw 0x0(%rax,%rax,1)
cmp    $0x1e,%ebx
mov    $0x20,%eax
cmove  %ebx,%eax
cmp    $0x19,%ebx
cmove  %ebx,%eax
cmp    $0x14,%ebx
cmove  %ebx,%eax
cmp    $0x7f,%ebx
mov    %eax,%ecx
cmovne %ebx,%ecx
cmp    $0x20,%ebx
cmovb  %eax,%ecx
lea    -0x5(%rbx),%eax
cmp    $0x2,%ebx
cmove  %ebx,%ecx
cmp    $0x2,%eax
cmovb  %ebx,%ecx
movsbl %cl,%edx
mov    %r12,%rdi
mov    %r15,%rsi
call   1040 <fprintf@plt>
add    $0x1,%ebx
cmp    $0x100,%ebx
je     1302 <main+0x1c2>
test   $0xf,%bl
jne    12a0 <main+0x160>
movsbl %bl,%edx
mov    %r12,%rdi
mov    %r14,%rsi
call   1040 <fprintf@plt>
jmp    12a0 <main+0x160>
lea    0xdba(%rip),%rdi
mov    $0x1d,%esi
mov    $0x1,%edx
mov    %r12,%rcx
call   1060 <fwrite@plt>
mov    %r12,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
jmp    132c <main+0x1ec>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [12 x i8] c"viscii.html\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [150 x i8] c"<html>\0A <head>\0A <meta http-equiv=\22Content-Type\22 content=\22text/html;charset=viscii\22>\0A <title>VISCII</title>\0A </head>\0A <body>\0A <table>\0A <tr><th> \00"
@.str.3 = [7 x i8] c"<th>%X\00"
@.str.4 = [17 x i8] c"\0A <tr><th>%02X\00"
@.str.5 = [7 x i8] c"<td>%c\00"
@.str.6 = [30 x i8] c"\0A </table>\0A </body>\0A</html>\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
store i32 0, i32* %1
%4 = call i32* @fopen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %4, i32** %3
%5 = load i32*, i32** %3
%6 = icmp ne i32* %5, null
br i1 %6, label %8, label %7
7: ; preds = %0
store i32 1, i32* %1
br label %77
8: ; preds = %0
%9 = load i32*, i32** %3
%10 = call i32 @fputs(i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str.2, i64 0, i64 0), i32* %9)
store i32 0, i32* %2
br label %11
11: ; preds = %19, %8
%12 = load i32, i32* %2
%13 = icmp slt i32 %12, 16
br i1 %13, label %14, label %22
14: ; preds = %11
%15 = load i32*, i32** %3
%16 = load i32, i32* %2
%17 = trunc i32 %16 to i8
%18 = call i32 @fprintf(i32* %15, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8 signext %17)
br label %19
19: ; preds = %14
%20 = load i32, i32* %2
%21 = add nsw i32 %20, 1
store i32 %21, i32* %2
br label %11
22: ; preds = %11
store i32 0, i32* %2
br label %23
23: ; preds = %69, %22
%24 = load i32, i32* %2
%25 = icmp slt i32 %24, 256
br i1 %25, label %26, label %72
26: ; preds = %23
%27 = load i32, i32* %2
%28 = and i32 %27, 15
%29 = icmp eq i32 0, %28
br i1 %29, label %30, label %35
30: ; preds = %26
%31 = load i32*, i32** %3
%32 = load i32, i32* %2
%33 = trunc i32 %32 to i8
%34 = call i32 @fprintf(i32* %31, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i8 signext %33)
br label %35
35: ; preds = %30, %26
%36 = load i32*, i32** %3
%37 = load i32, i32* %2
%38 = icmp sge i32 %37, 32
br i1 %38, label %39, label %42
39: ; preds = %35
%40 = load i32, i32* %2
%41 = icmp ne i32 %40, 127
br i1 %41, label %60, label %42
42: ; preds = %39, %35
%43 = load i32, i32* %2
%44 = icmp eq i32 %43, 2
br i1 %44, label %60, label %45
45: ; preds = %42
%46 = load i32, i32* %2
%47 = icmp eq i32 %46, 5
br i1 %47, label %60, label %48
48: ; preds = %45
%49 = load i32, i32* %2
%50 = icmp eq i32 %49, 6
br i1 %50, label %60, label %51
51: ; preds = %48
%52 = load i32, i32* %2
%53 = icmp eq i32 %52, 20
br i1 %53, label %60, label %54
54: ; preds = %51
%55 = load i32, i32* %2
%56 = icmp eq i32 %55, 25
br i1 %56, label %60, label %57
57: ; preds = %54
%58 = load i32, i32* %2
%59 = icmp eq i32 %58, 30
br i1 %59, label %60, label %64
60: ; preds = %57, %54, %51, %48, %45, %42, %39
%61 = load i32, i32* %2
%62 = trunc i32 %61 to i8
%63 = sext i8 %62 to i32
br label %65
64: ; preds = %57
br label %65
65: ; preds = %64, %60
%66 = phi i32 [ %63, %60 ], [ 32, %64 ]
%67 = trunc i32 %66 to i8
%68 = call i32 @fprintf(i32* %36, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i8 signext %67)
br label %69
69: ; preds = %65
%70 = load i32, i32* %2
%71 = add nsw i32 %70, 1
store i32 %71, i32* %2
br label %23
72: ; preds = %23
%73 = load i32*, i32** %3
%74 = call i32 @fputs(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i32* %73)
%75 = load i32*, i32** %3
%76 = call i32 @fclose(i32* %75)
store i32 0, i32* %1
br label %77
77: ; preds = %72, %7
%78 = load i32, i32* %1
ret i32 %78
}

LLVM IR (-O2):
@.str = [12 x i8] c"viscii.html\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [150 x i8] c"<html>\0A <head>\0A <meta http-equiv=\22Content-Type\22 content=\22text/html;charset=viscii\22>\0A <title>VISCII</title>\0A </head>\0A <body>\0A <table>\0A <tr><th> \00"
@.str.3 = [7 x i8] c"<th>%X\00"
@.str.4 = [17 x i8] c"\0A <tr><th>%02X\00"
@.str.5 = [7 x i8] c"<td>%c\00"
@.str.6 = [30 x i8] c"\0A </table>\0A </body>\0A</html>\0A\00"
define i32 @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i32* %1, null
br i1 %2, label %50, label %3
3: ; preds = %0
%4 = tail call i64 @fwrite(i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str.2, i64 0, i64 0), i64 149, i64 1, i32* %1)
%5 = tail call i32 @fprintf(i32* %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8 signext 0)
%6 = tail call i32 @fprintf(i32* %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8 signext 1)
%7 = tail call i32 @fprintf(i32* %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8 signext 2)
%8 = tail call i32 @fprintf(i32* %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8 signext 3)
%9 = tail call i32 @fprintf(i32* %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8 signext 4)
%10 = tail call i32 @fprintf(i32* %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8 signext 5)
%11 = tail call i32 @fprintf(i32* %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8 signext 6)
%12 = tail call i32 @fprintf(i32* %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8 signext 7)
%13 = tail call i32 @fprintf(i32* %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8 signext 8)
%14 = tail call i32 @fprintf(i32* %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8 signext 9)
%15 = tail call i32 @fprintf(i32* %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8 signext 10)
%16 = tail call i32 @fprintf(i32* %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8 signext 11)
%17 = tail call i32 @fprintf(i32* %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8 signext 12)
%18 = tail call i32 @fprintf(i32* %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8 signext 13)
%19 = tail call i32 @fprintf(i32* %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8 signext 14)
%20 = tail call i32 @fprintf(i32* %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8 signext 15)
br label %21
21: ; preds = %3, %28
%22 = phi i32 [ %45, %28 ], [ 0, %3 ]
%23 = and i32 %22, 15
%24 = icmp eq i32 %23, 0
%25 = trunc i32 %22 to i8
br i1 %24, label %26, label %28
26: ; preds = %21
%27 = tail call i32 @fprintf(i32* %1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i8 signext %25)
br label %28
28: ; preds = %21, %26
%29 = icmp ugt i32 %22, 31
%30 = icmp ne i32 %22, 127
%31 = and i1 %29, %30
%32 = icmp eq i32 %22, 2
%33 = or i1 %32, %31
%34 = add nsw i32 %22, -5
%35 = icmp ult i32 %34, 2
%36 = or i1 %35, %33
%37 = icmp eq i32 %22, 20
%38 = select i1 %36, i1 true, i1 %37
%39 = icmp eq i32 %22, 25
%40 = select i1 %38, i1 true, i1 %39
%41 = icmp eq i32 %22, 30
%42 = select i1 %40, i1 true, i1 %41
%43 = select i1 %42, i8 %25, i8 32
%44 = tail call i32 @fprintf(i32* %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i8 signext %43)
%45 = add nuw nsw i32 %22, 1
%46 = icmp eq i32 %45, 256
br i1 %46, label %47, label %21
47: ; preds = %28
%48 = tail call i64 @fwrite(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i64 29, i64 1, i32* %1)
%49 = tail call i32 @fclose(i32* %1)
br label %50
50: ; preds = %0, %47
%51 = phi i32 [ 0, %47 ], [ 1, %0 ]
ret i32 %51
}