#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*/ syntax(char *);
char *scan_must(char *from, char *to) {
  char *c;
  for (c = from; *c && *c <= ' '; c++)
    ;
  if (!*c)
    syntax(from);
  while (*c > ' ')
    *to++ = *c++;
  *to++ = 0;
  return c;
}


x86 assembly (clang, -O0):
<scan_must>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x19(%rbp)
je     114d <scan_must+0x3d>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
setle  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    115d <scan_must+0x4d>
jmp    1173 <scan_must+0x63>
jmp    1162 <scan_must+0x52>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <scan_must+0x18>
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1189 <scan_must+0x79>
mov    -0x8(%rbp),%rdi
call   1030 <syntax@plt>
jmp    118e <scan_must+0x7e>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jle    11c5 <scan_must+0xb5>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
jmp    118e <scan_must+0x7e>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scan_must>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
lea    -0x1(%rdi),%rbx
nopl   0x0(%rax,%rax,1)
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
je     1130 <scan_must+0x20>
cmp    $0x21,%al
jl     1120 <scan_must+0x10>
test   %al,%al
je     1162 <scan_must+0x52>
cmp    $0x21,%al
jl     1153 <scan_must+0x43>
nopl   0x0(%rax,%rax,1)
mov    %al,(%r14)
add    $0x1,%r14
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
cmp    $0x20,%al
jg     1140 <scan_must+0x30>
movb   $0x0,(%r14)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
call   1030 <syntax@plt>
mov    (%rbx),%al
cmp    $0x21,%al
jge    1140 <scan_must+0x30>
jmp    1153 <scan_must+0x43>

LLVM IR (-O0):
define i8* @scan_must(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
store i8* %6, i8** %5
br label %7
7: ; preds = %20, %2
%8 = load i8*, i8** %5
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %7
%13 = load i8*, i8** %5
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp sle i32 %15, 32
br label %17
17: ; preds = %12, %7
%18 = phi i1 [ false, %7 ], [ %16, %12 ]
br i1 %18, label %19, label %23
19: ; preds = %17
br label %20
20: ; preds = %19
%21 = load i8*, i8** %5
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %5
br label %7
23: ; preds = %17
%24 = load i8*, i8** %5
%25 = load i8, i8* %24
%26 = icmp ne i8 %25, 0
br i1 %26, label %30, label %27
27: ; preds = %23
%28 = load i8*, i8** %3
%29 = call i32 @syntax(i8* %28)
br label %30
30: ; preds = %27, %23
br label %31
31: ; preds = %36, %30
%32 = load i8*, i8** %5
%33 = load i8, i8* %32
%34 = sext i8 %33 to i32
%35 = icmp sgt i32 %34, 32
br i1 %35, label %36, label %42
36: ; preds = %31
%37 = load i8*, i8** %5
%38 = getelementptr inbounds i8, i8* %37, i32 1
store i8* %38, i8** %5
%39 = load i8, i8* %37
%40 = load i8*, i8** %4
%41 = getelementptr inbounds i8, i8* %40, i32 1
store i8* %41, i8** %4
store i8 %39, i8* %40
br label %31
42: ; preds = %31
%43 = load i8*, i8** %4
%44 = getelementptr inbounds i8, i8* %43, i32 1
store i8* %44, i8** %4
store i8 0, i8* %43
%45 = load i8*, i8** %5
ret i8* %45
}

LLVM IR (-O2):
define i8* @scan_must(i8* %0, i8* nocapture writeonly %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %9, %3 ]
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
%7 = icmp slt i8 %5, 33
%8 = and i1 %6, %7
%9 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %8, label %3, label %10
10: ; preds = %3
%11 = icmp eq i8 %5, 0
br i1 %11, label %12, label %15
12: ; preds = %10
%13 = tail call i32 @syntax(i8* %0)
%14 = load i8, i8* %4
br label %15
15: ; preds = %12, %10
%16 = phi i8 [ %14, %12 ], [ %5, %10 ]
%17 = icmp sgt i8 %16, 32
br i1 %17, label %18, label %26
18: ; preds = %15, %18
%19 = phi i8 [ %24, %18 ], [ %16, %15 ]
%20 = phi i8* [ %22, %18 ], [ %4, %15 ]
%21 = phi i8* [ %23, %18 ], [ %1, %15 ]
%22 = getelementptr inbounds i8, i8* %20, i64 1
%23 = getelementptr inbounds i8, i8* %21, i64 1
store i8 %19, i8* %21
%24 = load i8, i8* %22
%25 = icmp sgt i8 %24, 32
br i1 %25, label %18, label %26
26: ; preds = %18, %15
%27 = phi i8* [ %1, %15 ], [ %23, %18 ]
%28 = phi i8* [ %4, %15 ], [ %22, %18 ]
store i8 0, i8* %27
ret i8* %28
}