#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_print(struct cli_def *, char *, ...);
int /*<<< orphan*/ cli_set_configmode(struct cli_def *, int, char *);
scalar_t__ strcasecmp(char *, char *);
scalar_t__ strcmp(char *, char *);
int cmd_config_int(struct cli_def *cli, char *command __attribute__((unused)),
                   char *argv[], int argc) {
  if (argc < 1) {
    cli_print(cli, "Specify an interface to configure");
    return 0;
  }
  if (strcmp(argv[0], "?") == 0)
    cli_print(cli, "  test0/0");
  else if (strcasecmp(argv[0], "test0/0") == 0)
    cli_set_configmode(cli, 10, "test");
  else
    cli_print(cli, "Unknown interface %s", argv[0]);
  return 0;
}


x86 assembly (clang, -O0):
<cmd_config_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
cmpl   $0x1,-0x24(%rbp)
jge    117f <cmd_config_int+0x3f>
mov    -0x10(%rbp),%rdi
lea    0xe94(%rip),%rsi
mov    $0x0,%al
call   1050 <cli_print@plt>
movl   $0x0,-0x4(%rbp)
jmp    120f <cmd_config_int+0xcf>
mov    -0x20(%rbp),%rax
mov    (%rax),%rdi
lea    0xe95(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11b3 <cmd_config_int+0x73>
mov    -0x10(%rbp),%rdi
lea    0xe7d(%rip),%rsi
mov    $0x0,%al
call   1050 <cli_print@plt>
jmp    1208 <cmd_config_int+0xc8>
mov    -0x20(%rbp),%rax
mov    (%rax),%rdi
lea    0xe65(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    11ea <cmd_config_int+0xaa>
mov    -0x10(%rbp),%rdi
mov    $0xa,%esi
lea    0xe4e(%rip),%rdx
call   1060 <cli_set_configmode@plt>
jmp    1203 <cmd_config_int+0xc3>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rax
mov    (%rax),%rdx
lea    0xe37(%rip),%rsi
mov    $0x0,%al
call   1050 <cli_print@plt>
jmp    1208 <cmd_config_int+0xc8>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_config_int>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
test   %ecx,%ecx
jle    1190 <cmd_config_int+0x50>
mov    %rdx,%rbx
mov    (%rdx),%rdi
lea    0xec9(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1199 <cmd_config_int+0x59>
mov    (%rbx),%r14
lea    0xeb9(%rip),%rsi
mov    %r14,%rdi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     11ac <cmd_config_int+0x6c>
lea    0xeb2(%rip),%rsi
mov    %r15,%rdi
mov    %r14,%rdx
xor    %eax,%eax
call   1050 <cli_print@plt>
jmp    11c0 <cmd_config_int+0x80>
lea    0xe69(%rip),%rsi
jmp    11a0 <cmd_config_int+0x60>
lea    0xe84(%rip),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <cli_print@plt>
jmp    11c0 <cmd_config_int+0x80>
lea    0xe7b(%rip),%rdx
mov    %r15,%rdi
mov    $0xa,%esi
call   1060 <cli_set_configmode@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.cli_def = type { i32 }
@.str = [34 x i8] c"Specify an interface to configure\00"
@.str.1 = [2 x i8] c"?\00"
@.str.2 = [10 x i8] c" test0/0\00"
@.str.3 = [8 x i8] c"test0/0\00"
@.str.4 = [5 x i8] c"test\00"
@.str.5 = [21 x i8] c"Unknown interface %s\00"
define i32 @cmd_config_int(%struct.cli_def* %0, i8* %1, i8** %2, i32 %3) {
%5 = alloca i32
%6 = alloca %struct.cli_def*
%7 = alloca i8*
%8 = alloca i8**
%9 = alloca i32
store %struct.cli_def* %0, %struct.cli_def** %6
store i8* %1, i8** %7
store i8** %2, i8*** %8
store i32 %3, i32* %9
%10 = load i32, i32* %9
%11 = icmp slt i32 %10, 1
br i1 %11, label %12, label %15
12: ; preds = %4
%13 = load %struct.cli_def*, %struct.cli_def** %6
%14 = call i32 (%struct.cli_def*, i8*, ...) @cli_print(%struct.cli_def* %13, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %5
br label %41
15: ; preds = %4
%16 = load i8**, i8*** %8
%17 = getelementptr inbounds i8*, i8** %16, i64 0
%18 = load i8*, i8** %17
%19 = call i64 @strcmp(i8* %18, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %24
21: ; preds = %15
%22 = load %struct.cli_def*, %struct.cli_def** %6
%23 = call i32 (%struct.cli_def*, i8*, ...) @cli_print(%struct.cli_def* %22, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
br label %40
24: ; preds = %15
%25 = load i8**, i8*** %8
%26 = getelementptr inbounds i8*, i8** %25, i64 0
%27 = load i8*, i8** %26
%28 = call i64 @strcasecmp(i8* %27, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%29 = icmp eq i64 %28, 0
br i1 %29, label %30, label %33
30: ; preds = %24
%31 = load %struct.cli_def*, %struct.cli_def** %6
%32 = call i32 @cli_set_configmode(%struct.cli_def* %31, i32 10, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
br label %39
33: ; preds = %24
%34 = load %struct.cli_def*, %struct.cli_def** %6
%35 = load i8**, i8*** %8
%36 = getelementptr inbounds i8*, i8** %35, i64 0
%37 = load i8*, i8** %36
%38 = call i32 (%struct.cli_def*, i8*, ...) @cli_print(%struct.cli_def* %34, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i8* %37)
br label %39
39: ; preds = %33, %30
br label %40
40: ; preds = %39, %21
store i32 0, i32* %5
br label %41
41: ; preds = %40, %12
%42 = load i32, i32* %5
ret i32 %42
}

LLVM IR (-O2):
%struct.cli_def = type { i32 }
@.str = [34 x i8] c"Specify an interface to configure\00"
@.str.1 = [2 x i8] c"?\00"
@.str.2 = [10 x i8] c" test0/0\00"
@.str.3 = [8 x i8] c"test0/0\00"
@.str.4 = [5 x i8] c"test\00"
@.str.5 = [21 x i8] c"Unknown interface %s\00"
define i32 @cmd_config_int(%struct.cli_def* %0, i8* nocapture readnone %1, i8** nocapture %2, i32 %3) {
%5 = icmp slt i32 %3, 1
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = tail call i32 (%struct.cli_def*, i8*, ...) @cli_print(%struct.cli_def* %0, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
br label %22
8: ; preds = %4
%9 = load i8*, i8** %2
%10 = tail call i64 @strcmp(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = tail call i32 (%struct.cli_def*, i8*, ...) @cli_print(%struct.cli_def* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
br label %22
14: ; preds = %8
%15 = load i8*, i8** %2
%16 = tail call i64 @strcasecmp(i8* %15, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %14
%19 = tail call i32 @cli_set_configmode(%struct.cli_def* %0, i32 10, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
br label %22
20: ; preds = %14
%21 = tail call i32 (%struct.cli_def*, i8*, ...) @cli_print(%struct.cli_def* %0, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i8* %15)
br label %22
22: ; preds = %12, %20, %18, %6
ret i32 0
}