#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*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *, int, int,
                           int, int);
int /*<<< orphan*/ stdout;
void script_output(char *type, char *cmd, int lastpid, int movement, int score,
                   int niterests) {
  if (movement >= 0)
    fprintf(stdout, "[%s,%s,%i,+%i,%i,%i]\n", type, cmd, lastpid, movement,
            score, niterests);
  else
    fprintf(stdout, "[%s,%s,%i,%i,%i,%i]\n", type, cmd, lastpid, movement,
            score, niterests);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<script_output>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
cmpl   $0x0,-0x18(%rbp)
jl     1181 <script_output+0x61>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
mov    -0x1c(%rbp),%r10d
mov    -0x20(%rbp),%eax
lea    0xe91(%rip),%rsi
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1030 <fprintf@plt>
jmp    11b5 <script_output+0x95>
mov    0x2e58(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
mov    -0x1c(%rbp),%r10d
mov    -0x20(%rbp),%eax
lea    0xe6e(%rip),%rsi
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1030 <fprintf@plt>
mov    0x2e24(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<script_output>:
push   %r14
push   %rbx
push   %rax
mov    %r9d,%eax
mov    %r8d,%r10d
mov    %ecx,%r9d
mov    %edx,%r8d
mov    %rsi,%rcx
mov    %rdi,%rdx
test   %r9d,%r9d
mov    0x2ea0(%rip),%r14
mov    (%r14),%edi
lea    0xeb6(%rip),%rbx
lea    0xec5(%rip),%rsi
cmovns %rbx,%rsi
push   %rax
push   %r10
call   1030 <fprintf@plt>
add    $0x10,%rsp
mov    (%r14),%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [22 x i8] c"[%s,%s,%i,+%i,%i,%i]\0A\00"
@.str.1 = [21 x i8] c"[%s,%s,%i,%i,%i,%i]\0A\00"
define void @script_output(i8* %0, i8* %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i8* %0, i8** %7
store i8* %1, i8** %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = load i32, i32* %10
%14 = icmp sge i32 %13, 0
br i1 %14, label %15, label %24
15: ; preds = %6
%16 = load i32, i32* @stdout
%17 = load i8*, i8** %7
%18 = load i8*, i8** %8
%19 = load i32, i32* %9
%20 = load i32, i32* %10
%21 = load i32, i32* %11
%22 = load i32, i32* %12
%23 = call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %17, i8* %18, i32 %19, i32 %20, i32 %21, i32 %22)
br label %33
24: ; preds = %6
%25 = load i32, i32* @stdout
%26 = load i8*, i8** %7
%27 = load i8*, i8** %8
%28 = load i32, i32* %9
%29 = load i32, i32* %10
%30 = load i32, i32* %11
%31 = load i32, i32* %12
%32 = call i32 @fprintf(i32 %25, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %26, i8* %27, i32 %28, i32 %29, i32 %30, i32 %31)
br label %33
33: ; preds = %24, %15
%34 = load i32, i32* @stdout
%35 = call i32 @fflush(i32 %34)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [22 x i8] c"[%s,%s,%i,+%i,%i,%i]\0A\00"
@.str.1 = [21 x i8] c"[%s,%s,%i,%i,%i,%i]\0A\00"
define void @script_output(i8* %0, i8* %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = icmp sgt i32 %3, -1
%8 = load i32, i32* @stdout
%9 = select i1 %7, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0)
%10 = tail call i32 @fprintf(i32 %8, i8* %9, i8* %0, i8* %1, i32 %2, i32 %3, i32 %4, i32 %5)
%11 = load i32, i32* @stdout
%12 = tail call i32 @fflush(i32 %11)
ret void
}