#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 */
char *config_getvalue(char *);
int /*<<< orphan*/ strcmp(char const *, char *);
int default_mxp_mode() {
  const char *mode;
  mode = config_getvalue("config.advanced.default_mxp_mode");
  if (!mode || !strcmp(mode, "locked"))
    return 7;
  else if (!strcmp(mode, "secure"))
    return 6;
  else if (!strcmp(mode, "open"))
    return 5;
  else
    return 0;
}


x86 assembly (clang, -O0):
<default_mxp_mode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1040 <config_getvalue@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     115c <default_mxp_mode+0x3c>
mov    -0x10(%rbp),%rdi
lea    0xed3(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    1168 <default_mxp_mode+0x48>
movl   $0x7,-0x4(%rbp)
jmp    11b9 <default_mxp_mode+0x99>
mov    -0x10(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    118d <default_mxp_mode+0x6d>
movl   $0x6,-0x4(%rbp)
jmp    11b9 <default_mxp_mode+0x99>
mov    -0x10(%rbp),%rdi
lea    0xe97(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    11b2 <default_mxp_mode+0x92>
movl   $0x5,-0x4(%rbp)
jmp    11b9 <default_mxp_mode+0x99>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<default_mxp_mode>:
push   %rbp
push   %rbx
push   %rax
lea    0xed6(%rip),%rdi
call   1040 <config_getvalue@plt>
mov    $0x7,%ebp
test   %rax,%rax
je     1182 <default_mxp_mode+0x62>
mov    %rax,%rbx
lea    0xede(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     1182 <default_mxp_mode+0x62>
lea    0xed2(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     117d <default_mxp_mode+0x5d>
lea    0xec6(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
lea    (%rcx,%rcx,4),%ebp
jmp    1182 <default_mxp_mode+0x62>
mov    $0x6,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [33 x i8] c"config.advanced.default_mxp_mode\00"
@.str.1 = [7 x i8] c"locked\00"
@.str.2 = [7 x i8] c"secure\00"
@.str.3 = [5 x i8] c"open\00"
define i32 @default_mxp_mode() {
%1 = alloca i32
%2 = alloca i8*
%3 = call i8* @config_getvalue(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = load i8*, i8** %2
%8 = call i32 @strcmp(i8* %7, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp ne i32 %8, 0
br i1 %9, label %11, label %10
10: ; preds = %6, %0
store i32 7, i32* %1
br label %22
11: ; preds = %6
%12 = load i8*, i8** %2
%13 = call i32 @strcmp(i8* %12, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%14 = icmp ne i32 %13, 0
br i1 %14, label %16, label %15
15: ; preds = %11
store i32 6, i32* %1
br label %22
16: ; preds = %11
%17 = load i8*, i8** %2
%18 = call i32 @strcmp(i8* %17, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%19 = icmp ne i32 %18, 0
br i1 %19, label %21, label %20
20: ; preds = %16
store i32 5, i32* %1
br label %22
21: ; preds = %16
store i32 0, i32* %1
br label %22
22: ; preds = %21, %20, %15, %10
%23 = load i32, i32* %1
ret i32 %23
}

LLVM IR (-O2):
@.str = [33 x i8] c"config.advanced.default_mxp_mode\00"
@.str.1 = [7 x i8] c"locked\00"
@.str.2 = [7 x i8] c"secure\00"
@.str.3 = [5 x i8] c"open\00"
define i32 @default_mxp_mode() {
%1 = tail call i8* @config_getvalue(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8* %1, null
br i1 %2, label %13, label %3
3: ; preds = %0
%4 = tail call i32 @strcmp(i8* %1, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%5 = icmp eq i32 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %3
%7 = tail call i32 @strcmp(i8* %1, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%8 = icmp eq i32 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %6
%10 = tail call i32 @strcmp(i8* %1, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%11 = icmp eq i32 %10, 0
%12 = select i1 %11, i32 5, i32 0
br label %13
13: ; preds = %9, %6, %0, %3
%14 = phi i32 [ 7, %3 ], [ 7, %0 ], [ 6, %6 ], [ %12, %9 ]
ret i32 %14
}