#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 n, i, j, k, c = 1, range[10][4], nominal[10];
  printf("Enter number of variables: ");
  scanf("%d", &n);
  printf("Enter range of each variable: (min max)\n");
  for (i = 0; i < n; i++) {
    printf("Var %d:\t", i + 1);
    scanf("%d %d", &range[i][0], &range[i][3]);
    nominal[i] = (range[i][3] - range[i][0]) / 2 + range[i][0];
    range[i][1] = range[i][0] + 1;
    range[i][2] = range[i][3] - 1;
  }
  printf("\nId\t");
  for (i = 0; i < n; i++)
    printf("Var %d\t", i + 1);
  printf("\n");
  printf("%d\t", c++);
  for (i = 0; i < n; i++)
    printf("%d\t", nominal[i]);
  printf("\n");
  for (i = 0; i < n; i++) {
    for (k = 0; k < 4; k++) {
      printf("%d\t", c++);
      for (j = 0; j < i; j++) {
        printf("%d\t", nominal[j]);
      }
      printf("%d\t", range[i][k]);
      for (j = i + 1; j < n; j++) {
        printf("%d\t", nominal[j]);
      }
      printf("\n");
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x18(%rbp)
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf03(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    127d <main+0x15d>
mov    -0xc(%rbp),%esi
add    $0x1,%esi
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0xc(%rbp),%rax
lea    -0xc0(%rbp),%rsi
shl    $0x4,%rax
add    %rax,%rsi
movslq -0xc(%rbp),%rax
lea    -0xc0(%rbp),%rdx
shl    $0x4,%rax
add    %rax,%rdx
add    $0xc,%rdx
lea    0xe91(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
movslq -0xc(%rbp),%rcx
lea    -0xc0(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    0xc(%rax),%eax
movslq -0xc(%rbp),%rdx
lea    -0xc0(%rbp),%rcx
shl    $0x4,%rdx
add    %rdx,%rcx
sub    (%rcx),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
movslq -0xc(%rbp),%rdx
lea    -0xc0(%rbp),%rax
shl    $0x4,%rdx
add    %rdx,%rax
add    (%rax),%ecx
movslq -0xc(%rbp),%rax
mov    %ecx,-0xf0(%rbp,%rax,4)
movslq -0xc(%rbp),%rcx
lea    -0xc0(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    (%rax),%ecx
add    $0x1,%ecx
movslq -0xc(%rbp),%rdx
lea    -0xc0(%rbp),%rax
shl    $0x4,%rdx
add    %rdx,%rax
mov    %ecx,0x4(%rax)
movslq -0xc(%rbp),%rcx
lea    -0xc0(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    0xc(%rax),%ecx
sub    $0x1,%ecx
movslq -0xc(%rbp),%rdx
lea    -0xc0(%rbp),%rax
shl    $0x4,%rdx
add    %rdx,%rax
mov    %ecx,0x8(%rax)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    116e <main+0x4e>
lea    0xdd0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    12c0 <main+0x1a0>
mov    -0xc(%rbp),%esi
add    $0x1,%esi
lea    0xdae(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1292 <main+0x172>
lea    0xd7c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
lea    0xd7d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1321 <main+0x201>
movslq -0xc(%rbp),%rax
mov    -0xf0(%rbp,%rax,4),%esi
lea    0xd51(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    12ee <main+0x1ce>
lea    0xd1b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1438 <main+0x318>
movl   $0x0,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jge    1425 <main+0x305>
mov    -0x18(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
lea    0xcf8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    13a6 <main+0x286>
movslq -0x10(%rbp),%rax
mov    -0xf0(%rbp,%rax,4),%esi
lea    0xccc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1373 <main+0x253>
movslq -0xc(%rbp),%rcx
lea    -0xc0(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xc97(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1409 <main+0x2e9>
movslq -0x10(%rbp),%rax
mov    -0xf0(%rbp,%rax,4),%esi
lea    0xc69(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    13d6 <main+0x2b6>
lea    0xc33(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1349 <main+0x229>
jmp    142a <main+0x30a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1336 <main+0x216>
mov    -0x4(%rbp),%eax
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xf8,%rsp
lea    0xea8(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xec2(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0xebf(%rip),%rdi
call   1040 <puts@plt>
cmpl   $0x0,0x4(%rsp)
jle    11f7 <main+0xb7>
lea    0x5c(%rsp),%rbx
lea    0xe8b(%rip),%r14
lea    0xe8d(%rip),%r15
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
lea    0x1(%rbp),%r12
mov    %r14,%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    -0xc(%rbx),%rsi
mov    %r15,%rdi
mov    %rbx,%rdx
xor    %eax,%eax
call   1060 <scanf@plt>
mov    -0xc(%rbx),%eax
mov    (%rbx),%ecx
mov    %ecx,%edx
sub    %eax,%edx
mov    %edx,%esi
shr    $0x1f,%esi
add    %edx,%esi
sar    %esi
add    %eax,%esi
mov    %esi,0x20(%rsp,%rbp,4)
add    $0x1,%eax
mov    %eax,-0x8(%rbx)
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbx)
movslq 0x4(%rsp),%rax
add    $0x10,%rbx
mov    %r12,%rbp
cmp    %rax,%r12
jl     11a0 <main+0x60>
lea    0xe2d(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
cmpl   $0x0,0x4(%rsp)
jle    1235 <main+0xf5>
lea    0xe1d(%rip),%rbx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%ebp
mov    %rbx,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <printf@plt>
cmp    0x4(%rsp),%ebp
jl     1220 <main+0xe0>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xdee(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1050 <printf@plt>
cmpl   $0x0,0x4(%rsp)
jle    128c <main+0x14c>
lea    0xdd4(%rip),%rbx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0x20(%rsp,%rbp,4),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbp
movslq 0x4(%rsp),%rax
cmp    %rax,%rbp
jl     1270 <main+0x130>
mov    $0xa,%edi
call   1030 <putchar@plt>
cmpl   $0x0,0x4(%rsp)
jle    150d <main+0x3cd>
mov    $0x2,%r14d
mov    $0x1,%r15d
lea    0xd80(%rip),%r12
xor    %ebp,%ebp
jmp    12e8 <main+0x1a8>
nopl   0x0(%rax,%rax,1)
add    $0x4,%r14d
mov    $0xa,%edi
call   1030 <putchar@plt>
movslq 0x4(%rsp),%rax
add    $0x1,%r15
mov    0x8(%rsp),%rcx
mov    %rcx,%rbp
cmp    %rax,%rcx
jge    150d <main+0x3cd>
mov    %r15,0x18(%rsp)
lea    0x1(%rbp),%rax
mov    %rax,0x8(%rsp)
mov    %r12,%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
test   %rbp,%rbp
je     1327 <main+0x1e7>
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    0x20(%rsp,%rbx,4),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1310 <main+0x1d0>
mov    %r14d,%r13d
or     $0x1,%r13d
mov    %rbp,%rax
shl    $0x4,%rax
mov    %rax,0x10(%rsp)
mov    0x50(%rsp,%rax,1),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movslq 0x4(%rsp),%rax
cmp    %rax,0x8(%rsp)
jge    137a <main+0x23a>
mov    0x18(%rsp),%r15
nopl   0x0(%rax)
mov    0x20(%rsp,%r15,4),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%r15
cmp    %r15d,0x4(%rsp)
jg     1360 <main+0x220>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r12,%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
test   %rbp,%rbp
je     13b7 <main+0x277>
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    0x20(%rsp,%rbx,4),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    13a0 <main+0x260>
lea    0x2(%r14),%r13d
mov    0x10(%rsp),%rax
mov    0x54(%rsp,%rax,1),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movslq 0x4(%rsp),%rax
cmp    %rax,0x8(%rsp)
mov    0x18(%rsp),%r15
jge    1408 <main+0x2c8>
mov    %r15,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0x20(%rsp,%rbx,4),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbx
cmp    %ebx,0x4(%rsp)
jg     13f0 <main+0x2b0>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r12,%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
test   %rbp,%rbp
je     1447 <main+0x307>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    0x20(%rsp,%rbx,4),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1430 <main+0x2f0>
lea    0x3(%r14),%r13d
mov    0x10(%rsp),%rax
mov    0x58(%rsp,%rax,1),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movslq 0x4(%rsp),%rax
cmp    %rax,0x8(%rsp)
jge    1488 <main+0x348>
mov    %r15,%rbx
nopl   (%rax)
mov    0x20(%rsp,%rbx,4),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbx
cmp    %ebx,0x4(%rsp)
jg     1470 <main+0x330>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r12,%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
test   %rbp,%rbp
je     14c7 <main+0x387>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    0x20(%rsp,%rbx,4),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    14b0 <main+0x370>
mov    0x10(%rsp),%rax
mov    0x5c(%rsp,%rax,1),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movslq 0x4(%rsp),%rax
cmp    %rax,0x8(%rsp)
jge    12c0 <main+0x180>
mov    %r15,%rbx
nopl   (%rax)
mov    0x20(%rsp,%rbx,4),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbx
cmp    %ebx,0x4(%rsp)
jg     14f0 <main+0x3b0>
jmp    12c0 <main+0x180>
xor    %eax,%eax
add    $0xf8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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