#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*/ clock_get_relative();
unsigned short game_get_extra_multiplier();
int /*<<< orphan*/ game_get_multiplier();
int /*<<< orphan*/ game_get_score();
scalar_t__ game_has_multiplier_unset_protect();
int /*<<< orphan*/ mode_get_name();
int /*<<< orphan*/ printstatusf(char *, int /*<<< orphan*/, int /*<<< orphan*/,
                                int /*<<< orphan*/, int /*<<< orphan*/, char *,
                                char *);
int /*<<< orphan*/ sprintf(char *, char *, unsigned short);
void status_print(void) {
  unsigned short extra_mult = game_get_extra_multiplier();
  char extra_mult_msg[3];
  sprintf(extra_mult_msg, "%dx", extra_mult);
  printstatusf("%s: % 4.2lfs - %09u x%03u %s%s", mode_get_name(),
               clock_get_relative(), game_get_score(), game_get_multiplier(),
               game_has_multiplier_unset_protect() ? "Long Life Milk" : "",
               extra_mult > 1 ? extra_mult_msg : "");
}


x86 assembly (clang, -O0):
<status_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    $0x0,%al
call   1050 <game_get_extra_multiplier@plt>
mov    %ax,-0x2(%rbp)
lea    -0x5(%rbp),%rdi
lea    0xe62(%rip),%rsi
movzwl -0x2(%rbp),%edx
call   1090 <sprintf@plt>
mov    $0x0,%al
call   1060 <mode_get_name@plt>
mov    %eax,-0x20(%rbp)
mov    $0x0,%al
call   1040 <clock_get_relative@plt>
mov    %eax,-0x1c(%rbp)
mov    $0x0,%al
call   1080 <game_get_score@plt>
mov    %eax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <game_get_multiplier@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   10a0 <game_has_multiplier_unset_protect@plt>
mov    %rax,%rdx
lea    0xe51(%rip),%rax
lea    0xe3c(%rip),%rcx
cmp    $0x0,%rdx
cmovne %rcx,%rax
mov    %rax,-0x10(%rbp)
movzwl -0x2(%rbp),%eax
cmp    $0x1,%eax
jle    120d <status_print+0x8d>
lea    -0x5(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    121d <status_print+0x9d>
lea    0xe1d(%rip),%rax
mov    %rax,-0x28(%rbp)
jmp    121d <status_print+0x9d>
mov    -0x10(%rbp),%r9
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%ecx
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%esi
mov    -0x28(%rbp),%rax
lea    0xdcb(%rip),%rdi
mov    %rax,(%rsp)
call   1070 <printstatusf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<status_print>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
xor    %eax,%eax
call   1050 <game_get_extra_multiplier@plt>
movzwl %ax,%ebx
lea    0xe61(%rip),%rsi
lea    0x15(%rsp),%r14
mov    %r14,%rdi
mov    %ebx,%edx
call   1090 <sprintf@plt>
xor    %eax,%eax
call   1060 <mode_get_name@plt>
mov    %eax,%r15d
xor    %eax,%eax
call   1040 <clock_get_relative@plt>
mov    %eax,%r12d
xor    %eax,%eax
call   1080 <game_get_score@plt>
mov    %eax,%r13d
xor    %eax,%eax
call   1030 <game_get_multiplier@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   10a0 <game_has_multiplier_unset_protect@plt>
test   %rax,%rax
lea    0xe4b(%rip),%rax
lea    0xe36(%rip),%r9
cmove  %rax,%r9
cmp    $0x2,%bx
cmovae %r14,%rax
mov    %rax,(%rsp)
lea    0xe00(%rip),%rdi
mov    %r15d,%esi
mov    %r12d,%edx
mov    %r13d,%ecx
mov    %ebp,%r8d
call   1070 <printstatusf@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%dx\00"
@.str.1 = [31 x i8] c"%s: % 4.2lfs - %09u x%03u %s%s\00"
@.str.2 = [15 x i8] c"Long Life Milk\00"
@.str.3 = [1 x i8] zeroinitializer
define void @status_print() {
%1 = alloca i16
%2 = alloca [3 x i8]
%3 = call zeroext i16 (...) @game_get_extra_multiplier()
store i16 %3, i16* %1
%4 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%5 = load i16, i16* %1
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i16 zeroext %5)
%7 = call i32 (...) @mode_get_name()
%8 = call i32 (...) @clock_get_relative()
%9 = call i32 (...) @game_get_score()
%10 = call i32 (...) @game_get_multiplier()
%11 = call i64 (...) @game_has_multiplier_unset_protect()
%12 = icmp ne i64 %11, 0
%13 = zext i1 %12 to i64
%14 = select i1 %12, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0)
%15 = load i16, i16* %1
%16 = zext i16 %15 to i32
%17 = icmp sgt i32 %16, 1
br i1 %17, label %18, label %20
18: ; preds = %0
%19 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
br label %21
20: ; preds = %0
br label %21
21: ; preds = %20, %18
%22 = phi i8* [ %19, %18 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0), %20 ]
%23 = call i32 @printstatusf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 %7, i32 %8, i32 %9, i32 %10, i8* %14, i8* %22)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%dx\00"
@.str.1 = [31 x i8] c"%s: % 4.2lfs - %09u x%03u %s%s\00"
@.str.2 = [15 x i8] c"Long Life Milk\00"
@.str.3 = [1 x i8] zeroinitializer
define void @status_print() {
%1 = alloca [3 x i8]
%2 = tail call zeroext i16 (...) @game_get_extra_multiplier()
%3 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i16 zeroext %2)
%5 = tail call i32 (...) @mode_get_name()
%6 = tail call i32 (...) @clock_get_relative()
%7 = tail call i32 (...) @game_get_score()
%8 = tail call i32 (...) @game_get_multiplier()
%9 = tail call i64 (...) @game_has_multiplier_unset_protect()
%10 = icmp eq i64 %9, 0
%11 = select i1 %10, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0)
%12 = icmp ugt i16 %2, 1
%13 = select i1 %12, i8* %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0)
%14 = call i32 @printstatusf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 %5, i32 %6, i32 %7, i32 %8, i8* %11, i8* %13)
ret void
}