#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 */
int /*<<< orphan*/ strcmp(char *, char *);
int is_valid_sfile(char *fname) {
  char *tmp;
  tmp = "prot.6rf";
  if (!strcmp(fname, tmp))
    return 0;
  tmp = "prot.lst.dna";
  if (!strcmp(fname, tmp))
    return 0;
  tmp = "prot.lst";
  if (!strcmp(fname, tmp))
    return 0;
  tmp = "prot.src";
  if (!strcmp(fname, tmp))
    return 0;
  tmp = "nocompl";
  if (!strcmp(fname, tmp))
    return 0;
  tmp = "compl";
  if (!strcmp(fname, tmp))
    return 0;
  tmp = "prot.prm";
  if (!strcmp(fname, tmp))
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<is_valid_sfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xedd(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    1149 <is_valid_sfile+0x39>
movl   $0x0,-0x4(%rbp)
jmp    125e <is_valid_sfile+0x14e>
lea    0xeb9(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    1176 <is_valid_sfile+0x66>
movl   $0x0,-0x4(%rbp)
jmp    125e <is_valid_sfile+0x14e>
lea    0xe99(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    11a3 <is_valid_sfile+0x93>
movl   $0x0,-0x4(%rbp)
jmp    125e <is_valid_sfile+0x14e>
lea    0xe75(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    11d0 <is_valid_sfile+0xc0>
movl   $0x0,-0x4(%rbp)
jmp    125e <is_valid_sfile+0x14e>
lea    0xe51(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    11fd <is_valid_sfile+0xed>
movl   $0x0,-0x4(%rbp)
jmp    125e <is_valid_sfile+0x14e>
lea    0xe26(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    122a <is_valid_sfile+0x11a>
movl   $0x0,-0x4(%rbp)
jmp    125e <is_valid_sfile+0x14e>
lea    0xdff(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    1257 <is_valid_sfile+0x147>
movl   $0x0,-0x4(%rbp)
jmp    125e <is_valid_sfile+0x14e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_valid_sfile>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xee3(%rip),%rsi
call   1030 <strcmp@plt>
xor    %ebp,%ebp
test   %eax,%eax
je     119e <is_valid_sfile+0x8e>
lea    0xeda(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     119e <is_valid_sfile+0x8e>
lea    0xed4(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     119e <is_valid_sfile+0x8e>
lea    0xeca(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     119e <is_valid_sfile+0x8e>
lea    0xec0(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     119e <is_valid_sfile+0x8e>
lea    0xeaf(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     119e <is_valid_sfile+0x8e>
lea    0xea2(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
xor    %ebp,%ebp
test   %eax,%eax
setne  %bpl
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"prot.6rf\00"
@.str.1 = [13 x i8] c"prot.lst.dna\00"
@.str.2 = [9 x i8] c"prot.lst\00"
@.str.3 = [9 x i8] c"prot.src\00"
@.str.4 = [8 x i8] c"nocompl\00"
@.str.5 = [6 x i8] c"compl\00"
@.str.6 = [9 x i8] c"prot.prm\00"
define i32 @is_valid_sfile(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @strcmp(i8* %5, i8* %6)
%8 = icmp ne i32 %7, 0
br i1 %8, label %10, label %9
9: ; preds = %1
store i32 0, i32* %2
br label %47
10: ; preds = %1
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8** %4
%11 = load i8*, i8** %3
%12 = load i8*, i8** %4
%13 = call i32 @strcmp(i8* %11, i8* %12)
%14 = icmp ne i32 %13, 0
br i1 %14, label %16, label %15
15: ; preds = %10
store i32 0, i32* %2
br label %47
16: ; preds = %10
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8** %4
%17 = load i8*, i8** %3
%18 = load i8*, i8** %4
%19 = call i32 @strcmp(i8* %17, i8* %18)
%20 = icmp ne i32 %19, 0
br i1 %20, label %22, label %21
21: ; preds = %16
store i32 0, i32* %2
br label %47
22: ; preds = %16
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8** %4
%23 = load i8*, i8** %3
%24 = load i8*, i8** %4
%25 = call i32 @strcmp(i8* %23, i8* %24)
%26 = icmp ne i32 %25, 0
br i1 %26, label %28, label %27
27: ; preds = %22
store i32 0, i32* %2
br label %47
28: ; preds = %22
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8** %4
%29 = load i8*, i8** %3
%30 = load i8*, i8** %4
%31 = call i32 @strcmp(i8* %29, i8* %30)
%32 = icmp ne i32 %31, 0
br i1 %32, label %34, label %33
33: ; preds = %28
store i32 0, i32* %2
br label %47
34: ; preds = %28
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8** %4
%35 = load i8*, i8** %3
%36 = load i8*, i8** %4
%37 = call i32 @strcmp(i8* %35, i8* %36)
%38 = icmp ne i32 %37, 0
br i1 %38, label %40, label %39
39: ; preds = %34
store i32 0, i32* %2
br label %47
40: ; preds = %34
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i8** %4
%41 = load i8*, i8** %3
%42 = load i8*, i8** %4
%43 = call i32 @strcmp(i8* %41, i8* %42)
%44 = icmp ne i32 %43, 0
br i1 %44, label %46, label %45
45: ; preds = %40
store i32 0, i32* %2
br label %47
46: ; preds = %40
store i32 1, i32* %2
br label %47
47: ; preds = %46, %45, %39, %33, %27, %21, %15, %9
%48 = load i32, i32* %2
ret i32 %48
}

LLVM IR (-O2):
@.str = [9 x i8] c"prot.6rf\00"
@.str.1 = [13 x i8] c"prot.lst.dna\00"
@.str.2 = [9 x i8] c"prot.lst\00"
@.str.3 = [9 x i8] c"prot.src\00"
@.str.4 = [8 x i8] c"nocompl\00"
@.str.5 = [6 x i8] c"compl\00"
@.str.6 = [9 x i8] c"prot.prm\00"
define i32 @is_valid_sfile(i8* nocapture %0) {
%2 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(9) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
br i1 %3, label %23, label %4
4: ; preds = %1
%5 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(13) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i32 %5, 0
br i1 %6, label %23, label %7
7: ; preds = %4
%8 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(9) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%9 = icmp eq i32 %8, 0
br i1 %9, label %23, label %10
10: ; preds = %7
%11 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(9) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
%12 = icmp eq i32 %11, 0
br i1 %12, label %23, label %13
13: ; preds = %10
%14 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(8) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0))
%15 = icmp eq i32 %14, 0
br i1 %15, label %23, label %16
16: ; preds = %13
%17 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%18 = icmp eq i32 %17, 0
br i1 %18, label %23, label %19
19: ; preds = %16
%20 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(9) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0))
%21 = icmp ne i32 %20, 0
%22 = zext i1 %21 to i32
br label %23
23: ; preds = %19, %16, %13, %10, %7, %4, %1
%24 = phi i32 [ 0, %1 ], [ 0, %4 ], [ 0, %7 ], [ 0, %10 ], [ 0, %13 ], [ 0, %16 ], [ %22, %19 ]
ret i32 %24
}