#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*/ close(int);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fdopen(int, char *);
scalar_t__ fflush(int /*<<< orphan*/ *);
scalar_t__ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fileno(int /*<<< orphan*/ *);
scalar_t__ flock(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
int mkstemp(char *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ rename(char *, char *);
int /*<<< orphan*/ stderr;
scalar_t__ strcmp(char *, char *);
char *strdup(char *);
char *strerror(int /*<<< orphan*/);
int /*<<< orphan*/ strncpy(char *, char *, int);
int /*<<< orphan*/ unlink(char const *);
void removeKey(char *file_name, char *keyreq) {
  int fd;
  FILE *tmpfp = NULL;
  FILE *fp;
  char buf[1024];
  char *bufCopy;
  char *keyptr, *tmpptr;
  char tmpfile[15];
  strncpy(tmpfile, "/tmp/sc.XXXXXX", sizeof tmpfile);
  if ((fd = mkstemp(tmpfile)) == -1 || (tmpfp = fdopen(fd, "w+")) == NULL) {
    if (fd != -1) {
      unlink((const char *)tmpfp);
      close(fd);
    }
    fprintf(stderr, "%s: %s\n", tmpfile, strerror(errno));
    return;
  }
  fp = fopen(file_name, "a+");
  if (!fp) {
    fprintf(stderr, "error in file opening\n");
    return;
  }
  if (flock(fileno(fp), LOCK_EX)) {
    perror("error in file locking");
    return;
  }
  if (fflush(fp)) {
    fprintf(stderr, "error in flushing file\n");
  }
  while (fgets(buf, sizeof buf, fp)) {
    bufCopy = strdup(buf);
    keyptr = buf;
    while (*keyptr == ' ' || *keyptr == '\t') {
      ++keyptr;
    }
    tmpptr = keyptr;
    while (*tmpptr && *tmpptr != '=' && *tmpptr != ' ' && *tmpptr != '\t')
      ++tmpptr;
    *tmpptr = '\0';
    if (strcmp(keyptr, keyreq)) {
      fputs(bufCopy, tmpfp);
    } else {
      continue;
    }
  }
  if (fflush(fp)) {
    perror("error in flushing file");
  }
  if (flock(fileno(fp), LOCK_UN)) {
    perror("can't release filelock");
  }
  fclose(fp);
  fclose(tmpfp);
  rename(tmpfile, file_name);
}


x86 assembly (clang, -O0):
<removeKey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x470,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x20(%rbp)
lea    -0x457(%rbp),%rdi
lea    0xdb7(%rip),%rsi
mov    $0xf,%edx
call   1040 <strncpy@plt>
lea    -0x457(%rbp),%rdi
call   10d0 <mkstemp@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
je     1288 <removeKey+0x68>
mov    -0x14(%rbp),%edi
lea    0xd9a(%rip),%rsi
call   10e0 <fdopen@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    12f1 <removeKey+0xd1>
cmpl   $0xffffffff,-0x14(%rbp)
je     12a3 <removeKey+0x83>
mov    -0x20(%rbp),%rdi
call   1030 <unlink@plt>
mov    -0x14(%rbp),%edi
call   1070 <close@plt>
mov    0x2d2e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x464(%rbp)
lea    -0x457(%rbp),%rax
mov    %rax,-0x460(%rbp)
mov    0x2d09(%rip),%rax
mov    (%rax),%edi
call   1140 <strerror@plt>
mov    -0x464(%rbp),%edi
mov    -0x460(%rbp),%rdx
mov    %rax,%rcx
lea    0xd2d(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
jmp    157c <removeKey+0x35c>
mov    -0x8(%rbp),%rdi
lea    0xd1e(%rip),%rsi
call   10f0 <fopen@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    132c <removeKey+0x10c>
mov    0x2cc1(%rip),%rax
mov    (%rax),%edi
lea    0xcfd(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
jmp    157c <removeKey+0x35c>
mov    -0x28(%rbp),%rdi
call   10b0 <fileno@plt>
mov    %eax,%edi
mov    0x2caa(%rip),%rax
mov    (%rax),%esi
call   1120 <flock@plt>
cmp    $0x0,%rax
je     1360 <removeKey+0x140>
lea    0xcde(%rip),%rdi
call   1100 <perror@plt>
jmp    157c <removeKey+0x35c>
mov    -0x28(%rbp),%rdi
call   10c0 <fflush@plt>
cmp    $0x0,%rax
je     138a <removeKey+0x16a>
mov    0x2c5e(%rip),%rax
mov    (%rax),%edi
lea    0xcc7(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
jmp    138f <removeKey+0x16f>
lea    -0x430(%rbp),%rdi
mov    -0x28(%rbp),%rdx
mov    $0x400,%esi
call   1080 <fgets@plt>
cmp    $0x0,%rax
je     150c <removeKey+0x2ec>
lea    -0x430(%rbp),%rdi
call   1130 <strdup@plt>
mov    %rax,-0x438(%rbp)
lea    -0x430(%rbp),%rax
mov    %rax,-0x440(%rbp)
mov    -0x440(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x465(%rbp)
je     1400 <removeKey+0x1e0>
mov    -0x440(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x465(%rbp)
mov    -0x465(%rbp),%al
test   $0x1,%al
jne    1413 <removeKey+0x1f3>
jmp    142a <removeKey+0x20a>
mov    -0x440(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x440(%rbp)
jmp    13cf <removeKey+0x1af>
mov    -0x440(%rbp),%rax
mov    %rax,-0x448(%rbp)
mov    -0x448(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x466(%rbp)
je     149f <removeKey+0x27f>
mov    -0x448(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x3d,%ecx
mov    %al,-0x466(%rbp)
je     149f <removeKey+0x27f>
mov    -0x448(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x20,%ecx
mov    %al,-0x466(%rbp)
je     149f <removeKey+0x27f>
mov    -0x448(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
setne  %al
mov    %al,-0x466(%rbp)
mov    -0x466(%rbp),%al
test   $0x1,%al
jne    14b2 <removeKey+0x292>
jmp    14c9 <removeKey+0x2a9>
mov    -0x448(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x448(%rbp)
jmp    1438 <removeKey+0x218>
mov    -0x448(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x440(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
je     1502 <removeKey+0x2e2>
mov    -0x438(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1060 <fputs@plt>
jmp    1507 <removeKey+0x2e7>
jmp    138f <removeKey+0x16f>
jmp    138f <removeKey+0x16f>
mov    -0x28(%rbp),%rdi
call   10c0 <fflush@plt>
cmp    $0x0,%rax
je     152b <removeKey+0x30b>
lea    0xb3c(%rip),%rdi
call   1100 <perror@plt>
mov    -0x28(%rbp),%rdi
call   10b0 <fileno@plt>
mov    %eax,%edi
mov    0x2a8b(%rip),%rax
mov    (%rax),%esi
call   1120 <flock@plt>
cmp    $0x0,%rax
je     155a <removeKey+0x33a>
lea    0xb24(%rip),%rdi
call   1100 <perror@plt>
mov    -0x28(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x20(%rbp),%rdi
call   1050 <fclose@plt>
lea    -0x457(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1110 <rename@plt>
add    $0x470,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<removeKey>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x428,%rsp
mov    %rsi,%r12
mov    %rdi,%rbp
lea    0xdc2(%rip),%rsi
lea    0x11(%rsp),%rbx
mov    %rbx,%rdi
mov    $0xf,%edx
call   1040 <strncpy@plt>
mov    %rbx,%rdi
call   10d0 <mkstemp@plt>
cmp    $0xffffffff,%eax
je     13b5 <removeKey+0x195>
mov    %eax,%ebx
lea    0xda5(%rip),%rsi
mov    %eax,%edi
call   10e0 <fdopen@plt>
mov    %rax,(%rsp)
test   %rax,%rax
je     13a7 <removeKey+0x187>
lea    0xd95(%rip),%rsi
mov    %rbp,%rdi
call   10f0 <fopen@plt>
test   %rax,%rax
je     1435 <removeKey+0x215>
mov    %rax,%r13
mov    %rax,%rdi
call   10b0 <fileno@plt>
mov    0x2d40(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
call   1120 <flock@plt>
test   %rax,%rax
jne    145e <removeKey+0x23e>
mov    %rbp,0x8(%rsp)
mov    %r13,%rdi
call   10c0 <fflush@plt>
test   %rax,%rax
je     12e3 <removeKey+0xc3>
mov    0x2d05(%rip),%rax
mov    (%rax),%edi
lea    0xd6e(%rip),%rsi
xor    %eax,%eax
call   10a0 <fprintf@plt>
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x400,%esi
mov    %r13,%rdx
call   1080 <fgets@plt>
test   %rax,%rax
je     13e6 <removeKey+0x1c6>
lea    0x21(%rsp),%r14
movabs $0x2000000100000201,%r15
jmp    1339 <removeKey+0x119>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    $0x400,%esi
mov    %r13,%rdx
call   1080 <fgets@plt>
test   %rax,%rax
je     13e6 <removeKey+0x1c6>
mov    %rbx,%rdi
call   1130 <strdup@plt>
mov    %rax,%rbp
mov    %r14,%rax
mov    %rbx,%rdi
jmp    1358 <removeKey+0x138>
nopl   0x0(%rax)
add    $0x1,%rdi
add    $0x1,%rax
movzbl (%rdi),%ecx
cmp    $0x9,%cl
je     1350 <removeKey+0x130>
cmp    $0x20,%cl
je     1350 <removeKey+0x130>
jmp    1377 <removeKey+0x157>
nopw   0x0(%rax,%rax,1)
movzbl (%rax),%ecx
add    $0x1,%rax
cmp    $0x3d,%cl
ja     1370 <removeKey+0x150>
movzbl %cl,%ecx
bt     %rcx,%r15
jae    1370 <removeKey+0x150>
movb   $0x0,-0x1(%rax)
mov    %r12,%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
je     1320 <removeKey+0x100>
mov    %rbp,%rdi
mov    (%rsp),%rsi
call   1060 <fputs@plt>
jmp    1320 <removeKey+0x100>
xor    %edi,%edi
call   1030 <unlink@plt>
mov    %ebx,%edi
call   1070 <close@plt>
mov    0x2c1c(%rip),%rax
mov    (%rax),%ebx
mov    0x2c0b(%rip),%rax
mov    (%rax),%edi
call   1140 <strerror@plt>
lea    0xc3f(%rip),%rsi
lea    0x11(%rsp),%rdx
mov    %ebx,%edi
mov    %rax,%rcx
xor    %eax,%eax
call   10a0 <fprintf@plt>
jmp    144c <removeKey+0x22c>
mov    %r13,%rdi
call   10c0 <fflush@plt>
test   %rax,%rax
jne    146c <removeKey+0x24c>
mov    %r13,%rdi
call   10b0 <fileno@plt>
mov    0x2bc6(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
call   1120 <flock@plt>
test   %rax,%rax
mov    0x8(%rsp),%rbx
jne    147d <removeKey+0x25d>
mov    %r13,%rdi
call   1050 <fclose@plt>
mov    (%rsp),%rdi
call   1050 <fclose@plt>
lea    0x11(%rsp),%rdi
mov    %rbx,%rsi
call   1110 <rename@plt>
jmp    144c <removeKey+0x22c>
mov    0x2b9c(%rip),%rax
mov    (%rax),%edi
lea    0xbd8(%rip),%rsi
xor    %eax,%eax
call   10a0 <fprintf@plt>
add    $0x428,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xbcf(%rip),%rdi
call   1100 <perror@plt>
jmp    144c <removeKey+0x22c>
lea    0xbef(%rip),%rdi
call   1100 <perror@plt>
jmp    13f3 <removeKey+0x1d3>
lea    0xbf5(%rip),%rdi
call   1100 <perror@plt>
jmp    1415 <removeKey+0x1f5>

LLVM IR (-O0):
@.str = [15 x i8] c"/tmp/sc.XXXXXX\00"
@.str.1 = [3 x i8] c"w+\00"
@stderr = global i32 0
@.str.2 = [8 x i8] c"%s: %s\0A\00"
@errno = global i32 0
@.str.3 = [3 x i8] c"a+\00"
@.str.4 = [23 x i8] c"error in file opening\0A\00"
@LOCK_EX = global i32 0
@.str.5 = [22 x i8] c"error in file locking\00"
@.str.6 = [24 x i8] c"error in flushing file\0A\00"
@.str.7 = [23 x i8] c"error in flushing file\00"
@LOCK_UN = global i32 0
@.str.8 = [23 x i8] c"can't release filelock\00"
define void @removeKey(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca [1024 x i8]
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca [15 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
store i32* null, i32** %6
%13 = getelementptr inbounds [15 x i8], [15 x i8]* %12, i64 0, i64 0
%14 = call i32 @strncpy(i8* %13, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 15)
%15 = getelementptr inbounds [15 x i8], [15 x i8]* %12, i64 0, i64 0
%16 = call i32 @mkstemp(i8* %15)
store i32 %16, i32* %5
%17 = icmp eq i32 %16, -1
br i1 %17, label %22, label %18
18: ; preds = %2
%19 = load i32, i32* %5
%20 = call i32* @fdopen(i32 %19, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %20, i32** %6
%21 = icmp eq i32* %20, null
br i1 %21, label %22, label %37
22: ; preds = %18, %2
%23 = load i32, i32* %5
%24 = icmp ne i32 %23, -1
br i1 %24, label %25, label %31
25: ; preds = %22
%26 = load i32*, i32** %6
%27 = bitcast i32* %26 to i8*
%28 = call i32 @unlink(i8* %27)
%29 = load i32, i32* %5
%30 = call i32 @close(i32 %29)
br label %31
31: ; preds = %25, %22
%32 = load i32, i32* @stderr
%33 = getelementptr inbounds [15 x i8], [15 x i8]* %12, i64 0, i64 0
%34 = load i32, i32* @errno
%35 = call i8* @strerror(i32 %34)
%36 = call i32 (i32, i8*, ...) @fprintf(i32 %32, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* %33, i8* %35)
br label %146
37: ; preds = %18
%38 = load i8*, i8** %3
%39 = call i32* @fopen(i8* %38, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
store i32* %39, i32** %7
%40 = load i32*, i32** %7
%41 = icmp ne i32* %40, null
br i1 %41, label %45, label %42
42: ; preds = %37
%43 = load i32, i32* @stderr
%44 = call i32 (i32, i8*, ...) @fprintf(i32 %43, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0))
br label %146
45: ; preds = %37
%46 = load i32*, i32** %7
%47 = call i32 @fileno(i32* %46)
%48 = load i32, i32* @LOCK_EX
%49 = call i64 @flock(i32 %47, i32 %48)
%50 = icmp ne i64 %49, 0
br i1 %50, label %51, label %53
51: ; preds = %45
%52 = call i32 @perror(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0))
br label %146
53: ; preds = %45
%54 = load i32*, i32** %7
%55 = call i64 @fflush(i32* %54)
%56 = icmp ne i64 %55, 0
br i1 %56, label %57, label %60
57: ; preds = %53
%58 = load i32, i32* @stderr
%59 = call i32 (i32, i8*, ...) @fprintf(i32 %58, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0))
br label %60
60: ; preds = %57, %53
br label %61
61: ; preds = %123, %122, %60
%62 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%63 = load i32*, i32** %7
%64 = call i64 @fgets(i8* %62, i32 1024, i32* %63)
%65 = icmp ne i64 %64, 0
br i1 %65, label %66, label %124
66: ; preds = %61
%67 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%68 = call i8* @strdup(i8* %67)
store i8* %68, i8** %9
%69 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
store i8* %69, i8** %10
br label %70
70: ; preds = %82, %66
%71 = load i8*, i8** %10
%72 = load i8, i8* %71
%73 = sext i8 %72 to i32
%74 = icmp eq i32 %73, 32
br i1 %74, label %80, label %75
75: ; preds = %70
%76 = load i8*, i8** %10
%77 = load i8, i8* %76
%78 = sext i8 %77 to i32
%79 = icmp eq i32 %78, 9
br label %80
80: ; preds = %75, %70
%81 = phi i1 [ true, %70 ], [ %79, %75 ]
br i1 %81, label %82, label %85
82: ; preds = %80
%83 = load i8*, i8** %10
%84 = getelementptr inbounds i8, i8* %83, i32 1
store i8* %84, i8** %10
br label %70
85: ; preds = %80
%86 = load i8*, i8** %10
store i8* %86, i8** %11
br label %87
87: ; preds = %109, %85
%88 = load i8*, i8** %11
%89 = load i8, i8* %88
%90 = sext i8 %89 to i32
%91 = icmp ne i32 %90, 0
br i1 %91, label %92, label %107
92: ; preds = %87
%93 = load i8*, i8** %11
%94 = load i8, i8* %93
%95 = sext i8 %94 to i32
%96 = icmp ne i32 %95, 61
br i1 %96, label %97, label %107
97: ; preds = %92
%98 = load i8*, i8** %11
%99 = load i8, i8* %98
%100 = sext i8 %99 to i32
%101 = icmp ne i32 %100, 32
br i1 %101, label %102, label %107
102: ; preds = %97
%103 = load i8*, i8** %11
%104 = load i8, i8* %103
%105 = sext i8 %104 to i32
%106 = icmp ne i32 %105, 9
br label %107
107: ; preds = %102, %97, %92, %87
%108 = phi i1 [ false, %97 ], [ false, %92 ], [ false, %87 ], [ %106, %102 ]
br i1 %108, label %109, label %112
109: ; preds = %107
%110 = load i8*, i8** %11
%111 = getelementptr inbounds i8, i8* %110, i32 1
store i8* %111, i8** %11
br label %87
112: ; preds = %107
%113 = load i8*, i8** %11
store i8 0, i8* %113
%114 = load i8*, i8** %10
%115 = load i8*, i8** %4
%116 = call i64 @strcmp(i8* %114, i8* %115)
%117 = icmp ne i64 %116, 0
br i1 %117, label %118, label %122
118: ; preds = %112
%119 = load i8*, i8** %9
%120 = load i32*, i32** %6
%121 = call i32 @fputs(i8* %119, i32* %120)
br label %123
122: ; preds = %112
br label %61
123: ; preds = %118
br label %61
124: ; preds = %61
%125 = load i32*, i32** %7
%126 = call i64 @fflush(i32* %125)
%127 = icmp ne i64 %126, 0
br i1 %127, label %128, label %130
128: ; preds = %124
%129 = call i32 @perror(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0))
br label %130
130: ; preds = %128, %124
%131 = load i32*, i32** %7
%132 = call i32 @fileno(i32* %131)
%133 = load i32, i32* @LOCK_UN
%134 = call i64 @flock(i32 %132, i32 %133)
%135 = icmp ne i64 %134, 0
br i1 %135, label %136, label %138
136: ; preds = %130
%137 = call i32 @perror(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.8, i64 0, i64 0))
br label %138
138: ; preds = %136, %130
%139 = load i32*, i32** %7
%140 = call i32 @fclose(i32* %139)
%141 = load i32*, i32** %6
%142 = call i32 @fclose(i32* %141)
%143 = getelementptr inbounds [15 x i8], [15 x i8]* %12, i64 0, i64 0
%144 = load i8*, i8** %3
%145 = call i32 @rename(i8* %143, i8* %144)
br label %146
146: ; preds = %138, %51, %42, %31
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"/tmp/sc.XXXXXX\00"
@.str.1 = [3 x i8] c"w+\00"
@stderr = global i32 0
@.str.2 = [8 x i8] c"%s: %s\0A\00"
@errno = global i32 0
@.str.3 = [3 x i8] c"a+\00"
@.str.4 = [23 x i8] c"error in file opening\0A\00"
@LOCK_EX = global i32 0
@.str.5 = [22 x i8] c"error in file locking\00"
@.str.6 = [24 x i8] c"error in flushing file\0A\00"
@.str.7 = [23 x i8] c"error in flushing file\00"
@LOCK_UN = global i32 0
@.str.8 = [23 x i8] c"can't release filelock\00"
define void @removeKey(i8* nocapture %0, i8* %1) {
%3 = alloca [1024 x i8]
%4 = alloca [15 x i8]
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [15 x i8], [15 x i8]* %4, i64 0, i64 0
%7 = call i32 @strncpy(i8* %6, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 15)
%8 = call i32 @mkstemp(i8* %6)
%9 = icmp eq i32 %8, -1
br i1 %9, label %16, label %10
10: ; preds = %2
%11 = call i32* @fdopen(i32 %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%12 = icmp eq i32* %11, null
br i1 %12, label %13, label %21
13: ; preds = %10
%14 = call i32 @unlink(i8* null)
%15 = call i32 @close(i32 %8)
br label %16
16: ; preds = %2, %13
%17 = load i32, i32* @stderr
%18 = load i32, i32* @errno
%19 = call i8* @strerror(i32 %18)
%20 = call i32 (i32, i8*, ...) @fprintf(i32 %17, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* %6, i8* %19)
br label %80
21: ; preds = %10
%22 = call i32* @fopen(i8* %0, 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 %27
24: ; preds = %21
%25 = load i32, i32* @stderr
%26 = call i32 (i32, i8*, ...) @fprintf(i32 %25, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0))
br label %80
27: ; preds = %21
%28 = call i32 @fileno(i32* %22)
%29 = load i32, i32* @LOCK_EX
%30 = call i64 @flock(i32 %28, i32 %29)
%31 = icmp eq i64 %30, 0
br i1 %31, label %34, label %32
32: ; preds = %27
%33 = call i32 @perror(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0))
br label %80
34: ; preds = %27
%35 = call i64 @fflush(i32* %22)
%36 = icmp eq i64 %35, 0
br i1 %36, label %40, label %37
37: ; preds = %34
%38 = load i32, i32* @stderr
%39 = call i32 (i32, i8*, ...) @fprintf(i32 %38, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0))
br label %40
40: ; preds = %37, %34
%41 = call i64 @fgets(i8* %5, i32 1024, i32* %22)
%42 = icmp eq i64 %41, 0
br i1 %42, label %64, label %43
43: ; preds = %40, %61
%44 = call i8* @strdup(i8* %5)
br label %45
45: ; preds = %48, %43
%46 = phi i8* [ %5, %43 ], [ %49, %48 ]
%47 = load i8, i8* %46
switch i8 %47, label %50 [
i8 32, label %48
i8 9, label %48
]
48: ; preds = %45, %45
%49 = getelementptr inbounds i8, i8* %46, i64 1
br label %45
50: ; preds = %45, %53
%51 = phi i8 [ %55, %53 ], [ %47, %45 ]
%52 = phi i8* [ %54, %53 ], [ %46, %45 ]
switch i8 %51, label %53 [
i8 0, label %56
i8 61, label %56
i8 32, label %56
i8 9, label %56
]
53: ; preds = %50
%54 = getelementptr inbounds i8, i8* %52, i64 1
%55 = load i8, i8* %54
br label %50
56: ; preds = %50, %50, %50, %50
store i8 0, i8* %52
%57 = call i64 @strcmp(i8* %46, i8* %1)
%58 = icmp eq i64 %57, 0
br i1 %58, label %61, label %59
59: ; preds = %56
%60 = call i32 @fputs(i8* %44, i32* %11)
br label %61
61: ; preds = %59, %56
%62 = call i64 @fgets(i8* %5, i32 1024, i32* %22)
%63 = icmp eq i64 %62, 0
br i1 %63, label %64, label %43
64: ; preds = %61, %40
%65 = call i64 @fflush(i32* %22)
%66 = icmp eq i64 %65, 0
br i1 %66, label %69, label %67
67: ; preds = %64
%68 = call i32 @perror(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0))
br label %69
69: ; preds = %67, %64
%70 = call i32 @fileno(i32* %22)
%71 = load i32, i32* @LOCK_UN
%72 = call i64 @flock(i32 %70, i32 %71)
%73 = icmp eq i64 %72, 0
br i1 %73, label %76, label %74
74: ; preds = %69
%75 = call i32 @perror(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.8, i64 0, i64 0))
br label %76
76: ; preds = %74, %69
%77 = call i32 @fclose(i32* %22)
%78 = call i32 @fclose(i32* %11)
%79 = call i32 @rename(i8* %6, i8* %0)
br label %80
80: ; preds = %76, %32, %24, %16
ret void
}