#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 */

/* Variables and functions */
int /*<<< orphan*/ ActualFileClose(int);
int /*<<< orphan*/ ActualFileDelete(char *);
int ActualFileOpenForRead(char *);
int ActualFileOpenForWrite(char *);
int /*<<< orphan*/ ActualFileRename(char *, char *);
int /*<<< orphan*/ ActualFileSeek(int, int);
int ActualFileWrite(int, int, char *);
int /*<<< orphan*/ INIAddInExt(char *, int);
int /*<<< orphan*/ INIAddOutExt(char *, int);
int INICopy(int, int, int);
int INIFindKeyword(int, char const *, int /*<<< orphan*/ *);
int INIFindSection(int, char const *);
int INIReadLine(int, char *);
int INIRemoveExt(char const *, char *);
int INIRemove(const char *file, const char *section, const char *keyword) {
  char inname[255 + 1];
  char outname[255 + 1];
  int filepos;
  int infile;
  int outfile;
  char templine[255 + 1];
  int i;
  int retval;
  if (file == NULL)
    return (-1);
  if (section == NULL)
    return (-1);
  filepos = INIRemoveExt(file, inname);
  for (i = 0; i <= filepos; i++)
    outname[i] = inname[i];
  INIAddInExt(inname, filepos);
  INIAddOutExt(outname, filepos);
  infile = ActualFileOpenForRead(inname);
  if (infile == -1)
    return (-1);
  retval = INIFindSection(infile, section);
  if (retval == -1) {
    ActualFileClose(infile);
    infile = -1;
    return (-1);
  }
  filepos = retval;
  if (keyword == NULL) {
    outfile = ActualFileOpenForWrite(outname);
    if (outfile == -1) {
      ActualFileClose(infile);
      infile = -1;
      return (-1);
    }
    ActualFileSeek(infile, 0);
    retval = INICopy(infile, outfile, filepos);
    if (retval > 0) {
      ActualFileClose(infile);
      infile = -1;
      ActualFileClose(outfile);
      outfile = -1;
      ActualFileDelete(outname);
      return (-1);
    }
    templine[0] = 0;
    retval = 1;
    while ((retval > 0) && (templine[0] != '[')) {
      retval = INIReadLine(infile, templine);
    }
    if (templine[0] == '[') {
      i = 0;
      while ((i < 255) && (templine[i] != 0))
        i++;
      retval = ActualFileWrite(outfile, i, templine);
      if (retval < i) {
        ActualFileClose(infile);
        infile = -1;
        ActualFileClose(outfile);
        outfile = -1;
        ActualFileDelete(outname);
        return (-1);
      }
    }
  } else {
    filepos = retval;
    ActualFileSeek(infile, filepos);
    filepos += INIReadLine(infile, templine);
    retval = INIFindKeyword(infile, keyword, NULL);
    if (retval == -1) {
      ActualFileClose(infile);
      infile = -1;
      return (-1);
    }
    filepos += retval;
    outfile = ActualFileOpenForWrite(outname);
    if (outfile == -1) {
      ActualFileClose(infile);
      infile = -1;
      return (-1);
    }
    ActualFileSeek(infile, 0);
    retval = INICopy(infile, outfile, filepos);
    if (retval > 0) {
      ActualFileClose(infile);
      infile = -1;
      ActualFileClose(outfile);
      outfile = -1;
      ActualFileDelete(outname);
      return (-1);
    }
    INIReadLine(infile, templine);
  }
  INICopy(infile, outfile, 0xFFFFFFF);
  ActualFileClose(infile);
  infile = -1;
  ActualFileClose(outfile);
  outfile = -1;
  ActualFileDelete(inname);
  ActualFileRename(outname, inname);
  return (0);
}


x86 assembly (clang, -O0):
<INIRemove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x340,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    120e <INIRemove+0x2e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1707 <INIRemove+0x527>
cmpq   $0x0,-0x18(%rbp)
jne    1225 <INIRemove+0x45>
movl   $0xffffffff,-0x4(%rbp)
jmp    1707 <INIRemove+0x527>
mov    -0x10(%rbp),%rdi
lea    -0x120(%rbp),%rsi
call   10a0 <INIRemoveExt@plt>
mov    %eax,-0x224(%rbp)
movl   $0x0,-0x334(%rbp)
mov    -0x334(%rbp),%eax
cmp    -0x224(%rbp),%eax
jg     1287 <INIRemove+0xa7>
movslq -0x334(%rbp),%rax
mov    -0x120(%rbp,%rax,1),%cl
movslq -0x334(%rbp),%rax
mov    %cl,-0x220(%rbp,%rax,1)
mov    -0x334(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x334(%rbp)
jmp    1245 <INIRemove+0x65>
lea    -0x120(%rbp),%rdi
mov    -0x224(%rbp),%esi
call   10f0 <INIAddInExt@plt>
lea    -0x220(%rbp),%rdi
mov    -0x224(%rbp),%esi
call   1040 <INIAddOutExt@plt>
lea    -0x120(%rbp),%rdi
call   10c0 <ActualFileOpenForRead@plt>
mov    %eax,-0x228(%rbp)
cmpl   $0xffffffff,-0x228(%rbp)
jne    12d6 <INIRemove+0xf6>
movl   $0xffffffff,-0x4(%rbp)
jmp    1707 <INIRemove+0x527>
mov    -0x228(%rbp),%edi
mov    -0x18(%rbp),%rsi
call   10e0 <INIFindSection@plt>
mov    %eax,-0x338(%rbp)
cmpl   $0xffffffff,-0x338(%rbp)
jne    1319 <INIRemove+0x139>
mov    -0x228(%rbp),%edi
call   1070 <ActualFileClose@plt>
movl   $0xffffffff,-0x228(%rbp)
ff ff ff
movl   $0xffffffff,-0x4(%rbp)
jmp    1707 <INIRemove+0x527>
mov    -0x338(%rbp),%eax
mov    %eax,-0x224(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1542 <INIRemove+0x362>
lea    -0x220(%rbp),%rdi
call   1090 <ActualFileOpenForWrite@plt>
mov    %eax,-0x22c(%rbp)
cmpl   $0xffffffff,-0x22c(%rbp)
jne    1370 <INIRemove+0x190>
mov    -0x228(%rbp),%edi
call   1070 <ActualFileClose@plt>
movl   $0xffffffff,-0x228(%rbp)
ff ff ff
movl   $0xffffffff,-0x4(%rbp)
jmp    1707 <INIRemove+0x527>
mov    -0x228(%rbp),%edi
xor    %esi,%esi
call   1100 <ActualFileSeek@plt>
mov    -0x228(%rbp),%edi
mov    -0x22c(%rbp),%esi
mov    -0x224(%rbp),%edx
call   1060 <INICopy@plt>
mov    %eax,-0x338(%rbp)
cmpl   $0x0,-0x338(%rbp)
jle    13e9 <INIRemove+0x209>
mov    -0x228(%rbp),%edi
call   1070 <ActualFileClose@plt>
movl   $0xffffffff,-0x228(%rbp)
ff ff ff
mov    -0x22c(%rbp),%edi
call   1070 <ActualFileClose@plt>
movl   $0xffffffff,-0x22c(%rbp)
ff ff ff
lea    -0x220(%rbp),%rdi
call   1080 <ActualFileDelete@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1707 <INIRemove+0x527>
movb   $0x0,-0x330(%rbp)
movl   $0x1,-0x338(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x338(%rbp)
mov    %al,-0x339(%rbp)
jle    1422 <INIRemove+0x242>
movsbl -0x330(%rbp),%eax
cmp    $0x5b,%eax
setne  %al
mov    %al,-0x339(%rbp)
mov    -0x339(%rbp),%al
test   $0x1,%al
jne    1435 <INIRemove+0x255>
jmp    1452 <INIRemove+0x272>
mov    -0x228(%rbp),%edi
lea    -0x330(%rbp),%rsi
call   10b0 <INIReadLine@plt>
mov    %eax,-0x338(%rbp)
jmp    13fa <INIRemove+0x21a>
movsbl -0x330(%rbp),%eax
cmp    $0x5b,%eax
jne    153d <INIRemove+0x35d>
movl   $0x0,-0x334(%rbp)
xor    %eax,%eax
cmpl   $0xff,-0x334(%rbp)
mov    %al,-0x33a(%rbp)
jge    149f <INIRemove+0x2bf>
movslq -0x334(%rbp),%rax
movsbl -0x330(%rbp,%rax,1),%eax
ff
cmp    $0x0,%eax
setne  %al
mov    %al,-0x33a(%rbp)
mov    -0x33a(%rbp),%al
test   $0x1,%al
jne    14b2 <INIRemove+0x2d2>
jmp    14c6 <INIRemove+0x2e6>
mov    -0x334(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x334(%rbp)
jmp    146c <INIRemove+0x28c>
mov    -0x22c(%rbp),%edi
mov    -0x334(%rbp),%esi
lea    -0x330(%rbp),%rdx
call   1050 <ActualFileWrite@plt>
mov    %eax,-0x338(%rbp)
mov    -0x338(%rbp),%eax
cmp    -0x334(%rbp),%eax
jge    1538 <INIRemove+0x358>
mov    -0x228(%rbp),%edi
call   1070 <ActualFileClose@plt>
movl   $0xffffffff,-0x228(%rbp)
ff ff ff
mov    -0x22c(%rbp),%edi
call   1070 <ActualFileClose@plt>
movl   $0xffffffff,-0x22c(%rbp)
ff ff ff
lea    -0x220(%rbp),%rdi
call   1080 <ActualFileDelete@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1707 <INIRemove+0x527>
jmp    153d <INIRemove+0x35d>
jmp    16a1 <INIRemove+0x4c1>
mov    -0x338(%rbp),%eax
mov    %eax,-0x224(%rbp)
mov    -0x228(%rbp),%edi
mov    -0x224(%rbp),%esi
call   1100 <ActualFileSeek@plt>
mov    -0x228(%rbp),%edi
lea    -0x330(%rbp),%rsi
call   10b0 <INIReadLine@plt>
add    -0x224(%rbp),%eax
mov    %eax,-0x224(%rbp)
mov    -0x228(%rbp),%edi
mov    -0x20(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   10d0 <INIFindKeyword@plt>
mov    %eax,-0x338(%rbp)
cmpl   $0xffffffff,-0x338(%rbp)
jne    15c4 <INIRemove+0x3e4>
mov    -0x228(%rbp),%edi
call   1070 <ActualFileClose@plt>
movl   $0xffffffff,-0x228(%rbp)
ff ff ff
movl   $0xffffffff,-0x4(%rbp)
jmp    1707 <INIRemove+0x527>
mov    -0x338(%rbp),%eax
add    -0x224(%rbp),%eax
mov    %eax,-0x224(%rbp)
lea    -0x220(%rbp),%rdi
call   1090 <ActualFileOpenForWrite@plt>
mov    %eax,-0x22c(%rbp)
cmpl   $0xffffffff,-0x22c(%rbp)
jne    1616 <INIRemove+0x436>
mov    -0x228(%rbp),%edi
call   1070 <ActualFileClose@plt>
movl   $0xffffffff,-0x228(%rbp)
ff ff ff
movl   $0xffffffff,-0x4(%rbp)
jmp    1707 <INIRemove+0x527>
mov    -0x228(%rbp),%edi
xor    %esi,%esi
call   1100 <ActualFileSeek@plt>
mov    -0x228(%rbp),%edi
mov    -0x22c(%rbp),%esi
mov    -0x224(%rbp),%edx
call   1060 <INICopy@plt>
mov    %eax,-0x338(%rbp)
cmpl   $0x0,-0x338(%rbp)
jle    168f <INIRemove+0x4af>
mov    -0x228(%rbp),%edi
call   1070 <ActualFileClose@plt>
movl   $0xffffffff,-0x228(%rbp)
ff ff ff
mov    -0x22c(%rbp),%edi
call   1070 <ActualFileClose@plt>
movl   $0xffffffff,-0x22c(%rbp)
ff ff ff
lea    -0x220(%rbp),%rdi
call   1080 <ActualFileDelete@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1707 <INIRemove+0x527>
mov    -0x228(%rbp),%edi
lea    -0x330(%rbp),%rsi
call   10b0 <INIReadLine@plt>
mov    -0x228(%rbp),%edi
mov    -0x22c(%rbp),%esi
mov    $0xfffffff,%edx
call   1060 <INICopy@plt>
mov    -0x228(%rbp),%edi
call   1070 <ActualFileClose@plt>
movl   $0xffffffff,-0x228(%rbp)
ff ff ff
mov    -0x22c(%rbp),%edi
call   1070 <ActualFileClose@plt>
movl   $0xffffffff,-0x22c(%rbp)
ff ff ff
lea    -0x120(%rbp),%rdi
call   1080 <ActualFileDelete@plt>
lea    -0x220(%rbp),%rdi
lea    -0x120(%rbp),%rsi
call   1030 <ActualFileRename@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x340,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<INIRemove>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x308,%rsp
mov    $0xffffffff,%r15d
test   %rdi,%rdi
je     136e <INIRemove+0x17e>
mov    %rsi,%rbp
test   %rsi,%rsi
je     136e <INIRemove+0x17e>
mov    %rdx,%r14
lea    0x200(%rsp),%rsi
call   10b0 <INIRemoveExt@plt>
mov    %eax,%ebx
test   %eax,%eax
js     124d <INIRemove+0x5d>
mov    %ebx,%edx
add    $0x1,%rdx
lea    0x100(%rsp),%rdi
lea    0x200(%rsp),%rsi
call   10a0 <memcpy@plt>
lea    0x200(%rsp),%r12
mov    %r12,%rdi
mov    %ebx,%esi
call   1100 <INIAddInExt@plt>
lea    0x100(%rsp),%rdi
mov    %ebx,%esi
call   1040 <INIAddOutExt@plt>
mov    %r12,%rdi
call   10d0 <ActualFileOpenForRead@plt>
cmp    $0xffffffff,%eax
je     136e <INIRemove+0x17e>
mov    %eax,%r13d
mov    %eax,%edi
mov    %rbp,%rsi
call   10f0 <INIFindSection@plt>
cmp    $0xffffffff,%eax
je     1366 <INIRemove+0x176>
mov    %eax,%r12d
test   %r14,%r14
je     1316 <INIRemove+0x126>
mov    %r13d,%edi
mov    %r12d,%esi
call   1110 <ActualFileSeek@plt>
mov    %rsp,%rsi
mov    %r13d,%edi
call   10c0 <INIReadLine@plt>
mov    %eax,%ebp
mov    %r13d,%edi
mov    %r14,%rsi
xor    %edx,%edx
call   10e0 <INIFindKeyword@plt>
cmp    $0xffffffff,%eax
je     1366 <INIRemove+0x176>
mov    %eax,%ebx
lea    0x100(%rsp),%rdi
call   1090 <ActualFileOpenForWrite@plt>
cmp    $0xffffffff,%eax
je     1366 <INIRemove+0x176>
mov    %eax,%r14d
add    %r12d,%ebp
add    %ebx,%ebp
mov    %r13d,%edi
xor    %esi,%esi
call   1110 <ActualFileSeek@plt>
mov    %r13d,%edi
mov    %r14d,%esi
mov    %ebp,%edx
call   1060 <INICopy@plt>
test   %eax,%eax
jg     1347 <INIRemove+0x157>
mov    %rsp,%rsi
mov    %r13d,%edi
call   10c0 <INIReadLine@plt>
jmp    1418 <INIRemove+0x228>
lea    0x100(%rsp),%rdi
call   1090 <ActualFileOpenForWrite@plt>
cmp    $0xffffffff,%eax
je     1366 <INIRemove+0x176>
mov    %eax,%r14d
mov    %r13d,%edi
xor    %esi,%esi
call   1110 <ActualFileSeek@plt>
mov    %r13d,%edi
mov    %r14d,%esi
mov    %r12d,%edx
call   1060 <INICopy@plt>
test   %eax,%eax
jle    1383 <INIRemove+0x193>
mov    %r13d,%edi
call   1070 <ActualFileClose@plt>
mov    %r14d,%edi
call   1070 <ActualFileClose@plt>
lea    0x100(%rsp),%rdi
call   1080 <ActualFileDelete@plt>
jmp    136e <INIRemove+0x17e>
mov    %r13d,%edi
call   1070 <ActualFileClose@plt>
mov    %r15d,%eax
add    $0x308,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
movb   $0x0,(%rsp)
mov    %rsp,%rbx
nopw   0x0(%rax,%rax,1)
mov    %r13d,%edi
mov    %rbx,%rsi
call   10c0 <INIReadLine@plt>
movzbl (%rsp),%ecx
test   %eax,%eax
jle    13a8 <INIRemove+0x1b8>
cmp    $0x5b,%cl
jne    1390 <INIRemove+0x1a0>
cmp    $0x5b,%cl
jne    1418 <INIRemove+0x228>
xor    %eax,%eax
cmpb   $0x0,0x1(%rsp,%rax,1)
je     13e3 <INIRemove+0x1f3>
cmpb   $0x0,0x2(%rsp,%rax,1)
je     13e9 <INIRemove+0x1f9>
cmpb   $0x0,0x3(%rsp,%rax,1)
je     13ef <INIRemove+0x1ff>
cmpb   $0x0,0x4(%rsp,%rax,1)
je     13f5 <INIRemove+0x205>
cmp    $0xfa,%rax
je     13fe <INIRemove+0x20e>
lea    0x5(%rax),%rbx
cmpb   $0x0,0x5(%rsp,%rax,1)
mov    %rbx,%rax
jne    13af <INIRemove+0x1bf>
jmp    1403 <INIRemove+0x213>
add    $0x1,%rax
jmp    13f9 <INIRemove+0x209>
add    $0x2,%rax
jmp    13f9 <INIRemove+0x209>
add    $0x3,%rax
jmp    13f9 <INIRemove+0x209>
add    $0x4,%rax
mov    %rax,%rbx
jmp    1403 <INIRemove+0x213>
mov    $0xff,%ebx
mov    %rsp,%rdx
mov    %r14d,%edi
mov    %ebx,%esi
call   1050 <ActualFileWrite@plt>
cmp    %ebx,%eax
jl     1347 <INIRemove+0x157>
mov    %r13d,%edi
mov    %r14d,%esi
mov    $0xfffffff,%edx
call   1060 <INICopy@plt>
mov    %r13d,%edi
call   1070 <ActualFileClose@plt>
mov    %r14d,%edi
call   1070 <ActualFileClose@plt>
lea    0x200(%rsp),%rbx
mov    %rbx,%rdi
call   1080 <ActualFileDelete@plt>
lea    0x100(%rsp),%rdi
mov    %rbx,%rsi
call   1030 <ActualFileRename@plt>
xor    %r15d,%r15d
jmp    136e <INIRemove+0x17e>

LLVM IR (-O0):
define i32 @INIRemove(i8* %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca [256 x i8]
%9 = alloca [256 x i8]
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca [256 x i8]
%14 = alloca i32
%15 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
%16 = load i8*, i8** %5
%17 = icmp eq i8* %16, null
br i1 %17, label %18, label %19
18: ; preds = %3
store i32 -1, i32* %4
br label %207
19: ; preds = %3
%20 = load i8*, i8** %6
%21 = icmp eq i8* %20, null
br i1 %21, label %22, label %23
22: ; preds = %19
store i32 -1, i32* %4
br label %207
23: ; preds = %19
%24 = load i8*, i8** %5
%25 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 0
%26 = call i32 @INIRemoveExt(i8* %24, i8* %25)
store i32 %26, i32* %10
store i32 0, i32* %14
br label %27
27: ; preds = %39, %23
%28 = load i32, i32* %14
%29 = load i32, i32* %10
%30 = icmp sle i32 %28, %29
br i1 %30, label %31, label %42
31: ; preds = %27
%32 = load i32, i32* %14
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 %33
%35 = load i8, i8* %34
%36 = load i32, i32* %14
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 %37
store i8 %35, i8* %38
br label %39
39: ; preds = %31
%40 = load i32, i32* %14
%41 = add nsw i32 %40, 1
store i32 %41, i32* %14
br label %27
42: ; preds = %27
%43 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 0
%44 = load i32, i32* %10
%45 = call i32 @INIAddInExt(i8* %43, i32 %44)
%46 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%47 = load i32, i32* %10
%48 = call i32 @INIAddOutExt(i8* %46, i32 %47)
%49 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 0
%50 = call i32 @ActualFileOpenForRead(i8* %49)
store i32 %50, i32* %11
%51 = load i32, i32* %11
%52 = icmp eq i32 %51, -1
br i1 %52, label %53, label %54
53: ; preds = %42
store i32 -1, i32* %4
br label %207
54: ; preds = %42
%55 = load i32, i32* %11
%56 = load i8*, i8** %6
%57 = call i32 @INIFindSection(i32 %55, i8* %56)
store i32 %57, i32* %15
%58 = load i32, i32* %15
%59 = icmp eq i32 %58, -1
br i1 %59, label %60, label %63
60: ; preds = %54
%61 = load i32, i32* %11
%62 = call i32 @ActualFileClose(i32 %61)
store i32 -1, i32* %11
store i32 -1, i32* %4
br label %207
63: ; preds = %54
%64 = load i32, i32* %15
store i32 %64, i32* %10
%65 = load i8*, i8** %7
%66 = icmp eq i8* %65, null
br i1 %66, label %67, label %145
67: ; preds = %63
%68 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%69 = call i32 @ActualFileOpenForWrite(i8* %68)
store i32 %69, i32* %12
%70 = load i32, i32* %12
%71 = icmp eq i32 %70, -1
br i1 %71, label %72, label %75
72: ; preds = %67
%73 = load i32, i32* %11
%74 = call i32 @ActualFileClose(i32 %73)
store i32 -1, i32* %11
store i32 -1, i32* %4
br label %207
75: ; preds = %67
%76 = load i32, i32* %11
%77 = call i32 @ActualFileSeek(i32 %76, i32 0)
%78 = load i32, i32* %11
%79 = load i32, i32* %12
%80 = load i32, i32* %10
%81 = call i32 @INICopy(i32 %78, i32 %79, i32 %80)
store i32 %81, i32* %15
%82 = load i32, i32* %15
%83 = icmp sgt i32 %82, 0
br i1 %83, label %84, label %91
84: ; preds = %75
%85 = load i32, i32* %11
%86 = call i32 @ActualFileClose(i32 %85)
store i32 -1, i32* %11
%87 = load i32, i32* %12
%88 = call i32 @ActualFileClose(i32 %87)
store i32 -1, i32* %12
%89 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%90 = call i32 @ActualFileDelete(i8* %89)
store i32 -1, i32* %4
br label %207
91: ; preds = %75
%92 = getelementptr inbounds [256 x i8], [256 x i8]* %13, i64 0, i64 0
store i8 0, i8* %92
store i32 1, i32* %15
br label %93
93: ; preds = %103, %91
%94 = load i32, i32* %15
%95 = icmp sgt i32 %94, 0
br i1 %95, label %96, label %101
96: ; preds = %93
%97 = getelementptr inbounds [256 x i8], [256 x i8]* %13, i64 0, i64 0
%98 = load i8, i8* %97
%99 = sext i8 %98 to i32
%100 = icmp ne i32 %99, 91
br label %101
101: ; preds = %96, %93
%102 = phi i1 [ false, %93 ], [ %100, %96 ]
br i1 %102, label %103, label %107
103: ; preds = %101
%104 = load i32, i32* %11
%105 = getelementptr inbounds [256 x i8], [256 x i8]* %13, i64 0, i64 0
%106 = call i32 @INIReadLine(i32 %104, i8* %105)
store i32 %106, i32* %15
br label %93
107: ; preds = %101
%108 = getelementptr inbounds [256 x i8], [256 x i8]* %13, i64 0, i64 0
%109 = load i8, i8* %108
%110 = sext i8 %109 to i32
%111 = icmp eq i32 %110, 91
br i1 %111, label %112, label %144
112: ; preds = %107
store i32 0, i32* %14
br label %113
113: ; preds = %125, %112
%114 = load i32, i32* %14
%115 = icmp slt i32 %114, 255
br i1 %115, label %116, label %123
116: ; preds = %113
%117 = load i32, i32* %14
%118 = sext i32 %117 to i64
%119 = getelementptr inbounds [256 x i8], [256 x i8]* %13, i64 0, i64 %118
%120 = load i8, i8* %119
%121 = sext i8 %120 to i32
%122 = icmp ne i32 %121, 0
br label %123
123: ; preds = %116, %113
%124 = phi i1 [ false, %113 ], [ %122, %116 ]
br i1 %124, label %125, label %128
125: ; preds = %123
%126 = load i32, i32* %14
%127 = add nsw i32 %126, 1
store i32 %127, i32* %14
br label %113
128: ; preds = %123
%129 = load i32, i32* %12
%130 = load i32, i32* %14
%131 = getelementptr inbounds [256 x i8], [256 x i8]* %13, i64 0, i64 0
%132 = call i32 @ActualFileWrite(i32 %129, i32 %130, i8* %131)
store i32 %132, i32* %15
%133 = load i32, i32* %15
%134 = load i32, i32* %14
%135 = icmp slt i32 %133, %134
br i1 %135, label %136, label %143
136: ; preds = %128
%137 = load i32, i32* %11
%138 = call i32 @ActualFileClose(i32 %137)
store i32 -1, i32* %11
%139 = load i32, i32* %12
%140 = call i32 @ActualFileClose(i32 %139)
store i32 -1, i32* %12
%141 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%142 = call i32 @ActualFileDelete(i8* %141)
store i32 -1, i32* %4
br label %207
143: ; preds = %128
br label %144
144: ; preds = %143, %107
br label %194
145: ; preds = %63
%146 = load i32, i32* %15
store i32 %146, i32* %10
%147 = load i32, i32* %11
%148 = load i32, i32* %10
%149 = call i32 @ActualFileSeek(i32 %147, i32 %148)
%150 = load i32, i32* %11
%151 = getelementptr inbounds [256 x i8], [256 x i8]* %13, i64 0, i64 0
%152 = call i32 @INIReadLine(i32 %150, i8* %151)
%153 = load i32, i32* %10
%154 = add nsw i32 %153, %152
store i32 %154, i32* %10
%155 = load i32, i32* %11
%156 = load i8*, i8** %7
%157 = call i32 @INIFindKeyword(i32 %155, i8* %156, i32* null)
store i32 %157, i32* %15
%158 = load i32, i32* %15
%159 = icmp eq i32 %158, -1
br i1 %159, label %160, label %163
160: ; preds = %145
%161 = load i32, i32* %11
%162 = call i32 @ActualFileClose(i32 %161)
store i32 -1, i32* %11
store i32 -1, i32* %4
br label %207
163: ; preds = %145
%164 = load i32, i32* %15
%165 = load i32, i32* %10
%166 = add nsw i32 %165, %164
store i32 %166, i32* %10
%167 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%168 = call i32 @ActualFileOpenForWrite(i8* %167)
store i32 %168, i32* %12
%169 = load i32, i32* %12
%170 = icmp eq i32 %169, -1
br i1 %170, label %171, label %174
171: ; preds = %163
%172 = load i32, i32* %11
%173 = call i32 @ActualFileClose(i32 %172)
store i32 -1, i32* %11
store i32 -1, i32* %4
br label %207
174: ; preds = %163
%175 = load i32, i32* %11
%176 = call i32 @ActualFileSeek(i32 %175, i32 0)
%177 = load i32, i32* %11
%178 = load i32, i32* %12
%179 = load i32, i32* %10
%180 = call i32 @INICopy(i32 %177, i32 %178, i32 %179)
store i32 %180, i32* %15
%181 = load i32, i32* %15
%182 = icmp sgt i32 %181, 0
br i1 %182, label %183, label %190
183: ; preds = %174
%184 = load i32, i32* %11
%185 = call i32 @ActualFileClose(i32 %184)
store i32 -1, i32* %11
%186 = load i32, i32* %12
%187 = call i32 @ActualFileClose(i32 %186)
store i32 -1, i32* %12
%188 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%189 = call i32 @ActualFileDelete(i8* %188)
store i32 -1, i32* %4
br label %207
190: ; preds = %174
%191 = load i32, i32* %11
%192 = getelementptr inbounds [256 x i8], [256 x i8]* %13, i64 0, i64 0
%193 = call i32 @INIReadLine(i32 %191, i8* %192)
br label %194
194: ; preds = %190, %144
%195 = load i32, i32* %11
%196 = load i32, i32* %12
%197 = call i32 @INICopy(i32 %195, i32 %196, i32 268435455)
%198 = load i32, i32* %11
%199 = call i32 @ActualFileClose(i32 %198)
store i32 -1, i32* %11
%200 = load i32, i32* %12
%201 = call i32 @ActualFileClose(i32 %200)
store i32 -1, i32* %12
%202 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 0
%203 = call i32 @ActualFileDelete(i8* %202)
%204 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%205 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 0
%206 = call i32 @ActualFileRename(i8* %204, i8* %205)
store i32 0, i32* %4
br label %207
207: ; preds = %194, %183, %171, %160, %136, %84, %72, %60, %53, %22, %18
%208 = load i32, i32* %4
ret i32 %208
}

LLVM IR (-O2):
define i32 @INIRemove(i8* %0, i8* %1, i8* %2) {
%4 = alloca [256 x i8]
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%6 = alloca [256 x i8]
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%8 = alloca [256 x i8]
%9 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%11 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 0
%12 = icmp eq i8* %0, null
%13 = icmp eq i8* %1, null
%14 = or i1 %12, %13
br i1 %14, label %125, label %15
15: ; preds = %3
%16 = call i32 @INIRemoveExt(i8* %0, i8* %9)
%17 = icmp slt i32 %16, 0
br i1 %17, label %21, label %18
18: ; preds = %15
%19 = zext i32 %16 to i64
%20 = add nuw nsw i64 %19, 1
br label %21
21: ; preds = %18, %15
%22 = call i32 @INIAddInExt(i8* %9, i32 %16)
%23 = call i32 @INIAddOutExt(i8* %10, i32 %16)
%24 = call i32 @ActualFileOpenForRead(i8* %9)
%25 = icmp eq i32 %24, -1
br i1 %25, label %125, label %26
26: ; preds = %21
%27 = call i32 @INIFindSection(i32 %24, i8* %1)
%28 = icmp eq i32 %27, -1
br i1 %28, label %29, label %31
29: ; preds = %26
%30 = call i32 @ActualFileClose(i32 %24)
br label %125
31: ; preds = %26
%32 = icmp eq i8* %2, null
br i1 %32, label %33, label %94
33: ; preds = %31
%34 = call i32 @ActualFileOpenForWrite(i8* %10)
%35 = icmp eq i32 %34, -1
br i1 %35, label %36, label %38
36: ; preds = %33
%37 = call i32 @ActualFileClose(i32 %24)
br label %125
38: ; preds = %33
%39 = call i32 @ActualFileSeek(i32 %24, i32 0)
%40 = call i32 @INICopy(i32 %24, i32 %34, i32 %27)
%41 = icmp sgt i32 %40, 0
br i1 %41, label %42, label %46
42: ; preds = %38
%43 = call i32 @ActualFileClose(i32 %24)
%44 = call i32 @ActualFileClose(i32 %34)
%45 = call i32 @ActualFileDelete(i8* %10)
br label %125
46: ; preds = %38
store i8 0, i8* %11
br label %47
47: ; preds = %46, %47
%48 = call i32 @INIReadLine(i32 %24, i8* %11)
%49 = load i8, i8* %11
%50 = icmp sgt i32 %48, 0
%51 = icmp ne i8 %49, 91
%52 = select i1 %50, i1 %51, i1 false
br i1 %52, label %47, label %53
53: ; preds = %47
%54 = icmp eq i8 %49, 91
br i1 %54, label %55, label %118
55: ; preds = %53, %79
%56 = phi i64 [ %77, %79 ], [ 0, %53 ]
%57 = add nuw nsw i64 %56, 1
%58 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 %57
%59 = load i8, i8* %58
%60 = icmp eq i8 %59, 0
br i1 %60, label %83, label %61
61: ; preds = %55
%62 = add nuw nsw i64 %56, 2
%63 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 %62
%64 = load i8, i8* %63
%65 = icmp eq i8 %64, 0
br i1 %65, label %83, label %66
66: ; preds = %61
%67 = add nuw nsw i64 %56, 3
%68 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 %67
%69 = load i8, i8* %68
%70 = icmp eq i8 %69, 0
br i1 %70, label %83, label %71
71: ; preds = %66
%72 = add nuw nsw i64 %56, 4
%73 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 %72
%74 = load i8, i8* %73
%75 = icmp eq i8 %74, 0
br i1 %75, label %83, label %76
76: ; preds = %71
%77 = add nuw nsw i64 %56, 5
%78 = icmp eq i64 %77, 255
br i1 %78, label %86, label %79
79: ; preds = %76
%80 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 %77
%81 = load i8, i8* %80
%82 = icmp eq i8 %81, 0
br i1 %82, label %83, label %55
83: ; preds = %79, %71, %66, %61, %55
%84 = phi i64 [ %57, %55 ], [ %62, %61 ], [ %67, %66 ], [ %72, %71 ], [ %77, %79 ]
%85 = trunc i64 %84 to i32
br label %86
86: ; preds = %76, %83
%87 = phi i32 [ %85, %83 ], [ 255, %76 ]
%88 = call i32 @ActualFileWrite(i32 %34, i32 %87, i8* %11)
%89 = icmp slt i32 %88, %87
br i1 %89, label %90, label %118
90: ; preds = %86
%91 = call i32 @ActualFileClose(i32 %24)
%92 = call i32 @ActualFileClose(i32 %34)
%93 = call i32 @ActualFileDelete(i8* %10)
br label %125
94: ; preds = %31
%95 = call i32 @ActualFileSeek(i32 %24, i32 %27)
%96 = call i32 @INIReadLine(i32 %24, i8* %11)
%97 = call i32 @INIFindKeyword(i32 %24, i8* %2, i32* null)
%98 = icmp eq i32 %97, -1
br i1 %98, label %99, label %101
99: ; preds = %94
%100 = call i32 @ActualFileClose(i32 %24)
br label %125
101: ; preds = %94
%102 = call i32 @ActualFileOpenForWrite(i8* %10)
%103 = icmp eq i32 %102, -1
br i1 %103, label %104, label %106
104: ; preds = %101
%105 = call i32 @ActualFileClose(i32 %24)
br label %125
106: ; preds = %101
%107 = add nsw i32 %96, %27
%108 = add nsw i32 %107, %97
%109 = call i32 @ActualFileSeek(i32 %24, i32 0)
%110 = call i32 @INICopy(i32 %24, i32 %102, i32 %108)
%111 = icmp sgt i32 %110, 0
br i1 %111, label %112, label %116
112: ; preds = %106
%113 = call i32 @ActualFileClose(i32 %24)
%114 = call i32 @ActualFileClose(i32 %102)
%115 = call i32 @ActualFileDelete(i8* %10)
br label %125
116: ; preds = %106
%117 = call i32 @INIReadLine(i32 %24, i8* %11)
br label %118
118: ; preds = %53, %86, %116
%119 = phi i32 [ %34, %86 ], [ %34, %53 ], [ %102, %116 ]
%120 = call i32 @INICopy(i32 %24, i32 %119, i32 268435455)
%121 = call i32 @ActualFileClose(i32 %24)
%122 = call i32 @ActualFileClose(i32 %119)
%123 = call i32 @ActualFileDelete(i8* %9)
%124 = call i32 @ActualFileRename(i8* %10, i8* %9)
br label %125
125: ; preds = %21, %3, %118, %112, %104, %99, %90, %42, %36, %29
%126 = phi i32 [ -1, %29 ], [ -1, %36 ], [ -1, %42 ], [ -1, %90 ], [ 0, %118 ], [ -1, %99 ], [ -1, %104 ], [ -1, %112 ], [ -1, %3 ], [ -1, %21 ]
ret i32 %126
}