#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*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcmp(char *, char *);
void main(int argc, char **argv) {
  char buffer[512];
  char *q, *p = buffer;
  if (argc != 4) {
  usage:
    fprintf(stderr, "usage: copyright [ 020 | v37 | v33 ] <version> <date>\n");
    exit(10);
  }
  if (!strcmp(argv[1], "020"))
    q = " [68020]";
  else if (!strcmp(argv[1], "v33"))
    q = " [KS 1.3]";
  else if (!strcmp(argv[1], "v37"))
    q = "";
  else
    goto usage;
  sprintf(buffer,
          "translator.library %s %s%s\n"
          "\n"
          "Copyright © 1995 Francesco Devitt\n"
          "(Internet: ffranc@comp.vuw.ac.nz)\n"
          "\n",
          argv[2], argv[3], q);
  for (;;) {
    char ch = *p++;
    char nc;
    nc = ch ^ (128 + 16);
    printf("%d, ", (unsigned char)nc);
    if (!ch)
      break;
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x230,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x210(%rbp),%rax
mov    %rax,-0x220(%rbp)
cmpl   $0x4,-0x4(%rbp)
je     119e <main+0x4e>
jmp    117f <main+0x2f>
mov    0x2e5a(%rip),%rax
mov    (%rax),%edi
lea    0xe71(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0xa,%edi
call   1070 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe8a(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    11ce <main+0x7e>
lea    0xe79(%rip),%rax
mov    %rax,-0x218(%rbp)
jmp    123d <main+0xed>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe67(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    11fe <main+0xae>
lea    0xe56(%rip),%rax
mov    %rax,-0x218(%rbp)
jmp    1238 <main+0xe8>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe45(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    122e <main+0xde>
lea    0xe96(%rip),%rax
mov    %rax,-0x218(%rbp)
jmp    1233 <main+0xe3>
jmp    117f <main+0x2f>
jmp    1238 <main+0xe8>
jmp    123d <main+0xed>
lea    -0x210(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdx
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rcx
mov    -0x218(%rbp),%r8
lea    0xdf4(%rip),%rsi
call   1060 <sprintf@plt>
mov    -0x220(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x220(%rbp)
mov    (%rax),%al
mov    %al,-0x221(%rbp)
movsbl -0x221(%rbp),%eax
xor    $0x90,%eax
mov    %al,-0x222(%rbp)
movzbl -0x222(%rbp),%esi
lea    0xe15(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpb   $0x0,-0x221(%rbp)
jne    12bd <main+0x16d>
jmp    12c2 <main+0x172>
jmp    1267 <main+0x117>
lea    0xdee(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x230,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x200,%rsp
cmp    $0x4,%edi
jne    1222 <main+0xc2>
mov    %rsi,%r14
mov    0x8(%rsi),%rbx
lea    0xeb5(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %eax,%eax
je     11bd <main+0x5d>
lea    0xeaf(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %eax,%eax
je     11c6 <main+0x66>
lea    0xeaa(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %eax,%eax
jne    1222 <main+0xc2>
lea    0xefd(%rip),%r8
jmp    11cd <main+0x6d>
lea    0xe77(%rip),%r8
jmp    11cd <main+0x6d>
lea    0xe7b(%rip),%r8
mov    %rsp,%rbx
mov    0x10(%r14),%rdx
mov    0x18(%r14),%rcx
lea    0xe77(%rip),%rsi
mov    %rbx,%rdi
call   1070 <sprintf@plt>
lea    0xecb(%rip),%r14
xchg   %ax,%ax
movzbl (%rbx),%ebp
add    $0x1,%rbx
mov    %ebp,%esi
xor    $0x90,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   %ebp,%ebp
jne    11f0 <main+0x90>
mov    $0xa,%edi
add    $0x200,%rsp
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <putchar@plt>
mov    0x2db7(%rip),%rax
mov    (%rax),%edi
lea    0xdce(%rip),%rsi
call   1060 <fprintf@plt>
mov    $0xa,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [55 x i8] c"usage: copyright [ 020 | v37 | v33 ] <version> <date>\0A\00"
@.str.1 = [4 x i8] c"020\00"
@.str.2 = [9 x i8] c" [68020]\00"
@.str.3 = [4 x i8] c"v33\00"
@.str.4 = [10 x i8] c" [KS 1.3]\00"
@.str.5 = [4 x i8] c"v37\00"
@.str.6 = [1 x i8] zeroinitializer
@.str.7 = [99 x i8] c"translator.library %s %s%s\0A\0ACopyright \C2\A9 1995 Francesco Devitt\0A(Internet: ffranc@comp.vuw.ac.nz)\0A\0A\00"
@.str.8 = [5 x i8] c"%d, \00"
@.str.9 = [2 x i8] c"\0A\00"
define void @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca [512 x i8]
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8
%9 = alloca i8
store i32 %0, i32* %3
store i8** %1, i8*** %4
%10 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
store i8* %10, i8** %7
%11 = load i32, i32* %3
%12 = icmp ne i32 %11, 4
br i1 %12, label %13, label %18
13: ; preds = %2
br label %14
14: ; preds = %39, %13
%15 = load i32, i32* @stderr
%16 = call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%17 = call i32 @exit(i32 10)
unreachable
18: ; preds = %2
%19 = load i8**, i8*** %4
%20 = getelementptr inbounds i8*, i8** %19, i64 1
%21 = load i8*, i8** %20
%22 = call i32 @strcmp(i8* %21, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%23 = icmp ne i32 %22, 0
br i1 %23, label %25, label %24
24: ; preds = %18
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8** %6
br label %42
25: ; preds = %18
%26 = load i8**, i8*** %4
%27 = getelementptr inbounds i8*, i8** %26, i64 1
%28 = load i8*, i8** %27
%29 = call i32 @strcmp(i8* %28, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%30 = icmp ne i32 %29, 0
br i1 %30, label %32, label %31
31: ; preds = %25
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i8** %6
br label %41
32: ; preds = %25
%33 = load i8**, i8*** %4
%34 = getelementptr inbounds i8*, i8** %33, i64 1
%35 = load i8*, i8** %34
%36 = call i32 @strcmp(i8* %35, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%37 = icmp ne i32 %36, 0
br i1 %37, label %39, label %38
38: ; preds = %32
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.6, i64 0, i64 0), i8** %6
br label %40
39: ; preds = %32
br label %14
40: ; preds = %38
br label %41
41: ; preds = %40, %31
br label %42
42: ; preds = %41, %24
%43 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%44 = load i8**, i8*** %4
%45 = getelementptr inbounds i8*, i8** %44, i64 2
%46 = load i8*, i8** %45
%47 = load i8**, i8*** %4
%48 = getelementptr inbounds i8*, i8** %47, i64 3
%49 = load i8*, i8** %48
%50 = load i8*, i8** %6
%51 = call i32 @sprintf(i8* %43, i8* getelementptr inbounds ([99 x i8], [99 x i8]* @.str.7, i64 0, i64 0), i8* %46, i8* %49, i8* %50)
br label %52
52: ; preds = %66, %42
%53 = load i8*, i8** %7
%54 = getelementptr inbounds i8, i8* %53, i32 1
store i8* %54, i8** %7
%55 = load i8, i8* %53
store i8 %55, i8* %8
%56 = load i8, i8* %8
%57 = sext i8 %56 to i32
%58 = xor i32 %57, 144
%59 = trunc i32 %58 to i8
store i8 %59, i8* %9
%60 = load i8, i8* %9
%61 = zext i8 %60 to i32
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i32 %61)
%63 = load i8, i8* %8
%64 = icmp ne i8 %63, 0
br i1 %64, label %66, label %65
65: ; preds = %52
br label %67
66: ; preds = %52
br label %52
67: ; preds = %65
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [55 x i8] c"usage: copyright [ 020 | v37 | v33 ] <version> <date>\0A\00"
@.str.1 = [4 x i8] c"020\00"
@.str.2 = [9 x i8] c" [68020]\00"
@.str.3 = [4 x i8] c"v33\00"
@.str.4 = [10 x i8] c" [KS 1.3]\00"
@.str.5 = [4 x i8] c"v37\00"
@.str.6 = [1 x i8] zeroinitializer
@.str.7 = [99 x i8] c"translator.library %s %s%s\0A\0ACopyright \C2\A9 1995 Francesco Devitt\0A(Internet: ffranc@comp.vuw.ac.nz)\0A\0A\00"
@.str.8 = [5 x i8] c"%d, \00"
define void @main(i32 %0, i8** nocapture %1) {
%3 = alloca [512 x i8]
%4 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%5 = icmp eq i32 %0, 4
br i1 %5, label %10, label %6
6: ; preds = %18, %2
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @exit(i32 10)
unreachable
10: ; preds = %2
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = load i8*, i8** %11
%13 = tail call i32 @strcmp(i8* dereferenceable(1) %12, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%14 = icmp eq i32 %13, 0
br i1 %14, label %21, label %15
15: ; preds = %10
%16 = tail call i32 @strcmp(i8* dereferenceable(1) %12, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%17 = icmp eq i32 %16, 0
br i1 %17, label %21, label %18
18: ; preds = %15
%19 = tail call i32 @strcmp(i8* dereferenceable(1) %12, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %6
21: ; preds = %18, %15, %10
%22 = phi i8* [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), %10 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), %15 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.6, i64 0, i64 0), %18 ]
%23 = getelementptr inbounds i8*, i8** %1, i64 2
%24 = load i8*, i8** %23
%25 = getelementptr inbounds i8*, i8** %1, i64 3
%26 = load i8*, i8** %25
%27 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([99 x i8], [99 x i8]* @.str.7, i64 0, i64 0), i8* %24, i8* %26, i8* %22)
br label %28
28: ; preds = %28, %21
%29 = phi i8* [ %4, %21 ], [ %30, %28 ]
%30 = getelementptr inbounds i8, i8* %29, i64 1
%31 = load i8, i8* %29
%32 = xor i8 %31, -112
%33 = zext i8 %32 to i32
%34 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i32 %33)
%35 = icmp eq i8 %31, 0
br i1 %35, label %36, label %28
36: ; preds = %28
%37 = tail call i32 @putchar(i32 10)
ret void
}