#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 cdops_disc_status();
int /*<<< orphan*/ clrscr(int);
int /*<<< orphan*/ printat(int /*<<< orphan*/, int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ run_cdda_test();
void run_test() {
  for (;;) {
    clrscr(0x1f);
    printat(0, 0, "");
    if ((cdops_disc_status() & 0xf) >= 6) {
      printf("Please insert an audio disc");
      while ((cdops_disc_status() & 0xf) >= 6)
        ;
    } else {
      while ((cdops_disc_status() & 0xf) == 0)
        ;
      run_cdda_test();
      while ((cdops_disc_status() & 0xf) < 6)
        ;
    }
  }
}


x86 assembly (clang, -O0):
<run_test>:
push   %rbp
mov    %rsp,%rbp
jmp    1159 <run_test+0x9>
mov    $0x1f,%edi
call   1030 <clrscr@plt>
xor    %esi,%esi
lea    0xeaf(%rip),%rdx
mov    %esi,%edi
call   1050 <printat@plt>
mov    $0x0,%al
call   1060 <cdops_disc_status@plt>
and    $0xf,%eax
cmp    $0x6,%eax
jl     11af <run_test+0x5f>
lea    0xe73(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <cdops_disc_status@plt>
and    $0xf,%eax
cmp    $0x6,%eax
jl     11aa <run_test+0x5a>
jmp    1192 <run_test+0x42>
jmp    11f0 <run_test+0xa0>
jmp    11b4 <run_test+0x64>
mov    $0x0,%al
call   1060 <cdops_disc_status@plt>
and    $0xf,%eax
cmp    $0x0,%eax
jne    11cc <run_test+0x7c>
jmp    11b4 <run_test+0x64>
mov    $0x0,%al
call   1070 <run_cdda_test@plt>
mov    $0x0,%al
call   1060 <cdops_disc_status@plt>
and    $0xf,%eax
cmp    $0x6,%eax
jge    11eb <run_test+0x9b>
jmp    11d3 <run_test+0x83>
jmp    11f0 <run_test+0xa0>
jmp    1159 <run_test+0x9>

x86 assembly (clang, -O2):
<run_test>:
push   %r14
push   %rbx
push   %rax
lea    0xec0(%rip),%rbx
lea    0xe9e(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x1f,%edi
call   1030 <clrscr@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    %rbx,%rdx
call   1050 <printat@plt>
xor    %eax,%eax
call   1060 <cdops_disc_status@plt>
and    $0xe,%eax
cmp    $0x5,%eax
jbe    11c0 <run_test+0x70>
mov    %r14,%rdi
call   1040 <printf@plt>
nopl   (%rax)
xor    %eax,%eax
call   1060 <cdops_disc_status@plt>
and    $0xe,%eax
cmp    $0x5,%eax
ja     11a0 <run_test+0x50>
jmp    1170 <run_test+0x20>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1060 <cdops_disc_status@plt>
test   $0xf,%al
je     11c0 <run_test+0x70>
xor    %eax,%eax
call   1070 <run_cdda_test@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1060 <cdops_disc_status@plt>
and    $0xe,%eax
cmp    $0x6,%eax
jb     11e0 <run_test+0x90>
jmp    1170 <run_test+0x20>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [28 x i8] c"Please insert an audio disc\00"
define void @run_test() {
br label %1
1: ; preds = %29, %0
%2 = call i32 @clrscr(i32 31)
%3 = call i32 @printat(i32 0, i32 0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @cdops_disc_status()
%5 = and i32 %4, 15
%6 = icmp sge i32 %5, 6
br i1 %6, label %7, label %15
7: ; preds = %1
%8 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %13, %7
%10 = call i32 (...) @cdops_disc_status()
%11 = and i32 %10, 15
%12 = icmp sge i32 %11, 6
br i1 %12, label %13, label %14
13: ; preds = %9
br label %9
14: ; preds = %9
br label %29
15: ; preds = %1
br label %16
16: ; preds = %20, %15
%17 = call i32 (...) @cdops_disc_status()
%18 = and i32 %17, 15
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %16
br label %16
21: ; preds = %16
%22 = call i32 (...) @run_cdda_test()
br label %23
23: ; preds = %27, %21
%24 = call i32 (...) @cdops_disc_status()
%25 = and i32 %24, 15
%26 = icmp slt i32 %25, 6
br i1 %26, label %27, label %28
27: ; preds = %23
br label %23
28: ; preds = %23
br label %29
29: ; preds = %28, %14
br label %1
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [28 x i8] c"Please insert an audio disc\00"
define void @run_test() {
br label %2
1: ; preds = %20, %10
br label %2
2: ; preds = %1, %0
%3 = tail call i32 @clrscr(i32 31)
%4 = tail call i32 @printat(i32 0, i32 0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 (...) @cdops_disc_status()
%6 = and i32 %5, 14
%7 = icmp ugt i32 %6, 5
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %10, %8
%11 = tail call i32 (...) @cdops_disc_status()
%12 = and i32 %11, 14
%13 = icmp ugt i32 %12, 5
br i1 %13, label %10, label %1
14: ; preds = %2, %14
%15 = tail call i32 (...) @cdops_disc_status()
%16 = and i32 %15, 15
%17 = icmp eq i32 %16, 0
br i1 %17, label %14, label %18
18: ; preds = %14
%19 = tail call i32 (...) @run_cdda_test()
br label %20
20: ; preds = %20, %18
%21 = tail call i32 (...) @cdops_disc_status()
%22 = and i32 %21, 14
%23 = icmp ult i32 %22, 6
br i1 %23, label %20, label %1
}