#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 *);
char *skipwhite(char *);
int /*<<< orphan*/ str_term(char *);
char *line_block_name(char *line) {
  char *sp, *cp;
  sp = cp = skipwhite(line + 1);
  while (*cp != '\0' && *cp != '>')
    cp++;
  if (*cp != '>')
    printf("Blockname %s does not appear terminated\n", sp);
  str_term(cp);
  return sp;
}


x86 assembly (clang, -O0):
<line_block_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
call   1030 <skipwhite@plt>
mov    %rax,-0x18(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x19(%rbp)
je     1176 <line_block_name+0x46>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3e,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1186 <line_block_name+0x56>
jmp    1197 <line_block_name+0x67>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1151 <line_block_name+0x21>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3e,%eax
je     11b7 <line_block_name+0x87>
mov    -0x10(%rbp),%rsi
lea    0xe4e(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1050 <str_term@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<line_block_name>:
push   %r14
push   %rbx
push   %rax
add    $0x1,%rdi
call   1030 <skipwhite@plt>
mov    %rax,%r14
mov    %rax,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rbx),%eax
test   %al,%al
je     1161 <line_block_name+0x31>
cmp    $0x3e,%al
je     1170 <line_block_name+0x40>
add    $0x1,%rbx
jmp    1150 <line_block_name+0x20>
lea    0xe98(%rip),%rdi
mov    %r14,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1050 <str_term@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [41 x i8] c"Blockname %s does not appear terminated\0A\00"
define i8* @line_block_name(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = call i8* @skipwhite(i8* %6)
store i8* %7, i8** %4
store i8* %7, i8** %3
br label %8
8: ; preds = %20, %1
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %18
13: ; preds = %8
%14 = load i8*, i8** %4
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp ne i32 %16, 62
br label %18
18: ; preds = %13, %8
%19 = phi i1 [ false, %8 ], [ %17, %13 ]
br i1 %19, label %20, label %23
20: ; preds = %18
%21 = load i8*, i8** %4
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %4
br label %8
23: ; preds = %18
%24 = load i8*, i8** %4
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = icmp ne i32 %26, 62
br i1 %27, label %28, label %31
28: ; preds = %23
%29 = load i8*, i8** %3
%30 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %29)
br label %31
31: ; preds = %28, %23
%32 = load i8*, i8** %4
%33 = call i32 @str_term(i8* %32)
%34 = load i8*, i8** %3
ret i8* %34
}

LLVM IR (-O2):
@.str = [41 x i8] c"Blockname %s does not appear terminated\0A\00"
define i8* @line_block_name(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = tail call i8* @skipwhite(i8* %2)
br label %4
4: ; preds = %7, %1
%5 = phi i8* [ %3, %1 ], [ %8, %7 ]
%6 = load i8, i8* %5
switch i8 %6, label %7 [
i8 62, label %11
i8 0, label %9
]
7: ; preds = %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
br label %4
9: ; preds = %4
%10 = tail call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %3)
br label %11
11: ; preds = %4, %9
%12 = tail call i32 @str_term(i8* %5)
ret i8* %3
}