#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*/ printf(char *, ...);
void print_window(int *window, int win_edge) {
  printf("[");
  int i;
  for (i = 0; i < 4 * 2; i++) {
    printf("%c", window[i]);
    if (i == 4 - 1) {
      printf("||");
    } else if (i == 4 * 2 - 1) {
      printf("] %-2d\n", win_edge);
    } else {
      printf("|");
    }
  }
}


x86 assembly (clang, -O0):
<print_window>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
cmpl   $0x8,-0x10(%rbp)
jge    11ba <print_window+0xaa>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x3,-0x10(%rbp)
jne    1174 <print_window+0x64>
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11a7 <print_window+0x97>
cmpl   $0x7,-0x10(%rbp)
jne    1194 <print_window+0x84>
mov    -0xc(%rbp),%esi
lea    0xe80(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11a2 <print_window+0x92>
lea    0xe6b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11a7 <print_window+0x97>
jmp    11ac <print_window+0x9c>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1134 <print_window+0x24>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_window>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    $0x5b,%edi
call   1030 <putchar@plt>
mov    (%rbx),%edi
call   1030 <putchar@plt>
mov    $0x7c,%edi
call   1030 <putchar@plt>
mov    0x4(%rbx),%edi
call   1030 <putchar@plt>
mov    $0x7c,%edi
call   1030 <putchar@plt>
mov    0x8(%rbx),%edi
call   1030 <putchar@plt>
mov    $0x7c,%edi
call   1030 <putchar@plt>
mov    0xc(%rbx),%edi
call   1030 <putchar@plt>
lea    0xe8a(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%rbx),%edi
call   1030 <putchar@plt>
mov    $0x7c,%edi
call   1030 <putchar@plt>
mov    0x14(%rbx),%edi
call   1030 <putchar@plt>
mov    $0x7c,%edi
call   1030 <putchar@plt>
mov    0x18(%rbx),%edi
call   1030 <putchar@plt>
mov    $0x7c,%edi
call   1030 <putchar@plt>
mov    0x1c(%rbx),%edi
call   1030 <putchar@plt>
lea    0xe41(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"[\00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [3 x i8] c"||\00"
@.str.3 = [8 x i8] c"] %-2d\0A\00"
@.str.4 = [2 x i8] c"|\00"
define void @print_window(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %5
br label %7
7: ; preds = %31, %2
%8 = load i32, i32* %5
%9 = icmp slt i32 %8, 8
br i1 %9, label %10, label %34
10: ; preds = %7
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %15)
%17 = load i32, i32* %5
%18 = icmp eq i32 %17, 3
br i1 %18, label %19, label %21
19: ; preds = %10
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %30
21: ; preds = %10
%22 = load i32, i32* %5
%23 = icmp eq i32 %22, 7
br i1 %23, label %24, label %27
24: ; preds = %21
%25 = load i32, i32* %4
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 %25)
br label %29
27: ; preds = %21
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %29
29: ; preds = %27, %24
br label %30
30: ; preds = %29, %19
br label %31
31: ; preds = %30
%32 = load i32, i32* %5
%33 = add nsw i32 %32, 1
store i32 %33, i32* %5
br label %7
34: ; preds = %7
ret void
}

LLVM IR (-O2):
@.str.2 = [3 x i8] c"||\00"
@.str.3 = [8 x i8] c"] %-2d\0A\00"
define void @print_window(i32* nocapture %0, i32 %1) {
%3 = tail call i32 @putchar(i32 91)
%4 = load i32, i32* %0
%5 = tail call i32 @putchar(i32 %4)
%6 = tail call i32 @putchar(i32 124)
%7 = getelementptr inbounds i32, i32* %0, i64 1
%8 = load i32, i32* %7
%9 = tail call i32 @putchar(i32 %8)
%10 = tail call i32 @putchar(i32 124)
%11 = getelementptr inbounds i32, i32* %0, i64 2
%12 = load i32, i32* %11
%13 = tail call i32 @putchar(i32 %12)
%14 = tail call i32 @putchar(i32 124)
%15 = getelementptr inbounds i32, i32* %0, i64 3
%16 = load i32, i32* %15
%17 = tail call i32 @putchar(i32 %16)
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%19 = getelementptr inbounds i32, i32* %0, i64 4
%20 = load i32, i32* %19
%21 = tail call i32 @putchar(i32 %20)
%22 = tail call i32 @putchar(i32 124)
%23 = getelementptr inbounds i32, i32* %0, i64 5
%24 = load i32, i32* %23
%25 = tail call i32 @putchar(i32 %24)
%26 = tail call i32 @putchar(i32 124)
%27 = getelementptr inbounds i32, i32* %0, i64 6
%28 = load i32, i32* %27
%29 = tail call i32 @putchar(i32 %28)
%30 = tail call i32 @putchar(i32 124)
%31 = getelementptr inbounds i32, i32* %0, i64 7
%32 = load i32, i32* %31
%33 = tail call i32 @putchar(i32 %32)
%34 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 %1)
ret void
}