#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 EXIT_FAILURE;
char ffs(int);
int /*<<< orphan*/ putchar(char);
long strtol(char *, int /*<<< orphan*/ *, int);
int main(int argc, char *argv[]) {
  if (argc < 2) {
    return EXIT_FAILURE;
  }
  long n = strtol(argv[1], NULL, 10);
  for (int i = 1; i < (1 << n); i++) {
    putchar('`' + ffs(i));
  }
  putchar('\n');
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1161 <main+0x31>
mov    0x2e89(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11c8 <main+0x98>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1040 <strtol@plt>
mov    %rax,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x18(%rbp),%rcx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
cmp    %ecx,%eax
jge    11be <main+0x8e>
mov    -0x1c(%rbp),%edi
call   1050 <ffs@plt>
movsbl %al,%eax
add    $0x60,%eax
movsbl %al,%edi
call   1030 <putchar@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1182 <main+0x52>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
cmp    $0x1,%edi
jg     1145 <main+0x15>
mov    0x2ea0(%rip),%rax
mov    (%rax),%r14d
jmp    1192 <main+0x62>
mov    0x8(%rsi),%rdi
xor    %r14d,%r14d
xor    %esi,%esi
mov    $0xa,%edx
call   1040 <strtol@plt>
mov    $0x1,%ebp
mov    $0x1,%ebx
mov    %eax,%ecx
shl    %cl,%ebx
cmp    $0x2,%ebx
jl     1188 <main+0x58>
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
call   1050 <ffs@plt>
add    $0x60,%al
movsbl %al,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    1170 <main+0x40>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 2
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load i32, i32* @EXIT_FAILURE
store i32 %11, i32* %3
br label %35
12: ; preds = %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = call i64 @strtol(i8* %15, i32* null, i32 10)
store i64 %16, i64* %6
store i32 1, i32* %7
br label %17
17: ; preds = %30, %12
%18 = load i32, i32* %7
%19 = load i64, i64* %6
%20 = trunc i64 %19 to i32
%21 = shl i32 1, %20
%22 = icmp slt i32 %18, %21
br i1 %22, label %23, label %33
23: ; preds = %17
%24 = load i32, i32* %7
%25 = call signext i8 @ffs(i32 %24)
%26 = sext i8 %25 to i32
%27 = add nsw i32 96, %26
%28 = trunc i32 %27 to i8
%29 = call i32 @putchar(i8 signext %28)
br label %30
30: ; preds = %23
%31 = load i32, i32* %7
%32 = add nsw i32 %31, 1
store i32 %32, i32* %7
br label %17
33: ; preds = %17
%34 = call i32 @putchar(i8 signext 10)
br label %35
35: ; preds = %33, %10
%36 = load i32, i32* %3
ret i32 %36
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = load i32, i32* @EXIT_FAILURE
br label %22
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i64 @strtol(i8* nocapture %8, i32* null, i32 10)
%10 = trunc i64 %9 to i32
%11 = shl nuw i32 1, %10
%12 = icmp sgt i32 %11, 1
br i1 %12, label %15, label %13
13: ; preds = %15, %6
%14 = tail call i32 @putchar(i8 signext 10)
br label %22
15: ; preds = %6, %15
%16 = phi i32 [ %20, %15 ], [ 1, %6 ]
%17 = tail call signext i8 @ffs(i32 %16)
%18 = add i8 %17, 96
%19 = tail call i32 @putchar(i8 signext %18)
%20 = add nuw nsw i32 %16, 1
%21 = icmp eq i32 %20, %11
br i1 %21, label %13, label %15
22: ; preds = %13, %4
%23 = phi i32 [ %5, %4 ], [ 0, %13 ]
ret i32 %23
}