#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 */
scalar_t__ atoi(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ isdigit(char);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  unsigned char code;
  int ii, i;
  printf("\n");
  if (argc > 1) {
    if (isdigit(*argv[1])) {
      code = (unsigned char)atoi(argv[1]);
      printf("Code %3d is letter %c\n", code, code);
      exit(0);
    } else {
      code = (unsigned char)*argv[1];
      printf("Char %c is %3d\n", code, code);
    }
  } else {
    for (i = 0; i < 32; i++) {
      for (ii = 1; ii < 8; ii++) {
        code = (unsigned char)(i + ii * 32);
        printf("%3d [0x%x] - %c\t", code, code, code);
      }
      printf("\n");
    }
  }
  return 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)
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmpl   $0x1,-0x8(%rbp)
jle    11dd <main+0x9d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     11b5 <main+0x75>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %al,-0x11(%rbp)
movzbl -0x11(%rbp),%esi
movzbl -0x11(%rbp),%edx
lea    0xe59(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
movzbl -0x11(%rbp),%esi
movzbl -0x11(%rbp),%edx
lea    0xe46(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1256 <main+0x116>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x20,-0x1c(%rbp)
jge    1251 <main+0x111>
movl   $0x1,-0x18(%rbp)
cmpl   $0x8,-0x18(%rbp)
jge    1235 <main+0xf5>
mov    -0x1c(%rbp),%eax
mov    -0x18(%rbp),%ecx
shl    $0x5,%ecx
add    %ecx,%eax
mov    %al,-0x11(%rbp)
movzbl -0x11(%rbp),%esi
movzbl -0x11(%rbp),%edx
movzbl -0x11(%rbp),%ecx
lea    0xe07(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11f5 <main+0xb5>
lea    0xdd9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11e4 <main+0xa4>
jmp    1256 <main+0x116>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %edi,%ebp
mov    $0xa,%edi
call   1030 <putchar@plt>
cmp    $0x1,%ebp
jle    1199 <main+0x49>
mov    0x8(%rbx),%rax
movsbl (%rax),%edi
call   1040 <isdigit@plt>
mov    0x8(%rbx),%rdi
test   %rax,%rax
jne    124c <main+0xfc>
movzbl (%rdi),%edx
lea    0xe8c(%rip),%rdi
mov    %edx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    1245 <main+0xf5>
mov    $0xe0,%ebx
lea    0xe82(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
lea    -0xc0(%rbx),%ecx
mov    %r14,%rdi
mov    %ecx,%esi
mov    %ecx,%edx
xor    %eax,%eax
call   1050 <printf@plt>
lea    -0xa0(%rbx),%ecx
mov    %r14,%rdi
mov    %ecx,%esi
mov    %ecx,%edx
xor    %eax,%eax
call   1050 <printf@plt>
lea    -0x80(%rbx),%ecx
mov    %r14,%rdi
mov    %ecx,%esi
mov    %ecx,%edx
xor    %eax,%eax
call   1050 <printf@plt>
lea    -0x60(%rbx),%ecx
mov    %r14,%rdi
mov    %ecx,%esi
mov    %ecx,%edx
xor    %eax,%eax
call   1050 <printf@plt>
lea    -0x40(%rbx),%ecx
mov    %r14,%rdi
mov    %ecx,%esi
mov    %ecx,%edx
xor    %eax,%eax
call   1050 <printf@plt>
lea    -0x20(%rbx),%ecx
mov    %r14,%rdi
mov    %ecx,%esi
mov    %ecx,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
mov    %ebx,%ecx
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
cmp    $0x100,%ebx
jne    11b0 <main+0x60>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret
call   1060 <atoi@plt>
movzbl %al,%edx
lea    0xda5(%rip),%rdi
mov    %edx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %edi,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [23 x i8] c"Code %3d is letter %c\0A\00"
@.str.2 = [16 x i8] c"Char %c is %3d\0A\00"
@.str.3 = [17 x i8] c"%3d [0x%x] - %c\09\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* %4
%11 = icmp sgt i32 %10, 1
br i1 %11, label %12, label %42
12: ; preds = %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = load i8, i8* %15
%17 = call i64 @isdigit(i8 signext %16)
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %31
19: ; preds = %12
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 1
%22 = load i8*, i8** %21
%23 = call i64 @atoi(i8* %22)
%24 = trunc i64 %23 to i8
store i8 %24, i8* %6
%25 = load i8, i8* %6
%26 = zext i8 %25 to i32
%27 = load i8, i8* %6
%28 = zext i8 %27 to i32
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %26, i32 %28)
%30 = call i32 @exit(i32 0)
unreachable
31: ; preds = %12
%32 = load i8**, i8*** %5
%33 = getelementptr inbounds i8*, i8** %32, i64 1
%34 = load i8*, i8** %33
%35 = load i8, i8* %34
store i8 %35, i8* %6
%36 = load i8, i8* %6
%37 = zext i8 %36 to i32
%38 = load i8, i8* %6
%39 = zext i8 %38 to i32
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %37, i32 %39)
br label %41
41: ; preds = %31
br label %72
42: ; preds = %2
store i32 0, i32* %8
br label %43
43: ; preds = %68, %42
%44 = load i32, i32* %8
%45 = icmp slt i32 %44, 32
br i1 %45, label %46, label %71
46: ; preds = %43
store i32 1, i32* %7
br label %47
47: ; preds = %63, %46
%48 = load i32, i32* %7
%49 = icmp slt i32 %48, 8
br i1 %49, label %50, label %66
50: ; preds = %47
%51 = load i32, i32* %8
%52 = load i32, i32* %7
%53 = mul nsw i32 %52, 32
%54 = add nsw i32 %51, %53
%55 = trunc i32 %54 to i8
store i8 %55, i8* %6
%56 = load i8, i8* %6
%57 = zext i8 %56 to i32
%58 = load i8, i8* %6
%59 = zext i8 %58 to i32
%60 = load i8, i8* %6
%61 = zext i8 %60 to i32
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i32 %57, i32 %59, i32 %61)
br label %63
63: ; preds = %50
%64 = load i32, i32* %7
%65 = add nsw i32 %64, 1
store i32 %65, i32* %7
br label %47
66: ; preds = %47
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %68
68: ; preds = %66
%69 = load i32, i32* %8
%70 = add nsw i32 %69, 1
store i32 %70, i32* %8
br label %43
71: ; preds = %43
br label %72
72: ; preds = %71, %41
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [23 x i8] c"Code %3d is letter %c\0A\00"
@.str.2 = [16 x i8] c"Char %c is %3d\0A\00"
@.str.3 = [17 x i8] c"%3d [0x%x] - %c\09\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 @putchar(i32 10)
%4 = icmp sgt i32 %0, 1
br i1 %4, label %5, label %22
5: ; preds = %2
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = load i8, i8* %7
%9 = tail call i64 @isdigit(i8 signext %8)
%10 = icmp eq i64 %9, 0
%11 = load i8*, i8** %6
br i1 %10, label %18, label %12
12: ; preds = %5
%13 = tail call i64 @atoi(i8* %11)
%14 = trunc i64 %13 to i32
%15 = and i32 %14, 255
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %15, i32 %15)
%17 = tail call i32 @exit(i32 0)
unreachable
18: ; preds = %5
%19 = load i8, i8* %11
%20 = zext i8 %19 to i32
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %20, i32 %20)
br label %41
22: ; preds = %2, %22
%23 = phi i32 [ %39, %22 ], [ 0, %2 ]
%24 = add nuw nsw i32 %23, 32
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i32 %24, i32 %24, i32 %24)
%26 = add nuw nsw i32 %23, 64
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i32 %26, i32 %26, i32 %26)
%28 = add nuw nsw i32 %23, 96
%29 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i32 %28, i32 %28, i32 %28)
%30 = add nuw nsw i32 %23, 128
%31 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i32 %30, i32 %30, i32 %30)
%32 = add nuw nsw i32 %23, 160
%33 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i32 %32, i32 %32, i32 %32)
%34 = add nuw nsw i32 %23, 192
%35 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i32 %34, i32 %34, i32 %34)
%36 = add nuw nsw i32 %23, 224
%37 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i32 %36, i32 %36, i32 %36)
%38 = tail call i32 @putchar(i32 10)
%39 = add nuw nsw i32 %23, 1
%40 = icmp eq i32 %39, 32
br i1 %40, label %41, label %22
41: ; preds = %22, %18
ret i32 0
}