#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 */
scalar_t__ strncasecmp(char *, char *, int);
int var_cond(char *);
int /*<<< orphan*/ var_del(char *);
int /*<<< orphan*/ var_set(char *);
int get_void_rvalue(char *lvalue) {
  if (strncasecmp(lvalue, "set ", 4) == 0)
    var_set(lvalue + 4);
  else if (strncasecmp(lvalue, "del ", 4) == 0)
    var_del(lvalue + 4);
  else if (strncasecmp(lvalue, "cond ", 5) == 0)
    return var_cond(lvalue + 5);
  return 1;
}


x86 assembly (clang, -O0):
<get_void_rvalue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xea9(%rip),%rsi
mov    $0x4,%edx
call   1060 <strncasecmp@plt>
cmp    $0x0,%rax
jne    117d <get_void_rvalue+0x3d>
mov    -0x10(%rbp),%rdi
add    $0x4,%rdi
call   1040 <var_set@plt>
jmp    11ec <get_void_rvalue+0xac>
mov    -0x10(%rbp),%rdi
lea    0xe7d(%rip),%rsi
mov    $0x4,%edx
call   1060 <strncasecmp@plt>
cmp    $0x0,%rax
jne    11ae <get_void_rvalue+0x6e>
mov    -0x10(%rbp),%rdi
add    $0x4,%rdi
call   1030 <var_del@plt>
jmp    11e7 <get_void_rvalue+0xa7>
mov    -0x10(%rbp),%rdi
lea    0xe51(%rip),%rsi
mov    $0x5,%edx
call   1060 <strncasecmp@plt>
cmp    $0x0,%rax
jne    11e2 <get_void_rvalue+0xa2>
mov    -0x10(%rbp),%rdi
add    $0x5,%rdi
call   1050 <var_cond@plt>
mov    %eax,-0x4(%rbp)
jmp    11f3 <get_void_rvalue+0xb3>
jmp    11e7 <get_void_rvalue+0xa7>
jmp    11ec <get_void_rvalue+0xac>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_void_rvalue>:
push   %rbx
mov    %rdi,%rbx
lea    0xeb5(%rip),%rsi
mov    $0x4,%edx
call   1060 <strncasecmp@plt>
test   %rax,%rax
je     1199 <get_void_rvalue+0x59>
lea    0xea4(%rip),%rsi
mov    %rbx,%rdi
mov    $0x4,%edx
call   1060 <strncasecmp@plt>
test   %rax,%rax
je     11a7 <get_void_rvalue+0x67>
lea    0xe90(%rip),%rsi
mov    %rbx,%rdi
mov    $0x5,%edx
call   1060 <strncasecmp@plt>
test   %rax,%rax
jne    11b3 <get_void_rvalue+0x73>
add    $0x5,%rbx
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <var_cond@plt>
add    $0x4,%rbx
mov    %rbx,%rdi
call   1040 <var_set@plt>
jmp    11b3 <get_void_rvalue+0x73>
add    $0x4,%rbx
mov    %rbx,%rdi
call   1030 <var_del@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"set \00"
@.str.1 = [5 x i8] c"del \00"
@.str.2 = [6 x i8] c"cond \00"
define i32 @get_void_rvalue(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @strncasecmp(i8* %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 4
%10 = call i32 @var_set(i8* %9)
br label %29
11: ; preds = %1
%12 = load i8*, i8** %3
%13 = call i64 @strncasecmp(i8* %12, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 4)
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %19
15: ; preds = %11
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i64 4
%18 = call i32 @var_del(i8* %17)
br label %28
19: ; preds = %11
%20 = load i8*, i8** %3
%21 = call i64 @strncasecmp(i8* %20, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 5)
%22 = icmp eq i64 %21, 0
br i1 %22, label %23, label %27
23: ; preds = %19
%24 = load i8*, i8** %3
%25 = getelementptr inbounds i8, i8* %24, i64 5
%26 = call i32 @var_cond(i8* %25)
store i32 %26, i32* %2
br label %30
27: ; preds = %19
br label %28
28: ; preds = %27, %15
br label %29
29: ; preds = %28, %7
store i32 1, i32* %2
br label %30
30: ; preds = %29, %23
%31 = load i32, i32* %2
ret i32 %31
}

LLVM IR (-O2):
@.str = [5 x i8] c"set \00"
@.str.1 = [5 x i8] c"del \00"
@.str.2 = [6 x i8] c"cond \00"
define i32 @get_void_rvalue(i8* %0) {
%2 = tail call i64 @strncasecmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 4
%6 = tail call i32 @var_set(i8* %5)
br label %19
7: ; preds = %1
%8 = tail call i64 @strncasecmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 4)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = getelementptr inbounds i8, i8* %0, i64 4
%12 = tail call i32 @var_del(i8* %11)
br label %19
13: ; preds = %7
%14 = tail call i64 @strncasecmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 5)
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %13
%17 = getelementptr inbounds i8, i8* %0, i64 5
%18 = tail call i32 @var_cond(i8* %17)
br label %19
19: ; preds = %4, %13, %10, %16
%20 = phi i32 [ %18, %16 ], [ 1, %10 ], [ 1, %13 ], [ 1, %4 ]
ret i32 %20
}