#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 */
struct sgrp {
  char *sg_namp;
  char *sg_passwd;
  char **sg_adm;
  char **sg_mem;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ EINVAL;
scalar_t__ EOF;
int /*<<< orphan*/ _IO_flockfile(int /*<<< orphan*/ *);
int /*<<< orphan*/ _IO_funlockfile(int /*<<< orphan*/ *);
int /*<<< orphan*/ __nss_valid_field(char *);
int /*<<< orphan*/ __nss_valid_list_field(char **);
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
scalar_t__ fprintf(int /*<<< orphan*/ *, char *, char *, char *);
scalar_t__ putc_unlocked(char, int /*<<< orphan*/ *);
int putsgent(const struct sgrp *g, FILE *stream) {
  int errors = 0;
  if (g->sg_namp == NULL || !__nss_valid_field(g->sg_namp) ||
      !__nss_valid_field(g->sg_passwd) || !__nss_valid_list_field(g->sg_adm) ||
      !__nss_valid_list_field(g->sg_mem)) {
    __set_errno(EINVAL);
    return -1;
  }
  _IO_flockfile(stream);
  if (fprintf(stream, "%s:%s:", g->sg_namp, g->sg_passwd ? g->sg_passwd : "") <
      0)
    ++errors;
  bool first = true;
  char **sp = g->sg_adm;
  if (sp != NULL)
    while (*sp != NULL) {
      if (fprintf(stream, "%s%s", first ? "" : ",", *sp++) < 0) {
        ++errors;
        break;
      }
      first = false;
    }
  if (putc_unlocked(':', stream) == EOF)
    ++errors;
  first = true;
  sp = g->sg_mem;
  if (sp != NULL)
    while (*sp != NULL) {
      if (fprintf(stream, "%s%s", first ? "" : ",", *sp++) < 0) {
        ++errors;
        break;
      }
      first = false;
    }
  if (putc_unlocked('\n', stream) == EOF)
    ++errors;
  _IO_funlockfile(stream);
  return errors ? -1 : 0;
}


x86 assembly (clang, -O0):
<putsgent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     11ec <putsgent+0x7c>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1060 <__nss_valid_field@plt>
cmp    $0x0,%eax
je     11ec <putsgent+0x7c>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <__nss_valid_field@plt>
cmp    $0x0,%eax
je     11ec <putsgent+0x7c>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1090 <__nss_valid_list_field@plt>
cmp    $0x0,%eax
je     11ec <putsgent+0x7c>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1090 <__nss_valid_list_field@plt>
cmp    $0x0,%eax
jne    1206 <putsgent+0x96>
mov    0x2de5(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    140f <putsgent+0x29f>
mov    -0x18(%rbp),%rdi
call   1050 <_IO_flockfile@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x8(%rax)
je     1242 <putsgent+0xd2>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x40(%rbp)
jmp    1252 <putsgent+0xe2>
lea    0xdc4(%rip),%rax
mov    %rax,-0x40(%rbp)
jmp    1252 <putsgent+0xe2>
mov    -0x30(%rbp),%rdx
mov    -0x38(%rbp),%rdi
mov    -0x40(%rbp),%rcx
lea    0xd9b(%rip),%rsi
call   1070 <fprintf@plt>
cmp    $0x0,%rax
jge    127d <putsgent+0x10d>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
movl   $0x1,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     1311 <putsgent+0x1a1>
jmp    12a0 <putsgent+0x130>
mov    -0x28(%rbp),%rax
cmpq   $0x0,(%rax)
je     130c <putsgent+0x19c>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%ecx
lea    0xd50(%rip),%rdx
lea    0xd4a(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdx
mov    -0x28(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x28(%rbp)
mov    (%rax),%rcx
lea    0xd24(%rip),%rsi
call   1070 <fprintf@plt>
cmp    $0x0,%rax
jge    1300 <putsgent+0x190>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    130c <putsgent+0x19c>
movl   $0x0,-0x20(%rbp)
jmp    12a0 <putsgent+0x130>
jmp    1311 <putsgent+0x1a1>
mov    -0x18(%rbp),%rsi
mov    $0x3a,%edi
call   1080 <putc_unlocked@plt>
mov    0x2cc2(%rip),%rcx
cmp    (%rcx),%rax
jne    1338 <putsgent+0x1c8>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
movl   $0x1,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     13cc <putsgent+0x25c>
jmp    135b <putsgent+0x1eb>
mov    -0x28(%rbp),%rax
cmpq   $0x0,(%rax)
je     13c7 <putsgent+0x257>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%ecx
lea    0xc95(%rip),%rdx
lea    0xc8f(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdx
mov    -0x28(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x28(%rbp)
mov    (%rax),%rcx
lea    0xc69(%rip),%rsi
call   1070 <fprintf@plt>
cmp    $0x0,%rax
jge    13bb <putsgent+0x24b>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    13c7 <putsgent+0x257>
movl   $0x0,-0x20(%rbp)
jmp    135b <putsgent+0x1eb>
jmp    13cc <putsgent+0x25c>
mov    -0x18(%rbp),%rsi
mov    $0xa,%edi
call   1080 <putc_unlocked@plt>
mov    0x2c07(%rip),%rcx
cmp    (%rcx),%rax
jne    13f3 <putsgent+0x283>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <_IO_funlockfile@plt>
mov    -0x1c(%rbp),%edx
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putsgent>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r12
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1259 <putsgent+0xe9>
mov    %rsi,%r14
call   1060 <__nss_valid_field@plt>
test   %eax,%eax
je     1259 <putsgent+0xe9>
mov    0x8(%r12),%rdi
call   1060 <__nss_valid_field@plt>
test   %eax,%eax
je     1259 <putsgent+0xe9>
mov    0x10(%r12),%rdi
call   1090 <__nss_valid_list_field@plt>
test   %eax,%eax
je     1259 <putsgent+0xe9>
mov    0x18(%r12),%rdi
call   1090 <__nss_valid_list_field@plt>
test   %eax,%eax
je     1259 <putsgent+0xe9>
mov    %r14,%rdi
call   1050 <_IO_flockfile@plt>
mov    (%r12),%rdx
mov    0x8(%r12),%rcx
test   %rcx,%rcx
lea    0xe22(%rip),%rbx
cmove  %rbx,%rcx
lea    0xe0a(%rip),%rsi
mov    %r14,%rdi
call   1070 <fprintf@plt>
mov    %rax,%r15
shr    $0x3f,%r15
mov    0x10(%r12),%rbp
test   %rbp,%rbp
je     1283 <putsgent+0x113>
mov    0x0(%rbp),%rcx
test   %rcx,%rcx
je     1283 <putsgent+0x113>
mov    %r15,(%rsp)
add    $0x8,%rbp
lea    0xde0(%rip),%r13
lea    0xdde(%rip),%r15
xchg   %ax,%ax
mov    %r14,%rdi
mov    %r13,%rsi
mov    %rbx,%rdx
call   1070 <fprintf@plt>
test   %rax,%rax
js     127b <putsgent+0x10b>
mov    0x0(%rbp),%rcx
add    $0x8,%rbp
mov    %r15,%rbx
test   %rcx,%rcx
jne    1230 <putsgent+0xc0>
mov    (%rsp),%r15
jmp    1283 <putsgent+0x113>
mov    0x2d78(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    (%rsp),%r15
add    $0x1,%r15d
mov    $0x3a,%edi
mov    %r14,%rsi
call   1080 <putc_unlocked@plt>
mov    0x2d51(%rip),%rdx
xor    %r13d,%r13d
cmp    (%rdx),%rax
sete   %r13b
add    %r15d,%r13d
mov    0x18(%r12),%rbp
test   %rbp,%rbp
je     1302 <putsgent+0x192>
mov    0x0(%rbp),%rcx
mov    %rdx,%r12
test   %rcx,%rcx
je     130b <putsgent+0x19b>
add    $0x8,%rbp
lea    0xd48(%rip),%rdx
lea    0xd3b(%rip),%rbx
lea    0xd39(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1070 <fprintf@plt>
test   %rax,%rax
js     1307 <putsgent+0x197>
mov    0x0(%rbp),%rcx
add    $0x8,%rbp
mov    %r15,%rdx
test   %rcx,%rcx
jne    12e0 <putsgent+0x170>
jmp    130b <putsgent+0x19b>
mov    %rdx,%r12
jmp    130b <putsgent+0x19b>
add    $0x1,%r13d
mov    $0xa,%edi
mov    %r14,%rsi
call   1080 <putc_unlocked@plt>
xor    %ebx,%ebx
cmp    (%r12),%rax
sete   %bl
neg    %ebx
mov    %r14,%rdi
call   1040 <_IO_funlockfile@plt>
xor    %eax,%eax
cmp    %ebx,%r13d
setne  %al
neg    %eax
jmp    126c <putsgent+0xfc>

LLVM IR (-O0):
%struct.sgrp = type { i8*, i8*, i8**, i8** }
@EINVAL = global i32 0
@.str = [7 x i8] c"%s:%s:\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [5 x i8] c"%s%s\00"
@.str.3 = [2 x i8] c",\00"
@EOF = global i64 0
define i32 @putsgent(%struct.sgrp* %0, i32* %1) {
%3 = alloca i32
%4 = alloca %struct.sgrp*
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8**
store %struct.sgrp* %0, %struct.sgrp** %4
store i32* %1, i32** %5
store i32 0, i32* %6
%9 = load %struct.sgrp*, %struct.sgrp** %4
%10 = getelementptr inbounds %struct.sgrp, %struct.sgrp* %9, i32 0, i32 0
%11 = load i8*, i8** %10
%12 = icmp eq i8* %11, null
br i1 %12, label %37, label %13
13: ; preds = %2
%14 = load %struct.sgrp*, %struct.sgrp** %4
%15 = getelementptr inbounds %struct.sgrp, %struct.sgrp* %14, i32 0, i32 0
%16 = load i8*, i8** %15
%17 = call i32 @__nss_valid_field(i8* %16)
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %37
19: ; preds = %13
%20 = load %struct.sgrp*, %struct.sgrp** %4
%21 = getelementptr inbounds %struct.sgrp, %struct.sgrp* %20, i32 0, i32 1
%22 = load i8*, i8** %21
%23 = call i32 @__nss_valid_field(i8* %22)
%24 = icmp ne i32 %23, 0
br i1 %24, label %25, label %37
25: ; preds = %19
%26 = load %struct.sgrp*, %struct.sgrp** %4
%27 = getelementptr inbounds %struct.sgrp, %struct.sgrp* %26, i32 0, i32 2
%28 = load i8**, i8*** %27
%29 = call i32 @__nss_valid_list_field(i8** %28)
%30 = icmp ne i32 %29, 0
br i1 %30, label %31, label %37
31: ; preds = %25
%32 = load %struct.sgrp*, %struct.sgrp** %4
%33 = getelementptr inbounds %struct.sgrp, %struct.sgrp* %32, i32 0, i32 3
%34 = load i8**, i8*** %33
%35 = call i32 @__nss_valid_list_field(i8** %34)
%36 = icmp ne i32 %35, 0
br i1 %36, label %40, label %37
37: ; preds = %31, %25, %19, %13, %2
%38 = load i32, i32* @EINVAL
%39 = call i32 @__set_errno(i32 %38)
store i32 -1, i32* %3
br label %140
40: ; preds = %31
%41 = load i32*, i32** %5
%42 = call i32 @_IO_flockfile(i32* %41)
%43 = load i32*, i32** %5
%44 = load %struct.sgrp*, %struct.sgrp** %4
%45 = getelementptr inbounds %struct.sgrp, %struct.sgrp* %44, i32 0, i32 0
%46 = load i8*, i8** %45
%47 = load %struct.sgrp*, %struct.sgrp** %4
%48 = getelementptr inbounds %struct.sgrp, %struct.sgrp* %47, i32 0, i32 1
%49 = load i8*, i8** %48
%50 = icmp ne i8* %49, null
br i1 %50, label %51, label %55
51: ; preds = %40
%52 = load %struct.sgrp*, %struct.sgrp** %4
%53 = getelementptr inbounds %struct.sgrp, %struct.sgrp* %52, i32 0, i32 1
%54 = load i8*, i8** %53
br label %56
55: ; preds = %40
br label %56
56: ; preds = %55, %51
%57 = phi i8* [ %54, %51 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), %55 ]
%58 = call i64 @fprintf(i32* %43, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %46, i8* %57)
%59 = icmp slt i64 %58, 0
br i1 %59, label %60, label %63
60: ; preds = %56
%61 = load i32, i32* %6
%62 = add nsw i32 %61, 1
store i32 %62, i32* %6
br label %63
63: ; preds = %60, %56
store i32 1, i32* %7
%64 = load %struct.sgrp*, %struct.sgrp** %4
%65 = getelementptr inbounds %struct.sgrp, %struct.sgrp* %64, i32 0, i32 2
%66 = load i8**, i8*** %65
store i8** %66, i8*** %8
%67 = load i8**, i8*** %8
%68 = icmp ne i8** %67, null
br i1 %68, label %69, label %90
69: ; preds = %63
br label %70
70: ; preds = %88, %69
%71 = load i8**, i8*** %8
%72 = load i8*, i8** %71
%73 = icmp ne i8* %72, null
br i1 %73, label %74, label %89
74: ; preds = %70
%75 = load i32*, i32** %5
%76 = load i32, i32* %7
%77 = icmp ne i32 %76, 0
%78 = zext i1 %77 to i64
%79 = select i1 %77, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0)
%80 = load i8**, i8*** %8
%81 = getelementptr inbounds i8*, i8** %80, i32 1
store i8** %81, i8*** %8
%82 = load i8*, i8** %80
%83 = call i64 @fprintf(i32* %75, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* %79, i8* %82)
%84 = icmp slt i64 %83, 0
br i1 %84, label %85, label %88
85: ; preds = %74
%86 = load i32, i32* %6
%87 = add nsw i32 %86, 1
store i32 %87, i32* %6
br label %89
88: ; preds = %74
store i32 0, i32* %7
br label %70
89: ; preds = %85, %70
br label %90
90: ; preds = %89, %63
%91 = load i32*, i32** %5
%92 = call i64 @putc_unlocked(i8 signext 58, i32* %91)
%93 = load i64, i64* @EOF
%94 = icmp eq i64 %92, %93
br i1 %94, label %95, label %98
95: ; preds = %90
%96 = load i32, i32* %6
%97 = add nsw i32 %96, 1
store i32 %97, i32* %6
br label %98
98: ; preds = %95, %90
store i32 1, i32* %7
%99 = load %struct.sgrp*, %struct.sgrp** %4
%100 = getelementptr inbounds %struct.sgrp, %struct.sgrp* %99, i32 0, i32 3
%101 = load i8**, i8*** %100
store i8** %101, i8*** %8
%102 = load i8**, i8*** %8
%103 = icmp ne i8** %102, null
br i1 %103, label %104, label %125
104: ; preds = %98
br label %105
105: ; preds = %123, %104
%106 = load i8**, i8*** %8
%107 = load i8*, i8** %106
%108 = icmp ne i8* %107, null
br i1 %108, label %109, label %124
109: ; preds = %105
%110 = load i32*, i32** %5
%111 = load i32, i32* %7
%112 = icmp ne i32 %111, 0
%113 = zext i1 %112 to i64
%114 = select i1 %112, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0)
%115 = load i8**, i8*** %8
%116 = getelementptr inbounds i8*, i8** %115, i32 1
store i8** %116, i8*** %8
%117 = load i8*, i8** %115
%118 = call i64 @fprintf(i32* %110, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* %114, i8* %117)
%119 = icmp slt i64 %118, 0
br i1 %119, label %120, label %123
120: ; preds = %109
%121 = load i32, i32* %6
%122 = add nsw i32 %121, 1
store i32 %122, i32* %6
br label %124
123: ; preds = %109
store i32 0, i32* %7
br label %105
124: ; preds = %120, %105
br label %125
125: ; preds = %124, %98
%126 = load i32*, i32** %5
%127 = call i64 @putc_unlocked(i8 signext 10, i32* %126)
%128 = load i64, i64* @EOF
%129 = icmp eq i64 %127, %128
br i1 %129, label %130, label %133
130: ; preds = %125
%131 = load i32, i32* %6
%132 = add nsw i32 %131, 1
store i32 %132, i32* %6
br label %133
133: ; preds = %130, %125
%134 = load i32*, i32** %5
%135 = call i32 @_IO_funlockfile(i32* %134)
%136 = load i32, i32* %6
%137 = icmp ne i32 %136, 0
%138 = zext i1 %137 to i64
%139 = select i1 %137, i32 -1, i32 0
store i32 %139, i32* %3
br label %140
140: ; preds = %133, %37
%141 = load i32, i32* %3
ret i32 %141
}

LLVM IR (-O2):
%struct.sgrp = type { i8*, i8*, i8**, i8** }
@EINVAL = global i32 0
@.str = [7 x i8] c"%s:%s:\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [5 x i8] c"%s%s\00"
@.str.3 = [2 x i8] c",\00"
@EOF = global i64 0
define i32 @putsgent(%struct.sgrp* nocapture %0, i32* %1) {
%3 = getelementptr inbounds %struct.sgrp, %struct.sgrp* %0, i64 0, i32 0
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %24, label %6
6: ; preds = %2
%7 = tail call i32 @__nss_valid_field(i8* %4)
%8 = icmp eq i32 %7, 0
br i1 %8, label %24, label %9
9: ; preds = %6
%10 = getelementptr inbounds %struct.sgrp, %struct.sgrp* %0, i64 0, i32 1
%11 = load i8*, i8** %10
%12 = tail call i32 @__nss_valid_field(i8* %11)
%13 = icmp eq i32 %12, 0
br i1 %13, label %24, label %14
14: ; preds = %9
%15 = getelementptr inbounds %struct.sgrp, %struct.sgrp* %0, i64 0, i32 2
%16 = load i8**, i8*** %15
%17 = tail call i32 @__nss_valid_list_field(i8** %16)
%18 = icmp eq i32 %17, 0
br i1 %18, label %24, label %19
19: ; preds = %14
%20 = getelementptr inbounds %struct.sgrp, %struct.sgrp* %0, i64 0, i32 3
%21 = load i8**, i8*** %20
%22 = tail call i32 @__nss_valid_list_field(i8** %21)
%23 = icmp eq i32 %22, 0
br i1 %23, label %24, label %27
24: ; preds = %19, %14, %9, %6, %2
%25 = load i32, i32* @EINVAL
%26 = tail call i32 @__set_errno(i32 %25)
br label %86
27: ; preds = %19
%28 = tail call i32 @_IO_flockfile(i32* %1)
%29 = load i8*, i8** %3
%30 = load i8*, i8** %10
%31 = icmp eq i8* %30, null
%32 = select i1 %31, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* %30
%33 = tail call i64 @fprintf(i32* %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %29, i8* %32)
%34 = lshr i64 %33, 63
%35 = trunc i64 %34 to i32
%36 = load i8**, i8*** %15
%37 = icmp eq i8** %36, null
br i1 %37, label %53, label %38
38: ; preds = %27
%39 = load i8*, i8** %36
%40 = icmp eq i8* %39, null
br i1 %40, label %53, label %44
41: ; preds = %44
%42 = load i8*, i8** %50
%43 = icmp eq i8* %42, null
br i1 %43, label %53, label %44
44: ; preds = %38, %41
%45 = phi i8* [ %42, %41 ], [ %39, %38 ]
%46 = phi i8** [ %50, %41 ], [ %36, %38 ]
%47 = phi i8* [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), %41 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), %38 ]
%48 = tail call i64 @fprintf(i32* %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* %47, i8* %45)
%49 = icmp slt i64 %48, 0
%50 = getelementptr inbounds i8*, i8** %46, i64 1
br i1 %49, label %51, label %41
51: ; preds = %44
%52 = add nuw nsw i32 %35, 1
br label %53
53: ; preds = %41, %38, %51, %27
%54 = phi i32 [ %52, %51 ], [ %35, %27 ], [ %35, %38 ], [ %35, %41 ]
%55 = tail call i64 @putc_unlocked(i8 signext 58, i32* %1)
%56 = load i64, i64* @EOF
%57 = icmp eq i64 %55, %56
%58 = zext i1 %57 to i32
%59 = add nsw i32 %54, %58
%60 = load i8**, i8*** %20
%61 = icmp eq i8** %60, null
br i1 %61, label %77, label %62
62: ; preds = %53
%63 = load i8*, i8** %60
%64 = icmp eq i8* %63, null
br i1 %64, label %77, label %68
65: ; preds = %68
%66 = load i8*, i8** %74
%67 = icmp eq i8* %66, null
br i1 %67, label %77, label %68
68: ; preds = %62, %65
%69 = phi i8* [ %66, %65 ], [ %63, %62 ]
%70 = phi i8** [ %74, %65 ], [ %60, %62 ]
%71 = phi i8* [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), %65 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), %62 ]
%72 = tail call i64 @fprintf(i32* %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* %71, i8* %69)
%73 = icmp slt i64 %72, 0
%74 = getelementptr inbounds i8*, i8** %70, i64 1
br i1 %73, label %75, label %65
75: ; preds = %68
%76 = add nsw i32 %59, 1
br label %77
77: ; preds = %65, %62, %75, %53
%78 = phi i32 [ %76, %75 ], [ %59, %53 ], [ %59, %62 ], [ %59, %65 ]
%79 = tail call i64 @putc_unlocked(i8 signext 10, i32* %1)
%80 = load i64, i64* @EOF
%81 = icmp eq i64 %79, %80
%82 = sext i1 %81 to i32
%83 = tail call i32 @_IO_funlockfile(i32* %1)
%84 = icmp ne i32 %78, %82
%85 = sext i1 %84 to i32
br label %86
86: ; preds = %77, %24
%87 = phi i32 [ -1, %24 ], [ %85, %77 ]
ret i32 %87
}