#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*/ CG_GameTypeString();
int /*<<< orphan*/ CG_GetGameStatusText();
int /*<<< orphan*/ CG_GetKillerText();
int CG_Text_Width(int /*<<< orphan*/, float, int /*<<< orphan*/);
int CG_OwnerDrawWidth(int ownerDraw, float scale) {
  switch (ownerDraw) {
  case 39:
    return CG_Text_Width(CG_GameTypeString(), scale, 0);
  case 49:
    return CG_Text_Width(CG_GetGameStatusText(), scale, 0);
    break;
  case 50:
    return CG_Text_Width(CG_GetKillerText(), scale, 0);
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<CG_OwnerDrawWidth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x27,%eax
je     1186 <CG_OwnerDrawWidth+0x46>
jmp    1164 <CG_OwnerDrawWidth+0x24>
mov    -0x10(%rbp),%eax
sub    $0x31,%eax
je     11a3 <CG_OwnerDrawWidth+0x63>
jmp    1175 <CG_OwnerDrawWidth+0x35>
mov    -0x10(%rbp),%eax
sub    $0x32,%eax
je     11c0 <CG_OwnerDrawWidth+0x80>
jmp    11dd <CG_OwnerDrawWidth+0x9d>
mov    $0x0,%al
call   1030 <CG_GameTypeString@plt>
mov    %eax,%edi
movss  -0xc(%rbp),%xmm0
xor    %esi,%esi
call   1040 <CG_Text_Width@plt>
mov    %eax,-0x4(%rbp)
jmp    11e4 <CG_OwnerDrawWidth+0xa4>
mov    $0x0,%al
call   1060 <CG_GetGameStatusText@plt>
mov    %eax,%edi
movss  -0xc(%rbp),%xmm0
xor    %esi,%esi
call   1040 <CG_Text_Width@plt>
mov    %eax,-0x4(%rbp)
jmp    11e4 <CG_OwnerDrawWidth+0xa4>
mov    $0x0,%al
call   1050 <CG_GetKillerText@plt>
mov    %eax,%edi
movss  -0xc(%rbp),%xmm0
xor    %esi,%esi
call   1040 <CG_Text_Width@plt>
mov    %eax,-0x4(%rbp)
jmp    11e4 <CG_OwnerDrawWidth+0xa4>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CG_OwnerDrawWidth>:
push   %rax
cmp    $0x32,%edi
je     115f <CG_OwnerDrawWidth+0x1f>
cmp    $0x31,%edi
je     116e <CG_OwnerDrawWidth+0x2e>
cmp    $0x27,%edi
jne    118b <CG_OwnerDrawWidth+0x4b>
movss  %xmm0,0x4(%rsp)
xor    %eax,%eax
call   1030 <CG_GameTypeString@plt>
jmp    117b <CG_OwnerDrawWidth+0x3b>
movss  %xmm0,0x4(%rsp)
xor    %eax,%eax
call   1050 <CG_GetKillerText@plt>
jmp    117b <CG_OwnerDrawWidth+0x3b>
movss  %xmm0,0x4(%rsp)
xor    %eax,%eax
call   1060 <CG_GetGameStatusText@plt>
mov    %eax,%edi
movss  0x4(%rsp),%xmm0
xor    %esi,%esi
pop    %rax
jmp    1040 <CG_Text_Width@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @CG_OwnerDrawWidth(i32 %0, float %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca float
store i32 %0, i32* %4
store float %1, float* %5
%6 = load i32, i32* %4
switch i32 %6, label %19 [
i32 39, label %7
i32 49, label %11
i32 50, label %15
]
7: ; preds = %2
%8 = call i32 (...) @CG_GameTypeString()
%9 = load float, float* %5
%10 = call i32 @CG_Text_Width(i32 %8, float %9, i32 0)
store i32 %10, i32* %3
br label %20
11: ; preds = %2
%12 = call i32 (...) @CG_GetGameStatusText()
%13 = load float, float* %5
%14 = call i32 @CG_Text_Width(i32 %12, float %13, i32 0)
store i32 %14, i32* %3
br label %20
15: ; preds = %2
%16 = call i32 (...) @CG_GetKillerText()
%17 = load float, float* %5
%18 = call i32 @CG_Text_Width(i32 %16, float %17, i32 0)
store i32 %18, i32* %3
br label %20
19: ; preds = %2
store i32 0, i32* %3
br label %20
20: ; preds = %19, %15, %11, %7
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @CG_OwnerDrawWidth(i32 %0, float %1) {
switch i32 %0, label %12 [
i32 39, label %3
i32 49, label %5
i32 50, label %7
]
3: ; preds = %2
%4 = tail call i32 (...) @CG_GameTypeString()
br label %9
5: ; preds = %2
%6 = tail call i32 (...) @CG_GetGameStatusText()
br label %9
7: ; preds = %2
%8 = tail call i32 (...) @CG_GetKillerText()
br label %9
9: ; preds = %3, %5, %7
%10 = phi i32 [ %8, %7 ], [ %6, %5 ], [ %4, %3 ]
%11 = tail call i32 @CG_Text_Width(i32 %10, float %1, i32 0)
br label %12
12: ; preds = %9, %2
%13 = phi i32 [ 0, %2 ], [ %11, %9 ]
ret i32 %13
}