#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 /*<<< orphan*/ scanf(char *, int *);
int main() {
  int x;
  scanf("%d", &x);
  switch (x) {
  case 1:
    printf("*");
    break;
  case 2:
    printf("2*");
    printf("\n*1");
    break;
  case 3:
    printf("32*");
    printf("\n3*1");
    printf("\n*21");
    break;
  case 4:
    printf("\n432*");
    printf("\n43*1");
    printf("\n4*21");
    printf("\n*321");
    break;
  case 5:
    printf("\n5432*");
    printf("\n543*1");
    printf("\n54*21");
    printf("\n5*321");
    printf("\n*4321");
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xede(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x4,%eax
ja     1230 <main+0x110>
mov    -0x10(%rbp),%rax
lea    0xea1(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
jmp    1230 <main+0x110>
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
lea    0xe8b(%rip),%rdi
call   1030 <printf@plt>
jmp    1230 <main+0x110>
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
lea    0xe72(%rip),%rdi
call   1030 <printf@plt>
lea    0xe6b(%rip),%rdi
call   1030 <printf@plt>
jmp    1230 <main+0x110>
lea    0xe5f(%rip),%rdi
call   1030 <printf@plt>
lea    0xe59(%rip),%rdi
call   1030 <printf@plt>
lea    0xe53(%rip),%rdi
call   1030 <printf@plt>
lea    0xe4d(%rip),%rdi
call   1030 <printf@plt>
jmp    1230 <main+0x110>
lea    0xe42(%rip),%rdi
call   1030 <printf@plt>
lea    0xe3d(%rip),%rdi
call   1030 <printf@plt>
lea    0xe38(%rip),%rdi
call   1030 <printf@plt>
lea    0xe33(%rip),%rdi
call   1030 <printf@plt>
lea    0xe2e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
add    $0xffffffff,%eax
cmp    $0x4,%eax
ja     1213 <main+0xe3>
lea    0xea7(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x2a,%edi
call   1030 <putchar@plt>
jmp    1213 <main+0xe3>
lea    0xeb0(%rip),%rdi
call   1040 <printf@plt>
lea    0xe93(%rip),%rdi
jmp    120e <main+0xde>
lea    0xe97(%rip),%rdi
call   1040 <printf@plt>
lea    0xe7f(%rip),%rdi
call   1040 <printf@plt>
lea    0xe78(%rip),%rdi
jmp    120e <main+0xde>
lea    0xe74(%rip),%rdi
call   1040 <printf@plt>
lea    0xe6e(%rip),%rdi
call   1040 <printf@plt>
lea    0xe68(%rip),%rdi
call   1040 <printf@plt>
lea    0xe62(%rip),%rdi
jmp    120e <main+0xde>
lea    0xe5f(%rip),%rdi
call   1040 <printf@plt>
lea    0xe5a(%rip),%rdi
call   1040 <printf@plt>
lea    0xe55(%rip),%rdi
call   1040 <printf@plt>
lea    0xe50(%rip),%rdi
call   1040 <printf@plt>
lea    0xe4b(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [2 x i8] c"*\00"
@.str.2 = [3 x i8] c"2*\00"
@.str.3 = [4 x i8] c"\0A*1\00"
@.str.4 = [4 x i8] c"32*\00"
@.str.5 = [5 x i8] c"\0A3*1\00"
@.str.6 = [5 x i8] c"\0A*21\00"
@.str.7 = [6 x i8] c"\0A432*\00"
@.str.8 = [6 x i8] c"\0A43*1\00"
@.str.9 = [6 x i8] c"\0A4*21\00"
@.str.10 = [6 x i8] c"\0A*321\00"
@.str.11 = [7 x i8] c"\0A5432*\00"
@.str.12 = [7 x i8] c"\0A543*1\00"
@.str.13 = [7 x i8] c"\0A54*21\00"
@.str.14 = [7 x i8] c"\0A5*321\00"
@.str.15 = [7 x i8] c"\0A*4321\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
switch i32 %4, label %25 [
i32 1, label %5
i32 2, label %7
i32 3, label %10
i32 4, label %14
i32 5, label %19
]
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %25
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
br label %25
10: ; preds = %0
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%12 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%13 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
br label %25
14: ; preds = %0
%15 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
%16 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
%17 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
%18 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0))
br label %25
19: ; preds = %0
%20 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0))
%21 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.12, i64 0, i64 0))
%22 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.13, i64 0, i64 0))
%23 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.14, i64 0, i64 0))
%24 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.15, i64 0, i64 0))
br label %25
25: ; preds = %0, %19, %14, %10, %7, %5
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.2 = [3 x i8] c"2*\00"
@.str.3 = [4 x i8] c"\0A*1\00"
@.str.4 = [4 x i8] c"32*\00"
@.str.5 = [5 x i8] c"\0A3*1\00"
@.str.6 = [5 x i8] c"\0A*21\00"
@.str.7 = [6 x i8] c"\0A432*\00"
@.str.8 = [6 x i8] c"\0A43*1\00"
@.str.9 = [6 x i8] c"\0A4*21\00"
@.str.10 = [6 x i8] c"\0A*321\00"
@.str.11 = [7 x i8] c"\0A5432*\00"
@.str.12 = [7 x i8] c"\0A543*1\00"
@.str.13 = [7 x i8] c"\0A54*21\00"
@.str.14 = [7 x i8] c"\0A5*321\00"
@.str.15 = [7 x i8] c"\0A*4321\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
switch i32 %4, label %25 [
i32 1, label %5
i32 2, label %7
i32 3, label %10
i32 4, label %14
i32 5, label %19
]
5: ; preds = %0
%6 = call i32 @putchar(i32 42)
br label %25
7: ; preds = %0
%8 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
br label %25
10: ; preds = %0
%11 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%12 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%13 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
br label %25
14: ; preds = %0
%15 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
%16 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
%17 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
%18 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0))
br label %25
19: ; preds = %0
%20 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0))
%21 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.12, i64 0, i64 0))
%22 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.13, i64 0, i64 0))
%23 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.14, i64 0, i64 0))
%24 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.15, i64 0, i64 0))
br label %25
25: ; preds = %0, %19, %14, %10, %7, %5
ret i32 0
}