#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 */
scalar_t__ EOF;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
scalar_t__ fscanf(int /*<<< orphan*/ *, char *, char *);
int main() {
  FILE *in = fopen("task.in", "r");
  FILE *out = fopen("task.out", "w");
  for (char symbol; fscanf(in, "%c", &symbol) != EOF;) {
    if (symbol >= 97 && symbol <= 122) {
      symbol -= 32;
    }
    fprintf(out, "%c", symbol);
  }
  fprintf(out, "\n");
  fclose(in);
  fclose(out);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
lea    0xeab(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x10(%rbp)
lea    0xe9d(%rip),%rdi
lea    0xe9f(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe8d(%rip),%rsi
lea    -0x19(%rbp),%rdx
call   1040 <fscanf@plt>
mov    0x2e50(%rip),%rcx
cmp    (%rcx),%rax
je     11e0 <main+0xa0>
movsbl -0x19(%rbp),%eax
cmp    $0x61,%eax
jl     11c5 <main+0x85>
movsbl -0x19(%rbp),%eax
cmp    $0x7a,%eax
jg     11c5 <main+0x85>
movsbl -0x19(%rbp),%eax
sub    $0x20,%eax
mov    %al,-0x19(%rbp)
mov    -0x18(%rbp),%rdi
movsbl -0x19(%rbp),%edx
lea    0xe41(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
jmp    117d <main+0x3d>
mov    -0x18(%rbp),%rdi
lea    0xe2d(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xeac(%rip),%rdi
lea    0xead(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%r14
lea    0xea0(%rip),%rdi
lea    0xea2(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%rbx
lea    0xe95(%rip),%rsi
lea    0xf(%rsp),%rdx
mov    %r14,%rdi
call   1040 <fscanf@plt>
mov    0x2e54(%rip),%r13
cmp    0x0(%r13),%rax
jne    11c7 <main+0x87>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1050 <fputc@plt>
mov    %r14,%rdi
call   1030 <fclose@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret
lea    0xe47(%rip),%r15
lea    0xf(%rsp),%r12
jmp    11ff <main+0xbf>
cs nopw 0x0(%rax,%rax,1)
nop
movsbl %al,%edi
mov    %rbx,%rsi
call   1050 <fputc@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1040 <fscanf@plt>
cmp    0x0(%r13),%rax
je     119a <main+0x5a>
movzbl 0xf(%rsp),%eax
lea    -0x61(%rax),%ecx
cmp    $0x19,%cl
ja     11e0 <main+0xa0>
add    $0xe0,%al
mov    %al,0xf(%rsp)
jmp    11e0 <main+0xa0>

LLVM IR (-O0):
@.str = [8 x i8] c"task.in\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [9 x i8] c"task.out\00"
@.str.3 = [2 x i8] c"w\00"
@.str.4 = [3 x i8] c"%c\00"
@EOF = global i64 0
@.str.5 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i8
store i32 0, i32* %1
%5 = call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %5, i32** %2
%6 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %6, i32** %3
br label %7
7: ; preds = %25, %0
%8 = load i32*, i32** %2
%9 = call i64 @fscanf(i32* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %4)
%10 = load i64, i64* @EOF
%11 = icmp ne i64 %9, %10
br i1 %11, label %12, label %30
12: ; preds = %7
%13 = load i8, i8* %4
%14 = sext i8 %13 to i32
%15 = icmp sge i32 %14, 97
br i1 %15, label %16, label %25
16: ; preds = %12
%17 = load i8, i8* %4
%18 = sext i8 %17 to i32
%19 = icmp sle i32 %18, 122
br i1 %19, label %20, label %25
20: ; preds = %16
%21 = load i8, i8* %4
%22 = sext i8 %21 to i32
%23 = sub nsw i32 %22, 32
%24 = trunc i32 %23 to i8
store i8 %24, i8* %4
br label %25
25: ; preds = %20, %16, %12
%26 = load i32*, i32** %3
%27 = load i8, i8* %4
%28 = sext i8 %27 to i32
%29 = call i32 (i32*, i8*, ...) @fprintf(i32* %26, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %28)
br label %7
30: ; preds = %7
%31 = load i32*, i32** %3
%32 = call i32 (i32*, i8*, ...) @fprintf(i32* %31, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%33 = load i32*, i32** %2
%34 = call i32 @fclose(i32* %33)
%35 = load i32*, i32** %3
%36 = call i32 @fclose(i32* %35)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"task.in\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [9 x i8] c"task.out\00"
@.str.3 = [2 x i8] c"w\00"
@.str.4 = [3 x i8] c"%c\00"
@EOF = global i64 0
define i32 @main() {
%1 = alloca i8
%2 = tail call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%4 = call i64 @fscanf(i32* %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %1)
%5 = load i64, i64* @EOF
%6 = icmp eq i64 %4, %5
br i1 %6, label %7, label %11
7: ; preds = %17, %0
%8 = call i32 @fputc(i32 10, i32* %3)
%9 = call i32 @fclose(i32* %2)
%10 = call i32 @fclose(i32* %3)
ret i32 0
11: ; preds = %0, %17
%12 = load i8, i8* %1
%13 = add i8 %12, -97
%14 = icmp ult i8 %13, 26
br i1 %14, label %15, label %17
15: ; preds = %11
%16 = add nsw i8 %12, -32
store i8 %16, i8* %1
br label %17
17: ; preds = %15, %11
%18 = phi i8 [ %16, %15 ], [ %12, %11 ]
%19 = sext i8 %18 to i32
%20 = call i32 @fputc(i32 %19, i32* %3)
%21 = call i64 @fscanf(i32* %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %1)
%22 = load i64, i64* @EOF
%23 = icmp eq i64 %21, %22
br i1 %23, label %7, label %11
}