#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;
  char *pw_gecos;
  char *pw_dir;
  char *pw_shell;
  scalar_t__ pw_gid;
  scalar_t__ pw_uid;
};
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 *outfile, const struct passwd *pwbuf) {
  fprintf(outfile, "%s:%s:%d:%d:%s:%s:%s\n", pwbuf->pw_name, pwbuf->pw_passwd,
          (int)pwbuf->pw_uid, (int)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    0x30(%rax),%rax
mov    %eax,%r8d
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rax
mov    %eax,%r9d
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%r11
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%r10
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rax
lea    0xe98(%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    0x30(%rsi),%r8d
mov    0x28(%rsi),%r9d
movups 0x10(%rsi),%xmm0
mov    0x20(%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*, i8*, i8*, i8*, i64, i64 }
@.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 6
%14 = load i64, i64* %13
%15 = trunc i64 %14 to i32
%16 = load %struct.passwd*, %struct.passwd** %4
%17 = getelementptr inbounds %struct.passwd, %struct.passwd* %16, i32 0, i32 5
%18 = load i64, i64* %17
%19 = trunc i64 %18 to i32
%20 = load %struct.passwd*, %struct.passwd** %4
%21 = getelementptr inbounds %struct.passwd, %struct.passwd* %20, i32 0, i32 2
%22 = load i8*, i8** %21
%23 = load %struct.passwd*, %struct.passwd** %4
%24 = getelementptr inbounds %struct.passwd, %struct.passwd* %23, i32 0, i32 3
%25 = load i8*, i8** %24
%26 = load %struct.passwd*, %struct.passwd** %4
%27 = getelementptr inbounds %struct.passwd, %struct.passwd* %26, i32 0, i32 4
%28 = load i8*, i8** %27
%29 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %11, i32 %15, i32 %19, i8* %22, i8* %25, i8* %28)
ret void
}

LLVM IR (-O2):
%struct.passwd = type { i8*, i8*, i8*, i8*, i8*, i64, i64 }
@.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 6
%8 = load i64, i64* %7
%9 = trunc i64 %8 to i32
%10 = getelementptr inbounds %struct.passwd, %struct.passwd* %1, i64 0, i32 5
%11 = load i64, i64* %10
%12 = trunc i64 %11 to i32
%13 = getelementptr inbounds %struct.passwd, %struct.passwd* %1, i64 0, i32 2
%14 = load i8*, i8** %13
%15 = getelementptr inbounds %struct.passwd, %struct.passwd* %1, i64 0, i32 3
%16 = load i8*, i8** %15
%17 = getelementptr inbounds %struct.passwd, %struct.passwd* %1, i64 0, i32 4
%18 = load i8*, i8** %17
%19 = 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 %9, i32 %12, i8* %14, i8* %16, i8* %18)
ret void
}