#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char fgetc(int /*<<< orphan*/ *);
void ScanValue(FILE *Handle, char *Value) {
  short i;
  while (fgetc(Handle) != '<')
    ;
  i = 0;
  while ((Value[i] = fgetc(Handle)) != '>')
    i++;
  Value[i] = '\0';
}


x86 assembly (clang, -O0):
<ScanValue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
movsbl %al,%eax
cmp    $0x3c,%eax
je     113a <ScanValue+0x2a>
jmp    1120 <ScanValue+0x10>
movw   $0x0,-0x12(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    -0x10(%rbp),%rcx
movswq -0x12(%rbp),%rdx
mov    %al,(%rcx,%rdx,1)
movsbl %al,%eax
cmp    $0x3e,%eax
je     1172 <ScanValue+0x62>
mov    -0x12(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x12(%rbp)
jmp    1140 <ScanValue+0x30>
mov    -0x10(%rbp),%rax
movswq -0x12(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ScanValue>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
call   1030 <fgetc@plt>
cmp    $0x3c,%al
jne    1120 <ScanValue+0x10>
xor    %ebx,%ebx
xchg   %ax,%ax
mov    %r15,%rdi
call   1030 <fgetc@plt>
movswq %bx,%rcx
mov    %al,(%r14,%rcx,1)
add    $0x1,%ebx
cmp    $0x3e,%al
jne    1130 <ScanValue+0x20>
movb   $0x0,(%r14,%rcx,1)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @ScanValue(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
%5 = alloca i16
store i32* %0, i32** %3
store i8* %1, i8** %4
br label %6
6: ; preds = %11, %2
%7 = load i32*, i32** %3
%8 = call signext i8 @fgetc(i32* %7)
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 60
br i1 %10, label %11, label %12
11: ; preds = %6
br label %6
12: ; preds = %6
store i16 0, i16* %5
br label %13
13: ; preds = %22, %12
%14 = load i32*, i32** %3
%15 = call signext i8 @fgetc(i32* %14)
%16 = load i8*, i8** %4
%17 = load i16, i16* %5
%18 = sext i16 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
store i8 %15, i8* %19
%20 = sext i8 %15 to i32
%21 = icmp ne i32 %20, 62
br i1 %21, label %22, label %25
22: ; preds = %13
%23 = load i16, i16* %5
%24 = add i16 %23, 1
store i16 %24, i16* %5
br label %13
25: ; preds = %13
%26 = load i8*, i8** %4
%27 = load i16, i16* %5
%28 = sext i16 %27 to i64
%29 = getelementptr inbounds i8, i8* %26, i64 %28
store i8 0, i8* %29
ret void
}

LLVM IR (-O2):
define void @ScanValue(i32* nocapture %0, i8* nocapture writeonly %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call signext i8 @fgetc(i32* %0)
%5 = icmp eq i8 %4, 60
br i1 %5, label %6, label %3
6: ; preds = %3, %6
%7 = phi i16 [ %12, %6 ], [ 0, %3 ]
%8 = tail call signext i8 @fgetc(i32* %0)
%9 = sext i16 %7 to i64
%10 = getelementptr inbounds i8, i8* %1, i64 %9
store i8 %8, i8* %10
%11 = icmp eq i8 %8, 62
%12 = add i16 %7, 1
br i1 %11, label %13, label %6
13: ; preds = %6
%14 = getelementptr inbounds i8, i8* %1, i64 %9
store i8 0, i8* %14
ret void
}