#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *, char *,
                           char *, char *, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcpy(char *, char *);
int foo(char *out_var, int out_var_len, char *arg_0, int arg_0_len, char *arg_1,
        int arg_1_len, char *arg_2, int arg_2_len, char *arg_3, int arg_3_len,
        char *arg_4, int arg_4_len, char *arg_5, int arg_5_len) {
  fprintf(stderr, "FOO %s %s %s %s %s %s\n", arg_0, arg_1, arg_2, arg_3, arg_4,
          arg_5);
  strcpy(out_var, "test");
  return 4;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x48(%rbp),%eax
mov    0x40(%rbp),%rax
mov    0x38(%rbp),%eax
mov    0x30(%rbp),%rax
mov    0x28(%rbp),%eax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    0x10(%rbp),%r8
mov    0x20(%rbp),%r9
mov    0x30(%rbp),%r10
mov    0x40(%rbp),%rax
lea    0xe7e(%rip),%rsi
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xe7c(%rip),%rsi
call   1030 <strcpy@plt>
mov    $0x4,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbx
mov    %r8,%rcx
mov    %rdi,%rbx
mov    0x10(%rsp),%r8
mov    0x20(%rsp),%r9
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
lea    0xebf(%rip),%rsi
push   0x40(%rsp)
push   0x38(%rsp)
call   1040 <fprintf@plt>
add    $0x10,%rsp
lea    0xebe(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    $0x4,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [23 x i8] c"FOO %s %s %s %s %s %s\0A\00"
@.str.1 = [5 x i8] c"test\00"
define i32 @foo(i8* %0, i32 %1, i8* %2, i32 %3, i8* %4, i32 %5, i8* %6, i32 %7, i8* %8, i32 %9, i8* %10, i32 %11, i8* %12, i32 %13) {
%15 = alloca i8*
%16 = alloca i32
%17 = alloca i8*
%18 = alloca i32
%19 = alloca i8*
%20 = alloca i32
%21 = alloca i8*
%22 = alloca i32
%23 = alloca i8*
%24 = alloca i32
%25 = alloca i8*
%26 = alloca i32
%27 = alloca i8*
%28 = alloca i32
store i8* %0, i8** %15
store i32 %1, i32* %16
store i8* %2, i8** %17
store i32 %3, i32* %18
store i8* %4, i8** %19
store i32 %5, i32* %20
store i8* %6, i8** %21
store i32 %7, i32* %22
store i8* %8, i8** %23
store i32 %9, i32* %24
store i8* %10, i8** %25
store i32 %11, i32* %26
store i8* %12, i8** %27
store i32 %13, i32* %28
%29 = load i32, i32* @stderr
%30 = load i8*, i8** %17
%31 = load i8*, i8** %19
%32 = load i8*, i8** %21
%33 = load i8*, i8** %23
%34 = load i8*, i8** %25
%35 = load i8*, i8** %27
%36 = call i32 @fprintf(i32 %29, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %30, i8* %31, i8* %32, i8* %33, i8* %34, i8* %35)
%37 = load i8*, i8** %15
%38 = call i32 @strcpy(i8* %37, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret i32 4
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"FOO %s %s %s %s %s %s\0A\00"
@.str.1 = [5 x i8] c"test\00"
define i32 @foo(i8* %0, i32 %1, i8* %2, i32 %3, i8* %4, i32 %5, i8* %6, i32 %7, i8* %8, i32 %9, i8* %10, i32 %11, i8* %12, i32 %13) {
%15 = load i32, i32* @stderr
%16 = tail call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %4, i8* %6, i8* %8, i8* %10, i8* %12)
%17 = tail call i32 @strcpy(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret i32 4
}