#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 */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
int main() {
  char buf[256];
  int i = 0;
  for (i = 250; i >= 0; i--)
    buf[i] = (char)255 - i;
  write(1, buf, sizeof(buf));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x114(%rbp)
movl   $0xfa,-0x114(%rbp)
cmpl   $0x0,-0x114(%rbp)
jl     1172 <main+0x62>
mov    $0xffffffff,%eax
sub    -0x114(%rbp),%eax
mov    %al,%cl
movslq -0x114(%rbp),%rax
mov    %cl,-0x110(%rbp,%rax,1)
mov    -0x114(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x114(%rbp)
jmp    1136 <main+0x26>
lea    -0x110(%rbp),%rsi
mov    $0x1,%edi
mov    $0x100,%edx
call   1030 <write@plt>
xor    %eax,%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x108,%rsp
movdqa 0xee1(%rip),%xmm0
mov    $0xf0,%eax
pcmpeqd %xmm1,%xmm1
pxor   %xmm2,%xmm2
movdqa 0xedc(%rip),%xmm3
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movdqa %xmm0,%xmm4
pxor   %xmm1,%xmm4
movdqa %xmm4,%xmm5
punpcklbw %xmm2,%xmm5
pshufd $0x4e,%xmm5,%xmm5
pshuflw $0x1b,%xmm5,%xmm5
pshufhw $0x1b,%xmm5,%xmm5
punpckhbw %xmm2,%xmm4
pshufd $0x4e,%xmm4,%xmm4
pshuflw $0x1b,%xmm4,%xmm4
pshufhw $0x1b,%xmm4,%xmm4
packuswb %xmm5,%xmm4
movdqu %xmm4,-0x5(%rsp,%rax,1)
paddb  %xmm3,%xmm0
add    $0xfffffffffffffff0,%rax
jne    1140 <main+0x30>
movb   $0xf5,0xa(%rsp)
movw   $0xf6f7,0x8(%rsp)
movabs $0xf8f9fafbfcfdfeff,%rax
fa f9 f8
mov    %rax,(%rsp)
mov    %rsp,%rsi
mov    $0x1,%edi
mov    $0x100,%edx
call   1030 <write@plt>
xor    %eax,%eax
add    $0x108,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [256 x i8]
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
store i32 250, i32* %3
br label %4
4: ; preds = %14, %0
%5 = load i32, i32* %3
%6 = icmp sge i32 %5, 0
br i1 %6, label %7, label %17
7: ; preds = %4
%8 = load i32, i32* %3
%9 = sub nsw i32 -1, %8
%10 = trunc i32 %9 to i8
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 %12
store i8 %10, i8* %13
br label %14
14: ; preds = %7
%15 = load i32, i32* %3
%16 = add nsw i32 %15, -1
store i32 %16, i32* %3
br label %4
17: ; preds = %4
%18 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%19 = call i32 @write(i32 1, i8* %18, i32 256)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
br label %3
3: ; preds = %3, %0
%4 = phi i64 [ 0, %0 ], [ %12, %3 ]
%5 = phi <16 x i8> [ <i8 -6, i8 -7, i8 -8, i8 -9, i8 -10, i8 -11, i8 -12, i8 -13, i8 -14, i8 -15, i8 -16, i8 -17, i8 -18, i8 -19, i8 -20, i8 -21>, %0 ], [ %13, %3 ]
%6 = sub i64 250, %4
%7 = xor <16 x i8> %5, <i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1>
%8 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 %6
%9 = shufflevector <16 x i8> %7, <16 x i8> poison, <16 x i32> <i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
%10 = getelementptr inbounds i8, i8* %8, i64 -15
%11 = bitcast i8* %10 to <16 x i8>*
store <16 x i8> %9, <16 x i8>* %11
%12 = add nuw i64 %4, 16
%13 = add <16 x i8> %5, <i8 -16, i8 -16, i8 -16, i8 -16, i8 -16, i8 -16, i8 -16, i8 -16, i8 -16, i8 -16, i8 -16, i8 -16, i8 -16, i8 -16, i8 -16, i8 -16>
%14 = icmp eq i64 %12, 240
br i1 %14, label %15, label %3
15: ; preds = %3
%16 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 10
store i8 -11, i8* %16
%17 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 9
store i8 -10, i8* %17
%18 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 8
store i8 -9, i8* %18
%19 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 7
store i8 -8, i8* %19
%20 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 6
store i8 -7, i8* %20
%21 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 5
store i8 -6, i8* %21
%22 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 4
store i8 -5, i8* %22
%23 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 3
store i8 -4, i8* %23
%24 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 2
store i8 -3, i8* %24
%25 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 1
store i8 -2, i8* %25
%26 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
store i8 -1, i8* %26
%27 = call i32 @write(i32 1, i8* %2, i32 256)
ret i32 0
}