#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 EXIT_SUCCESS;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ printf(char *, ...);
char *strchr(char *, char);
char *strerror(int /*<<< orphan*/);
int main(int argc, char **argv) {
  FILE *in, *out;
  char line[4096];
  if (argc < 2) {
    printf("Usage:  csstoh cssfile header.h \n");
    exit(0);
  }
  in = fopen(argv[1], "rm");
  if (!in) {
    printf("Failed to open input file %s (%s) \n", argv[1], strerror(errno));
    exit(0);
  }
  out = fopen(argv[2], "wm");
  if (!out) {
    printf("Failed to open output file %s (%s) \n", argv[1], strerror(errno));
    exit(0);
  }
  fprintf(out, "#ifndef __INCLUDE_GUARD_CCS_H\n");
  fprintf(out, "#define __INCLUDE_GUARD_CCS_H\n");
  fprintf(out, "\n");
  fprintf(out, "const char css[] = \n");
  while (!feof(in)) {
    char *c;
    if (fgets(line, 4095, in) == NULL)
      break;
    c = strchr(line, '\n');
    if (c)
      *c = 0;
    fprintf(out, "\t\"%s\\n\"\n", line);
  }
  fprintf(out, ";\n");
  fprintf(out, "#endif\n");
  fclose(out);
  fclose(in);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1040,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    11c8 <main+0x38>
lea    0xe46(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
xor    %edi,%edi
call   10a0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe4b(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1227 <main+0x97>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x1030(%rbp)
mov    0x2ddf(%rip),%rax
mov    (%rax),%edi
call   10b0 <strerror@plt>
mov    -0x1030(%rbp),%rsi
mov    %rax,%rdx
lea    0xe0c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
xor    %edi,%edi
call   10a0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xe13(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1286 <main+0xf6>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x1038(%rbp)
mov    0x2d80(%rip),%rax
mov    (%rax),%edi
call   10b0 <strerror@plt>
mov    -0x1038(%rbp),%rsi
mov    %rax,%rdx
lea    0xdd4(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
xor    %edi,%edi
call   10a0 <exit@plt>
mov    -0x20(%rbp),%rdi
lea    0xde0(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xded(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xd92(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xde8(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1080 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    12ec <main+0x15c>
jmp    135e <main+0x1ce>
lea    -0x1020(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0xfff,%esi
call   1060 <fgets@plt>
cmp    $0x0,%rax
jne    1310 <main+0x180>
jmp    135e <main+0x1ce>
lea    -0x1020(%rbp),%rdi
mov    $0xa,%esi
call   1040 <strchr@plt>
mov    %rax,-0x1028(%rbp)
cmpq   $0x0,-0x1028(%rbp)
je     1340 <main+0x1b0>
mov    -0x1028(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x20(%rbp),%rdi
lea    -0x1020(%rbp),%rdx
lea    0xd72(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
jmp    12ce <main+0x13e>
mov    -0x20(%rbp),%rdi
lea    0xd64(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xd55(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x20(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
mov    0x2c3d(%rip),%rax
mov    (%rax),%eax
add    $0x1040,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x1008,%rsp
cmp    $0x1,%edi
jle    1330 <main+0x170>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
lea    0xe1b(%rip),%rsi
call   10b0 <fopen@plt>
test   %rax,%rax
je     1343 <main+0x183>
mov    %rax,%r14
mov    0x10(%rbx),%rdi
lea    0xe26(%rip),%rsi
call   10b0 <fopen@plt>
test   %rax,%rax
je     135e <main+0x19e>
mov    %rax,%r15
lea    0xe36(%rip),%rdi
mov    $0x1e,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   10d0 <fwrite@plt>
lea    0xe3c(%rip),%rdi
mov    $0x1e,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   10d0 <fwrite@plt>
mov    $0xa,%edi
mov    %r15,%rsi
call   1070 <fputc@plt>
lea    0xe35(%rip),%rdi
mov    $0x14,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   10d0 <fwrite@plt>
mov    %r14,%rdi
call   10a0 <feof@plt>
test   %eax,%eax
je     12d0 <main+0x110>
lea    0xe2e(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   10d0 <fwrite@plt>
lea    0xe18(%rip),%rdi
mov    $0x7,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   10d0 <fwrite@plt>
mov    %r15,%rdi
call   1040 <fclose@plt>
mov    %r14,%rdi
call   1040 <fclose@plt>
mov    0x2d19(%rip),%rax
mov    (%rax),%eax
add    $0x1008,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret
mov    %rsp,%rbx
lea    0xdc8(%rip),%r12
jmp    1300 <main+0x140>
nopl   0x0(%rax)
mov    %r15,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    %r14,%rdi
call   10a0 <feof@plt>
test   %eax,%eax
jne    1276 <main+0xb6>
mov    %rbx,%rdi
mov    $0xfff,%esi
mov    %r14,%rdx
call   1080 <fgets@plt>
test   %rax,%rax
je     1276 <main+0xb6>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1050 <strchr@plt>
test   %rax,%rax
je     12e0 <main+0x120>
movb   $0x0,(%rax)
jmp    12e0 <main+0x120>
lea    0xd7f(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   10c0 <exit@plt>
mov    0x8(%rbx),%rbx
mov    0x2c92(%rip),%rax
mov    (%rax),%edi
call   10e0 <strerror@plt>
lea    0xca7(%rip),%rdi
jmp    1377 <main+0x1b7>
mov    0x8(%rbx),%rbx
mov    0x2c77(%rip),%rax
mov    (%rax),%edi
call   10e0 <strerror@plt>
lea    0xcb3(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1060 <printf@plt>
xor    %edi,%edi
call   10c0 <exit@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"Usage: csstoh cssfile header.h \0A\00"
@.str.1 = [3 x i8] c"rm\00"
@.str.2 = [36 x i8] c"Failed to open input file %s (%s) \0A\00"
@errno = global i32 0
@.str.3 = [3 x i8] c"wm\00"
@.str.4 = [37 x i8] c"Failed to open output file %s (%s) \0A\00"
@.str.5 = [31 x i8] c"#ifndef __INCLUDE_GUARD_CCS_H\0A\00"
@.str.6 = [31 x i8] c"#define __INCLUDE_GUARD_CCS_H\0A\00"
@.str.7 = [2 x i8] c"\0A\00"
@.str.8 = [21 x i8] c"const char css[] = \0A\00"
@.str.9 = [9 x i8] c"\09\22%s\\n\22\0A\00"
@.str.10 = [3 x i8] c";\0A\00"
@.str.11 = [8 x i8] c"#endif\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca [4096 x i8]
%9 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = load i32, i32* %4
%11 = icmp slt i32 %10, 2
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @exit(i32 0)
unreachable
15: ; preds = %2
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 1
%18 = load i8*, i8** %17
%19 = call i32* @fopen(i8* %18, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %19, i32** %6
%20 = load i32*, i32** %6
%21 = icmp ne i32* %20, null
br i1 %21, label %30, label %22
22: ; preds = %15
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i64 1
%25 = load i8*, i8** %24
%26 = load i32, i32* @errno
%27 = call i8* @strerror(i32 %26)
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i8* %25, i8* %27)
%29 = call i32 @exit(i32 0)
unreachable
30: ; preds = %15
%31 = load i8**, i8*** %5
%32 = getelementptr inbounds i8*, i8** %31, i64 2
%33 = load i8*, i8** %32
%34 = call i32* @fopen(i8* %33, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
store i32* %34, i32** %7
%35 = load i32*, i32** %7
%36 = icmp ne i32* %35, null
br i1 %36, label %45, label %37
37: ; preds = %30
%38 = load i8**, i8*** %5
%39 = getelementptr inbounds i8*, i8** %38, i64 1
%40 = load i8*, i8** %39
%41 = load i32, i32* @errno
%42 = call i8* @strerror(i32 %41)
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0), i8* %40, i8* %42)
%44 = call i32 @exit(i32 0)
unreachable
45: ; preds = %30
%46 = load i32*, i32** %7
%47 = call i32 (i32*, i8*, ...) @fprintf(i32* %46, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0))
%48 = load i32*, i32** %7
%49 = call i32 (i32*, i8*, ...) @fprintf(i32* %48, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0))
%50 = load i32*, i32** %7
%51 = call i32 (i32*, i8*, ...) @fprintf(i32* %50, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%52 = load i32*, i32** %7
%53 = call i32 (i32*, i8*, ...) @fprintf(i32* %52, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.8, i64 0, i64 0))
br label %54
54: ; preds = %72, %45
%55 = load i32*, i32** %6
%56 = call i32 @feof(i32* %55)
%57 = icmp ne i32 %56, 0
%58 = xor i1 %57, true
br i1 %58, label %59, label %76
59: ; preds = %54
%60 = getelementptr inbounds [4096 x i8], [4096 x i8]* %8, i64 0, i64 0
%61 = load i32*, i32** %6
%62 = call i32* @fgets(i8* %60, i32 4095, i32* %61)
%63 = icmp eq i32* %62, null
br i1 %63, label %64, label %65
64: ; preds = %59
br label %76
65: ; preds = %59
%66 = getelementptr inbounds [4096 x i8], [4096 x i8]* %8, i64 0, i64 0
%67 = call i8* @strchr(i8* %66, i8 signext 10)
store i8* %67, i8** %9
%68 = load i8*, i8** %9
%69 = icmp ne i8* %68, null
br i1 %69, label %70, label %72
70: ; preds = %65
%71 = load i8*, i8** %9
store i8 0, i8* %71
br label %72
72: ; preds = %70, %65
%73 = load i32*, i32** %7
%74 = getelementptr inbounds [4096 x i8], [4096 x i8]* %8, i64 0, i64 0
%75 = call i32 (i32*, i8*, ...) @fprintf(i32* %73, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0), i8* %74)
br label %54
76: ; preds = %64, %54
%77 = load i32*, i32** %7
%78 = call i32 (i32*, i8*, ...) @fprintf(i32* %77, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
%79 = load i32*, i32** %7
%80 = call i32 (i32*, i8*, ...) @fprintf(i32* %79, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0))
%81 = load i32*, i32** %7
%82 = call i32 @fclose(i32* %81)
%83 = load i32*, i32** %6
%84 = call i32 @fclose(i32* %83)
%85 = load i32, i32* @EXIT_SUCCESS
ret i32 %85
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"rm\00"
@.str.2 = [36 x i8] c"Failed to open input file %s (%s) \0A\00"
@errno = global i32 0
@.str.3 = [3 x i8] c"wm\00"
@.str.4 = [37 x i8] c"Failed to open output file %s (%s) \0A\00"
@.str.5 = [31 x i8] c"#ifndef __INCLUDE_GUARD_CCS_H\0A\00"
@.str.6 = [31 x i8] c"#define __INCLUDE_GUARD_CCS_H\0A\00"
@.str.8 = [21 x i8] c"const char css[] = \0A\00"
@.str.9 = [9 x i8] c"\09\22%s\\n\22\0A\00"
@.str.10 = [3 x i8] c";\0A\00"
@.str.11 = [8 x i8] c"#endif\0A\00"
@EXIT_SUCCESS = global i32 0
@str = [33 x i8] c"Usage: csstoh cssfile header.h \00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [4096 x i8]
%4 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 0
%5 = icmp slt i32 %0, 2
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 0)
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 ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%13 = icmp eq i32* %12, null
br i1 %13, label %14, label %20
14: ; preds = %9
%15 = load i8*, i8** %10
%16 = load i32, i32* @errno
%17 = tail call i8* @strerror(i32 %16)
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i8* %15, i8* %17)
%19 = tail call i32 @exit(i32 0)
unreachable
20: ; preds = %9
%21 = getelementptr inbounds i8*, i8** %1, i64 2
%22 = load i8*, i8** %21
%23 = tail call i32* @fopen(i8* %22, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%24 = icmp eq i32* %23, null
br i1 %24, label %25, label %31
25: ; preds = %20
%26 = load i8*, i8** %10
%27 = load i32, i32* @errno
%28 = tail call i8* @strerror(i32 %27)
%29 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0), i8* %26, i8* %28)
%30 = tail call i32 @exit(i32 0)
unreachable
31: ; preds = %20
%32 = tail call i64 @fwrite(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0), i64 30, i64 1, i32* %23)
%33 = tail call i64 @fwrite(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0), i64 30, i64 1, i32* %23)
%34 = tail call i32 @fputc(i32 10, i32* %23)
%35 = tail call i64 @fwrite(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.8, i64 0, i64 0), i64 20, i64 1, i32* %23)
%36 = call i32 @feof(i32* %12)
%37 = icmp eq i32 %36, 0
br i1 %37, label %38, label %49
38: ; preds = %31, %45
%39 = call i32* @fgets(i8* %4, i32 4095, i32* %12)
%40 = icmp eq i32* %39, null
br i1 %40, label %49, label %41
41: ; preds = %38
%42 = call i8* @strchr(i8* %4, i8 signext 10)
%43 = icmp eq i8* %42, null
br i1 %43, label %45, label %44
44: ; preds = %41
store i8 0, i8* %42
br label %45
45: ; preds = %41, %44
%46 = call i32 (i32*, i8*, ...) @fprintf(i32* %23, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0), i8* %4)
%47 = call i32 @feof(i32* %12)
%48 = icmp eq i32 %47, 0
br i1 %48, label %38, label %49
49: ; preds = %45, %38, %31
%50 = call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i64 2, i64 1, i32* %23)
%51 = call i64 @fwrite(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0), i64 7, i64 1, i32* %23)
%52 = call i32 @fclose(i32* %23)
%53 = call i32 @fclose(i32* %12)
%54 = load i32, i32* @EXIT_SUCCESS
ret i32 %54
}