#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 */
struct in_addr {
  int /*<<< orphan*/ s_addr;
};

/* Variables and functions */
int client(int /*<<< orphan*/, char *);
scalar_t__ inet_aton(char *, struct in_addr *);
int usage(char *);
int main(int argc, char **argv) {
  if (argc != 3)
    return usage(argv[0]);
  struct in_addr inaddr;
  if (inet_aton(argv[1], &inaddr) == 0)
    return usage(argv[0]);
  return client(inaddr.s_addr, argv[2]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     1164 <main+0x34>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1040 <usage@plt>
mov    %eax,-0x4(%rbp)
jmp    11a6 <main+0x76>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <inet_aton@plt>
cmp    $0x0,%rax
jne    1193 <main+0x63>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1040 <usage@plt>
mov    %eax,-0x4(%rbp)
jmp    11a6 <main+0x76>
mov    -0x18(%rbp),%edi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1050 <client@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
cmp    $0x3,%edi
jne    115f <main+0x2f>
mov    0x8(%rbx),%rdi
lea    0x8(%rsp),%rsi
call   1030 <inet_aton@plt>
test   %rax,%rax
je     116c <main+0x3c>
mov    0x8(%rsp),%edi
mov    0x10(%rbx),%rsi
call   1050 <client@plt>
jmp    1174 <main+0x44>
mov    (%rbx),%rdi
add    $0x10,%rsp
pop    %rbx
jmp    1040 <usage@plt>
mov    (%rbx),%rdi
call   1040 <usage@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.in_addr = type { i32 }
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.in_addr
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 3
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 0
%12 = load i8*, i8** %11
%13 = call i32 @usage(i8* %12)
store i32 %13, i32* %3
br label %32
14: ; preds = %2
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
%18 = call i64 @inet_aton(i8* %17, %struct.in_addr* %6)
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %25
20: ; preds = %14
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 0
%23 = load i8*, i8** %22
%24 = call i32 @usage(i8* %23)
store i32 %24, i32* %3
br label %32
25: ; preds = %14
%26 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %6, i32 0, i32 0
%27 = load i32, i32* %26
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 2
%30 = load i8*, i8** %29
%31 = call i32 @client(i32 %27, i8* %30)
store i32 %31, i32* %3
br label %32
32: ; preds = %25, %20, %9
%33 = load i32, i32* %3
ret i32 %33
}

LLVM IR (-O2):
%struct.in_addr = type { i32 }
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.in_addr
%4 = icmp eq i32 %0, 3
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = load i8*, i8** %1
%7 = tail call i32 @usage(i8* %6)
br label %25
8: ; preds = %2
%9 = bitcast %struct.in_addr* %3 to i8*
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = call i64 @inet_aton(i8* %11, %struct.in_addr* %3)
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %8
%15 = load i8*, i8** %1
%16 = call i32 @usage(i8* %15)
br label %23
17: ; preds = %8
%18 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %3, i64 0, i32 0
%19 = load i32, i32* %18
%20 = getelementptr inbounds i8*, i8** %1, i64 2
%21 = load i8*, i8** %20
%22 = call i32 @client(i32 %19, i8* %21)
br label %23
23: ; preds = %17, %14
%24 = phi i32 [ %16, %14 ], [ %22, %17 ]
br label %25
25: ; preds = %23, %5
%26 = phi i32 [ %7, %5 ], [ %24, %23 ]
ret i32 %26
}