#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*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
char *strstr(char *, char *);
int main() {
  char line[80];
  char zonename[80];
  char zoneabbr[80];
  FILE *fp;
  int i = 0;
  char *s;
  printf("function tzSelector() {\n");
  printf("    var html = \"\";\n");
  printf("    html += \"<select id='tz_sel'>\";\n");
  if ((fp = fopen("kok", "r")) != NULL) {
    while (fgets(line, 80, fp) != NULL) {
      int len = strlen(line);
      if (len > 1) {
        if (line[len - 1] == '\n')
          line[len - 1] = '\0';
        if ((s = strstr(line, ",")) != NULL) {
          strcpy(zoneabbr, s + 1);
          *s = '\0';
          strcpy(zonename, line);
        }
        printf("    html += \"<option value='%s'>%s</option>\";\n", zoneabbr,
               zonename);
      }
    }
    fclose(fp);
  }
  printf("    html += \"</select>\";\n");
  printf("    return( html );\n");
  printf("}\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10c(%rbp)
lea    0xe6d(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xe78(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xe7e(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xe95(%rip),%rdi
lea    0xe92(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x108(%rbp)
cmp    $0x0,%rax
je     12c2 <main+0x152>
jmp    11df <main+0x6f>
lea    -0x60(%rbp),%rdi
mov    -0x108(%rbp),%rdx
mov    $0x50,%esi
call   1070 <fgets@plt>
cmp    $0x0,%rax
je     12b6 <main+0x146>
lea    -0x60(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,-0x11c(%rbp)
cmpl   $0x1,-0x11c(%rbp)
jle    12b1 <main+0x141>
mov    -0x11c(%rbp),%eax
sub    $0x1,%eax
cltq
movsbl -0x60(%rbp,%rax,1),%eax
cmp    $0xa,%eax
jne    1243 <main+0xd3>
mov    -0x11c(%rbp),%eax
sub    $0x1,%eax
cltq
movb   $0x0,-0x60(%rbp,%rax,1)
lea    -0x60(%rbp),%rdi
lea    0xe0a(%rip),%rsi
call   1090 <strstr@plt>
mov    %rax,-0x118(%rbp)
cmp    $0x0,%rax
je     1295 <main+0x125>
lea    -0x100(%rbp),%rdi
mov    -0x118(%rbp),%rsi
add    $0x1,%rsi
call   1030 <strcpy@plt>
mov    -0x118(%rbp),%rax
movb   $0x0,(%rax)
lea    -0xb0(%rbp),%rdi
lea    -0x60(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x100(%rbp),%rsi
lea    -0xb0(%rbp),%rdx
lea    0xdb0(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    11df <main+0x6f>
mov    -0x108(%rbp),%rdi
call   1040 <fclose@plt>
lea    0xdc0(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xdcc(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xdd3(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xf8,%rsp
lea    0xe9d(%rip),%rdi
call   1040 <puts@plt>
lea    0xea9(%rip),%rdi
call   1040 <puts@plt>
lea    0xeb0(%rip),%rdi
call   1040 <puts@plt>
lea    0xe44(%rip),%rdi
lea    0xe41(%rip),%rsi
call   10a0 <fopen@plt>
test   %rax,%rax
je     128c <main+0x10c>
mov    %rax,%r14
mov    %rsp,%rdi
mov    $0x50,%esi
mov    %rax,%rdx
call   1090 <fgets@plt>
test   %rax,%rax
je     1284 <main+0x104>
mov    %rsp,%rbx
lea    0xe0f(%rip),%r15
lea    0x50(%rsp),%r12
lea    0xa0(%rsp),%r13
jmp    1235 <main+0xb5>
cs nopw 0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   1080 <printf@plt>
mov    %rbx,%rdi
mov    $0x50,%esi
mov    %r14,%rdx
call   1090 <fgets@plt>
test   %rax,%rax
je     1284 <main+0x104>
mov    %rbx,%rdi
call   1060 <strlen@plt>
cmp    $0x2,%eax
jl     1220 <main+0xa0>
add    $0xffffffff,%eax
cmpb   $0xa,(%rsp,%rax,1)
jne    124f <main+0xcf>
movb   $0x0,(%rsp,%rax,1)
mov    %rbx,%rdi
mov    $0x2c,%esi
call   1070 <strchr@plt>
test   %rax,%rax
je     1210 <main+0x90>
mov    %rax,%rbp
mov    %rax,%rsi
add    $0x1,%rsi
mov    %r12,%rdi
call   1030 <strcpy@plt>
movb   $0x0,0x0(%rbp)
mov    %r13,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
jmp    1210 <main+0x90>
mov    %r14,%rdi
call   1050 <fclose@plt>
lea    0xdf1(%rip),%rdi
call   1040 <puts@plt>
lea    0xdfe(%rip),%rdi
call   1040 <puts@plt>
lea    0xe06(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0xf8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [25 x i8] c"function tzSelector() {\0A\00"
@.str.1 = [20 x i8] c" var html = \22\22;\0A\00"
@.str.2 = [37 x i8] c" html += \22<select id='tz_sel'>\22;\0A\00"
@.str.3 = [4 x i8] c"kok\00"
@.str.4 = [2 x i8] c"r\00"
@.str.5 = [2 x i8] c",\00"
@.str.6 = [47 x i8] c" html += \22<option value='%s'>%s</option>\22;\0A\00"
@.str.7 = [26 x i8] c" html += \22</select>\22;\0A\00"
@.str.8 = [21 x i8] c" return( html );\0A\00"
@.str.9 = [3 x i8] c"}\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [80 x i8]
%3 = alloca [80 x i8]
%4 = alloca [80 x i8]
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %6
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32* @fopen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
store i32* %12, i32** %5
%13 = icmp ne i32* %12, null
br i1 %13, label %14, label %59
14: ; preds = %0
br label %15
15: ; preds = %55, %14
%16 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%17 = load i32*, i32** %5
%18 = call i32* @fgets(i8* %16, i32 80, i32* %17)
%19 = icmp ne i32* %18, null
br i1 %19, label %20, label %56
20: ; preds = %15
%21 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%22 = call i32 @strlen(i8* %21)
store i32 %22, i32* %8
%23 = load i32, i32* %8
%24 = icmp sgt i32 %23, 1
br i1 %24, label %25, label %55
25: ; preds = %20
%26 = load i32, i32* %8
%27 = sub nsw i32 %26, 1
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 %28
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = icmp eq i32 %31, 10
br i1 %32, label %33, label %38
33: ; preds = %25
%34 = load i32, i32* %8
%35 = sub nsw i32 %34, 1
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 %36
store i8 0, i8* %37
br label %38
38: ; preds = %33, %25
%39 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%40 = call i8* @strstr(i8* %39, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
store i8* %40, i8** %7
%41 = icmp ne i8* %40, null
br i1 %41, label %42, label %51
42: ; preds = %38
%43 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%44 = load i8*, i8** %7
%45 = getelementptr inbounds i8, i8* %44, i64 1
%46 = call i32 @strcpy(i8* %43, i8* %45)
%47 = load i8*, i8** %7
store i8 0, i8* %47
%48 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%49 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%50 = call i32 @strcpy(i8* %48, i8* %49)
br label %51
51: ; preds = %42, %38
%52 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%53 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.6, i64 0, i64 0), i8* %52, i8* %53)
br label %55
55: ; preds = %51, %20
br label %15
56: ; preds = %15
%57 = load i32*, i32** %5
%58 = call i32 @fclose(i32* %57)
br label %59
59: ; preds = %56, %0
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0))
%61 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.8, i64 0, i64 0))
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.3 = [4 x i8] c"kok\00"
@.str.4 = [2 x i8] c"r\00"
@.str.6 = [47 x i8] c" html += \22<option value='%s'>%s</option>\22;\0A\00"
@str = [24 x i8] c"function tzSelector() {\00"
@str.10 = [19 x i8] c" var html = \22\22;\00"
@str.11 = [36 x i8] c" html += \22<select id='tz_sel'>\22;\00"
@str.12 = [25 x i8] c" html += \22</select>\22;\00"
@str.13 = [20 x i8] c" return( html );\00"
@str.14 = [2 x i8] c"}\00"
define i32 @main() {
%1 = alloca [80 x i8]
%2 = alloca [80 x i8]
%3 = alloca [80 x i8]
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.10, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.11, i64 0, i64 0))
%10 = tail call i32* @fopen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%11 = icmp eq i32* %10, null
br i1 %11, label %39, label %12
12: ; preds = %0
%13 = call i32* @fgets(i8* %4, i32 80, i32* %10)
%14 = icmp eq i32* %13, null
br i1 %14, label %37, label %15
15: ; preds = %12, %34
%16 = call i32 @strlen(i8* %4)
%17 = icmp sgt i32 %16, 1
br i1 %17, label %18, label %34
18: ; preds = %15
%19 = add nsw i32 %16, -1
%20 = zext i32 %19 to i64
%21 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 %20
%22 = load i8, i8* %21
%23 = icmp eq i8 %22, 10
br i1 %23, label %24, label %25
24: ; preds = %18
store i8 0, i8* %21
br label %25
25: ; preds = %24, %18
%26 = call i8* @strchr(i8* %4, i32 44)
%27 = icmp eq i8* %26, null
br i1 %27, label %32, label %28
28: ; preds = %25
%29 = getelementptr inbounds i8, i8* %26, i64 1
%30 = call i32 @strcpy(i8* %6, i8* %29)
store i8 0, i8* %26
%31 = call i32 @strcpy(i8* %5, i8* %4)
br label %32
32: ; preds = %28, %25
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.6, i64 0, i64 0), i8* %6, i8* %5)
br label %34
34: ; preds = %32, %15
%35 = call i32* @fgets(i8* %4, i32 80, i32* %10)
%36 = icmp eq i32* %35, null
br i1 %36, label %37, label %15
37: ; preds = %34, %12
%38 = call i32 @fclose(i32* %10)
br label %39
39: ; preds = %37, %0
%40 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.12, i64 0, i64 0))
%41 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.13, i64 0, i64 0))
%42 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.14, i64 0, i64 0))
ret i32 0
}