#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*/ write(int, int *, int);
int main(void) {
  int index;
  int nospace;
  nospace = '\n';
  index = '9';
  while (index >= '0') {
    write(1, &index, 1);
    index--;
  }
  write(1, &nospace, 1);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0xc(%rbp)
movl   $0x39,-0x8(%rbp)
cmpl   $0x30,-0x8(%rbp)
jl     1155 <main+0x45>
mov    $0x1,%edx
lea    -0x8(%rbp),%rsi
mov    %edx,%edi
call   1030 <write@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
mov    $0x1,%edx
lea    -0xc(%rbp),%rsi
mov    %edx,%edi
call   1030 <write@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0xa,0xc(%rsp)
movl   $0x39,0x8(%rsp)
lea    0x8(%rsp),%rbx
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
movl   $0x38,0x8(%rsp)
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
movl   $0x37,0x8(%rsp)
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
movl   $0x36,0x8(%rsp)
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
movl   $0x35,0x8(%rsp)
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
movl   $0x34,0x8(%rsp)
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
movl   $0x33,0x8(%rsp)
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
movl   $0x32,0x8(%rsp)
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
movl   $0x31,0x8(%rsp)
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
movl   $0x30,0x8(%rsp)
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
movl   $0x2f,0x8(%rsp)
lea    0xc(%rsp),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
call   1030 <write@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %3
store i32 57, i32* %2
br label %4
4: ; preds = %7, %0
%5 = load i32, i32* %2
%6 = icmp sge i32 %5, 48
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = call i32 @write(i32 1, i32* %2, i32 1)
%9 = load i32, i32* %2
%10 = add nsw i32 %9, -1
store i32 %10, i32* %2
br label %4
11: ; preds = %4
%12 = call i32 @write(i32 1, i32* %3, i32 1)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
store i32 10, i32* %2
store i32 57, i32* %1
%5 = call i32 @write(i32 1, i32* %1, i32 1)
store i32 56, i32* %1
%6 = call i32 @write(i32 1, i32* %1, i32 1)
store i32 55, i32* %1
%7 = call i32 @write(i32 1, i32* %1, i32 1)
store i32 54, i32* %1
%8 = call i32 @write(i32 1, i32* %1, i32 1)
store i32 53, i32* %1
%9 = call i32 @write(i32 1, i32* %1, i32 1)
store i32 52, i32* %1
%10 = call i32 @write(i32 1, i32* %1, i32 1)
store i32 51, i32* %1
%11 = call i32 @write(i32 1, i32* %1, i32 1)
store i32 50, i32* %1
%12 = call i32 @write(i32 1, i32* %1, i32 1)
store i32 49, i32* %1
%13 = call i32 @write(i32 1, i32* %1, i32 1)
store i32 48, i32* %1
%14 = call i32 @write(i32 1, i32* %1, i32 1)
store i32 47, i32* %1
%15 = call i32 @write(i32 1, i32* %2, i32 1)
ret i32 0
}