#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*/ fprintf(int /*<<< orphan*/ *, char *);
void java_script_src(FILE *f) {
  fprintf(f, "<script type='text/javascript'>\r\n");
  fprintf(f, "function switch_relay(checkboxElem){\r\n");
  fprintf(f, "   var status = checkboxElem.checked ? 1 : 0;\r\n");
  fprintf(f, "   var pin = checkboxElem.id;\r\n");
  fprintf(f, "   var url = '/gpio?pin='+pin+'&status='+status;\r\n");
  fprintf(f, "   var xmlHttp = new XMLHttpRequest();\r\n");
  fprintf(f, "   xmlHttp.onreadystatechange = function () {\r\n");
  fprintf(f, "      if (this.readyState < 4)\r\n");
  fprintf(f, "         document.getElementById('status').innerHTML = '';\r\n");
  fprintf(f, "      else if (this.readyState == 4) {\r\n");
  fprintf(f, "         if (this.status == 0) {\r\n");
  fprintf(f, "            document.getElementById('status').innerHTML = "
             "\"Network error\";\r\n");
  fprintf(f, "            checkboxElem.checked = (status==0);\r\n");
  fprintf(f, "         }\r\n");
  fprintf(f, "         else if (this.status != 200) {\r\n");
  fprintf(f, "            document.getElementById('status').innerHTML = "
             "this.statusText;\r\n");
  fprintf(f, "            checkboxElem.checked = (status==0);\r\n");
  fprintf(f, "         }\r\n");
  fprintf(f, "      }\r\n");
  fprintf(f, "   }\r\n");
  fprintf(f, "   xmlHttp.open( 'GET', url, true );\r\n");
  fprintf(f, "   xmlHttp.send( null );\r\n");
  fprintf(f, "}\r\n");
  fprintf(f, "</script>\r\n");
}


x86 assembly (clang, -O0):
<java_script_src>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xeeb(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xf02(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xf22(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xf32(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xf55(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xf6e(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xf8e(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xf9f(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xfcc(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xfe5(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xff8(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0x1035(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0x1057(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0x1054(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0x106e(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xff5(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0x1017(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0x100a(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xffd(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0x106b(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0x1082(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xfd0(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0x107d(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<java_script_src>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
lea    0xee1(%rip),%rdi
mov    $0x21,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fwrite@plt>
lea    0xeea(%rip),%rdi
mov    $0x26,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fwrite@plt>
lea    0xef8(%rip),%rdi
mov    $0x2f,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fwrite@plt>
lea    0xf0f(%rip),%rdi
mov    $0x1f,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fwrite@plt>
lea    0xf16(%rip),%rdi
mov    $0x32,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fwrite@plt>
lea    0xf30(%rip),%rdi
mov    $0x28,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fwrite@plt>
lea    0xf40(%rip),%rdi
mov    $0x2f,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fwrite@plt>
lea    0xf57(%rip),%rdi
mov    $0x20,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fwrite@plt>
lea    0xf5f(%rip),%rdi
mov    $0x3c,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fwrite@plt>
lea    0xf83(%rip),%rdi
mov    $0x28,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fwrite@plt>
lea    0xf93(%rip),%rdi
mov    $0x22,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fwrite@plt>
lea    0xf9d(%rip),%rdi
mov    $0x4c,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fwrite@plt>
lea    0xfd1(%rip),%r14
mov    $0x31,%esi
mov    $0x1,%edx
mov    %r14,%rdi
mov    %rbx,%rcx
call   1030 <fwrite@plt>
lea    0xfe7(%rip),%r15
mov    $0xc,%esi
mov    $0x1,%edx
mov    %r15,%rdi
mov    %rbx,%rcx
call   1030 <fwrite@plt>
lea    0xfd8(%rip),%rdi
mov    $0x29,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fwrite@plt>
lea    0xfe9(%rip),%rdi
mov    $0x4c,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fwrite@plt>
mov    $0x31,%esi
mov    $0x1,%edx
mov    %r14,%rdi
mov    %rbx,%rcx
call   1030 <fwrite@plt>
mov    $0xc,%esi
mov    $0x1,%edx
mov    %r15,%rdi
mov    %rbx,%rcx
call   1030 <fwrite@plt>
lea    0xf72(%rip),%rdi
mov    $0x9,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fwrite@plt>
lea    0xf5c(%rip),%rdi
mov    $0x6,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fwrite@plt>
lea    0xfc1(%rip),%rdi
mov    $0x26,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fwrite@plt>
lea    0xfcf(%rip),%rdi
mov    $0x1a,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fwrite@plt>
lea    0xf14(%rip),%rdi
mov    $0x3,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fwrite@plt>
lea    0xfb8(%rip),%rdi
mov    $0xb,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"<script type='text/javascript'>\0D\0A\00"
@.str.1 = [39 x i8] c"function switch_relay(checkboxElem){\0D\0A\00"
@.str.2 = [48 x i8] c" var status = checkboxElem.checked ? 1 : 0;\0D\0A\00"
@.str.3 = [32 x i8] c" var pin = checkboxElem.id;\0D\0A\00"
@.str.4 = [51 x i8] c" var url = '/gpio?pin='+pin+'&status='+status;\0D\0A\00"
@.str.5 = [41 x i8] c" var xmlHttp = new XMLHttpRequest();\0D\0A\00"
@.str.6 = [48 x i8] c" xmlHttp.onreadystatechange = function () {\0D\0A\00"
@.str.7 = [33 x i8] c" if (this.readyState < 4)\0D\0A\00"
@.str.8 = [61 x i8] c" document.getElementById('status').innerHTML = '';\0D\0A\00"
@.str.9 = [41 x i8] c" else if (this.readyState == 4) {\0D\0A\00"
@.str.10 = [35 x i8] c" if (this.status == 0) {\0D\0A\00"
@.str.11 = [77 x i8] c" document.getElementById('status').innerHTML = \22Network error\22;\0D\0A\00"
@.str.12 = [50 x i8] c" checkboxElem.checked = (status==0);\0D\0A\00"
@.str.13 = [13 x i8] c" }\0D\0A\00"
@.str.14 = [42 x i8] c" else if (this.status != 200) {\0D\0A\00"
@.str.15 = [77 x i8] c" document.getElementById('status').innerHTML = this.statusText;\0D\0A\00"
@.str.16 = [10 x i8] c" }\0D\0A\00"
@.str.17 = [7 x i8] c" }\0D\0A\00"
@.str.18 = [39 x i8] c" xmlHttp.open( 'GET', url, true );\0D\0A\00"
@.str.19 = [27 x i8] c" xmlHttp.send( null );\0D\0A\00"
@.str.20 = [4 x i8] c"}\0D\0A\00"
@.str.21 = [12 x i8] c"</script>\0D\0A\00"
define void @java_script_src(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%5 = load i32*, i32** %2
%6 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32*, i32** %2
%8 = call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.2, i64 0, i64 0))
%9 = load i32*, i32** %2
%10 = call i32 @fprintf(i32* %9, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0))
%11 = load i32*, i32** %2
%12 = call i32 @fprintf(i32* %11, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.4, i64 0, i64 0))
%13 = load i32*, i32** %2
%14 = call i32 @fprintf(i32* %13, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.5, i64 0, i64 0))
%15 = load i32*, i32** %2
%16 = call i32 @fprintf(i32* %15, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.6, i64 0, i64 0))
%17 = load i32*, i32** %2
%18 = call i32 @fprintf(i32* %17, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.7, i64 0, i64 0))
%19 = load i32*, i32** %2
%20 = call i32 @fprintf(i32* %19, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.8, i64 0, i64 0))
%21 = load i32*, i32** %2
%22 = call i32 @fprintf(i32* %21, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.9, i64 0, i64 0))
%23 = load i32*, i32** %2
%24 = call i32 @fprintf(i32* %23, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.10, i64 0, i64 0))
%25 = load i32*, i32** %2
%26 = call i32 @fprintf(i32* %25, i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.11, i64 0, i64 0))
%27 = load i32*, i32** %2
%28 = call i32 @fprintf(i32* %27, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.12, i64 0, i64 0))
%29 = load i32*, i32** %2
%30 = call i32 @fprintf(i32* %29, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.13, i64 0, i64 0))
%31 = load i32*, i32** %2
%32 = call i32 @fprintf(i32* %31, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.14, i64 0, i64 0))
%33 = load i32*, i32** %2
%34 = call i32 @fprintf(i32* %33, i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.15, i64 0, i64 0))
%35 = load i32*, i32** %2
%36 = call i32 @fprintf(i32* %35, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.12, i64 0, i64 0))
%37 = load i32*, i32** %2
%38 = call i32 @fprintf(i32* %37, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.13, i64 0, i64 0))
%39 = load i32*, i32** %2
%40 = call i32 @fprintf(i32* %39, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.16, i64 0, i64 0))
%41 = load i32*, i32** %2
%42 = call i32 @fprintf(i32* %41, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.17, i64 0, i64 0))
%43 = load i32*, i32** %2
%44 = call i32 @fprintf(i32* %43, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.18, i64 0, i64 0))
%45 = load i32*, i32** %2
%46 = call i32 @fprintf(i32* %45, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.19, i64 0, i64 0))
%47 = load i32*, i32** %2
%48 = call i32 @fprintf(i32* %47, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.20, i64 0, i64 0))
%49 = load i32*, i32** %2
%50 = call i32 @fprintf(i32* %49, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.21, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"<script type='text/javascript'>\0D\0A\00"
@.str.1 = [39 x i8] c"function switch_relay(checkboxElem){\0D\0A\00"
@.str.2 = [48 x i8] c" var status = checkboxElem.checked ? 1 : 0;\0D\0A\00"
@.str.3 = [32 x i8] c" var pin = checkboxElem.id;\0D\0A\00"
@.str.4 = [51 x i8] c" var url = '/gpio?pin='+pin+'&status='+status;\0D\0A\00"
@.str.5 = [41 x i8] c" var xmlHttp = new XMLHttpRequest();\0D\0A\00"
@.str.6 = [48 x i8] c" xmlHttp.onreadystatechange = function () {\0D\0A\00"
@.str.7 = [33 x i8] c" if (this.readyState < 4)\0D\0A\00"
@.str.8 = [61 x i8] c" document.getElementById('status').innerHTML = '';\0D\0A\00"
@.str.9 = [41 x i8] c" else if (this.readyState == 4) {\0D\0A\00"
@.str.10 = [35 x i8] c" if (this.status == 0) {\0D\0A\00"
@.str.11 = [77 x i8] c" document.getElementById('status').innerHTML = \22Network error\22;\0D\0A\00"
@.str.12 = [50 x i8] c" checkboxElem.checked = (status==0);\0D\0A\00"
@.str.13 = [13 x i8] c" }\0D\0A\00"
@.str.14 = [42 x i8] c" else if (this.status != 200) {\0D\0A\00"
@.str.15 = [77 x i8] c" document.getElementById('status').innerHTML = this.statusText;\0D\0A\00"
@.str.16 = [10 x i8] c" }\0D\0A\00"
@.str.17 = [7 x i8] c" }\0D\0A\00"
@.str.18 = [39 x i8] c" xmlHttp.open( 'GET', url, true );\0D\0A\00"
@.str.19 = [27 x i8] c" xmlHttp.send( null );\0D\0A\00"
@.str.20 = [4 x i8] c"}\0D\0A\00"
@.str.21 = [12 x i8] c"</script>\0D\0A\00"
define void @java_script_src(i32* %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i64 33, i64 1, i32* %0)
%3 = tail call i64 @fwrite(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i64 38, i64 1, i32* %0)
%4 = tail call i64 @fwrite(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.2, i64 0, i64 0), i64 47, i64 1, i32* %0)
%5 = tail call i64 @fwrite(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0), i64 31, i64 1, i32* %0)
%6 = tail call i64 @fwrite(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.4, i64 0, i64 0), i64 50, i64 1, i32* %0)
%7 = tail call i64 @fwrite(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.5, i64 0, i64 0), i64 40, i64 1, i32* %0)
%8 = tail call i64 @fwrite(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.6, i64 0, i64 0), i64 47, i64 1, i32* %0)
%9 = tail call i64 @fwrite(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.7, i64 0, i64 0), i64 32, i64 1, i32* %0)
%10 = tail call i64 @fwrite(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.8, i64 0, i64 0), i64 60, i64 1, i32* %0)
%11 = tail call i64 @fwrite(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.9, i64 0, i64 0), i64 40, i64 1, i32* %0)
%12 = tail call i64 @fwrite(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.10, i64 0, i64 0), i64 34, i64 1, i32* %0)
%13 = tail call i64 @fwrite(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.11, i64 0, i64 0), i64 76, i64 1, i32* %0)
%14 = tail call i64 @fwrite(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.12, i64 0, i64 0), i64 49, i64 1, i32* %0)
%15 = tail call i64 @fwrite(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.13, i64 0, i64 0), i64 12, i64 1, i32* %0)
%16 = tail call i64 @fwrite(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.14, i64 0, i64 0), i64 41, i64 1, i32* %0)
%17 = tail call i64 @fwrite(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.15, i64 0, i64 0), i64 76, i64 1, i32* %0)
%18 = tail call i64 @fwrite(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.12, i64 0, i64 0), i64 49, i64 1, i32* %0)
%19 = tail call i64 @fwrite(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.13, i64 0, i64 0), i64 12, i64 1, i32* %0)
%20 = tail call i64 @fwrite(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.16, i64 0, i64 0), i64 9, i64 1, i32* %0)
%21 = tail call i64 @fwrite(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.17, i64 0, i64 0), i64 6, i64 1, i32* %0)
%22 = tail call i64 @fwrite(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.18, i64 0, i64 0), i64 38, i64 1, i32* %0)
%23 = tail call i64 @fwrite(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.19, i64 0, i64 0), i64 26, i64 1, i32* %0)
%24 = tail call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.20, i64 0, i64 0), i64 3, i64 1, i32* %0)
%25 = tail call i64 @fwrite(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.21, i64 0, i64 0), i64 11, i64 1, i32* %0)
ret void
}