#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*/ decll(char const *);
int /*<<< orphan*/ holdit();
int /*<<< orphan*/ printf(char *, char const *);
int /*<<< orphan*/ println(char *);
int /*<<< orphan*/ vt_clear(int);
int /*<<< orphan*/ vt_el(int /*<<< orphan*/);
int /*<<< orphan*/ vt_move(int, int);
int tst_LED_Lights(const char *the_title) {
  int i;
  const char *ledmsg[6], *ledseq[6];
  ledmsg[0] = "L1 L2 L3 L4";
  ledseq[0] = "1;2;3;4";
  ledmsg[1] = "   L2 L3 L4";
  ledseq[1] = "1;0;4;3;2";
  ledmsg[2] = "   L2 L3";
  ledseq[2] = "1;4;;2;3";
  ledmsg[3] = "L1 L2";
  ledseq[3] = ";;2;1";
  ledmsg[4] = "L1";
  ledseq[4] = "1";
  ledmsg[5] = "";
  ledseq[5] = "";
  vt_clear(2);
  vt_move(10, 1);
  println("These LEDs (\"lamps\") on the keyboard should be on:");
  for (i = 0; i <= 5; i++) {
    vt_move(10, 52);
    vt_el(0);
    printf("%s", ledmsg[i]);
    decll("0");
    decll(ledseq[i]);
    vt_move(12, 1);
    holdit();
  }
  decll("0");
  return 0;
}


x86 assembly (clang, -O0):
<tst_LED_Lights>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xe7d(%rip),%rax
mov    %rax,-0x40(%rbp)
lea    0xe7e(%rip),%rax
mov    %rax,-0x70(%rbp)
lea    0xe7b(%rip),%rax
mov    %rax,-0x38(%rbp)
lea    0xe7c(%rip),%rax
mov    %rax,-0x68(%rbp)
lea    0xe7b(%rip),%rax
mov    %rax,-0x30(%rbp)
lea    0xe79(%rip),%rax
mov    %rax,-0x60(%rbp)
lea    0xe77(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0xe72(%rip),%rax
mov    %rax,-0x58(%rbp)
lea    0xe6d(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0xe60(%rip),%rax
mov    %rax,-0x50(%rbp)
lea    0xe91(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xe86(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    $0x2,%edi
call   1030 <vt_clear@plt>
mov    $0xa,%edi
mov    $0x1,%esi
call   1060 <vt_move@plt>
lea    0xe2b(%rip),%rdi
call   1070 <println@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jg     129f <tst_LED_Lights+0x12f>
mov    $0xa,%edi
mov    $0x34,%esi
call   1060 <vt_move@plt>
xor    %edi,%edi
call   1080 <vt_el@plt>
movslq -0xc(%rbp),%rax
mov    -0x40(%rbp,%rax,8),%rsi
lea    0xe22(%rip),%rdi
call   1050 <printf@plt>
lea    0xe19(%rip),%rdi
call   1040 <decll@plt>
movslq -0xc(%rbp),%rax
mov    -0x70(%rbp,%rax,8),%rdi
call   1040 <decll@plt>
mov    $0xc,%edi
mov    $0x1,%esi
call   1060 <vt_move@plt>
mov    $0x0,%al
call   1090 <holdit@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    122c <tst_LED_Lights+0xbc>
lea    0xddb(%rip),%rdi
call   1040 <decll@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tst_LED_Lights>:
push   %r15
push   %r14
push   %rbx
mov    $0x2,%edi
call   1030 <vt_clear@plt>
mov    $0xa,%edi
mov    $0x1,%esi
call   1060 <vt_move@plt>
lea    0xeb6(%rip),%rdi
call   1070 <println@plt>
mov    $0xa,%edi
mov    $0x34,%esi
call   1060 <vt_move@plt>
xor    %edi,%edi
call   1080 <vt_el@plt>
lea    0xec7(%rip),%r14
lea    0xe42(%rip),%rsi
mov    %r14,%rdi
call   1050 <printf@plt>
lea    0xeb4(%rip),%r15
mov    %r15,%rdi
call   1040 <decll@plt>
lea    0xe30(%rip),%rdi
call   1040 <decll@plt>
mov    $0xc,%edi
mov    $0x1,%esi
call   1060 <vt_move@plt>
xor    %eax,%eax
call   1090 <holdit@plt>
mov    $0xa,%edi
mov    $0x34,%esi
call   1060 <vt_move@plt>
xor    %edi,%edi
call   1080 <vt_el@plt>
lea    0xe00(%rip),%rsi
mov    %r14,%rdi
call   1050 <printf@plt>
mov    %r15,%rdi
call   1040 <decll@plt>
lea    0xdf5(%rip),%rdi
call   1040 <decll@plt>
mov    $0xc,%edi
mov    $0x1,%esi
call   1060 <vt_move@plt>
xor    %eax,%eax
call   1090 <holdit@plt>
mov    $0xa,%edi
mov    $0x34,%esi
call   1060 <vt_move@plt>
xor    %edi,%edi
call   1080 <vt_el@plt>
lea    0xdc7(%rip),%rsi
mov    %r14,%rdi
call   1050 <printf@plt>
mov    %r15,%rdi
call   1040 <decll@plt>
lea    0xdb9(%rip),%rdi
call   1040 <decll@plt>
mov    $0xc,%edi
mov    $0x1,%esi
call   1060 <vt_move@plt>
xor    %eax,%eax
call   1090 <holdit@plt>
mov    $0xa,%edi
mov    $0x34,%esi
call   1060 <vt_move@plt>
xor    %edi,%edi
call   1080 <vt_el@plt>
lea    0xd8a(%rip),%rsi
mov    %r14,%rdi
call   1050 <printf@plt>
mov    %r15,%rdi
call   1040 <decll@plt>
lea    0xd79(%rip),%rdi
call   1040 <decll@plt>
mov    $0xc,%edi
mov    $0x1,%esi
call   1060 <vt_move@plt>
xor    %eax,%eax
call   1090 <holdit@plt>
mov    $0xa,%edi
mov    $0x34,%esi
call   1060 <vt_move@plt>
xor    %edi,%edi
call   1080 <vt_el@plt>
lea    0xd47(%rip),%rsi
mov    %r14,%rdi
call   1050 <printf@plt>
mov    %r15,%rdi
call   1040 <decll@plt>
lea    0xd2e(%rip),%rdi
call   1040 <decll@plt>
mov    $0xc,%edi
mov    $0x1,%esi
call   1060 <vt_move@plt>
xor    %eax,%eax
call   1090 <holdit@plt>
mov    $0xa,%edi
mov    $0x34,%esi
call   1060 <vt_move@plt>
xor    %edi,%edi
call   1080 <vt_el@plt>
lea    0xd32(%rip),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <printf@plt>
mov    %r15,%rdi
call   1040 <decll@plt>
mov    %rbx,%rdi
call   1040 <decll@plt>
mov    $0xc,%edi
mov    $0x1,%esi
call   1060 <vt_move@plt>
xor    %eax,%eax
call   1090 <holdit@plt>
mov    %r15,%rdi
call   1040 <decll@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [12 x i8] c"L1 L2 L3 L4\00"
@.str.1 = [8 x i8] c"1;2;3;4\00"
@.str.2 = [12 x i8] c" L2 L3 L4\00"
@.str.3 = [10 x i8] c"1;0;4;3;2\00"
@.str.4 = [9 x i8] c" L2 L3\00"
@.str.5 = [9 x i8] c"1;4;;2;3\00"
@.str.6 = [6 x i8] c"L1 L2\00"
@.str.7 = [6 x i8] c";;2;1\00"
@.str.8 = [3 x i8] c"L1\00"
@.str.9 = [2 x i8] c"1\00"
@.str.10 = [1 x i8] zeroinitializer
@.str.11 = [51 x i8] c"These LEDs (\22lamps\22) on the keyboard should be on:\00"
@.str.12 = [3 x i8] c"%s\00"
@.str.13 = [2 x i8] c"0\00"
define i32 @tst_LED_Lights(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca [6 x i8*]
%5 = alloca [6 x i8*]
store i8* %0, i8** %2
%6 = getelementptr inbounds [6 x i8*], [6 x i8*]* %4, i64 0, i64 0
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8** %6
%7 = getelementptr inbounds [6 x i8*], [6 x i8*]* %5, i64 0, i64 0
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8** %7
%8 = getelementptr inbounds [6 x i8*], [6 x i8*]* %4, i64 0, i64 1
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8** %8
%9 = getelementptr inbounds [6 x i8*], [6 x i8*]* %5, i64 0, i64 1
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8** %9
%10 = getelementptr inbounds [6 x i8*], [6 x i8*]* %4, i64 0, i64 2
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i8** %10
%11 = getelementptr inbounds [6 x i8*], [6 x i8*]* %5, i64 0, i64 2
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i8** %11
%12 = getelementptr inbounds [6 x i8*], [6 x i8*]* %4, i64 0, i64 3
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i8** %12
%13 = getelementptr inbounds [6 x i8*], [6 x i8*]* %5, i64 0, i64 3
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i8** %13
%14 = getelementptr inbounds [6 x i8*], [6 x i8*]* %4, i64 0, i64 4
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i8** %14
%15 = getelementptr inbounds [6 x i8*], [6 x i8*]* %5, i64 0, i64 4
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0), i8** %15
%16 = getelementptr inbounds [6 x i8*], [6 x i8*]* %4, i64 0, i64 5
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.10, i64 0, i64 0), i8** %16
%17 = getelementptr inbounds [6 x i8*], [6 x i8*]* %5, i64 0, i64 5
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.10, i64 0, i64 0), i8** %17
%18 = call i32 @vt_clear(i32 2)
%19 = call i32 @vt_move(i32 10, i32 1)
%20 = call i32 @println(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.11, i64 0, i64 0))
store i32 0, i32* %3
br label %21
21: ; preds = %40, %1
%22 = load i32, i32* %3
%23 = icmp sle i32 %22, 5
br i1 %23, label %24, label %43
24: ; preds = %21
%25 = call i32 @vt_move(i32 10, i32 52)
%26 = call i32 @vt_el(i32 0)
%27 = load i32, i32* %3
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [6 x i8*], [6 x i8*]* %4, i64 0, i64 %28
%30 = load i8*, i8** %29
%31 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), i8* %30)
%32 = call i32 @decll(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
%33 = load i32, i32* %3
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [6 x i8*], [6 x i8*]* %5, i64 0, i64 %34
%36 = load i8*, i8** %35
%37 = call i32 @decll(i8* %36)
%38 = call i32 @vt_move(i32 12, i32 1)
%39 = call i32 (...) @holdit()
br label %40
40: ; preds = %24
%41 = load i32, i32* %3
%42 = add nsw i32 %41, 1
store i32 %42, i32* %3
br label %21
43: ; preds = %21
%44 = call i32 @decll(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"L1 L2 L3 L4\00"
@.str.1 = [8 x i8] c"1;2;3;4\00"
@.str.2 = [12 x i8] c" L2 L3 L4\00"
@.str.3 = [10 x i8] c"1;0;4;3;2\00"
@.str.4 = [9 x i8] c" L2 L3\00"
@.str.5 = [9 x i8] c"1;4;;2;3\00"
@.str.6 = [6 x i8] c"L1 L2\00"
@.str.7 = [6 x i8] c";;2;1\00"
@.str.8 = [3 x i8] c"L1\00"
@.str.9 = [2 x i8] c"1\00"
@.str.10 = [1 x i8] zeroinitializer
@.str.11 = [51 x i8] c"These LEDs (\22lamps\22) on the keyboard should be on:\00"
@.str.12 = [3 x i8] c"%s\00"
@.str.13 = [2 x i8] c"0\00"
define i32 @tst_LED_Lights(i8* nocapture readnone %0) {
%2 = tail call i32 @vt_clear(i32 2)
%3 = tail call i32 @vt_move(i32 10, i32 1)
%4 = tail call i32 @println(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.11, i64 0, i64 0))
%5 = tail call i32 @vt_move(i32 10, i32 52)
%6 = tail call i32 @vt_el(i32 0)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @decll(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
%9 = tail call i32 @decll(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%10 = tail call i32 @vt_move(i32 12, i32 1)
%11 = tail call i32 (...) @holdit()
%12 = tail call i32 @vt_move(i32 10, i32 52)
%13 = tail call i32 @vt_el(i32 0)
%14 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%15 = tail call i32 @decll(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
%16 = tail call i32 @decll(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%17 = tail call i32 @vt_move(i32 12, i32 1)
%18 = tail call i32 (...) @holdit()
%19 = tail call i32 @vt_move(i32 10, i32 52)
%20 = tail call i32 @vt_el(i32 0)
%21 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%22 = tail call i32 @decll(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
%23 = tail call i32 @decll(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0))
%24 = tail call i32 @vt_move(i32 12, i32 1)
%25 = tail call i32 (...) @holdit()
%26 = tail call i32 @vt_move(i32 10, i32 52)
%27 = tail call i32 @vt_el(i32 0)
%28 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%29 = tail call i32 @decll(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
%30 = tail call i32 @decll(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
%31 = tail call i32 @vt_move(i32 12, i32 1)
%32 = tail call i32 (...) @holdit()
%33 = tail call i32 @vt_move(i32 10, i32 52)
%34 = tail call i32 @vt_el(i32 0)
%35 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%36 = tail call i32 @decll(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
%37 = tail call i32 @decll(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%38 = tail call i32 @vt_move(i32 12, i32 1)
%39 = tail call i32 (...) @holdit()
%40 = tail call i32 @vt_move(i32 10, i32 52)
%41 = tail call i32 @vt_el(i32 0)
%42 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.10, i64 0, i64 0))
%43 = tail call i32 @decll(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
%44 = tail call i32 @decll(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.10, i64 0, i64 0))
%45 = tail call i32 @vt_move(i32 12, i32 1)
%46 = tail call i32 (...) @holdit()
%47 = tail call i32 @decll(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
ret i32 0
}