#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*/ str;

/* Variables and functions */
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *, char *);
int /*<<< orphan*/ stdin;
int main() {
  char str[256];
  char *p, *strtok();
  char *args[3];
  int i, missing = 0;
  while (fgets(str, sizeof(str), stdin) != NULL) {
    if ((p = strtok(str, "] ")) != NULL) {
    }
    for (i = 0; i < 3; i++) {
      if ((args[i] = strtok(0, "]")) == NULL) {
        missing = 1;
        break;
      }
    }
    if (missing)
      missing = 0;
    else
      printf("%s ... %s\n", args[0], args[2]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x140,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x138(%rbp)
lea    -0x110(%rbp),%rdi
mov    0x2e8e(%rip),%rax
mov    (%rax),%edx
mov    $0x100,%esi
call   1040 <fgets@plt>
cmp    $0x0,%rax
je     123c <main+0x10c>
lea    -0x110(%rbp),%rdi
lea    0xe82(%rip),%rsi
call   1050 <strtok@plt>
mov    %rax,-0x118(%rbp)
cmp    $0x0,%rax
je     1199 <main+0x69>
jmp    1199 <main+0x69>
movl   $0x0,-0x134(%rbp)
cmpl   $0x3,-0x134(%rbp)
jge    1201 <main+0xd1>
xor    %eax,%eax
mov    %eax,%edi
lea    0xe48(%rip),%rsi
call   1050 <strtok@plt>
movslq -0x134(%rbp),%rcx
mov    %rax,-0x130(%rbp,%rcx,8)
ff
cmp    $0x0,%rax
jne    11e8 <main+0xb8>
movl   $0x1,-0x138(%rbp)
jmp    1201 <main+0xd1>
jmp    11ed <main+0xbd>
mov    -0x134(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x134(%rbp)
jmp    11a3 <main+0x73>
cmpl   $0x0,-0x138(%rbp)
je     121d <main+0xed>
movl   $0x0,-0x138(%rbp)
jmp    1237 <main+0x107>
mov    -0x130(%rbp),%rsi
mov    -0x120(%rbp),%rdx
lea    0xdd3(%rip),%rdi
call   1030 <printf@plt>
jmp    114c <main+0x1c>
xor    %eax,%eax
add    $0x140,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x108,%rsp
mov    0x2ea0(%rip),%rbp
mov    0x0(%rbp),%edx
mov    %rsp,%rdi
mov    $0x100,%esi
call   1040 <fgets@plt>
test   %rax,%rax
je     11e0 <main+0xb0>
lea    0xe98(%rip),%r14
mov    %rsp,%r15
lea    0xe91(%rip),%r13
lea    0xe8c(%rip),%r12
jmp    1195 <main+0x65>
nopl   0x0(%rax,%rax,1)
mov    0x0(%rbp),%edx
mov    %r15,%rdi
mov    $0x100,%esi
call   1040 <fgets@plt>
test   %rax,%rax
je     11e0 <main+0xb0>
mov    %r15,%rdi
mov    %r14,%rsi
call   1050 <strtok@plt>
xor    %edi,%edi
mov    %r13,%rsi
call   1050 <strtok@plt>
test   %rax,%rax
je     1180 <main+0x50>
mov    %rax,%rbx
xor    %edi,%edi
mov    %r13,%rsi
call   1050 <strtok@plt>
test   %rax,%rax
je     1180 <main+0x50>
xor    %edi,%edi
mov    %r13,%rsi
call   1050 <strtok@plt>
test   %rax,%rax
je     1180 <main+0x50>
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
call   1030 <printf@plt>
jmp    1180 <main+0x50>
xor    %eax,%eax
add    $0x108,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [3 x i8] c"] \00"
@.str.1 = [2 x i8] c"]\00"
@.str.2 = [11 x i8] c"%s ... %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [256 x i8]
%3 = alloca i8*
%4 = alloca [3 x i8*]
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %6
br label %7
7: ; preds = %42, %0
%8 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%9 = load i32, i32* @stdin
%10 = call i32* @fgets(i8* %8, i32 256, i32 %9)
%11 = icmp ne i32* %10, null
br i1 %11, label %12, label %43
12: ; preds = %7
%13 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%14 = call i8* @strtok(i8* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i8* %14, i8** %3
%15 = icmp ne i8* %14, null
br i1 %15, label %16, label %17
16: ; preds = %12
br label %17
17: ; preds = %16, %12
store i32 0, i32* %5
br label %18
18: ; preds = %29, %17
%19 = load i32, i32* %5
%20 = icmp slt i32 %19, 3
br i1 %20, label %21, label %32
21: ; preds = %18
%22 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%23 = load i32, i32* %5
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [3 x i8*], [3 x i8*]* %4, i64 0, i64 %24
store i8* %22, i8** %25
%26 = icmp eq i8* %22, null
br i1 %26, label %27, label %28
27: ; preds = %21
store i32 1, i32* %6
br label %32
28: ; preds = %21
br label %29
29: ; preds = %28
%30 = load i32, i32* %5
%31 = add nsw i32 %30, 1
store i32 %31, i32* %5
br label %18
32: ; preds = %27, %18
%33 = load i32, i32* %6
%34 = icmp ne i32 %33, 0
br i1 %34, label %35, label %36
35: ; preds = %32
store i32 0, i32* %6
br label %42
36: ; preds = %32
%37 = getelementptr inbounds [3 x i8*], [3 x i8*]* %4, i64 0, i64 0
%38 = load i8*, i8** %37
%39 = getelementptr inbounds [3 x i8*], [3 x i8*]* %4, i64 0, i64 2
%40 = load i8*, i8** %39
%41 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* %38, i8* %40)
br label %42
42: ; preds = %36, %35
br label %7
43: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [3 x i8] c"] \00"
@.str.1 = [2 x i8] c"]\00"
@.str.2 = [11 x i8] c"%s ... %s\0A\00"
define i32 @main() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stdin
%4 = call i32* @fgets(i8* %2, i32 256, i32 %3)
%5 = icmp eq i32* %4, null
br i1 %5, label %22, label %6
6: ; preds = %0, %18
%7 = call i8* @strtok(i8* %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%8 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp eq i8* %8, null
br i1 %9, label %18, label %10
10: ; preds = %6
%11 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%12 = icmp eq i8* %11, null
br i1 %12, label %18, label %13
13: ; preds = %10
%14 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%15 = icmp eq i8* %14, null
br i1 %15, label %18, label %16
16: ; preds = %13
%17 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* %8, i8* %14)
br label %18
18: ; preds = %6, %10, %13, %16
%19 = load i32, i32* @stdin
%20 = call i32* @fgets(i8* %2, i32 256, i32 %19)
%21 = icmp eq i32* %20, null
br i1 %21, label %22, label %6
22: ; preds = %18, %0
ret i32 0
}