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

/* Variables and functions */
int /*<<< orphan*/ clear_command(char *);
scalar_t__ protected_set(char *);
int /*<<< orphan*/ set_error1(char *);
int parse_clear(struct msscene *ms, int n_words, char words[16][64]) {
  if (n_words != 1) {
    set_error1("user not allowed to modify protected set");
    return (0);
  }
  if (protected_set(words[1])) {
    set_error1("user not allowed to modify protected set");
    return (0);
  }
  clear_command(words[1]);
  return (1);
}


x86 assembly (clang, -O0):
<parse_clear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
cmpl   $0x1,-0x14(%rbp)
je     1165 <parse_clear+0x35>
lea    0xeac(%rip),%rdi
call   1040 <set_error1@plt>
movl   $0x0,-0x4(%rbp)
jmp    11a8 <parse_clear+0x78>
mov    -0x20(%rbp),%rdi
add    $0x40,%rdi
call   1030 <protected_set@plt>
cmp    $0x0,%rax
je     1194 <parse_clear+0x64>
lea    0xe7d(%rip),%rdi
call   1040 <set_error1@plt>
movl   $0x0,-0x4(%rbp)
jmp    11a8 <parse_clear+0x78>
mov    -0x20(%rbp),%rdi
add    $0x40,%rdi
call   1050 <clear_command@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_clear>:
push   %rbx
cmp    $0x1,%esi
jne    114a <parse_clear+0x1a>
mov    %rdx,%rbx
add    $0x40,%rbx
mov    %rbx,%rdi
call   1030 <protected_set@plt>
test   %rax,%rax
je     115a <parse_clear+0x2a>
lea    0xeaf(%rip),%rdi
call   1040 <set_error1@plt>
xor    %eax,%eax
pop    %rbx
ret
mov    %rbx,%rdi
call   1050 <clear_command@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.msscene = type { i32 }
@.str = [41 x i8] c"user not allowed to modify protected set\00"
define i32 @parse_clear(%struct.msscene* %0, i32 %1, [64 x i8]* %2) {
%4 = alloca i32
%5 = alloca %struct.msscene*
%6 = alloca i32
%7 = alloca [64 x i8]*
store %struct.msscene* %0, %struct.msscene** %5
store i32 %1, i32* %6
store [64 x i8]* %2, [64 x i8]** %7
%8 = load i32, i32* %6
%9 = icmp ne i32 %8, 1
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = call i32 @set_error1(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %4
br label %25
12: ; preds = %3
%13 = load [64 x i8]*, [64 x i8]** %7
%14 = getelementptr inbounds [64 x i8], [64 x i8]* %13, i64 1
%15 = getelementptr inbounds [64 x i8], [64 x i8]* %14, i64 0, i64 0
%16 = call i64 @protected_set(i8* %15)
%17 = icmp ne i64 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %12
%19 = call i32 @set_error1(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %4
br label %25
20: ; preds = %12
%21 = load [64 x i8]*, [64 x i8]** %7
%22 = getelementptr inbounds [64 x i8], [64 x i8]* %21, i64 1
%23 = getelementptr inbounds [64 x i8], [64 x i8]* %22, i64 0, i64 0
%24 = call i32 @clear_command(i8* %23)
store i32 1, i32* %4
br label %25
25: ; preds = %20, %18, %10
%26 = load i32, i32* %4
ret i32 %26
}

LLVM IR (-O2):
%struct.msscene = type { i32 }
@.str = [41 x i8] c"user not allowed to modify protected set\00"
define i32 @parse_clear(%struct.msscene* nocapture readnone %0, i32 %1, [64 x i8]* %2) {
%4 = icmp eq i32 %1, 1
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @set_error1(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
br label %15
7: ; preds = %3
%8 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 1, i64 0
%9 = tail call i64 @protected_set(i8* %8)
%10 = icmp eq i64 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %7
%12 = tail call i32 @set_error1(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
br label %15
13: ; preds = %7
%14 = tail call i32 @clear_command(i8* %8)
br label %15
15: ; preds = %13, %11, %5
%16 = phi i32 [ 0, %5 ], [ 0, %11 ], [ 1, %13 ]
ret i32 %16
}