#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 */
unsigned short atoi(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  unsigned short i;
  if (argc == 2) {
    i = atoi(argv[1]);
    if (i < 32 || i > 255)
      printf("ascii: call without arguments or with a number between 32 and "
             "255\n");
    else
      printf("%2x: %c\n", i, (unsigned char)i);
  } else {
    for (i = 32; i < 256; i++) {
      printf("%2x: %c ", i, (unsigned char)i);
      if (i % 13 == 5)
        printf("\n");
    }
    printf("\n");
  }
  exit(0);
}


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)
jne    11ae <main+0x7e>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %ax,-0x12(%rbp)
movzwl -0x12(%rbp),%eax
cmp    $0x20,%eax
jl     117d <main+0x4d>
movzwl -0x12(%rbp),%eax
cmp    $0xff,%eax
jle    1190 <main+0x60>
lea    0xe7c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11a9 <main+0x79>
movzwl -0x12(%rbp),%esi
mov    -0x12(%rbp),%ax
movzbl %al,%edx
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1223 <main+0xf3>
movw   $0x20,-0x12(%rbp)
movzwl -0x12(%rbp),%eax
cmp    $0x100,%eax
jge    1215 <main+0xe5>
movzwl -0x12(%rbp),%esi
mov    -0x12(%rbp),%ax
movzbl %al,%edx
lea    0xe77(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movzwl -0x12(%rbp),%eax
mov    $0xd,%ecx
cltd
idiv   %ecx
cmp    $0x5,%edx
jne    11ff <main+0xcf>
lea    0xe49(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1204 <main+0xd4>
mov    -0x12(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x12(%rbp)
jmp    11b4 <main+0x84>
lea    0xe25(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
cmp    $0x2,%edi
jne    118b <main+0x3b>
mov    0x8(%rsi),%rdi
call   1060 <atoi@plt>
lea    -0x100(%rax),%ecx
movzwl %cx,%ecx
cmp    $0xff1f,%ecx
ja     11f9 <main+0xa9>
lea    0xe93(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   1070 <exit@plt>
mov    $0x20,%ebx
lea    0xe72(%rip),%r14
jmp    11ab <main+0x5b>
nopl   0x0(%rax)
add    $0x1,%ebx
cmp    $0x100,%ebx
je     11e8 <main+0x98>
movzwl %bx,%eax
imul   $0x4ec5,%eax,%eax
shr    $0x12,%eax
lea    (%rax,%rax,2),%ecx
lea    (%rax,%rcx,4),%r15d
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
xor    %eax,%eax
call   1050 <printf@plt>
neg    %r15d
lea    (%rbx,%r15,1),%eax
add    $0x1b,%eax
cmp    $0x20,%ax
jne    11a0 <main+0x50>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    11a0 <main+0x50>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %edi,%edi
call   1070 <exit@plt>
movzwl %ax,%edx
lea    0xdfd(%rip),%rdi
mov    %edx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %edi,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [67 x i8] c"ascii: call without arguments or with a number between 32 and 255\0A\00"
@.str.1 = [9 x i8] c"%2x: %c\0A\00"
@.str.2 = [9 x i8] c"%2x: %c \00"
@.str.3 = [2 x i8] c"\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i16
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 2
br i1 %8, label %9, label %31
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call zeroext i16 @atoi(i8* %12)
store i16 %13, i16* %6
%14 = load i16, i16* %6
%15 = zext i16 %14 to i32
%16 = icmp slt i32 %15, 32
br i1 %16, label %21, label %17
17: ; preds = %9
%18 = load i16, i16* %6
%19 = zext i16 %18 to i32
%20 = icmp sgt i32 %19, 255
br i1 %20, label %21, label %23
21: ; preds = %17, %9
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0))
br label %30
23: ; preds = %17
%24 = load i16, i16* %6
%25 = zext i16 %24 to i32
%26 = load i16, i16* %6
%27 = trunc i16 %26 to i8
%28 = zext i8 %27 to i32
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %25, i32 %28)
br label %30
30: ; preds = %23, %21
br label %55
31: ; preds = %2
store i16 32, i16* %6
br label %32
32: ; preds = %50, %31
%33 = load i16, i16* %6
%34 = zext i16 %33 to i32
%35 = icmp slt i32 %34, 256
br i1 %35, label %36, label %53
36: ; preds = %32
%37 = load i16, i16* %6
%38 = zext i16 %37 to i32
%39 = load i16, i16* %6
%40 = trunc i16 %39 to i8
%41 = zext i8 %40 to i32
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 %38, i32 %41)
%43 = load i16, i16* %6
%44 = zext i16 %43 to i32
%45 = srem i32 %44, 13
%46 = icmp eq i32 %45, 5
br i1 %46, label %47, label %49
47: ; preds = %36
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %49
49: ; preds = %47, %36
br label %50
50: ; preds = %49
%51 = load i16, i16* %6
%52 = add i16 %51, 1
store i16 %52, i16* %6
br label %32
53: ; preds = %32
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %55
55: ; preds = %53, %30
%56 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str.1 = [9 x i8] c"%2x: %c\0A\00"
@.str.2 = [9 x i8] c"%2x: %c \00"
@str = [66 x i8] c"ascii: call without arguments or with a number between 32 and 255\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %15
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call zeroext i16 @atoi(i8* %6)
%8 = add i16 %7, -256
%9 = icmp ult i16 %8, -224
br i1 %9, label %10, label %12
10: ; preds = %4
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @str, i64 0, i64 0))
br label %28
12: ; preds = %4
%13 = zext i16 %7 to i32
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %13, i32 %13)
br label %28
15: ; preds = %2, %23
%16 = phi i32 [ %24, %23 ], [ 32, %2 ]
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 %16, i32 %16)
%18 = trunc i32 %16 to i16
%19 = urem i16 %18, 13
%20 = icmp eq i16 %19, 5
br i1 %20, label %21, label %23
21: ; preds = %15
%22 = tail call i32 @putchar(i32 10)
br label %23
23: ; preds = %15, %21
%24 = add nuw nsw i32 %16, 1
%25 = icmp eq i32 %24, 256
br i1 %25, label %26, label %15
26: ; preds = %23
%27 = tail call i32 @putchar(i32 10)
br label %28
28: ; preds = %10, %12, %26
%29 = tail call i32 @exit(i32 0)
unreachable
}