#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 outputLine(long *ar, int left, int store, int idx, int right) {
  int i;
  for (i = left; i <= right; i++) {
    printf("|");
    if (i == store) {
      printf("s");
    } else if (i == idx) {
      printf("i");
    } else {
      printf(" ");
    }
    printf("%02ld ", ar[i]);
  }
  printf("|\n");
}


x86 assembly (clang, -O0):
<outputLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jg     11c2 <outputLine+0xb2>
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    1168 <outputLine+0x58>
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    119a <outputLine+0x8a>
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jne    1187 <outputLine+0x77>
lea    0xe89(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1195 <outputLine+0x85>
lea    0xe7d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    119a <outputLine+0x8a>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xe59(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    112f <outputLine+0x1f>
lea    0xe44(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outputLine>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
cmp    %r8d,%esi
jg     11b1 <outputLine+0x81>
mov    %r8d,%r13d
movslq %esi,%rax
movslq %ecx,%r15
movslq %edx,%r12
sub    %rax,%r12
sub    %rax,%r15
lea    (%rdi,%rax,8),%rbx
sub    %esi,%r13d
add    $0x1,%r13d
lea    0xe9c(%rip),%r14
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
mov    $0x7c,%edi
call   1030 <putchar@plt>
cmp    %rbp,%r15
mov    $0x20,%edi
mov    $0x69,%eax
cmove  %eax,%edi
cmp    %rbp,%r12
mov    $0x73,%eax
cmove  %eax,%edi
call   1030 <putchar@plt>
mov    (%rbx,%rbp,8),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbp
cmp    %ebp,%r13d
jne    1170 <outputLine+0x40>
lea    0xe4f(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <puts@plt>

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

LLVM IR (-O2):
@.str.4 = [7 x i8] c"%02ld \00"
@str = [2 x i8] c"|\00"
define void @outputLine(i64* nocapture %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = icmp sgt i32 %1, %4
br i1 %6, label %26, label %7
7: ; preds = %5
%8 = sext i32 %1 to i64
%9 = sext i32 %3 to i64
%10 = sext i32 %2 to i64
%11 = add i32 %4, 1
br label %12
12: ; preds = %7, %12
%13 = phi i64 [ %8, %7 ], [ %23, %12 ]
%14 = tail call i32 @putchar(i32 124)
%15 = icmp eq i64 %13, %10
%16 = icmp eq i64 %13, %9
%17 = select i1 %16, i32 105, i32 32
%18 = select i1 %15, i32 115, i32 %17
%19 = tail call i32 @putchar(i32 %18)
%20 = getelementptr inbounds i64, i64* %0, i64 %13
%21 = load i64, i64* %20
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i64 %21)
%23 = add nsw i64 %13, 1
%24 = trunc i64 %23 to i32
%25 = icmp eq i32 %11, %24
br i1 %25, label %26, label %12
26: ; preds = %12, %5
%27 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret void
}