#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*/ app_error(char *);
int inet_pton(int, char const *, void *);
int /*<<< orphan*/ unix_error(char *);
void Inet_pton(int af, const char *src, void *dst) {
  int rc;
  rc = inet_pton(af, src, dst);
  if (rc == 0)
    app_error("inet_pton error: invalid dotted-decimal address");
  else if (rc < 0)
    unix_error("Inet_pton error");
}


x86 assembly (clang, -O0):
<Inet_pton>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <inet_pton@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    1171 <Inet_pton+0x41>
lea    0xe99(%rip),%rdi
call   1040 <app_error@plt>
jmp    118c <Inet_pton+0x5c>
cmpl   $0x0,-0x1c(%rbp)
jge    1187 <Inet_pton+0x57>
lea    0xeae(%rip),%rdi
call   1050 <unix_error@plt>
jmp    118c <Inet_pton+0x5c>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Inet_pton>:
push   %rax
call   1030 <inet_pton@plt>
test   %eax,%eax
je     113e <Inet_pton+0xe>
js     114b <Inet_pton+0x1b>
pop    %rax
ret
lea    0xebb(%rip),%rdi
pop    %rax
jmp    1040 <app_error@plt>
lea    0xede(%rip),%rdi
pop    %rax
jmp    1050 <unix_error@plt>

LLVM IR (-O0):
@.str = [48 x i8] c"inet_pton error: invalid dotted-decimal address\00"
@.str.1 = [16 x i8] c"Inet_pton error\00"
define void @Inet_pton(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = call i32 @inet_pton(i32 %8, i8* %9, i8* %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %3
%15 = call i32 @app_error(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
br label %22
16: ; preds = %3
%17 = load i32, i32* %7
%18 = icmp slt i32 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = call i32 @unix_error(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
br label %21
21: ; preds = %19, %16
br label %22
22: ; preds = %21, %14
ret void
}

LLVM IR (-O2):
@.str = [48 x i8] c"inet_pton error: invalid dotted-decimal address\00"
@.str.1 = [16 x i8] c"Inet_pton error\00"
define void @Inet_pton(i32 %0, i8* %1, i8* %2) {
%4 = tail call i32 @inet_pton(i32 %0, i8* %1, i8* %2)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @app_error(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
br label %12
8: ; preds = %3
%9 = icmp slt i32 %4, 0
br i1 %9, label %10, label %12
10: ; preds = %8
%11 = tail call i32 @unix_error(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %8, %10, %6
ret void
}