#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 scalar_t__ pid_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int STDOUT_FILENO;
scalar_t__ WEXITSTATUS(int);
int /*<<< orphan*/ WIFEXITED(int);
int /*<<< orphan*/ WUNTRACED;
int /*<<< orphan*/ abort();
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ dup2(int, int);
int /*<<< orphan*/ execlp(char *, char *, char *, char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fdopen(int, char *);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
scalar_t__ fork();
int /*<<< orphan*/ free(char *);
char *malloc(int);
int /*<<< orphan*/ perror(char *);
scalar_t__ pipe(int *);
char *realloc(char *, int);
int strlen(char *);
int /*<<< orphan*/ waitpid(scalar_t__, int *, int /*<<< orphan*/);
char *config_ini_spawn(char *command) {
  int read_write[2];
  pid_t pid;
  if (pipe(read_write)) {
    perror("pipe");
    return NULL;
  }
  pid = fork();
  if (pid == (pid_t)-1) {
    perror("fork");
    close(read_write[0]);
    close(read_write[1]);
    return NULL;
  }
  if (pid) {
    char *output = NULL;
    int status;
    FILE *ch;
    waitpid(pid, &status, WUNTRACED);
    if (!WIFEXITED(status) || WEXITSTATUS(status)) {
      close(read_write[0]);
      close(read_write[1]);
      return NULL;
    }
    if ((ch = fdopen(read_write[0], "r")) != NULL) {
      int size = 128;
      output = malloc(size * sizeof(char));
      if (output == NULL)
        perror("malloc");
      *output = '\n';
      while (output != NULL) {
        if (fgets(output, size, ch) == NULL || *output == '\n') {
          free(output);
          output = NULL;
        } else if (output[strlen(output) - 1] != '\n') {
          output = realloc(output, (size <<= 1) * sizeof(char));
          if (output == NULL)
            perror("malloc");
        } else {
          output[strlen(output) - 1] = '\0';
          break;
        }
      }
    }
    if (ch)
      fclose(ch);
    close(read_write[0]);
    close(read_write[1]);
    return output;
  } else {
    if (read_write[1] != STDOUT_FILENO) {
      close(STDOUT_FILENO);
      dup2(read_write[1], STDOUT_FILENO);
    }
    execlp("sh", "sh", "-c", command, NULL);
    perror("execlp");
    abort();
  }
  return NULL;
}


x86 assembly (clang, -O0):
<config_ini_spawn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
call   1090 <pipe@plt>
cmp    $0x0,%rax
je     1248 <config_ini_spawn+0x38>
lea    0xdca(%rip),%rdi
call   1100 <perror@plt>
movq   $0x0,-0x8(%rbp)
jmp    14bd <config_ini_spawn+0x2ad>
mov    $0x0,%al
call   1130 <fork@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0xffffffffffffffff,-0x20(%rbp)
jne    1287 <config_ini_spawn+0x77>
lea    0xda0(%rip),%rdi
call   1100 <perror@plt>
mov    -0x18(%rbp),%edi
call   1080 <close@plt>
mov    -0x14(%rbp),%edi
call   1080 <close@plt>
movq   $0x0,-0x8(%rbp)
jmp    14bd <config_ini_spawn+0x2ad>
cmpq   $0x0,-0x20(%rbp)
je     145a <config_ini_spawn+0x24a>
movq   $0x0,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
mov    0x2d33(%rip),%rax
mov    (%rax),%edx
lea    -0x2c(%rbp),%rsi
call   10f0 <waitpid@plt>
mov    -0x2c(%rbp),%edi
call   1110 <WIFEXITED@plt>
cmp    $0x0,%eax
je     12d3 <config_ini_spawn+0xc3>
mov    -0x2c(%rbp),%edi
call   10e0 <WEXITSTATUS@plt>
cmp    $0x0,%rax
je     12f0 <config_ini_spawn+0xe0>
mov    -0x18(%rbp),%edi
call   1080 <close@plt>
mov    -0x14(%rbp),%edi
call   1080 <close@plt>
movq   $0x0,-0x8(%rbp)
jmp    14bd <config_ini_spawn+0x2ad>
mov    -0x18(%rbp),%edi
lea    0xd10(%rip),%rsi
call   10d0 <fdopen@plt>
mov    %rax,-0x38(%rbp)
cmp    $0x0,%rax
je     1429 <config_ini_spawn+0x219>
movl   $0x80,-0x3c(%rbp)
movslq -0x3c(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   10b0 <malloc@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    133e <config_ini_spawn+0x12e>
lea    0xcd3(%rip),%rdi
call   1100 <perror@plt>
mov    -0x28(%rbp),%rax
movb   $0xa,(%rax)
cmpq   $0x0,-0x28(%rbp)
je     1424 <config_ini_spawn+0x214>
mov    -0x28(%rbp),%rdi
mov    -0x3c(%rbp),%esi
mov    -0x38(%rbp),%rdx
call   10a0 <fgets@plt>
cmp    $0x0,%rax
je     137a <config_ini_spawn+0x16a>
mov    -0x28(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    1390 <config_ini_spawn+0x180>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x28(%rbp)
jmp    141f <config_ini_spawn+0x20f>
mov    -0x28(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x28(%rbp),%rdi
call   1060 <strlen@plt>
mov    %eax,%ecx
mov    -0x48(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
je     13f4 <config_ini_spawn+0x1e4>
mov    -0x28(%rbp),%rdi
mov    -0x3c(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x3c(%rbp)
cltq
shl    $0x0,%rax
mov    %eax,%esi
call   10c0 <realloc@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    13ef <config_ini_spawn+0x1df>
lea    0xc22(%rip),%rdi
call   1100 <perror@plt>
jmp    141a <config_ini_spawn+0x20a>
mov    -0x28(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x28(%rbp),%rdi
call   1060 <strlen@plt>
mov    %eax,%ecx
mov    -0x50(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    1424 <config_ini_spawn+0x214>
jmp    141f <config_ini_spawn+0x20f>
jmp    1345 <config_ini_spawn+0x135>
jmp    1429 <config_ini_spawn+0x219>
cmpq   $0x0,-0x38(%rbp)
je     143d <config_ini_spawn+0x22d>
mov    -0x38(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x18(%rbp),%edi
call   1080 <close@plt>
mov    -0x14(%rbp),%edi
call   1080 <close@plt>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    14bd <config_ini_spawn+0x2ad>
mov    -0x14(%rbp),%eax
mov    0x2b8c(%rip),%rcx
cmp    (%rcx),%eax
je     148b <config_ini_spawn+0x27b>
mov    0x2b7d(%rip),%rax
mov    (%rax),%edi
call   1080 <close@plt>
mov    -0x14(%rbp),%edi
mov    0x2b6c(%rip),%rax
mov    (%rax),%esi
call   1070 <dup2@plt>
mov    -0x10(%rbp),%rcx
lea    0xb7d(%rip),%rsi
lea    0xb79(%rip),%rdx
xor    %eax,%eax
mov    %eax,%r8d
mov    %rsi,%rdi
call   1120 <execlp@plt>
lea    0xb68(%rip),%rdi
call   1100 <perror@plt>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x8(%rbp),%rax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<config_ini_spawn>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x4(%rsp),%rdi
call   1090 <pipe@plt>
test   %rax,%rax
jne    131c <config_ini_spawn+0x10c>
xor    %eax,%eax
call   1130 <fork@plt>
cmp    $0xffffffffffffffff,%rax
je     132a <config_ini_spawn+0x11a>
test   %rax,%rax
je     1392 <config_ini_spawn+0x182>
mov    0x2d89(%rip),%rcx
mov    (%rcx),%edx
lea    0xc(%rsp),%rsi
mov    %rax,%rdi
call   10f0 <waitpid@plt>
mov    0xc(%rsp),%edi
call   1110 <WIFEXITED@plt>
test   %eax,%eax
je     1279 <config_ini_spawn+0x69>
mov    0xc(%rsp),%edi
call   10e0 <WEXITSTATUS@plt>
test   %rax,%rax
je     1284 <config_ini_spawn+0x74>
mov    0x4(%rsp),%edi
xor    %ebx,%ebx
jmp    1367 <config_ini_spawn+0x157>
mov    0x4(%rsp),%edi
lea    0xd7b(%rip),%rsi
call   10d0 <fdopen@plt>
test   %rax,%rax
je     1318 <config_ini_spawn+0x108>
mov    %rax,%r14
mov    $0x80,%ebp
mov    $0x80,%edi
call   10b0 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1381 <config_ini_spawn+0x171>
movb   $0xa,(%rbx)
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14,%rdx
call   10a0 <fgets@plt>
test   %rax,%rax
je     130c <config_ini_spawn+0xfc>
cmpb   $0xa,(%rbx)
je     130c <config_ini_spawn+0xfc>
mov    %rbx,%rdi
call   1060 <strlen@plt>
cltq
cmpb   $0xa,-0x1(%rax,%rbx,1)
je     134c <config_ini_spawn+0x13c>
add    %ebp,%ebp
mov    %rbx,%rdi
mov    %ebp,%esi
call   10c0 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    12c0 <config_ini_spawn+0xb0>
lea    0xd09(%rip),%rdi
call   1100 <perror@plt>
xor    %ebx,%ebx
jmp    135b <config_ini_spawn+0x14b>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %ebx,%ebx
jmp    135b <config_ini_spawn+0x14b>
xor    %ebx,%ebx
jmp    1363 <config_ini_spawn+0x153>
lea    0xcdd(%rip),%rdi
call   1100 <perror@plt>
jmp    1348 <config_ini_spawn+0x138>
lea    0xcd4(%rip),%rdi
call   1100 <perror@plt>
mov    0x4(%rsp),%edi
call   1080 <close@plt>
mov    0x8(%rsp),%edi
call   1080 <close@plt>
xor    %ebx,%ebx
jmp    1375 <config_ini_spawn+0x165>
mov    %rbx,%rdi
call   1060 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbx,1)
mov    %r14,%rdi
call   1050 <fclose@plt>
mov    0x4(%rsp),%edi
call   1080 <close@plt>
mov    0x8(%rsp),%edi
call   1080 <close@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret
lea    0xc84(%rip),%rdi
call   1100 <perror@plt>
jmp    12b7 <config_ini_spawn+0xa7>
mov    0x2c57(%rip),%rbp
mov    0x0(%rbp),%edi
cmp    %edi,0x8(%rsp)
je     13b3 <config_ini_spawn+0x1a3>
call   1080 <close@plt>
mov    0x8(%rsp),%edi
mov    0x0(%rbp),%esi
call   1070 <dup2@plt>
lea    0xc59(%rip),%rdi
lea    0xc55(%rip),%rdx
mov    %rdi,%rsi
mov    %rbx,%rcx
xor    %r8d,%r8d
call   1120 <execlp@plt>
lea    0xc43(%rip),%rdi
call   1100 <perror@plt>
xor    %eax,%eax
call   1040 <abort@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"pipe\00"
@.str.1 = [5 x i8] c"fork\00"
@WUNTRACED = global i32 0
@.str.2 = [2 x i8] c"r\00"
@.str.3 = [7 x i8] c"malloc\00"
@STDOUT_FILENO = global i32 0
@.str.4 = [3 x i8] c"sh\00"
@.str.5 = [3 x i8] c"-c\00"
@.str.6 = [7 x i8] c"execlp\00"
define i8* @config_ini_spawn(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca [2 x i32]
%5 = alloca i64
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32
store i8* %0, i8** %3
%10 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%11 = call i64 @pipe(i32* %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %1
%14 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i8* null, i8** %2
br label %146
15: ; preds = %1
%16 = call i64 (...) @fork()
store i64 %16, i64* %5
%17 = load i64, i64* %5
%18 = icmp eq i64 %17, -1
br i1 %18, label %19, label %27
19: ; preds = %15
%20 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%21 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%22 = load i32, i32* %21
%23 = call i32 @close(i32 %22)
%24 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
%25 = load i32, i32* %24
%26 = call i32 @close(i32 %25)
store i8* null, i8** %2
br label %146
27: ; preds = %15
%28 = load i64, i64* %5
%29 = icmp ne i64 %28, 0
br i1 %29, label %30, label %129
30: ; preds = %27
store i8* null, i8** %6
%31 = load i64, i64* %5
%32 = load i32, i32* @WUNTRACED
%33 = call i32 @waitpid(i64 %31, i32* %7, i32 %32)
%34 = load i32, i32* %7
%35 = call i32 @WIFEXITED(i32 %34)
%36 = icmp ne i32 %35, 0
br i1 %36, label %37, label %41
37: ; preds = %30
%38 = load i32, i32* %7
%39 = call i64 @WEXITSTATUS(i32 %38)
%40 = icmp ne i64 %39, 0
br i1 %40, label %41, label %48
41: ; preds = %37, %30
%42 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%43 = load i32, i32* %42
%44 = call i32 @close(i32 %43)
%45 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
%46 = load i32, i32* %45
%47 = call i32 @close(i32 %46)
store i8* null, i8** %2
br label %146
48: ; preds = %37
%49 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%50 = load i32, i32* %49
%51 = call i32* @fdopen(i32 %50, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %51, i32** %8
%52 = icmp ne i32* %51, null
br i1 %52, label %53, label %115
53: ; preds = %48
store i32 128, i32* %9
%54 = load i32, i32* %9
%55 = sext i32 %54 to i64
%56 = mul i64 %55, 1
%57 = trunc i64 %56 to i32
%58 = call i8* @malloc(i32 %57)
store i8* %58, i8** %6
%59 = load i8*, i8** %6
%60 = icmp eq i8* %59, null
br i1 %60, label %61, label %63
61: ; preds = %53
%62 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
br label %63
63: ; preds = %61, %53
%64 = load i8*, i8** %6
store i8 10, i8* %64
br label %65
65: ; preds = %113, %63
%66 = load i8*, i8** %6
%67 = icmp ne i8* %66, null
br i1 %67, label %68, label %114
68: ; preds = %65
%69 = load i8*, i8** %6
%70 = load i32, i32* %9
%71 = load i32*, i32** %8
%72 = call i32* @fgets(i8* %69, i32 %70, i32* %71)
%73 = icmp eq i32* %72, null
br i1 %73, label %79, label %74
74: ; preds = %68
%75 = load i8*, i8** %6
%76 = load i8, i8* %75
%77 = sext i8 %76 to i32
%78 = icmp eq i32 %77, 10
br i1 %78, label %79, label %82
79: ; preds = %74, %68
%80 = load i8*, i8** %6
%81 = call i32 @free(i8* %80)
store i8* null, i8** %6
br label %113
82: ; preds = %74
%83 = load i8*, i8** %6
%84 = load i8*, i8** %6
%85 = call i32 @strlen(i8* %84)
%86 = sub nsw i32 %85, 1
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds i8, i8* %83, i64 %87
%89 = load i8, i8* %88
%90 = sext i8 %89 to i32
%91 = icmp ne i32 %90, 10
br i1 %91, label %92, label %105
92: ; preds = %82
%93 = load i8*, i8** %6
%94 = load i32, i32* %9
%95 = shl i32 %94, 1
store i32 %95, i32* %9
%96 = sext i32 %95 to i64
%97 = mul i64 %96, 1
%98 = trunc i64 %97 to i32
%99 = call i8* @realloc(i8* %93, i32 %98)
store i8* %99, i8** %6
%100 = load i8*, i8** %6
%101 = icmp eq i8* %100, null
br i1 %101, label %102, label %104
102: ; preds = %92
%103 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
br label %104
104: ; preds = %102, %92
br label %112
105: ; preds = %82
%106 = load i8*, i8** %6
%107 = load i8*, i8** %6
%108 = call i32 @strlen(i8* %107)
%109 = sub nsw i32 %108, 1
%110 = sext i32 %109 to i64
%111 = getelementptr inbounds i8, i8* %106, i64 %110
store i8 0, i8* %111
br label %114
112: ; preds = %104
br label %113
113: ; preds = %112, %79
br label %65
114: ; preds = %105, %65
br label %115
115: ; preds = %114, %48
%116 = load i32*, i32** %8
%117 = icmp ne i32* %116, null
br i1 %117, label %118, label %121
118: ; preds = %115
%119 = load i32*, i32** %8
%120 = call i32 @fclose(i32* %119)
br label %121
121: ; preds = %118, %115
%122 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%123 = load i32, i32* %122
%124 = call i32 @close(i32 %123)
%125 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
%126 = load i32, i32* %125
%127 = call i32 @close(i32 %126)
%128 = load i8*, i8** %6
store i8* %128, i8** %2
br label %146
129: ; preds = %27
%130 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
%131 = load i32, i32* %130
%132 = load i32, i32* @STDOUT_FILENO
%133 = icmp ne i32 %131, %132
br i1 %133, label %134, label %141
134: ; preds = %129
%135 = load i32, i32* @STDOUT_FILENO
%136 = call i32 @close(i32 %135)
%137 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
%138 = load i32, i32* %137
%139 = load i32, i32* @STDOUT_FILENO
%140 = call i32 @dup2(i32 %138, i32 %139)
br label %141
141: ; preds = %134, %129
%142 = load i8*, i8** %3
%143 = call i32 @execlp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %142, i32* null)
%144 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
%145 = call i32 (...) @abort()
unreachable
146: ; preds = %121, %41, %19, %13
%147 = load i8*, i8** %2
ret i8* %147
}

LLVM IR (-O2):
@.str = [5 x i8] c"pipe\00"
@.str.1 = [5 x i8] c"fork\00"
@WUNTRACED = global i32 0
@.str.2 = [2 x i8] c"r\00"
@.str.3 = [7 x i8] c"malloc\00"
@STDOUT_FILENO = global i32 0
@.str.4 = [3 x i8] c"sh\00"
@.str.5 = [3 x i8] c"-c\00"
@.str.6 = [7 x i8] c"execlp\00"
define i8* @config_ini_spawn(i8* %0) {
%2 = alloca [2 x i32]
%3 = alloca i32
%4 = bitcast [2 x i32]* %2 to i8*
%5 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%6 = call i64 @pipe(i32* %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %97
10: ; preds = %1
%11 = call i64 (...) @fork()
switch i64 %11, label %19 [
i64 -1, label %12
i64 0, label %83
]
12: ; preds = %10
%13 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%14 = load i32, i32* %5
%15 = call i32 @close(i32 %14)
%16 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 1
%17 = load i32, i32* %16
%18 = call i32 @close(i32 %17)
br label %97
19: ; preds = %10
%20 = bitcast i32* %3 to i8*
%21 = load i32, i32* @WUNTRACED
%22 = call i32 @waitpid(i64 %11, i32* %3, i32 %21)
%23 = load i32, i32* %3
%24 = call i32 @WIFEXITED(i32 %23)
%25 = icmp eq i32 %24, 0
br i1 %25, label %30, label %26
26: ; preds = %19
%27 = load i32, i32* %3
%28 = call i64 @WEXITSTATUS(i32 %27)
%29 = icmp eq i64 %28, 0
br i1 %29, label %32, label %30
30: ; preds = %26, %19
%31 = load i32, i32* %5
br label %76
32: ; preds = %26
%33 = load i32, i32* %5
%34 = call i32* @fdopen(i32 %33, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%35 = icmp eq i32* %34, null
br i1 %35, label %73, label %36
36: ; preds = %32
%37 = call dereferenceable_or_null(128) i8* @malloc(i32 128)
%38 = icmp eq i8* %37, null
br i1 %38, label %39, label %41
39: ; preds = %36
%40 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
br label %41
41: ; preds = %36, %39
store i8 10, i8* %37
br label %42
42: ; preds = %59, %41
%43 = phi i32 [ 128, %41 ], [ %60, %59 ]
%44 = phi i8* [ %37, %41 ], [ %61, %59 ]
%45 = call i32* @fgets(i8* %44, i32 %43, i32* %34)
%46 = icmp eq i32* %45, null
br i1 %46, label %50, label %47
47: ; preds = %42
%48 = load i8, i8* %44
%49 = icmp eq i8 %48, 10
br i1 %49, label %50, label %52
50: ; preds = %47, %42
%51 = call i32 @free(i8* %44)
br label %70
52: ; preds = %47
%53 = call i32 @strlen(i8* %44)
%54 = add nsw i32 %53, -1
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds i8, i8* %44, i64 %55
%57 = load i8, i8* %56
%58 = icmp eq i8 %57, 10
br i1 %58, label %65, label %59
59: ; preds = %52
%60 = shl i32 %43, 1
%61 = call i8* @realloc(i8* %44, i32 %60)
%62 = icmp eq i8* %61, null
br i1 %62, label %63, label %42
63: ; preds = %59
%64 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
br label %70
65: ; preds = %52
%66 = call i32 @strlen(i8* %44)
%67 = add nsw i32 %66, -1
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds i8, i8* %44, i64 %68
store i8 0, i8* %69
br label %70
70: ; preds = %65, %50, %63
%71 = phi i8* [ %44, %65 ], [ null, %50 ], [ null, %63 ]
%72 = call i32 @fclose(i32* %34)
br label %73
73: ; preds = %32, %70
%74 = phi i8* [ %71, %70 ], [ null, %32 ]
%75 = load i32, i32* %5
br label %76
76: ; preds = %73, %30
%77 = phi i32 [ %75, %73 ], [ %31, %30 ]
%78 = phi i8* [ %74, %73 ], [ null, %30 ]
%79 = call i32 @close(i32 %77)
%80 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 1
%81 = load i32, i32* %80
%82 = call i32 @close(i32 %81)
br label %97
83: ; preds = %10
%84 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 1
%85 = load i32, i32* %84
%86 = load i32, i32* @STDOUT_FILENO
%87 = icmp eq i32 %85, %86
br i1 %87, label %93, label %88
88: ; preds = %83
%89 = call i32 @close(i32 %86)
%90 = load i32, i32* %84
%91 = load i32, i32* @STDOUT_FILENO
%92 = call i32 @dup2(i32 %90, i32 %91)
br label %93
93: ; preds = %88, %83
%94 = call i32 @execlp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %0, i32* null)
%95 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
%96 = call i32 (...) @abort()
unreachable
97: ; preds = %76, %12, %8
%98 = phi i8* [ null, %8 ], [ null, %12 ], [ %78, %76 ]
ret i8* %98
}