#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;

/* Variables and functions */
int /*<<< orphan*/ SchemeLogMeta(char const *, char const *, int, char const *);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ putc(char, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ vfprintf(int /*<<< orphan*/, char const *,
                            int /*<<< orphan*/);
void SchemeLogV(const char *file, const char *fn, int lineno, const char *kind,
                const char *fmt, va_list argv) {
  fflush(stdout);
  SchemeLogMeta(file, fn, lineno, kind);
  vfprintf(stderr, fmt, argv);
  putc('\n', stderr);
  fflush(stderr);
}


x86 assembly (clang, -O0):
<SchemeLogV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
call   1030 <SchemeLogMeta@plt>
mov    0x2e58(%rip),%rax
mov    (%rax),%edi
mov    -0x28(%rbp),%rsi
mov    -0x2c(%rbp),%edx
call   1060 <vfprintf@plt>
mov    0x2e43(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1040 <putc@plt>
mov    0x2e30(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SchemeLogV>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9d,%r14d
mov    %r8,%r15
mov    %rcx,%r12
mov    %edx,%r13d
mov    %rsi,%rbp
mov    %rdi,%rbx
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %r13d,%edx
mov    %r12,%rcx
call   1030 <SchemeLogMeta@plt>
mov    0x2e5d(%rip),%rbx
mov    (%rbx),%edi
mov    %r15,%rsi
mov    %r14d,%edx
call   1060 <vfprintf@plt>
mov    (%rbx),%esi
mov    $0xa,%edi
call   1040 <putc@plt>
mov    (%rbx),%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <fflush@plt>

LLVM IR (-O0):
@stdout = global i32 0
@stderr = global i32 0
define void @SchemeLogV(i8* %0, i8* %1, i32 %2, i8* %3, i8* %4, i32 %5) {
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i32
store i8* %0, i8** %7
store i8* %1, i8** %8
store i32 %2, i32* %9
store i8* %3, i8** %10
store i8* %4, i8** %11
store i32 %5, i32* %12
%13 = load i32, i32* @stdout
%14 = call i32 @fflush(i32 %13)
%15 = load i8*, i8** %7
%16 = load i8*, i8** %8
%17 = load i32, i32* %9
%18 = load i8*, i8** %10
%19 = call i32 @SchemeLogMeta(i8* %15, i8* %16, i32 %17, i8* %18)
%20 = load i32, i32* @stderr
%21 = load i8*, i8** %11
%22 = load i32, i32* %12
%23 = call i32 @vfprintf(i32 %20, i8* %21, i32 %22)
%24 = load i32, i32* @stderr
%25 = call i32 @putc(i8 signext 10, i32 %24)
%26 = load i32, i32* @stderr
%27 = call i32 @fflush(i32 %26)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@stderr = global i32 0
define void @SchemeLogV(i8* %0, i8* %1, i32 %2, i8* %3, i8* %4, i32 %5) {
%7 = load i32, i32* @stdout
%8 = tail call i32 @fflush(i32 %7)
%9 = tail call i32 @SchemeLogMeta(i8* %0, i8* %1, i32 %2, i8* %3)
%10 = load i32, i32* @stderr
%11 = tail call i32 @vfprintf(i32 %10, i8* %4, i32 %5)
%12 = load i32, i32* @stderr
%13 = tail call i32 @putc(i8 signext 10, i32 %12)
%14 = load i32, i32* @stderr
%15 = tail call i32 @fflush(i32 %14)
ret void
}