#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 passwd {
  struct passwd *pw_shell;
  struct passwd *pw_dir;
  struct passwd *pw_gecos;
  struct passwd *pw_passwd;
  struct passwd *pw_name;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct passwd *);
void passwd_free(void *ent) {
  struct passwd *pw = ent;
  free(pw->pw_name);
  free(pw->pw_passwd);
  free(pw->pw_gecos);
  free(pw->pw_dir);
  free(pw->pw_shell);
  free(pw);
}


x86 assembly (clang, -O0):
<passwd_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<passwd_free>:
push   %rbx
mov    %rdi,%rbx
mov    0x20(%rdi),%rdi
call   1030 <free@plt>
mov    0x18(%rbx),%rdi
call   1030 <free@plt>
mov    0x10(%rbx),%rdi
call   1030 <free@plt>
mov    0x8(%rbx),%rdi
call   1030 <free@plt>
mov    (%rbx),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.passwd = type { %struct.passwd*, %struct.passwd*, %struct.passwd*, %struct.passwd*, %struct.passwd* }
define void @passwd_free(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.passwd*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct.passwd*
store %struct.passwd* %5, %struct.passwd** %3
%6 = load %struct.passwd*, %struct.passwd** %3
%7 = getelementptr inbounds %struct.passwd, %struct.passwd* %6, i32 0, i32 4
%8 = load %struct.passwd*, %struct.passwd** %7
%9 = call i32 @free(%struct.passwd* %8)
%10 = load %struct.passwd*, %struct.passwd** %3
%11 = getelementptr inbounds %struct.passwd, %struct.passwd* %10, i32 0, i32 3
%12 = load %struct.passwd*, %struct.passwd** %11
%13 = call i32 @free(%struct.passwd* %12)
%14 = load %struct.passwd*, %struct.passwd** %3
%15 = getelementptr inbounds %struct.passwd, %struct.passwd* %14, i32 0, i32 2
%16 = load %struct.passwd*, %struct.passwd** %15
%17 = call i32 @free(%struct.passwd* %16)
%18 = load %struct.passwd*, %struct.passwd** %3
%19 = getelementptr inbounds %struct.passwd, %struct.passwd* %18, i32 0, i32 1
%20 = load %struct.passwd*, %struct.passwd** %19
%21 = call i32 @free(%struct.passwd* %20)
%22 = load %struct.passwd*, %struct.passwd** %3
%23 = getelementptr inbounds %struct.passwd, %struct.passwd* %22, i32 0, i32 0
%24 = load %struct.passwd*, %struct.passwd** %23
%25 = call i32 @free(%struct.passwd* %24)
%26 = load %struct.passwd*, %struct.passwd** %3
%27 = call i32 @free(%struct.passwd* %26)
ret void
}

LLVM IR (-O2):
%struct.passwd = type { %struct.passwd*, %struct.passwd*, %struct.passwd*, %struct.passwd*, %struct.passwd* }
define void @passwd_free(i8* nocapture %0) {
%2 = bitcast i8* %0 to %struct.passwd*
%3 = getelementptr inbounds i8, i8* %0, i64 32
%4 = bitcast i8* %3 to %struct.passwd**
%5 = load %struct.passwd*, %struct.passwd** %4
%6 = tail call i32 @free(%struct.passwd* %5)
%7 = getelementptr inbounds i8, i8* %0, i64 24
%8 = bitcast i8* %7 to %struct.passwd**
%9 = load %struct.passwd*, %struct.passwd** %8
%10 = tail call i32 @free(%struct.passwd* %9)
%11 = getelementptr inbounds i8, i8* %0, i64 16
%12 = bitcast i8* %11 to %struct.passwd**
%13 = load %struct.passwd*, %struct.passwd** %12
%14 = tail call i32 @free(%struct.passwd* %13)
%15 = getelementptr inbounds i8, i8* %0, i64 8
%16 = bitcast i8* %15 to %struct.passwd**
%17 = load %struct.passwd*, %struct.passwd** %16
%18 = tail call i32 @free(%struct.passwd* %17)
%19 = bitcast i8* %0 to %struct.passwd**
%20 = load %struct.passwd*, %struct.passwd** %19
%21 = tail call i32 @free(%struct.passwd* %20)
%22 = tail call i32 @free(%struct.passwd* %2)
ret void
}