#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 /*<<< orphan*/ converte_entidade(int /*<<< orphan*/ *,
                                     int /*<<< orphan*/ *);
char fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char);
void escreveTweet(FILE *arqin, FILE *arqout) {
  char c = fgetc(arqin);
  while (c != '<') {
    if (c == '&')
      converte_entidade(arqin, arqout);
    else
      fprintf(arqout, "%c", c);
    c = fgetc(arqin);
  }
}


x86 assembly (clang, -O0):
<escreveTweet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %al,-0x11(%rbp)
movsbl -0x11(%rbp),%eax
cmp    $0x3c,%eax
je     119d <escreveTweet+0x6d>
movsbl -0x11(%rbp),%eax
cmp    $0x26,%eax
jne    1178 <escreveTweet+0x48>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <converte_entidade@plt>
jmp    118c <escreveTweet+0x5c>
mov    -0x10(%rbp),%rdi
lea    0xe7d(%rip),%rsi
movsbl -0x11(%rbp),%edx
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %al,-0x11(%rbp)
jmp    114c <escreveTweet+0x1c>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<escreveTweet>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
jmp    114b <escreveTweet+0x1b>
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <converte_entidade@plt>
mov    %rbx,%rdi
call   1030 <fgetc@plt>
cmp    $0x26,%al
je     1140 <escreveTweet+0x10>
cmp    $0x3c,%al
je     1168 <escreveTweet+0x38>
movsbl %al,%edi
mov    %r14,%rsi
call   1040 <fputc@plt>
jmp    114b <escreveTweet+0x1b>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define void @escreveTweet(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i8
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = call signext i8 @fgetc(i32* %6)
store i8 %7, i8* %5
br label %8
8: ; preds = %24, %2
%9 = load i8, i8* %5
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 60
br i1 %11, label %12, label %27
12: ; preds = %8
%13 = load i8, i8* %5
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 38
br i1 %15, label %16, label %20
16: ; preds = %12
%17 = load i32*, i32** %3
%18 = load i32*, i32** %4
%19 = call i32 @converte_entidade(i32* %17, i32* %18)
br label %24
20: ; preds = %12
%21 = load i32*, i32** %4
%22 = load i8, i8* %5
%23 = call i32 @fprintf(i32* %21, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %22)
br label %24
24: ; preds = %20, %16
%25 = load i32*, i32** %3
%26 = call signext i8 @fgetc(i32* %25)
store i8 %26, i8* %5
br label %8
27: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @escreveTweet(i32* %0, i32* %1) {
br label %3
3: ; preds = %10, %2
%4 = tail call signext i8 @fgetc(i32* %0)
switch i8 %4, label %7 [
i8 60, label %11
i8 38, label %5
]
5: ; preds = %3
%6 = tail call i32 @converte_entidade(i32* %0, i32* %1)
br label %10
7: ; preds = %3
%8 = sext i8 %4 to i32
%9 = tail call i32 @fputc(i32 %8, i32* %1)
br label %10
10: ; preds = %7, %5
br label %3
11: ; preds = %3
ret void
}