#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*/ buff;

/* Variables and functions */
scalar_t__ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ rfc2047_decode(char *, char *, int);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
int main(int argc, char *argv[]) {
  char buff[2048];
  while (fgets(buff, sizeof(buff), stdin)) {
    rfc2047_decode(buff, buff, sizeof(buff));
    fputs(buff, stdout);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x810,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x810(%rbp),%rdi
mov    0x2e91(%rip),%rax
mov    (%rax),%edx
mov    $0x800,%esi
call   1040 <fgets@plt>
cmp    $0x0,%rax
je     119f <main+0x6f>
lea    -0x810(%rbp),%rdi
lea    -0x810(%rbp),%rsi
mov    $0x800,%edx
call   1050 <rfc2047_decode@plt>
lea    -0x810(%rbp),%rdi
mov    0x2e45(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
jmp    1149 <main+0x19>
xor    %eax,%eax
add    $0x810,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x800,%rsp
mov    0x2ea5(%rip),%r14
mov    (%r14),%edx
mov    %rsp,%rdi
mov    $0x800,%esi
call   1040 <fgets@plt>
test   %rax,%rax
je     11a0 <main+0x70>
mov    %rsp,%rbx
mov    0x2e76(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    %rbx,%rsi
mov    $0x800,%edx
call   1050 <rfc2047_decode@plt>
mov    (%r15),%esi
mov    %rbx,%rdi
call   1030 <fputs@plt>
mov    (%r14),%edx
mov    %rbx,%rdi
mov    $0x800,%esi
call   1040 <fgets@plt>
test   %rax,%rax
jne    1170 <main+0x40>
xor    %eax,%eax
add    $0x800,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stdin = global i32 0
@stdout = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [2048 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %7
7: ; preds = %12, %2
%8 = getelementptr inbounds [2048 x i8], [2048 x i8]* %6, i64 0, i64 0
%9 = load i32, i32* @stdin
%10 = call i64 @fgets(i8* %8, i32 2048, i32 %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %19
12: ; preds = %7
%13 = getelementptr inbounds [2048 x i8], [2048 x i8]* %6, i64 0, i64 0
%14 = getelementptr inbounds [2048 x i8], [2048 x i8]* %6, i64 0, i64 0
%15 = call i32 @rfc2047_decode(i8* %13, i8* %14, i32 2048)
%16 = getelementptr inbounds [2048 x i8], [2048 x i8]* %6, i64 0, i64 0
%17 = load i32, i32* @stdout
%18 = call i32 @fputs(i8* %16, i32 %17)
br label %7
19: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@stdout = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [2048 x i8]
%4 = getelementptr inbounds [2048 x i8], [2048 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* @stdin
%6 = call i64 @fgets(i8* %4, i32 2048, i32 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %15, label %8
8: ; preds = %2, %8
%9 = call i32 @rfc2047_decode(i8* %4, i8* %4, i32 2048)
%10 = load i32, i32* @stdout
%11 = call i32 @fputs(i8* %4, i32 %10)
%12 = load i32, i32* @stdin
%13 = call i64 @fgets(i8* %4, i32 2048, i32 %12)
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %8
15: ; preds = %8, %2
ret i32 0
}