#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 */
struct item {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
struct item *do_make_item(char *, char *, char *, char *);
int /*<<< orphan*/ print_item(struct item *);
char *strstr(char *, char *);
struct item *parse_item(char *line) {
  char *p = NULL;
  char *s = line;
  struct item *pitem = NULL;
  char *word = NULL, *cog = NULL, *sim = NULL, *syn = NULL;
  int i;
  assert(line != NULL);
  for (i = 0, s = line; i < 4; i++) {
    p = strstr(s, "/ ");
    if (p == NULL) {
      return NULL;
    }
    *p = '\0';
    if (i == 0)
      word = s;
    else if (i == 1)
      cog = s;
    else if (i == 2)
      sim = s;
    else if (i == 3)
      syn = s;
    s = p + 2;
  }
  pitem = do_make_item(word, cog, sim, syn);
  print_item(pitem);
  return pitem;
}


x86 assembly (clang, -O0):
<parse_item>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
movq   $0x0,-0x38(%rbp)
movq   $0x0,-0x40(%rbp)
movq   $0x0,-0x48(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
movl   $0x0,-0x4c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpl   $0x4,-0x4c(%rbp)
jge    1262 <parse_item+0x122>
mov    -0x20(%rbp),%rdi
lea    0xe46(%rip),%rsi
call   1050 <strstr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    11db <parse_item+0x9b>
movq   $0x0,-0x8(%rbp)
jmp    128c <parse_item+0x14c>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
cmpl   $0x0,-0x4c(%rbp)
jne    11f9 <parse_item+0xb9>
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
jmp    1248 <parse_item+0x108>
cmpl   $0x1,-0x4c(%rbp)
jne    1210 <parse_item+0xd0>
mov    -0x20(%rbp),%rax
mov    %rax,-0x38(%rbp)
jmp    1243 <parse_item+0x103>
cmpl   $0x2,-0x4c(%rbp)
jne    1227 <parse_item+0xe7>
mov    -0x20(%rbp),%rax
mov    %rax,-0x40(%rbp)
jmp    123e <parse_item+0xfe>
cmpl   $0x3,-0x4c(%rbp)
jne    1239 <parse_item+0xf9>
mov    -0x20(%rbp),%rax
mov    %rax,-0x48(%rbp)
jmp    123e <parse_item+0xfe>
jmp    1243 <parse_item+0x103>
jmp    1248 <parse_item+0x108>
mov    -0x18(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x20(%rbp)
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    11a5 <parse_item+0x65>
mov    -0x30(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    -0x40(%rbp),%rdx
mov    -0x48(%rbp),%rcx
call   1060 <do_make_item@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   1030 <print_item@plt>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_item>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %edi,%edi
test   %r14,%r14
setne  %dil
call   1040 <assert@plt>
lea    0xea0(%rip),%rsi
mov    %r14,%rdi
call   1050 <strstr@plt>
test   %rax,%rax
je     11e8 <parse_item+0xa8>
mov    %rax,%rbx
movb   $0x0,(%rax)
add    $0x2,%rbx
lea    0xe82(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strstr@plt>
test   %rax,%rax
je     11e8 <parse_item+0xa8>
mov    %rax,%r15
movb   $0x0,(%rax)
add    $0x2,%r15
lea    0xe64(%rip),%rsi
mov    %r15,%rdi
call   1050 <strstr@plt>
test   %rax,%rax
je     11e8 <parse_item+0xa8>
mov    %rax,%r12
movb   $0x0,(%rax)
add    $0x2,%r12
lea    0xe46(%rip),%rsi
mov    %r12,%rdi
call   1050 <strstr@plt>
test   %rax,%rax
je     11e8 <parse_item+0xa8>
movb   $0x0,(%rax)
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r12,%rcx
call   1060 <do_make_item@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <print_item@plt>
jmp    11ea <parse_item+0xaa>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.item = type { i32 }
@.str = [3 x i8] c"/ \00"
define %struct.item* @parse_item(i8* %0) {
%2 = alloca %struct.item*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca %struct.item*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i32
store i8* %0, i8** %3
store i8* null, i8** %4
%12 = load i8*, i8** %3
store i8* %12, i8** %5
store %struct.item* null, %struct.item** %6
store i8* null, i8** %7
store i8* null, i8** %8
store i8* null, i8** %9
store i8* null, i8** %10
%13 = load i8*, i8** %3
%14 = icmp ne i8* %13, null
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
store i32 0, i32* %11
%17 = load i8*, i8** %3
store i8* %17, i8** %5
br label %18
18: ; preds = %54, %1
%19 = load i32, i32* %11
%20 = icmp slt i32 %19, 4
br i1 %20, label %21, label %57
21: ; preds = %18
%22 = load i8*, i8** %5
%23 = call i8* @strstr(i8* %22, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i8* %23, i8** %4
%24 = load i8*, i8** %4
%25 = icmp eq i8* %24, null
br i1 %25, label %26, label %27
26: ; preds = %21
store %struct.item* null, %struct.item** %2
br label %66
27: ; preds = %21
%28 = load i8*, i8** %4
store i8 0, i8* %28
%29 = load i32, i32* %11
%30 = icmp eq i32 %29, 0
br i1 %30, label %31, label %33
31: ; preds = %27
%32 = load i8*, i8** %5
store i8* %32, i8** %7
br label %51
33: ; preds = %27
%34 = load i32, i32* %11
%35 = icmp eq i32 %34, 1
br i1 %35, label %36, label %38
36: ; preds = %33
%37 = load i8*, i8** %5
store i8* %37, i8** %8
br label %50
38: ; preds = %33
%39 = load i32, i32* %11
%40 = icmp eq i32 %39, 2
br i1 %40, label %41, label %43
41: ; preds = %38
%42 = load i8*, i8** %5
store i8* %42, i8** %9
br label %49
43: ; preds = %38
%44 = load i32, i32* %11
%45 = icmp eq i32 %44, 3
br i1 %45, label %46, label %48
46: ; preds = %43
%47 = load i8*, i8** %5
store i8* %47, i8** %10
br label %48
48: ; preds = %46, %43
br label %49
49: ; preds = %48, %41
br label %50
50: ; preds = %49, %36
br label %51
51: ; preds = %50, %31
%52 = load i8*, i8** %4
%53 = getelementptr inbounds i8, i8* %52, i64 2
store i8* %53, i8** %5
br label %54
54: ; preds = %51
%55 = load i32, i32* %11
%56 = add nsw i32 %55, 1
store i32 %56, i32* %11
br label %18
57: ; preds = %18
%58 = load i8*, i8** %7
%59 = load i8*, i8** %8
%60 = load i8*, i8** %9
%61 = load i8*, i8** %10
%62 = call %struct.item* @do_make_item(i8* %58, i8* %59, i8* %60, i8* %61)
store %struct.item* %62, %struct.item** %6
%63 = load %struct.item*, %struct.item** %6
%64 = call i32 @print_item(%struct.item* %63)
%65 = load %struct.item*, %struct.item** %6
store %struct.item* %65, %struct.item** %2
br label %66
66: ; preds = %57, %26
%67 = load %struct.item*, %struct.item** %2
ret %struct.item* %67
}

LLVM IR (-O2):
%struct.item = type { i32 }
@.str = [3 x i8] c"/ \00"
define %struct.item* @parse_item(i8* %0) {
%2 = icmp ne i8* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i8* %5, null
br i1 %6, label %22, label %7
7: ; preds = %1
store i8 0, i8* %5
%8 = getelementptr inbounds i8, i8* %5, i64 2
%9 = tail call i8* @strstr(i8* dereferenceable(1) %8, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i8* %9, null
br i1 %10, label %22, label %11
11: ; preds = %7
store i8 0, i8* %9
%12 = getelementptr inbounds i8, i8* %9, i64 2
%13 = tail call i8* @strstr(i8* dereferenceable(1) %12, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%14 = icmp eq i8* %13, null
br i1 %14, label %22, label %15
15: ; preds = %11
store i8 0, i8* %13
%16 = getelementptr inbounds i8, i8* %13, i64 2
%17 = tail call i8* @strstr(i8* dereferenceable(1) %16, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%18 = icmp eq i8* %17, null
br i1 %18, label %22, label %19
19: ; preds = %15
store i8 0, i8* %17
%20 = tail call %struct.item* @do_make_item(i8* %0, i8* %8, i8* %12, i8* %16)
%21 = tail call i32 @print_item(%struct.item* %20)
br label %22
22: ; preds = %1, %7, %11, %15, %19
%23 = phi %struct.item* [ %20, %19 ], [ null, %15 ], [ null, %11 ], [ null, %7 ], [ null, %1 ]
ret %struct.item* %23
}