#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 */
typedef struct TYPE_8__ TYPE_4__;
typedef struct TYPE_7__ TYPE_3__;
typedef struct TYPE_6__ TYPE_2__;
typedef struct TYPE_5__ TYPE_1__;

/* Type definitions */
struct TYPE_7__ {
  unsigned int symbol_rate;
  void *modulation;
  void *fec_inner;
};
struct TYPE_6__ {
  unsigned int symbol_rate;
  void *fec_inner;
};
struct TYPE_5__ {
  int /*<<< orphan*/ hierarchy_information;
  int /*<<< orphan*/ guard_interval;
  int /*<<< orphan*/ transmission_mode;
  void *constellation;
  int /*<<< orphan*/ code_rate_LP;
  int /*<<< orphan*/ code_rate_HP;
  int /*<<< orphan*/ bandwidth;
};
struct TYPE_8__ {
  TYPE_3__ qam;
  TYPE_2__ qpsk;
  TYPE_1__ ofdm;
};
struct dvb_frontend_parameters {
  unsigned int frequency;
  TYPE_4__ u;
  void *inversion;
};
struct dvb_frontend_info {
  char *name;
  int type;
};
typedef int /*<<< orphan*/ fe_transmit_mode_t;
typedef void *fe_spectral_inversion_t;
typedef void *fe_modulation_t;
typedef int /*<<< orphan*/ fe_guard_interval_t;
typedef int /*<<< orphan*/ fe_code_rate_t;
typedef int /*<<< orphan*/ fe_bandwidth_t;

/* Variables and functions */
int /*<<< orphan*/ BANDWIDTH_7_MHZ;
int /*<<< orphan*/ BANDWIDTH_8_MHZ;
void *FEC_AUTO;
int /*<<< orphan*/ FE_GET_INFO;
#define FE_OFDM 130
#define FE_QAM 129
#define FE_QPSK 128
int /*<<< orphan*/ HIERARCHY_NONE;
void *INVERSION_OFF;
int SEC_TONE_ON;
int check_status(int, int, struct dvb_frontend_parameters *, unsigned int);
int /*<<< orphan*/ do_diseqc(int, unsigned char, int, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
scalar_t__ ioctl(int, int /*<<< orphan*/, struct dvb_frontend_info *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ stderr;
char toupper(char);
int /*<<< orphan*/ usleep(int);
int tune_it(int fd_frontend, unsigned int freq, unsigned int srate, char pol,
            int tone, fe_spectral_inversion_t specInv, unsigned char diseqc,
            fe_modulation_t modulation, fe_code_rate_t HP_CodeRate,
            fe_transmit_mode_t TransmissionMode,
            fe_guard_interval_t guardInterval, fe_bandwidth_t bandwidth) {
  int res, hi_lo, dfd;
  unsigned int base = 0;
  struct dvb_frontend_parameters feparams;
  struct dvb_frontend_info fe_info;
  if ((res = ioctl(fd_frontend, FE_GET_INFO, &fe_info) < 0)) {
    perror("FE_GET_INFO: ");
    return -1;
  }
  fprintf(stderr, "Using DVB card \"%s\", freq=%d\n", fe_info.name, freq);
  if (freq < 1000000)
    freq *= 1000UL;
  switch (fe_info.type) {
  case FE_OFDM:
    feparams.frequency = freq;
    feparams.inversion = INVERSION_OFF;
    feparams.u.ofdm.bandwidth = bandwidth;
    feparams.u.ofdm.code_rate_HP = HP_CodeRate;
    feparams.u.ofdm.code_rate_LP = (0);
    feparams.u.ofdm.constellation = modulation;
    feparams.u.ofdm.transmission_mode = TransmissionMode;
    feparams.u.ofdm.guard_interval = guardInterval;
    feparams.u.ofdm.hierarchy_information = HIERARCHY_NONE;
    fprintf(stderr, "tuning DVB-T (%s) to %d Hz, Bandwidth: %d\n",
            "in United Kingdom", freq,
            bandwidth == BANDWIDTH_8_MHZ
                ? 8
                : (bandwidth == BANDWIDTH_7_MHZ ? 7 : 6));
    break;
  case FE_QPSK:
    pol = toupper(pol);
    if (freq > 2200000) {
      if (freq < (11700 * 1000UL)) {
        feparams.frequency = (freq - (9750 * 1000UL));
        hi_lo = 0;
        base = (9750 * 1000UL);
      } else {
        feparams.frequency = (freq - (10600 * 1000UL));
        hi_lo = 1;
        base = (10600 * 1000UL);
      }
    } else {
      feparams.frequency = freq;
      hi_lo = 0;
      base = 0;
    }
    fprintf(
        stderr,
        "tuning DVB-S to Freq: %u, Pol:%c Srate=%d, 22kHz tone=%s, LNB: %d\n",
        feparams.frequency, pol, srate, tone == SEC_TONE_ON ? "on" : "off",
        diseqc);
    feparams.inversion = specInv;
    feparams.u.qpsk.symbol_rate = srate;
    feparams.u.qpsk.fec_inner = FEC_AUTO;
    dfd = fd_frontend;
    if (do_diseqc(dfd, diseqc, (pol == 'V' ? 1 : 0), hi_lo) == 0)
      fprintf(stderr, "DISEQC SETTING SUCCEDED\n");
    else {
      fprintf(stderr, "DISEQC SETTING FAILED\n");
      return -1;
    }
    break;
  case FE_QAM:
    fprintf(stderr, "tuning DVB-C to %d, srate=%d\n", freq, srate);
    feparams.frequency = freq;
    feparams.inversion = INVERSION_OFF;
    feparams.u.qam.symbol_rate = srate;
    feparams.u.qam.fec_inner = FEC_AUTO;
    feparams.u.qam.modulation = modulation;
    break;
  default:
    fprintf(stderr, "Unknown FE type. Aborting\n");
    exit(-1);
  }
  usleep(100000);
  return (check_status(fd_frontend, fe_info.type, &feparams, base));
}


x86 assembly (clang, -O0):
<tune_it>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
mov    %cl,%al
mov    0x38(%rbp),%ecx
mov    0x30(%rbp),%ecx
mov    0x28(%rbp),%ecx
mov    0x20(%rbp),%ecx
mov    0x18(%rbp),%rcx
mov    0x10(%rbp),%cl
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
movl   $0x0,-0x30(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2e0b(%rip),%rax
mov    (%rax),%esi
lea    -0xa0(%rbp),%rdx
call   1050 <ioctl@plt>
cmp    $0x0,%rax
setl   %al
mov    %al,%cl
and    $0x1,%cl
movzbl %cl,%ecx
mov    %ecx,-0x24(%rbp)
test   $0x1,%al
jne    11f2 <tune_it+0x72>
jmp    120a <tune_it+0x8a>
lea    0xe07(%rip),%rdi
call   1080 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    155f <tune_it+0x3df>
mov    0x2daf(%rip),%rax
mov    (%rax),%edi
mov    -0xa0(%rbp),%rdx
mov    -0xc(%rbp),%ecx
lea    0xdea(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
cmpl   $0xf4240,-0xc(%rbp)
jae    1245 <tune_it+0xc5>
mov    -0xc(%rbp),%eax
imul   $0x3e8,%rax,%rax
mov    %eax,-0xc(%rbp)
mov    -0x98(%rbp),%eax
mov    %eax,-0xa4(%rbp)
sub    $0x80,%eax
je     135f <tune_it+0x1df>
jmp    1261 <tune_it+0xe1>
mov    -0xa4(%rbp),%eax
sub    $0x81,%eax
je     14c1 <tune_it+0x341>
jmp    1277 <tune_it+0xf7>
mov    -0xa4(%rbp),%eax
sub    $0x82,%eax
jne    1519 <tune_it+0x399>
jmp    128d <tune_it+0x10d>
mov    -0xc(%rbp),%eax
mov    %eax,-0x90(%rbp)
mov    0x2d0b(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x38(%rbp)
mov    0x38(%rbp),%eax
mov    %eax,-0x40(%rbp)
mov    0x20(%rbp),%eax
mov    %eax,-0x44(%rbp)
movl   $0x0,-0x48(%rbp)
mov    0x18(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    0x28(%rbp),%eax
mov    %eax,-0x58(%rbp)
mov    0x30(%rbp),%eax
mov    %eax,-0x5c(%rbp)
mov    0x2d16(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x60(%rbp)
mov    0x2ce2(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xac(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0xa8(%rbp)
mov    0x38(%rbp),%eax
mov    0x2cb7(%rip),%rcx
cmp    (%rcx),%eax
jne    1311 <tune_it+0x191>
mov    $0x8,%eax
mov    %eax,-0xb0(%rbp)
jmp    1332 <tune_it+0x1b2>
mov    0x38(%rbp),%edx
mov    0x2cdd(%rip),%rax
mov    (%rax),%esi
mov    $0x6,%eax
mov    $0x7,%ecx
cmp    %esi,%edx
cmove  %ecx,%eax
mov    %eax,-0xb0(%rbp)
mov    -0xa8(%rbp),%ecx
mov    -0xac(%rbp),%edi
mov    -0xb0(%rbp),%r8d
lea    0xce0(%rip),%rsi
lea    0xd04(%rip),%rdx
mov    $0x0,%al
call   1060 <fprintf@plt>
jmp    153a <tune_it+0x3ba>
movsbl -0x11(%rbp),%edi
call   1030 <toupper@plt>
mov    %al,-0x11(%rbp)
cmpl   $0x2191c0,-0xc(%rbp)
jbe    13cb <tune_it+0x24b>
mov    -0xc(%rbp),%eax
cmp    $0xb28720,%rax
jae    13a9 <tune_it+0x229>
mov    -0xc(%rbp),%eax
sub    $0x94c5f0,%rax
mov    %eax,-0x90(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x94c5f0,-0x30(%rbp)
jmp    13c6 <tune_it+0x246>
mov    -0xc(%rbp),%eax
sub    $0xa1be40,%rax
mov    %eax,-0x90(%rbp)
movl   $0x1,-0x28(%rbp)
movl   $0xa1be40,-0x30(%rbp)
jmp    13e2 <tune_it+0x262>
mov    -0xc(%rbp),%eax
mov    %eax,-0x90(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x30(%rbp)
mov    0x2bd7(%rip),%rax
mov    (%rax),%edi
mov    -0x90(%rbp),%edx
movsbl -0x11(%rbp),%ecx
mov    -0x10(%rbp),%r8d
mov    -0x18(%rbp),%esi
mov    0x2bb5(%rip),%rax
mov    (%rax),%r10d
lea    0xca2(%rip),%r9
lea    0xc98(%rip),%rax
cmp    %r10d,%esi
cmove  %rax,%r9
movzbl 0x10(%rbp),%eax
lea    0xc43(%rip),%rsi
mov    %eax,(%rsp)
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x70(%rbp)
mov    0x2b93(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x68(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%edi
mov    0x10(%rbp),%al
movsbl -0x11(%rbp),%esi
xor    %edx,%edx
mov    $0x1,%ecx
cmp    $0x56,%esi
cmove  %ecx,%edx
mov    -0x28(%rbp),%ecx
movzbl %al,%esi
call   1070 <do_diseqc@plt>
cmp    $0x0,%eax
jne    1499 <tune_it+0x319>
mov    0x2b3c(%rip),%rax
mov    (%rax),%edi
lea    0xc26(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
jmp    14bc <tune_it+0x33c>
mov    0x2b20(%rip),%rax
mov    (%rax),%edi
lea    0xc23(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    155f <tune_it+0x3df>
jmp    153a <tune_it+0x3ba>
mov    0x2af8(%rip),%rax
mov    (%rax),%edi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xc0c(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x90(%rbp)
mov    0x2aba(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x88(%rbp)
mov    0x2ad3(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x78(%rbp)
mov    0x18(%rbp),%rax
mov    %rax,-0x80(%rbp)
jmp    153a <tune_it+0x3ba>
mov    0x2aa0(%rip),%rax
mov    (%rax),%edi
lea    0xbd8(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    $0xffffffff,%edi
call   1090 <exit@plt>
mov    $0x186a0,%edi
call   10a0 <usleep@plt>
mov    -0x8(%rbp),%edi
mov    -0x98(%rbp),%esi
mov    -0x30(%rbp),%ecx
lea    -0x90(%rbp),%rdx
call   1040 <check_status@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tune_it>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x88,%rsp
mov    %r9,%r13
mov    %r8d,%r14d
mov    %ecx,%r15d
mov    %edx,%r12d
mov    %esi,%ebx
mov    %edi,%ebp
mov    0x2e28(%rip),%rax
mov    (%rax),%esi
lea    0x18(%rsp),%rdx
call   1050 <ioctl@plt>
test   %rax,%rax
js     145c <tune_it+0x2dc>
mov    %ebp,0xc(%rsp)
mov    %r13,0x10(%rsp)
mov    0x2df3(%rip),%r13
mov    0x0(%r13),%edi
mov    0x18(%rsp),%rdx
lea    0xe31(%rip),%rsi
mov    %ebx,%ecx
xor    %eax,%eax
call   1060 <fprintf@plt>
imul   $0x3e8,%ebx,%ebp
cmp    $0xf4240,%ebx
cmovae %ebx,%ebp
mov    0x20(%rsp),%eax
cmp    $0x80,%eax
je     12ca <tune_it+0x14a>
mov    0xc8(%rsp),%r14
cmp    $0x81,%eax
je     1304 <tune_it+0x184>
cmp    $0x82,%eax
mov    0xc(%rsp),%ebx
jne    146f <tune_it+0x2ef>
mov    0xe8(%rsp),%eax
mov    0xe0(%rsp),%ecx
mov    0xd8(%rsp),%edx
mov    0xd0(%rsp),%esi
mov    %ebp,0x28(%rsp)
mov    0x2d5b(%rip),%rdi
mov    (%rdi),%rdi
mov    %rdi,0x80(%rsp)
mov    %eax,0x78(%rsp)
mov    %esi,0x74(%rsp)
movl   $0x0,0x70(%rsp)
mov    %r14,0x68(%rsp)
mov    %edx,0x60(%rsp)
mov    %ecx,0x5c(%rsp)
mov    0x2d6c(%rip),%rcx
mov    (%rcx),%ecx
mov    %ecx,0x58(%rsp)
mov    0x2d27(%rip),%rcx
mov    0x2d68(%rip),%rdx
xor    %esi,%esi
cmp    %eax,(%rdx)
sete   %sil
or     $0x6,%esi
cmp    %eax,(%rcx)
mov    0x0(%r13),%edi
mov    $0x8,%r8d
cmovne %esi,%r8d
lea    0xd7a(%rip),%rsi
lea    0xd9e(%rip),%rdx
xor    %r15d,%r15d
mov    %ebp,%ecx
xor    %eax,%eax
call   1060 <fprintf@plt>
jmp    142d <tune_it+0x2ad>
mov    0xc0(%rsp),%bl
movsbl %r15b,%edi
call   1030 <toupper@plt>
cmp    $0x2191c1,%ebp
jb     1356 <tune_it+0x1d6>
cmp    $0xb2871f,%ebp
ja     1367 <tune_it+0x1e7>
add    $0xff6b3a10,%ebp
mov    %ebp,0x28(%rsp)
mov    $0x94c5f0,%r15d
movl   $0x0,0x8(%rsp)
jmp    137f <tune_it+0x1ff>
mov    0x0(%r13),%edi
lea    0xdd4(%rip),%rsi
xor    %r15d,%r15d
mov    %ebp,%edx
mov    %r12d,%ecx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    %ebp,0x28(%rsp)
mov    0x2c7f(%rip),%rax
mov    (%rax),%rax
mov    %rax,0x80(%rsp)
mov    %r12d,0x30(%rsp)
mov    0x2c98(%rip),%rax
mov    (%rax),%rax
mov    %rax,0x40(%rsp)
mov    %r14,0x38(%rsp)
mov    0xc(%rsp),%ebx
jmp    142d <tune_it+0x2ad>
mov    %ebp,0x28(%rsp)
movl   $0x0,0x8(%rsp)
xor    %r15d,%r15d
jmp    137f <tune_it+0x1ff>
add    $0xff5e41c0,%ebp
mov    %ebp,0x28(%rsp)
mov    $0xa1be40,%r15d
movl   $0x1,0x8(%rsp)
mov    0x0(%r13),%edi
movsbl %al,%r13d
mov    0x2c2a(%rip),%rax
cmp    %r14d,(%rax)
lea    0xd14(%rip),%rax
lea    0xd10(%rip),%r9
cmove  %rax,%r9
movzbl %bl,%r14d
mov    %r14d,(%rsp)
lea    0xcb7(%rip),%rsi
mov    %ebp,%edx
mov    %r13d,%ecx
mov    %r12d,%r8d
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    0x10(%rsp),%rax
mov    %rax,0x80(%rsp)
mov    %r12d,0x48(%rsp)
mov    0x2bfe(%rip),%rax
mov    (%rax),%rax
mov    %rax,0x50(%rsp)
xor    %edx,%edx
cmp    $0x56,%r13b
sete   %dl
mov    0xc(%rsp),%ebx
mov    %ebx,%edi
mov    %r14d,%esi
mov    0x8(%rsp),%ecx
call   1070 <do_diseqc@plt>
mov    0x2bbc(%rip),%rcx
mov    (%rcx),%edi
test   %eax,%eax
je     141f <tune_it+0x29f>
lea    0xcbb(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    $0xffffffff,%eax
jmp    144a <tune_it+0x2ca>
lea    0xc8d(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    $0x186a0,%edi
call   10a0 <usleep@plt>
mov    0x20(%rsp),%esi
lea    0x28(%rsp),%rdx
mov    %ebx,%edi
mov    %r15d,%ecx
call   1040 <check_status@plt>
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xb9d(%rip),%rdi
call   1080 <perror@plt>
mov    $0xffffffff,%eax
jmp    144a <tune_it+0x2ca>
mov    0x0(%r13),%edi
lea    0xc87(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    $0xffffffff,%edi
call   1090 <exit@plt>

LLVM IR (-O0):
%struct.dvb_frontend_parameters = type { i32, %struct.TYPE_8__, i8* }
%struct.TYPE_8__ = type { %struct.TYPE_7__, %struct.TYPE_6__, %struct.TYPE_5__ }
%struct.TYPE_7__ = type { i32, i8*, i8* }
%struct.TYPE_6__ = type { i32, i8* }
%struct.TYPE_5__ = type { i32, i32, i32, i8*, i32, i32, i32 }
%struct.dvb_frontend_info = type { i8*, i32 }
@FE_GET_INFO = global i32 0
@.str = [14 x i8] c"FE_GET_INFO: \00"
@stderr = global i32 0
@.str.1 = [30 x i8] c"Using DVB card \22%s\22, freq=%d\0A\00"
@INVERSION_OFF = global i8* null
@HIERARCHY_NONE = global i32 0
@.str.2 = [43 x i8] c"tuning DVB-T (%s) to %d Hz, Bandwidth: %d\0A\00"
@.str.3 = [18 x i8] c"in United Kingdom\00"
@BANDWIDTH_8_MHZ = global i32 0
@BANDWIDTH_7_MHZ = global i32 0
@.str.4 = [67 x i8] c"tuning DVB-S to Freq: %u, Pol:%c Srate=%d, 22kHz tone=%s, LNB: %d\0A\00"
@SEC_TONE_ON = global i32 0
@.str.5 = [3 x i8] c"on\00"
@.str.6 = [4 x i8] c"off\00"
@FEC_AUTO = global i8* null
@.str.7 = [25 x i8] c"DISEQC SETTING SUCCEDED\0A\00"
@.str.8 = [23 x i8] c"DISEQC SETTING FAILED\0A\00"
@.str.9 = [30 x i8] c"tuning DVB-C to %d, srate=%d\0A\00"
@.str.10 = [27 x i8] c"Unknown FE type. Aborting\0A\00"
define i32 @tune_it(i32 %0, i32 %1, i32 %2, i8 signext %3, i32 %4, i8* %5, i8 zeroext %6, i8* %7, i32 %8, i32 %9, i32 %10, i32 %11) {
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i8
%18 = alloca i32
%19 = alloca i8*
%20 = alloca i8
%21 = alloca i8*
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
%26 = alloca i32
%27 = alloca i32
%28 = alloca i32
%29 = alloca i32
%30 = alloca %struct.dvb_frontend_parameters
%31 = alloca %struct.dvb_frontend_info
store i32 %0, i32* %14
store i32 %1, i32* %15
store i32 %2, i32* %16
store i8 %3, i8* %17
store i32 %4, i32* %18
store i8* %5, i8** %19
store i8 %6, i8* %20
store i8* %7, i8** %21
store i32 %8, i32* %22
store i32 %9, i32* %23
store i32 %10, i32* %24
store i32 %11, i32* %25
store i32 0, i32* %29
%32 = load i32, i32* %14
%33 = load i32, i32* @FE_GET_INFO
%34 = call i64 @ioctl(i32 %32, i32 %33, %struct.dvb_frontend_info* %31)
%35 = icmp slt i64 %34, 0
%36 = zext i1 %35 to i32
store i32 %36, i32* %26
br i1 %35, label %37, label %39
37: ; preds = %12
%38 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %13
br label %202
39: ; preds = %12
%40 = load i32, i32* @stderr
%41 = getelementptr inbounds %struct.dvb_frontend_info, %struct.dvb_frontend_info* %31, i32 0, i32 0
%42 = load i8*, i8** %41
%43 = load i32, i32* %15
%44 = call i32 (i32, i8*, ...) @fprintf(i32 %40, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* %42, i32 %43)
%45 = load i32, i32* %15
%46 = icmp ult i32 %45, 1000000
br i1 %46, label %47, label %52
47: ; preds = %39
%48 = load i32, i32* %15
%49 = zext i32 %48 to i64
%50 = mul i64 %49, 1000
%51 = trunc i64 %50 to i32
store i32 %51, i32* %15
br label %52
52: ; preds = %47, %39
%53 = getelementptr inbounds %struct.dvb_frontend_info, %struct.dvb_frontend_info* %31, i32 0, i32 1
%54 = load i32, i32* %53
switch i32 %54, label %191 [
i32 130, label %55
i32 128, label %102
i32 129, label %170
]
55: ; preds = %52
%56 = load i32, i32* %15
%57 = getelementptr inbounds %struct.dvb_frontend_parameters, %struct.dvb_frontend_parameters* %30, i32 0, i32 0
store i32 %56, i32* %57
%58 = load i8*, i8** @INVERSION_OFF
%59 = getelementptr inbounds %struct.dvb_frontend_parameters, %struct.dvb_frontend_parameters* %30, i32 0, i32 2
store i8* %58, i8** %59
%60 = load i32, i32* %25
%61 = getelementptr inbounds %struct.dvb_frontend_parameters, %struct.dvb_frontend_parameters* %30, i32 0, i32 1
%62 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %61, i32 0, i32 2
%63 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %62, i32 0, i32 6
store i32 %60, i32* %63
%64 = load i32, i32* %22
%65 = getelementptr inbounds %struct.dvb_frontend_parameters, %struct.dvb_frontend_parameters* %30, i32 0, i32 1
%66 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %65, i32 0, i32 2
%67 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %66, i32 0, i32 5
store i32 %64, i32* %67
%68 = getelementptr inbounds %struct.dvb_frontend_parameters, %struct.dvb_frontend_parameters* %30, i32 0, i32 1
%69 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %68, i32 0, i32 2
%70 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %69, i32 0, i32 4
store i32 0, i32* %70
%71 = load i8*, i8** %21
%72 = getelementptr inbounds %struct.dvb_frontend_parameters, %struct.dvb_frontend_parameters* %30, i32 0, i32 1
%73 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %72, i32 0, i32 2
%74 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %73, i32 0, i32 3
store i8* %71, i8** %74
%75 = load i32, i32* %23
%76 = getelementptr inbounds %struct.dvb_frontend_parameters, %struct.dvb_frontend_parameters* %30, i32 0, i32 1
%77 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %76, i32 0, i32 2
%78 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %77, i32 0, i32 2
store i32 %75, i32* %78
%79 = load i32, i32* %24
%80 = getelementptr inbounds %struct.dvb_frontend_parameters, %struct.dvb_frontend_parameters* %30, i32 0, i32 1
%81 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %80, i32 0, i32 2
%82 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %81, i32 0, i32 1
store i32 %79, i32* %82
%83 = load i32, i32* @HIERARCHY_NONE
%84 = getelementptr inbounds %struct.dvb_frontend_parameters, %struct.dvb_frontend_parameters* %30, i32 0, i32 1
%85 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %84, i32 0, i32 2
%86 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %85, i32 0, i32 0
store i32 %83, i32* %86
%87 = load i32, i32* @stderr
%88 = load i32, i32* %15
%89 = load i32, i32* %25
%90 = load i32, i32* @BANDWIDTH_8_MHZ
%91 = icmp eq i32 %89, %90
br i1 %91, label %92, label %93
92: ; preds = %55
br label %99
93: ; preds = %55
%94 = load i32, i32* %25
%95 = load i32, i32* @BANDWIDTH_7_MHZ
%96 = icmp eq i32 %94, %95
%97 = zext i1 %96 to i64
%98 = select i1 %96, i32 7, i32 6
br label %99
99: ; preds = %93, %92
%100 = phi i32 [ 8, %92 ], [ %98, %93 ]
%101 = call i32 (i32, i8*, ...) @fprintf(i32 %87, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i32 %88, i32 %100)
br label %195
102: ; preds = %52
%103 = load i8, i8* %17
%104 = call signext i8 @toupper(i8 signext %103)
store i8 %104, i8* %17
%105 = load i32, i32* %15
%106 = icmp ugt i32 %105, 2200000
br i1 %106, label %107, label %124
107: ; preds = %102
%108 = load i32, i32* %15
%109 = zext i32 %108 to i64
%110 = icmp ult i64 %109, 11700000
br i1 %110, label %111, label %117
111: ; preds = %107
%112 = load i32, i32* %15
%113 = zext i32 %112 to i64
%114 = sub i64 %113, 9750000
%115 = trunc i64 %114 to i32
%116 = getelementptr inbounds %struct.dvb_frontend_parameters, %struct.dvb_frontend_parameters* %30, i32 0, i32 0
store i32 %115, i32* %116
store i32 0, i32* %27
store i32 9750000, i32* %29
br label %123
117: ; preds = %107
%118 = load i32, i32* %15
%119 = zext i32 %118 to i64
%120 = sub i64 %119, 10600000
%121 = trunc i64 %120 to i32
%122 = getelementptr inbounds %struct.dvb_frontend_parameters, %struct.dvb_frontend_parameters* %30, i32 0, i32 0
store i32 %121, i32* %122
store i32 1, i32* %27
store i32 10600000, i32* %29
br label %123
123: ; preds = %117, %111
br label %127
124: ; preds = %102
%125 = load i32, i32* %15
%126 = getelementptr inbounds %struct.dvb_frontend_parameters, %struct.dvb_frontend_parameters* %30, i32 0, i32 0
store i32 %125, i32* %126
store i32 0, i32* %27
store i32 0, i32* %29
br label %127
127: ; preds = %124, %123
%128 = load i32, i32* @stderr
%129 = getelementptr inbounds %struct.dvb_frontend_parameters, %struct.dvb_frontend_parameters* %30, i32 0, i32 0
%130 = load i32, i32* %129
%131 = load i8, i8* %17
%132 = sext i8 %131 to i32
%133 = load i32, i32* %16
%134 = load i32, i32* %18
%135 = load i32, i32* @SEC_TONE_ON
%136 = icmp eq i32 %134, %135
%137 = zext i1 %136 to i64
%138 = select i1 %136, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0)
%139 = load i8, i8* %20
%140 = zext i8 %139 to i32
%141 = call i32 (i32, i8*, ...) @fprintf(i32 %128, i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.4, i64 0, i64 0), i32 %130, i32 %132, i32 %133, i8* %138, i32 %140)
%142 = load i8*, i8** %19
%143 = getelementptr inbounds %struct.dvb_frontend_parameters, %struct.dvb_frontend_parameters* %30, i32 0, i32 2
store i8* %142, i8** %143
%144 = load i32, i32* %16
%145 = getelementptr inbounds %struct.dvb_frontend_parameters, %struct.dvb_frontend_parameters* %30, i32 0, i32 1
%146 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %145, i32 0, i32 1
%147 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %146, i32 0, i32 0
store i32 %144, i32* %147
%148 = load i8*, i8** @FEC_AUTO
%149 = getelementptr inbounds %struct.dvb_frontend_parameters, %struct.dvb_frontend_parameters* %30, i32 0, i32 1
%150 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %149, i32 0, i32 1
%151 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %150, i32 0, i32 1
store i8* %148, i8** %151
%152 = load i32, i32* %14
store i32 %152, i32* %28
%153 = load i32, i32* %28
%154 = load i8, i8* %20
%155 = load i8, i8* %17
%156 = sext i8 %155 to i32
%157 = icmp eq i32 %156, 86
%158 = zext i1 %157 to i64
%159 = select i1 %157, i32 1, i32 0
%160 = load i32, i32* %27
%161 = call i32 @do_diseqc(i32 %153, i8 zeroext %154, i32 %159, i32 %160)
%162 = icmp eq i32 %161, 0
br i1 %162, label %163, label %166
163: ; preds = %127
%164 = load i32, i32* @stderr
%165 = call i32 (i32, i8*, ...) @fprintf(i32 %164, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i64 0, i64 0))
br label %169
166: ; preds = %127
%167 = load i32, i32* @stderr
%168 = call i32 (i32, i8*, ...) @fprintf(i32 %167, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.8, i64 0, i64 0))
store i32 -1, i32* %13
br label %202
169: ; preds = %163
br label %195
170: ; preds = %52
%171 = load i32, i32* @stderr
%172 = load i32, i32* %15
%173 = load i32, i32* %16
%174 = call i32 (i32, i8*, ...) @fprintf(i32 %171, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.9, i64 0, i64 0), i32 %172, i32 %173)
%175 = load i32, i32* %15
%176 = getelementptr inbounds %struct.dvb_frontend_parameters, %struct.dvb_frontend_parameters* %30, i32 0, i32 0
store i32 %175, i32* %176
%177 = load i8*, i8** @INVERSION_OFF
%178 = getelementptr inbounds %struct.dvb_frontend_parameters, %struct.dvb_frontend_parameters* %30, i32 0, i32 2
store i8* %177, i8** %178
%179 = load i32, i32* %16
%180 = getelementptr inbounds %struct.dvb_frontend_parameters, %struct.dvb_frontend_parameters* %30, i32 0, i32 1
%181 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %180, i32 0, i32 0
%182 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %181, i32 0, i32 0
store i32 %179, i32* %182
%183 = load i8*, i8** @FEC_AUTO
%184 = getelementptr inbounds %struct.dvb_frontend_parameters, %struct.dvb_frontend_parameters* %30, i32 0, i32 1
%185 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %184, i32 0, i32 0
%186 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %185, i32 0, i32 2
store i8* %183, i8** %186
%187 = load i8*, i8** %21
%188 = getelementptr inbounds %struct.dvb_frontend_parameters, %struct.dvb_frontend_parameters* %30, i32 0, i32 1
%189 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %188, i32 0, i32 0
%190 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %189, i32 0, i32 1
store i8* %187, i8** %190
br label %195
191: ; preds = %52
%192 = load i32, i32* @stderr
%193 = call i32 (i32, i8*, ...) @fprintf(i32 %192, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.10, i64 0, i64 0))
%194 = call i32 @exit(i32 -1)
unreachable
195: ; preds = %170, %169, %99
%196 = call i32 @usleep(i32 100000)
%197 = load i32, i32* %14
%198 = getelementptr inbounds %struct.dvb_frontend_info, %struct.dvb_frontend_info* %31, i32 0, i32 1
%199 = load i32, i32* %198
%200 = load i32, i32* %29
%201 = call i32 @check_status(i32 %197, i32 %199, %struct.dvb_frontend_parameters* %30, i32 %200)
store i32 %201, i32* %13
br label %202
202: ; preds = %195, %166, %37
%203 = load i32, i32* %13
ret i32 %203
}

LLVM IR (-O2):
%struct.dvb_frontend_parameters = type { i32, %struct.TYPE_8__, i8* }
%struct.TYPE_8__ = type { %struct.TYPE_7__, %struct.TYPE_6__, %struct.TYPE_5__ }
%struct.TYPE_7__ = type { i32, i8*, i8* }
%struct.TYPE_6__ = type { i32, i8* }
%struct.TYPE_5__ = type { i32, i32, i32, i8*, i32, i32, i32 }
%struct.dvb_frontend_info = type { i8*, i32 }
@FE_GET_INFO = global i32 0
@.str = [14 x i8] c"FE_GET_INFO: \00"
@stderr = global i32 0
@.str.1 = [30 x i8] c"Using DVB card \22%s\22, freq=%d\0A\00"
@INVERSION_OFF = global i8* null
@HIERARCHY_NONE = global i32 0
@.str.2 = [43 x i8] c"tuning DVB-T (%s) to %d Hz, Bandwidth: %d\0A\00"
@.str.3 = [18 x i8] c"in United Kingdom\00"
@BANDWIDTH_8_MHZ = global i32 0
@BANDWIDTH_7_MHZ = global i32 0
@.str.4 = [67 x i8] c"tuning DVB-S to Freq: %u, Pol:%c Srate=%d, 22kHz tone=%s, LNB: %d\0A\00"
@SEC_TONE_ON = global i32 0
@.str.5 = [3 x i8] c"on\00"
@.str.6 = [4 x i8] c"off\00"
@FEC_AUTO = global i8* null
@.str.7 = [25 x i8] c"DISEQC SETTING SUCCEDED\0A\00"
@.str.8 = [23 x i8] c"DISEQC SETTING FAILED\0A\00"
@.str.9 = [30 x i8] c"tuning DVB-C to %d, srate=%d\0A\00"
@.str.10 = [27 x i8] c"Unknown FE type. Aborting\0A\00"
define i32 @tune_it(i32 %0, i32 %1, i32 %2, i8 signext %3, i32 %4, i8* %5, i8 zeroext %6, i8* %7, i32 %8, i32 %9, i32 %10, i32 %11) {
%13 = alloca %struct.dvb_frontend_parameters
%14 = alloca %struct.dvb_frontend_info
%15 = bitcast %struct.dvb_frontend_parameters* %13 to i8*
%16 = bitcast %struct.dvb_frontend_info* %14 to i8*
%17 = load i32, i32* @FE_GET_INFO
%18 = call i64 @ioctl(i32 %0, i32 %17, %struct.dvb_frontend_info* %14)
%19 = icmp slt i64 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %12
%21 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %108
22: ; preds = %12
%23 = load i32, i32* @stderr
%24 = getelementptr inbounds %struct.dvb_frontend_info, %struct.dvb_frontend_info* %14, i64 0, i32 0
%25 = load i8*, i8** %24
%26 = call i32 (i32, i8*, ...) @fprintf(i32 %23, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* %25, i32 %1)
%27 = icmp ult i32 %1, 1000000
%28 = mul i32 %1, 1000
%29 = select i1 %27, i32 %28, i32 %1
%30 = getelementptr inbounds %struct.dvb_frontend_info, %struct.dvb_frontend_info* %14, i64 0, i32 1
%31 = load i32, i32* %30
switch i32 %31, label %99 [
i32 130, label %32
i32 128, label %52
i32 129, label %89
]
32: ; preds = %22
%33 = getelementptr inbounds %struct.dvb_frontend_parameters, %struct.dvb_frontend_parameters* %13, i64 0, i32 0
store i32 %29, i32* %33
%34 = load i8*, i8** @INVERSION_OFF
%35 = getelementptr inbounds %struct.dvb_frontend_parameters, %struct.dvb_frontend_parameters* %13, i64 0, i32 2
store i8* %34, i8** %35
%36 = getelementptr inbounds %struct.dvb_frontend_parameters, %struct.dvb_frontend_parameters* %13, i64 0, i32 1, i32 2, i32 6
store i32 %11, i32* %36
%37 = getelementptr inbounds %struct.dvb_frontend_parameters, %struct.dvb_frontend_parameters* %13, i64 0, i32 1, i32 2, i32 5
store i32 %8, i32* %37
%38 = getelementptr inbounds %struct.dvb_frontend_parameters, %struct.dvb_frontend_parameters* %13, i64 0, i32 1, i32 2, i32 4
store i32 0, i32* %38
%39 = getelementptr inbounds %struct.dvb_frontend_parameters, %struct.dvb_frontend_parameters* %13, i64 0, i32 1, i32 2, i32 3
store i8* %7, i8** %39
%40 = getelementptr inbounds %struct.dvb_frontend_parameters, %struct.dvb_frontend_parameters* %13, i64 0, i32 1, i32 2, i32 2
store i32 %9, i32* %40
%41 = getelementptr inbounds %struct.dvb_frontend_parameters, %struct.dvb_frontend_parameters* %13, i64 0, i32 1, i32 2, i32 1
store i32 %10, i32* %41
%42 = load i32, i32* @HIERARCHY_NONE
%43 = getelementptr inbounds %struct.dvb_frontend_parameters, %struct.dvb_frontend_parameters* %13, i64 0, i32 1, i32 2, i32 0
store i32 %42, i32* %43
%44 = load i32, i32* @stderr
%45 = load i32, i32* @BANDWIDTH_8_MHZ
%46 = icmp eq i32 %45, %11
%47 = load i32, i32* @BANDWIDTH_7_MHZ
%48 = icmp eq i32 %47, %11
%49 = select i1 %48, i32 7, i32 6
%50 = select i1 %46, i32 8, i32 %49
%51 = call i32 (i32, i8*, ...) @fprintf(i32 %44, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i32 %29, i32 %50)
br label %103
52: ; preds = %22
%53 = call signext i8 @toupper(i8 signext %3)
%54 = icmp ugt i32 %29, 2200000
br i1 %54, label %55, label %63
55: ; preds = %52
%56 = icmp ult i32 %29, 11700000
br i1 %56, label %57, label %60
57: ; preds = %55
%58 = add nsw i32 %29, -9750000
%59 = getelementptr inbounds %struct.dvb_frontend_parameters, %struct.dvb_frontend_parameters* %13, i64 0, i32 0
store i32 %58, i32* %59
br label %65
60: ; preds = %55
%61 = add i32 %29, -10600000
%62 = getelementptr inbounds %struct.dvb_frontend_parameters, %struct.dvb_frontend_parameters* %13, i64 0, i32 0
store i32 %61, i32* %62
br label %65
63: ; preds = %52
%64 = getelementptr inbounds %struct.dvb_frontend_parameters, %struct.dvb_frontend_parameters* %13, i64 0, i32 0
store i32 %29, i32* %64
br label %65
65: ; preds = %57, %60, %63
%66 = phi i32 [ %58, %57 ], [ %61, %60 ], [ %29, %63 ]
%67 = phi i32 [ 0, %57 ], [ 1, %60 ], [ 0, %63 ]
%68 = phi i32 [ 9750000, %57 ], [ 10600000, %60 ], [ 0, %63 ]
%69 = load i32, i32* @stderr
%70 = sext i8 %53 to i32
%71 = load i32, i32* @SEC_TONE_ON
%72 = icmp eq i32 %71, %4
%73 = select i1 %72, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0)
%74 = zext i8 %6 to i32
%75 = call i32 (i32, i8*, ...) @fprintf(i32 %69, i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.4, i64 0, i64 0), i32 %66, i32 %70, i32 %2, i8* %73, i32 %74)
%76 = getelementptr inbounds %struct.dvb_frontend_parameters, %struct.dvb_frontend_parameters* %13, i64 0, i32 2
store i8* %5, i8** %76
%77 = getelementptr inbounds %struct.dvb_frontend_parameters, %struct.dvb_frontend_parameters* %13, i64 0, i32 1, i32 1, i32 0
store i32 %2, i32* %77
%78 = load i8*, i8** @FEC_AUTO
%79 = getelementptr inbounds %struct.dvb_frontend_parameters, %struct.dvb_frontend_parameters* %13, i64 0, i32 1, i32 1, i32 1
store i8* %78, i8** %79
%80 = icmp eq i8 %53, 86
%81 = zext i1 %80 to i32
%82 = call i32 @do_diseqc(i32 %0, i8 zeroext %6, i32 %81, i32 %67)
%83 = icmp eq i32 %82, 0
%84 = load i32, i32* @stderr
br i1 %83, label %85, label %87
85: ; preds = %65
%86 = call i32 (i32, i8*, ...) @fprintf(i32 %84, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i64 0, i64 0))
br label %103
87: ; preds = %65
%88 = call i32 (i32, i8*, ...) @fprintf(i32 %84, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.8, i64 0, i64 0))
br label %108
89: ; preds = %22
%90 = load i32, i32* @stderr
%91 = call i32 (i32, i8*, ...) @fprintf(i32 %90, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.9, i64 0, i64 0), i32 %29, i32 %2)
%92 = getelementptr inbounds %struct.dvb_frontend_parameters, %struct.dvb_frontend_parameters* %13, i64 0, i32 0
store i32 %29, i32* %92
%93 = load i8*, i8** @INVERSION_OFF
%94 = getelementptr inbounds %struct.dvb_frontend_parameters, %struct.dvb_frontend_parameters* %13, i64 0, i32 2
store i8* %93, i8** %94
%95 = getelementptr inbounds %struct.dvb_frontend_parameters, %struct.dvb_frontend_parameters* %13, i64 0, i32 1, i32 0, i32 0
store i32 %2, i32* %95
%96 = load i8*, i8** @FEC_AUTO
%97 = getelementptr inbounds %struct.dvb_frontend_parameters, %struct.dvb_frontend_parameters* %13, i64 0, i32 1, i32 0, i32 2
store i8* %96, i8** %97
%98 = getelementptr inbounds %struct.dvb_frontend_parameters, %struct.dvb_frontend_parameters* %13, i64 0, i32 1, i32 0, i32 1
store i8* %7, i8** %98
br label %103
99: ; preds = %22
%100 = load i32, i32* @stderr
%101 = call i32 (i32, i8*, ...) @fprintf(i32 %100, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.10, i64 0, i64 0))
%102 = call i32 @exit(i32 -1)
unreachable
103: ; preds = %89, %85, %32
%104 = phi i32 [ 0, %89 ], [ %68, %85 ], [ 0, %32 ]
%105 = call i32 @usleep(i32 100000)
%106 = load i32, i32* %30
%107 = call i32 @check_status(i32 %0, i32 %106, %struct.dvb_frontend_parameters* %13, i32 %104)
br label %108
108: ; preds = %103, %87, %20
%109 = phi i32 [ -1, %20 ], [ %107, %103 ], [ -1, %87 ]
ret i32 %109
}