#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 */
int EOF;
int fgetc(int /*<<< orphan*/ *);
int getc(int /*<<< orphan*/ *);
int /*<<< orphan*/ putchar(int);
void process(FILE *file) {
  int ch;
  while ((ch = getc(file)) != EOF) {
    if (ch == '>') {
      while ((ch = fgetc(file)) != EOF) {
        if (ch == '<') {
          break;
        }
        putchar(ch);
      }
    }
  }
}


x86 assembly (clang, -O0):
<process>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <getc@plt>
mov    %eax,-0xc(%rbp)
mov    0x2e99(%rip),%rcx
cmp    (%rcx),%eax
je     11a7 <process+0x77>
cmpl   $0x3e,-0xc(%rbp)
jne    11a2 <process+0x72>
jmp    1166 <process+0x36>
mov    -0x8(%rbp),%rdi
call   1040 <fgetc@plt>
mov    %eax,-0xc(%rbp)
mov    0x2e6f(%rip),%rcx
cmp    (%rcx),%eax
je     119d <process+0x6d>
cmpl   $0x3c,-0xc(%rbp)
jne    1190 <process+0x60>
jmp    119d <process+0x6d>
mov    -0xc(%rbp),%edi
call   1030 <putchar@plt>
jmp    1166 <process+0x36>
jmp    11a2 <process+0x72>
jmp    113c <process+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1050 <getc@plt>
mov    0x2ea5(%rip),%r14
jmp    1158 <process+0x28>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbx,%rdi
call   1050 <getc@plt>
cmp    (%r14),%eax
je     118b <process+0x5b>
cmp    $0x3e,%eax
jne    1150 <process+0x20>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1040 <fgetc@plt>
cmp    $0x3c,%eax
je     1150 <process+0x20>
cmp    (%r14),%eax
je     1150 <process+0x20>
mov    %eax,%edi
call   1030 <putchar@plt>
jmp    1170 <process+0x40>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EOF = global i32 0
define void @process(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
br label %4
4: ; preds = %26, %1
%5 = load i32*, i32** %2
%6 = call i32 @getc(i32* %5)
store i32 %6, i32* %3
%7 = load i32, i32* @EOF
%8 = icmp ne i32 %6, %7
br i1 %8, label %9, label %27
9: ; preds = %4
%10 = load i32, i32* %3
%11 = icmp eq i32 %10, 62
br i1 %11, label %12, label %26
12: ; preds = %9
br label %13
13: ; preds = %22, %12
%14 = load i32*, i32** %2
%15 = call i32 @fgetc(i32* %14)
store i32 %15, i32* %3
%16 = load i32, i32* @EOF
%17 = icmp ne i32 %15, %16
br i1 %17, label %18, label %25
18: ; preds = %13
%19 = load i32, i32* %3
%20 = icmp eq i32 %19, 60
br i1 %20, label %21, label %22
21: ; preds = %18
br label %25
22: ; preds = %18
%23 = load i32, i32* %3
%24 = call i32 @putchar(i32 %23)
br label %13
25: ; preds = %21, %13
br label %26
26: ; preds = %25, %9
br label %4
27: ; preds = %4
ret void
}

LLVM IR (-O2):
@EOF = global i32 0
define void @process(i32* nocapture %0) {
%2 = tail call i32 @getc(i32* %0)
%3 = load i32, i32* @EOF
%4 = icmp eq i32 %2, %3
br i1 %4, label %26, label %5
5: ; preds = %1, %22
%6 = phi i32 [ %23, %22 ], [ %2, %1 ]
%7 = icmp eq i32 %6, 62
br i1 %7, label %8, label %22
8: ; preds = %5
%9 = tail call i32 @fgetc(i32* %0)
%10 = load i32, i32* @EOF
%11 = icmp eq i32 %9, %10
%12 = icmp eq i32 %9, 60
%13 = or i1 %12, %11
br i1 %13, label %22, label %14
14: ; preds = %8, %14
%15 = phi i32 [ %17, %14 ], [ %9, %8 ]
%16 = tail call i32 @putchar(i32 %15)
%17 = tail call i32 @fgetc(i32* %0)
%18 = load i32, i32* @EOF
%19 = icmp eq i32 %17, %18
%20 = icmp eq i32 %17, 60
%21 = or i1 %20, %19
br i1 %21, label %22, label %14
22: ; preds = %14, %8, %5
%23 = tail call i32 @getc(i32* %0)
%24 = load i32, i32* @EOF
%25 = icmp eq i32 %23, %24
br i1 %25, label %26, label %5
26: ; preds = %22, %1
ret void
}