#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*/ VDP_clearText(int, int, int);
int /*<<< orphan*/ VDP_drawText(char *, int, int);
int /*<<< orphan*/ fix32ToStr(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ getFPS();
int /*<<< orphan*/ getFPS_f();
int /*<<< orphan*/ uintToStr(int /*<<< orphan*/, char *, int);
void VDP_showFPS(unsigned short float_display) {
  char str[16];
  if (float_display) {
    fix32ToStr(getFPS_f(), str, 1);
    VDP_clearText(2, 1, 5);
  } else {
    uintToStr(getFPS(), str, 1);
    VDP_clearText(2, 1, 2);
  }
  VDP_drawText(str, 1, 1);
}


x86 assembly (clang, -O0):
<VDP_showFPS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
cmpw   $0x0,-0x2(%rbp)
je     11aa <VDP_showFPS+0x4a>
mov    $0x0,%al
call   1040 <getFPS_f@plt>
mov    %eax,%edi
lea    -0x20(%rbp),%rsi
mov    $0x1,%edx
call   1070 <fix32ToStr@plt>
mov    $0x2,%edi
mov    $0x1,%esi
mov    $0x5,%edx
call   1080 <VDP_clearText@plt>
jmp    11d2 <VDP_showFPS+0x72>
mov    $0x0,%al
call   1030 <getFPS@plt>
mov    %eax,%edi
lea    -0x20(%rbp),%rsi
mov    $0x1,%edx
call   1050 <uintToStr@plt>
mov    $0x2,%edx
mov    $0x1,%esi
mov    %edx,%edi
call   1080 <VDP_clearText@plt>
lea    -0x20(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1060 <VDP_drawText@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VDP_showFPS>:
sub    $0x18,%rsp
xor    %eax,%eax
test   %edi,%edi
je     1185 <VDP_showFPS+0x25>
call   1040 <getFPS_f@plt>
mov    %rsp,%rsi
mov    %eax,%edi
mov    $0x1,%edx
call   1070 <fix32ToStr@plt>
mov    $0x5,%edx
jmp    119e <VDP_showFPS+0x3e>
call   1030 <getFPS@plt>
mov    %rsp,%rsi
mov    %eax,%edi
mov    $0x1,%edx
call   1050 <uintToStr@plt>
mov    $0x2,%edx
mov    $0x2,%edi
mov    $0x1,%esi
call   1080 <VDP_clearText@plt>
mov    %rsp,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
call   1060 <VDP_drawText@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @VDP_showFPS(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca [16 x i8]
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = icmp ne i16 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = call i32 (...) @getFPS_f()
%8 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%9 = call i32 @fix32ToStr(i32 %7, i8* %8, i32 1)
%10 = call i32 @VDP_clearText(i32 2, i32 1, i32 5)
br label %16
11: ; preds = %1
%12 = call i32 (...) @getFPS()
%13 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%14 = call i32 @uintToStr(i32 %12, i8* %13, i32 1)
%15 = call i32 @VDP_clearText(i32 2, i32 1, i32 2)
br label %16
16: ; preds = %11, %6
%17 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%18 = call i32 @VDP_drawText(i8* %17, i32 1, i32 1)
ret void
}

LLVM IR (-O2):
define void @VDP_showFPS(i16 zeroext %0) {
%2 = alloca [16 x i8]
%3 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%4 = icmp eq i16 %0, 0
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = tail call i32 (...) @getFPS_f()
%7 = call i32 @fix32ToStr(i32 %6, i8* %3, i32 1)
br label %11
8: ; preds = %1
%9 = tail call i32 (...) @getFPS()
%10 = call i32 @uintToStr(i32 %9, i8* %3, i32 1)
br label %11
11: ; preds = %8, %5
%12 = phi i32 [ 2, %8 ], [ 5, %5 ]
%13 = call i32 @VDP_clearText(i32 2, i32 1, i32 %12)
%14 = call i32 @VDP_drawText(i8* %3, i32 1, i32 1)
ret void
}