#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 *, unsigned char, int,
                           ...);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
int main(int argc, char **argv) {
  FILE *output;
  int i, j;
  output = fopen("output.html", "wb");
  if (output == NULL) {
    return -1;
  }
  fputs(
      "<!DOCTYPE html>\n<html><head><meta charset=\"Shift-JIS\" /><body><pre>",
      output);
  for (i = 32; i < 256; i++) {
    if ((i > 0x80 && i < 0xa0) || (i > 0xdf && i < 0xfd)) {
      for (j = 0x40; j < 0xfd; j++) {
        if (j != 0x7f) {
          fprintf(output, "\"%c%c\",0x%02x,0x%02x\n", (unsigned char)i,
                  (unsigned char)j, i, j);
        }
      }
    } else if (i == 0x2c) {
    } else {
      fprintf(output, "\"%c\",0x0,0x%02x\n", (unsigned char)i, i);
    }
  }
  fputs("</pre></body></html>\n", output);
  fclose(output);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xea3(%rip),%rdi
lea    0xea8(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1184 <main+0x44>
movl   $0xffffffff,-0x4(%rbp)
jmp    129a <main+0x15a>
mov    -0x18(%rbp),%rsi
lea    0xe80(%rip),%rdi
call   1040 <fputs@plt>
movl   $0x20,-0x1c(%rbp)
cmpl   $0x100,-0x1c(%rbp)
jge    127a <main+0x13a>
cmpl   $0x80,-0x1c(%rbp)
jle    11c2 <main+0x82>
cmpl   $0xa0,-0x1c(%rbp)
jl     11dc <main+0x9c>
cmpl   $0xdf,-0x1c(%rbp)
jle    1238 <main+0xf8>
cmpl   $0xfd,-0x1c(%rbp)
jge    1238 <main+0xf8>
movl   $0x40,-0x20(%rbp)
cmpl   $0xfd,-0x20(%rbp)
jge    1233 <main+0xf3>
cmpl   $0x7f,-0x20(%rbp)
je     1220 <main+0xe0>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%eax
mov    -0x20(%rbp),%ecx
movzbl %cl,%ecx
mov    -0x1c(%rbp),%r8d
mov    -0x20(%rbp),%r9d
lea    0xe3d(%rip),%rsi
movzbl %al,%edx
mov    $0x0,%al
call   1050 <fprintf@plt>
jmp    1225 <main+0xe5>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    11e3 <main+0xa3>
jmp    1267 <main+0x127>
cmpl   $0x2c,-0x1c(%rbp)
jne    1247 <main+0x107>
jmp    1262 <main+0x122>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%eax
mov    -0x1c(%rbp),%ecx
lea    0xe11(%rip),%rsi
movzbl %al,%edx
mov    $0x0,%al
call   1050 <fprintf@plt>
jmp    1267 <main+0x127>
jmp    126c <main+0x12c>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    119b <main+0x5b>
mov    -0x18(%rbp),%rsi
lea    0xdf5(%rip),%rdi
call   1040 <fputs@plt>
mov    -0x18(%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   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
lea    0xeb1(%rip),%rdi
lea    0xeb6(%rip),%rsi
call   1050 <fopen@plt>
test   %rax,%rax
je     123f <main+0xff>
mov    %rax,%r14
lea    0xea1(%rip),%rdi
mov    $0x43,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1060 <fwrite@plt>
mov    $0x20,%ebx
lea    0xec7(%rip),%r15
lea    0xed6(%rip),%r12
jmp    11ab <main+0x6b>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%ebx
cmp    $0x100,%ebx
je     121a <main+0xda>
lea    -0x81(%rbx),%eax
cmp    $0x1f,%eax
jb     11e0 <main+0xa0>
lea    -0xe0(%rbx),%eax
cmp    $0x1c,%eax
jbe    11e0 <main+0xa0>
cmp    $0x2c,%ebx
je     11a0 <main+0x60>
movzbl %bl,%edx
mov    %r14,%rdi
mov    %r12,%rsi
mov    %ebx,%ecx
xor    %eax,%eax
call   1040 <fprintf@plt>
jmp    11a0 <main+0x60>
nopw   0x0(%rax,%rax,1)
mov    $0x40,%ebp
jmp    11fb <main+0xbb>
nopw   0x0(%rax,%rax,1)
add    $0x1,%ebp
cmp    $0xfd,%ebp
je     11a0 <main+0x60>
cmp    $0x7f,%ebp
je     11f0 <main+0xb0>
movzbl %bl,%edx
mov    %r14,%rdi
mov    %r15,%rsi
mov    %ebp,%ecx
mov    %ebx,%r8d
mov    %ebp,%r9d
xor    %eax,%eax
call   1040 <fprintf@plt>
jmp    11f0 <main+0xb0>
lea    0xe59(%rip),%rdi
mov    $0x15,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1060 <fwrite@plt>
mov    %r14,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
jmp    1244 <main+0x104>
mov    $0xffffffff,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [12 x i8] c"output.html\00"
@.str.1 = [3 x i8] c"wb\00"
@.str.2 = [68 x i8] c"<!DOCTYPE html>\0A<html><head><meta charset=\22Shift-JIS\22 /><body><pre>\00"
@.str.3 = [22 x i8] c"\22%c%c\22,0x%02x,0x%02x\0A\00"
@.str.4 = [17 x i8] c"\22%c\22,0x0,0x%02x\0A\00"
@.str.5 = [22 x i8] c"</pre></body></html>\0A\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
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = call i32* @fopen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %9, i32** %6
%10 = load i32*, i32** %6
%11 = icmp eq i32* %10, null
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 -1, i32* %3
br label %73
13: ; preds = %2
%14 = load i32*, i32** %6
%15 = call i32 @fputs(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.2, i64 0, i64 0), i32* %14)
store i32 32, i32* %7
br label %16
16: ; preds = %65, %13
%17 = load i32, i32* %7
%18 = icmp slt i32 %17, 256
br i1 %18, label %19, label %68
19: ; preds = %16
%20 = load i32, i32* %7
%21 = icmp sgt i32 %20, 128
br i1 %21, label %22, label %25
22: ; preds = %19
%23 = load i32, i32* %7
%24 = icmp slt i32 %23, 160
br i1 %24, label %31, label %25
25: ; preds = %22, %19
%26 = load i32, i32* %7
%27 = icmp sgt i32 %26, 223
br i1 %27, label %28, label %53
28: ; preds = %25
%29 = load i32, i32* %7
%30 = icmp slt i32 %29, 253
br i1 %30, label %31, label %53
31: ; preds = %28, %22
store i32 64, i32* %8
br label %32
32: ; preds = %49, %31
%33 = load i32, i32* %8
%34 = icmp slt i32 %33, 253
br i1 %34, label %35, label %52
35: ; preds = %32
%36 = load i32, i32* %8
%37 = icmp ne i32 %36, 127
br i1 %37, label %38, label %48
38: ; preds = %35
%39 = load i32*, i32** %6
%40 = load i32, i32* %7
%41 = trunc i32 %40 to i8
%42 = load i32, i32* %8
%43 = trunc i32 %42 to i8
%44 = zext i8 %43 to i32
%45 = load i32, i32* %7
%46 = load i32, i32* %8
%47 = call i32 (i32*, i8*, i8, i32, ...) @fprintf(i32* %39, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), i8 zeroext %41, i32 %44, i32 %45, i32 %46)
br label %48
48: ; preds = %38, %35
br label %49
49: ; preds = %48
%50 = load i32, i32* %8
%51 = add nsw i32 %50, 1
store i32 %51, i32* %8
br label %32
52: ; preds = %32
br label %64
53: ; preds = %28, %25
%54 = load i32, i32* %7
%55 = icmp eq i32 %54, 44
br i1 %55, label %56, label %57
56: ; preds = %53
br label %63
57: ; preds = %53
%58 = load i32*, i32** %6
%59 = load i32, i32* %7
%60 = trunc i32 %59 to i8
%61 = load i32, i32* %7
%62 = call i32 (i32*, i8*, i8, i32, ...) @fprintf(i32* %58, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i8 zeroext %60, i32 %61)
br label %63
63: ; preds = %57, %56
br label %64
64: ; preds = %63, %52
br label %65
65: ; preds = %64
%66 = load i32, i32* %7
%67 = add nsw i32 %66, 1
store i32 %67, i32* %7
br label %16
68: ; preds = %16
%69 = load i32*, i32** %6
%70 = call i32 @fputs(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), i32* %69)
%71 = load i32*, i32** %6
%72 = call i32 @fclose(i32* %71)
store i32 0, i32* %3
br label %73
73: ; preds = %68, %12
%74 = load i32, i32* %3
ret i32 %74
}

LLVM IR (-O2):
@.str = [12 x i8] c"output.html\00"
@.str.1 = [3 x i8] c"wb\00"
@.str.2 = [68 x i8] c"<!DOCTYPE html>\0A<html><head><meta charset=\22Shift-JIS\22 /><body><pre>\00"
@.str.3 = [22 x i8] c"\22%c%c\22,0x%02x,0x%02x\0A\00"
@.str.4 = [17 x i8] c"\22%c\22,0x0,0x%02x\0A\00"
@.str.5 = [22 x i8] c"</pre></body></html>\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32* @fopen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%4 = icmp eq i32* %3, null
br i1 %4, label %35, label %5
5: ; preds = %2
%6 = tail call i64 @fwrite(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.2, i64 0, i64 0), i64 67, i64 1, i32* %3)
br label %7
7: ; preds = %5, %29
%8 = phi i32 [ 32, %5 ], [ %30, %29 ]
%9 = add nsw i32 %8, -129
%10 = icmp ult i32 %9, 31
%11 = add nsw i32 %8, -224
%12 = icmp ult i32 %11, 29
%13 = select i1 %10, i1 true, i1 %12
br i1 %13, label %14, label %24
14: ; preds = %7
%15 = trunc i32 %8 to i8
br label %16
16: ; preds = %14, %21
%17 = phi i32 [ 64, %14 ], [ %22, %21 ]
%18 = icmp eq i32 %17, 127
br i1 %18, label %21, label %19
19: ; preds = %16
%20 = tail call i32 (i32*, i8*, i8, i32, ...) @fprintf(i32* %3, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), i8 zeroext %15, i32 %17, i32 %8, i32 %17)
br label %21
21: ; preds = %16, %19
%22 = add nuw nsw i32 %17, 1
%23 = icmp eq i32 %22, 253
br i1 %23, label %29, label %16
24: ; preds = %7
%25 = icmp eq i32 %8, 44
br i1 %25, label %29, label %26
26: ; preds = %24
%27 = trunc i32 %8 to i8
%28 = tail call i32 (i32*, i8*, i8, i32, ...) @fprintf(i32* %3, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i8 zeroext %27, i32 %8)
br label %29
29: ; preds = %21, %24, %26
%30 = add nuw nsw i32 %8, 1
%31 = icmp eq i32 %30, 256
br i1 %31, label %32, label %7
32: ; preds = %29
%33 = tail call i64 @fwrite(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), i64 21, i64 1, i32* %3)
%34 = tail call i32 @fclose(i32* %3)
br label %35
35: ; preds = %2, %32
%36 = phi i32 [ 0, %32 ], [ -1, %2 ]
ret i32 %36
}