#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 /*<<< orphan*/);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *, char *);
int /*<<< orphan*/ stdin;
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]);
  }
  exit(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    0x2e7e(%rip),%rax
mov    (%rax),%edx
mov    $0x100,%esi
call   1040 <fgets@plt>
cmp    $0x0,%rax
je     124c <main+0x10c>
lea    -0x110(%rbp),%rdi
lea    0xe72(%rip),%rsi
call   1050 <strtok@plt>
mov    %rax,-0x118(%rbp)
cmp    $0x0,%rax
je     11a9 <main+0x69>
jmp    11a9 <main+0x69>
movl   $0x0,-0x134(%rbp)
cmpl   $0x3,-0x134(%rbp)
jge    1211 <main+0xd1>
xor    %eax,%eax
mov    %eax,%edi
lea    0xe38(%rip),%rsi
call   1050 <strtok@plt>
movslq -0x134(%rbp),%rcx
mov    %rax,-0x130(%rbp,%rcx,8)
ff
cmp    $0x0,%rax
jne    11f8 <main+0xb8>
movl   $0x1,-0x138(%rbp)
jmp    1211 <main+0xd1>
jmp    11fd <main+0xbd>
mov    -0x134(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x134(%rbp)
jmp    11b3 <main+0x73>
cmpl   $0x0,-0x138(%rbp)
je     122d <main+0xed>
movl   $0x0,-0x138(%rbp)
jmp    1247 <main+0x107>
mov    -0x130(%rbp),%rsi
mov    -0x120(%rbp),%rdx
lea    0xdc3(%rip),%rdi
call   1030 <printf@plt>
jmp    115c <main+0x1c>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x108,%rsp
mov    0x2e90(%rip),%rbp
mov    0x0(%rbp),%edx
mov    %rsp,%rdi
mov    $0x100,%esi
call   1040 <fgets@plt>
test   %rax,%rax
jne    1174 <main+0x34>
xor    %edi,%edi
call   1060 <exit@plt>
lea    0xe85(%rip),%r14
mov    %rsp,%r15
lea    0xe7e(%rip),%r13
lea    0xe79(%rip),%r12
jmp    11a5 <main+0x65>
xchg   %ax,%ax
mov    0x0(%rbp),%edx
mov    %r15,%rdi
mov    $0x100,%esi
call   1040 <fgets@plt>
test   %rax,%rax
je     116d <main+0x2d>
mov    %r15,%rdi
mov    %r14,%rsi
call   1050 <strtok@plt>
xor    %edi,%edi
mov    %r13,%rsi
call   1050 <strtok@plt>
test   %rax,%rax
je     1190 <main+0x50>
mov    %rax,%rbx
xor    %edi,%edi
mov    %r13,%rsi
call   1050 <strtok@plt>
test   %rax,%rax
je     1190 <main+0x50>
xor    %edi,%edi
mov    %r13,%rsi
call   1050 <strtok@plt>
test   %rax,%rax
je     1190 <main+0x50>
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
call   1030 <printf@plt>
jmp    1190 <main+0x50>

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
%44 = call i32 @exit(i32 0)
unreachable
}

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
%23 = call i32 @exit(i32 0)
unreachable
}