#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 netent {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int errno;
struct netent *getnetbyaddr(int, int /*<<< orphan*/);
int main(int argc, char const *argv[]) {
  struct netent *entry;
  entry = getnetbyaddr(2851995648, AF_INET);
  assert(entry == NULL);
  entry = getnetbyaddr(2851995648, AF_INET);
  assert(entry == NULL);
  return errno;
}


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)
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
mov    $0xa9fe0000,%edi
call   1040 <getnetbyaddr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    0x2e82(%rip),%rax
mov    (%rax),%esi
mov    $0xa9fe0000,%edi
call   1040 <getnetbyaddr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    0x2e49(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ec0(%rip),%rbx
mov    (%rbx),%esi
mov    $0xa9fe0000,%edi
call   1040 <getnetbyaddr@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1030 <assert@plt>
mov    (%rbx),%esi
mov    $0xa9fe0000,%edi
call   1040 <getnetbyaddr@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1030 <assert@plt>
mov    0x2e75(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.netent = type { i32 }
@AF_INET = global i32 0
@errno = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.netent*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* @AF_INET
%8 = call %struct.netent* @getnetbyaddr(i32 -1442971648, i32 %7)
store %struct.netent* %8, %struct.netent** %6
%9 = load %struct.netent*, %struct.netent** %6
%10 = icmp eq %struct.netent* %9, null
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load i32, i32* @AF_INET
%14 = call %struct.netent* @getnetbyaddr(i32 -1442971648, i32 %13)
store %struct.netent* %14, %struct.netent** %6
%15 = load %struct.netent*, %struct.netent** %6
%16 = icmp eq %struct.netent* %15, null
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
%19 = load i32, i32* @errno
ret i32 %19
}

LLVM IR (-O2):
%struct.netent = type { i32 }
@AF_INET = global i32 0
@errno = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @AF_INET
%4 = tail call %struct.netent* @getnetbyaddr(i32 -1442971648, i32 %3)
%5 = icmp eq %struct.netent* %4, null
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = load i32, i32* @AF_INET
%9 = tail call %struct.netent* @getnetbyaddr(i32 -1442971648, i32 %8)
%10 = icmp eq %struct.netent* %9, null
%11 = zext i1 %10 to i32
%12 = tail call i32 @assert(i32 %11)
%13 = load i32, i32* @errno
ret i32 %13
}