#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 */
int atoi(char *);
struct passwd *getpwuid(int);
int /*<<< orphan*/ printf(char *, char *, int, int, char *, char *, char *);
int main(int argc, char **argv) {
  struct passwd *p;
  int uid;
  while (--argc > 0) {
    uid = atoi(*++argv);
    p = getpwuid(uid);
    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    $0x30,%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    11c1 <main+0x91>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
call   1030 <getpwuid@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    0xe4d(%rip),%rdi
mov    %rax,(%rsp)
call   1040 <printf@plt>
jmp    1146 <main+0x16>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
cmp    $0x2,%edi
jl     118c <main+0x5c>
mov    %rsi,%rbx
mov    %edi,%ebp
add    $0x1,%ebp
add    $0x8,%rbx
lea    0xeb0(%rip),%r14
mov    (%rbx),%rdi
call   1050 <atoi@plt>
mov    %eax,%edi
call   1030 <getpwuid@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   1040 <printf@plt>
add    $0xffffffff,%ebp
add    $0x8,%rbx
cmp    $0x2,%ebp
ja     1150 <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*
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %8
8: ; preds = %12, %2
%9 = load i32, i32* %4
%10 = add nsw i32 %9, -1
store i32 %10, i32* %4
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %38
12: ; preds = %8
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i32 1
store i8** %14, i8*** %5
%15 = load i8*, i8** %14
%16 = call i32 @atoi(i8* %15)
store i32 %16, i32* %7
%17 = load i32, i32* %7
%18 = call %struct.passwd* @getpwuid(i32 %17)
store %struct.passwd* %18, %struct.passwd** %6
%19 = load %struct.passwd*, %struct.passwd** %6
%20 = getelementptr inbounds %struct.passwd, %struct.passwd* %19, i32 0, i32 0
%21 = load i8*, i8** %20
%22 = load %struct.passwd*, %struct.passwd** %6
%23 = getelementptr inbounds %struct.passwd, %struct.passwd* %22, i32 0, i32 1
%24 = load i32, i32* %23
%25 = load %struct.passwd*, %struct.passwd** %6
%26 = getelementptr inbounds %struct.passwd, %struct.passwd* %25, i32 0, i32 2
%27 = load i32, i32* %26
%28 = load %struct.passwd*, %struct.passwd** %6
%29 = getelementptr inbounds %struct.passwd, %struct.passwd* %28, i32 0, i32 3
%30 = load i8*, i8** %29
%31 = load %struct.passwd*, %struct.passwd** %6
%32 = getelementptr inbounds %struct.passwd, %struct.passwd* %31, i32 0, i32 4
%33 = load i8*, i8** %32
%34 = load %struct.passwd*, %struct.passwd** %6
%35 = getelementptr inbounds %struct.passwd, %struct.passwd* %34, i32 0, i32 5
%36 = load i8*, i8** %35
%37 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %21, i32 %24, i32 %27, i8* %30, i8* %33, i8* %36)
br label %8
38: ; preds = %8
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 %26
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 i32 @atoi(i8* %9)
%11 = tail call %struct.passwd* @getpwuid(i32 %10)
%12 = getelementptr inbounds %struct.passwd, %struct.passwd* %11, i64 0, i32 0
%13 = load i8*, i8** %12
%14 = getelementptr inbounds %struct.passwd, %struct.passwd* %11, i64 0, i32 1
%15 = load i32, i32* %14
%16 = getelementptr inbounds %struct.passwd, %struct.passwd* %11, i64 0, i32 2
%17 = load i32, i32* %16
%18 = getelementptr inbounds %struct.passwd, %struct.passwd* %11, i64 0, i32 3
%19 = load i8*, i8** %18
%20 = getelementptr inbounds %struct.passwd, %struct.passwd* %11, i64 0, i32 4
%21 = load i8*, i8** %20
%22 = getelementptr inbounds %struct.passwd, %struct.passwd* %11, i64 0, i32 5
%23 = load i8*, i8** %22
%24 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %13, i32 %15, i32 %17, i8* %19, i8* %21, i8* %23)
%25 = icmp ugt i32 %5, 2
br i1 %25, label %4, label %26
26: ; preds = %4, %2
ret i32 0
}