#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_FAILURE;
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));
    return EXIT_FAILURE;
  }
  out = fopen(argv[2], "wm");
  if (!out) {
    printf("Failed to open output file %s (%s) \n", argv[1], strerror(errno));
    return EXIT_FAILURE;
  }
  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    1231 <main+0xa1>
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>
mov    0x2db1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    13b4 <main+0x224>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xe09(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    129a <main+0x10a>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x1038(%rbp)
mov    0x2d76(%rip),%rax
mov    (%rax),%edi
call   10b0 <strerror@plt>
mov    -0x1038(%rbp),%rsi
mov    %rax,%rdx
lea    0xdca(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    0x2d48(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    13b4 <main+0x224>
mov    -0x20(%rbp),%rdi
lea    0xdcc(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xdd9(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xd7e(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xdd4(%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    1300 <main+0x170>
jmp    1372 <main+0x1e2>
lea    -0x1020(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0xfff,%esi
call   1060 <fgets@plt>
cmp    $0x0,%rax
jne    1324 <main+0x194>
jmp    1372 <main+0x1e2>
lea    -0x1020(%rbp),%rdi
mov    $0xa,%esi
call   1040 <strchr@plt>
mov    %rax,-0x1028(%rbp)
cmpq   $0x0,-0x1028(%rbp)
je     1354 <main+0x1c4>
mov    -0x1028(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x20(%rbp),%rdi
lea    -0x1020(%rbp),%rdx
lea    0xd5e(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
jmp    12e2 <main+0x152>
mov    -0x20(%rbp),%rdi
lea    0xd50(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xd41(%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    0x2c21(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%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    1380 <main+0x1c0>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
lea    0xe1b(%rip),%rsi
call   10b0 <fopen@plt>
test   %rax,%rax
je     12c5 <main+0x105>
mov    %rax,%r15
mov    0x10(%rbx),%rdi
lea    0xe26(%rip),%rsi
call   10b0 <fopen@plt>
test   %rax,%rax
je     12e0 <main+0x120>
mov    %rax,%r14
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    %r14,%rcx
call   10d0 <fwrite@plt>
mov    $0xa,%edi
mov    %r14,%rsi
call   1070 <fputc@plt>
lea    0xe35(%rip),%rdi
mov    $0x14,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   10d0 <fwrite@plt>
mov    %r15,%rdi
call   10a0 <feof@plt>
test   %eax,%eax
je     131e <main+0x15e>
lea    0xe2a(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   10d0 <fwrite@plt>
lea    0xe14(%rip),%rdi
mov    $0x7,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   10d0 <fwrite@plt>
mov    %r14,%rdi
call   1040 <fclose@plt>
mov    %r15,%rdi
call   1040 <fclose@plt>
mov    0x2d0d(%rip),%rax
jmp    130d <main+0x14d>
mov    0x8(%rbx),%rbx
mov    0x2d10(%rip),%rax
mov    (%rax),%edi
call   10e0 <strerror@plt>
lea    0xd25(%rip),%rdi
jmp    12f9 <main+0x139>
mov    0x8(%rbx),%rbx
mov    0x2cf5(%rip),%rax
mov    (%rax),%edi
call   10e0 <strerror@plt>
lea    0xd31(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x2ccb(%rip),%rax
mov    (%rax),%eax
add    $0x1008,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret
mov    %rsp,%rbx
lea    0xd7a(%rip),%r12
jmp    1350 <main+0x190>
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    %r15,%rdi
call   10a0 <feof@plt>
test   %eax,%eax
jne    127a <main+0xba>
mov    %rbx,%rdi
mov    $0xfff,%esi
mov    %r15,%rdx
call   1080 <fgets@plt>
test   %rax,%rax
je     127a <main+0xba>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1050 <strchr@plt>
test   %rax,%rax
je     1330 <main+0x170>
movb   $0x0,(%rax)
jmp    1330 <main+0x170>
lea    0xd2f(%rip),%rdi
call   1030 <puts@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
@EXIT_FAILURE = 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 = load i32, i32* @EXIT_FAILURE
store i32 %29, i32* %3
br label %86
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 = load i32, i32* @EXIT_FAILURE
store i32 %44, i32* %3
br label %86
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
store i32 %85, i32* %3
br label %86
86: ; preds = %76, %37, %22
%87 = load i32, i32* %3
ret i32 %87
}

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
@EXIT_FAILURE = 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 %19
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)
br label %52
19: ; preds = %9
%20 = getelementptr inbounds i8*, i8** %1, i64 2
%21 = load i8*, i8** %20
%22 = tail call i32* @fopen(i8* %21, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%23 = icmp eq i32* %22, null
br i1 %23, label %24, label %29
24: ; preds = %19
%25 = load i8*, i8** %10
%26 = load i32, i32* @errno
%27 = tail call i8* @strerror(i32 %26)
%28 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0), i8* %25, i8* %27)
br label %52
29: ; preds = %19
%30 = tail call i64 @fwrite(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0), i64 30, i64 1, i32* %22)
%31 = tail call i64 @fwrite(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0), i64 30, i64 1, i32* %22)
%32 = tail call i32 @fputc(i32 10, i32* %22)
%33 = tail call i64 @fwrite(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.8, i64 0, i64 0), i64 20, i64 1, i32* %22)
%34 = call i32 @feof(i32* %12)
%35 = icmp eq i32 %34, 0
br i1 %35, label %36, label %47
36: ; preds = %29, %43
%37 = call i32* @fgets(i8* %4, i32 4095, i32* %12)
%38 = icmp eq i32* %37, null
br i1 %38, label %47, label %39
39: ; preds = %36
%40 = call i8* @strchr(i8* %4, i8 signext 10)
%41 = icmp eq i8* %40, null
br i1 %41, label %43, label %42
42: ; preds = %39
store i8 0, i8* %40
br label %43
43: ; preds = %39, %42
%44 = call i32 (i32*, i8*, ...) @fprintf(i32* %22, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0), i8* %4)
%45 = call i32 @feof(i32* %12)
%46 = icmp eq i32 %45, 0
br i1 %46, label %36, label %47
47: ; preds = %43, %36, %29
%48 = call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i64 2, i64 1, i32* %22)
%49 = call i64 @fwrite(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0), i64 7, i64 1, i32* %22)
%50 = call i32 @fclose(i32* %22)
%51 = call i32 @fclose(i32* %12)
br label %52
52: ; preds = %47, %24, %14
%53 = phi i32* [ @EXIT_SUCCESS, %47 ], [ @EXIT_FAILURE, %24 ], [ @EXIT_FAILURE, %14 ]
%54 = load i32, i32* %53
ret i32 %54
}