#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 pslTbl {
  int dummy;
};
struct lineFile {
  int dummy;
};
typedef int /*<<< orphan*/ row;

/* Variables and functions */
int /*<<< orphan*/ lineFileClose(struct lineFile **);
scalar_t__ lineFileNextRowTab(struct lineFile *, char **, int);
struct lineFile *lineFileOpen(char *, int);
int /*<<< orphan*/ loadPsl(struct pslTbl *, char **);
void loadPsls(struct pslTbl *pslTbl, char *pslFile) {
  struct lineFile *lf = lineFileOpen(pslFile, 1);
  char *row[21];
  while (lineFileNextRowTab(lf, row, (sizeof(row) / sizeof((row)[0]))))
    loadPsl(pslTbl, row);
  lineFileClose(&lf);
}


x86 assembly (clang, -O0):
<loadPsls>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
call   1060 <lineFileOpen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0xc0(%rbp),%rsi
mov    $0x15,%edx
call   1050 <lineFileNextRowTab@plt>
cmp    $0x0,%rax
je     1199 <loadPsls+0x59>
mov    -0x8(%rbp),%rdi
lea    -0xc0(%rbp),%rsi
call   1040 <loadPsl@plt>
jmp    1165 <loadPsls+0x25>
lea    -0x18(%rbp),%rdi
call   1030 <lineFileClose@plt>
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<loadPsls>:
push   %r15
push   %r14
push   %rbx
sub    $0xc0,%rsp
mov    %rdi,%r14
mov    %rsi,%rdi
mov    $0x1,%esi
call   1060 <lineFileOpen@plt>
mov    %rax,%r15
mov    %rax,0x8(%rsp)
lea    0x10(%rsp),%rsi
mov    %rax,%rdi
mov    $0x15,%edx
call   1050 <lineFileNextRowTab@plt>
test   %rax,%rax
je     11a0 <loadPsls+0x60>
lea    0x10(%rsp),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <loadPsl@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    $0x15,%edx
call   1050 <lineFileNextRowTab@plt>
test   %rax,%rax
jne    1180 <loadPsls+0x40>
lea    0x8(%rsp),%rdi
call   1030 <lineFileClose@plt>
add    $0xc0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.pslTbl = type { i32 }
%struct.lineFile = type { i32 }
define void @loadPsls(%struct.pslTbl* %0, i8* %1) {
%3 = alloca %struct.pslTbl*
%4 = alloca i8*
%5 = alloca %struct.lineFile*
%6 = alloca [21 x i8*]
store %struct.pslTbl* %0, %struct.pslTbl** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %4
%8 = call %struct.lineFile* @lineFileOpen(i8* %7, i32 1)
store %struct.lineFile* %8, %struct.lineFile** %5
br label %9
9: ; preds = %14, %2
%10 = load %struct.lineFile*, %struct.lineFile** %5
%11 = getelementptr inbounds [21 x i8*], [21 x i8*]* %6, i64 0, i64 0
%12 = call i64 @lineFileNextRowTab(%struct.lineFile* %10, i8** %11, i32 21)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %18
14: ; preds = %9
%15 = load %struct.pslTbl*, %struct.pslTbl** %3
%16 = getelementptr inbounds [21 x i8*], [21 x i8*]* %6, i64 0, i64 0
%17 = call i32 @loadPsl(%struct.pslTbl* %15, i8** %16)
br label %9
18: ; preds = %9
%19 = call i32 @lineFileClose(%struct.lineFile** %5)
ret void
}

LLVM IR (-O2):
%struct.pslTbl = type { i32 }
%struct.lineFile = type { i32 }
define void @loadPsls(%struct.pslTbl* %0, i8* %1) {
%3 = alloca %struct.lineFile*
%4 = alloca [21 x i8*]
%5 = bitcast %struct.lineFile** %3 to i8*
%6 = tail call %struct.lineFile* @lineFileOpen(i8* %1, i32 1)
store %struct.lineFile* %6, %struct.lineFile** %3
%7 = bitcast [21 x i8*]* %4 to i8*
%8 = getelementptr inbounds [21 x i8*], [21 x i8*]* %4, i64 0, i64 0
%9 = call i64 @lineFileNextRowTab(%struct.lineFile* %6, i8** %8, i32 21)
%10 = icmp eq i64 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %2, %11
%12 = call i32 @loadPsl(%struct.pslTbl* %0, i8** %8)
%13 = call i64 @lineFileNextRowTab(%struct.lineFile* %6, i8** %8, i32 21)
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %11
15: ; preds = %11, %2
%16 = call i32 @lineFileClose(%struct.lineFile** %3)
ret void
}