#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;
  int pw_uid;
  int pw_gid;
  char *pw_gecos;
  char *pw_dir;
  char *pw_shell;
};

/* Variables and functions */
struct passwd *getpwnam(char *);
int /*<<< orphan*/ printf(char *, char *, int, int, char *, char *, char *);
int main(int argc, char **argv) {
  struct passwd *p;
  while (--argc > 0) {
    p = getpwnam(*++argv);
    printf("%s, %d, %d, %s, %s, %s\n", p->pw_name, p->pw_uid, p->pw_gid,
           p->pw_gecos, p->pw_dir, p->pw_shell);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    11a6 <main+0x86>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    0x8(%rax),%rdi
call   1040 <getpwnam@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rsi
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%edx
mov    -0x18(%rbp),%rax
mov    0xc(%rax),%ecx
mov    -0x18(%rbp),%rax
mov    0x10(%rax),%r8
mov    -0x18(%rbp),%rax
mov    0x18(%rax),%r9
mov    -0x18(%rbp),%rax
mov    0x20(%rax),%rax
lea    0xe68(%rip),%rdi
mov    %rax,(%rsp)
call   1030 <printf@plt>
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
cmp    $0x2,%edi
jl     1175 <main+0x55>
mov    %rsi,%rbx
mov    %edi,%ebp
add    $0x1,%ebp
add    $0x8,%rbx
lea    0xec0(%rip),%r14
mov    (%rbx),%rdi
call   1040 <getpwnam@plt>
mov    (%rax),%rsi
mov    0x8(%rax),%edx
mov    0xc(%rax),%ecx
mov    0x10(%rax),%r8
mov    0x18(%rax),%r9
mov    0x20(%rax),%rax
mov    %rax,(%rsp)
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0xffffffff,%ebp
add    $0x8,%rbx
cmp    $0x2,%ebp
ja     1140 <main+0x20>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.passwd = type { i8*, i32, i32, i8*, i8*, i8* }
@.str = [24 x i8] c"%s, %d, %d, %s, %s, %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.passwd*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %7
7: ; preds = %11, %2
%8 = load i32, i32* %4
%9 = add nsw i32 %8, -1
store i32 %9, i32* %4
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %35
11: ; preds = %7
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i32 1
store i8** %13, i8*** %5
%14 = load i8*, i8** %13
%15 = call %struct.passwd* @getpwnam(i8* %14)
store %struct.passwd* %15, %struct.passwd** %6
%16 = load %struct.passwd*, %struct.passwd** %6
%17 = getelementptr inbounds %struct.passwd, %struct.passwd* %16, i32 0, i32 0
%18 = load i8*, i8** %17
%19 = load %struct.passwd*, %struct.passwd** %6
%20 = getelementptr inbounds %struct.passwd, %struct.passwd* %19, i32 0, i32 1
%21 = load i32, i32* %20
%22 = load %struct.passwd*, %struct.passwd** %6
%23 = getelementptr inbounds %struct.passwd, %struct.passwd* %22, i32 0, i32 2
%24 = load i32, i32* %23
%25 = load %struct.passwd*, %struct.passwd** %6
%26 = getelementptr inbounds %struct.passwd, %struct.passwd* %25, i32 0, i32 3
%27 = load i8*, i8** %26
%28 = load %struct.passwd*, %struct.passwd** %6
%29 = getelementptr inbounds %struct.passwd, %struct.passwd* %28, i32 0, i32 4
%30 = load i8*, i8** %29
%31 = load %struct.passwd*, %struct.passwd** %6
%32 = getelementptr inbounds %struct.passwd, %struct.passwd* %31, i32 0, i32 5
%33 = load i8*, i8** %32
%34 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %18, i32 %21, i32 %24, i8* %27, i8* %30, i8* %33)
br label %7
35: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
%struct.passwd = type { i8*, i32, i32, i8*, i8*, i8* }
@.str = [24 x i8] c"%s, %d, %d, %s, %s, %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %25
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %0, %2 ]
%6 = phi i8** [ %8, %4 ], [ %1, %2 ]
%7 = add nsw i32 %5, -1
%8 = getelementptr inbounds i8*, i8** %6, i64 1
%9 = load i8*, i8** %8
%10 = tail call %struct.passwd* @getpwnam(i8* %9)
%11 = getelementptr inbounds %struct.passwd, %struct.passwd* %10, i64 0, i32 0
%12 = load i8*, i8** %11
%13 = getelementptr inbounds %struct.passwd, %struct.passwd* %10, i64 0, i32 1
%14 = load i32, i32* %13
%15 = getelementptr inbounds %struct.passwd, %struct.passwd* %10, i64 0, i32 2
%16 = load i32, i32* %15
%17 = getelementptr inbounds %struct.passwd, %struct.passwd* %10, i64 0, i32 3
%18 = load i8*, i8** %17
%19 = getelementptr inbounds %struct.passwd, %struct.passwd* %10, i64 0, i32 4
%20 = load i8*, i8** %19
%21 = getelementptr inbounds %struct.passwd, %struct.passwd* %10, i64 0, i32 5
%22 = load i8*, i8** %21
%23 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %12, i32 %14, i32 %16, i8* %18, i8* %20, i8* %22)
%24 = icmp ugt i32 %5, 2
br i1 %24, label %4, label %25
25: ; preds = %4, %2
ret i32 0
}