#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*/ getch();
int /*<<< orphan*/ peek(short);
int /*<<< orphan*/ puthex(int /*<<< orphan*/);
int /*<<< orphan*/ puthex_b(short);
int /*<<< orphan*/ puts0(char *);
void vectors(void) {
  short int i;
  for (i = 0; i < 128 + 25; i++) {
    puthex_b(i);
    puts0(" ");
    puthex(peek(i * 4 + 2));
    puts0(":");
    puthex(peek(i * 4));
    if ((i + 1) % 6 == 0)
      puts0("\r\n");
    else
      puts0(" ");
    if (i == (128 + 14)) {
      puts0("PressAnyKey");
      getch();
      puts0("\r\n");
    }
  }
}


x86 assembly (clang, -O0):
<vectors>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movw   $0x0,-0x2(%rbp)
movswl -0x2(%rbp),%eax
cmp    $0x99,%eax
jge    1236 <vectors+0xe6>
movswl -0x2(%rbp),%edi
call   1040 <puthex_b@plt>
lea    0xe83(%rip),%rdi
call   1070 <puts0@plt>
movswl -0x2(%rbp),%eax
shl    $0x2,%eax
add    $0x2,%eax
movswl %ax,%edi
call   1030 <peek@plt>
mov    %eax,%edi
call   1050 <puthex@plt>
lea    0xe60(%rip),%rdi
call   1070 <puts0@plt>
movswl -0x2(%rbp),%eax
shl    $0x2,%eax
movswl %ax,%edi
call   1030 <peek@plt>
mov    %eax,%edi
call   1050 <puthex@plt>
movswl -0x2(%rbp),%eax
add    $0x1,%eax
mov    $0x6,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11e6 <vectors+0x96>
lea    0xe28(%rip),%rdi
call   1070 <puts0@plt>
jmp    11f2 <vectors+0xa2>
lea    0xe13(%rip),%rdi
call   1070 <puts0@plt>
movswl -0x2(%rbp),%eax
cmp    $0x8e,%eax
jne    1220 <vectors+0xd0>
lea    0xdff(%rip),%rdi
call   1070 <puts0@plt>
mov    $0x0,%al
call   1060 <getch@plt>
lea    0xde9(%rip),%rdi
call   1070 <puts0@plt>
jmp    1225 <vectors+0xd5>
mov    -0x2(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x2(%rbp)
jmp    115e <vectors+0xe>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vectors>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    $0x1,%bx
lea    0xe9a(%rip),%r13
xor    %r12d,%r12d
xor    %r14d,%r14d
jmp    118a <vectors+0x3a>
xchg   %ax,%ax
add    $0x4,%r12d
add    $0x1,%ebx
add    $0x1,%r14d
movzwl %r12w,%eax
cmp    $0x264,%eax
je     122d <vectors+0xdd>
movzwl %bx,%eax
imul   $0xaaab,%eax,%eax
shr    $0x12,%eax
lea    (%rax,%rax,2),%eax
lea    -0x4(,%rax,8),%r15d
ff
movswl %r14w,%edi
call   1040 <puthex_b@plt>
mov    %r13,%rdi
call   1070 <puts0@plt>
lea    0x2(%r12),%eax
movswl %ax,%edi
call   1030 <peek@plt>
mov    %eax,%edi
call   1050 <puthex@plt>
lea    0xe35(%rip),%rdi
call   1070 <puts0@plt>
movswl %r12w,%ebp
mov    %ebp,%edi
call   1030 <peek@plt>
mov    %eax,%edi
call   1050 <puthex@plt>
cmp    %bp,%r15w
mov    %r13,%rdi
lea    0xe12(%rip),%rax
cmove  %rax,%rdi
call   1070 <puts0@plt>
movzwl %bp,%eax
cmp    $0x238,%eax
jne    1170 <vectors+0x20>
lea    0xdf7(%rip),%rdi
call   1070 <puts0@plt>
xor    %eax,%eax
call   1060 <getch@plt>
lea    0xde1(%rip),%rdi
call   1070 <puts0@plt>
jmp    1170 <vectors+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
@.str.1 = [2 x i8] c":\00"
@.str.2 = [3 x i8] c"\0D\0A\00"
@.str.3 = [12 x i8] c"PressAnyKey\00"
define void @vectors() {
%1 = alloca i16
store i16 0, i16* %1
br label %2
2: ; preds = %42, %0
%3 = load i16, i16* %1
%4 = sext i16 %3 to i32
%5 = icmp slt i32 %4, 153
br i1 %5, label %6, label %45
6: ; preds = %2
%7 = load i16, i16* %1
%8 = call i32 @puthex_b(i16 signext %7)
%9 = call i32 @puts0(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%10 = load i16, i16* %1
%11 = sext i16 %10 to i32
%12 = mul nsw i32 %11, 4
%13 = add nsw i32 %12, 2
%14 = trunc i32 %13 to i16
%15 = call i32 @peek(i16 signext %14)
%16 = call i32 @puthex(i32 %15)
%17 = call i32 @puts0(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%18 = load i16, i16* %1
%19 = sext i16 %18 to i32
%20 = mul nsw i32 %19, 4
%21 = trunc i32 %20 to i16
%22 = call i32 @peek(i16 signext %21)
%23 = call i32 @puthex(i32 %22)
%24 = load i16, i16* %1
%25 = sext i16 %24 to i32
%26 = add nsw i32 %25, 1
%27 = srem i32 %26, 6
%28 = icmp eq i32 %27, 0
br i1 %28, label %29, label %31
29: ; preds = %6
%30 = call i32 @puts0(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %33
31: ; preds = %6
%32 = call i32 @puts0(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %33
33: ; preds = %31, %29
%34 = load i16, i16* %1
%35 = sext i16 %34 to i32
%36 = icmp eq i32 %35, 142
br i1 %36, label %37, label %41
37: ; preds = %33
%38 = call i32 @puts0(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%39 = call i32 (...) @getch()
%40 = call i32 @puts0(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %41
41: ; preds = %37, %33
br label %42
42: ; preds = %41
%43 = load i16, i16* %1
%44 = add i16 %43, 1
store i16 %44, i16* %1
br label %2
45: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
@.str.1 = [2 x i8] c":\00"
@.str.2 = [3 x i8] c"\0D\0A\00"
@.str.3 = [12 x i8] c"PressAnyKey\00"
define void @vectors() {
br label %1
1: ; preds = %0, %22
%2 = phi i16 [ 0, %0 ], [ %12, %22 ]
%3 = tail call i32 @puthex_b(i16 signext %2)
%4 = tail call i32 @puts0(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = shl i16 %2, 2
%6 = or i16 %5, 2
%7 = tail call i32 @peek(i16 signext %6)
%8 = tail call i32 @puthex(i32 %7)
%9 = tail call i32 @puts0(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%10 = tail call i32 @peek(i16 signext %5)
%11 = tail call i32 @puthex(i32 %10)
%12 = add nuw nsw i16 %2, 1
%13 = urem i16 %12, 6
%14 = icmp eq i16 %13, 0
%15 = select i1 %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
%16 = tail call i32 @puts0(i8* %15)
%17 = icmp eq i16 %2, 142
br i1 %17, label %18, label %22
18: ; preds = %1
%19 = tail call i32 @puts0(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%20 = tail call i32 (...) @getch()
%21 = tail call i32 @puts0(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %22
22: ; preds = %1, %18
%23 = icmp eq i16 %12, 153
br i1 %23, label %24, label %1
24: ; preds = %22
ret void
}