#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*/ CA_CacheGrChunk(int);
int /*<<< orphan*/ CA_DownLevel();
int /*<<< orphan*/ CA_UpLevel();
int /*<<< orphan*/ IN_ClearKeysDown();
int /*<<< orphan*/ IN_WaitButton();
int /*<<< orphan*/ SD_WaitSoundDone();
int /*<<< orphan*/ US_CPrint(char *);
int /*<<< orphan*/ US_CenterWindow(int, int);
scalar_t__ US_GetPrintY();
scalar_t__ US_GetWindowW();
scalar_t__ US_GetWindowX();
int /*<<< orphan*/ US_GetWindowY();
int /*<<< orphan*/ US_SetPrintY(scalar_t__);
int /*<<< orphan*/ US_SetWindowW(scalar_t__);
int /*<<< orphan*/ VHB_DrawBitmap(scalar_t__, int /*<<< orphan*/, int);
int /*<<< orphan*/ VL_Present();
void CK4_ShowCantSwimMessage(void) {
  SD_WaitSoundDone();
  CA_UpLevel();
  CA_CacheGrChunk(0x6F);
  US_CenterWindow(26, 8);
  VHB_DrawBitmap(US_GetWindowX() + US_GetWindowW() - 0x30, US_GetWindowY(),
                 0x6F);
  US_SetWindowW(US_GetWindowW() - 0x30);
  US_SetPrintY(US_GetPrintY() + 6);
  US_CPrint("I can't swim!");
  VL_Present();
  IN_ClearKeysDown();
  IN_WaitButton();
  CA_DownLevel();
}


x86 assembly (clang, -O0):
<CK4_ShowCantSwimMessage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <SD_WaitSoundDone@plt>
mov    $0x0,%al
call   1070 <CA_UpLevel@plt>
mov    $0x6f,%edi
call   10d0 <CA_CacheGrChunk@plt>
mov    $0x1a,%edi
mov    $0x8,%esi
call   10b0 <US_CenterWindow@plt>
mov    $0x0,%al
call   1060 <US_GetWindowX@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1110 <US_GetWindowW@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
add    %rcx,%rax
sub    $0x30,%rax
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1100 <US_GetWindowY@plt>
mov    -0x8(%rbp),%rdi
mov    %eax,%esi
mov    $0x6f,%edx
call   10f0 <VHB_DrawBitmap@plt>
mov    $0x0,%al
call   1110 <US_GetWindowW@plt>
mov    %rax,%rdi
sub    $0x30,%rdi
call   1030 <US_SetWindowW@plt>
mov    $0x0,%al
call   10e0 <US_GetPrintY@plt>
mov    %rax,%rdi
add    $0x6,%rdi
call   1090 <US_SetPrintY@plt>
lea    0xd69(%rip),%rdi
call   1050 <US_CPrint@plt>
mov    $0x0,%al
call   10a0 <VL_Present@plt>
mov    $0x0,%al
call   1120 <IN_ClearKeysDown@plt>
mov    $0x0,%al
call   1080 <IN_WaitButton@plt>
mov    $0x0,%al
call   10c0 <CA_DownLevel@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CK4_ShowCantSwimMessage>:
push   %rbx
xor    %eax,%eax
call   1040 <SD_WaitSoundDone@plt>
xor    %eax,%eax
call   1070 <CA_UpLevel@plt>
mov    $0x6f,%edi
call   10d0 <CA_CacheGrChunk@plt>
mov    $0x1a,%edi
mov    $0x8,%esi
call   10b0 <US_CenterWindow@plt>
xor    %eax,%eax
call   1060 <US_GetWindowX@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1110 <US_GetWindowW@plt>
add    %rax,%rbx
add    $0xffffffffffffffd0,%rbx
xor    %eax,%eax
call   1100 <US_GetWindowY@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    $0x6f,%edx
call   10f0 <VHB_DrawBitmap@plt>
xor    %eax,%eax
call   1110 <US_GetWindowW@plt>
lea    -0x30(%rax),%rdi
call   1030 <US_SetWindowW@plt>
xor    %eax,%eax
call   10e0 <US_GetPrintY@plt>
lea    0x6(%rax),%rdi
call   1090 <US_SetPrintY@plt>
lea    0xd83(%rip),%rdi
call   1050 <US_CPrint@plt>
xor    %eax,%eax
call   10a0 <VL_Present@plt>
xor    %eax,%eax
call   1120 <IN_ClearKeysDown@plt>
xor    %eax,%eax
call   1080 <IN_WaitButton@plt>
xor    %eax,%eax
pop    %rbx
jmp    10c0 <CA_DownLevel@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"I can't swim!\00"
define void @CK4_ShowCantSwimMessage() {
%1 = call i32 (...) @SD_WaitSoundDone()
%2 = call i32 (...) @CA_UpLevel()
%3 = call i32 @CA_CacheGrChunk(i32 111)
%4 = call i32 @US_CenterWindow(i32 26, i32 8)
%5 = call i64 (...) @US_GetWindowX()
%6 = call i64 (...) @US_GetWindowW()
%7 = add nsw i64 %5, %6
%8 = sub nsw i64 %7, 48
%9 = call i32 (...) @US_GetWindowY()
%10 = call i32 @VHB_DrawBitmap(i64 %8, i32 %9, i32 111)
%11 = call i64 (...) @US_GetWindowW()
%12 = sub nsw i64 %11, 48
%13 = call i32 @US_SetWindowW(i64 %12)
%14 = call i64 (...) @US_GetPrintY()
%15 = add nsw i64 %14, 6
%16 = call i32 @US_SetPrintY(i64 %15)
%17 = call i32 @US_CPrint(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%18 = call i32 (...) @VL_Present()
%19 = call i32 (...) @IN_ClearKeysDown()
%20 = call i32 (...) @IN_WaitButton()
%21 = call i32 (...) @CA_DownLevel()
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"I can't swim!\00"
define void @CK4_ShowCantSwimMessage() {
%1 = tail call i32 (...) @SD_WaitSoundDone()
%2 = tail call i32 (...) @CA_UpLevel()
%3 = tail call i32 @CA_CacheGrChunk(i32 111)
%4 = tail call i32 @US_CenterWindow(i32 26, i32 8)
%5 = tail call i64 (...) @US_GetWindowX()
%6 = tail call i64 (...) @US_GetWindowW()
%7 = add i64 %5, -48
%8 = add i64 %7, %6
%9 = tail call i32 (...) @US_GetWindowY()
%10 = tail call i32 @VHB_DrawBitmap(i64 %8, i32 %9, i32 111)
%11 = tail call i64 (...) @US_GetWindowW()
%12 = add nsw i64 %11, -48
%13 = tail call i32 @US_SetWindowW(i64 %12)
%14 = tail call i64 (...) @US_GetPrintY()
%15 = add nsw i64 %14, 6
%16 = tail call i32 @US_SetPrintY(i64 %15)
%17 = tail call i32 @US_CPrint(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%18 = tail call i32 (...) @VL_Present()
%19 = tail call i32 (...) @IN_ClearKeysDown()
%20 = tail call i32 (...) @IN_WaitButton()
%21 = tail call i32 (...) @CA_DownLevel()
ret void
}