do1glist(g, name) long g;
char *name;
{
  int nu;
  long last;
  char *info;
  groupsudirr(g, &nu);
  last = grouplast(g);
  info = groupinfo(g);
  printf(nu ? "%5d " : "      ", nu);
  printf(last ? "%5ld " : "      ", last);
  if (!name)
    name = groupname(g);
  if (info)
    printf("%-23s %s\n", name, info);
  else
    printf("%s\n", name);
}


x86 assembly (clang, -O0):
<do1glist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
mov    $0x0,%al
call   1070 <groupsudirr@plt>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1050 <grouplast@plt>
cltq
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1060 <groupinfo@plt>
cltq
mov    %rax,-0x30(%rbp)
mov    -0x1c(%rbp),%ecx
lea    0xe6a(%rip),%rdi
lea    0xe5e(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdi
mov    -0x1c(%rbp),%esi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x28(%rbp),%rcx
lea    0xe47(%rip),%rdi
lea    0xe47(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rdi
mov    -0x28(%rbp),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
cmpq   $0x0,-0x18(%rbp)
jne    11f4 <do1glist+0xa4>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <groupname@plt>
cltq
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x30(%rbp)
je     121a <do1glist+0xca>
mov    -0x18(%rbp),%rsi
mov    -0x30(%rbp),%rdx
lea    0xe04(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    122c <do1glist+0xdc>
mov    -0x18(%rbp),%rsi
lea    0xdf3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do1glist>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1080 <groupsudirr@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <grouplast@plt>
movslq %eax,%rbp
mov    %rbx,%rdi
xor    %eax,%eax
call   1070 <groupinfo@plt>
mov    %eax,%r15d
mov    0xc(%rsp),%esi
test   %esi,%esi
lea    0xe60(%rip),%r12
lea    0xe54(%rip),%rdi
cmove  %r12,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
test   %ebp,%ebp
lea    0xe4c(%rip),%rdi
cmove  %r12,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
test   %r14,%r14
je     11ee <do1glist+0x8e>
test   %r15d,%r15d
je     1200 <do1glist+0xa0>
movslq %r15d,%rdx
lea    0xe30(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    1208 <do1glist+0xa8>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <groupname@plt>
movslq %eax,%r14
test   %r15d,%r15d
jne    11d8 <do1glist+0x78>
mov    %r14,%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%5d \00"
@.str.1 = [7 x i8] c" \00"
@.str.2 = [6 x i8] c"%5ld \00"
@.str.3 = [10 x i8] c"%-23s %s\0A\00"
@.str.4 = [4 x i8] c"%s\0A\00"
define i32 @do1glist(i64 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i64
%8 = alloca i8*
store i64 %0, i64* %4
store i8* %1, i8** %5
%9 = load i64, i64* %4
%10 = call i32 (i64, i32*, ...) bitcast (i32 (...)* @groupsudirr to i32 (i64, i32*, ...)*)(i64 %9, i32* %6)
%11 = load i64, i64* %4
%12 = call i32 (i64, ...) bitcast (i32 (...)* @grouplast to i32 (i64, ...)*)(i64 %11)
%13 = sext i32 %12 to i64
store i64 %13, i64* %7
%14 = load i64, i64* %4
%15 = call i32 (i64, ...) bitcast (i32 (...)* @groupinfo to i32 (i64, ...)*)(i64 %14)
%16 = sext i32 %15 to i64
%17 = inttoptr i64 %16 to i8*
store i8* %17, i8** %8
%18 = load i32, i32* %6
%19 = icmp ne i32 %18, 0
%20 = zext i1 %19 to i64
%21 = select i1 %19, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0)
%22 = load i32, i32* %6
%23 = call i32 (i8*, ...) @printf(i8* %21, i32 %22)
%24 = load i64, i64* %7
%25 = icmp ne i64 %24, 0
%26 = zext i1 %25 to i64
%27 = select i1 %25, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0)
%28 = load i64, i64* %7
%29 = call i32 (i8*, ...) @printf(i8* %27, i64 %28)
%30 = load i8*, i8** %5
%31 = icmp ne i8* %30, null
br i1 %31, label %37, label %32
32: ; preds = %2
%33 = load i64, i64* %4
%34 = call i32 (i64, ...) bitcast (i32 (...)* @groupname to i32 (i64, ...)*)(i64 %33)
%35 = sext i32 %34 to i64
%36 = inttoptr i64 %35 to i8*
store i8* %36, i8** %5
br label %37
37: ; preds = %32, %2
%38 = load i8*, i8** %8
%39 = icmp ne i8* %38, null
br i1 %39, label %40, label %44
40: ; preds = %37
%41 = load i8*, i8** %5
%42 = load i8*, i8** %8
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* %41, i8* %42)
br label %47
44: ; preds = %37
%45 = load i8*, i8** %5
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* %45)
br label %47
47: ; preds = %44, %40
%48 = load i32, i32* %3
ret i32 %48
}

LLVM IR (-O2):
@.str = [5 x i8] c"%5d \00"
@.str.1 = [7 x i8] c" \00"
@.str.2 = [6 x i8] c"%5ld \00"
@.str.3 = [10 x i8] c"%-23s %s\0A\00"
define i32 @do1glist(i64 %0, i8* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 (i64, i32*, ...) bitcast (i32 (...)* @groupsudirr to i32 (i64, i32*, ...)*)(i64 %0, i32* %3)
%6 = call i32 (i64, ...) bitcast (i32 (...)* @grouplast to i32 (i64, ...)*)(i64 %0)
%7 = sext i32 %6 to i64
%8 = call i32 (i64, ...) bitcast (i32 (...)* @groupinfo to i32 (i64, ...)*)(i64 %0)
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i8*
%11 = load i32, i32* %3
%12 = icmp eq i32 %11, 0
%13 = select i1 %12, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %13, i32 %11)
%15 = icmp eq i32 %6, 0
%16 = select i1 %15, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0)
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %16, i64 %7)
%18 = icmp eq i8* %1, null
br i1 %18, label %19, label %23
19: ; preds = %2
%20 = call i32 (i64, ...) bitcast (i32 (...)* @groupname to i32 (i64, ...)*)(i64 %0)
%21 = sext i32 %20 to i64
%22 = inttoptr i64 %21 to i8*
br label %23
23: ; preds = %19, %2
%24 = phi i8* [ %1, %2 ], [ %22, %19 ]
%25 = icmp eq i32 %8, 0
br i1 %25, label %28, label %26
26: ; preds = %23
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* %24, i8* %10)
br label %30
28: ; preds = %23
%29 = call i32 @puts(i8* dereferenceable(1) %24)
br label %30
30: ; preds = %28, %26
ret i32 undef
}