#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_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ getword(char *, int);
char *malloc(scalar_t__);
int /*<<< orphan*/ memcpy(char *, char *, scalar_t__);
int /*<<< orphan*/ printf(char *, char *, char *, char *, char *);
int /*<<< orphan*/ stderr;
scalar_t__ strlen(char *);
int main(int argc, char **argv) {
  int i, ii, listsize;
  char *list[1000], word[100 + 1], *command, *ciphertext;
  if (argc != 3) {
    fprintf(stderr, "Usage: %s <command> <ciphertext>", argv[0]);
    exit(EXIT_FAILURE);
  }
  command = argv[1];
  ciphertext = argv[2];
  for (i = 0; i < 1000; i++)
    if (!getword(word, 100))
      break;
    else
      memcpy(list[i] = malloc(strlen(word) + 1), word, strlen(word) + 1);
  listsize = ++i;
  for (i = 0; i < listsize; i++)
    for (ii = i + 1; ii < listsize - 1; ii++)
      printf("%s %s %s %s\n", command, list[i], list[ii], ciphertext);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1ff0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     11bd <main+0x4d>
mov    0x2e46(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe56(%rip),%rsi
call   1060 <fprintf@plt>
mov    0x2e22(%rip),%rax
mov    (%rax),%edi
call   1090 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x1fd8(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x1fe0(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x3e8,-0x14(%rbp)
jge    1283 <main+0x113>
lea    -0x1fd0(%rbp),%rdi
mov    $0x64,%esi
call   1050 <getword@plt>
cmp    $0x0,%eax
jne    120e <main+0x9e>
jmp    1283 <main+0x113>
lea    -0x1fd0(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1080 <malloc@plt>
mov    %rax,%rcx
mov    %rcx,-0x1ff0(%rbp)
movslq -0x14(%rbp),%rax
mov    %rcx,-0x1f60(%rbp,%rax,8)
ff
lea    -0x1fd0(%rbp),%rax
mov    %rax,-0x1fe8(%rbp)
lea    -0x1fd0(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x1ff0(%rbp),%rdi
mov    -0x1fe8(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
call   1070 <memcpy@plt>
jmp    1275 <main+0x105>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11e2 <main+0x72>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    %eax,-0x1c(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    130f <main+0x19f>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    12fc <main+0x18c>
mov    -0x1fd8(%rbp),%rsi
movslq -0x14(%rbp),%rax
mov    -0x1f60(%rbp,%rax,8),%rdx
ff
movslq -0x18(%rbp),%rax
mov    -0x1f60(%rbp,%rax,8),%rcx
ff
mov    -0x1fe0(%rbp),%r8
lea    0xd38(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    12ab <main+0x13b>
jmp    1301 <main+0x191>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1296 <main+0x126>
mov    -0x4(%rbp),%eax
add    $0x1ff0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1fe8,%rsp
cmp    $0x3,%edi
jne    12ac <main+0x13c>
mov    0x8(%rsi),%rax
mov    %rax,0x8(%rsp)
mov    0x10(%rsi),%rax
mov    %rax,(%rsp)
xor    %ebp,%ebp
lea    0x30(%rsp),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r15,%rdi
mov    $0x64,%esi
call   1050 <getword@plt>
test   %eax,%eax
je     11fd <main+0x8d>
mov    %r15,%rdi
call   1030 <strlen@plt>
lea    0x1(%rax),%rbx
mov    %rbx,%rdi
call   1080 <malloc@plt>
mov    %rax,0xa0(%rsp,%rbp,8)
mov    %rax,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1070 <memcpy@plt>
add    $0x1,%rbp
cmp    $0x3e8,%rbp
jne    11b0 <main+0x40>
mov    $0x3e8,%ebp
mov    %ebp,%r12d
add    $0x1,%ebp
mov    %rbp,0x18(%rsp)
lea    0xa0(%rsp),%rcx
xor    %eax,%eax
lea    0xe08(%rip),%r14
mov    %r12,0x10(%rsp)
mov    0x8(%rsp),%rbp
mov    (%rsp),%rbx
jmp    1244 <main+0xd4>
nopl   0x0(%rax)
add    $0x8,%rcx
add    $0xffffffffffffffff,%r12
mov    0x20(%rsp),%rax
cmp    0x18(%rsp),%rax
je     1298 <main+0x128>
lea    0x1(%rax),%rsi
mov    %rsi,0x20(%rsp)
cmp    0x10(%rsp),%rsi
jae    1230 <main+0xc0>
mov    0xa0(%rsp,%rax,8),%rax
mov    %rax,0x28(%rsp)
mov    $0x1,%r15d
nopw   0x0(%rax,%rax,1)
mov    %rcx,%r13
mov    (%rcx,%r15,8),%rcx
mov    %r14,%rdi
mov    %rbp,%rsi
mov    0x28(%rsp),%rdx
mov    %rbx,%r8
call   1040 <printf@plt>
mov    %r13,%rcx
add    $0x1,%r15
cmp    %r15,%r12
jne    1270 <main+0x100>
jmp    1230 <main+0xc0>
xor    %eax,%eax
add    $0x1fe8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2d2d(%rip),%rax
mov    (%rax),%edi
mov    (%rsi),%rdx
lea    0xd41(%rip),%rsi
call   1060 <fprintf@plt>
mov    0x2d0d(%rip),%rax
mov    (%rax),%edi
call   1090 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [33 x i8] c"Usage: %s <command> <ciphertext>\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [13 x i8] c"%s %s %s %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca [1000 x i8*]
%10 = alloca [101 x i8]
%11 = alloca i8*
%12 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%13 = load i32, i32* %4
%14 = icmp ne i32 %13, 3
br i1 %14, label %15, label %23
15: ; preds = %2
%16 = load i32, i32* @stderr
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 0
%19 = load i8*, i8** %18
%20 = call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %19)
%21 = load i32, i32* @EXIT_FAILURE
%22 = call i32 @exit(i32 %21)
unreachable
23: ; preds = %2
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 1
%26 = load i8*, i8** %25
store i8* %26, i8** %11
%27 = load i8**, i8*** %5
%28 = getelementptr inbounds i8*, i8** %27, i64 2
%29 = load i8*, i8** %28
store i8* %29, i8** %12
store i32 0, i32* %6
br label %30
30: ; preds = %52, %23
%31 = load i32, i32* %6
%32 = icmp slt i32 %31, 1000
br i1 %32, label %33, label %55
33: ; preds = %30
%34 = getelementptr inbounds [101 x i8], [101 x i8]* %10, i64 0, i64 0
%35 = call i32 @getword(i8* %34, i32 100)
%36 = icmp ne i32 %35, 0
br i1 %36, label %38, label %37
37: ; preds = %33
br label %55
38: ; preds = %33
%39 = getelementptr inbounds [101 x i8], [101 x i8]* %10, i64 0, i64 0
%40 = call i64 @strlen(i8* %39)
%41 = add nsw i64 %40, 1
%42 = call i8* @malloc(i64 %41)
%43 = load i32, i32* %6
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds [1000 x i8*], [1000 x i8*]* %9, i64 0, i64 %44
store i8* %42, i8** %45
%46 = getelementptr inbounds [101 x i8], [101 x i8]* %10, i64 0, i64 0
%47 = getelementptr inbounds [101 x i8], [101 x i8]* %10, i64 0, i64 0
%48 = call i64 @strlen(i8* %47)
%49 = add nsw i64 %48, 1
%50 = call i32 @memcpy(i8* %42, i8* %46, i64 %49)
br label %51
51: ; preds = %38
br label %52
52: ; preds = %51
%53 = load i32, i32* %6
%54 = add nsw i32 %53, 1
store i32 %54, i32* %6
br label %30
55: ; preds = %37, %30
%56 = load i32, i32* %6
%57 = add nsw i32 %56, 1
store i32 %57, i32* %6
store i32 %57, i32* %8
store i32 0, i32* %6
br label %58
58: ; preds = %86, %55
%59 = load i32, i32* %6
%60 = load i32, i32* %8
%61 = icmp slt i32 %59, %60
br i1 %61, label %62, label %89
62: ; preds = %58
%63 = load i32, i32* %6
%64 = add nsw i32 %63, 1
store i32 %64, i32* %7
br label %65
65: ; preds = %82, %62
%66 = load i32, i32* %7
%67 = load i32, i32* %8
%68 = sub nsw i32 %67, 1
%69 = icmp slt i32 %66, %68
br i1 %69, label %70, label %85
70: ; preds = %65
%71 = load i8*, i8** %11
%72 = load i32, i32* %6
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds [1000 x i8*], [1000 x i8*]* %9, i64 0, i64 %73
%75 = load i8*, i8** %74
%76 = load i32, i32* %7
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds [1000 x i8*], [1000 x i8*]* %9, i64 0, i64 %77
%79 = load i8*, i8** %78
%80 = load i8*, i8** %12
%81 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %71, i8* %75, i8* %79, i8* %80)
br label %82
82: ; preds = %70
%83 = load i32, i32* %7
%84 = add nsw i32 %83, 1
store i32 %84, i32* %7
br label %65
85: ; preds = %65
br label %86
86: ; preds = %85
%87 = load i32, i32* %6
%88 = add nsw i32 %87, 1
store i32 %88, i32* %6
br label %58
89: ; preds = %58
%90 = load i32, i32* %3
ret i32 %90
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"Usage: %s <command> <ciphertext>\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [13 x i8] c"%s %s %s %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [1000 x i8*]
%4 = alloca [101 x i8]
%5 = bitcast [1000 x i8*]* %3 to i8*
%6 = getelementptr inbounds [101 x i8], [101 x i8]* %4, i64 0, i64 0
%7 = icmp eq i32 %0, 3
br i1 %7, label %14, label %8
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %1
%11 = tail call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = load i32, i32* @EXIT_FAILURE
%13 = tail call i32 @exit(i32 %12)
unreachable
14: ; preds = %2
%15 = getelementptr inbounds i8*, i8** %1, i64 1
%16 = load i8*, i8** %15
%17 = getelementptr inbounds i8*, i8** %1, i64 2
%18 = load i8*, i8** %17
br label %19
19: ; preds = %14, %23
%20 = phi i64 [ 0, %14 ], [ %29, %23 ]
%21 = call i32 @getword(i8* %6, i32 100)
%22 = icmp eq i32 %21, 0
br i1 %22, label %31, label %23
23: ; preds = %19
%24 = call i64 @strlen(i8* %6)
%25 = add nsw i64 %24, 1
%26 = call i8* @malloc(i64 %25)
%27 = getelementptr inbounds [1000 x i8*], [1000 x i8*]* %3, i64 0, i64 %20
store i8* %26, i8** %27
%28 = call i32 @memcpy(i8* %26, i8* %6, i64 %25)
%29 = add nuw nsw i64 %20, 1
%30 = icmp eq i64 %29, 1000
br i1 %30, label %33, label %19
31: ; preds = %19
%32 = trunc i64 %20 to i32
br label %33
33: ; preds = %23, %31
%34 = phi i32 [ %32, %31 ], [ 1000, %23 ]
%35 = zext i32 %34 to i64
%36 = add nuw nsw i32 %34, 1
%37 = zext i32 %36 to i64
br label %41
38: ; preds = %49, %41
%39 = add nuw nsw i64 %43, 1
%40 = icmp eq i64 %44, %37
br i1 %40, label %56, label %41
41: ; preds = %33, %38
%42 = phi i64 [ 0, %33 ], [ %44, %38 ]
%43 = phi i64 [ 1, %33 ], [ %39, %38 ]
%44 = add nuw nsw i64 %42, 1
%45 = icmp ult i64 %44, %35
br i1 %45, label %46, label %38
46: ; preds = %41
%47 = getelementptr inbounds [1000 x i8*], [1000 x i8*]* %3, i64 0, i64 %42
%48 = load i8*, i8** %47
br label %49
49: ; preds = %46, %49
%50 = phi i64 [ %43, %46 ], [ %54, %49 ]
%51 = getelementptr inbounds [1000 x i8*], [1000 x i8*]* %3, i64 0, i64 %50
%52 = load i8*, i8** %51
%53 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %16, i8* %48, i8* %52, i8* %18)
%54 = add nuw nsw i64 %50, 1
%55 = icmp eq i64 %54, %35
br i1 %55, label %38, label %49
56: ; preds = %38
ret i32 0
}