#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 {
  char *pw_name;
  char *pw_passwd;
  int pw_uid;
  int pw_gid;
  char *pw_gecos;
  char *pw_dir;
  char *pw_shell;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *, char *, int,
                           int, char *, char *, char *);
void print_passwd_struct(FILE *outstream, const struct passwd *pwbuf) {
  fprintf(outstream, "%s:%s:%d:%d:%s:%s:%s\n", pwbuf->pw_name, pwbuf->pw_passwd,
          pwbuf->pw_uid, pwbuf->pw_gid, pwbuf->pw_gecos, pwbuf->pw_dir,
          pwbuf->pw_shell);
}


x86 assembly (clang, -O0):
<print_passwd_struct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rcx
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%r8d
mov    -0x10(%rbp),%rax
mov    0x14(%rax),%r9d
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%r11
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%r10
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rax
lea    0xe9e(%rip),%rsi
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1030 <fprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_passwd_struct>:
sub    $0x18,%rsp
mov    (%rsi),%rdx
mov    0x8(%rsi),%rcx
mov    0x10(%rsi),%r8d
mov    0x14(%rsi),%r9d
movups 0x18(%rsi),%xmm0
mov    0x28(%rsi),%rax
mov    %rax,0x10(%rsp)
movups %xmm0,(%rsp)
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.passwd = type { i8*, i8*, i32, i32, i8*, i8*, i8* }
@.str = [22 x i8] c"%s:%s:%d:%d:%s:%s:%s\0A\00"
define void @print_passwd_struct(i32* %0, %struct.passwd* %1) {
%3 = alloca i32*
%4 = alloca %struct.passwd*
store i32* %0, i32** %3
store %struct.passwd* %1, %struct.passwd** %4
%5 = load i32*, i32** %3
%6 = load %struct.passwd*, %struct.passwd** %4
%7 = getelementptr inbounds %struct.passwd, %struct.passwd* %6, i32 0, i32 0
%8 = load i8*, i8** %7
%9 = load %struct.passwd*, %struct.passwd** %4
%10 = getelementptr inbounds %struct.passwd, %struct.passwd* %9, i32 0, i32 1
%11 = load i8*, i8** %10
%12 = load %struct.passwd*, %struct.passwd** %4
%13 = getelementptr inbounds %struct.passwd, %struct.passwd* %12, i32 0, i32 2
%14 = load i32, i32* %13
%15 = load %struct.passwd*, %struct.passwd** %4
%16 = getelementptr inbounds %struct.passwd, %struct.passwd* %15, i32 0, i32 3
%17 = load i32, i32* %16
%18 = load %struct.passwd*, %struct.passwd** %4
%19 = getelementptr inbounds %struct.passwd, %struct.passwd* %18, i32 0, i32 4
%20 = load i8*, i8** %19
%21 = load %struct.passwd*, %struct.passwd** %4
%22 = getelementptr inbounds %struct.passwd, %struct.passwd* %21, i32 0, i32 5
%23 = load i8*, i8** %22
%24 = load %struct.passwd*, %struct.passwd** %4
%25 = getelementptr inbounds %struct.passwd, %struct.passwd* %24, i32 0, i32 6
%26 = load i8*, i8** %25
%27 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %11, i32 %14, i32 %17, i8* %20, i8* %23, i8* %26)
ret void
}

LLVM IR (-O2):
%struct.passwd = type { i8*, i8*, i32, i32, i8*, i8*, i8* }
@.str = [22 x i8] c"%s:%s:%d:%d:%s:%s:%s\0A\00"
define void @print_passwd_struct(i32* nocapture %0, %struct.passwd* nocapture %1) {
%3 = getelementptr inbounds %struct.passwd, %struct.passwd* %1, i64 0, i32 0
%4 = load i8*, i8** %3
%5 = getelementptr inbounds %struct.passwd, %struct.passwd* %1, i64 0, i32 1
%6 = load i8*, i8** %5
%7 = getelementptr inbounds %struct.passwd, %struct.passwd* %1, i64 0, i32 2
%8 = load i32, i32* %7
%9 = getelementptr inbounds %struct.passwd, %struct.passwd* %1, i64 0, i32 3
%10 = load i32, i32* %9
%11 = getelementptr inbounds %struct.passwd, %struct.passwd* %1, i64 0, i32 4
%12 = load i8*, i8** %11
%13 = getelementptr inbounds %struct.passwd, %struct.passwd* %1, i64 0, i32 5
%14 = load i8*, i8** %13
%15 = getelementptr inbounds %struct.passwd, %struct.passwd* %1, i64 0, i32 6
%16 = load i8*, i8** %15
%17 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %6, i32 %8, i32 %10, i8* %12, i8* %14, i8* %16)
ret void
}