#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 spwd {
  int sp_warn;
  int sp_inact;
  int sp_expire;
  unsigned long sp_flag;
  int /*<<< orphan*/ sp_pwdp;
  int /*<<< orphan*/ sp_namp;
};

/* Variables and functions */
int /*<<< orphan*/ free(int /*<<< orphan*/);
int /*<<< orphan*/ memset(struct spwd *, char, int);
void give_spwd_free(struct spwd *pwd) {
  free(pwd->sp_namp);
  free(pwd->sp_pwdp);
  memset(pwd, '\0', sizeof(struct spwd));
  pwd->sp_warn = -1;
  pwd->sp_inact = -1;
  pwd->sp_expire = -1;
  pwd->sp_flag = ~0ul;
}


x86 assembly (clang, -O0):
<give_spwd_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1c(%rax),%edi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%edi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1040 <memset@plt>
mov    -0x8(%rbp),%rax
movl   $0xffffffff,(%rax)
mov    -0x8(%rbp),%rax
movl   $0xffffffff,0x4(%rax)
mov    -0x8(%rbp),%rax
movl   $0xffffffff,0x8(%rax)
mov    -0x8(%rbp),%rax
movq   $0xffffffffffffffff,0x10(%rax)
ff
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<give_spwd_free>:
push   %rbx
mov    %rdi,%rbx
mov    0x1c(%rdi),%edi
call   1030 <free@plt>
mov    0x18(%rbx),%edi
call   1030 <free@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1040 <memset@plt>
movq   $0xffffffffffffffff,(%rbx)
movl   $0xffffffff,0x8(%rbx)
movq   $0xffffffffffffffff,0x10(%rbx)
ff
pop    %rbx
ret

LLVM IR (-O0):
%struct.spwd = type { i32, i32, i32, i64, i32, i32 }
define void @give_spwd_free(%struct.spwd* %0) {
%2 = alloca %struct.spwd*
store %struct.spwd* %0, %struct.spwd** %2
%3 = load %struct.spwd*, %struct.spwd** %2
%4 = getelementptr inbounds %struct.spwd, %struct.spwd* %3, i32 0, i32 5
%5 = load i32, i32* %4
%6 = call i32 @free(i32 %5)
%7 = load %struct.spwd*, %struct.spwd** %2
%8 = getelementptr inbounds %struct.spwd, %struct.spwd* %7, i32 0, i32 4
%9 = load i32, i32* %8
%10 = call i32 @free(i32 %9)
%11 = load %struct.spwd*, %struct.spwd** %2
%12 = call i32 @memset(%struct.spwd* %11, i8 signext 0, i32 32)
%13 = load %struct.spwd*, %struct.spwd** %2
%14 = getelementptr inbounds %struct.spwd, %struct.spwd* %13, i32 0, i32 0
store i32 -1, i32* %14
%15 = load %struct.spwd*, %struct.spwd** %2
%16 = getelementptr inbounds %struct.spwd, %struct.spwd* %15, i32 0, i32 1
store i32 -1, i32* %16
%17 = load %struct.spwd*, %struct.spwd** %2
%18 = getelementptr inbounds %struct.spwd, %struct.spwd* %17, i32 0, i32 2
store i32 -1, i32* %18
%19 = load %struct.spwd*, %struct.spwd** %2
%20 = getelementptr inbounds %struct.spwd, %struct.spwd* %19, i32 0, i32 3
store i64 -1, i64* %20
ret void
}

LLVM IR (-O2):
%struct.spwd = type { i32, i32, i32, i64, i32, i32 }
define void @give_spwd_free(%struct.spwd* %0) {
%2 = getelementptr inbounds %struct.spwd, %struct.spwd* %0, i64 0, i32 5
%3 = load i32, i32* %2
%4 = tail call i32 @free(i32 %3)
%5 = getelementptr inbounds %struct.spwd, %struct.spwd* %0, i64 0, i32 4
%6 = load i32, i32* %5
%7 = tail call i32 @free(i32 %6)
%8 = tail call i32 @memset(%struct.spwd* %0, i8 signext 0, i32 32)
%9 = getelementptr inbounds %struct.spwd, %struct.spwd* %0, i64 0, i32 0
store i32 -1, i32* %9
%10 = getelementptr inbounds %struct.spwd, %struct.spwd* %0, i64 0, i32 1
store i32 -1, i32* %10
%11 = getelementptr inbounds %struct.spwd, %struct.spwd* %0, i64 0, i32 2
store i32 -1, i32* %11
%12 = getelementptr inbounds %struct.spwd, %struct.spwd* %0, i64 0, i32 3
store i64 -1, i64* %12
ret void
}