#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*/ print(int, char *, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  char letters[15];
  for (int i = 0; i < 15; i++)
    letters[i] = (char)('a' + i);
  int n, k;
  scanf("%d %d", &n, &k);
  k >>= 1;
  int upper = n < k ? k : n;
  for (int i = 0; i < upper - 1; i++)
    print(i, letters, 1);
  print(upper - 1, letters, 0);
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0xf,-0x18(%rbp)
jge    116e <main+0x3e>
mov    -0x18(%rbp),%eax
add    $0x61,%eax
mov    %al,%cl
movslq -0x18(%rbp),%rax
mov    %cl,-0x13(%rbp,%rax,1)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1146 <main+0x16>
lea    0xe8b(%rip),%rdi
lea    -0x1c(%rbp),%rsi
lea    -0x20(%rbp),%rdx
call   1050 <scanf@plt>
mov    -0x20(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    11a2 <main+0x72>
mov    -0x20(%rbp),%eax
mov    %eax,-0x2c(%rbp)
jmp    11a8 <main+0x78>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    11e5 <main+0xb5>
mov    -0x28(%rbp),%edi
lea    -0x13(%rbp),%rsi
mov    $0x1,%edx
call   1040 <print@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    11b5 <main+0x85>
mov    -0x24(%rbp),%edi
sub    $0x1,%edi
lea    -0x13(%rbp),%rsi
xor    %edx,%edx
call   1040 <print@plt>
lea    0xe09(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x20,%rsp
movabs $0x6867666564636261,%rax
66 67 68
mov    %rax,0x11(%rsp)
movl   $0x6c6b6a69,0x19(%rsp)
6c
movw   $0x6e6d,0x1d(%rsp)
movb   $0x6f,0x1f(%rsp)
lea    0xe9e(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1050 <scanf@plt>
mov    0x8(%rsp),%eax
sar    %eax
mov    %eax,0x8(%rsp)
mov    0xc(%rsp),%ecx
cmp    %eax,%ecx
cmovge %ecx,%eax
lea    -0x1(%rax),%ebx
cmp    $0x2,%eax
jl     11b6 <main+0x86>
xor    %ebp,%ebp
lea    0x11(%rsp),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebp,%edi
mov    %r14,%rsi
mov    $0x1,%edx
call   1040 <print@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    11a0 <main+0x70>
lea    0x11(%rsp),%rsi
mov    %ebx,%edi
xor    %edx,%edx
call   1040 <print@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
define i32 @main() {
%1 = alloca [15 x i8]
%2 = alloca i32
%3 = alloca i32
%4 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
store i8 97, i8* %4
%5 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 1
store i8 98, i8* %5
%6 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 2
store i8 99, i8* %6
%7 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 3
store i8 100, i8* %7
%8 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 4
store i8 101, i8* %8
%9 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 5
store i8 102, i8* %9
%10 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 6
store i8 103, i8* %10
%11 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 7
store i8 104, i8* %11
%12 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 8
store i8 105, i8* %12
%13 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 9
store i8 106, i8* %13
%14 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 10
store i8 107, i8* %14
%15 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 11
store i8 108, i8* %15
%16 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 12
store i8 109, i8* %16
%17 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 13
store i8 110, i8* %17
%18 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 14
store i8 111, i8* %18
%19 = bitcast i32* %2 to i8*
%20 = bitcast i32* %3 to i8*
%21 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%22 = load i32, i32* %3
%23 = ashr i32 %22, 1
store i32 %23, i32* %3
%24 = load i32, i32* %2
%25 = icmp slt i32 %24, %23
%26 = select i1 %25, i32 %23, i32 %24
%27 = add nsw i32 %26, -1
%28 = icmp sgt i32 %26, 1
br i1 %28, label %32, label %29
29: ; preds = %32, %0
%30 = call i32 @print(i32 %27, i8* %4, i32 0)
%31 = call i32 @putchar(i32 10)
ret i32 0
32: ; preds = %0, %32
%33 = phi i32 [ %35, %32 ], [ 0, %0 ]
%34 = call i32 @print(i32 %33, i8* %4, i32 1)
%35 = add nuw nsw i32 %33, 1
%36 = icmp eq i32 %35, %27
br i1 %36, label %29, label %32
}