#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 check_member(char *, char *);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ strcpy(char *, char *);
int main(int argc, char *argv[]) {
  int ret = 1;
  if (argc < 3) {
    printf("Usage: ipset-check-member <type> <port>\n");
    return 1;
  }
  char type[10];
  memset(type, 0, 10);
  strcpy(type, argv[1]);
  char member[40];
  memset(member, 0, 40);
  strcpy(member, argv[2]);
  ret = check_member(type, member);
  return (!ret);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    117f <main+0x3f>
lea    0xe92(%rip),%rdi
call   1050 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    11e2 <main+0xa2>
lea    -0x1e(%rbp),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1060 <memset@plt>
lea    -0x1e(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1030 <strcpy@plt>
lea    -0x50(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1060 <memset@plt>
lea    -0x50(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1030 <strcpy@plt>
lea    -0x1e(%rbp),%rdi
lea    -0x50(%rbp),%rsi
call   1040 <check_member@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x40,%rsp
cmp    $0x2,%edi
jg     1161 <main+0x21>
lea    0xeab(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%eax
jmp    11b8 <main+0x78>
mov    %rsi,%rbx
lea    0x6(%rsp),%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1060 <memset@plt>
mov    0x8(%rbx),%rsi
mov    %r14,%rdi
call   1030 <strcpy@plt>
lea    0x10(%rsp),%r15
mov    %r15,%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1060 <memset@plt>
mov    0x10(%rbx),%rsi
mov    %r15,%rdi
call   1030 <strcpy@plt>
mov    %r14,%rdi
mov    %r15,%rsi
call   1050 <check_member@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
add    $0x40,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [41 x i8] c"Usage: ipset-check-member <type> <port>\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [10 x i8]
%8 = alloca [40 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %6
%9 = load i32, i32* %4
%10 = icmp slt i32 %9, 3
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %35
13: ; preds = %2
%14 = getelementptr inbounds [10 x i8], [10 x i8]* %7, i64 0, i64 0
%15 = call i32 @memset(i8* %14, i32 0, i32 10)
%16 = getelementptr inbounds [10 x i8], [10 x i8]* %7, i64 0, i64 0
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 1
%19 = load i8*, i8** %18
%20 = call i32 @strcpy(i8* %16, i8* %19)
%21 = getelementptr inbounds [40 x i8], [40 x i8]* %8, i64 0, i64 0
%22 = call i32 @memset(i8* %21, i32 0, i32 40)
%23 = getelementptr inbounds [40 x i8], [40 x i8]* %8, i64 0, i64 0
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 2
%26 = load i8*, i8** %25
%27 = call i32 @strcpy(i8* %23, i8* %26)
%28 = getelementptr inbounds [10 x i8], [10 x i8]* %7, i64 0, i64 0
%29 = getelementptr inbounds [40 x i8], [40 x i8]* %8, i64 0, i64 0
%30 = call i32 @check_member(i8* %28, i8* %29)
store i32 %30, i32* %6
%31 = load i32, i32* %6
%32 = icmp ne i32 %31, 0
%33 = xor i1 %32, true
%34 = zext i1 %33 to i32
store i32 %34, i32* %3
br label %35
35: ; preds = %13, %11
%36 = load i32, i32* %3
ret i32 %36
}

LLVM IR (-O2):
@str = [40 x i8] c"Usage: ipset-check-member <type> <port>\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [10 x i8]
%4 = alloca [40 x i8]
%5 = icmp slt i32 %0, 3
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
br label %22
8: ; preds = %2
%9 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%10 = call i32 @memset(i8* %9, i32 0, i32 10)
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = load i8*, i8** %11
%13 = call i32 @strcpy(i8* %9, i8* %12)
%14 = getelementptr inbounds [40 x i8], [40 x i8]* %4, i64 0, i64 0
%15 = call i32 @memset(i8* %14, i32 0, i32 40)
%16 = getelementptr inbounds i8*, i8** %1, i64 2
%17 = load i8*, i8** %16
%18 = call i32 @strcpy(i8* %14, i8* %17)
%19 = call i32 @check_member(i8* %9, i8* %14)
%20 = icmp eq i32 %19, 0
%21 = zext i1 %20 to i32
br label %22
22: ; preds = %8, %6
%23 = phi i32 [ 1, %6 ], [ %21, %8 ]
ret i32 %23
}