#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*/ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int, ...);
int inet_pton(int, char const *, void *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
void Inet_pton(int family, const char *strptr, void *addrptr) {
  int n;
  if ((n = inet_pton(family, strptr, addrptr)) < 0) {
    fprintf(stderr, "%s:%d: Inet_pton(): %s\n",
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/Ricky-Gong/LegoCar/refs/heads/master/"
            "CarServer/self/zed_spec/wrap.c",
            26, strerror(errno));
    exit(1);
  } else if (n == 0) {
    fprintf(stderr, "%s:%d: Inet_pton(): unvalid string\n",
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/Ricky-Gong/LegoCar/refs/heads/master/"
            "CarServer/self/zed_spec/wrap.c",
            30);
    exit(1);
  }
}


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   1040 <inet_pton@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
jge    11b3 <Inet_pton+0x73>
mov    0x2e6a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    0x2e56(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
mov    -0x20(%rbp),%edi
mov    %rax,%r8
lea    0xe6a(%rip),%rsi
lea    0xe7b(%rip),%rdx
mov    $0x1a,%ecx
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
cmpl   $0x0,-0x1c(%rbp)
jne    11ea <Inet_pton+0xaa>
mov    0x2e1c(%rip),%rax
mov    (%rax),%edi
lea    0xee9(%rip),%rsi
lea    0xe44(%rip),%rdx
mov    $0x1e,%ecx
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
jmp    11ef <Inet_pton+0xaf>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Inet_pton>:
push   %rbx
call   1040 <inet_pton@plt>
test   %eax,%eax
js     114e <Inet_pton+0xe>
je     118e <Inet_pton+0x4e>
pop    %rbx
ret
mov    0x2e8b(%rip),%rax
mov    (%rax),%ebx
mov    0x2e7a(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
lea    0xe94(%rip),%rsi
lea    0xea5(%rip),%rdx
mov    %ebx,%edi
mov    $0x1a,%ecx
mov    %rax,%r8
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    0x2e4b(%rip),%rax
mov    (%rax),%edi
lea    0xf18(%rip),%rsi
lea    0xe73(%rip),%rdx
mov    $0x1e,%ecx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"%s:%d: Inet_pton(): %s\0A\00"
@.str.1 = [158 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Ricky-Gong/LegoCar/refs/heads/master/CarServer/self/zed_spec/wrap.c\00"
@errno = global i32 0
@.str.2 = [36 x i8] c"%s:%d: Inet_pton(): unvalid string\0A\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 %19
13: ; preds = %3
%14 = load i32, i32* @stderr
%15 = load i32, i32* @errno
%16 = call i8* @strerror(i32 %15)
%17 = call i32 (i32, i8*, i8*, i32, ...) @fprintf(i32 %14, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str.1, i64 0, i64 0), i32 26, i8* %16)
%18 = call i32 @exit(i32 1)
unreachable
19: ; preds = %3
%20 = load i32, i32* %7
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %26
22: ; preds = %19
%23 = load i32, i32* @stderr
%24 = call i32 (i32, i8*, i8*, i32, ...) @fprintf(i32 %23, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str.1, i64 0, i64 0), i32 30)
%25 = call i32 @exit(i32 1)
unreachable
26: ; preds = %19
br label %27
27: ; preds = %26
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"%s:%d: Inet_pton(): %s\0A\00"
@.str.1 = [158 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Ricky-Gong/LegoCar/refs/heads/master/CarServer/self/zed_spec/wrap.c\00"
@errno = global i32 0
@.str.2 = [36 x i8] c"%s:%d: Inet_pton(): unvalid string\0A\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 %12
6: ; preds = %3
%7 = load i32, i32* @stderr
%8 = load i32, i32* @errno
%9 = tail call i8* @strerror(i32 %8)
%10 = tail call i32 (i32, i8*, i8*, i32, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str.1, i64 0, i64 0), i32 26, i8* %9)
%11 = tail call i32 @exit(i32 1)
unreachable
12: ; preds = %3
%13 = icmp eq i32 %4, 0
br i1 %13, label %14, label %18
14: ; preds = %12
%15 = load i32, i32* @stderr
%16 = tail call i32 (i32, i8*, i8*, i32, ...) @fprintf(i32 %15, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str.1, i64 0, i64 0), i32 30)
%17 = tail call i32 @exit(i32 1)
unreachable
18: ; preds = %12
ret void
}