#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*/ decsasd(int);
int /*<<< orphan*/ decssdt(int);
int /*<<< orphan*/ holdit();
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ println(char *);
int /*<<< orphan*/ restore_status();
int /*<<< orphan*/ vt_move(int, int);
int simple_statusline(const char *the_title) {
  static char text[] = "TEXT IN THE STATUS LINE";
  vt_move(1, 1);
  println("This is a simple test of the status-line");
  println("");
  decssdt(2);
  decsasd(1);
  printf("%s", text);
  decsasd(0);
  printf("There should be %s\r\n", text);
  holdit();
  decssdt(0);
  println("There should be no status line");
  holdit();
  decssdt(1);
  println("The status line should be normal (i.e., indicator)");
  holdit();
  restore_status();
  return 0;
}


x86 assembly (clang, -O0):
<simple_statusline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%esi
mov    %esi,%edi
call   1070 <vt_move@plt>
lea    0xe71(%rip),%rdi
call   1080 <println@plt>
lea    0xea5(%rip),%rdi
call   1080 <println@plt>
mov    $0x2,%edi
call   1060 <decssdt@plt>
mov    $0x1,%edi
call   1030 <decsasd@plt>
lea    0xe6e(%rip),%rdi
lea    0x2e9e(%rip),%rsi
call   1050 <printf@plt>
xor    %edi,%edi
call   1030 <decsasd@plt>
lea    0xe57(%rip),%rdi
lea    0x2e84(%rip),%rsi
call   1050 <printf@plt>
mov    $0x0,%al
call   1090 <holdit@plt>
xor    %edi,%edi
call   1060 <decssdt@plt>
lea    0xe4b(%rip),%rdi
call   1080 <println@plt>
mov    $0x0,%al
call   1090 <holdit@plt>
mov    $0x1,%edi
call   1060 <decssdt@plt>
lea    0xe4d(%rip),%rdi
call   1080 <println@plt>
mov    $0x0,%al
call   1090 <holdit@plt>
mov    $0x0,%al
call   1040 <restore_status@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<simple_statusline>:
push   %rbx
mov    $0x1,%edi
mov    $0x1,%esi
call   1070 <vt_move@plt>
lea    0xe79(%rip),%rdi
call   1080 <println@plt>
lea    0xead(%rip),%rdi
call   1080 <println@plt>
mov    $0x2,%edi
call   1060 <decssdt@plt>
mov    $0x1,%edi
call   1030 <decsasd@plt>
lea    0xe76(%rip),%rdi
lea    0x2ea6(%rip),%rbx
mov    %rbx,%rsi
call   1050 <printf@plt>
xor    %edi,%edi
call   1030 <decsasd@plt>
lea    0xe5c(%rip),%rdi
mov    %rbx,%rsi
call   1050 <printf@plt>
xor    %eax,%eax
call   1090 <holdit@plt>
xor    %edi,%edi
call   1060 <decssdt@plt>
lea    0xe54(%rip),%rdi
call   1080 <println@plt>
xor    %eax,%eax
call   1090 <holdit@plt>
mov    $0x1,%edi
call   1060 <decssdt@plt>
lea    0xe56(%rip),%rdi
call   1080 <println@plt>
xor    %eax,%eax
call   1090 <holdit@plt>
xor    %eax,%eax
call   1040 <restore_status@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@simple_statusline.text = internal global [24 x i8] c"TEXT IN THE STATUS LINE\00"
@.str = [41 x i8] c"This is a simple test of the status-line\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [3 x i8] c"%s\00"
@.str.3 = [21 x i8] c"There should be %s\0D\0A\00"
@.str.4 = [31 x i8] c"There should be no status line\00"
@.str.5 = [51 x i8] c"The status line should be normal (i.e., indicator)\00"
define i32 @simple_statusline(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @vt_move(i32 1, i32 1)
%4 = call i32 @println(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @println(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @decssdt(i32 2)
%7 = call i32 @decsasd(i32 1)
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @simple_statusline.text, i64 0, i64 0))
%9 = call i32 @decsasd(i32 0)
%10 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @simple_statusline.text, i64 0, i64 0))
%11 = call i32 (...) @holdit()
%12 = call i32 @decssdt(i32 0)
%13 = call i32 @println(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0))
%14 = call i32 (...) @holdit()
%15 = call i32 @decssdt(i32 1)
%16 = call i32 @println(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.5, i64 0, i64 0))
%17 = call i32 (...) @holdit()
%18 = call i32 (...) @restore_status()
ret i32 0
}

LLVM IR (-O2):
@simple_statusline.text = internal global [24 x i8] c"TEXT IN THE STATUS LINE\00"
@.str = [41 x i8] c"This is a simple test of the status-line\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [3 x i8] c"%s\00"
@.str.3 = [21 x i8] c"There should be %s\0D\0A\00"
@.str.4 = [31 x i8] c"There should be no status line\00"
@.str.5 = [51 x i8] c"The status line should be normal (i.e., indicator)\00"
define i32 @simple_statusline(i8* nocapture readnone %0) {
%2 = tail call i32 @vt_move(i32 1, i32 1)
%3 = tail call i32 @println(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @println(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @decssdt(i32 2)
%6 = tail call i32 @decsasd(i32 1)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @simple_statusline.text, i64 0, i64 0))
%8 = tail call i32 @decsasd(i32 0)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @simple_statusline.text, i64 0, i64 0))
%10 = tail call i32 (...) @holdit()
%11 = tail call i32 @decssdt(i32 0)
%12 = tail call i32 @println(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0))
%13 = tail call i32 (...) @holdit()
%14 = tail call i32 @decssdt(i32 1)
%15 = tail call i32 @println(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.5, i64 0, i64 0))
%16 = tail call i32 (...) @holdit()
%17 = tail call i32 (...) @restore_status()
ret i32 0
}