#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);
int /*<<< orphan*/ scanf(char *, int *, ...);
int main() {
  int N, p, q, i = 0, j, c;
  scanf("%d", &N);
  while (N >= 1) {
    scanf("%d%d", &p, &q);
    if (p == q)
      printf("%d\n\n", p);
    else {
      if (q < p) {
        c = q, q = p, p = c;
        for (j = p; j <= q - 1; j++) {
          printf("%d ", j);
        }
        printf("%d\n\n", q);
      } else {
        for (j = p; j <= q - 1; j++) {
          printf("%d ", j);
        }
        printf("%d\n\n", q);
      }
    }
    N--;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0xec5(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
cmpl   $0x1,-0x8(%rbp)
jl     1244 <main+0x124>
lea    0xea7(%rip),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    1188 <main+0x68>
mov    -0xc(%rbp),%esi
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
jmp    1236 <main+0x116>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11ee <main+0xce>
mov    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     11da <main+0xba>
mov    -0x18(%rbp),%esi
lea    0xe43(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11ac <main+0x8c>
mov    -0x10(%rbp),%esi
lea    0xe21(%rip),%rdi
call   1030 <printf@plt>
jmp    1231 <main+0x111>
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     1222 <main+0x102>
mov    -0x18(%rbp),%esi
lea    0xdfb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11f4 <main+0xd4>
mov    -0x10(%rbp),%esi
lea    0xdd9(%rip),%rdi
call   1030 <printf@plt>
jmp    1236 <main+0x116>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1148 <main+0x28>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xecd(%rip),%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmpl   $0x0,0x10(%rsp)
jle    120a <main+0xea>
lea    0xead(%rip),%r14
lea    0x14(%rsp),%r15
lea    0xc(%rsp),%r12
lea    0xea1(%rip),%r13
lea    0xe9f(%rip),%rbx
jmp    118e <main+0x6e>
nopl   (%rax)
mov    %ebp,%esi
mov    %r13,%rdi
call   1030 <printf@plt>
mov    0x10(%rsp),%eax
lea    -0x1(%rax),%ecx
mov    %ecx,0x10(%rsp)
cmp    $0x1,%eax
jle    120a <main+0xea>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x14(%rsp),%ebp
mov    0xc(%rsp),%esi
cmp    %esi,%ebp
je     1170 <main+0x50>
jle    11e0 <main+0xc0>
mov    %ebp,0xc(%rsp)
mov    %esi,0x14(%rsp)
mov    %esi,%ebp
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
add    $0x1,%ebp
mov    0xc(%rsp),%esi
cmp    %esi,%ebp
jl     11c0 <main+0xa0>
jmp    1172 <main+0x52>
nopw   0x0(%rax,%rax,1)
jge    1172 <main+0x52>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
add    $0x1,%ebp
mov    0xc(%rsp),%esi
cmp    %esi,%ebp
jl     11f0 <main+0xd0>
jmp    1172 <main+0x52>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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