#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 cli_def {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cli_error(struct cli_def *, char *, ...);
int /*<<< orphan*/ cli_int_buildmode_reset_unset_help(struct cli_def *);
scalar_t__ cli_set_optarg_value(struct cli_def *, char const *, char const *,
                                int /*<<< orphan*/);
int cli_int_buildmode_flag_cback(struct cli_def *cli, const char *command,
                                 char *argv[], int argc) {
  int rc = -10;
  if (argc) {
    cli_error(cli, "Extra arguments on command line, command ignored.");
    rc = -1;
  }
  if (cli_set_optarg_value(cli, command, command, 0)) {
    cli_error(cli, "Problem setting value for optional flag %s", command);
    rc = -1;
  }
  cli_int_buildmode_reset_unset_help(cli);
  return rc;
}


x86 assembly (clang, -O0):
<cli_int_buildmode_flag_cback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movl   $0xfffffff6,-0x20(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1171 <cli_int_buildmode_flag_cback+0x41>
mov    -0x8(%rbp),%rdi
lea    0xe9d(%rip),%rsi
mov    $0x0,%al
call   1030 <cli_error@plt>
movl   $0xffffffff,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x10(%rbp),%rdx
xor    %ecx,%ecx
call   1050 <cli_set_optarg_value@plt>
cmp    $0x0,%rax
je     11ab <cli_int_buildmode_flag_cback+0x7b>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xe95(%rip),%rsi
mov    $0x0,%al
call   1030 <cli_error@plt>
movl   $0xffffffff,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <cli_int_buildmode_reset_unset_help@plt>
mov    -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cli_int_buildmode_flag_cback>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
test   %ecx,%ecx
je     1156 <cli_int_buildmode_flag_cback+0x26>
lea    0xebb(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <cli_error@plt>
mov    $0xffffffff,%ebp
jmp    115b <cli_int_buildmode_flag_cback+0x2b>
mov    $0xfffffff6,%ebp
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r14,%rdx
xor    %ecx,%ecx
call   1050 <cli_set_optarg_value@plt>
test   %rax,%rax
je     1189 <cli_int_buildmode_flag_cback+0x59>
lea    0xebb(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
xor    %eax,%eax
call   1030 <cli_error@plt>
mov    $0xffffffff,%ebp
mov    %rbx,%rdi
call   1040 <cli_int_buildmode_reset_unset_help@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.cli_def = type { i32 }
@.str = [50 x i8] c"Extra arguments on command line, command ignored.\00"
@.str.1 = [43 x i8] c"Problem setting value for optional flag %s\00"
define i32 @cli_int_buildmode_flag_cback(%struct.cli_def* %0, i8* %1, i8** %2, i32 %3) {
%5 = alloca %struct.cli_def*
%6 = alloca i8*
%7 = alloca i8**
%8 = alloca i32
%9 = alloca i32
store %struct.cli_def* %0, %struct.cli_def** %5
store i8* %1, i8** %6
store i8** %2, i8*** %7
store i32 %3, i32* %8
store i32 -10, i32* %9
%10 = load i32, i32* %8
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %4
%13 = load %struct.cli_def*, %struct.cli_def** %5
%14 = call i32 (%struct.cli_def*, i8*, ...) @cli_error(%struct.cli_def* %13, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %9
br label %15
15: ; preds = %12, %4
%16 = load %struct.cli_def*, %struct.cli_def** %5
%17 = load i8*, i8** %6
%18 = load i8*, i8** %6
%19 = call i64 @cli_set_optarg_value(%struct.cli_def* %16, i8* %17, i8* %18, i32 0)
%20 = icmp ne i64 %19, 0
br i1 %20, label %21, label %25
21: ; preds = %15
%22 = load %struct.cli_def*, %struct.cli_def** %5
%23 = load i8*, i8** %6
%24 = call i32 (%struct.cli_def*, i8*, ...) @cli_error(%struct.cli_def* %22, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0), i8* %23)
store i32 -1, i32* %9
br label %25
25: ; preds = %21, %15
%26 = load %struct.cli_def*, %struct.cli_def** %5
%27 = call i32 @cli_int_buildmode_reset_unset_help(%struct.cli_def* %26)
%28 = load i32, i32* %9
ret i32 %28
}

LLVM IR (-O2):
%struct.cli_def = type { i32 }
@.str = [50 x i8] c"Extra arguments on command line, command ignored.\00"
@.str.1 = [43 x i8] c"Problem setting value for optional flag %s\00"
define i32 @cli_int_buildmode_flag_cback(%struct.cli_def* %0, i8* %1, i8** nocapture readnone %2, i32 %3) {
%5 = icmp eq i32 %3, 0
br i1 %5, label %8, label %6
6: ; preds = %4
%7 = tail call i32 (%struct.cli_def*, i8*, ...) @cli_error(%struct.cli_def* %0, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %4
%9 = phi i32 [ -1, %6 ], [ -10, %4 ]
%10 = tail call i64 @cli_set_optarg_value(%struct.cli_def* %0, i8* %1, i8* %1, i32 0)
%11 = icmp eq i64 %10, 0
br i1 %11, label %14, label %12
12: ; preds = %8
%13 = tail call i32 (%struct.cli_def*, i8*, ...) @cli_error(%struct.cli_def* %0, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0), i8* %1)
br label %14
14: ; preds = %12, %8
%15 = phi i32 [ -1, %12 ], [ %9, %8 ]
%16 = tail call i32 @cli_int_buildmode_reset_unset_help(%struct.cli_def* %0)
ret i32 %15
}