#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 */
typedef int /*<<< orphan*/ video_dev;
struct v4l2_tuner {
  char *driver;
  int type;
  int rangelow;
  int rangehigh;
};
struct v4l2_capability {
  char *driver;
  int type;
  int rangelow;
  int rangehigh;
};

/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int /*<<< orphan*/ VIDIOC_G_TUNER;
int /*<<< orphan*/ VIDIOC_QUERYCAP;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
int getopt(int, char **, char *);
int ioctl(int, int /*<<< orphan*/, struct v4l2_tuner *);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ optarg;
int /*<<< orphan*/ printf(char *, ...);
int rand();
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ srand(unsigned int);
char *strerror(int /*<<< orphan*/);
int /*<<< orphan*/ strncpy(char *, int /*<<< orphan*/, int);
scalar_t__ time(int /*<<< orphan*/ *);
int main(int argc, char **argv) {
  int opt;
  char video_dev[256];
  int count;
  struct v4l2_tuner vtuner;
  struct v4l2_capability vcap;
  int ret;
  int fd;
  if (argc < 2) {
    printf("Usage: %s [-d </dev/videoX>]\n", argv[0]);
    exit(-1);
  }
  while ((opt = getopt(argc, argv, "d:")) != -1) {
    switch (opt) {
    case 'd':
      strncpy(video_dev, optarg, sizeof(video_dev) - 1);
      video_dev[sizeof(video_dev) - 1] = '\0';
      break;
    default:
      printf("Usage: %s [-d </dev/videoX>]\n", argv[0]);
      exit(-1);
    }
  }
  srand((unsigned int)time(NULL));
  count = rand();
  fd = open(video_dev, O_RDWR);
  if (fd == -1) {
    printf("Video Device open errno %s\n", strerror(errno));
    exit(-1);
  }
  printf("\nNote:\n"
         "While test is running, remove the device or unbind\n"
         "driver and ensure there are no use after free errors\n"
         "and other Oops in the dmesg. When possible, enable KaSan\n"
         "kernel config option for use-after-free error detection.\n\n");
  while (count > 0) {
    ret = ioctl(fd, VIDIOC_QUERYCAP, &vcap);
    if (ret < 0) {
      printf("VIDIOC_QUERYCAP errno %s\n", strerror(errno));
    } else {
      printf("Video device driver %s\n", vcap.driver);
    }
    ret = ioctl(fd, VIDIOC_G_TUNER, &vtuner);
    if (ret < 0) {
      printf("VIDIOC_G_TUNER, errno %s\n", strerror(errno));
    } else
      printf("type %d rangelow %d rangehigh %d\n", vtuner.type, vtuner.rangelow,
             vtuner.rangehigh);
    sleep(10);
    count--;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x160,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    11f2 <main+0x42>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe1f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   10a0 <exit@plt>
jmp    11f7 <main+0x47>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe19(%rip),%rdx
call   1090 <getopt@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
je     126e <main+0xbe>
mov    -0x14(%rbp),%eax
sub    $0x64,%eax
jne    124a <main+0x9a>
jmp    1227 <main+0x77>
lea    -0x120(%rbp),%rdi
mov    0x2dc3(%rip),%rax
mov    (%rax),%esi
mov    $0xff,%edx
call   1030 <strncpy@plt>
movb   $0x0,-0x21(%rbp)
jmp    1269 <main+0xb9>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xda8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   10a0 <exit@plt>
jmp    11f7 <main+0x47>
xor    %eax,%eax
mov    %eax,%edi
call   1070 <time@plt>
mov    %eax,%edi
call   1060 <srand@plt>
mov    $0x0,%al
call   10d0 <rand@plt>
mov    %eax,-0x124(%rbp)
lea    -0x120(%rbp),%rdi
mov    0x2d47(%rip),%rax
mov    (%rax),%esi
call   1080 <open@plt>
mov    %eax,-0x160(%rbp)
cmpl   $0xffffffff,-0x160(%rbp)
jne    12dc <main+0x12c>
mov    0x2d16(%rip),%rax
mov    (%rax),%edi
call   10b0 <strerror@plt>
mov    %rax,%rsi
lea    0xd56(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   10a0 <exit@plt>
lea    0xd5a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmpl   $0x0,-0x124(%rbp)
jle    13ee <main+0x23e>
mov    -0x160(%rbp),%edi
mov    0x2cb4(%rip),%rax
mov    (%rax),%esi
lea    -0x158(%rbp),%rdx
call   1050 <ioctl@plt>
mov    %eax,-0x15c(%rbp)
cmpl   $0x0,-0x15c(%rbp)
jge    1349 <main+0x199>
mov    0x2ca4(%rip),%rax
mov    (%rax),%edi
call   10b0 <strerror@plt>
mov    %rax,%rsi
lea    0xde3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    135e <main+0x1ae>
mov    -0x158(%rbp),%rsi
lea    0xde3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x160(%rbp),%edi
mov    0x2c5d(%rip),%rax
mov    (%rax),%esi
lea    -0x140(%rbp),%rdx
call   1050 <ioctl@plt>
mov    %eax,-0x15c(%rbp)
cmpl   $0x0,-0x15c(%rbp)
jge    13b0 <main+0x200>
mov    0x2c3d(%rip),%rax
mov    (%rax),%edi
call   10b0 <strerror@plt>
mov    %rax,%rsi
lea    0xdae(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    13d0 <main+0x220>
mov    -0x138(%rbp),%esi
mov    -0x134(%rbp),%edx
mov    -0x130(%rbp),%ecx
lea    0xda3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0xa,%edi
call   10c0 <sleep@plt>
mov    -0x124(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x124(%rbp)
jmp    12ea <main+0x13a>
mov    -0x4(%rbp),%eax
add    $0x160,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x138,%rsp
mov    %rsi,%rbx
cmp    $0x2,%edi
jl     135d <main+0x19d>
mov    %edi,%ebp
lea    0xe38(%rip),%r14
mov    0x2e0b(%rip),%r12
lea    0x30(%rsp),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   10a0 <getopt@plt>
cmp    $0x64,%eax
jne    122d <main+0x6d>
mov    (%r12),%esi
mov    %r15,%rdi
mov    $0xff,%edx
call   1030 <strncpy@plt>
movb   $0x0,0x12f(%rsp)
jmp    1200 <main+0x40>
cmp    $0xffffffff,%eax
jne    135d <main+0x19d>
xor    %edi,%edi
call   1080 <time@plt>
mov    %eax,%edi
call   1070 <srand@plt>
xor    %eax,%eax
call   10e0 <rand@plt>
mov    %eax,%ebx
mov    0x2d8c(%rip),%rax
mov    (%rax),%esi
lea    0x30(%rsp),%rdi
call   1090 <open@plt>
cmp    $0xffffffff,%eax
je     1378 <main+0x1b8>
mov    %eax,%ebp
lea    0xe39(%rip),%rdi
call   1040 <puts@plt>
test   %ebx,%ebx
jle    1349 <main+0x189>
add    $0x1,%ebx
mov    0x2d2f(%rip),%r15
lea    0x18(%rsp),%r14
mov    0x2d33(%rip),%r13
mov    %rsp,%r12
jmp    12cc <main+0x10c>
nopw   0x0(%rax,%rax,1)
mov    0x8(%rsp),%esi
mov    0xc(%rsp),%edx
mov    0x10(%rsp),%ecx
lea    0xdd6(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   10d0 <sleep@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
jle    1349 <main+0x189>
mov    (%r15),%esi
mov    %ebp,%edi
mov    %r14,%rdx
call   1060 <ioctl@plt>
test   %eax,%eax
js     12f0 <main+0x130>
mov    0x18(%rsp),%rsi
lea    0xd6e(%rip),%rdi
jmp    1308 <main+0x148>
nopl   0x0(%rax,%rax,1)
mov    0x2cd9(%rip),%rax
mov    (%rax),%edi
call   10c0 <strerror@plt>
lea    0xd38(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x0(%r13),%esi
mov    %ebp,%edi
mov    %r12,%rdx
call   1060 <ioctl@plt>
test   %eax,%eax
jns    12a0 <main+0xe0>
mov    0x2ca4(%rip),%rax
mov    (%rax),%edi
call   10c0 <strerror@plt>
lea    0xd35(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    12ba <main+0xfa>
xor    %eax,%eax
add    $0x138,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    (%rbx),%rsi
lea    0xc99(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xffffffff,%edi
call   10b0 <exit@plt>
mov    0x2c51(%rip),%rax
mov    (%rax),%edi
call   10c0 <strerror@plt>
lea    0xc94(%rip),%rdi
mov    %rax,%rsi
jmp    1367 <main+0x1a7>

LLVM IR (-O0):
%struct.v4l2_tuner = type { i8*, i32, i32, i32 }
%struct.v4l2_capability = type { i8*, i32, i32, i32 }
@.str = [30 x i8] c"Usage: %s [-d </dev/videoX>]\0A\00"
@.str.1 = [3 x i8] c"d:\00"
@optarg = global i32 0
@O_RDWR = global i32 0
@.str.2 = [28 x i8] c"Video Device open errno %s\0A\00"
@errno = global i32 0
@.str.3 = [227 x i8] c"\0ANote:\0AWhile test is running, remove the device or unbind\0Adriver and ensure there are no use after free errors\0Aand other Oops in the dmesg. When possible, enable KaSan\0Akernel config option for use-after-free error detection.\0A\0A\00"
@VIDIOC_QUERYCAP = global i32 0
@.str.4 = [26 x i8] c"VIDIOC_QUERYCAP errno %s\0A\00"
@.str.5 = [24 x i8] c"Video device driver %s\0A\00"
@VIDIOC_G_TUNER = global i32 0
@.str.6 = [26 x i8] c"VIDIOC_G_TUNER, errno %s\0A\00"
@.str.7 = [34 x i8] c"type %d rangelow %d rangehigh %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [256 x i8]
%8 = alloca i32
%9 = alloca %struct.v4l2_tuner
%10 = alloca %struct.v4l2_capability
%11 = alloca i32
%12 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%13 = load i32, i32* %4
%14 = icmp slt i32 %13, 2
br i1 %14, label %15, label %21
15: ; preds = %2
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 0
%18 = load i8*, i8** %17
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %18)
%20 = call i32 @exit(i32 -1)
unreachable
21: ; preds = %2
br label %22
22: ; preds = %40, %21
%23 = load i32, i32* %4
%24 = load i8**, i8*** %5
%25 = call i32 @getopt(i32 %23, i8** %24, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32 %25, i32* %6
%26 = icmp ne i32 %25, -1
br i1 %26, label %27, label %41
27: ; preds = %22
%28 = load i32, i32* %6
switch i32 %28, label %34 [
i32 100, label %29
]
29: ; preds = %27
%30 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%31 = load i32, i32* @optarg
%32 = call i32 @strncpy(i8* %30, i32 %31, i32 255)
%33 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 255
store i8 0, i8* %33
br label %40
34: ; preds = %27
%35 = load i8**, i8*** %5
%36 = getelementptr inbounds i8*, i8** %35, i64 0
%37 = load i8*, i8** %36
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %37)
%39 = call i32 @exit(i32 -1)
unreachable
40: ; preds = %29
br label %22
41: ; preds = %22
%42 = call i64 @time(i32* null)
%43 = trunc i64 %42 to i32
%44 = call i32 @srand(i32 %43)
%45 = call i32 (...) @rand()
store i32 %45, i32* %8
%46 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%47 = load i32, i32* @O_RDWR
%48 = call i32 @open(i8* %46, i32 %47)
store i32 %48, i32* %12
%49 = load i32, i32* %12
%50 = icmp eq i32 %49, -1
br i1 %50, label %51, label %56
51: ; preds = %41
%52 = load i32, i32* @errno
%53 = call i8* @strerror(i32 %52)
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i8* %53)
%55 = call i32 @exit(i32 -1)
unreachable
56: ; preds = %41
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([227 x i8], [227 x i8]* @.str.3, i64 0, i64 0))
br label %58
58: ; preds = %94, %56
%59 = load i32, i32* %8
%60 = icmp sgt i32 %59, 0
br i1 %60, label %61, label %98
61: ; preds = %58
%62 = load i32, i32* %12
%63 = load i32, i32* @VIDIOC_QUERYCAP
%64 = bitcast %struct.v4l2_capability* %10 to %struct.v4l2_tuner*
%65 = call i32 @ioctl(i32 %62, i32 %63, %struct.v4l2_tuner* %64)
store i32 %65, i32* %11
%66 = load i32, i32* %11
%67 = icmp slt i32 %66, 0
br i1 %67, label %68, label %72
68: ; preds = %61
%69 = load i32, i32* @errno
%70 = call i8* @strerror(i32 %69)
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), i8* %70)
br label %76
72: ; preds = %61
%73 = getelementptr inbounds %struct.v4l2_capability, %struct.v4l2_capability* %10, i32 0, i32 0
%74 = load i8*, i8** %73
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0), i8* %74)
br label %76
76: ; preds = %72, %68
%77 = load i32, i32* %12
%78 = load i32, i32* @VIDIOC_G_TUNER
%79 = call i32 @ioctl(i32 %77, i32 %78, %struct.v4l2_tuner* %9)
store i32 %79, i32* %11
%80 = load i32, i32* %11
%81 = icmp slt i32 %80, 0
br i1 %81, label %82, label %86
82: ; preds = %76
%83 = load i32, i32* @errno
%84 = call i8* @strerror(i32 %83)
%85 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0), i8* %84)
br label %94
86: ; preds = %76
%87 = getelementptr inbounds %struct.v4l2_tuner, %struct.v4l2_tuner* %9, i32 0, i32 1
%88 = load i32, i32* %87
%89 = getelementptr inbounds %struct.v4l2_tuner, %struct.v4l2_tuner* %9, i32 0, i32 2
%90 = load i32, i32* %89
%91 = getelementptr inbounds %struct.v4l2_tuner, %struct.v4l2_tuner* %9, i32 0, i32 3
%92 = load i32, i32* %91
%93 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.7, i64 0, i64 0), i32 %88, i32 %90, i32 %92)
br label %94
94: ; preds = %86, %82
%95 = call i32 @sleep(i32 10)
%96 = load i32, i32* %8
%97 = add nsw i32 %96, -1
store i32 %97, i32* %8
br label %58
98: ; preds = %58
%99 = load i32, i32* %3
ret i32 %99
}

LLVM IR (-O2):
%struct.v4l2_tuner = type { i8*, i32, i32, i32 }
%struct.v4l2_capability = type { i8*, i32, i32, i32 }
@.str = [30 x i8] c"Usage: %s [-d </dev/videoX>]\0A\00"
@.str.1 = [3 x i8] c"d:\00"
@optarg = global i32 0
@O_RDWR = global i32 0
@.str.2 = [28 x i8] c"Video Device open errno %s\0A\00"
@errno = global i32 0
@VIDIOC_QUERYCAP = global i32 0
@.str.4 = [26 x i8] c"VIDIOC_QUERYCAP errno %s\0A\00"
@.str.5 = [24 x i8] c"Video device driver %s\0A\00"
@VIDIOC_G_TUNER = global i32 0
@.str.6 = [26 x i8] c"VIDIOC_G_TUNER, errno %s\0A\00"
@.str.7 = [34 x i8] c"type %d rangelow %d rangehigh %d\0A\00"
@str = [226 x i8] c"\0ANote:\0AWhile test is running, remove the device or unbind\0Adriver and ensure there are no use after free errors\0Aand other Oops in the dmesg. When possible, enable KaSan\0Akernel config option for use-after-free error detection.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca [256 x i8]
%4 = alloca %struct.v4l2_tuner
%5 = alloca %struct.v4l2_capability
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%7 = bitcast %struct.v4l2_tuner* %4 to i8*
%8 = bitcast %struct.v4l2_capability* %5 to i8*
%9 = icmp slt i32 %0, 2
br i1 %9, label %12, label %10
10: ; preds = %2
%11 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 255
br label %16
12: ; preds = %2
%13 = load i8*, i8** %1
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = tail call i32 @exit(i32 -1)
unreachable
16: ; preds = %10, %18
%17 = call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
switch i32 %17, label %21 [
i32 -1, label %25
i32 100, label %18
]
18: ; preds = %16
%19 = load i32, i32* @optarg
%20 = call i32 @strncpy(i8* %6, i32 %19, i32 255)
store i8 0, i8* %11
br label %16
21: ; preds = %16
%22 = load i8*, i8** %1
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %22)
%24 = call i32 @exit(i32 -1)
unreachable
25: ; preds = %16
%26 = call i64 @time(i32* null)
%27 = trunc i64 %26 to i32
%28 = call i32 @srand(i32 %27)
%29 = call i32 (...) @rand()
%30 = load i32, i32* @O_RDWR
%31 = call i32 @open(i8* %6, i32 %30)
%32 = icmp eq i32 %31, -1
br i1 %32, label %33, label %38
33: ; preds = %25
%34 = load i32, i32* @errno
%35 = call i8* @strerror(i32 %34)
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i8* %35)
%37 = call i32 @exit(i32 -1)
unreachable
38: ; preds = %25
%39 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([226 x i8], [226 x i8]* @str, i64 0, i64 0))
%40 = icmp sgt i32 %29, 0
br i1 %40, label %41, label %76
41: ; preds = %38
%42 = bitcast %struct.v4l2_capability* %5 to %struct.v4l2_tuner*
%43 = getelementptr inbounds %struct.v4l2_capability, %struct.v4l2_capability* %5, i64 0, i32 0
%44 = getelementptr inbounds %struct.v4l2_tuner, %struct.v4l2_tuner* %4, i64 0, i32 1
%45 = getelementptr inbounds %struct.v4l2_tuner, %struct.v4l2_tuner* %4, i64 0, i32 2
%46 = getelementptr inbounds %struct.v4l2_tuner, %struct.v4l2_tuner* %4, i64 0, i32 3
br label %47
47: ; preds = %41, %72
%48 = phi i32 [ %29, %41 ], [ %74, %72 ]
%49 = load i32, i32* @VIDIOC_QUERYCAP
%50 = call i32 @ioctl(i32 %31, i32 %49, %struct.v4l2_tuner* %42)
%51 = icmp slt i32 %50, 0
br i1 %51, label %52, label %56
52: ; preds = %47
%53 = load i32, i32* @errno
%54 = call i8* @strerror(i32 %53)
%55 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), i8* %54)
br label %59
56: ; preds = %47
%57 = load i8*, i8** %43
%58 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0), i8* %57)
br label %59
59: ; preds = %56, %52
%60 = load i32, i32* @VIDIOC_G_TUNER
%61 = call i32 @ioctl(i32 %31, i32 %60, %struct.v4l2_tuner* %4)
%62 = icmp slt i32 %61, 0
br i1 %62, label %63, label %67
63: ; preds = %59
%64 = load i32, i32* @errno
%65 = call i8* @strerror(i32 %64)
%66 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0), i8* %65)
br label %72
67: ; preds = %59
%68 = load i32, i32* %44
%69 = load i32, i32* %45
%70 = load i32, i32* %46
%71 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.7, i64 0, i64 0), i32 %68, i32 %69, i32 %70)
br label %72
72: ; preds = %67, %63
%73 = call i32 @sleep(i32 10)
%74 = add nsw i32 %48, -1
%75 = icmp sgt i32 %48, 1
br i1 %75, label %47, label %76
76: ; preds = %72, %38
ret i32 0
}