#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*/ getch();
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int i, j;
  int a[10][10];
  printf("Ñî»ÔÈý½Ç!:\n");
  for (i = 0; i < 10; i++) {
    a[i][0] = 1;
    a[i][i] = 1;
  }
  for (i = 2; i < 10; i++)
    for (j = 1; j < i; j++)
      a[i][j] = a[i - 1][j - 1] + a[i - 1][j];
  for (i = 0; i < 10; i++) {
    printf("%*d", 25 - i * 2, a[i][0]);
    for (j = 1; j <= i; j++)
      printf("%4d", a[i][j]);
    printf("\n");
    getch();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1a0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1194 <main+0x74>
movslq -0x8(%rbp),%rcx
lea    -0x1a0(%rbp),%rax
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
movl   $0x1,(%rax)
movslq -0x8(%rbp),%rcx
lea    -0x1a0(%rbp),%rax
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
movslq -0x8(%rbp),%rcx
movl   $0x1,(%rax,%rcx,4)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1147 <main+0x27>
movl   $0x2,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1233 <main+0x113>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1220 <main+0x100>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
movslq %eax,%rcx
lea    -0x1a0(%rbp),%rax
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
movslq %eax,%rcx
lea    -0x1a0(%rbp),%rax
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
add    (%rax,%rcx,4),%edx
movslq -0x8(%rbp),%rcx
lea    -0x1a0(%rbp),%rax
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11ac <main+0x8c>
jmp    1225 <main+0x105>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    119b <main+0x7b>
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    12de <main+0x1be>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    $0x19,%esi
sub    %eax,%esi
movslq -0x8(%rbp),%rcx
lea    -0x1a0(%rbp),%rax
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
mov    (%rax),%edx
lea    0xda8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     12bb <main+0x19b>
movslq -0x8(%rbp),%rcx
lea    -0x1a0(%rbp),%rax
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xd72(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    127a <main+0x15a>
lea    0xd50(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getch@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    123a <main+0x11a>
xor    %eax,%eax
add    $0x1a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x190,%rsp
lea    0xf51(%rip),%rdi
call   1040 <puts@plt>
movl   $0x1,(%rsp)
movabs $0x100000001,%rax
mov    %rax,0x28(%rsp)
movabs $0x200000001,%rax
mov    %rax,0x50(%rsp)
movl   $0x1,0x58(%rsp)
movl   $0x1,0xb0(%rsp)
movl   $0x1,0x108(%rsp)
movl   $0x1,0x160(%rsp)
movl   $0x1,0x168(%rsp)
movl   $0x1,0x18c(%rsp)
movaps 0xe39(%rip),%xmm0
movups %xmm0,0x78(%rsp)
movaps 0xe3d(%rip),%xmm0
movaps %xmm0,0xa0(%rsp)
movaps 0xe3e(%rip),%xmm0
movups %xmm0,0xc8(%rsp)
movabs $0x100000005,%rax
mov    %rax,0xd8(%rsp)
movaps 0xe2d(%rip),%xmm0
movaps %xmm0,0xf0(%rsp)
movabs $0x60000000f,%rax
mov    %rax,0x100(%rsp)
movaps 0xe1c(%rip),%xmm0
movups %xmm0,0x118(%rsp)
movaps 0xe1d(%rip),%xmm0
movups %xmm0,0x128(%rsp)
movaps 0xe1e(%rip),%xmm0
movaps %xmm0,0x140(%rsp)
movaps 0xe1f(%rip),%xmm0
movaps %xmm0,0x150(%rsp)
movaps 0xe20(%rip),%xmm0
movups %xmm0,0x16c(%rsp)
movaps 0xe21(%rip),%xmm0
movups %xmm0,0x17c(%rsp)
lea    0x4(%rsp),%r12
lea    0xe1d(%rip),%r14
lea    0xe1a(%rip),%r15
xor    %r13d,%r13d
jmp    12af <main+0x16f>
nop
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1060 <getch@plt>
add    $0x1,%r13
add    $0x28,%r12
cmp    $0xa,%r13
je     12f9 <main+0x1b9>
lea    0x0(,%r13,4),%rax
add    %r13,%rax
mov    (%rsp,%rax,8),%edx
mov    $0x19,%esi
sub    %r13d,%esi
sub    %r13d,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
test   %r13,%r13
je     1290 <main+0x150>
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    (%r12,%rbx,4),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r13
jne    12e0 <main+0x1a0>
jmp    1290 <main+0x150>
xor    %eax,%eax
add    $0x190,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [20 x i8] c"\C3\91\C3\AE\C2\BB\C3\94\C3\88\C3\BD\C2\BD\C3\87!:\0A\00"
@.str.1 = [4 x i8] c"%*d\00"
@.str.2 = [4 x i8] c"%4d\00"
@.str.3 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [10 x [10 x i32]]
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %2
br label %6
6: ; preds = %20, %0
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 10
br i1 %8, label %9, label %23
9: ; preds = %6
%10 = load i32, i32* %2
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %4, i64 0, i64 %11
%13 = getelementptr inbounds [10 x i32], [10 x i32]* %12, i64 0, i64 0
store i32 1, i32* %13
%14 = load i32, i32* %2
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %4, i64 0, i64 %15
%17 = load i32, i32* %2
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [10 x i32], [10 x i32]* %16, i64 0, i64 %18
store i32 1, i32* %19
br label %20
20: ; preds = %9
%21 = load i32, i32* %2
%22 = add nsw i32 %21, 1
store i32 %22, i32* %2
br label %6
23: ; preds = %6
store i32 2, i32* %2
br label %24
24: ; preds = %61, %23
%25 = load i32, i32* %2
%26 = icmp slt i32 %25, 10
br i1 %26, label %27, label %64
27: ; preds = %24
store i32 1, i32* %3
br label %28
28: ; preds = %57, %27
%29 = load i32, i32* %3
%30 = load i32, i32* %2
%31 = icmp slt i32 %29, %30
br i1 %31, label %32, label %60
32: ; preds = %28
%33 = load i32, i32* %2
%34 = sub nsw i32 %33, 1
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %4, i64 0, i64 %35
%37 = load i32, i32* %3
%38 = sub nsw i32 %37, 1
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds [10 x i32], [10 x i32]* %36, i64 0, i64 %39
%41 = load i32, i32* %40
%42 = load i32, i32* %2
%43 = sub nsw i32 %42, 1
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %4, i64 0, i64 %44
%46 = load i32, i32* %3
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds [10 x i32], [10 x i32]* %45, i64 0, i64 %47
%49 = load i32, i32* %48
%50 = add nsw i32 %41, %49
%51 = load i32, i32* %2
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %4, i64 0, i64 %52
%54 = load i32, i32* %3
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds [10 x i32], [10 x i32]* %53, i64 0, i64 %55
store i32 %50, i32* %56
br label %57
57: ; preds = %32
%58 = load i32, i32* %3
%59 = add nsw i32 %58, 1
store i32 %59, i32* %3
br label %28
60: ; preds = %28
br label %61
61: ; preds = %60
%62 = load i32, i32* %2
%63 = add nsw i32 %62, 1
store i32 %63, i32* %2
br label %24
64: ; preds = %24
store i32 0, i32* %2
br label %65
65: ; preds = %97, %64
%66 = load i32, i32* %2
%67 = icmp slt i32 %66, 10
br i1 %67, label %68, label %100
68: ; preds = %65
%69 = load i32, i32* %2
%70 = mul nsw i32 %69, 2
%71 = sub nsw i32 25, %70
%72 = load i32, i32* %2
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %4, i64 0, i64 %73
%75 = getelementptr inbounds [10 x i32], [10 x i32]* %74, i64 0, i64 0
%76 = load i32, i32* %75
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %71, i32 %76)
store i32 1, i32* %3
br label %78
78: ; preds = %91, %68
%79 = load i32, i32* %3
%80 = load i32, i32* %2
%81 = icmp sle i32 %79, %80
br i1 %81, label %82, label %94
82: ; preds = %78
%83 = load i32, i32* %2
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %4, i64 0, i64 %84
%86 = load i32, i32* %3
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds [10 x i32], [10 x i32]* %85, i64 0, i64 %87
%89 = load i32, i32* %88
%90 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %89)
br label %91
91: ; preds = %82
%92 = load i32, i32* %3
%93 = add nsw i32 %92, 1
store i32 %93, i32* %3
br label %78
94: ; preds = %78
%95 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%96 = call i32 (...) @getch()
br label %97
97: ; preds = %94
%98 = load i32, i32* %2
%99 = add nsw i32 %98, 1
store i32 %99, i32* %2
br label %65
100: ; preds = %65
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%*d\00"
@.str.2 = [4 x i8] c"%4d\00"
@str = [19 x i8] c"\C3\91\C3\AE\C2\BB\C3\94\C3\88\C3\BD\C2\BD\C3\87!:\00"
define i32 @main() {
%1 = alloca [10 x [10 x i32]]
%2 = bitcast [10 x [10 x i32]]* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%4 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %1, i64 0, i64 0, i64 0
store i32 1, i32* %4
%5 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %1, i64 0, i64 1, i64 0
store i32 1, i32* %5
%6 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %1, i64 0, i64 1, i64 1
store i32 1, i32* %6
%7 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %1, i64 0, i64 2, i64 0
store i32 1, i32* %7
%8 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %1, i64 0, i64 2, i64 2
store i32 1, i32* %8
%9 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %1, i64 0, i64 3, i64 0
%10 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %1, i64 0, i64 4, i64 0
%11 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %1, i64 0, i64 4, i64 4
store i32 1, i32* %11
%12 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %1, i64 0, i64 5, i64 0
%13 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %1, i64 0, i64 5, i64 5
store i32 1, i32* %13
%14 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %1, i64 0, i64 6, i64 0
%15 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %1, i64 0, i64 6, i64 6
store i32 1, i32* %15
%16 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %1, i64 0, i64 7, i64 0
%17 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %1, i64 0, i64 8, i64 0
%18 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %1, i64 0, i64 8, i64 8
store i32 1, i32* %18
%19 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %1, i64 0, i64 9, i64 0
store i32 1, i32* %19
%20 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %1, i64 0, i64 9, i64 9
store i32 1, i32* %20
%21 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %1, i64 0, i64 2, i64 1
store i32 2, i32* %21
%22 = bitcast i32* %9 to <4 x i32>*
store <4 x i32> <i32 1, i32 3, i32 3, i32 1>, <4 x i32>* %22
%23 = bitcast i32* %10 to <4 x i32>*
store <4 x i32> <i32 1, i32 4, i32 6, i32 4>, <4 x i32>* %23
%24 = bitcast i32* %12 to <4 x i32>*
store <4 x i32> <i32 1, i32 5, i32 10, i32 10>, <4 x i32>* %24
%25 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %1, i64 0, i64 5, i64 4
store i32 5, i32* %25
%26 = bitcast i32* %14 to <4 x i32>*
store <4 x i32> <i32 1, i32 6, i32 15, i32 20>, <4 x i32>* %26
%27 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %1, i64 0, i64 6, i64 4
store i32 15, i32* %27
%28 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %1, i64 0, i64 6, i64 5
store i32 6, i32* %28
%29 = bitcast i32* %16 to <4 x i32>*
store <4 x i32> <i32 1, i32 7, i32 21, i32 35>, <4 x i32>* %29
%30 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %1, i64 0, i64 7, i64 4
%31 = bitcast i32* %30 to <4 x i32>*
store <4 x i32> <i32 35, i32 21, i32 7, i32 1>, <4 x i32>* %31
%32 = bitcast i32* %17 to <4 x i32>*
store <4 x i32> <i32 1, i32 8, i32 28, i32 56>, <4 x i32>* %32
%33 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %1, i64 0, i64 8, i64 4
%34 = bitcast i32* %33 to <4 x i32>*
store <4 x i32> <i32 70, i32 56, i32 28, i32 8>, <4 x i32>* %34
%35 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %1, i64 0, i64 9, i64 1
%36 = bitcast i32* %35 to <4 x i32>*
store <4 x i32> <i32 9, i32 36, i32 84, i32 126>, <4 x i32>* %36
%37 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %1, i64 0, i64 9, i64 5
%38 = bitcast i32* %37 to <4 x i32>*
store <4 x i32> <i32 126, i32 84, i32 36, i32 9>, <4 x i32>* %38
br label %39
39: ; preds = %0, %56
%40 = phi i64 [ 0, %0 ], [ %59, %56 ]
%41 = phi i64 [ 1, %0 ], [ %60, %56 ]
%42 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %1, i64 0, i64 %40, i64 0
%43 = load i32, i32* %42
%44 = trunc i64 %40 to i32
%45 = mul i32 %44, -2
%46 = add i32 %45, 25
%47 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %46, i32 %43)
%48 = icmp eq i64 %40, 0
br i1 %48, label %56, label %49
49: ; preds = %39, %49
%50 = phi i64 [ %54, %49 ], [ 1, %39 ]
%51 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %1, i64 0, i64 %40, i64 %50
%52 = load i32, i32* %51
%53 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %52)
%54 = add nuw nsw i64 %50, 1
%55 = icmp eq i64 %54, %41
br i1 %55, label %56, label %49
56: ; preds = %49, %39
%57 = tail call i32 @putchar(i32 10)
%58 = tail call i32 (...) @getch()
%59 = add nuw nsw i64 %40, 1
%60 = add nuw nsw i64 %41, 1
%61 = icmp eq i64 %59, 10
br i1 %61, label %62, label %39
62: ; preds = %56
ret i32 0
}