#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 */
scalar_t__ EOF;
int /*<<< orphan*/ flockfile(int /*<<< orphan*/ *);
scalar_t__ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ funlockfile(int /*<<< orphan*/ *);
scalar_t__ putc_unlocked(char, int /*<<< orphan*/ *);
int putspent(const struct spwd *p, FILE *stream) {
  int errors = 0;
  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;
  funlockfile(stream);
  return errors ? -1 : 0;
}


x86 assembly (clang, -O0):
<putspent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <flockfile@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,0x8(%rax)
je     1193 <putspent+0x53>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x30(%rbp)
jmp    11a3 <putspent+0x63>
lea    0xe71(%rip),%rax
mov    %rax,-0x30(%rbp)
jmp    11a3 <putspent+0x63>
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rcx
lea    0xe4a(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
cmp    $0x0,%rax
jge    11d0 <putspent+0x90>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0xffffffffffffffff,0x10(%rax)
je     1203 <putspent+0xc3>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%rdx
lea    0xe15(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
cmp    $0x0,%rax
jl     1230 <putspent+0xf0>
mov    -0x8(%rbp),%rax
cmpq   $0xffffffffffffffff,0x10(%rax)
jne    1239 <putspent+0xf9>
mov    -0x10(%rbp),%rsi
mov    $0x3a,%edi
call   1060 <putc_unlocked@plt>
mov    0x2dc1(%rip),%rcx
cmp    (%rcx),%rax
jne    1239 <putspent+0xf9>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0xffffffffffffffff,0x18(%rax)
je     126c <putspent+0x12c>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%rdx
lea    0xdac(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
cmp    $0x0,%rax
jl     1299 <putspent+0x159>
mov    -0x8(%rbp),%rax
cmpq   $0xffffffffffffffff,0x18(%rax)
jne    12a2 <putspent+0x162>
mov    -0x10(%rbp),%rsi
mov    $0x3a,%edi
call   1060 <putc_unlocked@plt>
mov    0x2d58(%rip),%rcx
cmp    (%rcx),%rax
jne    12a2 <putspent+0x162>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0xffffffffffffffff,0x20(%rax)
je     12d5 <putspent+0x195>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rax
mov    0x20(%rax),%rdx
lea    0xd43(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
cmp    $0x0,%rax
jl     1302 <putspent+0x1c2>
mov    -0x8(%rbp),%rax
cmpq   $0xffffffffffffffff,0x20(%rax)
jne    130b <putspent+0x1cb>
mov    -0x10(%rbp),%rsi
mov    $0x3a,%edi
call   1060 <putc_unlocked@plt>
mov    0x2cef(%rip),%rcx
cmp    (%rcx),%rax
jne    130b <putspent+0x1cb>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0xffffffffffffffff,0x28(%rax)
je     133e <putspent+0x1fe>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rax
mov    0x28(%rax),%rdx
lea    0xcda(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
cmp    $0x0,%rax
jl     136b <putspent+0x22b>
mov    -0x8(%rbp),%rax
cmpq   $0xffffffffffffffff,0x28(%rax)
jne    1374 <putspent+0x234>
mov    -0x10(%rbp),%rsi
mov    $0x3a,%edi
call   1060 <putc_unlocked@plt>
mov    0x2c86(%rip),%rcx
cmp    (%rcx),%rax
jne    1374 <putspent+0x234>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0xffffffffffffffff,0x30(%rax)
je     13a7 <putspent+0x267>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rax
mov    0x30(%rax),%rdx
lea    0xc71(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
cmp    $0x0,%rax
jl     13d4 <putspent+0x294>
mov    -0x8(%rbp),%rax
cmpq   $0xffffffffffffffff,0x30(%rax)
jne    13dd <putspent+0x29d>
mov    -0x10(%rbp),%rsi
mov    $0x3a,%edi
call   1060 <putc_unlocked@plt>
mov    0x2c1d(%rip),%rcx
cmp    (%rcx),%rax
jne    13dd <putspent+0x29d>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0xffffffffffffffff,0x38(%rax)
je     1410 <putspent+0x2d0>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rax
mov    0x38(%rax),%rdx
lea    0xc08(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
cmp    $0x0,%rax
jl     143d <putspent+0x2fd>
mov    -0x8(%rbp),%rax
cmpq   $0xffffffffffffffff,0x38(%rax)
jne    1446 <putspent+0x306>
mov    -0x10(%rbp),%rsi
mov    $0x3a,%edi
call   1060 <putc_unlocked@plt>
mov    0x2bb4(%rip),%rcx
cmp    (%rcx),%rax
jne    1446 <putspent+0x306>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0xffffffffffffffff,0x40(%rax)
je     1482 <putspent+0x342>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rax
mov    0x40(%rax),%rdx
lea    0xba4(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
cmp    $0x0,%rax
jge    1482 <putspent+0x342>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rsi
mov    $0xa,%edi
call   1060 <putc_unlocked@plt>
mov    0x2b51(%rip),%rcx
cmp    (%rcx),%rax
jne    14a9 <putspent+0x369>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <funlockfile@plt>
mov    -0x14(%rbp),%edx
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putspent>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1040 <flockfile@plt>
mov    (%rbx),%rdx
mov    0x8(%rbx),%rax
test   %rax,%rax
lea    0xea7(%rip),%rcx
cmovne %rax,%rcx
lea    0xe91(%rip),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    %rax,%r14
shr    $0x3f,%r14
mov    0x10(%rbx),%rdx
cmp    $0xffffffffffffffff,%rdx
je     11a7 <putspent+0x67>
lea    0xe76(%rip),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <fprintf@plt>
test   %rax,%rax
js     11c0 <putspent+0x80>
cmpq   $0xffffffffffffffff,0x10(%rbx)
jne    11c4 <putspent+0x84>
mov    $0x3a,%edi
mov    %r15,%rsi
call   1060 <putc_unlocked@plt>
mov    0x2e2d(%rip),%rcx
cmp    (%rcx),%rax
jne    11c4 <putspent+0x84>
add    $0x1,%r14d
mov    0x18(%rbx),%rdx
cmp    $0xffffffffffffffff,%rdx
je     11eb <putspent+0xab>
lea    0xe32(%rip),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <fprintf@plt>
test   %rax,%rax
js     1204 <putspent+0xc4>
cmpq   $0xffffffffffffffff,0x18(%rbx)
jne    1208 <putspent+0xc8>
mov    $0x3a,%edi
mov    %r15,%rsi
call   1060 <putc_unlocked@plt>
mov    0x2de9(%rip),%rcx
cmp    (%rcx),%rax
jne    1208 <putspent+0xc8>
add    $0x1,%r14d
mov    0x20(%rbx),%rdx
cmp    $0xffffffffffffffff,%rdx
je     122f <putspent+0xef>
lea    0xdee(%rip),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <fprintf@plt>
test   %rax,%rax
js     1248 <putspent+0x108>
cmpq   $0xffffffffffffffff,0x20(%rbx)
jne    124c <putspent+0x10c>
mov    $0x3a,%edi
mov    %r15,%rsi
call   1060 <putc_unlocked@plt>
mov    0x2da5(%rip),%rcx
cmp    (%rcx),%rax
jne    124c <putspent+0x10c>
add    $0x1,%r14d
mov    0x28(%rbx),%rdx
cmp    $0xffffffffffffffff,%rdx
je     1273 <putspent+0x133>
lea    0xdaa(%rip),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <fprintf@plt>
test   %rax,%rax
js     128c <putspent+0x14c>
cmpq   $0xffffffffffffffff,0x28(%rbx)
jne    1290 <putspent+0x150>
mov    $0x3a,%edi
mov    %r15,%rsi
call   1060 <putc_unlocked@plt>
mov    0x2d61(%rip),%rcx
cmp    (%rcx),%rax
jne    1290 <putspent+0x150>
add    $0x1,%r14d
mov    0x30(%rbx),%rdx
cmp    $0xffffffffffffffff,%rdx
je     12b7 <putspent+0x177>
lea    0xd66(%rip),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <fprintf@plt>
test   %rax,%rax
js     12d0 <putspent+0x190>
cmpq   $0xffffffffffffffff,0x30(%rbx)
jne    12d4 <putspent+0x194>
mov    $0x3a,%edi
mov    %r15,%rsi
call   1060 <putc_unlocked@plt>
mov    0x2d1d(%rip),%rcx
cmp    (%rcx),%rax
jne    12d4 <putspent+0x194>
add    $0x1,%r14d
mov    0x38(%rbx),%rdx
cmp    $0xffffffffffffffff,%rdx
je     12fb <putspent+0x1bb>
lea    0xd22(%rip),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <fprintf@plt>
test   %rax,%rax
js     1314 <putspent+0x1d4>
cmpq   $0xffffffffffffffff,0x38(%rbx)
jne    1318 <putspent+0x1d8>
mov    $0x3a,%edi
mov    %r15,%rsi
call   1060 <putc_unlocked@plt>
mov    0x2cd9(%rip),%rcx
cmp    (%rcx),%rax
jne    1318 <putspent+0x1d8>
add    $0x1,%r14d
mov    0x40(%rbx),%rdx
cmp    $0xffffffffffffffff,%rdx
je     133a <putspent+0x1fa>
lea    0xce3(%rip),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <fprintf@plt>
shr    $0x3f,%rax
add    %eax,%r14d
mov    $0xa,%edi
mov    %r15,%rsi
call   1060 <putc_unlocked@plt>
mov    0x2c9a(%rip),%rcx
xor    %ebx,%ebx
cmp    (%rcx),%rax
sete   %bl
neg    %ebx
mov    %r15,%rdi
call   1030 <funlockfile@plt>
xor    %eax,%eax
cmp    %ebx,%r14d
setne  %al
neg    %eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

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