#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 temp; fscanf(in, "%c", &temp) != EOF;) {
    if (temp > 64 && temp < 91) {
      fprintf(out, "%c", temp + 32);
    } else {
      fprintf(out, "%c", temp);
    }
  }
  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     11f4 <main+0xb4>
movsbl -0x19(%rbp),%eax
cmp    $0x40,%eax
jle    11d9 <main+0x99>
movsbl -0x19(%rbp),%eax
cmp    $0x5b,%eax
jge    11d9 <main+0x99>
mov    -0x18(%rbp),%rdi
movsbl -0x19(%rbp),%edx
add    $0x20,%edx
lea    0xe48(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
jmp    11ef <main+0xaf>
mov    -0x18(%rbp),%rdi
movsbl -0x19(%rbp),%edx
lea    0xe2d(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
jmp    117d <main+0x3d>
mov    -0x18(%rbp),%rdi
lea    0xe19(%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
je     11dd <main+0x9d>
lea    0xe74(%rip),%r15
lea    0xf(%rsp),%r12
cs nopw 0x0(%rax,%rax,1)
movsbl 0xf(%rsp),%eax
lea    -0x41(%rax),%ecx
lea    0x20(%rax),%edi
cmp    $0x1a,%cl
cmovae %eax,%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
jne    11b0 <main+0x70>
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

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 = %31, %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 %32
12: ; preds = %7
%13 = load i8, i8* %4
%14 = sext i8 %13 to i32
%15 = icmp sgt i32 %14, 64
br i1 %15, label %16, label %26
16: ; preds = %12
%17 = load i8, i8* %4
%18 = sext i8 %17 to i32
%19 = icmp slt i32 %18, 91
br i1 %19, label %20, label %26
20: ; preds = %16
%21 = load i32*, i32** %3
%22 = load i8, i8* %4
%23 = sext i8 %22 to i32
%24 = add nsw i32 %23, 32
%25 = call i32 (i32*, i8*, ...) @fprintf(i32* %21, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %24)
br label %31
26: ; preds = %16, %12
%27 = load i32*, i32** %3
%28 = load i8, i8* %4
%29 = sext i8 %28 to i32
%30 = call i32 (i32*, i8*, ...) @fprintf(i32* %27, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %29)
br label %31
31: ; preds = %26, %20
br label %7
32: ; preds = %7
%33 = load i32*, i32** %3
%34 = call i32 (i32*, i8*, ...) @fprintf(i32* %33, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%35 = load i32*, i32** %2
%36 = call i32 @fclose(i32* %35)
%37 = load i32*, i32** %3
%38 = call i32 @fclose(i32* %37)
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 = %11, %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, %11
%12 = load i8, i8* %1
%13 = sext i8 %12 to i32
%14 = add i8 %12, -65
%15 = icmp ult i8 %14, 26
%16 = add nsw i32 %13, 32
%17 = select i1 %15, i32 %16, i32 %13
%18 = call i32 @fputc(i32 %17, i32* %3)
%19 = call i64 @fscanf(i32* %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %1)
%20 = load i64, i64* @EOF
%21 = icmp eq i64 %19, %20
br i1 %21, label %7, label %11
}