#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*/ gclrline();
int /*<<< orphan*/ gmove(int, int);
void clearstat(int mode) {
  if (mode == -1) {
    gmove(20, 1);
    gclrline();
    gmove(21, 1);
    gclrline();
    gmove(22, 1);
    gclrline();
    gmove(23, 1);
    gclrline();
  } else {
    gmove(20 + mode, 1);
    gclrline();
  }
}


x86 assembly (clang, -O0):
<clearstat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
jne    1192 <clearstat+0x72>
mov    $0x14,%edi
mov    $0x1,%esi
call   1040 <gmove@plt>
mov    $0x0,%al
call   1030 <gclrline@plt>
mov    $0x15,%edi
mov    $0x1,%esi
call   1040 <gmove@plt>
mov    $0x0,%al
call   1030 <gclrline@plt>
mov    $0x16,%edi
mov    $0x1,%esi
call   1040 <gmove@plt>
mov    $0x0,%al
call   1030 <gclrline@plt>
mov    $0x17,%edi
mov    $0x1,%esi
call   1040 <gmove@plt>
mov    $0x0,%al
call   1030 <gclrline@plt>
jmp    11a9 <clearstat+0x89>
mov    -0x4(%rbp),%edi
add    $0x14,%edi
mov    $0x1,%esi
call   1040 <gmove@plt>
mov    $0x0,%al
call   1030 <gclrline@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clearstat>:
push   %rax
cmp    $0xffffffff,%edi
je     112b <clearstat+0xb>
add    $0x14,%edi
jmp    1172 <clearstat+0x52>
mov    $0x14,%edi
mov    $0x1,%esi
call   1040 <gmove@plt>
xor    %eax,%eax
call   1030 <gclrline@plt>
mov    $0x15,%edi
mov    $0x1,%esi
call   1040 <gmove@plt>
xor    %eax,%eax
call   1030 <gclrline@plt>
mov    $0x16,%edi
mov    $0x1,%esi
call   1040 <gmove@plt>
xor    %eax,%eax
call   1030 <gclrline@plt>
mov    $0x17,%edi
mov    $0x1,%esi
call   1040 <gmove@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <gclrline@plt>

LLVM IR (-O0):
define void @clearstat(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %14
5: ; preds = %1
%6 = call i32 @gmove(i32 20, i32 1)
%7 = call i32 (...) @gclrline()
%8 = call i32 @gmove(i32 21, i32 1)
%9 = call i32 (...) @gclrline()
%10 = call i32 @gmove(i32 22, i32 1)
%11 = call i32 (...) @gclrline()
%12 = call i32 @gmove(i32 23, i32 1)
%13 = call i32 (...) @gclrline()
br label %19
14: ; preds = %1
%15 = load i32, i32* %2
%16 = add nsw i32 20, %15
%17 = call i32 @gmove(i32 %16, i32 1)
%18 = call i32 (...) @gclrline()
br label %19
19: ; preds = %14, %5
ret void
}

LLVM IR (-O2):
define void @clearstat(i32 %0) {
%2 = icmp eq i32 %0, -1
br i1 %2, label %3, label %10
3: ; preds = %1
%4 = tail call i32 @gmove(i32 20, i32 1)
%5 = tail call i32 (...) @gclrline()
%6 = tail call i32 @gmove(i32 21, i32 1)
%7 = tail call i32 (...) @gclrline()
%8 = tail call i32 @gmove(i32 22, i32 1)
%9 = tail call i32 (...) @gclrline()
br label %12
10: ; preds = %1
%11 = add nsw i32 %0, 20
br label %12
12: ; preds = %10, %3
%13 = phi i32 [ %11, %10 ], [ 23, %3 ]
%14 = tail call i32 @gmove(i32 %13, i32 1)
%15 = tail call i32 (...) @gclrline()
ret void
}