#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*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int arr[100];
  int num;
  int i;
  int j;
  int order;
  printf("Enter the number of elements in the array: ");
  scanf("%d", &num);
  printf("Enter the array elements:\n");
  for (i = 0; i < num; i++) {
    scanf("%d", &arr[i]);
  }
  printf("Enter the order of sorting:\n");
  printf("1. Ascending Order\n2. Descending order\n");
  scanf("%d", &order);
  if ((order == 1) || (order == 2)) {
    for (i = 0; i < (num - 1); i++) {
      for (j = 0; j < (num - i - 1); j++) {
        if ((order == 1) && (arr[j] > arr[j + 1])) {
          arr[j] = arr[j] + arr[j + 1];
          arr[j + 1] = arr[j] - arr[j + 1];
          arr[j] = arr[j] - arr[j + 1];
          ;
        } else if ((order == 2) && (arr[j] < arr[j + 1])) {
          arr[j] = arr[j] + arr[j + 1];
          arr[j + 1] = arr[j] - arr[j + 1];
          arr[j] = arr[j] - arr[j + 1];
          ;
        }
      }
    }
  } else {
    printf("Invalid input!\n");
    exit(1);
  }
  printf("Array after sorting:\n");
  for (i = 0; i < num; i++) {
    printf("%d\t", arr[i]);
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1b0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
lea    -0x1a4(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x1a8(%rbp)
mov    -0x1a8(%rbp),%eax
cmp    -0x1a4(%rbp),%eax
jge    11c2 <main+0x92>
movslq -0x1a8(%rbp),%rax
lea    -0x1a0(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe83(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x1a8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1a8(%rbp)
jmp    117b <main+0x4b>
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe47(%rip),%rdi
lea    -0x1b0(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x1,-0x1b0(%rbp)
je     120b <main+0xdb>
cmpl   $0x2,-0x1b0(%rbp)
jne    1418 <main+0x2e8>
movl   $0x0,-0x1a8(%rbp)
mov    -0x1a8(%rbp),%eax
mov    -0x1a4(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1413 <main+0x2e3>
movl   $0x0,-0x1ac(%rbp)
mov    -0x1ac(%rbp),%eax
mov    -0x1a4(%rbp),%ecx
sub    -0x1a8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    13fa <main+0x2ca>
cmpl   $0x1,-0x1b0(%rbp)
jne    131a <main+0x1ea>
movslq -0x1ac(%rbp),%rax
mov    -0x1a0(%rbp,%rax,4),%eax
mov    -0x1ac(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
cmp    -0x1a0(%rbp,%rcx,4),%eax
jle    131a <main+0x1ea>
movslq -0x1ac(%rbp),%rax
mov    -0x1a0(%rbp,%rax,4),%ecx
mov    -0x1ac(%rbp),%eax
add    $0x1,%eax
cltq
add    -0x1a0(%rbp,%rax,4),%ecx
movslq -0x1ac(%rbp),%rax
mov    %ecx,-0x1a0(%rbp,%rax,4)
movslq -0x1ac(%rbp),%rax
mov    -0x1a0(%rbp,%rax,4),%ecx
mov    -0x1ac(%rbp),%eax
add    $0x1,%eax
cltq
sub    -0x1a0(%rbp,%rax,4),%ecx
mov    -0x1ac(%rbp),%eax
add    $0x1,%eax
cltq
mov    %ecx,-0x1a0(%rbp,%rax,4)
movslq -0x1ac(%rbp),%rax
mov    -0x1a0(%rbp,%rax,4),%ecx
mov    -0x1ac(%rbp),%eax
add    $0x1,%eax
cltq
sub    -0x1a0(%rbp,%rax,4),%ecx
movslq -0x1ac(%rbp),%rax
mov    %ecx,-0x1a0(%rbp,%rax,4)
jmp    13e1 <main+0x2b1>
cmpl   $0x2,-0x1b0(%rbp)
jne    13dc <main+0x2ac>
movslq -0x1ac(%rbp),%rax
mov    -0x1a0(%rbp,%rax,4),%eax
mov    -0x1ac(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
cmp    -0x1a0(%rbp,%rcx,4),%eax
jge    13dc <main+0x2ac>
movslq -0x1ac(%rbp),%rax
mov    -0x1a0(%rbp,%rax,4),%ecx
mov    -0x1ac(%rbp),%eax
add    $0x1,%eax
cltq
add    -0x1a0(%rbp,%rax,4),%ecx
movslq -0x1ac(%rbp),%rax
mov    %ecx,-0x1a0(%rbp,%rax,4)
movslq -0x1ac(%rbp),%rax
mov    -0x1a0(%rbp,%rax,4),%ecx
mov    -0x1ac(%rbp),%eax
add    $0x1,%eax
cltq
sub    -0x1a0(%rbp,%rax,4),%ecx
mov    -0x1ac(%rbp),%eax
add    $0x1,%eax
cltq
mov    %ecx,-0x1a0(%rbp,%rax,4)
movslq -0x1ac(%rbp),%rax
mov    -0x1a0(%rbp,%rax,4),%ecx
mov    -0x1ac(%rbp),%eax
add    $0x1,%eax
cltq
sub    -0x1a0(%rbp,%rax,4),%ecx
movslq -0x1ac(%rbp),%rax
mov    %ecx,-0x1a0(%rbp,%rax,4)
jmp    13e1 <main+0x2b1>
jmp    13e6 <main+0x2b6>
mov    -0x1ac(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1ac(%rbp)
jmp    1236 <main+0x106>
jmp    13ff <main+0x2cf>
mov    -0x1a8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1a8(%rbp)
jmp    1215 <main+0xe5>
jmp    1430 <main+0x300>
lea    0xc70(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
lea    0xc68(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x1a8(%rbp)
mov    -0x1a8(%rbp),%eax
cmp    -0x1a4(%rbp),%eax
jge    148a <main+0x35a>
movslq -0x1a8(%rbp),%rax
mov    -0x1a0(%rbp,%rax,4),%esi
lea    0xc46(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1a8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1a8(%rbp)
jmp    1448 <main+0x318>
lea    0xc0c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x1b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x1a0,%rsp
lea    0xe9d(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xebb(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1060 <scanf@plt>
lea    0xeb1(%rip),%rdi
call   1040 <puts@plt>
cmpl   $0x0,0x8(%rsp)
jle    11bd <main+0x6d>
lea    0x10(%rsp),%r15
xor    %ebx,%ebx
lea    0xe90(%rip),%r14
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %r15,%rsi
call   1060 <scanf@plt>
add    $0x1,%rbx
movslq 0x8(%rsp),%rax
add    $0x4,%r15
cmp    %rax,%rbx
jl     11a0 <main+0x50>
lea    0xe89(%rip),%rdi
call   1040 <puts@plt>
lea    0xe99(%rip),%rdi
call   1040 <puts@plt>
lea    0xe50(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1060 <scanf@plt>
mov    0xc(%rsp),%eax
lea    -0x1(%rax),%ecx
cmp    $0x1,%ecx
ja     12f5 <main+0x1a5>
mov    0x8(%rsp),%r9d
cmp    $0x2,%r9d
jl     129a <main+0x14a>
lea    -0x1(%r9),%r8d
xor    %r11d,%r11d
mov    %r8d,%r10d
jmp    122d <main+0xdd>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%r11d
add    $0xffffffff,%r10d
cmp    %r8d,%r11d
je     129a <main+0x14a>
mov    %r11d,%ecx
not    %ecx
add    %r9d,%ecx
test   %ecx,%ecx
jle    1220 <main+0xd0>
mov    %r10d,%ebx
xor    %edx,%edx
jmp    124f <main+0xff>
add    $0x1,%rdx
mov    %rdx,%rcx
mov    %rcx,%rdx
cmp    %rbx,%rcx
je     1220 <main+0xd0>
cmp    $0x1,%eax
je     1280 <main+0x130>
cmp    $0x2,%eax
jne    1240 <main+0xf0>
mov    0x10(%rsp,%rdx,4),%esi
mov    0x14(%rsp,%rdx,4),%edi
lea    0x1(%rdx),%rcx
cmp    %edi,%esi
jge    1247 <main+0xf7>
mov    %esi,0x14(%rsp,%rdx,4)
mov    %edi,0x10(%rsp,%rdx,4)
jmp    1247 <main+0xf7>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    0x10(%rsp,%rdx,4),%edi
mov    0x14(%rsp,%rdx,4),%esi
lea    0x1(%rdx),%rcx
cmp    %esi,%edi
jle    1247 <main+0xf7>
mov    %edi,0x14(%rsp,%rdx,4)
mov    %esi,0x10(%rsp,%rdx,4)
jmp    1247 <main+0xf7>
lea    0xdfe(%rip),%rdi
call   1040 <puts@plt>
cmpl   $0x0,0x8(%rsp)
jle    12dc <main+0x18c>
lea    0xd7b(%rip),%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    0x10(%rsp,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbx
movslq 0x8(%rsp),%rax
cmp    %rax,%rbx
jl     12c0 <main+0x170>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x1a0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret
lea    0xd94(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [44 x i8] c"Enter the number of elements in the array: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [27 x i8] c"Enter the array elements:\0A\00"
@.str.3 = [29 x i8] c"Enter the order of sorting:\0A\00"
@.str.4 = [40 x i8] c"1. Ascending Order\0A2. Descending order\0A\00"
@.str.5 = [16 x i8] c"Invalid input!\0A\00"
@.str.6 = [22 x i8] c"Array after sorting:\0A\00"
@.str.7 = [4 x i8] c"%d\09\00"
@.str.8 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i32]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %4
br label %10
10: ; preds = %19, %0
%11 = load i32, i32* %4
%12 = load i32, i32* %3
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %22
14: ; preds = %10
%15 = load i32, i32* %4
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %16
%18 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %17)
br label %19
19: ; preds = %14
%20 = load i32, i32* %4
%21 = add nsw i32 %20, 1
store i32 %21, i32* %4
br label %10
22: ; preds = %10
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0))
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.4, i64 0, i64 0))
%25 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%26 = load i32, i32* %6
%27 = icmp eq i32 %26, 1
br i1 %27, label %31, label %28
28: ; preds = %22
%29 = load i32, i32* %6
%30 = icmp eq i32 %29, 2
br i1 %30, label %31, label %165
31: ; preds = %28, %22
store i32 0, i32* %4
br label %32
32: ; preds = %161, %31
%33 = load i32, i32* %4
%34 = load i32, i32* %3
%35 = sub nsw i32 %34, 1
%36 = icmp slt i32 %33, %35
br i1 %36, label %37, label %164
37: ; preds = %32
store i32 0, i32* %5
br label %38
38: ; preds = %157, %37
%39 = load i32, i32* %5
%40 = load i32, i32* %3
%41 = load i32, i32* %4
%42 = sub nsw i32 %40, %41
%43 = sub nsw i32 %42, 1
%44 = icmp slt i32 %39, %43
br i1 %44, label %45, label %160
45: ; preds = %38
%46 = load i32, i32* %6
%47 = icmp eq i32 %46, 1
br i1 %47, label %48, label %100
48: ; preds = %45
%49 = load i32, i32* %5
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %50
%52 = load i32, i32* %51
%53 = load i32, i32* %5
%54 = add nsw i32 %53, 1
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %55
%57 = load i32, i32* %56
%58 = icmp sgt i32 %52, %57
br i1 %58, label %59, label %100
59: ; preds = %48
%60 = load i32, i32* %5
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %61
%63 = load i32, i32* %62
%64 = load i32, i32* %5
%65 = add nsw i32 %64, 1
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %66
%68 = load i32, i32* %67
%69 = add nsw i32 %63, %68
%70 = load i32, i32* %5
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %71
store i32 %69, i32* %72
%73 = load i32, i32* %5
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %74
%76 = load i32, i32* %75
%77 = load i32, i32* %5
%78 = add nsw i32 %77, 1
%79 = sext i32 %78 to i64
%80 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %79
%81 = load i32, i32* %80
%82 = sub nsw i32 %76, %81
%83 = load i32, i32* %5
%84 = add nsw i32 %83, 1
%85 = sext i32 %84 to i64
%86 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %85
store i32 %82, i32* %86
%87 = load i32, i32* %5
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %88
%90 = load i32, i32* %89
%91 = load i32, i32* %5
%92 = add nsw i32 %91, 1
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %93
%95 = load i32, i32* %94
%96 = sub nsw i32 %90, %95
%97 = load i32, i32* %5
%98 = sext i32 %97 to i64
%99 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %98
store i32 %96, i32* %99
br label %156
100: ; preds = %48, %45
%101 = load i32, i32* %6
%102 = icmp eq i32 %101, 2
br i1 %102, label %103, label %155
103: ; preds = %100
%104 = load i32, i32* %5
%105 = sext i32 %104 to i64
%106 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %105
%107 = load i32, i32* %106
%108 = load i32, i32* %5
%109 = add nsw i32 %108, 1
%110 = sext i32 %109 to i64
%111 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %110
%112 = load i32, i32* %111
%113 = icmp slt i32 %107, %112
br i1 %113, label %114, label %155
114: ; preds = %103
%115 = load i32, i32* %5
%116 = sext i32 %115 to i64
%117 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %116
%118 = load i32, i32* %117
%119 = load i32, i32* %5
%120 = add nsw i32 %119, 1
%121 = sext i32 %120 to i64
%122 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %121
%123 = load i32, i32* %122
%124 = add nsw i32 %118, %123
%125 = load i32, i32* %5
%126 = sext i32 %125 to i64
%127 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %126
store i32 %124, i32* %127
%128 = load i32, i32* %5
%129 = sext i32 %128 to i64
%130 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %129
%131 = load i32, i32* %130
%132 = load i32, i32* %5
%133 = add nsw i32 %132, 1
%134 = sext i32 %133 to i64
%135 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %134
%136 = load i32, i32* %135
%137 = sub nsw i32 %131, %136
%138 = load i32, i32* %5
%139 = add nsw i32 %138, 1
%140 = sext i32 %139 to i64
%141 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %140
store i32 %137, i32* %141
%142 = load i32, i32* %5
%143 = sext i32 %142 to i64
%144 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %143
%145 = load i32, i32* %144
%146 = load i32, i32* %5
%147 = add nsw i32 %146, 1
%148 = sext i32 %147 to i64
%149 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %148
%150 = load i32, i32* %149
%151 = sub nsw i32 %145, %150
%152 = load i32, i32* %5
%153 = sext i32 %152 to i64
%154 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %153
store i32 %151, i32* %154
br label %155
155: ; preds = %114, %103, %100
br label %156
156: ; preds = %155, %59
br label %157
157: ; preds = %156
%158 = load i32, i32* %5
%159 = add nsw i32 %158, 1
store i32 %159, i32* %5
br label %38
160: ; preds = %38
br label %161
161: ; preds = %160
%162 = load i32, i32* %4
%163 = add nsw i32 %162, 1
store i32 %163, i32* %4
br label %32
164: ; preds = %32
br label %168
165: ; preds = %28
%166 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0))
%167 = call i32 @exit(i32 1)
unreachable
168: ; preds = %164
%169 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0))
store i32 0, i32* %4
br label %170
170: ; preds = %180, %168
%171 = load i32, i32* %4
%172 = load i32, i32* %3
%173 = icmp slt i32 %171, %172
br i1 %173, label %174, label %183
174: ; preds = %170
%175 = load i32, i32* %4
%176 = sext i32 %175 to i64
%177 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %176
%178 = load i32, i32* %177
%179 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i32 %178)
br label %180
180: ; preds = %174
%181 = load i32, i32* %4
%182 = add nsw i32 %181, 1
store i32 %182, i32* %4
br label %170
183: ; preds = %170
%184 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [44 x i8] c"Enter the number of elements in the array: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.7 = [4 x i8] c"%d\09\00"
@str = [26 x i8] c"Enter the array elements:\00"
@str.9 = [28 x i8] c"Enter the order of sorting:\00"
@str.10 = [39 x i8] c"1. Ascending Order\0A2. Descending order\00"
@str.11 = [15 x i8] c"Invalid input!\00"
@str.12 = [21 x i8] c"Array after sorting:\00"
define i32 @main() {
%1 = alloca [100 x i32]
%2 = alloca i32
%3 = alloca i32
%4 = bitcast [100 x i32]* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%10 = load i32, i32* %2
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %20
12: ; preds = %0, %12
%13 = phi i64 [ %16, %12 ], [ 0, %0 ]
%14 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 %13
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %14)
%16 = add nuw nsw i64 %13, 1
%17 = load i32, i32* %2
%18 = sext i32 %17 to i64
%19 = icmp slt i64 %16, %18
br i1 %19, label %12, label %20
20: ; preds = %12, %0
%21 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.9, i64 0, i64 0))
%22 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.10, i64 0, i64 0))
%23 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%24 = load i32, i32* %3
%25 = add i32 %24, -1
%26 = icmp ult i32 %25, 2
br i1 %26, label %27, label %66
27: ; preds = %20
%28 = load i32, i32* %2
%29 = add i32 %28, -1
%30 = icmp sgt i32 %28, 1
br i1 %30, label %31, label %69
31: ; preds = %27, %62
%32 = phi i32 [ %64, %62 ], [ %29, %27 ]
%33 = phi i32 [ %63, %62 ], [ 0, %27 ]
%34 = xor i32 %33, -1
%35 = add i32 %28, %34
%36 = icmp sgt i32 %35, 0
br i1 %36, label %37, label %62
37: ; preds = %31
%38 = zext i32 %32 to i64
br label %39
39: ; preds = %37, %59
%40 = phi i64 [ 0, %37 ], [ %60, %59 ]
switch i32 %24, label %41 [
i32 1, label %43
i32 2, label %51
]
41: ; preds = %39
%42 = add nuw nsw i64 %40, 1
br label %59
43: ; preds = %39
%44 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 %40
%45 = load i32, i32* %44
%46 = add nuw nsw i64 %40, 1
%47 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 %46
%48 = load i32, i32* %47
%49 = icmp sgt i32 %45, %48
br i1 %49, label %50, label %59
50: ; preds = %43
store i32 %45, i32* %47
store i32 %48, i32* %44
br label %59
51: ; preds = %39
%52 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 %40
%53 = load i32, i32* %52
%54 = add nuw nsw i64 %40, 1
%55 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 %54
%56 = load i32, i32* %55
%57 = icmp slt i32 %53, %56
br i1 %57, label %58, label %59
58: ; preds = %51
store i32 %53, i32* %55
store i32 %56, i32* %52
br label %59
59: ; preds = %41, %43, %50, %58, %51
%60 = phi i64 [ %42, %41 ], [ %46, %43 ], [ %46, %50 ], [ %54, %58 ], [ %54, %51 ]
%61 = icmp eq i64 %60, %38
br i1 %61, label %62, label %39
62: ; preds = %59, %31
%63 = add nuw nsw i32 %33, 1
%64 = add i32 %32, -1
%65 = icmp eq i32 %63, %29
br i1 %65, label %69, label %31
66: ; preds = %20
%67 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.11, i64 0, i64 0))
%68 = call i32 @exit(i32 1)
unreachable
69: ; preds = %62, %27
%70 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.12, i64 0, i64 0))
%71 = load i32, i32* %2
%72 = icmp sgt i32 %71, 0
br i1 %72, label %73, label %82
73: ; preds = %69, %73
%74 = phi i64 [ %78, %73 ], [ 0, %69 ]
%75 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 %74
%76 = load i32, i32* %75
%77 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i32 %76)
%78 = add nuw nsw i64 %74, 1
%79 = load i32, i32* %2
%80 = sext i32 %79 to i64
%81 = icmp slt i64 %78, %80
br i1 %81, label %73, label %82
82: ; preds = %73, %69
%83 = call i32 @putchar(i32 10)
ret i32 0
}