#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*/ LOCK_EX;
int /*<<< orphan*/ LOCK_UN;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fileno(int /*<<< orphan*/ *);
int /*<<< orphan*/ flock(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *);
size_t fread(char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ *freopen(char *, char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ memcpy(char *, char *, size_t);
int /*<<< orphan*/ printf(char *, char *);
char *realloc(char *, size_t);
scalar_t__ strlen(char *);
scalar_t__ strstr(char *, char const *);
char *strtok(char *, char *);
void set_enabled(const char *host, int enabled) {
  FILE *hosts = NULL;
  char buffer[1024];
  char *content = NULL;
  size_t content_size = 0;
  size_t bytes_read = 0;
  char *line = NULL;
  int found = 0;
  hosts = fopen("/etc/hosts", "r+");
  if (!hosts) {
    printf("Could not open %s for writing.\n", "/etc/hosts");
    return;
  }
  flock(fileno(hosts), LOCK_EX);
  while ((bytes_read = fread(&buffer[0], sizeof(char), 1024, hosts)) > 0) {
    content = realloc(content, content_size + bytes_read + 1);
    memcpy(&content[content_size], buffer, bytes_read);
    content_size += bytes_read;
    content[content_size] = '\0';
  }
  hosts = freopen("/etc/hosts", "w", hosts);
  while ((line = strtok(line ? 0 : content, "\n"))) {
    if (strlen(line) > 0 && line[0] == '#') {
      fprintf(hosts, "%s\n", line);
    } else if (strstr(line, host)) {
      if (strstr(line, "127.0.0.1")) {
        if (enabled) {
          found = 1;
          fprintf(hosts, "%s\n", line);
        }
      } else {
        fprintf(hosts, "# %s\n", line);
      }
    } else {
      fprintf(hosts, "%s\n", line);
    }
  }
  if (enabled && !found) {
    fprintf(hosts, "127.0.0.1\t%s\n", host);
  }
  flock(fileno(hosts), LOCK_UN);
  fclose(hosts);
  free(content);
}


x86 assembly (clang, -O0):
<set_enabled>:
push   %rbp
mov    %rsp,%rbp
sub    $0x450,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x428(%rbp)
movq   $0x0,-0x430(%rbp)
movq   $0x0,-0x438(%rbp)
movq   $0x0,-0x440(%rbp)
movl   $0x0,-0x444(%rbp)
lea    0xdc9(%rip),%rdi
lea    0xdcd(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    126a <set_enabled+0x8a>
lea    0xdb5(%rip),%rdi
lea    0xda0(%rip),%rsi
call   1070 <printf@plt>
jmp    14cb <set_enabled+0x2eb>
mov    -0x18(%rbp),%rdi
call   10b0 <fileno@plt>
mov    %eax,%edi
mov    0x2d6c(%rip),%rax
mov    (%rax),%esi
call   10f0 <flock@plt>
lea    -0x420(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x1,%esi
mov    $0x400,%edx
call   1040 <fread@plt>
mov    %rax,-0x438(%rbp)
cmp    $0x0,%rax
jbe    1320 <set_enabled+0x140>
mov    -0x428(%rbp),%rdi
mov    -0x430(%rbp),%rsi
add    -0x438(%rbp),%rsi
add    $0x1,%rsi
call   10c0 <realloc@plt>
mov    %rax,-0x428(%rbp)
mov    -0x428(%rbp),%rdi
add    -0x430(%rbp),%rdi
lea    -0x420(%rbp),%rsi
mov    -0x438(%rbp),%rdx
call   10a0 <memcpy@plt>
mov    -0x438(%rbp),%rax
add    -0x430(%rbp),%rax
mov    %rax,-0x430(%rbp)
mov    -0x428(%rbp),%rax
mov    -0x430(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    1283 <set_enabled+0xa3>
mov    -0x18(%rbp),%rdx
lea    0xcd5(%rip),%rdi
lea    0xcfc(%rip),%rsi
call   1080 <freopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x440(%rbp)
je     1357 <set_enabled+0x177>
xor    %eax,%eax
mov    %rax,-0x450(%rbp)
jmp    1365 <set_enabled+0x185>
mov    -0x428(%rbp),%rax
mov    %rax,-0x450(%rbp)
mov    -0x450(%rbp),%rdi
lea    0xcb9(%rip),%rsi
call   10e0 <strtok@plt>
mov    %rax,-0x440(%rbp)
cmp    $0x0,%rax
je     1472 <set_enabled+0x292>
mov    -0x440(%rbp),%rdi
call   1060 <strlen@plt>
cmp    $0x0,%rax
jle    13ce <set_enabled+0x1ee>
mov    -0x440(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x23,%eax
jne    13ce <set_enabled+0x1ee>
mov    -0x18(%rbp),%rdi
mov    -0x440(%rbp),%rdx
lea    0xc86(%rip),%rsi
call   1090 <fprintf@plt>
jmp    146d <set_enabled+0x28d>
mov    -0x440(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1100 <strstr@plt>
cmp    $0x0,%rax
je     1451 <set_enabled+0x271>
mov    -0x440(%rbp),%rdi
lea    0xc3a(%rip),%rsi
call   1100 <strstr@plt>
cmp    $0x0,%rax
je     1435 <set_enabled+0x255>
cmpl   $0x0,-0xc(%rbp)
je     1430 <set_enabled+0x250>
movl   $0x1,-0x444(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x440(%rbp),%rdx
lea    0xc1f(%rip),%rsi
call   1090 <fprintf@plt>
jmp    144c <set_enabled+0x26c>
mov    -0x18(%rbp),%rdi
mov    -0x440(%rbp),%rdx
lea    0xbf3(%rip),%rsi
call   1090 <fprintf@plt>
jmp    1468 <set_enabled+0x288>
mov    -0x18(%rbp),%rdi
mov    -0x440(%rbp),%rdx
lea    0xbe7(%rip),%rsi
call   1090 <fprintf@plt>
jmp    146d <set_enabled+0x28d>
jmp    133b <set_enabled+0x15b>
cmpl   $0x0,-0xc(%rbp)
je     149d <set_enabled+0x2bd>
cmpl   $0x0,-0x444(%rbp)
jne    149d <set_enabled+0x2bd>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xba8(%rip),%rsi
call   1090 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   10b0 <fileno@plt>
mov    %eax,%edi
mov    0x2b29(%rip),%rax
mov    (%rax),%esi
call   10f0 <flock@plt>
mov    -0x18(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x428(%rbp),%rdi
call   1030 <free@plt>
add    $0x450,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_enabled>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x428,%rsp
mov    %esi,0x14(%rsp)
mov    %rdi,%rbx
lea    0xe01(%rip),%rdi
lea    0xe05(%rip),%rsi
call   10d0 <fopen@plt>
test   %rax,%rax
je     12c0 <set_enabled+0xe0>
mov    %rax,%r14
mov    %rbx,0x18(%rsp)
mov    %rax,%rdi
call   10b0 <fileno@plt>
mov    0x2dbd(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
call   10f0 <flock@plt>
lea    0x20(%rsp),%rdi
mov    $0x1,%esi
mov    $0x400,%edx
mov    %r14,%rcx
call   1040 <fread@plt>
mov    %rax,%rbx
xor    %eax,%eax
mov    %rax,0x8(%rsp)
test   %rbx,%rbx
je     12e4 <set_enabled+0x104>
xor    %ebp,%ebp
lea    0x20(%rsp),%r12
xor    %r13d,%r13d
nopl   0x0(%rax,%rax,1)
lea    (%rbx,%rbp,1),%r15
lea    (%rbx,%rbp,1),%rsi
add    $0x1,%rsi
mov    %r13,%rdi
call   10c0 <realloc@plt>
mov    %rax,%r13
add    %rax,%rbp
mov    %rbp,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
call   10a0 <memcpy@plt>
movb   $0x0,0x0(%r13,%r15,1)
mov    %r12,%rdi
mov    $0x1,%esi
mov    $0x400,%edx
mov    %r14,%rcx
call   1040 <fread@plt>
mov    %rax,%rbx
mov    %r15,%rbp
test   %rax,%rax
jne    1270 <set_enabled+0x90>
jmp    12e7 <set_enabled+0x107>
lea    0xd47(%rip),%rdi
lea    0xd32(%rip),%rsi
add    $0x428,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1070 <printf@plt>
xor    %r13d,%r13d
lea    0xd12(%rip),%rdi
lea    0xd39(%rip),%rsi
mov    %r14,%rdx
call   1080 <freopen@plt>
mov    %rax,%rbx
lea    0xd25(%rip),%rsi
mov    %r13,%rdi
call   10e0 <strtok@plt>
test   %rax,%rax
mov    0x18(%rsp),%r15
je     13be <set_enabled+0x1de>
mov    %rax,%r14
xor    %eax,%eax
mov    %rax,0x8(%rsp)
lea    0xcfe(%rip),%r12
jmp    1362 <set_enabled+0x182>
lea    0xd13(%rip),%rsi
mov    0x8(%rsp),%rax
mov    %eax,%ebp
mov    %rbx,%rdi
mov    %r14,%rdx
call   1090 <fprintf@plt>
mov    %ebp,%eax
mov    %rax,0x8(%rsp)
xor    %edi,%edi
mov    %r12,%rsi
call   10e0 <strtok@plt>
mov    %rax,%r14
test   %rax,%rax
je     13be <set_enabled+0x1de>
mov    %r14,%rdi
call   1060 <strlen@plt>
test   %rax,%rax
jle    1375 <set_enabled+0x195>
cmpb   $0x23,(%r14)
je     1330 <set_enabled+0x150>
mov    %r14,%rdi
mov    %r15,%rsi
call   1100 <strstr@plt>
test   %rax,%rax
je     1330 <set_enabled+0x150>
mov    %r14,%rdi
lea    0xca1(%rip),%rsi
call   1100 <strstr@plt>
lea    0xcaf(%rip),%rsi
test   %rax,%rax
lea    0xc95(%rip),%rax
cmove  %rax,%rsi
mov    $0x1,%ebp
cmove  0x8(%rsp),%ebp
je     133e <set_enabled+0x15e>
cmpl   $0x0,0x14(%rsp)
je     1350 <set_enabled+0x170>
jmp    133e <set_enabled+0x15e>
cmpl   $0x0,0x14(%rsp)
je     13de <set_enabled+0x1fe>
cmpl   $0x0,0x8(%rsp)
jne    13de <set_enabled+0x1fe>
lea    0xc6d(%rip),%rsi
mov    %rbx,%rdi
mov    %r15,%rdx
call   1090 <fprintf@plt>
mov    %rbx,%rdi
call   10b0 <fileno@plt>
mov    0x2beb(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
call   10f0 <flock@plt>
mov    %rbx,%rdi
call   1050 <fclose@plt>
mov    %r13,%rdi
call   1030 <free@plt>
add    $0x428,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"/etc/hosts\00"
@.str.1 = [3 x i8] c"r+\00"
@.str.2 = [32 x i8] c"Could not open %s for writing.\0A\00"
@LOCK_EX = global i32 0
@.str.3 = [2 x i8] c"w\00"
@.str.4 = [2 x i8] c"\0A\00"
@.str.5 = [4 x i8] c"%s\0A\00"
@.str.6 = [10 x i8] c"127.0.0.1\00"
@.str.7 = [6 x i8] c"# %s\0A\00"
@.str.8 = [14 x i8] c"127.0.0.1\09%s\0A\00"
@LOCK_UN = global i32 0
define void @set_enabled(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32*
%6 = alloca [1024 x i8]
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i64
%10 = alloca i8*
%11 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32* null, i32** %5
store i8* null, i8** %7
store i64 0, i64* %8
store i64 0, i64* %9
store i8* null, i8** %10
store i32 0, i32* %11
%12 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %12, i32** %5
%13 = load i32*, i32** %5
%14 = icmp ne i32* %13, null
br i1 %14, label %17, label %15
15: ; preds = %2
%16 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %120
17: ; preds = %2
%18 = load i32*, i32** %5
%19 = call i32 @fileno(i32* %18)
%20 = load i32, i32* @LOCK_EX
%21 = call i32 @flock(i32 %19, i32 %20)
br label %22
22: ; preds = %27, %17
%23 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%24 = load i32*, i32** %5
%25 = call i64 @fread(i8* %23, i32 1, i32 1024, i32* %24)
store i64 %25, i64* %9
%26 = icmp ugt i64 %25, 0
br i1 %26, label %27, label %46
27: ; preds = %22
%28 = load i8*, i8** %7
%29 = load i64, i64* %8
%30 = load i64, i64* %9
%31 = add i64 %29, %30
%32 = add i64 %31, 1
%33 = call i8* @realloc(i8* %28, i64 %32)
store i8* %33, i8** %7
%34 = load i8*, i8** %7
%35 = load i64, i64* %8
%36 = getelementptr inbounds i8, i8* %34, i64 %35
%37 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%38 = load i64, i64* %9
%39 = call i32 @memcpy(i8* %36, i8* %37, i64 %38)
%40 = load i64, i64* %9
%41 = load i64, i64* %8
%42 = add i64 %41, %40
store i64 %42, i64* %8
%43 = load i8*, i8** %7
%44 = load i64, i64* %8
%45 = getelementptr inbounds i8, i8* %43, i64 %44
store i8 0, i8* %45
br label %22
46: ; preds = %22
%47 = load i32*, i32** %5
%48 = call i32* @freopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32* %47)
store i32* %48, i32** %5
br label %49
49: ; preds = %100, %46
%50 = load i8*, i8** %10
%51 = icmp ne i8* %50, null
br i1 %51, label %52, label %53
52: ; preds = %49
br label %55
53: ; preds = %49
%54 = load i8*, i8** %7
br label %55
55: ; preds = %53, %52
%56 = phi i8* [ null, %52 ], [ %54, %53 ]
%57 = call i8* @strtok(i8* %56, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
store i8* %57, i8** %10
%58 = icmp ne i8* %57, null
br i1 %58, label %59, label %101
59: ; preds = %55
%60 = load i8*, i8** %10
%61 = call i64 @strlen(i8* %60)
%62 = icmp sgt i64 %61, 0
br i1 %62, label %63, label %73
63: ; preds = %59
%64 = load i8*, i8** %10
%65 = getelementptr inbounds i8, i8* %64, i64 0
%66 = load i8, i8* %65
%67 = sext i8 %66 to i32
%68 = icmp eq i32 %67, 35
br i1 %68, label %69, label %73
69: ; preds = %63
%70 = load i32*, i32** %5
%71 = load i8*, i8** %10
%72 = call i32 @fprintf(i32* %70, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* %71)
br label %100
73: ; preds = %63, %59
%74 = load i8*, i8** %10
%75 = load i8*, i8** %3
%76 = call i64 @strstr(i8* %74, i8* %75)
%77 = icmp ne i64 %76, 0
br i1 %77, label %78, label %95
78: ; preds = %73
%79 = load i8*, i8** %10
%80 = call i64 @strstr(i8* %79, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0))
%81 = icmp ne i64 %80, 0
br i1 %81, label %82, label %90
82: ; preds = %78
%83 = load i32, i32* %4
%84 = icmp ne i32 %83, 0
br i1 %84, label %85, label %89
85: ; preds = %82
store i32 1, i32* %11
%86 = load i32*, i32** %5
%87 = load i8*, i8** %10
%88 = call i32 @fprintf(i32* %86, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* %87)
br label %89
89: ; preds = %85, %82
br label %94
90: ; preds = %78
%91 = load i32*, i32** %5
%92 = load i8*, i8** %10
%93 = call i32 @fprintf(i32* %91, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i8* %92)
br label %94
94: ; preds = %90, %89
br label %99
95: ; preds = %73
%96 = load i32*, i32** %5
%97 = load i8*, i8** %10
%98 = call i32 @fprintf(i32* %96, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* %97)
br label %99
99: ; preds = %95, %94
br label %100
100: ; preds = %99, %69
br label %49
101: ; preds = %55
%102 = load i32, i32* %4
%103 = icmp ne i32 %102, 0
br i1 %103, label %104, label %111
104: ; preds = %101
%105 = load i32, i32* %11
%106 = icmp ne i32 %105, 0
br i1 %106, label %111, label %107
107: ; preds = %104
%108 = load i32*, i32** %5
%109 = load i8*, i8** %3
%110 = call i32 @fprintf(i32* %108, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0), i8* %109)
br label %111
111: ; preds = %107, %104, %101
%112 = load i32*, i32** %5
%113 = call i32 @fileno(i32* %112)
%114 = load i32, i32* @LOCK_UN
%115 = call i32 @flock(i32 %113, i32 %114)
%116 = load i32*, i32** %5
%117 = call i32 @fclose(i32* %116)
%118 = load i8*, i8** %7
%119 = call i32 @free(i8* %118)
br label %120
120: ; preds = %111, %15
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"/etc/hosts\00"
@.str.1 = [3 x i8] c"r+\00"
@.str.2 = [32 x i8] c"Could not open %s for writing.\0A\00"
@LOCK_EX = global i32 0
@.str.3 = [2 x i8] c"w\00"
@.str.4 = [2 x i8] c"\0A\00"
@.str.5 = [4 x i8] c"%s\0A\00"
@.str.6 = [10 x i8] c"127.0.0.1\00"
@.str.7 = [6 x i8] c"# %s\0A\00"
@.str.8 = [14 x i8] c"127.0.0.1\09%s\0A\00"
@LOCK_UN = global i32 0
define void @set_enabled(i8* %0, i32 %1) {
%3 = alloca [1024 x i8]
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = tail call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i32* %5, null
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %72
9: ; preds = %2
%10 = tail call i32 @fileno(i32* %5)
%11 = load i32, i32* @LOCK_EX
%12 = tail call i32 @flock(i32 %10, i32 %11)
%13 = call i64 @fread(i8* %4, i32 1, i32 1024, i32* %5)
%14 = icmp eq i64 %13, 0
br i1 %14, label %27, label %15
15: ; preds = %9, %15
%16 = phi i64 [ %25, %15 ], [ %13, %9 ]
%17 = phi i64 [ %19, %15 ], [ 0, %9 ]
%18 = phi i8* [ %21, %15 ], [ null, %9 ]
%19 = add i64 %16, %17
%20 = add i64 %19, 1
%21 = call i8* @realloc(i8* %18, i64 %20)
%22 = getelementptr inbounds i8, i8* %21, i64 %17
%23 = call i32 @memcpy(i8* %22, i8* %4, i64 %16)
%24 = getelementptr inbounds i8, i8* %21, i64 %19
store i8 0, i8* %24
%25 = call i64 @fread(i8* %4, i32 1, i32 1024, i32* %5)
%26 = icmp eq i64 %25, 0
br i1 %26, label %27, label %15
27: ; preds = %15, %9
%28 = phi i8* [ null, %9 ], [ %21, %15 ]
%29 = call i32* @freopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32* %5)
%30 = call i8* @strtok(i8* %28, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%31 = icmp eq i8* %30, null
br i1 %31, label %59, label %32
32: ; preds = %27
%33 = icmp ne i32 %1, 0
br label %34
34: ; preds = %32, %55
%35 = phi i8* [ %30, %32 ], [ %57, %55 ]
%36 = phi i32 [ 0, %32 ], [ %56, %55 ]
%37 = call i64 @strlen(i8* %35)
%38 = icmp sgt i64 %37, 0
br i1 %38, label %39, label %42
39: ; preds = %34
%40 = load i8, i8* %35
%41 = icmp eq i8 %40, 35
br i1 %41, label %51, label %42
42: ; preds = %39, %34
%43 = call i64 @strstr(i8* %35, i8* %0)
%44 = icmp eq i64 %43, 0
br i1 %44, label %51, label %45
45: ; preds = %42
%46 = call i64 @strstr(i8* %35, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0))
%47 = icmp eq i64 %46, 0
%48 = or i1 %47, %33
%49 = select i1 %47, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0)
%50 = select i1 %47, i32 %36, i32 1
br i1 %48, label %51, label %55
51: ; preds = %45, %42, %39
%52 = phi i8* [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), %39 ], [ %49, %45 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), %42 ]
%53 = phi i32 [ %36, %39 ], [ %50, %45 ], [ %36, %42 ]
%54 = call i32 @fprintf(i32* %29, i8* %52, i8* %35)
br label %55
55: ; preds = %45, %51
%56 = phi i32 [ %53, %51 ], [ %36, %45 ]
%57 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%58 = icmp eq i8* %57, null
br i1 %58, label %59, label %34
59: ; preds = %55, %27
%60 = phi i32 [ 0, %27 ], [ %56, %55 ]
%61 = icmp eq i32 %1, 0
%62 = icmp ne i32 %60, 0
%63 = select i1 %61, i1 true, i1 %62
br i1 %63, label %66, label %64
64: ; preds = %59
%65 = call i32 @fprintf(i32* %29, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0), i8* %0)
br label %66
66: ; preds = %64, %59
%67 = call i32 @fileno(i32* %29)
%68 = load i32, i32* @LOCK_UN
%69 = call i32 @flock(i32 %67, i32 %68)
%70 = call i32 @fclose(i32* %29)
%71 = call i32 @free(i8* %28)
br label %72
72: ; preds = %66, %7
ret void
}