#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 v4l2_capability {
  char *card;
  int capabilities;
};
struct option {
  char *member_0;
  char member_3;
  int /*<<< orphan*/ *member_2;
  int /*<<< orphan*/ member_1;
};

/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int V4L2_CAP_AUDIO;
int V4L2_CAP_RADIO;
int V4L2_CAP_TUNER;
int V4L2_CAP_VIDEO_CAPTURE;
int V4L2_CAP_VIDEO_OUTPUT;
int V4L2_CAP_VIDEO_OVERLAY;
int /*<<< orphan*/ VIDIOC_QUERYCAP;
int /*<<< orphan*/ close(int);
int getopt_long(int, char **, char *, struct option const *,
                int /*<<< orphan*/ *);
scalar_t__ ioctl(int, int /*<<< orphan*/, struct v4l2_capability *);
#define no_argument 128
int open(char *, int /*<<< orphan*/);
size_t optind;
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  static const struct option options[] = {{"help", no_argument, NULL, 'h'}, {}};
  int fd;
  char *device;
  struct v4l2_capability v2cap;
  while (1) {
    int option;
    option = getopt_long(argc, argv, "h", options, NULL);
    if (option == -1)
      break;
    switch (option) {
    case 'h':
      printf("Usage: v4l_id [--help] <device file>\n\n");
      return 0;
    default:
      return 1;
    }
  }
  device = argv[optind];
  if (device == NULL)
    return 2;
  fd = open(device, O_RDONLY);
  if (fd < 0)
    return 3;
  if (ioctl(fd, VIDIOC_QUERYCAP, &v2cap) == 0) {
    printf("ID_V4L_VERSION=2\n");
    printf("ID_V4L_PRODUCT=%s\n", v2cap.card);
    printf("ID_V4L_CAPABILITIES=:");
    if ((v2cap.capabilities & V4L2_CAP_VIDEO_CAPTURE) > 0)
      printf("capture:");
    if ((v2cap.capabilities & V4L2_CAP_VIDEO_OUTPUT) > 0)
      printf("video_output:");
    if ((v2cap.capabilities & V4L2_CAP_VIDEO_OVERLAY) > 0)
      printf("video_overlay:");
    if ((v2cap.capabilities & V4L2_CAP_AUDIO) > 0)
      printf("audio:");
    if ((v2cap.capabilities & V4L2_CAP_TUNER) > 0)
      printf("tuner:");
    if ((v2cap.capabilities & V4L2_CAP_RADIO) > 0)
      printf("radio:");
    printf("\n");
  }
  close(fd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe91(%rip),%rdx
lea    0x2c15(%rip),%rcx
xor    %eax,%eax
mov    %eax,%r8d
call   1030 <getopt_long@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0xffffffff,-0x34(%rbp)
jne    1197 <main+0x47>
jmp    11ce <main+0x7e>
mov    -0x34(%rbp),%eax
sub    $0x68,%eax
jne    11c2 <main+0x72>
jmp    11a8 <main+0x58>
lea    0xe58(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1362 <main+0x212>
movl   $0x1,-0x4(%rbp)
jmp    1362 <main+0x212>
mov    -0x10(%rbp),%rax
mov    0x2ddf(%rip),%rcx
mov    (%rcx),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    11fb <main+0xab>
movl   $0x2,-0x4(%rbp)
jmp    1362 <main+0x212>
mov    -0x20(%rbp),%rdi
mov    0x2dca(%rip),%rax
mov    (%rax),%esi
call   1070 <open@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1226 <main+0xd6>
movl   $0x3,-0x4(%rbp)
jmp    1362 <main+0x212>
mov    -0x14(%rbp),%edi
mov    0x2d60(%rip),%rax
mov    (%rax),%esi
lea    -0x30(%rbp),%rdx
call   1050 <ioctl@plt>
cmp    $0x0,%rax
jne    1353 <main+0x203>
lea    0xde2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x30(%rbp),%rsi
lea    0xde2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xde7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x28(%rbp),%eax
mov    0x2d5b(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
jle    1296 <main+0x146>
lea    0xdda(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x28(%rbp),%eax
mov    0x2d28(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
jle    12b9 <main+0x169>
lea    0xdc0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x28(%rbp),%eax
mov    0x2ce5(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
jle    12dc <main+0x18c>
lea    0xdab(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x28(%rbp),%eax
mov    0x2cba(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
jle    12ff <main+0x1af>
lea    0xd97(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x28(%rbp),%eax
mov    0x2cb7(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
jle    1322 <main+0x1d2>
lea    0xd7b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x28(%rbp),%eax
mov    0x2cb4(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
jle    1345 <main+0x1f5>
lea    0xd5f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xce0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%edi
call   1060 <close@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
lea    0xe86(%rip),%rdx
lea    0x2c0a(%rip),%rcx
xor    %r8d,%r8d
call   1050 <getopt_long@plt>
cmp    $0xffffffff,%eax
je     11b4 <main+0x44>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    $0x68,%ecx
jne    12fa <main+0x18a>
lea    0xed2(%rip),%rdi
call   1040 <puts@plt>
jmp    12ea <main+0x17a>
mov    0x2dfd(%rip),%rax
mov    (%rax),%rax
mov    (%rbx,%rax,8),%rdi
test   %rdi,%rdi
je     12ee <main+0x17e>
mov    0x2dfe(%rip),%rax
mov    (%rax),%esi
call   1090 <open@plt>
test   %eax,%eax
js     12f5 <main+0x185>
mov    %eax,%ebx
mov    0x2da6(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
mov    %ebx,%edi
call   1070 <ioctl@plt>
test   %rax,%rax
jne    12e3 <main+0x173>
lea    0xe65(%rip),%rdi
call   1040 <puts@plt>
mov    (%rsp),%rsi
lea    0xdf1(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xdf6(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x8(%rsp),%eax
mov    0x2da2(%rip),%rcx
test   %eax,(%rcx)
jle    124c <main+0xdc>
lea    0xdef(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x8(%rsp),%eax
mov    0x2d75(%rip),%rcx
test   %eax,(%rcx)
jle    1269 <main+0xf9>
lea    0xddb(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x8(%rsp),%eax
mov    0x2d38(%rip),%rcx
test   %eax,(%rcx)
jle    1286 <main+0x116>
lea    0xdcc(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x8(%rsp),%eax
mov    0x2d13(%rip),%rcx
test   %eax,(%rcx)
jle    12a3 <main+0x133>
lea    0xdbe(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x8(%rsp),%eax
mov    0x2d16(%rip),%rcx
test   %eax,(%rcx)
jle    12c0 <main+0x150>
lea    0xda8(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x8(%rsp),%eax
mov    0x2d19(%rip),%rcx
test   %eax,(%rcx)
jle    12d9 <main+0x169>
lea    0xd92(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %ebx,%edi
call   1080 <close@plt>
xor    %eax,%eax
jmp    12fa <main+0x18a>
mov    $0x2,%eax
jmp    12fa <main+0x18a>
mov    $0x3,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.option = type { i8*, i8, i32*, i32 }
%struct.v4l2_capability = type { i8*, i32 }
@main.options = internal constant [2 x %struct.option] [%struct.option { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), i8 -128, i32* null, i32 104 }, %struct.option zeroinitializer]
@.str = [5 x i8] c"help\00"
@.str.1 = [2 x i8] c"h\00"
@.str.2 = [39 x i8] c"Usage: v4l_id [--help] <device file>\0A\0A\00"
@optind = global i64 0
@O_RDONLY = global i32 0
@VIDIOC_QUERYCAP = global i32 0
@.str.3 = [18 x i8] c"ID_V4L_VERSION=2\0A\00"
@.str.4 = [19 x i8] c"ID_V4L_PRODUCT=%s\0A\00"
@.str.5 = [22 x i8] c"ID_V4L_CAPABILITIES=:\00"
@V4L2_CAP_VIDEO_CAPTURE = global i32 0
@.str.6 = [9 x i8] c"capture:\00"
@V4L2_CAP_VIDEO_OUTPUT = global i32 0
@.str.7 = [14 x i8] c"video_output:\00"
@V4L2_CAP_VIDEO_OVERLAY = global i32 0
@.str.8 = [15 x i8] c"video_overlay:\00"
@V4L2_CAP_AUDIO = global i32 0
@.str.9 = [7 x i8] c"audio:\00"
@V4L2_CAP_TUNER = global i32 0
@.str.10 = [7 x i8] c"tuner:\00"
@V4L2_CAP_RADIO = global i32 0
@.str.11 = [7 x i8] c"radio:\00"
@.str.12 = [2 x i8] c"\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
%8 = alloca %struct.v4l2_capability
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %10
10: ; preds = %2
%11 = load i32, i32* %4
%12 = load i8**, i8*** %5
%13 = call i32 @getopt_long(i32 %11, i8** %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), %struct.option* getelementptr inbounds ([2 x %struct.option], [2 x %struct.option]* @main.options, i64 0, i64 0), i32* null)
store i32 %13, i32* %9
%14 = load i32, i32* %9
%15 = icmp eq i32 %14, -1
br i1 %15, label %16, label %17
16: ; preds = %10
br label %22
17: ; preds = %10
%18 = load i32, i32* %9
switch i32 %18, label %21 [
i32 104, label %19
]
19: ; preds = %17
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %3
br label %100
21: ; preds = %17
store i32 1, i32* %3
br label %100
22: ; preds = %16
%23 = load i8**, i8*** %5
%24 = load i64, i64* @optind
%25 = getelementptr inbounds i8*, i8** %23, i64 %24
%26 = load i8*, i8** %25
store i8* %26, i8** %7
%27 = load i8*, i8** %7
%28 = icmp eq i8* %27, null
br i1 %28, label %29, label %30
29: ; preds = %22
store i32 2, i32* %3
br label %100
30: ; preds = %22
%31 = load i8*, i8** %7
%32 = load i32, i32* @O_RDONLY
%33 = call i32 @open(i8* %31, i32 %32)
store i32 %33, i32* %6
%34 = load i32, i32* %6
%35 = icmp slt i32 %34, 0
br i1 %35, label %36, label %37
36: ; preds = %30
store i32 3, i32* %3
br label %100
37: ; preds = %30
%38 = load i32, i32* %6
%39 = load i32, i32* @VIDIOC_QUERYCAP
%40 = call i64 @ioctl(i32 %38, i32 %39, %struct.v4l2_capability* %8)
%41 = icmp eq i64 %40, 0
br i1 %41, label %42, label %97
42: ; preds = %37
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%44 = getelementptr inbounds %struct.v4l2_capability, %struct.v4l2_capability* %8, i32 0, i32 0
%45 = load i8*, i8** %44
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i8* %45)
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0))
%48 = getelementptr inbounds %struct.v4l2_capability, %struct.v4l2_capability* %8, i32 0, i32 1
%49 = load i32, i32* %48
%50 = load i32, i32* @V4L2_CAP_VIDEO_CAPTURE
%51 = and i32 %49, %50
%52 = icmp sgt i32 %51, 0
br i1 %52, label %53, label %55
53: ; preds = %42
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0))
br label %55
55: ; preds = %53, %42
%56 = getelementptr inbounds %struct.v4l2_capability, %struct.v4l2_capability* %8, i32 0, i32 1
%57 = load i32, i32* %56
%58 = load i32, i32* @V4L2_CAP_VIDEO_OUTPUT
%59 = and i32 %57, %58
%60 = icmp sgt i32 %59, 0
br i1 %60, label %61, label %63
61: ; preds = %55
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0))
br label %63
63: ; preds = %61, %55
%64 = getelementptr inbounds %struct.v4l2_capability, %struct.v4l2_capability* %8, i32 0, i32 1
%65 = load i32, i32* %64
%66 = load i32, i32* @V4L2_CAP_VIDEO_OVERLAY
%67 = and i32 %65, %66
%68 = icmp sgt i32 %67, 0
br i1 %68, label %69, label %71
69: ; preds = %63
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0))
br label %71
71: ; preds = %69, %63
%72 = getelementptr inbounds %struct.v4l2_capability, %struct.v4l2_capability* %8, i32 0, i32 1
%73 = load i32, i32* %72
%74 = load i32, i32* @V4L2_CAP_AUDIO
%75 = and i32 %73, %74
%76 = icmp sgt i32 %75, 0
br i1 %76, label %77, label %79
77: ; preds = %71
%78 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0))
br label %79
79: ; preds = %77, %71
%80 = getelementptr inbounds %struct.v4l2_capability, %struct.v4l2_capability* %8, i32 0, i32 1
%81 = load i32, i32* %80
%82 = load i32, i32* @V4L2_CAP_TUNER
%83 = and i32 %81, %82
%84 = icmp sgt i32 %83, 0
br i1 %84, label %85, label %87
85: ; preds = %79
%86 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0))
br label %87
87: ; preds = %85, %79
%88 = getelementptr inbounds %struct.v4l2_capability, %struct.v4l2_capability* %8, i32 0, i32 1
%89 = load i32, i32* %88
%90 = load i32, i32* @V4L2_CAP_RADIO
%91 = and i32 %89, %90
%92 = icmp sgt i32 %91, 0
br i1 %92, label %93, label %95
93: ; preds = %87
%94 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0))
br label %95
95: ; preds = %93, %87
%96 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0))
br label %97
97: ; preds = %95, %37
%98 = load i32, i32* %6
%99 = call i32 @close(i32 %98)
store i32 0, i32* %3
br label %100
100: ; preds = %97, %36, %29, %21, %19
%101 = load i32, i32* %3
ret i32 %101
}

LLVM IR (-O2):
%struct.option = type { i8*, i8, i32*, i32 }
%struct.v4l2_capability = type { i8*, i32 }
@main.options = internal constant [2 x %struct.option] [%struct.option { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), i8 -128, i32* null, i32 104 }, %struct.option zeroinitializer]
@.str = [5 x i8] c"help\00"
@.str.1 = [2 x i8] c"h\00"
@optind = global i64 0
@O_RDONLY = global i32 0
@VIDIOC_QUERYCAP = global i32 0
@.str.4 = [19 x i8] c"ID_V4L_PRODUCT=%s\0A\00"
@.str.5 = [22 x i8] c"ID_V4L_CAPABILITIES=:\00"
@V4L2_CAP_VIDEO_CAPTURE = global i32 0
@.str.6 = [9 x i8] c"capture:\00"
@V4L2_CAP_VIDEO_OUTPUT = global i32 0
@.str.7 = [14 x i8] c"video_output:\00"
@V4L2_CAP_VIDEO_OVERLAY = global i32 0
@.str.8 = [15 x i8] c"video_overlay:\00"
@V4L2_CAP_AUDIO = global i32 0
@.str.9 = [7 x i8] c"audio:\00"
@V4L2_CAP_TUNER = global i32 0
@.str.10 = [7 x i8] c"tuner:\00"
@V4L2_CAP_RADIO = global i32 0
@.str.11 = [7 x i8] c"radio:\00"
@str = [17 x i8] c"ID_V4L_VERSION=2\00"
@str.13 = [38 x i8] c"Usage: v4l_id [--help] <device file>\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca %struct.v4l2_capability
%4 = bitcast %struct.v4l2_capability* %3 to i8*
%5 = tail call i32 @getopt_long(i32 %0, i8** %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), %struct.option* getelementptr inbounds ([2 x %struct.option], [2 x %struct.option]* @main.options, i64 0, i64 0), i32* null)
switch i32 %5, label %78 [
i32 -1, label %8
i32 104, label %6
]
6: ; preds = %2
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.13, i64 0, i64 0))
br label %78
8: ; preds = %2
%9 = load i64, i64* @optind
%10 = getelementptr inbounds i8*, i8** %1, i64 %9
%11 = load i8*, i8** %10
%12 = icmp eq i8* %11, null
br i1 %12, label %78, label %13
13: ; preds = %8
%14 = load i32, i32* @O_RDONLY
%15 = tail call i32 @open(i8* %11, i32 %14)
%16 = icmp slt i32 %15, 0
br i1 %16, label %78, label %17
17: ; preds = %13
%18 = load i32, i32* @VIDIOC_QUERYCAP
%19 = call i64 @ioctl(i32 %15, i32 %18, %struct.v4l2_capability* %3)
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %76
21: ; preds = %17
%22 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%23 = getelementptr inbounds %struct.v4l2_capability, %struct.v4l2_capability* %3, i64 0, i32 0
%24 = load i8*, i8** %23
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i8* %24)
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0))
%27 = getelementptr inbounds %struct.v4l2_capability, %struct.v4l2_capability* %3, i64 0, i32 1
%28 = load i32, i32* %27
%29 = load i32, i32* @V4L2_CAP_VIDEO_CAPTURE
%30 = and i32 %29, %28
%31 = icmp sgt i32 %30, 0
br i1 %31, label %32, label %35
32: ; preds = %21
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0))
%34 = load i32, i32* %27
br label %35
35: ; preds = %32, %21
%36 = phi i32 [ %34, %32 ], [ %28, %21 ]
%37 = load i32, i32* @V4L2_CAP_VIDEO_OUTPUT
%38 = and i32 %37, %36
%39 = icmp sgt i32 %38, 0
br i1 %39, label %40, label %43
40: ; preds = %35
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0))
%42 = load i32, i32* %27
br label %43
43: ; preds = %40, %35
%44 = phi i32 [ %42, %40 ], [ %36, %35 ]
%45 = load i32, i32* @V4L2_CAP_VIDEO_OVERLAY
%46 = and i32 %45, %44
%47 = icmp sgt i32 %46, 0
br i1 %47, label %48, label %51
48: ; preds = %43
%49 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0))
%50 = load i32, i32* %27
br label %51
51: ; preds = %48, %43
%52 = phi i32 [ %50, %48 ], [ %44, %43 ]
%53 = load i32, i32* @V4L2_CAP_AUDIO
%54 = and i32 %53, %52
%55 = icmp sgt i32 %54, 0
br i1 %55, label %56, label %59
56: ; preds = %51
%57 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0))
%58 = load i32, i32* %27
br label %59
59: ; preds = %56, %51
%60 = phi i32 [ %58, %56 ], [ %52, %51 ]
%61 = load i32, i32* @V4L2_CAP_TUNER
%62 = and i32 %61, %60
%63 = icmp sgt i32 %62, 0
br i1 %63, label %64, label %67
64: ; preds = %59
%65 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0))
%66 = load i32, i32* %27
br label %67
67: ; preds = %64, %59
%68 = phi i32 [ %66, %64 ], [ %60, %59 ]
%69 = load i32, i32* @V4L2_CAP_RADIO
%70 = and i32 %69, %68
%71 = icmp sgt i32 %70, 0
br i1 %71, label %72, label %74
72: ; preds = %67
%73 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0))
br label %74
74: ; preds = %72, %67
%75 = call i32 @putchar(i32 10)
br label %76
76: ; preds = %74, %17
%77 = call i32 @close(i32 %15)
br label %78
78: ; preds = %2, %6, %13, %8, %76
%79 = phi i32 [ 0, %76 ], [ 2, %8 ], [ 3, %13 ], [ 0, %6 ], [ 1, %2 ]
ret i32 %79
}