account(argc, argv) int argc;
char **argv;
{
  char acct[50], *getpass(), *ap;
  if (argc > 1) {
    ++argv;
    --argc;
    (void)strncpy(acct, *argv, 49);
    acct[49] = '\0';
    while (argc > 1) {
      --argc;
      ++argv;
      (void)strncat(acct, *argv, 49 - strlen(acct));
    }
    ap = acct;
  } else {
    ap = getpass("Account:");
  }
  (void)command("ACCT %s", ap);
}


x86 assembly (clang, -O0):
<account>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    11f9 <account+0xa9>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
lea    -0x50(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    $0x31,%edx
call   1030 <strncpy@plt>
movb   $0x0,-0x1f(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    11ec <account+0x9c>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
lea    -0x50(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x60(%rbp)
lea    -0x50(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x68(%rbp),%rdi
mov    -0x60(%rbp),%rsi
mov    $0x31,%edx
sub    %rax,%rdx
call   1060 <strncat@plt>
jmp    1197 <account+0x47>
lea    -0x50(%rbp),%rax
mov    %rax,-0x58(%rbp)
jmp    120b <account+0xbb>
lea    0xe00(%rip),%rdi
mov    $0x0,%al
call   1070 <getpass@plt>
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rsi
lea    0xdf3(%rip),%rdi
mov    $0x0,%al
call   1050 <command@plt>
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<account>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x38,%rsp
cmp    $0x2,%edi
jl     11bc <account+0x6c>
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsp,%r14
mov    0x8(%rsi),%rsi
mov    $0x31,%edx
mov    %r14,%rdi
call   1030 <strncpy@plt>
movb   $0x0,0x31(%rsp)
cmp    $0x2,%ebp
je     11cd <account+0x7d>
add    $0x10,%rbx
add    $0x1,%ebp
mov    %rsp,%r14
nopl   0x0(%rax)
mov    (%rbx),%r15
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    $0x31,%edx
sub    %rax,%rdx
mov    %r14,%rdi
mov    %r15,%rsi
call   1060 <strncat@plt>
add    $0x8,%rbx
add    $0xffffffff,%ebp
cmp    $0x3,%ebp
ja     1190 <account+0x40>
jmp    11cd <account+0x7d>
lea    0xe3d(%rip),%rdi
xor    %eax,%eax
call   1070 <getpass@plt>
mov    %rax,%r14
lea    0xe35(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <command@plt>
add    $0x38,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"Account:\00"
@.str.1 = [8 x i8] c"ACCT %s\00"
define i32 @account(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [50 x i8]
%7 = alloca i8*
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = icmp sgt i32 %8, 1
br i1 %9, label %10, label %37
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i32 1
store i8** %12, i8*** %5
%13 = load i32, i32* %4
%14 = add nsw i32 %13, -1
store i32 %14, i32* %4
%15 = getelementptr inbounds [50 x i8], [50 x i8]* %6, i64 0, i64 0
%16 = load i8**, i8*** %5
%17 = load i8*, i8** %16
%18 = call i8* @strncpy(i8* %15, i8* %17, i64 49)
%19 = getelementptr inbounds [50 x i8], [50 x i8]* %6, i64 0, i64 49
store i8 0, i8* %19
br label %20
20: ; preds = %23, %10
%21 = load i32, i32* %4
%22 = icmp sgt i32 %21, 1
br i1 %22, label %23, label %35
23: ; preds = %20
%24 = load i32, i32* %4
%25 = add nsw i32 %24, -1
store i32 %25, i32* %4
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i32 1
store i8** %27, i8*** %5
%28 = getelementptr inbounds [50 x i8], [50 x i8]* %6, i64 0, i64 0
%29 = load i8**, i8*** %5
%30 = load i8*, i8** %29
%31 = getelementptr inbounds [50 x i8], [50 x i8]* %6, i64 0, i64 0
%32 = call i64 @strlen(i8* %31)
%33 = sub i64 49, %32
%34 = call i8* @strncat(i8* %28, i8* %30, i64 %33)
br label %20
35: ; preds = %20
%36 = getelementptr inbounds [50 x i8], [50 x i8]* %6, i64 0, i64 0
store i8* %36, i8** %7
br label %39
37: ; preds = %2
%38 = call i8* (i8*, ...) bitcast (i8* (...)* @getpass to i8* (i8*, ...)*)(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
store i8* %38, i8** %7
br label %39
39: ; preds = %37, %35
%40 = load i8*, i8** %7
%41 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @command to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %40)
%42 = load i32, i32* %3
ret i32 %42
}

LLVM IR (-O2):
@.str = [9 x i8] c"Account:\00"
@.str.1 = [8 x i8] c"ACCT %s\00"
define i32 @account(i32 %0, i8** nocapture %1) {
%3 = alloca [50 x i8]
%4 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%5 = icmp sgt i32 %0, 1
br i1 %5, label %6, label %22
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = call i8* @strncpy(i8* %4, i8* dereferenceable(1) %8, i64 49)
%10 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 49
store i8 0, i8* %10
%11 = icmp eq i32 %0, 2
br i1 %11, label %24, label %12
12: ; preds = %6, %12
%13 = phi i8** [ %16, %12 ], [ %7, %6 ]
%14 = phi i32 [ %15, %12 ], [ %0, %6 ]
%15 = add nsw i32 %14, -1
%16 = getelementptr inbounds i8*, i8** %13, i64 1
%17 = load i8*, i8** %16
%18 = call i64 @strlen(i8* %4)
%19 = sub i64 49, %18
%20 = call i8* @strncat(i8* %4, i8* %17, i64 %19)
%21 = icmp ugt i32 %14, 3
br i1 %21, label %12, label %24
22: ; preds = %2
%23 = tail call i8* (i8*, ...) bitcast (i8* (...)* @getpass to i8* (i8*, ...)*)(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %24
24: ; preds = %12, %6, %22
%25 = phi i8* [ %23, %22 ], [ %4, %6 ], [ %4, %12 ]
%26 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @command to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %25)
ret i32 undef
}