#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 */

/* Variables and functions */
int /*<<< orphan*/ dprintf(int, char *);
scalar_t__ help_shortcmdline(int, char const *, char *);
void help_add(const char *program, int brief, int argc, char **argv) {
  if (!brief)
    dprintf(2, "\n adding devices ('add')"
               "\n ======================");
  if (help_shortcmdline(brief, program,
                        "add {<flags>} [<device> [<outputdevice>]]"))
    return;
  dprintf(2, "\n <flags>  \tany of the following flags may be present"
             "\n\t -n <name>           : pretty name for the device"
             "\n\t -w <max_width>      : maximum allowed frame width"
             "\n\t -h <max_height>     : maximum allowed frame height"
             "\n\t -x <exclusive_caps> : whether to announce OUTPUT/CAPTURE "
             "capabilities exclusively"
             "\n\t -b <buffers>        : buffers to queue"
             "\n\t -o <max_openers>    : maximum allowed concurrent openers"
             "\n\t -v                  : verbose mode (print properties of "
             "device after successfully creating it)"
             "\n"
             "\n <device>\tif given, create a specific device (otherwise just "
             "create a free one)."
             "\n         \teither specify a device name (e.g. '/dev/video1') "
             "or a device number ('1')."
             "\n <outputdevice>\tif given, use separate output & capture "
             "devices (otherwise they are the same).");
}


x86 assembly (clang, -O0):
<help_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1151 <help_add+0x31>
mov    $0x2,%edi
lea    0xeb4(%rip),%rsi
call   1030 <dprintf@plt>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
lea    0xed2(%rip),%rdx
call   1040 <help_shortcmdline@plt>
cmp    $0x0,%rax
je     1173 <help_add+0x53>
jmp    1184 <help_add+0x64>
mov    $0x2,%edi
lea    0xedc(%rip),%rsi
call   1030 <dprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<help_add>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
test   %esi,%esi
jne    113d <help_add+0x1d>
lea    0xecd(%rip),%rsi
mov    $0x2,%edi
call   1030 <dprintf@plt>
lea    0xeed(%rip),%rdx
mov    %ebp,%edi
mov    %rbx,%rsi
call   1040 <help_shortcmdline@plt>
test   %rax,%rax
je     115a <help_add+0x3a>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
lea    0xefa(%rip),%rsi
mov    $0x2,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <dprintf@plt>

LLVM IR (-O0):
@.str = [49 x i8] c"\0A adding devices ('add')\0A ======================\00"
@.str.1 = [42 x i8] c"add {<flags>} [<device> [<outputdevice>]]\00"
@.str.2 = [754 x i8] c"\0A <flags> \09any of the following flags may be present\0A\09 -n <name> : pretty name for the device\0A\09 -w <max_width> : maximum allowed frame width\0A\09 -h <max_height> : maximum allowed frame height\0A\09 -x <exclusive_caps> : whether to announce OUTPUT/CAPTURE capabilities exclusively\0A\09 -b <buffers> : buffers to queue\0A\09 -o <max_openers> : maximum allowed concurrent openers\0A\09 -v : verbose mode (print properties of device after successfully creating it)\0A\0A <device>\09if given, create a specific device (otherwise just create a free one).\0A \09either specify a device name (e.g. '/dev/video1') or a device number ('1').\0A <outputdevice>\09if given, use separate output & capture devices (otherwise they are the same).\00"
define void @help_add(i8* %0, i32 %1, i32 %2, i8** %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8**
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8** %3, i8*** %8
%9 = load i32, i32* %6
%10 = icmp ne i32 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %4
%12 = call i32 @dprintf(i32 2, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %4
%14 = load i32, i32* %6
%15 = load i8*, i8** %5
%16 = call i64 @help_shortcmdline(i32 %14, i8* %15, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0))
%17 = icmp ne i64 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %13
br label %21
19: ; preds = %13
%20 = call i32 @dprintf(i32 2, i8* getelementptr inbounds ([754 x i8], [754 x i8]* @.str.2, i64 0, i64 0))
br label %21
21: ; preds = %19, %18
ret void
}

LLVM IR (-O2):
@.str = [49 x i8] c"\0A adding devices ('add')\0A ======================\00"
@.str.1 = [42 x i8] c"add {<flags>} [<device> [<outputdevice>]]\00"
@.str.2 = [754 x i8] c"\0A <flags> \09any of the following flags may be present\0A\09 -n <name> : pretty name for the device\0A\09 -w <max_width> : maximum allowed frame width\0A\09 -h <max_height> : maximum allowed frame height\0A\09 -x <exclusive_caps> : whether to announce OUTPUT/CAPTURE capabilities exclusively\0A\09 -b <buffers> : buffers to queue\0A\09 -o <max_openers> : maximum allowed concurrent openers\0A\09 -v : verbose mode (print properties of device after successfully creating it)\0A\0A <device>\09if given, create a specific device (otherwise just create a free one).\0A \09either specify a device name (e.g. '/dev/video1') or a device number ('1').\0A <outputdevice>\09if given, use separate output & capture devices (otherwise they are the same).\00"
define void @help_add(i8* %0, i32 %1, i32 %2, i8** nocapture readnone %3) {
%5 = icmp eq i32 %1, 0
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = tail call i32 @dprintf(i32 2, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %4
%9 = tail call i64 @help_shortcmdline(i32 %1, i8* %0, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = tail call i32 @dprintf(i32 2, i8* getelementptr inbounds ([754 x i8], [754 x i8]* @.str.2, i64 0, i64 0))
br label %13
13: ; preds = %8, %11
ret void
}