#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 */
typedef int /*<<< orphan*/ va_list;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *, char *,
                           char *);
int /*<<< orphan*/ vsnprintf(char *, int, char *, int /*<<< orphan*/);
extern void libtest_args_real(FILE *file, char *slug, char *format,
                              va_list *args) {
  char buffer[4096];
  assert(file && slug && format && args);
  vsnprintf(buffer, 4096, format, *args);
  fprintf(file, "[%s] %s (%s)\n", "slf4c", buffer, slug);
}


x86 assembly (clang, -O0):
<libtest_args_real>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1030,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x1021(%rbp)
je     1192 <libtest_args_real+0x62>
xor    %eax,%eax
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x1021(%rbp)
je     1192 <libtest_args_real+0x62>
xor    %eax,%eax
cmpq   $0x0,-0x18(%rbp)
mov    %al,-0x1021(%rbp)
je     1192 <libtest_args_real+0x62>
cmpq   $0x0,-0x20(%rbp)
setne  %al
mov    %al,-0x1021(%rbp)
mov    -0x1021(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    -0x1020(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
mov    $0x1000,%esi
call   1030 <vsnprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x1020(%rbp),%rcx
mov    -0x10(%rbp),%r8
lea    0xe2d(%rip),%rsi
lea    0xe34(%rip),%rdx
call   1050 <fprintf@plt>
add    $0x1030,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libtest_args_real>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x1008,%rsp
mov    %rcx,%rbx
mov    %rdx,%r12
mov    %rsi,%r14
mov    %rdi,%r15
test   %rdi,%rdi
setne  %al
test   %rsi,%rsi
setne  %cl
and    %al,%cl
test   %rdx,%rdx
setne  %al
test   %rbx,%rbx
setne  %dl
and    %al,%dl
and    %cl,%dl
movzbl %dl,%edi
call   1040 <assert@plt>
mov    (%rbx),%ecx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1000,%esi
mov    %r12,%rdx
call   1030 <vsnprintf@plt>
lea    0xe74(%rip),%rsi
lea    0xe7b(%rip),%rdx
mov    %r15,%rdi
mov    %rbx,%rcx
mov    %r14,%r8
call   1050 <fprintf@plt>
add    $0x1008,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [14 x i8] c"[%s] %s (%s)\0A\00"
@.str.1 = [6 x i8] c"slf4c\00"
define void @libtest_args_real(i32* %0, i8* %1, i8* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32*
%9 = alloca [4096 x i8]
store i32* %0, i32** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32* %3, i32** %8
%10 = load i32*, i32** %5
%11 = icmp ne i32* %10, null
br i1 %11, label %12, label %21
12: ; preds = %4
%13 = load i8*, i8** %6
%14 = icmp ne i8* %13, null
br i1 %14, label %15, label %21
15: ; preds = %12
%16 = load i8*, i8** %7
%17 = icmp ne i8* %16, null
br i1 %17, label %18, label %21
18: ; preds = %15
%19 = load i32*, i32** %8
%20 = icmp ne i32* %19, null
br label %21
21: ; preds = %18, %15, %12, %4
%22 = phi i1 [ false, %15 ], [ false, %12 ], [ false, %4 ], [ %20, %18 ]
%23 = zext i1 %22 to i32
%24 = call i32 @assert(i32 %23)
%25 = getelementptr inbounds [4096 x i8], [4096 x i8]* %9, i64 0, i64 0
%26 = load i8*, i8** %7
%27 = load i32*, i32** %8
%28 = load i32, i32* %27
%29 = call i32 @vsnprintf(i8* %25, i32 4096, i8* %26, i32 %28)
%30 = load i32*, i32** %5
%31 = getelementptr inbounds [4096 x i8], [4096 x i8]* %9, i64 0, i64 0
%32 = load i8*, i8** %6
%33 = call i32 @fprintf(i32* %30, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %31, i8* %32)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"[%s] %s (%s)\0A\00"
@.str.1 = [6 x i8] c"slf4c\00"
define void @libtest_args_real(i32* %0, i8* %1, i8* %2, i32* %3) {
%5 = alloca [4096 x i8]
%6 = getelementptr inbounds [4096 x i8], [4096 x i8]* %5, i64 0, i64 0
%7 = icmp ne i32* %0, null
%8 = icmp ne i8* %1, null
%9 = and i1 %7, %8
%10 = icmp ne i8* %2, null
%11 = and i1 %9, %10
%12 = icmp ne i32* %3, null
%13 = and i1 %11, %12
%14 = zext i1 %13 to i32
%15 = tail call i32 @assert(i32 %14)
%16 = load i32, i32* %3
%17 = call i32 @vsnprintf(i8* %6, i32 4096, i8* %2, i32 %16)
%18 = call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %6, i8* %1)
ret void
}