#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*/ fprintf(int /*<<< orphan*/ *, char *, char const *, ...);
scalar_t__ isspace(char);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
int /*<<< orphan*/ *stderr;
char *strchr(char *, char);
scalar_t__ strcmp(char *, char const *);
int /*<<< orphan*/ strcpy(char *, char const *);
int strlen(char const *);
int /*<<< orphan*/ *tmpfile();
int app_netconf_item_set(const char *item, const char *item_name) {
  FILE *fp, *fptmp;
  char _label[81] = "";
  char _value[81] = "";
  char line[81] = "";
  int found = 0;
  fp = fopen("/local/etc/sysconfig/"
             "net.conf",
             "r");
  if (fp == NULL) {
    perror("/local/etc/sysconfig/"
           "net.conf");
    return -1;
  }
  fptmp = tmpfile();
  if (!fptmp) {
    perror("temporary file");
    fclose(fp);
    return -2;
  }
  while (fgets(line, 81, fp) != NULL) {
    char *p = line;
    char *s = p + strlen(line);
    if (strchr(line, '\n')) {
      *strchr(line, '\n') = '\0';
    }
    while (p < s && isspace(*p)) {
      ++p;
    }
    --s;
    while (s > p && isspace(*s)) {
      *s = 0;
      --s;
    }
    strcpy(line, p);
    if (line[0] != '#' && line[0] != '\0') {
      _label[0] = '\0';
      _value[0] = '\0';
      if (strchr(line, '=') == NULL) {
        fprintf(stderr, "WRONG FORMAT '%s'\n", line);
        fclose(fp);
        fclose(fptmp);
        return -1;
      }
      strcpy(_value, strchr(line, '=') + 1);
      if (strchr(_value, '\n')) {
        *strchr(_value, '\n') = '\0';
      }
      strcpy(_label, line);
      *strchr(_label, '=') = '\0';
      if (_label[0] != '\0') {
        if (strcmp(_label, item_name) == 0) {
          strcpy(_value, item);
          found = 1;
        }
        char *p = _value;
        char *s = p + strlen(_value);
        while (p < s && isspace(*p)) {
          ++p;
        }
        --s;
        while (s > p && isspace(*s)) {
          *s = 0;
          --s;
        }
        strcpy(_value, p);
        fprintf(fptmp, "%s=%s\n", _label, _value);
      } else {
        fprintf(fptmp, "%s\n", line);
      }
    } else {
      fprintf(fptmp, "%s\n", line);
    }
  }
  if (found == 0) {
    char *p = item;
    char *s = p + strlen(item);
    while (p < s && isspace(*p)) {
      ++p;
    }
    --s;
    while (s > p && isspace(*s)) {
      *s = 0;
      --s;
    }
    fprintf(fptmp, "%s=%s\n", item_name, p);
  }
  fclose(fp);
  rewind(fptmp);
  fp = fopen("/local/etc/sysconfig/"
             "net.conf",
             "w");
  if (!fp) {
    perror("/local/etc/sysconfig/"
           "net.conf");
    fclose(fptmp);
    return -1;
  }
  while (fgets(line, 81, fptmp) != NULL) {
    fprintf(fp, "%s", line);
  }
  fclose(fptmp);
  fclose(fp);
  return 0;
}


x86 assembly (clang, -O0):
<app_netconf_item_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1b0,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
lea    -0x80(%rbp),%rdi
xor    %esi,%esi
mov    $0x51,%edx
call   1080 <memset@plt>
lea    -0xe0(%rbp),%rdi
xor    %esi,%esi
mov    $0x51,%edx
call   1080 <memset@plt>
lea    -0x140(%rbp),%rdi
xor    %esi,%esi
mov    $0x51,%edx
call   1080 <memset@plt>
movl   $0x0,-0x144(%rbp)
lea    0xdd6(%rip),%rdi
lea    0xded(%rip),%rsi
call   10e0 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    125d <app_netconf_item_set+0x8d>
lea    0xdb4(%rip),%rdi
call   10f0 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    18e1 <app_netconf_item_set+0x711>
mov    $0x0,%al
call   10b0 <tmpfile@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    1294 <app_netconf_item_set+0xc4>
lea    0xda6(%rip),%rdi
call   10f0 <perror@plt>
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
movl   $0xfffffffe,-0x4(%rbp)
jmp    18e1 <app_netconf_item_set+0x711>
jmp    1299 <app_netconf_item_set+0xc9>
lea    -0x140(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    $0x51,%esi
call   10a0 <fgets@plt>
cmp    $0x0,%rax
je     16ef <app_netconf_item_set+0x51f>
lea    -0x140(%rbp),%rax
mov    %rax,-0x150(%rbp)
mov    -0x150(%rbp),%rax
mov    %rax,-0x180(%rbp)
lea    -0x140(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,%ecx
mov    -0x180(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x158(%rbp)
lea    -0x140(%rbp),%rdi
mov    $0xa,%esi
call   1060 <strchr@plt>
cmp    $0x0,%rax
je     1325 <app_netconf_item_set+0x155>
lea    -0x140(%rbp),%rdi
mov    $0xa,%esi
call   1060 <strchr@plt>
movb   $0x0,(%rax)
jmp    132a <app_netconf_item_set+0x15a>
mov    -0x150(%rbp),%rcx
xor    %eax,%eax
cmp    -0x158(%rbp),%rcx
mov    %al,-0x181(%rbp)
jae    1362 <app_netconf_item_set+0x192>
mov    -0x150(%rbp),%rax
movsbl (%rax),%edi
call   1090 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x181(%rbp)
mov    -0x181(%rbp),%al
test   $0x1,%al
jne    1375 <app_netconf_item_set+0x1a5>
jmp    138c <app_netconf_item_set+0x1bc>
mov    -0x150(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x150(%rbp)
jmp    132a <app_netconf_item_set+0x15a>
mov    -0x158(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x158(%rbp)
mov    -0x158(%rbp),%rcx
xor    %eax,%eax
cmp    -0x150(%rbp),%rcx
mov    %al,-0x182(%rbp)
jbe    13d6 <app_netconf_item_set+0x206>
mov    -0x158(%rbp),%rax
movsbl (%rax),%edi
call   1090 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x182(%rbp)
mov    -0x182(%rbp),%al
test   $0x1,%al
jne    13e9 <app_netconf_item_set+0x219>
jmp    140a <app_netconf_item_set+0x23a>
mov    -0x158(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x158(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x158(%rbp)
jmp    139e <app_netconf_item_set+0x1ce>
lea    -0x140(%rbp),%rdi
mov    -0x150(%rbp),%rsi
call   1030 <strcpy@plt>
movsbl -0x140(%rbp),%eax
cmp    $0x23,%eax
je     16d1 <app_netconf_item_set+0x501>
movsbl -0x140(%rbp),%eax
cmp    $0x0,%eax
je     16d1 <app_netconf_item_set+0x501>
movb   $0x0,-0x80(%rbp)
movb   $0x0,-0xe0(%rbp)
lea    -0x140(%rbp),%rdi
mov    $0x3d,%esi
call   1060 <strchr@plt>
cmp    $0x0,%rax
jne    14a0 <app_netconf_item_set+0x2d0>
mov    0x2b76(%rip),%rax
mov    (%rax),%rdi
lea    -0x140(%rbp),%rdx
lea    0xbb4(%rip),%rsi
mov    $0x0,%al
call   10d0 <fprintf@plt>
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x28(%rbp),%rdi
call   1040 <fclose@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    18e1 <app_netconf_item_set+0x711>
lea    -0xe0(%rbp),%rax
mov    %rax,-0x190(%rbp)
lea    -0x140(%rbp),%rdi
mov    $0x3d,%esi
call   1060 <strchr@plt>
mov    -0x190(%rbp),%rdi
mov    %rax,%rsi
add    $0x1,%rsi
call   1030 <strcpy@plt>
lea    -0xe0(%rbp),%rdi
mov    $0xa,%esi
call   1060 <strchr@plt>
cmp    $0x0,%rax
je     1501 <app_netconf_item_set+0x331>
lea    -0xe0(%rbp),%rdi
mov    $0xa,%esi
call   1060 <strchr@plt>
movb   $0x0,(%rax)
lea    -0x80(%rbp),%rdi
lea    -0x140(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x80(%rbp),%rdi
mov    $0x3d,%esi
call   1060 <strchr@plt>
movb   $0x0,(%rax)
movsbl -0x80(%rbp),%eax
cmp    $0x0,%eax
je     16b3 <app_netconf_item_set+0x4e3>
lea    -0x80(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   10c0 <strcmp@plt>
cmp    $0x0,%rax
jne    1560 <app_netconf_item_set+0x390>
lea    -0xe0(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
movl   $0x1,-0x144(%rbp)
lea    -0xe0(%rbp),%rax
mov    %rax,-0x160(%rbp)
mov    -0x160(%rbp),%rax
mov    %rax,-0x198(%rbp)
lea    -0xe0(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,%ecx
mov    -0x198(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x168(%rbp)
mov    -0x160(%rbp),%rcx
xor    %eax,%eax
cmp    -0x168(%rbp),%rcx
mov    %al,-0x199(%rbp)
jae    15d6 <app_netconf_item_set+0x406>
mov    -0x160(%rbp),%rax
movsbl (%rax),%edi
call   1090 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x199(%rbp)
mov    -0x199(%rbp),%al
test   $0x1,%al
jne    15e9 <app_netconf_item_set+0x419>
jmp    1600 <app_netconf_item_set+0x430>
mov    -0x160(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x160(%rbp)
jmp    159e <app_netconf_item_set+0x3ce>
mov    -0x168(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x168(%rbp)
mov    -0x168(%rbp),%rcx
xor    %eax,%eax
cmp    -0x160(%rbp),%rcx
mov    %al,-0x19a(%rbp)
jbe    164a <app_netconf_item_set+0x47a>
mov    -0x168(%rbp),%rax
movsbl (%rax),%edi
call   1090 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x19a(%rbp)
mov    -0x19a(%rbp),%al
test   $0x1,%al
jne    165d <app_netconf_item_set+0x48d>
jmp    167e <app_netconf_item_set+0x4ae>
mov    -0x168(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x168(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x168(%rbp)
jmp    1612 <app_netconf_item_set+0x442>
lea    -0xe0(%rbp),%rdi
mov    -0x160(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x28(%rbp),%rdi
lea    -0x80(%rbp),%rdx
lea    -0xe0(%rbp),%rcx
lea    0x99b(%rip),%rsi
mov    $0x0,%al
call   10d0 <fprintf@plt>
jmp    16cc <app_netconf_item_set+0x4fc>
mov    -0x28(%rbp),%rdi
lea    -0x140(%rbp),%rdx
lea    0x980(%rip),%rsi
mov    $0x0,%al
call   10d0 <fprintf@plt>
jmp    16ea <app_netconf_item_set+0x51a>
mov    -0x28(%rbp),%rdi
lea    -0x140(%rbp),%rdx
lea    0x962(%rip),%rsi
mov    $0x0,%al
call   10d0 <fprintf@plt>
jmp    1299 <app_netconf_item_set+0xc9>
cmpl   $0x0,-0x144(%rbp)
jne    1831 <app_netconf_item_set+0x661>
mov    -0x10(%rbp),%rax
mov    %rax,-0x170(%rbp)
mov    -0x170(%rbp),%rax
mov    %rax,-0x1a8(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,%ecx
mov    -0x1a8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x178(%rbp)
mov    -0x170(%rbp),%rcx
xor    %eax,%eax
cmp    -0x178(%rbp),%rcx
mov    %al,-0x1a9(%rbp)
jae    176c <app_netconf_item_set+0x59c>
mov    -0x170(%rbp),%rax
movsbl (%rax),%edi
call   1090 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x1a9(%rbp)
mov    -0x1a9(%rbp),%al
test   $0x1,%al
jne    177f <app_netconf_item_set+0x5af>
jmp    1796 <app_netconf_item_set+0x5c6>
mov    -0x170(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x170(%rbp)
jmp    1734 <app_netconf_item_set+0x564>
mov    -0x178(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x178(%rbp)
mov    -0x178(%rbp),%rcx
xor    %eax,%eax
cmp    -0x170(%rbp),%rcx
mov    %al,-0x1aa(%rbp)
jbe    17e0 <app_netconf_item_set+0x610>
mov    -0x178(%rbp),%rax
movsbl (%rax),%edi
call   1090 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x1aa(%rbp)
mov    -0x1aa(%rbp),%al
test   $0x1,%al
jne    17f3 <app_netconf_item_set+0x623>
jmp    1814 <app_netconf_item_set+0x644>
mov    -0x178(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x178(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x178(%rbp)
jmp    17a8 <app_netconf_item_set+0x5d8>
mov    -0x28(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x170(%rbp),%rcx
lea    0x818(%rip),%rsi
mov    $0x0,%al
call   10d0 <fprintf@plt>
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x28(%rbp),%rdi
call   1070 <rewind@plt>
lea    0x7b6(%rip),%rdi
lea    0x7f8(%rip),%rsi
call   10e0 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1886 <app_netconf_item_set+0x6b6>
lea    0x794(%rip),%rdi
call   10f0 <perror@plt>
mov    -0x28(%rbp),%rdi
call   1040 <fclose@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    18e1 <app_netconf_item_set+0x711>
jmp    188b <app_netconf_item_set+0x6bb>
lea    -0x140(%rbp),%rdi
mov    -0x28(%rbp),%rdx
mov    $0x51,%esi
call   10a0 <fgets@plt>
cmp    $0x0,%rax
je     18c8 <app_netconf_item_set+0x6f8>
mov    -0x20(%rbp),%rdi
lea    -0x140(%rbp),%rdx
lea    0x78f(%rip),%rsi
mov    $0x0,%al
call   10d0 <fprintf@plt>
jmp    188b <app_netconf_item_set+0x6bb>
mov    -0x28(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<app_netconf_item_set>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x138,%rsp
mov    %rsi,0x18(%rsp)
mov    %rdi,%r13
xorps  %xmm0,%xmm0
movaps %xmm0,0x120(%rsp)
movaps %xmm0,0x110(%rsp)
movaps %xmm0,0x100(%rsp)
movaps %xmm0,0xf0(%rsp)
movaps %xmm0,0xe0(%rsp)
movb   $0x0,0x130(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movb   $0x0,0x70(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movb   $0x0,0xd0(%rsp)
lea    0xd8f(%rip),%rdi
lea    0xda6(%rip),%rsi
call   10e0 <fopen@plt>
test   %rax,%rax
je     1643 <app_netconf_item_set+0x473>
mov    %rax,%rbp
xor    %eax,%eax
call   10b0 <tmpfile@plt>
test   %rax,%rax
je     1651 <app_netconf_item_set+0x481>
mov    %rax,0x8(%rsp)
lea    0x80(%rsp),%r14
mov    %r14,%rdi
mov    $0x51,%esi
mov    %rbp,%rdx
call   10a0 <fgets@plt>
test   %rax,%rax
je     1505 <app_netconf_item_set+0x335>
lea    0xe0(%rsp),%rbx
movl   $0x0,0x14(%rsp)
jmp    1312 <app_netconf_item_set+0x142>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    0x8(%rsp),%rdi
lea    0xd59(%rip),%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   10d0 <fprintf@plt>
mov    %r12,%rbx
mov    %r14,%rdi
mov    $0x51,%esi
mov    %rbp,%rdx
call   10a0 <fgets@plt>
test   %rax,%rax
je     14fa <app_netconf_item_set+0x32a>
mov    %rbx,%r12
mov    %r14,%rdi
call   1050 <strlen@plt>
mov    %eax,%ebx
mov    %r14,%rdi
mov    $0xa,%esi
call   1060 <strchr@plt>
test   %rax,%rax
je     1334 <app_netconf_item_set+0x164>
movb   $0x0,(%rax)
movslq %ebx,%rax
lea    (%rsp,%rax,1),%r15
add    $0x80,%r15
mov    %r14,%rbx
test   %eax,%eax
jle    1374 <app_netconf_item_set+0x1a4>
mov    %r14,%rbx
nopl   0x0(%rax)
movsbl (%rbx),%edi
call   1090 <isspace@plt>
test   %rax,%rax
je     1374 <app_netconf_item_set+0x1a4>
add    $0x1,%rbx
cmp    %r15,%rbx
jb     1350 <app_netconf_item_set+0x180>
jmp    1374 <app_netconf_item_set+0x1a4>
nopl   0x0(%rax,%rax,1)
movb   $0x0,(%r15)
add    $0xffffffffffffffff,%r15
cmp    %rbx,%r15
jbe    138b <app_netconf_item_set+0x1bb>
movsbl (%r15),%edi
call   1090 <isspace@plt>
test   %rax,%rax
jne    1370 <app_netconf_item_set+0x1a0>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    0x80(%rsp),%al
test   %al,%al
je     12e0 <app_netconf_item_set+0x110>
cmp    $0x23,%al
je     12e0 <app_netconf_item_set+0x110>
movb   $0x0,0xe0(%rsp)
movb   $0x0,0x20(%rsp)
mov    %r14,%rdi
mov    $0x3d,%esi
call   1060 <strchr@plt>
test   %rax,%rax
je     1614 <app_netconf_item_set+0x444>
add    $0x1,%rax
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1060 <strchr@plt>
test   %rax,%rax
je     13f9 <app_netconf_item_set+0x229>
movb   $0x0,(%rax)
mov    %r12,%rbx
mov    %r12,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %r12,%rdi
mov    $0x3d,%esi
call   1060 <strchr@plt>
movb   $0x0,(%rax)
cmpb   $0x0,0xe0(%rsp)
je     14df <app_netconf_item_set+0x30f>
mov    %rbp,%r15
mov    %rbx,%rdi
mov    0x18(%rsp),%rsi
call   10c0 <strcmp@plt>
test   %rax,%rax
jne    144f <app_netconf_item_set+0x27f>
lea    0x20(%rsp),%rdi
mov    %r13,%rsi
call   1030 <strcpy@plt>
movl   $0x1,0x14(%rsp)
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <strlen@plt>
cltq
lea    (%rsp,%rax,1),%rbp
add    $0x20,%rbp
test   %eax,%eax
jle    1494 <app_netconf_item_set+0x2c4>
lea    0x20(%rsp),%rbx
nop
movsbl (%rbx),%edi
call   1090 <isspace@plt>
test   %rax,%rax
je     1494 <app_netconf_item_set+0x2c4>
add    $0x1,%rbx
cmp    %rbp,%rbx
jb     1470 <app_netconf_item_set+0x2a0>
jmp    1494 <app_netconf_item_set+0x2c4>
nopl   0x0(%rax,%rax,1)
movb   $0x0,0x0(%rbp)
add    $0xffffffffffffffff,%rbp
cmp    %rbx,%rbp
jbe    14ab <app_netconf_item_set+0x2db>
movsbl 0x0(%rbp),%edi
call   1090 <isspace@plt>
test   %rax,%rax
jne    1490 <app_netconf_item_set+0x2c0>
lea    0x20(%rsp),%rbp
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    0x8(%rsp),%rdi
lea    0xb7b(%rip),%rsi
mov    %r12,%rbx
mov    %r12,%rdx
mov    %rbp,%rcx
xor    %eax,%eax
call   10d0 <fprintf@plt>
mov    %r15,%rbp
jmp    12f9 <app_netconf_item_set+0x129>
mov    0x8(%rsp),%rdi
lea    0xb5a(%rip),%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   10d0 <fprintf@plt>
jmp    12f9 <app_netconf_item_set+0x129>
cmpl   $0x0,0x14(%rsp)
jne    1582 <app_netconf_item_set+0x3b2>
mov    %r13,%rdi
call   1050 <strlen@plt>
cltq
lea    (%rax,%r13,1),%rbx
test   %eax,%eax
jle    153a <app_netconf_item_set+0x36a>
mov    0x8(%rsp),%r14
nopl   0x0(%rax)
movsbl 0x0(%r13),%edi
call   1090 <isspace@plt>
test   %rax,%rax
je     1560 <app_netconf_item_set+0x390>
add    $0x1,%r13
cmp    %rbx,%r13
jb     1520 <app_netconf_item_set+0x350>
jmp    1560 <app_netconf_item_set+0x390>
mov    0x8(%rsp),%r14
jmp    1560 <app_netconf_item_set+0x390>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl (%rbx),%edi
call   1090 <isspace@plt>
test   %rax,%rax
je     1569 <app_netconf_item_set+0x399>
movb   $0x0,(%rbx)
add    $0xffffffffffffffff,%rbx
cmp    %r13,%rbx
ja     1550 <app_netconf_item_set+0x380>
lea    0xad2(%rip),%rsi
mov    %r14,%rdi
mov    0x18(%rsp),%rdx
mov    %r13,%rcx
xor    %eax,%eax
call   10d0 <fprintf@plt>
mov    %rbp,%rdi
call   1040 <fclose@plt>
mov    0x8(%rsp),%r14
mov    %r14,%rdi
call   1070 <rewind@plt>
lea    0xa62(%rip),%rdi
lea    0xaa4(%rip),%rsi
call   10e0 <fopen@plt>
test   %rax,%rax
je     166c <app_netconf_item_set+0x49c>
mov    %rax,%rbx
lea    0x80(%rsp),%rdi
mov    $0x51,%esi
mov    %r14,%rdx
call   10a0 <fgets@plt>
test   %rax,%rax
je     1600 <app_netconf_item_set+0x430>
lea    0x80(%rsp),%rbp
nopl   0x0(%rax,%rax,1)
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1080 <fputs@plt>
mov    %rbp,%rdi
mov    $0x51,%esi
mov    %r14,%rdx
call   10a0 <fgets@plt>
test   %rax,%rax
jne    15e0 <app_netconf_item_set+0x410>
mov    %r14,%rdi
call   1040 <fclose@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
jmp    1685 <app_netconf_item_set+0x4b5>
mov    0x29c5(%rip),%rax
mov    (%rax),%rdi
lea    0xa0a(%rip),%rsi
lea    0x80(%rsp),%rdx
xor    %eax,%eax
call   10d0 <fprintf@plt>
mov    %rbp,%rdi
call   1040 <fclose@plt>
mov    0x8(%rsp),%rdi
jmp    167b <app_netconf_item_set+0x4ab>
lea    0x9b6(%rip),%rdi
call   10f0 <perror@plt>
jmp    1680 <app_netconf_item_set+0x4b0>
lea    0x9c8(%rip),%rdi
call   10f0 <perror@plt>
mov    %rbp,%rdi
call   1040 <fclose@plt>
mov    $0xfffffffe,%eax
jmp    1685 <app_netconf_item_set+0x4b5>
lea    0x98d(%rip),%rdi
call   10f0 <perror@plt>
mov    %r14,%rdi
call   1040 <fclose@plt>
mov    $0xffffffff,%eax
add    $0x138,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [30 x i8] c"/local/etc/sysconfig/net.conf\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [15 x i8] c"temporary file\00"
@stderr = global i32* null
@.str.3 = [19 x i8] c"WRONG FORMAT '%s'\0A\00"
@.str.4 = [7 x i8] c"%s=%s\0A\00"
@.str.5 = [4 x i8] c"%s\0A\00"
@.str.6 = [2 x i8] c"w\00"
@.str.7 = [3 x i8] c"%s\00"
define i32 @app_netconf_item_set(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca [81 x i8]
%9 = alloca [81 x i8]
%10 = alloca [81 x i8]
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i8*
%16 = alloca i8*
%17 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%18 = bitcast [81 x i8]* %8 to i8*
%19 = bitcast [81 x i8]* %9 to i8*
%20 = bitcast [81 x i8]* %10 to i8*
store i32 0, i32* %11
%21 = call i32* @fopen(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %21, i32** %6
%22 = load i32*, i32** %6
%23 = icmp eq i32* %22, null
br i1 %23, label %24, label %26
24: ; preds = %2
%25 = call i32 @perror(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %275
26: ; preds = %2
%27 = call i32* (...) @tmpfile()
store i32* %27, i32** %7
%28 = load i32*, i32** %7
%29 = icmp ne i32* %28, null
br i1 %29, label %34, label %30
30: ; preds = %26
%31 = call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%32 = load i32*, i32** %6
%33 = call i32 @fclose(i32* %32)
store i32 -2, i32* %3
br label %275
34: ; preds = %26
br label %35
35: ; preds = %200, %34
%36 = getelementptr inbounds [81 x i8], [81 x i8]* %10, i64 0, i64 0
%37 = load i32*, i32** %6
%38 = call i32* @fgets(i8* %36, i32 81, i32* %37)
%39 = icmp ne i32* %38, null
br i1 %39, label %40, label %201
40: ; preds = %35
%41 = getelementptr inbounds [81 x i8], [81 x i8]* %10, i64 0, i64 0
store i8* %41, i8** %12
%42 = load i8*, i8** %12
%43 = getelementptr inbounds [81 x i8], [81 x i8]* %10, i64 0, i64 0
%44 = call i32 @strlen(i8* %43)
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds i8, i8* %42, i64 %45
store i8* %46, i8** %13
%47 = getelementptr inbounds [81 x i8], [81 x i8]* %10, i64 0, i64 0
%48 = call i8* @strchr(i8* %47, i8 signext 10)
%49 = icmp ne i8* %48, null
br i1 %49, label %50, label %53
50: ; preds = %40
%51 = getelementptr inbounds [81 x i8], [81 x i8]* %10, i64 0, i64 0
%52 = call i8* @strchr(i8* %51, i8 signext 10)
store i8 0, i8* %52
br label %53
53: ; preds = %50, %40
br label %54
54: ; preds = %65, %53
%55 = load i8*, i8** %12
%56 = load i8*, i8** %13
%57 = icmp ult i8* %55, %56
br i1 %57, label %58, label %63
58: ; preds = %54
%59 = load i8*, i8** %12
%60 = load i8, i8* %59
%61 = call i64 @isspace(i8 signext %60)
%62 = icmp ne i64 %61, 0
br label %63
63: ; preds = %58, %54
%64 = phi i1 [ false, %54 ], [ %62, %58 ]
br i1 %64, label %65, label %68
65: ; preds = %63
%66 = load i8*, i8** %12
%67 = getelementptr inbounds i8, i8* %66, i32 1
store i8* %67, i8** %12
br label %54
68: ; preds = %63
%69 = load i8*, i8** %13
%70 = getelementptr inbounds i8, i8* %69, i32 -1
store i8* %70, i8** %13
br label %71
71: ; preds = %82, %68
%72 = load i8*, i8** %13
%73 = load i8*, i8** %12
%74 = icmp ugt i8* %72, %73
br i1 %74, label %75, label %80
75: ; preds = %71
%76 = load i8*, i8** %13
%77 = load i8, i8* %76
%78 = call i64 @isspace(i8 signext %77)
%79 = icmp ne i64 %78, 0
br label %80
80: ; preds = %75, %71
%81 = phi i1 [ false, %71 ], [ %79, %75 ]
br i1 %81, label %82, label %86
82: ; preds = %80
%83 = load i8*, i8** %13
store i8 0, i8* %83
%84 = load i8*, i8** %13
%85 = getelementptr inbounds i8, i8* %84, i32 -1
store i8* %85, i8** %13
br label %71
86: ; preds = %80
%87 = getelementptr inbounds [81 x i8], [81 x i8]* %10, i64 0, i64 0
%88 = load i8*, i8** %12
%89 = call i32 @strcpy(i8* %87, i8* %88)
%90 = getelementptr inbounds [81 x i8], [81 x i8]* %10, i64 0, i64 0
%91 = load i8, i8* %90
%92 = sext i8 %91 to i32
%93 = icmp ne i32 %92, 35
br i1 %93, label %94, label %196
94: ; preds = %86
%95 = getelementptr inbounds [81 x i8], [81 x i8]* %10, i64 0, i64 0
%96 = load i8, i8* %95
%97 = sext i8 %96 to i32
%98 = icmp ne i32 %97, 0
br i1 %98, label %99, label %196
99: ; preds = %94
%100 = getelementptr inbounds [81 x i8], [81 x i8]* %8, i64 0, i64 0
store i8 0, i8* %100
%101 = getelementptr inbounds [81 x i8], [81 x i8]* %9, i64 0, i64 0
store i8 0, i8* %101
%102 = getelementptr inbounds [81 x i8], [81 x i8]* %10, i64 0, i64 0
%103 = call i8* @strchr(i8* %102, i8 signext 61)
%104 = icmp eq i8* %103, null
br i1 %104, label %105, label %113
105: ; preds = %99
%106 = load i32*, i32** @stderr
%107 = getelementptr inbounds [81 x i8], [81 x i8]* %10, i64 0, i64 0
%108 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %106, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i8* %107)
%109 = load i32*, i32** %6
%110 = call i32 @fclose(i32* %109)
%111 = load i32*, i32** %7
%112 = call i32 @fclose(i32* %111)
store i32 -1, i32* %3
br label %275
113: ; preds = %99
%114 = getelementptr inbounds [81 x i8], [81 x i8]* %9, i64 0, i64 0
%115 = getelementptr inbounds [81 x i8], [81 x i8]* %10, i64 0, i64 0
%116 = call i8* @strchr(i8* %115, i8 signext 61)
%117 = getelementptr inbounds i8, i8* %116, i64 1
%118 = call i32 @strcpy(i8* %114, i8* %117)
%119 = getelementptr inbounds [81 x i8], [81 x i8]* %9, i64 0, i64 0
%120 = call i8* @strchr(i8* %119, i8 signext 10)
%121 = icmp ne i8* %120, null
br i1 %121, label %122, label %125
122: ; preds = %113
%123 = getelementptr inbounds [81 x i8], [81 x i8]* %9, i64 0, i64 0
%124 = call i8* @strchr(i8* %123, i8 signext 10)
store i8 0, i8* %124
br label %125
125: ; preds = %122, %113
%126 = getelementptr inbounds [81 x i8], [81 x i8]* %8, i64 0, i64 0
%127 = getelementptr inbounds [81 x i8], [81 x i8]* %10, i64 0, i64 0
%128 = call i32 @strcpy(i8* %126, i8* %127)
%129 = getelementptr inbounds [81 x i8], [81 x i8]* %8, i64 0, i64 0
%130 = call i8* @strchr(i8* %129, i8 signext 61)
store i8 0, i8* %130
%131 = getelementptr inbounds [81 x i8], [81 x i8]* %8, i64 0, i64 0
%132 = load i8, i8* %131
%133 = sext i8 %132 to i32
%134 = icmp ne i32 %133, 0
br i1 %134, label %135, label %191
135: ; preds = %125
%136 = getelementptr inbounds [81 x i8], [81 x i8]* %8, i64 0, i64 0
%137 = load i8*, i8** %5
%138 = call i64 @strcmp(i8* %136, i8* %137)
%139 = icmp eq i64 %138, 0
br i1 %139, label %140, label %144
140: ; preds = %135
%141 = getelementptr inbounds [81 x i8], [81 x i8]* %9, i64 0, i64 0
%142 = load i8*, i8** %4
%143 = call i32 @strcpy(i8* %141, i8* %142)
store i32 1, i32* %11
br label %144
144: ; preds = %140, %135
%145 = getelementptr inbounds [81 x i8], [81 x i8]* %9, i64 0, i64 0
store i8* %145, i8** %14
%146 = load i8*, i8** %14
%147 = getelementptr inbounds [81 x i8], [81 x i8]* %9, i64 0, i64 0
%148 = call i32 @strlen(i8* %147)
%149 = sext i32 %148 to i64
%150 = getelementptr inbounds i8, i8* %146, i64 %149
store i8* %150, i8** %15
br label %151
151: ; preds = %162, %144
%152 = load i8*, i8** %14
%153 = load i8*, i8** %15
%154 = icmp ult i8* %152, %153
br i1 %154, label %155, label %160
155: ; preds = %151
%156 = load i8*, i8** %14
%157 = load i8, i8* %156
%158 = call i64 @isspace(i8 signext %157)
%159 = icmp ne i64 %158, 0
br label %160
160: ; preds = %155, %151
%161 = phi i1 [ false, %151 ], [ %159, %155 ]
br i1 %161, label %162, label %165
162: ; preds = %160
%163 = load i8*, i8** %14
%164 = getelementptr inbounds i8, i8* %163, i32 1
store i8* %164, i8** %14
br label %151
165: ; preds = %160
%166 = load i8*, i8** %15
%167 = getelementptr inbounds i8, i8* %166, i32 -1
store i8* %167, i8** %15
br label %168
168: ; preds = %179, %165
%169 = load i8*, i8** %15
%170 = load i8*, i8** %14
%171 = icmp ugt i8* %169, %170
br i1 %171, label %172, label %177
172: ; preds = %168
%173 = load i8*, i8** %15
%174 = load i8, i8* %173
%175 = call i64 @isspace(i8 signext %174)
%176 = icmp ne i64 %175, 0
br label %177
177: ; preds = %172, %168
%178 = phi i1 [ false, %168 ], [ %176, %172 ]
br i1 %178, label %179, label %183
179: ; preds = %177
%180 = load i8*, i8** %15
store i8 0, i8* %180
%181 = load i8*, i8** %15
%182 = getelementptr inbounds i8, i8* %181, i32 -1
store i8* %182, i8** %15
br label %168
183: ; preds = %177
%184 = getelementptr inbounds [81 x i8], [81 x i8]* %9, i64 0, i64 0
%185 = load i8*, i8** %14
%186 = call i32 @strcpy(i8* %184, i8* %185)
%187 = load i32*, i32** %7
%188 = getelementptr inbounds [81 x i8], [81 x i8]* %8, i64 0, i64 0
%189 = getelementptr inbounds [81 x i8], [81 x i8]* %9, i64 0, i64 0
%190 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %187, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* %188, i8* %189)
br label %195
191: ; preds = %125
%192 = load i32*, i32** %7
%193 = getelementptr inbounds [81 x i8], [81 x i8]* %10, i64 0, i64 0
%194 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %192, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* %193)
br label %195
195: ; preds = %191, %183
br label %200
196: ; preds = %94, %86
%197 = load i32*, i32** %7
%198 = getelementptr inbounds [81 x i8], [81 x i8]* %10, i64 0, i64 0
%199 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %197, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* %198)
br label %200
200: ; preds = %196, %195
br label %35
201: ; preds = %35
%202 = load i32, i32* %11
%203 = icmp eq i32 %202, 0
br i1 %203, label %204, label %248
204: ; preds = %201
%205 = load i8*, i8** %4
store i8* %205, i8** %16
%206 = load i8*, i8** %16
%207 = load i8*, i8** %4
%208 = call i32 @strlen(i8* %207)
%209 = sext i32 %208 to i64
%210 = getelementptr inbounds i8, i8* %206, i64 %209
store i8* %210, i8** %17
br label %211
211: ; preds = %222, %204
%212 = load i8*, i8** %16
%213 = load i8*, i8** %17
%214 = icmp ult i8* %212, %213
br i1 %214, label %215, label %220
215: ; preds = %211
%216 = load i8*, i8** %16
%217 = load i8, i8* %216
%218 = call i64 @isspace(i8 signext %217)
%219 = icmp ne i64 %218, 0
br label %220
220: ; preds = %215, %211
%221 = phi i1 [ false, %211 ], [ %219, %215 ]
br i1 %221, label %222, label %225
222: ; preds = %220
%223 = load i8*, i8** %16
%224 = getelementptr inbounds i8, i8* %223, i32 1
store i8* %224, i8** %16
br label %211
225: ; preds = %220
%226 = load i8*, i8** %17
%227 = getelementptr inbounds i8, i8* %226, i32 -1
store i8* %227, i8** %17
br label %228
228: ; preds = %239, %225
%229 = load i8*, i8** %17
%230 = load i8*, i8** %16
%231 = icmp ugt i8* %229, %230
br i1 %231, label %232, label %237
232: ; preds = %228
%233 = load i8*, i8** %17
%234 = load i8, i8* %233
%235 = call i64 @isspace(i8 signext %234)
%236 = icmp ne i64 %235, 0
br label %237
237: ; preds = %232, %228
%238 = phi i1 [ false, %228 ], [ %236, %232 ]
br i1 %238, label %239, label %243
239: ; preds = %237
%240 = load i8*, i8** %17
store i8 0, i8* %240
%241 = load i8*, i8** %17
%242 = getelementptr inbounds i8, i8* %241, i32 -1
store i8* %242, i8** %17
br label %228
243: ; preds = %237
%244 = load i32*, i32** %7
%245 = load i8*, i8** %5
%246 = load i8*, i8** %16
%247 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %244, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* %245, i8* %246)
br label %248
248: ; preds = %243, %201
%249 = load i32*, i32** %6
%250 = call i32 @fclose(i32* %249)
%251 = load i32*, i32** %7
%252 = call i32 @rewind(i32* %251)
%253 = call i32* @fopen(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
store i32* %253, i32** %6
%254 = load i32*, i32** %6
%255 = icmp ne i32* %254, null
br i1 %255, label %260, label %256
256: ; preds = %248
%257 = call i32 @perror(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%258 = load i32*, i32** %7
%259 = call i32 @fclose(i32* %258)
store i32 -1, i32* %3
br label %275
260: ; preds = %248
br label %261
261: ; preds = %266, %260
%262 = getelementptr inbounds [81 x i8], [81 x i8]* %10, i64 0, i64 0
%263 = load i32*, i32** %7
%264 = call i32* @fgets(i8* %262, i32 81, i32* %263)
%265 = icmp ne i32* %264, null
br i1 %265, label %266, label %270
266: ; preds = %261
%267 = load i32*, i32** %6
%268 = getelementptr inbounds [81 x i8], [81 x i8]* %10, i64 0, i64 0
%269 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %267, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* %268)
br label %261
270: ; preds = %261
%271 = load i32*, i32** %7
%272 = call i32 @fclose(i32* %271)
%273 = load i32*, i32** %6
%274 = call i32 @fclose(i32* %273)
store i32 0, i32* %3
br label %275
275: ; preds = %270, %256, %105, %30, %24
%276 = load i32, i32* %3
ret i32 %276
}

LLVM IR (-O2):
@.str = [30 x i8] c"/local/etc/sysconfig/net.conf\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [15 x i8] c"temporary file\00"
@stderr = global i32* null
@.str.3 = [19 x i8] c"WRONG FORMAT '%s'\0A\00"
@.str.4 = [7 x i8] c"%s=%s\0A\00"
@.str.5 = [4 x i8] c"%s\0A\00"
@.str.6 = [2 x i8] c"w\00"
define i32 @app_netconf_item_set(i8* %0, i8* %1) {
%3 = alloca [81 x i8]
%4 = alloca [81 x i8]
%5 = alloca [81 x i8]
%6 = getelementptr inbounds [81 x i8], [81 x i8]* %3, i64 0, i64 0
%7 = getelementptr inbounds [81 x i8], [81 x i8]* %4, i64 0, i64 0
%8 = getelementptr inbounds [81 x i8], [81 x i8]* %5, i64 0, i64 0
%9 = tail call i32* @fopen(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%10 = icmp eq i32* %9, null
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = tail call i32 @perror(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
br label %163
13: ; preds = %2
%14 = tail call i32* (...) @tmpfile()
%15 = icmp eq i32* %14, null
br i1 %15, label %19, label %16
16: ; preds = %13
%17 = call i32* @fgets(i8* %8, i32 81, i32* %9)
%18 = icmp eq i32* %17, null
br i1 %18, label %118, label %22
19: ; preds = %13
%20 = tail call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%21 = tail call i32 @fclose(i32* %9)
br label %163
22: ; preds = %16, %112
%23 = phi i32 [ %113, %112 ], [ 0, %16 ]
%24 = call i32 @strlen(i8* %8)
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [81 x i8], [81 x i8]* %5, i64 0, i64 %25
%27 = call i8* @strchr(i8* %8, i8 signext 10)
%28 = icmp eq i8* %27, null
br i1 %28, label %30, label %29
29: ; preds = %22
store i8 0, i8* %27
br label %30
30: ; preds = %29, %22
%31 = icmp sgt i32 %24, 0
br i1 %31, label %32, label %40
32: ; preds = %30, %37
%33 = phi i8* [ %38, %37 ], [ %8, %30 ]
%34 = load i8, i8* %33
%35 = call i64 @isspace(i8 signext %34)
%36 = icmp eq i64 %35, 0
br i1 %36, label %40, label %37
37: ; preds = %32
%38 = getelementptr inbounds i8, i8* %33, i64 1
%39 = icmp ult i8* %38, %26
br i1 %39, label %32, label %40
40: ; preds = %32, %37, %30
%41 = phi i8* [ %8, %30 ], [ %38, %37 ], [ %33, %32 ]
%42 = getelementptr inbounds i8, i8* %26, i64 -1
%43 = icmp ugt i8* %42, %41
br i1 %43, label %44, label %52
44: ; preds = %40, %49
%45 = phi i8* [ %50, %49 ], [ %42, %40 ]
%46 = load i8, i8* %45
%47 = call i64 @isspace(i8 signext %46)
%48 = icmp eq i64 %47, 0
br i1 %48, label %52, label %49
49: ; preds = %44
store i8 0, i8* %45
%50 = getelementptr inbounds i8, i8* %45, i64 -1
%51 = icmp ugt i8* %50, %41
br i1 %51, label %44, label %52
52: ; preds = %44, %49, %40
%53 = call i32 @strcpy(i8* %8, i8* %41)
%54 = load i8, i8* %8
switch i8 %54, label %55 [
i8 35, label %110
i8 0, label %110
]
55: ; preds = %52
store i8 0, i8* %6
store i8 0, i8* %7
%56 = call i8* @strchr(i8* %8, i8 signext 61)
%57 = icmp eq i8* %56, null
br i1 %57, label %58, label %63
58: ; preds = %55
%59 = load i32*, i32** @stderr
%60 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %59, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i8* %8)
%61 = call i32 @fclose(i32* %9)
%62 = call i32 @fclose(i32* %14)
br label %163
63: ; preds = %55
%64 = getelementptr inbounds i8, i8* %56, i64 1
%65 = call i32 @strcpy(i8* %7, i8* %64)
%66 = call i8* @strchr(i8* %7, i8 signext 10)
%67 = icmp eq i8* %66, null
br i1 %67, label %69, label %68
68: ; preds = %63
store i8 0, i8* %66
br label %69
69: ; preds = %68, %63
%70 = call i32 @strcpy(i8* %6, i8* %8)
%71 = call i8* @strchr(i8* %6, i8 signext 61)
store i8 0, i8* %71
%72 = load i8, i8* %6
%73 = icmp eq i8 %72, 0
br i1 %73, label %108, label %74
74: ; preds = %69
%75 = call i64 @strcmp(i8* %6, i8* %1)
%76 = icmp eq i64 %75, 0
br i1 %76, label %77, label %79
77: ; preds = %74
%78 = call i32 @strcpy(i8* %7, i8* %0)
br label %79
79: ; preds = %77, %74
%80 = phi i32 [ 1, %77 ], [ %23, %74 ]
%81 = call i32 @strlen(i8* %7)
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds [81 x i8], [81 x i8]* %4, i64 0, i64 %82
%84 = icmp sgt i32 %81, 0
br i1 %84, label %85, label %93
85: ; preds = %79, %90
%86 = phi i8* [ %91, %90 ], [ %7, %79 ]
%87 = load i8, i8* %86
%88 = call i64 @isspace(i8 signext %87)
%89 = icmp eq i64 %88, 0
br i1 %89, label %93, label %90
90: ; preds = %85
%91 = getelementptr inbounds i8, i8* %86, i64 1
%92 = icmp ult i8* %91, %83
br i1 %92, label %85, label %93
93: ; preds = %85, %90, %79
%94 = phi i8* [ %7, %79 ], [ %91, %90 ], [ %86, %85 ]
%95 = getelementptr inbounds i8, i8* %83, i64 -1
%96 = icmp ugt i8* %95, %94
br i1 %96, label %97, label %105
97: ; preds = %93, %102
%98 = phi i8* [ %103, %102 ], [ %95, %93 ]
%99 = load i8, i8* %98
%100 = call i64 @isspace(i8 signext %99)
%101 = icmp eq i64 %100, 0
br i1 %101, label %105, label %102
102: ; preds = %97
store i8 0, i8* %98
%103 = getelementptr inbounds i8, i8* %98, i64 -1
%104 = icmp ugt i8* %103, %94
br i1 %104, label %97, label %105
105: ; preds = %97, %102, %93
%106 = call i32 @strcpy(i8* %7, i8* %94)
%107 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %14, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* %6, i8* %7)
br label %112
108: ; preds = %69
%109 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %14, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* %8)
br label %112
110: ; preds = %52, %52
%111 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %14, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* %8)
br label %112
112: ; preds = %110, %108, %105
%113 = phi i32 [ %80, %105 ], [ %23, %108 ], [ %23, %110 ]
%114 = call i32* @fgets(i8* %8, i32 81, i32* %9)
%115 = icmp eq i32* %114, null
br i1 %115, label %116, label %22
116: ; preds = %112
%117 = icmp eq i32 %113, 0
br i1 %117, label %118, label %145
118: ; preds = %16, %116
%119 = call i32 @strlen(i8* %0)
%120 = sext i32 %119 to i64
%121 = getelementptr inbounds i8, i8* %0, i64 %120
%122 = icmp sgt i32 %119, 0
br i1 %122, label %123, label %131
123: ; preds = %118, %128
%124 = phi i8* [ %129, %128 ], [ %0, %118 ]
%125 = load i8, i8* %124
%126 = call i64 @isspace(i8 signext %125)
%127 = icmp eq i64 %126, 0
br i1 %127, label %131, label %128
128: ; preds = %123
%129 = getelementptr inbounds i8, i8* %124, i64 1
%130 = icmp ult i8* %129, %121
br i1 %130, label %123, label %131
131: ; preds = %123, %128, %118
%132 = phi i8* [ %0, %118 ], [ %129, %128 ], [ %124, %123 ]
%133 = getelementptr inbounds i8, i8* %121, i64 -1
%134 = icmp ugt i8* %133, %132
br i1 %134, label %135, label %143
135: ; preds = %131, %140
%136 = phi i8* [ %141, %140 ], [ %133, %131 ]
%137 = load i8, i8* %136
%138 = call i64 @isspace(i8 signext %137)
%139 = icmp eq i64 %138, 0
br i1 %139, label %143, label %140
140: ; preds = %135
store i8 0, i8* %136
%141 = getelementptr inbounds i8, i8* %136, i64 -1
%142 = icmp ugt i8* %141, %132
br i1 %142, label %135, label %143
143: ; preds = %135, %140, %131
%144 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %14, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* %1, i8* %132)
br label %145
145: ; preds = %143, %116
%146 = call i32 @fclose(i32* %9)
%147 = call i32 @rewind(i32* %14)
%148 = call i32* @fopen(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%149 = icmp eq i32* %148, null
br i1 %149, label %153, label %150
150: ; preds = %145
%151 = call i32* @fgets(i8* %8, i32 81, i32* %14)
%152 = icmp eq i32* %151, null
br i1 %152, label %160, label %156
153: ; preds = %145
%154 = call i32 @perror(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%155 = call i32 @fclose(i32* %14)
br label %163
156: ; preds = %150, %156
%157 = call i32 @fputs(i8* %8, i32* %148)
%158 = call i32* @fgets(i8* %8, i32 81, i32* %14)
%159 = icmp eq i32* %158, null
br i1 %159, label %160, label %156
160: ; preds = %156, %150
%161 = call i32 @fclose(i32* %14)
%162 = call i32 @fclose(i32* %148)
br label %163
163: ; preds = %58, %160, %153, %19, %11
%164 = phi i32 [ -1, %11 ], [ 0, %160 ], [ -1, %153 ], [ -2, %19 ], [ -1, %58 ]
ret i32 %164
}