#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 lnode {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ connect(struct lnode *, struct lnode *);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ insert(char *, struct lnode *);
scalar_t__ isspace(char);
char *lin;
scalar_t__ strcmp(char *, char *);
void getlst_1(FILE *fp, char *quit, struct lnode *p1, struct lnode *p2) {
  char *install(), lin[256];
  int firstline = 1;
  connect(p1, p2);
  while (fgets(lin, 256, fp) != NULL && strcmp(lin, quit)) {
    if (firstline) {
      char *p = lin;
      while (isspace(*p))
        ++p;
      if (!*p)
        continue;
      if (lin[0] == ';' && lin[1] == ';')
        continue;
      firstline = 0;
    }
    insert(install(lin), p2);
  }
}


x86 assembly (clang, -O0):
<getlst_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x140,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movl   $0x1,-0x124(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1080 <connect@plt>
lea    -0x120(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x100,%esi
call   1050 <fgets@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x131(%rbp)
je     11d9 <getlst_1+0x79>
lea    -0x120(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x131(%rbp)
mov    -0x131(%rbp),%al
test   $0x1,%al
jne    11ec <getlst_1+0x8c>
jmp    129a <getlst_1+0x13a>
cmpl   $0x0,-0x124(%rbp)
je     127b <getlst_1+0x11b>
lea    -0x120(%rbp),%rax
mov    %rax,-0x130(%rbp)
mov    -0x130(%rbp),%rax
movsbl (%rax),%edi
call   1040 <isspace@plt>
cmp    $0x0,%rax
je     1237 <getlst_1+0xd7>
mov    -0x130(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x130(%rbp)
jmp    1207 <getlst_1+0xa7>
mov    -0x130(%rbp),%rax
cmpb   $0x0,(%rax)
jne    124c <getlst_1+0xec>
jmp    1192 <getlst_1+0x32>
movsbl -0x120(%rbp),%eax
cmp    $0x3b,%eax
jne    1271 <getlst_1+0x111>
movsbl -0x11f(%rbp),%eax
cmp    $0x3b,%eax
jne    1271 <getlst_1+0x111>
jmp    1192 <getlst_1+0x32>
movl   $0x0,-0x124(%rbp)
lea    -0x120(%rbp),%rdi
mov    $0x0,%al
call   1030 <install@plt>
mov    %rax,%rdi
mov    -0x20(%rbp),%rsi
call   1070 <insert@plt>
jmp    1192 <getlst_1+0x32>
add    $0x140,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getlst_1>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x108,%rsp
mov    %rcx,%r14
mov    %rsi,%r15
mov    %rdi,%r12
mov    %rdx,%rdi
mov    %rcx,%rsi
call   1080 <connect@plt>
mov    %rsp,%r13
mov    %r13,%rdi
mov    $0x100,%esi
mov    %r12,%rdx
call   1050 <fgets@plt>
test   %rax,%rax
je     1228 <getlst_1+0xc8>
xor    %ebp,%ebp
jmp    11dd <getlst_1+0x7d>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r13,%rdi
xor    %eax,%eax
call   1030 <install@plt>
mov    %rax,%rdi
mov    %r14,%rsi
call   1070 <insert@plt>
mov    $0x1,%bpl
mov    %r13,%rdi
mov    $0x100,%esi
mov    %r12,%rdx
call   1050 <fgets@plt>
test   %rax,%rax
je     1228 <getlst_1+0xc8>
mov    %r13,%rdi
mov    %r15,%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     1228 <getlst_1+0xc8>
test   $0x1,%bpl
jne    11b0 <getlst_1+0x50>
mov    %r13,%rbx
cs nopw 0x0(%rax,%rax,1)
movsbl (%rbx),%edi
call   1040 <isspace@plt>
add    $0x1,%rbx
test   %rax,%rax
jne    1200 <getlst_1+0xa0>
cmpb   $0x0,-0x1(%rbx)
je     1224 <getlst_1+0xc4>
cmpb   $0x3b,(%rsp)
jne    11b0 <getlst_1+0x50>
cmpb   $0x3b,0x1(%rsp)
jne    11b0 <getlst_1+0x50>
xor    %ebp,%ebp
jmp    11c8 <getlst_1+0x68>
add    $0x108,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.lnode = type { i32 }
@lin = global i8* null
define void @getlst_1(i32* %0, i8* %1, %struct.lnode* %2, %struct.lnode* %3) {
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca %struct.lnode*
%8 = alloca %struct.lnode*
%9 = alloca [256 x i8]
%10 = alloca i32
%11 = alloca i8*
store i32* %0, i32** %5
store i8* %1, i8** %6
store %struct.lnode* %2, %struct.lnode** %7
store %struct.lnode* %3, %struct.lnode** %8
store i32 1, i32* %10
%12 = load %struct.lnode*, %struct.lnode** %7
%13 = load %struct.lnode*, %struct.lnode** %8
%14 = call i32 @connect(%struct.lnode* %12, %struct.lnode* %13)
br label %15
15: ; preds = %57, %55, %44, %4
%16 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%17 = load i32*, i32** %5
%18 = call i32* @fgets(i8* %16, i32 256, i32* %17)
%19 = icmp ne i32* %18, null
br i1 %19, label %20, label %25
20: ; preds = %15
%21 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%22 = load i8*, i8** %6
%23 = call i64 @strcmp(i8* %21, i8* %22)
%24 = icmp ne i64 %23, 0
br label %25
25: ; preds = %20, %15
%26 = phi i1 [ false, %15 ], [ %24, %20 ]
br i1 %26, label %27, label %62
27: ; preds = %25
%28 = load i32, i32* %10
%29 = icmp ne i32 %28, 0
br i1 %29, label %30, label %57
30: ; preds = %27
%31 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
store i8* %31, i8** %11
br label %32
32: ; preds = %37, %30
%33 = load i8*, i8** %11
%34 = load i8, i8* %33
%35 = call i64 @isspace(i8 signext %34)
%36 = icmp ne i64 %35, 0
br i1 %36, label %37, label %40
37: ; preds = %32
%38 = load i8*, i8** %11
%39 = getelementptr inbounds i8, i8* %38, i32 1
store i8* %39, i8** %11
br label %32
40: ; preds = %32
%41 = load i8*, i8** %11
%42 = load i8, i8* %41
%43 = icmp ne i8 %42, 0
br i1 %43, label %45, label %44
44: ; preds = %40
br label %15
45: ; preds = %40
%46 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%47 = load i8, i8* %46
%48 = sext i8 %47 to i32
%49 = icmp eq i32 %48, 59
br i1 %49, label %50, label %56
50: ; preds = %45
%51 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 1
%52 = load i8, i8* %51
%53 = sext i8 %52 to i32
%54 = icmp eq i32 %53, 59
br i1 %54, label %55, label %56
55: ; preds = %50
br label %15
56: ; preds = %50, %45
store i32 0, i32* %10
br label %57
57: ; preds = %56, %27
%58 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%59 = call i8* (i8*, ...) bitcast (i8* (...)* @install to i8* (i8*, ...)*)(i8* %58)
%60 = load %struct.lnode*, %struct.lnode** %8
%61 = call i32 @insert(i8* %59, %struct.lnode* %60)
br label %15
62: ; preds = %25
ret void
}

LLVM IR (-O2):
%struct.lnode = type { i32 }
@lin = global i8* null
define void @getlst_1(i32* nocapture %0, i8* %1, %struct.lnode* %2, %struct.lnode* %3) {
%5 = alloca [256 x i8]
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%7 = tail call i32 @connect(%struct.lnode* %2, %struct.lnode* %3)
%8 = call i32* @fgets(i8* %6, i32 256, i32* %0)
%9 = icmp eq i32* %8, null
br i1 %9, label %39, label %10
10: ; preds = %4
%11 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 1
br label %12
12: ; preds = %10, %35
%13 = phi i1 [ false, %10 ], [ %36, %35 ]
%14 = call i64 @strcmp(i8* %6, i8* %1)
%15 = icmp eq i64 %14, 0
br i1 %15, label %39, label %16
16: ; preds = %12
br i1 %13, label %32, label %17
17: ; preds = %16, %17
%18 = phi i8* [ %22, %17 ], [ %6, %16 ]
%19 = load i8, i8* %18
%20 = call i64 @isspace(i8 signext %19)
%21 = icmp eq i64 %20, 0
%22 = getelementptr inbounds i8, i8* %18, i64 1
br i1 %21, label %23, label %17
23: ; preds = %17
%24 = load i8, i8* %18
%25 = icmp eq i8 %24, 0
br i1 %25, label %35, label %26
26: ; preds = %23
%27 = load i8, i8* %6
%28 = icmp eq i8 %27, 59
%29 = load i8, i8* %11
%30 = icmp eq i8 %29, 59
%31 = select i1 %28, i1 %30, i1 false
br i1 %31, label %35, label %32
32: ; preds = %26, %16
%33 = call i8* (i8*, ...) bitcast (i8* (...)* @install to i8* (i8*, ...)*)(i8* %6)
%34 = call i32 @insert(i8* %33, %struct.lnode* %3)
br label %35
35: ; preds = %23, %26, %32
%36 = phi i1 [ true, %32 ], [ false, %26 ], [ false, %23 ]
%37 = call i32* @fgets(i8* %6, i32 256, i32* %0)
%38 = icmp eq i32* %37, null
br i1 %38, label %39, label %12
39: ; preds = %12, %35, %4
ret void
}