#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, int *, int *);
scalar_t__ is_dualpal(int);
int main() {
  FILE *fin = fopen("dualpal.in", "r");
  FILE *fout = fopen("dualpal.out", "w");
  int i, num, start;
  fscanf(fin, "%d %d", &num, &start);
  for (i = start + 1;; i++) {
    if (is_dualpal(i)) {
      if (num-- <= 0)
        break;
      fprintf(fout, "%d\n", i);
    }
  }
  fclose(fin);
  fclose(fout);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe9a(%rip),%rdi
lea    0xe9e(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x10(%rbp)
lea    0xe90(%rip),%rdi
lea    0xe95(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe83(%rip),%rsi
lea    -0x20(%rbp),%rdx
lea    -0x24(%rbp),%rcx
call   1040 <fscanf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
call   1060 <is_dualpal@plt>
cmp    $0x0,%rax
je     11ec <main+0x9c>
mov    -0x20(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x20(%rbp)
cmp    $0x0,%eax
jg     11d9 <main+0x89>
jmp    11ff <main+0xaf>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%edx
lea    0xe3a(%rip),%rsi
call   1050 <fprintf@plt>
jmp    11f1 <main+0xa1>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11ae <main+0x5e>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
lea    0xea2(%rip),%rdi
lea    0xea6(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,%r14
lea    0xe99(%rip),%rdi
lea    0xe9e(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,%rbx
lea    0xe91(%rip),%rsi
mov    %rsp,%rdx
lea    0x4(%rsp),%rcx
mov    %r14,%rdi
call   1040 <fscanf@plt>
mov    0x4(%rsp),%ebp
add    $0x1,%ebp
lea    0xe79(%rip),%r15
jmp    11b3 <main+0x63>
nopw   0x0(%rax,%rax,1)
add    $0x1,%ebp
mov    %ebp,%edi
call   1060 <is_dualpal@plt>
test   %rax,%rax
je     11b0 <main+0x60>
mov    (%rsp),%eax
lea    -0x1(%rax),%ecx
mov    %ecx,(%rsp)
test   %eax,%eax
jle    11de <main+0x8e>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %ebp,%edx
call   1050 <fprintf@plt>
add    $0x1,%ebp
jmp    11b3 <main+0x63>
mov    %r14,%rdi
call   1030 <fclose@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"dualpal.in\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [12 x i8] c"dualpal.out\00"
@.str.3 = [2 x i8] c"w\00"
@.str.4 = [6 x i8] c"%d %d\00"
@.str.5 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
%7 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %7, i32** %2
%8 = call i32* @fopen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %8, i32** %3
%9 = load i32*, i32** %2
%10 = call i32 @fscanf(i32* %9, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32* %5, i32* %6)
%11 = load i32, i32* %6
%12 = add nsw i32 %11, 1
store i32 %12, i32* %4
br label %13
13: ; preds = %27, %0
%14 = load i32, i32* %4
%15 = call i64 @is_dualpal(i32 %14)
%16 = icmp ne i64 %15, 0
br i1 %16, label %17, label %26
17: ; preds = %13
%18 = load i32, i32* %5
%19 = add nsw i32 %18, -1
store i32 %19, i32* %5
%20 = icmp sle i32 %18, 0
br i1 %20, label %21, label %22
21: ; preds = %17
br label %30
22: ; preds = %17
%23 = load i32*, i32** %3
%24 = load i32, i32* %4
%25 = call i32 @fprintf(i32* %23, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %24)
br label %26
26: ; preds = %22, %13
br label %27
27: ; preds = %26
%28 = load i32, i32* %4
%29 = add nsw i32 %28, 1
store i32 %29, i32* %4
br label %13
30: ; preds = %21
%31 = load i32*, i32** %2
%32 = call i32 @fclose(i32* %31)
%33 = load i32*, i32** %3
%34 = call i32 @fclose(i32* %33)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"dualpal.in\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [12 x i8] c"dualpal.out\00"
@.str.3 = [2 x i8] c"w\00"
@.str.4 = [6 x i8] c"%d %d\00"
@.str.5 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = tail call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32* @fopen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = call i32 @fscanf(i32* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32* %1, i32* %2)
%8 = load i32, i32* %2
br label %9
9: ; preds = %14, %0
%10 = phi i32 [ %8, %0 ], [ %11, %14 ]
%11 = add nsw i32 %10, 1
%12 = call i64 @is_dualpal(i32 %11)
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %9, %19
br label %9
15: ; preds = %9
%16 = load i32, i32* %1
%17 = add nsw i32 %16, -1
store i32 %17, i32* %1
%18 = icmp slt i32 %16, 1
br i1 %18, label %21, label %19
19: ; preds = %15
%20 = call i32 @fprintf(i32* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %11)
br label %14
21: ; preds = %15
%22 = call i32 @fclose(i32* %3)
%23 = call i32 @fclose(i32* %4)
ret i32 0
}