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

/* Variables and functions */
int do_usage_one_command(char const *const *, unsigned int,
                         int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *);
int usage_command_internal(const char *const *usagestr, const char *token,
                           int full, int lst, FILE *outf) {
  unsigned int flags = 1U;
  int ret;
  if (full)
    flags |= 2U | 4U;
  if (lst)
    flags |= 8U;
  ret = do_usage_one_command(usagestr, flags, outf);
  switch (ret) {
  case -1:
    fprintf(outf, "No usage for '%s'\n", token);
    break;
  case -2:
    fprintf(outf, "No short description for '%s'\n", token);
    break;
  }
  return ret;
}


x86 assembly (clang, -O0):
<usage_command_internal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
movl   $0x1,-0x24(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1154 <usage_command_internal+0x34>
mov    -0x24(%rbp),%eax
or     $0x6,%eax
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     1167 <usage_command_internal+0x47>
mov    -0x24(%rbp),%eax
or     $0x8,%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    -0x20(%rbp),%rdx
call   1040 <do_usage_one_command@plt>
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    %eax,-0x2c(%rbp)
sub    $0xfffffffe,%eax
je     11b8 <usage_command_internal+0x98>
jmp    118e <usage_command_internal+0x6e>
mov    -0x2c(%rbp),%eax
sub    $0xffffffff,%eax
jne    11cc <usage_command_internal+0xac>
jmp    119f <usage_command_internal+0x7f>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xe52(%rip),%rsi
call   1030 <fprintf@plt>
jmp    11cc <usage_command_internal+0xac>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xe4c(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x28(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage_command_internal>:
push   %rbp
push   %r14
push   %rbx
mov    %r8,%rbx
mov    %rsi,%r14
test   %edx,%edx
mov    $0x1,%eax
mov    $0x7,%edx
cmove  %eax,%edx
lea    0x8(%rdx),%esi
test   %ecx,%ecx
cmove  %edx,%esi
mov    %r8,%rdx
call   1040 <do_usage_one_command@plt>
mov    %eax,%ebp
cmp    $0xffffffff,%eax
je     115e <usage_command_internal+0x3e>
cmp    $0xfffffffe,%ebp
jne    1170 <usage_command_internal+0x50>
lea    0xeb7(%rip),%rsi
jmp    1165 <usage_command_internal+0x45>
lea    0xe9b(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
call   1030 <fprintf@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [19 x i8] c"No usage for '%s'\0A\00"
@.str.1 = [31 x i8] c"No short description for '%s'\0A\00"
define i32 @usage_command_internal(i8** %0, i8* %1, i32 %2, i32 %3, i32* %4) {
%6 = alloca i8**
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32*
%11 = alloca i32
%12 = alloca i32
store i8** %0, i8*** %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32* %4, i32** %10
store i32 1, i32* %11
%13 = load i32, i32* %8
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %5
%16 = load i32, i32* %11
%17 = or i32 %16, 6
store i32 %17, i32* %11
br label %18
18: ; preds = %15, %5
%19 = load i32, i32* %9
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %24
21: ; preds = %18
%22 = load i32, i32* %11
%23 = or i32 %22, 8
store i32 %23, i32* %11
br label %24
24: ; preds = %21, %18
%25 = load i8**, i8*** %6
%26 = load i32, i32* %11
%27 = load i32*, i32** %10
%28 = call i32 @do_usage_one_command(i8** %25, i32 %26, i32* %27)
store i32 %28, i32* %12
%29 = load i32, i32* %12
switch i32 %29, label %38 [
i32 -1, label %30
i32 -2, label %34
]
30: ; preds = %24
%31 = load i32*, i32** %10
%32 = load i8*, i8** %7
%33 = call i32 @fprintf(i32* %31, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %32)
br label %38
34: ; preds = %24
%35 = load i32*, i32** %10
%36 = load i8*, i8** %7
%37 = call i32 @fprintf(i32* %35, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i8* %36)
br label %38
38: ; preds = %24, %34, %30
%39 = load i32, i32* %12
ret i32 %39
}

LLVM IR (-O2):
@.str = [19 x i8] c"No usage for '%s'\0A\00"
@.str.1 = [31 x i8] c"No short description for '%s'\0A\00"
define i32 @usage_command_internal(i8** %0, i8* %1, i32 %2, i32 %3, i32* %4) {
%6 = icmp eq i32 %2, 0
%7 = select i1 %6, i32 1, i32 7
%8 = icmp eq i32 %3, 0
%9 = or i32 %7, 8
%10 = select i1 %8, i32 %7, i32 %9
%11 = tail call i32 @do_usage_one_command(i8** %0, i32 %10, i32* %4)
switch i32 %11, label %16 [
i32 -1, label %13
i32 -2, label %12
]
12: ; preds = %5
br label %13
13: ; preds = %5, %12
%14 = phi i8* [ getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), %12 ], [ getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), %5 ]
%15 = tail call i32 @fprintf(i32* %4, i8* %14, i8* %1)
br label %16
16: ; preds = %13, %5
ret i32 %11
}