#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*/ itob(int, unsigned char, char *);
int /*<<< orphan*/ printf(char *, ...);
int strtol(char *, int /*<<< orphan*/ *, int);
unsigned char strtoul(char *, int /*<<< orphan*/ *, int);
int main(int argc, char **argv) {
  if (argc < 2) {
    printf("usage: 3-5 [base < 62] ...\n");
    return 1;
  }
  int i;
  char str[32];
  unsigned char n = strtoul(argv[1], NULL, 10);
  if (n > 62 || n == 0) {
    printf("usage: 3-5 [1 < base < 62] ...\n");
    return 1;
  }
  for (i = 2; i < argc; ++i) {
    int x = strtol(argv[i], NULL, 10);
    itob(x, n, str);
    printf("%s ", str);
  }
  printf("\b\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    117a <main+0x3a>
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    123e <main+0xfe>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1060 <strtoul@plt>
mov    %al,-0x41(%rbp)
movzbl -0x41(%rbp),%eax
cmp    $0x3e,%eax
jg     11ad <main+0x6d>
movzbl -0x41(%rbp),%eax
cmp    $0x0,%eax
jne    11c7 <main+0x87>
lea    0xe68(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    123e <main+0xfe>
movl   $0x2,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1229 <main+0xe9>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1050 <strtol@plt>
mov    %eax,-0x48(%rbp)
mov    -0x48(%rbp),%edi
mov    -0x41(%rbp),%al
lea    -0x40(%rbp),%rdx
movzbl %al,%esi
call   1040 <itob@plt>
lea    -0x40(%rbp),%rsi
lea    0xe28(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11ce <main+0x8e>
lea    0xe10(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
cmp    $0x1,%edi
jg     116c <main+0x1c>
lea    0xebb(%rip),%rdi
jmp    1190 <main+0x40>
mov    %rsi,%r14
mov    %edi,%ebx
mov    0x8(%rsi),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1070 <strtoul@plt>
lea    -0x3f(%rax),%ecx
cmp    $0xc2,%cl
jae    119c <main+0x4c>
lea    0xe76(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
jmp    1201 <main+0xb1>
cmp    $0x3,%ebx
jb     11f3 <main+0xa3>
mov    %ebx,%r12d
mov    $0x2,%ebp
movzbl %al,%r13d
mov    %rsp,%rbx
lea    0xe49(%rip),%r15
nopw   0x0(%rax,%rax,1)
mov    (%r14,%rbp,8),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1060 <strtol@plt>
mov    %eax,%edi
mov    %r13d,%esi
mov    %rbx,%rdx
call   1050 <itob@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbp
cmp    %rbp,%r12
jne    11c0 <main+0x70>
lea    0xe0a(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str.2 = [4 x i8] c"%s \00"
@str = [2 x i8] c"\08\00"
@str.4 = [31 x i8] c"usage: 3-5 [1 < base < 62] ...\00"
@str.5 = [27 x i8] c"usage: 3-5 [base < 62] ...\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [32 x i8]
%4 = icmp slt i32 %0, 2
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.5, i64 0, i64 0))
br label %33
7: ; preds = %2
%8 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call zeroext i8 @strtoul(i8* nocapture %10, i32* null, i32 10)
%12 = add i8 %11, -63
%13 = icmp ult i8 %12, -62
br i1 %13, label %18, label %14
14: ; preds = %7
%15 = icmp ugt i32 %0, 2
br i1 %15, label %16, label %29
16: ; preds = %14
%17 = zext i32 %0 to i64
br label %20
18: ; preds = %7
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.4, i64 0, i64 0))
br label %31
20: ; preds = %16, %20
%21 = phi i64 [ 2, %16 ], [ %27, %20 ]
%22 = getelementptr inbounds i8*, i8** %1, i64 %21
%23 = load i8*, i8** %22
%24 = call i32 @strtol(i8* nocapture %23, i32* null, i32 10)
%25 = call i32 @itob(i32 %24, i8 zeroext %11, i8* %8)
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %8)
%27 = add nuw nsw i64 %21, 1
%28 = icmp eq i64 %27, %17
br i1 %28, label %29, label %20
29: ; preds = %20, %14
%30 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
br label %31
31: ; preds = %29, %18
%32 = phi i32 [ 1, %18 ], [ 0, %29 ]
br label %33
33: ; preds = %31, %5
%34 = phi i32 [ 1, %5 ], [ %32, %31 ]
ret i32 %34
}