#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 */
typedef int /*<<< orphan*/ salt;
typedef int /*<<< orphan*/ key;

/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
char *crypt(char *, char *);
int /*<<< orphan*/ err(int, char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ get(char *, int);
int strlen(char *);
int write(int /*<<< orphan*/, char *, int);
int main(void) {
  int len;
  char *r, key[9], salt[3];
  get(key, sizeof(key) - 1);
  get(salt, sizeof(salt) - 1);
  len = strlen(r = crypt(key, salt));
  if (write(STDOUT_FILENO, r, len) != len)
    err(1, "stdout");
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x19(%rbp),%rdi
mov    $0x8,%esi
call   1070 <get@plt>
lea    -0x1c(%rbp),%rdi
mov    $0x2,%esi
call   1070 <get@plt>
lea    -0x19(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
call   1040 <crypt@plt>
mov    %rax,%rdi
mov    %rdi,-0x10(%rbp)
call   1050 <strlen@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e42(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%edx
call   1030 <write@plt>
cmp    -0x8(%rbp),%eax
je     11d6 <main+0x76>
mov    $0x1,%edi
lea    0xe2f(%rip),%rsi
call   1060 <err@plt>
xor    %edi,%edi
call   1080 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0x7(%rsp),%r14
mov    %r14,%rdi
mov    $0x8,%esi
call   1070 <get@plt>
lea    0x4(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x2,%esi
call   1070 <get@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <crypt@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <strlen@plt>
mov    %eax,%ebp
mov    0x2e45(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1030 <write@plt>
cmp    %ebp,%eax
je     11cc <main+0x6c>
lea    0xe3e(%rip),%rsi
mov    $0x1,%edi
call   1060 <err@plt>
xor    %edi,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@STDOUT_FILENO = global i32 0
@.str = [7 x i8] c"stdout\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [9 x i8]
%5 = alloca [3 x i8]
store i32 0, i32* %1
%6 = getelementptr inbounds [9 x i8], [9 x i8]* %4, i64 0, i64 0
%7 = call i32 @get(i8* %6, i32 8)
%8 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 0
%9 = call i32 @get(i8* %8, i32 2)
%10 = getelementptr inbounds [9 x i8], [9 x i8]* %4, i64 0, i64 0
%11 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 0
%12 = call i8* @crypt(i8* %10, i8* %11)
store i8* %12, i8** %3
%13 = call i32 @strlen(i8* %12)
store i32 %13, i32* %2
%14 = load i32, i32* @STDOUT_FILENO
%15 = load i8*, i8** %3
%16 = load i32, i32* %2
%17 = call i32 @write(i32 %14, i8* %15, i32 %16)
%18 = load i32, i32* %2
%19 = icmp ne i32 %17, %18
br i1 %19, label %20, label %22
20: ; preds = %0
%21 = call i32 @err(i32 1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %22
22: ; preds = %20, %0
%23 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
@.str = [7 x i8] c"stdout\00"
define i32 @main() {
%1 = alloca [9 x i8]
%2 = alloca [3 x i8]
%3 = getelementptr inbounds [9 x i8], [9 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%5 = call i32 @get(i8* %3, i32 8)
%6 = call i32 @get(i8* %4, i32 2)
%7 = call i8* @crypt(i8* %3, i8* %4)
%8 = call i32 @strlen(i8* %7)
%9 = load i32, i32* @STDOUT_FILENO
%10 = call i32 @write(i32 %9, i8* %7, i32 %8)
%11 = icmp eq i32 %10, %8
br i1 %11, label %14, label %12
12: ; preds = %0
%13 = call i32 @err(i32 1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %12, %0
%15 = call i32 @exit(i32 0)
unreachable
}