#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 dvb_frontend_info {
  scalar_t__ type;
  int /*<<< orphan*/ name;
};
typedef int /*<<< orphan*/ fe_dev;

/* Variables and functions */
scalar_t__ EINTR;
scalar_t__ FE_ATSC;
int /*<<< orphan*/ FE_GET_INFO;
scalar_t__ FE_OFDM;
scalar_t__ FE_QAM;
scalar_t__ FE_QPSK;
int O_NONBLOCK;
int O_RDONLY;
int PATH_MAX;
int /*<<< orphan*/ close(int);
scalar_t__ errno;
int /*<<< orphan*/ fatal(char *, char *, ...);
scalar_t__ ioctl(int, int /*<<< orphan*/, struct dvb_frontend_info *);
int open(char *, int);
int /*<<< orphan*/ snprintf(char *, int, char *, unsigned int, unsigned int);
int /*<<< orphan*/ strerror(scalar_t__);
int /*<<< orphan*/ vverbose(char *, ...);
char *zap_name(unsigned int adapter, unsigned int frontend) {
  char fe_dev[PATH_MAX];
  int fe_fd;
  struct dvb_frontend_info fe_info;
  bool got_info;
  snprintf(fe_dev, sizeof(fe_dev), "/dev/dvb/adapter%u/frontend%u", adapter,
           frontend);
  if ((fe_fd = open(fe_dev, O_RDONLY | O_NONBLOCK)) < 0)
    fatal("open '%s': %s", fe_dev, strerror(errno));
  vverbose("Getting frontend info");
  do {
    got_info = (ioctl(fe_fd, FE_GET_INFO, &fe_info) >= 0);
    if (!got_info && errno != EINTR)
      fatal("ioctl FE_GET_INFO: %s", strerror(errno));
  } while (!got_info);
  close(fe_fd);
  if (fe_info.type == FE_OFDM) {
    vverbose("Adapter %u is a '%s' DVB-T card", adapter, fe_info.name);
    return "tzap";
  } else if (fe_info.type == FE_QPSK) {
    vverbose("Adapter %u is a '%s' DVB-S card", adapter, fe_info.name);
    return "szap";
  } else if (fe_info.type == FE_QAM) {
    vverbose("Adapter %u is a '%s' DVB-C card", adapter, fe_info.name);
    return "czap";
  } else if (fe_info.type == FE_ATSC) {
    vverbose("Adapter %u is a '%s' ATSC card", adapter, fe_info.name);
    return "azap";
  } else {
    vverbose("Adapter %u (%s); unknown card type %d", adapter, fe_info.name,
             fe_info.type);
    return "";
  }
}


x86 assembly (clang, -O0):
<zap_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    0x2e6b(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x48(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x20(%rbp)
mov    %eax,%esi
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
lea    0xe46(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x48(%rbp),%rdi
mov    0x2e0e(%rip),%rax
mov    (%rax),%esi
mov    0x2e0d(%rip),%rax
or     (%rax),%esi
call   1070 <open@plt>
mov    %eax,-0x24(%rbp)
cmp    $0x0,%eax
jge    1209 <zap_name+0x99>
mov    0x2dcb(%rip),%rax
mov    (%rax),%rdi
call   1080 <strerror@plt>
mov    -0x48(%rbp),%rsi
mov    %eax,%edx
lea    0xe1c(%rip),%rdi
mov    $0x0,%al
call   1090 <fatal@plt>
lea    0xe1c(%rip),%rdi
mov    $0x0,%al
call   1060 <vverbose@plt>
mov    -0x24(%rbp),%edi
mov    0x2daf(%rip),%rax
mov    (%rax),%esi
lea    -0x38(%rbp),%rdx
call   1040 <ioctl@plt>
cmp    $0x0,%rax
setge  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x3c(%rbp)
cmpl   $0x0,-0x3c(%rbp)
jne    127f <zap_name+0x10f>
mov    0x2d6c(%rip),%rax
mov    (%rax),%rax
mov    0x2d52(%rip),%rcx
cmp    (%rcx),%rax
je     127f <zap_name+0x10f>
mov    0x2d52(%rip),%rax
mov    (%rax),%rdi
call   1080 <strerror@plt>
movslq %eax,%rsi
lea    0xdca(%rip),%rdi
mov    $0x0,%al
call   1090 <fatal@plt>
jmp    1284 <zap_name+0x114>
cmpl   $0x0,-0x3c(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1217 <zap_name+0xa7>
mov    -0x24(%rbp),%edi
call   1050 <close@plt>
mov    -0x38(%rbp),%rax
mov    0x2d20(%rip),%rcx
cmp    (%rcx),%rax
jne    12dc <zap_name+0x16c>
mov    -0xc(%rbp),%esi
mov    -0x30(%rbp),%edx
lea    0xd9a(%rip),%rdi
mov    $0x0,%al
call   1060 <vverbose@plt>
lea    0xdac(%rip),%rax
mov    %rax,-0x8(%rbp)
movl   $0x1,-0x40(%rbp)
jmp    13c3 <zap_name+0x253>
mov    -0x38(%rbp),%rax
mov    0x2cb9(%rip),%rcx
cmp    (%rcx),%rax
jne    131b <zap_name+0x1ab>
mov    -0xc(%rbp),%esi
mov    -0x30(%rbp),%edx
lea    0xd80(%rip),%rdi
mov    $0x0,%al
call   1060 <vverbose@plt>
lea    0xd92(%rip),%rax
mov    %rax,-0x8(%rbp)
movl   $0x1,-0x40(%rbp)
jmp    13c3 <zap_name+0x253>
mov    -0x38(%rbp),%rax
mov    0x2c72(%rip),%rcx
cmp    (%rcx),%rax
jne    135a <zap_name+0x1ea>
mov    -0xc(%rbp),%esi
mov    -0x30(%rbp),%edx
lea    0xd66(%rip),%rdi
mov    $0x0,%al
call   1060 <vverbose@plt>
lea    0xd78(%rip),%rax
mov    %rax,-0x8(%rbp)
movl   $0x1,-0x40(%rbp)
jmp    13c3 <zap_name+0x253>
mov    -0x38(%rbp),%rax
mov    0x2c4b(%rip),%rcx
cmp    (%rcx),%rax
jne    1399 <zap_name+0x229>
mov    -0xc(%rbp),%esi
mov    -0x30(%rbp),%edx
lea    0xd4c(%rip),%rdi
mov    $0x0,%al
call   1060 <vverbose@plt>
lea    0xd5d(%rip),%rax
mov    %rax,-0x8(%rbp)
movl   $0x1,-0x40(%rbp)
jmp    13c3 <zap_name+0x253>
mov    -0xc(%rbp),%esi
mov    -0x30(%rbp),%edx
mov    -0x38(%rbp),%rcx
lea    0xd41(%rip),%rdi
mov    $0x0,%al
call   1060 <vverbose@plt>
lea    0xd58(%rip),%rax
mov    %rax,-0x8(%rbp)
movl   $0x1,-0x40(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    -0x8(%rbp),%rax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zap_name>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %esi,%r8d
mov    %edi,%ecx
mov    0x2e63(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%r15
mov    %rsi,%rax
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r15
mov    %r15,%rsp
lea    0xe56(%rip),%rdx
mov    %r15,%rdi
mov    %ecx,-0x2c(%rbp)
call   1030 <snprintf@plt>
mov    0x2e1c(%rip),%rax
mov    0x2e1d(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    %r15,%rdi
call   1070 <open@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    11f7 <zap_name+0x87>
mov    0x2ddc(%rip),%rax
mov    (%rax),%rdi
call   1080 <strerror@plt>
lea    0xe33(%rip),%rdi
mov    %r15,%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1090 <fatal@plt>
lea    0xe2e(%rip),%rdi
xor    %eax,%eax
call   1060 <vverbose@plt>
mov    0x2dc4(%rip),%r13
mov    0x0(%r13),%esi
lea    -0x40(%rbp),%rdx
mov    %ebx,%edi
call   1040 <ioctl@plt>
test   %rax,%rax
js     1283 <zap_name+0x113>
mov    %ebx,%edi
call   1050 <close@plt>
mov    -0x40(%rbp),%rcx
mov    0x2d96(%rip),%rax
cmp    (%rax),%rcx
jne    1257 <zap_name+0xe7>
mov    -0x38(%rbp),%edx
lea    0xe17(%rip),%rdi
mov    -0x2c(%rbp),%esi
xor    %eax,%eax
call   1060 <vverbose@plt>
lea    0xe26(%rip),%rax
jmp    1342 <zap_name+0x1d2>
mov    0x2d42(%rip),%rax
cmp    (%rax),%rcx
jne    12d8 <zap_name+0x168>
mov    -0x38(%rbp),%edx
lea    0xe10(%rip),%rdi
mov    -0x2c(%rbp),%esi
xor    %eax,%eax
call   1060 <vverbose@plt>
lea    0xe1f(%rip),%rax
jmp    1342 <zap_name+0x1d2>
mov    0x2d2e(%rip),%r14
mov    0x2d17(%rip),%r12
lea    -0x40(%rbp),%r15
jmp    12b7 <zap_name+0x147>
nopw   0x0(%rax,%rax,1)
mov    0x0(%r13),%esi
mov    %ebx,%edi
mov    %r15,%rdx
call   1040 <ioctl@plt>
test   %rax,%rax
jns    1220 <zap_name+0xb0>
mov    (%r14),%rdi
cmp    (%r12),%rdi
je     12a0 <zap_name+0x130>
call   1080 <strerror@plt>
movslq %eax,%rsi
lea    0xd73(%rip),%rdi
xor    %eax,%eax
call   1090 <fatal@plt>
jmp    12a0 <zap_name+0x130>
mov    0x2cb9(%rip),%rax
cmp    (%rax),%rcx
jne    1301 <zap_name+0x191>
mov    -0x38(%rbp),%edx
lea    0xdb4(%rip),%rdi
mov    -0x2c(%rbp),%esi
xor    %eax,%eax
call   1060 <vverbose@plt>
lea    0xdc3(%rip),%rax
jmp    1342 <zap_name+0x1d2>
mov    0x2ca8(%rip),%rax
mov    -0x38(%rbp),%edx
cmp    (%rax),%rcx
jne    132a <zap_name+0x1ba>
lea    0xdb0(%rip),%rdi
mov    -0x2c(%rbp),%esi
xor    %eax,%eax
call   1060 <vverbose@plt>
lea    0xdbe(%rip),%rax
jmp    1342 <zap_name+0x1d2>
lea    0xdba(%rip),%rdi
mov    -0x2c(%rbp),%esi
xor    %eax,%eax
call   1060 <vverbose@plt>
lea    0xdce(%rip),%rax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.dvb_frontend_info = type { i64, i32 }
@PATH_MAX = global i32 0
@.str = [30 x i8] c"/dev/dvb/adapter%u/frontend%u\00"
@O_RDONLY = global i32 0
@O_NONBLOCK = global i32 0
@.str.1 = [14 x i8] c"open '%s': %s\00"
@errno = global i64 0
@.str.2 = [22 x i8] c"Getting frontend info\00"
@FE_GET_INFO = global i32 0
@EINTR = global i64 0
@.str.3 = [22 x i8] c"ioctl FE_GET_INFO: %s\00"
@FE_OFDM = global i64 0
@.str.4 = [32 x i8] c"Adapter %u is a '%s' DVB-T card\00"
@.str.5 = [5 x i8] c"tzap\00"
@FE_QPSK = global i64 0
@.str.6 = [32 x i8] c"Adapter %u is a '%s' DVB-S card\00"
@.str.7 = [5 x i8] c"szap\00"
@FE_QAM = global i64 0
@.str.8 = [32 x i8] c"Adapter %u is a '%s' DVB-C card\00"
@.str.9 = [5 x i8] c"czap\00"
@FE_ATSC = global i64 0
@.str.10 = [31 x i8] c"Adapter %u is a '%s' ATSC card\00"
@.str.11 = [5 x i8] c"azap\00"
@.str.12 = [38 x i8] c"Adapter %u (%s); unknown card type %d\00"
@.str.13 = [1 x i8] zeroinitializer
define i8* @zap_name(i32 %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32
%9 = alloca %struct.dvb_frontend_info
%10 = alloca i32
%11 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%12 = load i32, i32* @PATH_MAX
%13 = zext i32 %12 to i64
%14 = call i8* @llvm.stacksave()
store i8* %14, i8** %6
%15 = alloca i8, i64 %13
store i64 %13, i64* %7
%16 = trunc i64 %13 to i32
%17 = load i32, i32* %4
%18 = load i32, i32* %5
%19 = call i32 @snprintf(i8* %15, i32 %16, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %17, i32 %18)
%20 = load i32, i32* @O_RDONLY
%21 = load i32, i32* @O_NONBLOCK
%22 = or i32 %20, %21
%23 = call i32 @open(i8* %15, i32 %22)
store i32 %23, i32* %8
%24 = icmp slt i32 %23, 0
br i1 %24, label %25, label %29
25: ; preds = %2
%26 = load i64, i64* @errno
%27 = call i32 @strerror(i64 %26)
%28 = call i32 (i8*, i8*, ...) @fatal(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %15, i32 %27)
br label %29
29: ; preds = %25, %2
%30 = call i32 (i8*, ...) @vverbose(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
br label %31
31: ; preds = %50, %29
%32 = load i32, i32* %8
%33 = load i32, i32* @FE_GET_INFO
%34 = call i64 @ioctl(i32 %32, i32 %33, %struct.dvb_frontend_info* %9)
%35 = icmp sge i64 %34, 0
%36 = zext i1 %35 to i32
store i32 %36, i32* %10
%37 = load i32, i32* %10
%38 = icmp ne i32 %37, 0
br i1 %38, label %49, label %39
39: ; preds = %31
%40 = load i64, i64* @errno
%41 = load i64, i64* @EINTR
%42 = icmp ne i64 %40, %41
br i1 %42, label %43, label %49
43: ; preds = %39
%44 = load i64, i64* @errno
%45 = call i32 @strerror(i64 %44)
%46 = sext i32 %45 to i64
%47 = inttoptr i64 %46 to i8*
%48 = call i32 (i8*, i8*, ...) @fatal(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), i8* %47)
br label %49
49: ; preds = %43, %39, %31
br label %50
50: ; preds = %49
%51 = load i32, i32* %10
%52 = icmp ne i32 %51, 0
%53 = xor i1 %52, true
br i1 %53, label %31, label %54
54: ; preds = %50
%55 = load i32, i32* %8
%56 = call i32 @close(i32 %55)
%57 = getelementptr inbounds %struct.dvb_frontend_info, %struct.dvb_frontend_info* %9, i32 0, i32 0
%58 = load i64, i64* %57
%59 = load i64, i64* @FE_OFDM
%60 = icmp eq i64 %58, %59
br i1 %60, label %61, label %66
61: ; preds = %54
%62 = load i32, i32* %4
%63 = getelementptr inbounds %struct.dvb_frontend_info, %struct.dvb_frontend_info* %9, i32 0, i32 1
%64 = load i32, i32* %63
%65 = call i32 (i8*, ...) @vverbose(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0), i32 %62, i32 %64)
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i8** %3
store i32 1, i32* %11
br label %103
66: ; preds = %54
%67 = getelementptr inbounds %struct.dvb_frontend_info, %struct.dvb_frontend_info* %9, i32 0, i32 0
%68 = load i64, i64* %67
%69 = load i64, i64* @FE_QPSK
%70 = icmp eq i64 %68, %69
br i1 %70, label %71, label %76
71: ; preds = %66
%72 = load i32, i32* %4
%73 = getelementptr inbounds %struct.dvb_frontend_info, %struct.dvb_frontend_info* %9, i32 0, i32 1
%74 = load i32, i32* %73
%75 = call i32 (i8*, ...) @vverbose(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.6, i64 0, i64 0), i32 %72, i32 %74)
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i8** %3
store i32 1, i32* %11
br label %103
76: ; preds = %66
%77 = getelementptr inbounds %struct.dvb_frontend_info, %struct.dvb_frontend_info* %9, i32 0, i32 0
%78 = load i64, i64* %77
%79 = load i64, i64* @FE_QAM
%80 = icmp eq i64 %78, %79
br i1 %80, label %81, label %86
81: ; preds = %76
%82 = load i32, i32* %4
%83 = getelementptr inbounds %struct.dvb_frontend_info, %struct.dvb_frontend_info* %9, i32 0, i32 1
%84 = load i32, i32* %83
%85 = call i32 (i8*, ...) @vverbose(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.8, i64 0, i64 0), i32 %82, i32 %84)
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0), i8** %3
store i32 1, i32* %11
br label %103
86: ; preds = %76
%87 = getelementptr inbounds %struct.dvb_frontend_info, %struct.dvb_frontend_info* %9, i32 0, i32 0
%88 = load i64, i64* %87
%89 = load i64, i64* @FE_ATSC
%90 = icmp eq i64 %88, %89
br i1 %90, label %91, label %96
91: ; preds = %86
%92 = load i32, i32* %4
%93 = getelementptr inbounds %struct.dvb_frontend_info, %struct.dvb_frontend_info* %9, i32 0, i32 1
%94 = load i32, i32* %93
%95 = call i32 (i8*, ...) @vverbose(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.10, i64 0, i64 0), i32 %92, i32 %94)
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0), i8** %3
store i32 1, i32* %11
br label %103
96: ; preds = %86
%97 = load i32, i32* %4
%98 = getelementptr inbounds %struct.dvb_frontend_info, %struct.dvb_frontend_info* %9, i32 0, i32 1
%99 = load i32, i32* %98
%100 = getelementptr inbounds %struct.dvb_frontend_info, %struct.dvb_frontend_info* %9, i32 0, i32 0
%101 = load i64, i64* %100
%102 = call i32 (i8*, ...) @vverbose(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.12, i64 0, i64 0), i32 %97, i32 %99, i64 %101)
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.13, i64 0, i64 0), i8** %3
store i32 1, i32* %11
br label %103
103: ; preds = %96, %91, %81, %71, %61
%104 = load i8*, i8** %6
%105 = load i8*, i8** %3
ret i8* %105
}

LLVM IR (-O2):
%struct.dvb_frontend_info = type { i64, i32 }
@PATH_MAX = global i32 0
@.str = [30 x i8] c"/dev/dvb/adapter%u/frontend%u\00"
@O_RDONLY = global i32 0
@O_NONBLOCK = global i32 0
@.str.1 = [14 x i8] c"open '%s': %s\00"
@errno = global i64 0
@.str.2 = [22 x i8] c"Getting frontend info\00"
@FE_GET_INFO = global i32 0
@EINTR = global i64 0
@.str.3 = [22 x i8] c"ioctl FE_GET_INFO: %s\00"
@FE_OFDM = global i64 0
@.str.4 = [32 x i8] c"Adapter %u is a '%s' DVB-T card\00"
@.str.5 = [5 x i8] c"tzap\00"
@FE_QPSK = global i64 0
@.str.6 = [32 x i8] c"Adapter %u is a '%s' DVB-S card\00"
@.str.7 = [5 x i8] c"szap\00"
@FE_QAM = global i64 0
@.str.8 = [32 x i8] c"Adapter %u is a '%s' DVB-C card\00"
@.str.9 = [5 x i8] c"czap\00"
@FE_ATSC = global i64 0
@.str.10 = [31 x i8] c"Adapter %u is a '%s' ATSC card\00"
@.str.11 = [5 x i8] c"azap\00"
@.str.12 = [38 x i8] c"Adapter %u (%s); unknown card type %d\00"
@.str.13 = [1 x i8] zeroinitializer
define i8* @zap_name(i32 %0, i32 %1) {
%3 = alloca %struct.dvb_frontend_info
%4 = load i32, i32* @PATH_MAX
%5 = zext i32 %4 to i64
%6 = alloca i8, i64 %5
%7 = bitcast %struct.dvb_frontend_info* %3 to i8*
%8 = call i32 @snprintf(i8* %6, i32 %4, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
%9 = load i32, i32* @O_RDONLY
%10 = load i32, i32* @O_NONBLOCK
%11 = or i32 %10, %9
%12 = call i32 @open(i8* %6, i32 %11)
%13 = icmp slt i32 %12, 0
br i1 %13, label %14, label %18
14: ; preds = %2
%15 = load i64, i64* @errno
%16 = call i32 @strerror(i64 %15)
%17 = call i32 (i8*, i8*, ...) @fatal(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %6, i32 %16)
br label %18
18: ; preds = %14, %2
%19 = call i32 (i8*, ...) @vverbose(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%20 = load i32, i32* @FE_GET_INFO
%21 = call i64 @ioctl(i32 %12, i32 %20, %struct.dvb_frontend_info* %3)
%22 = icmp sgt i64 %21, -1
br i1 %22, label %36, label %23
23: ; preds = %18, %32
%24 = load i64, i64* @errno
%25 = load i64, i64* @EINTR
%26 = icmp eq i64 %24, %25
br i1 %26, label %32, label %27
27: ; preds = %23
%28 = call i32 @strerror(i64 %24)
%29 = sext i32 %28 to i64
%30 = inttoptr i64 %29 to i8*
%31 = call i32 (i8*, i8*, ...) @fatal(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), i8* %30)
br label %32
32: ; preds = %23, %27
%33 = load i32, i32* @FE_GET_INFO
%34 = call i64 @ioctl(i32 %12, i32 %33, %struct.dvb_frontend_info* %3)
%35 = icmp sgt i64 %34, -1
br i1 %35, label %36, label %23
36: ; preds = %32, %18
%37 = call i32 @close(i32 %12)
%38 = getelementptr inbounds %struct.dvb_frontend_info, %struct.dvb_frontend_info* %3, i64 0, i32 0
%39 = load i64, i64* %38
%40 = load i64, i64* @FE_OFDM
%41 = icmp eq i64 %39, %40
br i1 %41, label %42, label %46
42: ; preds = %36
%43 = getelementptr inbounds %struct.dvb_frontend_info, %struct.dvb_frontend_info* %3, i64 0, i32 1
%44 = load i32, i32* %43
%45 = call i32 (i8*, ...) @vverbose(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0), i32 %0, i32 %44)
br label %69
46: ; preds = %36
%47 = load i64, i64* @FE_QPSK
%48 = icmp eq i64 %39, %47
br i1 %48, label %49, label %53
49: ; preds = %46
%50 = getelementptr inbounds %struct.dvb_frontend_info, %struct.dvb_frontend_info* %3, i64 0, i32 1
%51 = load i32, i32* %50
%52 = call i32 (i8*, ...) @vverbose(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.6, i64 0, i64 0), i32 %0, i32 %51)
br label %69
53: ; preds = %46
%54 = load i64, i64* @FE_QAM
%55 = icmp eq i64 %39, %54
br i1 %55, label %56, label %60
56: ; preds = %53
%57 = getelementptr inbounds %struct.dvb_frontend_info, %struct.dvb_frontend_info* %3, i64 0, i32 1
%58 = load i32, i32* %57
%59 = call i32 (i8*, ...) @vverbose(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.8, i64 0, i64 0), i32 %0, i32 %58)
br label %69
60: ; preds = %53
%61 = load i64, i64* @FE_ATSC
%62 = icmp eq i64 %39, %61
%63 = getelementptr inbounds %struct.dvb_frontend_info, %struct.dvb_frontend_info* %3, i64 0, i32 1
%64 = load i32, i32* %63
br i1 %62, label %65, label %67
65: ; preds = %60
%66 = call i32 (i8*, ...) @vverbose(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.10, i64 0, i64 0), i32 %0, i32 %64)
br label %69
67: ; preds = %60
%68 = call i32 (i8*, ...) @vverbose(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.12, i64 0, i64 0), i32 %0, i32 %64, i64 %39)
br label %69
69: ; preds = %67, %65, %56, %49, %42
%70 = phi i8* [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), %42 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), %49 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0), %56 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0), %65 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.13, i64 0, i64 0), %67 ]
ret i8* %70
}