#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 spwd {
  char *sp_namp;
  char *sp_pwdp;
  long sp_lstchg;
  long sp_min;
  long sp_max;
  long sp_warn;
  long sp_inact;
  long sp_expire;
  unsigned long sp_flag;
};
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*/ __set_errno(int /*<<< orphan*/);
scalar_t__ fprintf(int /*<<< orphan*/ *, char *, ...);
scalar_t__ putc_unlocked(char, int /*<<< orphan*/ *);
int putspent(const struct spwd *p, FILE *stream) {
  int errors = 0;
  if (p->sp_namp == NULL || !__nss_valid_field(p->sp_namp) ||
      !__nss_valid_field(p->sp_pwdp)) {
    __set_errno(EINVAL);
    return -1;
  }
  _IO_flockfile(stream);
  if (fprintf(stream, "%s:%s:", p->sp_namp, p->sp_pwdp ? p->sp_pwdp : "") < 0)
    ++errors;
  if ((p->sp_lstchg != (long int)-1 &&
       fprintf(stream, "%ld:", p->sp_lstchg) < 0) ||
      (p->sp_lstchg == (long int)-1 && putc_unlocked(':', stream) == EOF))
    ++errors;
  if ((p->sp_min != (long int)-1 && fprintf(stream, "%ld:", p->sp_min) < 0) ||
      (p->sp_min == (long int)-1 && putc_unlocked(':', stream) == EOF))
    ++errors;
  if ((p->sp_max != (long int)-1 && fprintf(stream, "%ld:", p->sp_max) < 0) ||
      (p->sp_max == (long int)-1 && putc_unlocked(':', stream) == EOF))
    ++errors;
  if ((p->sp_warn != (long int)-1 && fprintf(stream, "%ld:", p->sp_warn) < 0) ||
      (p->sp_warn == (long int)-1 && putc_unlocked(':', stream) == EOF))
    ++errors;
  if ((p->sp_inact != (long int)-1 &&
       fprintf(stream, "%ld:", p->sp_inact) < 0) ||
      (p->sp_inact == (long int)-1 && putc_unlocked(':', stream) == EOF))
    ++errors;
  if ((p->sp_expire != (long int)-1 &&
       fprintf(stream, "%ld:", p->sp_expire) < 0) ||
      (p->sp_expire == (long int)-1 && putc_unlocked(':', stream) == EOF))
    ++errors;
  if (p->sp_flag != ~0ul && fprintf(stream, "%ld", p->sp_flag) < 0)
    ++errors;
  if (putc_unlocked('\n', stream) == EOF)
    ++errors;
  _IO_funlockfile(stream);
  return errors ? -1 : 0;
}


x86 assembly (clang, -O0):
<putspent>:
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     11b0 <putspent+0x50>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1060 <__nss_valid_field@plt>
cmp    $0x0,%eax
je     11b0 <putspent+0x50>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <__nss_valid_field@plt>
cmp    $0x0,%eax
jne    11ca <putspent+0x6a>
mov    0x2e21(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1538 <putspent+0x3d8>
mov    -0x18(%rbp),%rdi
call   1050 <_IO_flockfile@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x8(%rax)
je     1206 <putspent+0xa6>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x38(%rbp)
jmp    1216 <putspent+0xb6>
lea    0xdfe(%rip),%rax
mov    %rax,-0x38(%rbp)
jmp    1216 <putspent+0xb6>
mov    -0x28(%rbp),%rdx
mov    -0x30(%rbp),%rdi
mov    -0x38(%rbp),%rcx
lea    0xdd7(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
cmp    $0x0,%rax
jge    1243 <putspent+0xe3>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0xffffffffffffffff,0x10(%rax)
je     1276 <putspent+0x116>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdx
lea    0xda2(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
cmp    $0x0,%rax
jl     12a3 <putspent+0x143>
mov    -0x10(%rbp),%rax
cmpq   $0xffffffffffffffff,0x10(%rax)
jne    12ac <putspent+0x14c>
mov    -0x18(%rbp),%rsi
mov    $0x3a,%edi
call   1080 <putc_unlocked@plt>
mov    0x2d4e(%rip),%rcx
cmp    (%rcx),%rax
jne    12ac <putspent+0x14c>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0xffffffffffffffff,0x18(%rax)
je     12df <putspent+0x17f>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdx
lea    0xd39(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
cmp    $0x0,%rax
jl     130c <putspent+0x1ac>
mov    -0x10(%rbp),%rax
cmpq   $0xffffffffffffffff,0x18(%rax)
jne    1315 <putspent+0x1b5>
mov    -0x18(%rbp),%rsi
mov    $0x3a,%edi
call   1080 <putc_unlocked@plt>
mov    0x2ce5(%rip),%rcx
cmp    (%rcx),%rax
jne    1315 <putspent+0x1b5>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0xffffffffffffffff,0x20(%rax)
je     1348 <putspent+0x1e8>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdx
lea    0xcd0(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
cmp    $0x0,%rax
jl     1375 <putspent+0x215>
mov    -0x10(%rbp),%rax
cmpq   $0xffffffffffffffff,0x20(%rax)
jne    137e <putspent+0x21e>
mov    -0x18(%rbp),%rsi
mov    $0x3a,%edi
call   1080 <putc_unlocked@plt>
mov    0x2c7c(%rip),%rcx
cmp    (%rcx),%rax
jne    137e <putspent+0x21e>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0xffffffffffffffff,0x28(%rax)
je     13b1 <putspent+0x251>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rdx
lea    0xc67(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
cmp    $0x0,%rax
jl     13de <putspent+0x27e>
mov    -0x10(%rbp),%rax
cmpq   $0xffffffffffffffff,0x28(%rax)
jne    13e7 <putspent+0x287>
mov    -0x18(%rbp),%rsi
mov    $0x3a,%edi
call   1080 <putc_unlocked@plt>
mov    0x2c13(%rip),%rcx
cmp    (%rcx),%rax
jne    13e7 <putspent+0x287>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0xffffffffffffffff,0x30(%rax)
je     141a <putspent+0x2ba>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x30(%rax),%rdx
lea    0xbfe(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
cmp    $0x0,%rax
jl     1447 <putspent+0x2e7>
mov    -0x10(%rbp),%rax
cmpq   $0xffffffffffffffff,0x30(%rax)
jne    1450 <putspent+0x2f0>
mov    -0x18(%rbp),%rsi
mov    $0x3a,%edi
call   1080 <putc_unlocked@plt>
mov    0x2baa(%rip),%rcx
cmp    (%rcx),%rax
jne    1450 <putspent+0x2f0>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0xffffffffffffffff,0x38(%rax)
je     1483 <putspent+0x323>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x38(%rax),%rdx
lea    0xb95(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
cmp    $0x0,%rax
jl     14b0 <putspent+0x350>
mov    -0x10(%rbp),%rax
cmpq   $0xffffffffffffffff,0x38(%rax)
jne    14b9 <putspent+0x359>
mov    -0x18(%rbp),%rsi
mov    $0x3a,%edi
call   1080 <putc_unlocked@plt>
mov    0x2b41(%rip),%rcx
cmp    (%rcx),%rax
jne    14b9 <putspent+0x359>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0xffffffffffffffff,0x40(%rax)
je     14f5 <putspent+0x395>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x40(%rax),%rdx
lea    0xb31(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
cmp    $0x0,%rax
jge    14f5 <putspent+0x395>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rsi
mov    $0xa,%edi
call   1080 <putc_unlocked@plt>
mov    0x2ade(%rip),%rcx
cmp    (%rcx),%rax
jne    151c <putspent+0x3bc>
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):
<putspent>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     13b6 <putspent+0x256>
mov    %rsi,%r14
call   1060 <__nss_valid_field@plt>
test   %eax,%eax
je     13b6 <putspent+0x256>
mov    0x8(%rbx),%rdi
call   1060 <__nss_valid_field@plt>
test   %eax,%eax
je     13b6 <putspent+0x256>
mov    %r14,%rdi
call   1050 <_IO_flockfile@plt>
mov    (%rbx),%rdx
mov    0x8(%rbx),%rax
test   %rax,%rax
lea    0xe5d(%rip),%rcx
cmovne %rax,%rcx
lea    0xe47(%rip),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    %rax,%r15
shr    $0x3f,%r15
mov    0x10(%rbx),%rdx
cmp    $0xffffffffffffffff,%rdx
je     11f1 <putspent+0x91>
lea    0xe2c(%rip),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1070 <fprintf@plt>
test   %rax,%rax
js     120a <putspent+0xaa>
cmpq   $0xffffffffffffffff,0x10(%rbx)
jne    120e <putspent+0xae>
mov    $0x3a,%edi
mov    %r14,%rsi
call   1080 <putc_unlocked@plt>
mov    0x2de3(%rip),%rcx
cmp    (%rcx),%rax
jne    120e <putspent+0xae>
add    $0x1,%r15d
mov    0x18(%rbx),%rdx
cmp    $0xffffffffffffffff,%rdx
je     1235 <putspent+0xd5>
lea    0xde8(%rip),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1070 <fprintf@plt>
test   %rax,%rax
js     124e <putspent+0xee>
cmpq   $0xffffffffffffffff,0x18(%rbx)
jne    1252 <putspent+0xf2>
mov    $0x3a,%edi
mov    %r14,%rsi
call   1080 <putc_unlocked@plt>
mov    0x2d9f(%rip),%rcx
cmp    (%rcx),%rax
jne    1252 <putspent+0xf2>
add    $0x1,%r15d
mov    0x20(%rbx),%rdx
cmp    $0xffffffffffffffff,%rdx
je     1279 <putspent+0x119>
lea    0xda4(%rip),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1070 <fprintf@plt>
test   %rax,%rax
js     1292 <putspent+0x132>
cmpq   $0xffffffffffffffff,0x20(%rbx)
jne    1296 <putspent+0x136>
mov    $0x3a,%edi
mov    %r14,%rsi
call   1080 <putc_unlocked@plt>
mov    0x2d5b(%rip),%rcx
cmp    (%rcx),%rax
jne    1296 <putspent+0x136>
add    $0x1,%r15d
mov    0x28(%rbx),%rdx
cmp    $0xffffffffffffffff,%rdx
je     12bd <putspent+0x15d>
lea    0xd60(%rip),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1070 <fprintf@plt>
test   %rax,%rax
js     12d6 <putspent+0x176>
cmpq   $0xffffffffffffffff,0x28(%rbx)
jne    12da <putspent+0x17a>
mov    $0x3a,%edi
mov    %r14,%rsi
call   1080 <putc_unlocked@plt>
mov    0x2d17(%rip),%rcx
cmp    (%rcx),%rax
jne    12da <putspent+0x17a>
add    $0x1,%r15d
mov    0x30(%rbx),%rdx
cmp    $0xffffffffffffffff,%rdx
je     1301 <putspent+0x1a1>
lea    0xd1c(%rip),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1070 <fprintf@plt>
test   %rax,%rax
js     131a <putspent+0x1ba>
cmpq   $0xffffffffffffffff,0x30(%rbx)
jne    131e <putspent+0x1be>
mov    $0x3a,%edi
mov    %r14,%rsi
call   1080 <putc_unlocked@plt>
mov    0x2cd3(%rip),%rcx
cmp    (%rcx),%rax
jne    131e <putspent+0x1be>
add    $0x1,%r15d
mov    0x38(%rbx),%rdx
cmp    $0xffffffffffffffff,%rdx
je     1345 <putspent+0x1e5>
lea    0xcd8(%rip),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1070 <fprintf@plt>
test   %rax,%rax
js     135e <putspent+0x1fe>
cmpq   $0xffffffffffffffff,0x38(%rbx)
jne    1362 <putspent+0x202>
mov    $0x3a,%edi
mov    %r14,%rsi
call   1080 <putc_unlocked@plt>
mov    0x2c8f(%rip),%rcx
cmp    (%rcx),%rax
jne    1362 <putspent+0x202>
add    $0x1,%r15d
mov    0x40(%rbx),%rdx
cmp    $0xffffffffffffffff,%rdx
je     1384 <putspent+0x224>
lea    0xc99(%rip),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1070 <fprintf@plt>
shr    $0x3f,%rax
add    %eax,%r15d
mov    $0xa,%edi
mov    %r14,%rsi
call   1080 <putc_unlocked@plt>
mov    0x2c50(%rip),%rcx
xor    %ebx,%ebx
cmp    (%rcx),%rax
sete   %bl
neg    %ebx
mov    %r14,%rdi
call   1040 <_IO_funlockfile@plt>
xor    %eax,%eax
cmp    %ebx,%r15d
setne  %al
neg    %eax
jmp    13c9 <putspent+0x269>
mov    0x2c1b(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.spwd = type { i8*, i8*, i64, i64, i64, i64, i64, i64, i64 }
@EINVAL = global i32 0
@.str = [7 x i8] c"%s:%s:\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [5 x i8] c"%ld:\00"
@EOF = global i64 0
@.str.3 = [4 x i8] c"%ld\00"
define i32 @putspent(%struct.spwd* %0, i32* %1) {
%3 = alloca i32
%4 = alloca %struct.spwd*
%5 = alloca i32*
%6 = alloca i32
store %struct.spwd* %0, %struct.spwd** %4
store i32* %1, i32** %5
store i32 0, i32* %6
%7 = load %struct.spwd*, %struct.spwd** %4
%8 = getelementptr inbounds %struct.spwd, %struct.spwd* %7, i32 0, i32 0
%9 = load i8*, i8** %8
%10 = icmp eq i8* %9, null
br i1 %10, label %23, label %11
11: ; preds = %2
%12 = load %struct.spwd*, %struct.spwd** %4
%13 = getelementptr inbounds %struct.spwd, %struct.spwd* %12, i32 0, i32 0
%14 = load i8*, i8** %13
%15 = call i32 @__nss_valid_field(i8* %14)
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %23
17: ; preds = %11
%18 = load %struct.spwd*, %struct.spwd** %4
%19 = getelementptr inbounds %struct.spwd, %struct.spwd* %18, i32 0, i32 1
%20 = load i8*, i8** %19
%21 = call i32 @__nss_valid_field(i8* %20)
%22 = icmp ne i32 %21, 0
br i1 %22, label %26, label %23
23: ; preds = %17, %11, %2
%24 = load i32, i32* @EINVAL
%25 = call i32 @__set_errno(i32 %24)
store i32 -1, i32* %3
br label %229
26: ; preds = %17
%27 = load i32*, i32** %5
%28 = call i32 @_IO_flockfile(i32* %27)
%29 = load i32*, i32** %5
%30 = load %struct.spwd*, %struct.spwd** %4
%31 = getelementptr inbounds %struct.spwd, %struct.spwd* %30, i32 0, i32 0
%32 = load i8*, i8** %31
%33 = load %struct.spwd*, %struct.spwd** %4
%34 = getelementptr inbounds %struct.spwd, %struct.spwd* %33, i32 0, i32 1
%35 = load i8*, i8** %34
%36 = icmp ne i8* %35, null
br i1 %36, label %37, label %41
37: ; preds = %26
%38 = load %struct.spwd*, %struct.spwd** %4
%39 = getelementptr inbounds %struct.spwd, %struct.spwd* %38, i32 0, i32 1
%40 = load i8*, i8** %39
br label %42
41: ; preds = %26
br label %42
42: ; preds = %41, %37
%43 = phi i8* [ %40, %37 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), %41 ]
%44 = call i64 (i32*, i8*, ...) @fprintf(i32* %29, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %32, i8* %43)
%45 = icmp slt i64 %44, 0
br i1 %45, label %46, label %49
46: ; preds = %42
%47 = load i32, i32* %6
%48 = add nsw i32 %47, 1
store i32 %48, i32* %6
br label %49
49: ; preds = %46, %42
%50 = load %struct.spwd*, %struct.spwd** %4
%51 = getelementptr inbounds %struct.spwd, %struct.spwd* %50, i32 0, i32 2
%52 = load i64, i64* %51
%53 = icmp ne i64 %52, -1
br i1 %53, label %54, label %61
54: ; preds = %49
%55 = load i32*, i32** %5
%56 = load %struct.spwd*, %struct.spwd** %4
%57 = getelementptr inbounds %struct.spwd, %struct.spwd* %56, i32 0, i32 2
%58 = load i64, i64* %57
%59 = call i64 (i32*, i8*, ...) @fprintf(i32* %55, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i64 %58)
%60 = icmp slt i64 %59, 0
br i1 %60, label %71, label %61
61: ; preds = %54, %49
%62 = load %struct.spwd*, %struct.spwd** %4
%63 = getelementptr inbounds %struct.spwd, %struct.spwd* %62, i32 0, i32 2
%64 = load i64, i64* %63
%65 = icmp eq i64 %64, -1
br i1 %65, label %66, label %74
66: ; preds = %61
%67 = load i32*, i32** %5
%68 = call i64 @putc_unlocked(i8 signext 58, i32* %67)
%69 = load i64, i64* @EOF
%70 = icmp eq i64 %68, %69
br i1 %70, label %71, label %74
71: ; preds = %66, %54
%72 = load i32, i32* %6
%73 = add nsw i32 %72, 1
store i32 %73, i32* %6
br label %74
74: ; preds = %71, %66, %61
%75 = load %struct.spwd*, %struct.spwd** %4
%76 = getelementptr inbounds %struct.spwd, %struct.spwd* %75, i32 0, i32 3
%77 = load i64, i64* %76
%78 = icmp ne i64 %77, -1
br i1 %78, label %79, label %86
79: ; preds = %74
%80 = load i32*, i32** %5
%81 = load %struct.spwd*, %struct.spwd** %4
%82 = getelementptr inbounds %struct.spwd, %struct.spwd* %81, i32 0, i32 3
%83 = load i64, i64* %82
%84 = call i64 (i32*, i8*, ...) @fprintf(i32* %80, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i64 %83)
%85 = icmp slt i64 %84, 0
br i1 %85, label %96, label %86
86: ; preds = %79, %74
%87 = load %struct.spwd*, %struct.spwd** %4
%88 = getelementptr inbounds %struct.spwd, %struct.spwd* %87, i32 0, i32 3
%89 = load i64, i64* %88
%90 = icmp eq i64 %89, -1
br i1 %90, label %91, label %99
91: ; preds = %86
%92 = load i32*, i32** %5
%93 = call i64 @putc_unlocked(i8 signext 58, i32* %92)
%94 = load i64, i64* @EOF
%95 = icmp eq i64 %93, %94
br i1 %95, label %96, label %99
96: ; preds = %91, %79
%97 = load i32, i32* %6
%98 = add nsw i32 %97, 1
store i32 %98, i32* %6
br label %99
99: ; preds = %96, %91, %86
%100 = load %struct.spwd*, %struct.spwd** %4
%101 = getelementptr inbounds %struct.spwd, %struct.spwd* %100, i32 0, i32 4
%102 = load i64, i64* %101
%103 = icmp ne i64 %102, -1
br i1 %103, label %104, label %111
104: ; preds = %99
%105 = load i32*, i32** %5
%106 = load %struct.spwd*, %struct.spwd** %4
%107 = getelementptr inbounds %struct.spwd, %struct.spwd* %106, i32 0, i32 4
%108 = load i64, i64* %107
%109 = call i64 (i32*, i8*, ...) @fprintf(i32* %105, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i64 %108)
%110 = icmp slt i64 %109, 0
br i1 %110, label %121, label %111
111: ; preds = %104, %99
%112 = load %struct.spwd*, %struct.spwd** %4
%113 = getelementptr inbounds %struct.spwd, %struct.spwd* %112, i32 0, i32 4
%114 = load i64, i64* %113
%115 = icmp eq i64 %114, -1
br i1 %115, label %116, label %124
116: ; preds = %111
%117 = load i32*, i32** %5
%118 = call i64 @putc_unlocked(i8 signext 58, i32* %117)
%119 = load i64, i64* @EOF
%120 = icmp eq i64 %118, %119
br i1 %120, label %121, label %124
121: ; preds = %116, %104
%122 = load i32, i32* %6
%123 = add nsw i32 %122, 1
store i32 %123, i32* %6
br label %124
124: ; preds = %121, %116, %111
%125 = load %struct.spwd*, %struct.spwd** %4
%126 = getelementptr inbounds %struct.spwd, %struct.spwd* %125, i32 0, i32 5
%127 = load i64, i64* %126
%128 = icmp ne i64 %127, -1
br i1 %128, label %129, label %136
129: ; preds = %124
%130 = load i32*, i32** %5
%131 = load %struct.spwd*, %struct.spwd** %4
%132 = getelementptr inbounds %struct.spwd, %struct.spwd* %131, i32 0, i32 5
%133 = load i64, i64* %132
%134 = call i64 (i32*, i8*, ...) @fprintf(i32* %130, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i64 %133)
%135 = icmp slt i64 %134, 0
br i1 %135, label %146, label %136
136: ; preds = %129, %124
%137 = load %struct.spwd*, %struct.spwd** %4
%138 = getelementptr inbounds %struct.spwd, %struct.spwd* %137, i32 0, i32 5
%139 = load i64, i64* %138
%140 = icmp eq i64 %139, -1
br i1 %140, label %141, label %149
141: ; preds = %136
%142 = load i32*, i32** %5
%143 = call i64 @putc_unlocked(i8 signext 58, i32* %142)
%144 = load i64, i64* @EOF
%145 = icmp eq i64 %143, %144
br i1 %145, label %146, label %149
146: ; preds = %141, %129
%147 = load i32, i32* %6
%148 = add nsw i32 %147, 1
store i32 %148, i32* %6
br label %149
149: ; preds = %146, %141, %136
%150 = load %struct.spwd*, %struct.spwd** %4
%151 = getelementptr inbounds %struct.spwd, %struct.spwd* %150, i32 0, i32 6
%152 = load i64, i64* %151
%153 = icmp ne i64 %152, -1
br i1 %153, label %154, label %161
154: ; preds = %149
%155 = load i32*, i32** %5
%156 = load %struct.spwd*, %struct.spwd** %4
%157 = getelementptr inbounds %struct.spwd, %struct.spwd* %156, i32 0, i32 6
%158 = load i64, i64* %157
%159 = call i64 (i32*, i8*, ...) @fprintf(i32* %155, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i64 %158)
%160 = icmp slt i64 %159, 0
br i1 %160, label %171, label %161
161: ; preds = %154, %149
%162 = load %struct.spwd*, %struct.spwd** %4
%163 = getelementptr inbounds %struct.spwd, %struct.spwd* %162, i32 0, i32 6
%164 = load i64, i64* %163
%165 = icmp eq i64 %164, -1
br i1 %165, label %166, label %174
166: ; preds = %161
%167 = load i32*, i32** %5
%168 = call i64 @putc_unlocked(i8 signext 58, i32* %167)
%169 = load i64, i64* @EOF
%170 = icmp eq i64 %168, %169
br i1 %170, label %171, label %174
171: ; preds = %166, %154
%172 = load i32, i32* %6
%173 = add nsw i32 %172, 1
store i32 %173, i32* %6
br label %174
174: ; preds = %171, %166, %161
%175 = load %struct.spwd*, %struct.spwd** %4
%176 = getelementptr inbounds %struct.spwd, %struct.spwd* %175, i32 0, i32 7
%177 = load i64, i64* %176
%178 = icmp ne i64 %177, -1
br i1 %178, label %179, label %186
179: ; preds = %174
%180 = load i32*, i32** %5
%181 = load %struct.spwd*, %struct.spwd** %4
%182 = getelementptr inbounds %struct.spwd, %struct.spwd* %181, i32 0, i32 7
%183 = load i64, i64* %182
%184 = call i64 (i32*, i8*, ...) @fprintf(i32* %180, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i64 %183)
%185 = icmp slt i64 %184, 0
br i1 %185, label %196, label %186
186: ; preds = %179, %174
%187 = load %struct.spwd*, %struct.spwd** %4
%188 = getelementptr inbounds %struct.spwd, %struct.spwd* %187, i32 0, i32 7
%189 = load i64, i64* %188
%190 = icmp eq i64 %189, -1
br i1 %190, label %191, label %199
191: ; preds = %186
%192 = load i32*, i32** %5
%193 = call i64 @putc_unlocked(i8 signext 58, i32* %192)
%194 = load i64, i64* @EOF
%195 = icmp eq i64 %193, %194
br i1 %195, label %196, label %199
196: ; preds = %191, %179
%197 = load i32, i32* %6
%198 = add nsw i32 %197, 1
store i32 %198, i32* %6
br label %199
199: ; preds = %196, %191, %186
%200 = load %struct.spwd*, %struct.spwd** %4
%201 = getelementptr inbounds %struct.spwd, %struct.spwd* %200, i32 0, i32 8
%202 = load i64, i64* %201
%203 = icmp ne i64 %202, -1
br i1 %203, label %204, label %214
204: ; preds = %199
%205 = load i32*, i32** %5
%206 = load %struct.spwd*, %struct.spwd** %4
%207 = getelementptr inbounds %struct.spwd, %struct.spwd* %206, i32 0, i32 8
%208 = load i64, i64* %207
%209 = call i64 (i32*, i8*, ...) @fprintf(i32* %205, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i64 %208)
%210 = icmp slt i64 %209, 0
br i1 %210, label %211, label %214
211: ; preds = %204
%212 = load i32, i32* %6
%213 = add nsw i32 %212, 1
store i32 %213, i32* %6
br label %214
214: ; preds = %211, %204, %199
%215 = load i32*, i32** %5
%216 = call i64 @putc_unlocked(i8 signext 10, i32* %215)
%217 = load i64, i64* @EOF
%218 = icmp eq i64 %216, %217
br i1 %218, label %219, label %222
219: ; preds = %214
%220 = load i32, i32* %6
%221 = add nsw i32 %220, 1
store i32 %221, i32* %6
br label %222
222: ; preds = %219, %214
%223 = load i32*, i32** %5
%224 = call i32 @_IO_funlockfile(i32* %223)
%225 = load i32, i32* %6
%226 = icmp ne i32 %225, 0
%227 = zext i1 %226 to i64
%228 = select i1 %226, i32 -1, i32 0
store i32 %228, i32* %3
br label %229
229: ; preds = %222, %23
%230 = load i32, i32* %3
ret i32 %230
}

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