void smsg(s, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15,
          a16) char *s;
int a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16;
{
  char sbuf[80];
  sprintf(sbuf, s, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14,
          a15, a16);
  msg(sbuf);
}


x86 assembly (clang, -O0):
<smsg>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xf8,%rsp
mov    0x60(%rbp),%eax
mov    0x58(%rbp),%eax
mov    0x50(%rbp),%eax
mov    0x48(%rbp),%eax
mov    0x40(%rbp),%eax
mov    0x38(%rbp),%eax
mov    0x30(%rbp),%eax
mov    0x28(%rbp),%eax
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %rdi,-0x30(%rbp)
mov    %esi,-0x34(%rbp)
mov    %edx,-0x38(%rbp)
mov    %ecx,-0x3c(%rbp)
mov    %r8d,-0x40(%rbp)
mov    %r9d,-0x44(%rbp)
lea    -0xa0(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x34(%rbp),%edx
mov    -0x38(%rbp),%ecx
mov    -0x3c(%rbp),%r8d
mov    -0x40(%rbp),%r9d
mov    -0x44(%rbp),%eax
mov    %eax,-0xb4(%rbp)
mov    0x10(%rbp),%eax
mov    %eax,-0xb0(%rbp)
mov    0x18(%rbp),%eax
mov    %eax,-0xac(%rbp)
mov    0x20(%rbp),%eax
mov    %eax,-0xa8(%rbp)
mov    0x28(%rbp),%r13d
mov    0x30(%rbp),%r12d
mov    0x38(%rbp),%r15d
mov    0x40(%rbp),%r14d
mov    0x48(%rbp),%ebx
mov    0x50(%rbp),%r11d
mov    0x58(%rbp),%r10d
mov    0x60(%rbp),%eax
mov    %eax,-0xa4(%rbp)
mov    -0xb4(%rbp),%eax
mov    %eax,(%rsp)
mov    -0xb0(%rbp),%eax
mov    %eax,0x8(%rsp)
mov    -0xac(%rbp),%eax
mov    %eax,0x10(%rsp)
mov    -0xa8(%rbp),%eax
mov    %eax,0x18(%rsp)
mov    -0xa4(%rbp),%eax
mov    %r13d,0x20(%rsp)
mov    %r12d,0x28(%rsp)
mov    %r15d,0x30(%rsp)
mov    %r14d,0x38(%rsp)
mov    %ebx,0x40(%rsp)
mov    %r11d,0x48(%rsp)
mov    %r10d,0x50(%rsp)
mov    %eax,0x58(%rsp)
mov    $0x0,%al
call   1030 <sprintf@plt>
lea    -0xa0(%rbp),%rdi
mov    $0x0,%al
call   1040 <msg@plt>
add    $0xf8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<smsg>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %r9d,%r10d
mov    %r8d,%r9d
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,%edx
mov    %rdi,%rsi
mov    0xb8(%rsp),%ebp
mov    0xc0(%rsp),%r11d
mov    0xc8(%rsp),%r14d
mov    0xd0(%rsp),%r15d
mov    0xd8(%rsp),%r12d
mov    0xe0(%rsp),%r13d
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %eax,%eax
push   %r13
push   %r12
push   %r15
push   %r14
push   %r11
push   %rbp
mov    0xe0(%rsp),%ebp
push   %rbp
mov    0xe0(%rsp),%ebp
push   %rbp
mov    0xe0(%rsp),%ebp
push   %rbp
mov    0xe0(%rsp),%ebp
push   %rbp
mov    0xe0(%rsp),%ebp
push   %rbp
push   %r10
call   1030 <sprintf@plt>
add    $0x60,%rsp
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <msg@plt>
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @smsg(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 %9, i32 %10, i32 %11, i32 %12, i32 %13, i32 %14, i32 %15, i32 %16) {
%18 = alloca i8*
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
%26 = alloca i32
%27 = alloca i32
%28 = alloca i32
%29 = alloca i32
%30 = alloca i32
%31 = alloca i32
%32 = alloca i32
%33 = alloca i32
%34 = alloca i32
%35 = alloca [80 x i8]
store i8* %0, i8** %18
store i32 %1, i32* %19
store i32 %2, i32* %20
store i32 %3, i32* %21
store i32 %4, i32* %22
store i32 %5, i32* %23
store i32 %6, i32* %24
store i32 %7, i32* %25
store i32 %8, i32* %26
store i32 %9, i32* %27
store i32 %10, i32* %28
store i32 %11, i32* %29
store i32 %12, i32* %30
store i32 %13, i32* %31
store i32 %14, i32* %32
store i32 %15, i32* %33
store i32 %16, i32* %34
%36 = getelementptr inbounds [80 x i8], [80 x i8]* %35, i64 0, i64 0
%37 = load i8*, i8** %18
%38 = load i32, i32* %19
%39 = load i32, i32* %20
%40 = load i32, i32* %21
%41 = load i32, i32* %22
%42 = load i32, i32* %23
%43 = load i32, i32* %24
%44 = load i32, i32* %25
%45 = load i32, i32* %26
%46 = load i32, i32* %27
%47 = load i32, i32* %28
%48 = load i32, i32* %29
%49 = load i32, i32* %30
%50 = load i32, i32* %31
%51 = load i32, i32* %32
%52 = load i32, i32* %33
%53 = load i32, i32* %34
%54 = call i32 (i8*, i8*, ...) @sprintf(i8* %36, i8* %37, i32 %38, i32 %39, i32 %40, i32 %41, i32 %42, i32 %43, i32 %44, i32 %45, i32 %46, i32 %47, i32 %48, i32 %49, i32 %50, i32 %51, i32 %52, i32 %53)
%55 = getelementptr inbounds [80 x i8], [80 x i8]* %35, i64 0, i64 0
%56 = call i32 (i8*, ...) bitcast (i32 (...)* @msg to i32 (i8*, ...)*)(i8* %55)
ret void
}

LLVM IR (-O2):
define void @smsg(i8* nocapture %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 %9, i32 %10, i32 %11, i32 %12, i32 %13, i32 %14, i32 %15, i32 %16) {
%18 = alloca [80 x i8]
%19 = getelementptr inbounds [80 x i8], [80 x i8]* %18, i64 0, i64 0
%20 = call i32 (i8*, i8*, ...) @sprintf(i8* %19, i8* dereferenceable(1) %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 %9, i32 %10, i32 %11, i32 %12, i32 %13, i32 %14, i32 %15, i32 %16)
%21 = call i32 (i8*, ...) bitcast (i32 (...)* @msg to i32 (i8*, ...)*)(i8* %19)
ret void
}