#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 {
  char *sp_namp;
  char *sp_pwdp;
  int /*<<< orphan*/ sp_expire;
  int /*<<< orphan*/ sp_inact;
  int /*<<< orphan*/ sp_warn;
  int /*<<< orphan*/ sp_max;
  int /*<<< orphan*/ sp_min;
  int /*<<< orphan*/ sp_lstchg;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_shadow_info(struct spwd *shadow) {
  if (shadow != NULL) {
    printf("--------------------------------------\n");
    printf("User login: %s\n", shadow->sp_namp);
    printf("Encrypted password: %s\n", shadow->sp_pwdp);
    printf("Time of last password change %ld\n", shadow->sp_lstchg);
    printf("Minimum number of days between password changes %ld\n",
           shadow->sp_min);
    printf("Maximum number of days before password change required %ld\n",
           shadow->sp_max);
    printf(
        "Number of days before user is warned about password expiration %ld\n",
        shadow->sp_warn);
    printf("Number of days after password expiration until account is locked "
           "%ld\n",
           shadow->sp_inact);
    printf("Date when account expires %ld\n", shadow->sp_expire);
    printf("--------------------------------------\n");
  }
}


x86 assembly (clang, -O0):
<print_shadow_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     11ec <print_shadow_info+0xdc>
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xedf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    0x24(%rax),%esi
lea    0xee2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    0x20(%rax),%esi
lea    0xeef(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    0x1c(%rax),%esi
lea    0xf0f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%esi
lea    0xf36(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%esi
lea    0xf65(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%esi
lea    0xf96(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe1b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_shadow_info>:
test   %rdi,%rdi
je     11d7 <print_shadow_info+0xb7>
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0x102d(%rip),%r14
mov    %r14,%rdi
call   1030 <puts@plt>
mov    (%rbx),%rsi
lea    0xeb7(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rbx),%rsi
lea    0xeb5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x24(%rbx),%esi
lea    0xebc(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x20(%rbx),%esi
lea    0xecd(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x1c(%rbx),%esi
lea    0xef1(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x18(%rbx),%esi
lea    0xf1c(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x14(%rbx),%esi
lea    0xf4f(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%rbx),%esi
lea    0xf84(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <puts@plt>
ret

LLVM IR (-O0):
%struct.spwd = type { i8*, i8*, i32, i32, i32, i32, i32, i32 }
@.str = [40 x i8] c"--------------------------------------\0A\00"
@.str.1 = [16 x i8] c"User login: %s\0A\00"
@.str.2 = [24 x i8] c"Encrypted password: %s\0A\00"
@.str.3 = [34 x i8] c"Time of last password change %ld\0A\00"
@.str.4 = [53 x i8] c"Minimum number of days between password changes %ld\0A\00"
@.str.5 = [60 x i8] c"Maximum number of days before password change required %ld\0A\00"
@.str.6 = [68 x i8] c"Number of days before user is warned about password expiration %ld\0A\00"
@.str.7 = [70 x i8] c"Number of days after password expiration until account is locked %ld\0A\00"
@.str.8 = [31 x i8] c"Date when account expires %ld\0A\00"
define void @print_shadow_info(%struct.spwd* %0) {
%2 = alloca %struct.spwd*
store %struct.spwd* %0, %struct.spwd** %2
%3 = load %struct.spwd*, %struct.spwd** %2
%4 = icmp ne %struct.spwd* %3, null
br i1 %4, label %5, label %40
5: ; preds = %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%7 = load %struct.spwd*, %struct.spwd** %2
%8 = getelementptr inbounds %struct.spwd, %struct.spwd* %7, i32 0, i32 0
%9 = load i8*, i8** %8
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = load %struct.spwd*, %struct.spwd** %2
%12 = getelementptr inbounds %struct.spwd, %struct.spwd* %11, i32 0, i32 1
%13 = load i8*, i8** %12
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* %13)
%15 = load %struct.spwd*, %struct.spwd** %2
%16 = getelementptr inbounds %struct.spwd, %struct.spwd* %15, i32 0, i32 7
%17 = load i32, i32* %16
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0), i32 %17)
%19 = load %struct.spwd*, %struct.spwd** %2
%20 = getelementptr inbounds %struct.spwd, %struct.spwd* %19, i32 0, i32 6
%21 = load i32, i32* %20
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.4, i64 0, i64 0), i32 %21)
%23 = load %struct.spwd*, %struct.spwd** %2
%24 = getelementptr inbounds %struct.spwd, %struct.spwd* %23, i32 0, i32 5
%25 = load i32, i32* %24
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.5, i64 0, i64 0), i32 %25)
%27 = load %struct.spwd*, %struct.spwd** %2
%28 = getelementptr inbounds %struct.spwd, %struct.spwd* %27, i32 0, i32 4
%29 = load i32, i32* %28
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.6, i64 0, i64 0), i32 %29)
%31 = load %struct.spwd*, %struct.spwd** %2
%32 = getelementptr inbounds %struct.spwd, %struct.spwd* %31, i32 0, i32 3
%33 = load i32, i32* %32
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.7, i64 0, i64 0), i32 %33)
%35 = load %struct.spwd*, %struct.spwd** %2
%36 = getelementptr inbounds %struct.spwd, %struct.spwd* %35, i32 0, i32 2
%37 = load i32, i32* %36
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.8, i64 0, i64 0), i32 %37)
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
br label %40
40: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
%struct.spwd = type { i8*, i8*, i32, i32, i32, i32, i32, i32 }
@.str.1 = [16 x i8] c"User login: %s\0A\00"
@.str.2 = [24 x i8] c"Encrypted password: %s\0A\00"
@.str.3 = [34 x i8] c"Time of last password change %ld\0A\00"
@.str.4 = [53 x i8] c"Minimum number of days between password changes %ld\0A\00"
@.str.5 = [60 x i8] c"Maximum number of days before password change required %ld\0A\00"
@.str.6 = [68 x i8] c"Number of days before user is warned about password expiration %ld\0A\00"
@.str.7 = [70 x i8] c"Number of days after password expiration until account is locked %ld\0A\00"
@.str.8 = [31 x i8] c"Date when account expires %ld\0A\00"
@str.9 = [39 x i8] c"--------------------------------------\00"
define void @print_shadow_info(%struct.spwd* %0) {
%2 = icmp eq %struct.spwd* %0, null
br i1 %2, label %30, label %3
3: ; preds = %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.9, i64 0, i64 0))
%5 = getelementptr inbounds %struct.spwd, %struct.spwd* %0, i64 0, i32 0
%6 = load i8*, i8** %5
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%8 = getelementptr inbounds %struct.spwd, %struct.spwd* %0, i64 0, i32 1
%9 = load i8*, i8** %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* %9)
%11 = getelementptr inbounds %struct.spwd, %struct.spwd* %0, i64 0, i32 7
%12 = load i32, i32* %11
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0), i32 %12)
%14 = getelementptr inbounds %struct.spwd, %struct.spwd* %0, i64 0, i32 6
%15 = load i32, i32* %14
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.4, i64 0, i64 0), i32 %15)
%17 = getelementptr inbounds %struct.spwd, %struct.spwd* %0, i64 0, i32 5
%18 = load i32, i32* %17
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @.str.5, i64 0, i64 0), i32 %18)
%20 = getelementptr inbounds %struct.spwd, %struct.spwd* %0, i64 0, i32 4
%21 = load i32, i32* %20
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([68 x i8], [68 x i8]* @.str.6, i64 0, i64 0), i32 %21)
%23 = getelementptr inbounds %struct.spwd, %struct.spwd* %0, i64 0, i32 3
%24 = load i32, i32* %23
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([70 x i8], [70 x i8]* @.str.7, i64 0, i64 0), i32 %24)
%26 = getelementptr inbounds %struct.spwd, %struct.spwd* %0, i64 0, i32 2
%27 = load i32, i32* %26
%28 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.8, i64 0, i64 0), i32 %27)
%29 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.9, i64 0, i64 0))
br label %30
30: ; preds = %3, %1
ret void
}