#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 *, ...);
int main() {
  int array[4000] = {0};
  int i, j, jinw, print_flag = 0;
  array[4000 - 1] = 1;
  for (j = 0; j < 10000; j++) {
    jinw = 0;
    for (i = 4000 - 1; i >= 0; i--) {
      int tmp = array[i] * 2 + jinw;
      array[i] = tmp % 10;
      jinw = tmp / 10;
    }
  }
  for (j = 0; j < 4000; j++) {
    if (array[j] != 0 && print_flag == 0)
      print_flag = 1;
    if (print_flag == 1)
      printf("%d", array[j]);
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3eb0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3e90(%rbp),%rdi
xor    %esi,%esi
mov    $0x3e80,%edx
call   1040 <memset@plt>
movl   $0x0,-0x3ea0(%rbp)
movl   $0x1,-0x14(%rbp)
movl   $0x0,-0x3e98(%rbp)
cmpl   $0x2710,-0x3e98(%rbp)
jge    120b <main+0xeb>
movl   $0x0,-0x3e9c(%rbp)
movl   $0xf9f,-0x3e94(%rbp)
cmpl   $0x0,-0x3e94(%rbp)
jl     11f2 <main+0xd2>
movslq -0x3e94(%rbp),%rax
mov    -0x3e90(%rbp,%rax,4),%eax
shl    $0x1,%eax
add    -0x3e9c(%rbp),%eax
mov    %eax,-0x3ea4(%rbp)
mov    -0x3ea4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
movslq -0x3e94(%rbp),%rax
mov    %edx,-0x3e90(%rbp,%rax,4)
mov    -0x3ea4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x3e9c(%rbp)
mov    -0x3e94(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x3e94(%rbp)
jmp    1184 <main+0x64>
jmp    11f7 <main+0xd7>
mov    -0x3e98(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3e98(%rbp)
jmp    1160 <main+0x40>
movl   $0x0,-0x3e98(%rbp)
cmpl   $0xfa0,-0x3e98(%rbp)
jge    1293 <main+0x173>
movslq -0x3e98(%rbp),%rax
cmpl   $0x0,-0x3e90(%rbp,%rax,4)
je     1251 <main+0x131>
cmpl   $0x0,-0x3ea0(%rbp)
jne    1251 <main+0x131>
movl   $0x1,-0x3ea0(%rbp)
cmpl   $0x1,-0x3ea0(%rbp)
jne    127a <main+0x15a>
movslq -0x3e98(%rbp),%rax
mov    -0x3e90(%rbp,%rax,4),%esi
lea    0xd8d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    127f <main+0x15f>
mov    -0x3e98(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3e98(%rbp)
jmp    1215 <main+0xf5>
lea    0xd69(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x3eb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x3e88,%rsp
mov    %rsp,%rdi
xor    %ebx,%ebx
mov    $0x3e80,%edx
xor    %esi,%esi
call   1050 <memset@plt>
movl   $0x1,0x3e7c(%rsp)
nopl   0x0(%rax)
mov    $0xf9f,%eax
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
mov    (%rsp,%rax,4),%edx
lea    (%rcx,%rdx,2),%ecx
movslq %ecx,%rdx
imul   $0x66666667,%rdx,%rcx
mov    %rcx,%rsi
shr    $0x3f,%rsi
sar    $0x22,%rcx
add    %esi,%ecx
lea    (%rcx,%rcx,1),%esi
lea    (%rsi,%rsi,4),%esi
sub    %esi,%edx
mov    %edx,(%rsp,%rax,4)
add    $0xffffffffffffffff,%rax
jb     1170 <main+0x40>
add    $0x1,%ebx
cmp    $0x2710,%ebx
jne    1160 <main+0x30>
mov    $0x1,%r15d
lea    0xe4a(%rip),%r14
xor    %ebx,%ebx
xor    %ebp,%ebp
jmp    11cd <main+0x9d>
nopl   0x0(%rax)
add    $0x1,%rbx
cmp    $0xfa0,%rbx
je     11ee <main+0xbe>
mov    %ebp,%eax
mov    (%rsp,%rbx,4),%esi
test   %ebp,%ebp
cmove  %r15d,%ebp
test   %esi,%esi
cmove  %eax,%ebp
cmp    $0x1,%ebp
jne    11c0 <main+0x90>
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    11c0 <main+0x90>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x3e88,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [4000 x i32]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
%8 = bitcast [4000 x i32]* %2 to i8*
store i32 0, i32* %6
%9 = getelementptr inbounds [4000 x i32], [4000 x i32]* %2, i64 0, i64 3999
store i32 1, i32* %9
store i32 0, i32* %4
br label %10
10: ; preds = %36, %0
%11 = load i32, i32* %4
%12 = icmp slt i32 %11, 10000
br i1 %12, label %13, label %39
13: ; preds = %10
store i32 0, i32* %5
store i32 3999, i32* %3
br label %14
14: ; preds = %32, %13
%15 = load i32, i32* %3
%16 = icmp sge i32 %15, 0
br i1 %16, label %17, label %35
17: ; preds = %14
%18 = load i32, i32* %3
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [4000 x i32], [4000 x i32]* %2, i64 0, i64 %19
%21 = load i32, i32* %20
%22 = mul nsw i32 %21, 2
%23 = load i32, i32* %5
%24 = add nsw i32 %22, %23
store i32 %24, i32* %7
%25 = load i32, i32* %7
%26 = srem i32 %25, 10
%27 = load i32, i32* %3
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [4000 x i32], [4000 x i32]* %2, i64 0, i64 %28
store i32 %26, i32* %29
%30 = load i32, i32* %7
%31 = sdiv i32 %30, 10
store i32 %31, i32* %5
br label %32
32: ; preds = %17
%33 = load i32, i32* %3
%34 = add nsw i32 %33, -1
store i32 %34, i32* %3
br label %14
35: ; preds = %14
br label %36
36: ; preds = %35
%37 = load i32, i32* %4
%38 = add nsw i32 %37, 1
store i32 %38, i32* %4
br label %10
39: ; preds = %10
store i32 0, i32* %4
br label %40
40: ; preds = %63, %39
%41 = load i32, i32* %4
%42 = icmp slt i32 %41, 4000
br i1 %42, label %43, label %66
43: ; preds = %40
%44 = load i32, i32* %4
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds [4000 x i32], [4000 x i32]* %2, i64 0, i64 %45
%47 = load i32, i32* %46
%48 = icmp ne i32 %47, 0
br i1 %48, label %49, label %53
49: ; preds = %43
%50 = load i32, i32* %6
%51 = icmp eq i32 %50, 0
br i1 %51, label %52, label %53
52: ; preds = %49
store i32 1, i32* %6
br label %53
53: ; preds = %52, %49, %43
%54 = load i32, i32* %6
%55 = icmp eq i32 %54, 1
br i1 %55, label %56, label %62
56: ; preds = %53
%57 = load i32, i32* %4
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds [4000 x i32], [4000 x i32]* %2, i64 0, i64 %58
%60 = load i32, i32* %59
%61 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %60)
br label %62
62: ; preds = %56, %53
br label %63
63: ; preds = %62
%64 = load i32, i32* %4
%65 = add nsw i32 %64, 1
store i32 %65, i32* %4
br label %40
66: ; preds = %40
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [4000 x i32]
%2 = bitcast [4000 x i32]* %1 to i8*
%3 = getelementptr inbounds [4000 x i32], [4000 x i32]* %1, i64 0, i64 3999
store i32 1, i32* %3
br label %4
4: ; preds = %0, %17
%5 = phi i32 [ 0, %0 ], [ %18, %17 ]
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 3999, %4 ], [ %15, %6 ]
%8 = phi i32 [ 0, %4 ], [ %14, %6 ]
%9 = getelementptr inbounds [4000 x i32], [4000 x i32]* %1, i64 0, i64 %7
%10 = load i32, i32* %9
%11 = shl nsw i32 %10, 1
%12 = add nsw i32 %11, %8
%13 = srem i32 %12, 10
store i32 %13, i32* %9
%14 = sdiv i32 %12, 10
%15 = add nsw i64 %7, -1
%16 = icmp eq i64 %7, 0
br i1 %16, label %17, label %6
17: ; preds = %6
%18 = add nuw nsw i32 %5, 1
%19 = icmp eq i32 %18, 10000
br i1 %19, label %20, label %4
20: ; preds = %17, %32
%21 = phi i64 [ %33, %32 ], [ 0, %17 ]
%22 = phi i32 [ %28, %32 ], [ 0, %17 ]
%23 = getelementptr inbounds [4000 x i32], [4000 x i32]* %1, i64 0, i64 %21
%24 = load i32, i32* %23
%25 = icmp ne i32 %24, 0
%26 = icmp eq i32 %22, 0
%27 = select i1 %25, i1 %26, i1 false
%28 = select i1 %27, i32 1, i32 %22
%29 = icmp eq i32 %28, 1
br i1 %29, label %30, label %32
30: ; preds = %20
%31 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %24)
br label %32
32: ; preds = %20, %30
%33 = add nuw nsw i64 %21, 1
%34 = icmp eq i64 %33, 4000
br i1 %34, label %35, label %20
35: ; preds = %32
%36 = tail call i32 @putchar(i32 10)
ret i32 0
}