#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 StringLst {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gz_getlines(struct StringLst *, char const *);
int /*<<< orphan*/ plain_getlines(struct StringLst *, char const *);
scalar_t__ strcmp(char const *, char *);
int /*<<< orphan*/ warnx(char *, char const *);
int getlines(struct StringLst *tags, const char *comptype,
             const char *filename) {
  warnx("Attempting to read tag file %s", filename);
  if ((strcmp((comptype), ("none")) == 0)) {
    plain_getlines(tags, filename);
  } else if ((strcmp((comptype), ("gzip")) == 0)) {
    gz_getlines(tags, filename);
  } else {
    warnx("Unknown compression type %s!", comptype);
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<getlines>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
lea    0xea1(%rip),%rdi
call   1040 <warnx@plt>
mov    -0x18(%rbp),%rdi
lea    0xeb0(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1190 <getlines+0x50>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <plain_getlines@plt>
jmp    11dd <getlines+0x9d>
mov    -0x18(%rbp),%rdi
lea    0xe89(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    11bc <getlines+0x7c>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1060 <gz_getlines@plt>
jmp    11d8 <getlines+0x98>
mov    -0x18(%rbp),%rsi
lea    0xe62(%rip),%rdi
call   1040 <warnx@plt>
movl   $0x0,-0x4(%rbp)
jmp    11e4 <getlines+0xa4>
jmp    11dd <getlines+0x9d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getlines>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
lea    0xeab(%rip),%rdi
mov    %rdx,%rsi
call   1040 <warnx@plt>
lea    0xebb(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
je     1198 <getlines+0x58>
lea    0xeac(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
je     11a5 <getlines+0x65>
lea    0xe9d(%rip),%rdi
mov    %rbx,%rsi
call   1040 <warnx@plt>
xor    %eax,%eax
jmp    11b5 <getlines+0x75>
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <plain_getlines@plt>
jmp    11b0 <getlines+0x70>
mov    %r15,%rdi
mov    %r14,%rsi
call   1060 <gz_getlines@plt>
mov    $0x1,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.StringLst = type { i32 }
@.str = [31 x i8] c"Attempting to read tag file %s\00"
@.str.1 = [5 x i8] c"none\00"
@.str.2 = [5 x i8] c"gzip\00"
@.str.3 = [29 x i8] c"Unknown compression type %s!\00"
define i32 @getlines(%struct.StringLst* %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca %struct.StringLst*
%6 = alloca i8*
%7 = alloca i8*
store %struct.StringLst* %0, %struct.StringLst** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
%8 = load i8*, i8** %7
%9 = call i32 @warnx(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = load i8*, i8** %6
%11 = call i64 @strcmp(i8* %10, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %3
%14 = load %struct.StringLst*, %struct.StringLst** %5
%15 = load i8*, i8** %7
%16 = call i32 @plain_getlines(%struct.StringLst* %14, i8* %15)
br label %29
17: ; preds = %3
%18 = load i8*, i8** %6
%19 = call i64 @strcmp(i8* %18, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %25
21: ; preds = %17
%22 = load %struct.StringLst*, %struct.StringLst** %5
%23 = load i8*, i8** %7
%24 = call i32 @gz_getlines(%struct.StringLst* %22, i8* %23)
br label %28
25: ; preds = %17
%26 = load i8*, i8** %6
%27 = call i32 @warnx(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i8* %26)
store i32 0, i32* %4
br label %30
28: ; preds = %21
br label %29
29: ; preds = %28, %13
store i32 1, i32* %4
br label %30
30: ; preds = %29, %25
%31 = load i32, i32* %4
ret i32 %31
}

LLVM IR (-O2):
%struct.StringLst = type { i32 }
@.str = [31 x i8] c"Attempting to read tag file %s\00"
@.str.1 = [5 x i8] c"none\00"
@.str.2 = [5 x i8] c"gzip\00"
@.str.3 = [29 x i8] c"Unknown compression type %s!\00"
define i32 @getlines(%struct.StringLst* %0, i8* %1, i8* %2) {
%4 = tail call i32 @warnx(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %2)
%5 = tail call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 @plain_getlines(%struct.StringLst* %0, i8* %2)
br label %16
9: ; preds = %3
%10 = tail call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %9
%13 = tail call i32 @gz_getlines(%struct.StringLst* %0, i8* %2)
br label %16
14: ; preds = %9
%15 = tail call i32 @warnx(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i8* %1)
br label %16
16: ; preds = %7, %12, %14
%17 = phi i32 [ 0, %14 ], [ 1, %12 ], [ 1, %7 ]
ret i32 %17
}