#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*/ atoi(char *);
scalar_t__ isValidIpAddress(char *);
scalar_t__ isValidPort(int /*<<< orphan*/);
int isValidArguments(int argc, char **argv) {
  return (argc == 3 && isValidIpAddress(argv[1]) && isValidPort(atoi(argv[2])));
}


x86 assembly (clang, -O0):
<isValidArguments>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
cmpl   $0x3,-0x4(%rbp)
mov    %al,-0x11(%rbp)
jne    118b <isValidArguments+0x5b>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <isValidIpAddress@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
je     118b <isValidArguments+0x5b>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,%edi
call   1030 <isValidPort@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isValidArguments>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
cmp    $0x3,%edi
jne    1164 <isValidArguments+0x34>
mov    %rsi,%r14
mov    0x8(%rsi),%rdi
call   1040 <isValidIpAddress@plt>
test   %rax,%rax
je     1164 <isValidArguments+0x34>
mov    0x10(%r14),%rdi
call   1050 <atoi@plt>
mov    %eax,%edi
call   1030 <isValidPort@plt>
xor    %ebx,%ebx
test   %rax,%rax
setne  %bl
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @isValidArguments(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 3
br i1 %6, label %7, label %20
7: ; preds = %2
%8 = load i8**, i8*** %4
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = call i64 @isValidIpAddress(i8* %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %20
13: ; preds = %7
%14 = load i8**, i8*** %4
%15 = getelementptr inbounds i8*, i8** %14, i64 2
%16 = load i8*, i8** %15
%17 = call i32 @atoi(i8* %16)
%18 = call i64 @isValidPort(i32 %17)
%19 = icmp ne i64 %18, 0
br label %20
20: ; preds = %13, %7, %2
%21 = phi i1 [ false, %7 ], [ false, %2 ], [ %19, %13 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @isValidArguments(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 3
br i1 %3, label %4, label %16
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i64 @isValidIpAddress(i8* %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %16, label %9
9: ; preds = %4
%10 = getelementptr inbounds i8*, i8** %1, i64 2
%11 = load i8*, i8** %10
%12 = tail call i32 @atoi(i8* %11)
%13 = tail call i64 @isValidPort(i32 %12)
%14 = icmp ne i64 %13, 0
%15 = zext i1 %14 to i32
br label %16
16: ; preds = %9, %4, %2
%17 = phi i32 [ 0, %4 ], [ 0, %2 ], [ %15, %9 ]
ret i32 %17
}