#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 *strtok(char *, char *);
int main(int argc, char **argv) {
  if (argc != 2)
    return 1;
  printf("digraph g {\n");
  char *s = strtok(argv[1], " ");
  int i = 0;
  while (s) {
    printf("\tn%d -> n%s;\n", i, s);
    s = strtok(NULL, " ");
    i++;
  }
  printf("}\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     114c <main+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    11d0 <main+0xb0>
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xea4(%rip),%rsi
call   1040 <strtok@plt>
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     11bb <main+0x9b>
mov    -0x1c(%rbp),%esi
mov    -0x18(%rbp),%rdx
lea    0xe7d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
lea    0xe69(%rip),%rsi
call   1040 <strtok@plt>
mov    %rax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1179 <main+0x59>
lea    0xe5b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x1,%eax
cmp    $0x2,%edi
jne    11b3 <main+0x83>
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
mov    0x8(%rbx),%rdi
lea    0xea8(%rip),%rsi
call   1050 <strtok@plt>
test   %rax,%rax
je     11a1 <main+0x71>
lea    0xe99(%rip),%r14
lea    0xe90(%rip),%rbx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %ebp,%esi
mov    %rax,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   1050 <strtok@plt>
add    $0x1,%ebp
test   %rax,%rax
jne    1180 <main+0x50>
lea    0xe74(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"digraph g {\0A\00"
@.str.1 = [2 x i8] c" \00"
@.str.2 = [14 x i8] c"\09n%d -> n%s;\0A\00"
@.str.3 = [3 x i8] c"}\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 2
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 1, i32* %3
br label %29
11: ; preds = %2
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = call i8* @strtok(i8* %15, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i8* %16, i8** %6
store i32 0, i32* %7
br label %17
17: ; preds = %20, %11
%18 = load i8*, i8** %6
%19 = icmp ne i8* %18, null
br i1 %19, label %20, label %27
20: ; preds = %17
%21 = load i32, i32* %7
%22 = load i8*, i8** %6
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %21, i8* %22)
%24 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i8* %24, i8** %6
%25 = load i32, i32* %7
%26 = add nsw i32 %25, 1
store i32 %26, i32* %7
br label %17
27: ; preds = %17
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %3
br label %29
29: ; preds = %27, %10
%30 = load i32, i32* %3
ret i32 %30
}

LLVM IR (-O2):
@.str.1 = [2 x i8] c" \00"
@.str.2 = [14 x i8] c"\09n%d -> n%s;\0A\00"
@str = [12 x i8] c"digraph g {\00"
@str.4 = [2 x i8] c"}\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %19
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = tail call i8* @strtok(i8* %7, 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 %17, label %10
10: ; preds = %4, %10
%11 = phi i32 [ %15, %10 ], [ 0, %4 ]
%12 = phi i8* [ %14, %10 ], [ %8, %4 ]
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %11, i8* %12)
%14 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%15 = add nuw nsw i32 %11, 1
%16 = icmp eq i8* %14, null
br i1 %16, label %17, label %10
17: ; preds = %10, %4
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.4, i64 0, i64 0))
br label %19
19: ; preds = %2, %17
%20 = phi i32 [ 0, %17 ], [ 1, %2 ]
ret i32 %20
}