MESSAGE2(msg1, id1, msg2, id2, msg3, pos) char *msg1;
long id1;
char *msg2;
long id2;
char *msg3;
long pos;
{
  char buf[200];
  char *str1;
  char *str2;
  id_to_string(id1, &str1);
  id_to_string(id2, &str2);
  sprintf(buf, "%s%s%s%s%s", msg1, str1, msg2, str2, msg3);
  MESSAGE(buf, pos);
}


x86 assembly (clang, -O0):
<MESSAGE2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0x108(%rbp),%rsi
mov    $0x0,%al
call   1040 <id_to_string@plt>
mov    -0x28(%rbp),%rdi
lea    -0x110(%rbp),%rsi
mov    $0x0,%al
call   1040 <id_to_string@plt>
lea    -0x100(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x108(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x110(%rbp),%r9
mov    -0x30(%rbp),%rax
lea    0xe61(%rip),%rsi
mov    %rax,(%rsp)
mov    $0x0,%al
call   1050 <sprintf@plt>
lea    -0x100(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    $0x0,%al
call   1030 <MESSAGE@plt>
mov    -0x4(%rbp),%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MESSAGE2>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xf0,%rsp
mov    %r9,%r14
mov    %r8,%r15
mov    %rcx,%rbx
mov    %rdx,%r12
mov    %rsi,%rax
mov    %rdi,%r13
lea    0x18(%rsp),%rsi
mov    %rax,%rdi
xor    %eax,%eax
call   1040 <id_to_string@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <id_to_string@plt>
mov    0x18(%rsp),%rcx
mov    0x10(%rsp),%r9
mov    %r15,(%rsp)
lea    0xe7b(%rip),%rsi
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
mov    %r13,%rdx
mov    %r12,%r8
xor    %eax,%eax
call   1050 <sprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <MESSAGE@plt>
add    $0xf0,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [11 x i8] c"%s%s%s%s%s\00"
define i32 @MESSAGE2(i8* %0, i64 %1, i8* %2, i64 %3, i8* %4, i64 %5) {
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i8*
%11 = alloca i64
%12 = alloca i8*
%13 = alloca i64
%14 = alloca [200 x i8]
%15 = alloca i8*
%16 = alloca i8*
store i8* %0, i8** %8
store i64 %1, i64* %9
store i8* %2, i8** %10
store i64 %3, i64* %11
store i8* %4, i8** %12
store i64 %5, i64* %13
%17 = load i64, i64* %9
%18 = call i32 (i64, i8**, ...) bitcast (i32 (...)* @id_to_string to i32 (i64, i8**, ...)*)(i64 %17, i8** %15)
%19 = load i64, i64* %11
%20 = call i32 (i64, i8**, ...) bitcast (i32 (...)* @id_to_string to i32 (i64, i8**, ...)*)(i64 %19, i8** %16)
%21 = getelementptr inbounds [200 x i8], [200 x i8]* %14, i64 0, i64 0
%22 = load i8*, i8** %8
%23 = load i8*, i8** %15
%24 = load i8*, i8** %10
%25 = load i8*, i8** %16
%26 = load i8*, i8** %12
%27 = call i32 (i8*, i8*, ...) @sprintf(i8* %21, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %22, i8* %23, i8* %24, i8* %25, i8* %26)
%28 = getelementptr inbounds [200 x i8], [200 x i8]* %14, i64 0, i64 0
%29 = load i64, i64* %13
%30 = call i32 (i8*, i64, ...) bitcast (i32 (...)* @MESSAGE to i32 (i8*, i64, ...)*)(i8* %28, i64 %29)
%31 = load i32, i32* %7
ret i32 %31
}

LLVM IR (-O2):
@.str = [11 x i8] c"%s%s%s%s%s\00"
define i32 @MESSAGE2(i8* %0, i64 %1, i8* %2, i64 %3, i8* %4, i64 %5) {
%7 = alloca [200 x i8]
%8 = alloca i8*
%9 = alloca i8*
%10 = getelementptr inbounds [200 x i8], [200 x i8]* %7, i64 0, i64 0
%11 = bitcast i8** %8 to i8*
%12 = bitcast i8** %9 to i8*
%13 = call i32 (i64, i8**, ...) bitcast (i32 (...)* @id_to_string to i32 (i64, i8**, ...)*)(i64 %1, i8** %8)
%14 = call i32 (i64, i8**, ...) bitcast (i32 (...)* @id_to_string to i32 (i64, i8**, ...)*)(i64 %3, i8** %9)
%15 = load i8*, i8** %8
%16 = load i8*, i8** %9
%17 = call i32 (i8*, i8*, ...) @sprintf(i8* %10, i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %15, i8* %2, i8* %16, i8* %4)
%18 = call i32 (i8*, i64, ...) bitcast (i32 (...)* @MESSAGE to i32 (i8*, i64, ...)*)(i8* %10, i64 %5)
ret i32 undef
}