#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*/ err_quit(char *, char const *);
int /*<<< orphan*/ err_sys(char *, char const *);
int inet_pton(int, char const *, void *);
void Inet_pton(int af, const char *src, void *dst) {
  int n;
  if ((n = inet_pton(af, src, dst)) < 0)
    err_sys("inet_pton error for %s", src);
  else if (n == 0)
    err_quit("inet_pton error for %s", src);
}


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   1050 <inet_pton@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
jge    1174 <Inet_pton+0x44>
mov    -0x10(%rbp),%rsi
lea    0xe96(%rip),%rdi
call   1030 <err_sys@plt>
jmp    1193 <Inet_pton+0x63>
cmpl   $0x0,-0x1c(%rbp)
jne    118e <Inet_pton+0x5e>
mov    -0x10(%rbp),%rsi
lea    0xe77(%rip),%rdi
call   1040 <err_quit@plt>
jmp    1193 <Inet_pton+0x63>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Inet_pton>:
push   %rbx
mov    %rsi,%rbx
call   1050 <inet_pton@plt>
test   %eax,%eax
js     1141 <Inet_pton+0x11>
je     1151 <Inet_pton+0x21>
pop    %rbx
ret
lea    0xeb8(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <err_sys@plt>
lea    0xea8(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <err_quit@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"inet_pton error for %s\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 = icmp slt i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %3
%14 = load i8*, i8** %5
%15 = call i32 @err_sys(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %14)
br label %23
16: ; preds = %3
%17 = load i32, i32* %7
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %22
19: ; preds = %16
%20 = load i8*, i8** %5
%21 = call i32 @err_quit(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %20)
br label %22
22: ; preds = %19, %16
br label %23
23: ; preds = %22, %13
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"inet_pton error for %s\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 slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @err_sys(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %1)
br label %12
8: ; preds = %3
%9 = icmp eq i32 %4, 0
br i1 %9, label %10, label %12
10: ; preds = %8
%11 = tail call i32 @err_quit(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %1)
br label %12
12: ; preds = %8, %10, %6
ret void
}