#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__ Banned(char *, char *);
int /*<<< orphan*/ GetIP(char *, char *, char *);
scalar_t__ TempBanned(char *);
int checkBanned(char *data, char *password) {
  char port[1024];
  char ip[20];
  GetIP(data, ip, port);
  if (Banned(ip, password))
    return 1;
  else if (TempBanned(ip))
    return 2;
  else
    return 0;
}


x86 assembly (clang, -O0):
<checkBanned>:
push   %rbp
mov    %rsp,%rbp
sub    $0x440,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x440(%rbp),%rsi
lea    -0x420(%rbp),%rdx
call   1030 <GetIP@plt>
lea    -0x440(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <Banned@plt>
cmp    $0x0,%rax
je     1180 <checkBanned+0x50>
movl   $0x1,-0x4(%rbp)
jmp    11a9 <checkBanned+0x79>
lea    -0x440(%rbp),%rdi
call   1050 <TempBanned@plt>
cmp    $0x0,%rax
je     11a2 <checkBanned+0x72>
movl   $0x2,-0x4(%rbp)
jmp    11a9 <checkBanned+0x79>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x440,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkBanned>:
push   %r14
push   %rbx
sub    $0x428,%rsp
mov    %rsi,%rbx
mov    %rsp,%r14
lea    0x20(%rsp),%rdx
mov    %r14,%rsi
call   1030 <GetIP@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <Banned@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
jne    117a <checkBanned+0x4a>
mov    %rsp,%rdi
call   1050 <TempBanned@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    %eax,%eax
add    $0x428,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @checkBanned(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca [1024 x i8]
%7 = alloca [20 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = getelementptr inbounds [20 x i8], [20 x i8]* %7, i64 0, i64 0
%10 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%11 = call i32 @GetIP(i8* %8, i8* %9, i8* %10)
%12 = getelementptr inbounds [20 x i8], [20 x i8]* %7, i64 0, i64 0
%13 = load i8*, i8** %5
%14 = call i64 @Banned(i8* %12, i8* %13)
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %2
store i32 1, i32* %3
br label %23
17: ; preds = %2
%18 = getelementptr inbounds [20 x i8], [20 x i8]* %7, i64 0, i64 0
%19 = call i64 @TempBanned(i8* %18)
%20 = icmp ne i64 %19, 0
br i1 %20, label %21, label %22
21: ; preds = %17
store i32 2, i32* %3
br label %23
22: ; preds = %17
store i32 0, i32* %3
br label %23
23: ; preds = %22, %21, %16
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @checkBanned(i8* %0, i8* %1) {
%3 = alloca [1024 x i8]
%4 = alloca [20 x i8]
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%7 = call i32 @GetIP(i8* %0, i8* %6, i8* %5)
%8 = call i64 @Banned(i8* %6, i8* %1)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = call i64 @TempBanned(i8* %6)
%12 = icmp eq i64 %11, 0
%13 = select i1 %12, i32 0, i32 2
br label %14
14: ; preds = %10, %2
%15 = phi i32 [ 1, %2 ], [ %13, %10 ]
ret i32 %15
}