#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 */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
typedef int /*<<< orphan*/ u_int32_t;
struct TYPE_2__ {
  int /*<<< orphan*/ s_addr;
};
struct sockaddr_in {
  TYPE_1__ sin_addr;
  int /*<<< orphan*/ sin_family;
};
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ ra;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int __validuser2_sa(int /*<<< orphan*/ *, struct sockaddr *, int, char const *,
                    char const *, char *);
int /*<<< orphan*/ memset(struct sockaddr_in *, char, int);
int __ivaliduser(FILE *hostf, u_int32_t raddr, const char *luser,
                 const char *ruser) {
  struct sockaddr_in ra;
  memset(&ra, '\0', sizeof(ra));
  ra.sin_family = AF_INET;
  ra.sin_addr.s_addr = raddr;
  return __validuser2_sa(hostf, (struct sockaddr *)&ra, sizeof(ra), luser,
                         ruser, "-");
}


x86 assembly (clang, -O0):
<__ivaliduser>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
lea    -0x28(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1040 <memset@plt>
mov    0x2e9a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x28(%rbp),%rsi
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    $0x8,%edx
lea    0xe8b(%rip),%r9
call   1030 <__validuser2_sa@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ivaliduser>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %rcx,%r14
mov    %rdx,%r15
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0x8(%rsp),%r12
mov    %r12,%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1040 <memset@plt>
mov    0x2e96(%rip),%rax
mov    (%rax),%eax
mov    %eax,0xc(%rsp)
mov    %ebp,0x8(%rsp)
lea    0xe9d(%rip),%r9
mov    %rbx,%rdi
mov    %r12,%rsi
mov    $0x8,%edx
mov    %r15,%rcx
mov    %r14,%r8
call   1030 <__validuser2_sa@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.sockaddr_in = type { %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@AF_INET = global i32 0
@.str = [2 x i8] c"-\00"
define i32 @__ivaliduser(i32* %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca %struct.sockaddr_in
store i32* %0, i32** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%10 = call i32 @memset(%struct.sockaddr_in* %9, i8 signext 0, i32 8)
%11 = load i32, i32* @AF_INET
%12 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %9, i32 0, i32 1
store i32 %11, i32* %12
%13 = load i32, i32* %6
%14 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %9, i32 0, i32 0
%15 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %14, i32 0, i32 0
store i32 %13, i32* %15
%16 = load i32*, i32** %5
%17 = bitcast %struct.sockaddr_in* %9 to %struct.sockaddr*
%18 = load i8*, i8** %7
%19 = load i8*, i8** %8
%20 = call i32 @__validuser2_sa(i32* %16, %struct.sockaddr* %17, i32 8, i8* %18, i8* %19, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 %20
}

LLVM IR (-O2):
%struct.sockaddr_in = type { %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@AF_INET = global i32 0
@.str = [2 x i8] c"-\00"
define i32 @__ivaliduser(i32* %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca %struct.sockaddr_in
%6 = bitcast %struct.sockaddr_in* %5 to i8*
%7 = call i32 @memset(%struct.sockaddr_in* %5, i8 signext 0, i32 8)
%8 = load i32, i32* @AF_INET
%9 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %5, i64 0, i32 1
store i32 %8, i32* %9
%10 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %5, i64 0, i32 0, i32 0
store i32 %1, i32* %10
%11 = bitcast %struct.sockaddr_in* %5 to %struct.sockaddr*
%12 = call i32 @__validuser2_sa(i32* %0, %struct.sockaddr* %11, i32 8, i8* %2, i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 %12
}