char *auth(user, pass)
char *user;
char *pass;
{
  static char a[128];
  char up[128];
  char *p;
  strcpy(a, "BASIC ");
  p = a + 6;
  sprintf(up, "%s:%s", user, pass);
  encode64(&p, up);
  return (a);
}


x86 assembly (clang, -O0):
<auth>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0x2f06(%rip),%rdi
lea    0xeaf(%rip),%rsi
call   1030 <strcpy@plt>
lea    0x2ef3(%rip),%rax
add    $0x6,%rax
mov    %rax,-0x98(%rbp)
lea    -0x90(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xe89(%rip),%rsi
mov    $0x0,%al
call   1050 <sprintf@plt>
lea    -0x90(%rbp),%rsi
lea    -0x98(%rbp),%rdi
mov    $0x0,%al
call   1040 <encode64@plt>
lea    0x2eaf(%rip),%rax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<auth>:
push   %r14
push   %rbx
sub    $0x98,%rsp
mov    %rsi,%rcx
mov    %rdi,%rdx
movl   $0x49534142,0x2f06(%rip)
41 53 49
movl   $0x204349,0x2eff(%rip)
lea    0x2ef5(%rip),%r14
lea    0x2ef4(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0xea9(%rip),%rsi
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <sprintf@plt>
lea    0x8(%rsp),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <encode64@plt>
mov    %r14,%rax
add    $0x98,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@auth.a = internal global [128 x i8] zeroinitializer
@.str = [7 x i8] c"BASIC \00"
@.str.1 = [6 x i8] c"%s:%s\00"
define i8* @auth(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [128 x i8]
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = call i8* @strcpy(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @auth.a, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
store i8* getelementptr inbounds ([128 x i8], [128 x i8]* @auth.a, i64 0, i64 6), i8** %6
%8 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%9 = load i8*, i8** %3
%10 = load i8*, i8** %4
%11 = call i32 (i8*, i8*, ...) @sprintf(i8* %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %9, i8* %10)
%12 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%13 = call i32 (i8**, i8*, ...) bitcast (i32 (...)* @encode64 to i32 (i8**, i8*, ...)*)(i8** %6, i8* %12)
ret i8* getelementptr inbounds ([128 x i8], [128 x i8]* @auth.a, i64 0, i64 0)
}

LLVM IR (-O2):
@auth.a = internal global [128 x i8] zeroinitializer
@.str = [7 x i8] c"BASIC \00"
@.str.1 = [6 x i8] c"%s:%s\00"
define i8* @auth(i8* %0, i8* %1) {
%3 = alloca [128 x i8]
%4 = alloca i8*
%5 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%6 = bitcast i8** %4 to i8*
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 16 dereferenceable(7) getelementptr inbounds ([128 x i8], [128 x i8]* @auth.a, i64 0, i64 0), i8* align 1 dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64 7, i1 false)
store i8* getelementptr inbounds ([128 x i8], [128 x i8]* @auth.a, i64 0, i64 6), i8** %4
%7 = call i32 (i8*, i8*, ...) @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* %1)
%8 = call i32 (i8**, i8*, ...) bitcast (i32 (...)* @encode64 to i32 (i8**, i8*, ...)*)(i8** %4, i8* %5)
ret i8* getelementptr inbounds ([128 x i8], [128 x i8]* @auth.a, i64 0, i64 0)
}