#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*/ printf(char *, char *, char *);
int /*<<< orphan*/ reg_convert(char *, char *, char *);
unsigned long time(int /*<<< orphan*/ *);
int main(int argc, char *argv[]) {
  char buffer[512], code[8];
  unsigned long t = time(NULL);
  int b1 = t % 26, b2 = (t / 26) % 26, b3 = (t / 26 / 26) % 26;
  code[0] = '@' + b1;
  code[1] = '@' + b2;
  code[2] = '@' + b3;
  code[3] = '\0';
  if (argc != 2)
    return 1;
  reg_convert(argv[1], code, buffer);
  printf("name=%s\ncode=%s\n", argv[1], buffer);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x230,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %rax,-0x220(%rbp)
mov    -0x220(%rbp),%rax
mov    $0x1a,%ecx
xor    %edx,%edx
div    %rcx
mov    %edx,%eax
mov    %eax,-0x224(%rbp)
mov    -0x220(%rbp),%rax
mov    $0x1a,%ecx
xor    %edx,%edx
div    %rcx
mov    $0x1a,%ecx
xor    %edx,%edx
div    %rcx
mov    %edx,%eax
mov    %eax,-0x228(%rbp)
mov    -0x220(%rbp),%rax
mov    $0x1a,%ecx
xor    %edx,%edx
div    %rcx
mov    $0x1a,%ecx
xor    %edx,%edx
div    %rcx
mov    $0x1a,%ecx
xor    %edx,%edx
div    %rcx
mov    %edx,%eax
mov    %eax,-0x22c(%rbp)
mov    -0x224(%rbp),%eax
add    $0x40,%eax
mov    %al,-0x218(%rbp)
mov    -0x228(%rbp),%eax
add    $0x40,%eax
mov    %al,-0x217(%rbp)
mov    -0x22c(%rbp),%eax
add    $0x40,%eax
mov    %al,-0x216(%rbp)
movb   $0x0,-0x215(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     120c <main+0xdc>
movl   $0x1,-0x4(%rbp)
jmp    1249 <main+0x119>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    -0x218(%rbp),%rsi
lea    -0x210(%rbp),%rdx
call   1030 <reg_convert@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    -0x210(%rbp),%rdx
lea    0xdc3(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x230,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x210,%rsp
mov    %rsi,%r14
mov    %edi,%ebp
xor    %edi,%edi
call   1050 <time@plt>
mov    %rax,%rsi
movabs $0x4ec4ec4ec4ec4ec5,%rbx
ec c4 4e
mul    %rbx
mov    %rdx,%rcx
shr    $0x3,%rcx
lea    (%rcx,%rcx,4),%eax
lea    (%rax,%rax,4),%eax
add    %ecx,%eax
mov    %esi,%edi
sub    %eax,%edi
mov    %rcx,%rax
mul    %rbx
shr    $0x3,%edx
lea    (%rdx,%rdx,4),%eax
lea    (%rax,%rax,4),%eax
add    %edx,%eax
sub    %eax,%ecx
shr    $0x2,%rsi
movabs $0x183c977ab2bedd29,%rdx
97 3c 18
mov    %rsi,%rax
mul    %rdx
mov    %rdx,%rsi
shr    $0x4,%rsi
mov    %rsi,%rax
mul    %rbx
shr    $0x3,%edx
lea    (%rdx,%rdx,4),%eax
lea    (%rax,%rax,4),%eax
add    %edx,%eax
sub    %eax,%esi
or     $0x40,%dil
mov    %dil,0x8(%rsp)
or     $0x40,%cl
mov    %cl,0x9(%rsp)
or     $0x40,%sil
mov    %sil,0xa(%rsp)
movb   $0x0,0xb(%rsp)
mov    $0x1,%eax
cmp    $0x2,%ebp
jne    11fe <main+0xce>
mov    0x8(%r14),%rdi
lea    0x8(%rsp),%rsi
lea    0x10(%rsp),%rbp
mov    %rbp,%rdx
call   1030 <reg_convert@plt>
mov    0x8(%r14),%rsi
lea    0xe0c(%rip),%rdi
mov    %rbp,%rdx
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x210,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [17 x i8] c"name=%s\0Acode=%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [512 x i8]
%7 = alloca [8 x i8]
%8 = alloca i64
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%12 = call i64 @time(i32* null)
store i64 %12, i64* %8
%13 = load i64, i64* %8
%14 = urem i64 %13, 26
%15 = trunc i64 %14 to i32
store i32 %15, i32* %9
%16 = load i64, i64* %8
%17 = udiv i64 %16, 26
%18 = urem i64 %17, 26
%19 = trunc i64 %18 to i32
store i32 %19, i32* %10
%20 = load i64, i64* %8
%21 = udiv i64 %20, 26
%22 = udiv i64 %21, 26
%23 = urem i64 %22, 26
%24 = trunc i64 %23 to i32
store i32 %24, i32* %11
%25 = load i32, i32* %9
%26 = add nsw i32 64, %25
%27 = trunc i32 %26 to i8
%28 = getelementptr inbounds [8 x i8], [8 x i8]* %7, i64 0, i64 0
store i8 %27, i8* %28
%29 = load i32, i32* %10
%30 = add nsw i32 64, %29
%31 = trunc i32 %30 to i8
%32 = getelementptr inbounds [8 x i8], [8 x i8]* %7, i64 0, i64 1
store i8 %31, i8* %32
%33 = load i32, i32* %11
%34 = add nsw i32 64, %33
%35 = trunc i32 %34 to i8
%36 = getelementptr inbounds [8 x i8], [8 x i8]* %7, i64 0, i64 2
store i8 %35, i8* %36
%37 = getelementptr inbounds [8 x i8], [8 x i8]* %7, i64 0, i64 3
store i8 0, i8* %37
%38 = load i32, i32* %4
%39 = icmp ne i32 %38, 2
br i1 %39, label %40, label %41
40: ; preds = %2
store i32 1, i32* %3
br label %53
41: ; preds = %2
%42 = load i8**, i8*** %5
%43 = getelementptr inbounds i8*, i8** %42, i64 1
%44 = load i8*, i8** %43
%45 = getelementptr inbounds [8 x i8], [8 x i8]* %7, i64 0, i64 0
%46 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%47 = call i32 @reg_convert(i8* %44, i8* %45, i8* %46)
%48 = load i8**, i8*** %5
%49 = getelementptr inbounds i8*, i8** %48, i64 1
%50 = load i8*, i8** %49
%51 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%52 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %50, i8* %51)
store i32 0, i32* %3
br label %53
53: ; preds = %41, %40
%54 = load i32, i32* %3
ret i32 %54
}

LLVM IR (-O2):
@.str = [17 x i8] c"name=%s\0Acode=%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [512 x i8]
%4 = alloca [8 x i8]
%5 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [8 x i8], [8 x i8]* %4, i64 0, i64 0
%7 = tail call i64 @time(i32* null)
%8 = urem i64 %7, 26
%9 = trunc i64 %8 to i8
%10 = udiv i64 %7, 26
%11 = urem i64 %10, 26
%12 = trunc i64 %11 to i8
%13 = udiv i64 %7, 676
%14 = urem i64 %13, 26
%15 = trunc i64 %14 to i8
%16 = or i8 %9, 64
store i8 %16, i8* %6
%17 = or i8 %12, 64
%18 = getelementptr inbounds [8 x i8], [8 x i8]* %4, i64 0, i64 1
store i8 %17, i8* %18
%19 = or i8 %15, 64
%20 = getelementptr inbounds [8 x i8], [8 x i8]* %4, i64 0, i64 2
store i8 %19, i8* %20
%21 = getelementptr inbounds [8 x i8], [8 x i8]* %4, i64 0, i64 3
store i8 0, i8* %21
%22 = icmp eq i32 %0, 2
br i1 %22, label %23, label %29
23: ; preds = %2
%24 = getelementptr inbounds i8*, i8** %1, i64 1
%25 = load i8*, i8** %24
%26 = call i32 @reg_convert(i8* %25, i8* %6, i8* %5)
%27 = load i8*, i8** %24
%28 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %27, i8* %5)
br label %29
29: ; preds = %2, %23
%30 = phi i32 [ 0, %23 ], [ 1, %2 ]
ret i32 %30
}